Sunday 17 May 2015

raster - Choose what zoomlevel to read from for mbtiles file in GDAL


GDAL is supposed to read MBTiles files and to do so, it selects the highest zoomlevel available. However, is there a way to choose another zoomlevel? i.e. override the default and go for a lower one?


I'm currently accessing the file like this (and it defaults to the highest zoomlevel):


gdal_translate tiles.mbtiles export.tiff


Answer



Gdal_translate's Dataset open option -oo allows to specify MBTiles opening options.


To answer the question, you can get e.g. zoom level 12 by doing:
gdal_translate -oo ZOOM_LEVEL=12 tiles.mbtiles export.tiff


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...