#6119 closed enhancement (fixed)
Correct detection of MBTiles tile format
Reported by: | Martin Mikita | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.3.0 |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description
We are producing MBTiles with optimized PNG8 with transparency. Mostly inner tiles are only PNG8 (without transparency), but border tiles sometimes has transparency.
MBTilesDataset class detects number of bands from the center tile. It results in incorrect interpretation of tiles inside MBTiles.
I am not sure, what should be the correction:
- check more tiles (center, 2 corners, any random?)
- check more random tiles
- parse metadata first (type: overlay or baselayer, format: png or jpg)
- overlay png format should be 4 bands.
As workaround we set MBTILES_BAND_COUNT to 4 for each MBTiles format, which is working for us now. (Even with baselayer jpg tiles inside).
Note:
See TracTickets
for help on using tickets.
As it seems that the autodetection logic cannot work reliably, I woulnd't be opposed if you propose a patch to implement the same behaviour as GPKG :
<p>By default, the driver will expose a GeoPackage dataset as a four band (Red,Green, Blue,Alpha) dataset, which gives the maximum compatibility with the various encodings of tiles that can be stored. It is possible to specify an explicit number of bands with the BAND_COUNT opening option.</p>