Skip to content

Commit e28e439

Browse files
TheMarexNate-WesselCopilot
authored
cycleway value should fall back to cycleway:both if available (#7314)
* cycleway value should fall back to cycleway:both if available * Add small test for cycleway:both * Add changelog entry * Update profiles/bicycle.lua Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Nate Wessel <nate@natewessel.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 00565a7 commit e28e439

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- CHANGED: Upgrade Cucumber-js to v12 [#7221](https://github.com/Project-OSRM/osrm-backend/pull/7221)
2222
- CHANGED: Add libcap-setcap to alpine dockerfile [#7241](https://github.com/Project-OSRM/osrm-backend/issues/7241)
2323
- FIXED: Minor misspellings found in source code, comments and documents [#7215](https://github.com/Project-OSRM/osrm-backend/pull/7215)
24+
- FIXED: Use `cycleway:both` if available. [#6179](https://github.com/Project-OSRM/osrm-backend/issues/6179)
2425

2526
# 6.0.0
2627
- Changes from 6.0.0 RC2: None

features/bicycle/cycleway.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,13 @@ Feature: Bike - Cycle tracks/lanes
9797
| residential | track | yes | 15 km/h | 4 km/h +-1 |
9898
| cycleway | track | yes | 15 km/h | 4 km/h +-1 |
9999
| footway | track | yes | 15 km/h | 4 km/h +-1 |
100+
101+
Scenario: Bike - Cycleway should fall back to cycleway:both
102+
Then routability should be
103+
| highway | cycleway:both | forw | backw |
104+
| motorway | track | x | |
105+
| motorway | lane | x | |
106+
| motorway | shared | x | |
107+
| primary | track | x | x |
108+
| primary | lane | x | x |
109+
| primary | shared | x | x |

profiles/bicycle.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ function handle_bicycle_tags(profile,way,result,data)
306306
data.barrier = way:get_value_by_key("barrier")
307307
data.oneway = way:get_value_by_key("oneway")
308308
data.oneway_bicycle = way:get_value_by_key("oneway:bicycle")
309-
data.cycleway = way:get_value_by_key("cycleway")
309+
local cycleway = way:get_value_by_key("cycleway")
310+
data.cycleway = cycleway and cycleway or way:get_value_by_key("cycleway:both")
310311
data.cycleway_left = way:get_value_by_key("cycleway:left")
311312
data.cycleway_right = way:get_value_by_key("cycleway:right")
312313
data.duration = way:get_value_by_key("duration")

0 commit comments

Comments
 (0)