Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Stops allocated to agency arbitrarily? #2407
I'm having a problem with the way the GTFS feed generates stop relationships to agencies in order to use the index API. This doesn't affect any routing or other route / trip information but specifically causes a problem when you only have the stopid and you want to interrogate data from there.
stops.txt has no agency in GTFS feeds until you compile it with trips, then routes, then agencies - thus a stop has a defined agency indirectly and sometimes multiple agencies. But to call any of the index API endpoints you need to provide an agency to recall the stop information (routes servicing as an example). In theory you should be able to call a stop without an agency as multiple agencies may service some stops on many transport networks.
Depending on the order of the trips data, a different agency is assigned to a stop as the owner, even if the owner was previously something else. As an example, in one GTFS feed the owner of all the stops in the target feed were assigned to one agency. A change in the trips data caused all stops to be owned by a different agency. Even when that agency does NOT have any services, trips or routes that are connected with that stop.
This caused an incompatible state between the OTP application graph and an external application graph, requiring a translation table (agency X actually means agency Y if you hit the index API) in order to provide only the stop ID and still see all routes.
Version of OTP used (exact commit hash or JAR name)
This is 0.19 stable - so it may be fixed in later versions.
This has been adressed for v1.0 in #1999. Instead of using the agency id stops and other entities is now scoped by a feed id. The feed id is picked up from the
You can use the index API