diff --git a/tracking/reporter.cpp b/tracking/reporter.cpp index 8e2b9a9991..b161b4e3d6 100644 --- a/tracking/reporter.cpp +++ b/tracking/reporter.cpp @@ -12,6 +12,7 @@ namespace { +double constexpr kRequiredHorizontalAccuracy = 10.0; double constexpr kMinDelaySeconds = 1.0; double constexpr kReconnectDelaySeconds = 60.0; size_t constexpr kRealTimeBufferSize = 60; @@ -56,6 +57,9 @@ void Reporter::AddLocation(location::GpsInfo const & info) { lock_guard lg(m_mutex); + if (info.m_horizontalAccuracy > kRequiredHorizontalAccuracy) + return; + if (info.m_timestamp < m_lastGpsTime + kMinDelaySeconds) return; diff --git a/tracking/tracking_tests/reporter_test.cpp b/tracking/tracking_tests/reporter_test.cpp index 2492f32e9d..685b4f19f7 100644 --- a/tracking/tracking_tests/reporter_test.cpp +++ b/tracking/tracking_tests/reporter_test.cpp @@ -25,6 +25,7 @@ void TransferLocation(Reporter & reporter, TestSocket & testSocket, double times gpsInfo.m_timestamp = timestamp; gpsInfo.m_latitude = latidute; gpsInfo.m_longitude = longtitude; + gpsInfo.m_horizontalAccuracy = 1.0; reporter.AddLocation(gpsInfo); vector buffer;