phase 2 post traitements

This commit is contained in:
MaelREBOUX 2021-10-22 12:17:02 +02:00
parent 5a7d474af1
commit 61e6251991
2 changed files with 17 additions and 3 deletions

View file

@ -60,7 +60,7 @@ INSERT INTO phase_2_trace_secteur
ST_COLLECT(the_geom) AS the_geom ST_COLLECT(the_geom) AS the_geom
FROM trace_ordered FROM trace_ordered
GROUP BY secteur_id GROUP BY secteur_id
ORDER BY secteur_id ;" >> /dev/null ORDER BY secteur_id ;"
# mise à jour des attributs # mise à jour des attributs
PGPASSWORD=$DB_PASSWD $PSQL -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -c \ PGPASSWORD=$DB_PASSWD $PSQL -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -c \
@ -126,10 +126,10 @@ SET
ELSE TRUNC( ST_Length(the_geom)::numeric , 0) ELSE TRUNC( ST_Length(the_geom)::numeric , 0)
END), END),
km = uid -- km redadeg km = uid -- km redadeg
WHERE secteur_id = $secteur_id;" WHERE secteur_id = $secteur_id;" >> /dev/null
PGPASSWORD=$DB_PASSWD $PSQL -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -c \ PGPASSWORD=$DB_PASSWD $PSQL -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -c \
"VACUUM ANALYZE phase_2_trace_troncons ;" "VACUUM ANALYZE phase_2_trace_troncons ;" >> /dev/null
echo " fait" echo " fait"

View file

@ -480,6 +480,20 @@ CREATE INDEX phase_2_trace_troncons_geom_idx ON phase_2_trace_troncons USING gis
ALTER TABLE phase_2_trace_troncons OWNER to redadeg; ALTER TABLE phase_2_trace_troncons OWNER to redadeg;
-- une vue en 4326 pour export
DROP VIEW IF EXISTS phase_2_trace_troncons_4326 ;
CREATE VIEW phase_2_trace_troncons_4326 AS
SELECT
uid, secteur_id, ordre, km_reel, longueur,
osm_id, highway, type, oneway, ref,
name_fr, name_br,
ST_Transform(the_geom,4326)::geometry(LineString, 4326) AS the_geom
FROM phase_2_trace_troncons ;
ALTER TABLE phase_2_trace_troncons_4326 OWNER to redadeg;
DROP VIEW IF EXISTS phase_2_tdb ; DROP VIEW IF EXISTS phase_2_tdb ;
CREATE VIEW phase_2_tdb AS CREATE VIEW phase_2_tdb AS
WITH total AS WITH total AS