-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify that current cross-track distance uses spherical (Haversine) earth model, add Ellipsoidal (Vincenty) version #1140
base: main
Are you sure you want to change the base?
Conversation
…dding cross_track_distance_geodesic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conceptually, I think this material would work better as a trait implemented for the Geodesic
struct. As an example, I have a draft of a very different (and most likely much worse) cross-track-distance approach over at Geodesy, where it is implemented for the Ellipsoid
struct (and Geodesic
is really just a glorified Ellipsoid
).
It would allow the functionality to work for any ellipsoid, not just the WGS84, which you constrain it to here, and it would eliminate the (rather heavy) recomputation of all the numerical factors for Geodesic
at every new call.
That said, I'm just a humble hangaround, not a member of the Georust gang, so the real georusters may have a different view of this
@busstoptaktik -- Interesting take, Thomas. I am, however, struggling to find the Geodesic struct in this crate so that I can understand your point a little better. |
I'm talking about the |
So @busstoptaktik; are you suggesting we put these as a trait implementations in |
Since geographiclib-rs is a hard dependency anyway, and since it extends it with material based on additional work by the original author of GeographicLib, I think it would be a reasonable place to put it. Also note that it would be meaningful (e.g. for roundtripping), and probably almost free, to return a tuple consisting of the across track distance in combination with the along track distance for the intersection. |
Thank you for the code and sorry that this sat here for so long!
Is this based on reading a paper or on existing code somewhere? Can you provide a link to either or both?
Note that Geodesic::wg84() is memoized, so it only incurs that setup cost one time. @busstoptaktik's larger point about being able to use the method on other geodesics is reasonable, but in any case, I think we'll still want this existing API as well, because it mirrors our Haversine implementation, so I think it makes sense to merge this. (I still do want to update the docs and compare to any reference implementation you can link before merging) |
Hi @michaelkirk, thanks for joining us! I've implemented the ellipsoidal formula based on the following Python code |
Issue #1128
In response to Issue #1128 , I moved the old
cross_track_distance.rs
into a newcross_track_distance_haversine.rs
file and added an ellipsoid cross track distance function incross_track_distance_geodesic.rs
that uses the Karney 2023 improvements to the BML algorithm on geodesic intersections.