Files
comaps/openlr/openlr_model.cpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

42 lines
1.1 KiB
C++

#include "openlr/openlr_model.hpp"
#include "geometry/mercator.hpp"
#include "base/assert.hpp"
using namespace std;
namespace openlr
{
// LinearSegment -----------------------------------------------------------------------------------
vector<m2::PointD> LinearSegment::GetMercatorPoints() const
{
vector<m2::PointD> points;
points.reserve(m_locationReference.m_points.size());
for (auto const & point : m_locationReference.m_points)
points.push_back(mercator::FromLatLon(point.m_latLon));
return points;
}
vector<LocationReferencePoint> const & LinearSegment::GetLRPs() const
{
return m_locationReference.m_points;
}
vector<LocationReferencePoint> & LinearSegment::GetLRPs()
{
return m_locationReference.m_points;
}
string DebugPrint(LinearSegmentSource source)
{
switch (source)
{
case LinearSegmentSource::NotValid: return "NotValid";
case LinearSegmentSource::FromLocationReferenceTag: return "FromLocationReferenceTag";
case LinearSegmentSource::FromCoordinatesTag: return "FromCoordinatesTag";
}
UNREACHABLE();
}
} // namespace openlr