better handling of access and barrier tags
This commit is contained in:
parent
30465f08ac
commit
4b00557fda
@ -7,6 +7,7 @@ Feature: Bike - Restricted access
|
|||||||
Scenario: Bike - Access tags on ways
|
Scenario: Bike - Access tags on ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| access | bothw |
|
| access | bothw |
|
||||||
|
| | x |
|
||||||
| yes | x |
|
| yes | x |
|
||||||
| motorcar | x |
|
| motorcar | x |
|
||||||
| motor_vehicle | x |
|
| motor_vehicle | x |
|
||||||
@ -14,31 +15,17 @@ Feature: Bike - Restricted access
|
|||||||
| permissive | x |
|
| permissive | x |
|
||||||
| designated | x |
|
| designated | x |
|
||||||
| no | |
|
| no | |
|
||||||
|
| foot | |
|
||||||
| private | |
|
| private | |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestery | |
|
||||||
| designated | |
|
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
|
||||||
Scenario: Bike - Access tags for other modes should have no effect
|
|
||||||
Then routability should be
|
|
||||||
| access | bothw |
|
|
||||||
| ufo:yes | x |
|
|
||||||
| ufo:motorcar | x |
|
|
||||||
| ufo:motor_vehicle | x |
|
|
||||||
| ufo:vehicle | x |
|
|
||||||
| ufo:permissive | x |
|
|
||||||
| ufo:designated | x |
|
|
||||||
| ufo:no | x |
|
|
||||||
| ufo:private | x |
|
|
||||||
| ufo:agricultural | x |
|
|
||||||
| ufo:forestry | x |
|
|
||||||
| ufo:designated | x |
|
|
||||||
| ufo:some_tag | x |
|
|
||||||
|
|
||||||
Scenario: Bike - Access tags on nodes
|
Scenario: Bike - Access tags on nodes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| node:access | bothw |
|
| node/access | bothw |
|
||||||
|
| | x |
|
||||||
| yes | x |
|
| yes | x |
|
||||||
| motorcar | x |
|
| motorcar | x |
|
||||||
| motor_vehicle | x |
|
| motor_vehicle | x |
|
||||||
@ -46,21 +33,24 @@ Feature: Bike - Restricted access
|
|||||||
| permissive | x |
|
| permissive | x |
|
||||||
| designated | x |
|
| designated | x |
|
||||||
| no | |
|
| no | |
|
||||||
|
| foot | |
|
||||||
| private | |
|
| private | |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestery | |
|
||||||
| designated | |
|
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
|
||||||
Scenario: Bike - Access tags on both nodes and way
|
Scenario: Bike - Access tags on both nodes and way
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| access | node:access | bothw |
|
| access | node/access | bothw |
|
||||||
| yes | yes | x |
|
| yes | yes | x |
|
||||||
| yes | no | |
|
| yes | no | |
|
||||||
| yes | some_tag | |
|
| yes | foot | |
|
||||||
|
| yes | some_tag | x |
|
||||||
| no | yes | |
|
| no | yes | |
|
||||||
| no | no | |
|
| no | no | |
|
||||||
|
| no | foot | |
|
||||||
| no | some_tag | |
|
| no | some_tag | |
|
||||||
| some_tag | yes | |
|
| some_tag | yes | x |
|
||||||
| some_tag | no | |
|
| some_tag | no | |
|
||||||
| some_tag | some_tag | |
|
| some_tag | foot | |
|
||||||
|
| some_tag | some_tag | x |
|
||||||
|
@ -6,37 +6,43 @@ Feature: Barriers
|
|||||||
|
|
||||||
Scenario: Bike - Barriers
|
Scenario: Bike - Barriers
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | node/barrier | node/access | bothw |
|
| node/barrier | bothw |
|
||||||
| primary | | | x |
|
| | x |
|
||||||
| primary | gate | | x |
|
| bollard | x |
|
||||||
| primary | cattle_grid | | x |
|
| gate | x |
|
||||||
| primary | border_control | | x |
|
| cattle_grid | x |
|
||||||
| primary | toll_booth | | x |
|
| border_control | x |
|
||||||
| primary | sally_port | | x |
|
| toll_booth | x |
|
||||||
| primary | bollard | | x |
|
| sally_port | x |
|
||||||
| primary | some_tag | | |
|
| entrance | x |
|
||||||
|
| wall | |
|
||||||
|
| fence | |
|
||||||
|
| some_tag | |
|
||||||
|
|
||||||
Scenario: Bike - Access tag trumphs barriers
|
Scenario: Bike - Access tag trumphs barriers
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | node/barrier | node/access | bothw |
|
| node/barrier | node/access | bothw |
|
||||||
| primary | bollard | yes | x |
|
| bollard | | x |
|
||||||
| primary | gate | yes | x |
|
| bollard | yes | x |
|
||||||
| primary | cattle_grid | yes | x |
|
| bollard | bicycle | x |
|
||||||
| primary | border_control | yes | x |
|
| bollard | vehicle | x |
|
||||||
| primary | toll_booth | yes | x |
|
| bollard | motorcar | x |
|
||||||
| primary | sally_port | yes | x |
|
| bollard | motor_vehicle | x |
|
||||||
| primary | bollard | no | |
|
| bollard | permissive | x |
|
||||||
| primary | gate | no | |
|
| bollard | designated | x |
|
||||||
| primary | cattle_grid | no | |
|
| bollard | no | |
|
||||||
| primary | border_control | no | |
|
| bollard | foot | |
|
||||||
| primary | toll_booth | no | |
|
| bollard | private | |
|
||||||
| primary | sally_port | no | |
|
| bollard | agricultural | |
|
||||||
| primary | sally_port | some_tag | |
|
| wall | | |
|
||||||
| primary | some_tag | bicycle | x |
|
| wall | yes | x |
|
||||||
| primary | some_tag | foot | |
|
| wall | bicycle | x |
|
||||||
| primary | some_tag | motorcar | |
|
| wall | vehicle | x |
|
||||||
| primary | some_tag | motor_vehicle | |
|
| wall | motorcar | x |
|
||||||
| primary | some_tag | vehicle | |
|
| wall | motor_vehicle | x |
|
||||||
| primary | some_tag | motorcar | |
|
| wall | permissive | x |
|
||||||
| primary | some_tag | permissive | |
|
| wall | designated | x |
|
||||||
| primary | some_tag | designated | |
|
| wall | no | |
|
||||||
|
| wall | foot | |
|
||||||
|
| wall | private | |
|
||||||
|
| wall | agricultural | |
|
||||||
|
@ -16,29 +16,13 @@ Feature: Car - Restricted access
|
|||||||
| no | |
|
| no | |
|
||||||
| private | |
|
| private | |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestery | |
|
||||||
| designated | |
|
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
|
||||||
Scenario: Car - Access tags for other modes should have no effect
|
|
||||||
Then routability should be
|
|
||||||
| access | bothw |
|
|
||||||
| ufo:yes | x |
|
|
||||||
| ufo:motorcar | x |
|
|
||||||
| ufo:motor_vehicle | x |
|
|
||||||
| ufo:vehicle | x |
|
|
||||||
| ufo:permissive | x |
|
|
||||||
| ufo:designated | x |
|
|
||||||
| ufo:no | x |
|
|
||||||
| ufo:private | x |
|
|
||||||
| ufo:agricultural | x |
|
|
||||||
| ufo:forestry | x |
|
|
||||||
| ufo:designated | x |
|
|
||||||
| ufo:some_tag | x |
|
|
||||||
|
|
||||||
Scenario: Car - Access tags on nodes
|
Scenario: Car - Access tags on nodes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| node:access | bothw |
|
| node/access | bothw |
|
||||||
| yes | x |
|
| yes | x |
|
||||||
| motorcar | x |
|
| motorcar | x |
|
||||||
| motor_vehicle | x |
|
| motor_vehicle | x |
|
||||||
@ -48,19 +32,18 @@ Feature: Car - Restricted access
|
|||||||
| no | |
|
| no | |
|
||||||
| private | |
|
| private | |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestery | |
|
||||||
| designated | |
|
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
|
||||||
Scenario: Car - Access tags on both nodes and way
|
Scenario: Car - Access tags on both nodes and way
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| access | node:access | bothw |
|
| access | node/access | bothw |
|
||||||
| yes | yes | x |
|
| yes | yes | x |
|
||||||
| yes | no | |
|
| yes | no | |
|
||||||
| yes | some_tag | |
|
| yes | some_tag | x |
|
||||||
| no | yes | |
|
| no | yes | |
|
||||||
| no | no | |
|
| no | no | |
|
||||||
| no | some_tag | |
|
| no | some_tag | |
|
||||||
| some_tag | yes | |
|
| some_tag | yes | x |
|
||||||
| some_tag | no | |
|
| some_tag | no | |
|
||||||
| some_tag | some_tag | |
|
| some_tag | some_tag | x |
|
@ -6,37 +6,43 @@ Feature: Car - Barriers
|
|||||||
|
|
||||||
Scenario: Car - Barriers
|
Scenario: Car - Barriers
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | node/barrier | node/access | bothw |
|
| node/barrier | bothw |
|
||||||
| primary | | | x |
|
| | x |
|
||||||
| primary | gate | | x |
|
| bollard | |
|
||||||
| primary | cattle_grid | | x |
|
| gate | x |
|
||||||
| primary | border_control | | x |
|
| cattle_grid | x |
|
||||||
| primary | toll_booth | | x |
|
| border_control | x |
|
||||||
| primary | sally_port | | x |
|
| toll_booth | x |
|
||||||
| primary | bollard | | |
|
| sally_port | x |
|
||||||
| primary | some_tag | | |
|
| entrance | |
|
||||||
|
| wall | |
|
||||||
|
| fence | |
|
||||||
|
| some_tag | |
|
||||||
|
|
||||||
Scenario: Car - Access tag trumphs barriers
|
Scenario: Car - Access tag trumphs barriers
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | node/barrier | node/access | bothw |
|
| node/barrier | node/access | bothw |
|
||||||
| primary | bollard | yes | x |
|
| gate | | x |
|
||||||
| primary | gate | yes | x |
|
| gate | yes | x |
|
||||||
| primary | cattle_grid | yes | x |
|
| gate | vehicle | x |
|
||||||
| primary | border_control | yes | x |
|
| gate | motorcar | x |
|
||||||
| primary | toll_booth | yes | x |
|
| gate | motor_vehicle | x |
|
||||||
| primary | sally_port | yes | x |
|
| gate | permissive | x |
|
||||||
| primary | bollard | no | |
|
| gate | designated | x |
|
||||||
| primary | gate | no | |
|
| gate | no | |
|
||||||
| primary | cattle_grid | no | |
|
| gate | foot | |
|
||||||
| primary | border_control | no | |
|
| gate | bicycle | |
|
||||||
| primary | toll_booth | no | |
|
| gate | private | |
|
||||||
| primary | sally_port | no | |
|
| gate | agricultural | |
|
||||||
| primary | sally_port | some_tag | |
|
| wall | | |
|
||||||
| primary | bollard | bicycle | |
|
| wall | yes | x |
|
||||||
| primary | bollard | foot | |
|
| wall | vehicle | x |
|
||||||
| primary | bollard | motorcar | x |
|
| wall | motorcar | x |
|
||||||
| primary | bollard | motor_vehicle | x |
|
| wall | motor_vehicle | x |
|
||||||
| primary | bollard | vehicle | x |
|
| wall | permissive | x |
|
||||||
| primary | bollard | motorcar | x |
|
| wall | designated | x |
|
||||||
| primary | bollard | permissive | x |
|
| wall | no | |
|
||||||
| primary | bollard | designated | x |
|
| wall | foot | |
|
||||||
|
| wall | bicycle | |
|
||||||
|
| wall | private | |
|
||||||
|
| wall | agricultural | |
|
||||||
|
@ -5,30 +5,30 @@ Feature: Max speed restrictions
|
|||||||
Given the speedprofile "car"
|
Given the speedprofile "car"
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
|
|
||||||
Scenario: Car - Maxspeed below profile speed of way type
|
Scenario: Car - Respect maxspeeds when lower that way type speed
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c |
|
| a | b | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | maxspeed |
|
| nodes | highway | maxspeed |
|
||||||
| ab | motorway | |
|
| ab | trunk | |
|
||||||
| bc | motorway | 10 |
|
| bc | trunk | 10 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | b | ab | 40s ~10% |
|
| a | b | ab | 42s ~10% |
|
||||||
| b | c | bc | 360s ~10% |
|
| b | c | bc | 360s ~10% |
|
||||||
|
|
||||||
Scenario: Car - Maxspeed above profile speed of way type
|
Scenario: Car - Use maxspeed when higher that way type speed
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c |
|
| a | b | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | maxspeed |
|
| nodes | highway | maxspeed |
|
||||||
| ab | residential | |
|
| ab | residential | |
|
||||||
| bc | residential | 50 |
|
| bc | residential | 85 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | b | ab | 145s ~10% |
|
| a | b | ab | 144s ~10% |
|
||||||
| b | c | bc | 145s ~10% |
|
| b | c | bc | 42s ~10% |
|
||||||
|
@ -15,6 +15,16 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag
|
|||||||
| highway | oneway | forw | backw |
|
| highway | oneway | forw | backw |
|
||||||
| primary | -1 | | x |
|
| primary | -1 | | x |
|
||||||
|
|
||||||
|
Scenario: Car - Implied onewatys
|
||||||
|
Then routability should be
|
||||||
|
| highway | junction | forw | backw |
|
||||||
|
| motorway | | x | |
|
||||||
|
| motorway_link | | x | |
|
||||||
|
| primary | | x | x |
|
||||||
|
| motorway | roundabout | x | |
|
||||||
|
| motorway_link | roundabout | x | |
|
||||||
|
| primary | roundabout | x | |
|
||||||
|
|
||||||
Scenario: Car - Around the Block
|
Scenario: Car - Around the Block
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
|
@ -26,6 +26,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag
|
|||||||
Scenario: Foot - Oneway:foot tag should not cause walking on big roads
|
Scenario: Foot - Oneway:foot tag should not cause walking on big roads
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway:foot | bothw |
|
| highway | oneway:foot | bothw |
|
||||||
|
| footway | | x |
|
||||||
| motorway | yes | |
|
| motorway | yes | |
|
||||||
| motorway_link | yes | |
|
| motorway_link | yes | |
|
||||||
| trunk | yes | |
|
| trunk | yes | |
|
||||||
|
@ -10,7 +10,7 @@ Feature: Foot - Accessability of different way types
|
|||||||
| motorway | |
|
| motorway | |
|
||||||
| motorway_link | |
|
| motorway_link | |
|
||||||
| trunk | |
|
| trunk | |
|
||||||
| trunk_link | x |
|
| trunk_link | |
|
||||||
| primary | x |
|
| primary | x |
|
||||||
| primary_link | x |
|
| primary_link | x |
|
||||||
| secondary | x |
|
| secondary | x |
|
||||||
|
@ -157,7 +157,7 @@ Then /^routability should be$/ do |table|
|
|||||||
table.hashes.each_with_index do |row,i|
|
table.hashes.each_with_index do |row,i|
|
||||||
got = row.dup
|
got = row.dup
|
||||||
attempts = []
|
attempts = []
|
||||||
['forw','backw'].each do |direction|
|
['forw','backw','bothw'].each do |direction|
|
||||||
if table.headers.include? direction
|
if table.headers.include? direction
|
||||||
if direction == 'forw' || direction == 'bothw'
|
if direction == 'forw' || direction == 'bothw'
|
||||||
response = request_route("#{ORIGIN[1]},#{ORIGIN[0]+(1+WAY_SPACING*i)*@zoom}","#{ORIGIN[1]},#{ORIGIN[0]+(3+WAY_SPACING*i)*@zoom}")
|
response = request_route("#{ORIGIN[1]},#{ORIGIN[0]+(1+WAY_SPACING*i)*@zoom}","#{ORIGIN[1]},#{ORIGIN[0]+(3+WAY_SPACING*i)*@zoom}")
|
||||||
|
@ -121,7 +121,6 @@ Feature: Distance calculation
|
|||||||
| a | c | abc | 2000m +-1 |
|
| a | c | abc | 2000m +-1 |
|
||||||
| c | a | abc | 2000m +-1 |
|
| c | a | abc | 2000m +-1 |
|
||||||
|
|
||||||
@winding
|
|
||||||
Scenario: Distance of a winding south-north path
|
Scenario: Distance of a winding south-north path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
Given the node map
|
Given the node map
|
||||||
@ -144,7 +143,6 @@ Feature: Distance calculation
|
|||||||
| a | g | abcdefgh | 60m +-1 |
|
| a | g | abcdefgh | 60m +-1 |
|
||||||
| a | h | abcdefgh | 70m +-1 |
|
| a | h | abcdefgh | 70m +-1 |
|
||||||
|
|
||||||
@winding
|
|
||||||
Scenario: Distance of a winding east-west path
|
Scenario: Distance of a winding east-west path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
Given the node map
|
Given the node map
|
||||||
@ -231,7 +229,7 @@ Feature: Distance calculation
|
|||||||
| x | y | xy | 3162m +-1 |
|
| x | y | xy | 3162m +-1 |
|
||||||
|
|
||||||
@maze
|
@maze
|
||||||
Scenario: Distance of a winding south-north path
|
Scenario: Distance of a maze of short segments
|
||||||
Given a grid size of 7 meters
|
Given a grid size of 7 meters
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | s | t |
|
| a | b | s | t |
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
-- Bicycle profile
|
|
||||||
|
|
||||||
-- Begin of globals
|
-- Begin of globals
|
||||||
|
|
||||||
bollards_whitelist = { [""] = true, ["cattle_grid"] = true, ["border_control"] = true, ["toll_booth"] = true, ["no"] = true, ["sally_port"] = true, ["gate"] = true}
|
barrier_whitelist = { [""] = true, ["bollard"] = true, ["entrance"] = true, ["cattle_grid"] = true, ["border_control"] = true, ["toll_booth"] = true, ["no"] = true, ["sally_port"] = true, ["gate"] = true}
|
||||||
access_tag_whitelist = { ["yes"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true }
|
access_tag_whitelist = { ["yes"] = true, ["bicycle"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true }
|
||||||
access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestery"] = true }
|
access_tag_blacklist = { ["no"] = true, ["foot"] = true, ["private"] = true, ["agricultural"] = true, ["forestery"] = true }
|
||||||
access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
|
access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
|
||||||
access_tags = { "bicycle", "vehicle" }
|
|
||||||
service_tag_restricted = { ["parking_aisle"] = true }
|
service_tag_restricted = { ["parking_aisle"] = true }
|
||||||
ignore_in_grid = { ["ferry"] = true }
|
ignore_in_grid = { ["ferry"] = true }
|
||||||
|
|
||||||
@ -49,23 +46,28 @@ function node_function (node)
|
|||||||
local access = node.tags:Find ("access")
|
local access = node.tags:Find ("access")
|
||||||
local traffic_signal = node.tags:Find("highway")
|
local traffic_signal = node.tags:Find("highway")
|
||||||
|
|
||||||
--flag node if it carries a traffic light
|
-- flag node if it carries a traffic light
|
||||||
|
|
||||||
if traffic_signal == "traffic_signals" then
|
if traffic_signal == "traffic_signals" then
|
||||||
node.traffic_light = true;
|
node.traffic_light = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if obey_bollards then
|
-- parse access and barrier tags
|
||||||
--flag node as unpassable if it black listed as unpassable
|
if access ~= "" then
|
||||||
if access_tag_blacklist[barrier] then
|
if access_tag_blacklist[access] then
|
||||||
node.bollard = true;
|
node.bollard = true
|
||||||
|
else
|
||||||
|
node.bollard = false
|
||||||
end
|
end
|
||||||
|
elseif barrier ~= "" then
|
||||||
--reverse the previous flag if there is an access tag specifying entrance
|
if barrier_whitelist[barrier] then
|
||||||
if node.bollard and not bollards_whitelist[barrier] and not access_tag_whitelist[barrier] then
|
node.bollard = false
|
||||||
node.bollard = false;
|
else
|
||||||
|
node.bollard = true
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
node.bollard = false
|
||||||
end
|
end
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -93,6 +95,11 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
local access = way.tags:Find("access")
|
local access = way.tags:Find("access")
|
||||||
|
|
||||||
|
|
||||||
|
-- Check if we are allowed to access the way
|
||||||
|
if access_tag_blacklist[access] ~=nil and access_tag_blacklist[access] then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
-- Set the name that will be used for instructions
|
-- Set the name that will be used for instructions
|
||||||
if "" ~= ref then
|
if "" ~= ref then
|
||||||
way.name = ref
|
way.name = ref
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
barrier_whitelist = { ["cattle_grid"] = true, ["border_control"] = true, ["toll_booth"] = true, ["no"] = true, ["sally_port"] = true, ["gate"] = true}
|
barrier_whitelist = { ["cattle_grid"] = true, ["border_control"] = true, ["toll_booth"] = true, ["no"] = true, ["sally_port"] = true, ["gate"] = true}
|
||||||
access_tag_whitelist = { ["yes"] = true, ["motorcar"] = true, ["motor_vehicle"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true }
|
access_tag_whitelist = { ["yes"] = true, ["motorcar"] = true, ["motor_vehicle"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true }
|
||||||
access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestery"] = true }
|
access_tag_blacklist = { ["no"] = true, ["foot"] = true, ["bicycle"] = true, ["private"] = true, ["agricultural"] = true, ["forestery"] = true }
|
||||||
access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
|
access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
|
||||||
access_tags = { "motorcar", "motor_vehicle", "vehicle" }
|
access_tags = { "motorcar", "motor_vehicle", "vehicle" }
|
||||||
service_tag_restricted = { ["parking_aisle"] = true }
|
service_tag_restricted = { ["parking_aisle"] = true }
|
||||||
@ -44,26 +44,29 @@ function node_function (node)
|
|||||||
local access = node.tags:Find ("access")
|
local access = node.tags:Find ("access")
|
||||||
local traffic_signal = node.tags:Find("highway")
|
local traffic_signal = node.tags:Find("highway")
|
||||||
|
|
||||||
--flag node if it carries a traffic light
|
-- flag node if it carries a traffic light
|
||||||
|
|
||||||
if traffic_signal == "traffic_signals" then
|
if traffic_signal == "traffic_signals" then
|
||||||
node.traffic_light = true;
|
node.traffic_light = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if "" ~= barrier and obey_bollards then
|
-- parse access and barrier tags
|
||||||
node.bollard = true; -- flag as unpassable and then check
|
if access ~= "" then
|
||||||
|
if access_tag_blacklist[access] then
|
||||||
if "yes" == access then
|
node.bollard = true
|
||||||
node.bollard = false;
|
else
|
||||||
return
|
node.bollard = false
|
||||||
end
|
end
|
||||||
|
elseif barrier ~= "" then
|
||||||
--reverse the previous flag if there is an access tag specifying entrance
|
if barrier_whitelist[barrier] then
|
||||||
if node.bollard and (barrier_whitelist[barrier] or access_tag_whitelist[access]) then
|
node.bollard = false
|
||||||
node.bollard = false;
|
else
|
||||||
return
|
node.bollard = true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
node.bollard = false
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function way_function (way, numberOfNodesInWay)
|
function way_function (way, numberOfNodesInWay)
|
||||||
|
@ -11,7 +11,6 @@ service_tag_restricted = { ["parking_aisle"] = true }
|
|||||||
ignore_in_grid = { ["ferry"] = true }
|
ignore_in_grid = { ["ferry"] = true }
|
||||||
|
|
||||||
speed_profile = {
|
speed_profile = {
|
||||||
["trunk_link"] = 5,
|
|
||||||
["primary"] = 5,
|
["primary"] = 5,
|
||||||
["primary_link"] = 5,
|
["primary_link"] = 5,
|
||||||
["secondary"] = 5,
|
["secondary"] = 5,
|
||||||
|
Loading…
Reference in New Issue
Block a user