Upgrade libosmium to v2.15.6
This commit is contained in:
+33
-28
@@ -153,39 +153,44 @@ int main(int argc, char* argv[]) {
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
const std::string output_format{"SQLite"};
|
||||
const std::string input_filename{argv[1]};
|
||||
const std::string output_filename{"multipolygon.db"};
|
||||
try {
|
||||
const std::string output_format{"SQLite"};
|
||||
const std::string input_filename{argv[1]};
|
||||
const std::string output_filename{"multipolygon.db"};
|
||||
|
||||
CPLSetConfigOption("OGR_SQLITE_SYNCHRONOUS", "FALSE");
|
||||
gdalcpp::Dataset dataset{output_format, output_filename, gdalcpp::SRS{}, {"SPATIALITE=TRUE"}};
|
||||
CPLSetConfigOption("OGR_SQLITE_SYNCHRONOUS", "FALSE");
|
||||
gdalcpp::Dataset dataset{output_format, output_filename, gdalcpp::SRS{}, {"SPATIALITE=TRUE"}};
|
||||
|
||||
osmium::area::ProblemReporterOGR problem_reporter{dataset};
|
||||
osmium::area::AssemblerLegacy::config_type assembler_config;
|
||||
assembler_config.problem_reporter = &problem_reporter;
|
||||
assembler_config.check_roles = true;
|
||||
assembler_config.create_empty_areas = true;
|
||||
assembler_config.debug_level = 2;
|
||||
osmium::area::MultipolygonCollector<osmium::area::AssemblerLegacy> collector{assembler_config};
|
||||
osmium::area::ProblemReporterOGR problem_reporter{dataset};
|
||||
osmium::area::AssemblerLegacy::config_type assembler_config;
|
||||
assembler_config.problem_reporter = &problem_reporter;
|
||||
assembler_config.check_roles = true;
|
||||
assembler_config.create_empty_areas = true;
|
||||
assembler_config.debug_level = 2;
|
||||
osmium::area::MultipolygonCollector<osmium::area::AssemblerLegacy> collector{assembler_config};
|
||||
|
||||
std::cerr << "Pass 1...\n";
|
||||
osmium::io::Reader reader1{input_filename};
|
||||
collector.read_relations(reader1);
|
||||
reader1.close();
|
||||
std::cerr << "Pass 1 done\n";
|
||||
std::cerr << "Pass 1...\n";
|
||||
osmium::io::Reader reader1{input_filename};
|
||||
collector.read_relations(reader1);
|
||||
reader1.close();
|
||||
std::cerr << "Pass 1 done\n";
|
||||
|
||||
index_type index;
|
||||
location_handler_type location_handler{index};
|
||||
location_handler.ignore_errors();
|
||||
index_type index;
|
||||
location_handler_type location_handler{index};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
TestHandler test_handler{dataset};
|
||||
TestHandler test_handler{dataset};
|
||||
|
||||
std::cerr << "Pass 2...\n";
|
||||
osmium::io::Reader reader2{input_filename};
|
||||
osmium::apply(reader2, location_handler, test_handler, collector.handler([&test_handler](const osmium::memory::Buffer& area_buffer) {
|
||||
osmium::apply(area_buffer, test_handler);
|
||||
}));
|
||||
reader2.close();
|
||||
std::cerr << "Pass 2 done\n";
|
||||
std::cerr << "Pass 2...\n";
|
||||
osmium::io::Reader reader2{input_filename};
|
||||
osmium::apply(reader2, location_handler, test_handler, collector.handler([&test_handler](const osmium::memory::Buffer& area_buffer) {
|
||||
osmium::apply(area_buffer, test_handler);
|
||||
}));
|
||||
reader2.close();
|
||||
std::cerr << "Pass 2 done\n";
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << e.what() << '\n';
|
||||
std::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-13
@@ -79,23 +79,28 @@ int main(int argc, char* argv[]) {
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
const std::string output_format{"SQLite"};
|
||||
const std::string input_filename{argv[1]};
|
||||
const std::string output_filename{"testdata-overview.db"};
|
||||
::unlink(output_filename.c_str());
|
||||
try {
|
||||
const std::string output_format{"SQLite"};
|
||||
const std::string input_filename{argv[1]};
|
||||
const std::string output_filename{"testdata-overview.db"};
|
||||
::unlink(output_filename.c_str());
|
||||
|
||||
CPLSetConfigOption("OGR_SQLITE_SYNCHRONOUS", "FALSE");
|
||||
gdalcpp::Dataset dataset{output_format, output_filename, gdalcpp::SRS{}, {"SPATIALITE=TRUE"}};
|
||||
CPLSetConfigOption("OGR_SQLITE_SYNCHRONOUS", "FALSE");
|
||||
gdalcpp::Dataset dataset{output_format, output_filename, gdalcpp::SRS{}, {"SPATIALITE=TRUE"}};
|
||||
|
||||
osmium::io::Reader reader{input_filename};
|
||||
osmium::io::Reader reader{input_filename};
|
||||
|
||||
index_type index;
|
||||
location_handler_type location_handler{index};
|
||||
location_handler.ignore_errors();
|
||||
index_type index;
|
||||
location_handler_type location_handler{index};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
TestOverviewHandler handler{dataset};
|
||||
TestOverviewHandler handler{dataset};
|
||||
|
||||
osmium::apply(reader, location_handler, handler);
|
||||
reader.close();
|
||||
osmium::apply(reader, location_handler, handler);
|
||||
reader.close();
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << e.what() << '\n';
|
||||
std::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,11 @@ int main(int argc, char* argv[]) {
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
return Catch::Session().run(argc, argv);
|
||||
try {
|
||||
return Catch::Session().run(argc, argv);
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << e.what() << '\n';
|
||||
std::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ static std::string read_file(const char* test_id) {
|
||||
assert(fd >= 0);
|
||||
|
||||
std::string input(10000, '\0');
|
||||
const auto n = ::read(fd, reinterpret_cast<unsigned char*>(const_cast<char*>(input.data())), 10000);
|
||||
const auto n = ::read(fd, &*input.begin(), 10000);
|
||||
assert(n >= 0);
|
||||
input.resize(static_cast<std::string::size_type>(n));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user