Reworks Restriction Whitelist / Blacklist, resolves #2833

Takes a stricter aproach for whitelisting / blacklisting restrictions:

- uses `restriction=`
- uses more specific `restriction:<type>=`
- uses `except=<type>` to invert

Where `type` is the type of transportation to restrict, e.g. `motorcar`.

https://github.com/Project-OSRM/osrm-backend/issues/2833
This commit is contained in:
Daniel J. Hofmann
2016-09-09 12:34:04 +02:00
committed by Moritz Kobitzsch
parent e7b2f85a20
commit bbbbacb073
9 changed files with 38 additions and 51 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
access_tags_hierarchy = { "bicycle", "vehicle", "access" }
cycleway_tags = {["track"]=true,["lane"]=true,["opposite"]=true,["opposite_lane"]=true,["opposite_track"]=true,["share_busway"]=true,["sharrow"]=true,["shared"]=true }
service_tag_restricted = { ["parking_aisle"] = true }
restriction_exception_tags = { "bicycle", "vehicle", "access" }
restrictions = { "bicycle" }
unsafe_highway_list = { ["primary"] = true, ["secondary"] = true, ["tertiary"] = true, ["primary_link"] = true, ["secondary_link"] = true, ["tertiary_link"] = true}
local default_speed = 15
@@ -121,8 +121,8 @@ local function parse_maxspeed(source)
return n
end
function get_exceptions(vector)
for i,v in ipairs(restriction_exception_tags) do
function get_restrictions(vector)
for i,v in ipairs(restrictions) do
vector:Add(v)
end
end
+3 -3
View File
@@ -12,7 +12,7 @@ access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
access_tags_hierarchy = { "motorcar", "motor_vehicle", "vehicle", "access" }
service_tag_restricted = { ["parking_aisle"] = true }
service_tag_forbidden = { ["emergency_access"] = true }
restriction_exception_tags = { "motorcar", "motor_vehicle", "vehicle" }
restrictions = { "motorcar", "motor_vehicle", "vehicle" }
-- A list of suffixes to suppress in name change instructions
suffix_list = { "N", "NE", "E", "SE", "S", "SW", "W", "NW", "North", "South", "West", "East" }
@@ -172,8 +172,8 @@ function get_name_suffix_list(vector)
end
end
function get_exceptions(vector)
for i,v in ipairs(restriction_exception_tags) do
function get_restrictions(vector)
for i,v in ipairs(restrictions) do
vector:Add(v)
end
end
+3 -3
View File
@@ -10,7 +10,7 @@ access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
access_tags_hierarchy = { "foot", "access" }
service_tag_restricted = { ["parking_aisle"] = true }
ignore_in_grid = { ["ferry"] = true }
restriction_exception_tags = { "foot" }
restrictions = { "foot" }
walking_speed = 5
@@ -71,8 +71,8 @@ properties.continue_straight_at_waypoint = false
local fallback_names = true
function get_exceptions(vector)
for i,v in ipairs(restriction_exception_tags) do
function get_restrictions(vector)
for i,v in ipairs(restrictions) do
vector:Add(v)
end
end