fix #3337 (instructions): propagate major road names for unnamed link instructions #3338
Merged
michaz merged 1 commit intographhopper:masterfrom Apr 9, 2026
Conversation
michaz
added a commit
that referenced
this pull request
Apr 9, 2026
…l other instructions - Remove buildRoadLabel() — set instruction name to just the street name, not a composite "Name (Ref)". The ref is already stored in STREET_REF and used by _getName() for display. - Remove duplicate setExtraInfo(STREET_REF, ref) that was immediately overwritten. - Update test to assert name and ref separately. Follows up on #3338. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Fixes #3337
Summary
This PR fixes missing road names for instructions that start on unnamed link roads and continue onto named major roads.
Previously, GraphHopper could generate instructions like:
Turn lefteven though the merged instruction actually continued onto a named road such as:
Purple Heart Trail (I-40)Root cause
The unnamed link and following major road were merged into a single instruction, but the major road name/ref was not propagated into the merged instruction.
Fix
Instead of guessing from neighboring graph edges, this change performs deferred name fallback on the actual routed continuation:
To avoid regressions for motorway destination-style instructions, the fallback is not applied when the instruction already carries destination-related information.
Result
The instruction now changes from:
Turn leftto:
Turn left onto Purple Heart Trail (I-40)for this class of cases.
Testing
InstructionListTestfor unnamed link -> named major road instruction generation.