#7233 closed defect (fixed)
MBTiles driver should support pixel tile dimensions other than 256x256
Reported by: | kthujvu | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.3.0 |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | normal | Keywords: | mbtiles |
Cc: |
Description
An answer to https://gis.stackexchange.com/questions/270978/mbtiles-with-512x512-pixel-tiles says
"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."
GDAL indeed has hard-coded 256x256 tile dimensions. This means it does not support tiles in double resolution which are not rare nowadays (eg available as "retina" or "@2x" at some tile providers).
Trying to gdalinfo a non-256 mbtiles file gives "ERROR 6: Unsupported tile characteristics".
While the specs are sparse, I would consider it a bug that GDAL has the dimensions hardcoded. I assume the best way would be to not care about the dimensions at all.
Attached is a bash script that (using imagemagick/graphicsmagick and mb-util) creates tiles and mbtiles with 128x128, 256x256 and 512x512 pixels.
Attachments (1)
Change History (3)
by , 6 years ago
Attachment: | create_tiles.sh added |
---|
comment:2 by , 6 years ago
Milestone: | → 2.3.0 |
---|
script to create tiles and mbtiles