Avoid all highways listed in the avoid set

Even though the speeds are defined for a certain road class, routing should
be avoided as it is listed in the `avoid set`.
This commit is contained in:
Marcel Radischat 2017-12-06 11:32:38 +01:00 committed by Patrick Niklaus
parent 659b470320
commit b99d3a0a69
2 changed files with 10 additions and 0 deletions

View File

@ -356,6 +356,7 @@ function process_way(profile, way, result, relations)
-- routable. this includes things like status=impassable,
-- toll=yes and oneway=reversible
WayHandlers.blocked_ways,
WayHandlers.avoid_ways,
-- determine access status by checking our hierarchy of
-- access tags, e.g: motorcar, motor_vehicle, vehicle

View File

@ -490,6 +490,15 @@ function WayHandlers.weights(profile,way,result,data)
end
end
-- handle general avoid rules
function WayHandlers.avoid_ways(profile,way,result,data)
if profile.avoid[data.highway] then
return false
end
end
-- handle various that can block access
function WayHandlers.blocked_ways(profile,way,result,data)