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

Fix point-linestring intersection #500

Merged
merged 2 commits into from
Aug 21, 2020

Conversation

urschrei
Copy link
Member

This PR fixes #452, and harmonizes the algorithm in our hidden and shameful private_utils module with the logic we use elsewhere.

By re-using the point-line-containment algorithm on each segment
&& (point.y() > line.start.y.min(line.end.y))
&& (point.y() < line.start.y.max(line.end.y)))
{
// This is a duplicate of the line-contains-point logic in the "intersects" module
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, great shame be on us all.

These algorithms exist in geo-types so we can have a nice rstar integration, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, although as we have now discovered they can easily get out of whack and cause problems, so I'd love to find some better way of providing the functionality, although the reason it's done like this is to avoid circular dependencies 😩

Copy link
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thank you @urschrei!

@michaelkirk
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Aug 21, 2020

Build succeeded:

@bors bors bot merged commit f6a5b0a into georust:master Aug 21, 2020
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.

Simple example for LineString containing a Point fails
2 participants