[postgis-users] SQL Loop using ST_Within()H

diplonics paulcaz80 at hotmail.com
Sat Apr 4 09:16:21 PDT 2009


Hi,
 I have two geometry tabels, one with four points and the other with 70,000
polygons. I want to return all the polygons that contain the four points. I
can easily do this with:

SELECT * FROM polygonTable
WHERE ST_Within((SELECT the_geom FROM PointTable WHERE gid = 3),
polygon_geom);

Is there a way to perform this query in a loop so that I don't have to
change the nested select statement for every point id i need to test.
Any help appreciated, and thanks in advance.

Diplonics
-- 
View this message in context: http://www.nabble.com/SQL-Loop-using-ST_Within%28%29H-tp22885062p22885062.html
Sent from the PostGIS - User mailing list archive at Nabble.com.




More information about the postgis-users mailing list