Skip to content
Commits on Source (11)
......@@ -6,214 +6,152 @@
language: generic
sudo: false
dist: xenial
dist: trusty
#-----------------------------------------------------------------------------
# Save common build configurations as shortcuts, so we can reference them later.
addons_shortcuts:
addons_clang35: &clang35
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['libboost1.55-all-dev', 'libboost-program-options1.55-dev', 'pandoc', 'clang-3.5']
addons_clang38: &clang38
apt:
packages: ['libboost-all-dev', 'libboost-program-options-dev', 'pandoc', 'clang-3.8']
addons_clang39: &clang39
apt:
packages: ['libboost-all-dev', 'libboost-program-options-dev', 'pandoc', 'clang-3.9']
addons_clang50: &clang50
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libboost-all-dev', 'libboost-program-options-dev', 'pandoc', 'clang-5.0']
addons_clang60: &clang60
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libboost-all-dev', 'libboost-program-options-dev', 'pandoc', 'clang-6.0']
addons_gcc48: &gcc48
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['libboost1.55-all-dev', 'libboost-program-options1.55-dev', 'pandoc', 'g++-4.8', 'gcc-4.8']
addons_gcc49: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['libboost1.55-all-dev', 'libboost-program-options1.55-dev', 'pandoc', 'g++-4.9', 'gcc-4.9']
addons_gcc5: &gcc5
apt:
packages: ['libboost-all-dev', 'libboost-program-options-dev', 'pandoc', 'g++-5', 'gcc-5']
addons_gcc6: &gcc6
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libboost-all-dev', 'libboost-program-options-dev', 'pandoc', 'g++-6', 'gcc-6']
addons_gcc7: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libboost-all-dev', 'libboost-program-options-dev', 'pandoc', 'g++-7', 'gcc-7']
#-----------------------------------------------------------------------------
matrix:
include:
# 1/ Linux Clang Builds
- os: linux
compiler: linux-clang35-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.5', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='clang-3.5' CXX='clang++-3.5' BUILD_TYPE='Release'
# Linux Clang Builds
- os: linux
compiler: linux-clang35-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.5', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
addons: *clang35
env: CC='clang-3.5' CXX='clang++-3.5' BUILD_TYPE='Dev'
- os: linux
compiler: linux-clang38-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.8', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='clang-3.8' CXX='clang++-3.8' BUILD_TYPE='Release'
dist: trusty
- os: linux
compiler: linux-clang38-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.8', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
addons: *clang38
env: CC='clang-3.8' CXX='clang++-3.8' BUILD_TYPE='Dev'
- os: linux
compiler: linux-clang39-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.9', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='clang-3.9' CXX='clang++-3.9' BUILD_TYPE='Release'
- os: linux
compiler: linux-clang39-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.9', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
addons: *clang39
env: CC='clang-3.9' CXX='clang++-3.9' BUILD_TYPE='Dev'
- os: linux
compiler: linux-clang40-release
addons:
apt:
sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-4.0', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='clang-4.0' CXX='clang++-4.0' BUILD_TYPE='Release'
- os: linux
compiler: linux-clang40-dev
addons:
apt:
sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-4.0', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='clang-4.0' CXX='clang++-4.0' BUILD_TYPE='Dev'
- os: linux
compiler: linux-clang50-release
addons:
apt:
sources: ['llvm-toolchain-trusty-5.0', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-5.0', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='clang-5.0' CXX='clang++-5.0' BUILD_TYPE='Release'
- os: linux
compiler: linux-clang50-dev
addons:
apt:
sources: ['llvm-toolchain-trusty-5.0', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-5.0', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
addons: *clang50
env: CC='clang-5.0' CXX='clang++-5.0' BUILD_TYPE='Dev'
# Disabled because it creates false-positives on the old travis systems
# - os: linux
# compiler: linux-clang50-debug
# addons:
# apt:
# sources: ['llvm-toolchain-trusty-5.0', 'ubuntu-toolchain-r-test', 'boost-latest']
# packages: ['clang-5.0', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc', 'g++-6', 'gcc-6']
# env: CC='clang-5.0' CXX='clang++-5.0' BUILD_TYPE='Debug'
- os: linux
compiler: linux-clang60-dev
addons: *clang60
env: CC='clang-6.0' CXX='clang++-6.0' BUILD_TYPE='Dev'
# Disabled, because it is triggered by the rapidjson library
# - os: linux
# compiler: linux-clang60-debug
# addons: *clang60
# env: CC='clang-6.0' CXX='clang++-6.0' BUILD_TYPE='Debug'
# CXXFLAGS="-fsanitize=address,undefined,integer -fno-sanitize-recover=all -fno-omit-frame-pointer"
# LDFLAGS="-fsanitize=address,undefined,integer"
# # LSAN doesn't work on container-based system
# sudo: required
# 2/ Linux GCC Builds
- os: linux
compiler: linux-gcc48-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.8', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-4.8' CXX='g++-4.8' CXXFLAGS='-Wno-return-type' BUILD_TYPE='Release'
compiler: linux-clang60-release
addons: *clang60
env: CC='clang-6.0' CXX='clang++-6.0' BUILD_TYPE='Release'
- os: linux
compiler: linux-gcc48-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.8', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-4.8' CXX='g++-4.8' CXXFLAGS='-Wno-return-type' BUILD_TYPE='Dev'
# Linux GCC Builds
- os: linux
compiler: linux-gcc49-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.9', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-4.9' CXX='g++-4.9' BUILD_TYPE='Release'
compiler: linux-gcc48-dev
addons: *gcc48
env: CC='gcc-4.8' CXX='g++-4.8' CXXFLAGS='-Wno-return-type' BUILD_TYPE='Dev'
dist: trusty
- os: linux
compiler: linux-gcc49-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.9', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
addons: *gcc49
env: CC='gcc-4.9' CXX='g++-4.9' BUILD_TYPE='Dev'
- os: linux
compiler: linux-gcc5-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-5', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-5' CXX='g++-5' BUILD_TYPE='Release'
dist: trusty
- os: linux
compiler: linux-gcc5-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-5', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
addons: *gcc5
env: CC='gcc-5' CXX='g++-5' BUILD_TYPE='Dev'
- os: linux
compiler: linux-gcc6-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-6', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-6' CXX='g++-6' BUILD_TYPE='Release'
- os: linux
compiler: linux-gcc6-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-6', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
addons: *gcc6
env: CC='gcc-6' CXX='g++-6' BUILD_TYPE='Dev'
- os: linux
compiler: linux-gcc7-dev
addons: *gcc7
env: CC='gcc-7' CXX='g++-7' BUILD_TYPE='Dev'
# 3/ OSX Clang Builds
- os: osx
osx_image: xcode6.4
compiler: xcode64-clang-release
env: CXX='clang++' BUILD_TYPE='Release'
- os: linux
compiler: linux-gcc7-release
addons: *gcc7
env: CC='gcc-7' CXX='g++-7' BUILD_TYPE='Release'
- os: osx
osx_image: xcode6.4
compiler: xcode64-clang-dev
env: CXX='clang++' BUILD_TYPE='Dev'
# OSX Clang Builds
- os: osx
osx_image: xcode7
compiler: xcode7-clang-release
env: CXX='clang++' BUILD_TYPE='Release'
osx_image: xcode8.3
compiler: xcode8-clang-dev
env: CXX='clang++' BUILD_TYPE='Dev'
- os: osx
osx_image: xcode7
compiler: xcode7-clang-dev
osx_image: xcode9.4
compiler: xcode9-clang-dev
env: CXX='clang++' BUILD_TYPE='Dev'
- os: osx
osx_image: xcode8.3
compiler: xcode8-clang-release
osx_image: xcode10.1
compiler: xcode10-clang-release
env: CXX='clang++' BUILD_TYPE='Release'
- os: osx
osx_image: xcode8.3
compiler: xcode8-clang-dev
osx_image: xcode10.1
compiler: xcode10-clang-dev
env: CXX='clang++' BUILD_TYPE='Dev'
#-----------------------------------------------------------------------------
......
......@@ -13,6 +13,37 @@ This project adheres to [Semantic Versioning](https://semver.org/).
### Fixed
## [1.10.0] - 2018-12-10
### Added
* The `fileinfo` command now has an `--object-type`/`-t` option like some
other commands.
* Extended `fileinfo` command to show internal buffer counts and sizes.
* Add `--strategy` option to `sort` command. New `multipass` strategy which
reads the input file(s) three times making the sort a bit slower, but also
using less memory.
* New option `--remove-tags`/`-t` to `tags-filter` command. When used the
tags of all objects that are not matching the filter expression but are
included as references are removed.
* New option for smart extract strategy: `complete-partial-relations=X` will
complete all relations with at least X percent of their members already in
the extract.
* New export format "pg" creates a file in the PostgreSQL COPY text format
with the GEOMETRY as WKB and the tags in JSON(B) format. This can be
imported into a PostgreSQL/PostGIS database very quickly.
### Changed
* Show better error message if output directory is missing for `extract`
command.
### Fixed
* Several fixes for the `tags-filter` command which could lead to wrong
results.
## [1.9.1] - 2018-08-18
### Changed
......@@ -444,7 +475,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Minor updates to documentation and build system
[unreleased]: https://github.com/osmcode/osmium-tool/compare/v1.9.1...HEAD
[unreleased]: https://github.com/osmcode/osmium-tool/compare/v1.10.0...HEAD
[1.10.0]: https://github.com/osmcode/osmium-tool/compare/v1.9.1...v1.10.0
[1.9.1]: https://github.com/osmcode/osmium-tool/compare/v1.9.0...v1.9.1
[1.9.0]: https://github.com/osmcode/osmium-tool/compare/v1.8.0...v1.9.0
[1.8.0]: https://github.com/osmcode/osmium-tool/compare/v1.7.1...v1.8.0
......
......@@ -25,8 +25,8 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel;Dev"
project(osmium)
set(OSMIUM_VERSION_MAJOR 1)
set(OSMIUM_VERSION_MINOR 9)
set(OSMIUM_VERSION_PATCH 1)
set(OSMIUM_VERSION_MINOR 10)
set(OSMIUM_VERSION_PATCH 0)
set(OSMIUM_VERSION ${OSMIUM_VERSION_MAJOR}.${OSMIUM_VERSION_MINOR}.${OSMIUM_VERSION_PATCH})
......@@ -44,7 +44,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(Boost 1.55.0 REQUIRED COMPONENTS program_options)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
find_package(Osmium 2.14.2 REQUIRED COMPONENTS io)
find_package(Osmium 2.15.0 REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
......@@ -231,6 +231,7 @@ set(OSMIUM_SOURCE_FILES
util.cpp
command_help.cpp
export/export_format_json.cpp
export/export_format_pg.cpp
export/export_format_text.cpp
export/export_handler.cpp
extract/extract_bbox.cpp
......
......@@ -16,7 +16,7 @@ later are known to work. It also works on modern Visual Studio C++ compilers.
You also need the following libraries:
Libosmium (>= 2.14.2)
Libosmium (>= 2.15.0)
https://osmcode.org/libosmium
Debian/Ubuntu: libosmium2-dev
Fedora/CentOS: libosmium-devel
......@@ -108,10 +108,9 @@ default is RelWithDebInfo.
Please read the CMake documentation and get familiar with the `cmake` and
`ccmake` tools which have many more options.
On Windows you can compile with the Visual Studio C++ compiler using the
batch script `build-local.bat`. This script calls `build-appveyor.bat`
which downloads some precompiled libraries. You can also download and
compile all the prerequisites yourself.
On Windows you can compile with the Visual Studio C++ compiler and nmake.
The necessary dependencies can be installed with [conda](https://conda.io).
See `appveyor.yml` for the necessary commands to compile osmium-tool.
## Documentation
......
......@@ -71,6 +71,9 @@ find_path(OSMIUM_INCLUDE_DIR osmium/version.hpp
# Check libosmium version number
if(Osmium_FIND_VERSION)
if(NOT EXISTS "${OSMIUM_INCLUDE_DIR}/osmium/version.hpp")
message(FATAL_ERROR "Missing ${OSMIUM_INCLUDE_DIR}/osmium/version.hpp. Either your libosmium version is too old, or libosmium wasn't found in the place you said.")
endif()
file(STRINGS "${OSMIUM_INCLUDE_DIR}/osmium/version.hpp" _libosmium_version_define REGEX "#define LIBOSMIUM_VERSION_STRING")
if("${_libosmium_version_define}" MATCHES "#define LIBOSMIUM_VERSION_STRING \"([0-9.]+)\"")
set(_libosmium_version "${CMAKE_MATCH_1}")
......
osmium-tool (1.10.0-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
-- Bas Couwenberg <sebastic@debian.org> Mon, 17 Dec 2018 10:06:15 +0100
osmium-tool (1.10.0-1) unstable; urgency=medium
* New upstream release.
* Drop patches, included upstream.
-- Bas Couwenberg <sebastic@debian.org> Mon, 10 Dec 2018 16:54:26 +0100
osmium-tool (1.9.1-2) unstable; urgency=medium
* Bump Standards-Version to 4.2.1, no changes.
* Add upstream patches to fix FTBFS with libosmium 2.15.0.
(closes: #916109)
* Bump minimum required libosmium2-dev to 2.15.0.
-- Bas Couwenberg <sebastic@debian.org> Mon, 10 Dec 2018 12:20:36 +0100
osmium-tool (1.9.1-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
......
......@@ -9,10 +9,10 @@ Build-Depends: debhelper (>= 9),
libboost-program-options-dev,
libbz2-dev,
libexpat1-dev,
libosmium2-dev (>= 2.14.2),
libosmium2-dev (>= 2.15.0),
pandoc,
zlib1g-dev
Standards-Version: 4.2.0
Standards-Version: 4.2.1
Vcs-Browser: https://salsa.debian.org/debian-gis-team/osmium-tool/
Vcs-Git: https://salsa.debian.org/debian-gis-team/osmium-tool.git -b stretch-backports
Homepage: https://osmcode.org/osmium-tool/
......
{
"directory": "/tmp/",
"directory": "/tmp/foobar",
"extracts": [
{
"output": "dresden.osm.pbf",
......
......@@ -287,6 +287,11 @@ The following output formats are supported:
* `geojsonseq` (alias: `jsonseq`): GeoJSON Text Sequence (RFC8142). Each line
(beginning with a RS (0x1e, record separator) and ending in a linefeed
character) contains one GeoJSON object. Used for streaming GeoJSON.
* `pg`: PostgreSQL COPY text format. One line per object containing the
WGS84 geometry as WKB, the tags in JSON format and, optionally, more columns
for id and attributes. You have to create the table manually, then use the
PostgreSQL COPY command to import the data. Enable verbose output to see
the SQL commands needed to create the table and load the data.
* `text` (alias: `txt`): A simple text format with the geometry in WKT format
followed by the comma-delimited tags. This is mainly intended for debugging
at the moment. THE FORMAT MIGHT CHANGE WITHOUT NOTICE!
......
......@@ -329,6 +329,13 @@ the -S option: "-S types=multipolygon,route". Note that especially boundary
relations can be huge, so if you include them, be aware your result might be
huge.
The **smart** strategy allows another option "-S complete-partial-relations=X".
If this is set, all relations that have more than X percent of their members
already in the extract will have their full set of members in the extract. So
this allows completing almost complete relations. It can be useful for instance
to make sure a boundary relation is complete even if some of it is outside the
polygon used for extraction.
# DIAGNOSTICS
......@@ -352,6 +359,10 @@ strategy used. For the *simple* strategy it will at least be the number of
extracts times the highest node ID used divided by 8. For the *complete_ways*
twice that and for the *smart* strategy a bit more.
If you want to split a large file into many extracts, do this in several
steps. First create several larger extracts and then split them again and
again into smaller pieces.
# EXAMPLES
......
......@@ -72,6 +72,11 @@ This commands reads its input file only once, ie. it can read from STDIN.
-j, --json
: Output in JSON format. Can not be used together with --get.
-t, --object-type=TYPE
: Read only objects of given type (*node*, *way*, *relation*, *changeset*).
By default all types are read. This option can be given multiple times.
This only takes effect if the **--extended** option is also used.
@MAN_COMMON_OPTIONS@
@MAN_PROGRESS_OPTIONS@
@MAN_INPUT_OPTIONS@
......@@ -111,6 +116,9 @@ The following variables are available:
data.maxid.ways - INTEGER
data.maxid.relations - INTEGER
data.maxid.changesets - INTEGER
data.buffers.count - INTEGER
data.buffers.size - INTEGER
data.buffers.capcity - INTEGER
metadata.all_objects.version - BOOL (yes|no)
metadata.all_objects.timestamp - BOOL (yes|no)
metadata.all_objects.changeset - BOOL (yes|no)
......
......@@ -29,7 +29,18 @@ This command works with normal OSM data files, history files, and change files.
This commands reads its input file(s) only once and writes its output file
in one go so it can be streamed, ie. it can read from STDIN and write to
STDOUT.
STDOUT. (Unless the *multipass* strategy is used.)
# OPTIONS
-s, --strategy=STRATEGY
: Sorting strategy. The "simple" strategy reads all input files into memory,
does the sorting and writes everything out. The "multipass" strategy reads
the input files in three passes, one for nodes, one for ways, and one for
relations. After reading all objects of each type, they are sorted and
written out. This is a bit slower than the "simple" strategy, but uses
less memory. The "multi" strategy doesn't work when reading from STDIN.
Default: "simple".
@MAN_COMMON_OPTIONS@
......
......@@ -35,7 +35,7 @@ The command will only work correctly on history files if the
-e FILE, --expressions=FILE
: Read expressions from the specified file, one per line. Empty lines are
ignored. Everything after the comment character (#) is also ignored. The
ignored. Everything after the comment character (#) is also ignored. See
the **FILTER EXPRESSIONS** section for further details.
-i, --invert-match
......@@ -45,6 +45,12 @@ The command will only work correctly on history files if the
: Omit the nodes referenced from matching ways and members referenced from
matching relations.
-t, --remove-tags
: Remove tags from objects that are not matching the filter expression but
are included to complete references (nodes in ways and members of
relations). If an object is both matching the filter and used as a
reference it will keep its tags.
@MAN_COMMON_OPTIONS@
@MAN_PROGRESS_OPTIONS@
@MAN_INPUT_OPTIONS@
......
......@@ -21,6 +21,7 @@
: Allow an existing output file to be overwritten. Normally **osmium** will
refuse to write over an existing file.
--output-header=OPTION
: Add output header option. This option can be given several times. See the
*libosmium manual* for a list of allowed header options.
--output-header=OPTION=VALUE
: Add output header option. This command line option can be used multiple
times for different OPTIONs. See the *libosmium manual* for a list of
available header options.
......@@ -30,8 +30,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <cstdlib>
#include <iostream>
po::options_description Command::add_common_options(bool with_progress) {
po::options_description options("COMMON OPTIONS");
po::options_description Command::add_common_options(const bool with_progress) {
po::options_description options{"COMMON OPTIONS"};
auto opts = options.add_options()
("help,h", "Show usage help")
......@@ -87,7 +87,9 @@ void Command::setup_object_type_nwrc(const boost::program_options::variables_map
} else if (t == "c" || t == "changeset") {
m_osm_entity_bits |= osmium::osm_entity_bits::changeset;
} else {
throw argument_error{std::string{"Unknown object type '"} + t + "' (Allowed are 'node', 'way', 'relation', and 'changeset')."};
throw argument_error{std::string{"Unknown object type '"}
+ t
+ "' (Allowed are 'node', 'way', 'relation', and 'changeset')."};
}
}
} else {
......
......@@ -24,6 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <osmium/io/file.hpp>
#include <osmium/io/header.hpp>
#include <osmium/io/writer_options.hpp>
#include <osmium/osm/entity_bits.hpp>
#include <osmium/util/file.hpp>
......@@ -42,14 +43,6 @@ const char* get_osmium_version() noexcept;
const char* get_osmium_long_version() noexcept;
const char* get_libosmium_version() noexcept;
namespace osmium {
namespace io {
class Header;
} // namespace io
} // namespace osmium
class CommandFactory;
namespace po = boost::program_options;
......
......@@ -27,17 +27,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/index/map/all.hpp>
namespace osmium {
namespace io {
class Reader;
class Writer;
} // namespace io
class ProgressBar;
} // namespace osmium
#include <osmium/io/reader.hpp>
#include <osmium/io/writer.hpp>
#include <osmium/util/progress_bar.hpp>
#include <string>
#include <vector>
......@@ -47,12 +39,12 @@ using location_handler_type = osmium::handler::NodeLocationsForWays<index_type>;
class CommandAddLocationsToWays : public Command, public with_multiple_osm_inputs, public with_osm_output {
void copy_data(osmium::ProgressBar& progress_bar, osmium::io::Reader& reader, osmium::io::Writer& writer, location_handler_type& location_handler);
std::string m_index_type_name;
bool m_keep_untagged_nodes = false;
bool m_ignore_missing_nodes = false;
void copy_data(osmium::ProgressBar& progress_bar, osmium::io::Reader& reader, osmium::io::Writer& writer, location_handler_type& location_handler);
public:
explicit CommandAddLocationsToWays(const CommandFactory& command_factory) :
......
......@@ -34,17 +34,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
class CommandChangesetFilter : public Command, public with_single_osm_input, public with_osm_output {
std::string m_user;
osmium::Box m_box;
osmium::Timestamp m_after = osmium::start_of_time();
osmium::Timestamp m_before = osmium::end_of_time();
osmium::user_id_type m_uid = 0;
bool m_with_discussion = false;
bool m_without_discussion = false;
bool m_with_changes = false;
bool m_without_changes = false;
bool m_open = false;
bool m_closed = false;
osmium::user_id_type m_uid = 0;
std::string m_user;
osmium::Timestamp m_after = osmium::start_of_time();
osmium::Timestamp m_before = osmium::end_of_time();
osmium::Box m_box;
public:
......
......@@ -25,17 +25,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "cmd.hpp" // IWYU pragma: export
#include <osmium/io/writer.hpp>
#include <osmium/memory/buffer.hpp>
namespace osmium {
namespace io {
class Writer;
} // namespace io
class OSMObject;
} // namespace osmium
#include <osmium/osm/object.hpp>
#include <string>
#include <vector>
......
......@@ -25,6 +25,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "util.hpp"
#include "export/export_format_json.hpp"
#include "export/export_format_pg.hpp"
#include "export/export_format_text.hpp"
#include "export/export_handler.hpp"
......@@ -195,7 +196,7 @@ void CommandExport::parse_config_file() {
void CommandExport::canonicalize_output_format() {
for (auto& c : m_output_format) {
c = std::tolower(c);
c = static_cast<char>(std::tolower(c));
}
if (m_output_format == "json") {
......@@ -365,8 +366,8 @@ bool CommandExport::setup(const std::vector<std::string>& arguments) {
canonicalize_output_format();
if (m_output_format != "geojson" && m_output_format != "geojsonseq" && m_output_format != "text") {
throw argument_error{"Set output format with --output-format or -f to 'geojson', 'geojsonseq', or 'text'."};
if (m_output_format != "geojson" && m_output_format != "geojsonseq" && m_output_format != "pg" && m_output_format != "text") {
throw argument_error{"Set output format with --output-format or -f to 'geojson', 'geojsonseq', 'pg', or 'text'."};
}
if (vm.count("overwrite")) {
......@@ -490,6 +491,10 @@ static std::unique_ptr<ExportFormat> create_handler(const std::string& output_fo
return std::unique_ptr<ExportFormat>{new ExportFormatJSON{output_format, output_filename, overwrite, fsync, options}};
}
if (output_format == "pg") {
return std::unique_ptr<ExportFormat>{new ExportFormatPg{output_format, output_filename, overwrite, fsync, options}};
}
if (output_format == "text") {
return std::unique_ptr<ExportFormat>{new ExportFormatText{output_format, output_filename, overwrite, fsync, options}};
}
......@@ -511,6 +516,10 @@ bool CommandExport::run() {
m_area_ruleset.init_filter();
auto handler = create_handler(m_output_format, m_output_filename, m_output_overwrite, m_fsync, m_options);
if (m_vout.verbose()) {
handler->debug_output(m_vout, m_output_filename);
}
ExportHandler export_handler{std::move(handler), m_linear_ruleset, m_area_ruleset, m_geometry_types, m_show_errors, m_stop_on_error};
osmium::handler::CheckOrder check_order_handler;
......