0

I have the current location stored inside 2 double values. In my database, I have list of locations, each with latitude and longitude. How do I get the list of locations which is (let's say) 3 kilometers from my current location?

For example, this is the data inside my database:

Location | Latitude | Longitude
AAA      |  1.555   | 0.56767
BBB      | 2.33     | 3.444
CCC      | 1.000    | 2.44

What kind of calculation should I do?

DNA
  • 42,007
  • 12
  • 107
  • 146
imin
  • 4,504
  • 13
  • 56
  • 103
  • 3
    This question, of calculating a great-circle distance between Earth surface points, is nearly an FAQ here on SO. Before calculating, review some of the good Qs and As knocking around hereabouts. – High Performance Mark May 11 '15 at 15:46
  • You can find the answer previously answered here http://stackoverflow.com/questions/808963/finding-cities-within-x-kilometers-or-miles – ChoclateLove May 11 '15 at 15:52

0 Answers0