Hi everyone
I have a table with latitude and longitude coordinates which are reflective of a journey from London to Edinburgh. The table has 105,000 rows.
Does anyone know how I might be able to convert / translate the distance between point A and B into km, to look something like this:
Latitude | Longitude | Distance Travelled (km) |
51.5040464 | -0.0145931 | 0 |
51.50405 | -0.01459 | 1 |
51.50405 | -0.0146 | 2 |
51.50407 | -0.01466 | 3 |
51.50414 | -0.01478 | 4 |
51.50413 | -0.01481 | 5 |
51.50412 | -0.01483 | 6 |
The following article explains how this can be done mathematically, but was wondering if anyone had any pre-loaded Formula tool or configured Spatial tools which could easily do this?
https://sciencing.com/convert-distances-degrees-meters-7858322.html
Thanks
KA
Solved! Go to Solution.
Thank you @Qiu
I've not used the Multi Row Formula tool before, but am I right in thinking it effectively has created a new row and calculated the distance in KM from the coordinates in the first row??
Thanks,
KA
Separate from the spatial functions, I've been using this formula to calculate distance in feet:
131332796.6 *
(ACOS
(Cos([Row-1:Latitude]) * Cos([Row-1:Longitude]) * Cos([Latitude]) * Cos([Longitude]) +
Cos([Row-1:Latitude]) * Sin([Row-1:Longitude]) * Cos([Latitude]) * Sin([Longitude]) +
Sin([Row-1:Latitude]) * Sin([Latitude]))
/360)
Based on this information:
How to Convert GPS Coordinates to Feet
https://sciencing.com/convert-gps-coordinates-feet-7695232.html
Use the following formula to calculate the distance in feet of the shortest line across the surface of the earth that joins the two locations represented by GPS coordinates (a1, b1) and (a2, b2):
131332796.6 x (ArcCos{Cos[a1]xCos[b1]xCos[a2]xCos[b2] + Cos[a1]xSin[b1]xCos[a2]xSin[b2] + Sin[a1]xSin[a2]}/360)
where a1,b1 = latitude, longitude for location one
where a2,b2 = latitude, longitude for location two
Tips
Check that the calculator you are using has the degree mode selected before attempting these calculations. Calculations done using the calculator's radian mode will result in errors.
Chris