X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/86d90bc46005c00f2367ad759804f528adc4c6a5..97c572b92f5e09d646ce045a949e40d53f87243a:/tests/scenes/bin/osm2wkt.cc diff --git a/tests/scenes/bin/osm2wkt.cc b/tests/scenes/bin/osm2wkt.cc index 9cf9b578..56210892 100644 --- a/tests/scenes/bin/osm2wkt.cc +++ b/tests/scenes/bin/osm2wkt.cc @@ -7,23 +7,23 @@ #include #include -#include +#include #include #include #include #include #include #include -#include +#include -typedef osmium::index::map::StlMap index_type; +typedef osmium::index::map::SparseMemArray index_type; typedef osmium::handler::NodeLocationsForWays location_handler_type; class ExportToWKTHandler : public osmium::handler::Handler { - osmium::geom::WKTFactory m_factory; + osmium::geom::WKTFactory<> m_factory; std::unordered_map 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 collector(assembler); + osmium::area::Assembler::config_type assembler_config(&problem_reporter); + osmium::area::MultipolygonCollector 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";