<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EstiloDeEmail17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT-BR link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>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?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>SELECT count</span></b><span lang=EN-US style='font-size:9.0pt;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><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>OR<o:p></o:p></span></p><p class=MsoNormal style='background:white;text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Times New Roman",serif;color:black'><br></span><b><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:black'>SELECT count</span></b><span lang=EN-US style='font-size:9.0pt;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 lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:PT-BR'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:PT-BR'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:PT-BR'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:PT-BR'>Liglio<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>