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: dd9b30d8349b97ce2a01d478d43c011ad36cc5d6 (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 "std/string.hpp"

namespace ms
{

/// \brief Class for representing WGS point.
class LatLon
{
public:
  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 my::Hash(p.lat, p.lon);
    }
  };
};

string DebugPrint(LatLon const & t);

}  // namespace ms