transit stops table structure

transit stops table structure#

Lists all the transit stops in the model on which at least one transit trip stops during the day. It lists the agency it is associated to, as well as the closest network link to it

Additionally to transit stops, this table also holds nodes in the network associated with the active networks (walk and bike), more specifically the nodes created in the network to allow transit stops to be linked in what was previously the middle of a network link. If a node had to be moved during the GTFS map-matching (probably due to a too-sparse of a network), then the moved_by_matching field will contain the straight-line distance the stop was moved.

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

stop_id*

INTEGER

YES

ID of the stop/station used by POLARIS in the format AA0000000 (Agency)

stop

TEXT

NO

stop ID as seen in GTFS

agency_id

INTEGER

NO

Transit_Agencies(agency_id)

ID of the agency to which the stop belongs to

X

REAL

NO

0

x coordinate of the stop in meters

Y

REAL

NO

0

y coordinate of the stop in meters

Z

REAL

NO

0

z coordinate of the stop in meters

name

TEXT

YES

name of the stop as seen in GTFS

parent_station

TEXT

YES

parent station of the stop as seen in GTFS

description

TEXT

YES

description of the stop as seen in GTFS

street

TEXT

YES

name of the stop as seen in GTFS

zone

INTEGER

YES

Zone(zone)

zone of the stop as seen in the zone table

transit_zone_id

INTEGER

YES

Transit_Zones(transit_zone_id)

transit zone of the stop as seen in the transit_zones table

has_parking

INTEGER

NO

0

indicates whether cars can park by the station for the park-and-ride and park-and-rail modes

route_type

INTEGER

NO

-1

indicates the type of transit mode served at this stop, see transit_modes table or GTFS reference for definitions

moved_by_matching

INTEGER

YES

0

indicates whether the stop is relocated by the map matching process

geo

POINT

NO

‘’

(* - Primary key)

The SQL statement for table and index creation is below.

CREATE TABLE IF NOT EXISTS "Transit_Stops" (
    stop_id           INTEGER PRIMARY KEY AUTOINCREMENT ,
    stop              TEXT    NOT NULL ,
    agency_id         INTEGER NOT NULL,
    X                 REAL    NOT NULL DEFAULT 0 ,
    Y                 REAL    NOT NULL DEFAULT 0 ,
    Z                 REAL    NOT NULL DEFAULT 0 ,
    name              TEXT,
    parent_station    TEXT,
    description       TEXT,
    street            TEXT,
    zone              INTEGER,
    transit_zone_id   INTEGER,
    has_parking       INTEGER NOT NULL DEFAULT 0 ,
    route_type        INTEGER NOT NULL DEFAULT -1,
    moved_by_matching INTEGER DEFAULT 0,

    FOREIGN KEY(agency_id) REFERENCES "Transit_Agencies"(agency_id),
    FOREIGN KEY("zone") REFERENCES "Zone"("zone") deferrable initially deferred,
    FOREIGN KEY("transit_zone_id") REFERENCES "Transit_Zones"("transit_zone_id")
);

create INDEX IF NOT EXISTS transit_stops_stop_id ON Transit_Stops (stop_id);

select AddGeometryColumn( 'Transit_Stops', 'geo', SRID_PARAMETER, 'POINT', 'XY', 1);
select CreateSpatialIndex( 'Transit_Stops' , 'geo' );