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

Added special handling to booleanPointOnLine for zero length lines #2751

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

smallsaucepan
Copy link
Member

In cases where the point was on the same longitude as a zero length line, even if the point was far away, booleanPointOnLine would return true.

Resolves #2750

@smallsaucepan
Copy link
Member Author

Merging this will clear the way to getting a couple of cleanCoords bugs fixed as well.

@smallsaucepan
Copy link
Member Author

@JamesLMilner or @mfedderly could I please request someone cast an eye over this? There are a couple of other issues - cleanCoords and simplify - that can proceed once this is merged.


// Special cases for zero length lines
// https://github.com/Turfjs/turf/issues/2750
if (Math.abs(dxl) === Math.abs(dyl) && Math.abs(dxl) === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this math need to be done with some small epsilon for the float comparison instead of ===?

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.

@turf/boolean-point-on-line incorrectly returns true in some cases when line is of zero length
2 participants