new TripSearch( origin, destination [, departure [, options ] ] )

Description

Trip Search

This Class sets the parameters and options of a Trip Search: a search of the GTFS schedule data finding trips (direct and/or with transfers) from the origin Stop to the destination Stop at the specified time with the specified options.

Module: search/TripSearch

Parameters
Name Type Attributes Default Description
origin Stop

Origin Stop

destination Stop

Destination Stop

departure DateTime <optional>
now

The Departure Date/Time of the Trip Search

options Object <optional>

Trip Search Options

Name Type Attributes Default Description
allowTransfers boolean <optional>
true

Allow transfers between trains

allowChangeInDirection boolean <optional>
true

Allow transfers that change direction of travel

preDepartureHours int <optional>
3

The number of hours before the requested departure to include in results

postDepartureHours int <optional>
6

The number of hours after the requested departure to include in results

maxLayoverMins int <optional>
30

The maximum number of minutes to layover at a transfer Stop

minLayoverMins int <optional>
0

The minimum number of minutes to layover at a transfer Stop

maxTransfers int <optional>
2

The maximum number of transfers

Details

Members


origin :Stop

Description

Trip Search Origin Stop

Details

destination :Stop

Description

Trip Search Destination Stop

Details

departure :DateTime

Description

Trip Search Departure Date/Time

Details

now


allowTransfers :boolean

Description

Allow Transfers between Trains

Details
boolean

true


allowChangeInDirection :boolean

Description

Allow Transfers between trains operating in opposite directions

Details
boolean

true


preDepartureHours :int

Description

The number of hours before the departure time to include in results

Details
int

3


postDepartureHours :int

Description

The number of hours after the departure time to include in results

Details
int

6


maxLayoverMins :int

Description

The maximum number of minutes between trips at a layover

Details
int

30


minLayoverMins :int

Description

The minimum number of minutes between trips at a layover

Details
int

0


maxTransfers :int

Description

The maximum number of transfers for a single result

Details
int

2


options

Description

All of the Trip Search options

Returns

Methods


Description

Perform the trip search on the provided Right Track Database

Parameters
Name Type Description
db RightTrackDB

The Right Track DB to query

callback function

Callback function

Name Type Attributes Description
err Error

Database Query Error

results Array.<TripSearchResult> <optional>

Trip Search Results