Hi Ed,

Yeah, I would suggest to use ST_MakeEnvelope (which was also one of the 
suggestions by Francois Hugues).

The query would look something like this:
SELECT * FROM myschema.mylinestringtable WHERE ST_Intersects(geom, 
ST_MakeEnvelope(155000, 463000, 156000, 464000, 28992));

N.B. The fifht argument for ST_MakeEnvelope is the SRID of 
'mylinestringtable'.

HTH,

Egge-Jan
http://twiav-tt.blogspot.nl/


On Friday, July 13, 2012 3:32:59 PM UTC+2, Francois Hugues wrote:
>
>
> Coordinates of a rectangle, you mean of thé points at the corners ? 
>
> You should try st_makepolygon(st_makeline()) or st_makeenvelope. 
>
> Postgis manual is very useful, you should also try it to learn how these 
> function work and which one is tthe better one for you 
>
> Hugues 
>
>
> ----- Message d'origine-------- 
> De: postgis-users-boun...@postgis.refractions.net de la part de Ed Linde 
> Date:7/2012 14 
> À: PostGIS Users Discussion 
> Objet : [postgis-users] Bounding Box intersection 
>   
> 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? 
>
> Cheers,o 
> Ed 
>
>
> _______________________________________________ 
> postgis-users mailing list 
> postgis-users@postgis.refractions.net 
> http://postgis.refractions.net/mailman/listinfo/postgis-users 
>
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to