From 09be2264f0b84f5beab4f31f8442a0066df22b25 Mon Sep 17 00:00:00 2001 From: Shautvast Date: Mon, 30 Mar 2026 11:53:15 +0200 Subject: [PATCH] correct Photon download URL --- backend/scripts/04_import_geocoding.sh | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/backend/scripts/04_import_geocoding.sh b/backend/scripts/04_import_geocoding.sh index 9435cac..bdd3393 100755 --- a/backend/scripts/04_import_geocoding.sh +++ b/backend/scripts/04_import_geocoding.sh @@ -1,27 +1,22 @@ #!/bin/bash # scripts/04_import_geocoding.sh -# Download Photon's pre-built country geocoding index. -# This avoids needing to run Nominatim (heavy, needs Java). -# Photon provides ready-to-use country extracts. +# 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" -# Change COUNTRY_CODE to match your region (nl=Netherlands, de=Germany, fr=France, etc.) -COUNTRY_CODE="${PHOTON_COUNTRY_CODE:-nl}" +# Full country name as used in the GraphHopper download path +COUNTRY="${PHOTON_COUNTRY:-netherlands}" +PHOTON_VERSION="${PHOTON_VERSION:-1.0}" 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) -PHOTON_URL="https://download1.graphhopper.com/public/extracts/by-country-code/${COUNTRY_CODE}/photon-db-${COUNTRY_CODE}-latest.tar.bz2" +echo "=== Downloading Photon index: $PHOTON_URL ===" -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 ===" -tar -xjf "${PHOTON_DATA}/photon-db.tar.bz2" -C "$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" +echo "Photon index extracted to $PHOTON_DATA" +echo "Add a volume mount to the photon service: ../data/photon:/photon/photon_data"