Support trunk access for some countries
This commit is contained in:
@@ -276,6 +276,16 @@ function WayHandlers.speed(profile,way,result,data)
|
||||
|
||||
local key,value,speed = Tags.get_constant_by_key_value(way,profile.speeds)
|
||||
|
||||
-- if the highway is trunk or trunk_link and locationtag disables it
|
||||
-- then noroute available
|
||||
|
||||
if not speed and data.highway and profile.uselocationtags and profile.uselocationtags.trunk then
|
||||
if profile.trunk_speeds[data.highway] and
|
||||
(not way:get_location_tag(data.highway) or way:get_location_tag(data.highway) ~= "no") then
|
||||
speed = profile.trunk_speeds[data.highway]
|
||||
end
|
||||
end
|
||||
|
||||
if speed then
|
||||
-- set speed by way type
|
||||
result.forward_speed = speed
|
||||
@@ -634,6 +644,11 @@ function WayHandlers.blocked_ways(profile,way,result,data)
|
||||
return false
|
||||
end
|
||||
|
||||
-- motorroad
|
||||
if profile.avoid.motorroad and way:get_value_by_key("motorroad") == "yes" then
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user