[Git][debian-gis-team/osmcoastline][upstream] New upstream version 2.2.4

Bas Couwenberg gitlab at salsa.debian.org
Wed Feb 27 17:02:24 GMT 2019


Bas Couwenberg pushed to branch upstream at Debian GIS Project / osmcoastline


Commits:
042d0cc0 by Bas Couwenberg at 2019-02-27T16:55:33Z
New upstream version 2.2.4
- - - - -


7 changed files:

- .gitignore
- CHANGELOG.md
- CMakeLists.txt
- src/coastline_ring.cpp
- src/osmcoastline_filter.cpp
- src/osmcoastline_segments.cpp
- src/osmcoastline_ways.cpp


Changes:

=====================================
.gitignore
=====================================
@@ -1,2 +1,3 @@
+build
 *.swp
 .ycm_extra_conf.pyc


=====================================
CHANGELOG.md
=====================================
@@ -13,7 +13,19 @@ This project adheres to [Semantic Versioning](https://semver.org/).
 ### Fixed
 
 
-## [2.2.3] - 2018-02-06
+## [2.2.4] - 2019-02-27
+
+### Changed
+
+- Also look for newer clang-tidy versions in CMake config.
+
+### Fixed
+
+- Put Antarctic closure to exactly +/- 180 degree longitude.
+- Add try/catch around most of main so we don't end with exception.
+
+
+## [2.2.3] - 2019-02-06
 
 ### Fixed
 
@@ -21,7 +33,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
 - Better error reporting on some exceptions.
 
 
-## [2.2.2] - 2018-02-03
+## [2.2.2] - 2019-02-03
 
 ### Fixed
 
@@ -148,7 +160,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
 - Added man pages
 
 
-[unreleased]: https://github.com/osmcode/osmium-tool/compare/v2.2.3...HEAD
+[unreleased]: https://github.com/osmcode/osmium-tool/compare/v2.2.4...HEAD
+[2.2.4]: https://github.com/osmcode/osmium-tool/compare/v2.2.3...v2.2.4
 [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


=====================================
CMakeLists.txt
=====================================
@@ -20,7 +20,7 @@ project(osmcoastline)
 
 set(OSMCOASTLINE_VERSION_MAJOR 2)
 set(OSMCOASTLINE_VERSION_MINOR 2)
-set(OSMCOASTLINE_VERSION_PATCH 3)
+set(OSMCOASTLINE_VERSION_PATCH 4)
 
 set(OSMCOASTLINE_VERSION
     ${OSMCOASTLINE_VERSION_MAJOR}.${OSMCOASTLINE_VERSION_MINOR}.${OSMCOASTLINE_VERSION_PATCH})
@@ -138,7 +138,7 @@ set(CMAKE_BUILD_TYPE ${build_type}
 #
 #-----------------------------------------------------------------------------
 message(STATUS "Looking for clang-tidy")
-find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-6.0 clang-tidy-5.0)
+find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-7 clang-tidy-7.0 clang-tidy-6.0 clang-tidy-5.0)
 
 if(CLANG_TIDY)
     message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")


=====================================
src/coastline_ring.cpp
=====================================
@@ -98,7 +98,7 @@ void CoastlineRing::close_antarctica_ring(int epsg) {
     const double min = epsg == 4326 ? -90.0 : -85.0511288;
 
     for (int lat = -78; lat > int(min); --lat) {
-        m_way_node_list.emplace_back(0, osmium::Location{-179.99999, double(lat)});
+        m_way_node_list.emplace_back(0, osmium::Location{-180.0, double(lat)});
     }
 
     for (int lon = -180; lon < 180; ++lon) {
@@ -106,11 +106,11 @@ void CoastlineRing::close_antarctica_ring(int epsg) {
     }
 
     if (epsg == 3857) {
-        m_way_node_list.emplace_back(0, osmium::Location{179.99999, min});
+        m_way_node_list.emplace_back(0, osmium::Location{180.0, min});
     }
 
     for (auto lat = static_cast<int>(min); lat < -78; ++lat) {
-        m_way_node_list.emplace_back(0, osmium::Location{179.99999, double(lat)});
+        m_way_node_list.emplace_back(0, osmium::Location{180.0, double(lat)});
     }
 
     m_way_node_list.push_back(m_way_node_list.front());


=====================================
src/osmcoastline_filter.cpp
=====================================
@@ -96,11 +96,6 @@ int main(int argc, char* argv[]) {
         }
     }
 
-    // The vout object is an output stream we can write to instead of
-    // std::cerr. Nothing is written if we are not in verbose mode.
-    // The running time will be prepended to output lines.
-    osmium::util::VerboseOutput vout{verbose};
-
     if (output_filename.empty()) {
         std::cerr << "Missing -o/--output=OSMFILE option\n";
         std::exit(return_code_cmdline);
@@ -111,15 +106,20 @@ int main(int argc, char* argv[]) {
         std::exit(return_code_cmdline);
     }
 
-    osmium::io::Header header;
-    header.set("generator", std::string{"osmcoastline_filter/"} + get_osmcoastline_version());
-    header.add_box(osmium::Box{-180.0, -90.0, 180.0, 90.0});
+    try {
+        // The vout object is an output stream we can write to instead of
+        // std::cerr. Nothing is written if we are not in verbose mode.
+        // The running time will be prepended to output lines.
+        osmium::util::VerboseOutput vout{verbose};
+
+        osmium::io::Header header;
+        header.set("generator", std::string{"osmcoastline_filter/"} + get_osmcoastline_version());
+        header.add_box(osmium::Box{-180.0, -90.0, 180.0, 90.0});
 
-    osmium::io::File infile{argv[optind]};
+        osmium::io::File infile{argv[optind]};
 
-    vout << "Started osmcoastline_filter " << get_osmcoastline_long_version() << " / " << get_libosmium_version() << '\n';
+        vout << "Started osmcoastline_filter " << get_osmcoastline_long_version() << " / " << get_libosmium_version() << '\n';
 
-    try {
         osmium::io::Writer writer{output_filename, header};
         auto output_it = osmium::io::make_output_iterator(writer);
 
@@ -169,16 +169,16 @@ int main(int argc, char* argv[]) {
         }
 
         writer.close();
-    } catch (const osmium::io_error& e) {
-        std::cerr << "io error: " << e.what() << "'\n";
-        std::exit(return_code_fatal);
-    }
 
-    vout << "All done.\n";
-    osmium::MemoryUsage mem;
-    if (mem.current() > 0) {
-        vout << "Memory used: current: " << mem.current() << " MBytes\n"
-             << "             peak:    " << mem.peak() << " MBytes\n";
+        vout << "All done.\n";
+        osmium::MemoryUsage mem;
+        if (mem.current() > 0) {
+            vout << "Memory used: current: " << mem.current() << " MBytes\n"
+                << "             peak:    " << mem.peak() << " MBytes\n";
+        }
+    } catch (const std::exception& e) {
+        std::cerr << e.what() << '\n';
+        std::exit(return_code_fatal);
     }
 }
 


=====================================
src/osmcoastline_segments.cpp
=====================================
@@ -162,10 +162,10 @@ int main(int argc, char *argv[]) {
         std::exit(return_code_cmdline);
     }
 
-    segvec removed_segments;
-    segvec added_segments;
-
     try {
+        segvec removed_segments;
+        segvec added_segments;
+
         InputFile file1{argv[optind]};
         InputFile file2{argv[optind + 1]};
 
@@ -174,25 +174,25 @@ int main(int argc, char *argv[]) {
 
         std::set_difference(m1.cbegin(), m1.cend(), m2.cbegin(), m2.cend(), std::back_inserter(removed_segments));
         std::set_difference(m2.cbegin(), m2.cend(), m1.cbegin(), m1.cend(), std::back_inserter(added_segments));
-    } catch (const std::runtime_error& e) {
-        std::cerr << e.what() << "\n";
-        std::exit(return_code_fatal);
-    }
 
-    if (dump) {
-        std::cout << "Removed:\n";
-        for (const auto& segment : removed_segments) {
-            std::cout << "  " << segment << "\n";
-        }
+        if (dump) {
+            std::cout << "Removed:\n";
+            for (const auto& segment : removed_segments) {
+                std::cout << "  " << segment << "\n";
+            }
 
-        std::cout << "Added:\n";
-        for (const auto& segment : added_segments) {
-            std::cout << "  " << segment << "\n";
+            std::cout << "Added:\n";
+            for (const auto& segment : added_segments) {
+                std::cout << "  " << segment << "\n";
+            }
+        } else if (!geom.empty()) {
+            output_ogr(geom, format, removed_segments, added_segments);
         }
-    } else if (!geom.empty()) {
-        output_ogr(geom, format, removed_segments, added_segments);
-    }
 
-    return (removed_segments.empty() && added_segments.empty()) ? 0 : 1;
+        return (removed_segments.empty() && added_segments.empty()) ? 0 : 1;
+    } catch (const std::exception& e) {
+        std::cerr << e.what() << '\n';
+        std::exit(return_code_fatal);
+    }
 }
 


=====================================
src/osmcoastline_ways.cpp
=====================================
@@ -129,27 +129,32 @@ int main(int argc, char* argv[]) {
 
     CPLSetConfigOption("OGR_SQLITE_SYNCHRONOUS", "OFF");
 
-    const std::string input_osm_filename{argv[1]};
+    try {
+        const std::string input_osm_filename{argv[1]};
 
-    std::string output_db_filename{"coastline-ways.db"};
-    if (argc >= 3) {
-        output_db_filename = argv[2];
-    }
+        std::string output_db_filename{"coastline-ways.db"};
+        if (argc >= 3) {
+            output_db_filename = argv[2];
+        }
 
-    index_type index_pos;
-    index_type index_neg;
-    location_handler_type location_handler{index_pos, index_neg};
+        index_type index_pos;
+        index_type index_neg;
+        location_handler_type location_handler{index_pos, index_neg};
 
-    osmium::io::File infile{input_osm_filename};
-    osmium::io::Reader reader1{infile, osmium::osm_entity_bits::node};
-    osmium::apply(reader1, location_handler);
-    reader1.close();
+        osmium::io::File infile{input_osm_filename};
+        osmium::io::Reader reader1{infile, osmium::osm_entity_bits::node};
+        osmium::apply(reader1, location_handler);
+        reader1.close();
 
-    CoastlineWaysHandler coastline_ways_handler{output_db_filename};
-    osmium::io::Reader reader2{infile, osmium::osm_entity_bits::way};
-    osmium::apply(reader2, location_handler, coastline_ways_handler);
-    reader2.close();
+        CoastlineWaysHandler coastline_ways_handler{output_db_filename};
+        osmium::io::Reader reader2{infile, osmium::osm_entity_bits::way};
+        osmium::apply(reader2, location_handler, coastline_ways_handler);
+        reader2.close();
 
-    std::cerr << "Sum of way lengths: " << std::fixed << (coastline_ways_handler.sum_length() / 1000) << "km\n";
+        std::cerr << "Sum of way lengths: " << std::fixed << (coastline_ways_handler.sum_length() / 1000) << "km\n";
+    } catch (const std::exception& e) {
+        std::cerr << e.what() << '\n';
+        std::exit(return_code_fatal);
+    }
 }
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/osmcoastline/commit/042d0cc0a1f449f31aff1f02689f86fceb3175b0

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/osmcoastline/commit/042d0cc0a1f449f31aff1f02689f86fceb3175b0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20190227/de32d6a4/attachment-0001.html>


More information about the Pkg-grass-devel mailing list