summaryrefslogtreecommitdiff
path: root/tagstats
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2012-07-13 17:18:50 +0200
committerJochen Topf <jochen@topf.org>2012-07-13 17:18:50 +0200
commit6ccd712b65cfe5374ecbfdaf984c002d7a6ac594 (patch)
tree29f25c8802c54abb63337d3b89230107785e3ebc /tagstats
parent6e7eac0a71018fff0f71bb991eec03ce41a25415 (diff)
downloadtaginfo-6ccd712b65cfe5374ecbfdaf984c002d7a6ac594.tar
taginfo-6ccd712b65cfe5374ecbfdaf984c002d7a6ac594.tar.gz
Make tagstats work with current Osmium
Diffstat (limited to 'tagstats')
-rw-r--r--tagstats/Makefile14
-rw-r--r--tagstats/tagstats.cpp6
2 files changed, 14 insertions, 6 deletions
diff --git a/tagstats/Makefile b/tagstats/Makefile
index 68ec3a8..6f50d93 100644
--- a/tagstats/Makefile
+++ b/tagstats/Makefile
@@ -17,9 +17,17 @@ CXXFLAGS += -DTAGSTATS_COUNT_KEY_COMBINATIONS
CXXFLAGS += -DTAGSTATS_COUNT_TAG_COMBINATIONS
CXXFLAGS += -DTAGSTATS_GEODISTRIBUTION_INT=uint16_t
-CXXFLAGS += -DTAGSTATS_GEODISTRIBUTION_FOR_WAYS=`../bin/taginfo-config.rb tagstats.geodistribution`
-#CXXFLAGS += -DTAGSTATS_GEODISTRIBUTION_FOR_WAYS=SparseTable
-#CXXFLAGS += -DTAGSTATS_GEODISTRIBUTION_FOR_WAYS=Mmap
+
+BYID := $(shell ../bin/taginfo-config.rb tagstats.geodistribution)
+#BYID := SparseTable
+#BYID := MmapFile
+#BYID := MmapAnon
+
+BYID_LC := $(shell echo $(BYID) | sed -e 's/\([A-Z]\)/_\0/g' | cut -c2- | tr 'A-Z' 'a-z')
+BYID_INCL := "<osmium/storage/byid/$(BYID_LC).hpp>"
+
+CXXFLAGS += -DTAGSTATS_GEODISTRIBUTION_FOR_WAYS=$(BYID)
+CXXFLAGS += -DTAGSTATS_GEODISTRIBUTION_INCLUDE=$(BYID_INCL)
CXXFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
diff --git a/tagstats/tagstats.cpp b/tagstats/tagstats.cpp
index a8c32d5..bacdfdc 100644
--- a/tagstats/tagstats.cpp
+++ b/tagstats/tagstats.cpp
@@ -33,10 +33,10 @@ You should have received a copy of the Licenses along with Osmium. If not, see
*/
typedef TAGSTATS_GEODISTRIBUTION_INT rough_position_t;
+// Set BYID in Makefile to SparseTable, MmapFile, or MmapAnon
#ifdef TAGSTATS_GEODISTRIBUTION_FOR_WAYS
-# include <osmium/storage/byid.hpp>
-// Set TAGSTATS_GEODISTRIBUTION_STORAGE to SparseTable or Mmap in Makefile
-typedef Osmium::Storage::TAGSTATS_GEODISTRIBUTION_FOR_WAYS<rough_position_t> storage_t;
+# include TAGSTATS_GEODISTRIBUTION_INCLUDE
+typedef Osmium::Storage::ById::TAGSTATS_GEODISTRIBUTION_FOR_WAYS<rough_position_t> storage_t;
#endif // TAGSTATS_GEODISTRIBUTION_FOR_WAYS
#include "geodistribution.hpp"