[gdal-dev] MBTiles blurry

Kanishk Varshney varskann1993 at gmail.com
Thu Jun 30 04:18:10 PDT 2022


Hey Even,
Thanks for the quick response.

If you notice the MBTiles, the finer details(cracks on Road, etc) and edges
are all blurred. I tried the -r average flag as well but the result was
almost similar

I am more interested in preserving those details while reducing the size of
the data. So any other approach or format that might suit my use case will
be appreciated as well!

Thanks,
Kanishk

On Thu, Jun 30, 2022 at 3:37 PM Even Rouault <even.rouault at spatialys.com>
wrote:

> 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.tif outmbtile.mbtiles
>
> gdaladdo -r nearest outmbtile.mbtiles 2 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/b2f05916/attachment-0001.htm>


More information about the gdal-dev mailing list