diff options
Diffstat (limited to 'convert')
-rwxr-xr-x | convert | 65 |
1 files changed, 65 insertions, 0 deletions
@@ -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 |