Review fixes

This commit is contained in:
Lev Dragunov 2017-03-22 12:00:46 +03:00 committed by Patrick Niklaus
parent b95a58591d
commit 497709da13
5 changed files with 17 additions and 22 deletions

View File

@ -280,7 +280,7 @@ In addition to the [general options](#general-options) the following options are
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. | |timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.| |radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|gaps |`split` (default), `ignore` |Allows the input track splitting based on huge timestamp gaps between points. | |gaps |`split` (default), `ignore` |Allows the input track splitting based on huge timestamp gaps between points. |
|tidying |`true`, `false` (default) |Allows the input track modification to obtain better matching quality for noisy tracks. | |tidy |`true`, `false` (default) |Allows the input track modification to obtain better matching quality for noisy tracks. |
|Parameter |Values | |Parameter |Values |
|------------|-----------------------------------| |------------|-----------------------------------|

View File

@ -62,7 +62,7 @@ Feature: Basic Map Matching
Given a grid size of 100 meters Given a grid size of 100 meters
Given the query options Given the query options
| tidying | true | | tidy | true |
Given the node map Given the node map
""" """
@ -82,7 +82,7 @@ Feature: Basic Map Matching
Given a grid size of 100 meters Given a grid size of 100 meters
Given the query options Given the query options
| tidying | true | | tidy | true |
Given the node map Given the node map
""" """
@ -102,7 +102,7 @@ Feature: Basic Map Matching
Given a grid size of 8 meters Given a grid size of 8 meters
Given the query options Given the query options
| tidying | true | | tidy | true |
Given the node map Given the node map
""" """

View File

@ -63,23 +63,20 @@ struct MatchParameters : public RouteParameters
RouteParameters::GeometriesType::Polyline, RouteParameters::GeometriesType::Polyline,
RouteParameters::OverviewType::Simplified, RouteParameters::OverviewType::Simplified,
{}), {}),
gaps_processing(GapsType::Split), use_tidying(false) gaps(GapsType::Split), tidy(false)
{ {
} }
template <typename... Args> template <typename... Args>
MatchParameters(std::vector<unsigned> timestamps_, MatchParameters(std::vector<unsigned> timestamps_, GapsType gaps_, bool tidy_, Args... args_)
GapsType gaps_processing_,
bool use_tidying_,
Args... args_)
: RouteParameters{std::forward<Args>(args_)...}, timestamps{std::move(timestamps_)}, : RouteParameters{std::forward<Args>(args_)...}, timestamps{std::move(timestamps_)},
gaps_processing(gaps_processing_), use_tidying(use_tidying_) gaps(gaps_), tidy(tidy_)
{ {
} }
std::vector<unsigned> timestamps; std::vector<unsigned> timestamps;
GapsType gaps_processing; GapsType gaps;
bool use_tidying; bool tidy;
bool IsValid() const bool IsValid() const
{ {

View File

@ -38,14 +38,12 @@ struct MatchParametersGrammar final : public RouteParametersGrammar<Iterator, Si
root_rule = root_rule =
BaseGrammar::query_rule(qi::_r1) > -qi::lit(".json") > BaseGrammar::query_rule(qi::_r1) > -qi::lit(".json") >
-('?' > -('?' > (timestamps_rule(qi::_r1) | BaseGrammar::base_rule(qi::_r1) |
(timestamps_rule(qi::_r1) | BaseGrammar::base_rule(qi::_r1) | (qi::lit("gaps=") >
(qi::lit("gaps=") > gaps_type[ph::bind(&engine::api::MatchParameters::gaps, qi::_r1) = qi::_1]) |
gaps_type[ph::bind(&engine::api::MatchParameters::gaps_processing, qi::_r1) = (qi::lit("tidy=") >
qi::_1]) | qi::bool_[ph::bind(&engine::api::MatchParameters::tidy, qi::_r1) = qi::_1])) %
(qi::lit("tidying=") > qi::bool_[ph::bind(&engine::api::MatchParameters::use_tidying, '&');
qi::_r1) = qi::_1])) %
'&');
} }
private: private:

View File

@ -148,7 +148,7 @@ Status MatchPlugin::HandleRequest(const datafacade::ContiguousInternalMemoryData
SubMatchingList sub_matchings; SubMatchingList sub_matchings;
api::tidy::Result tidied; api::tidy::Result tidied;
if (parameters.use_tidying) if (parameters.tidy)
{ {
// Transparently tidy match parameters, do map matching on tidied parameters. // Transparently tidy match parameters, do map matching on tidied parameters.
// Then use the mapping to restore the original <-> tidied relationship. // Then use the mapping to restore the original <-> tidied relationship.
@ -207,7 +207,7 @@ Status MatchPlugin::HandleRequest(const datafacade::ContiguousInternalMemoryData
tidied.parameters.coordinates, tidied.parameters.coordinates,
tidied.parameters.timestamps, tidied.parameters.timestamps,
tidied.parameters.radiuses, tidied.parameters.radiuses,
parameters.gaps_processing == api::MatchParameters::GapsType::Split); parameters.gaps == api::MatchParameters::GapsType::Split);
if (sub_matchings.size() == 0) if (sub_matchings.size() == 0)
{ {