Skip to content

Commit eb93e71

Browse files
committed
Change speed calculation so that we do not apply speed_reduction on motorways
1 parent 0ca9131 commit eb93e71

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

profiles/lib/way_handlers.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,17 @@ function WayHandlers.maxspeed(profile,way,result,data)
437437
forward = WayHandlers.parse_maxspeed(forward,profile)
438438
backward = WayHandlers.parse_maxspeed(backward,profile)
439439

440+
speed_reduction = profile.speed_reduction
441+
if data.highway == 'motorway' then
442+
speed_reduction = 1
443+
end
444+
440445
if forward and forward > 0 then
441-
result.forward_speed = forward * profile.speed_reduction
446+
result.forward_speed = forward * speed_reduction
442447
end
443448

444449
if backward and backward > 0 then
445-
result.backward_speed = backward * profile.speed_reduction
450+
result.backward_speed = backward * speed_reduction
446451
end
447452
end
448453

0 commit comments

Comments
 (0)