Time information for maximum distance in matching

This commit is contained in:
Lev Dragunov 2017-06-15 17:06:28 +03:00 committed by Patrick Niklaus
parent e3276324b9
commit dc9b4bcfec
2 changed files with 39 additions and 16 deletions

View File

@ -358,8 +358,8 @@ Feature: Basic Map Matching
| trace | matchings | alternatives |
| abcdef | abcde | 0,0,0,0,1,1 |
Scenario: Testbot - Speed greater than speed threshhold
Given a grid size of 10 meters
Scenario: Testbot - Speed greater than speed threshold
Given a grid size of 100 meters
Given the query options
| geometries | geojson |
@ -379,8 +379,8 @@ Feature: Basic Map Matching
| trace | timestamps | matchings |
| abcd | 0 1 2 3 | ab,cd |
Scenario: Testbot - Speed less than speed threshhold
Given a grid size of 10 meters
Scenario: Testbot - Speed less than speed threshold
Given a grid size of 100 meters
Given the query options
| geometries | geojson |
@ -397,6 +397,28 @@ Feature: Basic Map Matching
| trace | timestamps | matchings |
| abcd | 0 1 2 3 | abcd |
Scenario: Testbot - Huge gap in the coordinates
Given a grid size of 100 meters
Given the query options
| geometries | geojson |
| gaps | ignore |
Given the node map
"""
a b c d ---- x
|
|
y ---- z ---- efjk
"""
And the ways
| nodes | oneway |
| abcdxyzefjk | no |
When I match I should get
| trace | timestamps | matchings |
| abcdefjk | 0 1 2 3 50 51 52 53 | abcdefjk |
# Regression test 1 for issue 3176
Scenario: Testbot - multiple segments: properly expose OSM IDs
Given the query options

View File

@ -79,16 +79,6 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
}
}();
const auto max_broken_time = median_sample_time * MAX_BROKEN_STATES;
const auto max_distance_delta = [&] {
if (use_timestamps)
{
return median_sample_time * facade.GetMapMatchingMaxSpeed();
}
else
{
return MAX_DISTANCE_DELTA;
}
}();
std::vector<std::vector<double>> emission_log_probabilities(trace_coordinates.size());
if (trace_gps_precision.empty())
@ -155,13 +145,24 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
for (auto t = initial_timestamp + 1; t < candidates_list.size(); ++t)
{
const auto step_time = trace_timestamps[t] - trace_timestamps[prev_unbroken_timestamps.back()];
const auto max_distance_delta = [&] {
if (use_timestamps)
{
return step_time * facade.GetMapMatchingMaxSpeed();
}
else
{
return MAX_DISTANCE_DELTA;
}
}();
const bool gap_in_trace = [&]() {
// use temporal information if available to determine a split
// but do not determine split by timestamps if wasn't asked about it
if (use_timestamps && allow_splitting)
{
return trace_timestamps[t] - trace_timestamps[prev_unbroken_timestamps.back()] >
max_broken_time;
return step_time > max_broken_time;
}
else
{