0

I insert the values from lat/long into the points. Those users move around and send me new Lat/long and of course , I made an update of the position.

I need to find people that are in a distance less than 100Km, which is the best approach to do that?.

RyanKDalton
  • 23,068
  • 17
  • 110
  • 178

1 Answers1

1

You could use St_DWithin

http://postgis.net/docs/ST_DWithin.html

This will enable you to find points within a set distance

I believe this is what you are after as an example from the PostGIS manual

SELECT * FROM geotable WHERE ST_DWithin(geocolumn, 'POINT(1000 1000)', 100.0);

Paul Ramsey
  • 19,865
  • 1
  • 47
  • 57
tjmgis
  • 3,330
  • 1
  • 23
  • 37