Add configurable lane_markings=no penalty to car profile#7409
Merged
DennisOSRM merged 2 commits intomasterfrom Mar 13, 2026
Merged
Add configurable lane_markings=no penalty to car profile#7409DennisOSRM merged 2 commits intomasterfrom
DennisOSRM merged 2 commits intomasterfrom
Conversation
- Add configurable lane_markings_penalty parameter (default 0.75) - Implement penalty logic for bidirectional roads with lane_markings=no - Document lane_markings tag in taginfo.json - Add comprehensive cucumber tests for feature Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
DennisOSRM
approved these changes
Mar 12, 2026
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.
Implements penalty for roads tagged with
lane_markings=noto reduce routing preference for narrow streets without clear lane markings. Addresses request to avoid rat-run roads while applying a lighter penalty (0.75×) than the existing single-lane penalty (0.5×).Implementation
lane_markings_penalty = 0.75to car.lua as globally configurable multiplierWayHandlers.penalties()to checklane_markings=notag and apply penalty only to bidirectional roadslane_markingsentry to taginfo.jsonBehavior
Example routing impact on primary road (65 km/h base):
lane_markings=no: rate = 13.5 m/s (0.75× multiplier)width=3orlanes=1: rate = 9.0 m/s (0.5× multiplier takes precedence)The penalty integrates with the existing penalty system via
math.min(), ensuring the most restrictive penalty always applies.Original prompt