osrm startup helpers added

This commit is contained in:
muerwre 2018-08-27 15:51:26 +07:00
parent d9f83425f6
commit eb091cc1a4
14 changed files with 1928 additions and 0 deletions

19
osrm/lib/maxspeed.lua Normal file
View file

@ -0,0 +1,19 @@
local math = math
local MaxSpeed = {}
function MaxSpeed.limit(way,max,maxf,maxb)
if maxf and maxf>0 then
way.forward_speed = math.min(way.forward_speed, maxf)
elseif max and max>0 then
way.forward_speed = math.min(way.forward_speed, max)
end
if maxb and maxb>0 then
way.backward_speed = math.min(way.backward_speed, maxb)
elseif max and max>0 then
way.backward_speed = math.min(way.backward_speed, max)
end
end
return MaxSpeed