summaryrefslogtreecommitdiff
path: root/tagstats
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2012-08-19 23:49:25 +0200
committerJochen Topf <jochen@topf.org>2012-08-19 23:49:25 +0200
commit1737c51ce067d18c154c49cb725ff351467d5c44 (patch)
tree6fed92669a0ec069fbe6de642d28464122ec867f /tagstats
parentcef0cf6c71eb9c5a103c53e1185ff6182ab4e0e9 (diff)
downloadtaginfo-1737c51ce067d18c154c49cb725ff351467d5c44.tar
taginfo-1737c51ce067d18c154c49cb725ff351467d5c44.tar.gz
Changes for current Osmium version
Diffstat (limited to 'tagstats')
-rw-r--r--tagstats/statistics_handler.hpp6
-rw-r--r--tagstats/tagstats_handler.hpp28
2 files changed, 17 insertions, 17 deletions
diff --git a/tagstats/statistics_handler.hpp b/tagstats/statistics_handler.hpp
index 93132c0..f1ece07 100644
--- a/tagstats/statistics_handler.hpp
+++ b/tagstats/statistics_handler.hpp
@@ -101,12 +101,12 @@ public:
m_stats.max_way_id = m_id;
}
m_stats.way_tags += m_tag_count;
- m_stats.way_nodes += way->node_count();
+ m_stats.way_nodes += way->nodes().size();
if (m_tag_count > (int64_t) m_stats.max_tags_on_way) {
m_stats.max_tags_on_way = m_tag_count;
}
- if (way->node_count() > (int64_t) m_stats.max_nodes_on_way) {
- m_stats.max_nodes_on_way = way->node_count();
+ if (way->nodes().size() > (int64_t) m_stats.max_nodes_on_way) {
+ m_stats.max_nodes_on_way = way->nodes().size();
}
if (m_version > (int64_t) m_stats.max_way_version) {
m_stats.max_way_version = m_version;
diff --git a/tagstats/tagstats_handler.hpp b/tagstats/tagstats_handler.hpp
index 3072c04..29858d0 100644
--- a/tagstats/tagstats_handler.hpp
+++ b/tagstats/tagstats_handler.hpp
@@ -132,18 +132,18 @@ public:
}
void update(const char* value, const Osmium::OSM::Object& object, StringStore& string_store) {
- key.count[object.get_type()]++;
+ key.count[object.type()]++;
value_hash_map_t::iterator values_iterator(values_hash.find(value));
if (values_iterator == values_hash.end()) {
Counter counter;
- counter.count[object.get_type()] = 1;
+ counter.count[object.type()] = 1;
values_hash.insert(std::pair<const char*, Counter>(string_store.add(value), counter));
- values.count[object.get_type()]++;
+ values.count[object.type()]++;
} else {
- values_iterator->second.count[object.get_type()]++;
- if (values_iterator->second.count[object.get_type()] == 1) {
- values.count[object.get_type()]++;
+ values_iterator->second.count[object.type()]++;
+ if (values_iterator->second.count[object.type()] == 1) {
+ values.count[object.type()]++;
}
}
@@ -227,9 +227,9 @@ class TagStatsHandler : public Osmium::Handler::Base {
key2 = object.tags().get_tag_key(j);
key_hash_map_t::iterator tsi2(tags_stat.find(key2));
if (strcmp(key1, key2) < 0) {
- tsi1->second->add_key_combination(tsi2->first, object.get_type());
+ tsi1->second->add_key_combination(tsi2->first, object.type());
} else {
- tsi2->second->add_key_combination(tsi1->first, object.get_type());
+ tsi2->second->add_key_combination(tsi1->first, object.type());
}
}
}
@@ -244,9 +244,9 @@ class TagStatsHandler : public Osmium::Handler::Base {
key_value_hash_map_t::iterator kvi2 = m_key_value_stats.find(key_value2.c_str());
if (kvi2 != m_key_value_stats.end()) {
if (key_value1 < key_value2) {
- kvi1->second->add_key_combination(kvi2->first, object.get_type());
+ kvi1->second->add_key_combination(kvi2->first, object.type());
} else {
- kvi2->second->add_key_combination(kvi1->first, object.get_type());
+ kvi2->second->add_key_combination(kvi1->first, object.type());
}
}
@@ -256,9 +256,9 @@ class TagStatsHandler : public Osmium::Handler::Base {
kvi2 = m_key_value_stats.find(key_value2.c_str());
if (kvi2 != m_key_value_stats.end()) {
if (key_value1 < key_value2) {
- kvi1->second->add_key_combination(kvi2->first, object.get_type());
+ kvi1->second->add_key_combination(kvi2->first, object.type());
} else {
- kvi2->second->add_key_combination(kvi1->first, object.get_type());
+ kvi2->second->add_key_combination(kvi1->first, object.type());
}
}
}
@@ -364,7 +364,7 @@ class TagStatsHandler : public Osmium::Handler::Base {
}
stat->update(it->value(), object, m_string_store);
- if (object.get_type() == NODE) {
+ if (object.type() == NODE) {
try {
stat->distribution.add_coordinate(m_map_to_int(static_cast<const Osmium::OSM::Node&>(object).position()));
} catch (std::range_error) {
@@ -372,7 +372,7 @@ class TagStatsHandler : public Osmium::Handler::Base {
}
}
#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS
- else if (object.get_type() == WAY) {
+ else if (object.type() == WAY) {
// This will only add the coordinate of the first node in a way to the
// distribution. We'll see how this goes, maybe we need to store the
// coordinates of all nodes?