diff -Nru libosmium-2.15.4/CHANGELOG.md libosmium-2.15.6/CHANGELOG.md --- libosmium-2.15.4/CHANGELOG.md 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/CHANGELOG.md 2020-06-27 21:33:26.000000000 +0000 @@ -12,6 +12,53 @@ ### Fixed + +## [2.15.6] - 2020-06-27 + +### Added + +* Add `IdSetSmall::merge_sorted` function. + +### Changed + +* Little optimization for IdSetSmall: Don't add the same id twice in a row. + +### Fixed + +* Do not build areas with "recursion depth > 20". This happens when there + are complex multipolygon with many rings touching in single points. This + is a quick fix that hopefully keeps us going until we find a better + solution. + +## [2.15.5] - 2020-04-21 + +### Added + +* Additional constructor for `builder::attr::member_type(_string)` taking + char type making it even easier to generate test data. +* Allow single C string or `std::string` as argument for `builder::attr::_tag`. + Must contain key and value separated by the equal sign. +* New `builder::attr::_t()` function to set tags from comma-separated string. +* New `nwr_array` iterator. +* Support for the PROJ library has now been declared deprecated. The old + PROJ API (up to version PROJ 6) is currently still available, but will + be removed in a future version. Support for the new PROJ API will not be + in libosmium. See https://github.com/osmcode/osmium-proj for some code + that might help you if you need this. + +### Changed + +* Check how much space is available in file system before resizing memory + mapped file (not on Windows). This means we can, at least in some cases, + show an error message instead of crashing the program. + +### Fixed + +* Parsing coordinates in PBF files did not work correctly if an lat/lon + offset was specified (which almost never happens). +* Make OPL parser more strict: Attributes can only be specified once. +* Do not close stdout after writing OSM file to it. + ## [2.15.4] - 2019-11-28 ### Added @@ -985,7 +1032,9 @@ Doxygen (up to version 1.8.8). This version contains a workaround to fix this. -[unreleased]: https://github.com/osmcode/libosmium/compare/v2.15.4...HEAD +[unreleased]: https://github.com/osmcode/libosmium/compare/v2.15.6...HEAD +[2.15.6]: https://github.com/osmcode/libosmium/compare/v2.15.5...v2.15.6 +[2.15.5]: https://github.com/osmcode/libosmium/compare/v2.15.4...v2.15.5 [2.15.4]: https://github.com/osmcode/libosmium/compare/v2.15.3...v2.15.4 [2.15.3]: https://github.com/osmcode/libosmium/compare/v2.15.2...v2.15.3 [2.15.2]: https://github.com/osmcode/libosmium/compare/v2.15.1...v2.15.2 diff -Nru libosmium-2.15.4/CMakeLists.txt libosmium-2.15.6/CMakeLists.txt --- libosmium-2.15.4/CMakeLists.txt 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/CMakeLists.txt 2020-06-27 21:33:26.000000000 +0000 @@ -40,7 +40,7 @@ set(LIBOSMIUM_VERSION_MAJOR 2) set(LIBOSMIUM_VERSION_MINOR 15) -set(LIBOSMIUM_VERSION_PATCH 4) +set(LIBOSMIUM_VERSION_PATCH 6) set(LIBOSMIUM_VERSION "${LIBOSMIUM_VERSION_MAJOR}.${LIBOSMIUM_VERSION_MINOR}.${LIBOSMIUM_VERSION_PATCH}") @@ -405,7 +405,7 @@ # Create a dummy .cpp file that includes the header file we want to # check. set(DUMMYCPP ${CMAKE_BINARY_DIR}/header_check/${libname}.cpp) - file(WRITE ${DUMMYCPP} "#include <${hpp}> // IWYU pragma: keep\n") + file(WRITE ${DUMMYCPP} "#define OSMIUM_UTIL_COMPATIBILITY_HPP\n#define OSMIUM_DEPRECATED\n#include <${hpp}> // IWYU pragma: keep\n") # There is no way in CMake to just compile but not link a C++ file, # so we pretend to build a library here. diff -Nru libosmium-2.15.4/debian/changelog libosmium-2.15.6/debian/changelog --- libosmium-2.15.4/debian/changelog 2019-11-29 05:35:55.000000000 +0000 +++ libosmium-2.15.6/debian/changelog 2021-10-03 09:29:29.000000000 +0000 @@ -1,3 +1,38 @@ +libosmium (2.15.6-1~focal2) focal; urgency=medium + + * No change rebuild for GDAL 3.3.2 transition. + + -- Angelos Tzotsos Sun, 03 Oct 2021 13:00:00 +0300 + +libosmium (2.15.6-1~focal1) focal; urgency=medium + + * No change rebuild for GDAL 3.2.0 transition. + + -- Angelos Tzotsos Sat, 19 Dec 2020 12:00:00 +0200 + +libosmium (2.15.6-1~focal0) focal; urgency=medium + + * No change rebuild for Focal. + + -- Angelos Tzotsos Fri, 02 Oct 2020 14:00:00 +0300 + +libosmium (2.15.6-1) unstable; urgency=medium + + * New upstream release. + + -- Bas Couwenberg Sun, 28 Jun 2020 08:02:49 +0200 + +libosmium (2.15.5-1) unstable; urgency=medium + + * New upstream release. + * Drop Name field from upstream metadata. + * Bump Standards-Version to 4.5.0, no changes. + * Bump debhelper compat to 10, changes: + - Drop --parallel option, enabled by default + * Update copyright years for Jochen Topf. + + -- Bas Couwenberg Tue, 21 Apr 2020 15:21:30 +0200 + libosmium (2.15.4-1) unstable; urgency=medium * New upstream release. diff -Nru libosmium-2.15.4/debian/compat libosmium-2.15.6/debian/compat --- libosmium-2.15.4/debian/compat 2017-03-07 17:23:24.000000000 +0000 +++ libosmium-2.15.6/debian/compat 2020-04-26 04:44:14.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru libosmium-2.15.4/debian/control libosmium-2.15.6/debian/control --- libosmium-2.15.4/debian/control 2019-09-30 17:12:23.000000000 +0000 +++ libosmium-2.15.6/debian/control 2020-04-26 04:59:41.000000000 +0000 @@ -3,7 +3,7 @@ Uploaders: Bas Couwenberg Section: science Priority: optional -Build-Depends: debhelper (>= 9), +Build-Depends: debhelper (>= 10~), doxygen, cmake, graphviz, @@ -15,7 +15,7 @@ libprotozero-dev (>= 1.6.3), libsparsehash-dev, zlib1g-dev -Standards-Version: 4.4.1 +Standards-Version: 4.5.0 Vcs-Browser: https://salsa.debian.org/debian-gis-team/libosmium/ Vcs-Git: https://salsa.debian.org/debian-gis-team/libosmium.git Homepage: https://osmcode.org/libosmium/ diff -Nru libosmium-2.15.4/debian/copyright libosmium-2.15.6/debian/copyright --- libosmium-2.15.4/debian/copyright 2019-03-09 07:14:57.000000000 +0000 +++ libosmium-2.15.6/debian/copyright 2020-04-26 04:44:14.000000000 +0000 @@ -4,7 +4,7 @@ Source: https://github.com/osmcode/libosmium Files: * -Copyright: 2013-2019, Jochen Topf +Copyright: 2013-2020, Jochen Topf 2012, Two Blue Cubes Ltd. License: BSL-1.0 diff -Nru libosmium-2.15.4/debian/rules libosmium-2.15.6/debian/rules --- libosmium-2.15.4/debian/rules 2019-08-17 06:03:52.000000000 +0000 +++ libosmium-2.15.6/debian/rules 2020-04-26 04:44:14.000000000 +0000 @@ -8,7 +8,7 @@ DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) %: - dh $@ --parallel --builddirectory=build + dh $@ --builddirectory=build override_dh_auto_configure: dh_auto_configure -- -DCMAKE_VERBOSE_MAKEFILE=1 diff -Nru libosmium-2.15.4/debian/upstream/metadata libosmium-2.15.6/debian/upstream/metadata --- libosmium-2.15.4/debian/upstream/metadata 2018-07-26 04:56:05.000000000 +0000 +++ libosmium-2.15.6/debian/upstream/metadata 2020-04-26 04:44:14.000000000 +0000 @@ -2,6 +2,5 @@ Bug-Database: https://github.com/osmcode/libosmium/issues Bug-Submit: https://github.com/osmcode/libosmium/issues/new Contact: Osmium Developers (https://osmcode.org/contact) -Name: libosmium Repository: https://github.com/osmcode/libosmium.git Repository-Browse: https://github.com/osmcode/libosmium diff -Nru libosmium-2.15.4/include/osmium/area/assembler_config.hpp libosmium-2.15.6/include/osmium/area/assembler_config.hpp --- libosmium-2.15.4/include/osmium/area/assembler_config.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/assembler_config.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/assembler.hpp libosmium-2.15.6/include/osmium/area/assembler.hpp --- libosmium-2.15.4/include/osmium/area/assembler.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/assembler.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/assembler_legacy.hpp libosmium-2.15.6/include/osmium/area/assembler_legacy.hpp --- libosmium-2.15.4/include/osmium/area/assembler_legacy.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/assembler_legacy.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/detail/basic_assembler.hpp libosmium-2.15.6/include/osmium/area/detail/basic_assembler.hpp --- libosmium-2.15.4/include/osmium/area/detail/basic_assembler.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/detail/basic_assembler.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -105,6 +105,12 @@ static constexpr const std::size_t max_split_locations = 100ULL; + // Maximum recursion depth, stops complex multipolygons from + // breaking everything. + enum : unsigned { + max_depth = 20U + }; + struct slocation { enum { @@ -713,7 +719,13 @@ }; + struct exceeded_max_depth {}; + void find_candidates(std::vector& candidates, std::unordered_set& loc_done, const std::vector& xrings, const candidate& cand, unsigned depth = 0) { + if (depth > max_depth) { + throw exceeded_max_depth{}; + } + if (debug()) { std::cerr << " find_candidates sum=" << cand.sum << " start=" << cand.start_location << " stop=" << cand.stop_location << "\n"; for (const auto& ring : cand.rings) { @@ -826,7 +838,14 @@ loc_done.insert(cand.stop_location); std::vector candidates; - find_candidates(candidates, loc_done, xrings, cand); + try { + find_candidates(candidates, loc_done, xrings, cand); + } catch (const exceeded_max_depth&) { + if (m_config.debug_level > 0) { + std::cerr << " Exceeded max depth (" << static_cast(max_depth) << ")\n"; + } + return false; + } if (candidates.empty()) { if (debug()) { diff -Nru libosmium-2.15.4/include/osmium/area/detail/basic_assembler_with_tags.hpp libosmium-2.15.6/include/osmium/area/detail/basic_assembler_with_tags.hpp --- libosmium-2.15.4/include/osmium/area/detail/basic_assembler_with_tags.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/detail/basic_assembler_with_tags.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/detail/node_ref_segment.hpp libosmium-2.15.6/include/osmium/area/detail/node_ref_segment.hpp --- libosmium-2.15.4/include/osmium/area/detail/node_ref_segment.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/detail/node_ref_segment.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/detail/proto_ring.hpp libosmium-2.15.6/include/osmium/area/detail/proto_ring.hpp --- libosmium-2.15.4/include/osmium/area/detail/proto_ring.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/detail/proto_ring.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/detail/segment_list.hpp libosmium-2.15.6/include/osmium/area/detail/segment_list.hpp --- libosmium-2.15.4/include/osmium/area/detail/segment_list.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/detail/segment_list.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/detail/vector.hpp libosmium-2.15.6/include/osmium/area/detail/vector.hpp --- libosmium-2.15.4/include/osmium/area/detail/vector.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/detail/vector.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/geom_assembler.hpp libosmium-2.15.6/include/osmium/area/geom_assembler.hpp --- libosmium-2.15.4/include/osmium/area/geom_assembler.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/geom_assembler.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/multipolygon_collector.hpp libosmium-2.15.6/include/osmium/area/multipolygon_collector.hpp --- libosmium-2.15.4/include/osmium/area/multipolygon_collector.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/multipolygon_collector.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/multipolygon_manager.hpp libosmium-2.15.6/include/osmium/area/multipolygon_manager.hpp --- libosmium-2.15.4/include/osmium/area/multipolygon_manager.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/multipolygon_manager.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/multipolygon_manager_legacy.hpp libosmium-2.15.6/include/osmium/area/multipolygon_manager_legacy.hpp --- libosmium-2.15.4/include/osmium/area/multipolygon_manager_legacy.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/multipolygon_manager_legacy.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/problem_reporter_exception.hpp libosmium-2.15.6/include/osmium/area/problem_reporter_exception.hpp --- libosmium-2.15.4/include/osmium/area/problem_reporter_exception.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/problem_reporter_exception.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/problem_reporter.hpp libosmium-2.15.6/include/osmium/area/problem_reporter.hpp --- libosmium-2.15.4/include/osmium/area/problem_reporter.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/problem_reporter.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -93,6 +93,10 @@ m_object_id = object_id; } + osmium::object_id_type object_id() const noexcept { + return m_object_id; + } + void set_nodes(size_t nodes) noexcept { m_nodes = nodes; } diff -Nru libosmium-2.15.4/include/osmium/area/problem_reporter_ogr.hpp libosmium-2.15.6/include/osmium/area/problem_reporter_ogr.hpp --- libosmium-2.15.4/include/osmium/area/problem_reporter_ogr.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/problem_reporter_ogr.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/problem_reporter_stream.hpp libosmium-2.15.6/include/osmium/area/problem_reporter_stream.hpp --- libosmium-2.15.4/include/osmium/area/problem_reporter_stream.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/problem_reporter_stream.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/area/stats.hpp libosmium-2.15.6/include/osmium/area/stats.hpp --- libosmium-2.15.4/include/osmium/area/stats.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/area/stats.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/builder/attr.hpp libosmium-2.15.6/include/osmium/builder/attr.hpp --- libosmium-2.15.4/include/osmium/builder/attr.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/builder/attr.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -226,8 +227,8 @@ OSMIUM_ATTRIBUTE(node_handler, _location, osmium::Location) constexpr explicit _location(const osmium::Location& value) noexcept : type_wrapper(value) {} - explicit _location(double lat, double lon) : - type_wrapper(osmium::Location{lat, lon}) {} + explicit _location(double lon, double lat) : + type_wrapper(osmium::Location{lon, lat}) {} }; OSMIUM_ATTRIBUTE(entity_handler, _user, const char*) @@ -254,6 +255,10 @@ m_role(role) { } + member_type(char type, osmium::object_id_type ref, const char* role = "") noexcept : + member_type(osmium::char_to_item_type(type), ref, role) { + } + constexpr osmium::item_type type() const noexcept { return m_type; } @@ -282,6 +287,10 @@ m_role(std::move(role)) { } + member_type_string(char type, osmium::object_id_type ref, std::string&& role) noexcept : + member_type_string(osmium::char_to_item_type(type), ref, std::forward(role)) { + } + osmium::item_type type() const noexcept { return m_type; } @@ -360,6 +369,15 @@ type_wrapper(std::make_pair(key, val)) {} explicit _tag(const std::string& key, const std::string& val) : type_wrapper(std::make_pair(key.c_str(), val.c_str())) {} + explicit _tag(const char* const key_value) : + type_wrapper(pair_of_cstrings{key_value, nullptr}) {} + explicit _tag(const std::string& key_value) : + type_wrapper(pair_of_cstrings{key_value.c_str(), nullptr}) {} + }; + + OSMIUM_ATTRIBUTE(tags_handler, _t, const char*) + explicit _t(const char *tags) : + type_wrapper(tags) {} }; template @@ -659,7 +677,19 @@ } static void set_value(TagListBuilder& builder, const attr::_tag& tag) { - builder.add_tag(tag.value); + if (tag.value.second != nullptr) { + builder.add_tag(tag.value); + return; + } + const char* key = tag.value.first; + auto const equal_sign = std::strchr(key, '='); + if (!equal_sign) { + builder.add_tag(key, ""); + return; + } + const char* value = equal_sign + 1; + builder.add_tag(key, equal_sign - key, + value, std::strlen(value)); } template @@ -669,6 +699,21 @@ } } + static void set_value(TagListBuilder& builder, const attr::_t& tags) { + const auto taglist = osmium::split_string(tags.value, ',', true); + for (const auto& tag : taglist) { + const std::size_t pos = tag.find_first_of('='); + if (pos == std::string::npos) { + builder.add_tag(tag, ""); + } else { + const char* value = tag.c_str() + pos + 1; + builder.add_tag(tag.c_str(), pos, + value, tag.size() - pos - 1); + } + + } + } + }; // struct tags_handler struct nodes_handler { diff -Nru libosmium-2.15.4/include/osmium/builder/builder_helper.hpp libosmium-2.15.6/include/osmium/builder/builder_helper.hpp --- libosmium-2.15.4/include/osmium/builder/builder_helper.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/builder/builder_helper.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/builder/builder.hpp libosmium-2.15.6/include/osmium/builder/builder.hpp --- libosmium-2.15.4/include/osmium/builder/builder.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/builder/builder.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/builder/osm_object_builder.hpp libosmium-2.15.6/include/osmium/builder/osm_object_builder.hpp --- libosmium-2.15.4/include/osmium/builder/osm_object_builder.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/builder/osm_object_builder.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/diff_handler.hpp libosmium-2.15.6/include/osmium/diff_handler.hpp --- libosmium-2.15.4/include/osmium/diff_handler.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/diff_handler.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/diff_iterator.hpp libosmium-2.15.6/include/osmium/diff_iterator.hpp --- libosmium-2.15.4/include/osmium/diff_iterator.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/diff_iterator.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/diff_visitor.hpp libosmium-2.15.6/include/osmium/diff_visitor.hpp --- libosmium-2.15.4/include/osmium/diff_visitor.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/diff_visitor.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/dynamic_handler.hpp libosmium-2.15.6/include/osmium/dynamic_handler.hpp --- libosmium-2.15.4/include/osmium/dynamic_handler.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/dynamic_handler.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/experimental/flex_reader.hpp libosmium-2.15.6/include/osmium/experimental/flex_reader.hpp --- libosmium-2.15.4/include/osmium/experimental/flex_reader.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/experimental/flex_reader.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/fwd.hpp libosmium-2.15.6/include/osmium/fwd.hpp --- libosmium-2.15.4/include/osmium/fwd.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/fwd.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/coordinates.hpp libosmium-2.15.6/include/osmium/geom/coordinates.hpp --- libosmium-2.15.4/include/osmium/geom/coordinates.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/coordinates.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/factory.hpp libosmium-2.15.6/include/osmium/geom/factory.hpp --- libosmium-2.15.4/include/osmium/geom/factory.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/factory.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/geojson.hpp libosmium-2.15.6/include/osmium/geom/geojson.hpp --- libosmium-2.15.4/include/osmium/geom/geojson.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/geojson.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/geos.hpp libosmium-2.15.6/include/osmium/geom/geos.hpp --- libosmium-2.15.4/include/osmium/geom/geos.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/geos.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/haversine.hpp libosmium-2.15.6/include/osmium/geom/haversine.hpp --- libosmium-2.15.4/include/osmium/geom/haversine.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/haversine.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include @@ -63,13 +63,13 @@ * * @pre @code c1.valid() && c2.valid() @endcode */ - inline double distance(const osmium::geom::Coordinates& c1, const osmium::geom::Coordinates& c2) { - double lonh = sin(deg_to_rad(c1.x - c2.x) * 0.5); + inline double distance(const osmium::geom::Coordinates& c1, const osmium::geom::Coordinates& c2) noexcept { + double lonh = std::sin(deg_to_rad(c1.x - c2.x) * 0.5); lonh *= lonh; - double lath = sin(deg_to_rad(c1.y - c2.y) * 0.5); + double lath = std::sin(deg_to_rad(c1.y - c2.y) * 0.5); lath *= lath; - const double tmp = cos(deg_to_rad(c1.y)) * cos(deg_to_rad(c2.y)); - return 2.0 * EARTH_RADIUS_IN_METERS * asin(sqrt(lath + tmp * lonh)); + const double tmp = std::cos(deg_to_rad(c1.y)) * std::cos(deg_to_rad(c2.y)); + return 2.0 * EARTH_RADIUS_IN_METERS * std::asin(std::sqrt(lath + tmp * lonh)); } /** @@ -83,6 +83,21 @@ sum_length += distance(it->location(), std::next(it)->location()); } } + + return sum_length; + } + + /** + * Calculate length of node list. + */ + inline double distance(const osmium::NodeRefList& nrl) { + double sum_length = 0; + + for (auto it = nrl.begin(); it != nrl.end(); ++it) { + if (std::next(it) != nrl.end()) { + sum_length += distance(it->location(), std::next(it)->location()); + } + } return sum_length; } diff -Nru libosmium-2.15.4/include/osmium/geom/mercator_projection.hpp libosmium-2.15.6/include/osmium/geom/mercator_projection.hpp --- libosmium-2.15.4/include/osmium/geom/mercator_projection.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/mercator_projection.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/ogr.hpp libosmium-2.15.6/include/osmium/geom/ogr.hpp --- libosmium-2.15.4/include/osmium/geom/ogr.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/ogr.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/projection.hpp libosmium-2.15.6/include/osmium/geom/projection.hpp --- libosmium-2.15.4/include/osmium/geom/projection.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/projection.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H # include @@ -64,6 +65,8 @@ /** * C++ wrapper for a Coordinate Reference System of the proj library. + * + * @deprecated Only supports the old PROJ API. */ class CRS { @@ -116,9 +119,11 @@ * Coordinates have to be in radians and are produced in radians. * * @throws osmium::projection_error if the projection fails + * + * @deprecated Only supports the old PROJ API. */ // cppcheck-suppress passedByValue (because c is small and we want to change it) - inline Coordinates transform(const CRS& src, const CRS& dest, Coordinates c) { + inline OSMIUM_DEPRECATED Coordinates transform(const CRS& src, const CRS& dest, Coordinates c) { const int result = pj_transform(src.get(), dest.get(), 1, 1, &c.x, &c.y, nullptr); if (result != 0) { throw osmium::projection_error{std::string{"projection failed: "} + pj_strerrno(result)}; @@ -136,6 +141,8 @@ * implementation of the Mercator projection is used, otherwise this * falls back to using the proj.4 library. Note that this "magic" does * not work if you use any of the constructors taking a string. + * + * @deprecated Only supports the old PROJ API. */ class Projection { diff -Nru libosmium-2.15.4/include/osmium/geom/rapid_geojson.hpp libosmium-2.15.6/include/osmium/geom/rapid_geojson.hpp --- libosmium-2.15.4/include/osmium/geom/rapid_geojson.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/rapid_geojson.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/relations.hpp libosmium-2.15.6/include/osmium/geom/relations.hpp --- libosmium-2.15.4/include/osmium/geom/relations.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/relations.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/tile.hpp libosmium-2.15.6/include/osmium/geom/tile.hpp --- libosmium-2.15.4/include/osmium/geom/tile.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/tile.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/util.hpp libosmium-2.15.6/include/osmium/geom/util.hpp --- libosmium-2.15.4/include/osmium/geom/util.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/util.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/wkb.hpp libosmium-2.15.6/include/osmium/geom/wkb.hpp --- libosmium-2.15.4/include/osmium/geom/wkb.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/wkb.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/geom/wkt.hpp libosmium-2.15.6/include/osmium/geom/wkt.hpp --- libosmium-2.15.4/include/osmium/geom/wkt.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/geom/wkt.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/handler/chain.hpp libosmium-2.15.6/include/osmium/handler/chain.hpp --- libosmium-2.15.4/include/osmium/handler/chain.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/handler/chain.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/handler/check_order.hpp libosmium-2.15.6/include/osmium/handler/check_order.hpp --- libosmium-2.15.4/include/osmium/handler/check_order.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/handler/check_order.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/handler/disk_store.hpp libosmium-2.15.6/include/osmium/handler/disk_store.hpp --- libosmium-2.15.4/include/osmium/handler/disk_store.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/handler/disk_store.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/handler/dump.hpp libosmium-2.15.6/include/osmium/handler/dump.hpp --- libosmium-2.15.4/include/osmium/handler/dump.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/handler/dump.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/handler/node_locations_for_ways.hpp libosmium-2.15.6/include/osmium/handler/node_locations_for_ways.hpp --- libosmium-2.15.4/include/osmium/handler/node_locations_for_ways.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/handler/node_locations_for_ways.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/handler/object_relations.hpp libosmium-2.15.6/include/osmium/handler/object_relations.hpp --- libosmium-2.15.4/include/osmium/handler/object_relations.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/handler/object_relations.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/handler.hpp libosmium-2.15.6/include/osmium/handler.hpp --- libosmium-2.15.4/include/osmium/handler.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/handler.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/bool_vector.hpp libosmium-2.15.6/include/osmium/index/bool_vector.hpp --- libosmium-2.15.4/include/osmium/index/bool_vector.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/bool_vector.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/detail/create_map_with_fd.hpp libosmium-2.15.6/include/osmium/index/detail/create_map_with_fd.hpp --- libosmium-2.15.4/include/osmium/index/detail/create_map_with_fd.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/detail/create_map_with_fd.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/detail/mmap_vector_anon.hpp libosmium-2.15.6/include/osmium/index/detail/mmap_vector_anon.hpp --- libosmium-2.15.4/include/osmium/index/detail/mmap_vector_anon.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/detail/mmap_vector_anon.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/detail/mmap_vector_base.hpp libosmium-2.15.6/include/osmium/index/detail/mmap_vector_base.hpp --- libosmium-2.15.4/include/osmium/index/detail/mmap_vector_base.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/detail/mmap_vector_base.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/detail/mmap_vector_file.hpp libosmium-2.15.6/include/osmium/index/detail/mmap_vector_file.hpp --- libosmium-2.15.4/include/osmium/index/detail/mmap_vector_file.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/detail/mmap_vector_file.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/detail/tmpfile.hpp libosmium-2.15.6/include/osmium/index/detail/tmpfile.hpp --- libosmium-2.15.4/include/osmium/index/detail/tmpfile.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/detail/tmpfile.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/detail/vector_map.hpp libosmium-2.15.6/include/osmium/index/detail/vector_map.hpp --- libosmium-2.15.4/include/osmium/index/detail/vector_map.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/detail/vector_map.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/detail/vector_multimap.hpp libosmium-2.15.6/include/osmium/index/detail/vector_multimap.hpp --- libosmium-2.15.4/include/osmium/index/detail/vector_multimap.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/detail/vector_multimap.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/id_set.hpp libosmium-2.15.6/include/osmium/index/id_set.hpp --- libosmium-2.15.4/include/osmium/index/id_set.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/id_set.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -274,6 +274,7 @@ IdSetDense(IdSetDense&&) noexcept = default; // This should really be noexcept, but GCC 4.8 doesn't like it. + // NOLINTNEXTLINE(hicpp-noexcept-move, performance-noexcept-move-constructor) IdSetDense& operator=(IdSetDense&&) = default; ~IdSetDense() noexcept override = default; @@ -386,7 +387,9 @@ * Add the given Id to the set. */ void set(T id) final { - m_data.push_back(id); + if (m_data.empty() || m_data.back() != id) { + m_data.push_back(id); + } } /** @@ -429,7 +432,8 @@ /** * Sort the internal vector and remove any duplicates. Call this - * before using size(), get_binary_search() or using an iterator. + * before using size(), get_binary_search(), merge_sorted() or + * using an iterator. */ void sort_unique() { std::sort(m_data.begin(), m_data.end()); @@ -452,6 +456,22 @@ return m_data.capacity() * sizeof(T); } + /** + * Merge the other set into this one. The result is sorted. + * + * @pre Both sets must be sorted and must not contain any + * duplicates. Call sort_unique() if you are not sure. + */ + void merge_sorted(const IdSetSmall& other) { + std::vector new_data; + new_data.reserve(m_data.size() + other.m_data.size()); + std::set_union(m_data.cbegin(), m_data.cend(), + other.m_data.cbegin(), other.m_data.cend(), + std::back_inserter(new_data)); + using std::swap; + swap(new_data, m_data); + } + /// Iterator type. There is no non-const iterator. using const_iterator = typename std::vector::const_iterator; diff -Nru libosmium-2.15.4/include/osmium/index/index.hpp libosmium-2.15.6/include/osmium/index/index.hpp --- libosmium-2.15.4/include/osmium/index/index.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/index.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/all.hpp libosmium-2.15.6/include/osmium/index/map/all.hpp --- libosmium-2.15.4/include/osmium/index/map/all.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/all.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/dense_file_array.hpp libosmium-2.15.6/include/osmium/index/map/dense_file_array.hpp --- libosmium-2.15.4/include/osmium/index/map/dense_file_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/dense_file_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/dense_mem_array.hpp libosmium-2.15.6/include/osmium/index/map/dense_mem_array.hpp --- libosmium-2.15.4/include/osmium/index/map/dense_mem_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/dense_mem_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/dense_mmap_array.hpp libosmium-2.15.6/include/osmium/index/map/dense_mmap_array.hpp --- libosmium-2.15.4/include/osmium/index/map/dense_mmap_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/dense_mmap_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/dummy.hpp libosmium-2.15.6/include/osmium/index/map/dummy.hpp --- libosmium-2.15.4/include/osmium/index/map/dummy.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/dummy.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/flex_mem.hpp libosmium-2.15.6/include/osmium/index/map/flex_mem.hpp --- libosmium-2.15.4/include/osmium/index/map/flex_mem.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/flex_mem.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/sparse_file_array.hpp libosmium-2.15.6/include/osmium/index/map/sparse_file_array.hpp --- libosmium-2.15.4/include/osmium/index/map/sparse_file_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/sparse_file_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/sparse_mem_array.hpp libosmium-2.15.6/include/osmium/index/map/sparse_mem_array.hpp --- libosmium-2.15.4/include/osmium/index/map/sparse_mem_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/sparse_mem_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/sparse_mem_map.hpp libosmium-2.15.6/include/osmium/index/map/sparse_mem_map.hpp --- libosmium-2.15.4/include/osmium/index/map/sparse_mem_map.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/sparse_mem_map.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/sparse_mem_table.hpp libosmium-2.15.6/include/osmium/index/map/sparse_mem_table.hpp --- libosmium-2.15.4/include/osmium/index/map/sparse_mem_table.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/sparse_mem_table.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map/sparse_mmap_array.hpp libosmium-2.15.6/include/osmium/index/map/sparse_mmap_array.hpp --- libosmium-2.15.4/include/osmium/index/map/sparse_mmap_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map/sparse_mmap_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/map.hpp libosmium-2.15.6/include/osmium/index/map.hpp --- libosmium-2.15.4/include/osmium/index/map.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/map.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/multimap/all.hpp libosmium-2.15.6/include/osmium/index/multimap/all.hpp --- libosmium-2.15.4/include/osmium/index/multimap/all.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/multimap/all.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/multimap/hybrid.hpp libosmium-2.15.6/include/osmium/index/multimap/hybrid.hpp --- libosmium-2.15.4/include/osmium/index/multimap/hybrid.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/multimap/hybrid.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/multimap/sparse_file_array.hpp libosmium-2.15.6/include/osmium/index/multimap/sparse_file_array.hpp --- libosmium-2.15.4/include/osmium/index/multimap/sparse_file_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/multimap/sparse_file_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/multimap/sparse_mem_array.hpp libosmium-2.15.6/include/osmium/index/multimap/sparse_mem_array.hpp --- libosmium-2.15.4/include/osmium/index/multimap/sparse_mem_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/multimap/sparse_mem_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/multimap/sparse_mem_multimap.hpp libosmium-2.15.6/include/osmium/index/multimap/sparse_mem_multimap.hpp --- libosmium-2.15.4/include/osmium/index/multimap/sparse_mem_multimap.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/multimap/sparse_mem_multimap.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -53,7 +53,7 @@ * lot of memory, but might make sense for small maps. */ template - class SparseMemMultimap : public osmium::index::multimap::Multimap { + class SparseMemMultimap final : public osmium::index::multimap::Multimap { // This is a rough estimate for the memory needed for each // element in the map (id + value + pointers to left, right, @@ -79,13 +79,13 @@ SparseMemMultimap() = default; - ~SparseMemMultimap() noexcept final = default; + ~SparseMemMultimap() noexcept = default; void unsorted_set(const TId id, const TValue value) { m_elements.emplace(id, value); } - void set(const TId id, const TValue value) final { + void set(const TId id, const TValue value) override { m_elements.emplace(id, value); } @@ -115,15 +115,15 @@ return m_elements.end(); } - size_t size() const final { + size_t size() const override { return m_elements.size(); } - size_t used_memory() const final { + size_t used_memory() const override { return element_size * m_elements.size(); } - void clear() final { + void clear() override { m_elements.clear(); } @@ -131,7 +131,7 @@ // intentionally left blank } - void dump_as_list(const int fd) final { + void dump_as_list(const int fd) override { std::vector v; v.reserve(m_elements.size()); for (const auto& element : m_elements) { diff -Nru libosmium-2.15.4/include/osmium/index/multimap/sparse_mmap_array.hpp libosmium-2.15.6/include/osmium/index/multimap/sparse_mmap_array.hpp --- libosmium-2.15.4/include/osmium/index/multimap/sparse_mmap_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/multimap/sparse_mmap_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/multimap.hpp libosmium-2.15.6/include/osmium/index/multimap.hpp --- libosmium-2.15.4/include/osmium/index/multimap.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/multimap.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/node_locations_map.hpp libosmium-2.15.6/include/osmium/index/node_locations_map.hpp --- libosmium-2.15.4/include/osmium/index/node_locations_map.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/node_locations_map.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/index/nwr_array.hpp libosmium-2.15.6/include/osmium/index/nwr_array.hpp --- libosmium-2.15.4/include/osmium/index/nwr_array.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/nwr_array.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -52,6 +52,9 @@ public: + using iterator = typename std::array::iterator; + using const_iterator = typename std::array::const_iterator; + nwr_array() : m_data() { } @@ -64,6 +67,30 @@ return m_data[osmium::item_type_to_nwr_index(type)]; } + iterator begin() noexcept { + return m_data.begin(); + } + + iterator end() noexcept { + return m_data.end(); + } + + const_iterator begin() const noexcept { + return m_data.cbegin(); + } + + const_iterator end() const noexcept { + return m_data.cend(); + } + + const_iterator cbegin() const noexcept { + return m_data.cbegin(); + } + + const_iterator cend() const noexcept { + return m_data.cend(); + } + }; // class nwr_array } // namespace osmium diff -Nru libosmium-2.15.4/include/osmium/index/relations_map.hpp libosmium-2.15.6/include/osmium/index/relations_map.hpp --- libosmium-2.15.4/include/osmium/index/relations_map.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/index/relations_map.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/any_compression.hpp libosmium-2.15.6/include/osmium/io/any_compression.hpp --- libosmium-2.15.4/include/osmium/io/any_compression.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/any_compression.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/any_input.hpp libosmium-2.15.6/include/osmium/io/any_input.hpp --- libosmium-2.15.4/include/osmium/io/any_input.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/any_input.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/any_output.hpp libosmium-2.15.6/include/osmium/io/any_output.hpp --- libosmium-2.15.4/include/osmium/io/any_output.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/any_output.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/bzip2_compression.hpp libosmium-2.15.6/include/osmium/io/bzip2_compression.hpp --- libosmium-2.15.4/include/osmium/io/bzip2_compression.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/bzip2_compression.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -114,7 +114,11 @@ #endif m_file = fdopen(fd, mode); if (!m_file) { - ::close(fd); + + // Do not close stdout + if (fd != 1) { + ::close(fd); + } throw std::system_error{errno, std::system_category(), "fdopen failed"}; } } @@ -143,11 +147,17 @@ osmium::detail::disable_invalid_parameter_handler diph; #endif if (m_file) { - if (fclose(m_file) != 0) { - m_file = nullptr; + FILE* file = m_file; + m_file = nullptr; + + // Do not close stdout + if (fileno(file) == 1) { + return; + } + + if (fclose(file) != 0) { throw std::system_error{errno, std::system_category(), "fclose failed"}; } - m_file = nullptr; } } @@ -155,7 +165,7 @@ } // namespace detail - class Bzip2Compressor : public Compressor { + class Bzip2Compressor final : public Compressor { detail::file_wrapper m_file; BZFILE* m_bzfile = nullptr; @@ -181,7 +191,7 @@ Bzip2Compressor(Bzip2Compressor&&) = delete; Bzip2Compressor& operator=(Bzip2Compressor&&) = delete; - ~Bzip2Compressor() noexcept final { + ~Bzip2Compressor() noexcept { try { close(); } catch (...) { @@ -189,7 +199,7 @@ } } - void write(const std::string& data) final { + void write(const std::string& data) override { assert(data.size() < std::numeric_limits::max()); assert(m_bzfile); #ifdef _MSC_VER @@ -202,7 +212,7 @@ } } - void close() final { + void close() override { if (m_bzfile) { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; @@ -222,7 +232,7 @@ }; // class Bzip2Compressor - class Bzip2Decompressor : public Decompressor { + class Bzip2Decompressor final : public Decompressor { detail::file_wrapper m_file; BZFILE* m_bzfile = nullptr; @@ -248,7 +258,7 @@ Bzip2Decompressor(Bzip2Decompressor&&) = delete; Bzip2Decompressor& operator=(Bzip2Decompressor&&) = delete; - ~Bzip2Decompressor() noexcept final { + ~Bzip2Decompressor() noexcept { try { close(); } catch (...) { @@ -256,7 +266,7 @@ } } - std::string read() final { + std::string read() override { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; #endif @@ -301,7 +311,7 @@ return buffer; } - void close() final { + void close() override { if (m_bzfile) { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; @@ -318,7 +328,7 @@ }; // class Bzip2Decompressor - class Bzip2BufferDecompressor : public Decompressor { + class Bzip2BufferDecompressor final : public Decompressor { const char* m_buffer; std::size_t m_buffer_size; @@ -345,7 +355,7 @@ Bzip2BufferDecompressor(Bzip2BufferDecompressor&&) = delete; Bzip2BufferDecompressor& operator=(Bzip2BufferDecompressor&&) = delete; - ~Bzip2BufferDecompressor() noexcept final { + ~Bzip2BufferDecompressor() noexcept { try { close(); } catch (...) { @@ -353,7 +363,7 @@ } } - std::string read() final { + std::string read() override { std::string output; if (m_buffer) { @@ -378,7 +388,7 @@ return output; } - void close() final { + void close() override { BZ2_bzDecompressEnd(&m_bzstream); } diff -Nru libosmium-2.15.4/include/osmium/io/compression.hpp libosmium-2.15.6/include/osmium/io/compression.hpp --- libosmium-2.15.4/include/osmium/io/compression.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/compression.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -216,7 +216,7 @@ }; // class CompressionFactory - class NoCompressor : public Compressor { + class NoCompressor final : public Compressor { int m_fd; @@ -233,7 +233,7 @@ NoCompressor(NoCompressor&&) = delete; NoCompressor& operator=(NoCompressor&&) = delete; - ~NoCompressor() noexcept final { + ~NoCompressor() noexcept { try { close(); } catch (...) { @@ -241,14 +241,20 @@ } } - void write(const std::string& data) final { + void write(const std::string& data) override { osmium::io::detail::reliable_write(m_fd, data.data(), data.size()); } - void close() final { + void close() override { if (m_fd >= 0) { const int fd = m_fd; m_fd = -1; + + // Do not sync or close stdout + if (fd == 1) { + return; + } + if (do_fsync()) { osmium::io::detail::reliable_fsync(fd); } @@ -258,7 +264,7 @@ }; // class NoCompressor - class NoDecompressor : public Decompressor { + class NoDecompressor final : public Decompressor { int m_fd = -1; const char* m_buffer = nullptr; @@ -282,7 +288,7 @@ NoDecompressor(NoDecompressor&&) = delete; NoDecompressor& operator=(NoDecompressor&&) = delete; - ~NoDecompressor() noexcept final { + ~NoDecompressor() noexcept { try { close(); } catch (...) { @@ -290,7 +296,7 @@ } } - std::string read() final { + std::string read() override { std::string buffer; if (m_buffer) { @@ -311,7 +317,7 @@ return buffer; } - void close() final { + void close() override { if (m_fd >= 0) { const int fd = m_fd; m_fd = -1; diff -Nru libosmium-2.15.4/include/osmium/io/debug_output.hpp libosmium-2.15.6/include/osmium/io/debug_output.hpp --- libosmium-2.15.4/include/osmium/io/debug_output.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/debug_output.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/debug_output_format.hpp libosmium-2.15.6/include/osmium/io/detail/debug_output_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/debug_output_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/debug_output_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/input_format.hpp libosmium-2.15.6/include/osmium/io/detail/input_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/input_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/input_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/o5m_input_format.hpp libosmium-2.15.6/include/osmium/io/detail/o5m_input_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/o5m_input_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/o5m_input_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -150,7 +150,7 @@ }; // class ReferenceTable - class O5mParser : public Parser { + class O5mParser final : public Parser { enum { initial_buffer_size = 1024UL * 1024UL @@ -617,9 +617,9 @@ O5mParser(O5mParser&&) = delete; O5mParser& operator=(O5mParser&&) = delete; - ~O5mParser() noexcept final = default; + ~O5mParser() noexcept = default; - void run() final { + void run() override { osmium::thread::set_thread_name("_osmium_o5m_in"); decode_header(); diff -Nru libosmium-2.15.4/include/osmium/io/detail/opl_input_format.hpp libosmium-2.15.6/include/osmium/io/detail/opl_input_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/opl_input_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/opl_input_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -98,7 +98,7 @@ } } - class OPLParser : public Parser { + class OPLParser final : public Parser { enum { initial_buffer_size = 1024UL * 1024UL @@ -122,7 +122,7 @@ OPLParser(OPLParser&&) = delete; OPLParser& operator=(OPLParser&&) = delete; - ~OPLParser() noexcept final = default; + ~OPLParser() noexcept = default; void parse_line(const char* data) { if (opl_parse_line(m_line_count, data, m_buffer, read_types())) { @@ -134,7 +134,7 @@ ++m_line_count; } - void run() final { + void run() override { osmium::thread::set_thread_name("_osmium_opl_in"); line_by_line(*this); diff -Nru libosmium-2.15.4/include/osmium/io/detail/opl_output_format.hpp libosmium-2.15.6/include/osmium/io/detail/opl_output_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/opl_output_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/opl_output_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/opl_parser_functions.hpp libosmium-2.15.6/include/osmium/io/detail/opl_parser_functions.hpp --- libosmium-2.15.4/include/osmium/io/detail/opl_parser_functions.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/opl_parser_functions.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -372,6 +372,16 @@ const char* tags_begin = nullptr; + bool has_version = false; + bool has_visible = false; + bool has_changeset_id = false; + bool has_timestamp = false; + bool has_uid = false; + bool has_user = false; + bool has_tags = false; + bool has_lon = false; + bool has_lat = false; + std::string user; osmium::Location location; while (**data) { @@ -383,35 +393,71 @@ ++(*data); switch (c) { case 'v': + if (has_version) { + throw opl_error{"Duplicate attribute: version (v)"}; + } + has_version = true; builder.set_version(opl_parse_version(data)); break; case 'd': + if (has_visible) { + throw opl_error{"Duplicate attribute: visible (d)"}; + } + has_visible = true; builder.set_visible(opl_parse_visible(data)); break; case 'c': + if (has_changeset_id) { + throw opl_error{"Duplicate attribute: changeset_id (c)"}; + } + has_changeset_id = true; builder.set_changeset(opl_parse_changeset_id(data)); break; case 't': + if (has_timestamp) { + throw opl_error{"Duplicate attribute: timestamp (t)"}; + } + has_timestamp = true; builder.set_timestamp(opl_parse_timestamp(data)); break; case 'i': + if (has_uid) { + throw opl_error{"Duplicate attribute: uid (i)"}; + } + has_uid = true; builder.set_uid(opl_parse_uid(data)); break; case 'u': + if (has_user) { + throw opl_error{"Duplicate attribute: user (u)"}; + } + has_user = true; opl_parse_string(data, user); break; case 'T': + if (has_tags) { + throw opl_error{"Duplicate attribute: tags (T)"}; + } + has_tags = true; if (opl_non_empty(*data)) { tags_begin = *data; opl_skip_section(data); } break; case 'x': + if (has_lon) { + throw opl_error{"Duplicate attribute: lon (x)"}; + } + has_lon = true; if (opl_non_empty(*data)) { location.set_lon_partial(data); } break; case 'y': + if (has_lat) { + throw opl_error{"Duplicate attribute: lat (y)"}; + } + has_lat = true; if (opl_non_empty(*data)) { location.set_lat_partial(data); } @@ -443,6 +489,15 @@ const char* nodes_begin = nullptr; const char* nodes_end = nullptr; + bool has_version = false; + bool has_visible = false; + bool has_changeset_id = false; + bool has_timestamp = false; + bool has_uid = false; + bool has_user = false; + bool has_tags = false; + bool has_nodes = false; + std::string user; while (**data) { opl_parse_space(data); @@ -453,30 +508,62 @@ ++(*data); switch (c) { case 'v': + if (has_version) { + throw opl_error{"Duplicate attribute: version (v)"}; + } + has_version = true; builder.set_version(opl_parse_version(data)); break; case 'd': + if (has_visible) { + throw opl_error{"Duplicate attribute: visible (d)"}; + } + has_visible = true; builder.set_visible(opl_parse_visible(data)); break; case 'c': + if (has_changeset_id) { + throw opl_error{"Duplicate attribute: changeset_id (c)"}; + } + has_changeset_id = true; builder.set_changeset(opl_parse_changeset_id(data)); break; case 't': + if (has_timestamp) { + throw opl_error{"Duplicate attribute: timestamp (t)"}; + } + has_timestamp = true; builder.set_timestamp(opl_parse_timestamp(data)); break; case 'i': + if (has_uid) { + throw opl_error{"Duplicate attribute: uid (i)"}; + } + has_uid = true; builder.set_uid(opl_parse_uid(data)); break; case 'u': + if (has_user) { + throw opl_error{"Duplicate attribute: user (u)"}; + } + has_user = true; opl_parse_string(data, user); break; case 'T': + if (has_tags) { + throw opl_error{"Duplicate attribute: tags (T)"}; + } + has_tags = true; if (opl_non_empty(*data)) { tags_begin = *data; opl_skip_section(data); } break; case 'N': + if (has_nodes) { + throw opl_error{"Duplicate attribute: nodes (N)"}; + } + has_nodes = true; nodes_begin = *data; nodes_end = opl_skip_section(data); break; @@ -540,6 +627,15 @@ const char* members_begin = nullptr; const char* members_end = nullptr; + bool has_version = false; + bool has_visible = false; + bool has_changeset_id = false; + bool has_timestamp = false; + bool has_uid = false; + bool has_user = false; + bool has_tags = false; + bool has_members = false; + std::string user; while (**data) { opl_parse_space(data); @@ -550,30 +646,62 @@ ++(*data); switch (c) { case 'v': + if (has_version) { + throw opl_error{"Duplicate attribute: version (v)"}; + } + has_version = true; builder.set_version(opl_parse_version(data)); break; case 'd': + if (has_visible) { + throw opl_error{"Duplicate attribute: visible (d)"}; + } + has_visible = true; builder.set_visible(opl_parse_visible(data)); break; case 'c': + if (has_changeset_id) { + throw opl_error{"Duplicate attribute: changeset_id (c)"}; + } + has_changeset_id = true; builder.set_changeset(opl_parse_changeset_id(data)); break; case 't': + if (has_timestamp) { + throw opl_error{"Duplicate attribute: timestamp (t)"}; + } + has_timestamp = true; builder.set_timestamp(opl_parse_timestamp(data)); break; case 'i': + if (has_uid) { + throw opl_error{"Duplicate attribute: uid (i)"}; + } + has_uid = true; builder.set_uid(opl_parse_uid(data)); break; case 'u': + if (has_user) { + throw opl_error{"Duplicate attribute: user (u)"}; + } + has_user = true; opl_parse_string(data, user); break; case 'T': + if (has_tags) { + throw opl_error{"Duplicate attribute: tags (T)"}; + } + has_tags = true; if (opl_non_empty(*data)) { tags_begin = *data; opl_skip_section(data); } break; case 'M': + if (has_members) { + throw opl_error{"Duplicate attribute: members (M)"}; + } + has_members = true; members_begin = *data; members_end = opl_skip_section(data); break; @@ -601,6 +729,18 @@ const char* tags_begin = nullptr; + bool has_num_changes = false; + bool has_created_at = false; + bool has_closed_at = false; + bool has_num_comments = false; + bool has_uid = false; + bool has_user = false; + bool has_tags = false; + bool has_min_x = false; + bool has_min_y = false; + bool has_max_x = false; + bool has_max_y = false; + osmium::Box box; std::string user; while (**data) { @@ -612,44 +752,88 @@ ++(*data); switch (c) { case 'k': + if (has_num_changes) { + throw opl_error{"Duplicate attribute: num_changes (k)"}; + } + has_num_changes = true; builder.set_num_changes(opl_parse_int(data)); break; case 's': + if (has_created_at) { + throw opl_error{"Duplicate attribute: created_at (s)"}; + } + has_created_at = true; builder.set_created_at(opl_parse_timestamp(data)); break; case 'e': + if (has_closed_at) { + throw opl_error{"Duplicate attribute: closed_at (e)"}; + } + has_closed_at = true; builder.set_closed_at(opl_parse_timestamp(data)); break; case 'd': + if (has_num_comments) { + throw opl_error{"Duplicate attribute: num_comments (d)"}; + } + has_num_comments = true; builder.set_num_comments(opl_parse_int(data)); break; case 'i': + if (has_uid) { + throw opl_error{"Duplicate attribute: uid (i)"}; + } + has_uid = true; builder.set_uid(opl_parse_uid(data)); break; case 'u': + if (has_user) { + throw opl_error{"Duplicate attribute: user (u)"}; + } + has_user = true; opl_parse_string(data, user); break; case 'x': + if (has_min_x) { + throw opl_error{"Duplicate attribute: min_x (x)"}; + } + has_min_x = true; if (opl_non_empty(*data)) { box.bottom_left().set_lon_partial(data); } break; case 'y': + if (has_min_y) { + throw opl_error{"Duplicate attribute: min_y (y)"}; + } + has_min_y = true; if (opl_non_empty(*data)) { box.bottom_left().set_lat_partial(data); } break; case 'X': + if (has_max_x) { + throw opl_error{"Duplicate attribute: max_x (X)"}; + } + has_max_x = true; if (opl_non_empty(*data)) { box.top_right().set_lon_partial(data); } break; case 'Y': + if (has_max_y) { + throw opl_error{"Duplicate attribute: max_y (Y)"}; + } + has_max_y = true; if (opl_non_empty(*data)) { box.top_right().set_lat_partial(data); } break; case 'T': + if (has_tags) { + throw opl_error{"Duplicate attribute: tags (T)"}; + } + has_tags = true; if (opl_non_empty(*data)) { tags_begin = *data; opl_skip_section(data); diff -Nru libosmium-2.15.4/include/osmium/io/detail/output_format.hpp libosmium-2.15.6/include/osmium/io/detail/output_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/output_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/output_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -199,7 +199,7 @@ }; // class OutputFormatFactory - class BlackholeOutputFormat : public osmium::io::detail::OutputFormat { + class BlackholeOutputFormat final : public osmium::io::detail::OutputFormat { public: @@ -213,9 +213,9 @@ BlackholeOutputFormat(BlackholeOutputFormat&&) = delete; BlackholeOutputFormat& operator=(BlackholeOutputFormat&&) = delete; - ~BlackholeOutputFormat() noexcept final = default; + ~BlackholeOutputFormat() noexcept = default; - void write_buffer(osmium::memory::Buffer&& /*buffer*/) final { + void write_buffer(osmium::memory::Buffer&& /*buffer*/) override { } }; // class BlackholeOutputFormat diff -Nru libosmium-2.15.4/include/osmium/io/detail/pbf_decoder.hpp libosmium-2.15.6/include/osmium/io/detail/pbf_decoder.hpp --- libosmium-2.15.4/include/osmium/io/detail/pbf_decoder.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/pbf_decoder.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -260,10 +260,14 @@ } } - int32_t convert_pbf_coordinate(const int64_t c) const noexcept { + int32_t convert_pbf_lon(const int64_t c) const noexcept { return int32_t((c * m_granularity + m_lon_offset) / resolution_convert); } + int32_t convert_pbf_lat(const int64_t c) const noexcept { + return int32_t((c * m_granularity + m_lat_offset) / resolution_convert); + } + void decode_node(const data_view& data) { osmium::builder::NodeBuilder builder{m_buffer}; osmium::Node& node = builder.object(); @@ -311,8 +315,8 @@ throw osmium::pbf_error{"illegal coordinate format"}; } node.set_location(osmium::Location{ - convert_pbf_coordinate(lon), - convert_pbf_coordinate(lat) + convert_pbf_lon(lon), + convert_pbf_lat(lat) }); } @@ -380,8 +384,8 @@ while (!refs.empty() && !lons.empty() && !lats.empty()) { wnl_builder.add_node_ref( ref.update(refs.front()), - osmium::Location{convert_pbf_coordinate(lon.update(lons.front())), - convert_pbf_coordinate(lat.update(lats.front()))} + osmium::Location{convert_pbf_lon(lon.update(lons.front())), + convert_pbf_lat(lat.update(lats.front()))} ); refs.drop_front(); lons.drop_front(); @@ -531,8 +535,8 @@ const auto lat = dense_latitude.update(lats.front()); lats.drop_front(); builder.object().set_location(osmium::Location{ - convert_pbf_coordinate(lon), - convert_pbf_coordinate(lat) + convert_pbf_lon(lon), + convert_pbf_lat(lat) }); if (tag_it != tags.end()) { @@ -696,8 +700,8 @@ lats.drop_front(); if (visible) { builder.object().set_location(osmium::Location{ - convert_pbf_coordinate(lon), - convert_pbf_coordinate(lat) + convert_pbf_lon(lon), + convert_pbf_lat(lat) }); } diff -Nru libosmium-2.15.4/include/osmium/io/detail/pbf.hpp libosmium-2.15.6/include/osmium/io/detail/pbf.hpp --- libosmium-2.15.4/include/osmium/io/detail/pbf.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/pbf.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/pbf_input_format.hpp libosmium-2.15.6/include/osmium/io/detail/pbf_input_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/pbf_input_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/pbf_input_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -62,7 +62,7 @@ namespace detail { - class PBFParser : public Parser { + class PBFParser final : public Parser { std::string m_input_buffer{}; @@ -203,9 +203,9 @@ PBFParser(PBFParser&&) = delete; PBFParser& operator=(PBFParser&&) = delete; - ~PBFParser() noexcept final = default; + ~PBFParser() noexcept = default; - void run() final { + void run() override { osmium::thread::set_thread_name("_osmium_pbf_in"); parse_header_blob(); diff -Nru libosmium-2.15.4/include/osmium/io/detail/pbf_output_format.hpp libosmium-2.15.6/include/osmium/io/detail/pbf_output_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/pbf_output_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/pbf_output_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/protobuf_tags.hpp libosmium-2.15.6/include/osmium/io/detail/protobuf_tags.hpp --- libosmium-2.15.4/include/osmium/io/detail/protobuf_tags.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/protobuf_tags.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/queue_util.hpp libosmium-2.15.6/include/osmium/io/detail/queue_util.hpp --- libosmium-2.15.4/include/osmium/io/detail/queue_util.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/queue_util.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/read_thread.hpp libosmium-2.15.6/include/osmium/io/detail/read_thread.hpp --- libosmium-2.15.4/include/osmium/io/detail/read_thread.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/read_thread.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/read_write.hpp libosmium-2.15.6/include/osmium/io/detail/read_write.hpp --- libosmium-2.15.4/include/osmium/io/detail/read_write.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/read_write.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/string_table.hpp libosmium-2.15.6/include/osmium/io/detail/string_table.hpp --- libosmium-2.15.4/include/osmium/io/detail/string_table.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/string_table.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/string_util.hpp libosmium-2.15.6/include/osmium/io/detail/string_util.hpp --- libosmium-2.15.4/include/osmium/io/detail/string_util.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/string_util.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/write_thread.hpp libosmium-2.15.6/include/osmium/io/detail/write_thread.hpp --- libosmium-2.15.4/include/osmium/io/detail/write_thread.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/write_thread.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/xml_input_format.hpp libosmium-2.15.6/include/osmium/io/detail/xml_input_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/xml_input_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/xml_input_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -125,7 +125,7 @@ namespace detail { - class XMLParser : public Parser { + class XMLParser final : public Parser { enum { initial_buffer_size = 1024UL * 1024UL @@ -768,9 +768,9 @@ XMLParser(XMLParser&&) = delete; XMLParser& operator=(XMLParser&&) = delete; - ~XMLParser() noexcept final = default; + ~XMLParser() noexcept = default; - void run() final { + void run() override { osmium::thread::set_thread_name("_osmium_xml_in"); ExpatXMLParser parser{this}; diff -Nru libosmium-2.15.4/include/osmium/io/detail/xml_output_format.hpp libosmium-2.15.6/include/osmium/io/detail/xml_output_format.hpp --- libosmium-2.15.4/include/osmium/io/detail/xml_output_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/xml_output_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/detail/zlib.hpp libosmium-2.15.6/include/osmium/io/detail/zlib.hpp --- libosmium-2.15.4/include/osmium/io/detail/zlib.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/detail/zlib.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/error.hpp libosmium-2.15.6/include/osmium/io/error.hpp --- libosmium-2.15.4/include/osmium/io/error.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/error.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/file_compression.hpp libosmium-2.15.6/include/osmium/io/file_compression.hpp --- libosmium-2.15.4/include/osmium/io/file_compression.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/file_compression.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/file_format.hpp libosmium-2.15.6/include/osmium/io/file_format.hpp --- libosmium-2.15.4/include/osmium/io/file_format.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/file_format.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/file.hpp libosmium-2.15.6/include/osmium/io/file.hpp --- libosmium-2.15.4/include/osmium/io/file.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/file.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/gzip_compression.hpp libosmium-2.15.6/include/osmium/io/gzip_compression.hpp --- libosmium-2.15.4/include/osmium/io/gzip_compression.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/gzip_compression.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -102,7 +102,7 @@ } // namespace detail - class GzipCompressor : public Compressor { + class GzipCompressor final : public Compressor { int m_fd; gzFile m_gzfile; @@ -111,11 +111,11 @@ explicit GzipCompressor(const int fd, const fsync sync) : Compressor(sync), - m_fd(osmium::io::detail::reliable_dup(fd)) { + m_fd(fd) { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; #endif - m_gzfile = ::gzdopen(fd, "wb"); + m_gzfile = ::gzdopen(osmium::io::detail::reliable_dup(fd), "wb"); if (!m_gzfile) { throw gzip_error{"gzip error: write initialization failed"}; } @@ -127,7 +127,7 @@ GzipCompressor(GzipCompressor&&) = delete; GzipCompressor& operator=(GzipCompressor&&) = delete; - ~GzipCompressor() noexcept final { + ~GzipCompressor() noexcept { try { close(); } catch (...) { @@ -135,7 +135,7 @@ } } - void write(const std::string& data) final { + void write(const std::string& data) override { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; #endif @@ -149,7 +149,7 @@ } } - void close() final { + void close() override { if (m_gzfile) { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; @@ -159,6 +159,12 @@ if (result != Z_OK) { throw gzip_error{"gzip error: write close failed", result}; } + + // Do not sync or close stdout + if (m_fd == 1) { + return; + } + if (do_fsync()) { osmium::io::detail::reliable_fsync(m_fd); } @@ -168,7 +174,7 @@ }; // class GzipCompressor - class GzipDecompressor : public Decompressor { + class GzipDecompressor final : public Decompressor { gzFile m_gzfile = nullptr; @@ -194,7 +200,7 @@ GzipDecompressor(GzipDecompressor&&) = delete; GzipDecompressor& operator=(GzipDecompressor&&) = delete; - ~GzipDecompressor() noexcept final { + ~GzipDecompressor() noexcept { try { close(); } catch (...) { @@ -202,7 +208,7 @@ } } - std::string read() final { + std::string read() override { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; #endif @@ -220,7 +226,7 @@ return buffer; } - void close() final { + void close() override { if (m_gzfile) { #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; @@ -235,7 +241,7 @@ }; // class GzipDecompressor - class GzipBufferDecompressor : public Decompressor { + class GzipBufferDecompressor final : public Decompressor { const char* m_buffer; std::size_t m_buffer_size; @@ -266,7 +272,7 @@ GzipBufferDecompressor(GzipBufferDecompressor&&) = delete; GzipBufferDecompressor& operator=(GzipBufferDecompressor&&) = delete; - ~GzipBufferDecompressor() noexcept final { + ~GzipBufferDecompressor() noexcept { try { close(); } catch (...) { @@ -274,7 +280,7 @@ } } - std::string read() final { + std::string read() override { std::string output; if (m_buffer) { @@ -303,7 +309,7 @@ return output; } - void close() final { + void close() override { inflateEnd(&m_zstream); } diff -Nru libosmium-2.15.4/include/osmium/io/header.hpp libosmium-2.15.6/include/osmium/io/header.hpp --- libosmium-2.15.4/include/osmium/io/header.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/header.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/input_iterator.hpp libosmium-2.15.6/include/osmium/io/input_iterator.hpp --- libosmium-2.15.4/include/osmium/io/input_iterator.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/input_iterator.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/o5m_input.hpp libosmium-2.15.6/include/osmium/io/o5m_input.hpp --- libosmium-2.15.4/include/osmium/io/o5m_input.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/o5m_input.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/opl_input.hpp libosmium-2.15.6/include/osmium/io/opl_input.hpp --- libosmium-2.15.4/include/osmium/io/opl_input.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/opl_input.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/opl_output.hpp libosmium-2.15.6/include/osmium/io/opl_output.hpp --- libosmium-2.15.4/include/osmium/io/opl_output.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/opl_output.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/output_iterator.hpp libosmium-2.15.6/include/osmium/io/output_iterator.hpp --- libosmium-2.15.4/include/osmium/io/output_iterator.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/output_iterator.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/overwrite.hpp libosmium-2.15.6/include/osmium/io/overwrite.hpp --- libosmium-2.15.4/include/osmium/io/overwrite.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/overwrite.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/pbf_input.hpp libosmium-2.15.6/include/osmium/io/pbf_input.hpp --- libosmium-2.15.4/include/osmium/io/pbf_input.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/pbf_input.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/pbf_output.hpp libosmium-2.15.6/include/osmium/io/pbf_output.hpp --- libosmium-2.15.4/include/osmium/io/pbf_output.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/pbf_output.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/reader.hpp libosmium-2.15.6/include/osmium/io/reader.hpp --- libosmium-2.15.4/include/osmium/io/reader.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/reader.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/reader_iterator.hpp libosmium-2.15.6/include/osmium/io/reader_iterator.hpp --- libosmium-2.15.4/include/osmium/io/reader_iterator.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/reader_iterator.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/reader_with_progress_bar.hpp libosmium-2.15.6/include/osmium/io/reader_with_progress_bar.hpp --- libosmium-2.15.4/include/osmium/io/reader_with_progress_bar.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/reader_with_progress_bar.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/writer.hpp libosmium-2.15.6/include/osmium/io/writer.hpp --- libosmium-2.15.4/include/osmium/io/writer.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/writer.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/writer_options.hpp libosmium-2.15.6/include/osmium/io/writer_options.hpp --- libosmium-2.15.4/include/osmium/io/writer_options.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/writer_options.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/xml_input.hpp libosmium-2.15.6/include/osmium/io/xml_input.hpp --- libosmium-2.15.4/include/osmium/io/xml_input.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/xml_input.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/io/xml_output.hpp libosmium-2.15.6/include/osmium/io/xml_output.hpp --- libosmium-2.15.4/include/osmium/io/xml_output.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/io/xml_output.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/memory/buffer.hpp libosmium-2.15.6/include/osmium/memory/buffer.hpp --- libosmium-2.15.4/include/osmium/memory/buffer.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/memory/buffer.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/memory/callback_buffer.hpp libosmium-2.15.6/include/osmium/memory/callback_buffer.hpp --- libosmium-2.15.4/include/osmium/memory/callback_buffer.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/memory/callback_buffer.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/memory/collection.hpp libosmium-2.15.6/include/osmium/memory/collection.hpp --- libosmium-2.15.4/include/osmium/memory/collection.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/memory/collection.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/memory/item.hpp libosmium-2.15.6/include/osmium/memory/item.hpp --- libosmium-2.15.4/include/osmium/memory/item.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/memory/item.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/memory/item_iterator.hpp libosmium-2.15.6/include/osmium/memory/item_iterator.hpp --- libosmium-2.15.4/include/osmium/memory/item_iterator.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/memory/item_iterator.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/object_pointer_collection.hpp libosmium-2.15.6/include/osmium/object_pointer_collection.hpp --- libosmium-2.15.4/include/osmium/object_pointer_collection.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/object_pointer_collection.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/opl.hpp libosmium-2.15.6/include/osmium/opl.hpp --- libosmium-2.15.4/include/osmium/opl.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/opl.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/area.hpp libosmium-2.15.6/include/osmium/osm/area.hpp --- libosmium-2.15.4/include/osmium/osm/area.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/area.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -202,7 +202,7 @@ /** * Check whether this area is a multipolygon, ie. whether it has more - * than one outer ring? + * than one outer ring. */ bool is_multipolygon() const { return num_rings().first > 1; diff -Nru libosmium-2.15.4/include/osmium/osm/box.hpp libosmium-2.15.6/include/osmium/osm/box.hpp --- libosmium-2.15.4/include/osmium/osm/box.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/box.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -60,7 +60,7 @@ constexpr Box() noexcept = default; /** - * Create box from minimum and maximum coordinates. + * Create box from minimum and maximum coordinates in WGS84. * * @pre @code minx <= maxx && miny <= maxy @endcode */ diff -Nru libosmium-2.15.4/include/osmium/osm/changeset.hpp libosmium-2.15.6/include/osmium/osm/changeset.hpp --- libosmium-2.15.4/include/osmium/osm/changeset.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/changeset.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/crc.hpp libosmium-2.15.6/include/osmium/osm/crc.hpp --- libosmium-2.15.4/include/osmium/osm/crc.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/crc.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/crc_zlib.hpp libosmium-2.15.6/include/osmium/osm/crc_zlib.hpp --- libosmium-2.15.4/include/osmium/osm/crc_zlib.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/crc_zlib.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/diff_object.hpp libosmium-2.15.6/include/osmium/osm/diff_object.hpp --- libosmium-2.15.4/include/osmium/osm/diff_object.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/diff_object.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/entity_bits.hpp libosmium-2.15.6/include/osmium/osm/entity_bits.hpp --- libosmium-2.15.4/include/osmium/osm/entity_bits.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/entity_bits.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/entity.hpp libosmium-2.15.6/include/osmium/osm/entity.hpp --- libosmium-2.15.4/include/osmium/osm/entity.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/entity.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/item_type.hpp libosmium-2.15.6/include/osmium/osm/item_type.hpp --- libosmium-2.15.4/include/osmium/osm/item_type.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/item_type.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/location.hpp libosmium-2.15.6/include/osmium/osm/location.hpp --- libosmium-2.15.4/include/osmium/osm/location.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/location.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -320,7 +320,8 @@ } /** - * Create Location with given longitude and latitude. + * Create Location with given longitude and latitude in WGS84 + * coordinates. */ Location(const double lon, const double lat) : m_x(double_to_fix(lon)), diff -Nru libosmium-2.15.4/include/osmium/osm/metadata_options.hpp libosmium-2.15.6/include/osmium/osm/metadata_options.hpp --- libosmium-2.15.4/include/osmium/osm/metadata_options.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/metadata_options.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/node.hpp libosmium-2.15.6/include/osmium/osm/node.hpp --- libosmium-2.15.4/include/osmium/osm/node.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/node.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/node_ref.hpp libosmium-2.15.6/include/osmium/osm/node_ref.hpp --- libosmium-2.15.4/include/osmium/osm/node_ref.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/node_ref.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/node_ref_list.hpp libosmium-2.15.6/include/osmium/osm/node_ref_list.hpp --- libosmium-2.15.4/include/osmium/osm/node_ref_list.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/node_ref_list.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/object_comparisons.hpp libosmium-2.15.6/include/osmium/osm/object_comparisons.hpp --- libosmium-2.15.4/include/osmium/osm/object_comparisons.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/object_comparisons.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/object.hpp libosmium-2.15.6/include/osmium/osm/object.hpp --- libosmium-2.15.4/include/osmium/osm/object.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/object.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/relation.hpp libosmium-2.15.6/include/osmium/osm/relation.hpp --- libosmium-2.15.4/include/osmium/osm/relation.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/relation.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/segment.hpp libosmium-2.15.6/include/osmium/osm/segment.hpp --- libosmium-2.15.4/include/osmium/osm/segment.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/segment.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/tag.hpp libosmium-2.15.6/include/osmium/osm/tag.hpp --- libosmium-2.15.4/include/osmium/osm/tag.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/tag.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/timestamp.hpp libosmium-2.15.6/include/osmium/osm/timestamp.hpp --- libosmium-2.15.4/include/osmium/osm/timestamp.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/timestamp.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/types_from_string.hpp libosmium-2.15.6/include/osmium/osm/types_from_string.hpp --- libosmium-2.15.4/include/osmium/osm/types_from_string.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/types_from_string.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/types.hpp libosmium-2.15.6/include/osmium/osm/types.hpp --- libosmium-2.15.4/include/osmium/osm/types.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/types.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/undirected_segment.hpp libosmium-2.15.6/include/osmium/osm/undirected_segment.hpp --- libosmium-2.15.4/include/osmium/osm/undirected_segment.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/undirected_segment.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm/way.hpp libosmium-2.15.6/include/osmium/osm/way.hpp --- libosmium-2.15.4/include/osmium/osm/way.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm/way.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/osm.hpp libosmium-2.15.6/include/osmium/osm.hpp --- libosmium-2.15.4/include/osmium/osm.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/osm.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/relations/collector.hpp libosmium-2.15.6/include/osmium/relations/collector.hpp --- libosmium-2.15.4/include/osmium/relations/collector.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/relations/collector.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/relations/detail/member_meta.hpp libosmium-2.15.6/include/osmium/relations/detail/member_meta.hpp --- libosmium-2.15.4/include/osmium/relations/detail/member_meta.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/relations/detail/member_meta.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/relations/detail/relation_meta.hpp libosmium-2.15.6/include/osmium/relations/detail/relation_meta.hpp --- libosmium-2.15.4/include/osmium/relations/detail/relation_meta.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/relations/detail/relation_meta.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/relations/manager_util.hpp libosmium-2.15.6/include/osmium/relations/manager_util.hpp --- libosmium-2.15.4/include/osmium/relations/manager_util.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/relations/manager_util.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/relations/members_database.hpp libosmium-2.15.6/include/osmium/relations/members_database.hpp --- libosmium-2.15.4/include/osmium/relations/members_database.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/relations/members_database.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/relations/relations_database.hpp libosmium-2.15.6/include/osmium/relations/relations_database.hpp --- libosmium-2.15.4/include/osmium/relations/relations_database.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/relations/relations_database.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/relations/relations_manager.hpp libosmium-2.15.6/include/osmium/relations/relations_manager.hpp --- libosmium-2.15.4/include/osmium/relations/relations_manager.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/relations/relations_manager.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/storage/item_stash.hpp libosmium-2.15.6/include/osmium/storage/item_stash.hpp --- libosmium-2.15.4/include/osmium/storage/item_stash.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/storage/item_stash.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/tags/filter.hpp libosmium-2.15.6/include/osmium/tags/filter.hpp --- libosmium-2.15.4/include/osmium/tags/filter.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/tags/filter.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/tags/matcher.hpp libosmium-2.15.6/include/osmium/tags/matcher.hpp --- libosmium-2.15.4/include/osmium/tags/matcher.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/tags/matcher.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -48,6 +48,7 @@ osmium::StringMatcher m_key_matcher; osmium::StringMatcher m_value_matcher; + bool m_has_value_matcher = false; bool m_result = true; public: @@ -60,6 +61,10 @@ m_value_matcher(osmium::StringMatcher::always_false{}) { } + bool has_value_matcher() const noexcept { + return m_has_value_matcher; + } + /** * Create a TagMatcher matching the key against the specified * StringMatcher. @@ -87,6 +92,7 @@ TagMatcher(TKey&& key_matcher, TValue&& value_matcher, bool invert = false) : m_key_matcher(std::forward(key_matcher)), m_value_matcher(std::forward(value_matcher)), + m_has_value_matcher(true), m_result(!invert) { } diff -Nru libosmium-2.15.4/include/osmium/tags/regex_filter.hpp libosmium-2.15.6/include/osmium/tags/regex_filter.hpp --- libosmium-2.15.4/include/osmium/tags/regex_filter.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/tags/regex_filter.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/tags/taglist.hpp libosmium-2.15.6/include/osmium/tags/taglist.hpp --- libosmium-2.15.4/include/osmium/tags/taglist.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/tags/taglist.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/tags/tags_filter.hpp libosmium-2.15.6/include/osmium/tags/tags_filter.hpp --- libosmium-2.15.4/include/osmium/tags/tags_filter.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/tags/tags_filter.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/thread/function_wrapper.hpp libosmium-2.15.6/include/osmium/thread/function_wrapper.hpp --- libosmium-2.15.4/include/osmium/thread/function_wrapper.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/thread/function_wrapper.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/thread/pool.hpp libosmium-2.15.6/include/osmium/thread/pool.hpp --- libosmium-2.15.4/include/osmium/thread/pool.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/thread/pool.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/thread/queue.hpp libosmium-2.15.6/include/osmium/thread/queue.hpp --- libosmium-2.15.4/include/osmium/thread/queue.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/thread/queue.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/thread/util.hpp libosmium-2.15.6/include/osmium/thread/util.hpp --- libosmium-2.15.4/include/osmium/thread/util.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/thread/util.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/cast.hpp libosmium-2.15.6/include/osmium/util/cast.hpp --- libosmium-2.15.4/include/osmium/util/cast.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/cast.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/compatibility.hpp libosmium-2.15.6/include/osmium/util/compatibility.hpp --- libosmium-2.15.4/include/osmium/util/compatibility.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/compatibility.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/config.hpp libosmium-2.15.6/include/osmium/util/config.hpp --- libosmium-2.15.4/include/osmium/util/config.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/config.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/delta.hpp libosmium-2.15.6/include/osmium/util/delta.hpp --- libosmium-2.15.4/include/osmium/util/delta.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/delta.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/double.hpp libosmium-2.15.6/include/osmium/util/double.hpp --- libosmium-2.15.4/include/osmium/util/double.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/double.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/endian.hpp libosmium-2.15.6/include/osmium/util/endian.hpp --- libosmium-2.15.4/include/osmium/util/endian.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/endian.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/file.hpp libosmium-2.15.6/include/osmium/util/file.hpp --- libosmium-2.15.4/include/osmium/util/file.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/file.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/iterator.hpp libosmium-2.15.6/include/osmium/util/iterator.hpp --- libosmium-2.15.4/include/osmium/util/iterator.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/iterator.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/memory.hpp libosmium-2.15.6/include/osmium/util/memory.hpp --- libosmium-2.15.4/include/osmium/util/memory.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/memory.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/memory_mapping.hpp libosmium-2.15.6/include/osmium/util/memory_mapping.hpp --- libosmium-2.15.4/include/osmium/util/memory_mapping.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/memory_mapping.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -44,6 +44,7 @@ #ifndef _WIN32 # include +# include #else # include # include @@ -150,6 +151,21 @@ void* map_view_of_file() const noexcept; #endif + // Get the available space on the file system where the file + // behind fd is on. Return 0 if it can't be determined. + static std::size_t available_space(int fd) { +#ifdef _WIN32 + return 0; +#else + struct statvfs stat; + const int result = ::fstatvfs(fd, &stat); + if (result != 0) { + return 0; + } + return stat.f_bsize * stat.f_bavail; +#endif + } + int resize_fd(int fd) { // Anonymous mapping doesn't need resizing. if (fd == -1) { @@ -157,7 +173,13 @@ } // Make sure the file backing this mapping is large enough. - if (osmium::file_size(fd) < m_size + m_offset) { + auto const current_file_size = osmium::file_size(fd); + if (current_file_size < m_size + m_offset) { + const auto available = available_space(fd); + if (available > 0 && current_file_size + available <= m_size) { + throw std::system_error{ENOSPC, std::system_category(), "Could not resize file: Not enough space on filesystem"}; + } + osmium::resize_file(fd, m_size + m_offset); } return fd; diff -Nru libosmium-2.15.4/include/osmium/util/minmax.hpp libosmium-2.15.6/include/osmium/util/minmax.hpp --- libosmium-2.15.4/include/osmium/util/minmax.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/minmax.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/misc.hpp libosmium-2.15.6/include/osmium/util/misc.hpp --- libosmium-2.15.4/include/osmium/util/misc.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/misc.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/options.hpp libosmium-2.15.6/include/osmium/util/options.hpp --- libosmium-2.15.4/include/osmium/util/options.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/options.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/progress_bar.hpp libosmium-2.15.6/include/osmium/util/progress_bar.hpp --- libosmium-2.15.4/include/osmium/util/progress_bar.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/progress_bar.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/string.hpp libosmium-2.15.6/include/osmium/util/string.hpp --- libosmium-2.15.4/include/osmium/util/string.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/string.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/string_matcher.hpp libosmium-2.15.6/include/osmium/util/string_matcher.hpp --- libosmium-2.15.4/include/osmium/util/string_matcher.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/string_matcher.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/timer.hpp libosmium-2.15.6/include/osmium/util/timer.hpp --- libosmium-2.15.4/include/osmium/util/timer.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/timer.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/util/verbose_output.hpp libosmium-2.15.6/include/osmium/util/verbose_output.hpp --- libosmium-2.15.4/include/osmium/util/verbose_output.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/util/verbose_output.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/include/osmium/version.hpp libosmium-2.15.6/include/osmium/version.hpp --- libosmium-2.15.4/include/osmium/version.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/version.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -35,8 +35,8 @@ #define LIBOSMIUM_VERSION_MAJOR 2 #define LIBOSMIUM_VERSION_MINOR 15 -#define LIBOSMIUM_VERSION_PATCH 4 +#define LIBOSMIUM_VERSION_PATCH 6 -#define LIBOSMIUM_VERSION_STRING "2.15.4" +#define LIBOSMIUM_VERSION_STRING "2.15.6" #endif // OSMIUM_VERSION_HPP diff -Nru libosmium-2.15.4/include/osmium/visitor.hpp libosmium-2.15.6/include/osmium/visitor.hpp --- libosmium-2.15.4/include/osmium/visitor.hpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/include/osmium/visitor.hpp 2020-06-27 21:33:26.000000000 +0000 @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2019 Jochen Topf and others (see README). +Copyright 2013-2020 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff -Nru libosmium-2.15.4/test/t/builder/test_attr.cpp libosmium-2.15.6/test/t/builder/test_attr.cpp --- libosmium-2.15.4/test/t/builder/test_attr.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/builder/test_attr.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -13,225 +13,287 @@ #include #include -TEST_CASE("create node using builders") { +using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace) - using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace) +TEST_CASE("create node using builders: add node with only id") { + osmium::memory::Buffer buffer{1024 * 10}; + + const auto pos = osmium::builder::add_node(buffer, _id(22)); + const auto& node = buffer.get(pos); + + REQUIRE(node.id() == 22); + REQUIRE(node.version() == 0); + REQUIRE(node.timestamp() == osmium::Timestamp{}); + REQUIRE(node.changeset() == 0); + REQUIRE(node.uid() == 0); + REQUIRE(node.user()[0] == '\0'); + REQUIRE(node.location() == osmium::Location{}); + REQUIRE(node.tags().empty()); +} + +TEST_CASE("create node using builders: add node with complete info but no tags") { osmium::memory::Buffer buffer{1024 * 10}; - SECTION("add node with only id") { - const auto pos = osmium::builder::add_node(buffer, _id(22)); + const osmium::Location loc{3.14, 1.59}; + const auto pos = osmium::builder::add_node(buffer, + _id(1), + _version(17), + _timestamp(osmium::Timestamp{"2015-01-01T10:20:30Z"}), + _cid(21), + _uid(222), + _location(loc), + _user("foo") + ); - const auto& node = buffer.get(pos); + const auto& node = buffer.get(pos); - REQUIRE(node.id() == 22); - REQUIRE(node.version() == 0); - REQUIRE(node.timestamp() == osmium::Timestamp{}); - REQUIRE(node.changeset() == 0); - REQUIRE(node.uid() == 0); - REQUIRE(std::string{node.user()}.empty()); - REQUIRE(node.location() == osmium::Location{}); - REQUIRE(node.tags().empty()); - } + REQUIRE(node.id() == 1); + REQUIRE(node.version() == 17); + REQUIRE(node.timestamp() == osmium::Timestamp{"2015-01-01T10:20:30Z"}); + REQUIRE(node.changeset() == 21); + REQUIRE(node.uid() == 222); + REQUIRE(std::string{node.user()} == "foo"); + REQUIRE(node.location() == loc); + REQUIRE(node.tags().empty()); + REQUIRE(std::distance(node.cbegin(), node.cend()) == 0); +} - SECTION("add node with complete info but no tags") { - const osmium::Location loc{3.14, 1.59}; - const auto pos = osmium::builder::add_node(buffer, - _id(1), - _version(17), - _timestamp(osmium::Timestamp{"2015-01-01T10:20:30Z"}), - _cid(21), - _uid(222), - _location(loc), - _user("foo") - ); +TEST_CASE("create node using builders: visible/deleted flag") { + osmium::memory::Buffer buffer{1024 * 10}; - const auto& node = buffer.get(pos); + osmium::builder::add_node(buffer, _id(1), _deleted()); + osmium::builder::add_node(buffer, _id(2), _deleted(true)); + osmium::builder::add_node(buffer, _id(3), _deleted(false)); + osmium::builder::add_node(buffer, _id(4), _visible()); + osmium::builder::add_node(buffer, _id(5), _visible(true)); + osmium::builder::add_node(buffer, _id(6), _visible(false)); + + auto it = buffer.select().cbegin(); + REQUIRE_FALSE(it++->visible()); + REQUIRE_FALSE(it++->visible()); + REQUIRE(it++->visible()); + REQUIRE(it++->visible()); + REQUIRE(it++->visible()); + REQUIRE_FALSE(it++->visible()); + REQUIRE(it == buffer.select().cend()); +} - REQUIRE(node.id() == 1); - REQUIRE(node.version() == 17); - REQUIRE(node.timestamp() == osmium::Timestamp{"2015-01-01T10:20:30Z"}); - REQUIRE(node.changeset() == 21); - REQUIRE(node.uid() == 222); - REQUIRE(std::string{node.user()} == "foo"); - REQUIRE(node.location() == loc); - REQUIRE(node.tags().empty()); - REQUIRE(std::distance(node.cbegin(), node.cend()) == 0); - } - - SECTION("visible/deleted flag") { - osmium::builder::add_node(buffer, _id(1), _deleted()); - osmium::builder::add_node(buffer, _id(2), _deleted(true)); - osmium::builder::add_node(buffer, _id(3), _deleted(false)); - osmium::builder::add_node(buffer, _id(4), _visible()); - osmium::builder::add_node(buffer, _id(5), _visible(true)); - osmium::builder::add_node(buffer, _id(6), _visible(false)); - - auto it = buffer.select().cbegin(); - REQUIRE_FALSE(it++->visible()); - REQUIRE_FALSE(it++->visible()); - REQUIRE(it++->visible()); - REQUIRE(it++->visible()); - REQUIRE(it++->visible()); - REQUIRE_FALSE(it++->visible()); - REQUIRE(it == buffer.select().cend()); - } - - SECTION("order of attributes doesn't matter") { - const osmium::Location loc{3.14, 1.59}; - const auto pos = osmium::builder::add_node(buffer, - _timestamp("2015-01-01T10:20:30Z"), - _version(17), - _cid(21), - _uid(222), - _user(std::string{"foo"}), - _id(1), - _location(3.14, 1.59) - ); +TEST_CASE("create node using builders: order of attributes doesn't matter") { + osmium::memory::Buffer buffer{1024 * 10}; - const auto& node = buffer.get(pos); + const osmium::Location loc{3.14, 1.59}; + const auto pos = osmium::builder::add_node(buffer, + _timestamp("2015-01-01T10:20:30Z"), + _version(17), + _cid(21), + _uid(222), + _user(std::string{"foo"}), + _id(1), + _location(3.14, 1.59) + ); - REQUIRE(node.id() == 1); - REQUIRE(node.version() == 17); - REQUIRE(node.timestamp() == osmium::Timestamp{"2015-01-01T10:20:30Z"}); - REQUIRE(node.changeset() == 21); - REQUIRE(node.uid() == 222); - REQUIRE(std::string{node.user()} == "foo"); - REQUIRE(node.location() == loc); - REQUIRE(node.tags().empty()); - } + const auto& node = buffer.get(pos); + REQUIRE(node.id() == 1); + REQUIRE(node.version() == 17); + REQUIRE(node.timestamp() == osmium::Timestamp{"2015-01-01T10:20:30Z"}); + REQUIRE(node.changeset() == 21); + REQUIRE(node.uid() == 222); + REQUIRE(std::string{node.user()} == "foo"); + REQUIRE(node.location() == loc); + REQUIRE(node.tags().empty()); } -TEST_CASE("create node with tags using builders") { +TEST_CASE("create node with tags using builders: add tags using _tag") { + osmium::memory::Buffer buffer{1024 * 10}; - using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace) + std::pair t1 = {"name", "Node Inn"}; + std::pair t2 = {"phone", "+1-123-555-4567"}; + const auto pos = osmium::builder::add_node(buffer, + _id(2), + _tag("amenity", "restaurant"), + _tag(t1), + _tag(t2), + _tag(std::string{"cuisine"}, std::string{"italian"}) + ); + + const auto& node = buffer.get(pos); + + REQUIRE(node.id() == 2); + REQUIRE(node.tags().size() == 4); + REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); + + auto it = node.tags().cbegin(); + REQUIRE(std::string{it->key()} == "amenity"); + REQUIRE(std::string{it->value()} == "restaurant"); + ++it; + REQUIRE(std::string{it->key()} == "name"); + REQUIRE(std::string{it->value()} == "Node Inn"); + ++it; + REQUIRE(std::string{it->key()} == "phone"); + REQUIRE(std::string{it->value()} == "+1-123-555-4567"); + ++it; + REQUIRE(std::string{it->key()} == "cuisine"); + REQUIRE(std::string{it->value()} == "italian"); + ++it; + REQUIRE(it == node.tags().cend()); +} + +TEST_CASE("create node with tags using builders: add tags using _tag with equal sign in single cstring") { osmium::memory::Buffer buffer{1024 * 10}; - SECTION("add tags using _tag") { - std::pair t1 = {"name", "Node Inn"}; - std::pair t2 = {"phone", "+1-123-555-4567"}; + const auto pos = osmium::builder::add_node(buffer, + _id(2), + _tag("amenity=restaurant"), + _tag("name="), + _tag("phone"), + _tag(std::string{"cuisine=italian"}) + ); - const auto pos = osmium::builder::add_node(buffer, - _id(2), - _tag("amenity", "restaurant"), - _tag(t1), - _tag(t2), - _tag(std::string{"cuisine"}, std::string{"italian"}) - ); + const auto& node = buffer.get(pos); - const auto& node = buffer.get(pos); + REQUIRE(node.id() == 2); + REQUIRE(node.tags().size() == 4); + REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); + + auto it = node.tags().cbegin(); + REQUIRE(std::string{it->key()} == "amenity"); + REQUIRE(std::string{it->value()} == "restaurant"); + ++it; + REQUIRE(std::string{it->key()} == "name"); + REQUIRE(it->value()[0] == '\0'); + ++it; + REQUIRE(std::string{it->key()} == "phone"); + REQUIRE(it->value()[0] == '\0'); + ++it; + REQUIRE(std::string{it->key()} == "cuisine"); + REQUIRE(std::string{it->value()} == "italian"); + ++it; + REQUIRE(it == node.tags().cend()); +} - REQUIRE(node.id() == 2); - REQUIRE(node.tags().size() == 4); - REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); +TEST_CASE("create node with tags using builders: add tags using _tags from initializer list") { + osmium::memory::Buffer buffer{1024 * 10}; - auto it = node.tags().cbegin(); - REQUIRE(std::string{it->key()} == "amenity"); - REQUIRE(std::string{it->value()} == "restaurant"); - ++it; - REQUIRE(std::string{it->key()} == "name"); - REQUIRE(std::string{it->value()} == "Node Inn"); - ++it; - REQUIRE(std::string{it->key()} == "phone"); - REQUIRE(std::string{it->value()} == "+1-123-555-4567"); - ++it; - REQUIRE(std::string{it->key()} == "cuisine"); - REQUIRE(std::string{it->value()} == "italian"); - ++it; - REQUIRE(it == node.tags().cend()); - } + const auto pos = osmium::builder::add_node(buffer, + _id(3), + _tags({{"amenity", "post_box"}}) + ); - SECTION("add tags using _tags from initializer list") { - const auto pos = osmium::builder::add_node(buffer, - _id(3), - _tags({{"amenity", "post_box"}}) - ); + const auto& node = buffer.get(pos); - const auto& node = buffer.get(pos); + REQUIRE(node.id() == 3); + REQUIRE(node.tags().size() == 1); - REQUIRE(node.id() == 3); - REQUIRE(node.tags().size() == 1); + auto it = node.tags().cbegin(); + REQUIRE(std::string{it->key()} == "amenity"); + REQUIRE(std::string{it->value()} == "post_box"); + ++it; + REQUIRE(it == node.tags().cend()); + REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); +} - auto it = node.tags().cbegin(); - REQUIRE(std::string{it->key()} == "amenity"); - REQUIRE(std::string{it->value()} == "post_box"); - ++it; - REQUIRE(it == node.tags().cend()); - REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); - } +TEST_CASE("create node with tags using builders: add tags using _tags from TagList") { + osmium::memory::Buffer buffer{1024 * 10}; - SECTION("add tags using _tags from TagList") { - const auto pos1 = osmium::builder::add_node(buffer, - _id(3), - _tag("a", "d"), - _tag("b", "e"), - _tag("c", "f") - ); + const auto pos1 = osmium::builder::add_node(buffer, + _id(3), + _tag("a", "d"), + _tag("b", "e"), + _tag("c", "f") + ); - const auto& node1 = buffer.get(pos1); + const auto& node1 = buffer.get(pos1); - const auto pos2 = osmium::builder::add_node(buffer, - _id(4), - _tags(node1.tags()) - ); + const auto pos2 = osmium::builder::add_node(buffer, + _id(4), + _tags(node1.tags()) + ); - const auto& node2 = buffer.get(pos2); + const auto& node2 = buffer.get(pos2); - REQUIRE(node2.id() == 4); - REQUIRE(node2.tags().size() == 3); + REQUIRE(node2.id() == 4); + REQUIRE(node2.tags().size() == 3); - auto it = node2.tags().cbegin(); - REQUIRE(std::string{it++->key()} == "a"); - REQUIRE(std::string{it++->key()} == "b"); - REQUIRE(std::string{it++->key()} == "c"); - REQUIRE(it == node2.tags().cend()); - REQUIRE(std::distance(node2.cbegin(), node2.cend()) == 1); - } + auto it = node2.tags().cbegin(); + REQUIRE(std::string{it++->key()} == "a"); + REQUIRE(std::string{it++->key()} == "b"); + REQUIRE(std::string{it++->key()} == "c"); + REQUIRE(it == node2.tags().cend()); + REQUIRE(std::distance(node2.cbegin(), node2.cend()) == 1); +} - SECTION("add tags using mixed tag sources") { - const std::vector tags = { - {"t5", "t5"}, - {"t6", "t6"} - }; +TEST_CASE("create node with tags using builders: add tags using mixed tag sources") { + osmium::memory::Buffer buffer{1024 * 10}; - const auto pos = osmium::builder::add_node(buffer, - _id(4), - _tag("t1", "t1"), - _tags({{"t2", "t2"}, {"t3", "t3"}}), - _tag("t4", "t4"), - _tags(tags) - ); - - const auto& node = buffer.get(pos); - - REQUIRE(node.id() == 4); - REQUIRE(node.tags().size() == 6); - - auto it = node.tags().cbegin(); - REQUIRE(std::string{it->key()} == "t1"); - ++it; - REQUIRE(std::string{it->key()} == "t2"); - ++it; - REQUIRE(std::string{it->key()} == "t3"); - ++it; - REQUIRE(std::string{it->key()} == "t4"); - ++it; - REQUIRE(std::string{it->key()} == "t5"); - ++it; - REQUIRE(std::string{it->key()} == "t6"); - ++it; - REQUIRE(it == node.tags().cend()); - REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); - } + const std::vector tags = { + {"t5", "t5"}, + {"t6", "t6"} + }; + + const auto pos = osmium::builder::add_node(buffer, + _id(4), + _tag("t1=t1"), + _tags({{"t2", "t2"}, {"t3", "t3"}}), + _tag("t4", "t4"), + _tags(tags) + ); + + const auto& node = buffer.get(pos); + REQUIRE(node.id() == 4); + REQUIRE(node.tags().size() == 6); + + auto it = node.tags().cbegin(); + REQUIRE(std::string{it->key()} == "t1"); + ++it; + REQUIRE(std::string{it->key()} == "t2"); + ++it; + REQUIRE(std::string{it->key()} == "t3"); + ++it; + REQUIRE(std::string{it->key()} == "t4"); + ++it; + REQUIRE(std::string{it->key()} == "t5"); + ++it; + REQUIRE(std::string{it->key()} == "t6"); + ++it; + REQUIRE(it == node.tags().cend()); + REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); } -TEST_CASE("create way using builders") { +TEST_CASE("create node with tags using builders: add tags using _t with string") { + osmium::memory::Buffer buffer{1024 * 10}; - using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace) + const auto pos = osmium::builder::add_node(buffer, + _id(5), + _t("amenity=post_box,,empty,also_empty=,operator=Deutsche Post") + ); + + const auto& node = buffer.get(pos); + + REQUIRE(node.id() == 5); + REQUIRE(node.tags().size() == 4); + auto it = node.tags().cbegin(); + REQUIRE(std::string{it->key()} == "amenity"); + REQUIRE(std::string{it->value()} == "post_box"); + ++it; + REQUIRE(std::string{it->key()} == "empty"); + REQUIRE(it->value()[0] == '\0'); + ++it; + REQUIRE(std::string{it->key()} == "also_empty"); + REQUIRE(it->value()[0] == '\0'); + ++it; + REQUIRE(std::string{it->key()} == "operator"); + REQUIRE(std::string{it->value()} == "Deutsche Post"); + ++it; + REQUIRE(it == node.tags().cend()); + REQUIRE(std::distance(node.cbegin(), node.cend()) == 1); +} + +TEST_CASE("create way using builders") { osmium::memory::Buffer buffer{1024 * 10}; SECTION("add way without nodes") { @@ -265,8 +327,6 @@ { 8, osmium::Location{8.8, 0.8} } }; - using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace) - osmium::memory::Buffer wbuffer{1024 * 10}; osmium::builder::add_way(wbuffer, _id(1), @@ -384,170 +444,167 @@ REQUIRE(it == way.nodes().cend()); } -TEST_CASE("create relation using builders") { +TEST_CASE("create relation using builders: create relation") { + osmium::memory::Buffer buffer{1024 * 10}; - using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace) + osmium::builder::attr::member_type m{osmium::item_type::way, 113, "inner"}; - osmium::memory::Buffer buffer{1024 * 10}; + osmium::builder::add_relation(buffer, + _id(123), + _member(osmium::item_type::node, 123, ""), + _member(osmium::item_type::node, 132), + _member(osmium::item_type::way, 111, "outer"), + _member(osmium::builder::attr::member_type{osmium::item_type::way, 112, "inner"}), + _member(m) + ); - SECTION("create relation") { - osmium::builder::attr::member_type m{osmium::item_type::way, 113, "inner"}; + const auto& relation = buffer.get(0); - osmium::builder::add_relation(buffer, - _id(123), - _member(osmium::item_type::node, 123, ""), - _member(osmium::item_type::node, 132), - _member(osmium::item_type::way, 111, "outer"), - _member(osmium::builder::attr::member_type{osmium::item_type::way, 112, "inner"}), - _member(m) - ); + REQUIRE(relation.id() == 123); + REQUIRE(relation.members().size() == 5); + REQUIRE(std::distance(relation.cbegin(), relation.cend()) == 1); + + auto it = relation.members().begin(); + + REQUIRE(it->type() == osmium::item_type::node); + REQUIRE(it->ref() == 123); + REQUIRE(it->role()[0] == '\0'); + ++it; + + REQUIRE(it->type() == osmium::item_type::node); + REQUIRE(it->ref() == 132); + REQUIRE(it->role()[0] == '\0'); + ++it; + + REQUIRE(it->type() == osmium::item_type::way); + REQUIRE(it->ref() == 111); + REQUIRE(std::string{it->role()} == "outer"); + ++it; + + REQUIRE(it->type() == osmium::item_type::way); + REQUIRE(it->ref() == 112); + REQUIRE(std::string{it->role()} == "inner"); + ++it; + + REQUIRE(it->type() == osmium::item_type::way); + REQUIRE(it->ref() == 113); + REQUIRE(std::string{it->role()} == "inner"); + ++it; - const auto& relation = buffer.get(0); + REQUIRE(it == relation.members().end()); +} - REQUIRE(relation.id() == 123); - REQUIRE(relation.members().size() == 5); - REQUIRE(std::distance(relation.cbegin(), relation.cend()) == 1); +TEST_CASE("create relation using builders: create relation member from existing relation member") { + osmium::memory::Buffer buffer{1024 * 10}; - auto it = relation.members().begin(); + osmium::builder::add_relation(buffer, + _id(123), + _member(osmium::item_type::way, 111, "outer"), + _member(osmium::item_type::way, 112, "inner") + ); - REQUIRE(it->type() == osmium::item_type::node); - REQUIRE(it->ref() == 123); - REQUIRE(std::string{it->role()}.empty()); - ++it; + const auto& relation1 = buffer.get(0); - REQUIRE(it->type() == osmium::item_type::node); - REQUIRE(it->ref() == 132); - REQUIRE(std::string{it->role()}.empty()); - ++it; + const auto pos = osmium::builder::add_relation(buffer, + _id(124), + _member(*relation1.members().begin()), + _members(std::next(relation1.members().begin()), relation1.members().end()) + ); - REQUIRE(it->type() == osmium::item_type::way); - REQUIRE(it->ref() == 111); - REQUIRE(std::string{it->role()} == "outer"); - ++it; + const auto& relation = buffer.get(pos); - REQUIRE(it->type() == osmium::item_type::way); - REQUIRE(it->ref() == 112); - REQUIRE(std::string{it->role()} == "inner"); - ++it; + REQUIRE(relation.id() == 124); + REQUIRE(relation.members().size() == 2); - REQUIRE(it->type() == osmium::item_type::way); - REQUIRE(it->ref() == 113); - REQUIRE(std::string{it->role()} == "inner"); - ++it; + auto it = relation.members().begin(); - REQUIRE(it == relation.members().end()); - } + REQUIRE(it->type() == osmium::item_type::way); + REQUIRE(it->ref() == 111); + REQUIRE(std::string{it->role()} == "outer"); + ++it; - SECTION("create relation member from existing relation member") { - osmium::builder::add_relation(buffer, - _id(123), - _member(osmium::item_type::way, 111, "outer"), - _member(osmium::item_type::way, 112, "inner") - ); + REQUIRE(it->type() == osmium::item_type::way); + REQUIRE(it->ref() == 112); + REQUIRE(std::string{it->role()} == "inner"); + ++it; - const auto& relation1 = buffer.get(0); + REQUIRE(it == relation.members().end()); +} - const auto pos = osmium::builder::add_relation(buffer, - _id(124), - _member(*relation1.members().begin()), - _members(std::next(relation1.members().begin()), relation1.members().end()) - ); +TEST_CASE("create relation using builders: create relation with members from initializer list") { + osmium::memory::Buffer buffer{1024 * 10}; - const auto& relation = buffer.get(pos); + const auto pos = osmium::builder::add_relation(buffer, + _id(123), + _members({ + {osmium::item_type::node, 123, ""}, + {osmium::item_type::way, 111, "outer"} + }) + ); - REQUIRE(relation.id() == 124); - REQUIRE(relation.members().size() == 2); + const auto& relation = buffer.get(pos); - auto it = relation.members().begin(); + REQUIRE(relation.id() == 123); + REQUIRE(relation.members().size() == 2); + REQUIRE(std::distance(relation.cbegin(), relation.cend()) == 1); + + auto it = relation.members().begin(); + REQUIRE(it->type() == osmium::item_type::node); + REQUIRE(it->ref() == 123); + REQUIRE(it->role()[0] == '\0'); + ++it; + REQUIRE(it->type() == osmium::item_type::way); + REQUIRE(it->ref() == 111); + REQUIRE(std::string{it->role()} == "outer"); + ++it; + REQUIRE(it == relation.members().end()); +} - REQUIRE(it->type() == osmium::item_type::way); - REQUIRE(it->ref() == 111); - REQUIRE(std::string{it->role()} == "outer"); - ++it; +TEST_CASE("create relation using builders: create relation with members from iterators and some tags") { + osmium::memory::Buffer buffer{1024 * 10}; - REQUIRE(it->type() == osmium::item_type::way); - REQUIRE(it->ref() == 112); - REQUIRE(std::string{it->role()} == "inner"); - ++it; + const std::vector members = { + {osmium::item_type::node, 123}, + {osmium::item_type::way, 111, "outer"} + }; - REQUIRE(it == relation.members().end()); + SECTION("using iterators") { + osmium::builder::add_relation(buffer, + _id(123), + _members(members.begin(), members.end()), + _tag("a", "x"), + _tag("b", "y") + ); } - - SECTION("create relation with members from initializer list") { - const auto pos = osmium::builder::add_relation(buffer, + SECTION("using container") { + osmium::builder::add_relation(buffer, _id(123), - _members({ - {osmium::item_type::node, 123, ""}, - {osmium::item_type::way, 111, "outer"} - }) + _members(members), + _tag("a", "x"), + _tag("b", "y") ); - - const auto& relation = buffer.get(pos); - - REQUIRE(relation.id() == 123); - REQUIRE(relation.members().size() == 2); - REQUIRE(std::distance(relation.cbegin(), relation.cend()) == 1); - - auto it = relation.members().begin(); - REQUIRE(it->type() == osmium::item_type::node); - REQUIRE(it->ref() == 123); - REQUIRE(std::string{it->role()}.empty()); - ++it; - REQUIRE(it->type() == osmium::item_type::way); - REQUIRE(it->ref() == 111); - REQUIRE(std::string{it->role()} == "outer"); - ++it; - REQUIRE(it == relation.members().end()); - } - - SECTION("create relation with members from iterators and some tags") { - const std::vector members = { - {osmium::item_type::node, 123}, - {osmium::item_type::way, 111, "outer"} - }; - - SECTION("using iterators") { - osmium::builder::add_relation(buffer, - _id(123), - _members(members.begin(), members.end()), - _tag("a", "x"), - _tag("b", "y") - ); - } - SECTION("using container") { - osmium::builder::add_relation(buffer, - _id(123), - _members(members), - _tag("a", "x"), - _tag("b", "y") - ); - } - - const auto& relation = buffer.get(0); - - REQUIRE(relation.id() == 123); - REQUIRE(relation.members().size() == 2); - REQUIRE(relation.tags().size() == 2); - REQUIRE(std::distance(relation.cbegin(), relation.cend()) == 2); - - auto it = relation.members().begin(); - REQUIRE(it->type() == osmium::item_type::node); - REQUIRE(it->ref() == 123); - REQUIRE(std::string{it->role()}.empty()); - ++it; - REQUIRE(it->type() == osmium::item_type::way); - REQUIRE(it->ref() == 111); - REQUIRE(std::string{it->role()} == "outer"); - ++it; - REQUIRE(it == relation.members().end()); } + const auto& relation = buffer.get(0); + + REQUIRE(relation.id() == 123); + REQUIRE(relation.members().size() == 2); + REQUIRE(relation.tags().size() == 2); + REQUIRE(std::distance(relation.cbegin(), relation.cend()) == 2); + + auto it = relation.members().begin(); + REQUIRE(it->type() == osmium::item_type::node); + REQUIRE(it->ref() == 123); + REQUIRE(it->role()[0] == '\0'); + ++it; + REQUIRE(it->type() == osmium::item_type::way); + REQUIRE(it->ref() == 111); + REQUIRE(std::string{it->role()} == "outer"); + ++it; + REQUIRE(it == relation.members().end()); } TEST_CASE("create area using builders") { - - using namespace osmium::builder::attr; // NOLINT(google-build-using-namespace) - osmium::memory::Buffer buffer{1024 * 10}; SECTION("add area without rings") { diff -Nru libosmium-2.15.4/test/t/geom/test_projection.cpp libosmium-2.15.6/test/t/geom/test_projection.cpp --- libosmium-2.15.4/test/t/geom/test_projection.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/geom/test_projection.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -4,8 +4,6 @@ #include #include -#include - TEST_CASE("Indentity Projection") { osmium::geom::IdentityProjection projection; REQUIRE(4326 == projection.epsg()); diff -Nru libosmium-2.15.4/test/t/index/test_id_set.cpp libosmium-2.15.6/test/t/index/test_id_set.cpp --- libosmium-2.15.4/test/t/index/test_id_set.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/index/test_id_set.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -147,6 +147,14 @@ REQUIRE(s.get(17)); REQUIRE(s.get(28)); REQUIRE_FALSE(s.empty()); + const auto size = s.size(); + + // Setting the same id as last time doesn't grow the size + s.set(28); + REQUIRE(s.get(17)); + REQUIRE(s.get(28)); + REQUIRE_FALSE(s.empty()); + REQUIRE(size == s.size()); s.clear(); REQUIRE(s.empty()); @@ -216,3 +224,31 @@ REQUIRE(it == s.end()); } +TEST_CASE("Merge two IdSetSmall") { + osmium::index::IdSetSmall s1; + osmium::index::IdSetSmall s2; + + s1.set(23); + s1.set(2); + s1.set(7); + s1.set(55); + s1.set(42); + s1.set(7); + + s2.set(2); + s2.set(32); + s2.set(8); + s2.set(55); + s2.set(1); + + s1.sort_unique(); + REQUIRE(s1.size() == 5); + s2.sort_unique(); + REQUIRE(s2.size() == 5); + s1.merge_sorted(s2); + REQUIRE(s1.size() == 8); + + const auto ids = {1, 2, 7, 8, 23, 32, 42, 55}; + REQUIRE(std::equal(s1.cbegin(), s1.cend(), ids.begin())); +} + diff -Nru libosmium-2.15.4/test/t/index/test_nwr_array.cpp libosmium-2.15.6/test/t/index/test_nwr_array.cpp --- libosmium-2.15.4/test/t/index/test_nwr_array.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/index/test_nwr_array.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -11,5 +11,11 @@ REQUIRE(a(osmium::item_type::node) == 1); REQUIRE(a(osmium::item_type::way) == 2); REQUIRE(a(osmium::item_type::relation) == 3); + + auto it = a.cbegin(); + REQUIRE(*it++ == 1); + REQUIRE(*it++ == 2); + REQUIRE(*it++ == 3); + REQUIRE(it == a.cend()); } diff -Nru libosmium-2.15.4/test/t/io/test_opl_parser.cpp libosmium-2.15.6/test/t/io/test_opl_parser.cpp --- libosmium-2.15.4/test/t/io/test_opl_parser.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/io/test_opl_parser.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -720,7 +720,6 @@ REQUIRE(node.location() == loc); REQUIRE(node.tags().empty()); } - } TEST_CASE("Parse way") { @@ -1044,6 +1043,54 @@ } +TEST_CASE("Duplicate attributes") { + osmium::memory::Buffer buffer{1024}; + REQUIRE_THROWS_WITH(osmium::opl_parse("n123 v1 v2", buffer), + "OPL error: Duplicate attribute: version (v) on line 0 column 0"); + REQUIRE_THROWS_WITH(osmium::opl_parse("w123 c1 c2", buffer), + "OPL error: Duplicate attribute: changeset_id (c) on line 0 column 0"); + REQUIRE_THROWS_WITH(osmium::opl_parse("r123 Ta=b Tc=d", buffer), + "OPL error: Duplicate attribute: tags (T) on line 0 column 0"); + REQUIRE_THROWS_WITH(osmium::opl_parse("c123 k1 k2", buffer), + "OPL error: Duplicate attribute: num_changes (k) on line 0 column 0"); + + for (const char *attr : {"v1", "dV", "c2", "t2020-01-01T00:00:01Z", "i3", "utest", "Ta=b", "x1.0", "y2.0"}) { + auto line = std::string{"n1 "} + attr; + REQUIRE_NOTHROW(osmium::opl_parse(line.c_str(), buffer)); + line += " "; + line += attr; + REQUIRE_THROWS_AS(osmium::opl_parse(line.c_str(), buffer), + const osmium::opl_error &); + } + + for (const char *attr : {"v1", "dV", "c2", "t2020-01-01T00:00:01Z", "i3", "utest", "Ta=b", "Nn1"}) { + auto line = std::string{"w1 "} + attr; + REQUIRE_NOTHROW(osmium::opl_parse(line.c_str(), buffer)); + line += " "; + line += attr; + REQUIRE_THROWS_AS(osmium::opl_parse(line.c_str(), buffer), + const osmium::opl_error &); + } + + for (const char *attr : {"v1", "dV", "c2", "t2020-01-01T00:00:01Z", "i3", "utest", "Ta=b", "Mn1@foo"}) { + auto line = std::string{"r1 "} + attr; + REQUIRE_NOTHROW(osmium::opl_parse(line.c_str(), buffer)); + line += " "; + line += attr; + REQUIRE_THROWS_AS(osmium::opl_parse(line.c_str(), buffer), + const osmium::opl_error &); + } + + for (const char *attr : {"k1", "s2020-01-01T00:00:01Z", "e2020-01-01T00:00:02Z", "d1", "i3", "utest", "Ta=b", "x1", "y2", "X3", "Y4"}) { + auto line = std::string{"c1 "} + attr; + REQUIRE_NOTHROW(osmium::opl_parse(line.c_str(), buffer)); + line += " "; + line += attr; + REQUIRE_THROWS_AS(osmium::opl_parse(line.c_str(), buffer), + const osmium::opl_error &); + } +} + TEST_CASE("Parse OPL using Reader") { osmium::io::File file{with_data_dir("t/io/data.opl")}; osmium::io::Reader reader{file}; diff -Nru libosmium-2.15.4/test/t/io/test_output_utils.cpp libosmium-2.15.6/test/t/io/test_output_utils.cpp --- libosmium-2.15.4/test/t/io/test_output_utils.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/io/test_output_utils.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -184,7 +184,7 @@ const uint32_t max_code_point = 0x10ffffU; for (uint32_t cp = 0; cp <= max_code_point; ++cp) { - auto end = osmium::io::detail::append_codepoint_as_utf8(cp, s); + const auto end = osmium::io::detail::append_codepoint_as_utf8(cp, s); const char* it = s; REQUIRE(osmium::io::detail::next_utf8_codepoint(&it, std::end(s)) == cp); REQUIRE(end == it); diff -Nru libosmium-2.15.4/test/t/io/test_reader_with_mock_decompression.cpp libosmium-2.15.6/test/t/io/test_reader_with_mock_decompression.cpp --- libosmium-2.15.4/test/t/io/test_reader_with_mock_decompression.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/io/test_reader_with_mock_decompression.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -14,7 +14,7 @@ // constructor it can be instructed to throw an exception in specific parts // of its code. This is then used to test the internals of the Reader. -class MockDecompressor : public osmium::io::Decompressor { +class MockDecompressor final : public osmium::io::Decompressor { std::string m_fail_in; int m_read_count = 0; @@ -34,7 +34,7 @@ MockDecompressor(MockDecompressor&&) = delete; MockDecompressor& operator=(MockDecompressor&&) = delete; - ~MockDecompressor() noexcept final = default; + ~MockDecompressor() noexcept = default; static void add_node(std::string& s, int i) { s += "\n"; } - std::string read() final { + std::string read() override { std::string buffer; ++m_read_count; @@ -68,7 +68,7 @@ return buffer; } - void close() final { + void close() override { if (m_fail_in == "close") { throw std::runtime_error{"error close"}; } diff -Nru libosmium-2.15.4/test/t/io/test_writer_with_mock_compression.cpp libosmium-2.15.6/test/t/io/test_writer_with_mock_compression.cpp --- libosmium-2.15.4/test/t/io/test_writer_with_mock_compression.cpp 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/test/t/io/test_writer_with_mock_compression.cpp 2020-06-27 21:33:26.000000000 +0000 @@ -10,7 +10,7 @@ #include #include -class MockCompressor : public osmium::io::Compressor { +class MockCompressor final : public osmium::io::Compressor { std::string m_fail_in; @@ -30,15 +30,15 @@ MockCompressor(MockCompressor&&) = delete; MockCompressor& operator=(MockCompressor&&) = delete; - ~MockCompressor() noexcept final = default; + ~MockCompressor() noexcept = default; - void write(const std::string& /*data*/) final { + void write(const std::string& /*data*/) override { if (m_fail_in == "write") { throw std::logic_error{"write"}; } } - void close() final { + void close() override { if (m_fail_in == "close") { throw std::logic_error{"close"}; } diff -Nru libosmium-2.15.4/.travis.yml libosmium-2.15.6/.travis.yml --- libosmium-2.15.4/.travis.yml 2019-11-28 10:29:22.000000000 +0000 +++ libosmium-2.15.6/.travis.yml 2020-06-27 21:33:26.000000000 +0000 @@ -4,10 +4,12 @@ # #----------------------------------------------------------------------------- -language: generic +os: linux dist: xenial +language: generic + #----------------------------------------------------------------------------- cache: @@ -75,7 +77,7 @@ #----------------------------------------------------------------------------- -matrix: +jobs: include: # Linux Clang Builds