Fixes how durations are parsed
This commit is contained in:
parent
ccdc6f1a63
commit
a92950d234
@ -162,8 +162,7 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
way.direction = Way.bidirectional
|
way.direction = Way.bidirectional
|
||||||
way.ignore_in_grid = true
|
way.ignore_in_grid = true
|
||||||
if durationIsValid(duration) then
|
if durationIsValid(duration) then
|
||||||
way.speed = math.max( parseDuration(duration) / math.max(1, numberOfNodesInWay-1) )
|
way.duration = math.max( 1, parseDuration(duration) )
|
||||||
way.is_duration_set = true
|
|
||||||
else
|
else
|
||||||
way.speed = route_speeds[route]
|
way.speed = route_speeds[route]
|
||||||
end
|
end
|
||||||
|
@ -49,9 +49,7 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
way.name = name
|
way.name = name
|
||||||
|
|
||||||
if route ~= nil and durationIsValid(duration) then
|
if route ~= nil and durationIsValid(duration) then
|
||||||
way.ignore_in_grid = true
|
way.duration = math.max( 1, parseDuration(duration) )
|
||||||
way.speed = math.max( 1, parseDuration(duration) / math.max(1, numberOfNodesInWay-1) )
|
|
||||||
way.is_duration_set = true
|
|
||||||
else
|
else
|
||||||
way.speed = speed_profile[highway] or speed_profile['default']
|
way.speed = speed_profile[highway] or speed_profile['default']
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user