fixes #808
This commit is contained in:
parent
b2512915ae
commit
e949677c48
@ -34,8 +34,8 @@ speed_profile = {
|
|||||||
|
|
||||||
take_minimum_of_speeds = false
|
take_minimum_of_speeds = false
|
||||||
obey_oneway = true
|
obey_oneway = true
|
||||||
obey_bollards = true
|
obey_bollards = true
|
||||||
use_restrictions = true
|
use_turn_restrictions = true
|
||||||
ignore_areas = true -- future feature
|
ignore_areas = true -- future feature
|
||||||
traffic_signal_penalty = 2
|
traffic_signal_penalty = 2
|
||||||
u_turn_penalty = 20
|
u_turn_penalty = 20
|
||||||
|
@ -114,7 +114,7 @@ function way_function (way)
|
|||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- don't route on ways that are still under construction
|
-- don't route on ways that are still under construction
|
||||||
if highway=='construction' then
|
if highway=='construction' then
|
||||||
return 0
|
return 0
|
||||||
@ -125,7 +125,7 @@ function way_function (way)
|
|||||||
if access_tag_blacklist[access] then
|
if access_tag_blacklist[access] then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local name = way.tags:Find("name")
|
local name = way.tags:Find("name")
|
||||||
local ref = way.tags:Find("ref")
|
local ref = way.tags:Find("ref")
|
||||||
local junction = way.tags:Find("junction")
|
local junction = way.tags:Find("junction")
|
||||||
@ -179,7 +179,7 @@ function way_function (way)
|
|||||||
-- unknown way, but valid access tag
|
-- unknown way, but valid access tag
|
||||||
way.speed = walking_speed
|
way.speed = walking_speed
|
||||||
end
|
end
|
||||||
|
|
||||||
-- oneway
|
-- oneway
|
||||||
if onewayClass == "yes" or onewayClass == "1" or onewayClass == "true" then
|
if onewayClass == "yes" or onewayClass == "1" or onewayClass == "true" then
|
||||||
way.direction = Way.oneway
|
way.direction = Way.oneway
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
-- Secondary road: 18km/h = 18000m/3600s = 100m/20s
|
-- Secondary road: 18km/h = 18000m/3600s = 100m/20s
|
||||||
-- Tertiary road: 12km/h = 12000m/3600s = 100m/30s
|
-- Tertiary road: 12km/h = 12000m/3600s = 100m/30s
|
||||||
|
|
||||||
speed_profile = {
|
speed_profile = {
|
||||||
["primary"] = 36,
|
["primary"] = 36,
|
||||||
["secondary"] = 18,
|
["secondary"] = 18,
|
||||||
["tertiary"] = 12,
|
["tertiary"] = 12,
|
||||||
@ -17,8 +17,8 @@ speed_profile = {
|
|||||||
|
|
||||||
take_minimum_of_speeds = true
|
take_minimum_of_speeds = true
|
||||||
obey_oneway = true
|
obey_oneway = true
|
||||||
obey_bollards = true
|
obey_barriers = true
|
||||||
use_restrictions = true
|
use_turn_restrictions = true
|
||||||
ignore_areas = true -- future feature
|
ignore_areas = true -- future feature
|
||||||
traffic_signal_penalty = 7 -- seconds
|
traffic_signal_penalty = 7 -- seconds
|
||||||
u_turn_penalty = 20
|
u_turn_penalty = 20
|
||||||
@ -55,7 +55,7 @@ function way_function (way)
|
|||||||
local maxspeed = tonumber(way.tags:Find ( "maxspeed"))
|
local maxspeed = tonumber(way.tags:Find ( "maxspeed"))
|
||||||
local maxspeed_forward = tonumber(way.tags:Find( "maxspeed:forward"))
|
local maxspeed_forward = tonumber(way.tags:Find( "maxspeed:forward"))
|
||||||
local maxspeed_backward = tonumber(way.tags:Find( "maxspeed:backward"))
|
local maxspeed_backward = tonumber(way.tags:Find( "maxspeed:backward"))
|
||||||
|
|
||||||
way.name = name
|
way.name = name
|
||||||
|
|
||||||
if route ~= nil and durationIsValid(duration) then
|
if route ~= nil and durationIsValid(duration) then
|
||||||
@ -69,7 +69,7 @@ function way_function (way)
|
|||||||
speed_forw = temp_speed*1.5
|
speed_forw = temp_speed*1.5
|
||||||
speed_back = temp_speed/1.5
|
speed_back = temp_speed/1.5
|
||||||
end
|
end
|
||||||
|
|
||||||
if maxspeed_forward ~= nil and maxspeed_forward > 0 then
|
if maxspeed_forward ~= nil and maxspeed_forward > 0 then
|
||||||
speed_forw = maxspeed_forward
|
speed_forw = maxspeed_forward
|
||||||
else
|
else
|
||||||
@ -77,7 +77,7 @@ function way_function (way)
|
|||||||
speed_forw = maxspeed
|
speed_forw = maxspeed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if maxspeed_backward ~= nil and maxspeed_backward > 0 then
|
if maxspeed_backward ~= nil and maxspeed_backward > 0 then
|
||||||
speed_back = maxspeed_backward
|
speed_back = maxspeed_backward
|
||||||
else
|
else
|
||||||
@ -85,13 +85,13 @@ function way_function (way)
|
|||||||
speed_back = maxspeed
|
speed_back = maxspeed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
way.speed = speed_forw
|
way.speed = speed_forw
|
||||||
if speed_back ~= way_forw then
|
if speed_back ~= way_forw then
|
||||||
way.backward_speed = speed_back
|
way.backward_speed = speed_back
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if oneway == "no" or oneway == "0" or oneway == "false" then
|
if oneway == "no" or oneway == "0" or oneway == "false" then
|
||||||
way.direction = Way.bidirectional
|
way.direction = Way.bidirectional
|
||||||
elseif oneway == "-1" then
|
elseif oneway == "-1" then
|
||||||
@ -101,7 +101,7 @@ function way_function (way)
|
|||||||
else
|
else
|
||||||
way.direction = Way.bidirectional
|
way.direction = Way.bidirectional
|
||||||
end
|
end
|
||||||
|
|
||||||
way.type = 1
|
way.type = 1
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user