Merge pull request #1818 from gardster/side_road_tag_support
A side_road tag support for the OSRM car profile.
This commit is contained in:
commit
a14cb1fc06
@ -133,6 +133,8 @@ u_turn_penalty = 20
|
||||
traffic_signal_penalty = 2
|
||||
use_turn_restrictions = true
|
||||
|
||||
side_road_speed_multiplier = 0.8
|
||||
|
||||
local turn_penalty = 10
|
||||
-- Note: this biases right-side driving. Should be
|
||||
-- inverted for left-driving countries.
|
||||
@ -311,6 +313,14 @@ function way_function (way, result)
|
||||
return
|
||||
end
|
||||
|
||||
-- reduce speed on special side roads
|
||||
local sideway = way:get_value_by_key("side_road")
|
||||
if "yes" == sideway or
|
||||
"rotary" == sideway then
|
||||
result.forward_speed = result.forward_speed * side_road_speed_multiplier
|
||||
result.backward_speed = result.backward_speed * side_road_speed_multiplier
|
||||
end
|
||||
|
||||
-- reduce speed on bad surfaces
|
||||
local surface = way:get_value_by_key("surface")
|
||||
local tracktype = way:get_value_by_key("tracktype")
|
||||
|
Loading…
Reference in New Issue
Block a user