Skip to content

Commit

Permalink
Introduces a construction whitelist in profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-j-h authored and Patrick Niklaus committed Jul 19, 2017
1 parent 48824c4 commit 64e4b7e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions profiles/bicycle.lua
Expand Up @@ -70,6 +70,12 @@ function setup()

restricted_highway_whitelist = Set { },

construction_whitelist = Set {
'no',
'widening',
'minor',
},

access_tags_hierarchy = Sequence {
'bicycle',
'vehicle',
Expand Down
6 changes: 6 additions & 0 deletions profiles/car.lua
Expand Up @@ -155,6 +155,12 @@ function setup()
'living_street',
},

construction_whitelist = Set {
'no',
'widening',
'minor',
},

route_speeds = {
ferry = 5,
shuttle_train = 10
Expand Down
2 changes: 2 additions & 0 deletions profiles/foot.lua
Expand Up @@ -57,6 +57,8 @@ function setup()

restricted_highway_whitelist = Set { },

construction_whitelist = Set {},

access_tags_hierarchy = Sequence {
'foot',
'access'
Expand Down
2 changes: 1 addition & 1 deletion profiles/lib/way_handlers.lua
Expand Up @@ -521,7 +521,7 @@ function WayHandlers.blocked_ways(profile,way,result,data)
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' and construction ~= 'minor' then
if construction and not profile.construction_whitelist[construction] then
return false
end
end
Expand Down

0 comments on commit 64e4b7e

Please sign in to comment.