[gdal-dev] Problem when using gdal_translate to create mbtiles

Even Rouault even.rouault at spatialys.com
Wed Feb 8 02:41:15 PST 2017


On mardi 7 février 2017 17:42:30 CET Renato Souza Sanabria wrote:
> Hi,
> 
> I have two similar (but with different resolutions) .tif's that I'm trying
> to convert to .mbtiles with gdal_translate. They both have 4 bands (RGBA),
> but only one of them is converted correctly (all four bands). In the case
> of the other one, the Alpha band is not converted and is removed in the
> final file.

Guessing the number of bands in a MBTiles file is a guess, so sometimes it doesn't work out 
of the box. Or it might be possible that the alpha channel of your dataset is always at 255.

You can try the BAND_COUNT open option:

http://gdal.org/frmt_mbtiles.html

*BAND_COUNT*=AUTO/1/2/3/4: Number of bands of the dataset exposed after opening. 
Some conversions will be done when possible and implemented, but this might fail in some 
cases, depending on the BAND_COUNT value and the number of bands of the tile. Defaults 
to AUTO.


gdalinfo -oo BAND_COUNT=4 foo.mbtiles

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170208/ce95ddc2/attachment.html>


More information about the gdal-dev mailing list