From 9d53dc55df11caf68faa275a20e093f61d74f46b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 14 Feb 2017 12:23:05 +0100 Subject: Initial commit --- convert | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 convert diff --git a/convert b/convert new file mode 100755 index 0000000..65302ee --- /dev/null +++ b/convert @@ -0,0 +1,65 @@ +#!/bin/bash + +set -e + +if [ "$(basename "$(pwd)")" != "work" ] +then + >&2 echo 'You should call this script within a directory called "work".' + exit 1 +fi + +mainUrl='https://download.geofabrik.de/europe/' +countries=( + austria + czech-republic + germany + italy + poland + slovakia +) + +[ -f "sea.zip" ] || \ + wget -nd 'http://osm2.pleiades.uni-wuppertal.de/sea/latest/sea.zip' +[ -f "bounds.zip" ] || \ + wget -nd 'http://osm2.pleiades.uni-wuppertal.de/bounds/latest/bounds.zip' + +for country in "${countries[@]}" +do + baseName="${country}-latest.osm.pbf" + baseNameDir="${country}-latest_dir" + dlItem="${mainUrl}${baseName}" + if [ ! -e "${baseName}" ] || ! wget -O - "${dlItem}.md5" 2> /dev/null | md5sum -c + then + rm -f "${baseName}" + wget -nd "${dlItem}" + if [ -d "${baseNameDir}" ] + then + if ls "${baseNameDir}" | grep -q '' + then + rm "${baseNameDir}"/* + fi + rmdir "${baseNameDir}" + fi + fi + + baseName="${country}-latest.osm.pbf" + baseNameDir="${country}-latest_dir" + + [ -d "${baseNameDir}" ] && continue + + mkdir "${baseNameDir}" + ( + cd "${baseNameDir}" + /usr/lib/jvm/java-8-openjdk/jre/bin/java -jar /usr/share/java/splitter/splitter.jar "../${baseName}" + ) +done + +/usr/lib/jvm/java-8-openjdk/jre/bin/java -jar /usr/share/java/mkgmap/mkgmap.jar \ + --route \ + --add-pois-to-lines \ + --add-pois-to-areas \ + --bounds=bounds.zip \ + --precomp-sea=sea.zip \ + --index \ + --gmapsupp \ + *-latest_dir/6324????.osm.pbf -- cgit v1.2.3-70-g09d2