signal table structure

signal table structure#

Each unique signal signal is associated to a unique node in the network and has associated to it a number of different phasing schemes times for different times of the day, as described on Signal_Nested_Records.

Each signal is also a part of a group of signals (NEED DESCRIPTION OF PURPOSE HERE).

For the time being, the field type is always equal to “TIMED” and the offset is always 0.

An index on nodes enforces the existence of a single signal per intersection

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

signal*

INTEGER

NO

signal identifier

group

INTEGER

NO

0

not used by POLARIS

times

INTEGER

YES

number of timing records for this signal

nodes

INTEGER

NO

-1

Node(nodes)

actual node (Node table) that the signal infomation refers to

type

TEXT

NO

‘’

type (TIMED, ACTUATED). Generally TIMED is used

offset

INTEGER

NO

0

not used by POLARIS

osm_id

INTEGER

YES

the node in open street maps of the traffic signal

(* - Primary key)

The SQL statement for table and index creation is below.

create TABLE IF NOT EXISTS "Signal" (
    "signal" INTEGER NOT NULL PRIMARY KEY,
    "group"  INTEGER NOT NULL DEFAULT 0,
    "times"  INTEGER,
    "nodes"  INTEGER NOT NULL DEFAULT -1,
    "type"   TEXT    NOT NULL DEFAULT '',
    "offset" INTEGER NOT NULL DEFAULT 0,
    "osm_id" INTEGER,

    CONSTRAINT "nodes_fk" FOREIGN KEY("nodes") REFERENCES "Node"("node") DEFERRABLE INITIALLY DEFERRED
);

CREATE UNIQUE INDEX IF NOT EXISTS "Signal_signal_i" ON "Signal" ("signal");

CREATE UNIQUE INDEX IF NOT EXISTS "Signal_node_i" ON "Signal" ("nodes");