43 lines
1.2 KiB
Bash
Executable file
43 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
# scripts/05_import_routing_host.sh
|
|
# Run this directly on the Pi host (not inside the importer container).
|
|
# OSRM tools only exist inside the osrm/osrm-backend image.
|
|
|
|
set -euo pipefail
|
|
|
|
DATA_DIR="${1:-$HOME/dev/maps/data}"
|
|
OSRM_DIR="${DATA_DIR}/osrm"
|
|
PBF_FILE="${DATA_DIR}/osm/region.osm.pbf"
|
|
|
|
if [ ! -f "$PBF_FILE" ]; then
|
|
echo "ERROR: PBF file not found at $PBF_FILE"
|
|
echo "Run 01_download.sh first."
|
|
exit 1
|
|
fi
|
|
|
|
for PROFILE in car foot bicycle; do
|
|
PROFILE_DIR="${OSRM_DIR}/${PROFILE}"
|
|
mkdir -p "$PROFILE_DIR"
|
|
cp "$PBF_FILE" "${PROFILE_DIR}/region.osm.pbf"
|
|
|
|
echo "=== Processing OSRM profile: $PROFILE ==="
|
|
|
|
podman run --rm \
|
|
-v "${PROFILE_DIR}:/data" \
|
|
docker.io/osrm/osrm-backend:latest \
|
|
osrm-extract -p "/opt/${PROFILE}.lua" /data/region.osm.pbf
|
|
|
|
podman run --rm \
|
|
-v "${PROFILE_DIR}:/data" \
|
|
docker.io/osrm/osrm-backend:latest \
|
|
osrm-partition /data/region.osrm
|
|
|
|
podman run --rm \
|
|
-v "${PROFILE_DIR}:/data" \
|
|
docker.io/osrm/osrm-backend:latest \
|
|
osrm-customize /data/region.osrm
|
|
|
|
echo "OSRM $PROFILE profile ready."
|
|
done
|
|
|
|
echo "All OSRM profiles processed."
|