-
Notifications
You must be signed in to change notification settings - Fork 952
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
Bug: turf/difference removes arrays of MultiPolygon Input #1475
Comments
As I know new martinez realization of a difference doesn't support MultiPolygon geometries. |
@ilijaz ah ok, the turf docs currently suggest otherwise and might need an update: http://turfjs.org/docs#difference |
Not sure it's caused by martinez, please, look at this codepen https://codepen.io/w8r/pen/LJyOmP |
@w8r thanks for clarifying, so it seems martinez is in fact supporting MultiPolygons as input for difference |
Hi @codeofsumit Thanks for the bug report - I'll take a look at what's going |
@rowanwins have you been able to take a look yet? Looking into @turf/difference in Line 54, it seems like it should return a MultiPolygon as the output from Martinez has a length of 2. When looking at my test result though, it's just a polygon 🤔 |
hey folks! Just wanted to ask once more if you were able to take a look at this bug. |
Hi @codeofsumit Looking into this a bit further, your original poly looks like the geojson is misformed. The hole in your first poly is not nested deeply enough, it should be represented as
I have noticed before that leaflet can do some funky things with rendering multipolys with holes In the |
Resolved in v6.2.0 onwards |
Hi all! Great work again on the removal of jsts, it made leaflet.pm so much smaller and better 👍.
I've tried to track down an issue in the plugin and I think it might be the output of difference.
Here's a gif showing a test of cutting an additional hole in a MultiPolygon:
Here's the data for testing
Input 1:
Input 2:
Using difference 6.0.2 like this:
gives the result:
The text was updated successfully, but these errors were encountered: