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: 95476645b44721928640437c91cae3387f04df27 (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
#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;

  double lat, lon;

  /// Does NOT initialize lat and lon. Allows to use it as a property of an ObjC class.
  LatLon() = default;
  LatLon(double lat, double lon) : lat(lat), lon(lon) {}

  static LatLon Zero() { return LatLon(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.lat, p.lon); }
  };
};

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