[GIS] MBTiles with 512×512 pixel tiles

mbtilestilesxyz-tiles

I have some z/x/y.png map tiles. While in the old days tiles were 256×256 pixels, nowadays it is not unusual to have images referencing the same extents in higher resolution (sometimes called "retina" in marketing speak).

This means the tile 1/2/3.png would represent the same geographical area in both cases but rendered in different resolutions.

When I tried to convert my directory tree to a mbtiles file with mb-util, the resulting file displays nothing in QGIS. Does the mbtiles format support higher resolution tiles and can I turn such files into a mbtiles file with mb-util?

Best Answer

The MBTiles specification https://github.com/mapbox/mbtiles-spec/blob/master/1.2/spec.md does not say anything about how many pixels a tile should contain. Specification defines the grid but all that is said about the BLOB that contains the image data is that it must be either jpeg or png image and therefore a MBTiles database with 512x512 sized tiles is totally valid. That does not mean that all MBTiles clients would understand such data correctly. For example the GDAL MBTiles driver http://www.gdal.org/frmt_mbtiles.html does not seem to have an option for setting the size of the tiles that it creates in pixels. Obviously it assumes that it is always 256x256.

You could put available a test MBTiles database with 512x512 tile size and ask from the gdal-dev mailing list about if that should be readable by GDAL.

Related Question