Per chi aggiorna spesso le OpenMTBMap con sistema operativo Linux, riporto qua uno script tratto dal sito ufficiale
https://github.com/Maproom/qmapshack/wiki/DocMapsTipsRasterDEM#script
Per funzionare lo script richiede che siano installati wget, 7z e mkgmap
Lo script scaricherà la mappa Italia (ho predisposto anche Alpi e Svizzera, basta solo decommentare la riga corrispondente) e la convertirà nel file .img nella cartella Scaricati (volendo si può indicare direttamente dopo
QMSMAPDIR= la cartella contenente le mappe)
Per scaricare altre mappe occorrerà indicare il link dopo FILESRC= ; l’elenco lo trovate
qui
Il tema di visualizzazione è quello tradizionale per il desktop ma può essere modificato dopo TYPE=
Per creare lo script basterà copiare il contenuto del codice in un file, rinominarlo a piacimeto con estensione .sh e concedere i permessi di esecuzione.
Codice:
#! /bin/sh
# set -vx
# configuration
# Italia
FILESRC="http://ftp5.gwdg.de/pub/misc/openstreetmap/openmtbmap/odbl/mtbitaly.exe"
# Alpi
# FILESRC="http://ftp5.gwdg.de/pub/misc/openstreetmap/openmtbmap/odbl/mtbalps.exe"
# Svizzera
# FILESRC="http://ftp5.gwdg.de/pub/misc/openstreetmap/openmtbmap/odbl/mtbswitzerland.exe"
# Possible options for TYPE
# clas
# easy
# hike
# thin
# trad -- desktop
# wide
# wint
# see also https://openmtbmap.org/about-2/map-legend/
TYPE="trad"
QMSMAPDIR="${HOME}/Scaricati"
MKGMAP="mkgmap"
# code starts here, no changes below here required
error_check() {
if [ $1 != 0 ]; then
echo ${red}ERROR${NC}
exit 1
else
echo ${green}OK${NC}
fi
}
tool_check() {
which $1 2>&1 1>/dev/null
if [ $? != 0 ]; then
echo ${red}ERROR: $1 missing${NC}
exit 1
fi
}
red="\033[0;31m"
green="\033[0;32m"
NC="\033[0m"
TMP=`mktemp`
if [ ! -f "${TMP}" ]; then
echo ${red}ERROR: failed to get temp. file${NC}
exit 1
fi
tool_check "wget"
tool_check "7z"
${MKGMAP} >/dev/null 2>&1
if [ $? != 0 ]; then
echo ${red}ERROR: mkgmap can\'t be executed${NC}
echo ${red}ERROR: make sure MKGMAP is set properly in script configuration${NC}
exit 1
fi
echo -n " * Downloading... "
wget -q -O "$TMP" "$FILESRC"
error_check $?
echo -n " * Decompressing... "
7z e -o"${TMP}_" ${TMP} >/dev/null
error_check $?
# This is needed to extract the map code (e.g. by for Bavaria or bw for baden-wuerttemberg)
TYPE_FILE=$(basename ${TMP}_/${TYPE}*.TYP)
tmp=${TYPE_FILE#${TYPE}}
REGION=${tmp%\.TYP}
IMGFMT="%Y-%m-%d__${REGION}_OpenMTBMap.img"
FILETIME=`stat -c %Y ${TMP}`
IMGFILE=`date -d@${FILETIME} +"${IMGFMT}"`
echo -n " * Building ${IMGFILE}... "
cd "${TMP}_"
FID=`ls -x 7*.img | head -1 | cut -c1-4`
${MKGMAP} --show-profiles=1 --product-id=1 --family-id=${FID} --index --gmapsupp 6*.img 7*.img ${TYPE_FILE} >/dev/null
error_check $?
echo -n " * Moving gmapsupp.img to ${QMSMAPDIR}... "
mv "${TMP}_/gmapsupp.img" "${QMSMAPDIR}/${IMGFILE}"
error_check $?
echo -n " * Cleanup... "
rm -rf "${TMP}" "${TMP}_"
error_check $?