reorganizating tests into car/bike/foot
This commit is contained in:
parent
b23a89d5a8
commit
d4352b84ac
@ -1,4 +1,4 @@
|
||||
@routing @access
|
||||
@routing @bicycle @access
|
||||
Feature: Restricted access
|
||||
|
||||
Background:
|
@ -1,30 +1,9 @@
|
||||
@routing @barrier
|
||||
@routing @bicycle @barrier
|
||||
Feature: Barriers
|
||||
|
||||
Scenario: Barriers and cars
|
||||
Given the speedprofile "car"
|
||||
Then routability should be
|
||||
| highway | node/barrier | node/access | bothw |
|
||||
| primary | | | x |
|
||||
| primary | bollard | | |
|
||||
| primary | gate | | |
|
||||
| primary | cattle_grid | | |
|
||||
| primary | border_control | | |
|
||||
| primary | toll_booth | | |
|
||||
| primary | sally_port | | |
|
||||
| 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 | motorcar | x |
|
||||
| primary | bollard | motor_vehicle | x |
|
||||
| primary | bollard | vehicle | x |
|
||||
| primary | bollard | motorcar | x |
|
||||
| primary | bollard | permissive | x |
|
||||
| primary | bollard | designated | x |
|
||||
|
||||
Background:
|
||||
Given the speedprofile "bicycle"
|
||||
|
||||
Scenario: Barriers and bicycles
|
||||
Given the speedprofile "bicycle"
|
||||
Then routability should be
|
70
features/bicycle/destination.feature
Normal file
70
features/bicycle/destination.feature
Normal file
@ -0,0 +1,70 @@
|
||||
@routing @bicycle @destination
|
||||
Feature: Destination only, no passing through
|
||||
|
||||
Background:
|
||||
Given the speedprofile "bicycle"
|
||||
|
||||
Scenario: Destination only street
|
||||
Given the node map
|
||||
| a | | | | |
|
||||
| | b | c | d | |
|
||||
| | | | | e |
|
||||
|
||||
And the ways
|
||||
| nodes | access |
|
||||
| ab | |
|
||||
| bcd | destination |
|
||||
| de | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab,bcd |
|
||||
| a | d | ab,bcd |
|
||||
| a | e | ab,bcd,de |
|
||||
| e | d | de |
|
||||
| e | c | de,bcd |
|
||||
| e | b | de,bcd |
|
||||
| e | a | de,bcd,ab |
|
||||
| b | c | bcd |
|
||||
| b | d | bcd |
|
||||
| d | c | bcd |
|
||||
| d | b | bcd |
|
||||
|
||||
Scenario: Series of destination only streets
|
||||
Given the node map
|
||||
| a | | c | | e |
|
||||
| | b | | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | access |
|
||||
| ab | |
|
||||
| bc | destination |
|
||||
| cd | destination |
|
||||
| de | destination |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab |
|
||||
| a | d | ab |
|
||||
| a | e | ab |
|
||||
|
||||
Scenario: Routing inside a destination only area
|
||||
Given the node map
|
||||
| a | | c | | e |
|
||||
| | b | | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | access |
|
||||
| ab | destination |
|
||||
| bc | destination |
|
||||
| cd | destination |
|
||||
| de | destination |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | e | ab,bc,cd,de |
|
||||
| e | a | de,cd,bc,ab |
|
||||
| b | d | bc,cd |
|
||||
| d | b | cd,bc |
|
30
features/bicycle/ferry.feature
Normal file
30
features/bicycle/ferry.feature
Normal file
@ -0,0 +1,30 @@
|
||||
@routing @bicycle @ferry
|
||||
Feature: Handle ferry routes
|
||||
|
||||
Background:
|
||||
Given the speedprofile "bicycle"
|
||||
|
||||
Scenario: Use a ferry route
|
||||
Given the node map
|
||||
| a | b | c | | |
|
||||
| | | d | | |
|
||||
| | | e | f | g |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | bicycle |
|
||||
| abc | primary | | |
|
||||
| cde | | ferry | yes |
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | g | abc,cde,efg |
|
||||
| b | f | abc,cde,efg |
|
||||
| e | c | cde |
|
||||
| e | b | cde,abc |
|
||||
| e | a | cde,abc |
|
||||
| c | e | cde |
|
||||
| c | f | cde,efg |
|
||||
| c | g | cde,efg |
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
@routing @names
|
||||
@routing @bicycle @names
|
||||
Feature: Street names in instructions
|
||||
|
||||
Background:
|
||||
Given the speedprofile "bicycle"
|
||||
|
||||
Scenario: A named street
|
||||
Given the node map
|
120
features/bicycle/oneway.feature
Normal file
120
features/bicycle/oneway.feature
Normal file
@ -0,0 +1,120 @@
|
||||
@routing @bicycle @oneway
|
||||
Feature: Oneway streets
|
||||
Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing
|
||||
|
||||
Background:
|
||||
Given the speedprofile "bicycle"
|
||||
|
||||
Scenario: Simple oneway
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | yes | x | |
|
||||
|
||||
Scenario: Simple reverse oneway
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | -1 | | x |
|
||||
|
||||
Scenario: Around the Block
|
||||
Given the node map
|
||||
| a | b |
|
||||
| d | c |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| bc | |
|
||||
| cd | |
|
||||
| da | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| b | a | bc,cd,da |
|
||||
|
||||
Scenario: Handle various oneway tag values
|
||||
Then routability should be
|
||||
| oneway | forw | backw |
|
||||
| | x | x |
|
||||
| nonsense | x | x |
|
||||
| no | x | x |
|
||||
| false | x | x |
|
||||
| 0 | x | x |
|
||||
| yes | x | |
|
||||
| true | x | |
|
||||
| 1 | x | |
|
||||
| -1 | | x |
|
||||
|
||||
Scenario: Implied oneways
|
||||
Then routability should be
|
||||
| junction | forw | backw |
|
||||
| | x | x |
|
||||
| | x | x |
|
||||
| | x | x |
|
||||
| | x | x |
|
||||
| | x | x |
|
||||
| | x | x |
|
||||
| | x | x |
|
||||
| roundabout | x | |
|
||||
| roundabout | x | |
|
||||
| roundabout | x | |
|
||||
| roundabout | x | |
|
||||
|
||||
Scenario: Overriding implied oneways
|
||||
Then routability should be
|
||||
| highway | junction | oneway | forw | backw |
|
||||
| primary | roundabout | no | x | x |
|
||||
| primary | roundabout | yes | x | |
|
||||
| motorway_link | | -1 | | |
|
||||
| trunk_link | | -1 | | |
|
||||
| primary | roundabout | -1 | | x |
|
||||
|
||||
@bicycle
|
||||
Scenario: Oneway:bicycle should override normal oneways tags
|
||||
Then routability should be
|
||||
| oneway:bicycle | oneway | junction | forw | backw |
|
||||
| yes | | | x | |
|
||||
| yes | yes | | x | |
|
||||
| yes | no | | x | |
|
||||
| yes | -1 | | x | |
|
||||
| yes | | roundabout | x | |
|
||||
| no | | | x | x |
|
||||
| no | yes | | x | x |
|
||||
| no | no | | x | x |
|
||||
| no | -1 | | x | x |
|
||||
| no | | roundabout | x | x |
|
||||
| -1 | | | | x |
|
||||
| -1 | yes | | | x |
|
||||
| -1 | no | | | x |
|
||||
| -1 | -1 | | | x |
|
||||
| -1 | | roundabout | | x |
|
||||
|
||||
@bicycle
|
||||
Scenario: Bicycles and contra flow
|
||||
Then routability should be
|
||||
| oneway | cycleway | forw | backw |
|
||||
| yes | opposite | x | x |
|
||||
| yes | opposite_track | x | x |
|
||||
| yes | opposite_lane | x | x |
|
||||
| -1 | opposite | x | x |
|
||||
| -1 | opposite_track | x | x |
|
||||
| -1 | opposite_lane | x | x |
|
||||
| no | opposite | x | x |
|
||||
| no | opposite_track | x | x |
|
||||
| no | opposite_lane | x | x |
|
||||
|
||||
Scenario: Bikes should not be affected by car tags
|
||||
Then routability should be
|
||||
| junction | oneway | oneway:car | forw | backw |
|
||||
| | yes | yes | x | |
|
||||
| | yes | no | x | |
|
||||
| | yes | -1 | x | |
|
||||
| | no | yes | x | x |
|
||||
| | no | no | x | x |
|
||||
| | no | -1 | x | x |
|
||||
| | -1 | yes | | x |
|
||||
| | -1 | no | | x |
|
||||
| | -1 | -1 | | x |
|
||||
| roundabout | | yes | x | |
|
||||
| roundabout | | no | x | |
|
||||
| roundabout | | -1 | x | |
|
199
features/bicycle/restrictions.feature
Normal file
199
features/bicycle/restrictions.feature
Normal file
@ -0,0 +1,199 @@
|
||||
@routing @bicycle @restrictions
|
||||
Feature: Turn restrictions
|
||||
Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction
|
||||
Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes.
|
||||
|
||||
Background: Use car routing
|
||||
Given the speedprofile "bicycle"
|
||||
|
||||
@no_turning
|
||||
Scenario: No left turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | wj | j | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@no_turning
|
||||
Scenario: No right turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | ej | j | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | |
|
||||
|
||||
@no_turning
|
||||
Scenario: No u-turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | wj | j | no_u_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@no_turning
|
||||
Scenario: Handle any no_* relation
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | wj | j | no_weird_zigzags |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@only_turning
|
||||
Scenario: Only left turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | wj | j | only_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | |
|
||||
| s | e | |
|
||||
|
||||
@only_turning
|
||||
Scenario: Only right turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | ej | j | only_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | |
|
||||
| s | n | |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@only_turning
|
||||
Scenario: Only straight on
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | nj | j | only_straight_on |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | |
|
||||
| s | n | sj,nj |
|
||||
| s | e | |
|
||||
|
||||
@no_turning
|
||||
Scenario: Handle any only_* restriction
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| from | to | via | restriction |
|
||||
| sj | nj | j | only_weird_zigzags |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | |
|
||||
| s | n | sj,nj |
|
||||
| s | e | |
|
34
features/bicycle/way.feature
Normal file
34
features/bicycle/way.feature
Normal file
@ -0,0 +1,34 @@
|
||||
@routing @bicycle @way
|
||||
Feature: Accessability of different way types
|
||||
|
||||
Background:
|
||||
Given the speedprofile "bicycle"
|
||||
|
||||
Scenario: Basic access for bicycles
|
||||
Bikes are allowed on footways etc because you can pull your bike at a lower speed.
|
||||
Given the speedprofile "bicycle"
|
||||
Then routability should be
|
||||
| highway | forw |
|
||||
| motorway | |
|
||||
| motorway_link | |
|
||||
| trunk | |
|
||||
| trunk_link | |
|
||||
| primary | x |
|
||||
| primary_link | x |
|
||||
| secondary | x |
|
||||
| secondary_link | x |
|
||||
| tertiary | x |
|
||||
| tertiary_link | x |
|
||||
| residential | x |
|
||||
| service | x |
|
||||
| unclassified | x |
|
||||
| living_street | x |
|
||||
| road | x |
|
||||
| track | x |
|
||||
| path | x |
|
||||
| footway | x |
|
||||
| pedestrian | x |
|
||||
| steps | x |
|
||||
| pier | x |
|
||||
| cycleway | x |
|
||||
| bridleway | |
|
66
features/car/access.feature
Normal file
66
features/car/access.feature
Normal file
@ -0,0 +1,66 @@
|
||||
@routing @car @access
|
||||
Feature: Restricted access
|
||||
|
||||
Background:
|
||||
Given the speedprofile "car"
|
||||
|
||||
Scenario: Access tags on ways
|
||||
Then routability should be
|
||||
| access | bothw |
|
||||
| yes | x |
|
||||
| motorcar | x |
|
||||
| motor_vehicle | x |
|
||||
| vehicle | x |
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| designated | |
|
||||
| some_tag | x |
|
||||
|
||||
Scenario: 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: Access tags on nodes
|
||||
Then routability should be
|
||||
| node:access | bothw |
|
||||
| yes | x |
|
||||
| motorcar | x |
|
||||
| motor_vehicle | x |
|
||||
| vehicle | x |
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| designated | |
|
||||
| some_tag | x |
|
||||
|
||||
Scenario: Access tags on both nodes and way
|
||||
Then routability should be
|
||||
| access | node:access | bothw |
|
||||
| yes | yes | x |
|
||||
| yes | no | |
|
||||
| yes | some_tag | |
|
||||
| no | yes | |
|
||||
| no | no | |
|
||||
| no | some_tag | |
|
||||
| some_tag | yes | |
|
||||
| some_tag | no | |
|
||||
| some_tag | some_tag | |
|
28
features/car/barrier.feature
Normal file
28
features/car/barrier.feature
Normal file
@ -0,0 +1,28 @@
|
||||
@routing @car @barrier
|
||||
Feature: Barriers
|
||||
|
||||
Background:
|
||||
Given the speedprofile "car"
|
||||
|
||||
Scenario: Barriers and cars
|
||||
Then routability should be
|
||||
| highway | node/barrier | node/access | bothw |
|
||||
| primary | | | x |
|
||||
| primary | bollard | | |
|
||||
| primary | gate | | |
|
||||
| primary | cattle_grid | | |
|
||||
| primary | border_control | | |
|
||||
| primary | toll_booth | | |
|
||||
| primary | sally_port | | |
|
||||
| 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 | motorcar | x |
|
||||
| primary | bollard | motor_vehicle | x |
|
||||
| primary | bollard | vehicle | x |
|
||||
| primary | bollard | motorcar | x |
|
||||
| primary | bollard | permissive | x |
|
||||
| primary | bollard | designated | x |
|
@ -1,4 +1,4 @@
|
||||
@routing @destination
|
||||
@routing @car @destination
|
||||
Feature: Destination only, no passing through
|
||||
|
||||
Background:
|
@ -1,5 +1,8 @@
|
||||
@routing @ferry
|
||||
@routing @car @ferry
|
||||
Feature: Handle ferry routes
|
||||
|
||||
Background:
|
||||
Given the speedprofile "car"
|
||||
|
||||
Scenario: Use a ferry route
|
||||
Given the node map
|
44
features/car/names.feature
Normal file
44
features/car/names.feature
Normal file
@ -0,0 +1,44 @@
|
||||
@routing @car @names
|
||||
Feature: Street names in instructions
|
||||
|
||||
Background:
|
||||
Given the speedprofile "car"
|
||||
|
||||
Scenario: A named street
|
||||
Given the node map
|
||||
| a | b |
|
||||
| | c |
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| ab | My Way |
|
||||
| bc | Your Way |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | My Way,Your Way |
|
||||
|
||||
Scenario: Use way type to describe unnamed ways
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | tertiary | |
|
||||
| bc | residential | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | tertiary,residential |
|
||||
|
||||
Scenario: Don't create instructions for every node of unnamed ways
|
||||
Given the node map
|
||||
| a | b | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abcd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | primary |
|
49
features/car/oneway.feature
Normal file
49
features/car/oneway.feature
Normal file
@ -0,0 +1,49 @@
|
||||
@routing @car @oneway
|
||||
Feature: Oneway streets
|
||||
Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing
|
||||
|
||||
Background:
|
||||
Given the speedprofile "car"
|
||||
|
||||
Scenario: Simple oneway
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | yes | x | |
|
||||
|
||||
Scenario: Simple reverse oneway
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | -1 | | x |
|
||||
|
||||
Scenario: Around the Block
|
||||
Given the node map
|
||||
| a | b |
|
||||
| d | c |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| bc | |
|
||||
| cd | |
|
||||
| da | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| b | a | bc,cd,da |
|
||||
|
||||
Scenario: Cars should not be affected by bicycle tags
|
||||
Then routability should be
|
||||
| highway | junction | oneway | oneway:bicycle | forw | backw |
|
||||
| primary | | yes | yes | x | |
|
||||
| primary | | yes | no | x | |
|
||||
| primary | | yes | -1 | x | |
|
||||
| primary | | no | yes | x | x |
|
||||
| primary | | no | no | x | x |
|
||||
| primary | | no | -1 | x | x |
|
||||
| primary | | -1 | yes | | x |
|
||||
| primary | | -1 | no | | x |
|
||||
| primary | | -1 | -1 | | x |
|
||||
| primary | roundabout | | yes | x | |
|
||||
| primary | roundabout | | no | x | |
|
||||
| primary | roundabout | | -1 | x | |
|
@ -1,4 +1,4 @@
|
||||
@routing @restrictions
|
||||
@routing @car @restrictions
|
||||
Feature: Turn restrictions
|
||||
Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction
|
||||
Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes.
|
32
features/car/way.feature
Normal file
32
features/car/way.feature
Normal file
@ -0,0 +1,32 @@
|
||||
@routing @car @way
|
||||
Feature: Accessability of different way types
|
||||
|
||||
Background:
|
||||
Given the speedprofile "car"
|
||||
|
||||
Scenario: Basic access for cars
|
||||
Then routability should be
|
||||
| highway | forw |
|
||||
| motorway | x |
|
||||
| motorway_link | x |
|
||||
| trunk | x |
|
||||
| trunk_link | x |
|
||||
| primary | x |
|
||||
| primary_link | x |
|
||||
| secondary | x |
|
||||
| secondary_link | x |
|
||||
| tertiary | x |
|
||||
| tertiary_link | x |
|
||||
| residential | x |
|
||||
| service | x |
|
||||
| unclassified | x |
|
||||
| living_street | x |
|
||||
| road | |
|
||||
| track | |
|
||||
| path | |
|
||||
| footway | |
|
||||
| pedestrian | |
|
||||
| steps | |
|
||||
| pier | |
|
||||
| cycleway | |
|
||||
| bridleway | |
|
59
features/foot/oneway.feature
Normal file
59
features/foot/oneway.feature
Normal file
@ -0,0 +1,59 @@
|
||||
@routing @foot @oneway
|
||||
Feature: Oneway streets
|
||||
Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing
|
||||
|
||||
Background:
|
||||
Given the speedprofile "foot"
|
||||
|
||||
Scenario: Walking should not be affected by oneways
|
||||
Then routability should be
|
||||
| oneway | bothw |
|
||||
| | x |
|
||||
| nonsense | x |
|
||||
| no | x |
|
||||
| false | x |
|
||||
| 0 | x |
|
||||
| yes | x |
|
||||
| true | x |
|
||||
| 1 | x |
|
||||
| -1 | x |
|
||||
|
||||
Scenario: Walking and roundabouts
|
||||
Then routability should be
|
||||
| junction | bothw |
|
||||
| roundarout | x |
|
||||
|
||||
Scenario: Oneway:foot tag should not cause walking on big roads
|
||||
Then routability should be
|
||||
| highway | oneway:foot | bothw |
|
||||
| motorway | yes | |
|
||||
| motorway_link | yes | |
|
||||
| trunk | yes | |
|
||||
| trunk_link | yes | |
|
||||
| motorway | no | |
|
||||
| motorway_link | no | |
|
||||
| trunk | no | |
|
||||
| trunk_link | no | |
|
||||
| motorway | -1 | |
|
||||
| motorway_link | -1 | |
|
||||
| trunk | -1 | |
|
||||
| trunk_link | -1 | |
|
||||
|
||||
Scenario: Walking should respect oneway:foot
|
||||
Then routability should be
|
||||
| oneway:foot | oneway | junction | forw | backw |
|
||||
| yes | | | x | |
|
||||
| yes | yes | | x | |
|
||||
| yes | no | | x | |
|
||||
| yes | -1 | | x | |
|
||||
| yes | | roundabout | x | |
|
||||
| no | | | x | x |
|
||||
| no | yes | | x | x |
|
||||
| no | no | | x | x |
|
||||
| no | -1 | | x | x |
|
||||
| no | | roundabout | x | x |
|
||||
| -1 | | | | x |
|
||||
| -1 | yes | | | x |
|
||||
| -1 | no | | | x |
|
||||
| -1 | -1 | | | x |
|
||||
| -1 | | roundabout | | x |
|
32
features/foot/way.feature
Normal file
32
features/foot/way.feature
Normal file
@ -0,0 +1,32 @@
|
||||
@routing @foot @way
|
||||
Feature: Accessability of different way types
|
||||
|
||||
Background:
|
||||
Given the speedprofile "foot"
|
||||
|
||||
Scenario: Basic access for walking
|
||||
Then routability should be
|
||||
| highway | forw |
|
||||
| motorway | |
|
||||
| motorway_link | |
|
||||
| trunk | |
|
||||
| trunk_link | x |
|
||||
| primary | x |
|
||||
| primary_link | x |
|
||||
| secondary | x |
|
||||
| secondary_link | x |
|
||||
| tertiary | x |
|
||||
| tertiary_link | x |
|
||||
| residential | x |
|
||||
| service | x |
|
||||
| unclassified | x |
|
||||
| living_street | x |
|
||||
| road | x |
|
||||
| track | x |
|
||||
| path | x |
|
||||
| footway | x |
|
||||
| pedestrian | x |
|
||||
| steps | x |
|
||||
| pier | x |
|
||||
| cycleway | |
|
||||
| bridleway | |
|
@ -1,135 +0,0 @@
|
||||
@routing @oneway
|
||||
Feature: Oneway streets
|
||||
Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing
|
||||
|
||||
Scenario: Simple oneway
|
||||
Given the speedprofile "car"
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | yes | x | |
|
||||
|
||||
Scenario: Simple reverse oneway
|
||||
Given the speedprofile "car"
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | -1 | | x |
|
||||
|
||||
Scenario: Around the Block
|
||||
Given the node map
|
||||
| a | b |
|
||||
| d | c |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| bc | |
|
||||
| cd | |
|
||||
| da | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| b | a | bc,cd,da |
|
||||
|
||||
Scenario: Handle various oneway tag values
|
||||
Given the speedprofile "bicycle"
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | | x | x |
|
||||
| primary | nonsense | x | x |
|
||||
| primary | no | x | x |
|
||||
| primary | false | x | x |
|
||||
| primary | 0 | x | x |
|
||||
| primary | yes | x | |
|
||||
| primary | true | x | |
|
||||
| primary | 1 | x | |
|
||||
| primary | -1 | | x |
|
||||
|
||||
Scenario: Implied oneways
|
||||
Given the speedprofile "car"
|
||||
Then routability should be
|
||||
| highway | junction | forw | backw |
|
||||
| motorway | | x | |
|
||||
| motorway_link | | x | |
|
||||
| trunk | | x | x |
|
||||
| trunk_link | | x | x |
|
||||
| primary | | x | x |
|
||||
| primary_link | | x | x |
|
||||
| secondary | | x | x |
|
||||
| secondary_link | | x | x |
|
||||
| tertiary | | x | x |
|
||||
| tertiary_link | | x | x |
|
||||
| residential | | x | x |
|
||||
| primary | roundabout | x | |
|
||||
| secondary | roundabout | x | |
|
||||
| tertiary | roundabout | x | |
|
||||
| residential | roundabout | x | |
|
||||
|
||||
Scenario: Overriding implied oneways
|
||||
Given the speedprofile "car"
|
||||
Then routability should be
|
||||
| highway | junction | oneway | forw | backw |
|
||||
| motorway_link | | no | x | x |
|
||||
| trunk_link | | no | x | x |
|
||||
| primary | roundabout | no | x | x |
|
||||
| motorway_link | | yes | x | |
|
||||
| trunk_link | | yes | x | |
|
||||
| primary | roundabout | yes | x | |
|
||||
| motorway_link | | -1 | | x |
|
||||
| trunk_link | | -1 | | x |
|
||||
| primary | roundabout | -1 | | x |
|
||||
|
||||
@bicycle
|
||||
Scenario: Oneway:bicycle should override normal oneways tags
|
||||
Given the speedprofile "bicycle"
|
||||
Then routability should be
|
||||
| highway | oneway:bicycle | oneway | junction | forw | backw |
|
||||
| primary | yes | | | x | |
|
||||
| primary | yes | yes | | x | |
|
||||
| primary | yes | no | | x | |
|
||||
| primary | yes | -1 | | x | |
|
||||
| primary | yes | | roundabout | x | |
|
||||
| primary | no | | | x | x |
|
||||
| primary | no | yes | | x | x |
|
||||
| primary | no | no | | x | x |
|
||||
| primary | no | -1 | | x | x |
|
||||
| primary | no | | roundabout | x | x |
|
||||
| primary | -1 | | | | x |
|
||||
| primary | -1 | yes | | | x |
|
||||
| primary | -1 | no | | | x |
|
||||
| primary | -1 | -1 | | | x |
|
||||
| primary | -1 | | roundabout | | x |
|
||||
|
||||
@bicycle
|
||||
Scenario: Bicycles and contra flow
|
||||
Given the speedprofile "bicycle"
|
||||
Then routability should be
|
||||
| highway | oneway | cycleway | forw | backw |
|
||||
| primary | yes | opposite | x | x |
|
||||
| primary | yes | opposite_track | x | x |
|
||||
| primary | yes | opposite_lane | x | x |
|
||||
| primary | -1 | opposite | x | x |
|
||||
| primary | -1 | opposite_track | x | x |
|
||||
| primary | -1 | opposite_lane | x | x |
|
||||
| primary | no | opposite | x | x |
|
||||
| primary | no | opposite_track | x | x |
|
||||
| primary | no | opposite_lane | x | x |
|
||||
|
||||
@bicycle
|
||||
Scenario: Cars should not be affected by bicycle tags
|
||||
Given the speedprofile "car"
|
||||
Then routability should be
|
||||
| highway | junction | oneway | oneway:bicycle | forw | backw |
|
||||
| primary | | yes | yes | x | |
|
||||
| primary | | yes | no | x | |
|
||||
| primary | | yes | -1 | x | |
|
||||
| primary | | no | yes | x | x |
|
||||
| primary | | no | no | x | x |
|
||||
| primary | | no | -1 | x | x |
|
||||
| primary | | -1 | yes | | x |
|
||||
| primary | | -1 | no | | x |
|
||||
| primary | | -1 | -1 | | x |
|
||||
| primary | roundabout | | yes | x | |
|
||||
| primary | roundabout | | no | x | |
|
||||
| primary | roundabout | | -1 | x | |
|
||||
|
@ -1,79 +0,0 @@
|
||||
@routing @way
|
||||
Feature: Accessability of different way types
|
||||
|
||||
Scenario: Basic access for cars
|
||||
Given the speedprofile "car"
|
||||
Then routability should be
|
||||
| highway | forw |
|
||||
| motorway | x |
|
||||
| motorway_link | x |
|
||||
| trunk | x |
|
||||
| trunk_link | x |
|
||||
| primary | x |
|
||||
| secondary | x |
|
||||
| tertiary | x |
|
||||
| residential | x |
|
||||
| service | x |
|
||||
| unclassified | x |
|
||||
| living_street | x |
|
||||
| road | |
|
||||
| track | |
|
||||
| path | |
|
||||
| footway | |
|
||||
| pedestrian | |
|
||||
| steps | |
|
||||
| pier | |
|
||||
| cycleway | |
|
||||
| bridleway | |
|
||||
|
||||
Scenario: Basic access for bicycles
|
||||
Bikes are allowed on footways etc because you can pull your bike at a lower speed.
|
||||
Given the speedprofile "bicycle"
|
||||
Then routability should be
|
||||
| highway | forw |
|
||||
| motorway | |
|
||||
| motorway_link | |
|
||||
| trunk | |
|
||||
| trunk_link | |
|
||||
| primary | x |
|
||||
| secondary | x |
|
||||
| tertiary | x |
|
||||
| residential | x |
|
||||
| service | x |
|
||||
| unclassified | x |
|
||||
| living_street | x |
|
||||
| road | x |
|
||||
| track | x |
|
||||
| path | x |
|
||||
| footway | x |
|
||||
| pedestrian | x |
|
||||
| steps | x |
|
||||
| pier | x |
|
||||
| cycleway | x |
|
||||
| bridleway | |
|
||||
|
||||
Scenario: Basic access for walking
|
||||
Given the speedprofile "foot"
|
||||
Then routability should be
|
||||
| highway | forw |
|
||||
| motorway | |
|
||||
| motorway_link | |
|
||||
| trunk | |
|
||||
| trunk_link | x |
|
||||
| primary | x |
|
||||
| secondary | x |
|
||||
| tertiary | x |
|
||||
| residential | x |
|
||||
| service | x |
|
||||
| unclassified | x |
|
||||
| living_street | x |
|
||||
| road | x |
|
||||
| track | x |
|
||||
| path | x |
|
||||
| footway | x |
|
||||
| pedestrian | x |
|
||||
| steps | x |
|
||||
| pier | x |
|
||||
| cycleway | x |
|
||||
| bridleway | |
|
||||
|
@ -17,6 +17,7 @@ speed_profile = {
|
||||
["secondary"] = 18,
|
||||
["secondary_link"] = 18,
|
||||
["tertiary"] = 18,
|
||||
["tertiary_link"] = 18,
|
||||
["residential"] = 18,
|
||||
["unclassified"] = 16,
|
||||
["living_street"] = 16,
|
||||
|
@ -29,14 +29,13 @@ speed_profile = {
|
||||
["ferry"] = 5,
|
||||
["pedestrian"] = 5,
|
||||
["footway"] = 5,
|
||||
["cycleway"] = 5,
|
||||
["pier"] = 5,
|
||||
["default"] = 5
|
||||
}
|
||||
|
||||
|
||||
take_minimum_of_speeds = true
|
||||
obey_oneway = false
|
||||
obey_oneway = true
|
||||
obey_bollards = false
|
||||
use_restrictions = false
|
||||
ignore_areas = true -- future feature
|
||||
@ -87,7 +86,7 @@ function way_function (way, numberOfNodesInWay)
|
||||
local man_made = way.tags:Find("man_made")
|
||||
local barrier = way.tags:Find("barrier")
|
||||
local oneway = way.tags:Find("oneway")
|
||||
local cycleway = way.tags:Find("cycleway")
|
||||
local onewayClass = way.tags:Find("oneway:foot")
|
||||
local duration = way.tags:Find("duration")
|
||||
local service = way.tags:Find("service")
|
||||
local area = way.tags:Find("area")
|
||||
@ -173,15 +172,15 @@ function way_function (way, numberOfNodesInWay)
|
||||
|
||||
-- Set direction according to tags on way
|
||||
if obey_oneway then
|
||||
if oneway == "no" or oneway == "0" or oneway == "false" then
|
||||
way.direction = Way.bidirectional
|
||||
elseif oneway == "-1" then
|
||||
way.direction = Way.opposite
|
||||
elseif oneway == "yes" or oneway == "1" or oneway == "true" or junction == "roundabout" or highway == "motorway_link" or highway == "motorway" then
|
||||
way.direction = Way.oneway
|
||||
else
|
||||
way.direction = Way.bidirectional
|
||||
end
|
||||
if onewayClass == "yes" or onewayClass == "1" or onewayClass == "true" then
|
||||
way.direction = Way.oneway
|
||||
elseif onewayClass == "no" or onewayClass == "0" or onewayClass == "false" then
|
||||
way.direction = Way.bidirectional
|
||||
elseif onewayClass == "-1" then
|
||||
way.direction = Way.opposite
|
||||
else
|
||||
way.direction = Way.bidirectional
|
||||
end
|
||||
else
|
||||
way.direction = Way.bidirectional
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user