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
|
(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
|
(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
|
(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
|
||||||||||||
callback |
function | Callback function Properties
|