better handling of access and barrier tags

This commit is contained in:
Emil Tin
2012-10-03 19:04:56 +02:00
parent 30465f08ac
commit 4b00557fda
13 changed files with 162 additions and 159 deletions
+14 -24
View File
@@ -7,6 +7,7 @@ Feature: Bike - Restricted access
Scenario: Bike - Access tags on ways
Then routability should be
| access | bothw |
| | x |
| yes | x |
| motorcar | x |
| motor_vehicle | x |
@@ -14,31 +15,17 @@ Feature: Bike - Restricted access
| permissive | x |
| designated | x |
| no | |
| foot | |
| private | |
| agricultural | |
| forestry | |
| designated | |
| forestery | |
| 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
Then routability should be
| node:access | bothw |
| node/access | bothw |
| | x |
| yes | x |
| motorcar | x |
| motor_vehicle | x |
@@ -46,21 +33,24 @@ Feature: Bike - Restricted access
| permissive | x |
| designated | x |
| no | |
| foot | |
| private | |
| agricultural | |
| forestry | |
| designated | |
| forestery | |
| some_tag | x |
Scenario: Bike - Access tags on both nodes and way
Then routability should be
| access | node:access | bothw |
| access | node/access | bothw |
| yes | yes | x |
| yes | no | |
| yes | some_tag | |
| yes | foot | |
| yes | some_tag | x |
| no | yes | |
| no | no | |
| no | foot | |
| no | some_tag | |
| some_tag | yes | |
| some_tag | yes | x |
| some_tag | no | |
| some_tag | some_tag | |
| some_tag | foot | |
| some_tag | some_tag | x |
+37 -31
View File
@@ -6,37 +6,43 @@ Feature: Barriers
Scenario: Bike - Barriers
Then routability should be
| highway | node/barrier | node/access | bothw |
| primary | | | x |
| primary | gate | | x |
| primary | cattle_grid | | x |
| primary | border_control | | x |
| primary | toll_booth | | x |
| primary | sally_port | | x |
| primary | bollard | | x |
| primary | some_tag | | |
| node/barrier | bothw |
| | x |
| bollard | x |
| gate | x |
| cattle_grid | x |
| border_control | x |
| toll_booth | x |
| sally_port | x |
| entrance | x |
| wall | |
| fence | |
| some_tag | |
Scenario: Bike - Access tag trumphs barriers
Then routability should be
| highway | node/barrier | node/access | bothw |
| primary | bollard | yes | x |
| primary | gate | yes | x |
| primary | cattle_grid | yes | x |
| primary | border_control | yes | x |
| primary | toll_booth | yes | x |
| primary | sally_port | yes | x |
| primary | bollard | no | |
| primary | gate | no | |
| primary | cattle_grid | no | |
| primary | border_control | no | |
| primary | toll_booth | no | |
| primary | sally_port | no | |
| primary | sally_port | some_tag | |
| primary | some_tag | bicycle | x |
| primary | some_tag | foot | |
| primary | some_tag | motorcar | |
| primary | some_tag | motor_vehicle | |
| primary | some_tag | vehicle | |
| primary | some_tag | motorcar | |
| primary | some_tag | permissive | |
| primary | some_tag | designated | |
| node/barrier | node/access | bothw |
| bollard | | x |
| bollard | yes | x |
| bollard | bicycle | x |
| bollard | vehicle | x |
| bollard | motorcar | x |
| bollard | motor_vehicle | x |
| bollard | permissive | x |
| bollard | designated | x |
| bollard | no | |
| bollard | foot | |
| bollard | private | |
| bollard | agricultural | |
| wall | | |
| wall | yes | x |
| wall | bicycle | x |
| wall | vehicle | x |
| wall | motorcar | x |
| wall | motor_vehicle | x |
| wall | permissive | x |
| wall | designated | x |
| wall | no | |
| wall | foot | |
| wall | private | |
| wall | agricultural | |
+7 -24
View File
@@ -16,29 +16,13 @@ Feature: Car - Restricted access
| no | |
| private | |
| agricultural | |
| forestry | |
| designated | |
| forestery | |
| 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
Then routability should be
| node:access | bothw |
| node/access | bothw |
| yes | x |
| motorcar | x |
| motor_vehicle | x |
@@ -48,19 +32,18 @@ Feature: Car - Restricted access
| no | |
| private | |
| agricultural | |
| forestry | |
| designated | |
| forestery | |
| some_tag | x |
Scenario: Car - Access tags on both nodes and way
Then routability should be
| access | node:access | bothw |
| access | node/access | bothw |
| yes | yes | x |
| yes | no | |
| yes | some_tag | |
| yes | some_tag | x |
| no | yes | |
| no | no | |
| no | some_tag | |
| some_tag | yes | |
| some_tag | yes | x |
| some_tag | no | |
| some_tag | some_tag | |
| some_tag | some_tag | x |
+38 -32
View File
@@ -6,37 +6,43 @@ Feature: Car - Barriers
Scenario: Car - Barriers
Then routability should be
| highway | node/barrier | node/access | bothw |
| primary | | | x |
| primary | gate | | x |
| primary | cattle_grid | | x |
| primary | border_control | | x |
| primary | toll_booth | | x |
| primary | sally_port | | x |
| primary | bollard | | |
| primary | some_tag | | |
| node/barrier | bothw |
| | x |
| bollard | |
| gate | x |
| cattle_grid | x |
| border_control | x |
| toll_booth | x |
| sally_port | x |
| entrance | |
| wall | |
| fence | |
| some_tag | |
Scenario: Car - Access tag trumphs barriers
Then routability should be
| highway | node/barrier | node/access | bothw |
| primary | bollard | yes | x |
| primary | gate | yes | x |
| primary | cattle_grid | yes | x |
| primary | border_control | yes | x |
| primary | toll_booth | yes | x |
| primary | sally_port | yes | x |
| primary | bollard | no | |
| primary | gate | no | |
| primary | cattle_grid | no | |
| primary | border_control | no | |
| primary | toll_booth | no | |
| primary | sally_port | no | |
| primary | sally_port | some_tag | |
| primary | bollard | bicycle | |
| primary | bollard | foot | |
| primary | bollard | motorcar | x |
| primary | bollard | motor_vehicle | x |
| primary | bollard | vehicle | x |
| primary | bollard | motorcar | x |
| primary | bollard | permissive | x |
| primary | bollard | designated | x |
| node/barrier | node/access | bothw |
| gate | | x |
| gate | yes | x |
| gate | vehicle | x |
| gate | motorcar | x |
| gate | motor_vehicle | x |
| gate | permissive | x |
| gate | designated | x |
| gate | no | |
| gate | foot | |
| gate | bicycle | |
| gate | private | |
| gate | agricultural | |
| wall | | |
| wall | yes | x |
| wall | vehicle | x |
| wall | motorcar | x |
| wall | motor_vehicle | x |
| wall | permissive | x |
| wall | designated | x |
| wall | no | |
| wall | foot | |
| wall | bicycle | |
| wall | private | |
| wall | agricultural | |
+8 -8
View File
@@ -5,30 +5,30 @@ Feature: Max speed restrictions
Given the speedprofile "car"
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
| a | b | c |
And the ways
| nodes | highway | maxspeed |
| ab | motorway | |
| bc | motorway | 10 |
| ab | trunk | |
| bc | trunk | 10 |
When I route I should get
| from | to | route | time |
| a | b | ab | 40s ~10% |
| a | b | ab | 42s ~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
| a | b | c |
And the ways
| nodes | highway | maxspeed |
| ab | residential | |
| bc | residential | 50 |
| bc | residential | 85 |
When I route I should get
| from | to | route | time |
| a | b | ab | 145s ~10% |
| b | c | bc | 145s ~10% |
| a | b | ab | 144s ~10% |
| b | c | bc | 42s ~10% |
+10
View File
@@ -15,6 +15,16 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag
| highway | oneway | forw | backw |
| 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
Given the node map
| a | b |
+1
View File
@@ -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
Then routability should be
| highway | oneway:foot | bothw |
| footway | | x |
| motorway | yes | |
| motorway_link | yes | |
| trunk | yes | |
+1 -1
View File
@@ -10,7 +10,7 @@ Feature: Foot - Accessability of different way types
| motorway | |
| motorway_link | |
| trunk | |
| trunk_link | x |
| trunk_link | |
| primary | x |
| primary_link | x |
| secondary | x |
+1 -1
View File
@@ -157,7 +157,7 @@ Then /^routability should be$/ do |table|
table.hashes.each_with_index do |row,i|
got = row.dup
attempts = []
['forw','backw'].each do |direction|
['forw','backw','bothw'].each do |direction|
if table.headers.include? direction
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}")
+1 -3
View File
@@ -121,7 +121,6 @@ Feature: Distance calculation
| a | c | abc | 2000m +-1 |
| c | a | abc | 2000m +-1 |
@winding
Scenario: Distance of a winding south-north path
Given a grid size of 10 meters
Given the node map
@@ -144,7 +143,6 @@ Feature: Distance calculation
| a | g | abcdefgh | 60m +-1 |
| a | h | abcdefgh | 70m +-1 |
@winding
Scenario: Distance of a winding east-west path
Given a grid size of 10 meters
Given the node map
@@ -231,7 +229,7 @@ Feature: Distance calculation
| x | y | xy | 3162m +-1 |
@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 the node map
| a | b | s | t |