![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, i have inserted a polygon with points into a mysql database. Now how can i retrieve back the points associated with this polygon? |
#3
| |||
| |||
|
|
shashi kanth <dskanth... (AT) gmail (DOT) com> writes: Hi, i have inserted a polygon with points into a mysql database. Now how can i retrieve back the points associated with this polygon? How did you insert them? sherm-- -- Sherm Pendley * * * * * * * * * * * * * * * * * *<http://camelbones.sourceforge.net Cocoa Developer |
#4
| |||
| |||
|
|
On Feb 24, 7:37Â*pm, Sherm Pendley <sherm.pend... (AT) gmail (DOT) com> wrote: shashi kanth <dskanth... (AT) gmail (DOT) com> writes: Hi, i have inserted a polygon with points into a mysql database. Now how can i retrieve back the points associated with this polygon? How did you insert them? Hi, first i created the table like this: CREATE TABLE geom (g GEOMETRY); And i inserted a polygon into it, using the following syntax: INSERT INTO geom (g) VALUES(PolygonFromText('POLYGON(( 9.190586853 45.464518970, 9.190602686 45.463993916, 9.191572471 45.464001929, 9.191613325 45.463884676, 9.192136130 45.463880767, 9.192111509 45.464095594, 9.192427961 45.464117804, 9.192417811 45.464112862, 9.192509035 45.464225851, 9.192493139 45.464371079, 9.192448471 45.464439002, 9.192387444 45.464477861, 9.192051402 45.464483037, 9.192012814 45.464643592, 9.191640825 45.464647090, 9.191622331 45.464506215, 9.190586853 45.464518970))') ); |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Well, i could get a string format of the polygon vertices using: SELECT cast(AsText(g) as char) AS points FROM geom |
#8
| |||
| |||
|
|
Hi, i have inserted a polygon with points into a mysql database. Now how can i retrieve back the points associated with this polygon? (hopefully in WKT format). What i want to do is to check whether a point lies inside polygon, and for doing this, i hope i need the vertices of the polygon. Please help. |
#9
| |||
| |||
|
|
Hi, i have inserted a polygon with points into a mysql database. Now how can i retrieve back the points associated with this polygon? (hopefully in WKT format). What i want to do is to check whether a point lies inside polygon, and for doing this, i hope i need the vertices of the polygon. |
|
n | p | +----+---------------------------------+ 1 | POINT(9.190586853 45.46451897) | 2 | POINT(9.190602686 45.463993916) | 3 | POINT(9.191572471 45.464001929) | 4 | POINT(9.191613325 45.463884676) | 5 | POINT(9.19213613 45.463880767) | 6 | POINT(9.192111509 45.464095594) | 7 | POINT(9.192427961 45.464117804) | 8 | POINT(9.192417811 45.464112862) | 9 | POINT(9.192509035 45.464225851) | 10 | POINT(9.192493139 45.464371079) | 11 | POINT(9.192448471 45.464439002) | 12 | POINT(9.192387444 45.464477861) | 13 | POINT(9.192051402 45.464483037) | 14 | POINT(9.192012814 45.464643592) | 15 | POINT(9.191640825 45.46464709) | 16 | POINT(9.191622331 45.464506215) | 17 | POINT(9.190586853 45.46451897) | +----+---------------------------------+ |
![]() |
| Thread Tools | |
| Display Modes | |
| |