From 97e8962e9baacf16356edd3160b7824a19420ac7 Mon Sep 17 00:00:00 2001 From: tombay Date: Sat, 10 Aug 2024 18:58:23 +1000 Subject: [PATCH] Add files via upload --- features/countrybicycle/access.feature | 186 ++++++++++++++++++ features/countrybicycle/access_node.feature | 68 +++++++ features/countrybicycle/alley.feature | 34 ++++ features/countrybicycle/area.feature | 112 +++++++++++ features/countrybicycle/barrier.feature | 41 ++++ features/countrybicycle/bridge.feature | 44 +++++ features/countrybicycle/classes.feature | 92 +++++++++ .../countrybicycle/countrybikespeeds.feature | 89 +++++++++ features/countrybicycle/countryoneway.feature | 156 +++++++++++++++ features/countrybicycle/cycleway.feature | 99 ++++++++++ features/countrybicycle/destination.feature | 83 ++++++++ features/countrybicycle/distance.feature | 35 ++++ features/countrybicycle/exclude.feature | 55 ++++++ features/countrybicycle/ferry.feature | 63 ++++++ features/countrybicycle/maxspeed.feature | 90 +++++++++ features/countrybicycle/mode.feature | 97 +++++++++ features/countrybicycle/names.feature | 37 ++++ features/countrybicycle/oneway.feature | 152 ++++++++++++++ features/countrybicycle/pushing.feature | 127 ++++++++++++ features/countrybicycle/restrictions.feature | 133 +++++++++++++ features/countrybicycle/safety.feature | 104 ++++++++++ features/countrybicycle/startpoint.feature | 53 +++++ features/countrybicycle/stop_area.feature | 39 ++++ features/countrybicycle/surface.feature | 68 +++++++ features/countrybicycle/train.feature | 71 +++++++ features/countrybicycle/turn_penalty.feature | 42 ++++ features/countrybicycle/way.feature | 42 ++++ 27 files changed, 2212 insertions(+) create mode 100644 features/countrybicycle/access.feature create mode 100644 features/countrybicycle/access_node.feature create mode 100644 features/countrybicycle/alley.feature create mode 100644 features/countrybicycle/area.feature create mode 100644 features/countrybicycle/barrier.feature create mode 100644 features/countrybicycle/bridge.feature create mode 100644 features/countrybicycle/classes.feature create mode 100644 features/countrybicycle/countrybikespeeds.feature create mode 100644 features/countrybicycle/countryoneway.feature create mode 100644 features/countrybicycle/cycleway.feature create mode 100644 features/countrybicycle/destination.feature create mode 100644 features/countrybicycle/distance.feature create mode 100644 features/countrybicycle/exclude.feature create mode 100644 features/countrybicycle/ferry.feature create mode 100644 features/countrybicycle/maxspeed.feature create mode 100644 features/countrybicycle/mode.feature create mode 100644 features/countrybicycle/names.feature create mode 100644 features/countrybicycle/oneway.feature create mode 100644 features/countrybicycle/pushing.feature create mode 100644 features/countrybicycle/restrictions.feature create mode 100644 features/countrybicycle/safety.feature create mode 100644 features/countrybicycle/startpoint.feature create mode 100644 features/countrybicycle/stop_area.feature create mode 100644 features/countrybicycle/surface.feature create mode 100644 features/countrybicycle/train.feature create mode 100644 features/countrybicycle/turn_penalty.feature create mode 100644 features/countrybicycle/way.feature diff --git a/features/countrybicycle/access.feature b/features/countrybicycle/access.feature new file mode 100644 index 000000000..818594f5e --- /dev/null +++ b/features/countrybicycle/access.feature @@ -0,0 +1,186 @@ +@routing @countrybicycle @access +Feature: Bike - Access tags on ways +# Reference: http://wiki.openstreetmap.org/wiki/Key:access + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Access tag hierarchy on ways + Then routability should be + | highway | access | vehicle | bicycle | bothw | + | primary | | | | cycling | + | primary | yes | | | cycling | + | primary | no | | | | + | primary | | yes | | cycling | + | primary | | no | | | + | primary | no | yes | | cycling | + | primary | yes | no | | | + | primary | | | yes | cycling | + | primary | | | no | | + | primary | no | | yes | cycling | + | primary | yes | | no | | + | primary | | no | yes | cycling | + | primary | | yes | no | | + + @todo + Scenario: Bike - Access tag in forward direction + Then routability should be + | highway | access:forward | vehicle:forward | bicycle:forward | forw | backw | + | primary | | | | cycling | | + | primary | yes | | | cycling | | + | primary | no | | | | | + | primary | | yes | | cycling | | + | primary | | no | | | | + | primary | no | yes | | cycling | | + | primary | yes | no | | | | + | primary | | | yes | cycling | | + | primary | | | no | | | + | primary | no | | yes | cycling | | + | primary | yes | | no | | | + | primary | | no | yes | cycling | | + | primary | | yes | no | | | + | runway | | | | cycling | | + | runway | yes | | | cycling | | + | runway | no | | | | | + | runway | | yes | | cycling | | + | runway | | no | | | | + | runway | no | yes | | cycling | | + | runway | yes | no | | | | + | runway | | | yes | cycling | | + | runway | | | no | | | + | runway | no | | yes | cycling | | + | runway | yes | | no | | | + | runway | | no | yes | cycling | | + | runway | | yes | no | | | + + @todo + Scenario: Bike - Access tag in backward direction + Then routability should be + | highway | access:forward | vehicle:forward | bicycle:forward | forw | backw | + | primary | | | | | cycling | + | primary | yes | | | | cycling | + | primary | no | | | | | + | primary | | yes | | | cycling | + | primary | | no | | | | + | primary | no | yes | | | cycling | + | primary | yes | no | | | | + | primary | | | yes | | cycling | + | primary | | | no | | | + | primary | no | | yes | | cycling | + | primary | yes | | no | | | + | primary | | no | yes | | cycling | + | primary | | yes | no | | | + | runway | | | | | cycling | + | runway | yes | | | | cycling | + | runway | no | | | | | + | runway | | yes | | | cycling | + | runway | | no | | | | + | runway | no | yes | | | cycling | + | runway | yes | no | | | | + | runway | | | yes | | cycling | + | runway | | | no | | | + | runway | no | | yes | | cycling | + | runway | yes | | no | | | + | runway | | no | yes | | cycling | + | runway | | yes | no | | | + + Scenario: Bike - Overwriting implied acccess on ways + Then routability should be + | highway | access | vehicle | bicycle | bothw | + | cycleway | | | | cycling | + | runway | | | | | + | cycleway | no | | | | + | cycleway | | no | | | + | cycleway | | | no | | + | runway | yes | | | cycling | + | runway | | yes | | cycling | + | runway | | | yes | cycling | + + Scenario: Bike - Access tags on ways + Then routability should be + | access | vehicle | bicycle | bothw | + | | | | cycling | + | yes | | | cycling | + | permissive | | | cycling | + | designated | | | cycling | + | some_tag | | | cycling | + | no | | | | + | private | | | | + | agricultural | | | | + | forestry | | | | + | delivery | | | | + | | yes | | cycling | + | | permissive | | cycling | + | | designated | | cycling | + | | some_tag | | cycling | + | | no | | | + | | private | | | + | | agricultural | | | + | | forestry | | | + | | delivery | | | + | | | yes | cycling | + | | | permissive | cycling | + | | | designated | cycling | + | | | some_tag | cycling | + | | | no | | + | | | private | | + | | | agricultural | | + | | | forestry | | + | | | delivery | | + | | | use_sidepath | | + + Scenario: Bike - Access tags on both node and way + Then routability should be + | access | node/access | bothw | + | yes | yes | cycling | + | yes | no | | + | yes | some_tag | cycling | + | no | yes | | + | no | no | | + | no | some_tag | | + | some_tag | yes | cycling | + | some_tag | no | | + | some_tag | some_tag | cycling | + + Scenario: Bike - Access combinations + Then routability should be + | highway | access | vehicle | bicycle | forw | backw | + | runway | private | | yes | cycling | cycling | + | footway | | no | permissive | cycling | cycling | + | motorway | | | yes | cycling | | + | track | forestry | | permissive | cycling | cycling | + | cycleway | yes | designated | no | | | + | primary | | yes | private | | | + | residential | permissive | | no | | | + + Scenario: Bike - Ignore access tags for other modes + Then routability should be + | highway | boat | motor_vehicle | moped | bothw | + | river | yes | | | | + | cycleway | no | | | cycling | + | runway | | yes | | | + | cycleway | | no | | cycling | + | runway | | | yes | | + | cycleway | | | no | cycling | + + Scenario: Bike - Bridleways when access is explicit + Then routability should be + | highway | horse | foot | bicycle | bothw | + | bridleway | | | yes | cycling | + | bridleway | | yes | | pushing bike | + | bridleway | designated | | | | + | bridleway | | | | | + + Scenario: Bike - Tram with oneway when access is implicit + Then routability should be + | highway | railway | access | oneway | forw | backw | + | residential | tram | | yes | cycling | pushing bike | + | service | tram | psv | yes | cycling | pushing bike | + + Scenario: Bike - Access combinations + Then routability should be + | highway | access | bothw | + | primary | permissive | cycling | + | steps | permissive | cycling | + | footway | permissive | cycling | + | garbagetag | permissive | cycling | diff --git a/features/countrybicycle/access_node.feature b/features/countrybicycle/access_node.feature new file mode 100644 index 000000000..2ac256663 --- /dev/null +++ b/features/countrybicycle/access_node.feature @@ -0,0 +1,68 @@ +@routing @countrybicycle @access +Feature: Bike - Access tags on nodes +# Reference: http://wiki.openstreetmap.org/wiki/Key:access + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Access tag hierarchy on nodes + Then routability should be + | node/access | node/vehicle | node/bicycle | node/highway | bothw | + | | | | | cycling | + | yes | | | | cycling | + | no | | | | | + | | yes | | | cycling | + | | no | | | | + | no | yes | | | cycling | + | yes | no | | | | + | | | yes | | cycling | + | | | no | | | + | | | no | crossing | cycling | + | no | | yes | | cycling | + | yes | | no | | | + | | no | yes | | cycling | + | | yes | no | | | + + Scenario: Bike - Overwriting implied acccess on nodes doesn't overwrite way + Then routability should be + | highway | node/access | node/vehicle | node/bicycle | bothw | + | cycleway | | | | cycling | + | runway | | | | | + | cycleway | no | | | | + | cycleway | | no | | | + | cycleway | | | no | | + | runway | yes | | | | + | runway | | yes | | | + | runway | | | yes | | + + Scenario: Bike - Access tags on nodes + Then routability should be + | node/access | node/vehicle | node/bicycle | bothw | + | | | | cycling | + | yes | | | cycling | + | permissive | | | cycling | + | designated | | | cycling | + | some_tag | | | cycling | + | no | | | | + | private | | | | + | agricultural | | | | + | forestry | | | | + | delivery | | | | + | | yes | | cycling | + | | permissive | | cycling | + | | designated | | cycling | + | | some_tag | | cycling | + | | no | | | + | | private | | | + | | agricultural | | | + | | forestry | | | + | | delivery | | | + | | | yes | cycling | + | | | permissive | cycling | + | | | designated | cycling | + | | | some_tag | cycling | + | | | no | | + | | | private | | + | | | agricultural | | + | | | forestry | | + | | | delivery | | diff --git a/features/countrybicycle/alley.feature b/features/countrybicycle/alley.feature new file mode 100644 index 000000000..8c1d736ed --- /dev/null +++ b/features/countrybicycle/alley.feature @@ -0,0 +1,34 @@ +@routing @countrybicycle @alley +Feature: Bicycle - Route around alleys + + Background: + Given the profile file "countrybicycle" initialized with + """ + profile.properties.weight_name = 'cyclability' + """ + + Scenario: Bicycle - Avoid taking alleys + Given the query options + | annotations | nodes | + + Given the node map + """ + a-----b-----c + | : | + d.....e.....f + """ + + And the ways + | nodes | highway | service | + | abc | residential | | + | def | service | alley | + | ad | residential | | + | be | service | alley | + | cf | residential | | + + When I route I should get + | from | to | a:nodes | weight | # | + | a | f | 1:2:3:6 | 196.2 | Avoids d,e,f | + | a | e | 1:2:5 | 172.2 | Take the alley b,e if neccessary | + | d | f | 4:1:2:3:6 | 248.4 | Avoids the alley d,e,f | + diff --git a/features/countrybicycle/area.feature b/features/countrybicycle/area.feature new file mode 100644 index 000000000..56a62e819 --- /dev/null +++ b/features/countrybicycle/area.feature @@ -0,0 +1,112 @@ +@routing @countrybicycle @area +Feature: Bike - Squares and other areas + + Background: + Given the profile "countrybicycle" + + @square + Scenario: Bike - Route along edge of a squares + Given the node map + """ + x + a b + d c + """ + + And the ways + | nodes | area | highway | + | xa | | primary | + | abcda | yes | residential | + + When I route I should get + | from | to | route | + | a | b | abcda,abcda | + | a | d | abcda,abcda | + | b | c | abcda,abcda | + | c | b | abcda,abcda | + | c | d | abcda,abcda | + | d | c | abcda,abcda | + | d | a | abcda,abcda | + | a | d | abcda,abcda | + + @building + Scenario: Bike - Don't route on buildings + Given the node map + """ + x + a b + d c + """ + + And the ways + | nodes | highway | area | building | access | + | xa | primary | | | | + | abcda | (nil) | yes | yes | yes | + + When I route I should get + | from | to | route | + | a | b | xa,xa | + | a | d | xa,xa | + | b | c | xa,xa | + | c | b | xa,xa | + | c | d | xa,xa | + | d | c | xa,xa | + | d | a | xa,xa | + | a | d | xa,xa | + + @parking + Scenario: Bike - parking areas + Given the node map + """ + e f + x a b y + d c + """ + + And the ways + | nodes | highway | amenity | + | xa | primary | | + | by | primary | | + | xefy | primary | | + | abcda | (nil) | parking | + + When I route I should get + | from | to | route | + | x | y | xa,abcda,by | + | y | x | by,abcda,xa | + | a | b | abcda,abcda | + | a | d | abcda,abcda | + | b | c | abcda,abcda | + | c | b | abcda,abcda | + | c | d | abcda,abcda | + | d | c | abcda,abcda | + | d | a | abcda,abcda | + | a | d | abcda,abcda | + + + @train @platform + Scenario: Bike - railway platforms + Given the node map + """ + x a b y + d c + """ + + And the ways + | nodes | highway | railway | + | xa | primary | | + | by | primary | | + | abcda | (nil) | platform | + + When I route I should get + | from | to | route | + | x | y | xa,abcda,by | + | y | x | by,abcda,xa | + | a | b | abcda,abcda | + | a | d | abcda,abcda | + | b | c | abcda,abcda | + | c | b | abcda,abcda | + | c | d | abcda,abcda | + | d | c | abcda,abcda | + | d | a | abcda,abcda | + | a | d | abcda,abcda | diff --git a/features/countrybicycle/barrier.feature b/features/countrybicycle/barrier.feature new file mode 100644 index 000000000..49ecc7fa5 --- /dev/null +++ b/features/countrybicycle/barrier.feature @@ -0,0 +1,41 @@ +@routing @countrybicycle @barrier +Feature: Barriers + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Barriers + Then routability should be + | node/barrier | bothw | + | | x | + | bollard | x | + | gate | x | + | lift_gate | x | + | cycle_barrier | x | + | cattle_grid | x | + | border_control | x | + | toll_booth | x | + | sally_port | x | + | entrance | x | + | wall | | + | fence | | + | some_tag | x | + | block | x | + + Scenario: Bike - Access tag trumphs barriers + Then routability should be + | node/barrier | node/access | bothw | + | bollard | | x | + | bollard | yes | x | + | bollard | permissive | x | + | bollard | designated | x | + | bollard | no | | + | bollard | private | | + | bollard | agricultural | | + | wall | | | + | wall | yes | x | + | wall | permissive | x | + | wall | designated | x | + | wall | no | | + | wall | private | | + | wall | agricultural | | diff --git a/features/countrybicycle/bridge.feature b/features/countrybicycle/bridge.feature new file mode 100644 index 000000000..19cdaca58 --- /dev/null +++ b/features/countrybicycle/bridge.feature @@ -0,0 +1,44 @@ +@routing @countrybicycle @bridge +Feature: Bicycle - Handle cycling + + Background: + Given the profile "bicycle" + + Scenario: Bicycle - Use a movable bridge + Given the node map + """ + a b c + d + e f g + """ + + And the ways + | nodes | highway | bridge | bicycle | + | abc | primary | | | + | cde | | movable | yes | + | efg | primary | | | + + When I route I should get + | from | to | route | modes | + | a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | + + Scenario: Bicycle - Properly handle durations + Given the node map + """ + a b c + d + e f g + """ + + And the ways + | nodes | highway | bridge | duration | + | abc | primary | | | + | cde | | movable | 00:05:00 | + | efg | primary | | | + + When I route I should get + | from | to | route | modes | speed | + | a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 6 km/h | + | b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h | + | c | e | cde,cde | cycling,cycling | 2 km/h | + | e | c | cde,cde | cycling,cycling | 2 km/h | diff --git a/features/countrybicycle/classes.feature b/features/countrybicycle/classes.feature new file mode 100644 index 000000000..fe80d3563 --- /dev/null +++ b/features/countrybicycle/classes.feature @@ -0,0 +1,92 @@ +@routing @countrybicycle @mode +Feature: Bicycle - Mode flag + Background: + Given the profile "bicycle" + + Scenario: Bicycle - We tag ferries with a class + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | highway | route | + | ab | primary | | + | bc | | ferry | + | cd | primary | | + + When I route I should get + | from | to | route | turns | classes | + | a | d | ab,bc,cd,cd | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] | + | d | a | cd,bc,ab,ab | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] | + | c | a | bc,ab,ab | depart,notification left,arrive | [(ferry)],[()],[()] | + | d | b | cd,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] | + | a | c | ab,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] | + | b | d | bc,cd,cd | depart,notification left,arrive | [(ferry)],[()],[()] | + + Scenario: Bicycle - We tag tunnel with a class + Background: + Given a grid size of 200 meters + + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | tunnel | + | ab | no | + | bc | yes | + | cd | | + + When I route I should get + | from | to | route | turns | classes | + | a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] | + + Scenario: Bicycle - We tag classes without intersections + Background: + Given a grid size of 200 meters + + Given the node map + """ + a b c d + """ + + And the ways + | nodes | name | tunnel | + | ab | road | | + | bc | road | yes | + | cd | road | | + + When I route I should get + | from | to | route | turns | classes | + | a | d | road,road | depart,arrive | [(),(tunnel),()],[()] | + + Scenario: Bicycle - From roundabout on ferry + Given the node map + """ + c + / \ + a---b d---f--h + \ / + e + | + g + """ + + And the ways + | nodes | oneway | highway | junction | route | + | ab | yes | service | | | + | cb | yes | service | roundabout | | + | dc | yes | service | roundabout | | + | be | yes | service | roundabout | | + | ed | yes | service | roundabout | | + | eg | yes | service | | | + | df | | | | ferry | + | fh | yes | service | | | + + When I route I should get + | from | to | route | turns | classes | + | a | h | ab,df,df,fh,fh | depart,roundabout-exit-2,exit roundabout slight right,notification straight,arrive | [()],[(),()],[(ferry)],[()],[()] | diff --git a/features/countrybicycle/countrybikespeeds.feature b/features/countrybicycle/countrybikespeeds.feature new file mode 100644 index 000000000..71efc2e44 --- /dev/null +++ b/features/countrybicycle/countrybikespeeds.feature @@ -0,0 +1,89 @@ +@routing @countryfoot @countrybikespeeds +Feature: Testbot - Country Profile Selection + + # Check that country data is being selected + # CHE (a) does not support trunk on bike + # FIN (c) does not support trunk on bike + # GRC (m) and IRL (o) support bridleway + # LIU (s) is not a country in list so looks like worldwide + # so + # GRC (m) and LIU (s) support trunk + + Scenario: Country Profile Selection - highway chosen for country + + Given the extract extra arguments "--location-dependent-data data/countrytest.geojson" + And the partition extra arguments "--threads 1" + And the customize extra arguments "--threads 1" + + And the profile file "countrybicycle" initialized with + """ + profile.uselocationtags.countryspeeds = true + """ + + And the node locations + | node | lat | lon | + | a | 9.5 | 5.0 | + | b | 9.5 | 10.0 | + | c | 9.5 | 15.0 | + | d | 9.0 | 5.0 | + | e | 9.0 | 10.0 | + | f | 9.0 | 15.0 | + | g | 8.5 | 5.0 | + | h | 8.5 | 10.0 | + | i | 8.5 | 15.0 | + | j | 8.0 | 5.0 | + | k | 8.0 | 10.0 | + | l | 8.0 | 15.0 | + | m | 7.5 | 5.0 | + | n | 7.5 | 10.0 | + | o | 7.5 | 15.0 | + | p | 7.0 | 5.0 | + | q | 7.0 | 10.0 | + | r | 7.0 | 15.0 | + | s | 6.5 | 5.0 | + | t | 6.5 | 10.0 | + | u | 6.5 | 15.0 | + + And the ways + | nodes | highway | comment + | ab | trunk | CHE - FIN no + | bc | trunk | + | cf | trunk | FIN - BEL no + | fi | trunk | + | fl | trunk | + | or | trunk | IRL - world yes + | ru | trunk | + | mn | bridleway | GRC - IRL yes + | no | bridleway | + | mp | trunk | GRC - liu yes + | ps | trunk | + + And the partition extra arguments "--threads 1" + And the customize extra arguments "--threads 1" + + + When I route I should get + | waypoints | route | status | message | + | a,b,c | | 400 | Impossible route between points | + | c,l | | 400 | Impossible route between points | + | g,i | | 400 | Impossible route between points | + | o,u | or,ru,ru | 200 | | + | m,o | mn,no,no | 200 | | + | m,s | mp,ps,ps | 200 | | + + + + + + + + + + + + + + + + + diff --git a/features/countrybicycle/countryoneway.feature b/features/countrybicycle/countryoneway.feature new file mode 100644 index 000000000..7abc7183c --- /dev/null +++ b/features/countrybicycle/countryoneway.feature @@ -0,0 +1,156 @@ +@routing @countrybicycle @countryoneway +Feature: Bike - Oneway streets +# Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing +# Usually we can push bikes against oneways, but we use foot=no to prevent this in these tests + + Background: + Given the profile file "countrybicycle" initialized with + """ + profile.uselocationtags.countryspeeds = true + """ + + Scenario: Bike - Simple oneway + Then routability should be + | highway | foot | oneway | forw | backw | + | primary | no | yes | cycling | | + | primary | | yes | cycling | pushing bike | + + Scenario: Simple reverse oneway + Then routability should be + | highway | foot | oneway | forw | backw | + | primary | no | -1 | | cycling | + | primary | | -1 | pushing bike | cycling | + + Scenario: Bike - Around the Block + Given the node map + """ + a b + f d c e + """ + + And the ways + | nodes | oneway | foot | + | ab | yes | no | + | bc | | no | + | cd | | no | + | da | | no | + | df | | no | + | ce | | no | + + When I route I should get + | from | to | route | + | a | b | ab,ab | + | b | a | bc,cd,da,da | + + Scenario: Bike - Handle various oneway tag values + Then routability should be + | foot | oneway | forw | backw | + | no | | cycling | cycling | + | no | nonsense | cycling | cycling | + | no | no | cycling | cycling | + | no | false | cycling | cycling | + | no | 0 | cycling | cycling | + | no | yes | cycling | | + | no | true | cycling | | + | no | 1 | cycling | | + | no | -1 | | cycling | + + Scenario: Bike - Implied oneways no motorway + Then routability should be + | highway | foot | bicycle | junction | forw | backw | # | + | | no | | | cycling | cycling | | + | | no | | roundabout | cycling | | | + | motorway | no | no | | | | | + | motorway_link | no | no | | | | | + | motorway | no | no | roundabout | | | | + | motorway_link | no | no | roundabout | | | | + + Scenario: Bike - Overriding implied oneways + Then routability should be + | highway | foot | junction | oneway | forw | backw | + | primary | no | roundabout | no | cycling | cycling | + | primary | no | roundabout | yes | cycling | | + | motorway_link | no | | -1 | | | + | trunk | no | | -1 | | cycling | + | trunk_link | no | | -1 | | cycling | + | primary | no | roundabout | -1 | | cycling | + + Scenario: Bike - Oneway:bicycle should override normal oneways tags + Then routability should be + | foot | oneway:bicycle | oneway | junction | forw | backw | + | no | yes | | | cycling | | + | no | yes | yes | | cycling | | + | no | yes | no | | cycling | | + | no | yes | -1 | | cycling | | + | no | yes | | roundabout | cycling | | + | no | no | | | cycling | cycling | + | no | no | yes | | cycling | cycling | + | no | no | no | | cycling | cycling | + | no | no | -1 | | cycling | cycling | + | no | no | | roundabout | cycling | cycling | + | no | -1 | | | | cycling | + | no | -1 | yes | | | cycling | + | no | -1 | no | | | cycling | + | no | -1 | -1 | | | cycling | + | no | -1 | | roundabout | | cycling | + + Scenario: Bike - Contra flow + Then routability should be + | foot | oneway | cycleway | forw | backw | + | no | yes | opposite | cycling | cycling | + | no | yes | opposite_track | cycling | cycling | + | no | yes | opposite_lane | cycling | cycling | + | no | -1 | opposite | cycling | cycling | + | no | -1 | opposite_track | cycling | cycling | + | no | -1 | opposite_lane | cycling | cycling | + | no | no | opposite | cycling | cycling | + | no | no | opposite_track | cycling | cycling | + | no | no | opposite_lane | cycling | cycling | + + Scenario: Bike - Should not be affected by car tags + Then routability should be + | foot | junction | oneway | oneway:car | forw | backw | + | no | | yes | yes | cycling | | + | no | | yes | no | cycling | | + | no | | yes | -1 | cycling | | + | no | | no | yes | cycling | cycling | + | no | | no | no | cycling | cycling | + | no | | no | -1 | cycling | cycling | + | no | | -1 | yes | | cycling | + | no | | -1 | no | | cycling | + | no | | -1 | -1 | | cycling | + | no | roundabout | | yes | cycling | | + | no | roundabout | | no | cycling | | + | no | roundabout | | -1 | cycling | | + + Scenario: Bike - Two consecutive oneways + Given the node map + """ + a b c + """ + + And the ways + | nodes | oneway | + | ab | yes | + | bc | yes | + + + When I route I should get + | from | to | route | + | a | c | ab,bc,bc | + + + Scenario: Bike - Left/right cycleways on oneways + Then routability should be + | highway | oneway | cycleway:left | cycleway:right | forw | backw | + | primary | yes | | | cycling | pushing bike | + | primary | yes | | track | cycling | pushing bike | + | primary | yes | track | | cycling | pushing bike | + | primary | yes | track | track | cycling | pushing bike | + + Scenario: Bike - Left/right cycleways on any oneways + Then routability should be + | foot | oneway | cycleway:left | cycleway:right | forw | backw | + | no | yes | track | | cycling | | + | yes | yes | track | | cycling | pushing bike | + | yes | -1 | track | | pushing bike | cycling | diff --git a/features/countrybicycle/cycleway.feature b/features/countrybicycle/cycleway.feature new file mode 100644 index 000000000..cbe84b7ec --- /dev/null +++ b/features/countrybicycle/cycleway.feature @@ -0,0 +1,99 @@ +@routing @countrybicycle @cycleway +Feature: Bike - Cycle tracks/lanes +# Reference: http://wiki.openstreetmap.org/wiki/Key:cycleway + + Background: + Given the profile "bicycle" + + Scenario: Bike - Cycle tracks/lanes should enable biking + Then routability should be + | highway | cycleway | forw | backw | + | motorway | | | | + | motorway | track | x | | + | motorway | lane | x | | + | motorway | shared | x | | + | motorway | share_busway | x | | + | motorway | sharrow | x | | + | some_tag | track | x | x | + | some_tag | lane | x | x | + | some_tag | shared | x | x | + | some_tag | share_busway | x | x | + | some_tag | sharrow | x | x | + | residential | track | x | x | + | residential | lane | x | x | + | residential | shared | x | x | + | residential | share_busway | x | x | + | residential | sharrow | x | x | + + Scenario: Bike - Left/right side cycleways on implied bidirectionals + Then routability should be + | highway | cycleway | cycleway:left | cycleway:right | forw | backw | + | primary | | | | x | x | + | primary | track | | | x | x | + | primary | opposite | | | x | x | + | primary | | track | | x | x | + | primary | | opposite | | x | x | + | primary | | | track | x | x | + | primary | | | opposite | x | x | + | primary | | track | track | x | x | + | primary | | opposite | opposite | x | x | + | primary | | track | opposite | x | x | + | primary | | opposite | track | x | x | + + Scenario: Bike - Left/right side cycleways on implied oneways + Then routability should be + | highway | cycleway | cycleway:left | cycleway:right | forw | backw | + | primary | | | | x | x | + | motorway | | | | | | + | motorway | track | | | x | | + | motorway | opposite | | | x | x | + | motorway | | track | | x | | + | motorway | | opposite | | x | x | + | motorway | | | track | x | | + | motorway | | | opposite | x | x | + # motorways are implicit oneways and cycleway tracks next to oneways always + # follow the oneway direction (unless tagged as opposite) + | motorway | | track | track | x | | + | motorway | | opposite | opposite | x | x | + | motorway | | track | opposite | x | x | + | motorway | | opposite | track | x | x | + + Scenario: Bike - Invalid cycleway tags + Then routability should be + | highway | cycleway | bothw | + | primary | | x | + | primary | yes | x | + | primary | no | x | + | primary | some_track | x | + | motorway | | | + | motorway | yes | | + | motorway | no | | + | motorway | some_track | | + + Scenario: Bike - Access tags should overwrite cycleway access + Then routability should be + | highway | cycleway | access | forw | backw | + | motorway | track | no | | | + | residential | track | no | | | + | footway | track | no | | | + | cycleway | track | no | | | + | motorway | lane | yes | x | | + | residential | lane | yes | x | x | + | footway | lane | yes | x | x | + | cycleway | lane | yes | x | x | + + Scenario: Bike - Cycleway on oneways, modes + Then routability should be + | highway | cycleway | oneway | forw | backw | + | motorway | track | yes | cycling | | + | residential | track | yes | cycling | pushing bike | + | cycleway | track | yes | cycling | pushing bike | + | footway | track | yes | cycling | pushing bike | + + Scenario: Bike - Cycleway on oneways, speeds + Then routability should be + | highway | cycleway | oneway | forw | backw | + | motorway | track | yes | 15 km/h | | + | residential | track | yes | 15 km/h | 4 km/h +-1 | + | cycleway | track | yes | 15 km/h | 4 km/h +-1 | + | footway | track | yes | 15 km/h | 4 km/h +-1 | diff --git a/features/countrybicycle/destination.feature b/features/countrybicycle/destination.feature new file mode 100644 index 000000000..df9f9a160 --- /dev/null +++ b/features/countrybicycle/destination.feature @@ -0,0 +1,83 @@ +@routing @countrybicycle @destination @todo +Feature: Bike - Destination only, no passing through + + Background: + Given the profile "bicycle" + + Scenario: Bike - Destination only street + Given the node map + """ + a e + b c d + + x y + """ + + And the ways + | nodes | access | + | ab | | + | bcd | destination | + | de | | + | axye | | + + When I route I should get + | from | to | route | + | a | b | ab,ab | + | a | c | ab,bcd | + | a | d | ab,bcd | + | a | e | axye,axye | + | e | d | de,de | + | e | c | de,bcd | + | e | b | de,bcd | + | e | a | axye,axye | + + Scenario: Bike - Destination only street + Given the node map + """ + a e + b c d + + x y + """ + + And the ways + | nodes | access | + | ab | | + | bc | destination | + | cd | destination | + | de | | + | axye | | + + When I route I should get + | from | to | route | + | a | b | ab,ab | + | a | c | ab,bc | + | a | d | ab,bc,cd | + | a | e | axye,axye | + | e | d | de,de | + | e | c | de,cd,cd | + | e | b | de,cd,bc | + | e | a | axye,axye | + + Scenario: Bike - Routing inside a destination only area + Given the node map + """ + a c e + b d + x y + """ + + And the ways + | nodes | access | + | ab | destination | + | bc | destination | + | cd | destination | + | de | destination | + | axye | | + + 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 | diff --git a/features/countrybicycle/distance.feature b/features/countrybicycle/distance.feature new file mode 100644 index 000000000..ab35c03b8 --- /dev/null +++ b/features/countrybicycle/distance.feature @@ -0,0 +1,35 @@ +@routing @countrybicycle +Feature: Bike - Use distance weight + + Background: + Given a grid size of 200 meters + + Scenario: Bike - Check distance weight + Given the profile file + """ + local functions = require('bicycle') + functions.setup_testbot = functions.setup + + functions.setup = function() + local profile = functions.setup_testbot() + profile.properties.weight_name = 'distance' + return profile + end + + return functions + """ + + Given the node map + """ + a-b-c + """ + + + And the ways + | nodes | highway | + | abc | residential | + + When I route I should get + | from | to | route | weight | time | distance | + | a | b | abc,abc | 200 | 48s | 200m +-1 | + | a | c | abc,abc | 400 | 96s | 400m +-1 | diff --git a/features/countrybicycle/exclude.feature b/features/countrybicycle/exclude.feature new file mode 100644 index 000000000..c2da8bff4 --- /dev/null +++ b/features/countrybicycle/exclude.feature @@ -0,0 +1,55 @@ +@routing @countrybicycle @exclude +Feature: Bicycle - Exclude flags + Background: + Given the profile file "countrybicycle" initialized with + """ + profile.excludable = Sequence { Set { 'ferry' } } + """ + Given the node map + """ + a....b~~~~~c...f + : : + d.....e + """ + + And the ways + | nodes | highway | route | duration | # | + | ab | service | | | always drivable | + | bc | | ferry | 00:00:01 | not drivable for exclude=ferry, but fast. | + | bd | service | | | always drivable | + | de | service | | | always drivable | + | ec | service | | | always drivable | + | cf | service | | | always drivable | + + Scenario: Bicycle - exclude nothing + When I route I should get + | from | to | route | + | a | f | ab,bc,cf,cf | + + When I match I should get + | trace | matchings | duration | + | abcf | abcf | 109 | + + When I request a travel time matrix I should get + | | a | f | + | a | 0 | 109 | + | f | 109 | 0 | + + Scenario: Bicycle - exclude ferry + Given the query options + | exclude | ferry | + + When I route I should get + | from | to | route | + | a | f | ab,bd,de,ec,cf,cf | + + When I match I should get + | trace | matchings | duration | + | abcf | abcf | 301 | + + When I request a travel time matrix I should get + | | a | f | + | a | 0 | 301 +- 1 | + | f | 301.2 +- 1 | 0 | + + diff --git a/features/countrybicycle/ferry.feature b/features/countrybicycle/ferry.feature new file mode 100644 index 000000000..577e960a7 --- /dev/null +++ b/features/countrybicycle/ferry.feature @@ -0,0 +1,63 @@ +@routing @countrybicycle @ferry +Feature: Bike - Handle ferry routes + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - 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,efg | + | c | e | cde,cde | + | c | g | cde,efg,efg | + + Scenario: Bike - Ferry duration, single node + Given the node map + """ + a b c d + e f + g h + i j + """ + + And the ways + | nodes | highway | route | bicycle | duration | + | ab | primary | | | | + | cd | primary | | | | + | ef | primary | | | | + | gh | primary | | | | + | ij | primary | | | | + | bc | | ferry | yes | 0:01 | + | be | | ferry | yes | 0:10 | + | bg | | ferry | yes | 1:00 | + | bi | | ferry | yes | 10:00 | + + Scenario: Bike - Ferry duration, multiple nodes + Given the node map + """ + x a b c d y + """ + + And the ways + | nodes | highway | route | bicycle | duration | + | xa | primary | | | | + | yd | primary | | | | + | abcd | | ferry | yes | 1:00 | + + When I route I should get + | from | to | route | time | + | a | d | abcd,abcd | 3600s | + | d | a | abcd,abcd | 3600s | diff --git a/features/countrybicycle/maxspeed.feature b/features/countrybicycle/maxspeed.feature new file mode 100644 index 000000000..f56c65960 --- /dev/null +++ b/features/countrybicycle/maxspeed.feature @@ -0,0 +1,90 @@ +@routing @maxspeed @countrybicycle +Feature: Bike - Max speed restrictions + + Background: Use specific speeds + Given the profile "countrybicycle" + And a grid size of 1000 meters + + Scenario: Bicycle - Respect maxspeeds when lower that way type speed + Then routability should be + | highway | maxspeed | bothw | + | residential | | 15 km/h | + | residential | 10 | 10 km/h | + + Scenario: Bicycle - Ignore maxspeed when higher than way speed + Then routability should be + | highway | maxspeed | bothw | + | residential | | 15 km/h | + | residential | 80 | 15 km/h | + + @todo + Scenario: Bicycle - Maxspeed formats + Then routability should be + | highway | maxspeed | bothw | + | residential | | 49s ~10% | + | residential | 5 | 144s ~10% | + | residential | 5mph | 90s ~10% | + | residential | 5 mph | 90s ~10% | + | residential | 5MPH | 90s ~10% | + | residential | 5 MPH | 90s ~10% | + | trunk | 5unknown | 49s ~10% | + | trunk | 5 unknown | 49s ~10% | + + @todo + Scenario: Bicycle - Maxspeed special tags + Then routability should be + | highway | maxspeed | bothw | + | residential | | 49s ~10% | + | residential | none | 49s ~10% | + | residential | signals | 49s ~10% | + + Scenario: Bike - Do not 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 | 80 | + + When I route I should get + | from | to | route | speed | + | a | b | ab,ab | 15 km/h | + | b | c | bc,bc | 15 km/h | + + Scenario: Bike - Forward/backward maxspeed + Given the shortcuts + | key | value | + | bike | 49s ~10% | + | run | 73s ~10% | + | walk | 145s ~10% | + | snail | 720s ~10% | + + Then routability should be + | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw | + | | | | 15 km/h | 15 km/h | + | 10 | | | 10 km/h | 10 km/h | + | | 10 | | 10 km/h | 15 km/h | + | | | 10 | 15 km/h | 10 km/h | + | 2 | 10 | | 10 km/h | 2 km/h | + | 2 | | 10 | 2 km/h | 10 km/h | + | 2 | 5 | 10 | 5 km/h | 10 km/h | + + Scenario: Bike - Maxspeed should not allow routing on unroutable ways + Then routability should be + | highway | railway | access | maxspeed | maxspeed:forward | maxspeed:backward | bothw | + | primary | | | | | | x | + | secondary | | no | | | | | + | secondary | | no | 100 | | | | + | secondary | | no | | 100 | | | + | secondary | | no | | | 100 | | + | (nil) | train | | | | | | + | (nil) | train | | 100 | | | | + | (nil) | train | | | 100 | | | + | (nil) | train | | | | 100 | | + | runway | | | | | | | + | runway | | | 100 | | | | + | runway | | | | 100 | | | + | runway | | | | | 100 | | diff --git a/features/countrybicycle/mode.feature b/features/countrybicycle/mode.feature new file mode 100644 index 000000000..9a47ea10a --- /dev/null +++ b/features/countrybicycle/mode.feature @@ -0,0 +1,97 @@ +@routing @countrybicycle @mode +Feature: Bike - Mode flag + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Mode when using a ferry + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | highway | route | duration | + | ab | primary | | | + | bc | | ferry | 0:01 | + | cd | primary | | | + + When I route I should get + | from | to | route | modes | + | a | d | ab,bc,cd,cd | cycling,ferry,cycling,cycling | + | c | a | bc,ab,ab | ferry,cycling,cycling | + | d | b | cd,bc,bc | cycling,ferry,ferry | + + Scenario: Bike - Mode when using a train + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | highway | railway | bicycle | + | ab | primary | | | + | bc | | train | yes | + | cd | primary | | | + + When I route I should get + | from | to | route | modes | + | a | d | ab,bc,cd,cd | cycling,train,cycling,cycling | + | c | a | bc,ab,ab | train,cycling,cycling | + | d | b | cd,bc,bc | cycling,train,train | + + #representative test for all pushes (and mode changes). Where a bike is pushed is tested over in access.feature + Scenario: Bike - Mode when pushing bike against oneways + Given the node map + """ + a b e + f c d + """ + + And the ways + | nodes | highway | oneway | + | ab | primary | | + | bc | primary | yes | + | cd | primary | | + | be | primary | | + | cf | primary | | + + + When I route I should get + | from | to | route | modes | + | a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling | + | d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling | + | c | a | bc,ab,ab | pushing bike,cycling,cycling | + | d | b | cd,bc,bc | cycling,pushing bike,pushing bike | + + Scenario: Bicycle - Modes when starting on forward oneway + Given the node map + """ + a b + """ + + And the ways + | nodes | oneway | + | ab | yes | + + When I route I should get + | from | to | route | modes | + | a | b | ab,ab | cycling,cycling | + | b | a | ab,ab | pushing bike,pushing bike | + + Scenario: Bicycle - Modes when starting on reverse oneway + Given the node map + """ + a b + """ + + And the ways + | nodes | oneway | + | ab | -1 | + + When I route I should get + | from | to | route | modes | + | a | b | ab,ab | pushing bike,pushing bike | + | b | a | ab,ab | cycling,cycling | diff --git a/features/countrybicycle/names.feature b/features/countrybicycle/names.feature new file mode 100644 index 000000000..0dd571c74 --- /dev/null +++ b/features/countrybicycle/names.feature @@ -0,0 +1,37 @@ +@routing @countrybicycle @names +Feature: Bike - Street names in instructions + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - A named street + Given the node map + """ + a b + c + """ + + And the ways + | nodes | name | ref | + | ab | My Way | A6 | + | bc | Your Way | A7 | + + When I route I should get + | from | to | route | ref | + | a | c | My Way,Your Way | A6,A7 | + + @unnamed + Scenario: Bike - No longer use way type to describe unnamed ways, see #3231 + Given the node map + """ + a b c d + """ + + And the ways + | nodes | highway | name | + | ab | cycleway | | + | bcd | track | | + + When I route I should get + | from | to | route | + | a | d | , | diff --git a/features/countrybicycle/oneway.feature b/features/countrybicycle/oneway.feature new file mode 100644 index 000000000..32e0dfb41 --- /dev/null +++ b/features/countrybicycle/oneway.feature @@ -0,0 +1,152 @@ +@routing @countrybicycle @oneway +Feature: Bike - Oneway streets +# Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing +# Usually we can push bikes against oneways, but we use foot=no to prevent this in these tests + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Simple oneway + Then routability should be + | highway | foot | oneway | forw | backw | + | primary | no | yes | cycling | | + | primary | | yes | cycling | pushing bike | + + Scenario: Simple reverse oneway + Then routability should be + | highway | foot | oneway | forw | backw | + | primary | no | -1 | | cycling | + | primary | | -1 | pushing bike | cycling | + + Scenario: Bike - Around the Block + Given the node map + """ + a b + f d c e + """ + + And the ways + | nodes | oneway | foot | + | ab | yes | no | + | bc | | no | + | cd | | no | + | da | | no | + | df | | no | + | ce | | no | + + When I route I should get + | from | to | route | + | a | b | ab,ab | + | b | a | bc,cd,da,da | + + Scenario: Bike - Handle various oneway tag values + Then routability should be + | foot | oneway | forw | backw | + | no | | cycling | cycling | + | no | nonsense | cycling | cycling | + | no | no | cycling | cycling | + | no | false | cycling | cycling | + | no | 0 | cycling | cycling | + | no | yes | cycling | | + | no | true | cycling | | + | no | 1 | cycling | | + | no | -1 | | cycling | + + Scenario: Bike - Implied oneways + Then routability should be + | highway | foot | bicycle | junction | forw | backw | # | + | | no | | | cycling | cycling | | + | | no | | roundabout | cycling | | | + | motorway | no | yes | | cycling | | | + | motorway_link | no | yes | | cycling | cycling | does not imply oneway | + | motorway | no | yes | roundabout | cycling | | | + | motorway_link | no | yes | roundabout | cycling | | | + + Scenario: Bike - Overriding implied oneways + Then routability should be + | highway | foot | junction | oneway | forw | backw | + | primary | no | roundabout | no | cycling | cycling | + | primary | no | roundabout | yes | cycling | | + | motorway_link | no | | -1 | | | + | trunk_link | no | | -1 | | | + | primary | no | roundabout | -1 | | cycling | + + Scenario: Bike - Oneway:bicycle should override normal oneways tags + Then routability should be + | foot | oneway:bicycle | oneway | junction | forw | backw | + | no | yes | | | cycling | | + | no | yes | yes | | cycling | | + | no | yes | no | | cycling | | + | no | yes | -1 | | cycling | | + | no | yes | | roundabout | cycling | | + | no | no | | | cycling | cycling | + | no | no | yes | | cycling | cycling | + | no | no | no | | cycling | cycling | + | no | no | -1 | | cycling | cycling | + | no | no | | roundabout | cycling | cycling | + | no | -1 | | | | cycling | + | no | -1 | yes | | | cycling | + | no | -1 | no | | | cycling | + | no | -1 | -1 | | | cycling | + | no | -1 | | roundabout | | cycling | + + Scenario: Bike - Contra flow + Then routability should be + | foot | oneway | cycleway | forw | backw | + | no | yes | opposite | cycling | cycling | + | no | yes | opposite_track | cycling | cycling | + | no | yes | opposite_lane | cycling | cycling | + | no | -1 | opposite | cycling | cycling | + | no | -1 | opposite_track | cycling | cycling | + | no | -1 | opposite_lane | cycling | cycling | + | no | no | opposite | cycling | cycling | + | no | no | opposite_track | cycling | cycling | + | no | no | opposite_lane | cycling | cycling | + + Scenario: Bike - Should not be affected by car tags + Then routability should be + | foot | junction | oneway | oneway:car | forw | backw | + | no | | yes | yes | cycling | | + | no | | yes | no | cycling | | + | no | | yes | -1 | cycling | | + | no | | no | yes | cycling | cycling | + | no | | no | no | cycling | cycling | + | no | | no | -1 | cycling | cycling | + | no | | -1 | yes | | cycling | + | no | | -1 | no | | cycling | + | no | | -1 | -1 | | cycling | + | no | roundabout | | yes | cycling | | + | no | roundabout | | no | cycling | | + | no | roundabout | | -1 | cycling | | + + Scenario: Bike - Two consecutive oneways + Given the node map + """ + a b c + """ + + And the ways + | nodes | oneway | + | ab | yes | + | bc | yes | + + + When I route I should get + | from | to | route | + | a | c | ab,bc,bc | + + + Scenario: Bike - Left/right cycleways on oneways + Then routability should be + | highway | oneway | cycleway:left | cycleway:right | forw | backw | + | primary | yes | | | cycling | pushing bike | + | primary | yes | | track | cycling | pushing bike | + | primary | yes | track | | cycling | pushing bike | + | primary | yes | track | track | cycling | pushing bike | + + Scenario: Bike - Left/right cycleways on any oneways + Then routability should be + | foot | oneway | cycleway:left | cycleway:right | forw | backw | + | no | yes | track | | cycling | | + | yes | yes | track | | cycling | pushing bike | + | yes | -1 | track | | pushing bike | cycling | diff --git a/features/countrybicycle/pushing.feature b/features/countrybicycle/pushing.feature new file mode 100644 index 000000000..70009013b --- /dev/null +++ b/features/countrybicycle/pushing.feature @@ -0,0 +1,127 @@ +@routing @countrybicycle @pushing +Feature: Bike - Accessability of different way types + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Pushing bikes on pedestrian-only ways + Then routability should be + | highway | oneway | forw | backw | + | (nil) | | | | + | cycleway | | cycling | cycling | + | primary | | cycling | cycling | + | pedestrian | | pushing bike | pushing bike | + | cycleway | | cycling | cycling | + | primary | yes | cycling | pushing bike | + + Scenario: Bike - Pushing bikes against normal oneways + Then routability should be + | highway | oneway | forw | backw | + | (nil) | | | | + | primary | yes | cycling | pushing bike | + | pedestrian | yes | pushing bike | pushing bike | + + Scenario: Bike - Pushing bikes against reverse oneways + Then routability should be + | highway | oneway | forw | backw | + | (nil) | | | | + | primary | -1 | pushing bike | cycling | + | pedestrian | -1 | pushing bike | pushing bike | + + @square + Scenario: Bike - Push bikes on pedestrian areas + Given the node map + """ + x + a b + d c + """ + + And the ways + | nodes | area | highway | + | xa | | primary | + | abcda | yes | pedestrian | + + When I route I should get + | from | to | route | + | a | b | abcda,abcda | + | a | d | abcda,abcda | + | b | c | abcda,abcda | + | c | b | abcda,abcda | + | c | d | abcda,abcda | + | d | c | abcda,abcda | + | d | a | abcda,abcda | + | a | d | abcda,abcda | + + Scenario: Bike - Pushing bikes on ways with foot=yes + Then routability should be + | highway | foot | forw | backw | + | motorway | | | | + | motorway | yes | pushing bike | | + | runway | | | | + | runway | yes | pushing bike | pushing bike | + + @todo + Scenario: Bike - Pushing bikes on ways with foot=yes in one direction + Then routability should be + | highway | foot:forward | foot:backward | forw | backw | + | motorway | | | | | + | motorway | yes | | pushing bike | | + | motorway | | yes | | pushing bike | + + @construction + Scenario: Bike - Don't allow routing on ways still under construction + Then routability should be + | highway | foot | bicycle | bothw | + | primary | | | x | + | construction | | | | + | construction | yes | | | + | construction | | yes | | + + @roundabout + Scenario: Bike - Don't push bikes against oneway flow on roundabouts + Then routability should be + | junction | forw | backw | + | roundabout | x | | + + Scenario: Bike - Instructions when pushing bike on oneways + Given the node map + """ + a b e + f c d + """ + + And the ways + | nodes | highway | oneway | + | ab | primary | | + | bc | primary | yes | + | cd | primary | | + | be | primary | | + | cf | primary | | + + When I route I should get + | from | to | route | modes | + | a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling | + | d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling | + | c | a | bc,ab,ab | pushing bike,cycling,cycling | + | d | b | cd,bc,bc | cycling,pushing bike,pushing bike | + + Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc. + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | highway | + | ab | primary | + | bc | footway | + | cd | primary | + + When I route I should get + | from | to | route | modes | + | a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling | + | d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling | + | c | a | bc,ab,ab | pushing bike,cycling,cycling | + | d | b | cd,bc,bc | cycling,pushing bike,pushing bike | diff --git a/features/countrybicycle/restrictions.feature b/features/countrybicycle/restrictions.feature new file mode 100644 index 000000000..c2bb35c00 --- /dev/null +++ b/features/countrybicycle/restrictions.feature @@ -0,0 +1,133 @@ +@routing @countrybicycle @restrictions +Feature: Bike - Turn restrictions +# Ignore turn restrictions on bicycle, since you always become a temporary pedestrian. +# Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes. + + Background: + Given the profile "countrybicycle" + Given a grid size of 200 meters + + # check to see if bicycle profiles handle relations. The code path is the same as in cars. + # If relations are passed, all variants tested in car also work for bike + @no_turning + Scenario: Bike - No left turn + Given the node map + """ + n + w j e + s + """ + + And the ways + | nodes | oneway | foot | + | sj | yes | no | + | nj | -1 | no | + | wj | -1 | no | + | ej | -1 | no | + + And the relations + | type | way:from | way:to | node:via | restriction | + | restriction | sj | wj | j | no_left_turn | + + When I route I should get + | from | to | route | + | s | w | sj,wj,wj | + | s | n | sj,nj,nj | + | s | e | sj,ej,ej | + + ## exceptions are different for bike over car and need to be tested here + @except + Scenario: Bike - Except tag and on no_ restrictions + Given the node map + """ + b x c + a j d + s + """ + + And the ways + | nodes | oneway | foot | + | sj | no | no | + | xj | -1 | no | + | aj | -1 | no | + | bj | no | no | + | cj | -1 | no | + | dj | -1 | no | + + And the relations + | type | way:from | way:to | node:via | restriction | except | + | restriction | sj | aj | j | no_left_turn | bicycle | + | restriction | sj | bj | j | no_left_turn | | + | restriction | sj | cj | j | no_right_turn | | + | restriction | sj | dj | j | no_right_turn | bicycle | + + When I route I should get + | from | to | route | + | s | a | sj,aj,aj | + | s | b | sj,bj,bj | + | s | c | sj,cj,cj | + | s | d | sj,dj,dj | + + @except + Scenario: Bike - Except tag and on only_ restrictions + Given the node map + """ + a b + j + s + """ + + And the ways + | nodes | oneway | foot | + | sj | yes | no | + | aj | no | no | + | bj | no | no | + + And the relations + | type | way:from | way:to | node:via | restriction | except | + | restriction | sj | aj | j | only_straight_on | bicycle | + + When I route I should get + | from | to | route | + | s | a | sj,aj,aj | + | s | b | sj,bj,bj | + + @except + Scenario: Bike - Multiple except tag values + Given the node map + """ + s j a + b + c + d + e + f + """ + + And the ways + | nodes | oneway | foot | + | sj | yes | no | + | ja | yes | no | + | jb | yes | no | + | jc | yes | no | + | jd | yes | no | + | je | yes | no | + | jf | yes | no | + + And the relations + | type | way:from | way:to | node:via | restriction | except | + | restriction | sj | ja | j | no_straight_on | | + | restriction | sj | jb | j | no_straight_on | bicycle | + | restriction | sj | jc | j | no_straight_on | bus; bicycle | + | restriction | sj | jd | j | no_straight_on | bicycle; motocar | + | restriction | sj | je | j | no_straight_on | bus, bicycle | + | restriction | sj | jf | j | no_straight_on | bicycle, bus | + + When I route I should get + | from | to | route | + | s | a | sj,ja,ja | + | s | b | sj,jb,jb | + | s | c | sj,jc,jc | + | s | d | sj,jd,jd | + | s | e | sj,je,je | + | s | f | sj,jf,jf | diff --git a/features/countrybicycle/safety.feature b/features/countrybicycle/safety.feature new file mode 100644 index 000000000..2d848df8d --- /dev/null +++ b/features/countrybicycle/safety.feature @@ -0,0 +1,104 @@ +@routing @countrybicycle @safety +Feature: Bicycle - Adds penalties to unsafe roads + + Background: + Given the profile file "countrybicycle" initialized with + """ + profile.properties.weight_name = 'cyclability' + """ + + Scenario: Bike - Apply penalties to ways without cycleways + Then routability should be + | highway | cycleway | forw | backw | forw_rate | backw_rate | + | motorway | | | | | | + | primary | | 15 km/h | 15 km/h | 2.1 | 2.1 | + | secondary | | 15 km/h | 15 km/h | 2.7 | 2.7 | + | tertiary | | 15 km/h | 15 km/h | 3.3 | 3.3 | + | primary_link | | 15 km/h | 15 km/h | 2.1 | 2.1 | + | secondary_link | | 15 km/h | 15 km/h | 2.7 | 2.7 | + | tertiary_link | | 15 km/h | 15 km/h | 3.3 | 3.3 | + | residential | | 15 km/h | 15 km/h | 4.2 | 4.2 | + | cycleway | | 15 km/h | 15 km/h | 4.2 | 4.2 | + | footway | | 4 km/h +-1 | 4 km/h +-1 | 1.1 | 1.1 | + + Scenario: Bike - Apply no penalties to ways with cycleways + Then routability should be + | highway | cycleway | forw | backw | forw_rate | backw_rate | + | motorway | track | 15 km/h | | 4.2 | | + | primary | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | secondary | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | tertiary | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | primary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | secondary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | tertiary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | residential | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | cycleway | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | footway | track | 14 km/h | 14 km/h | 4.2 | 4.2 | + | motorway | lane | 15 km/h | | 4.2 | | + | primary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | secondary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | tertiary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | primary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | secondary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | tertiary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | residential | lane | 14 km/h | 14 km/h | 4.2 | 4.2 | + | cycleway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | footway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | motorway | shared_lane | 15 km/h | | 4.2 | | + | primary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + + Scenario: Bike - Apply no penalties to ways in direction of cycleways + Then routability should be + | highway | cycleway:right | cycleway:left | forw | backw | forw_rate | backw_rate | + | motorway | track | | 15 km/h | | 4.2 | | + | primary | track | | 15 km/h | 15 km/h | 4.2 | 2.1 | + | secondary | track | | 15 km/h | 15 km/h | 4.2 | 2.7 | + | tertiary | track | | 15 km/h | 15 km/h | 4.2 | 3.3 | + | primary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.1 | + | secondary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.7 | + | tertiary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.3 | + | residential | track | | 15 km/h | 15 km/h | 4.2 | 4.2 | + | cycleway | track | | 15 km/h | 15 km/h | 4.2 | 4.2 | + | footway | track | | 14 km/h | 4 km/h +-1 | 4.2 | 1.1 | + | motorway | | track | 15 km/h | | 4.2 | | + | primary | | track | 15 km/h | 15 km/h | 2.1 | 4.2 | + | secondary | | track | 15 km/h | 15 km/h | 2.7 | 4.2 | + | tertiary | | track | 15 km/h | 15 km/h | 3.3 | 4.2 | + | primary_link | | track | 15 km/h | 15 km/h | 2.1 | 4.2 | + | secondary_link | | track | 15 km/h | 15 km/h | 2.7 | 4.2 | + | tertiary_link | | track | 15 km/h | 15 km/h | 3.3 | 4.2 | + | residential | | track | 14 km/h | 14 km/h | 4.2 | 4.2 | + | cycleway | | track | 15 km/h | 15 km/h | 4.2 | 4.2 | + | footway | | track | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 | + | motorway | lane | | 15 km/h | | 4.2 | | + | primary | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 | + | secondary | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 | + | tertiary | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 | + | primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 | + | secondary_link | lane | | 14 km/h | 14 km/h | 4.2 | 2.7 | + | tertiary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 | + | residential | lane | | 15 km/h +-1 | 15 km/h +-1 | 4.2 | 4.2 | + | cycleway | lane | | 15 km/h | 15 km/h | 4.2 | 4.2 | + | footway | lane | | 15 km/h | 4 km/h +-1 | 4.2 | 1.1 | + | motorway | | lane | 15 km/h | | 4.2 | | + | primary | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 | + | secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 2.7 | 4.2 | + | tertiary | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 | + | primary_link | | lane | 14 km/h | 14 km/h | 2.1 | 4.2 | + | secondary_link | | lane | 15 km/h | 15 km/h | 2.7 | 4.2 | + | tertiary_link | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 | + | residential | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | cycleway | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | footway | | lane | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 | + | motorway | shared_lane | | 15 km/h | | 4.2 | | + | primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.1 | + | motorway | | shared_lane | 14 km/h | | 4.2 | | + | primary | | shared_lane | 15 km/h | 15 km/h | 2.1 | 4.2 | + + + Scenario: Bike - Don't apply penalties for all kind of cycleways + Then routability should be + | highway | cycleway | forw | backw | forw_rate | backw_rate | + | tertiary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | tertiary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 | + | tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 3.3 | diff --git a/features/countrybicycle/startpoint.feature b/features/countrybicycle/startpoint.feature new file mode 100644 index 000000000..03d0f6d1b --- /dev/null +++ b/features/countrybicycle/startpoint.feature @@ -0,0 +1,53 @@ +@routing @countrybicycle @startpoint +Feature: Bike - Allowed start/end modes + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Don't start/stop on ferries + Given the node map + """ + a 1 b 2 c + """ + + And the ways + | nodes | highway | route | bicycle | + | ab | primary | | | + | bc | | ferry | yes | + + When I route I should get + | from | to | route | modes | + | 1 | 2 | ab,ab | cycling,cycling | + | 2 | 1 | ab,ab | cycling,cycling | + + Scenario: Bike - Don't start/stop on trains + Given the node map + """ + a 1 b 2 c + """ + + And the ways + | nodes | highway | railway | bicycle | + | ab | primary | | | + | bc | | train | yes | + + When I route I should get + | from | to | route | modes | + | 1 | 2 | ab,ab | cycling,cycling | + | 2 | 1 | ab,ab | cycling,cycling | + + Scenario: Bike - OK to start pushing bike + Given the node map + """ + a 1 b 2 c + """ + + And the ways + | nodes | highway | + | ab | primary | + | bc | steps | + + When I route I should get + | from | to | route | modes | + | 1 | 2 | ab,bc,bc | cycling,pushing bike,pushing bike | + | 2 | 1 | bc,ab,ab | pushing bike,cycling,cycling | diff --git a/features/countrybicycle/stop_area.feature b/features/countrybicycle/stop_area.feature new file mode 100644 index 000000000..889f18cd3 --- /dev/null +++ b/features/countrybicycle/stop_area.feature @@ -0,0 +1,39 @@ +@routing @countrybicycle @stop_area @todo +Feature: Bike - Stop areas for public transport +# Platforms and railway/bus lines are connected using a relation rather that a way, as specified in: +# http://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Platforms tagged using public_transport + Then routability should be + | highway | public_transport | bicycle | bothw | + | primary | | | x | + | (nil) | platform | | x | + + Scenario: Bike - railway platforms + Given the node map + """ + a b c d + s t + """ + + And the nodes + | node | public_transport | + | c | stop_position | + + And the ways + | nodes | highway | railway | bicycle | public_transport | + | abcd | (nil) | train | yes | | + | st | (nil) | (nil) | | platform | + + And the relations + | type | public_transport | node:stop | way:platform | + | public_transport | stop_area | c | st | + + When I route I should get + | from | to | route | + | a | d | abcd,abcd | + | s | t | st,st | + | s | d | /st,.+,abcd/,abcd/ | diff --git a/features/countrybicycle/surface.feature b/features/countrybicycle/surface.feature new file mode 100644 index 000000000..6827afc5f --- /dev/null +++ b/features/countrybicycle/surface.feature @@ -0,0 +1,68 @@ +@routing @surface @countrybicycle +Feature: Bike - Surfaces + + Background: + Given the profile "countrybicycle" + + Scenario: Bicycle - Slow surfaces + Then routability should be + | highway | surface | bothw | + | cycleway | | 48 s | + | cycleway | asphalt | 47.9 s | + | cycleway | chipseal | 48 s | + | cycleway | concrete | 48 s | + | cycleway | concrete_lanes | 48 s | + | cycleway | cobblestone:flattened | 72 s | + | cycleway | paving_stones | 72 s | + | cycleway | wood | 72 s | + | cycleway | metal | 72 s | + | cycleway | compacted | 72 s | + | cycleway | fine_gravel | 72 s | + | cycleway | ground | 72 s | + | cycleway | dirt | 90 s | + | cycleway | cobblestone | 102.9 s | + | cycleway | gravel | 120 s | + | cycleway | pebblestone | 120 s | + | cycleway | grass_paver | 120 s | + | cycleway | dirt | 90 s | + | cycleway | earth | 120 s | + | cycleway | grass | 120 s | + | cycleway | mud | 240 s | + | cycleway | sand | 240 s | + | cycleway | woodchips | 240 s | + | cycleway | sett | 80 s | + + Scenario: Bicycle - Good surfaces on small paths + Then routability should be + | highway | surface | bothw | + | cycleway | | 48 s | + | path | | 55.3 s | + | track | | 60 s | + | track | asphalt | 60 s | + | path | asphalt | 55.4 s | + + Scenario: Bicycle - Surfaces should not make unknown ways routable + Then routability should be + | highway | surface | bothw | + | cycleway | | 48 s | + | nosense | | | + | nosense | asphalt | | + + Scenario: Bicycle - Surfaces should not increase speed when pushing bikes + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | highway | oneway | surface | + | ab | primary | yes | asphalt | + | cd | footway | | asphalt | + + When I route I should get + | from | to | route | modes | speed | + | a | b | ab,ab | cycling,cycling | 15 km/h | + | b | a | ab,ab | pushing bike,pushing bike | 4 km/h | + | c | d | cd,cd | pushing bike,pushing bike | 4 km/h | + | d | c | cd,cd | pushing bike,pushing bike | 4 km/h | diff --git a/features/countrybicycle/train.feature b/features/countrybicycle/train.feature new file mode 100644 index 000000000..be914492c --- /dev/null +++ b/features/countrybicycle/train.feature @@ -0,0 +1,71 @@ +@routing @bicycle @train +Feature: Bike - Handle ferry routes +# Bringing bikes on trains and subways +# We cannot currently use a 'routability' type test, since the bike +# profile does not allow starting/stopping on trains, and +# it's not possible to modify the bicycle profile table because it's +# defined as local. + + Background: + Given the profile "bicycle" + + Scenario: Bike - Bringing bikes on trains + Given the node map + """ + a 1 b c 2 d e 3 f g 4 h + """ + + And the ways + | nodes | highway | railway | bicycle | + | ab | primary | | | + | cd | primary | | | + | ef | primary | | | + | gh | primary | | | + | bc | | train | | + | de | | train | yes | + | fg | | train | no | + + When I route I should get + | from | to | route | + | 1 | 2 | | + | 2 | 3 | cd,de,ef,ef | + | 3 | 4 | | + + Scenario: Bike - Bringing bikes on trains, invalid railway tag is accepted if access specified + Given the node map + """ + a 1 b c 2 d e 3 f g 4 h + """ + + And the ways + | nodes | highway | railway | bicycle | + | ab | primary | | | + | cd | primary | | | + | ef | primary | | | + | gh | primary | | | + | bc | | invalid_tag | | + | de | | invalid_tag | yes | + | fg | | invalid_tag | no | + + When I route I should get + | from | to | route | + | 1 | 2 | | + | 2 | 3 | cd,de,ef| + | 3 | 4 | | + + @construction + Scenario: Bike - Don't route on railways under construction + Given the node map + """ + a 1 b c 2 d + """ + + And the ways + | nodes | highway | railway | bicycle | + | ab | primary | | | + | cd | primary | | | + | bc | | construction | yes | + + When I route I should get + | from | to | route | + | 1 | 2 | | diff --git a/features/countrybicycle/turn_penalty.feature b/features/countrybicycle/turn_penalty.feature new file mode 100644 index 000000000..e3f1dad85 --- /dev/null +++ b/features/countrybicycle/turn_penalty.feature @@ -0,0 +1,42 @@ +@routing @countrybicycle @turn_penalty +Feature: Turn Penalties + + Background: + Given the profile "countrybicycle" + Given a grid size of 200 meters + + + Scenario: Bicycle - Turn penalties on cyclability + Given the profile file "bicycle" initialized with + """ + profile.properties.weight_name = 'cyclability' + """ + + Given the node map + """ + a--b-----c + | + | + d + + e--------f-----------g + / + / + / + h + """ + + And the ways + | nodes | highway | + | abc | residential | + | bd | residential | + | efg | residential | + | fh | residential | + + When I route I should get + | from | to | distance | weight | # | + | a | c | 900m +- 1 | 216 | Going straight has no penalties | + | a | d | 900m +- 1 | 220.2 | Turning right had penalties | + | e | g | 2100m +- 5| 503.9 | Going straght has no penalties | + | e | h | 2100m +- 5| 515.1 | Turn sharp right has even higher penalties| + diff --git a/features/countrybicycle/way.feature b/features/countrybicycle/way.feature new file mode 100644 index 000000000..f1af436e8 --- /dev/null +++ b/features/countrybicycle/way.feature @@ -0,0 +1,42 @@ +@routing @countrybicycle @way +Feature: Bike - Accessability of different way types + + Background: + Given the profile "countrybicycle" + + Scenario: Bike - Routability of way types + # Bikes are allowed on footways etc because you can pull your bike at a lower speed. + # Pier is not allowed, since it's tagged using man_made=pier. + + Then routability should be + | highway | bothw | + | (nil) | | + | 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 | + | cycleway | x | + | bridleway | | + | pier | | + + Scenario: Bike - Routability of man_made structures + Then routability should be + | highway | man_made | bothw | + | (nil) | (nil) | | + | (nil) | pier | x |