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