diff -Nru osmcoastline-2.2.2/CHANGELOG.md osmcoastline-2.2.3/CHANGELOG.md --- osmcoastline-2.2.2/CHANGELOG.md 2019-02-03 08:23:18.000000000 +0000 +++ osmcoastline-2.2.3/CHANGELOG.md 2019-02-06 10:31:01.000000000 +0000 @@ -13,6 +13,14 @@ ### Fixed +## [2.2.3] - 2018-02-06 + +### Fixed + +- Compile with `NDEBUG` in `RelWithDebInfo` mode. +- Better error reporting on some exceptions. + + ## [2.2.2] - 2018-02-03 ### Fixed @@ -140,7 +148,10 @@ - Added man pages -[unreleased]: https://github.com/osmcode/osmium-tool/compare/v2.2.0...HEAD +[unreleased]: https://github.com/osmcode/osmium-tool/compare/v2.2.3...HEAD +[2.2.3]: https://github.com/osmcode/osmium-tool/compare/v2.2.2...v2.2.3 +[2.2.2]: https://github.com/osmcode/osmium-tool/compare/v2.2.1...v2.2.2 +[2.2.1]: https://github.com/osmcode/osmium-tool/compare/v2.2.0...v2.2.1 [2.2.0]: https://github.com/osmcode/osmium-tool/compare/v2.1.4...v2.2.0 [2.1.4]: https://github.com/osmcode/osmium-tool/compare/v2.1.3...v2.1.4 [2.1.3]: https://github.com/osmcode/osmium-tool/compare/v2.1.2...v2.1.3 diff -Nru osmcoastline-2.2.2/CMakeLists.txt osmcoastline-2.2.3/CMakeLists.txt --- osmcoastline-2.2.2/CMakeLists.txt 2019-02-03 08:23:18.000000000 +0000 +++ osmcoastline-2.2.3/CMakeLists.txt 2019-02-06 10:31:01.000000000 +0000 @@ -20,7 +20,7 @@ set(OSMCOASTLINE_VERSION_MAJOR 2) set(OSMCOASTLINE_VERSION_MINOR 2) -set(OSMCOASTLINE_VERSION_PATCH 2) +set(OSMCOASTLINE_VERSION_PATCH 3) set(OSMCOASTLINE_VERSION ${OSMCOASTLINE_VERSION_MAJOR}.${OSMCOASTLINE_VERSION_MINOR}.${OSMCOASTLINE_VERSION_PATCH}) @@ -75,9 +75,11 @@ # #----------------------------------------------------------------------------- if(MSVC) - set(USUAL_COMPILE_OPTIONS "/Ox") + set(DEV_COMPILE_OPTIONS "/Ox") + set(RWD_COMPILE_OPTIONS "/Ox /DNDEBUG") else() - set(USUAL_COMPILE_OPTIONS "-O3 -g") + set(DEV_COMPILE_OPTIONS "-O3 -g") + set(RWD_COMPILE_OPTIONS "-O3 -g -DNDEBUG") endif() if(WIN32) @@ -85,7 +87,7 @@ -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0600) endif() -set(CMAKE_CXX_FLAGS_DEV "${USUAL_COMPILE_OPTIONS}" +set(CMAKE_CXX_FLAGS_DEV "${DEV_COMPILE_OPTIONS}" CACHE STRING "Flags used by the compiler during developer builds." FORCE) @@ -97,7 +99,7 @@ CMAKE_EXE_LINKER_FLAGS_DEV ) -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${USUAL_COMPILE_OPTIONS}" +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${RWD_COMPILE_OPTIONS}" CACHE STRING "Flags used by the compiler during RELWITHDEBINFO builds." FORCE) diff -Nru osmcoastline-2.2.2/debian/changelog osmcoastline-2.2.3/debian/changelog --- osmcoastline-2.2.2/debian/changelog 2019-02-03 18:30:14.000000000 +0000 +++ osmcoastline-2.2.3/debian/changelog 2019-02-06 15:34:36.000000000 +0000 @@ -1,3 +1,11 @@ +osmcoastline (2.2.3-1) unstable; urgency=medium + + * New upstream release. + * Add -DCMAKE_BUILD_TYPE=RelWithDebInfo CMake option. + * Drop unused lintian overrides. + + -- Bas Couwenberg Wed, 06 Feb 2019 16:34:36 +0100 + osmcoastline (2.2.2-1) unstable; urgency=medium * New upstream release. diff -Nru osmcoastline-2.2.2/debian/osmcoastline.lintian-overrides osmcoastline-2.2.3/debian/osmcoastline.lintian-overrides --- osmcoastline-2.2.2/debian/osmcoastline.lintian-overrides 2019-02-03 18:30:14.000000000 +0000 +++ osmcoastline-2.2.3/debian/osmcoastline.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# Build uses -D_FORTIFY_SOURCE=2, but hardening-check reports: -# Fortify Source functions: no, only unprotected functions found! -osmcoastline: hardening-no-fortify-functions * - -# https://github.com/osmcode/osmcoastline/issues/33 -osmcoastline: file-references-package-build-path usr/bin/osmcoastline - diff -Nru osmcoastline-2.2.2/debian/rules osmcoastline-2.2.3/debian/rules --- osmcoastline-2.2.2/debian/rules 2018-12-17 09:18:12.000000000 +0000 +++ osmcoastline-2.2.3/debian/rules 2019-02-06 15:34:36.000000000 +0000 @@ -10,7 +10,7 @@ --parallel override_dh_auto_configure: - dh_auto_configure -- -DCMAKE_VERBOSE_MAKEFILE=1 + dh_auto_configure -- -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo override_dh_auto_test: dh_auto_test diff -Nru osmcoastline-2.2.2/src/osmcoastline.cpp osmcoastline-2.2.3/src/osmcoastline.cpp --- osmcoastline-2.2.2/src/osmcoastline.cpp 2019-02-03 08:23:18.000000000 +0000 +++ osmcoastline-2.2.3/src/osmcoastline.cpp 2019-02-06 10:31:01.000000000 +0000 @@ -153,6 +153,15 @@ /* ================================================== */ +std::unique_ptr open_output_database(const std::string& name, const bool create_index) try { + return std::unique_ptr{new OutputDatabase{name, srs, create_index}}; +} catch (const std::exception& e) { + std::cerr << e.what() << '\n'; + std::exit(return_code_fatal); +} + +/* ================================================== */ + int main(int argc, char *argv[]) { Stats stats{}; unsigned int warnings = 0; @@ -201,7 +210,8 @@ } else { vout << "Will NOT create geometry index (because you told me to using --no-index/-i).\n"; } - OutputDatabase output_database{options.output_database, srs, options.create_index}; + + auto output_database = open_output_database(options.output_database, options.create_index); // The collection of all coastline rings we will be filling and then // operating on. @@ -253,7 +263,7 @@ for (const auto& node : buffer.select()) { if (node.tags().has_tag("natural", "coastline")) { try { - output_database.add_error_point(factory.create_point(node), "tagged_node", node.id()); + output_database->add_error_point(factory.create_point(node), "tagged_node", node.id()); } catch (const osmium::geometry_error&) { std::cerr << "Ignoring illegal geometry for node " << node.id() << ".\n"; } @@ -267,7 +277,7 @@ } reader2.close(); } catch (const std::exception& e) { - vout << e.what() << '\n'; + std::cerr << e.what() << '\n'; std::exit(return_code_fatal); } @@ -282,10 +292,10 @@ vout << memory_usage(); - output_database.set_options(options); + output_database->set_options(options); vout << "Check line segments for intersections and overlaps...\n"; - warnings += coastline_rings.check_for_intersections(output_database, segments_fd); + warnings += coastline_rings.check_for_intersections(*output_database, segments_fd); if (segments_fd != -1) { ::close(segments_fd); @@ -301,7 +311,7 @@ if (options.close_rings) { vout << "Close broken rings... (Use --close-distance/-c 0 if you do not want this.)\n"; vout << " Closing if distance between nodes smaller than " << options.close_distance << ". (Set this with --close-distance/-c.)\n"; - coastline_rings.close_rings(output_database, options.debug, options.close_distance); + coastline_rings.close_rings(*output_database, options.debug, options.close_distance); stats.rings_fixed = coastline_rings.num_fixed_rings(); errors += coastline_rings.num_fixed_rings(); vout << " Closed " << coastline_rings.num_fixed_rings() << " rings. This left " @@ -313,7 +323,7 @@ if (options.output_rings) { vout << "Writing out rings... (Because you gave the --output-rings/-r option.)\n"; - warnings += coastline_rings.output_rings(output_database); + warnings += coastline_rings.output_rings(*output_database); } else { vout << "Not writing out rings. (Use option --output-rings/-r if you want the rings.)\n"; } @@ -321,8 +331,8 @@ if (options.output_polygons != output_polygon_type::none || options.output_lines) { try { vout << "Create polygons...\n"; - CoastlinePolygons coastline_polygons{create_polygons(coastline_rings, output_database, &warnings, &errors), \ - output_database, \ + CoastlinePolygons coastline_polygons{create_polygons(coastline_rings, *output_database, &warnings, &errors), \ + *output_database, \ options.bbox_overlap, \ options.max_points_in_polygon}; @@ -348,7 +358,7 @@ if (options.output_polygons != output_polygon_type::none) { if (options.epsg == 4326) { vout << "Checking for questionable input data...\n"; - const unsigned int questionable = coastline_rings.output_questionable(coastline_polygons, output_database); + const unsigned int questionable = coastline_rings.output_questionable(coastline_polygons, *output_database); warnings += questionable; vout << " Found " << questionable << " rings in input data.\n"; } else { @@ -387,8 +397,8 @@ vout << memory_usage(); vout << "Committing database transactions...\n"; - output_database.set_meta(vout.runtime(), osmium::MemoryUsage{}.peak(), stats); - output_database.commit(); + output_database->set_meta(vout.runtime(), osmium::MemoryUsage{}.peak(), stats); + output_database->commit(); vout << "All done.\n"; vout << memory_usage();