Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Feb 21, 2012
2 parents a99a26a + 091cd57 commit d3bf394
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ win/bin-debug/
/osrm-routed
/osrm-prepare
/nohup.out

# Sandbox folder #
###################
sandbox/
29 changes: 27 additions & 2 deletions features/access.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@routing @access
Feature: Oneway streets
Basic accessability of various way types.
Feature: Default speedprofiles
Basic accessability of various way types depending on speedprofile.

Scenario: Basic access for cars
Given the speedprofile "car"
Expand Down Expand Up @@ -53,3 +53,28 @@ Feature: Oneway streets
| 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 | |

279 changes: 279 additions & 0 deletions features/distance.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
@routing @distance
Feature: Distance calculation

Scenario: Distance of a winding south-north path
Given a grid size of 10 meters
Given the nodes
| a | b |
| d | c |
| e | f |
| h | g |

And the ways
| nodes |
| abcdefg |

When I route I should get
| from | to | route | distance |
| a | b | abcdefg | 10 |
| a | c | abcdefg | 20 |
| a | d | abcdefg | 30 |
| a | e | abcdefg | 40 |
| a | f | abcdefg | 50 |
| a | g | abcdefg | 60 |
| a | h | abcdefg | 70 |

Scenario: Distance of a winding east-west path
Given a grid size of 10 meters
Given the nodes
| a | d | e | h |
| b | c | f | g |

And the ways
| nodes |
| abcdefg |

When I route I should get
| from | to | route | distance |
| a | b | abcdefg | 10 |
| a | c | abcdefg | 20 |
| a | d | abcdefg | 30 |
| a | e | abcdefg | 40 |
| a | f | abcdefg | 50 |
| a | g | abcdefg | 60 |
| a | h | abcdefg | 70 |

Scenario: Distances when traversing part of a way
Given a grid size of 100 meters
Given the nodes
| a | 0 | 1 | 2 |
| 9 | | | 3 |
| 8 | | | 4 |
| 7 | 6 | 5 | b |

And the ways
| nodes |
| ab |

When I route I should get
| from | to | route | distance |
| a | 0 | ab | 70 |
| a | 1 | ab | 140 |
| a | 2 | ab | 210 |
| a | 3 | ab | 280 |
| a | 4 | ab | 350 |
| a | b | ab | 420 |
| a | 5 | ab | 350 |
| a | 6 | ab | 280 |
| a | 7 | ab | 210 |
| a | 8 | ab | 140 |
| a | 9 | ab | 70 |
| b | 5 | ab | 70 |
| b | 6 | ab | 140 |
| b | 7 | ab | 210 |
| b | 8 | ab | 280 |
| b | 9 | ab | 350 |
| b | a | ab | 420 |
| b | 0 | ab | 350 |
| b | 1 | ab | 280 |
| b | 2 | ab | 210 |
| b | 3 | ab | 140 |
| b | 4 | ab | 70 |

Scenario: Geometric distances
Given a grid size of 1000 meters
Given the nodes
| v | w | y | a | b | c | d |
| u | | | | | | e |
| t | | | | | | f |
| s | | | x | | | g |
| r | | | | | | h |
| q | | | | | | i |
| p | o | n | m | l | k | j |

And the ways
| nodes |
| xa |
| xb |
| xc |
| xd |
| xe |
| xf |
| xg |
| xh |
| xi |
| xj |
| xk |
| xl |
| xm |
| xn |
| xo |
| xp |
| xq |
| xr |
| xs |
| xt |
| xu |
| xv |
| xw |
| xy |

