Take stop signs into account during routing
This commit is contained in:
@@ -1,21 +1,9 @@
|
||||
local GiveWay = {}
|
||||
|
||||
TrafficFlowControlNode = require("lib/traffic_flow_control_node")
|
||||
|
||||
function GiveWay.get_value(node)
|
||||
local tag = node:get_value_by_key("highway")
|
||||
if "give_way" == tag then
|
||||
local direction = node:get_value_by_key("direction")
|
||||
if direction then
|
||||
if "forward" == direction then
|
||||
return traffic_flow_control_direction.direction_forward
|
||||
end
|
||||
if "backward" == direction then
|
||||
return traffic_flow_control_direction.direction_reverse
|
||||
end
|
||||
end
|
||||
return traffic_flow_control_direction.direction_all
|
||||
end
|
||||
return traffic_flow_control_direction.none
|
||||
return TrafficFlowControlNode.get_value(node, "give_way")
|
||||
end
|
||||
|
||||
return GiveWay
|
||||
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
local StopSign = {}
|
||||
|
||||
TrafficFlowControlNode = require("lib/traffic_flow_control_node")
|
||||
|
||||
function StopSign.get_value(node)
|
||||
local tag = node:get_value_by_key("highway")
|
||||
if "stop" == tag then
|
||||
local direction = node:get_value_by_key("direction")
|
||||
if direction then
|
||||
if "forward" == direction then
|
||||
return traffic_flow_control_direction.direction_forward
|
||||
end
|
||||
if "backward" == direction then
|
||||
return traffic_flow_control_direction.direction_reverse
|
||||
end
|
||||
end
|
||||
return traffic_flow_control_direction.direction_all
|
||||
end
|
||||
return traffic_flow_control_direction.none
|
||||
return TrafficFlowControlNode.get_value(node, "stop")
|
||||
end
|
||||
|
||||
return StopSign
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
local TrafficFlowControlNode = {}
|
||||
|
||||
function TrafficFlowControlNode.get_value(node, tag_name)
|
||||
local tag = node:get_value_by_key("highway")
|
||||
if tag_name == tag then
|
||||
local direction = node:get_value_by_key("direction")
|
||||
if direction then
|
||||
if "forward" == direction then
|
||||
return traffic_flow_control_direction.direction_forward
|
||||
end
|
||||
if "backward" == direction then
|
||||
return traffic_flow_control_direction.direction_reverse
|
||||
end
|
||||
end
|
||||
return traffic_flow_control_direction.direction_all
|
||||
end
|
||||
return traffic_flow_control_direction.none
|
||||
end
|
||||
|
||||
return TrafficFlowControlNode
|
||||
|
||||
Reference in New Issue
Block a user