mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Make CleanPolygon call configurable/disable-able #131

Closed springmeyer closed 7 years ago

springmeyer commented 9 years ago

Calling ClipperLib::CleanPolygon may discard tiny polygons at low zooms. This is generally desirable if your priority is reducing vtile sizes. But this may not be desirable in certain situations.

Take for instance: making maps at low zoom levels of polynesian islands.

Here is an example of a MarkersSymbolizer on each polygon when rendering shp->png directly (no vector tile encoding):

nz-1

However when rendered to a vtile and back to an image we loose many of the small islands:

nz-1-actual

After disabling CleanPolygon we regain most of the small islands:

nz-1-actual-noclean

NOTE: area_threshold in these tests was set to 0.0 so the islands are not being thrown away due to that parameter.

One potential solution - for cartographic or other use cases where loosing small polygons is not okay -would be to offer a mode where polygons are collapsed to points rather than thrown away. But in the short term I think the best solution is to provide an option to disable cleaning polygons.

flippmoke commented 9 years ago

I wonder if this should actually be configurable, because my hunch is that these small islands are invalid polygons.

flippmoke commented 7 years ago

This issue is closed because the CleanPolygon process has been replaced as part of the introduction of wagyu over the angus clipper.