Calculate the Distance between two Latitudes and Longitudes
Calculate the Distance between two Latitudes and Longitudes
March 17, 2023
From Renee’s SQL for Data Scientists found the calculation https://daynebatten.com/2015/latitude-longitude-distance-sql which can be useful for my weather data.
ROUND(2 * 3961 * ASIN(SQRT(POWER(SIN(RADIANS((latitude - 38.4463) / 2)),2) +
COS(RADIANS(38.4463)) * COS(RADIANS(latitude)) * POWER((SIN(RADIANS((longitude
- -78.8712) / 2))), 2))))