mbutil
mbutil copied to clipboard
Feature request: Set zoom level range?
I would like to generate tiles only from zoom level 1 to 11 It would be very practical if it was possible to set two parameters for mbutil. Something like: zoom_level_start=1 zoom_level_en=11
This would make it possible to significantly reduce the time to generate the tiles.
Any chance to see this feature implemented? If not, could somebody tell me what code changes that would have to be done to make it possible to set a zoom range.
https://github.com/mapbox/mbutil/blob/2fc4161f9be890a65d07f5e7b2ed0c8a0a123ed6/mbutil/util.py#L312
This while loop pulls tiles one by one from the database. There may be a more efficient way, but you could just check the tile to see if it's in your zoom range and add a continue statement if it's not.
z = t[0]
if z < minZoom or z > maxZoom:
continue
I manually deleted the room range using this: https://gist.github.com/zhm/3830471
sorry to bump up, someone found a solution to set the zoom level ? @maxammann where to apply, no found in util.py
sorry to bump up, someone found a solution to set the zoom level ? @maxammann where to apply, no found in util.py
You can open a mbtiles files using sqlite3 on the command line. Then you cam enter the commands from the Github Gist. Make a backup first though.