[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Use of ST_DWithin
From:       Hugues_François <hugues.francois () inrae ! fr>
Date:       2021-01-22 6:48:17
Message-ID: 947203240.819057.1611298097737.JavaMail.zimbra () zstore-b3-003 ! partage ! renater ! fr
[Download RAW message or body]

[Attachment #2 (text/html)]

<div dir='auto'><div>Hi,<div dir="auto"><br></div><div dir="auto">Yes you have to \
transform your geometry to a spatial reference using meters. You may think about \
adding an additional geometry column or create a temporary table if you want to take \
advantage of the gist index.&nbsp;</div><div dir="auto"><br></div><div \
dir="auto">Regards,</div><div dir="auto">Hug</div><br><div \
class="gmail_extra"><br><div class="gmail_quote">Le&nbsp;21 janv. 2021 22:20, \
liglio.pessoal@nexxa.com.br a écrit&nbsp;:<br type="attribution"><blockquote \
class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div \
style="word-wrap:break-word"><div><p>Hi,</p><p>&nbsp;</p><p>I have to find how many \
points are near (60km) a line. The line and point are both in SRID 4326. Do I have to \
transform to SRID in meters?</p><p>&nbsp;</p><p><b><span \
style="font-size:9pt;font-family:'courier new'">SELECT count</span></b><span \
style="font-size:9pt;font-family:'courier new'">(*)<br><b>FROM </b>tb_line <b>as \
</b>b, tb_point <b>as </b>f<br><b>WHERE </b>ST_DWithin(f.point_geom, \
b.line_geom,2163, 60000)<br><b>AND </b>b.id 'XPTO1'<br><b>AND </b>f.din_point &gt;= \
'2019-11-01 00:00:00' <b>AND </b>f.din_point &lt; '2019-12-01 \
00:00:00'<br><br></span></p><p>OR</p><p style="background:white"><span \
style="font-size:9pt;font-family:'times new roman' , \
serif;color:black"><br></span><b><span style="font-size:9pt;font-family:'courier \
new';color:black">SELECT count</span></b><span \
style="font-size:9pt;font-family:'courier new';color:black">(*)<br><b>FROM \
</b>tb_line <b>as </b>b, tb_point <b>as </b>f<br><b>WHERE \
</b>ST_DWithin(ST_Transform(f.point_geom,2163), ST_Transform(b.line_geom,2163), \
60000)<br><b>AND </b>b.id 'XPTO1'<br><b>AND </b>f.din_point &gt;= '2019-11-01 \
00:00:00' <b>AND </b>f.din_point &lt; '2019-12-01 00:00:00'<br><br><br></span><span \
style="font-size:9pt;font-family:'courier \
new'"></span></p><p>&nbsp;</p><p>Regards,</p><p>&nbsp;</p><p>Liglio</p><p>&nbsp;</p></div></div></blockquote></div><br></div></div></div>




_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://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