forked from organicmaps/organicmaps
Add GetPopulation() to feature.
This commit is contained in:
parent
cce07a6ae2
commit
e5f3ddf1c6
2 changed files with 9 additions and 0 deletions
|
@ -981,3 +981,11 @@ uint8_t FeatureType::GetRank() const
|
|||
|
||||
return m_Params.rank;
|
||||
}
|
||||
|
||||
uint32_t FeatureType::GetPopulation() 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)));
|
||||
}
|
||||
|
|
|
@ -377,6 +377,7 @@ public:
|
|||
string DebugString(int scale) const;
|
||||
|
||||
uint8_t GetRank() const;
|
||||
uint32_t GetPopulation() const;
|
||||
|
||||
/// @name Statistic functions.
|
||||
//@{
|
||||
|
|
Loading…
Add table
Reference in a new issue