From 356ac180326847a73985d69938e7baaef02882c1 Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Mon, 26 Nov 2018 16:44:37 +0300 Subject: [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. --- map/address_finder.cpp | 4 ++-- map/extrapolation_benchmark/extrapolation_benchmark.cpp | 2 +- map/framework.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'map') diff --git a/map/address_finder.cpp b/map/address_finder.cpp index ce3e0c88ae..353406e217 100644 --- a/map/address_finder.cpp +++ b/map/address_finder.cpp @@ -99,7 +99,7 @@ namespace if (!types.Has(m_coastType) && NeedProcess(types)) { // Convert from meters to degrees for backward compatibility. - double const d = feature::GetMinDistanceMeters(f, m_pt, m_scale) * MercatorBounds::degreeInMetres; + double const d = feature::GetMinDistanceMeters(f, m_pt, m_scale) * MercatorBounds::degreeInMeters; ASSERT_GREATER_OR_EQUAL(d, 0.0, ()); if (IsInclude(d, types)) @@ -308,7 +308,7 @@ namespace virtual double GetResultDistance(double d, feature::TypesHolder const & types) const { - return (d + GetCompareEpsilonImpl(types.GetGeoType(), 5.0 * MercatorBounds::degreeInMetres)); + return (d + GetCompareEpsilonImpl(types.GetGeoType(), 5.0 * MercatorBounds::degreeInMeters)); } virtual double NeedProcess(feature::TypesHolder const & types) const diff --git a/map/extrapolation_benchmark/extrapolation_benchmark.cpp b/map/extrapolation_benchmark/extrapolation_benchmark.cpp index cb7df04734..286b44b2bf 100644 --- a/map/extrapolation_benchmark/extrapolation_benchmark.cpp +++ b/map/extrapolation_benchmark/extrapolation_benchmark.cpp @@ -269,7 +269,7 @@ int main(int argc, char * argv[]) double const kHalfSquareSide = 100.0; // |kHalfSquareSide| is chosen based on maximum value of GpsInfo::m_horizontalAccuracy // which is used calculation of projection in production code. - m2::RectD const posSquare = MercatorBounds::MetresToXY( + m2::RectD const posSquare = MercatorBounds::MetersToXY( extrapolated.m_longitude, extrapolated.m_latitude, kHalfSquareSide); // One is deducted from polyline size because in GetClosestProjectionInInterval() // is used segment indices but not point indices. diff --git a/map/framework.cpp b/map/framework.cpp index 1279d60c9b..71b74ccabd 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2478,7 +2478,7 @@ void Framework::PredictLocation(double & lat, double & lon, double accuracy, double offsetInM = speed * elapsedSeconds; double angle = base::DegToRad(90.0 - bearing); - m2::PointD mercatorPt = MercatorBounds::MetresToXY(lon, lat, accuracy).Center(); + m2::PointD mercatorPt = MercatorBounds::MetersToXY(lon, lat, accuracy).Center(); mercatorPt = MercatorBounds::GetSmPoint(mercatorPt, offsetInM * cos(angle), offsetInM * sin(angle)); lon = MercatorBounds::XToLon(mercatorPt.x); lat = MercatorBounds::YToLat(mercatorPt.y); -- cgit v1.2.3