Static GTFS to RT GTFS multiple agencies

49 views
Skip to first unread message

Christian K

unread,
Mar 17, 2025, 8:46:34 PMMar 17
to GTFS Changes
agency.txt has X number of agencies defined with unique agency ids

Read the VehiclePositions.pb which is the aggregation of all vehicles for all X agencies.

How would you map a vehicle back to an agency?

Route id and trip id are unique to an agency, but that would not be guaranteed to be true over the X agencies.
The same is true for the ID of the vehicle. 

Thoughts? This is the first time I have encountered this and the RT feed is not a different endpoint.

Maybe the RT feed should be concatenating the agency ID to the route 5:1234 or the agency id should just be another property in the vehiclesPosition data

Thanks
CK

 

Mike Gilligan (TriMet)

unread,
Mar 17, 2025, 8:51:51 PMMar 17
to GTFS Changes
trip_id has to be unique across the trips.txt so it should be guaranteed to be unique.

Christian K

unread,
Mar 18, 2025, 1:09:03 PMMar 18
to GTFS Changes
Thank you Mike. After rereading the spec you are right. My thought was, trying to span multiple agencies and keep that unique, would be a challenge, especially if each agency is producing their own file data and handing it up the foodchain. I understand if there is a single source aggregating the data provided by each agency. In the real world, since in notice you are with trimet, who owns this governance? Is each agency told, your going to have trip ids starting with AGENCY1?

Leonard Ehrenfried

unread,
Mar 18, 2025, 1:17:10 PMMar 18
to gtfs-c...@googlegroups.com
I'm afraid it's even worse than that. Two GTFS feeds may contain the same agency perhaps even with the same ID.

Therefore, if you're dealing with several feeds you also have to store which feed the data came from to disambiguate. This not only applies to trips and agencies but all entities in GTFS feeds. That's why we have a so-called feed-scoped id in OpenTripPlanner.

To answer your question about governance: in many parts of the world you have some central authority that gathers data from their constituent agencies and perhaps deduplicates/normalises it. In the US this is not very common.

--
You received this message because you are subscribed to the Google Groups "GTFS Changes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtfs-changes...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages