query/stops

Stop Query Functions

These functions query the gtfs_stops, rt_stops_extra and rt_alt_stop_names tables in the Right Track Database.

Source:

Methods

(inner) getStop(db, id, callback)

Source:

Get the Stop(s) specified by ID(s) from the passed database

Parameters:
Name Type Description
db RightTrackDB

The Right Track Database to query

id string | Array.<string>

Stop ID(s)

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

stop Stop | Array.<Stop> <optional>

The selected Stop(s)

(inner) getStopByName(db, name, callback)

Source:

Get the Stop specified by name from the passed database

Parameters:
Name Type Description
db RightTrackDB

The Right Track Database to query

name string

Stop Name (found in either gtfs_stops, rt_alt_stop_names or rt_stops_extra tables)

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

stop Stop <optional>

The selected Stop

(inner) getStopByStatusId(db, statusId, callback)

Source:

Get the Stop specified by status id from the passed database

Parameters:
Name Type Description
db RightTrackDB

The Right Track Database to query

statusId string

the status id of the Stop

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

stop Stop <optional>

The selected Stop

(inner) getStops(db, hasFeedopt, callback)

Source:

Get all of the Stops that are stored in the passed database (sorted alphabetically), optionally filtered to only include Stops that support real-time Station Feeds.

Parameters:
Name Type Attributes Default Description
db RightTrackDB

The Right Track Database to query

hasFeed boolean <optional>
false

When true, only return Stops that support real-time Station Feeds. When false, include all Stops.

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

stops Array.<Stop> <optional>

The selected Stops

(inner) getStopsByLocation(db, lat, lon, optionsopt, callback)

Source:

Get Stops sorted by distance from the specified location. Optionally, filter the returned stops to include up to count results and/or within distance miles from the location. Also, the returned Stops can be filtered to include only Stops that support real-time Station Feeds and/or are associated with a specific Route.

Parameters:
Name Type Attributes Description
db RightTrackDB

The Right Track Database to query

lat number

Location latitude (decimal degrees)

lon number

Location longitude (decimal degrees)

options Object <optional>

Filter Options

Properties
Name Type Attributes Description
count int <optional>

Max number of Stops to return

distance number <optional>

Max distance (miles) Stops can be from location

hasFeed boolean <optional>

When true, only return Stops that support real-time Station Feeds. Otherwise include all matching Stops.

routeId string <optional>

When provided with a GTFS Route ID, return only Stops associated with the Route

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

stops Array.<Stop> <optional>

The selected Stops

(inner) getStopsByRoute(db, routeId, hasFeedopt, callback)

Source:

Get all of the Stops that are associated with the specified route (sorted alphabetically), optionally filtered to only include Stops that support real-time Station Feeds.

Parameters:
Name Type Attributes Default Description
db RightTrackDB

The Right Track Database to query

routeId string

The Route ID

hasFeed boolean <optional>
false

When true, only return Stops on Route that support real-time Station Feeds. When false, include all Stops on Route.

callback function

Callback function

Properties
Name Type Attributes Description
error Error

Database Query Error

stops Array.<Stop> <optional>

The selected Stops