@turf/boolean-contains: allow boundary points in MultiPoint containment checks#3024
Merged
mfedderly merged 2 commits intoJun 22, 2026
Merged
Conversation
Collaborator
|
This seems like a pretty reasonable change, and I'm kind of torn on whether correcting behavior to match the spec is a breaking fix or not (I went back and forth on #3070 with the same debate). I think semantically they're bug fixes so 7.x is appropriate, but adding them to the v8 milestone and explicitly documenting the behavior change is probably a safer rollout strategy. Its always hard to tell on these calls until we hear back from users after a release that we broke things for them. Thoughts? |
Collaborator
|
I have convinced myself that this is a bug that doesn't need a major version bump to correct. The docs and de-9im all suggest that this is a correction of buggy behavior and people should not have been depending on the broken state. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Lifted from #3010)
Fixes behavior of
booleanContainsto returntrueif every point in a MultiPoint is inside/on boundary of some polygon, and at least one is strictly interior. This previously returnedfalse, but differs frombooleanWithinand doesn't match DE-9IM semantics. In my eyes this is a bugfix, not a breaking change - but will leave it to the maintainers to decide how to classify it.An example:
Given the following square polygon:
{ "type": "Polygon", "coordinates": [ [ [0, 0], [1, 0], [1, 1], [0, 1], [0, 0] ] ] }And the following MultiPoint:
{ "type": "MultiPoint", "coordinates": [ [0.5, 0.5], [1, 1] ] }In this case, one point is strictly on the interior of the polygon, while one point is on the boundary. This previously returned
false, but the way I (and DE-9IM) see it should returntrue.Resolves #3025