Fixes issue #432

This commit is contained in:
DennisOSRM 2012-09-26 18:16:15 +02:00
parent dccb9f2424
commit 01dc1af5f4

View File

@ -50,16 +50,39 @@ function node_function (node)
node.traffic_light = true;
end
if obey_bollards then
--flag node as unpassable if it black listed as unpassable
if access_tag_blacklist[barrier] then
node.bollard = true;
end
if access_tag_blacklist[barrier] then
node.bollard = true;
end
--reverse the previous flag if there is an access tag specifying entrance
if node.bollard and not bollards_whitelist[barrier] and not access_tag_whitelist[barrier] then
node.bollard = false;
end
if "" ~= barrier then
if obey_bollards then
--flag node as unpassable if it black listed as unpassable
print(barrier)
node.bollard = true;
end
--reverse the previous flag if there is an access tag specifying entrance
if node.bollard and bollards_whitelist[barrier] and access_tag_whitelist[barrier] then
node.bollard = false;
return 1
end
-- Check if our vehicle types are allowd to pass the barrier
for i,v in ipairs(access_tags) do
local mode_value = node.tags:Find(v)
if nil ~= mode_value and "yes" == mode_value then
return 1
node.bollard = false
return
end
end
else
-- Check if our vehicle types are forbidden to pass the node
for i,v in ipairs(access_tags) do
local mode_value = node.tags:Find(v)
if nil ~= mode_value and "no" == mode_value then
node.bollard = true
return 1
end
end
end
return 1
end