Consider two nearby points on Earth:
p1 = LatLon(1.214914, 103.851194)
p2 = LatLon(1.214986, 103.851527)
The distance between them is:
julia> norm(ECEF(p1) - ECEF(p2))
37.90659161709082
This is the tunneling distance, but given how close the points are, the geodesic distance won't be very different.
The documentation claims that the EastNorth is a local coordinate system that wraps around Earth. I would expect that distances, at least locally, in that system should be correct. Try:
julia> norm(EastNorth(p1) - EastNorth(p2))
2.3117759335122004e7
Clearly this isn't the distance between p1 and p2.
The problem doesn't seem to be in rounding off in floating point due to large east-north coordinates either:
julia> norm(EastNorth(LatLon{BigFloat}(p1)) - EastNorth(LatLon{BigFloat}(p2)))
2.311775933512200348236462687224363807320209393693279196902270161034214710284282e+07
P.S. To handle rounding off problems, it would be nice if the EastNorth conversion could be done with respect to any specified origin for the local coordinate system.
Consider two nearby points on Earth:
The distance between them is:
This is the tunneling distance, but given how close the points are, the geodesic distance won't be very different.
The documentation claims that the
EastNorthis a local coordinate system that wraps around Earth. I would expect that distances, at least locally, in that system should be correct. Try:Clearly this isn't the distance between
p1andp2.The problem doesn't seem to be in rounding off in floating point due to large east-north coordinates either:
P.S. To handle rounding off problems, it would be nice if the
EastNorthconversion could be done with respect to any specified origin for the local coordinate system.