Google Map Nearest Place Finder Query

Few days ago while i am working on projects where using google map,i face a problem that i have already few place’s in my database with their latitude and longitude,now i need to find nearest place’s depend on a certain distance.That time i found a solution,here i am going to share this how will be query to find nearest place’s in depend on lat,lang.

Google Map Nearest Place Find Query

This is called Haversine formula and the constant 6371 is used to get distance in KM, while 3959 is used to get distance in miles. You can use either of them as per your requirement.
Happy coding!!!

2 Comments

Leave a Reply