ar_redadeg/scripts/update_osm_roads_pgr.sh
2019-05-04 12:19:32 +02:00

33 lines
693 B
Bash
Executable file

#!/bin/bash
set -e
set -u
PSQL=/usr/bin/psql
DB_HOST=localhost
DB_NAME=redadeg
DB_USER=redadeg
cd /data/www/vhosts/ar-redadeg_openstreetmap_bzh/htdocs/scripts/
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo " Mise à jour des couches de routage"
echo ""
echo " prend environ 5 min"
echo ""
# cette couche vient d'une base osm donc il faut la recharger
$PSQL -h $DB_HOST -U $DB_USER -d $DB_NAME -c "TRUNCATE TABLE public.osm_roads;"
$PSQL -h $DB_HOST -U $DB_USER -d $DB_NAME < data/osm_roads.sql
# maj de la topologie de la couche osm_roads_pgr qui sert au routage
$PSQL -h $DB_HOST -U $DB_USER -d $DB_NAME < update_osm_roads_pgr.sql
echo "fini"
echo ""