diff --git a/indexer/data_header_reader.cpp b/indexer/data_header_reader.cpp index a3bfd95f34..be77ac65bc 100644 --- a/indexer/data_header_reader.cpp +++ b/indexer/data_header_reader.cpp @@ -8,19 +8,26 @@ namespace feature { + uint64_t GetSkipHeaderSize(Reader const & reader) + { + uint64_t const headerSize = ReadPrimitiveFromPos(reader, 0); + return headerSize + sizeof(uint64_t); + } + uint64_t ReadDataHeader(string const & datFileName, feature::DataHeader & outHeader) { try { - FileReader datReader(datFileName); - // read header size - uint64_t const headerSize = ReadPrimitiveFromPos(datReader, 0); + FileReader reader(datFileName); + + uint64_t const toSkip = GetSkipHeaderSize(reader); + + ReaderSource src(reader); + src.Skip(sizeof(uint64_t)); - FileReader subReader = datReader.SubReader(sizeof(uint64_t), headerSize); - ReaderSource src(subReader); outHeader.Load(src); - return (headerSize + sizeof(uint64_t)); + return toSkip; } catch (Reader::Exception const & e) { diff --git a/indexer/data_header_reader.hpp b/indexer/data_header_reader.hpp index 61e3f5937f..c731d10e57 100644 --- a/indexer/data_header_reader.hpp +++ b/indexer/data_header_reader.hpp @@ -4,11 +4,14 @@ #include "../std/string.hpp" class Writer; +class Reader; namespace feature { class DataHeader; + /// @return total header size, which should be skipped for data read, or 0 if error + uint64_t GetSkipHeaderSize(Reader const & reader); uint64_t ReadDataHeader(string const & datFileName, feature::DataHeader & outHeader); void WriteDataHeader(Writer & writer, feature::DataHeader const & header); } diff --git a/indexer/feature.cpp b/indexer/feature.cpp index e489bbeb38..790f0220f3 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -42,6 +42,7 @@ bool FeatureBuilder::IsGeometryClosed() const void FeatureBuilder::AddPoint(m2::PointD const & p) { m_Geometry.push_back(pts::ToId(CoordPointT(p.x, p.y))); + m_LimitRect.Add(p); } void FeatureBuilder::AddTriangle(m2::PointD const & a, m2::PointD const & b, m2::PointD const & c) @@ -67,6 +68,38 @@ void FeatureBuilder::AddLayer(int32_t layer) m_Layer = layer; } +FeatureBase FeatureBuilder::GetFeatureBase() const +{ + FeatureBase f; + f.SetHeader(GetHeader()); + + f.m_Layer = m_Layer; + for (size_t i = 0; i < m_Types.size(); ++i) + f.m_Types[i] = m_Types[i]; + f.m_LimitRect = m_LimitRect; + f.m_Name = m_Name; + + f.m_bTypesParsed = f.m_bLayerParsed = f.m_bNameParsed = f.m_bGeometryParsed = true; + + return f; +} + +namespace +{ + bool is_equal(double d1, double d2) + { + //return my::AlmostEqual(d1, d2, 100000000); + return (fabs(d1 - d2) < 1.0E-6); + } + bool is_equal(m2::RectD const & r1, m2::RectD const & r2) + { + return (is_equal(r1.minX(), r2.minX()) && + is_equal(r1.minY(), r2.minY()) && + is_equal(r1.maxX(), r2.maxX()) && + is_equal(r1.maxY(), r2.maxY())); + } +} + bool FeatureBuilder::operator == (FeatureBuilder const & fb) const { return @@ -74,19 +107,12 @@ bool FeatureBuilder::operator == (FeatureBuilder const & fb) const m_Layer == fb.m_Layer && m_Name == fb.m_Name && m_Geometry == fb.m_Geometry && - m_Triangles == fb.m_Triangles; + m_Triangles == fb.m_Triangles && + is_equal(m_LimitRect, fb.m_LimitRect); } -void FeatureBuilder::Serialize(vector & data) const +uint8_t FeatureBuilder::GetHeader() const { - CHECK(!m_Geometry.empty(), ()); - CHECK(m_Geometry.size() > 1 || m_Triangles.empty(), ()); - CHECK_LESS(m_Types.size(), 16, ()); - - data.clear(); - PushBackByteSink > sink(data); - - // Serializing header. uint8_t header = static_cast(m_Types.size()); if (m_Layer != 0) header |= FeatureBase::HEADER_HAS_LAYER; @@ -99,7 +125,20 @@ void FeatureBuilder::Serialize(vector & data) const } if (!m_Name.empty()) header |= FeatureBase::HEADER_HAS_NAME; - WriteToSink(sink, header); + return header; +} + +void FeatureBuilder::Serialize(vector & data) const +{ + CHECK(!m_Geometry.empty(), ()); + CHECK(m_Geometry.size() > 1 || m_Triangles.empty(), ()); + CHECK_LESS(m_Types.size(), 16, ()); + + data.clear(); + PushBackByteSink > sink(data); + + // Serializing header. + WriteToSink(sink, GetHeader()); // Serializing types. { @@ -145,18 +184,16 @@ void FeatureBuilder::Serialize(vector & data) const bool FeatureBuilder::CheckCorrect(vector const & data) const { vector data1 = data; - FeatureGeom feature; - feature.DeserializeAndParse(data1); + FeatureGeom f; + f.DeserializeAndParse(data1); FeatureBuilder fb; - feature.InitFeatureBuilder(fb); + f.InitFeatureBuilder(fb); - string const s = feature.DebugString(); + string const s = f.DebugString(); - ASSERT_EQUAL(m_Types, fb.m_Types, (s)); - ASSERT_EQUAL(m_Layer, fb.m_Layer, (s)); - ASSERT_EQUAL(m_Geometry, fb.m_Geometry, (s)); - ASSERT_EQUAL(m_Triangles, fb.m_Triangles, (s)); - ASSERT_EQUAL(m_Name, fb.m_Name, (s)); + ASSERT_EQUAL(m_Layer, f.m_Layer, (s)); + ASSERT_EQUAL(m_Name, f.m_Name, (s)); + ASSERT(is_equal(m_LimitRect, f.m_LimitRect), (s)); ASSERT(*this == fb, (s)); return true; @@ -184,6 +221,13 @@ uint32_t FeatureBase::CalcOffset(ArrayByteSource const & source) const return static_cast(static_cast(source.Ptr()) - DataPtr()); } +void FeatureBase::SetHeader(uint8_t h) +{ + ASSERT ( m_Offset == 0, (m_Offset) ); + m_Data.resize(1); + m_Data[0] = h; +} + void FeatureBase::ParseTypes() const { ASSERT(!m_bTypesParsed, ()); @@ -340,3 +384,12 @@ void FeatureGeom::InitFeatureBuilder(FeatureBuilder & fb) const for (size_t i = 0; i < triangleCount; ++i) fb.AddTriangle(m_Triangles[3*i + 0], m_Triangles[3*i + 1], m_Triangles[3*i + 2]); } + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FeatureGeomRef implementation +/////////////////////////////////////////////////////////////////////////////////////////////////// + +FeatureGeomRef::FeatureGeomRef(vector & data, uint32_t offset) +{ + Deserialize(data, offset); +} diff --git a/indexer/feature.hpp b/indexer/feature.hpp index d1a43e1c8a..12d09cc078 100644 --- a/indexer/feature.hpp +++ b/indexer/feature.hpp @@ -9,7 +9,7 @@ #include "../std/vector.hpp" class ArrayByteSource; - +class FeatureBase; class FeatureBuilder { @@ -20,13 +20,13 @@ public: void AddTriangle(m2::PointD const & a, m2::PointD const & b, m2::PointD const & c); template - void AddTypes(TIter beg, TIter end) + inline void AddTypes(TIter beg, TIter end) { // 15 - is the maximum count of types (@see Feature::GetTypesCount()) size_t const count = min(15, static_cast(distance(beg, end))); m_Types.assign(beg, beg + count); } - void SetType(uint32_t type) + inline void SetType(uint32_t type) { m_Types.clear(); m_Types.push_back(type); @@ -36,12 +36,19 @@ public: void Serialize(vector & data) const; + inline m2::RectD GetLimitRect() const { return m_LimitRect; } + + // Get common parameters of feature. + FeatureBase GetFeatureBase() const; + bool IsGeometryClosed() const; size_t GetPointsCount() const { return m_Geometry.size(); } bool operator == (FeatureBuilder const &) const; private: + uint8_t GetHeader() const; + bool CheckCorrect(vector const & data) const; int32_t m_Layer; @@ -49,6 +56,7 @@ private: vector m_Types; vector m_Geometry; vector m_Triangles; + m2::RectD m_LimitRect; }; class FeatureBase @@ -62,7 +70,7 @@ public: FEATURE_TYPE_UNKNOWN = 17 }; - FeatureBase() {} + FeatureBase() : m_Offset(0) {} /// @name Use like polymorfic functions. Need to overwrite in derived classes. //@{ @@ -140,6 +148,10 @@ protected: vector m_Data; uint32_t m_Offset; + friend class FeatureBuilder; + + void SetHeader(uint8_t h); + inline char const * DataPtr() const { return &m_Data[m_Offset]; } inline uint8_t Header() const { return static_cast(*DataPtr()); } uint32_t CalcOffset(ArrayByteSource const & source) const; @@ -251,7 +263,11 @@ private: class FeatureGeomRef : public FeatureBase { + typedef FeatureBase base_type; +public: + FeatureGeomRef() {} + FeatureGeomRef(vector & data, uint32_t offset = 0); }; inline string debug_print(FeatureGeom const & f) diff --git a/indexer/feature_processor.hpp b/indexer/feature_processor.hpp index 559bfdc931..4ef1b23494 100644 --- a/indexer/feature_processor.hpp +++ b/indexer/feature_processor.hpp @@ -1,6 +1,7 @@ #pragma once #include "feature.hpp" +#include "data_header_reader.hpp" #include "../coding/varint.hpp" #include "../coding/file_reader.hpp" @@ -9,23 +10,18 @@ namespace feature { + /// Read feature from feature source. template - void ReadFromSource(TSource & src, TFeature & ft) + void ReadFromSource(TSource & src, TFeature & f) { uint32_t const sz = ReadVarUint(src); vector buffer(sz); src.Read(&buffer[0], sz); - ft.Deserialize(buffer); + f.Deserialize(buffer); } - /// @return total header size, which should be skipped for data read, or 0 if error - inline uint64_t ReadDatHeaderSize(Reader const & reader) - { - uint64_t const headerSize = ReadPrimitiveFromPos(reader, 0); - return headerSize + sizeof(uint64_t); - } - - template + /// Process features in .dat file. + template void ForEachFromDat(string const & fName, ToDo & toDo) { typedef ReaderSource source_t; @@ -33,16 +29,17 @@ namespace feature FileReader reader(fName); source_t src(reader); - // skip xml header - uint64_t currPos = ReadDatHeaderSize(reader); + // skip header + uint64_t currPos = feature::GetSkipHeaderSize(reader); src.Skip(currPos); + uint64_t const fSize = reader.Size(); // read features one by one while (currPos < fSize) { - FeatureGeom ft; - ReadFromSource(src, ft); - toDo(ft, currPos); + TFeature f; + ReadFromSource(src, f); + toDo(f, currPos); currPos = src.Pos(); } } diff --git a/indexer/index_builder.cpp b/indexer/index_builder.cpp index 6b86cef541..bddebd6d67 100644 --- a/indexer/index_builder.cpp +++ b/indexer/index_builder.cpp @@ -1,8 +1,10 @@ #include "index_builder.hpp" -#include "feature_processor.hpp" +#include "data_header_reader.hpp" #include "features_vector.hpp" + #include "../coding/file_reader.hpp" + namespace indexer { bool BuildIndexFromDatFile(string const & fullIndexFilePath, string const & fullDatFilePath, @@ -11,8 +13,9 @@ namespace indexer try { FileReader dataReader(fullDatFilePath); - // skip xml header with metadata - uint64_t startOffset = feature::ReadDatHeaderSize(dataReader); + + uint64_t startOffset = feature::GetSkipHeaderSize(dataReader); + FileReader subReader = dataReader.SubReader(startOffset, dataReader.Size() - startOffset); FeaturesVector featuresVector(subReader); diff --git a/indexer/indexer_tests/data_header_test.cpp b/indexer/indexer_tests/data_header_test.cpp index 9e7c98aaf9..1af83a4bdb 100644 --- a/indexer/indexer_tests/data_header_test.cpp +++ b/indexer/indexer_tests/data_header_test.cpp @@ -1,11 +1,13 @@ #include "../../testing/testing.hpp" -#include "../../coding/file_writer.hpp" -#include "../feature_processor.hpp" #include "../data_header_reader.hpp" #include "../data_header.hpp" #include "../cell_id.hpp" +#include "../../coding/file_reader.hpp" +#include "../../coding/file_writer.hpp" + + UNIT_TEST(DataHeaderSerialization) { char const * fileName = "mfj4340smn54123.tmp"; @@ -30,7 +32,7 @@ UNIT_TEST(DataHeaderSerialization) { FileReader reader(fileName); - uint64_t const headerSize = feature::ReadDatHeaderSize(reader); + uint64_t const headerSize = feature::GetSkipHeaderSize(reader); TEST_GREATER(headerSize, 0, ()); uint64_t number = 0; reader.Read(headerSize, &number, sizeof(number)); diff --git a/indexer/indexer_tests/feature_bucketer_test.cpp b/indexer/indexer_tests/feature_bucketer_test.cpp index b36f7c5766..5783066fa9 100644 --- a/indexer/indexer_tests/feature_bucketer_test.cpp +++ b/indexer/indexer_tests/feature_bucketer_test.cpp @@ -19,9 +19,13 @@ namespace PushBackFeatureDebugStringOutput(string const & name, InitDataType const & initData) : m_pContainer(&((*initData)[name])) {} - void operator() (FeatureType const & feature) + void operator() (FeatureBuilder const & fb) { - m_pContainer->push_back(feature.DebugString()); + vector bytes; + fb.Serialize(bytes); + FeatureType f(bytes); + + m_pContainer->push_back(f.DebugString()); } private: @@ -37,9 +41,9 @@ namespace FeatureType MakeFeature(FeatureBuilder const & fb) { - vector data; - fb.Serialize(data); - return FeatureType(data, 0); + vector bytes; + fb.Serialize(bytes); + return FeatureType(bytes); } } @@ -51,7 +55,7 @@ UNIT_TEST(FeatureBucketerSmokeTest) FeatureBuilder fb; fb.AddPoint(m2::PointD(10, 10)); fb.AddPoint(m2::PointD(20, 20)); - bucketer(MakeFeature(fb)); + bucketer(fb); expectedOut["3"].push_back(MakeFeature(fb).DebugString()); TEST_EQUAL(out, expectedOut, ()); diff --git a/indexer/indexer_tests/index_builder_test.cpp b/indexer/indexer_tests/index_builder_test.cpp index f78ac38151..772bde5040 100644 --- a/indexer/indexer_tests/index_builder_test.cpp +++ b/indexer/indexer_tests/index_builder_test.cpp @@ -1,11 +1,14 @@ #include "../../testing/testing.hpp" + #include "../index.hpp" #include "../index_builder.hpp" #include "../classif_routine.hpp" #include "../features_vector.hpp" -#include "../feature_processor.hpp" +#include "../data_header_reader.hpp" + #include "../../platform/platform.hpp" + UNIT_TEST(BuildIndexTest) { Platform & p = GetPlatform(); @@ -15,7 +18,7 @@ UNIT_TEST(BuildIndexTest) FileReader reader(p.WritablePathForFile("minsk-pass.dat")); // skip xml metadata header - uint64_t startOffset = feature::ReadDatHeaderSize(reader); + uint64_t const startOffset = feature::GetSkipHeaderSize(reader); FileReader subReader = reader.SubReader(startOffset, reader.Size() - startOffset); FeaturesVector featuresVector(subReader); diff --git a/indexer/indexer_tool/feature_bucketer.hpp b/indexer/indexer_tool/feature_bucketer.hpp index a63eec2f39..9b3a35d482 100644 --- a/indexer/indexer_tool/feature_bucketer.hpp +++ b/indexer/indexer_tool/feature_bucketer.hpp @@ -36,49 +36,39 @@ public: CellIdConverter::GetCellBounds(cell, minX, minY, maxX, maxY); m_Buckets[i].m_Rect = m2::RectD(minX, minY, maxX, maxY); } + // create separate world bucket if necessary if (maxWorldZoom >= 0) - { m_worldBucket.reset(new FeatureOutT(WORLD_FILE_NAME, m_FeatureOutInitData)); - } } - void operator () (FeatureType const & f) + void operator () (FeatureBuilder const & fb) { // separately store features needed for world map - if (m_worldBucket && m_maxWorldZoom >= feature::MinDrawableScaleForFeature(f)) - (*m_worldBucket)(f); + if (m_worldBucket && m_maxWorldZoom >= feature::MinDrawableScaleForFeature(fb.GetFeatureBase())) + (*m_worldBucket)(fb); - FeatureClipperT clipper(f); + FeatureClipperT clipper(fb); // TODO: Is feature fully inside GetLimitRect()? - m2::RectD const limitRect = f.GetLimitRect(); + m2::RectD const limitRect = fb.GetLimitRect(); for (uint32_t i = 0; i < m_Buckets.size(); ++i) { // First quick and dirty limit rect intersection. // Clipper may (or may not) do a better intersection. if (m_Buckets[i].m_Rect.IsIntersect(limitRect)) { - FeatureType clippedFeature; - if (clipper(m_Buckets[i].m_Rect, clippedFeature)) + FeatureBuilder clippedFb; + if (clipper(m_Buckets[i].m_Rect, clippedFb)) { if (!m_Buckets[i].m_pOut) m_Buckets[i].m_pOut = new FeatureOutT(BucketName(i), m_FeatureOutInitData); - (*(m_Buckets[i].m_pOut))(clippedFeature); + (*(m_Buckets[i].m_pOut))(clippedFb); } } } } - void operator () (FeatureBuilder const & fb) - { - vector data; - fb.Serialize(data); - FeatureType f; - f.Deserialize(data); - this->operator()(f); - } - template void GetBucketNames(F f) const { for (uint32_t i = 0; i < m_Buckets.size(); ++i) @@ -111,19 +101,17 @@ private: class SimpleFeatureClipper { + FeatureBuilder const & m_Feature; public: - explicit SimpleFeatureClipper(FeatureType const & f) : m_Feature(f) + explicit SimpleFeatureClipper(FeatureBuilder const & f) : m_Feature(f) { } - bool operator () (m2::RectD const & /*rect*/, FeatureType & clippedFeature) const + bool operator () (m2::RectD const & /*rect*/, FeatureBuilder & clippedF) const { - clippedFeature = m_Feature; + clippedF = m_Feature; return true; } - -private: - FeatureType const & m_Feature; }; } diff --git a/indexer/indexer_tool/feature_generator.cpp b/indexer/indexer_tool/feature_generator.cpp index 2a8f6b1376..6a88ef77e7 100644 --- a/indexer/indexer_tool/feature_generator.cpp +++ b/indexer/indexer_tool/feature_generator.cpp @@ -147,7 +147,7 @@ FeaturesCollector::FeaturesCollector(string const & bucketName, Init(); } -void FeaturesCollector::operator() (FeatureBuilder const & f) +void FeaturesCollector::operator() (FeatureBuilder const & fb) { #ifdef DEBUG // .dat file should be less than 4Gb @@ -157,7 +157,7 @@ void FeaturesCollector::operator() (FeatureBuilder const & f) #endif vector bytes; - f.Serialize(bytes); + fb.Serialize(bytes); size_t const sz = bytes.size(); CHECK(sz, ("Empty feature! WTF?")); @@ -166,18 +166,10 @@ void FeaturesCollector::operator() (FeatureBuilder const & f) WriteVarUint(m_datFile, sz); m_datFile.Write(&bytes[0], sz); - FeatureType f(bytes); - m_bounds.Add(f.GetLimitRect()); + m_bounds.Add(fb.GetLimitRect()); } } -void FeaturesCollector::operator() (FeatureType const & f) -{ - FeatureBuilder fb; - f.InitFeatureBuilder(fb); - this->operator()(fb); -} - FeaturesCollector::~FeaturesCollector() { // rewrite map information with actual data diff --git a/indexer/indexer_tool/feature_generator.hpp b/indexer/indexer_tool/feature_generator.hpp index aeeec514c6..6d55c864f3 100644 --- a/indexer/indexer_tool/feature_generator.hpp +++ b/indexer/indexer_tool/feature_generator.hpp @@ -1,7 +1,6 @@ #pragma once #include "../../indexer/osm_decl.hpp" -#include "../../indexer/feature.hpp" #include "../../geometry/rect2d.hpp" @@ -11,7 +10,6 @@ #include "../../std/string.hpp" class FeatureBuilder; -class FeatureGeom; namespace feature { @@ -48,6 +46,5 @@ namespace feature FeaturesCollector(string const & bucketName, InitDataType const & datFilePrefixSuffix); void operator() (FeatureBuilder const & f); - void operator() (FeatureType const & f); }; } diff --git a/indexer/indexer_tool/feature_sorter.cpp b/indexer/indexer_tool/feature_sorter.cpp index dd7e1d734d..3fafedb703 100644 --- a/indexer/indexer_tool/feature_sorter.cpp +++ b/indexer/indexer_tool/feature_sorter.cpp @@ -1,6 +1,7 @@ #include "feature_sorter.hpp" #include "feature_generator.hpp" +#include "../../indexer/data_header.hpp" #include "../../indexer/feature_processor.hpp" #include "../../indexer/feature_visibility.hpp" #include "../../indexer/scales.hpp" @@ -57,15 +58,6 @@ namespace { return c1.first < c2.first; } - - template - void ReadFeature(TReader const & reader, FeatureGeom & ft, uint64_t offset) - { - ReaderSource src(reader); - src.Skip(offset); - - feature::ReadFromSource(src, ft); - } } namespace feature @@ -86,21 +78,38 @@ namespace feature // stores cellIds for middle points CalculateMidPoints midPoints; - ForEachFromDat(tempDatFilePath, midPoints); + ForEachFromDat(tempDatFilePath, midPoints); + // sort features by their middle point std::sort(midPoints.m_vec.begin(), midPoints.m_vec.end(), &SortMidPointsFunc); // store sorted features { - FeaturesCollector collector(datFilePath); - FileReader notSortedFileReader(tempDatFilePath); + FileWriter writer(datFilePath); + FileReader reader(tempDatFilePath); + + feature::DataHeader header; + feature::ReadDataHeader(tempDatFilePath, header); + feature::WriteDataHeader(writer, header); - FeatureGeom ft; for (size_t i = 0; i < midPoints.m_vec.size(); ++i) { - ReadFeature(notSortedFileReader, ft, midPoints.m_vec[i].second); - collector(ft); + ReaderSource src(reader); + + // move to position + src.Skip(midPoints.m_vec[i].second); + + // read feature bytes + uint32_t const sz = ReadVarUint(src); + vector buffer(sz); + src.Read(&buffer[0], sz); + + // write feature bytes + WriteVarUint(writer, sz); + writer.Write(&buffer[0], sz); } + + // at this point files should be closed } // remove old not-sorted dat file diff --git a/indexer/indexer_tool/indexer_tool.cpp b/indexer/indexer_tool/indexer_tool.cpp index 977249869d..1078e423c6 100644 --- a/indexer/indexer_tool/indexer_tool.cpp +++ b/indexer/indexer_tool/indexer_tool.cpp @@ -9,7 +9,6 @@ #include "../features_vector.hpp" #include "../index_builder.hpp" #include "../osm_decl.hpp" -#include "../feature_processor.hpp" #include "../data_header.hpp" #include "../defines.hpp" diff --git a/indexer/indexer_tool/tesselator.cpp b/indexer/indexer_tool/tesselator.cpp index 83e08c2b02..642ed346a1 100644 --- a/indexer/indexer_tool/tesselator.cpp +++ b/indexer/indexer_tool/tesselator.cpp @@ -30,9 +30,9 @@ namespace feature tess.beginContour(); { - vector data; - fb.Serialize(data); - FeatureGeom f(data); + vector bytes; + fb.Serialize(bytes); + FeatureGeom f(bytes); f.ForEachPoint(AddTessPointF(tess)); } tess.endContour(); diff --git a/map/feature_vec_model.cpp b/map/feature_vec_model.cpp index dd418f057b..f085d2f9c3 100644 --- a/map/feature_vec_model.cpp +++ b/map/feature_vec_model.cpp @@ -8,7 +8,7 @@ #include "../indexer/scales.hpp" #include "../indexer/classif_routine.hpp" #include "../indexer/classificator.hpp" -#include "../indexer/feature_processor.hpp" +#include "../indexer/data_header_reader.hpp" #include "../base/logging.hpp" @@ -41,7 +41,7 @@ void FeaturesFetcher::AddMap(string const & dataPath, string const & indexPath) uint32_t const idxLogPageCount = 11; FileReader dataReader(dataPath, datLogPageSize, datLogPageCount); - uint64_t const startOffset = feature::ReadDatHeaderSize(dataReader); + uint64_t const startOffset = feature::GetSkipHeaderSize(dataReader); #ifdef USE_BUFFER_READER // readers from memory diff --git a/map/map_tests/map_foreach_test.cpp b/map/map_tests/map_foreach_test.cpp index d2099f3cd6..f2f9994588 100644 --- a/map/map_tests/map_foreach_test.cpp +++ b/map/map_tests/map_foreach_test.cpp @@ -160,7 +160,7 @@ public: template void ForEachFeature(m2::RectD const & /*rect*/, ToDo toDo) { - feature::ForEachFromDat(m_fDat, toDo); + feature::ForEachFromDat(m_fDat, toDo); } };