From 8651b85289754a09b662e0412b5cae172284c3be Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Mon, 9 Apr 2018 14:27:33 +0300 Subject: [coding] [geometry] Deprecated PointToInt. For some reason we have been using bitwise merge to store a pair of 32-bit unsigned integer coordinates. Since the width of the coordinates is fixed and storage in general has nothing to do with the Z-order curve where bitwise merge is appropriate, this commit marks this method of storage as obsolete (and effectively deprecated). The functions to convert between PointD and PointU are still serviceable. Their usage is slightly refactored. --- local_ads/statistics.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'local_ads') diff --git a/local_ads/statistics.cpp b/local_ads/statistics.cpp index 2d2510f005..5a3df4d24f 100644 --- a/local_ads/statistics.cpp +++ b/local_ads/statistics.cpp @@ -9,6 +9,7 @@ #include "coding/file_name_utils.hpp" #include "coding/file_writer.hpp" #include "coding/point_to_integer.hpp" +#include "coding/pointd_to_pointu.hpp" #include "coding/url_encode.hpp" #include "coding/write_to_sink.hpp" #include "coding/zlib.hpp" @@ -158,9 +159,10 @@ std::list ReadEvents(std::string const & fileName) { FileReader reader(fileName); ReaderSource src(reader); - ReadPackedData(src, [&result](local_ads::Statistics::PackedData && data, std::string const & countryId, - int64_t mwmVersion, local_ads::Timestamp const & baseTimestamp) { - auto const mercatorPt = Int64ToPoint(data.m_mercator, POINT_COORD_BITS); + ReadPackedData(src, [&result](local_ads::Statistics::PackedData && data, + std::string const & countryId, int64_t mwmVersion, + local_ads::Timestamp const & baseTimestamp) { + auto const mercatorPt = Int64ToPointObsolete(data.m_mercator, POINT_COORD_BITS); result.emplace_back(static_cast(data.m_eventType), mwmVersion, countryId, data.m_featureIndex, data.m_zoomLevel, baseTimestamp + std::chrono::seconds(data.m_seconds), @@ -318,7 +320,7 @@ std::list Statistics::WriteEvents(std::list & events, std::string data.m_zoomLevel = event.m_zoomLevel; data.m_eventType = static_cast(event.m_type); auto const mercatorPt = MercatorBounds::FromLatLon(event.m_latitude, event.m_longitude); - data.m_mercator = PointToInt64(mercatorPt, POINT_COORD_BITS); + data.m_mercator = PointToInt64Obsolete(mercatorPt, POINT_COORD_BITS); data.m_accuracy = event.m_accuracyInMeters; WritePackedData(*writer, std::move(data)); } -- cgit v1.2.3