mapbox / tippecanoe

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

Add `--cluster-maxzoom` option #956

Open Oreilles opened 2 years ago

Oreilles commented 2 years ago

This PR adds the option to set the maximum zoom level at which features should be clustered. Syntax taken from the updated docs:

I just picked the letter k as it was available, but this could be change to anything else if needed.

An alternative solution would be to use the already existing --base-zoom option to prevent clustering above the specified zoom. While possible, it could lead to unexpected result when using both -zg and -Bg, as the zoom at which most feature would be become distinct could be much higher than the one at which a tile crosses the 50k feature limit.

Fixes https://github.com/mapbox/tippecanoe/issues/934 and https://github.com/mapbox/tippecanoe/issues/799. This PR, alongside https://github.com/mapbox/tippecanoe/pull/940 and https://github.com/mapbox/tippecanoe/pull/955 would bring feature parity and improved consistency with the supercluster library used to generate clusters in mapbox-gl-js.

e-n-f commented 2 years ago

Could you please make this PR against https://github.com/felt/tippecanoe instead? The mapbox repo is essentially unmaintained now.

Oreilles commented 2 years ago

Done 👍