diff --git a/data/WorldCoasts_obsolete.mwm b/data/WorldCoasts_obsolete.mwm deleted file mode 100644 index 5e14ccfb5f..0000000000 Binary files a/data/WorldCoasts_obsolete.mwm and /dev/null differ diff --git a/routing/index_graph.cpp b/routing/index_graph.cpp index 77bf1fc0c4..856a13d1c4 100644 --- a/routing/index_graph.cpp +++ b/routing/index_graph.cpp @@ -25,6 +25,13 @@ m2::PointD const & IndexGraph::GetPoint(Joint::Id jointId) return m_geometry.GetPoint(m_jointIndex.GetPoint(jointId)); } +m2::PointD const & IndexGraph::GetPoint(RoadPoint const & rp) +{ + RoadGeometry const & road = GetGeometry().GetRoad(rp.GetFeatureId()); + CHECK_LESS(rp.GetPointId(), road.GetPointsCount(), ()); + return road.GetPoint(rp.GetPointId()); +} + void IndexGraph::Build(uint32_t numJoints) { m_jointIndex.Build(m_roadIndex, numJoints); } void IndexGraph::Import(vector const & joints) diff --git a/routing/index_graph.hpp b/routing/index_graph.hpp index 10691cf39f..fa5430af06 100644 --- a/routing/index_graph.hpp +++ b/routing/index_graph.hpp @@ -45,6 +45,7 @@ public: void GetEdgeList(Joint::Id jointId, bool isOutgoing, vector & edges); Joint::Id GetJointId(RoadPoint const & rp) const { return m_roadIndex.GetJointId(rp); } m2::PointD const & GetPoint(Joint::Id jointId); + m2::PointD const & GetPoint(RoadPoint const & rp); Geometry & GetGeometry() { return m_geometry; } EdgeEstimator const & GetEstimator() const { return *m_estimator; } diff --git a/routing/index_graph_starter.cpp b/routing/index_graph_starter.cpp index 268c73fb3b..9e480c6821 100644 --- a/routing/index_graph_starter.cpp +++ b/routing/index_graph_starter.cpp @@ -29,6 +29,11 @@ m2::PointD const & IndexGraphStarter::GetPoint(Joint::Id jointId) return m_graph.GetPoint(jointId); } +m2::PointD const & IndexGraphStarter::GetPoint(RoadPoint const & rp) +{ + return m_graph.GetPoint(rp); +} + void IndexGraphStarter::RedressRoute(vector const & route, vector & routePoints) { diff --git a/routing/index_graph_starter.hpp b/routing/index_graph_starter.hpp index 9dbd8808e1..f6f22f8a23 100644 --- a/routing/index_graph_starter.hpp +++ b/routing/index_graph_starter.hpp @@ -29,6 +29,7 @@ public: Joint::Id GetFinishJoint() const { return m_finish.m_jointId; } m2::PointD const & GetPoint(Joint::Id jointId); + m2::PointD const & GetPoint(RoadPoint const & rp); void GetOutgoingEdgesList(Joint::Id jointId, vector & edges) { diff --git a/routing/single_mwm_router.cpp b/routing/single_mwm_router.cpp index 3a8b1d46bb..6cec88940a 100644 --- a/routing/single_mwm_router.cpp +++ b/routing/single_mwm_router.cpp @@ -208,11 +208,10 @@ bool SingleMwmRouter::BuildRoute(MwmSet::MwmId const & mwmId, vector vector junctions; junctions.reserve(routePoints.size()); - Geometry & geometry = starter.GetGraph().GetGeometry(); // TODO: Use real altitudes for pedestrian and bicycle routing. for (RoutePoint const & routePoint : routePoints) { - junctions.emplace_back(geometry.GetPoint(routePoint.GetRoadPoint()), + junctions.emplace_back(starter.GetPoint(routePoint.GetRoadPoint()), feature::kDefaultAltitudeMeters); }