Created
May 27, 2016 17:55
-
-
Save fjcunha/496875388e1eca05afd2b201f342b0e8 to your computer and use it in GitHub Desktop.
Formula to calcule Distance between two geoPoints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQRT( | |
POW(69.1 * (latitude - [startlat]), 2) + | |
POW(69.1 ([startlng] - longitude) * COS(latitude / 57.3), 2)) AS distance | |
FROM TableName HAVING distance < 25 ORDER BY distance; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment