query/trips

Trip Query Functions

These functions query the gtfs_trips table in the Right Track Database.

Source:

Methods

(inner) getTrip(db, id, date, callback)

Source:

Get the Trip (with Route, Service and StopTimes) specified by the Trip ID from the passed database

Parameters:
Name Type Description
db RightTrackDB

The Right Track DB to query

id string

Trip ID

date int

The date (yyyymmdd) that the Trip operates on

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

trip Trip <optional>

The selected Trip

(inner) getTripByDeparture(db, originId, destinationId, departure, callback)

Source:

Find the Trip that leaves the specified origin Stop for the specified destination Stop at the departure time specified by the DateTime

Parameters:
Name Type Description
db RightTrackDB

The Right Track DB to query

originId string

Origin Stop ID

destinationId string

Destination Stop ID

departure DateTime

DateTime of trip departure

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

trip Trip <optional>

The selected Trip

(inner) getTripByShortName(db, shortName, date, callback)

Source:

Get the Trip specified by the Trip short name that operates on the specified date

Parameters:
Name Type Description
db RightTrackDB

The Right Track DB to query

shortName string

Trip short name

date int

Date Integer (yyyymmdd)

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

trip Trip <optional>

The selected Trip

(inner) getTripsByDate(db, date, optsopt, callback)

Source:

Get all Trips effectively running on the specified date

Parameters:
Name Type Attributes Description
db RightTrackDB

The Right Track DB to query

date int

Date in YYYYMMDD format

opts Object <optional>

Query Options

Properties
Name Type Attributes Description
routeId string <optional>

GTFS Route ID - get Trips that run on this Route

stopId string <optional>

GTFS Stop ID - get Trips that stop at this Stop

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

trips Array.<Trip> <optional>

List of Trips