Commit 40c2811f authored by Jean-Benoist Leger's avatar Jean-Benoist Leger

We stop doing wrong with actions on import

parent edb6c545
BEGIN;
INSERT INTO rv_ways
(
SELECT
ways.id AS id
FROM
ways
WHERE
(
tags->'highway' NOT SIMILAR TO '(motorway|trunk|construction|steps|pedestrian|track)%'
OR
tags->'cycleway' NOT SIMILAR TO '(no|false)'
OR
tags->'bicycle' NOT SIMILAR TO '(no|false)'
)
);
INSERT INTO actions
(
SELECT
'N' AS data_type,
'C' AS action,
id
FROM nodes
);
SELECT sum(compute_edges_for_one_way(sub.id))
FROM
(
SELECT
rv_ways.id
FROM
rv_ways
) AS sub;
INSERT INTO actions
(
SELECT
'W' AS data_type,
'C' AS action,
id
FROM ways
);
SELECT updateRV();
-- etape 3 : on insere (ou re-insere) tous les noeuds crées (ou modifiés)
INSERT INTO rv_nodes
(
SELECT
n.id AS id,
get_height(ST_X(nodes.geom),ST_Y(nodes.geom)) AS height,
NULL::bigint AS cc,
nodes.geom AS geom
FROM
(
SELECT DISTINCT
way_nodes.node_id AS id
FROM
way_nodes
INNER JOIN
rv_ways ON way_nodes.way_id=rv_ways.id
) AS n
INNER JOIN
nodes ON nodes.id=n.id
);
DELETE FROM actions;
-- for the computation of cc
SELECT updateRV();
COMMIT;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment