Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This question already has an answer here:

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?.

share|improve this question

marked as duplicate by RyanDalton, Devdatta Tengshe, Zachary, iant, whuber Feb 26 '13 at 13:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 1 down vote accepted

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);

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.