Bugfix for interchanges that start and end from the same stop#4597
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #4597 +/- ##
=============================================
+ Coverage 60.63% 60.68% +0.04%
- Complexity 12229 12245 +16
=============================================
Files 1580 1584 +4
Lines 63461 63486 +25
Branches 6994 6993 -1
=============================================
+ Hits 38481 38526 +45
+ Misses 22801 22784 -17
+ Partials 2179 2176 -3 ☔ View full report in Codecov by Sentry. |
Member
|
Would it be too much to ask for a unit test, at least for the GTFS case? I see that there is a |
hannesj
self-requested a review
November 15, 2022 10:07
hannesj
previously approved these changes
Nov 21, 2022
t2gran
reviewed
Nov 23, 2022
t2gran
requested changes
Nov 23, 2022
t2gran
previously approved these changes
Dec 4, 2022
…java Co-authored-by: Thomas Gran <t2gran@gmail.com>
hannesj
reviewed
Dec 5, 2022
hannesj
reviewed
Dec 5, 2022
hannesj
reviewed
Dec 5, 2022
added 2 commits
December 5, 2022 17:15
hannesj
reviewed
Dec 5, 2022
hannesj
previously approved these changes
Dec 5, 2022
hannesj
approved these changes
Dec 5, 2022
t2gran
approved these changes
Dec 6, 2022
t2gran
pushed a commit
that referenced
this pull request
Dec 6, 2022
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Mar 25, 2026
When a ServiceJourneyInterchange references a ScheduledStopPoint that appears multiple times in the feeder trip's JourneyPattern (loop route), TransferMapper previously used lastIndexOf to pick a single stop position for the FROM side. This was introduced in opentripplanner#4597 to handle circular routes where the stop is both first and last. However, for loop-in-middle patterns (stop visited at positions 30 and 44 in a 45-stop pattern), lastIndexOf picks the wrong occurrence. Since we cannot know at import time which visit Raptor will use for the transfer, TransferMapper now creates a ConstrainedTransfer for each occurrence of the stop. This handles both circular routes and loop-in-middle patterns correctly. Addresses opentripplanner#7466
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug for interchanges that start end end from the same stop.
Issue
#4572