Open GermainRV opened 2 months ago
euclidean_distance
seems to be the straight-line distance between two points on the Earth, going through the surface of the Earth:
https://github.com/JuliaGeo/Geodesy.jl/blob/b5a3f70471b2b288ff588e5049f435cda6a76eb4/src/distances.jl#L6-L10 https://github.com/JuliaGeo/Geodesy.jl/blob/b5a3f70471b2b288ff588e5049f435cda6a76eb4/src/distances.jl#L16
so this is probably not the right function to use here. Geodesics.jl probably has the correct ellipsoidal calculation, and if you just want the industry standard result you can use Proj.jl's geodesic API.
We
I need to compute the long distances (>>1000km) between two points given their coordinates (latitude, longitude) so I used the
euclidean_distance
function. The points are:I computed the distance using the following code:
Te output was:
Euclidean Distance: 8748.3453257146 km
However, I know that the true distance should be approximately 9650 km. I confirmed this with online latitude/longitude distance calculators like NOAA Lat/Lon calculator which gave a result of approximately 9633 km.I also tried using the Geodesics.jl package, and it provided a more accurate distance:
The output was:
Geodesic Distance: 9642.42096397771 km
I have tested the
euclidean_distance
function with short distances, and it seems accurate. However, the error increases with long distances, so I guess there is some error propagation when dealing with longer distances. Please let me know if I am using the function incorrectly or if this is an actual computational error.