Hi Lenz,
I have some results. It is surprising how painful the conversion between map file formats is, and how badly it is documented. There seems to be no easy way to get from QGIS to mapsforge .map files.
I've collected all the information I have so far, hopefully it will be helpful for someone else:
The best two ways to export QGIS to Orux seem to be mbtiles. Sadly so far only raster data, but Orux loads even very large files reasonably fast.
1. QGIS with QMetaTiles Plugin
(This took a long time on my machine and I did not let it finish. QMetaTiles would have taken a week)
- Install QMetaTiles
- Run plugin, save as zip file
- Install MOBAC
- create a local tile file and put in mapsources folder, as described here: https://mobac.sourceforge.io/wiki/index.php/Custom_XML_Map_Sources#Local_Tile_files
<?xml version="1.0" encoding="UTF-8"?>
<localTileZip>
<name>Custom map from tile zips</name>
<sourceType>QUADKEY</sourceType>
<zipFile>D:\MOBAC\LocalTiles\MapCruncher_test.zip</zipFile>
<backgroundColor>#000000</backgroundColor>
</localTileZip>
- create a MOBAC sqlite file for OruxMaps, as described in the manual https://www.oruxmaps.com/oruxmapsmanual_en.pdf
2. QGIS
- Go to Processing Toolbox in QGIS.
- Raster tools, Generate XYZ tiles (MBTiles)
- this directly saves the mbtiles file.
- reasonably fast (about half a day), but the files are still massive
Other options:
- "Vector Tiles" item in the Processing Toolbox. Export as XYZ mbtiles. OruxMaps does not recognize the files.
- I've read somewhere that OruxMaps can read shapefiles directly, but this did not work for me.
- Converting the shapefile to KML might work for small files, but not for large maps.
- In theory there is a way shp->osm->map, as described in the Locus link above. This should be the best way, as it creates a vector map. Merkaartor does not load my shapefiles. Requires a lot of manual work
- there is a script shp2osm. First need ogr2ogr to convert the point coordinates to WGS84. https://wiki.openstreetmap.org/wiki/Shp2osm
- Maps could be exported as geo pdf, which Orux reads nicely. I haven't tried, because my map is too large, but one could write a script that automatically tiles the map into many pdfs. Files are still rastered, so I don't see any advantage over the rastered mbtiles.
- QTiles does not seem to be supported anymore, but option 2 seems to be doing the same without a plugin.
I have some results. It is surprising how painful the conversion between map file formats is, and how badly it is documented. There seems to be no easy way to get from QGIS to mapsforge .map files.
I've collected all the information I have so far, hopefully it will be helpful for someone else:
The best two ways to export QGIS to Orux seem to be mbtiles. Sadly so far only raster data, but Orux loads even very large files reasonably fast.
1. QGIS with QMetaTiles Plugin
(This took a long time on my machine and I did not let it finish. QMetaTiles would have taken a week)
- Install QMetaTiles
- Run plugin, save as zip file
- Install MOBAC
- create a local tile file and put in mapsources folder, as described here: https://mobac.sourceforge.io/wiki/index.php/Custom_XML_Map_Sources#Local_Tile_files
<?xml version="1.0" encoding="UTF-8"?>
<localTileZip>
<name>Custom map from tile zips</name>
<sourceType>QUADKEY</sourceType>
<zipFile>D:\MOBAC\LocalTiles\MapCruncher_test.zip</zipFile>
<backgroundColor>#000000</backgroundColor>
</localTileZip>
- create a MOBAC sqlite file for OruxMaps, as described in the manual https://www.oruxmaps.com/oruxmapsmanual_en.pdf
2. QGIS
- Go to Processing Toolbox in QGIS.
- Raster tools, Generate XYZ tiles (MBTiles)
- this directly saves the mbtiles file.
- reasonably fast (about half a day), but the files are still massive
Other options:
- "Vector Tiles" item in the Processing Toolbox. Export as XYZ mbtiles. OruxMaps does not recognize the files.
- I've read somewhere that OruxMaps can read shapefiles directly, but this did not work for me.
- Converting the shapefile to KML might work for small files, but not for large maps.
- In theory there is a way shp->osm->map, as described in the Locus link above. This should be the best way, as it creates a vector map. Merkaartor does not load my shapefiles. Requires a lot of manual work
- there is a script shp2osm. First need ogr2ogr to convert the point coordinates to WGS84. https://wiki.openstreetmap.org/wiki/Shp2osm
- Maps could be exported as geo pdf, which Orux reads nicely. I haven't tried, because my map is too large, but one could write a script that automatically tiles the map into many pdfs. Files are still rastered, so I don't see any advantage over the rastered mbtiles.
- QTiles does not seem to be supported anymore, but option 2 seems to be doing the same without a plugin.