Skip to content
Documentation

Agencies and operators

Last updated

Distinctions between agencies and operators

An agency represents a single GTFS agency.txt entity that was imported from a single feed version. The metadata, routes, and other data for an agency include only the data for that specific agency in that specific feed version.

Operators are a higher-level abstraction over agencies, with each operator defined by an entry in the Transitland Atlas. Operators provide a method for enriching the basic GTFS agency data, as well as grouping agencies that span across multiple source feeds. Operators are matched with GTFS agencies using associated_feeds, a simple list of Feed Onestop IDs and GTFS agency_ids. For instance, the Atlas operator record for the New York City MTA has associated_feeds values for 8 static GTFS feeds and 10 GTFS Realtime feeds. A query for this operator Onestop ID thus represents the union of data from all 8 static feeds, and includes routes for the subway and for bus service in all 5 boroughs. The MTA's commuter rail agencies, the Long Island Rail Road and Metro-North Railroad, are separate operators. This record also includes additional metadata about the MTA, such as the United States National Transit Database (NTD) ID, Wikidata IDs, and alternate names for the agency. Operator records are created and maintained through pull requests to the Atlas DMFR files, and Transitland synchronizes them from the Atlas repository every hour.

Virtual operator records

The operators implementation includes a fall-back to ensure that all agencies and routes are available through operators queries, even if an operator record is not defined in Atlas or the association is broken. In this case, a virtual (or generated) operator record is created for each unmatched agency. Its Onestop ID is built from a geohash of the agency's stops and the agency_name (see Onestop ID scheme), and its name is the agency_name. Fields that come only from Atlas, such as short_name, website, and tags, are null, and the GraphQL generated field is true.

Unmatched operators

Occasionally an operator fails to associate with the intended agencies. This usually happens when a feed containing multiple agencies has a change in agency_id values that need to be updated in the operator Atlas record. If you come across such a record, let us know or open an Atlas pull request to update the operator metadata.