Support trunk access for some countries

This commit is contained in:
tombay
2024-10-05 16:01:09 +10:00
parent becfd8a56d
commit 4b24713d76
8 changed files with 494 additions and 51 deletions
+15
View File
@@ -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