Skip to content

feat(highways): scale road width with lane count - #1104

Merged
louis-e merged 4 commits into
mainfrom
feat/road-width-lanes
Jun 16, 2026
Merged

louis-e merged 4 commits into
mainfrom
feat/road-width-lanes

Conversation

@louis-e

@louis-e louis-e commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Vehicular roads now derive width from the OSM lanes=* tag at the standard 3.5 m/lane (lanes is the total for both directions), never narrower than the per-type default, so multi-lane arterials are visibly wider than a 2-lane street instead of all sharing one fixed width. width=* still wins, and the result is clamped to MAX_BLOCK_RANGE. tertiary widens 5 -> 7 m via its 2-lane default. Untagged and 2-lane roads keep their current widths.

Vehicular roads now derive width from the OSM lanes=* tag at the standard
3.5 m/lane (lanes is the total for both directions), never narrower than
the per-type default, so multi-lane arterials are visibly wider than a
2-lane street instead of all sharing one fixed width. width=* still wins,
and the result is clamped to MAX_BLOCK_RANGE. tertiary widens 5 -> 7 m via
its 2-lane default. Untagged and 2-lane roads keep their current widths.
Copilot AI review requested due to automatic review settings June 15, 2026 23:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the highway renderer so vehicular road widths can scale with the OSM lanes=* tag (3.5 m/lane), while preserving existing defaults for untagged and 2‑lane roads and keeping width=* as the highest-precedence override (clamped to MAX_BLOCK_RANGE).

Changes:

  • Introduces a lanes_scale_width flag per highway type to apply lane-based widening only to vehicular roads.
  • Parses and caps lanes=*, derives a lanes-based block_range, and applies clamping consistently.
  • Simplifies the old “other highway types” special-casing so residential/unclassified/etc. are handled by the unified lane-based logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/element_processing/highways.rs Outdated
Comment thread src/element_processing/highways.rs Outdated
Comment thread src/element_processing/highways.rs Outdated
@github-actions

github-actions Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 51s
🏗️ Generation time: 19s (excl. data fetching)
🧠 Peak memory usage: 1015 MB

📈 Compared against baseline: 18s time, 1005 MB memory
🧮 Delta: 33s time, 10 MB memory
🔢 Commit: 4d29bd4

🟢 Generation time is unchanged.
🟢 Peak memory is unchanged.

📅 Last benchmark: 2026-06-16 08:57:54 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Address PR review: the prescan/bridge consumers call highway_block_range,
which had diverged from the renderer's new lane-scaling, so road masks and
bridge widths disagreed with the rendered road. Move the full width logic
(per-type base, lanes scaling, width=* precedence, clamp) into
highway_block_range and have the renderer call it, so they can't drift.
width=* now tolerates a trailing "m" (reuses the shared width parser), and
a unit test covers the lane/width cases.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/element_processing/highways.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@louis-e
louis-e merged commit 89c90e1 into main Jun 16, 2026
4 checks passed
@louis-e
louis-e deleted the feat/road-width-lanes branch June 16, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants