diff options
author | Jochen Topf <jochen@topf.org> | 2013-10-07 18:36:15 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-10-07 18:36:15 +0200 |
commit | a1d5747cfd8144da30b42054a6587377736a6ed3 (patch) | |
tree | 00efb5a00a5ca7116cbf38a41f31b81af9dbebbf /tagstats/tagstats_handler.hpp | |
parent | c16b94047a36a6738c6f95eb24deddf6519cd1af (diff) | |
download | taginfo-a1d5747cfd8144da30b42054a6587377736a6ed3.tar taginfo-a1d5747cfd8144da30b42054a6587377736a6ed3.tar.gz |
Make min_tag_combination_count configurable at runtime
Diffstat (limited to 'tagstats/tagstats_handler.hpp')
-rw-r--r-- | tagstats/tagstats_handler.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tagstats/tagstats_handler.hpp b/tagstats/tagstats_handler.hpp index d3ea136..4069dd1 100644 --- a/tagstats/tagstats_handler.hpp +++ b/tagstats/tagstats_handler.hpp @@ -243,7 +243,7 @@ class TagStatsHandler : public Osmium::Handler::Base { * Tag combination not appearing at least this often are not written * to database. */ - static const unsigned int min_tag_combination_count = 1000; + unsigned int m_min_tag_combination_count; time_t timer; @@ -446,8 +446,9 @@ class TagStatsHandler : public Osmium::Handler::Base { public: - TagStatsHandler(Sqlite::Database& database, const std::string& tags_list, const std::string& relation_type_list, MapToInt<rough_position_t>& map_to_int) : + TagStatsHandler(Sqlite::Database& database, const std::string& tags_list, const std::string& relation_type_list, MapToInt<rough_position_t>& map_to_int, unsigned int min_tag_combination_count) : Base(), + m_min_tag_combination_count(min_tag_combination_count), m_max_timestamp(0), m_string_store(string_store_size), m_database(database), @@ -691,7 +692,7 @@ public: for (combination_hash_map_t::const_iterator it = stat->m_key_value_combination_hash.begin(); it != stat->m_key_value_combination_hash.end(); ++it) { const Counter* s = &(it->second); - if (s->all() >= min_tag_combination_count) { + if (s->all() >= m_min_tag_combination_count) { std::vector<std::string> kv2; boost::split(kv2, it->first, boost::is_any_of("=")); kv2.push_back(""); // if there is no = in key, make sure there is an empty value |