mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
committed by
Konstantin Pastbin
parent
c9cbb64f12
commit
76ffc99abd
41
tools/openlr/openlr_model.cpp
Normal file
41
tools/openlr/openlr_model.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user