diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2011-03-28 02:08:09 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:14:26 +0300 |
commit | 3447ff9b60feccb91834f24500ea215f02604985 (patch) | |
tree | 6ecfa840ec7b8d1470e0650145be8c5b20e9265a /indexer/mercator.hpp | |
parent | b3c559d728b6c57c86017b9ae120be7e84040153 (diff) |
renamed ErrorToRadius to MetresToXY for clarity.
Diffstat (limited to 'indexer/mercator.hpp')
-rw-r--r-- | indexer/mercator.hpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/indexer/mercator.hpp b/indexer/mercator.hpp index 52659c521e..03807e6aa7 100644 --- a/indexer/mercator.hpp +++ b/indexer/mercator.hpp @@ -34,12 +34,25 @@ struct MercatorBounds static double const degreeInMetres; + inline static double ConvertMetresToY(double lat, double metresValue) + { + return LatToY(lat + metresValue * degreeInMetres) - LatToY(lat); + } + + inline static double ConvertMetresToX(double lon, double metresValue) + { + return LonToX(lon + metresValue * degreeInMetres) - LonToX(lon); + } + /// @return mercator bound points in rect - inline static m2::RectD ErrorToRadius(double lon, double lat, double errorInMetres) + inline static m2::RectD MetresToXY(double lon, double lat, double metresValue) { // We use approximate number of metres per degree - double const offset = errorInMetres / 2.0 * degreeInMetres; - return m2::RectD(LonToX(lon - offset), LatToY(lat - offset), LonToX(lon + offset), LatToY(lat + offset)); + double const degreeOffset = metresValue / 2.0 * degreeInMetres; + return m2::RectD(LonToX(lon - degreeOffset), + LatToY(lat - degreeOffset), + LonToX(lon + degreeOffset), + LatToY(lat + degreeOffset)); } static double GetCellID2PointAbsEpsilon() { return 1.0E-4; } |