[postgis-users] Fwd: Reg: Get features in a bounding box

Manikanta Kondeti mani.iiit123 at gmail.com
Sun Nov 27 08:23:28 PST 2016


Andy & Regina,

Thanks for the help.  I've tried in two ways as given below, I thought the
first one is the query needed, but the results are a little different,
while second one gave accurate results.

1. plots.geom &&  ST_MakeEnvelope(80.478328, 16.504874, 80.478922,
16.505413, 4326)
2. ST_Intersects(ST_MakeEnvelope(80.478328, 16.504874, 80.478922,
16.505413, 4326), plots.geom))



On Sun, Nov 27, 2016 at 9:05 PM, Regina Obe <lr at pcorp.us> wrote:

> Manikanta,
>
>
>
> Easiest way is to use the ST_MakeEnvelope function to convert your mins
> and maxes to a geometry.
>
>
>
> http://postgis.net/docs/ST_MakeEnvelope.html
>
>
>
> SELECT t.name, t.geom
>
> FROM  t
>
> WHERE ST_Intersects(t.geom, ST_MakeEnvelope(MIN-X, MIN-Y, MAX-X,
> MAX-Y,SRID) );
>
>
>
> Where the upper case I have you replace with your variables and t replace
> with your table name.
>
> If you want completely enclosed, replace ST_Intersects with ST_CoveredBy
>
>
>
>
>
> Hope that helps,
>
> Regina
>
> http://www.postgis.us
>
> http://postgis.net
>
>
>
>
>
>
>
>
>
>
>
> *From:* postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] *On
> Behalf Of *Manikanta Kondeti
> *Sent:* Saturday, November 26, 2016 3:16 PM
> *To:* postgis-users at lists.osgeo.org
> *Subject:* [postgis-users] Fwd: Reg: Get features in a bounding box
>
>
>
>
>
> Hello,
>
>
>
>  I have almost empty knowledge on postgis queries and trying to learn
> them. I beg your pardon if its a very simple question.
>
>
>
>   So here it is in my current project, as the subject says, I have a list
> of bounding box cooridnates, MIN-X, MIN-Y, MAX-X MAX-Y with the same SRID
> of the geom column. Now I want to query the list of features that are
> enclosed in this bounding box. Awaiting for a reply, thanks in advance.
>
>
>
>
>
> Regards,
>
> Manikanta
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20161127/62f76428/attachment.html>


More information about the postgis-users mailing list