new Trip( id, route, service, stopTimes [, optional ] )

Description

GTFS Trip

Representation of the GTFS 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

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

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

Details

Members


id :string

Description

A unique ID representing the Trip

Details
string

route :Route

Description

The Trip's parent Route

Details

service :Service

Description

The Service the Trip operates on

Details

stopTimes :Array.<StopTime>

Description

List of scheduled StopTimes for the Trip

Details
Array.<StopTime>

headsign :string

Description

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

Details
string

shortName :string

Description

Publicly-viewable Trip ID or name

Details
string

directionId :int

Description

Direction of travel for the Trip

Details
int

-1


directionDescription :string

Description

A description of the Trip's direction

Details
string

blockId :string

Description

The ID of the block the Trip belongs to

Details
string

shapeId :string

Description

The ID of the shape the Trip belongs to

Details
string

wheelchairAccessible :int

Description

Value indicating the wheelchair accessibility of the vehicle making the Trip

Details
int

0


bikesAllowed :int

Description

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

Details
int

0


peak :boolean

Description

Value indicating the peak status of the Trip.

Details
boolean

false

Methods


getStopTime( stop ) → {StopTime}

Description

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

Details

hasStopTime( stop ) → {boolean}

Description

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

Details

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

Description

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

Details