Skip to content
Commits on Source (12)
---
Checks: '*,-android-cloexec-*,-cert-dcl21-cpp,-cert-err58-cpp,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-google-runtime-references,-hicpp-invalid-access-moved,-hicpp-no-array-decay,-hicpp-no-assembler,-hicpp-vararg,-misc-macro-parentheses,-misc-unused-parameters,-modernize-make-unique,-modernize-raw-string-literal,-readability-avoid-const-params-in-decls,-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.
#
# cert-dcl21-cpp
# It is unclear whether this is still a good recommendation in modern C++.
#
# cert-err58-cpp
# Used in several singelton factory functions. I don't know of a better
# way to do this and it is rather unlikely that this will be a problem.
#
# 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-constant-array-index
# Is needed for low-level code.
#
# cppcoreguidelines-pro-bounds-pointer-arithmetic
# This is a low-level library, it needs to do pointer arithmetic.
#
# cppcoreguidelines-pro-type-const-cast
# When you need it, you need it.
#
# cppcoreguidelines-pro-type-reinterpret-cast
# This is a low-level library, it needs to do reinterpret-casts.
#
# 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, and we can't change the interfaces
# now anyways.
#
# hicpp-invalid-access-moved
# Creates false positives.
#
# hicpp-no-array-decay
# Alias for cppcoreguidelines-pro-bounds-array-to-pointer-decay.
#
# hicpp-no-assembler
# Reports are from macros we don't have any control over.
#
# hicpp-vararg
# Too strict, sometimes calling vararg functions is necessary.
#
# misc-macro-parentheses
# False positive in the only place where it reports something and
# disabling locally doesn't work.
#
# misc-unused-parameters
# Can't be fixed, because then Doxygen will complain. (In file
# include/osmium/area/problem_reporter.hpp).
#
# modernize-make-unique
# This is a C++11 library and C++ doesn't have std::make_unique.
#
# modernize-raw-string-literal
# Readability isn't that much better, arguably worse because of the new
# syntax.
#
# readability-avoid-const-params-in-decls
# This is header only library, so the declaration and implementation are
# often the same and we want to have the const in implementations.
#
# 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: '*'
HeaderFilterRegex: '\/include\/osmium\/.*'
...
[submodule "test/data-tests/osm-testdata"]
path = test/data-tests/osm-testdata
url = https://github.com/osmcode/osm-testdata
......@@ -8,6 +8,10 @@ language: generic
sudo: false
dist: trusty
#-----------------------------------------------------------------------------
cache:
directories:
- $HOME/.ccache
......@@ -18,176 +22,195 @@ env:
- CCACHE_COMPRESS=1
- CASHER_TIME_OUT=1000
#-----------------------------------------------------------------------------
# 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', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'clang-3.5']
addons_clang38: &clang38
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'clang-3.8']
addons_clang39: &clang39
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'clang-3.9']
addons_clang40: &clang40
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest', 'llvm-toolchain-trusty-4.0' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'clang-4.0']
addons_clang50: &clang50
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest', 'llvm-toolchain-trusty-5.0' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'clang-5.0', 'g++-6', 'gcc-6']
addons_gcc48: &gcc48
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'g++-4.8', 'gcc-4.8' ]
addons_gcc49: &gcc49
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'g++-4.9', 'gcc-4.9' ]
addons_gcc5: &gcc5
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'g++-5', 'gcc-5' ]
addons_gcc6: &gcc6
apt:
sources: [ 'ubuntu-toolchain-r-test', 'boost-latest' ]
packages: [ 'libboost1.55-all-dev', 'libgdal-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin', 'g++-6', 'gcc-6' ]
#-----------------------------------------------------------------------------
matrix:
include:
# 1/ Linux Clang Builds
- os: linux
compiler: linux-clang35-release
addons:
apt:
sources: ['llvm-toolchain-precise-3.5', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.5', 'cmake', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='clang++-3.5' BUILD_TYPE='Release'
env: CC='clang-3.5' CXX='clang++-3.5' BUILD_TYPE='Release'
addons: *clang35
- 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', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='clang++-3.5' BUILD_TYPE='Dev'
env: CC='clang-3.5' CXX='clang++-3.5' BUILD_TYPE='Dev'
addons: *clang35
- os: linux
compiler: linux-clang38-release
env: CC='clang-3.8' CXX='clang++-3.8' BUILD_TYPE='Release'
addons: *clang38
- os: linux
compiler: linux-clang37-release
addons:
apt:
sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.7', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='clang++-3.7' BUILD_TYPE='Release'
compiler: linux-clang38-dev
env: CC='clang-3.8' CXX='clang++-3.8' BUILD_TYPE='Dev'
addons: *clang38
- os: linux
compiler: linux-clang37-dev
addons:
apt:
sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.7', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='clang++-3.7' BUILD_TYPE='Dev'
compiler: linux-clang39-release
env: CC='clang-3.9' CXX='clang++-3.9' BUILD_TYPE='Release'
addons: *clang39
- os: linux
compiler: linux-clang39-dev
env: CC='clang-3.9' CXX='clang++-3.9' BUILD_TYPE='Dev'
addons: *clang39
- os: linux
compiler: linux-clang40-release
env: CC='clang-4.0' CXX='clang++-4.0' BUILD_TYPE='Release'
addons: *clang40
- os: linux
compiler: linux-clang38-release
addons:
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.8', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
compiler: linux-clang40-dev
env: CC='clang-4.0' CXX='clang++-4.0' BUILD_TYPE='Dev'
addons: *clang40
- os: linux
compiler: linux-clang38-dev
addons:
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test', 'boost-latest']
packages: ['clang-3.8', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='clang++-3.8' BUILD_TYPE='Dev'
compiler: linux-clang50-release
env: CC='clang-5.0' CXX='clang++-5.0' BUILD_TYPE='Release'
addons: *clang50
- os: linux
compiler: linux-clang50-dev
env: CC='clang-5.0' CXX='clang++-5.0' BUILD_TYPE='Dev'
addons: *clang50
# Disabled because it creates false-positives on the old travis systems
# - os: linux
# compiler: linux-clang50-debug
# 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
# addons: *clang50
# 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-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-4.8' COMPILER_FLAGS='-Wno-return-type' BUILD_TYPE='Release'
env: CC='gcc-4.8' CXX='g++-4.8' BUILD_TYPE='Release'
CXXFLAGS='-Wno-return-type'
addons: *gcc48
- os: linux
compiler: linux-gcc48-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.8', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-4.8' COMPILER_FLAGS='-Wno-return-type' BUILD_TYPE='Dev'
env: CC='gcc-4.8' CXX='g++-4.8' BUILD_TYPE='Dev'
CXXFLAGS='-Wno-return-type'
addons: *gcc48
- os: linux
compiler: linux-gcc49-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.9', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-4.9' BUILD_TYPE='Release'
env: CC='gcc-4.9' CXX='g++-4.9' BUILD_TYPE='Release'
addons: *gcc49
- os: linux
compiler: linux-gcc49-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-4.9', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-4.9' BUILD_TYPE='Dev'
env: CC='gcc-4.9' CXX='g++-4.9' BUILD_TYPE='Dev'
addons: *gcc49
- os: linux
compiler: linux-gcc5-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-5', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-5' BUILD_TYPE='Release'
env: CC='gcc-5' CXX='g++-5' BUILD_TYPE='Release'
addons: *gcc5
- os: linux
compiler: linux-gcc5-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-5', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-5' BUILD_TYPE='Dev'
env: CC='gcc-5' CXX='g++-5' BUILD_TYPE='Dev'
addons: *gcc5
- os: linux
compiler: linux-gcc6-release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-6', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-6' BUILD_TYPE='Release'
env: CC='gcc-6' CXX='g++-6' BUILD_TYPE='Release'
addons: *gcc6
- os: linux
compiler: linux-gcc6-dev
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-6', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-6' BUILD_TYPE='Dev'
env: CC='gcc-6' CXX='g++-6' BUILD_TYPE='Dev'
addons: *gcc6
- os: linux
compiler: linux-gcc6-coverage
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'boost-latest']
packages: ['g++-6', 'libboost1.55-all-dev', 'libgdal-dev', 'libgeos++-dev', 'libproj-dev', 'libsparsehash-dev', 'spatialite-bin']
env: COMPILER='g++-6' BUILD_TYPE='Coverage'
env: CC='gcc-6' CXX='g++-6' BUILD_TYPE='Coverage'
addons: *gcc6
# 3/ OSX Clang Builds
- os: osx
osx_image: xcode6.4
compiler: xcode64-clang-release
env: COMPILER='clang++' BUILD_TYPE='Release'
env: CC='clang' CXX='clang++' BUILD_TYPE='Release'
- os: osx
osx_image: xcode6.4
compiler: xcode64-clang-dev
env: COMPILER='clang++' BUILD_TYPE='Dev'
env: CC='clang' CXX='clang++' BUILD_TYPE='Dev'
- os: osx
osx_image: xcode7
compiler: xcode7-clang-release
env: COMPILER='clang++' BUILD_TYPE='Release'
env: CC='clang' CXX='clang++' BUILD_TYPE='Release'
- os: osx
osx_image: xcode7
compiler: xcode7-clang-dev
env: COMPILER='clang++' BUILD_TYPE='Dev'
env: CC='clang' CXX='clang++' BUILD_TYPE='Dev'
- os: osx
osx_image: xcode8.3
compiler: xcode8-clang-release
env: COMPILER='clang++' BUILD_TYPE='Release'
env: CC='clang' CXX='clang++' BUILD_TYPE='Release'
- os: osx
osx_image: xcode8.3
compiler: xcode8-clang-dev
env: COMPILER='clang++' BUILD_TYPE='Dev'
env: CC='clang' CXX='clang++' BUILD_TYPE='Dev'
install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- git clone --quiet --depth 1 https://github.com/osmcode/osm-testdata.git
- git clone --quiet --depth 1 https://github.com/mapbox/protozero.git ../protozero
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew remove gdal
......@@ -197,8 +220,9 @@ install:
before_script:
- cd ${TRAVIS_BUILD_DIR}
- git submodule update --init
- mkdir build && cd build
- CXX=${COMPILER} CXXFLAGS=${COMPILER_FLAGS} cmake -LA .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_WITH_CCACHE=1 -DOSM_TESTDATA="${TRAVIS_BUILD_DIR}/deps/osm-testdata"
- cmake -LA .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_DATA_TESTS=ON -DBUILD_WITH_CCACHE=1
script:
- make VERBOSE=1 && ctest --output-on-failure
......@@ -208,11 +232,12 @@ after_success:
if [ "${BUILD_TYPE}" = "Coverage" ]; then
curl -S -f https://codecov.io/bash -o codecov
chmod +x codecov
gcov-${COMPILER#g++-} -p $(find test/CMakeFiles -name '*.o')
./codecov -Z -c -F unit_tests
gcov-${COMPILER#g++-} -p $(find test/data-tests -name '*.o')
./codecov -Z -c -F data_tests
gcov-${COMPILER#g++-} -p $(find examples -name '*.o')
./codecov -Z -c -F examples
gcov-${CXX#g++-} -p $(find test/CMakeFiles -name '*.o')
./codecov -Z -c -X gcov -F unit_tests
gcov-${CXX#g++-} -p $(find test/data-tests -name '*.o')
./codecov -Z -c -X gcov -F data_tests
gcov-${CXX#g++-} -p $(find examples -name '*.o')
./codecov -Z -c -X gcov -F examples
fi
#-----------------------------------------------------------------------------
......@@ -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,90 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
## [2.14.0] - 2018-03-31
### Added
* Add `ReaderWithProgressBar` class. This wraps an `osmium::io::Reader` and an
`osmium::ProgressBar` into a nice little package allowing easier use in the
common case.
* Add polygon implementation for WKT and GeoJSON geometry factories. (Thanks
to Horace Williams.)
* Various tests.
### Changed
* Add git submodule with `osm-testdata` repository. Before this the repository
had to be installed externally. Now a submodule update can be used to get the
correct version of the osm-testdata repository.
* The XML file reader was rewritten to be more strict. Cases where it could
be tricked into failing badly were removed. There are now more tests for the
XML parser.
* Replaced `strftime` by our own implementation. Uses a specialized
implementation for our use case instead the more general `strftime`.
Benchmarked this to be faster.
* Changed the way IDs are parsed from strings. No asserts are used any more but
checks are done and an exception is thrown when IDs are out of range. This
also changes the way negative values are handled. The value `-1` is now
always accepted for all IDs and returned as `0`. This deprecates the
`string_to_user_id()` function, use `string_to_uid()` instead which returns a
different type.
* It was always a bit confusing that some of the util classes and functions are
directly in the `osmium` namespace and some are in `osmium::util`. The
`osmium::util` namespace is now declared `inline`. which allows all util
classes and functions to be addressed directly in the `osmium` namespace
while keeping backwards compatibility.
* An error is now thrown when the deprecated `pbf_add_metadata` file format
option is used. Use `add_metadata` instead.
* Extended the `add_metadata` file format option. In addition to allowing the
values `true`, `yes`, `false`, and `no`, the new values `all` and `none`
are now recognized. The option can also be set to a list of attributes
separated by the `+` sign. Attributes are `version`, `timestamp`,
`changeset`, `uid`, and `user`. All output formats have been updated to
only output the specified attributes. This is based on the new
`osmium::metadata_options` class which stores information about what metadata
an `OSMObject` has or should have. (Thanks to Michael Reichert.)
* The `<` (less than) operator on `OSMObject`s now ignores the case when
one or both of the timestamps on the objects are not set at all. This
allows better handling of OSM data files with reduced metadata.
* Allow `version = -1` and `changeset = -1` in PBF input. This value is
sometimes used by other programs to denote "no value". Osmium uses the `0`
for this.
* The example programs using the `getopt_long` function have been rewritten to
work without it. This makes using libosmium on Windows easier, where this
function is not available.
* Removed the embedded protozero from repository. Like other dependencies you
have to install protozero first. If you check out the protozero repository
in the same directory where you checked out libosmium, libosmium's CMake
will find it.
* Various code cleanups, fixing of include order, etc.
* Remove need for `winsock2` library in Windows by using code from Protozero.
(Thanks alex85k.)
* Add MSYS2 build to Appveyor and fixed some Windows compile issues. (Thanks
to alex85k.)
* Use array instead of map to store input/output format creators.
* Update included `catch.hpp` to version 1.12.1.
### Fixed
* Remove check for lost ways in multipolygon assembler. This rules out too many
valid multipolygons, more specifically more complex ones with touching inner
rings.
* Use different macro magic for registering index maps. This allows the maps
to be used for several types at the same time.
* Lots of code was rewritten to fix warnings reported by `clang-tidy` making
libosmium more robust.
* Make ADL work for `begin()`/`end()` of `InputIterator<Reader>`.
* Various fixes to make the code more robust, including an undefined behaviour
in the debug output format and a buffer overflow in the o5m parser.
* Range checks in o5m parser throw exceptions now instead of triggering
assertions.
* Better checking that PBF data is in range.
* Check `read` and `write` system calls for `EINTR`.
* Use tag and type from protozero to make PBF parser more robust.
* Test `testdata-multipolygon` on Windows was using the wrong executable name.
## [2.13.1] - 2017-08-25
### Added
......@@ -739,7 +823,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
Doxygen (up to version 1.8.8). This version contains a workaround to fix
this.
[unreleased]: https://github.com/osmcode/libosmium/compare/v2.13.1...HEAD
[unreleased]: https://github.com/osmcode/libosmium/compare/v2.14.0...HEAD
[2.14.0]: https://github.com/osmcode/libosmium/compare/v2.13.1...v2.14.0
[2.13.1]: https://github.com/osmcode/libosmium/compare/v2.13.0...v2.13.1
[2.13.0]: https://github.com/osmcode/libosmium/compare/v2.12.2...v2.13.0
[2.12.2]: https://github.com/osmcode/libosmium/compare/v2.12.1...v2.12.2
......
......@@ -24,8 +24,8 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel;Dev;Cover
project(libosmium)
set(LIBOSMIUM_VERSION_MAJOR 2)
set(LIBOSMIUM_VERSION_MINOR 13)
set(LIBOSMIUM_VERSION_PATCH 1)
set(LIBOSMIUM_VERSION_MINOR 14)
set(LIBOSMIUM_VERSION_PATCH 0)
set(LIBOSMIUM_VERSION
"${LIBOSMIUM_VERSION_MAJOR}.${LIBOSMIUM_VERSION_MINOR}.${LIBOSMIUM_VERSION_PATCH}")
......@@ -62,7 +62,6 @@ option(BUILD_BENCHMARKS "compile benchmark programs" ${dev_build})
option(BUILD_DATA_TESTS "compile data tests, please run them with ctest" ${data_test_build})
option(INSTALL_GDALCPP "also install gdalcpp headers" OFF)
option(INSTALL_PROTOZERO "also install protozero headers" OFF)
option(INSTALL_UTFCPP "also install utfcpp headers" OFF)
option(WITH_PROFILING "add flags needed for profiling" OFF)
......@@ -173,17 +172,6 @@ set(_own_index)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
if(MSVC)
find_path(GETOPT_INCLUDE_DIR getopt.h)
find_library(GETOPT_LIBRARY NAMES wingetopt)
if(GETOPT_INCLUDE_DIR AND GETOPT_LIBRARY)
include_directories(SYSTEM ${GETOPT_INCLUDE_DIR})
list(APPEND OSMIUM_LIBRARIES ${GETOPT_LIBRARY})
else()
set(GETOPT_MISSING 1)
endif()
endif()
#-----------------------------------------------------------------------------
#
......@@ -402,13 +390,14 @@ if(BUILD_HEADERS)
file(MAKE_DIRECTORY header_check)
foreach(hpp ${ALL_HPPS})
if(GDAL_FOUND OR NOT ((hpp STREQUAL "osmium/area/problem_reporter_ogr.hpp") OR (hpp STREQUAL "osmium/geom/ogr.hpp")))
string(REPLACE ".hpp" "" tmp ${hpp})
string(REPLACE "/" "__" libname ${tmp})
# Create a dummy .cpp file that includes the header file we want to
# check.
set(DUMMYCPP ${CMAKE_BINARY_DIR}/header_check/${libname}.cpp)
file(WRITE ${DUMMYCPP} "#include <${hpp}>\n")
file(WRITE ${DUMMYCPP} "#include <${hpp}> // IWYU pragma: keep\n")
# There is no way in CMake to just compile but not link a C++ file,
# so we pretend to build a library here.
......@@ -416,7 +405,7 @@ if(BUILD_HEADERS)
#### this is better but only supported from cmake 3.0:
###add_library(${libname} OBJECT ${DUMMYCPP} include/${hpp})
endif()
endforeach()
endif()
......@@ -427,10 +416,10 @@ endif()
#
#-----------------------------------------------------------------------------
message(STATUS "Looking for clang-tidy")
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-3.9 clang-tidy-3.8 clang-tidy-3.7 clang-tidy-3.6 clang-tidy-3.5)
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-6.0 clang-tidy-5.0)
if(CLANG_TIDY)
message(STATUS "Looking for clang-tidy - found")
message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
if(BUILD_EXAMPLES)
file(GLOB CT_ALL_EXAMPLES examples/*.cpp)
......@@ -467,41 +456,9 @@ if(CLANG_TIDY)
${CT_ALL_BENCHMARKS}
${CT_ALL_DATA_TESTS})
# For a list of check options, see:
# http://clang.llvm.org/extra/clang-tidy/checks/list.html
list(APPEND CT_CHECKS "cert-*"
"-cert-err60-cpp") # even the std lib doesn't do this
# disabled, because it is slow
# list(APPEND CT_CHECKS "clang-analyzer-*")
list(APPEND CT_CHECKS "google-*"
"-google-explicit-constructor"
"-google-readability-casting"
"-google-readability-function")
list(APPEND CT_CHECKS "llvm-*"
"-llvm-include-order")
list(APPEND CT_CHECKS "misc-*"
"-misc-argument-comment")
list(APPEND CT_CHECKS "modernize-*"
"-modernize-make-unique") # not available in C++11
list(APPEND CT_CHECKS "readability-*"
"-readability-identifier-naming"
"-readability-implicit-bool-cast"
"-readability-named-parameter")
string(REPLACE ";" "," ALL_CHECKS "${CT_CHECKS}")
add_custom_target(clang-tidy
${CLANG_TIDY}
-p ${CMAKE_BINARY_DIR}
-header-filter='include/osmium/.*'
-checks="${ALL_CHECKS}"
${CT_CHECK_FILES}
)
else()
......@@ -523,10 +480,6 @@ if(INSTALL_GDALCPP)
install(FILES include/gdalcpp.hpp DESTINATION include)
endif()
if(INSTALL_PROTOZERO)
install(DIRECTORY include/protozero DESTINATION include)
endif()
if(INSTALL_UTFCPP)
install(FILES include/utf8.h DESTINATION include)
install(DIRECTORY include/utf8 DESTINATION include)
......@@ -560,8 +513,7 @@ include(CPack)
if(BUILD_DATA_TESTS AND OSM_TESTDATA STREQUAL "OSM_TESTDATA-NOTFOUND")
message("\n========================== WARNING ==========================")
message("osm-testdata directory not found, data tests were disabled!\n")
message("You can get it from https://github.com/osmcode/osm-testdata")
message("Clone it into the same directory libosmium is in")
message("Call 'git submodule update --init' to install test data")
message("or set the OSM_TESTDATA cmake variable to its path.")
message("=============================================================\n")
endif()
......
......@@ -10,3 +10,10 @@ Some rules for contributing to this project:
you have added. Please read the [notes for developers](NOTES_FOR_DEVELOPERS.md)
beforehand which contains some coding guidelines.
If you are reporting a problem:
* 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.
==== For protozero from https://github.com/mapbox/protozero
protozero copyright (c) Mapbox.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==== For protozero from https://github.com/mapbox/protozero
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
==== For utf8.h
Copyright 2006 Nemanja Trifunovic
......
......@@ -126,7 +126,7 @@ Call `cmake/iwyu.sh` to check for proper includes and forward declarations.
This uses the clang-based `include-what-you-use` program. Note that it does
produce some false reports and crashes often. The `osmium.imp` file can be
used to define mappings for iwyu. See the IWYU tool at
<http://code.google.com/p/include-what-you-use/>.
<https://include-what-you-use.org/>.
## Testing
......
......@@ -9,6 +9,7 @@ Libosmium works on Linux, Mac OSX and Windows.
[![Travis Build Status](https://secure.travis-ci.org/osmcode/libosmium.svg)](https://travis-ci.org/osmcode/libosmium)
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/osmcode/libosmium?svg=true)](https://ci.appveyor.com/project/Mapbox/libosmium)
[![Coverage Status](https://codecov.io/gh/osmcode/libosmium/branch/master/graph/badge.svg)](https://codecov.io/gh/osmcode/libosmium)
[![Packaging status](https://repology.org/badge/tiny-repos/libosmium.svg)](https://repology.org/metapackage/libosmium)
Please see the [Libosmium manual](http://osmcode.org/libosmium/manual.html)
for more details than this README can provide.
......@@ -31,9 +32,11 @@ manual.
The following external (header-only) libraries are included in the libosmium
repository:
* [gdalcpp](https://github.com/joto/gdalcpp)
* [protozero](https://github.com/mapbox/protozero)
* [utfcpp](http://utfcpp.sourceforge.net/)
Note that [protozero](https://github.com/mapbox/protozero) was included in
earlier versions of libosmium, but isn't any more.
## Directories
......@@ -73,6 +76,14 @@ chapter in the manual.
## Testing
To download the `osm-testdata` submodule call:
```
git submodule update --init
```
This will enable additional tests.
See the
[Libosmium Manual](http://osmcode.org/libosmium/manual.html#running-tests)
for instructions.
......
......@@ -6,34 +6,54 @@
environment:
matrix:
- config: Dev
- config: MSYS2
autocrlf: true
- config: Dev
autocrlf: false
- config: RelWithDebInfo
- config: Debug
autocrlf: true
- config: Release
autocrlf: true
- config: RelWithDebInfo
- config: Debug
autocrlf: false
- config: Release
autocrlf: false
shallow_clone: true
clone_depth: 1
# Operating system (build VM template)
os: Visual Studio 2015
platform: x64
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf %autocrlf%
- git config --get core.autocrlf
# clone directory
clone_folder: c:\projects\libosmium
platform: x64
# The option --ask=20 is a workaround for a problem with the MSYS2 update
# process. Without it the following error is printed and the appveyor script
# halts: "msys2-runtime and catgets are in conflict. Remove catgets?"
# See also: https://github.com/Alexpux/MSYS2-packages/issues/1141
install:
- git submodule update --init
- cd c:\projects
- git clone --depth 1 https://github.com/mapbox/protozero
- if [%config%]==[MSYS2] (
C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade --ask=20
&& C:\msys64\usr\bin\pacman -Rc --noconfirm mingw-w64-x86_64-gcc-libs
)
build_script:
- build-appveyor.bat
- cd c:\projects\libosmium
- if [%config%]==[MSYS2] (
build-msys2.bat
) else (
build-appveyor.bat
)
# remove garbage VS messages
# http://help.appveyor.com/discussions/problems/4569-the-target-_convertpdbfiles-listed-in-a-beforetargets-attribute-at-c-does-not-exist-in-the-project-and-will-be-ignored
# https://help.appveyor.com/discussions/problems/4569-the-target-_convertpdbfiles-listed-in-a-beforetargets-attribute-at-c-does-not-exist-in-the-project-and-will-be-ignored
before_build:
- del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
......@@ -4,9 +4,9 @@
#
cd $DATA_DIR
curl --location --output 1_liechtenstein.osm.pbf http://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf # about 2 MB
curl --location --output 2_bremen.osm.pbf http://download.geofabrik.de/europe/germany/bremen-latest.osm.pbf # about 16 MB
curl --location --output 3_sachsen.osm.pbf http://download.geofabrik.de/europe/germany/sachsen-latest.osm.pbf # about 160 MB
curl --location --output 4_germany.osm.pbf http://download.geofabrik.de/europe/germany-latest.osm.pbf # about 3 GB
curl --location --output 5_planet.osm.pbf http://planet.osm.org/pbf/planet-latest.osm.pbf # about 35 GB
curl --location --output 1_liechtenstein.osm.pbf https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf # about 2 MB
curl --location --output 2_bremen.osm.pbf https://download.geofabrik.de/europe/germany/bremen-latest.osm.pbf # about 16 MB
curl --location --output 3_sachsen.osm.pbf https://download.geofabrik.de/europe/germany/sachsen-latest.osm.pbf # about 160 MB
curl --location --output 4_germany.osm.pbf https://download.geofabrik.de/europe/germany-latest.osm.pbf # about 3 GB
curl --location --output 5_planet.osm.pbf https://planet.osm.org/pbf/planet-latest.osm.pbf # about 35 GB
......@@ -4,36 +4,35 @@
*/
#include <osmium/handler.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <string>
#include <osmium/io/any_input.hpp>
#include <osmium/handler.hpp>
#include <osmium/visitor.hpp>
struct CountHandler : public osmium::handler::Handler {
uint64_t nodes = 0;
uint64_t ways = 0;
uint64_t relations = 0;
void node(const osmium::Node&) {
void node(const osmium::Node& /*node*/) {
++nodes;
}
void way(const osmium::Way&) {
void way(const osmium::Way& /*way*/) {
++ways;
}
void relation(const osmium::Relation&) {
void relation(const osmium::Relation& /*relation*/) {
++relations;
}
};
int main(int argc, char* argv[]) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " OSMFILE\n";
......@@ -48,8 +47,8 @@ int main(int argc, char* argv[]) {
osmium::apply(reader, handler);
reader.close();
std::cout << "Nodes: " << handler.nodes << "\n";
std::cout << "Ways: " << handler.ways << "\n";
std::cout << "Relations: " << handler.relations << "\n";
std::cout << "Nodes: " << handler.nodes << '\n';
std::cout << "Ways: " << handler.ways << '\n';
std::cout << "Relations: " << handler.relations << '\n';
}
......@@ -4,15 +4,15 @@
*/
#include <osmium/handler.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <string>
#include <osmium/io/any_input.hpp>
#include <osmium/handler.hpp>
#include <osmium/visitor.hpp>
struct CountHandler : public osmium::handler::Handler {
uint64_t counter = 0;
......@@ -26,17 +26,16 @@ struct CountHandler : public osmium::handler::Handler {
}
}
void way(const osmium::Way&) {
void way(const osmium::Way& /*way*/) {
++all;
}
void relation(const osmium::Relation&) {
void relation(const osmium::Relation& /*relation*/) {
++all;
}
};
int main(int argc, char* argv[]) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " OSMFILE\n";
......@@ -51,6 +50,6 @@ int main(int argc, char* argv[]) {
osmium::apply(reader, handler);
reader.close();
std::cout << "r_all=" << handler.all << " r_counter=" << handler.counter << "\n";
std::cout << "r_all=" << handler.all << " r_counter=" << handler.counter << '\n';
}
......@@ -4,16 +4,15 @@
*/
#include <cstdlib>
#include <iostream>
#include <string>
#include <osmium/index/map/all.hpp>
#include <osmium/handler.hpp>
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/index/map/all.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/handler.hpp>
#include <cstdlib>
#include <iostream>
#include <string>
using index_type = osmium::index::map::Map<osmium::unsigned_object_id_type, osmium::Location>;
......
......@@ -4,17 +4,17 @@
*/
#include <osmium/geom/mercator_projection.hpp>
#include <osmium/geom/wkb.hpp>
#include <osmium/handler.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <string>
#include <osmium/io/any_input.hpp>
#include <osmium/handler.hpp>
#include <osmium/visitor.hpp>
#include <osmium/geom/wkb.hpp>
#include <osmium/geom/mercator_projection.hpp>
struct GeomHandler : public osmium::handler::Handler {
osmium::geom::WKBFactory<osmium::geom::MercatorProjection> factory;
......@@ -25,7 +25,6 @@ struct GeomHandler : public osmium::handler::Handler {
};
int main(int argc, char* argv[]) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " OSMFILE\n";
......
......@@ -16,6 +16,12 @@
*/
#include <osmium/handler.hpp>
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/index/map/all.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>
#include <algorithm>
#include <chrono>
#include <cmath>
......@@ -24,13 +30,6 @@
#include <limits>
#include <string>
#include <osmium/index/map/all.hpp>
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/visitor.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/handler.hpp>
using static_index_type = osmium::index::map::SparseMemArray<osmium::unsigned_object_id_type, osmium::Location>;
const std::string location_store{"sparse_mem_array"};
......@@ -84,8 +83,12 @@ int main(int argc, char* argv[]) {
const double duration = std::chrono::duration<double, std::milli>(end - start).count();
if (duration < static_min) static_min = duration;
if (duration > static_max) static_max = duration;
if (duration < static_min) {
static_min = duration;
}
if (duration > static_max) {
static_max = duration;
}
static_sum += duration;
}
......@@ -107,8 +110,12 @@ int main(int argc, char* argv[]) {
const double duration = std::chrono::duration<double, std::milli>(end - start).count();
if (duration < dynamic_min) dynamic_min = duration;
if (duration > dynamic_max) dynamic_max = duration;
if (duration < dynamic_min) {
dynamic_min = duration;
}
if (duration > dynamic_max) {
dynamic_max = duration;
}
dynamic_sum += duration;
}
}
......
......@@ -4,73 +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 lodir=%CD%
SET PATH=%lodir%\%CUSTOM_CMAKE%\bin;%PATH%
SET LODEPSDIR=%lodir%\libosmium-deps
SET PROJ_LIB=%LODEPSDIR%\proj\share
SET GDAL_DATA=%LODEPSDIR%\gdal\data
::gdal.dll
SET PATH=%LODEPSDIR%\gdal\lib;%PATH%
::geos.dll
SET PATH=%LODEPSDIR%\geos\lib;%PATH%
::libtiff.dll
SET PATH=%LODEPSDIR%\libtiff\lib;%PATH%
::jpeg.dll
SET PATH=%LODEPSDIR%\jpeg\lib;%PATH%
::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 %CUSTOM_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 libosmium
CD %lodir%\..
ECHO config^: %config%
IF NOT EXIST osm-testdata ECHO cloning osm-testdata && git clone --depth 1 https://github.com/osmcode/osm-testdata.git
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CD osm-testdata
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 %lodir%
IF EXIST build ECHO deleting build dir... && RD /Q /S build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
......@@ -78,20 +38,21 @@ MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CD build
ECHO config^: %config%
::This will produce lots of LNK4099 warnings which can be ignored.
::Unfortunately they can't be disabled, see
::http://stackoverflow.com/questions/661606/visual-c-how-to-disable-specific-linker-warnings
SET CMAKE_CMD=cmake .. ^
-LA -G "Visual Studio 14 Win64" ^
::https://stackoverflow.com/questions/661606/visual-c-how-to-disable-specific-linker-warnings
SET CMAKE_CMD=cmake .. -LA -G "Visual Studio 14 Win64" ^
-DOsmium_DEBUG=TRUE ^
-DCMAKE_BUILD_TYPE=%config% ^
-DBUILD_HEADERS=OFF ^
-DBOOST_ROOT=%LODEPSDIR%\boost ^
-DZLIB_LIBRARY=%LODEPSDIR%\zlib\lib\zlibwapi.lib ^
-DBZIP2_LIBRARY_RELEASE=%LIBBZIP2% ^
-DCMAKE_PREFIX_PATH=%LODEPSDIR%\zlib;%LODEPSDIR%\expat;%LODEPSDIR%\bzip2;%LODEPSDIR%\geos;%LODEPSDIR%\gdal;%LODEPSDIR%\proj;%LODEPSDIR%\sparsehash;%LODEPSDIR%\wingetopt
-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
ECHO calling^: %CMAKE_CMD%
%CMAKE_CMD%
......@@ -107,12 +68,9 @@ msbuild libosmium.sln ^
/p:PlatformToolset=v140 %avlogger%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ctest --output-on-failure ^
-C %config% ^
-E testdata-overview
ctest --output-on-failure -C %config% -E testdata-overview
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
......
@ECHO OFF
SETLOCAL
SET EL=0
ECHO ~~~~~~ %~f0 ~~~~~~
echo "Adding MSYS2 to path..."
SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
echo %PATH%
echo "Installing MSYS2 packages..."
bash -lc "pacman -S --needed --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-geos mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-cppcheck mingw-w64-x86_64-doxygen mingw-w64-x86_64-gdb mingw-w64-x86_64-sparsehash mingw-w64-x86_64-gdal mingw-w64-x86_64-ruby mingw-w64-x86_64-libspatialite mingw-w64-x86_64-spatialite-tools mingw-w64-x86_64-clang-tools-extra"
bash -lc "pacman -S --needed --noconfirm mingw-w64-x86_64-postgresql mingw-w64-x86_64-netcdf mingw-w64-x86_64-crypto++"
call C:\msys64\mingw64\bin\gem.cmd install json
echo "Setting PROJ_LIB variable for correct PROJ.4 working"
set PROJ_LIB=c:\msys64\mingw64\share\proj
echo "Generating makefiles"
mkdir build
cd build
cmake .. -G "MSYS Makefiles" -DBUILD_DATA_TESTS=ON -DBUILD_HEADERS=OFF
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
echo "Building"
make
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
echo "Testing"
ctest --output-on-failure
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
:ERROR
ECHO ~~~~~~ ERROR %~f0 ~~~~~~
SET EL=%ERRORLEVEL%
:DONE
IF %EL% NEQ 0 ECHO. && ECHO !!! ERRORLEVEL^: %EL% !!! && ECHO.
ECHO ~~~~~~ DONE %~f0 ~~~~~~
EXIT /b %EL%