@turf/boolean-contains: allow boundary points in MultiPoint containment checks #3024
+45
−3
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