Ep

Ep

How to find nearest point using latitude and longitude?

Find nearest latitude and longitude points

In my previous post I explained How to get points inside circle? - Google Maps v3. Here I will explain how to find nearest point in MySQL database.
Mysql - latitude/longitude find nearest latitude/longitude


SELECT Latitude,Longitude,distance FROM  (SELECT Latitude,Longitude,(6371 * ACOS( COS( RADIANS('22.607672') )* COS( RADIANS( Latitude ) ) * COS( RADIANS( Longitude ) - RADIANS('88.36853') ) + SIN( RADIANS('22.607672') ) * SIN( RADIANS( Latitude ) ) ) )   AS distance FROM bts HAVING distance < '7') a order by distance desc limit 1



Mysql - latitude/longitude find nearest latitude/longitude

How to find nearest point using latitude and longitude? Reviewed by Ravi Kumar on 12:44:00 PM Rating: 5

No comments:

All Rights Reserved by Etechpulse © 2012 - 2017
Powered By Blogger

Contact Form

Name

Email *

Message *

Powered by Blogger.