Discards construction and proposed ways, resolves #4230

This commit is contained in:
Daniel J. Hofmann 2017-07-08 18:49:01 +02:00
parent 175d27691d
commit 6a555a477b
6 changed files with 53 additions and 3 deletions

View File

@ -0,0 +1,16 @@
@routing @car @construction
Feature: Car - all construction tags the OpenStreetMap community could think of and then some
Background:
Given the profile "car"
Scenario: Various ways to tag construction and proposed roads
Then routability should be
| highway | construction | proposed | bothw |
| primary | | | x |
| construction | | | |
| proposed | | | |
| primary | yes | | |
| primary | | yes | |
| primary | no | | x |
| primary | widening | | x |

View File

@ -189,7 +189,8 @@ local profile = {
avoid = Set {
'impassable',
'construction'
'construction',
'proposed'
}
}

View File

@ -110,7 +110,9 @@ local profile = {
'reversible',
'impassable',
'hov_lanes',
'steps'
'steps',
'construction',
'proposed'
},
speeds = Sequence {

View File

@ -76,7 +76,9 @@ local profile = {
},
avoid = Set {
'impassable'
'impassable',
'construction',
'proposed'
},
speeds = Sequence {

View File

@ -513,6 +513,25 @@ function Handlers.handle_blocked_ways(way,result,data,profile)
return false
end
-- In addition to the highway=construction tag above handle the construction=* tag
-- http://wiki.openstreetmap.org/wiki/Key:construction
-- https://taginfo.openstreetmap.org/keys/construction#values
if profile.avoid.construction then
local construction = way:get_value_by_key('construction')
-- Of course there are negative tags to handle, too
if construction and construction ~= 'no' and construction ~= 'widening' then
return false
end
end
-- Not only are there multiple construction tags there is also a proposed=* tag.
-- http://wiki.openstreetmap.org/wiki/Key:proposed
-- https://taginfo.openstreetmap.org/keys/proposed#values
if profile.avoid.proposed and way:get_value_by_key('proposed') then
return false
end
-- Reversible oneways change direction with low frequency (think twice a day):
-- do not route over these at all at the moment because of time dependence.
-- Note: alternating (high frequency) oneways are handled below with penalty.

View File

@ -366,6 +366,16 @@
"value": "circular",
"description": "A Roundabout where the traffic on the roundabout not always has right of way."
},
{
"key": "proposed",
"object_types": [ "way" ],
"description": "Proposed ways. Discarded for routing"
},
{
"key": "construction",
"object_types": [ "way" ],
"description": "Ways under construction. Discarded for routing except construction=no, construction=widening"
},
{
"key": "type",
"value": "restriction",