[postgis-users] Use of ST_DWithin

liglio.pessoal at nexxa.com.br liglio.pessoal at nexxa.com.br
Thu Jan 21 13:09:44 PST 2021


Hi,

 

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?

 

SELECT count(*)
FROM tb_line as b, tb_point as f
WHERE ST_DWithin(f.point_geom, b.line_geom,2163, 60000)
AND b.id 'XPTO1'
AND f.din_point >= '2019-11-01 00:00:00' AND f.din_point < '2019-12-01
00:00:00'



OR


SELECT count(*)
FROM tb_line as b, tb_point as f
WHERE ST_DWithin(ST_Transform(f.point_geom,2163),
ST_Transform(b.line_geom,2163), 60000)
AND b.id 'XPTO1'
AND f.din_point >= '2019-11-01 00:00:00' AND f.din_point < '2019-12-01
00:00:00'




 

Regards,

 

Liglio

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20210121/dbed27ac/attachment.html>


More information about the postgis-users mailing list