On 14 July 2012 00:35, Ed Linde <edoli...@gmail.com> wrote:
> Hi All,
> I have a table with linestring geometries, and I have the co-ordinates of a
> rectangle/ bounding box.
> I want to get only a restricted set of geometries that lie within or
> intersect with this box. Is there a
> way to construct this box on the fly and get only the relevant set of
> geometries?

Hi Ed,

You could use ST_MakeEnvelope [1] to make a box on the fly:

SELECT *
FROM roads
WHERE geom && ST_MakeEnvelope(10, 10, 11, 11, 4326);

-Mike

[1] http://postgis.refractions.net/docs/ST_MakeEnvelope.html
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to