forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenlr_model.cpp
40 lines (33 loc) · 1 KB
/
openlr_model.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#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;
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