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.

If I have two LatLongs, what is the best way to determine if the first one is within a 10 mile radius of the second?

share|improve this question
2  
Duplicate of: gis.stackexchange.com/questions/2/… –  Rowland Shaw Jul 30 '10 at 12:07
1  
Voting to close as an exact duplicate. –  whuber Mar 10 '11 at 2:11

1 Answer 1

up vote 3 down vote accepted

The following thread provides algorithms for calculating distance between lat/long coordinate pairs. http://gis.stackexchange.com/questions/2/how-do-i-find-the-distance-between-two-coordinates

After that, just do a conditional, like: if (distance <= 10):

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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