Files
comaps/map/elevation_info.hpp
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

60 lines
1.5 KiB
C++

#pragma once
#include "kml/types.hpp"
#include "geometry/point_with_altitude.hpp"
#include "geometry/latlon.hpp"
#include "platform/location.hpp"
#include <cstdint>
#include <string>
#include <vector>
struct ElevationInfo
{
public:
struct Point
{
Point(geometry::PointWithAltitude point, double distance)
: m_point(point), m_distance(distance)
{}
const geometry::PointWithAltitude m_point;
const double m_distance;
};
using Points = std::vector<Point>;
using GpsPoints = std::vector<location::GpsInfo>;
using GeometryLine = kml::MultiGeometry::LineT;
using SegmentsDistances = std::vector<double>;
enum Difficulty : uint8_t
{
Unknown,
Easy,
Medium,
Hard
};
ElevationInfo() = default;
explicit ElevationInfo(std::vector<GeometryLine> const & lines);
void AddGpsPoints(GpsPoints const & points);
size_t GetSize() const { return m_points.size(); };
Points const & GetPoints() const { return m_points; };
uint8_t GetDifficulty() const { return m_difficulty; }
SegmentsDistances const & GetSegmentsDistances() const { return m_segmentsDistances; };
private:
// Points with distance from start of the track and altitude.
Points m_points;
// Some digital difficulty level with value in range [0-kMaxDifficulty]
// or kInvalidDifficulty when difficulty is not found or incorrect.
Difficulty m_difficulty = Difficulty::Unknown;
// Distances to the start of each segment.
SegmentsDistances m_segmentsDistances;
void AddPoints(GeometryLine const & line, bool isNewSegment = false);
};