From 7eafb48d209baf1b3a9ce789a7e563dc065f4a20 Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Wed, 19 Jul 2017 15:33:19 +0200 Subject: [PATCH] Introduces a construction whitelist in profiles --- profiles/bicycle.lua | 6 ++++++ profiles/car.lua | 7 +++++++ profiles/foot.lua | 2 ++ profiles/lib/handlers.lua | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 4fe779501..75f9fda9f 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -72,6 +72,12 @@ local profile = { restricted_highway_whitelist = Set { }, + construction_whitelist = Set { + 'no', + 'widening', + 'minor', + }, + access_tags_hierarchy = Sequence { 'bicycle', 'vehicle', diff --git a/profiles/car.lua b/profiles/car.lua index 7418f732f..90c23f67b 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -94,6 +94,13 @@ local profile = { 'access' }, + construction_whitelist = Set { + 'no', + 'widening', + 'minor', + }, + + service_tag_forbidden = Set { 'emergency_access' }, diff --git a/profiles/foot.lua b/profiles/foot.lua index c715b0c2a..e4722e557 100644 --- a/profiles/foot.lua +++ b/profiles/foot.lua @@ -61,6 +61,8 @@ local profile = { restricted_highway_whitelist = Set { }, + construction_whitelist = Set {}, + access_tags_hierarchy = Sequence { 'foot', 'access' diff --git a/profiles/lib/handlers.lua b/profiles/lib/handlers.lua index 235b019a7..b9d07bd8e 100644 --- a/profiles/lib/handlers.lua +++ b/profiles/lib/handlers.lua @@ -520,7 +520,7 @@ function Handlers.handle_blocked_ways(way,result,data,profile) local construction = way:get_value_by_key('construction') -- Of course there are negative tags to handle, too - if construction and construction ~= 'no' and construction ~= 'widening' and construction ~= 'minor' then + if construction and not profile.construction_whitelist[construction] then return false end end