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:
authormpimenov <mpimenov@users.noreply.github.com>2016-11-10 20:27:41 +0300
committerGitHub <noreply@github.com>2016-11-10 20:27:41 +0300
commit77206c4859e4dd0d06b954f2ae9e24dce0fbc795 (patch)
tree9b164e713080faa8d05f64cd38fee940d6c987f7 /indexer
parentc48ed95e792bf806a9ac172f0434c67462ab6da0 (diff)
parentb3ddddc503d660990d9495fd6d7a2bc8817e180c (diff)
Merge pull request #4670 from Zverik/fix_zoom_lev
[features] Fix zoom level test for city-capitals
Diffstat (limited to 'indexer')
-rw-r--r--indexer/feature_utils.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp
index 696b35d5c0..1da89805d2 100644
--- a/indexer/feature_utils.cpp
+++ b/indexer/feature_utils.cpp
@@ -102,6 +102,12 @@ class FeatureEstimator
return false;
}
+ static bool InSubtree(uint32_t t, uint32_t const orig)
+ {
+ ftype::TruncValue(t, ftype::GetLevel(orig));
+ return t == orig;
+ }
+
public:
FeatureEstimator()
@@ -114,7 +120,6 @@ public:
m_TypeCounty[1] = GetType("place", "county");
m_TypeCity = GetType("place", "city");
- m_TypeCityCapital = GetType("place", "city", "capital");
m_TypeTown = GetType("place", "town");
m_TypeVillage[0] = GetType("place", "village");
@@ -171,7 +176,7 @@ private:
if (IsEqual(type, m_TypeCounty))
return 7;
- if (type == m_TypeCity || type == m_TypeCityCapital)
+ if (InSubtree(type, m_TypeCity))
return 9;
if (type == m_TypeTown)
@@ -202,7 +207,6 @@ private:
uint32_t m_TypeState;
uint32_t m_TypeCounty[2];
uint32_t m_TypeCity;
- uint32_t m_TypeCityCapital;
uint32_t m_TypeTown;
uint32_t m_TypeVillage[2];
uint32_t m_TypeSmallVillage[3];