Add vehicle-specific maximum speed profiles with configurable upper bounds#7383
Conversation
|
@claude[agent] start the implementation of the feature and associated tests for when the vehicle max speed is set and als when it is unset. |
…pper bounds Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
Implementation complete in commit de6086a. Added:
The feature is non-intrusive and preserves default car profile behavior when vehicle_max_speed is nil. |
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
|
@claude[agent] the build is failing in an unexpected way. Analyse the failure and verify that it doesn't come from a rounding error in the calculation of the offset, which can exceed 1% depending on how it's calculated. |
Confirmed: the rounding error is 1.15%, which exceeds the 1% tolerance. The fuzzy matching uses strict less-than comparison ( Three fix options:
Which approach would you like me to implement? |
Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements vehicle-specific maximum speed caps for routing profiles, addressing issue #6979 where signposted maxspeeds could override lower vehicle-specific speed limits (e.g., trucks being routed at speeds exceeding their legal limits).
Changes:
- Added optional
vehicle_max_speedprofile property to enable vehicle-specific speed caps - Implemented
WayHandlers.vehicle_speed_cap()handler to enforce the maximum speed limit - Added comprehensive test coverage with three scenarios validating capping behavior, backward compatibility, and directional maxspeed interactions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| profiles/lib/way_handlers.lua | Adds vehicle_speed_cap handler that applies math.min() capping when vehicle_max_speed is set |
| profiles/car.lua | Declares optional vehicle_max_speed property (defaults to nil) and inserts handler in correct execution order |
| features/car/maxspeed.feature | Adds three test scenarios covering vehicle_max_speed enabled, disabled, and directional maxspeed cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@claude[agent] Add a line to the changelog summarising this change. List issue #6979 as the reference. |
Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
No description provided.