Skip to content
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

Add Haversine:distance for Line vs. Point (same as CrossTrackDistance) #1243

Closed
wants to merge 3 commits into from

Conversation

michaelkirk
Copy link
Member

@michaelkirk michaelkirk commented Oct 31, 2024

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

Part of #1181

At first I also made CrossTrackDistance generic so that you could:

- let distance = point.cross_track_distance(line_start, line_end);
+ let distance = point.cross_track_distance::<Haversine>(line_start, line_end);
+ let distance = point.cross_track_distance::<Euclidean>(line_start, line_end);

But I decided to avoid the breaking change for now and rolled it back (since we just released a breaking change 2 hours ago 😅)

At this point, I consider CrossTrackDistance to be wholly redundant with Line x Point distance, but maybe it's worth keeping around just because it's a well know (?) algorithm name people will be searching for. I'm willing to be convinced otherwise though.

@michaelkirk
Copy link
Member Author

I didn't realize that CrossTrackDistance applies to an (infinite) line passing through the given line points, not a line segment. This change is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant