Skip to content

Commit 877ea00

Browse files
authored
Don’t route on motorroads by foot or bicycle (#6697) (#7316)
1 parent 58bf4c1 commit 877ea00

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
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-
- Profile:
24+
- Profiles:
25+
- FIXED: Bicycle and foot profiles now don't route on motor roads [#6697](https://github.com/Project-OSRM/osrm-backend/pull/6697)
2526
- FIXED: Use `cycleway:both` if available. [#6179](https://github.com/Project-OSRM/osrm-backend/issues/6179)
2627
- FIXED: Correctly limit exclude classes to 7. [#7322](https://github.com/Project-OSRM/osrm-backend/pull/7322)
2728

features/bicycle/way.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ Feature: Bike - Accessability of different way types
4040
| highway | man_made | bothw |
4141
| (nil) | (nil) | |
4242
| (nil) | pier | x |
43+
44+
Scenario: Bike - Motorroad
45+
Then routability should be
46+
| highway | motorroad | bothw |
47+
| primary | (nil) | x |
48+
| primary | yes | |

features/foot/way.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ Feature: Foot - Accessability of different way types
4242
| footway | | | x |
4343
| proposed | | | |
4444
| proposed | yes | yes | |
45+
46+
Scenario: Foot - Motorroad
47+
Then routability should be
48+
| highway | motorroad | forw |
49+
| primary | (nil) | x |
50+
| primary | yes | |

profiles/bicycle.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ function setup()
221221
avoid = Set {
222222
'impassable',
223223
'construction',
224-
'proposed'
224+
'proposed',
225+
'motorroad'
225226
}
226227
}
227228
end

profiles/foot.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ function setup()
7070

7171
avoid = Set {
7272
'impassable',
73-
'proposed'
73+
'proposed',
74+
'motorroad'
7475
},
7576

7677
speeds = Sequence {

profiles/lib/way_handlers.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ function WayHandlers.blocked_ways(profile,way,result,data)
634634
return false
635635
end
636636

637+
-- motorroad
638+
if profile.avoid.motorroad and way:get_value_by_key("motorroad") == "yes" then
639+
return false
640+
end
641+
637642
-- In addition to the highway=construction tag above handle the construction=* tag
638643
-- http://wiki.openstreetmap.org/wiki/Key:construction
639644
-- https://taginfo.openstreetmap.org/keys/construction#values

0 commit comments

Comments
 (0)