mclaeysb / simplepolygon

JS tool to break self-intersecting GeoJSON polygons down in their constituent non-self-intersecting parts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Complex polygon only return two parts

DenisCarriere opened this issue · comments

commented

Complex polygons should return multiple parts (only return with two parts).

https://gist.github.com/a49494d38ded757824ba1f325bf26940
image

From the image you added it indeed looks like the algorithm failed to correctly identify the simple polygons of the input polygons. I advise you to turn on the debug parameter and follow how the algorithm walks over the edges. This way you can find out where it makes its mistake!

commented

@mclaeysb kinda hard a troubleshoot a library I didn't build, I would have no clue where to start. This why I added the dynamic testing in test/in, here are the results of test/out/complex.geojson

Just had some time to look in to this. Was due the dependancy geojson-polygon-self-intersections which had some trouble with the exactly vertical line (meridian). Fixed that issue in the dependancy and published to npm. Running npm update inside the simplepolygon directory solves this.