Return to Snippet

Revision: 47413
at June 7, 2011 21:06 by muximus


Initial Code
select * from tb_location ORDER BY SQRT(POWER((y-lng), 2)+POWER((x-lat),2)) ASC LIMIT 1;

Initial URL

                                

Initial Description
Get closest location to a set of gps coordinates (x, y) given a database table with columns lat(latitude) and lng(longitude)

Initial Title
Get closet location(POI)

Initial Tags
mysql

Initial Language
MySQL