Trip

Trip

GTFS Trip

Representation of the GTS Trip definition

GTFS Required Fields:

  • Trip ID
  • Route
  • Service
  • List of StopTimes

GTFS Optional Fields:

  • Trip Headsign
  • Trip Short Name
  • Trip Direction ID
  • Trip Block ID
  • Trip Shape ID
  • Trip Wheelchair Accessibility
  • Trip Bikes Allowed

Right Track Fields:

  • Trip Direction Description
  • Trip Peak Indicator

Module: gtfs/Trip

Constructor

new Trip(id, route, service, stopTimes, optionalopt)

Source:
See:

Trip Constructor

Parameters:
Name Type Attributes Description
id string

Trip ID

route Route

Trip Route

service Service

Trip Service

stopTimes Array.<StopTime>

Trip StopTimes list

optional Object <optional>

Optional Arguments

Properties
Name Type Attributes Default Description
headsign string <optional>

Trip Headsign

shortName string <optional>

Trip Short Name

directionId int <optional>
-1

Trip Direction ID

directionDescription string <optional>

Trip Direction Description

blockId int <optional>

Trip Block ID

shapeId int <optional>

Trip Shape ID

wheelchairAccessible int <optional>
0

Trip Wheelchair Accessibility code

bikesAllowed int <optional>
0

Trip Bikes Allowed code

peak boolean <optional>

Trip Peak Status

Members

(static, constant) BIKES_ALLOWED_NO :number

Source:
Default Value:
  • 2

Trip Bikes Allowed: No bikes allowed

Type:
  • number

(static, constant) BIKES_ALLOWED_UNKNOWN :number

Source:
Default Value:
  • 0

Trip Bikes Allowed: Unknown

Type:
  • number

(static, constant) BIKES_ALLOWED_YES :number

Source:
Default Value:
  • 1

Trip Bikes Allowed: At least one allowed

Type:
  • number

(static, constant) WHEELCHAIR_ACCESSIBLE_N0 :number

Source:
Default Value:
  • 2

Trip Wheelchair Accessibility: Inaccessible

Type:
  • number

(static, constant) WHEELCHAIR_ACCESSIBLE_UNKNOWN :number

Source:
Default Value:
  • 0

Trip Wheelchair Accessibility: Unknown

Type:
  • number

(static, constant) WHEELCHAIR_ACCESSIBLE_YES :number

Source:
Default Value:
  • 1

Trip Wheelchair Accessibility: Accessible

Type:
  • number

bikesAllowed :int

Source:
Default Value:
  • 0

Value indicating whether bikes are allowed on the vehicle making the Trip

Type:
  • int

blockId :string

Source:

The ID of the block the Trip belongs to

Type:
  • string

directionDescription :string

Source:

A description of the Trip's direction

Type:
  • string

directionId :int

Source:
Default Value:
  • -1

Direction of travel for the Trip

Type:
  • int

headsign :string

Source:

Trip Headsign - text displayed to passengers indicating the Trip's destination

Type:
  • string

id :string

Source:

A unique ID representing the Trip

Type:
  • string

peak :boolean

Source:
Default Value:
  • false

Value indicating the peak status of the Trip.

Type:
  • boolean

route :Route

Source:

The Trip's parent Route

Type:

service :Service

Source:

The Service the Trip operates on

Type:

shapeId :string

Source:

The ID of the shape the Trip belongs to

Type:
  • string

shortName :string

Source:

Publicly-viewable Trip ID or name

Type:
  • string

stopTimes :Array.<StopTime>

Source:

List of scheduled StopTimes for the Trip

Type:

wheelchairAccessible :int

Source:
Default Value:
  • 0

Value indicating the wheelchair accessibility of the vehicle making the Trip

Type:
  • int

Methods

(static) sortByDepartureTime(a, b) → {number}

Source:

Sort Trips by departure time of the first Stop (or reference Stop, if defined)

Parameters:
Name Type Description
a Trip

first Trip

b Trip

second Trip

Returns:

compare integer

Type
number

getStopTime(stop) → {StopTime}

Source:

Get the StopTime associated with the specified Stop

Parameters:
Name Type Description
stop Stop | String

Stop (or Stop ID) to find in Trip's list of StopTimes

Returns:

matching StopTime

Type
StopTime

hasStopTime(stop) → {boolean}

Source:

Check if the Trip's list of StopTimes includes the specified Stop

Parameters:
Name Type Description
stop Stop | String

Stop (or Stop ID) to check for

Returns:

true if the Stop is found in list of StopTimes

Type
boolean