does anybody have a MySQL query where I can return all the zipcodes in 150 mile radius from a specific zipcode? The kicker is my DB uses points and the format as text is (lat lng). Any hints would be great! Thanks.
Country: USA
City (varchar 25)
State (varchar 10)
Zip (int)
Location (point)
example:location (70 -12)
A quick Google search yielded this basic MySQL function for caclulating distance between two Geo-points. To get miles instead of Km, you’d just replace the
6378.388constant with3963.1as described in this formula breakdown.