forked from organicmaps/organicmaps
Result types count output
This commit is contained in:
parent
5d95ae6ed5
commit
9d8db80ecc
3 changed files with 21 additions and 2 deletions
|
@ -55,6 +55,7 @@ public:
|
|||
inline bool PopExactType(uint32_t type) { return m_params.PopExactType(type); }
|
||||
inline void SetType(uint32_t type) { m_params.SetType(type); }
|
||||
inline uint32_t FindType(uint32_t comp, uint8_t level) const { return m_params.FindType(comp, level); }
|
||||
inline FeatureParams::TTypes const & GetTypes() const { return m_params.m_Types; }
|
||||
|
||||
/// Check classificator types for their compatibility with feature geometry type.
|
||||
/// Need to call when using any classificator types manipulating.
|
||||
|
|
|
@ -26,6 +26,7 @@ class WorldMapGenerator
|
|||
deque<m2::RegionD> m_waterRegions;
|
||||
|
||||
m4::Tree<size_t> m_tree;
|
||||
map<uint32_t, size_t> m_mapTypes;
|
||||
|
||||
public:
|
||||
explicit EmitterImpl(feature::GenerateInfo const & info)
|
||||
|
@ -37,6 +38,16 @@ class WorldMapGenerator
|
|||
LOG(LINFO, ("Output World file:", info.GetTmpFileName(WORLD_FILE_NAME)));
|
||||
}
|
||||
|
||||
~EmitterImpl()
|
||||
{
|
||||
Classificator const & c = classif();
|
||||
|
||||
stringstream ss;
|
||||
for (auto const & p : m_mapTypes)
|
||||
ss << c.GetReadableObjectName(p.first) << " : " << p.second << endl;
|
||||
LOG(LINFO, ("World types:\n", ss.str()));
|
||||
}
|
||||
|
||||
void LoadWaterGeometry(string const & rawGeometryFileName)
|
||||
{
|
||||
LOG(LINFO, ("Loading water geometry:", rawGeometryFileName));
|
||||
|
@ -79,6 +90,12 @@ class WorldMapGenerator
|
|||
PushSure(fb);
|
||||
}
|
||||
|
||||
void CalcStatistics(FeatureBuilder1 const & fb)
|
||||
{
|
||||
for (uint32_t type : fb.GetTypes())
|
||||
++m_mapTypes[type];
|
||||
}
|
||||
|
||||
bool IsWaterBoundaries(FeatureBuilder1 const & fb) const
|
||||
{
|
||||
return false;
|
||||
|
@ -173,6 +190,7 @@ public:
|
|||
{
|
||||
if (m_worldBucket.NeedPushToWorld(fb))
|
||||
{
|
||||
m_worldBucket.CalcStatistics(fb);
|
||||
// skip visible water boundary
|
||||
if (m_worldBucket.IsWaterBoundaries(fb))
|
||||
return;
|
||||
|
|
|
@ -208,8 +208,8 @@ class FeatureParams : public FeatureParamsBase
|
|||
public:
|
||||
|
||||
|
||||
typedef vector<uint32_t> types_t;
|
||||
types_t m_Types;
|
||||
typedef vector<uint32_t> TTypes;
|
||||
TTypes m_Types;
|
||||
|
||||
bool m_reverseGeometry;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue