From f541885e6940a2d0f219f70fdfaa9aba1ca451c1 Mon Sep 17 00:00:00 2001 From: James Addison Date: Mon, 9 May 2022 16:58:16 +0100 Subject: [PATCH] Permit 'cycleway:both' way key to populate both left-and-right cycleway definitions --- profiles/bicycle.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 223954f02..32714fbb7 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -276,8 +276,8 @@ function handle_bicycle_tags(profile,way,result,data) data.oneway = way:get_value_by_key("oneway") data.oneway_bicycle = way:get_value_by_key("oneway:bicycle") data.cycleway = way:get_value_by_key("cycleway") - data.cycleway_left = way:get_value_by_key("cycleway:left") - data.cycleway_right = way:get_value_by_key("cycleway:right") + data.cycleway_left = way:get_value_by_key("cycleway:left") or way:get_value_by_key("cycleway:both") + data.cycleway_right = way:get_value_by_key("cycleway:right") or way:get_value_by_key("cycleway:both") data.duration = way:get_value_by_key("duration") data.service = way:get_value_by_key("service") data.foot = way:get_value_by_key("foot") @@ -370,6 +370,12 @@ function speed_handler(profile,way,result,data) end function oneway_handler(profile,way,result,data) + -- explicit twoway + local cycleway_both = way:get_value_by_key("cycleway:both") + if cycleway_both and profile.cycleway_tags[cycleway_both] then + return + end + -- oneway data.implied_oneway = data.junction == "roundabout" or data.junction == "circular" or data.highway == "motorway" data.reverse = false