26 lines
917 B
Bash
Executable file
26 lines
917 B
Bash
Executable file
#!/bin/bash
|
|
# scripts/04_import_geocoding.sh
|
|
# Download Photon's pre-built country geocoding index from GraphHopper.
|
|
# Uses the 1.0 stable release which matches komoot/photon:latest.
|
|
|
|
set -euo pipefail
|
|
|
|
PHOTON_DATA="/data/photon"
|
|
# Full country name as used in the GraphHopper download path
|
|
COUNTRY="${PHOTON_COUNTRY:-netherlands}"
|
|
PHOTON_VERSION="${PHOTON_VERSION:-1.0}"
|
|
|
|
mkdir -p "$PHOTON_DATA"
|
|
|
|
PHOTON_URL="https://download1.graphhopper.com/public/europe/${COUNTRY}/photon-db-${COUNTRY}-${PHOTON_VERSION}-latest.tar.bz2"
|
|
|
|
echo "=== Downloading Photon index: $PHOTON_URL ==="
|
|
|
|
wget -O "${PHOTON_DATA}/photon-db.tar.bz2" "$PHOTON_URL"
|
|
|
|
echo "=== Extracting Photon index ==="
|
|
pbzip2 -cd "${PHOTON_DATA}/photon-db.tar.bz2" | tar x -C "$PHOTON_DATA"
|
|
rm "${PHOTON_DATA}/photon-db.tar.bz2"
|
|
|
|
echo "Photon index extracted to $PHOTON_DATA"
|
|
echo "Add a volume mount to the photon service: ../data/photon:/photon/photon_data"
|