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
This commit is contained in:
Daniel J. Hofmann 2015-08-25 14:46:05 +02:00
parent 3e8ef5e462
commit db30836b53
2 changed files with 12 additions and 1 deletions

View File

@ -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 | |

View File

@ -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