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

Method GetLineCandidates

tools/openlr/score_candidate_paths_getter.cpp:277–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void ScoreCandidatePathsGetter::GetLineCandidates(openlr::LocationReferencePoint const & p, LinearSegmentSource source,
278 bool isLastPoint, double distanceToNextPointM,
279 ScoreEdgeVec const & edgeCandidates, ScorePathVec & candidates)
280{
281 double constexpr kDefaultBearDistM = 25.0;
282 double const bearDistM = min(kDefaultBearDistM, distanceToNextPointM);
283
284 ScoreEdgeVec const & startLines = edgeCandidates;
285 LOG(LDEBUG, ("Listing start lines:"));
286 for (auto const & e : startLines)
287 LOG(LDEBUG, (LogAs2GisPath(e.m_edge)));
288
289 auto const startPoint = mercator::FromLatLon(p.m_latLon);
290
291 vector<shared_ptr<Link>> allPaths;
292 GetAllSuitablePaths(startLines, source, isLastPoint, bearDistM, p.m_functionalRoadClass, p.m_formOfWay,
293 distanceToNextPointM, allPaths);
294
295 GetBestCandidatePaths(allPaths, source, isLastPoint, p.m_bearing, bearDistM, startPoint, candidates);
296 // Sorting by increasing order.
297 sort(candidates.begin(), candidates.end(),
298 [](ScorePath const & s1, ScorePath const & s2) { return s1.m_score > s2.m_score; });
299 LOG(LDEBUG, (candidates.size(), "Candidate paths found for point:", p.m_latLon));
300}
301
302bool ScoreCandidatePathsGetter::GetBearingScore(BearingPointsSelector const & pointsSelector,
303 ScoreCandidatePathsGetter::Link const & part,

Callers

nothing calls this directly

Calls 5

LogAs2GisPathFunction · 0.85
FromLatLonFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected