Modify TripPattern logic for updating stop-to-stop geometry - #3988
Merged
Bartosz-Kruba merged 1 commit intoMar 17, 2022
Merged
Conversation
| } | ||
| else { | ||
| // Use old geometry but patch first and last point with new stops | ||
| Coordinate newStart; |
Member
There was a problem hiding this comment.
Is there a reason that you put variable definition and assignment on two lines?
Contributor
Author
There was a problem hiding this comment.
No reason at all. I joined definition and assignment into one statement now.
Bartosz-Kruba
force-pushed
the
realtime_geometry
branch
from
March 15, 2022 10:38
b73935d to
d8362f6
Compare
hannesj
reviewed
Mar 15, 2022
| boolean stopsAreSame = other.getStop(i).equals(this.getStop(i)) && other.getStop(i + 1) | ||
| .equals(this.getStop(i + 1)); | ||
| boolean parentStationsAreSame = other.getStop(i) | ||
| .getParentStation() |
Contributor
There was a problem hiding this comment.
.getParentStation() might return null
Contributor
Author
There was a problem hiding this comment.
I changed code to use Objects.equals instead so that it is protected against nulls.
Bartosz-Kruba
force-pushed
the
realtime_geometry
branch
from
March 15, 2022 13:18
d8362f6 to
51910f2
Compare
- Do not default to straight line on stop point override (as long as it is the same stop place)
Bartosz-Kruba
force-pushed
the
realtime_geometry
branch
from
March 15, 2022 13:40
51910f2 to
7e60e47
Compare
Bartosz-Kruba
marked this pull request as ready for review
March 15, 2022 13:59
hannesj
approved these changes
Mar 15, 2022
leonardehrenfried
approved these changes
Mar 16, 2022
t2gran
pushed a commit
that referenced
this pull request
Mar 17, 2022
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
In case journey stop point is updated to different one do not reduce journey geometry to stop-to-stop straight line. Instead use original journey pattern and just patch first and last point to locations of new stop point. This happens only if both stop points lies within same parent station
Issue
N/A
Unit tests
No unit tests (as currently there are no tests for TripPattern class).
Code style
Yes
Documentation
Updated method java doc for modified method.