Skip to content
sheldonabrown edited this page Jun 10, 2016 · 1 revision

Purpose

The current convention of agency_ids is not well documented nor well understood. As Sound Transit continues to integrate data sources it is clear a convention needs to be established. The agency Id is intended to be the regional NTD Id but not all operators have an NTD Id. Hence GTFS Agency Ids are often arbitrary and conflicting. NOTE: OpenTripPlanner solves this by scoping each agency id to its GTFS dataset. However this is not an applicable solution for the Puget Sound Region where many operators provide service for different agencies. As an example, King County Metro, Community Transit, and Sound Transit all provide service that is branded as Sound Transit.

Puget Sound Example:

Agency Id
King County Metro 1
Pierce 3
Intercity 19
Community Transit 29
Sound Transit 40
Washington State Ferries 95
Everett 97
Seattle Chilrens Hospital 98
JBLM 99

Database Design:

Column Type Notes
id int the external id used in GTFS
name string the full name of the agency (agency_name in GTFS0
short_name string an abbreviation of name
legacy_id string OneBusAway's internal id
GTFS_Feed_url string GTFS source URL if available
GTFS_RT_feed_url string GTFS-RT source URL if available
bounding_box string:WKT Geometry of bounding box in well known text (WKT)
ntd_id string National Transit Database Id if available

API

The following APIs are supported. The result set in all cases is an array of JSON records that are a serialized version of matching rows of the above table.

  • /agency/list
  • /agency/search/id/{id}
  • /agency/search/name/{name}
  • /agency/search/short_name/{short_name}
  • /agency/search/legacy_id/{legacy_id}
  • /agency/search/point/{lat}/{lon}
  • /agency/search/ntd_id/{id}
Clone this wiki locally