diff --git a/.github/actions/win-install/action.yml b/.github/actions/win-install/action.yml index a31825a95..e00163d91 100644 --- a/.github/actions/win-install/action.yml +++ b/.github/actions/win-install/action.yml @@ -16,6 +16,6 @@ runs: proj[core]:x64-windows \ zlib:x64-windows shell: bash - - name: Install psycopg2 and behave - run: python -m pip install psycopg2 behave osmium + - name: Install psycopg and behave + run: python -m pip install psycopg behave osmium shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 763aa0bd3..1d8d0a873 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -37,7 +37,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -56,7 +56,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -76,7 +76,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -95,7 +95,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -115,7 +115,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -135,7 +135,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -154,7 +154,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -165,7 +165,6 @@ jobs: env: CC: gcc-12 CXX: g++-12 - EXTRA_FLAGS: -Wno-stringop-overread LUA_VERSION: 5.3 LUAJIT_OPTION: ON POSTGRESQL_VERSION: 13 @@ -174,7 +173,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -193,7 +192,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -212,7 +211,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -232,7 +231,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -251,7 +250,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -262,7 +261,6 @@ jobs: env: CC: gcc-12 CXX: g++-12 - EXTRA_FLAGS: -Wno-stringop-overread LUA_VERSION: 5.4 LUAJIT_OPTION: ON POSTGRESQL_VERSION: 16 @@ -271,7 +269,7 @@ jobs: PSYCOPG: 2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -291,7 +289,7 @@ jobs: PSYCOPG: 3 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -312,7 +310,7 @@ jobs: PSYCOPG: 3 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -332,7 +330,7 @@ jobs: PSYCOPG: 3 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/build-and-test @@ -348,8 +346,8 @@ jobs: VCPKG_DEFAULT_BINARY_CACHE: C:/vcpkg_binary_cache steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/checkout@v6 + - uses: actions/cache@v5 with: path: | C:/vcpkg_binary_cache @@ -373,7 +371,7 @@ jobs: working-directory: build if: matrix.os == 'windows-2025' - name: 'Upload Artifact' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: osm2pgsql-win64 path: c:/artifact @@ -387,8 +385,8 @@ jobs: OSMURL: https://download.geofabrik.de/europe/monaco-latest.osm.pbf steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 + - uses: actions/checkout@v6 + - uses: actions/download-artifact@v6 with: name: osm2pgsql-win64 - uses: ./.github/actions/win-postgres diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 6e8721787..b3d2491ab 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -18,7 +18,7 @@ jobs: PIP_OPTION: --break-system-packages steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-prerequisites - uses: ./.github/actions/linux-cmake - uses: ./.github/actions/clang-tidy diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml index a21a9053f..26a6eae47 100644 --- a/.github/workflows/luacheck.yml +++ b/.github/workflows/luacheck.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install prerequisites run: | diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 1581280d1..4b28eb924 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -22,13 +22,13 @@ jobs: POSTGRESQL_VERSION: 16 POSTGIS_VERSION: 3 BUILD_TYPE: Release - CXXFLAGS: -pedantic -Wextra -Wno-stringop-overread -Werror + CXXFLAGS: -pedantic -Wextra -Werror PREFIX: /usr/local OSMURL: https://download.geofabrik.de/europe/monaco-latest.osm.pbf OSMFILE: monaco-latest.osm.pbf steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Show installed PostgreSQL packages run: apt-cache search postgresql | sort diff --git a/CMakeLists.txt b/CMakeLists.txt index 22d37fb5b..e96d9c49d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,10 @@ else() add_compile_options(-Wall) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_definitions(-Wno-stringop-overread -Wno-maybe-uninitialized) +endif() + option(EXTERNAL_LIBOSMIUM "Do not use the bundled libosmium" OFF) option(EXTERNAL_PROTOZERO "Do not use the bundled protozero" OFF) option(EXTERNAL_FMT "Do not use the bundled fmt" OFF) @@ -67,7 +71,7 @@ endif() set(MINIMUM_POSTGRESQL_SERVER_VERSION "11") set(MINIMUM_POSTGRESQL_SERVER_VERSION_NUM "110000") -set(PostgreSQL_ADDITIONAL_VERSIONS "17" "16" "15" "14" "13" "12" "11") +set(PostgreSQL_ADDITIONAL_VERSIONS "19" "18" "17" "16" "15" "14" "13" "12" "11") ############################################################# # Version @@ -196,7 +200,7 @@ endif() find_program(LUA_EXE NAMES lua lua5.4 lua5.3 lua5.2 lua5.1) -find_package(Boost 1.50 REQUIRED) +find_package(Boost CONFIG 1.50 REQUIRED) include_directories(SYSTEM ${Boost_INCLUDE_DIR}) find_package(PostgreSQL REQUIRED) @@ -308,10 +312,6 @@ if (BUILD_TESTS) set(TESTING_TIMEOUT 1200) endif() add_subdirectory(tests) - configure_file( - ${PROJECT_SOURCE_DIR}/tests/run-behave.in - ${PROJECT_BINARY_DIR}/run-behave - ) else() message(STATUS "Tests disabled. Set BUILD_TESTS=ON to enable tests.") endif() @@ -330,6 +330,7 @@ include(GNUInstallDirs) if (ENABLE_INSTALL) install(TARGETS osm2pgsql DESTINATION bin) + install(TARGETS osm2pgsql-expire DESTINATION bin) install(FILES default.style empty.style DESTINATION share/osm2pgsql) install(PROGRAMS scripts/osm2pgsql-replication DESTINATION bin) if (BUILD_GEN) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f1e51e01..f830a4ceb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,48 +143,48 @@ BDD tests you need to have behave and psycopg installed. On Ubuntu run: sudo apt-get install python3-psycopg python3-behave ``` +The BDD tests are run through the osm2pgsql-test-style tester. See the +[section on testing](https://osm2pgsql.org/doc/manual.html#style-testing) +in the manual for details. + There are ctest directives to run the tests. If you want to run the tests manually, for example to run single tests during development, you can -switch to the bdd test directory and run behave directly from there: +use the `run-bdd-tests` script in the build directory. It is a thin +wrapper around osm2pgsql-test-style which properly sets up the paths +for the osm2pgsql binary and test data paths: ```sh -cd osm2pgsql/tests/bdd -behave -DBINARY=/osm2pgsql +cd build +./run-bdd-tests ../tests/bdd/regression/ ``` -Per default, behave assumes that the build directory is under `osm2pgsql/build`. -If your setup works like that, you can leave out the `-D` parameter. - -To make this a bit easier a shell script `run-behave` is provided in your -build directory which sets those correct paths and calls `behave`. If run -with `-p` as first option it will wrap the call to `behave` in a call to -`pg_virtualenv` for your convenience. All other command line parameters of -`run-behave` will be passed through to behave. - To run a single test, simply add the name of the test file, followed by a column and the line number of the test: ```sh -behave flex/area.feature:71 +./run-bdd-tests ../tests/bdd/flex/area.feature:71 ``` -If you need to inspect the database that a test produces, you can add -`-DKEEP_TEST_DB` and behave won't remove the database after the test is -finished. This makes of course only sense, when running a single test. +You can pass any additional parameters to the script that osm2pgsql-test-style +would take. If you need to inspect the database that a test produces, you add +`--keep-test-db` and behave won't remove the database after the test is +finished. This makes only sense, when running a single test. When running under pg_virtualenv, don't forget to keep the virtual environment as well. You can use the handy `-s` switch: ```sh -pg_virtualenv -s behave -DKEEP_TEST_DB flex/area.feature:71 +pg_virtualenv -s ./run-bdd-tests ../tests/bdd/flex/area.feature:71 ``` It drops you into a shell when the behave test fails, where you can use psql to look at the database. Or start a shell in the virtual environment with `pg_virtualenv bash` and run behave from there. -The BDDs automatically detect if osm2pgsql was compiled with Lua and +The BDDs automatically detect if osm2pgsql was compiled with proj support and skip tests accordingly. They also check for the test -tablespace `tablespacetest` for tests that need tablespaces. +tablespace `tablespacetest` for tests that need tablespaces. To force +running the proj and tablespace tests use `--test-proj yes` and +`--test-tablespace yes` respectively. BDD tests hide print statements by default. For development purposes they can be shown by adding these lines to `tests/bdd/.behaverc`: diff --git a/README.md b/README.md index 8d0e74fc8..c1c7dd84a 100644 --- a/README.md +++ b/README.md @@ -223,8 +223,9 @@ GNU General Public License for more details. ## Maintainers -The current maintainers of osm2pgsql are [Sarah Hoffmann](https://github.com/lonvia/) -and [Paul Norman](https://github.com/pnorman/). +The current maintainers of osm2pgsql are [Sarah Hoffmann](https://github.com/lonvia/), +[Paul Norman](https://github.com/pnorman/) and +[Jochen Topf](https://github.com/joto). ## Contributing diff --git a/cmake/FindOsmium.cmake b/cmake/FindOsmium.cmake index 651c09a72..17be19666 100644 --- a/cmake/FindOsmium.cmake +++ b/cmake/FindOsmium.cmake @@ -32,8 +32,6 @@ # io - include libraries needed for any type of input/output # geos - include if you want to use any of the GEOS functions # gdal - include if you want to use any of the OGR functions -# proj - include if you want to use any of the Proj.4 functions -# sparsehash - include if you use the sparsehash index (deprecated!) # lz4 - include support for LZ4 compression of PBF files # # You can check for success with something like this: @@ -205,57 +203,6 @@ if(Osmium_USE_GDAL) endif() endif() -#---------------------------------------------------------------------- -# Component 'proj' -if(Osmium_USE_PROJ) - find_path(PROJ_INCLUDE_DIR proj_api.h) - find_library(PROJ_LIBRARY NAMES proj) - - list(APPEND OSMIUM_EXTRA_FIND_VARS PROJ_INCLUDE_DIR PROJ_LIBRARY) - if(PROJ_INCLUDE_DIR AND PROJ_LIBRARY) - set(PROJ_FOUND 1) - list(APPEND OSMIUM_LIBRARIES ${PROJ_LIBRARY}) - list(APPEND OSMIUM_INCLUDE_DIRS ${PROJ_INCLUDE_DIR}) - else() - message(WARNING "Osmium: PROJ.4 library is required but not found, please install it or configure the paths.") - endif() -endif() - -#---------------------------------------------------------------------- -# Component 'sparsehash' -if(Osmium_USE_SPARSEHASH) - message(WARNING "Osmium: Use of Google SparseHash is deprecated. Please switch to a different index type.") - find_path(SPARSEHASH_INCLUDE_DIR google/sparsetable) - - list(APPEND OSMIUM_EXTRA_FIND_VARS SPARSEHASH_INCLUDE_DIR) - if(SPARSEHASH_INCLUDE_DIR) - # Find size of sparsetable::size_type. This does not work on older - # CMake versions because they can do this check only in C, not in C++. - if(NOT CMAKE_VERSION VERSION_LESS 3.0) - include(CheckTypeSize) - set(CMAKE_REQUIRED_INCLUDES ${SPARSEHASH_INCLUDE_DIR}) - set(CMAKE_EXTRA_INCLUDE_FILES "google/sparsetable") - check_type_size("google::sparsetable::size_type" SPARSETABLE_SIZE_TYPE LANGUAGE CXX) - set(CMAKE_EXTRA_INCLUDE_FILES) - set(CMAKE_REQUIRED_INCLUDES) - else() - set(SPARSETABLE_SIZE_TYPE ${CMAKE_SIZEOF_VOID_P}) - endif() - - # Sparsetable::size_type must be at least 8 bytes (64bit), otherwise - # OSM object IDs will not fit. - if(SPARSETABLE_SIZE_TYPE GREATER 7) - set(SPARSEHASH_FOUND 1) - add_definitions(-DOSMIUM_WITH_SPARSEHASH=${SPARSEHASH_FOUND}) - list(APPEND OSMIUM_INCLUDE_DIRS ${SPARSEHASH_INCLUDE_DIR}) - else() - message(WARNING "Osmium: Disabled Google SparseHash library on 32bit system (size_type=${SPARSETABLE_SIZE_TYPE}).") - endif() - else() - message(WARNING "Osmium: Google SparseHash library is required but not found, please install it or configure the paths.") - endif() -endif() - #---------------------------------------------------------------------- list(REMOVE_DUPLICATES OSMIUM_INCLUDE_DIRS) diff --git a/contrib/libosmium/README.contrib b/contrib/libosmium/README.contrib index 955da97f3..7026807c1 100644 --- a/contrib/libosmium/README.contrib +++ b/contrib/libosmium/README.contrib @@ -1,2 +1,2 @@ Source: https://github.com/osmcode/libosmium -Revision: v2.22.0 +Revision: v2.23.0 diff --git a/contrib/libosmium/include/osmium/area/assembler.hpp b/contrib/libosmium/include/osmium/area/assembler.hpp index 3116f47b0..0ecd13612 100644 --- a/contrib/libosmium/include/osmium/area/assembler.hpp +++ b/contrib/libosmium/include/osmium/area/assembler.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/assembler_config.hpp b/contrib/libosmium/include/osmium/area/assembler_config.hpp index e81afcfa3..ff5156c9b 100644 --- a/contrib/libosmium/include/osmium/area/assembler_config.hpp +++ b/contrib/libosmium/include/osmium/area/assembler_config.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/assembler_legacy.hpp b/contrib/libosmium/include/osmium/area/assembler_legacy.hpp index f30ab329d..537087565 100644 --- a/contrib/libosmium/include/osmium/area/assembler_legacy.hpp +++ b/contrib/libosmium/include/osmium/area/assembler_legacy.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -72,7 +72,7 @@ namespace osmium { */ class AssemblerLegacy : public detail::BasicAssemblerWithTags { - void add_common_tags(osmium::builder::TagListBuilder& tl_builder, std::set& ways) const { + void add_common_tags(osmium::builder::TagListBuilder& tl_builder, const std::set& ways) const { std::map counter; for (const osmium::Way* way : ways) { for (const auto& tag : way->tags()) { diff --git a/contrib/libosmium/include/osmium/area/detail/basic_assembler.hpp b/contrib/libosmium/include/osmium/area/detail/basic_assembler.hpp index 5a378d076..fa2152a2e 100644 --- a/contrib/libosmium/include/osmium/area/detail/basic_assembler.hpp +++ b/contrib/libosmium/include/osmium/area/detail/basic_assembler.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -290,7 +290,7 @@ namespace osmium { } } - ProtoRing* find_enclosing_ring(NodeRefSegment* segment) { + ProtoRing* find_enclosing_ring(NodeRefSegment const* segment) { if (debug()) { std::cerr << " Looking for ring enclosing " << *segment << "\n"; } @@ -553,7 +553,7 @@ namespace osmium { return; } - std::stable_sort(rings.begin(), rings.end(), [](ProtoRing* a, ProtoRing* b) { + std::stable_sort(rings.begin(), rings.end(), [](ProtoRing const* a, ProtoRing const* b) { return a->min_segment() < b->min_segment(); }); @@ -824,7 +824,7 @@ namespace osmium { }); find_inner_outer_complex(); - ProtoRing* outer_ring = find_enclosing_ring(ring_min->ring().min_segment()); + const ProtoRing* outer_ring = find_enclosing_ring(ring_min->ring().min_segment()); const bool ring_min_is_outer = !outer_ring; if (debug()) { std::cerr << " Open ring is " << (ring_min_is_outer ? "outer" : "inner") << " ring\n"; @@ -858,7 +858,7 @@ namespace osmium { if (!open_ring_its.empty()) { ++m_stats.open_rings; if (m_config.problem_reporter) { - for (auto& it : open_ring_its) { + for (const auto& it : open_ring_its) { m_config.problem_reporter->report_ring_not_closed(it->get_node_ref_start(), nullptr); m_config.problem_reporter->report_ring_not_closed(it->get_node_ref_stop(), nullptr); } @@ -912,7 +912,7 @@ namespace osmium { [this, &location](const slocation& lhs, const slocation& rhs) { return lhs.location(m_segment_list, location) < rhs.location(m_segment_list, location); })); - for (auto& loc : locs) { + for (const auto& loc : locs) { if (!m_segment_list[loc.item].is_done()) { count_remaining -= add_new_ring_complex(loc); if (count_remaining == 0) { diff --git a/contrib/libosmium/include/osmium/area/detail/basic_assembler_with_tags.hpp b/contrib/libosmium/include/osmium/area/detail/basic_assembler_with_tags.hpp index 9e4a4072e..8c5b56f43 100644 --- a/contrib/libosmium/include/osmium/area/detail/basic_assembler_with_tags.hpp +++ b/contrib/libosmium/include/osmium/area/detail/basic_assembler_with_tags.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/detail/node_ref_segment.hpp b/contrib/libosmium/include/osmium/area/detail/node_ref_segment.hpp index 5ecaf02a4..41f35b4fe 100644 --- a/contrib/libosmium/include/osmium/area/detail/node_ref_segment.hpp +++ b/contrib/libosmium/include/osmium/area/detail/node_ref_segment.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/detail/proto_ring.hpp b/contrib/libosmium/include/osmium/area/detail/proto_ring.hpp index ec62dca59..fb8316f9b 100644 --- a/contrib/libosmium/include/osmium/area/detail/proto_ring.hpp +++ b/contrib/libosmium/include/osmium/area/detail/proto_ring.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -195,7 +195,7 @@ namespace osmium { } } - void join_forward(ProtoRing& other) { + void join_forward(const ProtoRing& other) { m_segments.reserve(m_segments.size() + other.m_segments.size()); for (NodeRefSegment* segment : other.m_segments) { add_segment_back(segment); diff --git a/contrib/libosmium/include/osmium/area/detail/segment_list.hpp b/contrib/libosmium/include/osmium/area/detail/segment_list.hpp index ed07fe198..4be4cb1e1 100644 --- a/contrib/libosmium/include/osmium/area/detail/segment_list.hpp +++ b/contrib/libosmium/include/osmium/area/detail/segment_list.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/detail/vector.hpp b/contrib/libosmium/include/osmium/area/detail/vector.hpp index 3c1ba31b0..ac5474602 100644 --- a/contrib/libosmium/include/osmium/area/detail/vector.hpp +++ b/contrib/libosmium/include/osmium/area/detail/vector.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/geom_assembler.hpp b/contrib/libosmium/include/osmium/area/geom_assembler.hpp index 8ce75a7a6..558eb9767 100644 --- a/contrib/libosmium/include/osmium/area/geom_assembler.hpp +++ b/contrib/libosmium/include/osmium/area/geom_assembler.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/multipolygon_collector.hpp b/contrib/libosmium/include/osmium/area/multipolygon_collector.hpp index c983ae18a..c3054c625 100644 --- a/contrib/libosmium/include/osmium/area/multipolygon_collector.hpp +++ b/contrib/libosmium/include/osmium/area/multipolygon_collector.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/multipolygon_manager.hpp b/contrib/libosmium/include/osmium/area/multipolygon_manager.hpp index 26b4c06ec..f9b221e3b 100644 --- a/contrib/libosmium/include/osmium/area/multipolygon_manager.hpp +++ b/contrib/libosmium/include/osmium/area/multipolygon_manager.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/multipolygon_manager_legacy.hpp b/contrib/libosmium/include/osmium/area/multipolygon_manager_legacy.hpp index adf9eda0c..9077805ab 100644 --- a/contrib/libosmium/include/osmium/area/multipolygon_manager_legacy.hpp +++ b/contrib/libosmium/include/osmium/area/multipolygon_manager_legacy.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/problem_reporter.hpp b/contrib/libosmium/include/osmium/area/problem_reporter.hpp index 95e4e8206..2748f9690 100644 --- a/contrib/libosmium/include/osmium/area/problem_reporter.hpp +++ b/contrib/libosmium/include/osmium/area/problem_reporter.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/problem_reporter_exception.hpp b/contrib/libosmium/include/osmium/area/problem_reporter_exception.hpp index 216b4b0c4..f9b8699df 100644 --- a/contrib/libosmium/include/osmium/area/problem_reporter_exception.hpp +++ b/contrib/libosmium/include/osmium/area/problem_reporter_exception.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/problem_reporter_ogr.hpp b/contrib/libosmium/include/osmium/area/problem_reporter_ogr.hpp index a99e2f1f3..b887e5b16 100644 --- a/contrib/libosmium/include/osmium/area/problem_reporter_ogr.hpp +++ b/contrib/libosmium/include/osmium/area/problem_reporter_ogr.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/problem_reporter_stream.hpp b/contrib/libosmium/include/osmium/area/problem_reporter_stream.hpp index d2307a6a3..dd491f958 100644 --- a/contrib/libosmium/include/osmium/area/problem_reporter_stream.hpp +++ b/contrib/libosmium/include/osmium/area/problem_reporter_stream.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/area/stats.hpp b/contrib/libosmium/include/osmium/area/stats.hpp index 2699d7445..4434f48d8 100644 --- a/contrib/libosmium/include/osmium/area/stats.hpp +++ b/contrib/libosmium/include/osmium/area/stats.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/builder/attr.hpp b/contrib/libosmium/include/osmium/builder/attr.hpp index fdc54bb34..8e99c7f20 100644 --- a/contrib/libosmium/include/osmium/builder/attr.hpp +++ b/contrib/libosmium/include/osmium/builder/attr.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/builder/builder.hpp b/contrib/libosmium/include/osmium/builder/builder.hpp index 2206bcd50..57ead29cb 100644 --- a/contrib/libosmium/include/osmium/builder/builder.hpp +++ b/contrib/libosmium/include/osmium/builder/builder.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/builder/osm_object_builder.hpp b/contrib/libosmium/include/osmium/builder/osm_object_builder.hpp index 7e49535d9..aa5b04315 100644 --- a/contrib/libosmium/include/osmium/builder/osm_object_builder.hpp +++ b/contrib/libosmium/include/osmium/builder/osm_object_builder.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -324,7 +324,7 @@ namespace osmium { class ChangesetDiscussionBuilder : public Builder { - osmium::ChangesetComment* m_comment = nullptr; + std::size_t m_comment_offset = std::numeric_limits::max(); void add_user(osmium::ChangesetComment& comment, const char* user, const std::size_t length) { if (length > osmium::max_osm_string_length) { @@ -343,6 +343,19 @@ namespace osmium { add_padding(true); } + bool has_open_comment() const noexcept { + return m_comment_offset != std::numeric_limits::max(); + } + + // Get current comment pointer (recalculated each time to handle buffer reallocation) + osmium::ChangesetComment* get_comment_ptr() { + if (has_open_comment()) { + return &buffer().get( + buffer().committed() + m_comment_offset); + } + return nullptr; + } + public: explicit ChangesetDiscussionBuilder(osmium::memory::Buffer& buffer, Builder* parent = nullptr) : @@ -362,32 +375,46 @@ namespace osmium { ChangesetDiscussionBuilder& operator=(ChangesetDiscussionBuilder&&) = delete; ~ChangesetDiscussionBuilder() { - assert(!m_comment && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); + assert(!has_open_comment() && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); add_padding(); } void add_comment(osmium::Timestamp date, osmium::user_id_type uid, const char* user) { - assert(!m_comment && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); - m_comment = reserve_space_for(); - new (m_comment) osmium::ChangesetComment{date, uid}; + assert(!has_open_comment() && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); + + // Store offset instead of pointer to handle buffer reallocation + m_comment_offset = buffer().written() - buffer().committed(); + + auto* comment = reserve_space_for(); + new (comment) osmium::ChangesetComment{date, uid}; add_size(sizeof(ChangesetComment)); - add_user(*m_comment, user, std::strlen(user)); + + add_user(*comment, user, std::strlen(user)); } void add_comment_text(const char* text) { - assert(m_comment && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); - osmium::ChangesetComment& comment = *m_comment; - m_comment = nullptr; - add_text(comment, text, std::strlen(text)); + assert(has_open_comment() && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); + + // Get fresh pointer each time to handle buffer reallocation + auto* comment = get_comment_ptr(); + + // Invalidate offset to ensure right adding order + m_comment_offset = std::numeric_limits::max(); + + add_text(*comment, text, std::strlen(text)); } void add_comment_text(const std::string& text) { - assert(m_comment && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); - osmium::ChangesetComment& comment = *m_comment; - m_comment = nullptr; - add_text(comment, text.c_str(), text.size()); - } + assert(has_open_comment() && "You have to always call both add_comment() and then add_comment_text() in that order for each comment!"); + // Get fresh pointer each time to handle buffer reallocation + auto* comment = get_comment_ptr(); + + // Invalidate offset to ensure right adding order + m_comment_offset = std::numeric_limits::max(); + + add_text(*comment, text.c_str(), text.size()); + } }; // class ChangesetDiscussionBuilder #define OSMIUM_FORWARD(setter) \ diff --git a/contrib/libosmium/include/osmium/diff_handler.hpp b/contrib/libosmium/include/osmium/diff_handler.hpp index 935d6a1a1..2bf4435e4 100644 --- a/contrib/libosmium/include/osmium/diff_handler.hpp +++ b/contrib/libosmium/include/osmium/diff_handler.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/diff_iterator.hpp b/contrib/libosmium/include/osmium/diff_iterator.hpp index c6c725168..577b3e333 100644 --- a/contrib/libosmium/include/osmium/diff_iterator.hpp +++ b/contrib/libosmium/include/osmium/diff_iterator.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/diff_visitor.hpp b/contrib/libosmium/include/osmium/diff_visitor.hpp index 32f0ff328..4a3ec8171 100644 --- a/contrib/libosmium/include/osmium/diff_visitor.hpp +++ b/contrib/libosmium/include/osmium/diff_visitor.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/dynamic_handler.hpp b/contrib/libosmium/include/osmium/dynamic_handler.hpp index 3917309dd..a730f2f6c 100644 --- a/contrib/libosmium/include/osmium/dynamic_handler.hpp +++ b/contrib/libosmium/include/osmium/dynamic_handler.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/experimental/flex_reader.hpp b/contrib/libosmium/include/osmium/experimental/flex_reader.hpp index ad4525f1f..92d830ff1 100644 --- a/contrib/libosmium/include/osmium/experimental/flex_reader.hpp +++ b/contrib/libosmium/include/osmium/experimental/flex_reader.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/fwd.hpp b/contrib/libosmium/include/osmium/fwd.hpp index b80c5d742..608f83b51 100644 --- a/contrib/libosmium/include/osmium/fwd.hpp +++ b/contrib/libosmium/include/osmium/fwd.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/coordinates.hpp b/contrib/libosmium/include/osmium/geom/coordinates.hpp index c734d0dd7..72d3a20ff 100644 --- a/contrib/libosmium/include/osmium/geom/coordinates.hpp +++ b/contrib/libosmium/include/osmium/geom/coordinates.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/factory.hpp b/contrib/libosmium/include/osmium/geom/factory.hpp index 148a3e2e3..0b2438a81 100644 --- a/contrib/libosmium/include/osmium/geom/factory.hpp +++ b/contrib/libosmium/include/osmium/geom/factory.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/geojson.hpp b/contrib/libosmium/include/osmium/geom/geojson.hpp index 41650501b..9ad997370 100644 --- a/contrib/libosmium/include/osmium/geom/geojson.hpp +++ b/contrib/libosmium/include/osmium/geom/geojson.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/geos.hpp b/contrib/libosmium/include/osmium/geom/geos.hpp index d859e6be3..87afe8bf3 100644 --- a/contrib/libosmium/include/osmium/geom/geos.hpp +++ b/contrib/libosmium/include/osmium/geom/geos.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/haversine.hpp b/contrib/libosmium/include/osmium/geom/haversine.hpp index a57170f82..f1bc7a6be 100644 --- a/contrib/libosmium/include/osmium/geom/haversine.hpp +++ b/contrib/libosmium/include/osmium/geom/haversine.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/mercator_projection.hpp b/contrib/libosmium/include/osmium/geom/mercator_projection.hpp index 514152e1c..572d080cf 100644 --- a/contrib/libosmium/include/osmium/geom/mercator_projection.hpp +++ b/contrib/libosmium/include/osmium/geom/mercator_projection.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/ogr.hpp b/contrib/libosmium/include/osmium/geom/ogr.hpp index 603a104cf..f26c01c96 100644 --- a/contrib/libosmium/include/osmium/geom/ogr.hpp +++ b/contrib/libosmium/include/osmium/geom/ogr.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/rapid_geojson.hpp b/contrib/libosmium/include/osmium/geom/rapid_geojson.hpp index 5e415f5b4..f93b9996c 100644 --- a/contrib/libosmium/include/osmium/geom/rapid_geojson.hpp +++ b/contrib/libosmium/include/osmium/geom/rapid_geojson.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/relations.hpp b/contrib/libosmium/include/osmium/geom/relations.hpp index 4a33574ce..d1beb721c 100644 --- a/contrib/libosmium/include/osmium/geom/relations.hpp +++ b/contrib/libosmium/include/osmium/geom/relations.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/tile.hpp b/contrib/libosmium/include/osmium/geom/tile.hpp index 242fd5c27..3dde94ef1 100644 --- a/contrib/libosmium/include/osmium/geom/tile.hpp +++ b/contrib/libosmium/include/osmium/geom/tile.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/util.hpp b/contrib/libosmium/include/osmium/geom/util.hpp index 2341b38d7..4b69da939 100644 --- a/contrib/libosmium/include/osmium/geom/util.hpp +++ b/contrib/libosmium/include/osmium/geom/util.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/wkb.hpp b/contrib/libosmium/include/osmium/geom/wkb.hpp index 30f0b5428..9f7a5973d 100644 --- a/contrib/libosmium/include/osmium/geom/wkb.hpp +++ b/contrib/libosmium/include/osmium/geom/wkb.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/geom/wkt.hpp b/contrib/libosmium/include/osmium/geom/wkt.hpp index 5be2507cc..a5ff4fabe 100644 --- a/contrib/libosmium/include/osmium/geom/wkt.hpp +++ b/contrib/libosmium/include/osmium/geom/wkt.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/handler.hpp b/contrib/libosmium/include/osmium/handler.hpp index cd510c30a..cb3d495d9 100644 --- a/contrib/libosmium/include/osmium/handler.hpp +++ b/contrib/libosmium/include/osmium/handler.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/handler/chain.hpp b/contrib/libosmium/include/osmium/handler/chain.hpp index 869076809..d05df2556 100644 --- a/contrib/libosmium/include/osmium/handler/chain.hpp +++ b/contrib/libosmium/include/osmium/handler/chain.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/handler/check_order.hpp b/contrib/libosmium/include/osmium/handler/check_order.hpp index 643034226..c05652d6a 100644 --- a/contrib/libosmium/include/osmium/handler/check_order.hpp +++ b/contrib/libosmium/include/osmium/handler/check_order.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/handler/disk_store.hpp b/contrib/libosmium/include/osmium/handler/disk_store.hpp index 2d5ec190e..165f09283 100644 --- a/contrib/libosmium/include/osmium/handler/disk_store.hpp +++ b/contrib/libosmium/include/osmium/handler/disk_store.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/handler/dump.hpp b/contrib/libosmium/include/osmium/handler/dump.hpp index c08d79752..a15fb52d4 100644 --- a/contrib/libosmium/include/osmium/handler/dump.hpp +++ b/contrib/libosmium/include/osmium/handler/dump.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/handler/node_locations_for_ways.hpp b/contrib/libosmium/include/osmium/handler/node_locations_for_ways.hpp index 05b36e814..720d1ae81 100644 --- a/contrib/libosmium/include/osmium/handler/node_locations_for_ways.hpp +++ b/contrib/libosmium/include/osmium/handler/node_locations_for_ways.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/handler/object_relations.hpp b/contrib/libosmium/include/osmium/handler/object_relations.hpp index 0dee79edf..d9c318a80 100644 --- a/contrib/libosmium/include/osmium/handler/object_relations.hpp +++ b/contrib/libosmium/include/osmium/handler/object_relations.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/detail/create_map_with_fd.hpp b/contrib/libosmium/include/osmium/index/detail/create_map_with_fd.hpp index 8870f09b2..876fa1f49 100644 --- a/contrib/libosmium/include/osmium/index/detail/create_map_with_fd.hpp +++ b/contrib/libosmium/include/osmium/index/detail/create_map_with_fd.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/detail/mmap_vector_anon.hpp b/contrib/libosmium/include/osmium/index/detail/mmap_vector_anon.hpp index 1b36522c7..4bcf86ef0 100644 --- a/contrib/libosmium/include/osmium/index/detail/mmap_vector_anon.hpp +++ b/contrib/libosmium/include/osmium/index/detail/mmap_vector_anon.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/detail/mmap_vector_base.hpp b/contrib/libosmium/include/osmium/index/detail/mmap_vector_base.hpp index a81cde7fb..9e7ba10f7 100644 --- a/contrib/libosmium/include/osmium/index/detail/mmap_vector_base.hpp +++ b/contrib/libosmium/include/osmium/index/detail/mmap_vector_base.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/detail/mmap_vector_file.hpp b/contrib/libosmium/include/osmium/index/detail/mmap_vector_file.hpp index f7e18e59c..30aa28707 100644 --- a/contrib/libosmium/include/osmium/index/detail/mmap_vector_file.hpp +++ b/contrib/libosmium/include/osmium/index/detail/mmap_vector_file.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/detail/tmpfile.hpp b/contrib/libosmium/include/osmium/index/detail/tmpfile.hpp index 88db24d7d..dc0205f98 100644 --- a/contrib/libosmium/include/osmium/index/detail/tmpfile.hpp +++ b/contrib/libosmium/include/osmium/index/detail/tmpfile.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/detail/vector_map.hpp b/contrib/libosmium/include/osmium/index/detail/vector_map.hpp index 550694b98..db4fb999a 100644 --- a/contrib/libosmium/include/osmium/index/detail/vector_map.hpp +++ b/contrib/libosmium/include/osmium/index/detail/vector_map.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/detail/vector_multimap.hpp b/contrib/libosmium/include/osmium/index/detail/vector_multimap.hpp index a1a5a7320..adbd19882 100644 --- a/contrib/libosmium/include/osmium/index/detail/vector_multimap.hpp +++ b/contrib/libosmium/include/osmium/index/detail/vector_multimap.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/id_set.hpp b/contrib/libosmium/include/osmium/index/id_set.hpp index c5732ea3a..07946662d 100644 --- a/contrib/libosmium/include/osmium/index/id_set.hpp +++ b/contrib/libosmium/include/osmium/index/id_set.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/index.hpp b/contrib/libosmium/include/osmium/index/index.hpp index 9ebb4cce6..8da068e11 100644 --- a/contrib/libosmium/include/osmium/index/index.hpp +++ b/contrib/libosmium/include/osmium/index/index.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map.hpp b/contrib/libosmium/include/osmium/index/map.hpp index ff2a54d56..ea26c99cb 100644 --- a/contrib/libosmium/include/osmium/index/map.hpp +++ b/contrib/libosmium/include/osmium/index/map.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/all.hpp b/contrib/libosmium/include/osmium/index/map/all.hpp index 9f001c30c..28e497d43 100644 --- a/contrib/libosmium/include/osmium/index/map/all.hpp +++ b/contrib/libosmium/include/osmium/index/map/all.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/dense_file_array.hpp b/contrib/libosmium/include/osmium/index/map/dense_file_array.hpp index 674464589..8de47e7f0 100644 --- a/contrib/libosmium/include/osmium/index/map/dense_file_array.hpp +++ b/contrib/libosmium/include/osmium/index/map/dense_file_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/dense_mem_array.hpp b/contrib/libosmium/include/osmium/index/map/dense_mem_array.hpp index 0a90488a3..ea1999e5a 100644 --- a/contrib/libosmium/include/osmium/index/map/dense_mem_array.hpp +++ b/contrib/libosmium/include/osmium/index/map/dense_mem_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/dense_mmap_array.hpp b/contrib/libosmium/include/osmium/index/map/dense_mmap_array.hpp index 0ee920491..2660c8d46 100644 --- a/contrib/libosmium/include/osmium/index/map/dense_mmap_array.hpp +++ b/contrib/libosmium/include/osmium/index/map/dense_mmap_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/dummy.hpp b/contrib/libosmium/include/osmium/index/map/dummy.hpp index e29322371..b6ebbfbcb 100644 --- a/contrib/libosmium/include/osmium/index/map/dummy.hpp +++ b/contrib/libosmium/include/osmium/index/map/dummy.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/flex_mem.hpp b/contrib/libosmium/include/osmium/index/map/flex_mem.hpp index b282217b2..770be661c 100644 --- a/contrib/libosmium/include/osmium/index/map/flex_mem.hpp +++ b/contrib/libosmium/include/osmium/index/map/flex_mem.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/sparse_file_array.hpp b/contrib/libosmium/include/osmium/index/map/sparse_file_array.hpp index 8832682f1..41ac38fd4 100644 --- a/contrib/libosmium/include/osmium/index/map/sparse_file_array.hpp +++ b/contrib/libosmium/include/osmium/index/map/sparse_file_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/sparse_mem_array.hpp b/contrib/libosmium/include/osmium/index/map/sparse_mem_array.hpp index ce0ef9cb7..39bdd34f1 100644 --- a/contrib/libosmium/include/osmium/index/map/sparse_mem_array.hpp +++ b/contrib/libosmium/include/osmium/index/map/sparse_mem_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/sparse_mem_map.hpp b/contrib/libosmium/include/osmium/index/map/sparse_mem_map.hpp index b7b798abb..c03cc6935 100644 --- a/contrib/libosmium/include/osmium/index/map/sparse_mem_map.hpp +++ b/contrib/libosmium/include/osmium/index/map/sparse_mem_map.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/map/sparse_mmap_array.hpp b/contrib/libosmium/include/osmium/index/map/sparse_mmap_array.hpp index b616f1921..202ffbba4 100644 --- a/contrib/libosmium/include/osmium/index/map/sparse_mmap_array.hpp +++ b/contrib/libosmium/include/osmium/index/map/sparse_mmap_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/multimap.hpp b/contrib/libosmium/include/osmium/index/multimap.hpp index 6c72fdcc5..a70d4631c 100644 --- a/contrib/libosmium/include/osmium/index/multimap.hpp +++ b/contrib/libosmium/include/osmium/index/multimap.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/multimap/all.hpp b/contrib/libosmium/include/osmium/index/multimap/all.hpp index 439762a74..de7359bc8 100644 --- a/contrib/libosmium/include/osmium/index/multimap/all.hpp +++ b/contrib/libosmium/include/osmium/index/multimap/all.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/multimap/hybrid.hpp b/contrib/libosmium/include/osmium/index/multimap/hybrid.hpp index 45e38d954..9311f0c0e 100644 --- a/contrib/libosmium/include/osmium/index/multimap/hybrid.hpp +++ b/contrib/libosmium/include/osmium/index/multimap/hybrid.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/multimap/sparse_file_array.hpp b/contrib/libosmium/include/osmium/index/multimap/sparse_file_array.hpp index 38cf5e4cb..ad2268f63 100644 --- a/contrib/libosmium/include/osmium/index/multimap/sparse_file_array.hpp +++ b/contrib/libosmium/include/osmium/index/multimap/sparse_file_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/multimap/sparse_mem_array.hpp b/contrib/libosmium/include/osmium/index/multimap/sparse_mem_array.hpp index c9a24eb79..34030b3ed 100644 --- a/contrib/libosmium/include/osmium/index/multimap/sparse_mem_array.hpp +++ b/contrib/libosmium/include/osmium/index/multimap/sparse_mem_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/multimap/sparse_mem_multimap.hpp b/contrib/libosmium/include/osmium/index/multimap/sparse_mem_multimap.hpp index 5899d647a..92c1b1dc8 100644 --- a/contrib/libosmium/include/osmium/index/multimap/sparse_mem_multimap.hpp +++ b/contrib/libosmium/include/osmium/index/multimap/sparse_mem_multimap.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/multimap/sparse_mmap_array.hpp b/contrib/libosmium/include/osmium/index/multimap/sparse_mmap_array.hpp index 7d82c3eac..b599a3c57 100644 --- a/contrib/libosmium/include/osmium/index/multimap/sparse_mmap_array.hpp +++ b/contrib/libosmium/include/osmium/index/multimap/sparse_mmap_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/node_locations_map.hpp b/contrib/libosmium/include/osmium/index/node_locations_map.hpp index 3a1035c49..8c80169be 100644 --- a/contrib/libosmium/include/osmium/index/node_locations_map.hpp +++ b/contrib/libosmium/include/osmium/index/node_locations_map.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/nwr_array.hpp b/contrib/libosmium/include/osmium/index/nwr_array.hpp index 001851a11..dc469d55c 100644 --- a/contrib/libosmium/include/osmium/index/nwr_array.hpp +++ b/contrib/libosmium/include/osmium/index/nwr_array.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/index/relations_map.hpp b/contrib/libosmium/include/osmium/index/relations_map.hpp index 57a214968..0f993bc5a 100644 --- a/contrib/libosmium/include/osmium/index/relations_map.hpp +++ b/contrib/libosmium/include/osmium/index/relations_map.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/any_compression.hpp b/contrib/libosmium/include/osmium/io/any_compression.hpp index ebdb0f87c..e02eee771 100644 --- a/contrib/libosmium/include/osmium/io/any_compression.hpp +++ b/contrib/libosmium/include/osmium/io/any_compression.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/any_input.hpp b/contrib/libosmium/include/osmium/io/any_input.hpp index bb625ed8c..3a8f0522e 100644 --- a/contrib/libosmium/include/osmium/io/any_input.hpp +++ b/contrib/libosmium/include/osmium/io/any_input.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/any_output.hpp b/contrib/libosmium/include/osmium/io/any_output.hpp index a78fff652..509dd947e 100644 --- a/contrib/libosmium/include/osmium/io/any_output.hpp +++ b/contrib/libosmium/include/osmium/io/any_output.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/bzip2_compression.hpp b/contrib/libosmium/include/osmium/io/bzip2_compression.hpp index 99c50cc2a..e1f9e3235 100644 --- a/contrib/libosmium/include/osmium/io/bzip2_compression.hpp +++ b/contrib/libosmium/include/osmium/io/bzip2_compression.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -109,6 +109,9 @@ namespace osmium { file_wrapper() noexcept = default; file_wrapper(const int fd, const char* mode) { + if (fd < 0) { + throw std::system_error{errno, std::system_category(), "file descriptor must be >= 0"}; + } #ifdef _MSC_VER osmium::detail::disable_invalid_parameter_handler diph; #endif @@ -152,7 +155,7 @@ namespace osmium { // Do not close stdout if (fileno(wrapped_file) == 1) { - return; + return; // NOLINT(clang-analyzer-unix.Stream) } if (fclose(wrapped_file) != 0) { @@ -313,7 +316,18 @@ namespace osmium { throw bzip2_error{"bzip2 error: read open failed", bzerror}; } } else { - m_stream_end = true; + // Close current stream and try to open a new one for multi-stream files + ::BZ2_bzReadClose(&bzerror, m_bzfile); + if (bzerror != BZ_OK) { + throw bzip2_error{"bzip2 error: read close failed", bzerror}; + } + // Try to open a new stream - there might be more bzip2 streams concatenated + m_bzfile = ::BZ2_bzReadOpen(&bzerror, m_file.file(), 0, 0, nullptr, 0); + if (!m_bzfile || bzerror != BZ_OK) { + // If we can't open a new stream, we've truly reached the end + m_stream_end = true; + m_bzfile = nullptr; + } } } else { m_stream_end = true; diff --git a/contrib/libosmium/include/osmium/io/compression.hpp b/contrib/libosmium/include/osmium/io/compression.hpp index f21905d34..a49f5157d 100644 --- a/contrib/libosmium/include/osmium/io/compression.hpp +++ b/contrib/libosmium/include/osmium/io/compression.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -207,6 +207,10 @@ namespace osmium { return m_callbacks.insert(cc).second; } + void clear_register() { + m_callbacks.clear(); + } + template std::unique_ptr create_compressor(const osmium::io::file_compression compression, TArgs&&... args) const { const auto callbacks = find_callbacks(compression); diff --git a/contrib/libosmium/include/osmium/io/debug_output.hpp b/contrib/libosmium/include/osmium/io/debug_output.hpp index 87bf29d32..e1999014f 100644 --- a/contrib/libosmium/include/osmium/io/debug_output.hpp +++ b/contrib/libosmium/include/osmium/io/debug_output.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/debug_output_format.hpp b/contrib/libosmium/include/osmium/io/detail/debug_output_format.hpp index 9767690e9..4fe3c1cd7 100644 --- a/contrib/libosmium/include/osmium/io/detail/debug_output_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/debug_output_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -106,6 +106,14 @@ namespace osmium { }; // struct debug_output_options + // Space needed for printing numbers from 0 to num - 1 + inline int print_width(std::size_t num) noexcept { + if (num <= 10) { + return 1; + } + return static_cast(std::log10(num - 1)) + 1; + } + /** * Writes out one buffer with OSM data in Debug format. */ @@ -392,7 +400,7 @@ namespace osmium { *m_out += " (open)\n"; } - const int width = static_cast(std::log10(way.nodes().size())) + 1; + const int width = print_width(way.nodes().size()); int n = 0; for (const auto& node_ref : way.nodes()) { write_diff(); @@ -427,7 +435,7 @@ namespace osmium { output_int(relation.members().size()); *m_out += '\n'; - const int width = static_cast(std::log10(relation.members().size())) + 1; + const int width = print_width(relation.members().size()); int n = 0; for (const auto& member : relation.members()) { write_diff(); @@ -485,7 +493,7 @@ namespace osmium { output_int(changeset.num_comments()); *m_out += '\n'; - const int width = static_cast(std::log10(changeset.num_comments())) + 1; + const int width = print_width(changeset.num_comments()); int n = 0; for (const auto& comment : changeset.discussion()) { write_counter(width, n++); diff --git a/contrib/libosmium/include/osmium/io/detail/ids_output_format.hpp b/contrib/libosmium/include/osmium/io/detail/ids_output_format.hpp index 87448280b..6249705a4 100644 --- a/contrib/libosmium/include/osmium/io/detail/ids_output_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/ids_output_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/input_format.hpp b/contrib/libosmium/include/osmium/io/detail/input_format.hpp index f16a1b77e..403afb53f 100644 --- a/contrib/libosmium/include/osmium/io/detail/input_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/input_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/lz4.hpp b/contrib/libosmium/include/osmium/io/detail/lz4.hpp index 601ffc5af..c8061fdb6 100644 --- a/contrib/libosmium/include/osmium/io/detail/lz4.hpp +++ b/contrib/libosmium/include/osmium/io/detail/lz4.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/o5m_input_format.hpp b/contrib/libosmium/include/osmium/io/detail/o5m_input_format.hpp index 2f6995186..f76a367b1 100644 --- a/contrib/libosmium/include/osmium/io/detail/o5m_input_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/o5m_input_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/opl_input_format.hpp b/contrib/libosmium/include/osmium/io/detail/opl_input_format.hpp index 568110af2..63a5b4d1c 100644 --- a/contrib/libosmium/include/osmium/io/detail/opl_input_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/opl_input_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/opl_output_format.hpp b/contrib/libosmium/include/osmium/io/detail/opl_output_format.hpp index ab5a847b1..9c1723641 100644 --- a/contrib/libosmium/include/osmium/io/detail/opl_output_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/opl_output_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/opl_parser_functions.hpp b/contrib/libosmium/include/osmium/io/detail/opl_parser_functions.hpp index 8fb5c3966..3fa5ed430 100644 --- a/contrib/libosmium/include/osmium/io/detail/opl_parser_functions.hpp +++ b/contrib/libosmium/include/osmium/io/detail/opl_parser_functions.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/output_format.hpp b/contrib/libosmium/include/osmium/io/detail/output_format.hpp index 3a86d497c..7f648cfcf 100644 --- a/contrib/libosmium/include/osmium/io/detail/output_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/output_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/pbf.hpp b/contrib/libosmium/include/osmium/io/detail/pbf.hpp index 0dd5e7550..c6fbcdcc5 100644 --- a/contrib/libosmium/include/osmium/io/detail/pbf.hpp +++ b/contrib/libosmium/include/osmium/io/detail/pbf.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/pbf_decoder.hpp b/contrib/libosmium/include/osmium/io/detail/pbf_decoder.hpp index 6f77dda6b..b03cfb2f3 100644 --- a/contrib/libosmium/include/osmium/io/detail/pbf_decoder.hpp +++ b/contrib/libosmium/include/osmium/io/detail/pbf_decoder.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -81,31 +81,50 @@ namespace osmium { using protozero::data_view; - class varint_range { + template + class values_access { const char* m_data = nullptr; const char* m_end = nullptr; + T m_value = 0; + int m_num_values = 0; + + protected: std::uint64_t next() { return protozero::decode_varint(&m_data, m_end); } + bool has_single_value() const noexcept { + return m_num_values > 0; + } + + T get_and_clear_value() noexcept { + m_num_values = 0; + return m_value; + } + public: - varint_range() = default; + values_access() = default; - explicit varint_range(const data_view& data) : + explicit values_access(const data_view& data) : m_data(data.data()), m_end(data.data() + data.size()) { } + explicit values_access(T value) : + m_value(value), + m_num_values(1) { + } + bool empty() const noexcept { - return m_data == m_end; + return m_data == m_end && m_num_values == 0; } std::size_t size() const noexcept { if (!m_data) { - return 0; + return m_num_values; } // We know that each varint contains exactly one byte with the most @@ -116,23 +135,67 @@ namespace osmium { }); } - std::int32_t next_int32() { + }; // class values_access + + class values_access_int32 : public values_access { + + public: + + using values_access::values_access; + + int32_t next_int32() { + if (has_single_value()) { + return get_and_clear_value(); + } return static_cast(next()); } - std::uint32_t next_uint32() { + }; // class values_access_int32 + + class values_access_uint32 : public values_access { + + public: + + using values_access::values_access; + + uint32_t next_uint32() { + if (has_single_value()) { + return get_and_clear_value(); + } return static_cast(next()); } - std::int32_t next_sint32() { + }; // class values_access_uint32 + + class values_access_sint32 : public values_access { + + public: + + using values_access::values_access; + + int32_t next_sint32() { + if (has_single_value()) { + return get_and_clear_value(); + } return protozero::decode_zigzag32(static_cast(next())); } - std::int64_t next_sint64() { + }; // class values_access_sint32 + + class values_access_sint64 : public values_access { + + public: + + using values_access::values_access; + + int64_t next_sint64() { + if (has_single_value()) { + return get_and_clear_value(); + } return protozero::decode_zigzag64(next()); } - }; // class varint_range + }; // class values_access_sint64 using osm_string_len_type = std::pair; @@ -300,7 +363,7 @@ namespace osmium { return user; } - void build_tag_list(osmium::builder::Builder& parent, varint_range& keys, varint_range& vals) { + void build_tag_list(osmium::builder::Builder& parent, values_access_uint32& keys, values_access_uint32& vals) { if (keys.empty() || vals.empty()) { return; } @@ -325,8 +388,8 @@ namespace osmium { osmium::builder::NodeBuilder builder{m_buffer}; osmium::Node& node = builder.object(); - varint_range keys; - varint_range vals; + values_access_uint32 keys; + values_access_uint32 vals; int64_t lon = std::numeric_limits::max(); int64_t lat = std::numeric_limits::max(); @@ -339,10 +402,16 @@ namespace osmium { node.set_id(pbf_node.get_sint64()); break; case protozero::tag_and_type(OSMFormat::Node::packed_uint32_keys, protozero::pbf_wire_type::length_delimited): - keys = varint_range{pbf_node.get_view()}; + keys = values_access_uint32{pbf_node.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Node::packed_uint32_keys, protozero::pbf_wire_type::varint): + keys = values_access_uint32{pbf_node.get_uint32()}; break; case protozero::tag_and_type(OSMFormat::Node::packed_uint32_vals, protozero::pbf_wire_type::length_delimited): - vals = varint_range{pbf_node.get_view()}; + vals = values_access_uint32{pbf_node.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Node::packed_uint32_vals, protozero::pbf_wire_type::varint): + vals = values_access_uint32{pbf_node.get_uint32()}; break; case protozero::tag_and_type(OSMFormat::Node::optional_Info_info, protozero::pbf_wire_type::length_delimited): if (m_read_metadata == osmium::io::read_meta::yes) { @@ -381,11 +450,11 @@ namespace osmium { void decode_way(const data_view& data) { osmium::builder::WayBuilder builder{m_buffer}; - varint_range keys; - varint_range vals; - varint_range refs; - varint_range lats; - varint_range lons; + values_access_uint32 keys; + values_access_uint32 vals; + values_access_sint64 refs; + values_access_sint64 lats; + values_access_sint64 lons; osm_string_len_type user{"", 0}; @@ -396,10 +465,16 @@ namespace osmium { builder.object().set_id(pbf_way.get_int64()); break; case protozero::tag_and_type(OSMFormat::Way::packed_uint32_keys, protozero::pbf_wire_type::length_delimited): - keys = varint_range{pbf_way.get_view()}; + keys = values_access_uint32{pbf_way.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Way::packed_uint32_keys, protozero::pbf_wire_type::varint): + keys = values_access_uint32{pbf_way.get_uint32()}; break; case protozero::tag_and_type(OSMFormat::Way::packed_uint32_vals, protozero::pbf_wire_type::length_delimited): - vals = varint_range{pbf_way.get_view()}; + vals = values_access_uint32{pbf_way.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Way::packed_uint32_vals, protozero::pbf_wire_type::varint): + vals = values_access_uint32{pbf_way.get_uint32()}; break; case protozero::tag_and_type(OSMFormat::Way::optional_Info_info, protozero::pbf_wire_type::length_delimited): if (m_read_metadata == osmium::io::read_meta::yes) { @@ -409,13 +484,22 @@ namespace osmium { } break; case protozero::tag_and_type(OSMFormat::Way::packed_sint64_refs, protozero::pbf_wire_type::length_delimited): - refs = varint_range{pbf_way.get_view()}; + refs = values_access_sint64{pbf_way.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Way::packed_sint64_refs, protozero::pbf_wire_type::varint): + refs = values_access_sint64{pbf_way.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::Way::packed_sint64_lat, protozero::pbf_wire_type::length_delimited): - lats = varint_range{pbf_way.get_view()}; + lats = values_access_sint64{pbf_way.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Way::packed_sint64_lat, protozero::pbf_wire_type::varint): + lats = values_access_sint64{pbf_way.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::Way::packed_sint64_lon, protozero::pbf_wire_type::length_delimited): - lons = varint_range{pbf_way.get_view()}; + lons = values_access_sint64{pbf_way.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Way::packed_sint64_lon, protozero::pbf_wire_type::varint): + lons = values_access_sint64{pbf_way.get_sint64()}; break; default: pbf_way.skip(); @@ -450,11 +534,11 @@ namespace osmium { void decode_relation(const data_view& data) { osmium::builder::RelationBuilder builder{m_buffer}; - varint_range keys; - varint_range vals; - varint_range roles; - varint_range refs; - varint_range types; + values_access_uint32 keys; + values_access_uint32 vals; + values_access_int32 roles; + values_access_sint64 refs; + values_access_int32 types; osm_string_len_type user{"", 0}; @@ -465,10 +549,16 @@ namespace osmium { builder.object().set_id(pbf_relation.get_int64()); break; case protozero::tag_and_type(OSMFormat::Relation::packed_uint32_keys, protozero::pbf_wire_type::length_delimited): - keys = varint_range{pbf_relation.get_view()}; + keys = values_access_uint32{pbf_relation.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Relation::packed_uint32_keys, protozero::pbf_wire_type::varint): + keys = values_access_uint32{pbf_relation.get_uint32()}; break; case protozero::tag_and_type(OSMFormat::Relation::packed_uint32_vals, protozero::pbf_wire_type::length_delimited): - vals = varint_range{pbf_relation.get_view()}; + vals = values_access_uint32{pbf_relation.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Relation::packed_uint32_vals, protozero::pbf_wire_type::varint): + vals = values_access_uint32{pbf_relation.get_uint32()}; break; case protozero::tag_and_type(OSMFormat::Relation::optional_Info_info, protozero::pbf_wire_type::length_delimited): if (m_read_metadata == osmium::io::read_meta::yes) { @@ -478,13 +568,22 @@ namespace osmium { } break; case protozero::tag_and_type(OSMFormat::Relation::packed_int32_roles_sid, protozero::pbf_wire_type::length_delimited): - roles = varint_range{pbf_relation.get_view()}; + roles = values_access_int32{pbf_relation.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Relation::packed_int32_roles_sid, protozero::pbf_wire_type::varint): + roles = values_access_int32{pbf_relation.get_int32()}; break; case protozero::tag_and_type(OSMFormat::Relation::packed_sint64_memids, protozero::pbf_wire_type::length_delimited): - refs = varint_range{pbf_relation.get_view()}; + refs = values_access_sint64{pbf_relation.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Relation::packed_sint64_memids, protozero::pbf_wire_type::varint): + refs = values_access_sint64{pbf_relation.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::Relation::packed_MemberType_types, protozero::pbf_wire_type::length_delimited): - types = varint_range{pbf_relation.get_view()}; + types = values_access_int32{pbf_relation.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::Relation::packed_MemberType_types, protozero::pbf_wire_type::varint): + types = values_access_int32{pbf_relation.get_int32()}; break; default: pbf_relation.skip(); @@ -514,7 +613,7 @@ namespace osmium { build_tag_list(builder, keys, vals); } - void build_tag_list_from_dense_nodes(osmium::builder::NodeBuilder& builder, varint_range& tags) { + void build_tag_list_from_dense_nodes(osmium::builder::NodeBuilder& builder, values_access_int32& tags) { osmium::builder::TagListBuilder tl_builder{builder}; while (!tags.empty()) { const auto idx = tags.next_int32(); @@ -531,25 +630,37 @@ namespace osmium { } void decode_dense_nodes_without_metadata(const data_view& data) { - varint_range ids; - varint_range lats; - varint_range lons; - varint_range tags; + values_access_sint64 ids; + values_access_sint64 lats; + values_access_sint64 lons; + values_access_int32 tags; protozero::pbf_message pbf_dense_nodes{data}; while (pbf_dense_nodes.next()) { switch (pbf_dense_nodes.tag_and_type()) { case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_id, protozero::pbf_wire_type::length_delimited): - ids = varint_range{pbf_dense_nodes.get_view()}; + ids = values_access_sint64{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_id, protozero::pbf_wire_type::varint): + ids = values_access_sint64{pbf_dense_nodes.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lat, protozero::pbf_wire_type::length_delimited): - lats = varint_range{pbf_dense_nodes.get_view()}; + lats = values_access_sint64{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lat, protozero::pbf_wire_type::varint): + lats = values_access_sint64{pbf_dense_nodes.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lon, protozero::pbf_wire_type::length_delimited): - lons = varint_range{pbf_dense_nodes.get_view()}; + lons = values_access_sint64{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lon, protozero::pbf_wire_type::varint): + lons = values_access_sint64{pbf_dense_nodes.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseNodes::packed_int32_keys_vals, protozero::pbf_wire_type::length_delimited): - tags = varint_range{pbf_dense_nodes.get_view()}; + tags = values_access_int32{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_int32_keys_vals, protozero::pbf_wire_type::varint): + tags = values_access_int32{pbf_dense_nodes.get_int32()}; break; default: pbf_dense_nodes.skip(); @@ -592,22 +703,25 @@ namespace osmium { void decode_dense_nodes(const data_view& data) { bool has_info = false; - varint_range ids; - varint_range lats; - varint_range lons; - varint_range tags; - varint_range versions; - varint_range timestamps; - varint_range changesets; - varint_range uids; - varint_range user_sids; - varint_range visibles; + values_access_sint64 ids; + values_access_sint64 lats; + values_access_sint64 lons; + values_access_int32 tags; + values_access_int32 versions; + values_access_sint64 timestamps; + values_access_sint64 changesets; + values_access_sint32 uids; + values_access_sint32 user_sids; + values_access_int32 visibles; protozero::pbf_message pbf_dense_nodes{data}; while (pbf_dense_nodes.next()) { switch (pbf_dense_nodes.tag_and_type()) { case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_id, protozero::pbf_wire_type::length_delimited): - ids = varint_range{pbf_dense_nodes.get_view()}; + ids = values_access_sint64{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_id, protozero::pbf_wire_type::varint): + ids = values_access_sint64{pbf_dense_nodes.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseNodes::optional_DenseInfo_denseinfo, protozero::pbf_wire_type::length_delimited): { @@ -616,22 +730,40 @@ namespace osmium { while (pbf_dense_info.next()) { switch (pbf_dense_info.tag_and_type()) { case protozero::tag_and_type(OSMFormat::DenseInfo::packed_int32_version, protozero::pbf_wire_type::length_delimited): - versions = varint_range{pbf_dense_info.get_view()}; + versions = values_access_int32{pbf_dense_info.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseInfo::packed_int32_version, protozero::pbf_wire_type::varint): + versions = values_access_int32{pbf_dense_info.get_int32()}; break; case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint64_timestamp, protozero::pbf_wire_type::length_delimited): - timestamps = varint_range{pbf_dense_info.get_view()}; + timestamps = values_access_sint64{pbf_dense_info.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint64_timestamp, protozero::pbf_wire_type::varint): + timestamps = values_access_sint64{pbf_dense_info.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint64_changeset, protozero::pbf_wire_type::length_delimited): - changesets = varint_range{pbf_dense_info.get_view()}; + changesets = values_access_sint64{pbf_dense_info.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint64_changeset, protozero::pbf_wire_type::varint): + changesets = values_access_sint64{pbf_dense_info.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint32_uid, protozero::pbf_wire_type::length_delimited): - uids = varint_range{pbf_dense_info.get_view()}; + uids = values_access_sint32{pbf_dense_info.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint32_uid, protozero::pbf_wire_type::varint): + uids = values_access_sint32{pbf_dense_info.get_sint32()}; break; case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint32_user_sid, protozero::pbf_wire_type::length_delimited): - user_sids = varint_range{pbf_dense_info.get_view()}; + user_sids = values_access_sint32{pbf_dense_info.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseInfo::packed_sint32_user_sid, protozero::pbf_wire_type::varint): + user_sids = values_access_sint32{pbf_dense_info.get_sint32()}; break; case protozero::tag_and_type(OSMFormat::DenseInfo::packed_bool_visible, protozero::pbf_wire_type::length_delimited): - visibles = varint_range{pbf_dense_info.get_view()}; + visibles = values_access_int32{pbf_dense_info.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseInfo::packed_bool_visible, protozero::pbf_wire_type::varint): + visibles = values_access_int32{pbf_dense_info.get_int32()}; break; default: pbf_dense_info.skip(); @@ -640,13 +772,22 @@ namespace osmium { } break; case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lat, protozero::pbf_wire_type::length_delimited): - lats = varint_range{pbf_dense_nodes.get_view()}; + lats = values_access_sint64{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lat, protozero::pbf_wire_type::varint): + lats = values_access_sint64{pbf_dense_nodes.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lon, protozero::pbf_wire_type::length_delimited): - lons = varint_range{pbf_dense_nodes.get_view()}; + lons = values_access_sint64{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_sint64_lon, protozero::pbf_wire_type::varint): + lons = values_access_sint64{pbf_dense_nodes.get_sint64()}; break; case protozero::tag_and_type(OSMFormat::DenseNodes::packed_int32_keys_vals, protozero::pbf_wire_type::length_delimited): - tags = varint_range{pbf_dense_nodes.get_view()}; + tags = values_access_int32{pbf_dense_nodes.get_view()}; + break; + case protozero::tag_and_type(OSMFormat::DenseNodes::packed_int32_keys_vals, protozero::pbf_wire_type::varint): + tags = values_access_int32{pbf_dense_nodes.get_int32()}; break; default: pbf_dense_nodes.skip(); diff --git a/contrib/libosmium/include/osmium/io/detail/pbf_input_format.hpp b/contrib/libosmium/include/osmium/io/detail/pbf_input_format.hpp index fc4b70d18..abac957c7 100644 --- a/contrib/libosmium/include/osmium/io/detail/pbf_input_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/pbf_input_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -124,6 +124,11 @@ namespace osmium { if (!osmium::io::detail::read_exactly(m_fd, buffer.data(), static_cast(buffer.size()))) { return 0; // EOF } + + if (m_offset_ptr) { + *m_offset_ptr += buffer.size(); + } + return check_size(get_size_in_network_byte_order(buffer.data())); } @@ -210,6 +215,10 @@ namespace osmium { if (!osmium::io::detail::read_exactly(m_fd, &*buffer.begin(), static_cast(size))) { throw osmium::pbf_error{"unexpected EOF"}; } + + if (m_offset_ptr) { + *m_offset_ptr += buffer.size(); + } } else { ensure_available_in_input_queue(size); buffer.append(m_input_buffer, 0, size); diff --git a/contrib/libosmium/include/osmium/io/detail/pbf_output_format.hpp b/contrib/libosmium/include/osmium/io/detail/pbf_output_format.hpp index 4834475c0..05f11c3fc 100644 --- a/contrib/libosmium/include/osmium/io/detail/pbf_output_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/pbf_output_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/protobuf_tags.hpp b/contrib/libosmium/include/osmium/io/detail/protobuf_tags.hpp index 50e09fc18..f337aefb3 100644 --- a/contrib/libosmium/include/osmium/io/detail/protobuf_tags.hpp +++ b/contrib/libosmium/include/osmium/io/detail/protobuf_tags.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/queue_util.hpp b/contrib/libosmium/include/osmium/io/detail/queue_util.hpp index 5bffb1e00..fc4870661 100644 --- a/contrib/libosmium/include/osmium/io/detail/queue_util.hpp +++ b/contrib/libosmium/include/osmium/io/detail/queue_util.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/read_thread.hpp b/contrib/libosmium/include/osmium/io/detail/read_thread.hpp index cf92440df..66e24e4e1 100644 --- a/contrib/libosmium/include/osmium/io/detail/read_thread.hpp +++ b/contrib/libosmium/include/osmium/io/detail/read_thread.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/read_write.hpp b/contrib/libosmium/include/osmium/io/detail/read_write.hpp index dffc6e7ec..f4b1913c5 100644 --- a/contrib/libosmium/include/osmium/io/detail/read_write.hpp +++ b/contrib/libosmium/include/osmium/io/detail/read_write.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -104,6 +104,9 @@ namespace osmium { #endif if (filename.empty() || filename == "-") { +#ifdef _WIN32 + _setmode(0, _O_BINARY); +#endif return 0; // stdin } diff --git a/contrib/libosmium/include/osmium/io/detail/string_table.hpp b/contrib/libosmium/include/osmium/io/detail/string_table.hpp index 5045c8d6c..5854e17ed 100644 --- a/contrib/libosmium/include/osmium/io/detail/string_table.hpp +++ b/contrib/libosmium/include/osmium/io/detail/string_table.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/string_util.hpp b/contrib/libosmium/include/osmium/io/detail/string_util.hpp index 381e84aed..038a5194f 100644 --- a/contrib/libosmium/include/osmium/io/detail/string_util.hpp +++ b/contrib/libosmium/include/osmium/io/detail/string_util.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/write_thread.hpp b/contrib/libosmium/include/osmium/io/detail/write_thread.hpp index 8f00896d8..166e8cb2d 100644 --- a/contrib/libosmium/include/osmium/io/detail/write_thread.hpp +++ b/contrib/libosmium/include/osmium/io/detail/write_thread.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp b/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp index bf5e8c61f..fc966a7a8 100644 --- a/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/xml_output_format.hpp b/contrib/libosmium/include/osmium/io/detail/xml_output_format.hpp index 88a4a0b29..1ba57f2fe 100644 --- a/contrib/libosmium/include/osmium/io/detail/xml_output_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/xml_output_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/detail/zlib.hpp b/contrib/libosmium/include/osmium/io/detail/zlib.hpp index 502fe9d35..c0329b597 100644 --- a/contrib/libosmium/include/osmium/io/detail/zlib.hpp +++ b/contrib/libosmium/include/osmium/io/detail/zlib.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/error.hpp b/contrib/libosmium/include/osmium/io/error.hpp index eabdcde39..97b94573e 100644 --- a/contrib/libosmium/include/osmium/io/error.hpp +++ b/contrib/libosmium/include/osmium/io/error.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/file.hpp b/contrib/libosmium/include/osmium/io/file.hpp index 7c8e6345a..678038015 100644 --- a/contrib/libosmium/include/osmium/io/file.hpp +++ b/contrib/libosmium/include/osmium/io/file.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/file_compression.hpp b/contrib/libosmium/include/osmium/io/file_compression.hpp index 79f20e34d..6c6010a0d 100644 --- a/contrib/libosmium/include/osmium/io/file_compression.hpp +++ b/contrib/libosmium/include/osmium/io/file_compression.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/file_format.hpp b/contrib/libosmium/include/osmium/io/file_format.hpp index 35fbb46a9..a981866f8 100644 --- a/contrib/libosmium/include/osmium/io/file_format.hpp +++ b/contrib/libosmium/include/osmium/io/file_format.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/gzip_compression.hpp b/contrib/libosmium/include/osmium/io/gzip_compression.hpp index ed7fa2b6e..1060bcbbe 100644 --- a/contrib/libosmium/include/osmium/io/gzip_compression.hpp +++ b/contrib/libosmium/include/osmium/io/gzip_compression.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/header.hpp b/contrib/libosmium/include/osmium/io/header.hpp index 9c2903111..4e495c45d 100644 --- a/contrib/libosmium/include/osmium/io/header.hpp +++ b/contrib/libosmium/include/osmium/io/header.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/ids_output.hpp b/contrib/libosmium/include/osmium/io/ids_output.hpp index fe09c5f59..8caf5b1b0 100644 --- a/contrib/libosmium/include/osmium/io/ids_output.hpp +++ b/contrib/libosmium/include/osmium/io/ids_output.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/input_iterator.hpp b/contrib/libosmium/include/osmium/io/input_iterator.hpp index e8196268e..2bd40b6e0 100644 --- a/contrib/libosmium/include/osmium/io/input_iterator.hpp +++ b/contrib/libosmium/include/osmium/io/input_iterator.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/o5m_input.hpp b/contrib/libosmium/include/osmium/io/o5m_input.hpp index e2df6fcd0..5d70c77ff 100644 --- a/contrib/libosmium/include/osmium/io/o5m_input.hpp +++ b/contrib/libosmium/include/osmium/io/o5m_input.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/opl_input.hpp b/contrib/libosmium/include/osmium/io/opl_input.hpp index bde901863..8641ffd46 100644 --- a/contrib/libosmium/include/osmium/io/opl_input.hpp +++ b/contrib/libosmium/include/osmium/io/opl_input.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/opl_output.hpp b/contrib/libosmium/include/osmium/io/opl_output.hpp index 521dac34a..445bf5f19 100644 --- a/contrib/libosmium/include/osmium/io/opl_output.hpp +++ b/contrib/libosmium/include/osmium/io/opl_output.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/output_iterator.hpp b/contrib/libosmium/include/osmium/io/output_iterator.hpp index 7aeb75089..84a3ff085 100644 --- a/contrib/libosmium/include/osmium/io/output_iterator.hpp +++ b/contrib/libosmium/include/osmium/io/output_iterator.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/overwrite.hpp b/contrib/libosmium/include/osmium/io/overwrite.hpp index 37c011d3e..87132a9ca 100644 --- a/contrib/libosmium/include/osmium/io/overwrite.hpp +++ b/contrib/libosmium/include/osmium/io/overwrite.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/pbf.hpp b/contrib/libosmium/include/osmium/io/pbf.hpp index 2205b9de9..96b0c3045 100644 --- a/contrib/libosmium/include/osmium/io/pbf.hpp +++ b/contrib/libosmium/include/osmium/io/pbf.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/pbf_input.hpp b/contrib/libosmium/include/osmium/io/pbf_input.hpp index e2a1f2b80..cd5472d18 100644 --- a/contrib/libosmium/include/osmium/io/pbf_input.hpp +++ b/contrib/libosmium/include/osmium/io/pbf_input.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/pbf_output.hpp b/contrib/libosmium/include/osmium/io/pbf_output.hpp index 83f1048b0..34ab804d7 100644 --- a/contrib/libosmium/include/osmium/io/pbf_output.hpp +++ b/contrib/libosmium/include/osmium/io/pbf_output.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/reader.hpp b/contrib/libosmium/include/osmium/io/reader.hpp index 2e63bc6b1..835279760 100644 --- a/contrib/libosmium/include/osmium/io/reader.hpp +++ b/contrib/libosmium/include/osmium/io/reader.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/reader_iterator.hpp b/contrib/libosmium/include/osmium/io/reader_iterator.hpp index 632cbbbe7..c989f3ca3 100644 --- a/contrib/libosmium/include/osmium/io/reader_iterator.hpp +++ b/contrib/libosmium/include/osmium/io/reader_iterator.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/reader_with_progress_bar.hpp b/contrib/libosmium/include/osmium/io/reader_with_progress_bar.hpp index 88323488a..d332b667f 100644 --- a/contrib/libosmium/include/osmium/io/reader_with_progress_bar.hpp +++ b/contrib/libosmium/include/osmium/io/reader_with_progress_bar.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/writer.hpp b/contrib/libosmium/include/osmium/io/writer.hpp index 52346a379..3a2731923 100644 --- a/contrib/libosmium/include/osmium/io/writer.hpp +++ b/contrib/libosmium/include/osmium/io/writer.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/writer_options.hpp b/contrib/libosmium/include/osmium/io/writer_options.hpp index dddb2918e..8e90a3073 100644 --- a/contrib/libosmium/include/osmium/io/writer_options.hpp +++ b/contrib/libosmium/include/osmium/io/writer_options.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/xml_input.hpp b/contrib/libosmium/include/osmium/io/xml_input.hpp index 8681a4736..3a90cf528 100644 --- a/contrib/libosmium/include/osmium/io/xml_input.hpp +++ b/contrib/libosmium/include/osmium/io/xml_input.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/io/xml_output.hpp b/contrib/libosmium/include/osmium/io/xml_output.hpp index 3110c4317..4b69d9ac1 100644 --- a/contrib/libosmium/include/osmium/io/xml_output.hpp +++ b/contrib/libosmium/include/osmium/io/xml_output.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/memory/buffer.hpp b/contrib/libosmium/include/osmium/memory/buffer.hpp index a1fe3c168..6645d555a 100644 --- a/contrib/libosmium/include/osmium/memory/buffer.hpp +++ b/contrib/libosmium/include/osmium/memory/buffer.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -343,8 +343,8 @@ namespace osmium { } /** - * Returns the number of bytes currently filled in this buffer that - * are not yet committed. + * Returns the number of bytes currently filled in this buffer. + * This includes committed and not yet committed bytes. * Always returns 0 on invalid buffers. */ std::size_t written() const noexcept { diff --git a/contrib/libosmium/include/osmium/memory/callback_buffer.hpp b/contrib/libosmium/include/osmium/memory/callback_buffer.hpp index 4c55b8146..102f43eeb 100644 --- a/contrib/libosmium/include/osmium/memory/callback_buffer.hpp +++ b/contrib/libosmium/include/osmium/memory/callback_buffer.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/memory/collection.hpp b/contrib/libosmium/include/osmium/memory/collection.hpp index 01b127dc3..5dab5aaf7 100644 --- a/contrib/libosmium/include/osmium/memory/collection.hpp +++ b/contrib/libosmium/include/osmium/memory/collection.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -35,6 +35,7 @@ DEALINGS IN THE SOFTWARE. #include +#include #include #include #include diff --git a/contrib/libosmium/include/osmium/memory/item.hpp b/contrib/libosmium/include/osmium/memory/item.hpp index 19e9e5bcb..fbf1f8a84 100644 --- a/contrib/libosmium/include/osmium/memory/item.hpp +++ b/contrib/libosmium/include/osmium/memory/item.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/memory/item_iterator.hpp b/contrib/libosmium/include/osmium/memory/item_iterator.hpp index 132bb8ea2..14de17b44 100644 --- a/contrib/libosmium/include/osmium/memory/item_iterator.hpp +++ b/contrib/libosmium/include/osmium/memory/item_iterator.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/object_pointer_collection.hpp b/contrib/libosmium/include/osmium/object_pointer_collection.hpp index 4a03f5a42..50f634a43 100644 --- a/contrib/libosmium/include/osmium/object_pointer_collection.hpp +++ b/contrib/libosmium/include/osmium/object_pointer_collection.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/opl.hpp b/contrib/libosmium/include/osmium/opl.hpp index d4d280241..86025b348 100644 --- a/contrib/libosmium/include/osmium/opl.hpp +++ b/contrib/libosmium/include/osmium/opl.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm.hpp b/contrib/libosmium/include/osmium/osm.hpp index 23e2b7537..3bded0674 100644 --- a/contrib/libosmium/include/osmium/osm.hpp +++ b/contrib/libosmium/include/osmium/osm.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/area.hpp b/contrib/libosmium/include/osmium/osm/area.hpp index 1d3fa603a..5aa4f5f42 100644 --- a/contrib/libosmium/include/osmium/osm/area.hpp +++ b/contrib/libosmium/include/osmium/osm/area.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/box.hpp b/contrib/libosmium/include/osmium/osm/box.hpp index 5ad763932..3de1db5dc 100644 --- a/contrib/libosmium/include/osmium/osm/box.hpp +++ b/contrib/libosmium/include/osmium/osm/box.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/changeset.hpp b/contrib/libosmium/include/osmium/osm/changeset.hpp index bf9030d96..4a1d8598f 100644 --- a/contrib/libosmium/include/osmium/osm/changeset.hpp +++ b/contrib/libosmium/include/osmium/osm/changeset.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/crc.hpp b/contrib/libosmium/include/osmium/osm/crc.hpp index 508e361f6..55f909723 100644 --- a/contrib/libosmium/include/osmium/osm/crc.hpp +++ b/contrib/libosmium/include/osmium/osm/crc.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/crc_zlib.hpp b/contrib/libosmium/include/osmium/osm/crc_zlib.hpp index 3b300463a..8297ba00f 100644 --- a/contrib/libosmium/include/osmium/osm/crc_zlib.hpp +++ b/contrib/libosmium/include/osmium/osm/crc_zlib.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/diff_object.hpp b/contrib/libosmium/include/osmium/osm/diff_object.hpp index 393234250..5e9f5654e 100644 --- a/contrib/libosmium/include/osmium/osm/diff_object.hpp +++ b/contrib/libosmium/include/osmium/osm/diff_object.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/entity.hpp b/contrib/libosmium/include/osmium/osm/entity.hpp index 16534c78b..8515513b8 100644 --- a/contrib/libosmium/include/osmium/osm/entity.hpp +++ b/contrib/libosmium/include/osmium/osm/entity.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/entity_bits.hpp b/contrib/libosmium/include/osmium/osm/entity_bits.hpp index f082cd9f9..f1b0d5503 100644 --- a/contrib/libosmium/include/osmium/osm/entity_bits.hpp +++ b/contrib/libosmium/include/osmium/osm/entity_bits.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -45,6 +45,8 @@ namespace osmium { */ namespace osm_entity_bits { + // NOLINTBEGIN(clang-analyzer-optin.core.EnumCastOutOfRange) + /** * Describes zero or more OSM entities. * @@ -123,6 +125,8 @@ namespace osmium { return static_cast(1U << (ut - 1U)); } + // NOLINTEND(clang-analyzer-optin.core.EnumCastOutOfRange) + } // namespace osm_entity_bits } // namespace osmium diff --git a/contrib/libosmium/include/osmium/osm/item_type.hpp b/contrib/libosmium/include/osmium/osm/item_type.hpp index 3556bb4f0..0d462254a 100644 --- a/contrib/libosmium/include/osmium/osm/item_type.hpp +++ b/contrib/libosmium/include/osmium/osm/item_type.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/location.hpp b/contrib/libosmium/include/osmium/osm/location.hpp index 2fcf75f30..36072d184 100644 --- a/contrib/libosmium/include/osmium/osm/location.hpp +++ b/contrib/libosmium/include/osmium/osm/location.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -34,6 +34,7 @@ DEALINGS IN THE SOFTWARE. */ #include +#include #include #include #include @@ -267,6 +268,13 @@ namespace osmium { * * Coordinates are never checked on whether they are inside bounds. * Call valid() to check this. + * + * If the macro OSMIUM_LOCATION_WITH_EXTRA_BIT is defined, Location values + * can store one extra bit of information, because one bit is not needed + * for the y coordinate. Use the functions set/clear/toggle/get_extra_bit() + * to access it. The extra bit will always be cleared for new locations or + * by setting the y coordinate of a location. You can not store an extra + * bit on an invalid location. */ class Location { @@ -277,6 +285,31 @@ namespace osmium { return static_cast(detail::coordinate_precision); } +#ifdef OSMIUM_LOCATION_WITH_EXTRA_BIT + + /** + * For normal y coordinates, bit 30 is always equal to bit 31. So + * we can use that to store one extra piece of information. + */ + enum { + mask_b30 = 1UL << 30UL + }; + + static constexpr int32_t remove_extra_bit(int32_t v) noexcept { + if (v == undefined_coordinate) { + return v; + } + auto const value = static_cast(v); + auto const n30 = value & ~mask_b30; + auto const b30 = (value >> 1UL) & mask_b30; + return static_cast(n30 | b30); + } +#else + static constexpr int32_t remove_extra_bit(int32_t v) noexcept { + return v; + } +#endif + public: // this value is used for a coordinate to mark it as undefined @@ -310,7 +343,7 @@ namespace osmium { */ constexpr Location(const int32_t x, const int32_t y) noexcept : m_x(x), - m_y(y) { + m_y(remove_extra_bit(y)) { } /** @@ -320,7 +353,7 @@ namespace osmium { */ constexpr Location(const int64_t x, const int64_t y) noexcept : m_x(static_cast(x)), - m_y(static_cast(y)) { + m_y(remove_extra_bit(static_cast(y))) { } /** @@ -329,14 +362,14 @@ namespace osmium { */ Location(const double lon, const double lat) : m_x(double_to_fix(lon)), - m_y(double_to_fix(lat)) { + m_y(remove_extra_bit(double_to_fix(lat))) { } /** * Check whether the coordinates of this location * are defined. * - * @deprecated Use is_defined() or is_undefined() or is_valid() which + * @deprecated Use is_defined() or is_undefined() or valid() which * have all slightly different meanings. */ explicit constexpr operator bool() const noexcept { @@ -350,16 +383,16 @@ namespace osmium { * See also is_defined() and is_undefined(). */ constexpr bool valid() const noexcept { - return m_x >= -180 * precision() - && m_x <= 180 * precision() - && m_y >= -90 * precision() - && m_y <= 90 * precision(); + return x() >= -180 * precision() + && x() <= 180 * precision() + && y() >= -90 * precision() + && y() <= 90 * precision(); } /** * Returns true if at least one of the coordinates is defined. * - * See also is_undefined() and is_valid(). + * See also is_undefined() and valid(). */ constexpr bool is_defined() const noexcept { return m_x != undefined_coordinate || m_y != undefined_coordinate; @@ -368,7 +401,7 @@ namespace osmium { /** * Returns true if both coordinates are undefined. * - * See also is_defined() and is_valid(). + * See also is_defined() and valid(). */ constexpr bool is_undefined() const noexcept { return m_x == undefined_coordinate && m_y == undefined_coordinate; @@ -379,7 +412,7 @@ namespace osmium { } constexpr int32_t y() const noexcept { - return m_y; + return remove_extra_bit(m_y); } Location& set_x(const int32_t x) noexcept { @@ -387,8 +420,13 @@ namespace osmium { return *this; } + /** + * Set the y coordinate of the location. + * + * This will always clear the extra bit. + */ Location& set_y(const int32_t y) noexcept { - m_y = y; + m_y = remove_extra_bit(y); return *this; } @@ -401,14 +439,14 @@ namespace osmium { if (!valid()) { throw osmium::invalid_location{"invalid location"}; } - return fix_to_double(m_x); + return fix_to_double(x()); } /** * Get longitude without checking the validity. */ double lon_without_check() const noexcept { - return fix_to_double(m_x); + return fix_to_double(x()); } /** @@ -420,24 +458,22 @@ namespace osmium { if (!valid()) { throw osmium::invalid_location{"invalid location"}; } - return fix_to_double(m_y); + return fix_to_double(y()); } /** * Get latitude without checking the validity. */ double lat_without_check() const noexcept { - return fix_to_double(m_y); + return fix_to_double(y()); } Location& set_lon(double lon) noexcept { - m_x = double_to_fix(lon); - return *this; + return set_x(double_to_fix(lon)); } Location& set_lat(double lat) noexcept { - m_y = double_to_fix(lat); - return *this; + return set_y(double_to_fix(lat)); } Location& set_lon(const char* str) { @@ -446,8 +482,7 @@ namespace osmium { if (**data != '\0') { throw invalid_location{std::string{"characters after coordinate: '"} + *data + "'"}; } - m_x = value; - return *this; + return set_x(value); } Location& set_lat(const char* str) { @@ -456,18 +491,15 @@ namespace osmium { if (**data != '\0') { throw invalid_location{std::string{"characters after coordinate: '"} + *data + "'"}; } - m_y = value; - return *this; + return set_y(value); } Location& set_lon_partial(const char** str) { - m_x = detail::string_to_location_coordinate(str); - return *this; + return set_x(detail::string_to_location_coordinate(str)); } Location& set_lat_partial(const char** str) { - m_y = detail::string_to_location_coordinate(str); - return *this; + return set_y(detail::string_to_location_coordinate(str)); } template @@ -485,6 +517,73 @@ namespace osmium { return as_string_without_check(iterator, separator); } +#ifdef OSMIUM_LOCATION_WITH_EXTRA_BIT + /** + * Get extra bit from location. + */ + constexpr bool get_extra_bit() const noexcept { + assert(m_y != undefined_coordinate); + + auto const b = static_cast(m_y); + auto const b31 = b >> 31UL; + auto const b30 = (b >> 30UL) & 1UL; + return b30 ^ b31; + } + + /** + * Set extra bit on location. + * + * @pre valid() + */ + constexpr void set_extra_bit() noexcept { + assert(m_y != undefined_coordinate); + + auto const b = static_cast(m_y); + auto const n30 = b & ~mask_b30; + auto const b30 = (~b >> 1UL) & mask_b30; + m_y = static_cast(n30 | b30); + } + + /** + * Set or clear extra bit on location. + * + * @pre valid() + */ + constexpr void set_extra_bit(bool value) noexcept { + assert(m_y != undefined_coordinate); + + auto const b = static_cast(m_y); + auto const n30 = b & ~mask_b30; + auto const b30 = ((b >> 31UL) ^ value) << 30UL; + m_y = static_cast(n30 | b30); + } + + /** + * Clear extra bit on location. + * + * @pre valid() + */ + constexpr void clear_extra_bit() noexcept { + assert(m_y != undefined_coordinate); + + m_y = y(); + } + + /** + * Toggle extra bit on location. + * + * @pre valid() + */ + constexpr void toggle_extra_bit() noexcept { + assert(m_y != undefined_coordinate); + + auto const b = static_cast(m_y); + auto const n30 = b & ~mask_b30; + auto const b30 = ~b & mask_b30; + m_y = static_cast(n30 | b30); + } +#endif + }; // class Location /** diff --git a/contrib/libosmium/include/osmium/osm/metadata_options.hpp b/contrib/libosmium/include/osmium/osm/metadata_options.hpp index 85d05fea3..1552886f0 100644 --- a/contrib/libosmium/include/osmium/osm/metadata_options.hpp +++ b/contrib/libosmium/include/osmium/osm/metadata_options.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -42,6 +42,8 @@ DEALINGS IN THE SOFTWARE. namespace osmium { + // NOLINTBEGIN(clang-analyzer-optin.core.EnumCastOutOfRange) + /** * Describes which metadata fields are available in an OSMObject. This is * most often used to describe which metadata fields are available in the @@ -219,6 +221,8 @@ namespace osmium { }; // class metadata_options + // NOLINTEND(clang-analyzer-optin.core.EnumCastOutOfRange) + template inline std::basic_ostream& operator<<(std::basic_ostream& out, const metadata_options& options) { return out << options.to_string(); diff --git a/contrib/libosmium/include/osmium/osm/node.hpp b/contrib/libosmium/include/osmium/osm/node.hpp index fa3544f66..773a43d18 100644 --- a/contrib/libosmium/include/osmium/osm/node.hpp +++ b/contrib/libosmium/include/osmium/osm/node.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/node_ref.hpp b/contrib/libosmium/include/osmium/osm/node_ref.hpp index bb8138f0c..0b33c3ab1 100644 --- a/contrib/libosmium/include/osmium/osm/node_ref.hpp +++ b/contrib/libosmium/include/osmium/osm/node_ref.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/node_ref_list.hpp b/contrib/libosmium/include/osmium/osm/node_ref_list.hpp index ba8bbe3e0..a7e495f7d 100644 --- a/contrib/libosmium/include/osmium/osm/node_ref_list.hpp +++ b/contrib/libosmium/include/osmium/osm/node_ref_list.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/object.hpp b/contrib/libosmium/include/osmium/osm/object.hpp index 38c17f244..80d93740e 100644 --- a/contrib/libosmium/include/osmium/osm/object.hpp +++ b/contrib/libosmium/include/osmium/osm/object.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/object_comparisons.hpp b/contrib/libosmium/include/osmium/osm/object_comparisons.hpp index eff811fd0..96a5ca7ef 100644 --- a/contrib/libosmium/include/osmium/osm/object_comparisons.hpp +++ b/contrib/libosmium/include/osmium/osm/object_comparisons.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/relation.hpp b/contrib/libosmium/include/osmium/osm/relation.hpp index c457b5fae..f0eb060c5 100644 --- a/contrib/libosmium/include/osmium/osm/relation.hpp +++ b/contrib/libosmium/include/osmium/osm/relation.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/segment.hpp b/contrib/libosmium/include/osmium/osm/segment.hpp index 04598d180..c037c1aaf 100644 --- a/contrib/libosmium/include/osmium/osm/segment.hpp +++ b/contrib/libosmium/include/osmium/osm/segment.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/tag.hpp b/contrib/libosmium/include/osmium/osm/tag.hpp index e1538a9ae..40c00dbce 100644 --- a/contrib/libosmium/include/osmium/osm/tag.hpp +++ b/contrib/libosmium/include/osmium/osm/tag.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/timestamp.hpp b/contrib/libosmium/include/osmium/osm/timestamp.hpp index f91747448..38a908ff5 100644 --- a/contrib/libosmium/include/osmium/osm/timestamp.hpp +++ b/contrib/libosmium/include/osmium/osm/timestamp.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/types.hpp b/contrib/libosmium/include/osmium/osm/types.hpp index 154329d7a..3403f5c61 100644 --- a/contrib/libosmium/include/osmium/osm/types.hpp +++ b/contrib/libosmium/include/osmium/osm/types.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/types_from_string.hpp b/contrib/libosmium/include/osmium/osm/types_from_string.hpp index 8471a7f16..b2ee7b84d 100644 --- a/contrib/libosmium/include/osmium/osm/types_from_string.hpp +++ b/contrib/libosmium/include/osmium/osm/types_from_string.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/undirected_segment.hpp b/contrib/libosmium/include/osmium/osm/undirected_segment.hpp index ad68e2f0b..2123b3d90 100644 --- a/contrib/libosmium/include/osmium/osm/undirected_segment.hpp +++ b/contrib/libosmium/include/osmium/osm/undirected_segment.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/osm/way.hpp b/contrib/libosmium/include/osmium/osm/way.hpp index 71f535910..3fdfcf06f 100644 --- a/contrib/libosmium/include/osmium/osm/way.hpp +++ b/contrib/libosmium/include/osmium/osm/way.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/relations/collector.hpp b/contrib/libosmium/include/osmium/relations/collector.hpp index e61574936..4648a92f7 100644 --- a/contrib/libosmium/include/osmium/relations/collector.hpp +++ b/contrib/libosmium/include/osmium/relations/collector.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/relations/detail/member_meta.hpp b/contrib/libosmium/include/osmium/relations/detail/member_meta.hpp index 3df887b66..6b467b8de 100644 --- a/contrib/libosmium/include/osmium/relations/detail/member_meta.hpp +++ b/contrib/libosmium/include/osmium/relations/detail/member_meta.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/relations/detail/relation_meta.hpp b/contrib/libosmium/include/osmium/relations/detail/relation_meta.hpp index 87678a70f..6bc6fc277 100644 --- a/contrib/libosmium/include/osmium/relations/detail/relation_meta.hpp +++ b/contrib/libosmium/include/osmium/relations/detail/relation_meta.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/relations/manager_util.hpp b/contrib/libosmium/include/osmium/relations/manager_util.hpp index 929c97dd5..94bd45b9a 100644 --- a/contrib/libosmium/include/osmium/relations/manager_util.hpp +++ b/contrib/libosmium/include/osmium/relations/manager_util.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/relations/members_database.hpp b/contrib/libosmium/include/osmium/relations/members_database.hpp index 1702658de..b743edffa 100644 --- a/contrib/libosmium/include/osmium/relations/members_database.hpp +++ b/contrib/libosmium/include/osmium/relations/members_database.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/relations/relations_database.hpp b/contrib/libosmium/include/osmium/relations/relations_database.hpp index e31d237e0..2fd01b27d 100644 --- a/contrib/libosmium/include/osmium/relations/relations_database.hpp +++ b/contrib/libosmium/include/osmium/relations/relations_database.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/relations/relations_manager.hpp b/contrib/libosmium/include/osmium/relations/relations_manager.hpp index 1bee78cce..d62933ccd 100644 --- a/contrib/libosmium/include/osmium/relations/relations_manager.hpp +++ b/contrib/libosmium/include/osmium/relations/relations_manager.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/storage/item_stash.hpp b/contrib/libosmium/include/osmium/storage/item_stash.hpp index e42836df9..a9a0142fb 100644 --- a/contrib/libosmium/include/osmium/storage/item_stash.hpp +++ b/contrib/libosmium/include/osmium/storage/item_stash.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/tags/filter.hpp b/contrib/libosmium/include/osmium/tags/filter.hpp index 45c5e6d6b..d061c0716 100644 --- a/contrib/libosmium/include/osmium/tags/filter.hpp +++ b/contrib/libosmium/include/osmium/tags/filter.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/tags/matcher.hpp b/contrib/libosmium/include/osmium/tags/matcher.hpp index 50eb110c8..0746a5468 100644 --- a/contrib/libosmium/include/osmium/tags/matcher.hpp +++ b/contrib/libosmium/include/osmium/tags/matcher.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/tags/taglist.hpp b/contrib/libosmium/include/osmium/tags/taglist.hpp index d5ec309a3..b61afa040 100644 --- a/contrib/libosmium/include/osmium/tags/taglist.hpp +++ b/contrib/libosmium/include/osmium/tags/taglist.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/tags/tags_filter.hpp b/contrib/libosmium/include/osmium/tags/tags_filter.hpp index 61d20e20c..608c1e878 100644 --- a/contrib/libosmium/include/osmium/tags/tags_filter.hpp +++ b/contrib/libosmium/include/osmium/tags/tags_filter.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -154,6 +154,49 @@ namespace osmium { using TagsFilter = TagsFilterBase; + /** + * Compare two lists of tags ignoring tags matching the filter. + * Tag lists must be ordered in a consistent way. + * The filter must return "false" for all tags that should be ignored. + */ + inline bool compare_tags(osmium::TagList const &tags1, + osmium::TagList const &tags2, + TagsFilter const &filter) + { + auto const end1 = tags1.cend(); + auto const end2 = tags2.cend(); + + auto it1 = tags1.cbegin(); + auto it2 = tags2.cbegin(); + + while (it1 != end1 && it2 != end2) { + if (!filter(*it1)) { + ++it1; + continue; + } + if (!filter(*it2)) { + ++it2; + continue; + } + if (*it1 == *it2) { + ++it1; + ++it2; + continue; + } + return false; + } + + while (it1 != end1 && !filter(*it1)) { + ++it1; + } + + while (it2 != end2 && !filter(*it2)) { + ++it2; + } + + return it1 == end1 && it2 == end2; + } + } // namespace osmium diff --git a/contrib/libosmium/include/osmium/thread/function_wrapper.hpp b/contrib/libosmium/include/osmium/thread/function_wrapper.hpp index d0ec3509d..0c1110155 100644 --- a/contrib/libosmium/include/osmium/thread/function_wrapper.hpp +++ b/contrib/libosmium/include/osmium/thread/function_wrapper.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/thread/pool.hpp b/contrib/libosmium/include/osmium/thread/pool.hpp index 059f761d3..de5f2716a 100644 --- a/contrib/libosmium/include/osmium/thread/pool.hpp +++ b/contrib/libosmium/include/osmium/thread/pool.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/thread/queue.hpp b/contrib/libosmium/include/osmium/thread/queue.hpp index 950b60227..574bef0b9 100644 --- a/contrib/libosmium/include/osmium/thread/queue.hpp +++ b/contrib/libosmium/include/osmium/thread/queue.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/thread/util.hpp b/contrib/libosmium/include/osmium/thread/util.hpp index 0817d93e1..9244f1e2c 100644 --- a/contrib/libosmium/include/osmium/thread/util.hpp +++ b/contrib/libosmium/include/osmium/thread/util.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/compatibility.hpp b/contrib/libosmium/include/osmium/util/compatibility.hpp index 1b6ac56d1..be7ac6399 100644 --- a/contrib/libosmium/include/osmium/util/compatibility.hpp +++ b/contrib/libosmium/include/osmium/util/compatibility.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/config.hpp b/contrib/libosmium/include/osmium/util/config.hpp index eaa887848..6ac37bee8 100644 --- a/contrib/libosmium/include/osmium/util/config.hpp +++ b/contrib/libosmium/include/osmium/util/config.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/delta.hpp b/contrib/libosmium/include/osmium/util/delta.hpp index 6033e6474..8a2eb672c 100644 --- a/contrib/libosmium/include/osmium/util/delta.hpp +++ b/contrib/libosmium/include/osmium/util/delta.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/double.hpp b/contrib/libosmium/include/osmium/util/double.hpp index 4e8dfb90b..01746dd44 100644 --- a/contrib/libosmium/include/osmium/util/double.hpp +++ b/contrib/libosmium/include/osmium/util/double.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/endian.hpp b/contrib/libosmium/include/osmium/util/endian.hpp index 17be6a2ff..e48e9aa51 100644 --- a/contrib/libosmium/include/osmium/util/endian.hpp +++ b/contrib/libosmium/include/osmium/util/endian.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/file.hpp b/contrib/libosmium/include/osmium/util/file.hpp index 1d7737e0c..20bfd1dfd 100644 --- a/contrib/libosmium/include/osmium/util/file.hpp +++ b/contrib/libosmium/include/osmium/util/file.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/iterator.hpp b/contrib/libosmium/include/osmium/util/iterator.hpp index 8fcb497e3..5236e8963 100644 --- a/contrib/libosmium/include/osmium/util/iterator.hpp +++ b/contrib/libosmium/include/osmium/util/iterator.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/memory.hpp b/contrib/libosmium/include/osmium/util/memory.hpp index 7ccb388c5..72cd4cc0f 100644 --- a/contrib/libosmium/include/osmium/util/memory.hpp +++ b/contrib/libosmium/include/osmium/util/memory.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/memory_mapping.hpp b/contrib/libosmium/include/osmium/util/memory_mapping.hpp index 38ca38ed7..7a73137e9 100644 --- a/contrib/libosmium/include/osmium/util/memory_mapping.hpp +++ b/contrib/libosmium/include/osmium/util/memory_mapping.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/minmax.hpp b/contrib/libosmium/include/osmium/util/minmax.hpp index 1f0931d4d..552ecd250 100644 --- a/contrib/libosmium/include/osmium/util/minmax.hpp +++ b/contrib/libosmium/include/osmium/util/minmax.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/misc.hpp b/contrib/libosmium/include/osmium/util/misc.hpp index 824e57131..4cdef5e87 100644 --- a/contrib/libosmium/include/osmium/util/misc.hpp +++ b/contrib/libosmium/include/osmium/util/misc.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/options.hpp b/contrib/libosmium/include/osmium/util/options.hpp index a31d9084a..5ff71506b 100644 --- a/contrib/libosmium/include/osmium/util/options.hpp +++ b/contrib/libosmium/include/osmium/util/options.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/progress_bar.hpp b/contrib/libosmium/include/osmium/util/progress_bar.hpp index 2329bdaa8..394ee8d8d 100644 --- a/contrib/libosmium/include/osmium/util/progress_bar.hpp +++ b/contrib/libosmium/include/osmium/util/progress_bar.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/string.hpp b/contrib/libosmium/include/osmium/util/string.hpp index 2a1557e83..c2474d345 100644 --- a/contrib/libosmium/include/osmium/util/string.hpp +++ b/contrib/libosmium/include/osmium/util/string.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/string_matcher.hpp b/contrib/libosmium/include/osmium/util/string_matcher.hpp index 1d11e1926..0f2fb8def 100644 --- a/contrib/libosmium/include/osmium/util/string_matcher.hpp +++ b/contrib/libosmium/include/osmium/util/string_matcher.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/timer.hpp b/contrib/libosmium/include/osmium/util/timer.hpp index 312c34536..0db68e9ea 100644 --- a/contrib/libosmium/include/osmium/util/timer.hpp +++ b/contrib/libosmium/include/osmium/util/timer.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/util/verbose_output.hpp b/contrib/libosmium/include/osmium/util/verbose_output.hpp index cfc774307..246033f72 100644 --- a/contrib/libosmium/include/osmium/util/verbose_output.hpp +++ b/contrib/libosmium/include/osmium/util/verbose_output.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/contrib/libosmium/include/osmium/version.hpp b/contrib/libosmium/include/osmium/version.hpp index 585f999e2..549cca1b0 100644 --- a/contrib/libosmium/include/osmium/version.hpp +++ b/contrib/libosmium/include/osmium/version.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 @@ -37,11 +37,11 @@ DEALINGS IN THE SOFTWARE. #define LIBOSMIUM_VERSION_MAJOR 2 // NOLINTNEXTLINE(modernize-macro-to-enum) -#define LIBOSMIUM_VERSION_MINOR 22 +#define LIBOSMIUM_VERSION_MINOR 23 // NOLINTNEXTLINE(modernize-macro-to-enum) #define LIBOSMIUM_VERSION_PATCH 0 -#define LIBOSMIUM_VERSION_STRING "2.22.0" +#define LIBOSMIUM_VERSION_STRING "2.23.0" #endif // OSMIUM_VERSION_HPP diff --git a/contrib/libosmium/include/osmium/visitor.hpp b/contrib/libosmium/include/osmium/visitor.hpp index fdd5ce1c7..174a940bd 100644 --- a/contrib/libosmium/include/osmium/visitor.hpp +++ b/contrib/libosmium/include/osmium/visitor.hpp @@ -5,7 +5,7 @@ This file is part of Osmium (https://osmcode.org/libosmium). -Copyright 2013-2025 Jochen Topf and others (see README). +Copyright 2013-2026 Jochen Topf and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 diff --git a/flex-config/turning-circles.lua b/flex-config/turning-circles.lua new file mode 100644 index 000000000..dfca535ec --- /dev/null +++ b/flex-config/turning-circles.lua @@ -0,0 +1,69 @@ +-- This config example file is released into the Public Domain. + +-- Create a table with turning circles that can be styled in sync with the +-- highway they are on. + +local turning_circles = osm2pgsql.define_table({ + name = 'turning_circles', + ids = { type = 'node', id_column = 'node_id', cache = true }, + columns = { + { column = 'geom', type = 'point', not_null = true }, + } +}) + +local highways = osm2pgsql.define_table({ + name = 'highways', + ids = { type = 'way', id_column = 'way_id' }, + columns = { + { column = 'htype', type = 'text', not_null = true }, + { column = 'geom', type = 'linestring', not_null = true }, + } +}) + +-- This table will contain entries for all node/way combinations where the way +-- is tagged as "highway" and the node is tagged as "highway=turning_circle". +-- The "htype" column contains the highway type, the "geom" the geometry of +-- the node. This can be used, for instance, to draw the point in a style that +-- fits with the style of the highway. +-- +-- Note that you might have multiple entries for the same node in this table +-- if it is in several ways. In that case you might have to decide at rendering +-- time which of them to render. +local highway_ends = osm2pgsql.define_table({ + name = 'highway_ends', + ids = { type = 'way', id_column = 'way_id' }, + columns = { + { column = 'htype', type = 'text', not_null = true }, + { column = 'node_id', type = 'int8', not_null = true }, + { column = 'geom', type = 'point', not_null = true }, + } +}) + +function osm2pgsql.process_node(object) + if object.tags.highway == 'turning_circle' then + -- This insert will add the entry to the id cache later read with + -- in_id_cache(). + turning_circles:insert({ + geom = object:as_point(), + }) + end +end + +function osm2pgsql.process_way(object) + local t = object.tags.highway + if t then + highways:insert({ + htype = t, + geom = object:as_linestring(), + }) + local c = turning_circles:in_id_cache(object.nodes) + for _, n in ipairs(c) do + highway_ends:insert({ + htype = t, + node_id = object.nodes[n], + geom = object:as_point(n), + }) + end + end +end + diff --git a/man/manpage_from_python.py b/man/manpage_from_python.py index b41b4c2a7..182932713 100644 --- a/man/manpage_from_python.py +++ b/man/manpage_from_python.py @@ -2,7 +2,7 @@ # # This file is part of osm2pgsql (https://osm2pgsql.org/). # -# Copyright (C) 2006-2025 by the osm2pgsql developer community. +# Copyright (C) 2006-2026 by the osm2pgsql developer community. # For a full list of authors see the git log. """ Create a man page for osm2pgsql helper scripts in python. """ diff --git a/man/osm2pgsql-expire.1 b/man/osm2pgsql-expire.1 index c6dbd023c..5425c3fa2 100644 --- a/man/osm2pgsql-expire.1 +++ b/man/osm2pgsql-expire.1 @@ -1,79 +1,102 @@ .TH "OSM2PGSQL" "1" "2.2.0" "" "" .SH NAME -osm2pgsql\-expire \- Visualize expire output +.PP +osm2pgsql-expire - Visualize expire output .SH SYNOPSIS -\f[B]osm2pgsql\-expire\f[R] [\f[I]OPTIONS\f[R]] \f[I]OSM\-FILE\f[R] (1) -\f[B]osm2pgsql\-expire\f[R] \f[I]TILES\-FILE\f[R] (2) +.PP +\f[B]osm2pgsql-expire\f[R] [\f[I]OPTIONS\f[R]] \f[I]OSM-FILE\f[R] (1) +\f[B]osm2pgsql-expire\f[R] \f[I]TILES-FILE\f[R] (2) .SH DESCRIPTION +.PP \f[B]This command is currently experimental.\f[R] .PP The expire command can be used for two things: .IP "1." 3 \f[B]To check what tiles some OSM data is in.\f[R] If an -\f[I]OSM\-FILE\f[R] is specified osm2pgsql\-expire will calculate the +\f[I]OSM-FILE\f[R] is specified osm2pgsql-expire will calculate the tiles covering the objects in that file. Note that the file must not be a change file but a regular OSM data file! Output is, by default, a tile file, but GeoJSON is also possible. +Covering tiles are only calculated for tagged objects. .IP "2." 3 -\f[B]Visualize tile list.\f[R] If a \f[I]TILE\-FILE\f[R] (presumably +\f[B]Visualize tile list.\f[R] If a \f[I]TILE-FILE\f[R] (presumably generated by osm2pgsql) is specified, a GeoJSON file is generated showing all mentioned tiles. In this mode all command line options are ignored. .PP Read the \f[I]Expire\f[R] chapter of the osm2pgsql manual (https://osm2pgsql.org/doc/manual.html#expire) for details on how to -interpret the \f[CR]\-m, \[rs]\-\-mode\f[R] and -\f[CR]\[rs]\-\-full\-area\-limit\f[R] options. +interpret the \f[V]-m, \[rs]--mode\f[R] and +\f[V]\[rs]--full-area-limit\f[R] options. +.SH GEOMETRY GENERATION +.PP +To calculate the tiles covering the specified OSM data in mode (1), a +geometry has to be generated first for each object. +This works as follow: +.IP \[bu] 2 +For nodes a point geometry will be generated. +.IP \[bu] 2 +For closed ways a polygon geometry will be generated, for non-closed +ways a linestring geometry. +If a generated polygon is not valid, the program will fall back to a +linestring. +If neither a valid polygon nor a valid linestring can be generated the +object is ignored. +.IP \[bu] 2 +For relations a geometry is generated based on the \f[V]type\f[R] tag. +For types \f[V]multipolygon\f[R] and \f[V]boundary\f[R], a multipolygon +geometry is created, for types \f[V]route\f[R] and +\f[V]multilinestring\f[R] a multilinestring geometry is created, for all +other types a geometry collection is created. +.PP +Note that for (multi)polygons it depends on the command line options +--mode and --full-area-limit whether the tiles calculation is based on +the area or the boundary of the (multi)polygons. .SH OPTIONS +.PP This program follows the usual GNU command line syntax, with long -options starting with two dashes (\f[CR]\-\-\f[R]). +options starting with two dashes (\f[V]--\f[R]). Mandatory arguments to long options are mandatory for short options too. .SH MAIN OPTIONS .TP -\-b, \-\-buffer=VALUE +-b, --buffer=VALUE Set buffer size around geometry relative to tile size. Example: Set to 0.1 for a buffer that\[cq]s 10% of the tile size. .TP -\-f, \-\-format=FORMAT +-f, --format=FORMAT Output format. Options are `tiles' (default) or `geojson'. The GeoJSON output uses the Web Mercator projection (EPSG:3857) which is supported by many programs although, strictly speaking, it is not allowed by the GeoJSON spec. .TP -\-\-full\-area\-limit=VALUE +--full-area-limit=VALUE Set full area limit. .TP -\-m, \-\-mode=MODE +-m, --mode=MODE Set expire mode. -One of \f[CR]boundary_only\f[R], \f[CR]full_area\f[R] (default), and -\f[CR]hybrid\f[R]. +One of \f[V]boundary_only\f[R], \f[V]full_area\f[R] (default), and +\f[V]hybrid\f[R]. .TP -\-z, \-\-zoom=ZOOM +-z, --zoom=ZOOM Zoom level on which to calculate tiles. .SH HELP/VERSION OPTIONS .TP -\-h, \-\-help +-h, --help Print help. .TP -\-V, \-\-version +-V, --version Print osm2pgsql version. .SH LOGGING OPTIONS .TP -\-\-log\-level=LEVEL +--log-level=LEVEL Set log level (`debug', `info' (default), `warn', or `error'). .SH SEE ALSO .IP \[bu] 2 -\c -.UR https://osm2pgsql.org -osm2pgsql website -.UE \c +osm2pgsql website (https://osm2pgsql.org) .IP \[bu] 2 -\c -.UR https://osm2pgsql.org/doc/manual.html -osm2pgsql manual -.UE \c +osm2pgsql manual (https://osm2pgsql.org/doc/manual.html) .IP \[bu] 2 \f[B]osm2pgsql\f[R](1) .IP \[bu] 2 diff --git a/man/osm2pgsql-expire.md b/man/osm2pgsql-expire.md index 3024b81b0..9c031ee5b 100644 --- a/man/osm2pgsql-expire.md +++ b/man/osm2pgsql-expire.md @@ -16,7 +16,8 @@ The expire command can be used for two things: 1. **To check what tiles some OSM data is in.** If an *OSM-FILE* is specified osm2pgsql-expire will calculate the tiles covering the objects in that file. Note that the file must not be a change file but a regular OSM data file! - Output is, by default, a tile file, but GeoJSON is also possible. + Output is, by default, a tile file, but GeoJSON is also possible. Covering + tiles are only calculated for tagged objects. 2. **Visualize tile list.** If a *TILE-FILE* (presumably generated by osm2pgsql) is specified, a GeoJSON file is generated showing all mentioned tiles. In this mode all command line options are ignored. @@ -25,6 +26,25 @@ Read the *Expire* chapter of the osm2pgsql manual (https://osm2pgsql.org/doc/manual.html#expire) for details on how to interpret the `-m, \--mode` and `\--full-area-limit` options. +# GEOMETRY GENERATION + +To calculate the tiles covering the specified OSM data in mode (1), a geometry +has to be generated first for each object. This works as follow: + +* For nodes a point geometry will be generated. +* For closed ways a polygon geometry will be generated, for non-closed ways + a linestring geometry. If a generated polygon is not valid, the program + will fall back to a linestring. If neither a valid polygon nor a valid + linestring can be generated the object is ignored. +* For relations a geometry is generated based on the `type` tag. For types + `multipolygon` and `boundary`, a multipolygon geometry is created, for types + `route` and `multilinestring` a multilinestring geometry is created, for + all other types a geometry collection is created. + +Note that for (multi)polygons it depends on the command line options \--mode +and \--full-area-limit whether the tiles calculation is based on the area or +the boundary of the (multi)polygons. + # OPTIONS This program follows the usual GNU command line syntax, with long options diff --git a/scripts/osm2pgsql-replication b/scripts/osm2pgsql-replication index 5f9120c20..2b68efb90 100755 --- a/scripts/osm2pgsql-replication +++ b/scripts/osm2pgsql-replication @@ -4,7 +4,7 @@ # # This file is part of osm2pgsql (https://osm2pgsql.org/). # -# Copyright (C) 2006-2025 by the osm2pgsql developer community. +# Copyright (C) 2006-2026 by the osm2pgsql developer community. # For a full list of authors see the git log. """ diff --git a/scripts/osm2pgsql-test-style b/scripts/osm2pgsql-test-style new file mode 100755 index 000000000..e4e574ef8 --- /dev/null +++ b/scripts/osm2pgsql-test-style @@ -0,0 +1,872 @@ +#!/usr/bin/env python3 + +# SPDX-License-Identifier: GPL-2.0-or-later +# +# This file is part of osm2pgsql (https://osm2pgsql.org/). +# +# Copyright (C) 2025-2026 by the osm2pgsql developer community. +# For a full list of authors see the git log. +""" +Test runner for BDD-style integration tests. + +See osm2pgsql manual for more information on osm2pgsql style testing. +""" +import logging +import sys +import tempfile +import math +import re +import os +import contextlib +import json +import datetime as dt +from decimal import Decimal +from subprocess import Popen, PIPE +from argparse import ArgumentParser, RawDescriptionHelpFormatter +from pathlib import Path +import importlib.util +import io +from importlib.machinery import SourceFileLoader + +from behave import given, when, then, use_step_matcher, use_fixture, fixture +from behave.runner import ModelRunner, Context +from behave.formatter.base import StreamOpener +from behave.formatter.pretty import PrettyFormatter +from behave import runner_util +from behave.configuration import Configuration + +LOG = logging.getLogger() + +import psycopg +from psycopg import sql + +use_step_matcher('re') + +OBJECT_ORDER = {'n': 1, 'w': 2, 'r': 3} + +def opl_sort(line): + oid = line.split(' ', 1)[0] + return OBJECT_ORDER[oid[0]], int(oid[1:]) + +#################### Replication mock ############################## + +class ReplicationServerMock: + + def __init__(self, base_url, state_infos): + self.expected_base_url = base_url + self.state_infos = state_infos + + def __call__(self, base_url): + assert base_url == self.expected_base_url,\ + f"Wrong replication service called. Expected '{self.expected_base_url}', got '{base_url}'" + return self + + def get_state_info(self, seq=None, retries=2): + assert self.state_infos, 'Replication mock not properly set up' + if seq is None: + return self.state_infos[-1] + + for info in self.state_infos: + if info.sequence == seq: + return info + + return None + + def timestamp_to_sequence(self, timestamp, balanced_search=False): + assert self.state_infos, 'Replication mock not properly set up' + + if timestamp < self.state_infos[0].timestamp: + return self.state_infos[0].sequence + + prev = self.state_infos[0] + for info in self.state_infos: + if timestamp >= prev.timestamp and timestamp < info.timestamp: + return prev.sequence + prev = info + + return prev.sequence + + def apply_diffs(self, handler, start_id, max_size=1024, idx="", simplify=True): + if start_id > self.state_infos[-1].sequence: + return None + + numdiffs = int((max_size + 1023)/1024) + return min(self.state_infos[-1].sequence, start_id + numdiffs - 1) + +# Replication module is optional +_repfl_spec = importlib.util.spec_from_loader( + 'osm2pgsql_replication', + SourceFileLoader('osm2pgsql_replication', + str(Path(__file__, '..', 'osm2pgsql-replication').resolve()))) + +if _repfl_spec: + osm2pgsql_replication = importlib.util.module_from_spec(_repfl_spec) + _repfl_spec.loader.exec_module(osm2pgsql_replication) + + from osmium.replication.server import OsmosisState +else: + osm2pgsql_replication = None + +#################### hooks ######################################### + +def hook_before_all(context): + context.config.setup_logging(logging.INFO) + + # Feature check: table spaces + if context.user_args.test_tablespace == 'auto': + with context.connect_db('postgres') as conn: + with conn.cursor() as cur: + cur.execute("""SELECT spcname FROM pg_tablespace + WHERE spcname = 'tablespacetest'""") + context.user_args.test_tablespace = cur.rowcount > 0 + LOG.info('Check if tablespaces are available: %s', + 'yes' if context.user_args.test_tablespace else 'no') + else: + context.user_args.test_tablespace = context.user_args.test_tablespace == 'yes' + + # Test that osm2pgsql works. + proc = Popen([context.user_args.osm2pgsql_binary, '--version'], + stdout=PIPE, stderr=PIPE) + _, serr = proc.communicate() + osm2pgsql_version = serr.decode('utf-8') + if proc.returncode != 0: + LOG.critical("Could not run osm2pgsql. Error:\n%s", serr) + LOG.critical("osm2pgsql binary used: %s", context.user_args.osm2pgsql_binary) + raise RuntimeError('Error running osm2pgsql') + + LOG.info('Check if proj is available: %s', + 'yes' if context.user_args.test_proj else 'no') + + # Feature check: proj + if context.user_args.test_proj == 'auto': + context.user_args.test_proj = 'Proj [disabled]' not in osm2pgsql_version + else: + context.user_args.test_proj = context.user_args.test_proj == 'yes' + + use_fixture(template_test_db, context) + + + +def hook_before_scenario(context, scenario): + if 'config.have_proj' in scenario.tags and not context.user_args.test_proj: + scenario.skip("Generic proj library not configured.") + + context.db = use_fixture(test_db, context) + context.import_file = None + context.import_data = None + context.osm2pgsql_params = {'-d': context.user_args.test_db} + context.osm2pgsql_returncode = None + context.workdir = use_fixture(working_directory, context) + context.nodes = NodeStore() + context.sql_statements = {} + context.urlrequest_responses = {} + osm2pgsql_replication.ReplicationServer = None + + def _mock_urlopen(request): + if not request.full_url in context.urlrequest_responses: + raise urllib.error.URLError('Unknown URL') + + return contextlib.closing(io.BytesIO(context.urlrequest_responses[request.full_url].encode('utf-8'))) + + osm2pgsql_replication.urlrequest.urlopen = _mock_urlopen + + + +#################### fixtures ###################################### + +@fixture +def template_test_db(context, **kwargs): + context.drop_db(context.user_args.template_test_db, recreate_template='default') + + with context.connect_db(context.user_args.template_test_db) as conn: + conn.execute('CREATE EXTENSION postgis') + conn.execute('CREATE EXTENSION hstore') + + yield context.user_args.template_test_db + + context.drop_db(context.user_args.template_test_db) + + +@fixture +def test_db(context, **kwargs): + context.drop_db(recreate_template=context.user_args.template_test_db) + + with context.connect_db() as conn: + yield conn + + if not context.user_args.keep_test_db: + context.drop_db() + + +@fixture +def working_directory(context, **kwargs): + with tempfile.TemporaryDirectory() as tmpdir: + yield Path(tmpdir) + +################### Node location creation ######################### + +class NodeStore: + grid = {} + + def set_grid(self, lines, grid_step, origin_x, origin_y): + self.grid = {} + origin_y -= grid_step * (len(lines) - 1) + + ndigits = 1 + step = grid_step + while step < 0: + ndigits += 1 + step /= 10 + + for y, line in enumerate(lines): + for x, pt in enumerate(line): + if pt.isdigit(): + self.grid[int(pt)] = (round(origin_x + x * grid_step, ndigits), + round(origin_y + y * grid_step, ndigits)) + + def get_as_opl(self): + return [f"n{i} x{x} y{y}" for i, (x, y) in self.grid.items()] + + def add_coordinates(self, lines): + for line in lines: + if line.startswith('n') and ' x' not in line: + nid = int(line.split(' ', 1)[0][1:]) + assert nid in self.grid, \ + f"OPL error. Node {nid} has no coordinates and is not in grid." + x, y = self.grid[nid] + yield f"{line} x{x} y{y}" + else: + yield line + + def parse_point(self, pt): + pt = pt.strip() + if ' ' in pt: + return list(map(float, pt.split(' ', 1))) + return self.grid[int(pt)] + + +################### ResultComparison ############################### + +class ResultCompare: + + def __init__(self, heading, nodes): + self.nodes = nodes + if '!' in heading: + self.name, self.fmt = heading.rsplit('!', 1) + if self.fmt.startswith(':'): + self.compare = self._intcompare_fmt + elif self.fmt.startswith('~'): + if self.fmt.endswith('%'): + rel_tol = float(self.fmt[1:-1]) / 100 + self.compare = lambda exp, val: math.isclose(float(exp), val, rel_tol=rel_tol) + else: + abs_tol = float(self.fmt[1:]) + self.compare = lambda exp, val: math.isclose(float(exp), val, abs_tol=abs_tol) + else: + self.compare = getattr(self, f"_compare_{self.fmt}", None) + assert self.compare is not None, f"Unknown formatter {self.fmt}" + else: + self.name = heading + self.fmt = None + self.compare = lambda exp, val: str(val) == exp + + def as_select(self): + if self.fmt == 'geo': + return f"ST_AsText({self.name})" + + return self.name + + def equals(self, expected, value): + if expected == 'NULL': + return value is None + + return self.compare(expected, value) + + def _intcompare_fmt(self, expected, value): + return expected == f"{{{self.fmt}}}".format(value) + + def _compare_i(self, expected, value): + return expected.lower() == str(value).lower() + + def _compare_re(self, expected, value): + return re.fullmatch(expected, str(value)) is not None + + def _compare_substr(self, expected, value): + return expected in str(value) + + def _compare_json(self, expected, value): + return json.loads(expected) == value + + def _compare_geo(self, expected, value): + m = re.fullmatch(r'([A-Z]+)\((.*)\)', value) + + return self._eq_geom(expected, m[1], m[2]) if m else False + + def _eq_geom(self, bdd_geom, pg_type, pg_coords): + # MULTI* geometries + if bdd_geom.startswith('[') and bdd_geom.endswith(']'): + bdd_parts = bdd_geom[1:-1].split(';') + pg_parts = pg_coords[1:-1].split('),(') + return pg_type.startswith('MULTI') \ + and len(bdd_parts) == len(pg_parts) \ + and all(self._eq_geom(b.strip(), pg_type[5:], g.strip()) + for b, g in zip(bdd_parts, pg_parts)) + + # GEOMETRYCOLLECTIONS + if bdd_geom.startswith('{') and bdd_geom.endswith('}'): + bdd_parts = bdd_geom[1:-1].split(';') + pg_parts = list(map(lambda s: re.fullmatch(r'([A-Z]+)\(([^A-Z]*)\)', s), + re.findall('[A-Z]+[^A-Z]+[^,A-Z]', pg_coords))) + return pg_type.startswith('GEOMETRYCOLLECTION')\ + and len(bdd_parts) == len(pg_parts)\ + and all(g is not None and self._eq_geom(b.strip(), g[1], g[2]) + for b, g in zip(bdd_parts, pg_parts)) + + # POINT + if ',' not in bdd_geom: + return pg_type == 'POINT' and self._eq_point(bdd_geom, pg_coords) + + # LINESTRING + if '(' not in bdd_geom: + return pg_type == 'LINESTRING' \ + and all(self._eq_point(b, p) for b, p + in zip((g.strip() for g in bdd_geom.split(',')), + (g.strip() for g in pg_coords.split(',')))) + + # POLYGON + if pg_type != 'POLYGON': + return False + # Polygon comparison is tricky because the polygons don't necessarily + # end at the same point or have the same winding order. + # Brute force all possible variants of the expected polygon + bdd_parts = re.findall(r'\([^)]+\)', bdd_geom) + pg_parts = [g.strip() for g in pg_coords[1:-1].split('),(')] + return len(bdd_parts) == len(pg_parts) \ + and all(self._eq_ring(*parts) for parts in zip(bdd_parts, pg_parts)) + + def _eq_point(self, bdd_pt, pg_pt): + exp_geom = self.nodes.parse_point(bdd_pt) + pg_geom = list(map(float, pg_pt.split(' '))) + return len(exp_geom) == len(pg_geom) \ + and all(math.isclose(e, p, rel_tol=0.000001) for e, p in zip(exp_geom, pg_geom)) + + def _eq_ring(self, bdd_ring, pg_ring): + bdd_pts = [g.strip() for g in bdd_ring[1:-1].split(',')] + pg_pts = [g.strip() for g in pg_ring.split(',')] + if bdd_pts[0] != bdd_pts[-1]: + raise RuntimeError(f"Invalid polygon {bdd_geom}. " + "First and last point need to be the same") + if len(bdd_pts) != len(pg_pts): + return False + + for line in (bdd_pts[:-1], bdd_pts[-1:0:-1]): + for i in range(len(line)): + if all(self._eq_point(p1, p2) for p1, p2 in + zip(line[i:] + line[:i], pg_pts)): + return True + + return False + +################### Steps: Database setup ########################## + +@given("the database schema (?P.+)") +def create_db_schema(context, schema): + with context.db.cursor() as cur: + cur.execute("CREATE SCHEMA " + schema) + + +@when("deleting table (?P.+)") +def delete_table(context, table): + with context.db.cursor() as cur: + cur.execute("DROP TABLE " + table) + + +################### Steps: OSM data ################################ + +@given("the input file '(?P.+)'") +def osm_set_import_file(context, osm_file): + assert context.import_data is None, \ + "Import file cannot be used together with inline data." + pfile = Path(osm_file) + if pfile.is_absolute(): + context.import_file = pfile + else: + basedir = context.user_args.test_data_dir or Path(context.feature.filename).parent + context.import_file = (basedir / osm_file).resolve() + + +@given("the OSM data") +def osm_define_data(context): + assert context.import_file is None, \ + "Inline data cannot be used together with an import file." + if context.text.strip(): + context.append_osm_data(context.nodes.add_coordinates(context.text.split('\n'))) + else: + context.append_osm_data([]) + + +@given("the OSM data format string") +def osm_define_data(context): + assert context.import_file is None, \ + "Inline data cannot be used together with an import file." + data = eval('f"""' + context.text + '"""') + + context.append_osm_data(context.nodes.add_coordinates(data.split('\n'))) + + +@given("the (?P[0-9.]+ )?grid(?: with origin (?P[0-9.-]+) (?P[0-9.-]+))?") +def osm_define_node_grid(context, step, origin_x, origin_y): + step = float(step.strip()) if step else 0.1 + x = float(origin_x) if origin_x else 20.0 + y = float(origin_y) if origin_y else 20.0 + + assert x > -180.0 and x < 180.0 + assert y > -90.0 and y < 90.0 + + context.nodes.set_grid([context.table.headings] + [list(h) for h in context.table], step, x, y) + context.append_osm_data(context.nodes.get_as_opl()) + +################### Steps: Style file ############################## + +@given("the style file '(?P