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

latlon.cpp « geometry - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 70888d413ad46d1dc10a1d936fcd39cb0d4a4653 (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
#include "latlon.hpp"

#include <sstream>

namespace ms
{
// static
double const LatLon::kMinLat = -90.0;
double const LatLon::kMaxLat = 90.0;
double const LatLon::kMinLon = -180.0;
double const LatLon::kMaxLon = 180.0;

// Note. LatLon(-180.0, -180.0) are invalid coordinates that are used in statistics.
// So if you want to change the value you should change the code of processing the statistics.
LatLon const LatLon::kInvalidValue = LatLon(-180.0, -180.0);

bool LatLon::operator==(ms::LatLon const & p) const { return m_lat == p.m_lat && m_lon == p.m_lon; }

bool LatLon::EqualDxDy(LatLon const & p, double eps) const
{
  return (base::AlmostEqualAbs(m_lat, p.m_lat, eps) && base::AlmostEqualAbs(m_lon, p.m_lon, eps));
}

std::string DebugPrint(LatLon const & t)
{
  std::ostringstream out;
  out.precision(20);
  out << "ms::LatLon(" << t.m_lat << ", " << t.m_lon << ")";
  return out.str();
}
}  // namespace ms