update profile and tests for pushing of bikes
This commit is contained in:
parent
b3d517943a
commit
dd5d520b53
@ -1,5 +1,5 @@
|
|||||||
@routing @bicycle @access
|
@routing @bicycle @access
|
||||||
Feature: Bike - Restricted access
|
Feature: Bike - Access tags on ways
|
||||||
Reference: http://wiki.openstreetmap.org/wiki/Key:access
|
Reference: http://wiki.openstreetmap.org/wiki/Key:access
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
@ -7,37 +7,95 @@ Reference: http://wiki.openstreetmap.org/wiki/Key:access
|
|||||||
|
|
||||||
Scenario: Bike - Access tag hierachy on ways
|
Scenario: Bike - Access tag hierachy on ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| access | vehicle | bicycle | bothw |
|
| highway | access | vehicle | bicycle | bothw |
|
||||||
| | | | x |
|
| | | | | x |
|
||||||
| yes | | | x |
|
| | yes | | | x |
|
||||||
| no | | | |
|
| | no | | | |
|
||||||
| | yes | | x |
|
| | | yes | | x |
|
||||||
| | no | | |
|
| | | no | | |
|
||||||
| no | yes | | x |
|
| | no | yes | | x |
|
||||||
| yes | no | | |
|
| | yes | no | | |
|
||||||
| | | yes | x |
|
| | | | yes | x |
|
||||||
| | | no | |
|
| | | | no | |
|
||||||
| no | | yes | x |
|
| | no | | yes | x |
|
||||||
| yes | | no | |
|
| | yes | | no | |
|
||||||
| | no | yes | x |
|
| | | no | yes | x |
|
||||||
| | yes | no | |
|
| | | yes | no | |
|
||||||
|
| runway | | | | |
|
||||||
|
| runway | yes | | | x |
|
||||||
|
| runway | no | | | |
|
||||||
|
| runway | | yes | | x |
|
||||||
|
| runway | | no | | |
|
||||||
|
| runway | no | yes | | x |
|
||||||
|
| runway | yes | no | | |
|
||||||
|
| runway | | | yes | x |
|
||||||
|
| runway | | | no | |
|
||||||
|
| runway | no | | yes | x |
|
||||||
|
| runway | yes | | no | |
|
||||||
|
| runway | | no | yes | x |
|
||||||
|
| runway | | yes | no | |
|
||||||
|
|
||||||
Scenario: Bike - Access tag hierachy on nodes
|
@todo
|
||||||
|
Scenario: Bike - Access tag in forward direction
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| node/access | node/vehicle | node/bicycle | bothw |
|
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||||
| | | | x |
|
| | | | | x | |
|
||||||
| yes | | | x |
|
| | yes | | | x | |
|
||||||
| no | | | |
|
| | no | | | | |
|
||||||
| | yes | | x |
|
| | | yes | | x | |
|
||||||
| | no | | |
|
| | | no | | | |
|
||||||
| no | yes | | x |
|
| | no | yes | | x | |
|
||||||
| yes | no | | |
|
| | yes | no | | | |
|
||||||
| | | yes | x |
|
| | | | yes | x | |
|
||||||
| | | no | |
|
| | | | no | | |
|
||||||
| no | | yes | x |
|
| | no | | yes | x | |
|
||||||
| yes | | no | |
|
| | yes | | no | | |
|
||||||
| | no | yes | x |
|
| | | no | yes | x | |
|
||||||
| | yes | no | |
|
| | | yes | no | | |
|
||||||
|
| runway | | | | x | |
|
||||||
|
| runway | yes | | | x | |
|
||||||
|
| runway | no | | | | |
|
||||||
|
| runway | | yes | | x | |
|
||||||
|
| runway | | no | | | |
|
||||||
|
| runway | no | yes | | x | |
|
||||||
|
| runway | yes | no | | | |
|
||||||
|
| runway | | | yes | x | |
|
||||||
|
| runway | | | no | | |
|
||||||
|
| runway | no | | yes | x | |
|
||||||
|
| runway | yes | | no | | |
|
||||||
|
| runway | | no | yes | x | |
|
||||||
|
| runway | | yes | no | | |
|
||||||
|
|
||||||
|
@todo
|
||||||
|
Scenario: Bike - Access tag in backward direction
|
||||||
|
Then routability should be
|
||||||
|
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||||
|
| | | | | | x |
|
||||||
|
| | yes | | | | x |
|
||||||
|
| | no | | | | |
|
||||||
|
| | | yes | | | x |
|
||||||
|
| | | no | | | |
|
||||||
|
| | no | yes | | | x |
|
||||||
|
| | yes | no | | | |
|
||||||
|
| | | | yes | | x |
|
||||||
|
| | | | no | | |
|
||||||
|
| | no | | yes | | x |
|
||||||
|
| | yes | | no | | |
|
||||||
|
| | | no | yes | | x |
|
||||||
|
| | | yes | no | | |
|
||||||
|
| runway | | | | | x |
|
||||||
|
| runway | yes | | | | x |
|
||||||
|
| runway | no | | | | |
|
||||||
|
| runway | | yes | | | x |
|
||||||
|
| runway | | no | | | |
|
||||||
|
| runway | no | yes | | | x |
|
||||||
|
| runway | yes | no | | | |
|
||||||
|
| runway | | | yes | | x |
|
||||||
|
| runway | | | no | | |
|
||||||
|
| runway | no | | yes | | x |
|
||||||
|
| runway | yes | | no | | |
|
||||||
|
| runway | | no | yes | | x |
|
||||||
|
| runway | | yes | no | | |
|
||||||
|
|
||||||
Scenario: Bike - Overwriting implied acccess on ways
|
Scenario: Bike - Overwriting implied acccess on ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@ -51,18 +109,6 @@ Reference: http://wiki.openstreetmap.org/wiki/Key:access
|
|||||||
| runway | | yes | | x |
|
| runway | | yes | | x |
|
||||||
| runway | | | yes | x |
|
| runway | | | yes | x |
|
||||||
|
|
||||||
Scenario: Bike - Overwriting implied acccess on nodes
|
|
||||||
Then routability should be
|
|
||||||
| highway | node/access | node/vehicle | node/bicycle | bothw |
|
|
||||||
| cycleway | | | | x |
|
|
||||||
| runway | | | | |
|
|
||||||
| cycleway | no | | | |
|
|
||||||
| cycleway | | no | | |
|
|
||||||
| cycleway | | | no | |
|
|
||||||
| runway | yes | | | |
|
|
||||||
| runway | | yes | | |
|
|
||||||
| runway | | | yes | |
|
|
||||||
|
|
||||||
Scenario: Bike - Access tags on ways
|
Scenario: Bike - Access tags on ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| access | vehicle | bicycle | bothw |
|
| access | vehicle | bicycle | bothw |
|
||||||
@ -92,35 +138,6 @@ Reference: http://wiki.openstreetmap.org/wiki/Key:access
|
|||||||
| | | agricultural | |
|
| | | agricultural | |
|
||||||
| | | forestery | |
|
| | | forestery | |
|
||||||
|
|
||||||
Scenario: Bike - Access tags on nodes
|
|
||||||
Then routability should be
|
|
||||||
| node/access | node/vehicle | node/bicycle | bothw |
|
|
||||||
| | | | x |
|
|
||||||
| yes | | | x |
|
|
||||||
| permissive | | | x |
|
|
||||||
| designated | | | x |
|
|
||||||
| some_tag | | | x |
|
|
||||||
| no | | | |
|
|
||||||
| private | | | |
|
|
||||||
| agricultural | | | |
|
|
||||||
| forestery | | | |
|
|
||||||
| | yes | | x |
|
|
||||||
| | permissive | | x |
|
|
||||||
| | designated | | x |
|
|
||||||
| | some_tag | | x |
|
|
||||||
| | no | | |
|
|
||||||
| | private | | |
|
|
||||||
| | agricultural | | |
|
|
||||||
| | forestery | | |
|
|
||||||
| | | yes | x |
|
|
||||||
| | | permissive | x |
|
|
||||||
| | | designated | x |
|
|
||||||
| | | some_tag | x |
|
|
||||||
| | | no | |
|
|
||||||
| | | private | |
|
|
||||||
| | | agricultural | |
|
|
||||||
| | | forestery | |
|
|
||||||
|
|
||||||
Scenario: Bike - Access tags on both node and way
|
Scenario: Bike - Access tags on both node and way
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| access | node/access | bothw |
|
| access | node/access | bothw |
|
||||||
@ -147,8 +164,8 @@ Reference: http://wiki.openstreetmap.org/wiki/Key:access
|
|||||||
|
|
||||||
Scenario: Bike - Ignore access tags for other modes
|
Scenario: Bike - Ignore access tags for other modes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | foot | motor_vehicle | moped | bothw |
|
| highway | boat | motor_vehicle | moped | bothw |
|
||||||
| runway | yes | | | |
|
| river | yes | | | |
|
||||||
| cycleway | no | | | x |
|
| cycleway | no | | | x |
|
||||||
| runway | | yes | | |
|
| runway | | yes | | |
|
||||||
| cycleway | | no | | x |
|
| cycleway | | no | | x |
|
||||||
|
64
features/bicycle/access_node.feature
Normal file
64
features/bicycle/access_node.feature
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
@routing @bicycle @access
|
||||||
|
Feature: Bike - Access tags on nodes
|
||||||
|
Reference: http://wiki.openstreetmap.org/wiki/Key:access
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "bicycle"
|
||||||
|
|
||||||
|
Scenario: Bike - Access tag hierachy on nodes
|
||||||
|
Then routability should be
|
||||||
|
| node/access | node/vehicle | node/bicycle | bothw |
|
||||||
|
| | | | x |
|
||||||
|
| yes | | | x |
|
||||||
|
| no | | | |
|
||||||
|
| | yes | | x |
|
||||||
|
| | no | | |
|
||||||
|
| no | yes | | x |
|
||||||
|
| yes | no | | |
|
||||||
|
| | | yes | x |
|
||||||
|
| | | no | |
|
||||||
|
| no | | yes | x |
|
||||||
|
| yes | | no | |
|
||||||
|
| | no | yes | x |
|
||||||
|
| | yes | no | |
|
||||||
|
|
||||||
|
Scenario: Bike - Overwriting implied acccess on nodes
|
||||||
|
Then routability should be
|
||||||
|
| highway | node/access | node/vehicle | node/bicycle | bothw |
|
||||||
|
| cycleway | | | | x |
|
||||||
|
| 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 |
|
||||||
|
| | | | x |
|
||||||
|
| yes | | | x |
|
||||||
|
| permissive | | | x |
|
||||||
|
| designated | | | x |
|
||||||
|
| some_tag | | | x |
|
||||||
|
| no | | | |
|
||||||
|
| private | | | |
|
||||||
|
| agricultural | | | |
|
||||||
|
| forestery | | | |
|
||||||
|
| | yes | | x |
|
||||||
|
| | permissive | | x |
|
||||||
|
| | designated | | x |
|
||||||
|
| | some_tag | | x |
|
||||||
|
| | no | | |
|
||||||
|
| | private | | |
|
||||||
|
| | agricultural | | |
|
||||||
|
| | forestery | | |
|
||||||
|
| | | yes | x |
|
||||||
|
| | | permissive | x |
|
||||||
|
| | | designated | x |
|
||||||
|
| | | some_tag | x |
|
||||||
|
| | | no | |
|
||||||
|
| | | private | |
|
||||||
|
| | | agricultural | |
|
||||||
|
| | | forestery | |
|
@ -29,16 +29,16 @@ Reference: http://wiki.openstreetmap.org/wiki/Key:cycleway
|
|||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | cycleway | cycleway:left | cycleway:right | forw | backw |
|
| highway | cycleway | cycleway:left | cycleway:right | forw | backw |
|
||||||
| primary | | | | x | x |
|
| primary | | | | x | x |
|
||||||
| pirmary | track | | | x | x |
|
| primary | track | | | x | x |
|
||||||
| pirmary | opposite | | | x | x |
|
| primary | opposite | | | x | x |
|
||||||
| pirmary | | track | | x | x |
|
| primary | | track | | x | x |
|
||||||
| pirmary | | opposite | | x | x |
|
| primary | | opposite | | x | x |
|
||||||
| pirmary | | | track | x | x |
|
| primary | | | track | x | x |
|
||||||
| pirmary | | | opposite | x | x |
|
| primary | | | opposite | x | x |
|
||||||
| pirmary | | track | track | x | x |
|
| primary | | track | track | x | x |
|
||||||
| pirmary | | opposite | opposite | x | x |
|
| primary | | opposite | opposite | x | x |
|
||||||
| pirmary | | track | opposite | x | x |
|
| primary | | track | opposite | x | x |
|
||||||
| pirmary | | opposite | track | x | x |
|
| primary | | opposite | track | x | x |
|
||||||
|
|
||||||
Scenario: Bike - Left/right side cycleways on implied oneways
|
Scenario: Bike - Left/right side cycleways on implied oneways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
@routing @bicycle @oneway
|
@routing @bicycle @oneway
|
||||||
Feature: Bike - Oneway streets
|
Feature: Bike - Oneway streets
|
||||||
Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing
|
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:
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
Scenario: Bike - Simple oneway
|
Scenario: Bike - Simple oneway
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | forw | backw |
|
| highway | foot | oneway | forw | backw |
|
||||||
| primary | yes | x | |
|
| primary | no | yes | x | |
|
||||||
|
|
||||||
Scenario: Simple reverse oneway
|
Scenario: Simple reverse oneway
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | forw | backw |
|
| highway | foot | oneway | forw | backw |
|
||||||
| primary | -1 | | x |
|
| primary | no | -1 | | x |
|
||||||
|
|
||||||
Scenario: Bike - Around the Block
|
Scenario: Bike - Around the Block
|
||||||
Given the node map
|
Given the node map
|
||||||
@ -21,11 +22,11 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag
|
|||||||
| d | c |
|
| d | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| ab | yes |
|
| ab | yes | no |
|
||||||
| bc | |
|
| bc | | no |
|
||||||
| cd | |
|
| cd | | no |
|
||||||
| da | |
|
| da | | no |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
@ -34,80 +35,80 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag
|
|||||||
|
|
||||||
Scenario: Bike - Handle various oneway tag values
|
Scenario: Bike - Handle various oneway tag values
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| oneway | forw | backw |
|
| foot | oneway | forw | backw |
|
||||||
| | x | x |
|
| no | | x | x |
|
||||||
| nonsense | x | x |
|
| no | nonsense | x | x |
|
||||||
| no | x | x |
|
| no | no | x | x |
|
||||||
| false | x | x |
|
| no | false | x | x |
|
||||||
| 0 | x | x |
|
| no | 0 | x | x |
|
||||||
| yes | x | |
|
| no | yes | x | |
|
||||||
| true | x | |
|
| no | true | x | |
|
||||||
| 1 | x | |
|
| no | 1 | x | |
|
||||||
| -1 | | x |
|
| no | -1 | | x |
|
||||||
|
|
||||||
Scenario: Bike - Implied oneways
|
Scenario: Bike - Implied oneways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | bicycle | junction | forw | backw |
|
| highway | foot | bicycle | junction | forw | backw |
|
||||||
| | | | x | x |
|
| | no | | | x | x |
|
||||||
| | | roundabout | x | |
|
| | no | | roundabout | x | |
|
||||||
| motorway | yes | | x | |
|
| motorway | no | yes | | x | |
|
||||||
| motorway_link | yes | | x | |
|
| motorway_link | no | yes | | x | |
|
||||||
| motorway | yes | roundabout | x | |
|
| motorway | no | yes | roundabout | x | |
|
||||||
| motorway_link | yes | roundabout | x | |
|
| motorway_link | no | yes | roundabout | x | |
|
||||||
|
|
||||||
Scenario: Bike - Overriding implied oneways
|
Scenario: Bike - Overriding implied oneways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | junction | oneway | forw | backw |
|
| highway | foot | junction | oneway | forw | backw |
|
||||||
| primary | roundabout | no | x | x |
|
| primary | no | roundabout | no | x | x |
|
||||||
| primary | roundabout | yes | x | |
|
| primary | no | roundabout | yes | x | |
|
||||||
| motorway_link | | -1 | | |
|
| motorway_link | no | | -1 | | |
|
||||||
| trunk_link | | -1 | | |
|
| trunk_link | no | | -1 | | |
|
||||||
| primary | roundabout | -1 | | x |
|
| primary | no | roundabout | -1 | | x |
|
||||||
|
|
||||||
Scenario: Bike - Oneway:bicycle should override normal oneways tags
|
Scenario: Bike - Oneway:bicycle should override normal oneways tags
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| oneway:bicycle | oneway | junction | forw | backw |
|
| foot | oneway:bicycle | oneway | junction | forw | backw |
|
||||||
| yes | | | x | |
|
| no | yes | | | x | |
|
||||||
| yes | yes | | x | |
|
| no | yes | yes | | x | |
|
||||||
| yes | no | | x | |
|
| no | yes | no | | x | |
|
||||||
| yes | -1 | | x | |
|
| no | yes | -1 | | x | |
|
||||||
| yes | | roundabout | x | |
|
| no | yes | | roundabout | x | |
|
||||||
| no | | | x | x |
|
| no | no | | | x | x |
|
||||||
| no | yes | | x | x |
|
| no | no | yes | | x | x |
|
||||||
| no | no | | x | x |
|
| no | no | no | | x | x |
|
||||||
| no | -1 | | x | x |
|
| no | no | -1 | | x | x |
|
||||||
| no | | roundabout | x | x |
|
| no | no | | roundabout | x | x |
|
||||||
| -1 | | | | x |
|
| no | -1 | | | | x |
|
||||||
| -1 | yes | | | x |
|
| no | -1 | yes | | | x |
|
||||||
| -1 | no | | | x |
|
| no | -1 | no | | | x |
|
||||||
| -1 | -1 | | | x |
|
| no | -1 | -1 | | | x |
|
||||||
| -1 | | roundabout | | x |
|
| no | -1 | | roundabout | | x |
|
||||||
|
|
||||||
Scenario: Bike - Contra flow
|
Scenario: Bike - Contra flow
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| oneway | cycleway | forw | backw |
|
| foot | oneway | cycleway | forw | backw |
|
||||||
| yes | opposite | x | x |
|
| no | yes | opposite | x | x |
|
||||||
| yes | opposite_track | x | x |
|
| no | yes | opposite_track | x | x |
|
||||||
| yes | opposite_lane | x | x |
|
| no | yes | opposite_lane | x | x |
|
||||||
| -1 | opposite | x | x |
|
| no | -1 | opposite | x | x |
|
||||||
| -1 | opposite_track | x | x |
|
| no | -1 | opposite_track | x | x |
|
||||||
| -1 | opposite_lane | x | x |
|
| no | -1 | opposite_lane | x | x |
|
||||||
| no | opposite | x | x |
|
| no | no | opposite | x | x |
|
||||||
| no | opposite_track | x | x |
|
| no | no | opposite_track | x | x |
|
||||||
| no | opposite_lane | x | x |
|
| no | no | opposite_lane | x | x |
|
||||||
|
|
||||||
Scenario: Bike - Should not be affected by car tags
|
Scenario: Bike - Should not be affected by car tags
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| junction | oneway | oneway:car | forw | backw |
|
| foot | junction | oneway | oneway:car | forw | backw |
|
||||||
| | yes | yes | x | |
|
| no | | yes | yes | x | |
|
||||||
| | yes | no | x | |
|
| no | | yes | no | x | |
|
||||||
| | yes | -1 | x | |
|
| no | | yes | -1 | x | |
|
||||||
| | no | yes | x | x |
|
| no | | no | yes | x | x |
|
||||||
| | no | no | x | x |
|
| no | | no | no | x | x |
|
||||||
| | no | -1 | x | x |
|
| no | | no | -1 | x | x |
|
||||||
| | -1 | yes | | x |
|
| no | | -1 | yes | | x |
|
||||||
| | -1 | no | | x |
|
| no | | -1 | no | | x |
|
||||||
| | -1 | -1 | | x |
|
| no | | -1 | -1 | | x |
|
||||||
| roundabout | | yes | x | |
|
| no | roundabout | | yes | x | |
|
||||||
| roundabout | | no | x | |
|
| no | roundabout | | no | x | |
|
||||||
| roundabout | | -1 | x | |
|
| no | roundabout | | -1 | x | |
|
||||||
|
72
features/bicycle/pushing.feature
Normal file
72
features/bicycle/pushing.feature
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
@routing @bicycle @pushing
|
||||||
|
Feature: Bike - Accessability of different way types
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "bicycle"
|
||||||
|
Given the shortcuts
|
||||||
|
| key | value |
|
||||||
|
| bike | 40s ~20% |
|
||||||
|
| foot | 180s ~20% |
|
||||||
|
|
||||||
|
Scenario: Bike - Pushing bikes on pedestrian-only ways
|
||||||
|
Then routability should be
|
||||||
|
| highway | oneway | forw | backw |
|
||||||
|
| (nil) | | | |
|
||||||
|
| cycleway | | bike | bike |
|
||||||
|
| primary | | bike | bike |
|
||||||
|
| pedestrian | | foot | foot |
|
||||||
|
| footway | | foot | foot |
|
||||||
|
| primary | yes | bike | foot |
|
||||||
|
|
||||||
|
Scenario: Bike - Pushing bikes against normal oneways
|
||||||
|
Then routability should be
|
||||||
|
| highway | oneway | forw | backw |
|
||||||
|
| (nil) | | | |
|
||||||
|
| primary | yes | bike | foot |
|
||||||
|
| pedestrian | yes | foot | foot |
|
||||||
|
|
||||||
|
Scenario: Bike - Pushing bikes against reverse oneways
|
||||||
|
Then routability should be
|
||||||
|
| highway | oneway | forw | backw |
|
||||||
|
| (nil) | | | |
|
||||||
|
| primary | -1 | foot | bike |
|
||||||
|
| pedestrian | -1 | foot | foot |
|
||||||
|
|
||||||
|
@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 |
|
||||||
|
| a | d | abcda |
|
||||||
|
| b | c | abcda |
|
||||||
|
| c | b | abcda |
|
||||||
|
| c | d | abcda |
|
||||||
|
| d | c | abcda |
|
||||||
|
| d | a | abcda |
|
||||||
|
| a | d | abcda |
|
||||||
|
|
||||||
|
Scenario: Bike - Pushing bikes on ways with foot=yes
|
||||||
|
Then routability should be
|
||||||
|
| highway | foot | bothw |
|
||||||
|
| motorway | | |
|
||||||
|
| motorway | yes | foot |
|
||||||
|
| runway | | |
|
||||||
|
| runway | yes | foot |
|
||||||
|
|
||||||
|
@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 | | foot | |
|
||||||
|
| motorway | | yes | | foot |
|
@ -3,7 +3,7 @@ Feature: Bike - Turn restrictions
|
|||||||
Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction
|
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.
|
Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes.
|
||||||
|
|
||||||
Background: Use car routing
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
@ -14,11 +14,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -38,11 +38,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -62,11 +62,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -86,11 +86,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -110,11 +110,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -134,11 +134,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -158,11 +158,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -182,11 +182,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| nj | -1 |
|
| nj | -1 | no |
|
||||||
| wj | -1 |
|
| wj | -1 | no |
|
||||||
| ej | -1 |
|
| ej | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@ -206,13 +206,13 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | no |
|
| sj | no | no |
|
||||||
| xj | -1 |
|
| xj | -1 | no |
|
||||||
| aj | -1 |
|
| aj | -1 | no |
|
||||||
| bj | no |
|
| bj | no | no |
|
||||||
| cj | -1 |
|
| cj | -1 | no |
|
||||||
| dj | -1 |
|
| dj | -1 | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction | except |
|
| type | way:from | way:to | node:via | restriction | except |
|
||||||
@ -236,10 +236,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| | s | |
|
| | s | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| aj | no |
|
| aj | no | no |
|
||||||
| bj | no |
|
| bj | no | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction | except |
|
| type | way:from | way:to | node:via | restriction | except |
|
||||||
@ -261,14 +261,14 @@ Feature: Bike - Turn restrictions
|
|||||||
| | | f |
|
| | | f |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway | foot |
|
||||||
| sj | yes |
|
| sj | yes | no |
|
||||||
| ja | yes |
|
| ja | yes | no |
|
||||||
| jb | yes |
|
| jb | yes | no |
|
||||||
| jc | yes |
|
| jc | yes | no |
|
||||||
| jd | yes |
|
| jd | yes | no |
|
||||||
| je | yes |
|
| je | yes | no |
|
||||||
| jf | yes |
|
| jf | yes | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction | except |
|
| type | way:from | way:to | node:via | restriction | except |
|
||||||
|
@ -4,11 +4,11 @@ Feature: Bike - Accessability of different way types
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
Scenario: Bike - Basic access
|
Scenario: Bike - Routability of way types
|
||||||
Bikes are allowed on footways etc because you can pull your bike at a lower speed.
|
Bikes are allowed on footways etc because you can pull your bike at a lower speed.
|
||||||
Given the profile "bicycle"
|
Pier is not allowed, since it's tagged using man_made=pier.
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | forw |
|
| highway | bothw |
|
||||||
| (nil) | |
|
| (nil) | |
|
||||||
| motorway | |
|
| motorway | |
|
||||||
| motorway_link | |
|
| motorway_link | |
|
||||||
@ -30,6 +30,12 @@ Feature: Bike - Accessability of different way types
|
|||||||
| footway | x |
|
| footway | x |
|
||||||
| pedestrian | x |
|
| pedestrian | x |
|
||||||
| steps | x |
|
| steps | x |
|
||||||
| pier | x |
|
|
||||||
| cycleway | x |
|
| cycleway | x |
|
||||||
| bridleway | |
|
| bridleway | |
|
||||||
|
| pier | |
|
||||||
|
|
||||||
|
Scenario: Bike - Routability of man_made structures
|
||||||
|
Then routability should be
|
||||||
|
| highway | man_made | bothw |
|
||||||
|
| (nil) | (nil) | |
|
||||||
|
| (nil) | pier | x |
|
||||||
|
0
features/car/permissive.feature
Normal file
0
features/car/permissive.feature
Normal file
@ -12,7 +12,9 @@ restriction_exception_tags = { "bicycle", "vehicle", "access" }
|
|||||||
|
|
||||||
default_speed = 16
|
default_speed = 16
|
||||||
|
|
||||||
main_speeds = {
|
walking_speed = 4
|
||||||
|
|
||||||
|
bicycle_speeds = {
|
||||||
["cycleway"] = 18,
|
["cycleway"] = 18,
|
||||||
["primary"] = 17,
|
["primary"] = 17,
|
||||||
["primary_link"] = 17,
|
["primary_link"] = 17,
|
||||||
@ -26,17 +28,14 @@ main_speeds = {
|
|||||||
["road"] = 16,
|
["road"] = 16,
|
||||||
["service"] = 16,
|
["service"] = 16,
|
||||||
["track"] = 13,
|
["track"] = 13,
|
||||||
["path"] = 13,
|
["path"] = 13
|
||||||
["footway"] = 12,
|
--["footway"] = 12,
|
||||||
["pedestrian"] = 12,
|
--["pedestrian"] = 12,
|
||||||
["pier"] = 12,
|
|
||||||
["steps"] = 2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pedestrian_speeds = {
|
pedestrian_speeds = {
|
||||||
["footway"] = 5,
|
["footway"] = walking_speed,
|
||||||
["pedestrian"] = 5,
|
["pedestrian"] = walking_speed,
|
||||||
["pier"] = 5,
|
|
||||||
["steps"] = 2
|
["steps"] = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +49,7 @@ railway_speeds = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
platform_speeds = {
|
platform_speeds = {
|
||||||
["platform"] = 5
|
["platform"] = walking_speed
|
||||||
}
|
}
|
||||||
|
|
||||||
amenity_speeds = {
|
amenity_speeds = {
|
||||||
@ -58,6 +57,10 @@ amenity_speeds = {
|
|||||||
["parking_entrance"] = 10
|
["parking_entrance"] = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
man_made_speeds = {
|
||||||
|
["pier"] = walking_speed
|
||||||
|
}
|
||||||
|
|
||||||
route_speeds = {
|
route_speeds = {
|
||||||
["ferry"] = 5
|
["ferry"] = 5
|
||||||
}
|
}
|
||||||
@ -111,16 +114,35 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
return 0;
|
return 0;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- First, get the properties of each way that we come across
|
-- initial routability check, filters out buildings, boundaries, etc
|
||||||
local highway = way.tags:Find("highway")
|
local highway = way.tags:Find("highway")
|
||||||
|
local route = way.tags:Find("route")
|
||||||
|
local man_made = way.tags:Find("man_made")
|
||||||
|
local railway = way.tags:Find("railway")
|
||||||
|
local amenity = way.tags:Find("amenity")
|
||||||
|
local public_transport = way.tags:Find("public_transport")
|
||||||
|
if (not highway or highway == '') and
|
||||||
|
(not route or route == '') and
|
||||||
|
(not railway or railway=='') and
|
||||||
|
(not amenity or amenity=='') and
|
||||||
|
(not man_made or man_made=='') and
|
||||||
|
(not public_transport or public_transport=='')
|
||||||
|
then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
-- access
|
||||||
|
local access = Access.find_access_tag(way, access_tags_hierachy)
|
||||||
|
if access_tag_blacklist[access] then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- other tags
|
||||||
local name = way.tags:Find("name")
|
local name = way.tags:Find("name")
|
||||||
local ref = way.tags:Find("ref")
|
local ref = way.tags:Find("ref")
|
||||||
local junction = way.tags:Find("junction")
|
local junction = way.tags:Find("junction")
|
||||||
local route = way.tags:Find("route")
|
|
||||||
local railway = way.tags:Find("railway")
|
|
||||||
local public_transport = way.tags:Find("public_transport")
|
|
||||||
local maxspeed = parseMaxspeed(way.tags:Find ( "maxspeed") )
|
local maxspeed = parseMaxspeed(way.tags:Find ( "maxspeed") )
|
||||||
local man_made = way.tags:Find("man_made")
|
|
||||||
local barrier = way.tags:Find("barrier")
|
local barrier = way.tags:Find("barrier")
|
||||||
local oneway = way.tags:Find("oneway")
|
local oneway = way.tags:Find("oneway")
|
||||||
local onewayClass = way.tags:Find("oneway:bicycle")
|
local onewayClass = way.tags:Find("oneway:bicycle")
|
||||||
@ -130,23 +152,7 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
local duration = way.tags:Find("duration")
|
local duration = way.tags:Find("duration")
|
||||||
local service = way.tags:Find("service")
|
local service = way.tags:Find("service")
|
||||||
local area = way.tags:Find("area")
|
local area = way.tags:Find("area")
|
||||||
local amenity = way.tags:Find("amenity")
|
local foot = way.tags:Find("foot")
|
||||||
local access = Access.find_access_tag(way, access_tags_hierachy)
|
|
||||||
|
|
||||||
-- initial routability check, filters out buildings, boundaries, etc
|
|
||||||
if (not highway or highway == '') and
|
|
||||||
(not route or route == '') and
|
|
||||||
(not railway or railway=='') and
|
|
||||||
(not amenity or amenity=='') and
|
|
||||||
(not public_transport or public_transport=='')
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
-- access
|
|
||||||
if access_tag_blacklist[access] then
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
-- name
|
-- name
|
||||||
if "" ~= ref then
|
if "" ~= ref then
|
||||||
@ -157,8 +163,9 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
way.name = highway -- if no name exists, use way type
|
way.name = highway -- if no name exists, use way type
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- speed
|
||||||
if route_speeds[route] then
|
if route_speeds[route] then
|
||||||
-- ferries
|
-- ferries (doesn't cover routes tagged using relations)
|
||||||
way.direction = Way.bidirectional
|
way.direction = Way.bidirectional
|
||||||
way.ignore_in_grid = true
|
way.ignore_in_grid = true
|
||||||
if durationIsValid(duration) then
|
if durationIsValid(duration) then
|
||||||
@ -179,32 +186,30 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
way.speed = railway_speeds[railway]
|
way.speed = railway_speeds[railway]
|
||||||
way.direction = Way.bidirectional
|
way.direction = Way.bidirectional
|
||||||
end
|
end
|
||||||
elseif pedestrian_speeds[highway] and main_speeds[highway] then
|
|
||||||
-- pedestrian areas
|
|
||||||
if access_tag_whitelist[access] then
|
|
||||||
way.speed = main_speeds[highway] -- biking
|
|
||||||
else
|
|
||||||
way.speed = pedestrian_speeds[highway] -- pushing bikes
|
|
||||||
end
|
|
||||||
elseif amenity and amenity_speeds[amenity] then
|
elseif amenity and amenity_speeds[amenity] then
|
||||||
-- parking areas
|
-- parking areas
|
||||||
way.speed = amenity_speeds[amenity]
|
way.speed = amenity_speeds[amenity]
|
||||||
else
|
elseif bicycle_speeds[highway] then
|
||||||
-- regular ways
|
-- regular ways
|
||||||
if main_speeds[highway] then
|
way.speed = bicycle_speeds[highway]
|
||||||
way.speed = main_speeds[highway]
|
elseif access and access_tag_whitelist[access] then
|
||||||
elseif main_speeds[man_made] then
|
-- unknown way, but valid access tag
|
||||||
way.speed = main_speeds[man_made]
|
|
||||||
elseif access_tag_whitelist[access] then
|
|
||||||
way.speed = default_speed
|
way.speed = default_speed
|
||||||
|
else
|
||||||
|
-- biking not allowed, maybe we can push our bike?
|
||||||
|
-- essentially requires pedestrian profiling, for example foot=no mean we can't push a bike
|
||||||
|
-- TODO: if we can push, the way should be marked as pedestrion mode, but there's no way to do it yet from lua..
|
||||||
|
if foot ~= 'no' then
|
||||||
|
if pedestrian_speeds[highway] then
|
||||||
|
-- pedestrian-only ways and areas
|
||||||
|
way.speed = pedestrian_speeds[highway]
|
||||||
|
elseif man_made and man_made_speeds[man_made] then
|
||||||
|
-- man made structures
|
||||||
|
way.speed = man_made_speeds[man_made]
|
||||||
|
elseif foot == 'yes' then
|
||||||
|
way.speed = walking_speed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- maxspeed
|
|
||||||
if take_minimum_of_speeds then
|
|
||||||
if maxspeed and maxspeed>0 then
|
|
||||||
way.speed = math.min(way.speed, maxspeed)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- direction
|
-- direction
|
||||||
@ -249,13 +254,38 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
way.direction = Way.oneway
|
way.direction = Way.oneway
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- pushing bikes
|
||||||
|
if bicycle_speeds[highway] or pedestrian_speeds[highway] then
|
||||||
|
if foot ~= 'no' then
|
||||||
|
if way.direction == Way.oneway then
|
||||||
|
way.backward_speed = walking_speed
|
||||||
|
elseif way.direction == Way.opposite then
|
||||||
|
way.backward_speed = walking_speed
|
||||||
|
way.speed = way.speed
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if way.backward_speed == way.speed then
|
||||||
|
-- TODO: no way yet to mark a way as pedestrian mode if forward/backward speeds are equal
|
||||||
|
way.direction = Way.bidirectional
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- cycleways
|
-- cycleways
|
||||||
if cycleway and cycleway_tags[cycleway] then
|
if cycleway and cycleway_tags[cycleway] then
|
||||||
way.speed = main_speeds["cycleway"]
|
way.speed = bicycle_speeds["cycleway"]
|
||||||
elseif cycleway_left and cycleway_tags[cycleway_left] then
|
elseif cycleway_left and cycleway_tags[cycleway_left] then
|
||||||
way.speed = main_speeds["cycleway"]
|
way.speed = bicycle_speeds["cycleway"]
|
||||||
elseif cycleway_right and cycleway_tags[cycleway_right] then
|
elseif cycleway_right and cycleway_tags[cycleway_right] then
|
||||||
way.speed = main_speeds["cycleway"]
|
way.speed = bicycle_speeds["cycleway"]
|
||||||
|
end
|
||||||
|
|
||||||
|
-- maxspeed
|
||||||
|
-- TODO: maxspeed of backward direction
|
||||||
|
if take_minimum_of_speeds then
|
||||||
|
if maxspeed and maxspeed>0 then
|
||||||
|
way.speed = math.min(way.speed, maxspeed)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
way.type = 1
|
way.type = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user