[postgis-users] Quick way to query table for 'intersects'?

Andreas ml at 3.141592654.de
Tue Dec 22 18:16:29 PST 2009


Hi Robert,

> I am trying to find the quickest way to query a table in my
> database and grab only the records that have a geom that intersects
> with another geom. 

Not sure if I got your question right. Perhaps the spatial predicate ST_Intersects(geom1, geom2) may be sufficient [1]? Something like this:

SELECT ... FROM your_table WHERE ST_Intersects(the_geom, ST_GeomFromText('your WKT here', srid))

Best regards,
Andreas 

[1] http://postgis.refractions.net/docs/ST_Intersects.html



More information about the postgis-users mailing list