Remove route short names in headsigns#1511
Conversation
amy-corson-ibigroup
left a comment
There was a problem hiding this comment.
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.
happy new year :)
| while (finalHeadsign.startsWith(`${routeShortName} `)) { | ||
| finalHeadsign = finalHeadsign.substring(routeShortName.length + 1) | ||
| } | ||
| } | ||
| return finalHeadsign | ||
| } |
There was a problem hiding this comment.
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
daniel-heppner-ibigroup
left a comment
There was a problem hiding this comment.
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: