Skip to content

Don’t route on motorroads by foot or bicycle (#6697) #6708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
- FIXED: Remove unused C++ headers [#7105](https://github.com/Project-OSRM/osrm-backend/pull/7105)
- Profiles:
- FIXED: Bicycle and foot profiles now don't route on proposed ways [#6615](https://github.com/Project-OSRM/osrm-backend/pull/6615)
- FIXED: Bicycle and foot profiles now don't route on motor roads [#6697](https://github.com/Project-OSRM/osrm-backend/pull/6697)
- ADDED: Add optional support of cargo bike exclusion and width to bicyle profile [#7044](https://github.com/Project-OSRM/osrm-backend/pull/7044)
- Routing:
- FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419)
Expand Down
6 changes: 6 additions & 0 deletions features/bicycle/way.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ Feature: Bike - Accessability of different way types
| highway | man_made | bothw |
| (nil) | (nil) | |
| (nil) | pier | x |

Scenario: Bike - Motorroad
Then routability should be
| highway | motorroad | bothw |
| (nil) | (nil) | x |
| (nil) | yes | |
6 changes: 6 additions & 0 deletions features/foot/way.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ Feature: Foot - Accessability of different way types
| footway | | | x |
| proposed | | | |
| proposed | yes | yes | |

Scenario: Foot - Motorroad
Then routability should be
| highway | motorroad | forw |
| (nil) | (nil) | x |
| (nil) | yes | |
3 changes: 2 additions & 1 deletion profiles/bicycle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ function setup()
avoid = Set {
'impassable',
'construction',
'proposed'
'proposed',
'motorroad'
}
}
end
Expand Down
3 changes: 2 additions & 1 deletion profiles/foot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ function setup()

avoid = Set {
'impassable',
'proposed'
'proposed',
'motorroad'
},

speeds = Sequence {
Expand Down
5 changes: 5 additions & 0 deletions profiles/lib/way_handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,11 @@ function WayHandlers.blocked_ways(profile,way,result,data)
return false
end

-- motorroad
if profile.avoid.motorroad and way:get_value_by_key("motorroad") == "yes" then
return false
end

-- In addition to the highway=construction tag above handle the construction=* tag
-- http://wiki.openstreetmap.org/wiki/Key:construction
-- https://taginfo.openstreetmap.org/keys/construction#values
Expand Down
Loading