correct Photon download URL

This commit is contained in:
Shautvast 2026-03-30 11:53:15 +02:00
parent ff05801c3f
commit 09be2264f0

View file

@ -1,27 +1,22 @@
#!/bin/bash #!/bin/bash
# scripts/04_import_geocoding.sh # scripts/04_import_geocoding.sh
# Download Photon's pre-built country geocoding index. # Download Photon's pre-built country geocoding index from GraphHopper.
# This avoids needing to run Nominatim (heavy, needs Java). # Uses the 1.0 stable release which matches komoot/photon:latest.
# Photon provides ready-to-use country extracts.
set -euo pipefail set -euo pipefail
PHOTON_DATA="/data/photon" PHOTON_DATA="/data/photon"
# Change COUNTRY_CODE to match your region (nl=Netherlands, de=Germany, fr=France, etc.) # Full country name as used in the GraphHopper download path
COUNTRY_CODE="${PHOTON_COUNTRY_CODE:-nl}" COUNTRY="${PHOTON_COUNTRY:-netherlands}"
PHOTON_VERSION="${PHOTON_VERSION:-1.0}"
mkdir -p "$PHOTON_DATA" mkdir -p "$PHOTON_DATA"
echo "=== Downloading Photon index for country: $COUNTRY_CODE ===" PHOTON_URL="https://download1.graphhopper.com/public/europe/${COUNTRY}/photon-db-${COUNTRY}-${PHOTON_VERSION}-latest.tar.bz2"
# Photon country extracts from GraphHopper (maintained by komoot/photon project) echo "=== Downloading Photon index: $PHOTON_URL ==="
PHOTON_URL="https://download1.graphhopper.com/public/extracts/by-country-code/${COUNTRY_CODE}/photon-db-${COUNTRY_CODE}-latest.tar.bz2"
wget -O "${PHOTON_DATA}/photon-db.tar.bz2" "$PHOTON_URL" wget -O - "$PHOTON_URL" | bzip2 -cd | tar x -C "$PHOTON_DATA"
echo "=== Extracting Photon index ===" echo "Photon index extracted to $PHOTON_DATA"
tar -xjf "${PHOTON_DATA}/photon-db.tar.bz2" -C "$PHOTON_DATA" echo "Add a volume mount to the photon service: ../data/photon:/photon/photon_data"
rm "${PHOTON_DATA}/photon-db.tar.bz2"
echo "Photon index ready at $PHOTON_DATA"
echo "Mount $PHOTON_DATA/photon_data into the photon container as /photon/photon_data"