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
Feed Id and Agency Id mapping #2524
The Api's in the IndexAPI.java dont really provide proper insight into the relation between between a FeedId and an AgencyId. The One Bus Away GTFS loader should distinguish between FeedId and AgencyId.
Observed behaviour is elaborated in the OpenTripPlanner-Dev forum here
Version of OTP used (exact commit hash or JAR name)
Latest as of this date
Data sets in use (links to GTFS and OSM PBF files)
Example GTFS files are from
Command line used to start OTP
--build /path-to-router --inMemory
Router config and graph build config JSON
defaults or none
Steps to reproduce the problem
Also described here in request and responses
If one agency with the same id would exist in more than one feed, OTP would treat them as separate agencies and not as one single agency.
Since the agency id itself is not scoped with the feed id as other entities is this url structure is used to list agencies for a specific feed;
Im not sure then if we should have both issues open as long as all concerns are addressed but it seems like a full total solution is required that addresses all concerns. How we do that is really fine with me.
added a commit
Dec 29, 2017
I agree that the current model i confusing, and changing the AgencyAndId to FeedScopedId would be clearer. I can do that as soon as the split #2494 is merged into master.
However, I am a little puzzled by the idea that ids are changed in OTP. I see OTP as just one component in a chain of components, and if every component change IDs, it would very soon be a mess. Also, I don´t think that OTP clients should need to know about feeds. Hence, feed ids do not belong in resource URLs. At the moment this is not an issue for us, and not a prioritized thing to do, just a though from me.
Hi @t2gran, can you clarify what you mean by "the idea that ids are changed in OTP"? What kind of IDs, and where are they changed? I agree, ideally no IDs should be changed anywhere. However changes have accumulated from several sources so perhaps some shared rules/guidelines have not emerged.
However, if IDs are not changed, then clients must be aware of feeds, at least as prefixes on IDs, because IDs inside GTFS feeds are not globally unique.
I am sorry if I was a bit unclear. What I mean by change is that an ID is prefixed with feedId. When looking at OTP as a black box, the IDs that goes inn, are not the same as the one used to access data on the API, the clients need to know the feedId. This is OK if the id was retrieved from OTP, but not if it came from som other component in the ecosystem. The problem of conflicting IDs between feeds should be fixed by prefixing, only when it is a problem (enabled in the build config). This is not a big issue - and we(Entur and Ruter) already worked around it. I was just a little concerned that the feed ID should pollute the URLs also. At Entur and Ruter all IDs are uniq. We also merged all operators into one feed, but might undo that in the future.