[gdal-dev] gdaladdo zoom level not supported

Even Rouault even.rouault at spatialys.com
Wed Oct 21 11:41:22 PDT 2020


> When I ran
> gdaladdo, I got an error message about zoom levels:
> ERROR 6: zoom_level > 22 not supported

You will get it also when doing "gdalinfo TLTR.mbtiles". There is a limitation 
in the driver to zoom_level <= 22, because if the .mbtiles would have world 
coverage, the dimensions would overflow a 32 bit signed integer as used by 
GDAL. For a mbtiles with a smaller extent, that limitation could likely be 
removed, but this is as things are currently in the driver.

But the issue here is that you're translating a tiff file in longlat to 
mbtiles which expects EPSG:3857. So add an intermediate step

gdalwarp TLTR_crs.tif TLTR_crs_3857.tif -t_srs EPSG:3857

and then gdal_translate the result to mbtiles

And for your gdaladdo command just run

gdaladdo TLTR.mbtiles

It will automatically add the needed subsampling factors: 2, 4, 8, 16 etc..

I see you intend to pass zoom levels, but gdaladdo expects subsampling 
factors, so 2^zoom_level.

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list