Traffic Signal Phases in GeoJSON
Most of the information in the GeoJSON files describe the geometry of a scene. The
Phases sections of these files describe the traffic light phases
of signals at each junction.
Consider a junction with three signal phases, with each one containing
green-yellow-red intervals of varying durations. This figure shows such a sample phase
as it appears in the 2D Editor.
This GeoJSON snippet corresponds to the first traffic phase. Some of the data for this
phase has been omitted for clarity.
"Phases": [
{
"Intervals": [
{
"BulbStates": [
{
"Id": "{8bedd7ab-7e17-4177-b095-ddca457e6985}",
"On": false,
"SignalId": "{cc65a9c4-f47c-465b-8a8f-ae7c7e2aca50}"
},
.
.
.
],
"GateStates": [
{
"Id": "{3233fba0-a5b6-4f09-a442-2e0ddc07c4c0}",
"State": "Go"
},
.
.
.
],
"Time": 10,
"Type": "Green"
},
{
"BulbStates": [
{
"Id": "{8bedd7ab-7e17-4177-b095-ddca457e6985}",
"On": false,
"SignalId": "{cc65a9c4-f47c-465b-8a8f-ae7c7e2aca50}"
},
.
.
.
],
"GateStates": [
{
"Id": "{3233fba0-a5b6-4f09-a442-2e0ddc07c4c0}",
"State": "Go"
},
.
.
.
],
"Time": 4,
"Type": "Yellow"
},
{
"BulbStates": [
{
"Id": "{8bedd7ab-7e17-4177-b095-ddca457e6985}",
"On": true,
"SignalId": "{cc65a9c4-f47c-465b-8a8f-ae7c7e2aca50}"
},
.
.
.
],
"GateStates": [
{
"Id": "{3233fba0-a5b6-4f09-a442-2e0ddc07c4c0}",
"State": "Stop"
},
.
.
.
],
"Time": 1,
"Type": "Red"
}
]
},
{
"Intervals": [
.
.
.
]
The Time and Type values specify that the first
phase has a green interval that lasts 10 seconds, a yellow interval that lasts 4
seconds, and a red interval that lasts 1 second.
Each BulbStates section lists the unique ID of a traffic light bulb
in the scene. In full GeoJSON files, you can find the bulb specification by searching
for this ID. In the first (green) interval, the first bulb in
BulbStates has an ID of
8bedd7ab-7e17-4177-b095-ddca457e6985 with its
"On" state set to false. In the full GeoJSON
file (not shown here), this bulb is specified as being light red. Therefore, it is
expected that the bulb is off at this phase. In the GeoJSON file snippet, you can see
that the bulb with this ID is also off in the second (yellow) interval but is then on in
the third (red) interval.
Each GateStates section lists the unique ID of a maneuver gate in
the junction and what its state is during each interval. As with the bulbs in the
BulbStates sections, the gates in the
GateStates sections are repeated in each interval, with only the
states differing at each interval.
Though not shown in this GeoJSON snippet, the full GeoJSON file includes two additional
Intervals sections for the two remaining intervals in the
phase.