New tidying and gaps parameters.

This commit is contained in:
Lev Dragunov
2017-03-20 13:30:24 +03:00
committed by Patrick Niklaus
parent 836a5066c2
commit 2fab696bb3
7 changed files with 44 additions and 41 deletions
+13 -13
View File
@@ -175,7 +175,7 @@ Status MatchPlugin::HandleRequest(const datafacade::ContiguousInternalMemoryData
}
SubMatchingList sub_matchings;
if (parameters.track_preprocessing == api::MatchParameters::PreprocessingType::Full)
if (parameters.use_tidying)
{
// Transparently tidy match parameters, do map matching on tidied parameters.
// Then use the mapping to restore the original <-> tidied relationship.
@@ -197,12 +197,12 @@ Status MatchPlugin::HandleRequest(const datafacade::ContiguousInternalMemoryData
}
// call the actual map matching
sub_matchings = algorithms.MapMatching(
candidates_lists,
tidied.parameters.coordinates,
tidied.parameters.timestamps,
tidied.parameters.radiuses,
!(parameters.track_preprocessing == api::MatchParameters::PreprocessingType::False));
sub_matchings = algorithms.MapMatching(candidates_lists,
tidied.parameters.coordinates,
tidied.parameters.timestamps,
tidied.parameters.radiuses,
parameters.gaps_processing ==
api::MatchParameters::GapsType::Split);
}
else
{
@@ -222,12 +222,12 @@ Status MatchPlugin::HandleRequest(const datafacade::ContiguousInternalMemoryData
}
// call the actual map matching
sub_matchings = algorithms.MapMatching(
candidates_lists,
parameters.coordinates,
parameters.timestamps,
parameters.radiuses,
!(parameters.track_preprocessing == api::MatchParameters::PreprocessingType::False));
sub_matchings = algorithms.MapMatching(candidates_lists,
parameters.coordinates,
parameters.timestamps,
parameters.radiuses,
parameters.gaps_processing ==
api::MatchParameters::GapsType::Split);
}
if (sub_matchings.size() == 0)
@@ -55,7 +55,7 @@ mapMatchingImpl(SearchEngineData &engine_working_data,
const std::vector<util::Coordinate> &trace_coordinates,
const std::vector<unsigned> &trace_timestamps,
const std::vector<boost::optional<double>> &trace_gps_precision,
const bool use_tidying)
const bool allow_splitting)
{
map_matching::MatchingConfidence confidence;
map_matching::EmissionLogProbability default_emission_log_probability(DEFAULT_GPS_PRECISION);
@@ -159,11 +159,7 @@ mapMatchingImpl(SearchEngineData &engine_working_data,
const bool gap_in_trace = [&]() {
// do not determine split if wasn't asked about it
if (!use_tidying)
{
return false;
}
else
if (allow_splitting)
{
// use temporal information if available to determine a split
if (use_timestamps)
@@ -176,6 +172,10 @@ mapMatchingImpl(SearchEngineData &engine_working_data,
return t - prev_unbroken_timestamps.back() > MAX_BROKEN_STATES;
}
}
else
{
return false;
}
}();
if (!gap_in_trace)