0

I have some z/x/y.png map tiles. While in the old days tiles were 256x256 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?

1

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.

1

Since https://trac.osgeo.org/gdal/changeset/41449 GDAL supports tiles in non-256 pixel sizes.

This means GDAL 2.3 supports this and so will any QGIS built on it.

  • Even 7 months after the technically correct answer from inc41, QGIS still does not use this updated version of GDAL. So nobody who downloads QGIS today should assume that this issue is fixed now. It is not! – mipa Sep 24 '18 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.