summaryrefslogtreecommitdiff
path: root/tagstats/tagstats_handler.hpp
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2011-10-15 23:00:38 +0200
committerJochen Topf <jochen@topf.org>2011-10-15 23:00:38 +0200
commitc9b9a1b03efa73e28fb8929272d464c1684e9d8f (patch)
tree16cd0ae926b07dbf377a55b386130e2774216340 /tagstats/tagstats_handler.hpp
parent8d1d99e8e85e1796da25556fb5760fde875cfe68 (diff)
downloadtaginfo-c9b9a1b03efa73e28fb8929272d464c1684e9d8f.tar
taginfo-c9b9a1b03efa73e28fb8929272d464c1684e9d8f.tar.gz
Moved statistics handler over from Osmium
The statistics handler was kept in the Osmium distribution, but it makes more sense here.
Diffstat (limited to 'tagstats/tagstats_handler.hpp')
-rw-r--r--tagstats/tagstats_handler.hpp34
1 files changed, 28 insertions, 6 deletions
diff --git a/tagstats/tagstats_handler.hpp b/tagstats/tagstats_handler.hpp
index 75b4e65..2e66853 100644
--- a/tagstats/tagstats_handler.hpp
+++ b/tagstats/tagstats_handler.hpp
@@ -1,6 +1,28 @@
#ifndef TAGSTATS_HANDLER_HPP
#define TAGSTATS_HANDLER_HPP
+/*
+
+Copyright 2011 Jochen Topf <jochen@topf.org> and others (see README).
+
+This file is part of Taginfo (https://github.com/joto/taginfo).
+
+Osmium is free software: you can redistribute it and/or modify it under the
+terms of the GNU Lesser General Public License or (at your option) the GNU
+General Public License as published by the Free Software Foundation, either
+version 3 of the Licenses, or (at your option) any later version.
+
+Osmium is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU Lesser General Public License and the GNU
+General Public License for more details.
+
+You should have received a copy of the Licenses along with Osmium. If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+
#include <google/sparse_hash_map>
#include <string>
#include <fstream>
@@ -282,7 +304,7 @@ class TagStatsHandler : public Osmium::Handler::Base {
#endif // TAGSTATS_COUNT_KEY_COMBINATIONS
}
- Osmium::Handler::Statistics osmium_handler_stats;
+ StatisticsHandler statistics_handler;
MapToInt<rough_position_t> m_map_to_int;
@@ -295,7 +317,7 @@ public:
TagStatsHandler(MapToInt<rough_position_t>& map_to_int) :
Base(),
max_timestamp(0),
- osmium_handler_stats(),
+ statistics_handler(),
m_map_to_int(map_to_int)
#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS
, m_storage()
@@ -311,7 +333,7 @@ public:
}
void node(Osmium::OSM::Node* node) {
- osmium_handler_stats.node(node);
+ statistics_handler.node(node);
collect_tag_stats(node);
#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS
try {
@@ -323,12 +345,12 @@ public:
}
void way(Osmium::OSM::Way* way) {
- osmium_handler_stats.way(way);
+ statistics_handler.way(way);
collect_tag_stats(way);
}
void relation(Osmium::OSM::Relation* relation) {
- osmium_handler_stats.relation(relation);
+ statistics_handler.relation(relation);
collect_tag_stats(relation);
}
@@ -396,7 +418,7 @@ public:
}
void final() {
- osmium_handler_stats.final();
+ statistics_handler.final();
_print_memory_usage();
timer = time(0);