diff options
author | vng <viktor.govako@gmail.com> | 2011-06-01 02:48:03 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:18:38 +0300 |
commit | 90886f0e123ef3821ac74d4414bd265fe4a04f76 (patch) | |
tree | 03f46e7b6c12d25016423540c701726c0c82b548 /indexer/feature.cpp | |
parent | ce0472ccfdd972640c87fb377fa1ac645bca31a6 (diff) |
- Don't store names for features with invisible texts.
- Try to make better rank for drawing text font.
Diffstat (limited to 'indexer/feature.cpp')
-rw-r--r-- | indexer/feature.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/indexer/feature.cpp b/indexer/feature.cpp index 59896d553f..cd2675e24f 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -148,6 +148,10 @@ bool FeatureBuilder1::PreSerialize() return false; } + // Clear name for features with invisible texts. + if (!m_Params.name.IsEmpty() && feature::MinDrawableScaleForText(GetFeatureBase()) == -1) + m_Params.name.Clear(); + return true; } @@ -984,22 +988,25 @@ string FeatureType::GetPreferredDrawableName(char const * priorities) const return res; } -uint8_t FeatureType::GetRank() const +uint32_t FeatureType::GetPopulation() const { if (!m_bCommonParsed) ParseCommon(); - /// @todo Move this check to generator (don't store rank for countries). - if (m_Params.rank > 0 && feature::IsCountry(m_Types[0])) - return 0; + if (m_Params.rank == 0) + return 1; - return m_Params.rank; + return static_cast<uint32_t>(min(double(uint32_t(-1)), pow(1.1, m_Params.rank))); } -uint32_t FeatureType::GetPopulation() const +double FeatureType::GetPopulationDrawRank() const { - uint8_t const rank = GetRank(); - if (rank == 0) - return 1; - return static_cast<uint32_t>(min(double(uint32_t(-1)), pow(1.1, rank))); + uint32_t const n = GetPopulation(); + if (n == 1) return 0.0; + + // Do not return rank for countries. + if (feature::IsCountry(m_Types, m_Types + GetTypesCount())) + return 0.5; + else + return min(3.0E6, static_cast<double>(n)) / 3.0E6; } |