diff options
author | Ilya Zverev <zverik@textual.ru> | 2015-09-12 16:03:10 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:05:00 +0300 |
commit | c54944d79419888debe327e4244eb1e16ad85027 (patch) | |
tree | 9a1bf26a0fc489d6efdb50ea0f11991836a7b129 /indexer | |
parent | 480a748695739a51219ad09b0adc9d7d75024647 (diff) |
[stats] type_statistics key for generator_tool, better area calculation
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/mercator.cpp | 7 | ||||
-rw-r--r-- | indexer/mercator.hpp | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/indexer/mercator.cpp b/indexer/mercator.cpp index 81ec954df9..d7a2c495d4 100644 --- a/indexer/mercator.cpp +++ b/indexer/mercator.cpp @@ -43,5 +43,10 @@ m2::PointD MercatorBounds::GetSmPoint(m2::PointD const & pt, double lonMetresR, double MercatorBounds::DistanceOnEarth(m2::PointD const & p1, m2::PointD const & p2) { - return ms::DistanceOnEarth(YToLat(p1.y), XToLon(p1.x), YToLat(p2.y), XToLon(p2.x)); + return ms::DistanceOnEarth(ToLatLon(p1), ToLatLon(p2)); +} + +double MercatorBounds::AreaOnEarth(m2::PointD const & p1, m2::PointD const & p2, m2::PointD const & p3) +{ + return ms::AreaOnEarth(ToLatLon(p1), ToLatLon(p2), ToLatLon(p3)); } diff --git a/indexer/mercator.hpp b/indexer/mercator.hpp index c24028f88d..71388e9b50 100644 --- a/indexer/mercator.hpp +++ b/indexer/mercator.hpp @@ -127,4 +127,7 @@ struct MercatorBounds /// Calculates distance on Earth by two points in mercator static double DistanceOnEarth(m2::PointD const & p1, m2::PointD const & p2); + + /// Calculates area of a triangle on Earth in m² by three points + static double AreaOnEarth(m2::PointD const & p1, m2::PointD const & p2, m2::PointD const & p3); }; |