Allow restricted access on highway=service roads for the car profile
We still backlist `access=private` for the car profile though.
This commit is contained in:
committed by
Patrick Niklaus
parent
a9d94d35a2
commit
02712cd513
@@ -71,6 +71,9 @@ function setup()
|
||||
|
||||
restricted_highway_whitelist = Set { },
|
||||
|
||||
-- tags disallow access to in combination with highway=service
|
||||
service_access_tag_blacklist = Set { },
|
||||
|
||||
construction_whitelist = Set {
|
||||
'no',
|
||||
'widening',
|
||||
|
||||
+9
-3
@@ -38,8 +38,8 @@ function setup()
|
||||
cardinal_directions = false,
|
||||
|
||||
-- Size of the vehicle, to be limited by physical restriction of the way
|
||||
vehicle_height = 2.5, -- in metters, 2.5m is the height of van
|
||||
vehicle_width = 1.9, -- in metters, ways with narrow tag are considered narrower than 2.2m
|
||||
vehicle_height = 2.5, -- in meters, 2.5m is the height of van
|
||||
vehicle_width = 1.9, -- in meters, ways with narrow tag are considered narrower than 2.2m
|
||||
|
||||
-- a list of suffixes to suppress in name change instructions. The suffixes also include common substrings of each other
|
||||
suffix_list = {
|
||||
@@ -79,6 +79,11 @@ function setup()
|
||||
'destination'
|
||||
},
|
||||
|
||||
-- tags disallow access to in combination with highway=service
|
||||
service_access_tag_blacklist = Set {
|
||||
'private'
|
||||
},
|
||||
|
||||
restricted_access_tag_list = Set {
|
||||
'private',
|
||||
'delivery',
|
||||
@@ -166,7 +171,8 @@ function setup()
|
||||
'tertiary_link',
|
||||
'residential',
|
||||
'living_street',
|
||||
'unclassified'
|
||||
'unclassified',
|
||||
'service'
|
||||
},
|
||||
|
||||
construction_whitelist = Set {
|
||||
|
||||
@@ -65,6 +65,9 @@ function setup()
|
||||
'access'
|
||||
},
|
||||
|
||||
-- tags disallow access to in combination with highway=service
|
||||
service_access_tag_blacklist = Set { },
|
||||
|
||||
restrictions = Sequence {
|
||||
'foot'
|
||||
},
|
||||
|
||||
@@ -81,6 +81,13 @@ function WayHandlers.startpoint(profile,way,result,data)
|
||||
result.is_startpoint = result.forward_mode == profile.default_mode or
|
||||
result.backward_mode == profile.default_mode
|
||||
end
|
||||
-- highway=service and access tags check
|
||||
local is_service = data.highway == "service"
|
||||
if is_service then
|
||||
if profile.service_access_tag_blacklist[data.forward_access] then
|
||||
result.is_startpoint = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- handle turn lanes
|
||||
@@ -219,7 +226,7 @@ function WayHandlers.access(profile,way,result,data)
|
||||
data.forward_access, data.backward_access =
|
||||
Tags.get_forward_backward_by_set(way,data,profile.access_tags_hierarchy)
|
||||
|
||||
-- only allow a subset of roads that are marked as restricted
|
||||
-- only allow a subset of roads to be treated as restricted
|
||||
if profile.restricted_highway_whitelist[data.highway] then
|
||||
if profile.restricted_access_tag_list[data.forward_access] then
|
||||
result.forward_restricted = true
|
||||
@@ -230,6 +237,7 @@ function WayHandlers.access(profile,way,result,data)
|
||||
end
|
||||
end
|
||||
|
||||
-- blacklist access tags that aren't marked as restricted
|
||||
if profile.access_tag_blacklist[data.forward_access] and not result.forward_restricted then
|
||||
result.forward_mode = mode.inaccessible
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user