do not overwrite vehicle maxspeed with higher value, fixes #6979#7036
Closed
woodpeck wants to merge 6 commits intoProject-OSRM:masterfrom
Closed
do not overwrite vehicle maxspeed with higher value, fixes #6979#7036woodpeck wants to merge 6 commits intoProject-OSRM:masterfrom
woodpeck wants to merge 6 commits intoProject-OSRM:masterfrom
Conversation
Contributor
|
This PR seems to be stale. Is it still relevant? |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to fix a maxspeed handling issue in the Lua car profile logic so that a higher signposted (edge-based) maxspeed does not override a lower vehicle-based maxspeed.
Changes:
- Update
WayHandlers.maxspeedto apply maxspeed viamath.min(...)against the current computed speeds. - Add a CHANGELOG entry documenting the fix under Profiles.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
profiles/lib/way_handlers.lua |
Changes maxspeed application to clamp against the current forward/backward speeds. |
CHANGELOG.md |
Adds a Profiles FIXED entry describing the behavior change. |
Comments suppressed due to low confidence (3)
profiles/lib/way_handlers.lua:442
- Using math.min() here prevents maxspeed tags from ever increasing the computed speed above the way-type/default speed set by WayHandlers.speed. This contradicts existing profile behavior/tests (e.g., features/car/maxspeed.feature scenario "Do not ignore maxspeed when higher than way speed" expects residential maxspeed=90 to yield 72 km/h after speed_reduction). Consider restoring the overwrite behavior and instead only clamping against an explicit vehicle-specific maximum (if that’s what needs protection), so maxspeed can still raise speeds when appropriate.
end
if result.backward_speed > 0 then
result.backward_rate = (result.backward_speed * backward_penalty) / 3.6
profiles/lib/way_handlers.lua:446
- Same issue as forward direction: math.min() here prevents maxspeed:backward (or maxspeed) from increasing backward_speed above the baseline speed, which will break scenarios where directional maxspeed is higher than the default/general value and is expected to override it.
if result.duration > 0 then
result.weight = result.duration / forward_penalty
end
CHANGELOG.md:88
- The new changelog entry sentence starts with a lowercase "edge" while surrounding FIXED entries use sentence-style capitalization. Consider capitalizing it (and optionally clarifying wording, e.g., "Edge maxspeed…"), to keep formatting consistent within the section.
- REMOVED: Remove unused AppVeyor files [#6860](https://github.com/Project-OSRM/osrm-backend/pull/6860)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
Implemented in separate PR linked above. |
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.
Issue
Fix the overwriting of a lower vehicle-based maxspeed by a higher signposted (edge-based) maxspeed
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?