Perhaps it's a precision issue? If you parse these into a single precision floating point number, they are equal (all the longitude values anyway-the latitude is only equal on one boundary). Not sure if this would be a PostGIS or PostgreSQL problem.
Arnold From: [email protected] [mailto:[email protected]] On Behalf Of Craig de Stigter Sent: Wednesday, February 23, 2011 15:58 To: [email protected] Subject: [postgis-users] st_intersects() returns false with point and polygon that obviously intersect Hi list This query returns false, but the box and point intersect: select st_intersects('POINT(169.69960846592 -46.5061209281002)'::geometry, 'POLYGON((169.699607857174 -46.5061218662,169.699607857174 -46.5061195965597,169.699608806526 -46.5061195965597,169.699608806526 -46.5061218662,169.699607857174 -46.5061218662))'::geometry); st_intersects --------------- f (1 row) Tested on postgis 1.5.2. postgis_version(): 1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 Using geos via python it works: >>> from django.contrib.gis import geos >>> p = geos.GEOSGeometry('POLYGON((169.699607857174 >>> -46.5061218662,169.699607857174 -46.5061195965597,169.699608806526 >>> -46.5061195965597,169.699608806526 -46.5061218662,169.699607857174 >>> -46.5061218662))') >>> pt = geos.GEOSGeometry('POINT(169.69960846592 -46.5061209281002)') >>> pt.intersects(p) True Any ideas? Thanks Craig de Stigter -- Koordinates Ltd PO Box 1604, Shortland St, Auckland, New Zealand Phone +64-9-966 0433 Fax +64-9-969 0045 Web http://www.koordinates.com
_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
