From 1da1bbf121104c29fc3c9265d6f4156c48d688d5 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sat, 17 May 2014 14:51:02 +0200 Subject: Make compilation not conditional on TAGSTATS_GEODISTRIBUTION_FOR_WAYS --- tagstats/tagstats.cpp | 4 +--- tagstats/tagstats_handler.hpp | 17 ++--------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/tagstats/tagstats.cpp b/tagstats/tagstats.cpp index f5c349a..2ebae5e 100644 --- a/tagstats/tagstats.cpp +++ b/tagstats/tagstats.cpp @@ -36,10 +36,8 @@ typedef TAGSTATS_GEODISTRIBUTION_INT rough_position_t; // Set BYID in Makefile to SparseTable, MmapFile, or MmapAnon -#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS -# include TAGSTATS_GEODISTRIBUTION_INCLUDE +#include TAGSTATS_GEODISTRIBUTION_INCLUDE typedef Osmium::Storage::ById::TAGSTATS_GEODISTRIBUTION_FOR_WAYS storage_t; -#endif // TAGSTATS_GEODISTRIBUTION_FOR_WAYS #include "geodistribution.hpp" diff --git a/tagstats/tagstats_handler.hpp b/tagstats/tagstats_handler.hpp index 022a4bb..846d86b 100644 --- a/tagstats/tagstats_handler.hpp +++ b/tagstats/tagstats_handler.hpp @@ -456,11 +456,7 @@ class TagStatsHandler : public Osmium::Handler::Base { gd_it->second->add_coordinate(location); } } -#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS 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? const Osmium::OSM::WayNodeList& wnl = static_cast(object).nodes(); if (!wnl.empty()) { key_value_geodistribution_hash_map_t::iterator gd_it = m_key_value_geodistribution.find(keyvalue); @@ -473,7 +469,6 @@ class TagStatsHandler : public Osmium::Handler::Base { } } } -#endif // TAGSTATS_GEODISTRIBUTION_FOR_WAYS } _update_key_combination_hash(object.type(), begin, end); @@ -484,9 +479,7 @@ class TagStatsHandler : public Osmium::Handler::Base { MapToInt m_map_to_int; -#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS storage_t m_storage; -#endif public: @@ -497,10 +490,8 @@ public: m_string_store(string_store_size), m_database(database), statistics_handler(database), - m_map_to_int(map_to_int) -#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS - , m_storage() -#endif + m_map_to_int(map_to_int), + m_storage() { if (!selection_database_name.empty()) { Sqlite::Database sdb(selection_database_name.c_str(), SQLITE_OPEN_READONLY); @@ -540,9 +531,7 @@ public: void node(const shared_ptr& node) { statistics_handler.node(node); collect_tag_stats(*node); -#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS m_storage.set(node->id(), m_map_to_int(node->position())); -#endif } void way(const shared_ptr& way) { @@ -599,10 +588,8 @@ public: void after_ways() { _timer_info("processing ways"); -#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS _print_and_clear_key_distribution_images(false); _print_and_clear_tag_distribution_images(false); -#endif _print_memory_usage(); } -- cgit v1.2.3