You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I arrange multiple polygons in a way so that they should form a polygon with a hole, the resulting geoJson is formated as if the hole is another polygon in the multipolygon
[
[ [ outer polygon ] ],
[ [ inner polygon/hole ] ]
]
Whereas it should be
[
[ [ outer polygon ],
[ inner polygon/hole ] ]
]
I have an example (strangly it shows correct, in the viewer, but with F12 you'll see the wrong geoJson https://codepen.io/Sakke/pen/aYbeEM?editors=0010
The following example is related and does show the error in the viewer:
When I add an additional polygon (making it a true multipolygon), then I also goes wrong. https://codepen.io/Sakke/pen/dmPoMp?editors=0010
The text was updated successfully, but these errors were encountered:
I was trying to find the reason and it seems to be with if(!resultEvents[i].isExteriorRing)
the original is an exterior ring, and because of that isExteriorRing=true.
Then it does result.push(contour) where I guess it should have done result[result.length - 1].push(contour[0]);
However I have no idea how I could validate it otherwise. Maybe with a method where I can check if one polygon is completely contained in the other, then I could make it a hole. However that would seem to be a workaround.
It seems this is inherent to the Martinez algorithm: you still have to figure out which polygon is a hole and to which polygon the hole belongs.
In my code I sweep trough the polygons to try and figure this out, however my implementation probably isn't quite performant.
When I arrange multiple polygons in a way so that they should form a polygon with a hole, the resulting geoJson is formated as if the hole is another polygon in the multipolygon
[
[ [ outer polygon ] ],
[ [ inner polygon/hole ] ]
]
Whereas it should be
[
[ [ outer polygon ],
[ inner polygon/hole ] ]
]
I have an example (strangly it shows correct, in the viewer, but with F12 you'll see the wrong geoJson
https://codepen.io/Sakke/pen/aYbeEM?editors=0010
The following example is related and does show the error in the viewer:
When I add an additional polygon (making it a true multipolygon), then I also goes wrong.
https://codepen.io/Sakke/pen/dmPoMp?editors=0010
The text was updated successfully, but these errors were encountered: