From dbf253c9d147193b6d510cc1fb515de07320029e Mon Sep 17 00:00:00 2001 From: mvglasow Date: Thu, 8 May 2025 22:39:47 +0300 Subject: [PATCH] [openlr] Always evaluate FRC and FOW, regardless of LinearSegment source Signed-off-by: mvglasow --- openlr/helpers.cpp | 2 +- openlr/score_candidate_paths_getter.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openlr/helpers.cpp b/openlr/helpers.cpp index 40a8150de..6c1c479d3 100644 --- a/openlr/helpers.cpp +++ b/openlr/helpers.cpp @@ -41,7 +41,7 @@ optional GetFrcScore(Graph::Edge const & e, FunctionalRoadClass functiona Score constexpr kMaxScoreForFrc = 25; if (functionalRoadClass == FunctionalRoadClass::NotAValue) - return nullopt; + return optional(0); auto const hwClass = infoGetter.Get(e.GetFeatureId()).m_hwClass; diff --git a/openlr/score_candidate_paths_getter.cpp b/openlr/score_candidate_paths_getter.cpp index 92985a341..368d8c39a 100644 --- a/openlr/score_candidate_paths_getter.cpp +++ b/openlr/score_candidate_paths_getter.cpp @@ -147,8 +147,7 @@ void ScoreCandidatePathsGetter::GetAllSuitablePaths(ScoreEdgeVec const & startLi for (auto const & e : startLines) { Score roadScore = 0; // Score based on functional road class and form of way. - if (source == LinearSegmentSource::FromLocationReferenceTag && - !PassesRestrictionV3(e.m_edge, functionalRoadClass, formOfWay, m_infoGetter, roadScore)) + if (!PassesRestrictionV3(e.m_edge, functionalRoadClass, formOfWay, m_infoGetter, roadScore)) { continue; } @@ -203,8 +202,7 @@ void ScoreCandidatePathsGetter::GetAllSuitablePaths(ScoreEdgeVec const & startLi CHECK(currentEdge.HasRealPart(), ()); Score roadScore = 0; - if (source == LinearSegmentSource::FromLocationReferenceTag && - !PassesRestrictionV3(e, functionalRoadClass, formOfWay, m_infoGetter, roadScore)) + if (!PassesRestrictionV3(e, functionalRoadClass, formOfWay, m_infoGetter, roadScore)) { continue; }