Files
comaps/track_analyzing/track.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

56 lines
1.5 KiB
C++

#pragma once
#include "routing/segment.hpp"
#include "routing_common/num_mwm_id.hpp"
#include "coding/traffic.hpp"
#include <string>
#include <unordered_map>
#include <vector>
namespace track_analyzing
{
using DataPoint = coding::TrafficGPSEncoder::DataPoint;
using Track = std::vector<DataPoint>;
using UserToTrack = std::unordered_map<std::string, Track>;
using MwmToTracks = std::unordered_map<routing::NumMwmId, UserToTrack>;
class MatchedTrackPoint final
{
public:
MatchedTrackPoint(DataPoint const & dataPoint, routing::Segment const & segment)
: m_dataPoint(dataPoint), m_segment(segment)
{
}
DataPoint const & GetDataPoint() const { return m_dataPoint; }
routing::Segment const & GetSegment() const { return m_segment; }
private:
DataPoint const m_dataPoint;
routing::Segment const m_segment;
};
using MatchedTrack = std::vector<MatchedTrackPoint>;
using UserToMatchedTracks = std::unordered_map<std::string, std::vector<MatchedTrack>>;
using MwmToMatchedTracks = std::unordered_map<routing::NumMwmId, UserToMatchedTracks>;
class TrackFilter final
{
public:
TrackFilter(uint64_t minDuration, double minLength, double minSpeed, double maxSpeed,
bool ignoreTraffic);
bool Passes(uint64_t duration, double length, double speed, bool hasTrafficPoints) const;
private:
uint64_t const m_minDuration;
double const m_minLength;
double const m_minSpeed;
double const m_maxSpeed;
bool const m_ignoreTraffic;
};
} // namespace track_analyzing