diff options
author | Maxim Pimenov <m@maps.me> | 2018-11-26 16:44:37 +0300 |
---|---|---|
committer | Maksim Andrianov <maksimandrianov1@gmail.com> | 2018-11-26 19:11:42 +0300 |
commit | 356ac180326847a73985d69938e7baaef02882c1 (patch) | |
tree | cd81c771122a799b1c982bc28d7dd8b87d2aad4a /coding | |
parent | 9744c0c04170b07bc848611b8cca7358d3f057bb (diff) |
[coding] Removed the CellId epsilon.
In was used as eps in meters in some cases and eps in mercator in others.
Its value was hard to justify and so were its use cases. We're better off
with less epsilons for now.
Also renamed Metres to Meters in the mercator code.
Diffstat (limited to 'coding')
-rw-r--r-- | coding/coding_tests/geometry_serialization_test.cpp | 4 | ||||
-rw-r--r-- | coding/coding_tests/point_coding_tests.cpp | 2 | ||||
-rw-r--r-- | coding/point_coding.hpp | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/coding/coding_tests/geometry_serialization_test.cpp b/coding/coding_tests/geometry_serialization_test.cpp index 25937556b7..05e592e7f1 100644 --- a/coding/coding_tests/geometry_serialization_test.cpp +++ b/coding/coding_tests/geometry_serialization_test.cpp @@ -19,12 +19,12 @@ namespace { bool IsEqual(double d1, double d2) { - return base::AlmostEqualAbs(d1, d2, kCellIdToPointEps); + return base::AlmostEqualAbs(d1, d2, kMwmPointAccuracy); } bool IsEqual(m2::PointD const & p1, m2::PointD const & p2) { - return p1.EqualDxDy(p2, kCellIdToPointEps); + return p1.EqualDxDy(p2, kMwmPointAccuracy); } bool IsEqual(m2::RectD const & r1, m2::RectD const & r2) diff --git a/coding/coding_tests/point_coding_tests.cpp b/coding/coding_tests/point_coding_tests.cpp index 03dc73f63d..24f4ba3a7e 100644 --- a/coding/coding_tests/point_coding_tests.cpp +++ b/coding/coding_tests/point_coding_tests.cpp @@ -14,7 +14,7 @@ using namespace std; namespace { -double const kEps = kCellIdToPointEps; +double const kEps = kMwmPointAccuracy; uint8_t const kCoordBits = kPointCoordBits; uint32_t const kBig = uint32_t{1} << 30; diff --git a/coding/point_coding.hpp b/coding/point_coding.hpp index 6d0226569e..b1209497de 100644 --- a/coding/point_coding.hpp +++ b/coding/point_coding.hpp @@ -36,9 +36,6 @@ uint8_t constexpr kFeatureSorterPointCoordBits = 27; // todo(@m) Clarify how kPointCoordBits and kFeatureSorterPointCoordBits are related. double constexpr kMwmPointAccuracy = 1e-5; -// todo(@m) Explain this constant. -double constexpr kCellIdToPointEps = 1e-4; - uint32_t DoubleToUint32(double x, double min, double max, uint8_t coordBits); double Uint32ToDouble(uint32_t x, double min, double max, uint8_t coordBits); |