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:
authorvng <viktor.govako@gmail.com>2011-08-25 17:58:00 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:22:23 +0300
commita67f4c612fdf415b0c53e33e286730a103015b48 (patch)
tree99b32240c48b451b529fa0d205a6f542b3b867b5 /indexer/data_header.cpp
parentd38ed958ee39924eab20ec47fa6e101146d62920 (diff)
Support old format 1.01 (April 2011).
Diffstat (limited to 'indexer/data_header.cpp')
-rw-r--r--indexer/data_header.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/indexer/data_header.cpp b/indexer/data_header.cpp
index c461fa1fb3..0c193981d2 100644
--- a/indexer/data_header.cpp
+++ b/indexer/data_header.cpp
@@ -33,16 +33,13 @@ namespace feature
pair<int, int> DataHeader::GetScaleRange() const
{
- pair<int, int> ret(0, scales::GetUpperScale());
+ int const worldB = scales::GetUpperWorldScale();
+ int const countryB = scales::GetUpperScale();
- int const bound = scales::GetUpperWorldScale();
-
- if (m_scales.front() > bound)
- ret.first = bound+1;
- if (m_scales.back() <= bound)
- ret.second = bound;
-
- return ret;
+ if (m_scales.back() == countryB)
+ return make_pair(worldB + 1, countryB);
+ else
+ return make_pair(0, worldB);
}
void DataHeader::Save(FileWriter & w) const
@@ -70,5 +67,21 @@ namespace feature
m_bounds.second = ReadPrimitiveFromSource<int64_t>(src);
src.Read(m_scales.data(), m_scales.size());
+
+ m_ver = v2;
+ }
+
+ void DataHeader::LoadVer1(ModelReaderPtr const & r)
+ {
+ ReaderSource<ModelReaderPtr> src(r);
+ int64_t const base = ReadPrimitiveFromSource<int64_t>(src);
+ m_codingParams = serial::CodingParams(POINT_COORD_BITS, base);
+
+ m_bounds.first = ReadVarInt<int64_t>(src) + base;
+ m_bounds.second = ReadVarInt<int64_t>(src) + base;
+
+ src.Read(m_scales.data(), m_scales.size());
+
+ m_ver = v1;
}
}