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:[email protected]] On Behalf Of 
Manikanta Kondeti
Sent: Saturday, November 26, 2016 3:16 PM
To: [email protected]
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
[email protected]
http://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to