Which is the best way to convert a complex multipolygon into simple and "merged" polygon?
For example, the red stroked polygon (drawn by hand of course) is the simplified version of the white multipolygon one:
The aim is to get rid of the little polygons by generalizing the zone, also, there is a multipolygon that could be converted into 2 simplified polygons features or a simplified multipolygon feature:
The purpose of doing this is to find a way to optimize an elasticsearch geo_shape index for searching geofenced queries. In this case, low resolution works to test the search capabilities.
link to the geojson gist. Original Norway shape was extracted from a kml and already simplified with ogr2ogr -simplify 0.125
.
Best Answer
I see multiples ways to answer this complex problem, but do remember this is a complex and not really closed topic, like Vince said. First, if you want to test, you should probably import your data in Postgis to quickly test and see the result, then look for other tools/library if you want to industrialyze (or just read or export from Postgis), that's usually what I do.
The 2 simplest ways that I see right now are:
The resulting polygon should ensure you to not leave any part of your initial polygons appart. You can use a ST_Simplify after if you want to be sure to have a small number of points in your polygon.