2014-10-09 08:30:06 -04:00
|
|
|
@routing @projection @testbot
|
2013-10-02 07:43:07 -04:00
|
|
|
Feature: Projection to nearest point on road
|
2014-03-27 16:46:53 -04:00
|
|
|
# Waypoints are projected perpendiculary onto the closest road
|
2013-10-02 07:43:07 -04:00
|
|
|
|
|
|
|
Background:
|
2014-03-27 16:46:53 -04:00
|
|
|
# The coordinas below was calculated using http://www.movable-type.co.uk/scripts/latlong.html
|
|
|
|
# The nodes are placed as follows, with ab, bc and bd all being 1 km in length each:
|
|
|
|
# | | | c |
|
|
|
|
# | | b | | (this is sketch only, real data is in the table below)
|
|
|
|
# | a | | d |
|
2013-10-02 07:53:09 -04:00
|
|
|
|
2013-10-02 07:43:07 -04:00
|
|
|
Given the profile "testbot"
|
|
|
|
Given the node locations
|
2017-01-17 11:17:47 -05:00
|
|
|
| node | lat | lon |
|
|
|
|
| a | 80.000000 | 0.0000000 |
|
|
|
|
| b | 80.006350 | 0.0366666 |
|
|
|
|
| c | 80.012730 | 0.0733333 |
|
|
|
|
| d | 80.000000 | 0.0733333 |
|
2013-10-02 07:43:07 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abc |
|
|
|
|
|
|
|
|
Scenario: Projection onto way at high latitudes, 1km distance
|
|
|
|
When I route I should get
|
2017-01-17 11:17:47 -05:00
|
|
|
| from | to | route | bearing | distance |
|
|
|
|
| b | a | abc,abc | 0->225,225->0 | 1000m |
|
|
|
|
| b | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
|
|
|
|
| a | d | abc,abc | 0->45,45->0 | 1000m |
|
|
|
|
| d | a | abc,abc | 0->225,225->0 | 1000m |
|
|
|
|
| c | d | abc,abc | 0->225,225->0 | 1000m +- 3 |
|
|
|
|
| d | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
|
2013-10-02 07:43:07 -04:00
|
|
|
|
2013-12-16 11:36:36 -05:00
|
|
|
Scenario: Projection onto way at high latitudes, no distance
|
2013-10-02 07:43:07 -04:00
|
|
|
When I route I should get
|
2016-04-01 05:39:47 -04:00
|
|
|
| from | to | route | distance |
|
2017-01-17 11:17:47 -05:00
|
|
|
| d | b | abc,abc | 0m |
|
|
|
|
| b | d | abc,abc | 0m |
|