tippecanoe
tippecanoe copied to clipboard
Specifying a unified simplification for a given zoom level for all tiles
I'm not sure this is an issue or something I don't know how to do. I've searched other issues which resemble my issue but can't seem to find the right option.
I've used the mapbox studio tileset service and when I upload a simplified geojson, I get tilesets ranging from z4 to z9 which look perfect. By using tippecanoe, I wanted to add a feature id to my geojson by using --use-attribute-for-id=insee_code
. Unfortunately, during generation of the tilesets, I get tiles which are too detailed and thus too big.
35018 features, 10775303 bytes of geometry, 275463 bytes of separate metadata, 711485 bytes of string pool
tile 2/2/1 size is 545482 with detail 12, >500000
tile 3/4/2 size is 791842 with detail 12, >500000
tile 3/4/2 size is 517850 with detail 11, >500000
tile 4/8/5 size is 971075 with detail 12, >500000
tile 4/8/5 size is 760785 with detail 11, >500000
tile 5/16/11 size is 1013722 with detail 12, >500000
tile 5/16/11 size is 756407 with detail 11, >500000
tile 5/16/11 size is 592690 with detail 10, >500000
tile 6/32/22 size is 729739 with detail 12, >500000
tile 6/32/22 size is 514876 with detail 11, >500000
If I upload this to mapbox studio, I get non-uniform outlines for a given zoom level:
I've tried many many options by forcing detail level to 9, forcing minimum zoom to 4, using -pS
, following the solution from this similar issue https://github.com/mapbox/tippecanoe/issues/452, but I can't get to have the same tileset result from a geojson uploaded to mapbox studio and a simple addition of ID to features in tippecanoe. My main issue is that by using tippecanoe the result doesn't look uniform over all the map. Is there a way to specify to tippecanoe how to have the same simplification logic for all tiles for a zoom level (so that there is no strange tile-specific "glitches") ?
The dataset itself is the outlines of all administrative areas in france with 2 properties per feature (which are small but would be nice to keep).
Thanks for the help,
The only way to make it consistent across the zoom is to find a detail
that is sufficient for all the tiles, or to use one of the --coalesce-*-as-needed
or --drop-*-as-needed
options to drop or merge features consistently across the entire zoom. Since these are continuous polygons, --coalesce-smallest-as-needed
is probably the closest thing to what you want.
Hm I see. Indeed, I tried drop-*-as-needed
but I got gaps when zooming in. On the other hand coalesce-*-as-needed
works quite well but then I get one feature id used for multiple areas so the mouse hover (I need feature IDs to add tooltips with information on hover) effect returns wrong data. I guess I'll have to reduce the detail
and block the zoom level at 4, same as mapbox studio does to keep a good UX :) There are no other options that I may have missed ?
Thanks for the help and your time !