MYSQL FORMULA TO LIST NEAREST LOCATIONS FROM TWO GEO COORDINATES


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT id, place_name,
  2. ROUND( SQRT( POW((69.1 * (#Val(arguments.latitude)# - latitude)), 2) + POW((53 * (#Val(arguments.longitude)# - longitude)), 2)), 1) AS distance
  3. FROM places

URL: http://www.petefreitag.com/item/622.cfm

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.