Time information for maximum distance in matching
This commit is contained in:
parent
e3276324b9
commit
dc9b4bcfec
@ -358,8 +358,8 @@ Feature: Basic Map Matching
|
|||||||
| trace | matchings | alternatives |
|
| trace | matchings | alternatives |
|
||||||
| abcdef | abcde | 0,0,0,0,1,1 |
|
| abcdef | abcde | 0,0,0,0,1,1 |
|
||||||
|
|
||||||
Scenario: Testbot - Speed greater than speed threshhold
|
Scenario: Testbot - Speed greater than speed threshold
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 100 meters
|
||||||
Given the query options
|
Given the query options
|
||||||
| geometries | geojson |
|
| geometries | geojson |
|
||||||
|
|
||||||
@ -379,8 +379,8 @@ Feature: Basic Map Matching
|
|||||||
| trace | timestamps | matchings |
|
| trace | timestamps | matchings |
|
||||||
| abcd | 0 1 2 3 | ab,cd |
|
| abcd | 0 1 2 3 | ab,cd |
|
||||||
|
|
||||||
Scenario: Testbot - Speed less than speed threshhold
|
Scenario: Testbot - Speed less than speed threshold
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 100 meters
|
||||||
Given the query options
|
Given the query options
|
||||||
| geometries | geojson |
|
| geometries | geojson |
|
||||||
|
|
||||||
@ -397,6 +397,28 @@ Feature: Basic Map Matching
|
|||||||
| trace | timestamps | matchings |
|
| trace | timestamps | matchings |
|
||||||
| abcd | 0 1 2 3 | abcd |
|
| 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
|
# Regression test 1 for issue 3176
|
||||||
Scenario: Testbot - multiple segments: properly expose OSM IDs
|
Scenario: Testbot - multiple segments: properly expose OSM IDs
|
||||||
Given the query options
|
Given the query options
|
||||||
|
@ -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_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());
|
std::vector<std::vector<double>> emission_log_probabilities(trace_coordinates.size());
|
||||||
if (trace_gps_precision.empty())
|
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)
|
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 = [&]() {
|
const bool gap_in_trace = [&]() {
|
||||||
// use temporal information if available to determine a split
|
// use temporal information if available to determine a split
|
||||||
// but do not determine split by timestamps if wasn't asked about it
|
// but do not determine split by timestamps if wasn't asked about it
|
||||||
if (use_timestamps && allow_splitting)
|
if (use_timestamps && allow_splitting)
|
||||||
{
|
{
|
||||||
return trace_timestamps[t] - trace_timestamps[prev_unbroken_timestamps.back()] >
|
return step_time > max_broken_time;
|
||||||
max_broken_time;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user