├── .clang-format ├── .clang-tidy ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug-report.md │ └── config.yml ├── actions │ ├── build-and-test │ │ └── action.yml │ ├── clang-tidy │ │ └── action.yml │ ├── linux-cmake │ │ └── action.yml │ ├── ubuntu-prerequisites │ │ └── action.yml │ ├── win-build │ │ └── action.yml │ ├── win-cmake │ │ └── action.yml │ ├── win-install │ │ └── action.yml │ ├── win-postgres │ │ └── action.yml │ └── win-test │ │ └── action.yml └── workflows │ ├── ci.yml │ ├── clang-tidy.yml │ ├── luacheck.yml │ └── test-install.yml ├── .gitignore ├── .luacheckrc ├── AUTHORS ├── CMakeLists.txt ├── CONTRIBUTING.md ├── COPYING ├── README.md ├── cmake ├── FindLua.cmake ├── FindLuaJIT.cmake ├── FindOsmium.cmake └── FindProtozero.cmake ├── contrib ├── CLI11 │ ├── LICENSE │ ├── README.contrib │ ├── README.md │ └── include │ │ └── CLI │ │ ├── App.hpp │ │ ├── Argv.hpp │ │ ├── CLI.hpp │ │ ├── Config.hpp │ │ ├── ConfigFwd.hpp │ │ ├── Encoding.hpp │ │ ├── Error.hpp │ │ ├── Formatter.hpp │ │ ├── FormatterFwd.hpp │ │ ├── Macros.hpp │ │ ├── Option.hpp │ │ ├── Split.hpp │ │ ├── StringTools.hpp │ │ ├── Timer.hpp │ │ ├── TypeTools.hpp │ │ ├── Validators.hpp │ │ ├── Version.hpp │ │ └── impl │ │ ├── App_inl.hpp │ │ ├── Argv_inl.hpp │ │ ├── Config_inl.hpp │ │ ├── Encoding_inl.hpp │ │ ├── Formatter_inl.hpp │ │ ├── Option_inl.hpp │ │ ├── Split_inl.hpp │ │ ├── StringTools_inl.hpp │ │ └── Validators_inl.hpp ├── catch2 │ ├── LICENSE.txt │ ├── README.contrib │ ├── README.md │ └── include │ │ └── catch.hpp ├── fmt │ ├── LICENSE │ ├── README.contrib │ ├── README.md │ └── include │ │ └── fmt │ │ ├── args.h │ │ ├── base.h │ │ ├── chrono.h │ │ ├── color.h │ │ ├── compile.h │ │ ├── core.h │ │ ├── format-inl.h │ │ ├── format.h │ │ ├── os.h │ │ ├── ostream.h │ │ ├── printf.h │ │ ├── ranges.h │ │ ├── std.h │ │ └── xchar.h ├── libosmium │ ├── LICENSE │ ├── README.contrib │ ├── README.md │ └── include │ │ └── osmium │ │ ├── area │ │ ├── assembler.hpp │ │ ├── assembler_config.hpp │ │ ├── assembler_legacy.hpp │ │ ├── detail │ │ │ ├── basic_assembler.hpp │ │ │ ├── basic_assembler_with_tags.hpp │ │ │ ├── node_ref_segment.hpp │ │ │ ├── proto_ring.hpp │ │ │ ├── segment_list.hpp │ │ │ └── vector.hpp │ │ ├── geom_assembler.hpp │ │ ├── multipolygon_collector.hpp │ │ ├── multipolygon_manager.hpp │ │ ├── multipolygon_manager_legacy.hpp │ │ ├── problem_reporter.hpp │ │ ├── problem_reporter_exception.hpp │ │ ├── problem_reporter_ogr.hpp │ │ ├── problem_reporter_stream.hpp │ │ └── stats.hpp │ │ ├── builder │ │ ├── attr.hpp │ │ ├── builder.hpp │ │ └── osm_object_builder.hpp │ │ ├── diff_handler.hpp │ │ ├── diff_iterator.hpp │ │ ├── diff_visitor.hpp │ │ ├── dynamic_handler.hpp │ │ ├── experimental │ │ └── flex_reader.hpp │ │ ├── fwd.hpp │ │ ├── geom │ │ ├── coordinates.hpp │ │ ├── factory.hpp │ │ ├── geojson.hpp │ │ ├── geos.hpp │ │ ├── haversine.hpp │ │ ├── mercator_projection.hpp │ │ ├── ogr.hpp │ │ ├── rapid_geojson.hpp │ │ ├── relations.hpp │ │ ├── tile.hpp │ │ ├── util.hpp │ │ ├── wkb.hpp │ │ └── wkt.hpp │ │ ├── handler.hpp │ │ ├── handler │ │ ├── chain.hpp │ │ ├── check_order.hpp │ │ ├── disk_store.hpp │ │ ├── dump.hpp │ │ ├── node_locations_for_ways.hpp │ │ └── object_relations.hpp │ │ ├── index │ │ ├── detail │ │ │ ├── create_map_with_fd.hpp │ │ │ ├── mmap_vector_anon.hpp │ │ │ ├── mmap_vector_base.hpp │ │ │ ├── mmap_vector_file.hpp │ │ │ ├── tmpfile.hpp │ │ │ ├── vector_map.hpp │ │ │ └── vector_multimap.hpp │ │ ├── id_set.hpp │ │ ├── index.hpp │ │ ├── map.hpp │ │ ├── map │ │ │ ├── all.hpp │ │ │ ├── dense_file_array.hpp │ │ │ ├── dense_mem_array.hpp │ │ │ ├── dense_mmap_array.hpp │ │ │ ├── dummy.hpp │ │ │ ├── flex_mem.hpp │ │ │ ├── sparse_file_array.hpp │ │ │ ├── sparse_mem_array.hpp │ │ │ ├── sparse_mem_map.hpp │ │ │ └── sparse_mmap_array.hpp │ │ ├── multimap.hpp │ │ ├── multimap │ │ │ ├── all.hpp │ │ │ ├── hybrid.hpp │ │ │ ├── sparse_file_array.hpp │ │ │ ├── sparse_mem_array.hpp │ │ │ ├── sparse_mem_multimap.hpp │ │ │ └── sparse_mmap_array.hpp │ │ ├── node_locations_map.hpp │ │ ├── nwr_array.hpp │ │ └── relations_map.hpp │ │ ├── io │ │ ├── any_compression.hpp │ │ ├── any_input.hpp │ │ ├── any_output.hpp │ │ ├── bzip2_compression.hpp │ │ ├── compression.hpp │ │ ├── debug_output.hpp │ │ ├── detail │ │ │ ├── debug_output_format.hpp │ │ │ ├── ids_output_format.hpp │ │ │ ├── input_format.hpp │ │ │ ├── lz4.hpp │ │ │ ├── o5m_input_format.hpp │ │ │ ├── opl_input_format.hpp │ │ │ ├── opl_output_format.hpp │ │ │ ├── opl_parser_functions.hpp │ │ │ ├── output_format.hpp │ │ │ ├── pbf.hpp │ │ │ ├── pbf_decoder.hpp │ │ │ ├── pbf_input_format.hpp │ │ │ ├── pbf_output_format.hpp │ │ │ ├── protobuf_tags.hpp │ │ │ ├── queue_util.hpp │ │ │ ├── read_thread.hpp │ │ │ ├── read_write.hpp │ │ │ ├── string_table.hpp │ │ │ ├── string_util.hpp │ │ │ ├── write_thread.hpp │ │ │ ├── xml_input_format.hpp │ │ │ ├── xml_output_format.hpp │ │ │ └── zlib.hpp │ │ ├── error.hpp │ │ ├── file.hpp │ │ ├── file_compression.hpp │ │ ├── file_format.hpp │ │ ├── gzip_compression.hpp │ │ ├── header.hpp │ │ ├── ids_output.hpp │ │ ├── input_iterator.hpp │ │ ├── o5m_input.hpp │ │ ├── opl_input.hpp │ │ ├── opl_output.hpp │ │ ├── output_iterator.hpp │ │ ├── overwrite.hpp │ │ ├── pbf.hpp │ │ ├── pbf_input.hpp │ │ ├── pbf_output.hpp │ │ ├── reader.hpp │ │ ├── reader_iterator.hpp │ │ ├── reader_with_progress_bar.hpp │ │ ├── writer.hpp │ │ ├── writer_options.hpp │ │ ├── xml_input.hpp │ │ └── xml_output.hpp │ │ ├── memory │ │ ├── buffer.hpp │ │ ├── callback_buffer.hpp │ │ ├── collection.hpp │ │ ├── item.hpp │ │ └── item_iterator.hpp │ │ ├── object_pointer_collection.hpp │ │ ├── opl.hpp │ │ ├── osm.hpp │ │ ├── osm │ │ ├── area.hpp │ │ ├── box.hpp │ │ ├── changeset.hpp │ │ ├── crc.hpp │ │ ├── crc_zlib.hpp │ │ ├── diff_object.hpp │ │ ├── entity.hpp │ │ ├── entity_bits.hpp │ │ ├── item_type.hpp │ │ ├── location.hpp │ │ ├── metadata_options.hpp │ │ ├── node.hpp │ │ ├── node_ref.hpp │ │ ├── node_ref_list.hpp │ │ ├── object.hpp │ │ ├── object_comparisons.hpp │ │ ├── relation.hpp │ │ ├── segment.hpp │ │ ├── tag.hpp │ │ ├── timestamp.hpp │ │ ├── types.hpp │ │ ├── types_from_string.hpp │ │ ├── undirected_segment.hpp │ │ └── way.hpp │ │ ├── relations │ │ ├── collector.hpp │ │ ├── detail │ │ │ ├── member_meta.hpp │ │ │ └── relation_meta.hpp │ │ ├── manager_util.hpp │ │ ├── members_database.hpp │ │ ├── relations_database.hpp │ │ └── relations_manager.hpp │ │ ├── storage │ │ └── item_stash.hpp │ │ ├── tags │ │ ├── filter.hpp │ │ ├── matcher.hpp │ │ ├── taglist.hpp │ │ └── tags_filter.hpp │ │ ├── thread │ │ ├── function_wrapper.hpp │ │ ├── pool.hpp │ │ ├── queue.hpp │ │ └── util.hpp │ │ ├── util │ │ ├── compatibility.hpp │ │ ├── config.hpp │ │ ├── delta.hpp │ │ ├── double.hpp │ │ ├── endian.hpp │ │ ├── file.hpp │ │ ├── iterator.hpp │ │ ├── memory.hpp │ │ ├── memory_mapping.hpp │ │ ├── minmax.hpp │ │ ├── misc.hpp │ │ ├── options.hpp │ │ ├── progress_bar.hpp │ │ ├── string.hpp │ │ ├── string_matcher.hpp │ │ ├── timer.hpp │ │ └── verbose_output.hpp │ │ ├── version.hpp │ │ └── visitor.hpp └── protozero │ ├── LICENSE.from_folly │ ├── LICENSE.md │ ├── README.contrib │ ├── README.md │ └── include │ └── protozero │ ├── basic_pbf_builder.hpp │ ├── basic_pbf_writer.hpp │ ├── buffer_fixed.hpp │ ├── buffer_string.hpp │ ├── buffer_tmpl.hpp │ ├── buffer_vector.hpp │ ├── byteswap.hpp │ ├── config.hpp │ ├── data_view.hpp │ ├── exception.hpp │ ├── iterators.hpp │ ├── pbf_builder.hpp │ ├── pbf_message.hpp │ ├── pbf_reader.hpp │ ├── pbf_writer.hpp │ ├── types.hpp │ ├── varint.hpp │ └── version.hpp ├── default.style ├── empty.style ├── flex-config ├── README.md ├── addresses.lua ├── attributes.lua ├── bbox.lua ├── compatible.lua ├── data-types.lua ├── expire.lua ├── gen │ ├── README.md │ └── forests.lua ├── generic.lua ├── geometries.lua ├── indexes.lua ├── labelpoint.lua ├── locator │ ├── README.md │ ├── buildings.lua │ ├── iceland.lua │ ├── import-countries.lua │ └── motorway-colours.lua ├── places.lua ├── public-transport.lua ├── route-relations.lua ├── simple.lua ├── unitable.lua ├── untagged.lua └── with-schema.lua ├── man ├── CMakeLists.txt ├── manpage.template ├── manpage_from_python.py ├── osm2pgsql-gen.1 ├── osm2pgsql-gen.md ├── osm2pgsql-replication.1 ├── osm2pgsql.1 └── osm2pgsql.md ├── scripts └── osm2pgsql-replication ├── src ├── CMakeLists.txt ├── command-line-app.cpp ├── command-line-app.hpp ├── command-line-parser.cpp ├── command-line-parser.hpp ├── db-copy-mgr.hpp ├── db-copy.cpp ├── db-copy.hpp ├── debug-output.cpp ├── debug-output.hpp ├── domain-matcher.hpp ├── expire-config.hpp ├── expire-output.cpp ├── expire-output.hpp ├── expire-tiles.cpp ├── expire-tiles.hpp ├── flex-index.cpp ├── flex-index.hpp ├── flex-lua-expire-output.cpp ├── flex-lua-expire-output.hpp ├── flex-lua-geom.cpp ├── flex-lua-geom.hpp ├── flex-lua-index.cpp ├── flex-lua-index.hpp ├── flex-lua-locator.cpp ├── flex-lua-locator.hpp ├── flex-lua-table.cpp ├── flex-lua-table.hpp ├── flex-lua-wrapper.hpp ├── flex-table-column.cpp ├── flex-table-column.hpp ├── flex-table.cpp ├── flex-table.hpp ├── flex-write.cpp ├── flex-write.hpp ├── format.hpp ├── gen │ ├── canvas.cpp │ ├── canvas.hpp │ ├── gen-base.cpp │ ├── gen-base.hpp │ ├── gen-create.cpp │ ├── gen-create.hpp │ ├── gen-discrete-isolation.cpp │ ├── gen-discrete-isolation.hpp │ ├── gen-rivers.cpp │ ├── gen-rivers.hpp │ ├── gen-tile-builtup.cpp │ ├── gen-tile-builtup.hpp │ ├── gen-tile-raster.cpp │ ├── gen-tile-raster.hpp │ ├── gen-tile-sql.cpp │ ├── gen-tile-sql.hpp │ ├── gen-tile-vector.cpp │ ├── gen-tile-vector.hpp │ ├── gen-tile.cpp │ ├── gen-tile.hpp │ ├── osm2pgsql-gen.cpp │ ├── raster.cpp │ ├── raster.hpp │ ├── tracer.cpp │ └── tracer.hpp ├── geom-area-assembler.cpp ├── geom-area-assembler.hpp ├── geom-boost-adaptor.hpp ├── geom-box.cpp ├── geom-box.hpp ├── geom-from-osm.cpp ├── geom-from-osm.hpp ├── geom-functions.cpp ├── geom-functions.hpp ├── geom-output.hpp ├── geom-pole-of-inaccessibility.cpp ├── geom-pole-of-inaccessibility.hpp ├── geom.cpp ├── geom.hpp ├── idlist.cpp ├── idlist.hpp ├── init.lua ├── input.cpp ├── input.hpp ├── json-writer.hpp ├── locator.cpp ├── locator.hpp ├── logging.cpp ├── logging.hpp ├── lua-init.cpp.in ├── lua-init.hpp ├── lua-setup.cpp ├── lua-setup.hpp ├── lua-utils.cpp ├── lua-utils.hpp ├── middle-pgsql.cpp ├── middle-pgsql.hpp ├── middle-ram.cpp ├── middle-ram.hpp ├── middle.cpp ├── middle.hpp ├── node-locations.cpp ├── node-locations.hpp ├── node-persistent-cache.cpp ├── node-persistent-cache.hpp ├── options.hpp ├── ordered-index.cpp ├── ordered-index.hpp ├── osm2pgsql.cpp ├── osmdata.cpp ├── osmdata.hpp ├── osmtypes.hpp ├── output-flex.cpp ├── output-flex.hpp ├── output-null.cpp ├── output-null.hpp ├── output-pgsql.cpp ├── output-pgsql.hpp ├── output-requirements.hpp ├── output.cpp ├── output.hpp ├── overloaded.hpp ├── params.cpp ├── params.hpp ├── pgsql-capabilities-int.hpp ├── pgsql-capabilities.cpp ├── pgsql-capabilities.hpp ├── pgsql-helper.cpp ├── pgsql-helper.hpp ├── pgsql-params.hpp ├── pgsql.cpp ├── pgsql.hpp ├── progress-display.cpp ├── progress-display.hpp ├── properties.cpp ├── properties.hpp ├── reprojection-generic-none.cpp ├── reprojection-generic-proj6.cpp ├── reprojection.cpp ├── reprojection.hpp ├── table.cpp ├── table.hpp ├── taginfo-impl.hpp ├── taginfo.cpp ├── taginfo.hpp ├── tagtransform-c.cpp ├── tagtransform-c.hpp ├── tagtransform-lua.cpp ├── tagtransform-lua.hpp ├── tagtransform.cpp ├── tagtransform.hpp ├── template.cpp ├── template.hpp ├── thread-pool.cpp ├── thread-pool.hpp ├── tile-output.hpp ├── tile.cpp ├── tile.hpp ├── util.cpp ├── util.hpp ├── version.cpp.in ├── version.hpp ├── wildcmp.cpp ├── wildcmp.hpp ├── wkb.cpp └── wkb.hpp ├── style.lua └── tests ├── CMakeLists.txt ├── bdd ├── .behaverc ├── command-line │ ├── dsn.feature │ ├── invalid.feature │ ├── replication.feature │ ├── replication_legacy.feature │ ├── replication_schema.feature │ └── schema.feature ├── environment.py ├── flex │ ├── area.feature │ ├── bbox.feature │ ├── empty-insert.feature │ ├── expire.feature │ ├── extra-attributes.feature │ ├── geometry-collection.feature │ ├── geometry-function-area.feature │ ├── geometry-iteration.feature │ ├── geometry-linestring.feature │ ├── geometry-multilinestring.feature │ ├── geometry-multipoint.feature │ ├── geometry-null.feature │ ├── geometry-processing.feature │ ├── invalid-geometries.feature │ ├── invalid-lua.feature │ ├── line-splitting.feature │ ├── locator.feature │ ├── lua-basics.feature │ ├── lua-callbacks.feature │ ├── lua-expire-output-definitions.feature │ ├── lua-expire.feature │ ├── lua-index-definitions.feature │ ├── lua-table-definitions.feature │ ├── missing-nodes.feature │ ├── multigeom.feature │ ├── nocluster.feature │ ├── node-add.feature │ ├── nogeom.feature │ ├── relation-changes.feature │ ├── run-with-expire.feature │ ├── table-ids.feature │ ├── tags.feature │ ├── way-add.feature │ ├── way-change.feature │ ├── way-del.feature │ ├── way-relation-add.feature │ └── way-relation-del.feature ├── regression │ ├── extra-attributes.feature │ ├── forward_dependencies.feature │ ├── import.feature │ ├── input.feature │ ├── multipolygon.feature │ ├── properties.feature │ ├── timestamps.feature │ └── update.feature └── steps │ ├── geometry_factory.py │ ├── replication_server_mock.py │ ├── steps_db.py │ ├── steps_execute.py │ └── steps_osm_data.py ├── catch-main.cpp ├── common-buffer.hpp ├── common-cleanup.hpp ├── common-import.hpp ├── common-options.hpp ├── common-pg.hpp ├── data ├── 000466354.osc.gz ├── 008-ch.osc.gz ├── hstore-match-only.osm ├── hstore-match-only.style ├── liechtenstein-2013-08-03.osm.bz2 ├── liechtenstein-2013-08-03.osm.pbf ├── test_expire.lua ├── test_invalid_location.osm ├── test_multipolygon.osm ├── test_multipolygon_diff.osc ├── test_multipolygon_postdiff.osm ├── test_output_flex.lua ├── test_output_flex_copy.lua ├── test_output_flex_node.lua ├── test_output_flex_nodes.lua ├── test_output_flex_relation_combinations.lua ├── test_output_flex_relations.lua ├── test_output_flex_schema.lua ├── test_output_flex_stage2.lua ├── test_output_flex_stage2_alt.lua ├── test_output_flex_types.lua ├── test_output_flex_uni.lua ├── test_output_flex_validgeom.lua ├── test_output_flex_way.lua ├── test_output_pgsql_area.osm ├── test_output_pgsql_int4.osm ├── test_output_pgsql_int4.style ├── test_output_pgsql_route_rel.osm ├── test_output_pgsql_validgeom.osm ├── test_output_pgsql_way_area.osm └── test_output_pgsql_z_order.osm ├── fixture-tablespace-cleanup ├── fixture-tablespace-setup ├── lua └── tests.lua ├── run-behave.in ├── style ├── comments.style ├── data-types.style ├── empty.style ├── invalid-data-type.style ├── invalid-osm-type.style ├── missing.style ├── node.style ├── valid.style └── way-area.style ├── test-check-input.cpp ├── test-db-copy-mgr.cpp ├── test-db-copy-thread.cpp ├── test-domain-matcher.cpp ├── test-expire-from-geometry.cpp ├── test-expire-tiles.cpp ├── test-flex-indexes.cpp ├── test-geom-box.cpp ├── test-geom-collections.cpp ├── test-geom-linestrings.cpp ├── test-geom-multilinestrings.cpp ├── test-geom-multipoints.cpp ├── test-geom-multipolygons.cpp ├── test-geom-null.cpp ├── test-geom-output.cpp ├── test-geom-points.cpp ├── test-geom-pole-of-inaccessibility.cpp ├── test-geom-polygons.cpp ├── test-geom-transform.cpp ├── test-json-writer.cpp ├── test-locator.cpp ├── test-lua-utils.cpp ├── test-middle.cpp ├── test-node-locations.cpp ├── test-options-parse.cpp ├── test-options-projection.cpp ├── test-ordered-index.cpp ├── test-osm-file-parsing.cpp ├── test-output-flex-example-configs.cpp ├── test-output-flex-multi-input.cpp ├── test-output-flex-nodes.cpp ├── test-output-flex-relation-combinations.cpp ├── test-output-flex-relations.cpp ├── test-output-flex-schema.cpp ├── test-output-flex-stage2.cpp ├── test-output-flex-tablespace.cpp ├── test-output-flex-types.cpp ├── test-output-flex-uni.cpp ├── test-output-flex-update.cpp ├── test-output-flex-validgeom.cpp ├── test-output-flex.cpp ├── test-output-pgsql-area.cpp ├── test-output-pgsql-hstore-match-only.cpp ├── test-output-pgsql-int4.cpp ├── test-output-pgsql-schema.cpp ├── test-output-pgsql-style-file.cpp ├── test-output-pgsql-tablespace.cpp ├── test-output-pgsql-validgeom.cpp ├── test-output-pgsql-z_order.cpp ├── test-output-pgsql.cpp ├── test-params.cpp ├── test-persistent-cache.cpp ├── test-pgsql-capabilities.cpp ├── test-pgsql.cpp ├── test-properties.cpp ├── test-reprojection.cpp ├── test-taginfo.cpp ├── test-tile.cpp ├── test-util.cpp ├── test-wildcard-match.cpp └── test-wkb.cpp /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: LLVM 4 | AccessModifierOffset: -4 5 | BreakBeforeBraces: Mozilla 6 | IndentWidth: 4 7 | ConstructorInitializerIndentWidth: 0 8 | ReflowComments: false 9 | AlwaysBreakTemplateDeclarations: true 10 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: "https://osm2pgsql.org/sponsors/" 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Report problems with the software 3 | about: You found a (possible) bug in osm2pgsql 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | ## What version of osm2pgsql are you using? 13 | 14 | 17 | 18 | 19 | ## What operating system and PostgreSQL/PostGIS version are you using? 20 | 21 | 22 | 23 | 24 | ## Tell us something about your system 25 | 26 | 27 | 28 | 29 | ## What did you do exactly? 30 | 31 | 33 | 34 | 35 | ## What did you expect to happen? 36 | 37 | 38 | 39 | 40 | ## What did happen instead? 41 | 42 | 44 | 45 | 46 | ## What did you do to try analyzing the problem? 47 | 48 | 50 | 51 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: osm2pgsql Discussions 3 | url: https://github.com/openstreetmap/osm2pgsql/discussions 4 | about: Ask questions, get support, share ideas and discuss with community members. 5 | -------------------------------------------------------------------------------- /.github/actions/build-and-test/action.yml: -------------------------------------------------------------------------------- 1 | name: Build and test osm2pgsql 2 | 3 | inputs: 4 | test-wrapper: 5 | description: 'Wrapper to use around tests' 6 | required: false 7 | default: pg_virtualenv 8 | 9 | runs: 10 | using: composite 11 | 12 | steps: 13 | - name: build 14 | run: make -j3 all man 15 | shell: bash 16 | working-directory: build 17 | 18 | - name: test 19 | run: | 20 | if [ "$WRAPPER" = "pg_virtualenv" ]; then 21 | pg_virtualenv -v $POSTGRESQL_VERSION ctest --output-on-failure 22 | else 23 | $WRAPPER ctest --output-on-failure 24 | fi 25 | shell: bash 26 | working-directory: build 27 | env: 28 | WRAPPER: ${{ inputs.test-wrapper }} 29 | 30 | -------------------------------------------------------------------------------- /.github/actions/clang-tidy/action.yml: -------------------------------------------------------------------------------- 1 | name: Run clang-tidy 2 | 3 | runs: 4 | using: composite 5 | 6 | steps: 7 | - name: Run clang-tidy 8 | run: run-clang-tidy-17 -q -p build 9 | shell: bash 10 | -------------------------------------------------------------------------------- /.github/actions/linux-cmake/action.yml: -------------------------------------------------------------------------------- 1 | name: CMake 2 | 3 | runs: 4 | using: composite 5 | 6 | steps: 7 | - name: create build directory 8 | run: mkdir build 9 | shell: bash 10 | 11 | - name: configure 12 | run: | 13 | CMAKE_OPTIONS="-LA -DBUILD_TESTS=ON -DWITH_LUAJIT=${LUAJIT_OPTION}" 14 | if [ -n "$WITH_PROJ" ]; then 15 | CMAKE_OPTIONS="$CMAKE_OPTIONS -DWITH_PROJ=$WITH_PROJ" 16 | fi 17 | if [ -n "$CPP_VERSION" ]; then 18 | CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_CXX_STANDARD=$CPP_VERSION" 19 | fi 20 | if [ -n "$BUILD_TYPE" ]; then 21 | CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=$BUILD_TYPE" 22 | fi 23 | cmake $CMAKE_OPTIONS .. 24 | shell: bash 25 | working-directory: build 26 | env: 27 | CXXFLAGS: -pedantic -Wextra ${{ env.EXTRA_FLAGS }} -Werror 28 | 29 | -------------------------------------------------------------------------------- /.github/actions/win-build/action.yml: -------------------------------------------------------------------------------- 1 | name: Windows build 2 | 3 | runs: 4 | using: composite 5 | 6 | steps: 7 | - name: Build 8 | run: cmake --build . --config Release --verbose 9 | shell: bash 10 | working-directory: build 11 | 12 | -------------------------------------------------------------------------------- /.github/actions/win-cmake/action.yml: -------------------------------------------------------------------------------- 1 | name: Windows CMake 2 | 3 | runs: 4 | using: composite 5 | 6 | steps: 7 | - name: Create build directory 8 | run: mkdir build 9 | shell: bash 10 | 11 | - name: Configure 12 | run: cmake -LA .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_TESTS=ON -DGETOPT_INCLUDE_DIR=$GETOPT_INCLUDE_DIR -DGETOPT_LIBRARY=$GETOPT_LIBRARY -DBoost_USE_STATIC_LIBS=ON 13 | shell: bash 14 | working-directory: build 15 | 16 | -------------------------------------------------------------------------------- /.github/actions/win-install/action.yml: -------------------------------------------------------------------------------- 1 | name: Windows install 2 | 3 | runs: 4 | using: composite 5 | 6 | steps: 7 | - name: Install packages 8 | run: | 9 | vcpkg install \ 10 | boost-geometry:x64-windows \ 11 | bzip2[core]:x64-windows \ 12 | expat:x64-windows \ 13 | libpq:x64-windows \ 14 | lua:x64-windows \ 15 | nlohmann-json:x64-windows \ 16 | proj[core]:x64-windows \ 17 | zlib:x64-windows 18 | shell: bash 19 | - name: Install psycopg2 and behave 20 | run: python -m pip install psycopg2 behave osmium 21 | shell: bash 22 | -------------------------------------------------------------------------------- /.github/actions/win-test/action.yml: -------------------------------------------------------------------------------- 1 | name: Windows test 2 | 3 | runs: 4 | using: composite 5 | 6 | steps: 7 | - name: Test 8 | run: ctest --output-on-failure -C Release 9 | env: 10 | PYTHONUTF8: 1 11 | PROJ_DATA: c:/vcpkg/installed/x64-windows/share/proj/ # so proj finds proj.db 12 | shell: bash 13 | working-directory: build 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/clang-tidy.yml: -------------------------------------------------------------------------------- 1 | name: clang-tidy 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | clang-tidy: 7 | runs-on: ubuntu-24.04 8 | 9 | env: 10 | CC: clang-18 11 | CXX: clang++-18 12 | LUA_VERSION: 5.4 13 | LUAJIT_OPTION: OFF 14 | POSTGRESQL_VERSION: 16 15 | POSTGIS_VERSION: 3 16 | BUILD_TYPE: Debug 17 | PSYCOPG: 3 18 | PIP_OPTION: --break-system-packages 19 | 20 | steps: 21 | - uses: actions/checkout@v4 22 | - uses: ./.github/actions/ubuntu-prerequisites 23 | - uses: ./.github/actions/linux-cmake 24 | - uses: ./.github/actions/clang-tidy 25 | 26 | -------------------------------------------------------------------------------- /.github/workflows/luacheck.yml: -------------------------------------------------------------------------------- 1 | name: Check Lua scripts with luacheck 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | luacheck: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v4 11 | 12 | - name: Install prerequisites 13 | run: | 14 | sudo apt-get update -qq 15 | sudo apt-get install -yq --no-install-suggests --no-install-recommends lua-check 16 | 17 | - name: Run luacheck 18 | run: luacheck flex-config/*.lua flex-config/*/*.lua tests/data/*.lua tests/lua/tests.lua 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | docs/html 4 | docs/latex 5 | 6 | __pycache__ 7 | -------------------------------------------------------------------------------- /.luacheckrc: -------------------------------------------------------------------------------- 1 | -- 2 | -- Configuration for luacheck 3 | -- 4 | -- To check Lua files call like this: 5 | -- luacheck flex-config/*.lua flex-config/gen/*.lua tests/data/*.lua tests/lua/tests.lua 6 | -- 7 | 8 | unused_args = false 9 | 10 | stds.osm2pgsql = { 11 | read_globals = { 12 | osm2pgsql = { 13 | fields = { 14 | process_node = { 15 | read_only = false 16 | }, 17 | process_way = { 18 | read_only = false 19 | }, 20 | process_relation = { 21 | read_only = false 22 | }, 23 | process_untagged_node = { 24 | read_only = false 25 | }, 26 | process_untagged_way = { 27 | read_only = false 28 | }, 29 | process_untagged_relation = { 30 | read_only = false 31 | }, 32 | select_relation_members = { 33 | read_only = false 34 | }, 35 | process_gen = { 36 | read_only = false 37 | }, 38 | }, 39 | other_fields = true, 40 | } 41 | } 42 | } 43 | 44 | std = 'min+osm2pgsql' 45 | 46 | files['tests/lua/tests.lua'].globals = { 'osm2pgsql' } 47 | 48 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | osm2pgsql was written by Jon Burgess, Artem Pavlenko, Martijn van Oosterhout, 2 | Sarah Hoffmann, Kai Krueger, Frederik Ramm, Brian Quinion, Matt Amos, 3 | Kevin Kreiser, Paul Norman, Jochen Topf and other OpenStreetMap project members. 4 | -------------------------------------------------------------------------------- /cmake/FindLuaJIT.cmake: -------------------------------------------------------------------------------- 1 | # Locate LuaJIT library 2 | # This module defines 3 | # LUAJIT_FOUND, if false, do not try to link to Lua 4 | # LUAJIT_LIBRARIES 5 | # LUAJIT_INCLUDE_DIR, where to find luajit.h 6 | # LUAJIT_VERSION_STRING, the version of Lua found (since CMake 2.8.8) 7 | 8 | ## Copied from default CMake FindLua51.cmake 9 | 10 | find_path(LUAJIT_INCLUDE_DIR luajit.h 11 | HINTS 12 | ENV LUA_DIR 13 | PATH_SUFFIXES include/luajit-2.0 include/luajit-2.1 include 14 | PATHS 15 | ~/Library/Frameworks 16 | /Library/Frameworks 17 | /sw # Fink 18 | /opt/local # DarwinPorts 19 | /opt/csw # Blastwave 20 | /opt 21 | ) 22 | 23 | find_library(LUAJIT_LIBRARY 24 | NAMES luajit-5.1 25 | HINTS 26 | ENV LUA_DIR 27 | PATH_SUFFIXES lib 28 | PATHS 29 | ~/Library/Frameworks 30 | /Library/Frameworks 31 | /sw 32 | /opt/local 33 | /opt/csw 34 | /opt 35 | ) 36 | 37 | if(LUAJIT_LIBRARY) 38 | # include the math library for Unix 39 | if(UNIX AND NOT APPLE) 40 | find_library(LUA_MATH_LIBRARY m) 41 | set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "LuaJIT Libraries") 42 | # For Windows and Mac, don't need to explicitly include the math library 43 | else() 44 | set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "LuaJIT Libraries") 45 | endif() 46 | endif() 47 | 48 | if(LUAJIT_INCLUDE_DIR AND EXISTS "${LUAJIT_INCLUDE_DIR}/luajit.h") 49 | file(STRINGS "${LUAJIT_INCLUDE_DIR}/luajit.h" luajit_version_str REGEX "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT .+\"") 50 | 51 | string(REGEX REPLACE "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT ([^\"]+)\".*" "\\1" LUAJIT_VERSION_STRING "${luajit_version_str}") 52 | unset(luajit_version_str) 53 | endif() 54 | 55 | include(FindPackageHandleStandardArgs) 56 | # handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if 57 | # all listed variables are TRUE 58 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT 59 | REQUIRED_VARS LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR 60 | VERSION_VAR LUAJIT_VERSION_STRING) 61 | 62 | mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUA_MATH_LIBRARY) 63 | 64 | -------------------------------------------------------------------------------- /contrib/CLI11/LICENSE: -------------------------------------------------------------------------------- 1 | CLI11 2.2 Copyright (c) 2017-2024 University of Cincinnati, developed by Henry 2 | Schreiner under NSF AWARD 1414736. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms of CLI11, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 3. Neither the name of the copyright holder nor the names of its contributors 13 | may be used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /contrib/CLI11/README.contrib: -------------------------------------------------------------------------------- 1 | Source: https://github.com/CLIUtils/CLI11 2 | Revision: v2.4.2 3 | -------------------------------------------------------------------------------- /contrib/CLI11/include/CLI/Argv.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner 2 | // under NSF AWARD 1414736 and by the respective contributors. 3 | // All rights reserved. 4 | // 5 | // SPDX-License-Identifier: BSD-3-Clause 6 | 7 | #pragma once 8 | 9 | // IWYU pragma: private, include "CLI/CLI.hpp" 10 | 11 | // [CLI11:public_includes:set] 12 | #include 13 | #include 14 | // [CLI11:public_includes:end] 15 | 16 | #include "Macros.hpp" 17 | 18 | namespace CLI { 19 | // [CLI11:argv_hpp:verbatim] 20 | namespace detail { 21 | #ifdef _WIN32 22 | /// Decode and return UTF-8 argv from GetCommandLineW. 23 | CLI11_INLINE std::vector compute_win32_argv(); 24 | #endif 25 | } // namespace detail 26 | // [CLI11:argv_hpp:end] 27 | } // namespace CLI 28 | 29 | #ifndef CLI11_COMPILE 30 | #include "impl/Argv_inl.hpp" // IWYU pragma: export 31 | #endif 32 | -------------------------------------------------------------------------------- /contrib/CLI11/include/CLI/CLI.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner 2 | // under NSF AWARD 1414736 and by the respective contributors. 3 | // All rights reserved. 4 | // 5 | // SPDX-License-Identifier: BSD-3-Clause 6 | 7 | #pragma once 8 | 9 | // CLI Library includes 10 | // Order is important for combiner script 11 | 12 | // IWYU pragma: begin_exports 13 | 14 | #include "Version.hpp" 15 | 16 | #include "Macros.hpp" 17 | 18 | #include "Encoding.hpp" 19 | 20 | #include "Argv.hpp" 21 | 22 | #include "StringTools.hpp" 23 | 24 | #include "Error.hpp" 25 | 26 | #include "TypeTools.hpp" 27 | 28 | #include "Split.hpp" 29 | 30 | #include "ConfigFwd.hpp" 31 | 32 | #include "Validators.hpp" 33 | 34 | #include "FormatterFwd.hpp" 35 | 36 | #include "Option.hpp" 37 | 38 | #include "App.hpp" 39 | 40 | #include "Config.hpp" 41 | 42 | #include "Formatter.hpp" 43 | 44 | // IWYU pragma: end_exports 45 | -------------------------------------------------------------------------------- /contrib/CLI11/include/CLI/Config.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner 2 | // under NSF AWARD 1414736 and by the respective contributors. 3 | // All rights reserved. 4 | // 5 | // SPDX-License-Identifier: BSD-3-Clause 6 | 7 | #pragma once 8 | 9 | // IWYU pragma: private, include "CLI/CLI.hpp" 10 | 11 | // [CLI11:public_includes:set] 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | // [CLI11:public_includes:end] 20 | 21 | #include "App.hpp" 22 | #include "ConfigFwd.hpp" 23 | #include "StringTools.hpp" 24 | 25 | namespace CLI { 26 | // [CLI11:config_hpp:verbatim] 27 | namespace detail { 28 | 29 | std::string convert_arg_for_ini(const std::string &arg, 30 | char stringQuote = '"', 31 | char literalQuote = '\'', 32 | bool disable_multi_line = false); 33 | 34 | /// Comma separated join, adds quotes if needed 35 | std::string ini_join(const std::vector &args, 36 | char sepChar = ',', 37 | char arrayStart = '[', 38 | char arrayEnd = ']', 39 | char stringQuote = '"', 40 | char literalQuote = '\''); 41 | 42 | void clean_name_string(std::string &name, const std::string &keyChars); 43 | 44 | std::vector generate_parents(const std::string §ion, std::string &name, char parentSeparator); 45 | 46 | /// assuming non default segments do a check on the close and open of the segments in a configItem structure 47 | void checkParentSegments(std::vector &output, const std::string ¤tSection, char parentSeparator); 48 | } // namespace detail 49 | 50 | // [CLI11:config_hpp:end] 51 | } // namespace CLI 52 | 53 | #ifndef CLI11_COMPILE 54 | #include "impl/Config_inl.hpp" // IWYU pragma: export 55 | #endif 56 | -------------------------------------------------------------------------------- /contrib/CLI11/include/CLI/Encoding.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner 2 | // under NSF AWARD 1414736 and by the respective contributors. 3 | // All rights reserved. 4 | // 5 | // SPDX-License-Identifier: BSD-3-Clause 6 | 7 | #pragma once 8 | 9 | // IWYU pragma: private, include "CLI/CLI.hpp" 10 | #include "Macros.hpp" 11 | 12 | // [CLI11:public_includes:set] 13 | #include 14 | // [CLI11:public_includes:end] 15 | 16 | // [CLI11:encoding_includes:verbatim] 17 | #ifdef CLI11_CPP17 18 | #include 19 | #endif // CLI11_CPP17 20 | 21 | #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 22 | #include 23 | #include // NOLINT(build/include) 24 | #endif // CLI11_HAS_FILESYSTEM 25 | // [CLI11:encoding_includes:end] 26 | 27 | namespace CLI { 28 | // [CLI11:encoding_hpp:verbatim] 29 | 30 | /// Convert a wide string to a narrow string. 31 | CLI11_INLINE std::string narrow(const std::wstring &str); 32 | CLI11_INLINE std::string narrow(const wchar_t *str); 33 | CLI11_INLINE std::string narrow(const wchar_t *str, std::size_t size); 34 | 35 | /// Convert a narrow string to a wide string. 36 | CLI11_INLINE std::wstring widen(const std::string &str); 37 | CLI11_INLINE std::wstring widen(const char *str); 38 | CLI11_INLINE std::wstring widen(const char *str, std::size_t size); 39 | 40 | #ifdef CLI11_CPP17 41 | CLI11_INLINE std::string narrow(std::wstring_view str); 42 | CLI11_INLINE std::wstring widen(std::string_view str); 43 | #endif // CLI11_CPP17 44 | 45 | #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 46 | /// Convert a char-string to a native path correctly. 47 | CLI11_INLINE std::filesystem::path to_path(std::string_view str); 48 | #endif // CLI11_HAS_FILESYSTEM 49 | 50 | // [CLI11:encoding_hpp:end] 51 | } // namespace CLI 52 | 53 | #ifndef CLI11_COMPILE 54 | #include "impl/Encoding_inl.hpp" // IWYU pragma: export 55 | #endif 56 | -------------------------------------------------------------------------------- /contrib/CLI11/include/CLI/Formatter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner 2 | // under NSF AWARD 1414736 and by the respective contributors. 3 | // All rights reserved. 4 | // 5 | // SPDX-License-Identifier: BSD-3-Clause 6 | 7 | #pragma once 8 | 9 | // IWYU pragma: private, include "CLI/CLI.hpp" 10 | 11 | // [CLI11:public_includes:set] 12 | #include 13 | #include 14 | #include 15 | // [CLI11:public_includes:end] 16 | 17 | #include "App.hpp" 18 | #include "FormatterFwd.hpp" 19 | 20 | namespace CLI { 21 | // [CLI11:formatter_hpp:verbatim] 22 | // [CLI11:formatter_hpp:end] 23 | } // namespace CLI 24 | 25 | #ifndef CLI11_COMPILE 26 | #include "impl/Formatter_inl.hpp" // IWYU pragma: export 27 | #endif 28 | -------------------------------------------------------------------------------- /contrib/CLI11/include/CLI/Split.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner 2 | // under NSF AWARD 1414736 and by the respective contributors. 3 | // All rights reserved. 4 | // 5 | // SPDX-License-Identifier: BSD-3-Clause 6 | 7 | #pragma once 8 | 9 | // IWYU pragma: private, include "CLI/CLI.hpp" 10 | 11 | // [CLI11:public_includes:set] 12 | #include 13 | #include 14 | #include 15 | #include 16 | // [CLI11:public_includes:end] 17 | 18 | #include "Macros.hpp" 19 | 20 | namespace CLI { 21 | // [CLI11:split_hpp:verbatim] 22 | 23 | namespace detail { 24 | 25 | // Returns false if not a short option. Otherwise, sets opt name and rest and returns true 26 | CLI11_INLINE bool split_short(const std::string ¤t, std::string &name, std::string &rest); 27 | 28 | // Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true 29 | CLI11_INLINE bool split_long(const std::string ¤t, std::string &name, std::string &value); 30 | 31 | // Returns false if not a windows style option. Otherwise, sets opt name and value and returns true 32 | CLI11_INLINE bool split_windows_style(const std::string ¤t, std::string &name, std::string &value); 33 | 34 | // Splits a string into multiple long and short names 35 | CLI11_INLINE std::vector split_names(std::string current); 36 | 37 | /// extract default flag values either {def} or starting with a ! 38 | CLI11_INLINE std::vector> get_default_flag_values(const std::string &str); 39 | 40 | /// Get a vector of short names, one of long names, and a single name 41 | CLI11_INLINE std::tuple, std::vector, std::string> 42 | get_names(const std::vector &input); 43 | 44 | } // namespace detail 45 | // [CLI11:split_hpp:end] 46 | } // namespace CLI 47 | 48 | #ifndef CLI11_COMPILE 49 | #include "impl/Split_inl.hpp" // IWYU pragma: export 50 | #endif 51 | -------------------------------------------------------------------------------- /contrib/CLI11/include/CLI/Version.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner 2 | // under NSF AWARD 1414736 and by the respective contributors. 3 | // All rights reserved. 4 | // 5 | // SPDX-License-Identifier: BSD-3-Clause 6 | 7 | #pragma once 8 | 9 | // IWYU pragma: private, include "CLI/CLI.hpp" 10 | 11 | // [CLI11:version_hpp:verbatim] 12 | 13 | #define CLI11_VERSION_MAJOR 2 14 | #define CLI11_VERSION_MINOR 4 15 | #define CLI11_VERSION_PATCH 2 16 | #define CLI11_VERSION "2.4.2" 17 | 18 | // [CLI11:version_hpp:end] 19 | -------------------------------------------------------------------------------- /contrib/catch2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /contrib/catch2/README.contrib: -------------------------------------------------------------------------------- 1 | Source: https://github.com/catchorg/Catch2 2 | Revision: v2.13.10 3 | -------------------------------------------------------------------------------- /contrib/fmt/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /contrib/fmt/README.contrib: -------------------------------------------------------------------------------- 1 | Source: https://github.com/fmtlib/fmt 2 | Revision: v11.1.2 3 | -------------------------------------------------------------------------------- /contrib/fmt/include/fmt/core.h: -------------------------------------------------------------------------------- 1 | // This file is only provided for compatibility and may be removed in future 2 | // versions. Use fmt/base.h if you don't need fmt::format and fmt/format.h 3 | // otherwise. 4 | 5 | #include "format.h" 6 | -------------------------------------------------------------------------------- /contrib/libosmium/LICENSE: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /contrib/libosmium/README.contrib: -------------------------------------------------------------------------------- 1 | Source: https://github.com/osmcode/libosmium 2 | Revision: v2.22.0 3 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/index/multimap/all.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_INDEX_MULTIMAP_ALL_HPP 2 | #define OSMIUM_INDEX_MULTIMAP_ALL_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | #include // IWYU pragma: keep 37 | #include // IWYU pragma: keep 38 | #include // IWYU pragma: keep 39 | #include // IWYU pragma: keep 40 | 41 | #endif // OSMIUM_INDEX_MULTIMAP_ALL_HPP 42 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/any_compression.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_ANY_COMPRESSION_HPP 2 | #define OSMIUM_IO_ANY_COMPRESSION_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | /** 37 | * @file 38 | * 39 | * Include this file if you want to read or write compressed OSM XML files. 40 | * 41 | * @attention If you include this file, you'll need to link with `libz` 42 | * and `libbz2`. 43 | */ 44 | 45 | #include // IWYU pragma: export 46 | #include // IWYU pragma: export 47 | 48 | #endif // OSMIUM_IO_ANY_COMPRESSION_HPP 49 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/debug_output.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_DEBUG_OUTPUT_HPP 2 | #define OSMIUM_IO_DEBUG_OUTPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | #include // IWYU pragma: export 37 | #include // IWYU pragma: export 38 | 39 | #endif // OSMIUM_IO_DEBUG_OUTPUT_HPP 40 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/ids_output.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_IDS_OUTPUT_HPP 2 | #define OSMIUM_IO_IDS_OUTPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | #include // IWYU pragma: export 37 | #include // IWYU pragma: export 38 | 39 | #endif // OSMIUM_IO_IDS_OUTPUT_HPP 40 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/o5m_input.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_O5M_INPUT_HPP 2 | #define OSMIUM_IO_O5M_INPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | /** 37 | * @file 38 | * 39 | * Include this file if you want to read OSM o5m and o5c files. 40 | */ 41 | 42 | #include // IWYU pragma: export 43 | #include // IWYU pragma: export 44 | 45 | #endif // OSMIUM_IO_O5M_INPUT_HPP 46 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/opl_input.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_OPL_INPUT_HPP 2 | #define OSMIUM_IO_OPL_INPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | /** 37 | * @file 38 | * 39 | * Include this file if you want to read OSM OPL files. 40 | * 41 | */ 42 | 43 | #include // IWYU pragma: export 44 | #include // IWYU pragma: export 45 | 46 | #endif // OSMIUM_IO_OPL_INPUT_HPP 47 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/opl_output.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_OPL_OUTPUT_HPP 2 | #define OSMIUM_IO_OPL_OUTPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | #include // IWYU pragma: export 37 | #include // IWYU pragma: export 38 | 39 | #endif // OSMIUM_IO_OPL_OUTPUT_HPP 40 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/overwrite.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_OVERWRITE_HPP 2 | #define OSMIUM_IO_OVERWRITE_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | #pragma message("Including overwrite.hpp is deprecated, #include instead.") 37 | #include // IWYU pragma: keep 38 | 39 | #endif // OSMIUM_IO_OVERWRITE_HPP 40 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/pbf_input.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_PBF_INPUT_HPP 2 | #define OSMIUM_IO_PBF_INPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | /** 37 | * @file 38 | * 39 | * Include this file if you want to read OSM PBF files. 40 | * 41 | * @attention If you include this file, you'll need to link with 42 | * `libz`, and enable multithreading. 43 | */ 44 | 45 | #include // IWYU pragma: export 46 | #include // IWYU pragma: export 47 | #include // IWYU pragma: export 48 | 49 | #endif // OSMIUM_IO_PBF_INPUT_HPP 50 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/pbf_output.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_PBF_OUTPUT_HPP 2 | #define OSMIUM_IO_PBF_OUTPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | /** 37 | * @file 38 | * 39 | * Include this file if you want to write OSM PBF files. 40 | * 41 | * @attention If you include this file, you'll need to link with 42 | * `libz`, and enable multithreading. 43 | */ 44 | 45 | #include // IWYU pragma: export 46 | #include // IWYU pragma: export 47 | #include // IWYU pragma: export 48 | 49 | #endif // OSMIUM_IO_PBF_OUTPUT_HPP 50 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/xml_input.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_XML_INPUT_HPP 2 | #define OSMIUM_IO_XML_INPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | /** 37 | * @file 38 | * 39 | * Include this file if you want to read OSM XML files. 40 | * 41 | * @attention If you include this file, you'll need to link with 42 | * `libexpat`, and enable multithreading. 43 | */ 44 | 45 | #include // IWYU pragma: export 46 | #include // IWYU pragma: export 47 | 48 | #endif // OSMIUM_IO_XML_INPUT_HPP 49 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/io/xml_output.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_IO_XML_OUTPUT_HPP 2 | #define OSMIUM_IO_XML_OUTPUT_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | /** 37 | * @file 38 | * 39 | * Include this file if you want to write OSM XML files. 40 | * 41 | * @attention If you include this file, you'll need to enable multithreading. 42 | */ 43 | 44 | #include // IWYU pragma: export 45 | #include // IWYU pragma: export 46 | 47 | #endif // OSMIUM_IO_XML_OUTPUT_HPP 48 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/util/compatibility.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_UTIL_COMPATIBILITY_HPP 2 | #define OSMIUM_UTIL_COMPATIBILITY_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | // Set OSMIUM_DEFINE_EXPORT before including any osmium headers to add 37 | // the special attributes to all exception classes. 38 | #ifdef OSMIUM_DEFINE_EXPORT 39 | # ifdef _MSC_VER 40 | # define OSMIUM_EXPORT __declspec(dllexport) 41 | # else 42 | # define OSMIUM_EXPORT __attribute__ ((visibility("default"))) 43 | # endif 44 | #else 45 | # define OSMIUM_EXPORT 46 | #endif 47 | 48 | #endif // OSMIUM_UTIL_COMPATIBILITY_HPP 49 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/util/endian.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_UTIL_ENDIAN_HPP 2 | #define OSMIUM_UTIL_ENDIAN_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | // Windows is only available for little endian architectures 37 | // https://stackoverflow.com/questions/6449468/can-i-safely-assume-that-windows-installations-will-always-be-little-endian 38 | #if defined(__FreeBSD__) || defined(__DragonFly__) 39 | # include 40 | #elif !defined(_WIN32) && !defined(__APPLE__) 41 | # include 42 | #else 43 | # define __LITTLE_ENDIAN 1234 44 | # define __BYTE_ORDER __LITTLE_ENDIAN 45 | #endif 46 | 47 | #endif // OSMIUM_UTIL_ENDIAN_HPP 48 | -------------------------------------------------------------------------------- /contrib/libosmium/include/osmium/version.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OSMIUM_VERSION_HPP 2 | #define OSMIUM_VERSION_HPP 3 | 4 | /* 5 | 6 | This file is part of Osmium (https://osmcode.org/libosmium). 7 | 8 | Copyright 2013-2025 Jochen Topf and others (see README). 9 | 10 | Boost Software License - Version 1.0 - August 17th, 2003 11 | 12 | Permission is hereby granted, free of charge, to any person or organization 13 | obtaining a copy of the software and accompanying documentation covered by 14 | this license (the "Software") to use, reproduce, display, distribute, 15 | execute, and transmit the Software, and to prepare derivative works of the 16 | Software, and to permit third-parties to whom the Software is furnished to 17 | do so, all subject to the following: 18 | 19 | The copyright notices in the Software and this entire statement, including 20 | the above license grant, this restriction and the following disclaimer, 21 | must be included in all copies of the Software, in whole or in part, and 22 | all derivative works of the Software, unless such copies or derivative 23 | works are solely in the form of machine-executable object code generated by 24 | a source language processor. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 29 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 30 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 31 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 32 | DEALINGS IN THE SOFTWARE. 33 | 34 | */ 35 | 36 | // NOLINTNEXTLINE(modernize-macro-to-enum) 37 | #define LIBOSMIUM_VERSION_MAJOR 2 38 | 39 | // NOLINTNEXTLINE(modernize-macro-to-enum) 40 | #define LIBOSMIUM_VERSION_MINOR 22 41 | 42 | // NOLINTNEXTLINE(modernize-macro-to-enum) 43 | #define LIBOSMIUM_VERSION_PATCH 0 44 | 45 | #define LIBOSMIUM_VERSION_STRING "2.22.0" 46 | 47 | #endif // OSMIUM_VERSION_HPP 48 | -------------------------------------------------------------------------------- /contrib/protozero/LICENSE.md: -------------------------------------------------------------------------------- 1 | protozero copyright (c) Mapbox. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in 11 | the documentation and/or other materials provided with the 12 | distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 15 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /contrib/protozero/README.contrib: -------------------------------------------------------------------------------- 1 | Source: https://github.com/mapbox/protozero 2 | Revision: v1.8.0 3 | -------------------------------------------------------------------------------- /contrib/protozero/include/protozero/config.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PROTOZERO_CONFIG_HPP 2 | #define PROTOZERO_CONFIG_HPP 3 | 4 | /***************************************************************************** 5 | 6 | protozero - Minimalistic protocol buffer decoder and encoder in C++. 7 | 8 | This file is from https://github.com/mapbox/protozero where you can find more 9 | documentation. 10 | 11 | *****************************************************************************/ 12 | 13 | #include 14 | 15 | /** 16 | * @file config.hpp 17 | * 18 | * @brief Contains macro checks for different configurations. 19 | */ 20 | 21 | #define PROTOZERO_LITTLE_ENDIAN 1234 22 | #define PROTOZERO_BIG_ENDIAN 4321 23 | 24 | // Find out which byte order the machine has. 25 | #if defined(__BYTE_ORDER) 26 | # if (__BYTE_ORDER == __LITTLE_ENDIAN) 27 | # define PROTOZERO_BYTE_ORDER PROTOZERO_LITTLE_ENDIAN 28 | # endif 29 | # if (__BYTE_ORDER == __BIG_ENDIAN) 30 | # define PROTOZERO_BYTE_ORDER PROTOZERO_BIG_ENDIAN 31 | # endif 32 | #else 33 | // This probably isn't a very good default, but might do until we figure 34 | // out something better. 35 | # define PROTOZERO_BYTE_ORDER PROTOZERO_LITTLE_ENDIAN 36 | #endif 37 | 38 | // Check whether __builtin_bswap is available 39 | #if defined(__GNUC__) || defined(__clang__) 40 | # define PROTOZERO_USE_BUILTIN_BSWAP 41 | #endif 42 | 43 | // Wrapper for assert() used for testing 44 | #ifndef protozero_assert 45 | # define protozero_assert(x) assert(x) 46 | #endif 47 | 48 | #endif // PROTOZERO_CONFIG_HPP 49 | -------------------------------------------------------------------------------- /contrib/protozero/include/protozero/pbf_builder.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PROTOZERO_PBF_BUILDER_HPP 2 | #define PROTOZERO_PBF_BUILDER_HPP 3 | 4 | /***************************************************************************** 5 | 6 | protozero - Minimalistic protocol buffer decoder and encoder in C++. 7 | 8 | This file is from https://github.com/mapbox/protozero where you can find more 9 | documentation. 10 | 11 | *****************************************************************************/ 12 | 13 | /** 14 | * @file pbf_builder.hpp 15 | * 16 | * @brief Contains the pbf_builder template class. 17 | */ 18 | 19 | #include "basic_pbf_builder.hpp" 20 | #include "pbf_writer.hpp" 21 | 22 | #include 23 | 24 | namespace protozero { 25 | 26 | /// Specialization of basic_pbf_builder using std::string as buffer type. 27 | template 28 | using pbf_builder = basic_pbf_builder; 29 | 30 | } // end namespace protozero 31 | 32 | #endif // PROTOZERO_PBF_BUILDER_HPP 33 | -------------------------------------------------------------------------------- /contrib/protozero/include/protozero/types.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PROTOZERO_TYPES_HPP 2 | #define PROTOZERO_TYPES_HPP 3 | 4 | /***************************************************************************** 5 | 6 | protozero - Minimalistic protocol buffer decoder and encoder in C++. 7 | 8 | This file is from https://github.com/mapbox/protozero where you can find more 9 | documentation. 10 | 11 | *****************************************************************************/ 12 | 13 | /** 14 | * @file types.hpp 15 | * 16 | * @brief Contains the declaration of low-level types used in the pbf format. 17 | */ 18 | 19 | #include "config.hpp" 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace protozero { 29 | 30 | /** 31 | * The type used for field tags (field numbers). 32 | */ 33 | using pbf_tag_type = uint32_t; 34 | 35 | /** 36 | * The type used to encode type information. 37 | * See the table on 38 | * https://developers.google.com/protocol-buffers/docs/encoding 39 | */ 40 | enum class pbf_wire_type : uint32_t { 41 | varint = 0, // int32/64, uint32/64, sint32/64, bool, enum 42 | fixed64 = 1, // fixed64, sfixed64, double 43 | length_delimited = 2, // string, bytes, nested messages, packed repeated fields 44 | fixed32 = 5, // fixed32, sfixed32, float 45 | unknown = 99 // used for default setting in this library 46 | }; 47 | 48 | /** 49 | * Get the tag and wire type of the current field in one integer suitable 50 | * for comparison with a switch statement. 51 | * 52 | * See pbf_reader.tag_and_type() for an example how to use this. 53 | */ 54 | template 55 | constexpr uint32_t tag_and_type(T tag, pbf_wire_type wire_type) noexcept { 56 | return (static_cast(static_cast(tag)) << 3U) | static_cast(wire_type); 57 | } 58 | 59 | /** 60 | * The type used for length values, such as the length of a field. 61 | */ 62 | using pbf_length_type = uint32_t; 63 | 64 | } // end namespace protozero 65 | 66 | #endif // PROTOZERO_TYPES_HPP 67 | -------------------------------------------------------------------------------- /contrib/protozero/include/protozero/version.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PROTOZERO_VERSION_HPP 2 | #define PROTOZERO_VERSION_HPP 3 | 4 | /***************************************************************************** 5 | 6 | protozero - Minimalistic protocol buffer decoder and encoder in C++. 7 | 8 | This file is from https://github.com/mapbox/protozero where you can find more 9 | documentation. 10 | 11 | *****************************************************************************/ 12 | 13 | /** 14 | * @file version.hpp 15 | * 16 | * @brief Contains macros defining the protozero version. 17 | */ 18 | 19 | /// The major version number 20 | #define PROTOZERO_VERSION_MAJOR 1 21 | 22 | /// The minor version number 23 | #define PROTOZERO_VERSION_MINOR 7 24 | 25 | /// The patch number 26 | #define PROTOZERO_VERSION_PATCH 1 27 | 28 | /// The complete version number 29 | #define PROTOZERO_VERSION_CODE (PROTOZERO_VERSION_MAJOR * 10000 + PROTOZERO_VERSION_MINOR * 100 + PROTOZERO_VERSION_PATCH) 30 | 31 | /// Version number as string 32 | #define PROTOZERO_VERSION_STRING "1.7.1" 33 | 34 | #endif // PROTOZERO_VERSION_HPP 35 | -------------------------------------------------------------------------------- /flex-config/gen/README.md: -------------------------------------------------------------------------------- 1 | # Flex Output Configuration for Generalization 2 | 3 | These are config file examples for use with the generalization support. 4 | 5 | GENERALIZATION SUPPORT IS EXPERIMENTAL. EVERYTHING IN THIS DIRECTORY MIGHT 6 | CHANGE WITHOUT NOTICE. 7 | 8 | See the [Flex Output](https://osm2pgsql.org/doc/manual.html#the-flex-output) 9 | and [Generalization](https://osm2pgsql.org/doc/manual.html#generalization) 10 | chapters in the manual for all the details. 11 | 12 | ## Public Domain 13 | 14 | All the example config files in this directory are released into the Public 15 | Domain. You may use them in any way you like. 16 | 17 | -------------------------------------------------------------------------------- /flex-config/locator/README.md: -------------------------------------------------------------------------------- 1 | # Flex Output Configuration for Locator 2 | 3 | These are config file examples for use with the *locator* functionality. 4 | 5 | First use the `import-countries.lua` to import country boundaries, then 6 | use these with the other config files. 7 | 8 | You should be able to run this on the planet file or on any extracts you want. 9 | 10 | -------------------------------------------------------------------------------- /flex-config/locator/iceland.lua: -------------------------------------------------------------------------------- 1 | -- This config example file is released into the Public Domain. 2 | 3 | -- This file shows how to use a locator with a bounding box to import only 4 | -- the data for a region. In this case only highways in Iceland are imported 5 | -- even if you run this on the full planet file. 6 | 7 | local iceland = osm2pgsql.define_locator({ name = 'iceland' }) 8 | 9 | iceland:add_bbox('IS', -25.0, 62.0, -12.0, 68.0) 10 | 11 | local highways = osm2pgsql.define_way_table('highways', { 12 | { column = 'hwtype', type = 'text', not_null = true }, 13 | { column = 'name', type = 'text' }, 14 | { column = 'ref', type = 'text' }, 15 | { column = 'geom', type = 'linestring', not_null = true }, 16 | }) 17 | 18 | function osm2pgsql.process_way(object) 19 | local t = object.tags 20 | if t.highway then 21 | local geom = object:as_linestring() 22 | local region = iceland:first_intersecting(geom) 23 | if region then 24 | highways:insert({ 25 | hwtype = t.highway, 26 | name = t.name, 27 | ref = t.ref, 28 | geom = geom, 29 | }) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /flex-config/locator/import-countries.lua: -------------------------------------------------------------------------------- 1 | -- This config example file is released into the Public Domain. 2 | 3 | -- This file is part of the examples for using the locator function of 4 | -- osm2pgsql. It is used to import all country boundaries into a database. 5 | 6 | local countries = osm2pgsql.define_relation_table('countries', { 7 | -- For the ISO3166-1 Alpha-2 country code 8 | -- https://en.wikipedia.org/wiki/ISO_3166-1 9 | { column = 'code', type = 'text', not_null = true }, 10 | -- Because we want to use the geometries for the locator feature they 11 | -- must be in 4326! We use a polygon type here and will later split 12 | -- multipolygons into their parts. 13 | { column = 'geom', type = 'polygon', not_null = true, projection = 4326 }, 14 | }) 15 | 16 | function osm2pgsql.process_relation(object) 17 | local t = object.tags 18 | 19 | if t.boundary == 'administrative' and t.admin_level == '2' then 20 | local code = t['ISO3166-1'] 21 | 22 | -- Ignore entries with syntactically invalid ISO code 23 | if not code or not string.match(code, '^%u%u$') then 24 | return 25 | end 26 | 27 | for geom in object:as_multipolygon():geometries() do 28 | countries:insert({ 29 | code = code, 30 | geom = geom, 31 | }) 32 | end 33 | end 34 | end 35 | 36 | -------------------------------------------------------------------------------- /flex-config/locator/motorway-colours.lua: -------------------------------------------------------------------------------- 1 | -- This config example file is released into the Public Domain. 2 | 3 | -- This file shows how to use a locator to find the country-specific colour 4 | 5 | -- Define the "countries" locator and get all country geometries from the 6 | -- database. Use the import-countries.lua file to import them first, before 7 | -- you run this. 8 | local countries = osm2pgsql.define_locator({ name = 'countries' }) 9 | countries:add_from_db('SELECT code, ST_Subdivide(geom, 200) FROM countries') 10 | 11 | local highways = osm2pgsql.define_way_table('highways', { 12 | { column = 'hwtype', type = 'text' }, 13 | { column = 'country', type = 'text' }, 14 | { column = 'colour', type = 'text' }, 15 | { column = 'geom', type = 'linestring', not_null = true }, 16 | }) 17 | 18 | -- Each country uses their own colour for motorways. Here is the beginning 19 | -- of a list of some countries in Europe. Source: 20 | -- https://en.wikipedia.org/wiki/Comparison_of_European_road_signs 21 | local cc2colour = { 22 | BE = '#2d00e5', 23 | CH = '#128044', 24 | DE = '#174688', 25 | FR = '#333b97', 26 | NL = '#064269', 27 | } 28 | 29 | function osm2pgsql.process_way(object) 30 | if object.tags.highway then 31 | local geom = object:as_linestring() 32 | local cc = countries:first_intersecting(geom) 33 | highways:insert({ 34 | hwtype = object.tags.highway, 35 | country = cc, 36 | colour = cc2colour[cc], 37 | geom = geom, 38 | }) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /flex-config/places.lua: -------------------------------------------------------------------------------- 1 | -- This config example file is released into the Public Domain. 2 | 3 | -- This example shows how you can use JSON and JSONB columns in your database. 4 | 5 | local places = osm2pgsql.define_node_table('places', { 6 | { column = 'tags', type = 'jsonb' }, 7 | { column = 'geom', type = 'point' }, 8 | }) 9 | 10 | local function starts_with(str, start) 11 | return str:sub(1, #start) == start 12 | end 13 | 14 | function osm2pgsql.process_node(object) 15 | if not object.tags.place then 16 | return 17 | end 18 | 19 | -- Put all name:* tags in their own substructure 20 | local names = {} 21 | local has_names = false 22 | for k, v in pairs(object.tags) do 23 | if k == 'name' then 24 | names[''] = v 25 | object.tags.name = nil 26 | has_names = true 27 | elseif starts_with(k, "name:") then 28 | -- extract language 29 | local lang = k:sub(6, -1) 30 | names[lang] = v 31 | object.tags[k] = nil 32 | has_names = true 33 | end 34 | end 35 | 36 | if has_names then 37 | object.tags.names = names 38 | end 39 | 40 | -- The population should be stored as number, not as a string 41 | if object.tags.population then 42 | object.tags.population = tonumber(object.tags.population) 43 | end 44 | 45 | places:insert({ 46 | tags = object.tags, 47 | geom = object:as_point() 48 | }) 49 | end 50 | 51 | -------------------------------------------------------------------------------- /flex-config/unitable.lua: -------------------------------------------------------------------------------- 1 | -- This config example file is released into the Public Domain. 2 | 3 | -- Put all OSM data into a single table 4 | 5 | -- We define a single table that can take any OSM object and any geometry. 6 | -- OSM nodes are converted to Points, ways to LineStrings and relations 7 | -- to GeometryCollections. If an object would create an invalid geometry 8 | -- it is still added to the table with a NULL geometry. 9 | local dtable = osm2pgsql.define_table{ 10 | name = "data", 11 | -- This will generate a column "osm_id INT8" for the id, and a column 12 | -- "osm_type CHAR(1)" for the type of object: N(ode), W(way), R(relation) 13 | ids = { type = 'any', id_column = 'osm_id', type_column = 'osm_type' }, 14 | columns = { 15 | { column = 'attrs', type = 'jsonb' }, 16 | { column = 'tags', type = 'jsonb' }, 17 | { column = 'geom', type = 'geometry' }, 18 | } 19 | } 20 | 21 | -- Helper function to remove some of the tags we usually are not interested in. 22 | -- Returns true if there are no tags left. 23 | local function clean_tags(tags) 24 | tags.odbl = nil 25 | tags.created_by = nil 26 | tags.source = nil 27 | tags['source:ref'] = nil 28 | 29 | return next(tags) == nil 30 | end 31 | 32 | local function process(object, geometry) 33 | if clean_tags(object.tags) then 34 | return 35 | end 36 | dtable:insert({ 37 | attrs = { 38 | version = object.version, 39 | timestamp = object.timestamp, 40 | }, 41 | tags = object.tags, 42 | geom = geometry 43 | }) 44 | end 45 | 46 | function osm2pgsql.process_node(object) 47 | process(object, object:as_point()) 48 | end 49 | 50 | function osm2pgsql.process_way(object) 51 | process(object, object:as_linestring()) 52 | end 53 | 54 | function osm2pgsql.process_relation(object) 55 | process(object, object:as_geometrycollection()) 56 | end 57 | 58 | -------------------------------------------------------------------------------- /flex-config/untagged.lua: -------------------------------------------------------------------------------- 1 | -- This config example file is released into the Public Domain. 2 | -- 3 | -- Most of the time we are only interested in nodes, ways, and relations that 4 | -- have tags. But we can also get the untagged ones if necessary by using 5 | -- the processing functions 'process_untagged_node', 'process_untagged_way', 6 | -- and 'process_untagged_relation', respectively. 7 | 8 | local nodes = osm2pgsql.define_node_table('nodes', { 9 | { column = 'tags', type = 'jsonb' }, 10 | { column = 'geom', type = 'point' }, 11 | }) 12 | 13 | local ways = osm2pgsql.define_way_table('ways', { 14 | { column = 'tags', type = 'jsonb' }, 15 | { column = 'geom', type = 'linestring' }, 16 | }) 17 | 18 | function osm2pgsql.process_node(object) 19 | nodes:insert({ 20 | tags = object.tags, 21 | geom = object:as_point(), 22 | }) 23 | end 24 | 25 | function osm2pgsql.process_untagged_node(object) 26 | nodes:insert({ 27 | geom = object:as_point(), 28 | }) 29 | end 30 | 31 | -- If you want to use the same function in both cases, that's also quite easy. 32 | -- For instance like this: 33 | 34 | local function do_way(object) 35 | ways:insert({ 36 | tags = object.tags, 37 | geom = object:as_linestring(), 38 | }) 39 | end 40 | 41 | osm2pgsql.process_way = do_way 42 | osm2pgsql.process_untagged_way = do_way 43 | 44 | -------------------------------------------------------------------------------- /flex-config/with-schema.lua: -------------------------------------------------------------------------------- 1 | -- This config example file is released into the Public Domain. 2 | 3 | -- This configuration for the flex output shows how to define a table in 4 | -- a PostgreSQL schema. 5 | -- 6 | -- This config file expects that you have a schema called `myschema` in 7 | -- your database (created with something like `CREATE SCHEMA myschema;`). 8 | 9 | local dtable = osm2pgsql.define_way_table('data', { 10 | { column = 'tags', type = 'jsonb' }, 11 | { column = 'geom', type = 'linestring' }, 12 | }, { schema = 'myschema' }) 13 | 14 | function osm2pgsql.process_way(object) 15 | dtable:insert({ 16 | tags = object.tags, 17 | geom = object:as_linestring() 18 | }) 19 | end 20 | 21 | -------------------------------------------------------------------------------- /man/manpage.template: -------------------------------------------------------------------------------- 1 | $if(has-tables)$ 2 | .\"t 3 | $endif$ 4 | .TH "$title$" "$section$" "$version$" "$footer$" "$header$" 5 | $for(header-includes)$ 6 | $header-includes$ 7 | $endfor$ 8 | $for(include-before)$ 9 | $include-before$ 10 | $endfor$ 11 | $body$ 12 | $for(include-after)$ 13 | $include-after$ 14 | $endfor$ 15 | -------------------------------------------------------------------------------- /man/manpage_from_python.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-or-later 2 | # 3 | # This file is part of osm2pgsql (https://osm2pgsql.org/). 4 | # 5 | # Copyright (C) 2006-2025 by the osm2pgsql developer community. 6 | # For a full list of authors see the git log. 7 | """ Create a man page for osm2pgsql helper scripts in python. 8 | """ 9 | from argparse import ArgumentParser, RawDescriptionHelpFormatter 10 | import re 11 | 12 | from build_manpages.manpage import Manpage 13 | from build_manpages.build_manpage import get_parser_from_file 14 | 15 | SEE_ALSO = [ 16 | "osm2pgsql website (https://osm2pgsql.org)", 17 | "osm2pgsql manual (https://osm2pgsql.org/doc/manual.html)" 18 | ] 19 | 20 | def create_manpage_for(args): 21 | """ Create a man page for the given script. 22 | """ 23 | parser = get_parser_from_file(args.script, 'get_parser', 'function') 24 | parser.man_short_description = args.description 25 | parser._manpage = [ 26 | {'heading': 'SEE ALSO', 27 | 'content': '\n'.join(f"* {s}" for s in SEE_ALSO)} 28 | ] 29 | 30 | manpage = str(Manpage(parser)) 31 | manpage = re.sub(r'.TH.*', 32 | f'.TH "{parser.prog.upper()}" "1" "{args.version}" "" ""', 33 | manpage) 34 | manpage = manpage.replace('%(prog)s', parser.prog) 35 | # Correct quoting for single quotes. See groff manpage. 36 | manpage = manpage.replace('`', '\\(cq') 37 | 38 | return manpage 39 | 40 | 41 | if __name__ == "__main__": 42 | parser = ArgumentParser(usage='%(prog)s [options]