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

feat(@turf/boolean-contains): Add MultiPolygon support #2338

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

Debakel
Copy link
Contributor

@Debakel Debakel commented Sep 20, 2022

Adds support for MultiPolygons to booleanContains().

Closes #2337


Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Have read How To Contribute.
  • Run npm test at the sub modules where changes have occurred.
  • Run npm run lint to ensure code style at the turf module level.

Copy link
Member

@rowanwins rowanwins left a comment

Choose a reason for hiding this comment

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

This looks great thanks @Debakel - I'm just waiting for CI to pass before merging. And the team is hoping that we'll get a release out soon

@rowanwins rowanwins merged commit 81bb457 into Turfjs:master Oct 6, 2022
@antonmelbardis
Copy link

@rowanwins hi! When is this going to be released?

@rowanwins
Copy link
Member

Hi @antonmelbardis - this should now be available in 7.0.0-alpha.0 which is available on npm

@antonmelbardis
Copy link

@rowanwins thank you sir!

@nick-romano
Copy link

fyi- still getting Error: feature2 MultiPolygon geometry not supported on 7.0.0-alpha.0

@antonmelbardis
Copy link

@rowanwins @nick-romano yeah, the issue is still there unfortunately

@Debakel
Copy link
Contributor Author

Debakel commented Dec 2, 2022

fyi- still getting Error: feature2 MultiPolygon geometry not supported on 7.0.0-alpha.0

@antonmelbardis @nick-romano The PR implemented booleanContains(feature1, feature2) only for cases where feature1 is a MultiPolygon and feature2 is a Polygon. Reversed operands are still not supported (but seems like there's already another PR for this: #2357).

➡️ It's only possible to check wether a Polygon is contained by a MultiPolygon and not vice-versa.
➡️ It's currently not possible to check wether a MultiPolygon contains a Point, Line or any other geometry type than Polygon.

@markstos
Copy link

markstos commented Dec 2, 2022

I'm looking for point(MultiPolygon, Point), but maybe there's another way to accomplish that.

Found it! booleanPointInPolygon(). This function could be worth a mention from the booleanContains() docs.

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.

booleanContains with MultiPolygon
5 participants