Possible Duplicate:
Radius of multiple latitude/longitude points
distance calculations in mysql queries
select within 20 kilometers based on latitude/longitude
I have a MyISAM table, which the data is stored in. The data includes latitude and longitude for Google Maps. What I am trying to achieve is to select all objects within the radius of 40 kilometers of the sample latitude and longitude.
Thanks!
I use this query to get all points within a
$radiusaround$lat/$lng:6371 is the earth radius im km. And I have not invented it:
http://code.google.com/intl/en/apis/maps/articles/phpsqlsearch.htmlhttps://developers.google.com/maps/articles/phpsqlsearch_v3#findnearsql (edit: URL changed)