[postgis-users] PostGIS returns no rows for ST_Intersects

Meherzad Romer mromer at natureserve.ca
Wed Oct 12 20:16:43 PDT 2011

I am new to PostGIS, have only been using it for the last couple of weeks.
 I have been using the workshops.opengeo website to learn how to use PostGIS
and am working with the sample NYC database that it came with.  I am trying
to test how the ST_Intersect function works so that I can use it on a real
database, but am not getting any rows returned.
Here's what I did:
1.  I created a polygon in Google Earth that covers the entire NY state and
then, saved it as a KML.
2.  I opened the KML in a text editor used the coordinates to get a geometry
using the ST_GeomFromKML function in PostGIS.  The query looks like this:
SELECT ST_GeomFromKML(' <Polygon>
-75.7218231334201,40.86468238402224,0 -74.91763291540505,39.90090726204763,0
-71.50935163152492,39.85541359103798,0 -71.6577861052406,41.55717566179406,0
-74.71588104333701,41.6603205817405,0 -75.7218231334201,40.86468238402224,0

3.  When I ran it the resulting geometry was:

4. I copied this into another sql and used the ST_Intersects function, the
query is:
SELECT gid, id, "name", oneway, "type", the_geom
  FROM nyc_streets
  where st_intersects (the_geom,

5.  I expect to get every single street in the result, however I don't get
any rows returned.

What am I doing wrong?

Please help!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111012/f0a2f73d/attachment.html>

More information about the postgis-users mailing list