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 stop position type to GTFS GraphQL API #5810

Closed

Conversation

leonardehrenfried
Copy link
Member

@leonardehrenfried leonardehrenfried commented Apr 18, 2024

Summary

It adds a new field to the GTFS API which allows frontend developers to easily figure out if a stop time is the first, last or middle stop in a trip.

Why might you need this when you could just look at all stop times? In the nearby view (and perhaps others) when looking at the DepartureRow you see stop times in isolation without a trip. Here it would be nice if frontend developers could easily tell if it's the first or the last stop in a trip.

Unit tests

Added.

Documentation

Added.

cc @miles-grant-ibigroup

Copy link

codecov bot commented Apr 18, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 67.91%. Comparing base (bad0b72) to head (e866ce9).
Report is 1 commits behind head on dev-2.x.

Files Patch % Lines
...pplanner/apis/gtfs/mapping/TripPositionMapper.java 80.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5810      +/-   ##
=============================================
+ Coverage      67.89%   67.91%   +0.01%     
- Complexity     16556    16566      +10     
=============================================
  Files           1908     1910       +2     
  Lines          72341    72360      +19     
  Branches        7440     7441       +1     
=============================================
+ Hits           49117    49141      +24     
+ Misses         20702    20695       -7     
- Partials        2522     2524       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leonardehrenfried
Copy link
Member Author

We talked about it in the dev meeting today and there was criticism that it doesn't satisfy the "general use" criteria as it doesn't deal with the following cases:

  • interlined/stay seated trips
  • realtime update: what is when the last/first stop is cancelled?

I will convert this to a draft do more thinking on it.

@leonardehrenfried leonardehrenfried marked this pull request as draft April 18, 2024 15:01
@t2gran t2gran added this to the 2.6 (next release) milestone May 7, 2024
@t2gran
Copy link
Member

t2gran commented Jun 3, 2024

Can stopPositionInPattern and the trip numberOfScheduled stops be used? Then you can do what you need in the client. If this is problematic due to gap in stopPosition (caused by canceled stops) we will have to find a different solution. I am against adding types/features custom to one specific client - a more general use-case need to exist. Keep in mind that OTP is a general purpose router.

@leonardehrenfried
Copy link
Member Author

Are you aware that this is a draft?

@miles-grant-ibigroup
Copy link
Contributor

I'm happy to close this. IBI no longer needs this feature.

@t2gran
Copy link
Member

t2gran commented Jun 3, 2024

Are you aware that this is a draft?

Yes, I just want to give you an early warning - adding types/data structures witch I think is not part of eiter GTFS or NeTEx is a long shot. My gut feeling tels me this is probably use-case specific...

@leonardehrenfried leonardehrenfried deleted the stoptime-position branch June 4, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants