osrm-backend/features/car/weight.feature

87 lines
2.6 KiB
Gherkin
Raw Permalink Normal View History

2017-02-03 04:37:05 -05:00
@routing @car @weight
Feature: Car - weights
Scenario: Only routes down service road when that's the destination
2017-05-18 08:27:28 -04:00
Given the profile "car"
And the node map
2017-02-03 04:37:05 -05:00
"""
a--b--c
2017-11-03 13:31:22 -04:00
| |
d |
| |
2017-02-03 04:37:05 -05:00
e--f--g
"""
And the ways
| nodes | highway |
| abc | residential |
| efg | residential |
| cg | tertiary |
| bdf | service |
When I route I should get
| from | to | route | speed | weight |
2017-11-03 13:31:22 -04:00
| a | e | abc,cg,efg,efg | 29 km/h | 122.4 |
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
2017-02-03 04:37:05 -05:00
Scenario: Does not jump off the highway to go down service road
2017-05-18 08:27:28 -04:00
Given the profile "car"
And the node map
2017-02-03 04:37:05 -05:00
"""
a
|
b
|\
| e
|/
c
|
d
"""
And the nodes
| node | id |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
| e | 5 |
2017-02-03 04:37:05 -05:00
And the ways
| nodes | highway | oneway |
| ab | primary | yes |
| bc | primary | yes |
| cd | primary | yes |
| be | service | yes |
| ec | service | yes |
2017-02-03 04:37:05 -05:00
And the contract extra arguments "--segment-speed-file {speeds_file}"
2017-03-14 10:39:59 -04:00
And the customize extra arguments "--segment-speed-file {speeds_file}"
2017-02-03 04:37:05 -05:00
And the speed file
"""
2,5,8
2017-02-03 04:37:05 -05:00
"""
When I route I should get
| from | to | route | speed | weight |
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
2017-11-03 13:31:22 -04:00
| a | e | ab,be,be | 14 km/h | 111.8 |
Scenario: Distance weights
2017-05-18 08:27:28 -04:00
Given the profile file "car" initialized with
"""
2017-05-18 08:27:28 -04:00
profile.properties.weight_name = 'distance'
"""
Given the node map
"""
a---b---c
|
d
"""
And the ways
| nodes |
| abc |
| bd |
When I route I should get
| waypoints | bearings | route | distance | weights | times |
| a,b | 90 90 | abc,abc | 200m | 200,0 | 11.1s,0s |
| b,c | 90 90 | abc,abc | 200m | 200,0 | 11.1s,0s |
| a,d | 90 180 | abc,bd,bd | 400m | 200,200,0 | 13.2s,11.1s,0s |