summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconvert70
1 files changed, 48 insertions, 22 deletions
diff --git a/convert b/convert
index 70a73b3..ca60c24 100755
--- a/convert
+++ b/convert
@@ -30,6 +30,10 @@ fi
[ -f "bounds.zip" ] || \
wget -nd 'http://osm2.pleiades.uni-wuppertal.de/bounds/latest/bounds.zip'
+needsRecompilation=false
+
+nextId="63240001"
+
for country in "${countries[@]}"
do
baseName="${country}-latest.osm.pbf"
@@ -39,6 +43,16 @@ do
then
rm -f "${baseName}"
wget -nd "${dlItem}"
+ needsRecompilation=true
+ fi
+
+ if [ ! -d "${baseNameDir}" ]
+ then
+ needsRecompilation=true
+ fi
+
+ if ${needsRecompilation}
+ then
if [ -d "${baseNameDir}" ]
then
if ls "${baseNameDir}" | grep -q ''
@@ -47,29 +61,41 @@ do
fi
rmdir "${baseNameDir}"
fi
- fi
-
- baseName="${country}-latest.osm.pbf"
- baseNameDir="${country}-latest_dir"
- [ -d "${baseNameDir}" ] && continue
+ mkdir "${baseNameDir}"
+ /usr/lib/jvm/java-8-openjdk/jre/bin/java -jar /usr/share/java/splitter/splitter.jar \
+ --output-dir="${baseNameDir}" \
+ --mapid="${nextId}" \
+ "${baseName}"
+ fi
- mkdir "${baseNameDir}"
- (
- cd "${baseNameDir}"
- /usr/lib/jvm/java-8-openjdk/jre/bin/java -jar /usr/share/java/splitter/splitter.jar "../${baseName}"
- )
+ nextId=$[
+ $(
+ ls -1 "${baseNameDir}" | \
+ grep '^6324....\.osm\.pbf$' | \
+ cut -d. -f1 | \
+ sort -n | \
+ tail -n1
+ )
+ +1
+ ]
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 \
- --family-name="OpenStreetmap mkgmap" \
- --area-name="parts of europe" \
- --max-jobs="${numJobs}" \
- *-latest_dir/6324????.osm.pbf
+if ${needsRecompilation}
+then
+ /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 \
+ --generate-sea \
+ --index \
+ --gmapsupp \
+ --family-name="OpenStreetmap mkgmap" \
+ --area-name="parts of europe" \
+ --max-jobs="${numJobs}" \
+ --remove-ovm-work-files \
+ *-latest_dir/6324????.osm.pbf
+ rm -f 6324????.img
+fi