Skip to content

Commit

Permalink
Merge pull request #154 from emiltin/update_distance_tests
Browse files Browse the repository at this point in the history
fixed two distance tests, and added another for 1000km scales
  • Loading branch information
Project OSRM committed Feb 27, 2012
2 parents 02e15bd + 5ad4992 commit f8fb79a
Showing 1 changed file with 52 additions and 29 deletions.
81 changes: 52 additions & 29 deletions features/distance.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ Feature: Distance calculation
| h | g |

And the ways
| nodes |
| abcdefg |
| nodes |
| abcdefgh |

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 |
| from | to | route | distance |
| a | b | abcdefgh | 10 |
| a | c | abcdefgh | 20 |
| a | d | abcdefgh | 30 |
| a | e | abcdefgh | 40 |
| a | f | abcdefgh | 50 |
| a | g | abcdefgh | 60 |
| a | h | abcdefgh | 70 |

Scenario: Distance of a winding east-west path
Given a grid size of 10 meters
Expand All @@ -30,18 +30,18 @@ Feature: Distance calculation
| b | c | f | g |

And the ways
| nodes |
| abcdefg |
| nodes |
| abcdefgh |

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 |
| from | to | route | distance |
| a | b | abcdefgh | 10 |
| a | c | abcdefgh | 20 |
| a | d | abcdefgh | 30 |
| a | e | abcdefgh | 40 |
| a | f | abcdefgh | 50 |
| a | g | abcdefgh | 60 |
| a | h | abcdefgh | 70 |

Scenario: Distances when traversing part of a way
Given a grid size of 100 meters
Expand Down Expand Up @@ -122,27 +122,27 @@ Feature: Distance calculation
| from | to | route | distance |
| x | a | xa | 3000 |
| x | b | xb | 3160 |
| x | c | xc | 3600 |
| x | c | xc | 3610 |
| x | d | xd | 4240 |
| x | e | xe | 3600 |
| x | e | xe | 3610 |
| x | f | xf | 3160 |
| x | g | xg | 3000 |
| x | h | xh | 3160 |
| x | i | xi | 3600 |
| x | i | xi | 3610 |
| x | j | xj | 4240 |
| x | k | xk | 3600 |
| x | k | xk | 3610 |
| x | l | xl | 3160 |
| x | m | xm | 3000 |
| x | n | xn | 3160 |
| x | o | xo | 3600 |
| x | o | xo | 3610 |
| x | p | xp | 4240 |
| x | q | xq | 3600 |
| x | q | xq | 3610 |
| x | r | xr | 3160 |
| x | s | xs | 3000 |
| x | t | xt | 3160 |
| x | u | xu | 3600 |
| x | u | xu | 3610 |
| x | v | xv | 4240 |
| x | w | xw | 3600 |
| x | w | xw | 3610 |
| x | y | xy | 3160 |

Scenario: 1m distances
Expand Down Expand Up @@ -276,4 +276,27 @@ Feature: Distance calculation
| b | c | abc | 1000000 |
| c | b | abc | 1000000 |
| a | c | abc | 2000000 |
| c | a | abc | 2000000 |
| c | a | abc | 2000000 |

@a
Scenario: Angles at 1000km scale
Given a grid size of 1000 meters
Given the nodes
| | | | b | | | |
| | | | | | | c |
| a | | | | | | |
| | | | e | | | |
| | | | | | | f |
| d | | | | | | |

And the ways
| nodes |
| ba |
| bc |
| ed |
| ef |

When I route I should get
| from | to | route | distance |
| b | c | bc | 3160 |
| e | f | ef | 3160 |

1 comment on commit f8fb79a

@emiltin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Angles at 1000km scale" fails for me, osrm returns a distance of >10000 meters

Please sign in to comment.