summaryrefslogtreecommitdiff
path: root/tagstats
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-05-13 23:34:53 +0200
committerJochen Topf <jochen@topf.org>2014-05-13 23:34:53 +0200
commitcdb4f187b2e30cdad308381c7d5df62411808900 (patch)
tree85963d18638d979b7fd0c5463bd9086ea6a7caf3 /tagstats
parentee925d7011aadb6ac2a3c85353d68964d0d292be (diff)
downloadtaginfo-cdb4f187b2e30cdad308381c7d5df62411808900.tar
taginfo-cdb4f187b2e30cdad308381c7d5df62411808900.tar.gz
Add all positions in ways to map, not just the first one.
Diffstat (limited to 'tagstats')
-rw-r--r--tagstats/tagstats_handler.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tagstats/tagstats_handler.hpp b/tagstats/tagstats_handler.hpp
index a62218a..a03467c 100644
--- a/tagstats/tagstats_handler.hpp
+++ b/tagstats/tagstats_handler.hpp
@@ -471,11 +471,13 @@ class TagStatsHandler : public Osmium::Handler::Base {
// coordinates of all nodes?
const Osmium::OSM::WayNodeList& wnl = static_cast<const Osmium::OSM::Way&>(object).nodes();
if (!wnl.empty()) {
- rough_position_t location = m_storage[wnl.front().ref()];
- stat->distribution.add_coordinate(location);
key_value_geodistribution_hash_map_t::iterator gd_it = m_key_value_geodistribution.find(keyvalue.c_str());
- if (gd_it != m_key_value_geodistribution.end()) {
- gd_it->second->add_coordinate(location);
+ for (Osmium::OSM::WayNodeList::const_iterator it = wnl.begin(); it != wnl.end(); ++it) {
+ rough_position_t location = m_storage[it->ref()];
+ stat->distribution.add_coordinate(location);
+ if (gd_it != m_key_value_geodistribution.end()) {
+ gd_it->second->add_coordinate(location);
+ }
}
}
}