Further changes to duration handling

This commit is contained in:
DennisOSRM 2013-01-30 14:03:21 +01:00
parent 9ecfed4e56
commit adf0c726ef

View File

@ -136,8 +136,7 @@ function way_function (way, numberOfNodesInWay)
end
-- Handling ferries and piers
if (speed_profile[route] ~= nil and speed_profile[route] > 0)
then
if (speed_profile[route] ~= nil and speed_profile[route] > 0) then
if durationIsValid(duration) then
way.duration = math.max( parseDuration(duration), 1 );
end
@ -145,7 +144,7 @@ function way_function (way, numberOfNodesInWay)
if speed_profile[route] ~= nil then
highway = route;
end
if not way.duration > 0 then
if tonumber(way.duration) < 0 then
way.speed = speed_profile[highway]
end
end
@ -166,6 +165,11 @@ function way_function (way, numberOfNodesInWay)
way.speed = math.min(speed_profile["default"], maxspeed)
end
if durationIsValid(duration) then
way.duration = math.max( parseDuration(duration), 1 );
end
-- Set access restriction flag if access is allowed under certain restrictions only
if access ~= "" and access_tag_restricted[access] then
way.is_access_restricted = true