I need to merge data from an OSM map with some other data (tiles) I get from a tileserver. I can import and display both layers well in QGIS and all zoom levels work fine. Now, I would like to export a region of this map as an .osm file so I can use it offline on my mobile phone (the app I am using on the phone can only load .osm files).

What I managed so far: I can export the merged maps from QGIS to an .mbtiles file. I can also extract that file to a folder structure or load the .mbtiles file as a single layer into QGIS again if that helps.

How can I get from the .mbtiles file to the .osm file, or more generally, how do I export the result of a merged OSM map with an tile-server map to single .osm file?

(additional info: I work with Ubuntu 14.04 and QGIS 2.18)

1 Answer 1


You can use tippecanoe by mapbox to convert MBTILES to GEOJSON layers. Then use ogr2ogr to convert GEOJSON to OSM XML Based file. A better approach is to use a mobile app that supports vector tiles MBTILES.

Ok created with QTILES means raster in blob You can't not make OSM from raster. I thought you had vector tiles with PBF in blob of tile_data in tiles table

  • tippecanoe-decode yields the following error: $: tippecanoe-decode testfile.mbtiles { "type": "FeatureCollection", "properties": { "bounds": "8.75451840334,45.7940852367,8.84680355959,45.8634521078", "description": "Created with QTiles", "format": "png", "maxZoom": "13", "minZoom": "0", "name": "Mapnik", "type": "baselayer", "version": "1.1" }, "features": [ PBF decoding error in tile 0/0/0. Looks like the mbtiles file is corrupt?! It is created with the QTiles plugin in QGIS. Any suggestions?
    – sweiss
    Commented Aug 14, 2017 at 18:49
  • I saw the app also supports reading from a tile directory structure. QTiles can also export to a directory. The app (G-Vario) can read the data if it is in a folder under sdcard/osmdroid/tiles. As a note for others (maybe specific to GVario): the generated tiles are very large in png format and much smaller in jpg format. Only after renaming the ".jpg" tiles to ".png.tile" GVario can read them. Note: this is just changing the file name ending, I did no conversion; so the size of the map is still small. Strange that OSM from raster does not work, seems to me a useful conversion....
    – sweiss
    Commented Aug 16, 2017 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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