v07
This commit is contained in:
+13
-16
@@ -1,18 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# Compatibility shim. No manually supplied POI XML files are required anymore.
|
||||
# Preferred: python3 scripts/build_bgmountains.py --img gmapsupp.img --download-creator --out ./build/out
|
||||
set -euo pipefail
|
||||
# Usage: build_obf.sh /path/OsmAndMapCreator map.osm[.gz] [--poi-types full-poi_types.xml] [--rendering-types full-rendering_types.xml]
|
||||
if (( $# < 2 )); then echo "Usage: $0 CREATOR_DIR MAP.osm[.gz] [--poi-types FILE] [--rendering-types FILE]" >&2;exit 2;fi
|
||||
creator="$1"; input="$2";shift 2
|
||||
[[ -f "$creator/utilities.sh" && -f "$input" ]] || { echo 'Missing OsmAnd utilities.sh or map input' >&2;exit 1; }
|
||||
args=(generate-obf-no-address "$input")
|
||||
while (( $# > 0 )); do
|
||||
case "$1" in
|
||||
--poi-types|--rendering-types)
|
||||
(( $# >= 2 )) || { echo "Missing file after $1" >&2;exit 2; }
|
||||
[[ -f "$2" ]] || { echo "Config not found: $2" >&2;exit 2; }
|
||||
args+=("$1=$2");shift 2;;
|
||||
*) echo "Unknown option: $1" >&2;exit 2;;
|
||||
esac
|
||||
done
|
||||
export JAVA_OPTS="${JAVA_OPTS:--Xms256M -Xmx4096M}"
|
||||
"$creator/utilities.sh" "${args[@]}"
|
||||
if (( $# < 2 )); then
|
||||
echo "Usage: $0 CREATOR_DIR INPUT_v0.7.osm[.gz] [OUTPUT_DIR]" >&2
|
||||
echo "Recommended instead: python3 scripts/build_bgmountains.py --img gmapsupp.img --download-creator --out ./build/out" >&2
|
||||
exit 2
|
||||
fi
|
||||
creator="$1"; osm="$2"; out="${3:-$(dirname "$osm")/rebuilt-obf}"
|
||||
root="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
source_dir="$(dirname "$osm")"
|
||||
args=(--osm "$osm" --creator "$creator" --out "$out")
|
||||
if [[ -f "$source_dir/poi-types.csv" ]]; then args+=(--catalog "$source_dir/poi-types.csv"); fi
|
||||
exec python3 "$root/scripts/build_bgmountains.py" "${args[@]}"
|
||||
|
||||
Reference in New Issue
Block a user