Welcome to mirror list, hosted at ThFree Co, Russian Federation.

latlon.hpp « geometry - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e1f5cf8f0071fd595099a64692e407f2379eba3b (plain)
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
#pragma once

#include "base/math.hpp"

#include <string>

namespace ms
{
/// \brief Class for representing WGS point.
class LatLon
{
public:
  static double const kMinLat;
  static double const kMaxLat;
  static double const kMinLon;
  static double const kMaxLon;
  static LatLon const kInvalidValue;

  double m_lat = kInvalidValue.m_lat;
  double m_lon = kInvalidValue.m_lon;

  LatLon() = default;
  LatLon(double lat, double lon) : m_lat(lat), m_lon(lon) {}

  static LatLon Zero() { return LatLon(0.0, 0.0); }

  bool operator==(ms::LatLon const & p) const;

  bool EqualDxDy(LatLon const & p, double eps) const;

  struct Hash
  {
    size_t operator()(ms::LatLon const & p) const { return base::Hash(p.m_lat, p.m_lon); }
  };
};

std::string DebugPrint(LatLon const & t);
}  // namespace ms