Skip to content
Commits on Source (14)
---
Checks: '*,-android-cloexec-*,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-google-runtime-references,-hicpp-no-array-decay,-hicpp-vararg,-modernize-make-unique,-readability-implicit-bool-cast,-readability-implicit-bool-conversion'
#
# For a list of check options, see:
# http://clang.llvm.org/extra/clang-tidy/checks/list.html
#
# Disabled checks:
#
# android-cloexec-*
# O_CLOEXEC isn't available on Windows making this non-portable.
#
# cppcoreguidelines-owning-memory
# Don't want to add dependency on gsl library.
#
# cppcoreguidelines-pro-bounds-array-to-pointer-decay
# Limited use and many false positives including for all asserts.
#
# cppcoreguidelines-pro-bounds-pointer-arithmetic
# Difficult to get by without it...
#
# cppcoreguidelines-pro-type-static-cast-downcast
# This is needed and totally okay if we are sure about the types.
#
# cppcoreguidelines-pro-type-vararg
# We need some of these functions at least and for some functions it isn't
# even clear that those are vararg functions.
#
# fuchsia-*
# Much too strict.
#
# google-runtime-references
# This is just a matter of preference.
#
# hicpp-no-array-decay
# Alias for cppcoreguidelines-pro-bounds-array-to-pointer-decay.
#
# hicpp-vararg
# Too strict, sometimes calling vararg functions is necessary.
#
# modernize-make-unique
# This is a C++11 program and C++ doesn't have std::make_unique.
#
# readability-implicit-bool-cast
# Old name for readability-implicit-bool-conversion.
#
# readability-implicit-bool-conversion
# I don't think this makes the code more readable.
#
#WarningsAsErrors: '*'
...
......@@ -8,18 +8,7 @@ language: generic
sudo: false
# http://docs.travis-ci.com/user/apt/
addons:
apt:
sources:
- boost-latest
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- gcc-4.8
- libboost1.55-dev
- libboost-program-options1.55-dev
- pandoc
dist: trusty
#-----------------------------------------------------------------------------
......@@ -31,51 +20,98 @@ matrix:
compiler: linux-clang35-release
addons:
apt:
sources: ['llvm-toolchain-precise-3.5', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.5', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='clang++-3.5' BUILD_TYPE='Release'
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'
- os: linux
compiler: linux-clang35-dev
addons:
apt:
sources: ['llvm-toolchain-precise-3.5', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.5', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='clang++-3.5' BUILD_TYPE='Dev'
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='Dev'
- os: linux
compiler: linux-clang37-release
compiler: linux-clang38-release
addons:
apt:
sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.7', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='clang++-3.7' BUILD_TYPE='Release'
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'
- os: linux
compiler: linux-clang37-dev
compiler: linux-clang38-dev
addons:
apt:
sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.7', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='clang++-3.7' BUILD_TYPE='Dev'
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='Dev'
- os: linux
compiler: linux-clang38-release
compiler: linux-clang39-release
addons:
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.8', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
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-clang38-dev
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']
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-precise-3.8', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.8', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='clang++-3.8' BUILD_TYPE='Dev'
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='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'
# 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
......@@ -84,16 +120,16 @@ matrix:
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.8', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='g++-4.8' COMPILER_FLAGS='-Wno-return-type' BUILD_TYPE='Release'
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'
- os: linux
compiler: linux-gcc48-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.8', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='g++-4.8' COMPILER_FLAGS='-Wno-return-type' BUILD_TYPE='Dev'
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'
- os: linux
......@@ -101,16 +137,16 @@ matrix:
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.9', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='g++-4.9' BUILD_TYPE='Release'
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'
- os: linux
compiler: linux-gcc49-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.9', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='g++-4.9' BUILD_TYPE='Dev'
packages: ['g++-4.9', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-4.9' CXX='g++-4.9' BUILD_TYPE='Dev'
- os: linux
......@@ -118,16 +154,16 @@ matrix:
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-5', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='g++-5' BUILD_TYPE='Release'
packages: ['g++-5', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-5' CXX='g++-5' BUILD_TYPE='Release'
- os: linux
compiler: linux-gcc5-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-5', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='g++-5' BUILD_TYPE='Dev'
packages: ['g++-5', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-5' CXX='g++-5' BUILD_TYPE='Dev'
- os: linux
......@@ -135,55 +171,56 @@ matrix:
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-6', 'libboost1.55-all-dev', 'pandoc']
env: COMPILER='g++-6' BUILD_TYPE='Release'
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-all-dev', 'pandoc']
env: COMPILER='g++-6' BUILD_TYPE='Dev'
packages: ['g++-6', 'libboost1.55-dev', 'libboost-program-options1.55-dev', 'pandoc']
env: CC='gcc-6' CXX='g++-6' BUILD_TYPE='Dev'
# 3/ OSX Clang Builds
- os: osx
osx_image: xcode6.4
compiler: xcode64-clang-release
env: COMPILER='clang++' BUILD_TYPE='Release'
env: CXX='clang++' BUILD_TYPE='Release'
- os: osx
osx_image: xcode6.4
compiler: xcode64-clang-dev
env: COMPILER='clang++' BUILD_TYPE='Dev'
env: CXX='clang++' BUILD_TYPE='Dev'
- os: osx
osx_image: xcode7
compiler: xcode7-clang-release
env: COMPILER='clang++' BUILD_TYPE='Release'
env: CXX='clang++' BUILD_TYPE='Release'
- os: osx
osx_image: xcode7
compiler: xcode7-clang-dev
env: COMPILER='clang++' BUILD_TYPE='Dev'
env: CXX='clang++' BUILD_TYPE='Dev'
- os: osx
osx_image: xcode8
osx_image: xcode8.3
compiler: xcode8-clang-release
env: COMPILER='clang++' BUILD_TYPE='Release'
env: CXX='clang++' BUILD_TYPE='Release'
- os: osx
osx_image: xcode8
osx_image: xcode8.3
compiler: xcode8-clang-dev
env: COMPILER='clang++' BUILD_TYPE='Dev'
env: CXX='clang++' BUILD_TYPE='Dev'
#-----------------------------------------------------------------------------
install:
- git clone --quiet --depth 1 https://github.com/osmcode/libosmium.git ../libosmium
- git clone --quiet --depth 1 https://github.com/mapbox/protozero.git ../protozero
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew install cmake boost || true
......@@ -193,7 +230,7 @@ install:
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir build && cd build
- CXX=${COMPILER} CXXFLAGS=${COMPILER_FLAGS} cmake -LA .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- cmake -LA .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
script:
- make VERBOSE=1 && ctest --output-on-failure
......
......@@ -2,7 +2,7 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
This project adheres to [Semantic Versioning](https://semver.org/).
## [unreleased] -
......@@ -13,6 +13,49 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
## [1.8.0] - 2018-03-31
### Added
* Support for negative IDs in export command.
* Lots of tests with missing metadata (Thanks to Michael Reichert).
* Add metadata options to the extended output of fileinfo command (Thanks to
Michael Reichert).
* Add progress bars to many commands.
* Add `--redact` option to the `apply-changes` command to redact (patch)
history files. The change files can contain any version of any object which
will replace that version of that object from the input. This allows changing
the history! This mode is for special use only, for instance to remove
copyrighted or private data.
### Changed
- Needs libosmium 2.14.0.
* Update included `catch.hpp` to version 1.12.1.
* Removed Makefile. Undocumented and possibly confusing way of building.
As documented, use CMake directly instead.
* Allow bbox setting with any two opposing corners, instead of insisting on
bottom-left and top-right corner. This affects the changeset-filter and
extract commands.
* Allow GeoJSON input file to have a FeatureCollection instead of a Feature.
Only the first feature of this collection is used.
### Fixed
* Bug in the derive-changes command if it is used without `--keep-details`.
A deletion of any type of object was written as a deletion of a node.
(Thanks to Michael Reichert.)
* Fix assertion failure in diff command.
* Throw exception instead of using assert to catch broken rings.
* Disable progress bar if STDOUT isn't a tty.
* Show error when there are no extracts specified in extract command.
* Improve STDIN handling in extract command. STDIN can now be used with the
`simple` strategy, with other strategies it will give you a nice error
message.
* Lots of code cleanups based on `clang-tidy` warnings making the code more
robust.
* Only install manpage directories, not CMake files. (Thanks Bas Couwenberg.)
## [1.7.1] - 2017-08-25
### Added
......@@ -335,7 +378,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Minor updates to documentation and build system
[unreleased]: https://github.com/osmcode/osmium-tool/compare/v1.7.1...HEAD
[unreleased]: https://github.com/osmcode/osmium-tool/compare/v1.8.0...HEAD
[1.8.0]: https://github.com/osmcode/osmium-tool/compare/v1.7.1...v1.8.0
[1.7.1]: https://github.com/osmcode/osmium-tool/compare/v1.7.0...v1.7.1
[1.7.0]: https://github.com/osmcode/osmium-tool/compare/v1.6.1...v1.7.0
[1.6.1]: https://github.com/osmcode/osmium-tool/compare/v1.6.0...v1.6.1
......
......@@ -25,8 +25,8 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel;Dev"
project(osmium)
set(OSMIUM_VERSION_MAJOR 1)
set(OSMIUM_VERSION_MINOR 7)
set(OSMIUM_VERSION_PATCH 1)
set(OSMIUM_VERSION_MINOR 8)
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.13.1 REQUIRED COMPONENTS io)
find_package(Osmium 2.14.0 REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
......@@ -73,7 +73,7 @@ endif()
#-----------------------------------------------------------------------------
#
# Optional "iwyu" target to check headers
# http://include-what-you-use.org/
# https://include-what-you-use.org/
#
#-----------------------------------------------------------------------------
find_program(IWYU_TOOL NAMES iwyu_tool iwyu_tool.py)
......@@ -199,6 +199,59 @@ configure_file(
include_directories(SYSTEM include)
include_directories(${PROJECT_BINARY_DIR}/src)
#-----------------------------------------------------------------------------
SET(OSMIUM_COMMANDS
add-locations-to-ways
apply-changes
cat
changeset-filter
check-refs
derive-changes
diff
export
extract
fileinfo
getid
merge
merge-changes
renumber
show
sort
tags-filter
time-filter
)
set(OSMIUM_SOURCE_FILES
cmd.cpp
cmd_factory.cpp
io.cpp
util.cpp
command_help.cpp
export/export_format_json.cpp
export/export_format_text.cpp
export/export_handler.cpp
extract/extract_bbox.cpp
extract/extract.cpp
extract/extract_polygon.cpp
extract/geojson_file_parser.cpp
extract/osm_file_parser.cpp
extract/poly_file_parser.cpp
extract/strategy_complete_ways.cpp
extract/strategy_complete_ways_with_history.cpp
extract/strategy_simple.cpp
extract/strategy_smart.cpp
)
foreach(_command ${OSMIUM_COMMANDS})
string(REPLACE "-" "_" _ucmd ${_command})
list(APPEND OSMIUM_SOURCE_FILES "command_${_ucmd}.cpp")
endforeach()
add_subdirectory(man)
add_subdirectory(src)
#-----------------------------------------------------------------------------
#
# Tests
......@@ -209,9 +262,44 @@ enable_testing()
add_subdirectory(test)
#-----------------------------------------------------------------------------
#
# Optional "clang-tidy" target
#
#-----------------------------------------------------------------------------
message(STATUS "Looking for clang-tidy")
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-6.0 clang-tidy-5.0)
add_subdirectory(man)
add_subdirectory(src)
if(CLANG_TIDY)
message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
file(GLOB _unit_tests RELATIVE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/test/*/*.cpp")
add_custom_target(clang-tidy
${CLANG_TIDY}
-p ${CMAKE_BINARY_DIR}
${OSMIUM_SOURCE_FILES} ${_unit_tests}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src"
)
else()
message(STATUS "Looking for clang-tidy - not found")
message(STATUS " Build target 'clang-tidy' will not be available.")
endif()
#-----------------------------------------------------------------------------
#
# Test install
#
# Does a local install and checks that the files we expect to be installed
# are installed and no extra files are installed. If this fails make sure
# the list of files in cmake/test_install.cmake is correct. Only enables
# if the WITH_EXTRA_TESTS option is set, because this test fails on some
# platforms even if everything is correct.
#
#-----------------------------------------------------------------------------
option(WITH_EXTRA_TESTS "Run extra tests (usually only for developers)")
if(WITH_EXTRA_TESTS)
add_test(NAME testinstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/test_install.cmake)
endif()
#-----------------------------------------------------------------------------
......@@ -8,7 +8,8 @@ Some rules for contributing to this project:
If you are reporting a problem:
* Describe exactly what you did, what you expected to happen and what did happen
instead. Include relevant information about the platform, OS version etc. you
are using. Include shell commands you typed in, log files, errors messages etc.
* Describe exactly what you were trying to achieve, what you did, what you
expected to happen and what did happen instead. Include relevant information
about the platform, OS version etc. you are using. Include shell commands you
typed in, log files, errors messages etc.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://www.fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
......@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
......@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
all:
mkdir -p build && cd build && cmake .. && $(MAKE)
clean:
if test -d build; then cd build && $(MAKE) clean; fi
distclean:
rm -fr build
deb:
debuild -I -us -uc
test:
cd build && ctest
.PHONY: clean distclean deb test
......@@ -16,24 +16,23 @@ later are known to work. It also works on modern Visual Studio C++ compilers.
You also need the following libraries:
Libosmium (>= 2.13.1)
Libosmium (>= 2.14.0)
http://osmcode.org/libosmium
Debian/Ubuntu: libosmium2-dev
Fedora/CentOS: libosmium-devel
Protozero (>= 1.5.1)
This is included in the libosmium repository and might or might not
have been installed with it. See the libosmium README.
https://github.com/mapbox/protozero
Debian/Ubuntu: protozero
Fedora: protozero-devel
Debian/Ubuntu: libprotozero-dev
Fedora/CentOS: protozero-devel
Utfcpp
This is included in the libosmium repository and might or might not
have been installed with it. See the libosmium README.
http://utfcpp.sourceforge.net/
Debian/Ubuntu: libutfcpp-dev
Fedora/CentOS: utf8cpp-devel
openSUSE: utfcpp
Fedora: utf8cpp-devel
RapidJSON (>= 1.1)
This is included in the osmium-tool repository, so you usually do
......@@ -44,62 +43,89 @@ You also need the following libraries:
boost-program-options (>= 1.55)
http://www.boost.org/doc/libs/1_55_0/doc/html/program_options.html
Debian/Ubuntu: libboost-program-options-dev
Fedora/CentOS: boost-devel
openSUSE: boost
boost-crc
http://www.boost.org/doc/libs/1_55_0/libs/crc/
Debian/Ubuntu: libboost-dev
Fedora/CentOS: boost-devel
openSUSE: boost
bz2lib
http://www.bzip.org/
Debian/Ubuntu: libbz2-dev
Fedora: bzip2-devel
CentOS: bzip2-devel
Fedora/CentOS: bzip2-devel
openSUSE: bzip2
zlib
http://www.zlib.net/
https://www.zlib.net/
Debian/Ubuntu: zlib1g-dev
Fedora/CentOS: zlib-devel
openSUSE: zlib-devel
Fedora: zlib-devel
CentOS: zlib-devel
Expat
http://expat.sourceforge.net/
https://libexpat.github.io/
Debian/Ubuntu: libexpat1-dev
openSUSE: libexpat-devel
Fedora: expat-devel
CentOS: expat-devel
Fedora/CentOS: expat-devel
cmake
http://www.cmake.org/
https://cmake.org/
Debian/Ubuntu: cmake
Fedora/CentOS: cmake
openSUSE: cmake
Fedora: cmake
Pandoc
(Needed to build documentation, optional)
http://johnmacfarlane.net/pandoc/
http://pandoc.org/
Debian/Ubuntu: pandoc
Fedora/CentOS: pandoc
openSUSE: pandoc
Fedora: pandoc
On Linux systems most of these libraries are available through your package
manager, see the list above for the names of the packages. But make sure to
check the versions. If the packaged version available is not new enough, you'll
have to install from source. Most likely this is the case for Protozero and
Libosmium.
## Building
On macOS many of the libraries above will be available through Homebrew.
Osmium uses CMake for its builds. For Unix/Linux systems a simple Makefile
wrapper is provided to make the build even easier. Just type `make` to compile.
Results will be in the `build` directory.
When building the tool, CMake will automatically look for these libraries in
the usual places on your system. In addition it will look for the Libosmium and
Protozero libraries in the same directory where this Osmium repository is. So
if you are building from the Git repository and want to use the newest
Libosmium, Protozero, and Osmium, clone all of them into the same directory:
Or you can go the long route explicitly calling CMake as follows:
mkdir work
cd work
git clone https://github.com/mapbox/protozero
git clone https://github.com/osmcode/libosmium
git clone https://github.com/osmcode/osmium-tool
## Building
Osmium uses CMake for its builds. On Linux and macOS you can build as follows:
mkdir build
cd build
cmake ..
ccmake . ## optional: change CMake settings if needed
make
To set the build type call cmake with `-DCMAKE_BUILD_TYPE=type`. Possible
values are empty, Debug, Release, RelWithDebInfo, MinSizeRel, and Dev. The
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.
## Documentation
......@@ -121,7 +147,7 @@ More extensive tests of the libosmium I/O system can also be run. See
## License
Copyright (C) 2013-2017 Jochen Topf (jochen@topf.org)
Copyright (C) 2013-2018 Jochen Topf (jochen@topf.org)
This program is available under the GNU GENERAL PUBLIC LICENSE Version 3.
See the file LICENSE.txt for the complete text of the license.
......
......@@ -6,22 +6,28 @@
environment:
matrix:
- config: Dev
- config: RelWithDebInfo
- config: Debug
- config: Release
shallow_clone: true
# Operating system (build VM template)
os: Visual Studio 2015
platform: x64
# scripts that are called at very beginning, before repo cloning
init:
# clone directory
clone_folder: c:\projects\osmium-tool
platform: x64
install:
- cd c:\projects
- git clone --depth 1 https://github.com/osmcode/libosmium
- git clone --depth 1 https://github.com/mapbox/protozero
build_script:
- cd c:\projects/osmium-tool
- build-appveyor.bat
......@@ -4,63 +4,33 @@ SET EL=0
ECHO ~~~~~~ %~f0 ~~~~~~
SET CUSTOM_CMAKE=cmake-3.6.2-win64-x64
::show all available env vars
SET
ECHO cmake on AppVeyor
cmake -version
ECHO activating VS cmd prompt && CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET otdir=%CD%
SET PATH=%otdir%\%CUSTOM_CMAKE%\bin;%PATH%
SET LODEPSDIR=%otdir%\libosmium-deps
::libexpat.dll
SET PATH=%LODEPSDIR%\expat\lib;%PATH%
::zlibwapi.dll
SET PATH=%LODEPSDIR%\zlib\lib;%PATH%
::convert backslashes in bzip2 path to forward slashes
::cmake cannot find it otherwise
SET LIBBZIP2=%LODEPSDIR%\bzip2\lib\libbz2.lib
SET LIBBZIP2=%LIBBZIP2:\=/%
IF NOT EXIST cm.7z ECHO downloading cmake... && powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/%CUSTOM_CMAKE%.7z -OutFile cm.7z
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CD ..
IF NOT EXIST lodeps.7z ECHO downloading binary dependencies... && powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/libosmium-deps-win-14.0-x64.7z -OutFile lodeps.7z
nuget install expat.v140 -Version 2.2.5
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT EXIST %CUSTOM_CMAKE% ECHO extracting cmake... && 7z x cm.7z | %windir%\system32\find "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=C:/projects/expat.v140.2.2.5/build/native/bin/x64/%config%;%PATH%
IF NOT EXIST %LODEPSDIR% ECHO extracting binary dependencies... && 7z x lodeps.7z | %windir%\system32\find "ing archive"
nuget install zlib-vc140-static-64 -Version 1.2.11
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO %LODEPSDIR%
DIR %LODEPSDIR%
::TREE %LODEPSDIR%
::powershell (Get-ChildItem $env:LODEPSDIR\boost\lib -Filter *boost*.dll)[0].BaseName.split('_')[-1]
FOR /F "tokens=1 usebackq" %%i in (`powershell ^(Get-ChildItem %LODEPSDIR%\boost\lib -Filter *boost*.dll^)[0].BaseName.split^('_'^)[-1]`) DO SET BOOST_VERSION=%%i
nuget install bzip2.v140 -Version 1.0.6.9
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO BOOST_VERSION^: %BOOST_VERSION%
SET PATH=C:/projects/bzip2.v140.1.0.6.9/build/native/bin/x64/%config%;%PATH%
ECHO our own cmake
cmake -version
CD osmium-tool
CD %otdir%\..
ECHO config^: %config%
IF NOT EXIST libosmium ECHO cloning libosmium && git clone --depth 1 https://github.com/osmcode/libosmium.git
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CD libosmium
git fetch
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
git pull
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET libpostfix=""
IF "%config%"=="Debug" SET libpostfix="d"
CD %otdir%
IF EXIST build ECHO deleting build dir... && RD /Q /S build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
......@@ -68,19 +38,18 @@ MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CD build
ECHO config^: %config%
SET CMAKE_CMD=cmake .. -LA -G "Visual Studio 14 Win64" ^
-DOsmium_DEBUG=TRUE ^
-DCMAKE_BUILD_TYPE=%config% ^
-DBOOST_ROOT=%LODEPSDIR%\boost ^
-DBoost_PROGRAM_OPTIONS_LIBRARY=%LODEPSDIR%\boost\lib\libboost_program_options-vc140-mt-1_%BOOST_VERSION%.lib ^
-DZLIB_LIBRARY=%LODEPSDIR%\zlib\lib\zlibwapi.lib ^
-DZLIB_INCLUDE_DIR=%LODEPSDIR%\zlib\include ^
-DEXPAT_LIBRARY=%LODEPSDIR%\expat\lib\libexpat.lib ^
-DEXPAT_INCLUDE_DIR=%LODEPSDIR%\expat\include ^
-DBZIP2_LIBRARIES=%LIBBZIP2% ^
-DBZIP2_INCLUDE_DIR=%LODEPSDIR%\bzip2\include
-DBOOST_ROOT=C:/Libraries/boost_1_63_0 ^
-DZLIB_INCLUDE_DIR=C:/projects/zlib-vc140-static-64.1.2.11/lib/native/include ^
-DZLIB_LIBRARY=C:/projects/zlib-vc140-static-64.1.2.11/lib/native/libs/x64/static/%config%/zlibstatic.lib ^
-DEXPAT_INCLUDE_DIR=C:/projects/expat.v140.2.2.5/build/native/include ^
-DEXPAT_LIBRARY=C:/projects/expat.v140.2.2.5/build/native/lib/x64/%config%/libexpat%libpostfix%.lib ^
-DBZIP2_INCLUDE_DIR=C:/projects/bzip2.v140.1.0.6.9/build/native/include ^
-DBZIP2_LIBRARIES=C:/projects/bzip2.v140.1.0.6.9/build/native/lib/x64/%config%/libbz2%libpostfix%.lib ^
-DBoost_USE_STATIC_LIBS=ON
ECHO calling^: %CMAKE_CMD%
%CMAKE_CMD%
......@@ -96,7 +65,6 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ctest --output-on-failure -C %config%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
GOTO DONE
:ERROR
......
......@@ -6,11 +6,11 @@ ECHO ~~~~~~ %~f0 ~~~~~~
ECHO.
ECHO build-local ["config=Dev"]
ECHO default config^: RelWithDebInfo
ECHO default config^: Release
ECHO.
SET platform=x64
SET config=RelWithDebInfo
SET config=Release
:: OVERRIDE PARAMETERS >>>>>>>>
:NEXT-ARG
......@@ -24,9 +24,6 @@ GOTO NEXT-ARG
:ARGS-DONE
::<<<<< OVERRIDE PARAMETERS
WHERE 7z
IF %ERRORLEVEL% NEQ 0 ECHO 7zip not on PATH && GOTO ERROR
CALL build-appveyor.bat
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
......
......@@ -54,8 +54,7 @@
#
#----------------------------------------------------------------------
# This is the list of directories where we look for osmium and protozero
# includes.
# This is the list of directories where we look for osmium includes.
set(_osmium_include_path
../libosmium
~/Library/Frameworks
......@@ -112,29 +111,14 @@ endif()
if(Osmium_USE_PBF)
find_package(ZLIB)
find_package(Threads)
message(STATUS "Looking for protozero")
find_path(PROTOZERO_INCLUDE_DIR protozero/version.hpp
PATH_SUFFIXES include
PATHS ${_osmium_include_path}
${OSMIUM_INCLUDE_DIR}
)
if(PROTOZERO_INCLUDE_DIR)
message(STATUS "Looking for protozero - found")
else()
message(STATUS "Looking for protozero - not found")
endif()
find_package(Protozero 1.5.1)
list(APPEND OSMIUM_EXTRA_FIND_VARS ZLIB_FOUND Threads_FOUND PROTOZERO_INCLUDE_DIR)
if(ZLIB_FOUND AND Threads_FOUND AND PROTOZERO_INCLUDE_DIR)
if(ZLIB_FOUND AND Threads_FOUND AND PROTOZERO_FOUND)
list(APPEND OSMIUM_PBF_LIBRARIES
${ZLIB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
if(WIN32)
# This is needed for the ntohl() function
list(APPEND OSMIUM_PBF_LIBRARIES ws2_32)
endif()
list(APPEND OSMIUM_INCLUDE_DIRS
${ZLIB_INCLUDE_DIR}
${PROTOZERO_INCLUDE_DIR}
......@@ -361,10 +345,10 @@ endif()
set(OSMIUM_DRACONIC_CLANG_OPTIONS "-Wdocumentation -Wunused-exception-parameter -Wmissing-declarations -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-unused-macros -Wno-exit-time-destructors -Wno-global-constructors -Wno-padded -Wno-switch-enum -Wno-missing-prototypes -Wno-weak-vtables -Wno-cast-align -Wno-float-equal")
if(Osmium_DEBUG)
message(STATUS "OSMIUM_XML_LIBRARIES=" ${OSMIUM_XML_LIBRARIES})
message(STATUS "OSMIUM_PBF_LIBRARIES=" ${OSMIUM_PBF_LIBRARIES})
message(STATUS "OSMIUM_IO_LIBRARIES=" ${OSMIUM_IO_LIBRARIES})
message(STATUS "OSMIUM_LIBRARIES=" ${OSMIUM_LIBRARIES})
message(STATUS "OSMIUM_INCLUDE_DIRS=" ${OSMIUM_INCLUDE_DIRS})
message(STATUS "OSMIUM_XML_LIBRARIES=${OSMIUM_XML_LIBRARIES}")
message(STATUS "OSMIUM_PBF_LIBRARIES=${OSMIUM_PBF_LIBRARIES}")
message(STATUS "OSMIUM_IO_LIBRARIES=${OSMIUM_IO_LIBRARIES}")
message(STATUS "OSMIUM_LIBRARIES=${OSMIUM_LIBRARIES}")
message(STATUS "OSMIUM_INCLUDE_DIRS=${OSMIUM_INCLUDE_DIRS}")
endif()
#----------------------------------------------------------------------
#
# FindProtozero.cmake
#
# Find the protozero headers.
#
#----------------------------------------------------------------------
#
# Usage:
#
# Copy this file somewhere into your project directory, where cmake can
# find it. Usually this will be a directory called "cmake" which you can
# add to the CMake module search path with the following line in your
# CMakeLists.txt:
#
# list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
#
# Then add the following in your CMakeLists.txt:
#
# find_package(Protozero [version] [REQUIRED])
# include_directories(SYSTEM ${PROTOZERO_INCLUDE_DIR})
#
# The version number is optional. If it is not set, any version of
# protozero will do.
#
# if(NOT PROTOZERO_FOUND)
# message(WARNING "Protozero not found!\n")
# endif()
#
#----------------------------------------------------------------------
#
# Variables:
#
# PROTOZERO_FOUND - True if Protozero was found.
# PROTOZERO_INCLUDE_DIR - Where to find include files.
#
#----------------------------------------------------------------------
# find include path
find_path(PROTOZERO_INCLUDE_DIR protozero/version.hpp
PATH_SUFFIXES include
PATHS ${CMAKE_SOURCE_DIR}/../protozero
)
# Check version number
if(Protozero_FIND_VERSION)
file(STRINGS "${PROTOZERO_INCLUDE_DIR}/protozero/version.hpp" _version_define REGEX "#define PROTOZERO_VERSION_STRING")
if("${_version_define}" MATCHES "#define PROTOZERO_VERSION_STRING \"([0-9.]+)\"")
set(_version "${CMAKE_MATCH_1}")
else()
set(_version "unknown")
endif()
endif()
#set(PROTOZERO_INCLUDE_DIRS "${PROTOZERO_INCLUDE_DIR}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Protozero
REQUIRED_VARS PROTOZERO_INCLUDE_DIR
VERSION_VAR _version)
#----------------------------------------------------------------------
set(OSMIUM_INSTALL_FILES
share/man/man1/osmium-show.1
share/man/man1/osmium-export.1
share/man/man1/osmium-tags-filter.1
share/man/man1/osmium-cat.1
share/man/man1/osmium-check-refs.1
share/man/man1/osmium-renumber.1
share/man/man1/osmium-sort.1
share/man/man1/osmium-getid.1
share/man/man1/osmium.1
share/man/man1/osmium-add-locations-to-ways.1
share/man/man1/osmium-apply-changes.1
share/man/man1/osmium-merge.1
share/man/man1/osmium-extract.1
share/man/man1/osmium-time-filter.1
share/man/man1/osmium-fileinfo.1
share/man/man1/osmium-derive-changes.1
share/man/man1/osmium-changeset-filter.1
share/man/man1/osmium-diff.1
share/man/man1/osmium-merge-changes.1
share/man/man5/osmium-file-formats.5
share/man/man5/osmium-index-types.5
bin/osmium
)
execute_process(COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/test_install -P ${CMAKE_BINARY_DIR}/cmake_install.cmake)
file(READ ${CMAKE_BINARY_DIR}/install_manifest.txt _manifest)
string(REPLACE "\n" ";" _files "${_manifest}")
string(REPLACE "${CMAKE_BINARY_DIR}/test_install/" "" _file_list "${_files}")
list(SORT OSMIUM_INSTALL_FILES)
list(SORT _file_list)
if(NOT "${OSMIUM_INSTALL_FILES}" STREQUAL "${_file_list}")
foreach(_file IN LISTS OSMIUM_INSTALL_FILES)
list(FIND _file_list ${_file} _result)
if(${_result} EQUAL -1)
message(STATUS "Missing file in install: ${_file}")
else()
list(REMOVE_ITEM _file_list ${_file})
endif()
endforeach()
if(NOT "${_file_list}" STREQUAL "")
message(STATUS "Installed files that should not be: ${_file_list}")
endif()
message(FATAL_ERROR "Install broken")
endif()
osmium-tool (1.8.0-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
-- Bas Couwenberg <sebastic@debian.org> Fri, 06 Apr 2018 07:21:27 +0200
osmium-tool (1.8.0-1) unstable; urgency=medium
* New upstream release.
* Update copyright-format URL to use HTTPS.
* Update Vcs-* URLs for Salsa.
* Bump Standards-Version to 4.1.3, no changes.
* Bump minimum required libosmium2-dev to 2.14.0.
* Drop manpages-install.patch, applied upstream.
* Update copyright years for Jochen Topf.
-- Bas Couwenberg <sebastic@debian.org> Sat, 31 Mar 2018 21:49:56 +0200
osmium-tool (1.7.1-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
......
......@@ -9,12 +9,12 @@ Build-Depends: debhelper (>= 9),
libboost-program-options-dev,
libbz2-dev,
libexpat1-dev,
libosmium2-dev (>= 2.13.1),
libosmium2-dev (>= 2.14.0),
pandoc,
zlib1g-dev
Standards-Version: 4.0.0
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-grass/osmium-tool.git/
Vcs-Git: https://anonscm.debian.org/git/pkg-grass/osmium-tool.git -b stretch-backports
Standards-Version: 4.1.3
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: http://osmcode.org/osmium-tool/
Package: osmium-tool
......
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Osmium Tool
Upstream-Contact: Osmium Developers (http://osmcode.org/contact)
Source: https://github.com/osmcode/osmium-tool
Files: *
Copyright: 2013-2017, Jochen Topf <jochen@topf.org>
Copyright: 2013-2018, Jochen Topf <jochen@topf.org>
License: GPL-3+
Files: include/rapidjson/*
......
Description: Only install manpage directories, not CMake files.
Author: Bas Couwenberg <sebastic@debian.org>
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -68,7 +68,7 @@ if(PANDOC)
add_man_page(5 osmium-file-formats)
add_man_page(5 osmium-index-types)
- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION share)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1 ${CMAKE_CURRENT_BINARY_DIR}/man5 DESTINATION share/man)
add_custom_target(man ALL DEPENDS ${ALL_MAN_PAGES})
else()
......@@ -6,7 +6,7 @@ created with the `osmium extract` command can be specified.
The config file `extracts.json` contains a list of all extracts that should be
created. In this case several different parts of Germany. You can [download a
Germany extract](http://download.geofabrik.de/europe/germany.html) and then try
Germany extract](https://download.geofabrik.de/europe/germany.html) and then try
this out:
osmium extract -v -c examples-extract.json germany-latest.osm.pbf
......