Skip to content
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

Merged
merged 10 commits into from
Feb 5, 2024

Conversation

leonardehrenfried
Copy link
Member

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.

@leonardehrenfried leonardehrenfried added Sandbox IBI Developed by or important for IBI Group Skip Changelog labels Jan 22, 2024
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner January 22, 2024 07:09
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (eaa9160) 67.50% compared to head (a0e40e3) 67.52%.

❗ Current head a0e40e3 differs from pull request most recent head a83c2b1. Consider uploading reports for the commit a83c2b1 to get more accurate results

Files Patch % Lines
...opentripplanner/ext/geocoder/GeocoderResource.java 0.00% 2 Missing ⚠️
...pentripplanner/ext/geocoder/StopClusterMapper.java 87.50% 1 Missing and 1 partial ⚠️
...in/java/org/opentripplanner/apis/APIEndpoints.java 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@leonardehrenfried leonardehrenfried changed the title Geocoder agency Add agencies and feed publisher to geocoding result Jan 22, 2024
@@ -18,10 +19,22 @@ record StopCluster(
@Nullable String code,
String name,
Coordinate coordinate,
Collection<String> modes
Collection<String> modes,
List<Agency> agencies,
Copy link
Contributor

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?

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup Jan 23, 2024

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?

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup Jan 23, 2024

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.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a 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.

@leonardehrenfried
Copy link
Member Author

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.

@leonardehrenfried
Copy link
Member Author

If there was a single, integrated feed in Atlanta that would contain these three agencies and a station/stop hierarchy, this would work automatically.

@leonardehrenfried
Copy link
Member Author

BTW, the current Pelias geocoder on atlrides.com shows nothing for the term "600011".

Screenshot from 2024-01-24 14-21-31

@binh-dam-ibigroup
Copy link
Contributor

BTW, the current Pelias geocoder on atlrides.com shows nothing for the term "600011".

However the OTP geocode endpoint does: https://atl-rides-otp-v2.ibi-transit.com/otp/routers/default/geocode?query=600011

@t2gran t2gran added this to the 2.5 (next release) milestone Jan 26, 2024
Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a 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.

@leonardehrenfried leonardehrenfried merged commit 0978b31 into opentripplanner:dev-2.x Feb 5, 2024
5 checks passed
@leonardehrenfried leonardehrenfried deleted the geocoder-agency branch February 5, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IBI Developed by or important for IBI Group Sandbox Skip Changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants