diff --git a/data/classificator.txt b/data/classificator.txt index d32edd036a..baccb27870 100644 --- a/data/classificator.txt +++ b/data/classificator.txt @@ -1020,9 +1020,11 @@ world + even 17|0|4|92 - all 17|0|5|93 - {} - shop 17|3|19|11829 + - bakery 17|2|62|1573 - - hairdresser 17|2|63|1574 - + shop + + bakery 17|2|62|1573 17|3|19|11829 - + hairdresser 17|2|63|1574 17|3|19|11829 - + convenience 17|2|122|1572 17|3|19|11829 - + supermarket 17|2|122|1572 17|3|19|11829 - {} historic + battlefield 17|2|68|1579 17|3|19|11829 - diff --git a/data/drawing_rules.bin b/data/drawing_rules.bin index 9a974a6aa1..2929692b2d 100755 Binary files a/data/drawing_rules.bin and b/data/drawing_rules.bin differ diff --git a/data/types.txt b/data/types.txt index 26d4035850..79e87cf59e 100644 --- a/data/types.txt +++ b/data/types.txt @@ -698,3 +698,5 @@ highway|tertiary_link|area| highway|unsurfaced|tunnel| highway|secondary_link|area| natural|allotments| +shop|convenience| +shop|supermarket| diff --git a/data/visibility.txt b/data/visibility.txt index a087b764de..6a23267e75 100644 --- a/data/visibility.txt +++ b/data/visibility.txt @@ -989,7 +989,9 @@ world 000000000000000000 + {} shop 000000000000000000 + bakery 000000000000000001 - + convenience 000000000000000001 - hairdresser 000000000000000001 - + supermarket 000000000000000001 - {} sport 000000000000000000 + american_football 000000000000000001 - diff --git a/indexer/old/feature_loader_101.cpp b/indexer/old/feature_loader_101.cpp index 4f253d87c9..cae2f8ca43 100644 --- a/indexer/old/feature_loader_101.cpp +++ b/indexer/old/feature_loader_101.cpp @@ -36,13 +36,55 @@ uint8_t LoaderImpl::GetHeader() return header; } +namespace +{ + class TypeConvertor + { + vector m_inc; + + public: + TypeConvertor() + { + char const * arr[][2] = { + { "shop", "convenience" }, // new type + { "shop", "hairdresser" } + }; + + Classificator const & c = classif(); + + for (size_t i = 0; i < ARRAY_SIZE(arr); ++i) + { + vector v; + v.push_back(arr[i][0]); + v.push_back(arr[i][1]); + m_inc.push_back(c.GetTypeByPath(v)); + } + } + + uint32_t Convert(uint32_t t) const + { + size_t const count = m_inc.size(); + for (size_t i = 0; i < count; ++i) + if (m_inc[i] == t) + { + // return next type (advance by 1) + ASSERT_LESS ( i+1, count, () ); + return m_inc[i+1]; + } + return t; + } + }; +} + void LoaderImpl::ParseTypes() { ArrayByteSource source(DataPtr() + m_TypesOffset); + static TypeConvertor typeC; + size_t const count = m_pF->GetTypesCount(); for (size_t i = 0; i < count; ++i) - m_pF->m_Types[i] = ReadVarUint(source); + m_pF->m_Types[i] = typeC.Convert(ReadVarUint(source)); m_CommonOffset = CalcOffset(source); }