From 058bc5e8b3b0fc7dc4afded6b8ad552813466d53 Mon Sep 17 00:00:00 2001 From: Yuri Gorshenin Date: Thu, 7 Sep 2017 17:24:40 +0300 Subject: [PATCH] [openlr] Added threshold for FRC checking. --- openlr/openlr_stat/openlr_stat.cpp | 4 ++++ openlr/router.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/openlr/openlr_stat/openlr_stat.cpp b/openlr/openlr_stat/openlr_stat.cpp index b2a914da9c..9d0b924d0a 100644 --- a/openlr/openlr_stat/openlr_stat.cpp +++ b/openlr/openlr_stat/openlr_stat.cpp @@ -39,6 +39,7 @@ DEFINE_string(assessment_output, "", "Path to output file in assessment-tool ori DEFINE_string(non_matched_ids, "non-matched-ids.txt", "Path to a file ids of non-matched segments will be saved to"); DEFINE_string(mwms_path, "", "Path to a folder with mwms."); +DEFINE_string(resources_path, "", "Path to a folder with resources."); DEFINE_int32(limit, -1, "Max number of segments to handle. -1 for all."); DEFINE_bool(multipoints_only, false, "Only segments with multiple points to handle."); DEFINE_int32(num_threads, 1, "Number of threads."); @@ -214,6 +215,9 @@ int main(int argc, char * argv[]) google::SetUsageMessage("OpenLR stats tool."); google::ParseCommandLineFlags(&argc, &argv, true); + if (!FLAGS_resources_path.empty()) + GetPlatform().SetResourceDir(FLAGS_resources_path); + classificator::Load(); auto const numThreads = static_cast(FLAGS_num_threads); diff --git a/openlr/router.cpp b/openlr/router.cpp index a5ce4c442e..eb894894d5 100644 --- a/openlr/router.cpp +++ b/openlr/router.cpp @@ -22,6 +22,7 @@ namespace openlr { namespace { +int const kFRCThreshold = 2; size_t const kMaxRoadCandidates = 20; double const kDistanceAccuracyM = 1000; double const kEps = 1e-9; @@ -432,7 +433,7 @@ bool Router::PassesRestriction(routing::Edge const & edge, return true; auto const frc = m_roadInfoGetter.Get(edge.GetFeatureId()).m_frc; - return frc <= restriction; + return static_cast(frc) <= static_cast(restriction) + kFRCThreshold; } uint32_t Router::GetReverseBearing(Vertex const & u, Links const & links) const