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

Function ValidatePath

tools/openlr/paths_connector.cpp:19–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17namespace
18{
19bool ValidatePath(Graph::EdgeVector const & path, double const distanceToNextPoint, double const pathLengthTolerance)
20{
21 double pathLen = 0.0;
22 for (auto const & e : path)
23 pathLen += EdgeLength(e);
24
25 double pathDiffPercent =
26 AbsDifference(static_cast<double>(distanceToNextPoint), pathLen) / static_cast<double>(distanceToNextPoint);
27
28 LOG(LDEBUG, ("Validating path:", LogAs2GisPath(path)));
29
30 if (pathDiffPercent > pathLengthTolerance)
31 {
32 LOG(LDEBUG, ("Shortest path doest not meet required length constraints, error:", pathDiffPercent));
33 return false;
34 }
35
36 return true;
37}
38} // namespace
39
40PathsConnector::PathsConnector(double pathLengthTolerance, Graph & graph, RoadInfoGetter & infoGetter, v2::Stats & stat)

Callers 1

ConnectCandidatesMethod · 0.85

Calls 3

EdgeLengthFunction · 0.85
AbsDifferenceFunction · 0.85
LogAs2GisPathFunction · 0.85

Tested by

no test coverage detected