Closed hackergrrl closed 7 years ago
This looks like this is caused by incorrect winding order on the input geojson. Rewinding the input geometry before merging results in correct output. It seems like topojson is picky about GeoJSON being valid, fair enough. FYI geojson-rewind does not currently rewind GeometryCollections https://github.com/mapbox/geojson-rewind/pull/14
Great find, @gmaclennan!
This gist reproduces the issue: https://gist.github.com/noffle/aad0b1db44a2e443b8c64897897064d0
There are three large
Polygon
s, which produce aMultiPolygon
when merged. However, eachLinearRing
inside does not repeat the first coordinates as the last coordinates as per the GeoJSON spec. This issue doesn't seem to appear with all merges, just this particular case. I notice that if I remove the 3rd polygon, this issue is no longer reproduced.