2017-06-27 05:14:01 -04:00
|
|
|
@contract @options @edge-weight-updates-over-factor
|
2016-09-12 12:16:56 -04:00
|
|
|
Feature: osrm-contract command line option: edge-weight-updates-over-factor
|
|
|
|
|
|
|
|
Background: Log edge weight updates over given factor
|
|
|
|
Given the node locations
|
|
|
|
| node | lat | lon |
|
|
|
|
| a | 0.1 | 0.1 |
|
2016-10-03 13:15:39 -04:00
|
|
|
| b | 0.05 | 0.1 |
|
2016-09-12 12:16:56 -04:00
|
|
|
| c | 0.3 | 0.1 |
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| ab | residential |
|
|
|
|
| ac | primary |
|
|
|
|
Given the profile "testbot"
|
|
|
|
Given the speed file
|
|
|
|
"""
|
|
|
|
1,2,100
|
|
|
|
1,3,100
|
|
|
|
"""
|
2016-09-29 17:01:52 -04:00
|
|
|
And the data has been saved to disk
|
|
|
|
|
|
|
|
Scenario: Logging weight with updates over factor of 2, long segment
|
2017-05-05 02:43:51 -04:00
|
|
|
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
2017-06-27 05:14:01 -04:00
|
|
|
And the data has been partitioned
|
2016-09-12 12:16:56 -04:00
|
|
|
When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}"
|
2017-04-11 07:06:22 -04:00
|
|
|
Then stderr should not contain "Speed values were used to update 2 segment(s)"
|
2017-03-15 19:52:01 -04:00
|
|
|
And stderr should contain "Segment: 1,2"
|
|
|
|
And stderr should contain "Segment: 1,3"
|
2016-09-12 12:16:56 -04:00
|
|
|
And I route I should get
|
|
|
|
| from | to | route | speed |
|
|
|
|
| a | b | ab,ab | 100 km/h |
|
|
|
|
| a | c | ac,ac | 100 km/h |
|
2017-04-11 07:06:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
Scenario: Logging using weigts as durations for non-duration profile
|
2017-05-18 08:27:28 -04:00
|
|
|
Given the profile file
|
2017-04-11 07:06:22 -04:00
|
|
|
"""
|
2017-05-18 08:27:28 -04:00
|
|
|
local functions = require('testbot')
|
|
|
|
functions.setup_testbot = functions.setup
|
|
|
|
|
|
|
|
functions.setup = function()
|
|
|
|
local profile = functions.setup_testbot()
|
|
|
|
profile.properties.weight_name = 'steps'
|
|
|
|
return profile
|
|
|
|
end
|
|
|
|
|
|
|
|
functions.process_way = function(profile, way, result)
|
2017-04-11 07:06:22 -04:00
|
|
|
result.forward_mode = mode.driving
|
|
|
|
result.backward_mode = mode.driving
|
|
|
|
result.weight = 1
|
|
|
|
result.duration = 1
|
|
|
|
end
|
2017-05-18 08:27:28 -04:00
|
|
|
|
|
|
|
return functions
|
2017-04-11 07:06:22 -04:00
|
|
|
"""
|
|
|
|
And the data has been saved to disk
|
|
|
|
|
2017-05-05 02:43:51 -04:00
|
|
|
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
2017-04-11 07:06:22 -04:00
|
|
|
When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}"
|
|
|
|
Then stderr should contain "Speed values were used to update 2 segments for 'steps' profile"
|