Skip to content

hexGrid says it accepts a multipolygon but the typing only allows polygon #2841

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

Open
SimonsUnikaNamn opened this issue Feb 17, 2025 · 3 comments
Labels

Comments

@SimonsUnikaNamn
Copy link
Contributor

As you can see in the docs, it specifically says that multipolygon is allowed, but the typing says otherwise

I have tested disregarding the typing and it seems to work

Will fix a PR for this

@SimonsUnikaNamn
Copy link
Contributor Author

Wasn't able to create a new branch, not sure how I am supposed to open a PR so will just depend on someone else fixing this minor thing

@smallsaucepan
Copy link
Member

Thanks @SimonsUnikaNamn.

Wasn't able to create a new branch, not sure how I am supposed to open a PR

You will need to fork Turfjs/turf first, create and work in a branch in your forked repo, and then raise a PR to merge that branch back in to turf.

I have tested disregarding the typing and it seems to work

If you're still interested in doing a PR, thanks for offering to tidy this up.

Would you mind also confirming any calls hexGrid makes in turn accept MultiPolygons? Just to make sure all possible flows are "MultiPolygon safe". Maybe also add a simple test case as well?

SimonsUnikaNamn added a commit to SimonsUnikaNamn/turf-hexgrid-fix that referenced this issue Mar 17, 2025
Typing of mask does not allow for MultiPolygon while the documentation obviously states that this is allowed
@SimonsUnikaNamn
Copy link
Contributor Author

Sorry for taking some time, created a new fork and PR here

I changed one of the existing test cases into a MultiPolygon and made sure I got the same results

twelch pushed a commit that referenced this issue Mar 17, 2025
* turf-hexgrid: fix issue #2841

Typing of mask does not allow for MultiPolygon while the documentation obviously states that this is allowed

* feat: update readme of turf-hexgrid to include MultiPolygon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants