feat: region-based road width factor with shoulder widths - #61
Merged
Conversation
- Add TemperateNorthAmerica to RegionType (US/CA wider than European Temperate)
- Update OSMParser: US, CA → TemperateNorthAmerica
- Update RegionTextures for TemperateNorthAmerica (same asphalt/roof/wall as Temperate, concrete kerb)
- Add RegionWidthFactors with GetWidthFactor(RegionType) and GetShoulderWidth(RoadType)
- Add GetWidthForRoadType(RoadType,int,RegionType) to RoadMeshExtruder using formula:
(lanes × laneWidth + shoulder) × regionFactor [when lanes>0]
baseTableWidth × regionFactor [when lanes==0]
- Update ExtrudeWithDetails(RoadType,...) to use region-aware width formula
- Add/update tests: 622 pass (612 before)
Co-authored-by: adam133 <20442729+adam133@users.noreply.github.com>
Agent-Logs-Url: https://github.com/adam133/vectorroad/sessions/34d3b6ab-22ab-4d21-8601-8b79e570bc3a
Copilot
AI
changed the title
[WIP] Add region based width factor for roads
feat: region-based road width factor with shoulder widths
Mar 22, 2026
adam133
marked this pull request as ready for review
March 22, 2026 23:21
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.
Road widths were uniform across regions despite real-world variation — US/Canadian roads are notably wider than European equivalents. This adds a mathematical width model that accounts for lanes, road-type shoulder widths, and a per-region multiplier.
Width formula
New:
RegionWidthFactorsclassGetWidthFactor(RegionType)— region multipliers: NA=1.10, EU/Boreal/Mediterranean=1.00, Desert=0.95, Arctic/Tropical=0.90, Steppe=0.85GetShoulderWidth(RoadType)— total shoulder (both sides): Motorway=6m, Trunk=5m, Primary=3m, Secondary=1.5m, Tertiary=1m, Residential=0.5m, Service/Dirt/Path/Cycleway=0mNew
RegionType.TemperateNorthAmericaUS and Canada are split out from
Temperate(Europe/East Asia) into a dedicatedTemperateNorthAmericaenum value.OSMParsermapsUS/CAcountry codes to this new type.RegionTexturesuses the same asphalt/wall/roof textures asTemperatewith concrete kerb (matching NA infrastructure style).RoadMeshExtruderchangesGetWidthForRoadType(RoadType, int lanes, RegionType region)— applies full formula aboveExtrudeWithDetails(RoadType, ...)now uses the region-aware overload instead of the lane-only one, so region is factored into mesh width automaticallyOriginal prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.