-
So I'm trying remove overlaps between Polygon/Polygon which works great with turf.booleanOverlap and turf.difference, however in some cases turf.difference returns (rightfully so) MultiPolygons which still has overlaps, and turf.difference between MultiPolygons and Polygons does not work, so my approach is to use turf.coordEach to iterate through the MultiPolygon, and then use turf.booleanPointInPolygon(currentCoord, Polygon) which also seems to return the desired true/false-value, but I can't seem to figure out how to actually remove the currentCoord from the MultiPolygon. The currentIndex built in to coordEach is just an i++, it doesn't represent the actual index of the coordinate. I've made an example in RunKit of it, where the last console log should be something like feature.geometry.coordinates[2][0][3] but all I can get is feature.geometry.coordinates[2][0][19] as the coordIndex is 19 instead of 3. I'll attach links to the StackOverflow issue I created, aswell as the RunKit notebook. Would appreciate any guidance in this! https://runkit.com/mdanneil/636dfc8408353e0008f22526 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @mdanneil The issue of currentIndex is being address in #2344 , just needs to get merged and released, so perhaps place a watch on that issue Cheers |
Beta Was this translation helpful? Give feedback.
Hi @mdanneil
The issue of currentIndex is being address in #2344 , just needs to get merged and released, so perhaps place a watch on that issue
Cheers
Rowan