When I route I should get
| from | to | route | distance |
| x | a | xa | 3000 |
| x | b | xb | 3160 |
| x | c | xc | 3600 |
| x | d | xd | 4240 |
| x | e | xe | 3600 |
| x | f | xf | 3160 |
| x | g | xg | 3000 |
| x | h | xh | 3160 |
| x | i | xi | 3600 |
| x | j | xj | 4240 |
| x | k | xk | 3600 |
| x | l | xl | 3160 |
| x | m | xm | 3000 |
| x | n | xn | 3160 |
| x | o | xo | 3600 |
| x | p | xp | 4240 |
| x | q | xq | 3600 |
| x | r | xr | 3160 |
| x | s | xs | 3000 |
| x | t | xt | 3160 |
| x | u | xu | 3600 |
| x | v | xv | 4240 |
| x | w | xw | 3600 |
| x | y | xy | 3160 |

Scenario: 1m distances
Given a grid size of 1 meters
Given the nodes
| a | b |
| | c |

And the ways
| nodes |
| abc |

When I route I should get
| from | to | route | distance |
| a | b | abc | 1 |
| b | a | abc | 1 |
| b | c | abc | 1 |
| c | b | abc | 1 |
| a | c | abc | 2 |
| c | a | abc | 2 |

Scenario: 10m distances
Given a grid size of 10 meters
Given the nodes
| a | b |
| | c |

And the ways
| nodes |
| abc |

When I route I should get
| from | to | route | distance |
| a | b | abc | 10 |
| b | a | abc | 10 |
| b | c | abc | 10 |
| c | b | abc | 10 |
| a | c | abc | 20 |
| c | a | abc | 20 |

Scenario: 100m distances
Given a grid size of 100 meters
Given the nodes
| a | b |
| | c |

And the ways
| nodes |
| abc |

When I route I should get
| from | to | route | distance |
| a | b | abc | 100 |
| b | a | abc | 100 |
| b | c | abc | 100 |
| c | b | abc | 100 |
| a | c | abc | 200 |
| c | a | abc | 200 |

Scenario: 1km distance
Given a grid size of 1000 meters
Given the nodes
| a | b |
| | c |

And the ways
| nodes |
| abc |

When I route I should get
| from | to | route | distance |
| a | b | abc | 1000 |
| b | a | abc | 1000 |
| b | c | abc | 1000 |
| c | b | abc | 1000 |
| a | c | abc | 2000 |
| c | a | abc | 2000 |

Scenario: 10km distances
Given a grid size of 10000 meters
Given the nodes
| a | b |
| | c |

And the ways
| nodes |
| abc |

When I route I should get
| from | to | route | distance |
| a | b | abc | 10000 |
| b | a | abc | 10000 |
| b | c | abc | 10000 |
| c | b | abc | 10000 |
| a | c | abc | 20000 |
| c | a | abc | 20000 |

Scenario: 100km distances
Given a grid size of 100000 meters
Given the nodes
| a | b |
| | c |

And the ways
| nodes |
| abc |

When I route I should get
| from | to | route | distance |
| a | b | abc | 100000 |
| b | a | abc | 100000 |
| b | c | abc | 100000 |
| c | b | abc | 100000 |
| a | c | abc | 200000 |
| c | a | abc | 200000 |

Scenario: 1000km distances
Given a grid size of 1000000 meters
Given the nodes
| a | b |
| | c |

And the ways
| nodes |
| abc |

When I route I should get
| from | to | route | distance |
| a | b | abc | 1000000 |
| b | a | abc | 1000000 |
| b | c | abc | 1000000 |
| c | b | abc | 1000000 |
| a | c | abc | 2000000 |
| c | a | abc | 2000000 |
22 changes: 22 additions & 0 deletions features/snap.feature
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,25 @@ Feature: Snap start/end point to the nearest way
| b | j | jkla |
| b | k | jkla |
| b | l | jkla |

Scenario: Snap to correct way at large scales
Given a grid size of 1000 meters
Given the nodes
| | | | a |
| x | | | b |
| | | | c |

And the ways
| nodes |
| xa |
| xb |
| xc |

When I route I should get
| from | to | route |
| x | a | xa |
| x | b | xb |
| x | c | xc |
| a | x | xa |
| b | x | xb |
| c | x | xc |
Loading

0 comments on commit d3bf394

Please sign in to comment.