-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathtraffic_signal.lua
More file actions
26 lines (22 loc) · 744 Bytes
/
traffic_signal.lua
File metadata and controls
26 lines (22 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- Assigns traffic light value to node as defined by
-- include/extractor/traffic_lights.hpp
local TrafficSignal = {}
function TrafficSignal.get_value(node)
local tag = node:get_value_by_key("highway")
if "traffic_signals" == tag then
local direction = node:get_value_by_key("traffic_signals:direction")
if direction then
if "forward" == direction then
return traffic_lights.direction_forward
end
if "backward" == direction then
return traffic_lights.direction_reverse
end
end
-- return traffic_lights.direction_all
return true
end
-- return traffic_lights.none
return false
end
return TrafficSignal