MCPcopy Create free account
hub / github.com/comaps/comaps / ReconstructRoute

Function ReconstructRoute

libs/routing/routing_helpers.cpp:58–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void ReconstructRoute(DirectionsEngine & engine, IndexRoadGraph const & graph, base::Cancellable const & cancellable,
59 vector<geometry::PointWithAltitude> const & path, vector<double> const & times, Route & route)
60{
61 if (path.empty())
62 {
63 LOG(LERROR, ("Can't reconstruct route from an empty list of positions."));
64 return;
65 }
66
67 CHECK_EQUAL(path.size(), times.size() + 1, ());
68
69 vector<RouteSegment> routeSegments;
70 if (!engine.Generate(graph, path, cancellable, routeSegments))
71 return;
72
73 if (cancellable.IsCancelled())
74 return;
75
76 FillSegmentInfo(times, routeSegments);
77 route.SetRouteSegments(std::move(routeSegments));
78
79 vector<m2::PointD> routeGeometry;
80 JunctionsToPoints(path, routeGeometry);
81
82 route.SetGeometry(routeGeometry.begin(), routeGeometry.end());
83
84 LOG(LDEBUG, (route.DebugPrintTurns()));
85}
86
87Segment ConvertEdgeToSegment(NumMwmIds const & numMwmIds, Edge const & edge)
88{

Callers 1

RedressRouteMethod · 0.85

Calls 11

FillSegmentInfoFunction · 0.85
JunctionsToPointsFunction · 0.85
GenerateMethod · 0.80
SetRouteSegmentsMethod · 0.80
DebugPrintTurnsMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
IsCancelledMethod · 0.45
SetGeometryMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected