add tunnel as a class in lua (#4812)

This commit is contained in:
Kajari Ghosh
2018-01-19 09:47:27 -05:00
committed by GitHub
parent a7f1cd36fb
commit 72de59ac91
5 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ function setup()
},
classes = Sequence {
'toll', 'motorway', 'ferry', 'restricted'
'toll', 'motorway', 'ferry', 'restricted', 'tunnel'
},
-- classes to support for exclude flags
+6
View File
@@ -283,6 +283,12 @@ end
function WayHandlers.classes(profile,way,result,data)
local forward_toll, backward_toll = Tags.get_forward_backward_by_key(way, data, "toll")
local forward_route, backward_route = Tags.get_forward_backward_by_key(way, data, "route")
local tunnel = way:get_value_by_key("tunnel")
if tunnel and tunnel ~= "no" then
result.forward_classes["tunnel"] = true
result.backward_classes["tunnel"] = true
end
if forward_toll == "yes" then
result.forward_classes["toll"] = true