mapbox / tippecanoe

Build vector tilesets from large collections of GeoJSON features.
BSD 2-Clause "Simplified" License
2.73k stars 431 forks source link

Dropping polygons based on their size #978

Open vincentvd1 opened 1 year ago

vincentvd1 commented 1 year ago

I have a polygon layer that should be visible from Z10 to Z13. I am having troubles though letting tippecanoe drop polygons to not create a to crowded map. I can let it drop polygons but tippecanoe often prefers dropping the largest features while I would like it to drop the smallest features at low zoomlevels and slowly make them visible.

I tried to parameters below but that does not give the desired output (see also the example dataset below).

tippecanoe -Z10 -z13 -o output/leisure_tourism_z10.pmtiles output/leisure_tourism_z10.geojson --no-simplification-of-shared-nodes --drop-polygons --drop-rate=1.5 --cluster-distance=7 --no-clipping

Is there a way to keep the largest polygons and slowly show the smaller polygons as you zoom in?

I generate the geojson files by exporting them from Postgressql/postgis. Another approach would be to create a geojson per zoomlevel and let postgis drop some features with a sql selection. Given that this method is less dynamic it is not my preferred way.

Sample dataset: leisure_tourism_z10.zip