0

I have in my DB addresses with lat and lng coordinates. I would like to find all the addresses that are distant less than, for example, 10km from a given point.

For the geolocation of the addresses, I use openstreetmap nominatim.

Is there any PHP library to do that ? Or a simple calculation ?

Thanks all !

EDIT : I can't use a method to calculate the distance between two points as I don't know the first point (that will be the adresse of the person searching for other adresses). If I use this method, this means that I must take EACH point in the database (which can be a lot !) and compare it to the address given. This would be too long. I would like a method to know the limit coordinates of the circle : for example, if I know that the limit of the circle are : lat(12, 20) and lng(-3, 7), I can search in my db all the coordinate where 12 < lat < 20 and -3 < lng <7. (These coordinates are examples, I don't even know if they are possible :))

wyllyjon
  • 505
  • 1
  • 5
  • 20
  • 1
    Big topic jumpin here: http://stackoverflow.com/questions/1006654/fastest-way-to-find-distance-between-two-lat-long-points#1006668 – JustOnUnderMillions Jan 30 '17 at 14:48
  • 5
    Possible duplicate of [Fastest Way to Find Distance Between Two Lat/Long Points](http://stackoverflow.com/questions/1006654/fastest-way-to-find-distance-between-two-lat-long-points) – Hokascha Jan 30 '17 at 14:48
  • Answer in edition of my question – wyllyjon Jan 31 '17 at 10:42

0 Answers0