Skip to content

Commit

Permalink
Don’t route on motorroads by foot or bicycle (Project-OSRM#6697)
Browse files Browse the repository at this point in the history
  • Loading branch information
mangerlahn committed Oct 5, 2023
1 parent 5723eaa commit 7f1d847
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion profiles/bicycle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,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

0 comments on commit 7f1d847

Please sign in to comment.