]> git.openstreetmap.org Git - nominatim.git/commitdiff
update scene builder to compile with latest libosmium
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 21 Feb 2015 15:35:54 +0000 (16:35 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 21 Feb 2015 15:35:54 +0000 (16:35 +0100)
tests/scenes/bin/Makefile
tests/scenes/bin/make_scenes.sh
tests/scenes/bin/osm2wkt.cc

index 46b18756397b7dd5d0cc4a4503f5a35d0af91c67..c65f52b8277bce1be76d6673e6263676d2d73dff 100644 (file)
@@ -1,7 +1,7 @@
 CXXFLAGS += -O3
 #CXXFLAGS += -g
 CXXFLAGS += -std=c++11 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-CXXFLAGS += -I../../../libosmium/include
+CXXFLAGS += -I../../../../libosmium/include
 
 OS:=$(shell uname -s)
 ifeq ($(OS),Darwin)
index 4ad31f31fcbae466c0b1253239487f08e39f5d20..71de870354d077c62eee042f3aff8813c0ed1d12 100755 (executable)
@@ -5,7 +5,7 @@
 
 datadir="$( cd "$( dirname "$0" )" && cd ../data && pwd )"
 
-if [! -d "$datadir" ]; then
+if [ ! -d "$datadir" ]; then
  echo "Cannot find data dir."; 
  exit -1;
 fi
index 9cf9b578539ae0644039568bd65ea734ddbc3c15..56210892e18b2841698f73fb48727a584f18862f 100644 (file)
@@ -7,23 +7,23 @@
 #include <unordered_map>
 
 #include <osmium/area/assembler.hpp>
-#include <osmium/area/collector.hpp>
+#include <osmium/area/multipolygon_collector.hpp>
 #include <osmium/area/problem_reporter_exception.hpp>
 #include <osmium/geom/wkt.hpp>
 #include <osmium/handler.hpp>
 #include <osmium/handler/node_locations_for_ways.hpp>
 #include <osmium/io/any_input.hpp>
 #include <osmium/visitor.hpp>
-#include <osmium/index/map/stl_map.hpp>
+#include <osmium/index/map/sparse_mem_array.hpp>
 
-typedef osmium::index::map::StlMap<osmium::unsigned_object_id_type, osmium::Location> index_type;
+typedef osmium::index::map::SparseMemArray<osmium::unsigned_object_id_type, osmium::Location> index_type;
 
 typedef osmium::handler::NodeLocationsForWays<index_type, index_type> location_handler_type;
 
 
 class ExportToWKTHandler : public osmium::handler::Handler {
 
-    osmium::geom::WKTFactory m_factory;
+    osmium::geom::WKTFactory<> m_factory;
     std::unordered_map<std::string, std::ofstream>  m_files;
 
 public:
@@ -70,13 +70,12 @@ int main(int argc, char* argv[]) {
 
     std::string input_filename {argv[1]};
 
-    typedef osmium::area::Assembler area_assembler_type;
     osmium::area::ProblemReporterException problem_reporter;
-    area_assembler_type assembler(&problem_reporter);
-    osmium::area::Collector<area_assembler_type> collector(assembler);
+    osmium::area::Assembler::config_type assembler_config(&problem_reporter);
+    osmium::area::MultipolygonCollector<osmium::area::Assembler> collector(assembler_config);
 
     std::cerr << "Pass 1...\n";
-    osmium::io::Reader reader1(input_filename);
+    osmium::io::Reader reader1(input_filename, osmium::osm_entity_bits::relation);
     collector.read_relations(reader1);
     std::cerr << "Pass 1 done\n";
 
@@ -87,9 +86,10 @@ int main(int argc, char* argv[]) {
     std::cerr << "Pass 2...\n";
     ExportToWKTHandler export_handler;
     osmium::io::Reader reader2(input_filename);
-    osmium::apply(reader2, location_handler, export_handler, collector.handler());
+    osmium::apply(reader2, location_handler, export_handler, collector.handler([&export_handler](osmium::memory::Buffer&& buffer) {
+        osmium::apply(buffer, export_handler);
+    }));
     reader2.close();
-    osmium::apply(collector, export_handler);
     export_handler.close();
     std::cerr << "Pass 2 done\n";