Skip to content

Commit aa65f46

Browse files
fix(profiles): add winter_road/ice_road and surface=ice/snow to car.lua (#7465)
* fix(profiles): add winter_road/ice_road and surface=ice/snow to car.lua OSM highway=winter_road, highway=ice_road, surface=ice, and surface=snow had no entries in car.lua. OSRM was routing over these ways at full highway speed, producing dangerously optimistic routes in winter conditions. Add conservative speed caps consistent with safe winter driving: - speeds.highway: winter_road=20, ice_road=15 (km/h) - surface_speeds: ice=20, snow=30 (km/h) WayHandlers.speed() and WayHandlers.surface() already read these tables; no logic changes required. Fixes #7464 Co-Authored-By: Claude and aki1770-del <aki1770@gmail.com> * test(profiles): add cucumber tests for winter_road/ice_road and surface=ice/snow Co-Authored-By: Claude and aki1770-del <aki1770@gmail.com> --------- Co-authored-by: Dennis Luxen <info@project-osrm.org>
1 parent b3b0f38 commit aa65f46

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

features/car/speed.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Feature: Car - speeds
2323
| residential | no | 25 km/h |
2424
| living_street | no | 10 km/h |
2525
| service | no | 15 km/h |
26+
| winter_road | no | 20 km/h |
27+
| ice_road | no | 15 km/h |
2628

2729
# Alternating oneways scale rates but not speeds
2830
Scenario: Car - scaled speeds for oneway=alternating

features/car/surface.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Feature: Car - Surfaces
3333
| trunk | asphalt | x |
3434
| trunk | sett | x |
3535
| trunk | gravel | x |
36+
| trunk | ice | x |
37+
| trunk | snow | x |
3638
| trunk | nonsense | x |
3739

3840
Scenario: Car - Good surfaces should not grant access
@@ -93,6 +95,8 @@ Feature: Car - Surfaces
9395
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 |
9496
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 |
9597
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
98+
| motorway | no | ice | 20 km/h +-1 | 20 km/h +-1 |
99+
| motorway | no | snow | 30 km/h +-1 | 30 km/h +-1 |
96100

97101
Scenario: Car - Tracktypes should reduce speed
98102
Then routability should be

profiles/car.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ function setup()
163163
unclassified = 25,
164164
residential = 25,
165165
living_street = 10,
166-
service = 15
166+
service = 15,
167+
-- winter highway types (OSM highway=winter_road / highway=ice_road)
168+
winter_road = 20,
169+
ice_road = 15
167170
}
168171
},
169172

@@ -251,7 +254,11 @@ function setup()
251254
rocky = 20,
252255
sand = 20,
253256

254-
mud = 10
257+
mud = 10,
258+
259+
-- winter surfaces (OSM surface=ice / surface=snow)
260+
ice = 20,
261+
snow = 30
255262
},
256263

257264
-- max speed for tracktypes

0 commit comments

Comments
 (0)