Repository navigation
Fix speed limits on edges copied for via-way turn restrictions - #3441
Open
ZainnQureshii wants to merge 1 commit into
Open
ZainnQureshii wants to merge 1 commit into
ZainnQureshii wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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.
This contribution falls under the Apache License 2.0 as outlined in the contribution guide.
The patch adds
ZainnQureshiitoCONTRIBUTORS.md:101for this first contribution.Fixes #2914
With speed-limit estimation and turn costs enabled, a permitted turn can force a route onto a copied via-way edge (
core/src/main/java/com/graphhopper/routing/util/parsers/RestrictionSetter.java:83and:113). The old calculator read zero from the copy's unwritten temporary speed entry and cleared both directions when either limit was missing (core/src/main/java/com/graphhopper/routing/util/MaxSpeedCalculator.java:158onmaster). That left the copied segment without the car model'smax_speed * 0.9cap (core/src/main/resources/com/graphhopper/custom_models/car.json:17).The calculator now applies each estimate and its directional flags to the source edge and its copies, and preserves tagged directions when there is no estimate (
core/src/main/java/com/graphhopper/routing/util/MaxSpeedCalculator.java:162and:164in this patch). In the routing probe,max_speedchanged fromnullto 100 km/h withmax_speed_estimated: truein one way orientation, and fromnullto the tagged 70 km/h withmax_speed_estimated: falsewhen the way was reversed.GraphHopper.postImportOSM()is the production entry point for speed estimation (core/src/main/java/com/graphhopper/GraphHopper.java:928).RestrictionSettercreates the via-way copies through the sole production call tocopyEdge(). The other callers offorEdgeAndCopiesOfEdge()handle elevation smoothing, geometry sorting, or turn weights and leavemax_speeduntouched. Existing graphs need a fresh OSM import because loading a saved graph skips import processing (core/src/main/java/com/graphhopper/GraphHopper.java:799).The full Maven reactor passed on JDK 25.0.5.1 with
mvn -B -ntp clean test verify. Core reported 3,346 tests, including 20 skipped, with zero failures or errors.Both regression tests passed with Maven 3.9.6 and JDK 25.0.5.1.
The POM-pinned Checkstyle and Forbidden APIs checks passed on both changed Java files with a scratch-only configuration. Stock Checkstyle failed on the existing
LineLengthconfiguration, and stock Forbidden APIs flagged deprecatedLocaleconstructors in web-api on both revisions. The linked Eclipse formatter ran on copies of both files and reformatted the base and patched versions. The added Java lines meet the checked EditorConfig rules.Prepared with AI assistance (Codex and Claude Code) and reviewed with GitHub Copilot.
🤖 Generated with Claude Code