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.
This commit is contained in:
Michael Bell
2021-03-31 00:28:01 +01:00
parent c15b02ecf6
commit 8d3ebc64dc
4 changed files with 30 additions and 1 deletions
+12 -1
View File
@@ -342,7 +342,18 @@ function process_node(profile, node, result, relations)
local bollard = node:get_value_by_key("bollard")
local rising_bollard = bollard and "rising" == bollard
if not profile.barrier_whitelist[barrier] and not rising_bollard or restricted_by_height then
-- make an exception for lowered/flat barrier=kerb
-- and incorrect tagging of highway crossing kerb as highway barrier
local kerb = node:get_value_by_key("kerb")
local highway = node:get_value_by_key("highway")
local flat_kerb = kerb and ("lowered" == kerb or "flush" == kerb)
local highway_crossing_kerb = barrier == "kerb" and highway and highway == "crossing"
if not profile.barrier_whitelist[barrier]
and not rising_bollard
and not flat_kerb
and not highway_crossing_kerb
or restricted_by_height then
result.barrier = true
end
end