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

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

Open
smallsaucepan opened this issue Nov 20, 2024 · 0 comments · May be fixed by #2751
Open

Comments

@smallsaucepan
Copy link
Member

turf 7.1.0

In cases where the line is of zero length (start and end points the same) booleanPointOnLine incorrectly returns true for any other point on the same longitude.

const line = turf.lineString([[1, 1], [1, 1]]);
let pt;

pt = turf.point([2, 13]);
turf.booleanPointOnLine(pt, line);
//false, cool

pt = turf.point([1, 13]);
turf.booleanPointOnLine(pt, line);
// true, oh no

Technically (I guess?) this function should only return true if the three points - start, end, and point - are the same.

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

Successfully merging a pull request may close this issue.

1 participant