-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add agencies and feed publisher to geocoding result #5634
Add agencies and feed publisher to geocoding result #5634
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5634 +/- ##
=============================================
+ Coverage 67.50% 67.52% +0.01%
- Complexity 16271 16296 +25
=============================================
Files 1887 1889 +2
Lines 71545 71588 +43
Branches 7398 7409 +11
=============================================
+ Hits 48300 48341 +41
- Misses 20739 20748 +9
+ Partials 2506 2499 -7 ☔ View full report in Codecov by Sentry. |
src/main/java/org/opentripplanner/transit/service/TransitService.java
Outdated
Show resolved
Hide resolved
@@ -18,10 +19,22 @@ record StopCluster( | |||
@Nullable String code, | |||
String name, | |||
Coordinate coordinate, | |||
Collection<String> modes | |||
Collection<String> modes, | |||
List<Agency> agencies, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe a case where multiple agencies would be returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Atlanta region, for the stop cluster formed by stops with code 600011 (from 3 different feeds for Cobb, Gwinnett, and Xpress), the logic as written returns one stop as documented, however only one agency is listed. Is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now. See my comment in GeocoderAPI.md.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After consulting with @miles-grant-ibigroup, this comment https://github.com/opentripplanner/OpenTripPlanner/pull/5634/files#r1463811604 needs to be addressed, so that all agencies operating stops in a stop cluster are listed.
The current implementation only ever returns a single stop (admittedly the end point is called "cluster") and a single ID. Which stop it is, is chosen at random and the definition of a cluster are stops . If we wanted the result to return multiple stops from multiple feeds I would have to rework the API a bit. Is this what we want, @binh-dam-ibigroup @miles-grant-ibigroup? BTW, even in a single feed a stop can be used by several agencies. There is no one-to-one mapping between stop and agency, the relationship is stop->route->agency. |
If there was a single, integrated feed in Atlanta that would contain these three agencies and a station/stop hierarchy, this would work automatically. |
However the OTP geocode endpoint does: https://atl-rides-otp-v2.ibi-transit.com/otp/routers/default/geocode?query=600011 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving per team discussion.
Summary
@miles-grant-ibigroup has requested that some data be added to the sandbox geocoder result, namely the agencies and feed publisher of a result.
It also shortens the path by removing the now superfluous
/routers/default
part, which is in line with other PRs and described in #4052.Unit tests
Added.
Documentation
Updated.