Open hyperknot opened 3 years ago
I checked with fixed right-hand rule using:
ogr2ogr -f GeoJSON -lco RFC7946=YES fixed.geojson input.geojson
And the result is the same. So it is not related to any geojsonhint errors, as the fixed file has none.
At the end I figured out the best results by running the following chain multiple times, in my case 3x was needed:
-clean
-explode
-filter-islands
-dissolve2
finishing with a clean.
Does it make sense or I'm doing something wrong here?
// I also realised clean rewind
fixes the right-hand-rule.
I have the following GeoJSON from mapbox-gl-js's
queryRenderedFeatures()
, run on an OSM water layer: browser.geojson (renamed to .txt)I'd like to remove small islands from it (<1 km2), I'm running the following code:
What happens is that 99% of the islands get removed, but not all. The result is the same with 1000000km2.
Adding
-clean
removes a bit more, but still not all of them.Running geojsonhint on it throws up
warning Polygons and MultiPolygons should follow the right-hand rule
lines for 456 features, but almost all of these get removed correctly.