Till senaste kommentaren

Finding operator values from GTFS Sweden 3 static data


Hi,

We are migrating from the regional static GTFS feeds to the aggregated GTFS Sweden 3 static feed. For real-time vehicle positions, however, we still call operator-specific endpoints such as:

/gtfs-rt-sweden/sl/VehiclePositions.pb
/gtfs-rt-sweden/ul/VehiclePositions.pb
/gtfs-rt-sweden/skane/VehiclePositions.pb

The resulting vehicles are therefore associated with operator codes such as  sl ,  ul , and  skane.

In the aggregated static feed, routes are connected to agencies through  routes.txt  and  agency.txt , but I cannot find the corresponding Trafiklab operator code in the static GTFS data.

Is there an official way to map an  agency_id  from GTFS Sweden 3 to the operator code used by the GTFS-RT endpoints?

For example, is there published metadata that maps something like:

agency_id -> sl
agency_id -> ul
agency_id ->skane

Or are consumers expected to maintain an external lookup between  agency_id  values and Trafiklab’s operator codes?

It would also be useful to know whether this mapping is stable over time and whether a single operator code can correspond to multiple  agency_id  values?


Jonas

Kommentarer

  • Hi Jonas,

    What do you need this lookup for? There is no exakt mapping available, this would be a many-to-one relationship as one operator code often includes multiple agency ids. The realtime data is mapped through trip_id/route_id reference in the realtime data --> trip --> route --> agency.

    Regards,
    Bert
    Bert på Trafiklab
  • Yes I realized that this can’t be mapped from agency since multiple agencies can server one ”operator”.

    I don’t ”need” this but when using the gtfs regional each stop/geofence is tagged with the operator. Switching to the national ”feed” all stops will be tagged ”sweden3”.

    One scenario is a stop in Stockholm SL that ”belongs” to UL.
     
    So there is no way to find out to which ”operator” a stop belongs in the national feeds.

    Thanks!

    Jonas
  • Forget my question I have probably mixed up things here :-)

    What I wanted is a way to know to what ”operator” a stop belongs. But I don’t ”need” it. I assume that requires me to be able to go from the opaque stop_id to an ”operator”.

    Thanks!
    Jonas

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.