[gdal-dev] MBTiles blurry

Even Rouault even.rouault at spatialys.com
Thu Jun 30 03:07:55 PDT 2022


Kanishk,


>
> And my GDAL commands are:
>
> gdalwarp -srcnodata 0 -dstalpha infile.tif outfile.tif
> gdal_translate -tr 0.035 0.035 -co 'QUALITY=100' -of MBTILES 
> outfile.tifoutmbtile.mbtiles
> gdaladdo -r nearest outmbtile.mbtiles2 4 8 16

The above gives a OK result for me with topveiw_sample.tif as input. 
Note that you don't need the first gdalwarp step as your file has 
already an alpha band.

To improve quality you should add for example -r average to 
gdal_translate otherwise nearest neighbour reampling will be used, which 
is generally a bad idea.

Same for gdaladdo: you should'nt use nearest neighbour reampling for 
good quality

> If I am trying to improve the target resolution even further(reducing -tr value) , it corrupts the output mbtile and a blank or blurred tile gets generated
> Also, the opening option ZOOM_LEVEL seems to error out(Using with -oo "ZOOM_LEVEL=9)

If you look at the output of gdalinfo on the generated mbtiles file, 
you'll see that the full resolution is at zoom level 22, and given the 
dimensions of the file only 2 overview levels were generated. So the 
minimum zoom level at which you can open that file is 20.

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220630/7e01bb5d/attachment.htm>


More information about the gdal-dev mailing list