diff --git a/routing/nearest_edge_finder.cpp b/routing/nearest_edge_finder.cpp index d7c9c76d7f..637abc395e 100644 --- a/routing/nearest_edge_finder.cpp +++ b/routing/nearest_edge_finder.cpp @@ -41,12 +41,10 @@ void NearestEdgeFinder::AddInformationSource(FeatureID const & featureId, IRoadG // to segment [res.m_segStart.GetPoint(), res.m_segEnd.GetPoint()]. // It's necessary to calculate exact value of res.m_projPoint.GetAltitude() by this // information. - bool const isAltitude = res.m_segStart.GetAltitude() != feature::kInvalidAltitude && - res.m_segEnd.GetAltitude() != feature::kInvalidAltitude; + ASSERT_NOT_EQUAL(res.m_segStart.GetAltitude() , feature::kInvalidAltitude, ()); + ASSERT_NOT_EQUAL(res.m_segEnd.GetAltitude(), feature::kInvalidAltitude, ()); feature::TAltitude const projPointAlt = - isAltitude ? static_cast( - (res.m_segStart.GetAltitude() + res.m_segEnd.GetAltitude()) / 2) - : feature::kInvalidAltitude; + static_cast((res.m_segStart.GetAltitude() + res.m_segEnd.GetAltitude()) / 2); res.m_projPoint = Junction(pt, projPointAlt); } } diff --git a/routing/road_graph.cpp b/routing/road_graph.cpp index 58864fa80e..52a66857e5 100644 --- a/routing/road_graph.cpp +++ b/routing/road_graph.cpp @@ -66,7 +66,7 @@ void ReverseEdges(size_t beginIdx, IRoadGraph::TEdgeVector & edges) // Junction -------------------------------------------------------------------- -Junction::Junction() : m_point(m2::PointD::Zero()), m_altitude(feature::kInvalidAltitude) {} +Junction::Junction() : m_point(m2::PointD::Zero()), m_altitude(feature::kDefautlAltitudeMeters) {} Junction::Junction(m2::PointD const & point, feature::TAltitude altitude) : m_point(point), m_altitude(altitude) {} diff --git a/routing/road_graph.hpp b/routing/road_graph.hpp index f11056cbac..2f00733633 100644 --- a/routing/road_graph.hpp +++ b/routing/road_graph.hpp @@ -39,7 +39,7 @@ private: inline Junction MakeJunctionForTesting(m2::PointD const & point) { - return Junction(point, feature::kInvalidAltitude); + return Junction(point, feature::kDefautlAltitudeMeters); } inline bool AlmostEqualAbs(Junction const & lhs, Junction const & rhs)