Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2018-04-09 14:27:33 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2018-04-10 14:31:32 +0300
commit8651b85289754a09b662e0412b5cae172284c3be (patch)
tree08d176fad5682b2b54397c3066b5cc553846b4c5 /local_ads
parent9666660b84740e6bbe0585e59fccd1347c4c793f (diff)
[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.
Diffstat (limited to 'local_ads')
-rw-r--r--local_ads/statistics.cpp10
1 files changed, 6 insertions, 4 deletions
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<local_ads::Event> ReadEvents(std::string const & fileName)
{
FileReader reader(fileName);
ReaderSource<FileReader> 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<local_ads::EventType>(data.m_eventType), mwmVersion, countryId,
data.m_featureIndex, data.m_zoomLevel,
baseTimestamp + std::chrono::seconds(data.m_seconds),
@@ -318,7 +320,7 @@ std::list<Event> Statistics::WriteEvents(std::list<Event> & events, std::string
data.m_zoomLevel = event.m_zoomLevel;
data.m_eventType = static_cast<uint8_t>(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));
}