Discards construction and proposed ways, resolves #4230
This commit is contained in:
parent
175d27691d
commit
6a555a477b
16
features/car/construction.feature
Normal file
16
features/car/construction.feature
Normal 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 |
|
@ -189,7 +189,8 @@ local profile = {
|
|||||||
|
|
||||||
avoid = Set {
|
avoid = Set {
|
||||||
'impassable',
|
'impassable',
|
||||||
'construction'
|
'construction',
|
||||||
|
'proposed'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,9 @@ local profile = {
|
|||||||
'reversible',
|
'reversible',
|
||||||
'impassable',
|
'impassable',
|
||||||
'hov_lanes',
|
'hov_lanes',
|
||||||
'steps'
|
'steps',
|
||||||
|
'construction',
|
||||||
|
'proposed'
|
||||||
},
|
},
|
||||||
|
|
||||||
speeds = Sequence {
|
speeds = Sequence {
|
||||||
|
@ -76,7 +76,9 @@ local profile = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
avoid = Set {
|
avoid = Set {
|
||||||
'impassable'
|
'impassable',
|
||||||
|
'construction',
|
||||||
|
'proposed'
|
||||||
},
|
},
|
||||||
|
|
||||||
speeds = Sequence {
|
speeds = Sequence {
|
||||||
|
@ -513,6 +513,25 @@ function Handlers.handle_blocked_ways(way,result,data,profile)
|
|||||||
return false
|
return false
|
||||||
end
|
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):
|
-- 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.
|
-- do not route over these at all at the moment because of time dependence.
|
||||||
-- Note: alternating (high frequency) oneways are handled below with penalty.
|
-- Note: alternating (high frequency) oneways are handled below with penalty.
|
||||||
|
10
taginfo.json
10
taginfo.json
@ -366,6 +366,16 @@
|
|||||||
"value": "circular",
|
"value": "circular",
|
||||||
"description": "A Roundabout where the traffic on the roundabout not always has right of way."
|
"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",
|
"key": "type",
|
||||||
"value": "restriction",
|
"value": "restriction",
|
||||||
|
Loading…
Reference in New Issue
Block a user