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.
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
How to find nearest point using latitude and longitude?
Reviewed by Ravi Kumar
on
12:44 PM
Rating:

Post Comment
No comments: