Hikingmaps

A collection of Hiking Maps based on CC licensed sources



Wanna build your own maps?

### the source

First of all you need an appropriate source. Many authorities offer their data in different ways, e.g. online
WMS server or static downloads in GeoPDF or GeoTIFF format. GeoTiff format is recommended for processing with GDAL. For our Howto we use the tiles provided on the BEV website.


### the build environment

Although it is possible to run this howto in Windows, it is much easier to set up a small Linux environment for it. Apart from a full Linux installation, you can also use a virtual machine or even simpler the
Windows Subsystem for Linux (WSL). This is done under Windows 10 with a simple command line:

wsl --install -d ubuntu


For more detailed instructions I recommend a visit to the
Microsoft or Ubuntu website. Otherwise, the further configuration is largely self-explanatory. After a reboot, the setup continues automatically and after defining a username and password, you have a working Ubuntu Linux installation.


In the next step we install GDAL and install some other dependencies for creating sqlite databases.

sudo apt update && sudo apt install gdal-bin python3-pip


## Dissolving dependencies for mbtiles2osmand
pip install pillow image


## Download mbtiles2osmand

wget https://raw.githubusercontent.com/tarwirdur/mbtiles2osmand/master/mbtiles2osmand.py




## Merge multiple tiff files into one with GDAL:
gdalwarp -co COMPRESS=JPEG -co JPEG_QUALITY=35 -co PHOTOMETRIC=YCBCR -co BIGTIFF=YES -co TILED=YES input-files*.tif output-file.tif


## Create *.vrt for QMapShack
gdalbuildvrt output.vrt output.tif


## convert Geotiff to mbtiles:
gdal_translate output.tif output.mbtiles



## define zoomlevels for OSMand:
gdaladdo -r nearest output.mbtiles 2 4 8 16



### convert mbtiles to sqlitedb with mbtiles2osmand.py:
python3 mbtiles2osmand.py --jpg 25 -f output.mbtiles output.sqlitedb