<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. </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 21 janv. 2021 22:20, liglio.pessoal@nexxa.com.br a écrit :<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> </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> </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 >= '2019-11-01 00:00:00' <b>AND </b>f.din_point < '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 >= '2019-11-01 00:00:00' <b>AND </b>f.din_point < '2019-12-01 00:00:00'<br><br><br></span><span style="font-size:9pt;font-family:'courier new'"></span></p><p> </p><p>Regards,</p><p> </p><p>Liglio</p><p> </p></div></div></blockquote></div><br></div></div></div>