[postgis-users] Point in Polygon Problem
Marcos Paul
marcospaulgerardo at gmail.com
Thu Oct 21 23:37:16 PDT 2010
Hi Folks,
I am trying to solve a simple problem: the point in polygon. First of all, I
have a CSV file with the polygons in list similar to the WKT Format, that is
something like:
BUILT_UP_AREA_ID VERTEX_SEQ LATITUDE LONGITUDE 1081 0 152.6657 -25.5206
1081 1 152.6662 -25.5211 1081 2 152.6666 -25.5216 1081 3 152.6673 -25.5224
1081 4 152.668 -25.523 1081 5 152.6694 -25.5247 1081 6 152.67 -25.5255
1081 7 152.6707 -25.5263 1081 8 152.6734 -25.5291 1081 9 152.6741 -25.5295
1081 10 152.6745 -25.5299 1081 11 152.675 -25.5301 1081 12 152.676
-25.5313 1081 13 152.6762 -25.5317 1081 14 152.6764 -25.5321 1081 15
152.6764 -25.5333 1081 16 152.6766 -25.534 1081 17 152.6766 -25.5341 1081
18 152.6771 -25.5341 1081 19 152.6774 -25.534 1081 20 152.6788 -25.5354
1081 21 152.6797 -25.5361 1081 22 152.6788 -25.5368
>From there I want to export that to my postgis data base, I solved that
converting the CSV to a Shape file and then applying the shp2psql gui.
When I am trying to check if a particular point is inside my table I am just
applying the following command:
select ST_ASTEXT(the_geom) as multipolygons FROM Table_Polygons WHERE
ST_Contains(Table_Polygons.the_geom, ST_GeometryFromText('POINT(X,Y)'));
So after that, I am getting that the point X,Y is not inside one of the
polygons of my file, when I am completely sure that this point is actually
inside a polygon.
What I am doing wrong? Does the fact that I am using Multipolygons affect
at all?
Thank you for your help,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101022/d5469c64/attachment.html>
More information about the postgis-users
mailing list