From 687e4af31b6583c347a2a4dc3a3f27b21b2a84d0 Mon Sep 17 00:00:00 2001 From: "amaury.zarzelli" Date: Tue, 19 Sep 2023 15:45:22 +0200 Subject: [PATCH] fix(cost-calc): urbain can now be NULL in bduni --- sql/bdtopo_v3.3.sql | 5 ++++- sql/bduni_convert.sql | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sql/bdtopo_v3.3.sql b/sql/bdtopo_v3.3.sql index 51e2f5d..dfeb7c7 100644 --- a/sql/bdtopo_v3.3.sql +++ b/sql/bdtopo_v3.3.sql @@ -190,7 +190,10 @@ CREATE TEMP TABLE IF NOT EXISTS bduni_troncon AS -- TODO: remove t.bande_cyclable as bande_cyclable, t.reserve_aux_bus as reserve_aux_bus, - t.urbain as urbain, + (CASE + WHEN t.urbain IS NULL THEN 0 + ELSE t.urbain + END) as urbain, t.acces_pieton as acces_pieton, t.nature_de_la_restriction as nature_de_la_restriction, t.restriction_de_hauteur as restriction_de_hauteur, diff --git a/sql/bduni_convert.sql b/sql/bduni_convert.sql index 022c041..0751a15 100644 --- a/sql/bduni_convert.sql +++ b/sql/bduni_convert.sql @@ -161,6 +161,7 @@ CREATE TEMP TABLE IF NOT EXISTS bduni_troncon AS t.sens_de_circulation as sens_de_circulation, (CASE WHEN t.vitesse_moyenne_vl=1 THEN 0 + WHEN t.vitesse_moyenne_vl IS NULL THEN 0 ELSE t.vitesse_moyenne_vl::integer END) as vitesse_moyenne_vl, @@ -188,7 +189,10 @@ CREATE TEMP TABLE IF NOT EXISTS bduni_troncon AS -- TODO: remove t.bande_cyclable as bande_cyclable, t.reserve_aux_bus as reserve_aux_bus, - t.urbain as urbain, + (CASE + WHEN t.urbain IS NULL THEN 0 + ELSE t.urbain + END) as urbain, t.acces_pieton as acces_pieton, t.nature_de_la_restriction as nature_de_la_restriction, t.restriction_de_hauteur as restriction_de_hauteur,