summaryrefslogtreecommitdiff
path: root/tagstats
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-10-05 18:52:12 +0200
committerJochen Topf <jochen@topf.org>2013-10-05 18:52:12 +0200
commit276bc579a294d3662ff9aed8b499512b032db50f (patch)
tree71165a57993d54fbb01ce9df05eb46ba42c1cd99 /tagstats
parent8c4abe5c452b55a5768938e7f766a023d4448022 (diff)
downloadtaginfo-276bc579a294d3662ff9aed8b499512b032db50f.tar
taginfo-276bc579a294d3662ff9aed8b499512b032db50f.tar.gz
Fixes #35
Diffstat (limited to 'tagstats')
-rw-r--r--tagstats/tagstats_handler.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tagstats/tagstats_handler.hpp b/tagstats/tagstats_handler.hpp
index 40ed03b..4049083 100644
--- a/tagstats/tagstats_handler.hpp
+++ b/tagstats/tagstats_handler.hpp
@@ -423,7 +423,10 @@ class TagStatsHandler : public Osmium::Handler::Base {
// 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?
- stat->distribution.add_coordinate(m_storage[static_cast<const Osmium::OSM::Way&>(object).nodes().front().ref()]);
+ const Osmium::OSM::WayNodeList& wnl = static_cast<const Osmium::OSM::Way&>(object).nodes();
+ if (!wnl.empty()) {
+ stat->distribution.add_coordinate(m_storage[wnl.front().ref()]);
+ }
}
#endif // TAGSTATS_GEODISTRIBUTION_FOR_WAYS
}