Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Magidovich <mgsergio@mapswithme.com>2018-01-26 16:04:37 +0300
committerYuri Gorshenin <mipt.vi002@gmail.com>2018-02-09 12:19:56 +0300
commitb99673f4e6dc568ce056fa1dde50ad77c70cfae2 (patch)
treeb18452d9141bb7daa13041fcb4dd2e336351d4df
parentfd73e7d0d90150dfec788c25d100f3d1075834f2 (diff)
[OpenLR] Avoid routes with two adjacent fake edges.
-rw-r--r--openlr/candidate_paths_getter.cpp4
-rw-r--r--openlr/paths_connector.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/openlr/candidate_paths_getter.cpp b/openlr/candidate_paths_getter.cpp
index be7a952049..a61e3bb407 100644
--- a/openlr/candidate_paths_getter.cpp
+++ b/openlr/candidate_paths_getter.cpp
@@ -219,6 +219,10 @@ void CandidatePathsGetter::GetAllSuitablePaths(Graph::EdgeVector const & startLi
for (auto const & e : edges)
{
+ // Fake edges are allowed only at the start/end of the path.
+ if (e.IsFake())
+ continue;
+
if (EdgesAreAlmostEqual(e.GetReverseEdge(), currentEdge))
continue;
diff --git a/openlr/paths_connector.cpp b/openlr/paths_connector.cpp
index 0052fcaad0..57a9c46f35 100644
--- a/openlr/paths_connector.cpp
+++ b/openlr/paths_connector.cpp
@@ -196,6 +196,11 @@ bool PathsConnector::FindShortestPath(Graph::Edge const & from, Graph::Edge cons
{
// TODO(mgsergio): Use frc to filter edges.
+ // Only start and/or end of the route can be fake.
+ // Routes made only of fake edges are no used to us.
+ if (u.IsFake() && e.IsFake())
+ continue;
+
auto const it = scores.find(e);
auto const eScore = us + EdgeLength(e);
if (it == end(scores) || it->second > eScore)