export des PK pour merour

This commit is contained in:
MaelREBOUX 2021-11-07 14:21:46 +01:00
parent c05d9ba256
commit 3f1be575df
2 changed files with 34 additions and 1 deletions

32
scripts_v2/phase_3_export.sh Executable file
View file

@ -0,0 +1,32 @@
#! /bin/bash
# exit dès que qqch se passe mal
set -e
# sortir si "unbound variable"
#set -u
if [ -z "$1" ]
then
echo "Pas de millésime en argument --> stop"
exit 1
fi
# lecture du fichier de configuration
. config.sh
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo " Export des données phase 3 pour le millésime $millesime"
echo ""
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ""
echo " Exports GeoJSON pour umap"
rm -f $rep_data/phase_2_trace_secteur.geojson
ogr2ogr -f "GeoJSON" $rep_data/phase_3_pk.geojson PG:"host=$DB_HOST port=$DB_PORT user=$DB_USER password=$DB_PASSWD dbname=$DB_NAME" phase_3_pk_4326
echo " fait"

View file

@ -683,7 +683,8 @@ CREATE VIEW phase_3_pk_4326 AS
way_osm_id, way_highway, way_type, way_oneway, way_ref,
way_name_fr, way_name_br,
ST_Transform(the_geom,4326)::geometry(Point, 4326) AS the_geom
FROM phase_3_pk ;
FROM phase_3_pk
ORDER BY pk_id;
ALTER TABLE phase_3_pk_4326 OWNER TO redadeg;