29 lines
702 B
Bash
Executable File
29 lines
702 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
mkdir -p data/osm data/postgis
|
|
|
|
PBF="data/osm/netherlands-latest.osm.pbf"
|
|
URL="https://download.geofabrik.de/europe/netherlands-latest.osm.pbf"
|
|
|
|
if [[ ! -s "$PBF" ]]; then
|
|
echo "Downloading Netherlands OSM extract..."
|
|
curl -L --fail --continue-at - -o "$PBF" "$URL"
|
|
else
|
|
echo "Using existing $PBF"
|
|
fi
|
|
|
|
echo "Starting PostGIS..."
|
|
docker compose up -d postgis
|
|
|
|
echo "Waiting for PostGIS healthcheck..."
|
|
until docker compose exec -T postgis pg_isready -U adres -d adresanalyse >/dev/null 2>&1; do
|
|
sleep 2
|
|
done
|
|
|
|
echo "Importing supermarkets and schools from full Netherlands OSM extract..."
|
|
python3 osm-poi-import.py "$PBF"
|
|
|
|
echo "Done."
|