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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLev Dragunov <l.dragunov@corp.mail.ru>2015-10-27 16:25:30 +0300
committerLev Dragunov <l.dragunov@corp.mail.ru>2015-10-27 16:25:30 +0300
commit17f7099da64a8e0a891dbcbfc516218deecbef86 (patch)
tree12dd3273f5400c670f0b7f01906e5f70fc31cf9d /geometry
parentba3db415505896e05a45c0daa6a0fef1678c9a86 (diff)
Using LatLon for WGS coordinates in cross routing.
Diffstat (limited to 'geometry')
-rw-r--r--geometry/latlon.hpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/geometry/latlon.hpp b/geometry/latlon.hpp
index d5512993f6..4d5d105c29 100644
--- a/geometry/latlon.hpp
+++ b/geometry/latlon.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "base/math.hpp"
+
#include "std/string.hpp"
namespace ms
@@ -9,8 +11,29 @@ namespace ms
class LatLon
{
public:
- LatLon(double lat, double lon) : lat(lat), lon(lon) {}
double lat, lon;
+
+ LatLon(double lat, double lon) : lat(lat), lon(lon) {}
+
+ static LatLon Zero() { return LatLon(0., 0.); }
+
+ bool operator == (ms::LatLon const & p) const
+ {
+ return lat == p.lat && lon == p.lon;
+ }
+
+ bool EqualDxDy(LatLon const & p, double eps) const
+ {
+ return ((fabs(lat - p.lat) < eps) && (fabs(lon - p.lon) < eps));
+ }
+
+ struct Hash
+ {
+ size_t operator()(ms::LatLon const & p) const
+ {
+ return my::Hash(p.lat, p.lon);
+ }
+ };
};
string DebugPrint(LatLon const & t);