diff options
author | Darafei Praliaskouski <komzpa@gmail.com> | 2013-01-15 16:58:35 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:48:46 +0300 |
commit | a81bbd3cb85535d7664ca39c661fd6b163f50694 (patch) | |
tree | 17558058a37261f9580ef2cf78be4d4945383a53 /indexer | |
parent | 2d5d54580b018be526a5e8f31bf725ff0d7b222c (diff) |
feature styler
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/drawing_rule_def.hpp | 2 | ||||
-rw-r--r-- | indexer/feature.cpp | 15 | ||||
-rw-r--r-- | indexer/feature.hpp | 1 | ||||
-rw-r--r-- | indexer/feature_visibility.cpp | 37 | ||||
-rw-r--r-- | indexer/feature_visibility.hpp | 13 |
5 files changed, 1 insertions, 67 deletions
diff --git a/indexer/drawing_rule_def.hpp b/indexer/drawing_rule_def.hpp index 385320e2f8..3276506e57 100644 --- a/indexer/drawing_rule_def.hpp +++ b/indexer/drawing_rule_def.hpp @@ -34,7 +34,7 @@ namespace drule /// geo type of rule - can be one combined of ... enum rule_geo_t { node = 1, way = 2 }; - int const layer_base_priority = 2000; + double const layer_base_priority = 2000; void MakeUnique(vector<Key> & keys); void SortByScaleTypeDepth(vector<Key> & keys); diff --git a/indexer/feature.cpp b/indexer/feature.cpp index dfb406a894..f5fc4f555e 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -311,21 +311,6 @@ uint32_t FeatureType::GetPopulation() const return (r == 0 ? 1 : static_cast<uint32_t>(pow(1.1, r))); } -double FeatureType::GetPopulationDrawRank() const -{ - uint32_t const n = GetPopulation(); - if (n == 1) return 0.0; - - // Do not return rank for countries. - if (feature::UsePopulationRank(m_Types, m_Types + GetTypesCount())) - { - double const upperBound = 3.0E6; - return min(upperBound, static_cast<double>(n)) / upperBound; - } - else - return 0.0; -} - namespace { class DoCalcDistance diff --git a/indexer/feature.hpp b/indexer/feature.hpp index a9c3a3b761..1ff1d5deac 100644 --- a/indexer/feature.hpp +++ b/indexer/feature.hpp @@ -243,7 +243,6 @@ public: uint8_t GetRank() const; uint32_t GetPopulation() const; - double GetPopulationDrawRank() const; inline string GetRoadNumber() const { return m_Params.ref; } diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 5e88bb51cc..0ecaeeb698 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -404,43 +404,6 @@ pair<int, int> GetDrawableScaleRangeForRules(FeatureBase const & f, int rules) return GetDrawableScaleRangeForRules(TypesHolder(f), rules); } -bool UsePopulationRank(uint32_t type) -{ - class CheckerT - { - uint32_t m_types[3]; - - public: - CheckerT() - { - Classificator & c = classif(); - - vector<string> vec; - vec.push_back("place"); - vec.push_back("city"); - m_types[0] = c.GetTypeByPath(vec); - - vec.push_back("capital"); - m_types[1] = c.GetTypeByPath(vec); - - vec.clear(); - vec.push_back("place"); - vec.push_back("town"); - m_types[2] = c.GetTypeByPath(vec); - } - - bool IsMyType(uint32_t t) const - { - uint32_t const * e = m_types + ARRAY_SIZE(m_types); - return (find(m_types, e, t) != e); - } - }; - - static CheckerT checker; - return (checker.IsMyType(type)); -} - - void TypeSetChecker::SetType(StringT * beg, StringT * end) { m_type = classif().GetTypeByPath(vector<string>(beg, end)); diff --git a/indexer/feature_visibility.hpp b/indexer/feature_visibility.hpp index d5c1ca0586..bc1ad86bd2 100644 --- a/indexer/feature_visibility.hpp +++ b/indexer/feature_visibility.hpp @@ -57,19 +57,6 @@ namespace feature pair<int, bool> GetDrawRule(FeatureBase const & f, int level, vector<drule::Key> & keys, string & names); - bool UsePopulationRank(uint32_t type); - - template <class IterT> - inline bool UsePopulationRank(IterT beg, IterT end) - { - while (beg != end) - { - if (UsePopulationRank(*beg++)) - return true; - } - return false; - } - /// Used to check whether user types belong to particular classificator set. class TypeSetChecker { |