Fixes how durations are parsed

This commit is contained in:
DennisOSRM 2013-01-27 23:01:37 +01:00
parent ccdc6f1a63
commit a92950d234
2 changed files with 2 additions and 5 deletions

View File

@ -162,8 +162,7 @@ function way_function (way, numberOfNodesInWay)
way.direction = Way.bidirectional
way.ignore_in_grid = true
if durationIsValid(duration) then
way.speed = math.max( parseDuration(duration) / math.max(1, numberOfNodesInWay-1) )
way.is_duration_set = true
way.duration = math.max( 1, parseDuration(duration) )
else
way.speed = route_speeds[route]
end

View File

@ -49,9 +49,7 @@ function way_function (way, numberOfNodesInWay)
way.name = name
if route ~= nil and durationIsValid(duration) then
way.ignore_in_grid = true
way.speed = math.max( 1, parseDuration(duration) / math.max(1, numberOfNodesInWay-1) )
way.is_duration_set = true
way.duration = math.max( 1, parseDuration(duration) )
else
way.speed = speed_profile[highway] or speed_profile['default']
end