diff --git a/features/bicycle/cycleway.feature b/features/bicycle/cycleway.feature index c04d7aabd16..fbee59f1d09 100644 --- a/features/bicycle/cycleway.feature +++ b/features/bicycle/cycleway.feature @@ -9,22 +9,38 @@ Feature: Bike - Cycle tracks/lanes Then routability should be | highway | cycleway | forw | backw | | motorway | | | | + | motorway | no | | | | motorway | track | x | | | motorway | lane | x | | | motorway | shared | x | | | motorway | share_busway | x | | | motorway | sharrow | x | | + | some_tag | | | | + | some_tag | no | | | | some_tag | track | x | x | | some_tag | lane | x | x | | some_tag | shared | x | x | | some_tag | share_busway | x | x | | some_tag | sharrow | x | x | + # residential ways may not have cycleways present but they should be routable + | residential | | x | x | + | residential | no | x | x | | residential | track | x | x | | residential | lane | x | x | | residential | shared | x | x | | residential | share_busway | x | x | | residential | sharrow | x | x | + Scenario: Bike - Bidirectional cycleways + Then routability should be + | highway | cycleway:both | forw | backw | + | primary | | x | x | + | primary | track | x | x | + | primary | opposite | x | x | + | motorway | | | | + | motorway | track | x | x | + | motorway | opposite | x | x | + Scenario: Bike - Left/right side cycleways on implied bidirectionals Then routability should be | highway | cycleway | cycleway:left | cycleway:right | forw | backw | @@ -97,3 +113,21 @@ Feature: Bike - Cycle tracks/lanes | residential | track | yes | 15 km/h | 4 km/h +-1 | | cycleway | track | yes | 15 km/h | 4 km/h +-1 | | footway | track | yes | 15 km/h | 4 km/h +-1 | + + Scenario: Bike - Cycleway on twoways, modes + Then routability should be + | highway | cycleway:both | forw | backw | + | motorway | no | | | + | motorway | track | cycling | cycling | + | residential | track | cycling | cycling | + | cycleway | track | cycling | cycling | + | footway | track | cycling | cycling | + + Scenario: Bike - Cycleway on twoways, speeds + Then routability should be + | highway | cycleway:both | forw | backw | + | motorway | no | | | + | motorway | track | 15 km/h | 15 km/h | + | residential | track | 15 km/h | 15 km/h | + | cycleway | track | 15 km/h | 15 km/h | + | footway | track | 15 km/h | 15 km/h | diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 223954f0219..32714fbb761 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