#!/bin/bash # scripts/05_import_routing.sh PBF_FILE="/data/osm/region.osm.pbf" OSRM_DATA="/data/osrm" # Process each profile: driving, walking, cycling for PROFILE in car foot bicycle; do PROFILE_DIR="${OSRM_DATA}/${PROFILE}" mkdir -p "$PROFILE_DIR" cp "$PBF_FILE" "${PROFILE_DIR}/region.osm.pbf" # Step 1: Extract — parse the PBF and produce an .osrm file # Uses the appropriate profile from OSRM's bundled profiles osrm-extract \ --profile /opt/osrm-profiles/${PROFILE}.lua \ --threads 4 \ "${PROFILE_DIR}/region.osm.pbf" # Step 2: Partition — create a recursive multi-level partition osrm-partition \ "${PROFILE_DIR}/region.osrm" # Step 3: Customize — compute edge weights for the partition osrm-customize \ "${PROFILE_DIR}/region.osrm" echo "OSRM ${PROFILE} profile ready." done echo "All OSRM profiles processed."