Skip to content

Commit 8d3ebc6

Browse files
committed
Add kerb barrier exception to default car profile
OSM data contains many mistakes that tag kerbs as highway barriers when instead they are only describing highway crossings. This PR updates the default car profile to handle these mistakes and unblock routing on the affected highways.
1 parent c15b02e commit 8d3ebc6

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
- Misc:
44
- FIXED: Upgrade to @mapbox/node-pre-gyp fix various bugs with Node 12/14 [#5991](https://github.com/Project-OSRM/osrm-backend/pull/5991)
55
- FIXED: `valid` type in documentation examples [#5990](https://github.com/Project-OSRM/osrm-backend/issues/5990)
6+
- Profile:
7+
- FIXED: Add kerb barrier exception to default car profile. [#5999](https://github.com/Project-OSRM/osrm-backend/pull/5999)
68

79
# 5.24.0
810
- Changes from 5.23.0

features/car/barrier.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ Feature: Car - Barriers
4646
| bollard | rising | x |
4747
| bollard | removable | |
4848

49+
# https://github.com/Project-OSRM/osrm-backend/issues/5996
50+
Scenario: Car - Kerb exception for barriers
51+
Then routability should be
52+
| node/barrier | node/highway | node/kerb | bothw |
53+
| kerb | | | |
54+
| kerb | crossing | | x |
55+
| kerb | crossing | yes | x |
56+
| kerb | | lowered | x |
57+
| kerb | | flush | x |
58+
| kerb | | raised | |
59+
| kerb | | yes | |
60+
4961
Scenario: Car - Height restrictions
5062
Then routability should be
5163
| node/barrier | node/maxheight | bothw |

profiles/car.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,18 @@ function process_node(profile, node, result, relations)
342342
local bollard = node:get_value_by_key("bollard")
343343
local rising_bollard = bollard and "rising" == bollard
344344

345-
if not profile.barrier_whitelist[barrier] and not rising_bollard or restricted_by_height then
345+
-- make an exception for lowered/flat barrier=kerb
346+
-- and incorrect tagging of highway crossing kerb as highway barrier
347+
local kerb = node:get_value_by_key("kerb")
348+
local highway = node:get_value_by_key("highway")
349+
local flat_kerb = kerb and ("lowered" == kerb or "flush" == kerb)
350+
local highway_crossing_kerb = barrier == "kerb" and highway and highway == "crossing"
351+
352+
if not profile.barrier_whitelist[barrier]
353+
and not rising_bollard
354+
and not flat_kerb
355+
and not highway_crossing_kerb
356+
or restricted_by_height then
346357
result.barrier = true
347358
end
348359
end

taginfo.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
{"key": "side_road", "value": "rotary", "description": "gets speed penalty"},
126126
{"key": "route", "object_types": ["way"]},
127127
{"key": "highway", "value": "traffic_signals", "object_types": ["node"]},
128+
{"key": "highway", "value": "crossing", "object_types": ["node"]},
128129
{"key": "access", "value": "yes"},
129130
{"key": "access", "value": "motorcar"},
130131
{"key": "access", "value": "motor_vehicle"},
@@ -202,6 +203,7 @@
202203
{"key": "barrier", "value": "lift_gate"},
203204
{"key": "barrier", "value": "no"},
204205
{"key": "barrier", "value": "entrance"},
206+
{"key": "barrier", "value": "kerb"},
205207
{"key": "highway", "value": "motorway"},
206208
{"key": "highway", "value": "motorway_link"},
207209
{"key": "highway", "value": "trunk"},
@@ -220,6 +222,8 @@
220222
{"key": "highway", "value": "movable"},
221223
{"key": "highway", "value": "shuttle_train"},
222224
{"key": "highway", "value": "default"},
225+
{"key": "kerb", "value": "lowered", "object_types": ["node"]},
226+
{"key": "kerb", "value": "flush", "object_types": ["node"]},
223227
{"key": "width", "description": "Penalties for narrow streets"},
224228
{"key": "lanes", "description": "Penalties for shared single lane streets"},
225229
{"key": "lanes:forward", "description": "Lanes in forward direction"},

0 commit comments

Comments
 (0)