diff options
-rw-r--r-- | tagstats/tagstats_handler.hpp | 10 |
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); + } } } } |