From db30836b537e1ecc00cbf7a688b6c14fab5ffee9 Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Tue, 25 Aug 2015 14:46:05 +0200 Subject: [PATCH] Add rising bollard exception to barriers for car profile. This handles `barrier=bollard` with `bollard=rising`, by making an exception to the barrier whitelist. Barriers tagged as such do no longer require an explicit access tag. This also adds corresponding tests, check this out: cucumber --tags @barrier References: - http://wiki.openstreetmap.org/wiki/Tag:barrier%3Dbollard - http://wiki.openstreetmap.org/wiki/Key:bollard - https://github.com/Project-OSRM/osrm-backend/issues/1616 --- features/car/barrier.feature | 7 +++++++ profiles/car.lua | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/features/car/barrier.feature b/features/car/barrier.feature index 7c89688c9..3f5bef53e 100644 --- a/features/car/barrier.feature +++ b/features/car/barrier.feature @@ -37,3 +37,10 @@ Feature: Car - Barriers | wall | no | | | wall | private | | | wall | agricultural | | + + Scenario: Car - Rising bollard exception for barriers + Then routability should be + | node/barrier | node/bollard | bothw | + | bollard | | | + | bollard | rising | x | + | bollard | removable | | diff --git a/profiles/car.lua b/profiles/car.lua index 03d266437..03ca924dc 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -195,7 +195,11 @@ function node_function (node, result) else local barrier = node:get_value_by_key("barrier") if barrier and "" ~= barrier then - if not barrier_whitelist[barrier] then + -- make an exception for rising bollard barriers + local bollard = node:get_value_by_key("bollard") + local rising_bollard = bollard and "rising" == bollard + + if not barrier_whitelist[barrier] and not rising_bollard then result.barrier = true end end