-
Notifications
You must be signed in to change notification settings - Fork 58
Remove route short names in headsigns #1511
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
Conversation
amy-corson-ibigroup
left a comment
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.
Looks good to me! Just a clarifying question to make sure I'm understanding correctly.
| calendarMax="2027-12-31" | ||
| calendarMin="2026-01-01" |
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.
happy new year :)
| while (finalHeadsign.startsWith(`${routeShortName} `)) { | ||
| finalHeadsign = finalHeadsign.substring(routeShortName.length + 1) | ||
| } | ||
| } | ||
| return finalHeadsign | ||
| } |
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.
Just to make sure I understand, we're not using something like replaceAll here because we wouldn't want to remove characters that aren't actually the short name, right? For example if the shortname was something like "A" we wouldn't want to accidentally take out all the "a"s
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.
Correct.
daniel-heppner-ibigroup
left a comment
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.
Code looks good, do we know why the short name was getting prepended to the pattern name multiple times? Is there some other issue we should look into that's causing that?
@daniel-heppner-ibigroup This is probably where it is happening: https://github.com/opentripplanner/OpenTripPlanner/blob/24ade9781126307afd08cbe7eda427935e6cfddc/application/src/main/java/org/opentripplanner/graph_builder/module/TripPatternNamer.java#L124, where the |
Description:
This PR fixes headsigns where the route short name is prepended multiple times.
PR Checklist: