From d4352b84acda272afb4b0dd02aa03d3f359dfa05 Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Sun, 30 Sep 2012 14:40:59 +0200 Subject: [PATCH] reorganizating tests into car/bike/foot --- features/{ => bicycle}/access.feature | 2 +- features/{ => bicycle}/barrier.feature | 29 +--- features/bicycle/destination.feature | 70 ++++++++ features/bicycle/ferry.feature | 30 ++++ features/{ => bicycle}/names.feature | 5 +- features/bicycle/oneway.feature | 120 ++++++++++++++ features/bicycle/restrictions.feature | 199 +++++++++++++++++++++++ features/bicycle/way.feature | 34 ++++ features/car/access.feature | 66 ++++++++ features/car/barrier.feature | 28 ++++ features/{ => car}/destination.feature | 2 +- features/{ => car}/ferry.feature | 5 +- features/car/names.feature | 44 +++++ features/car/oneway.feature | 49 ++++++ features/{ => car}/restrictions.feature | 2 +- features/car/way.feature | 32 ++++ features/foot/oneway.feature | 59 +++++++ features/foot/way.feature | 32 ++++ features/{ => general}/bad.feature | 0 features/{ => general}/basic.feature | 0 features/{ => general}/bearing.feature | 0 features/{ => general}/distance.feature | 0 features/{ => general}/origin.feature | 0 features/{ => general}/penalty.feature | 0 features/{ => general}/planetary.feature | 0 features/{ => general}/snap.feature | 0 features/{ => general}/time.feature | 0 features/{ => general}/utf.feature | 0 features/{ => general}/weight.feature | 0 features/{ => general}/weird.feature | 0 features/oneway.feature | 135 --------------- features/way.feature | 79 --------- profiles/bicycle.lua | 1 + profiles/foot.lua | 23 ++- 34 files changed, 790 insertions(+), 256 deletions(-) rename features/{ => bicycle}/access.feature (98%) rename features/{ => bicycle}/barrier.feature (50%) create mode 100644 features/bicycle/destination.feature create mode 100644 features/bicycle/ferry.feature rename features/{ => bicycle}/names.feature (92%) create mode 100644 features/bicycle/oneway.feature create mode 100644 features/bicycle/restrictions.feature create mode 100644 features/bicycle/way.feature create mode 100644 features/car/access.feature create mode 100644 features/car/barrier.feature rename features/{ => car}/destination.feature (98%) rename features/{ => car}/ferry.feature (90%) create mode 100644 features/car/names.feature create mode 100644 features/car/oneway.feature rename features/{ => car}/restrictions.feature (99%) create mode 100644 features/car/way.feature create mode 100644 features/foot/oneway.feature create mode 100644 features/foot/way.feature rename features/{ => general}/bad.feature (100%) rename features/{ => general}/basic.feature (100%) rename features/{ => general}/bearing.feature (100%) rename features/{ => general}/distance.feature (100%) rename features/{ => general}/origin.feature (100%) rename features/{ => general}/penalty.feature (100%) rename features/{ => general}/planetary.feature (100%) rename features/{ => general}/snap.feature (100%) rename features/{ => general}/time.feature (100%) rename features/{ => general}/utf.feature (100%) rename features/{ => general}/weight.feature (100%) rename features/{ => general}/weird.feature (100%) delete mode 100644 features/oneway.feature delete mode 100644 features/way.feature diff --git a/features/access.feature b/features/bicycle/access.feature similarity index 98% rename from features/access.feature rename to features/bicycle/access.feature index 5cc22fe3c..4e13b6dde 100644 --- a/features/access.feature +++ b/features/bicycle/access.feature @@ -1,4 +1,4 @@ -@routing @access +@routing @bicycle @access Feature: Restricted access Background: diff --git a/features/barrier.feature b/features/bicycle/barrier.feature similarity index 50% rename from features/barrier.feature rename to features/bicycle/barrier.feature index 106bbe1c8..71e86bef9 100644 --- a/features/barrier.feature +++ b/features/bicycle/barrier.feature @@ -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 diff --git a/features/bicycle/destination.feature b/features/bicycle/destination.feature new file mode 100644 index 000000000..0beefe6ca --- /dev/null +++ b/features/bicycle/destination.feature @@ -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 | \ No newline at end of file diff --git a/features/bicycle/ferry.feature b/features/bicycle/ferry.feature new file mode 100644 index 000000000..22a0f24a9 --- /dev/null +++ b/features/bicycle/ferry.feature @@ -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 | + + diff --git a/features/names.feature b/features/bicycle/names.feature similarity index 92% rename from features/names.feature rename to features/bicycle/names.feature index 95951f6c5..1c21901a8 100644 --- a/features/names.feature +++ b/features/bicycle/names.feature @@ -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 diff --git a/features/bicycle/oneway.feature b/features/bicycle/oneway.feature new file mode 100644 index 000000000..98cb2cefe --- /dev/null +++ b/features/bicycle/oneway.feature @@ -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 | | diff --git a/features/bicycle/restrictions.feature b/features/bicycle/restrictions.feature new file mode 100644 index 000000000..8a11ef8d9 --- /dev/null +++ b/features/bicycle/restrictions.feature @@ -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 | | diff --git a/features/bicycle/way.feature b/features/bicycle/way.feature new file mode 100644 index 000000000..c6fc112a4 --- /dev/null +++ b/features/bicycle/way.feature @@ -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 | | diff --git a/features/car/access.feature b/features/car/access.feature new file mode 100644 index 000000000..a8a8df8ed --- /dev/null +++ b/features/car/access.feature @@ -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 | | diff --git a/features/car/barrier.feature b/features/car/barrier.feature new file mode 100644 index 000000000..b2382fc45 --- /dev/null +++ b/features/car/barrier.feature @@ -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 | diff --git a/features/destination.feature b/features/car/destination.feature similarity index 98% rename from features/destination.feature rename to features/car/destination.feature index 1427d48af..95f2a340d 100644 --- a/features/destination.feature +++ b/features/car/destination.feature @@ -1,4 +1,4 @@ -@routing @destination +@routing @car @destination Feature: Destination only, no passing through Background: diff --git a/features/ferry.feature b/features/car/ferry.feature similarity index 90% rename from features/ferry.feature rename to features/car/ferry.feature index e69d7cb74..98004942c 100644 --- a/features/ferry.feature +++ b/features/car/ferry.feature @@ -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 diff --git a/features/car/names.feature b/features/car/names.feature new file mode 100644 index 000000000..35c738d03 --- /dev/null +++ b/features/car/names.feature @@ -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 | diff --git a/features/car/oneway.feature b/features/car/oneway.feature new file mode 100644 index 000000000..c9c02d791 --- /dev/null +++ b/features/car/oneway.feature @@ -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 | | \ No newline at end of file diff --git a/features/restrictions.feature b/features/car/restrictions.feature similarity index 99% rename from features/restrictions.feature rename to features/car/restrictions.feature index 17949bcaf..acd871d4e 100644 --- a/features/restrictions.feature +++ b/features/car/restrictions.feature @@ -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. diff --git a/features/car/way.feature b/features/car/way.feature new file mode 100644 index 000000000..00eedf9c5 --- /dev/null +++ b/features/car/way.feature @@ -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 | | diff --git a/features/foot/oneway.feature b/features/foot/oneway.feature new file mode 100644 index 000000000..93b13b136 --- /dev/null +++ b/features/foot/oneway.feature @@ -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 | \ No newline at end of file diff --git a/features/foot/way.feature b/features/foot/way.feature new file mode 100644 index 000000000..5b50ccb54 --- /dev/null +++ b/features/foot/way.feature @@ -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 | | \ No newline at end of file diff --git a/features/bad.feature b/features/general/bad.feature similarity index 100% rename from features/bad.feature rename to features/general/bad.feature diff --git a/features/basic.feature b/features/general/basic.feature similarity index 100% rename from features/basic.feature rename to features/general/basic.feature diff --git a/features/bearing.feature b/features/general/bearing.feature similarity index 100% rename from features/bearing.feature rename to features/general/bearing.feature diff --git a/features/distance.feature b/features/general/distance.feature similarity index 100% rename from features/distance.feature rename to features/general/distance.feature diff --git a/features/origin.feature b/features/general/origin.feature similarity index 100% rename from features/origin.feature rename to features/general/origin.feature diff --git a/features/penalty.feature b/features/general/penalty.feature similarity index 100% rename from features/penalty.feature rename to features/general/penalty.feature diff --git a/features/planetary.feature b/features/general/planetary.feature similarity index 100% rename from features/planetary.feature rename to features/general/planetary.feature diff --git a/features/snap.feature b/features/general/snap.feature similarity index 100% rename from features/snap.feature rename to features/general/snap.feature diff --git a/features/time.feature b/features/general/time.feature similarity index 100% rename from features/time.feature rename to features/general/time.feature diff --git a/features/utf.feature b/features/general/utf.feature similarity index 100% rename from features/utf.feature rename to features/general/utf.feature diff --git a/features/weight.feature b/features/general/weight.feature similarity index 100% rename from features/weight.feature rename to features/general/weight.feature diff --git a/features/weird.feature b/features/general/weird.feature similarity index 100% rename from features/weird.feature rename to features/general/weird.feature diff --git a/features/oneway.feature b/features/oneway.feature deleted file mode 100644 index 9b66bf937..000000000 --- a/features/oneway.feature +++ /dev/null @@ -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 | | - diff --git a/features/way.feature b/features/way.feature deleted file mode 100644 index 45f0496c7..000000000 --- a/features/way.feature +++ /dev/null @@ -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 | | - diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 1aae6d7a1..e10b97a98 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -17,6 +17,7 @@ speed_profile = { ["secondary"] = 18, ["secondary_link"] = 18, ["tertiary"] = 18, + ["tertiary_link"] = 18, ["residential"] = 18, ["unclassified"] = 16, ["living_street"] = 16, diff --git a/profiles/foot.lua b/profiles/foot.lua index 52461fc69..5efcc459c 100644 --- a/profiles/foot.lua +++ b/profiles/foot.lua @@ -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