correction suppression secteur name
This commit is contained in:
parent
a22e865349
commit
9b73d34d2a
|
@ -114,19 +114,19 @@ CREATE TABLE phase_1_pk_auto
|
||||||
DROP VIEW IF EXISTS phase_1_pk_auto ;
|
DROP VIEW IF EXISTS phase_1_pk_auto ;
|
||||||
CREATE VIEW phase_1_pk_auto AS
|
CREATE VIEW phase_1_pk_auto AS
|
||||||
SELECT
|
SELECT
|
||||||
uid, secteur, ordre, km, km_reel,
|
uid, secteur_id, ordre, km, km_reel,
|
||||||
ST_Line_Interpolate_Point(the_geom, 1)::geometry(Point, 2154) AS the_geom
|
ST_Line_Interpolate_Point(the_geom, 1)::geometry(Point, 2154) AS the_geom
|
||||||
FROM phase_1_trace_troncons
|
FROM phase_1_trace_troncons
|
||||||
ORDER BY secteur ASC, ordre ASC, km ASC ;
|
ORDER BY secteur_id ASC, ordre ASC, km ASC ;
|
||||||
|
|
||||||
-- la même mais en 4326 pour export
|
-- la même mais en 4326 pour export
|
||||||
DROP VIEW IF EXISTS phase_1_pk_auto_4326 ;
|
DROP VIEW IF EXISTS phase_1_pk_auto_4326 ;
|
||||||
CREATE VIEW phase_1_pk_auto_4326 AS
|
CREATE VIEW phase_1_pk_auto_4326 AS
|
||||||
SELECT
|
SELECT
|
||||||
uid, secteur, ordre, km, km_reel,
|
uid, secteur_id, ordre, km, km_reel,
|
||||||
ST_Transform(the_geom,4326)::geometry(Point, 4326) AS the_geom
|
ST_Transform(the_geom,4326)::geometry(Point, 4326) AS the_geom
|
||||||
FROM phase_1_pk_auto
|
FROM phase_1_pk_auto
|
||||||
ORDER BY secteur ASC, ordre ASC, km ASC ;
|
ORDER BY secteur_id ASC, ordre ASC, km ASC ;
|
||||||
|
|
||||||
ALTER TABLE phase_1_pk_auto OWNER to redadeg;
|
ALTER TABLE phase_1_pk_auto OWNER to redadeg;
|
||||||
ALTER TABLE phase_1_pk_auto_4326 OWNER to redadeg;
|
ALTER TABLE phase_1_pk_auto_4326 OWNER to redadeg;
|
||||||
|
|
|
@ -21,13 +21,13 @@ SET longueur = TRUNC( ST_Length(the_geom)::numeric / 1000 , 2) ;
|
||||||
TRUNCATE phase_1_trace_4326 ;
|
TRUNCATE phase_1_trace_4326 ;
|
||||||
INSERT INTO phase_1_trace_4326
|
INSERT INTO phase_1_trace_4326
|
||||||
SELECT
|
SELECT
|
||||||
ogc_fid,
|
t.ogc_fid,
|
||||||
section_nom::text, -- name
|
s.nom_br AS name,
|
||||||
secteur_id::int,
|
t.secteur_id::int,
|
||||||
ordre::int,
|
t.ordre::int,
|
||||||
longueur,
|
t.longueur,
|
||||||
ST_Transform(the_geom,4326) AS the_geom
|
ST_Transform(t.the_geom,4326) AS the_geom
|
||||||
FROM phase_1_trace
|
FROM phase_1_trace t JOIN secteur s ON t.secteur_id = s.id
|
||||||
ORDER BY secteur_id ASC, ordre ASC ;
|
ORDER BY secteur_id ASC, ordre ASC ;
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ INSERT INTO phase_1_trace_troncons
|
||||||
SELECT
|
SELECT
|
||||||
row_number() over() as uid,
|
row_number() over() as uid,
|
||||||
secteur_id,
|
secteur_id,
|
||||||
section_nom,
|
|
||||||
ordre,
|
ordre,
|
||||||
NULL AS km,
|
NULL AS km,
|
||||||
NULL AS km_reel,
|
NULL AS km_reel,
|
||||||
|
@ -58,7 +57,6 @@ INSERT INTO phase_1_trace_troncons
|
||||||
(SELECT
|
(SELECT
|
||||||
ogc_fid,
|
ogc_fid,
|
||||||
secteur_id,
|
secteur_id,
|
||||||
section_nom,
|
|
||||||
ordre,
|
ordre,
|
||||||
ST_LineMerge(the_geom)::geometry(LineString,2154) AS the_geom,
|
ST_LineMerge(the_geom)::geometry(LineString,2154) AS the_geom,
|
||||||
ST_Length(the_geom) As length
|
ST_Length(the_geom) As length
|
||||||
|
|
Loading…
Reference in a new issue