transit agencies table structure

transit agencies table structure#

The Transit_agencies table holds information on all the transit agencies for which there are transit services included in the model. information for these agencies include the GTFS feed (feed_date) and operation day (service_date) for which services were imported into the model.

Encoding of ids for transit agencies, routes, patterns and trips follows a strict encoding that allow one to trace back each element to its parent (Agency->Route->Pattern->Trip). This encoding follows the following pattern: AARRRPPTTT. Since this IDs are always integer, those corresponding to agencies 1 through 9 will omit the first 0 in the ID pattern shown above.

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

agency_id*

INTEGER

NO

ID of the agency. 1 is reserved for a dummy agency for walking links

agency

TEXT

NO

Name of the agency as imported

feed_date

TEXT

YES

Release date for the GTFS feed used

service_date

TEXT

YES

The service date used for importing the GTFS feed

description

TEXT

YES

User notes

(* - Primary key)

The SQL statement for table and index creation is below.

create TABLE IF NOT EXISTS "Transit_Agencies" (
    agency_id    INTEGER NOT NULL  PRIMARY KEY AUTOINCREMENT,
    agency       TEXT    NOT NULL,
    feed_date    TEXT,
    service_date TEXT,
    description  TEXT
);

create UNIQUE INDEX IF NOT EXISTS transit_operators_id ON Transit_Agencies (agency_id);