[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis-users] Fwd: Reg: Get features in a bounding box
From: Manikanta Kondeti <mani.iiit123 () gmail ! com>
Date: 2016-11-27 16:35:28
Message-ID: CAMxCCEaXnoYJpmTfgZN_MjR+5_VNV1bOvK6wHn6_qvJC1xZLnQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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@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@lists.osgeo.org] *On
> Behalf Of *Manikanta Kondeti
> *Sent:* Saturday, November 26, 2016 3:16 PM
> *To:* postgis-users@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@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
>
[Attachment #5 (text/html)]
<div dir="ltr">Andy & Regina, <div><br></div><div>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. </div><div><br></div><div>1. plots.geom && \
ST_MakeEnvelope(80.478328, 16.504874, 80.478922, 16.505413, 4326)</div><div>2. \
ST_Intersects(ST_MakeEnvelope(80.478328, 16.504874, 80.478922, 16.505413, 4326), \
plots.geom))</div><div><br></div><div><br></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 27, 2016 at 9:05 PM, \
Regina Obe <span dir="ltr"><<a href="mailto:lr@pcorp.us" \
target="_blank">lr@pcorp.us</a>></span> wrote:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div \
lang="EN-US" link="#0563C1" vlink="#954F72"><div \
class="m_-6622698831874772625WordSection1"><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Manikanta,<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Easiest \
way is to use the ST_MakeEnvelope function to convert your mins and maxes to a \
geometry.<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><a \
href="http://postgis.net/docs/ST_MakeEnvelope.html" \
target="_blank">http://postgis.net/docs/ST_<wbr>MakeEnvelope.html</a><u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">SELECT \
<a href="http://t.name" target="_blank">t.name</a>, t.geom<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">FROM \
t<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">WHERE \
ST_Intersects(t.geom, ST_MakeEnvelope(MIN-X, MIN-Y, MAX-X, MAX-Y,SRID) \
);<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Where \
the upper case I have you replace with your variables and t replace with your table \
name.<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">If \
you want completely enclosed, replace ST_Intersects with \
ST_CoveredBy<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hope \
that helps,<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Regina<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><a \
href="http://www.postgis.us" \
target="_blank">http://www.postgis.us</a><u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><a \
href="http://postgis.net" \
target="_blank">http://postgis.net</a><u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal" style="margin-left:.5in"><b><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif"> postgis-users \
[mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" \
target="_blank">postgis-users-bounces@<wbr>lists.osgeo.org</a>] <b>On Behalf Of \
</b>Manikanta Kondeti<br><b>Sent:</b> Saturday, November 26, 2016 3:16 \
PM<br><b>To:</b> <a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br><b>Subject:</b> [postgis-users] \
Fwd: Reg: Get features in a bounding box<u></u><u></u></span></p><div><div \
class="h5"><p class="MsoNormal" style="margin-left:.5in"><u></u> \
<u></u></p><div><div><p class="MsoNormal" style="margin-left:.5in"><u></u> \
<u></u></p><div><p class="MsoNormal" \
style="margin-left:.5in">Hello,<u></u><u></u></p><div><p class="MsoNormal" \
style="margin-left:.5in"><u></u> <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:.5in"> I have almost empty knowledge on postgis queries and \
trying to learn them. I beg your pardon if its a very simple \
question.<u></u><u></u></p></div><div><p class="MsoNormal" \
style="margin-left:.5in"><u></u> <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:.5in"> 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.<u></u><u></u></p></div><div><p class="MsoNormal" \
style="margin-left:.5in"><u></u> <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:.5in"><u></u> <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:.5in">Regards,<u></u><u></u></p></div><div><p class="MsoNormal" \
style="margin-left:.5in">Manikanta <u></u><u></u></p></div></div></div><p \
class="MsoNormal" style="margin-left:.5in"><u></u> \
<u></u></p></div></div></div></div></div><br>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" \
target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
[Attachment #6 (text/plain)]
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic