Use correctly traffic light penalty for no_turn turns

This commit is contained in:
Michael Krasnyk 2017-07-03 12:18:35 +02:00
parent e2e279bc85
commit 8a404ea850

View File

@ -405,6 +405,7 @@ function turn_function (turn)
if turn.direction_modifier == direction_modifier.u_turn then if turn.direction_modifier == direction_modifier.u_turn then
turn.duration = turn.duration + profile.u_turn_penalty turn.duration = turn.duration + profile.u_turn_penalty
end end
end
-- for distance based routing we don't want to have penalties based on turn angle -- for distance based routing we don't want to have penalties based on turn angle
if properties.weight_name == 'distance' then if properties.weight_name == 'distance' then
@ -412,7 +413,7 @@ function turn_function (turn)
else else
turn.weight = turn.duration turn.weight = turn.duration
end end
end
if properties.weight_name == 'routability' then if properties.weight_name == 'routability' then
-- penalize turns from non-local access only segments onto local access only tags -- penalize turns from non-local access only segments onto local access only tags
if not turn.source_restricted and turn.target_restricted then if not turn.source_restricted and turn.target_restricted then