Created
May 15, 2018 13:41
-
-
Save cobergmd/30dd493eadf7e19b52d01dc64ec74cbf to your computer and use it in GitHub Desktop.
SQL Euclidian Distance
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
-- Euclidian Distance | |
-- a = min lat | |
-- b = max lat | |
-- c = min long | |
-- d = max long | |
-- sqrt ( square(B - A) + square(D - C) ) | |
select | |
format (sqrt(square(max(lat_n) - min(lat_n)) + square(max(long_w) - min(long_w))),'F4') | |
from latlongs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment