felt / tippecanoe

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

Limiting maxzoom to keep from generating many tiles #124

Open gio0v opened 1 year ago

gio0v commented 1 year ago

I have been using tippecanoe for a while, but it is the first time I encounter this and I did not find much discussion about it.

When creating vector tiles for a given world map of mine, everything works well if using PMTiles compression (and the job takes about 2 hours with -zg and -P). However, when I try to generate uncompressed PBF files, the process becomes extremely slow after repeatedly showing messages like Limiting maxzoom to -z10 to keep from generating 4577205 tiles.

Firstly, I am confused about what is going on. The -zg parameter is making tippecanoe find z8 and z12 as ideal zoom levels. So:

  1. why is it forcing z10 as the maximum only when generating uncompressed tiles?
  2. is it forcing z10 only for the offending features/tiles, or for the whole task? Reading the source code I got the impression that it is forcing z10 only for some specific features/tiles, but understanding this is of relevance.
  3. is there a way to bypass that limit in case memory and processing are not bottlenecks for me? I read the many ways to handle limits, but I did not quite get which parameter would affect that particular situation. Also, per the source code, the limit seems to be hard-coded, so not changeable - and also not bypassable by any flag.

Thanks!

bdon commented 1 year ago

@gio0v can you share your complete command lines - it is not clear if this has to do with the pmtiles format, does it have to do with -pC/--no-tile-compression ? What is your case for using uncompressed PBFs?

e-n-f commented 1 year ago

The "limiting maxzoom" should apply to all guessed maxzooms, not specifically to uncompressed tiles, and I added it to avoid the problem where it was too easy to make a polygon that covers the entire world and gets tiled very deeply.

I should add a flag to make the z10 limit optional.

MariaSliacka commented 1 month ago

@e-n-f would it be possible to somehow combine the -zg flag with also setting up a maximum possible zoom? I have a problem where my data could contain both polygon covering whole world but also tiny details, so using -zg is my best option here, however, I would like to limit the max zoom to 15 so that I dont get millions of tiles in a very detailed dataset.

MariaSliacka commented 1 month ago

@e-n-f alternatively, would it be possible to know the calculated zoom level before generation of tiles? in that way we could terminate the command early and instead of -zg use -z15. Edit - I also opened up a separate issue for this as a feature request - https://github.com/felt/tippecanoe/issues/281 .