adapatations suite modif structure des tables
This commit is contained in:
parent
a23c8deb68
commit
3fee1a3f2c
|
@ -3,14 +3,16 @@
|
||||||
TRUNCATE phase_1_trace_3948 ;
|
TRUNCATE phase_1_trace_3948 ;
|
||||||
INSERT INTO phase_1_trace_3948
|
INSERT INTO phase_1_trace_3948
|
||||||
SELECT
|
SELECT
|
||||||
ogc_fid, name,
|
ogc_fid,
|
||||||
secteur::int,
|
-- name AS secteur_nom,
|
||||||
|
secteur_id::int,
|
||||||
|
name,
|
||||||
ordre::int,
|
ordre::int,
|
||||||
0,
|
0 AS longueur,
|
||||||
ST_Transform(the_geom,3948) AS the_geom
|
ST_Transform(the_geom,3948) AS the_geom
|
||||||
FROM phase_1_trace_3857
|
FROM phase_1_trace_3857
|
||||||
WHERE ST_LENGTH(the_geom) > 0
|
WHERE ST_LENGTH(the_geom) > 0
|
||||||
ORDER BY secteur ASC, ordre ASC ;
|
ORDER BY secteur_id ASC, ordre ASC ;
|
||||||
|
|
||||||
-- mise à jour de la longueur 1 fois la géométrie passée en CC48
|
-- mise à jour de la longueur 1 fois la géométrie passée en CC48
|
||||||
UPDATE phase_1_trace_3948
|
UPDATE phase_1_trace_3948
|
||||||
|
@ -43,8 +45,9 @@ TRUNCATE phase_1_trace_troncons_3948 ;
|
||||||
INSERT INTO phase_1_trace_troncons_3948
|
INSERT INTO phase_1_trace_troncons_3948
|
||||||
SELECT
|
SELECT
|
||||||
row_number() over() as uid,
|
row_number() over() as uid,
|
||||||
secteur,
|
secteur_id,
|
||||||
ordre,
|
section_nom,
|
||||||
|
ordre,
|
||||||
NULL AS km,
|
NULL AS km,
|
||||||
NULL AS km_reel,
|
NULL AS km_reel,
|
||||||
NULL AS longueur,
|
NULL AS longueur,
|
||||||
|
@ -56,17 +59,18 @@ INSERT INTO phase_1_trace_troncons_3948
|
||||||
FROM
|
FROM
|
||||||
(SELECT
|
(SELECT
|
||||||
ogc_fid,
|
ogc_fid,
|
||||||
secteur,
|
secteur_id,
|
||||||
|
section_nom,
|
||||||
ordre,
|
ordre,
|
||||||
ST_LineMerge(the_geom)::geometry(LineString,3948) AS the_geom,
|
ST_LineMerge(the_geom)::geometry(LineString,3948) AS the_geom,
|
||||||
ST_Length(the_geom) As length
|
ST_Length(the_geom) As length
|
||||||
FROM phase_1_trace_3948
|
FROM phase_1_trace_3948
|
||||||
-- ce tri est le plus important
|
-- ce tri est le plus important
|
||||||
ORDER BY secteur ASC, ordre ASC
|
ORDER BY secteur_id ASC, ordre ASC
|
||||||
) AS t
|
) AS t
|
||||||
CROSS JOIN generate_series(0,10000) AS n
|
CROSS JOIN generate_series(0,10000) AS n
|
||||||
WHERE n*1000.00/length < 1
|
WHERE n*1000.00/length < 1
|
||||||
ORDER BY t.secteur ASC, t.ordre ASC ;
|
ORDER BY t.secteur_id ASC, t.ordre ASC ;
|
||||||
|
|
||||||
-- mise à jour des attributs
|
-- mise à jour des attributs
|
||||||
UPDATE phase_1_trace_troncons_3948
|
UPDATE phase_1_trace_troncons_3948
|
||||||
|
|
Loading…
Reference in a new issue