mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
# Conflicts: # CMakeLists.txt # android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java # android/sdk/src/main/cpp/app/organicmaps/sdk/Framework.hpp # android/sdk/src/main/cpp/app/organicmaps/sdk/OrganicMaps.cpp # android/sdk/src/main/cpp/app/organicmaps/sdk/util/Config.cpp # libs/indexer/data_source.hpp # libs/indexer/feature.hpp # libs/indexer/ftypes_matcher.hpp # libs/map/framework.cpp # libs/map/traffic_manager.cpp # libs/routing/absent_regions_finder.cpp # libs/routing/edge_estimator.hpp # libs/routing/index_router.cpp # libs/routing/index_router.hpp # libs/routing/routing_session.hpp # libs/routing_common/num_mwm_id.hpp # libs/traffic/traffic_info.cpp # qt/mainwindow.hpp # qt/preferences_dialog.cpp # tools/openlr/helpers.hpp # tools/openlr/openlr_decoder.cpp # tools/openlr/openlr_decoder.hpp # tools/openlr/openlr_stat/openlr_stat.cpp # tools/openlr/router.hpp # tools/openlr/score_candidate_paths_getter.cpp # tools/openlr/score_candidate_paths_getter.hpp # xcode/CoMaps.xcworkspace/contents.xcworkspacedata
59 lines
1.6 KiB
C++
59 lines
1.6 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();
|
|
}
|
|
|
|
string DebugPrint(FunctionalRoadClass frc)
|
|
{
|
|
switch (frc)
|
|
{
|
|
case FunctionalRoadClass::FRC0: return "FRC0";
|
|
case FunctionalRoadClass::FRC1: return "FRC1";
|
|
case FunctionalRoadClass::FRC2: return "FRC2";
|
|
case FunctionalRoadClass::FRC3: return "FRC3";
|
|
case FunctionalRoadClass::FRC4: return "FRC4";
|
|
case FunctionalRoadClass::FRC5: return "FRC5";
|
|
case FunctionalRoadClass::FRC6: return "FRC6";
|
|
case FunctionalRoadClass::FRC7: return "FRC7";
|
|
case FunctionalRoadClass::NotAValue: return "NotAValue";
|
|
}
|
|
UNREACHABLE();
|
|
}
|
|
} // namespace openlr
|