Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fdecc79f4 |
@@ -94,6 +94,3 @@ node_modules
|
|||||||
/server.ini
|
/server.ini
|
||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
# local lua debugging file
|
|
||||||
debug.lua
|
|
||||||
+50
-61
@@ -13,7 +13,6 @@ notifications:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- "5.6"
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
ccache: true
|
ccache: true
|
||||||
@@ -26,9 +25,7 @@ env:
|
|||||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||||
- CCACHE_COMPRESS=1
|
- CCACHE_COMPRESS=1
|
||||||
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
||||||
- CCACHE_VERSION=3.3.1
|
- JOBS=4
|
||||||
- CMAKE_VERSION=3.6.2
|
|
||||||
- MASON="$(pwd)/third_party/mason/mason"
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
@@ -42,53 +39,42 @@ matrix:
|
|||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "clang-3.9-debug"
|
compiler: "clang-3.8-debug"
|
||||||
addons: &clang38
|
addons: &clang38
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||||
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Debug' BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
|
env: CLANG_VERSION='3.8.1' CLANG_PACKAGE="clang++" BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode8.2
|
osx_image: xcode7.3
|
||||||
compiler: "mason-osx-release"
|
compiler: clang
|
||||||
# we use the xcode provides clang and don't install our own
|
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Debug' JOBS=1 CUCUMBER_TIMEOUT=60000
|
||||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON
|
|
||||||
|
|
||||||
# Release Builds
|
# Release Builds
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "mason-linux-release"
|
compiler: "mason-release"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev']
|
packages: ['libstdc++-5-dev', 'ccache']
|
||||||
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON
|
env: BUILD_TYPE='Release' ENABLE_MASON=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-release"
|
compiler: "gcc-6-release"
|
||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_COMPONENTS=ON
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_COMPONENTS=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-release-i686"
|
compiler: "gcc-6-release-i686"
|
||||||
env: >
|
env: TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||||
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
|
||||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-4.9-release"
|
|
||||||
addons: &gcc49
|
|
||||||
apt:
|
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
|
||||||
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
|
||||||
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
|
||||||
|
|
||||||
# Disabled because of CI slowness
|
# Disabled because of CI slowness
|
||||||
#- os: linux
|
#- os: linux
|
||||||
@@ -99,13 +85,19 @@ matrix:
|
|||||||
#- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
#- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
|
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
|
||||||
|
|
||||||
|
# Disabled because of CI slowness
|
||||||
|
#- os: osx
|
||||||
|
#- osx_image: xcode7.3
|
||||||
|
#- compiler: clang
|
||||||
|
#- env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Release'
|
||||||
|
|
||||||
# Shared Library
|
# Shared Library
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-release-shared"
|
compiler: "gcc-6-release-shared"
|
||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON BUILD_COMPONENTS=ON
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON BUILD_COMPONENTS=ON
|
||||||
|
|
||||||
# Disabled because CI slowness
|
# Disabled because CI slowness
|
||||||
@@ -119,36 +111,24 @@ matrix:
|
|||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
|
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
|
||||||
|
- if [[ $(uname -s) == 'Darwin' ]]; then sudo mdutil -i off /; fi;
|
||||||
|
- source ./scripts/install_node.sh 4
|
||||||
|
- npm install
|
||||||
|
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
||||||
|
- export PATH=${DEPS_DIR}/bin:${PATH} && mkdir -p ${DEPS_DIR}
|
||||||
|
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/3.5.2.tar.gz"
|
||||||
|
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR} || exit 1
|
||||||
- |
|
- |
|
||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
if [[ ${CLANG_VERSION:-false} != false ]]; then
|
||||||
export JOBS=$((`nproc` + 1))
|
export CCOMPILER='clang'
|
||||||
fi
|
export CXXCOMPILER='clang++'
|
||||||
- |
|
CLANG_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/${CLANG_PACKAGE}/${CLANG_VERSION}.tar.gz"
|
||||||
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR} || exit 1
|
||||||
${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh
|
|
||||||
fi
|
fi
|
||||||
- |
|
- |
|
||||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||||
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
|
||||||
sudo mdutil -i off /
|
brew install libzip libstxxl lua51 luabind tbb md5sha1sum ccache
|
||||||
fi
|
|
||||||
- echo "Using ${JOBS} jobs"
|
|
||||||
- source ./scripts/install_node.sh 4
|
|
||||||
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
|
|
||||||
- npm install
|
|
||||||
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
|
|
||||||
- ${MASON} install cmake ${CMAKE_VERSION} && export PATH=$(${MASON} prefix cmake ${CMAKE_VERSION})/bin:${PATH}
|
|
||||||
- |
|
|
||||||
if [[ ! -z ${CLANG_VERSION} ]]; then
|
|
||||||
export CCOMPILER='clang'
|
|
||||||
export CXXCOMPILER='clang++'
|
|
||||||
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH}
|
|
||||||
# we only enable lto for release builds
|
|
||||||
# and therefore don't need to us ld.gold or llvm tools for linking
|
|
||||||
# for debug builds
|
|
||||||
if [[ ${BUILD_TYPE} == 'Release' ]]; then
|
|
||||||
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH}
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
||||||
|
|
||||||
@@ -157,11 +137,11 @@ install:
|
|||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||||
./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||||
fi
|
fi
|
||||||
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
|
- mkdir build && pushd build
|
||||||
- mkdir ${OSRM_BUILD_DIR} && pushd ${OSRM_BUILD_DIR}
|
|
||||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON
|
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON
|
||||||
- echo "travis_fold:start:MAKE"
|
- echo "travis_fold:start:MAKE"
|
||||||
|
- make osrm-extract --jobs=3
|
||||||
- make --jobs=${JOBS}
|
- make --jobs=${JOBS}
|
||||||
- make tests --jobs=${JOBS}
|
- make tests --jobs=${JOBS}
|
||||||
- make benchmarks --jobs=${JOBS}
|
- make benchmarks --jobs=${JOBS}
|
||||||
@@ -172,13 +152,18 @@ install:
|
|||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
fi
|
fi
|
||||||
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
|
|
||||||
- popd
|
- popd
|
||||||
|
- |
|
||||||
|
if [[ ${ENABLE_MASON:-OFF} == 'ON' ]]; then
|
||||||
|
# for mason builds we need to point the example
|
||||||
|
# at the clang++ installed by the CMakeLists.txt automatically
|
||||||
|
export CXX=$(./third_party/mason/mason prefix clang++ 3.8.1)/bin/clang++
|
||||||
|
export CC=$(./third_party/mason/mason prefix clang++ 3.8.1)/bin/clang
|
||||||
|
fi
|
||||||
- mkdir example/build && pushd example/build
|
- mkdir example/build && pushd example/build
|
||||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||||
- make --jobs=${JOBS}
|
- make
|
||||||
- popd
|
- popd
|
||||||
- npm run build-api-docs
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
||||||
@@ -187,7 +172,7 @@ script:
|
|||||||
- echo "travis_fold:end:BENCHMARK"
|
- echo "travis_fold:end:BENCHMARK"
|
||||||
- ./example/build/osrm-example test/data/monaco.osrm
|
- ./example/build/osrm-example test/data/monaco.osrm
|
||||||
# All tests assume to be run from the build directory
|
# All tests assume to be run from the build directory
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd build
|
||||||
- ./unit_tests/library-tests ../test/data/monaco.osrm
|
- ./unit_tests/library-tests ../test/data/monaco.osrm
|
||||||
- ./unit_tests/extractor-tests
|
- ./unit_tests/extractor-tests
|
||||||
- ./unit_tests/engine-tests
|
- ./unit_tests/engine-tests
|
||||||
@@ -197,6 +182,10 @@ script:
|
|||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
|
- |
|
||||||
|
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
||||||
|
./scripts/format.sh # we don't want to fail just yet
|
||||||
|
fi
|
||||||
- |
|
- |
|
||||||
if [ -n "${ENABLE_COVERAGE}" ]; then
|
if [ -n "${ENABLE_COVERAGE}" ]; then
|
||||||
bash <(curl -s https://codecov.io/bash)
|
bash <(curl -s https://codecov.io/bash)
|
||||||
|
|||||||
+2
-62
@@ -1,51 +1,3 @@
|
|||||||
# 5.6.1
|
|
||||||
- Changes from 5.6.0
|
|
||||||
- Bugfixes
|
|
||||||
- Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
|
|
||||||
|
|
||||||
# 5.6.0
|
|
||||||
- Changes from 5.5
|
|
||||||
- Bugfixes
|
|
||||||
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
|
|
||||||
- Fix #3515 adjusted number of `nodes` in `annotation`
|
|
||||||
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
|
|
||||||
- Fix #2844 handle up to 16777215 code units in OSM names
|
|
||||||
- Infrastructure
|
|
||||||
- Support building rpm packages.
|
|
||||||
- Guidance
|
|
||||||
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
|
|
||||||
- Profiles
|
|
||||||
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
|
|
||||||
- `properties` object has a new `weight_name` field, default value is "duration"
|
|
||||||
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
|
|
||||||
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
|
|
||||||
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
|
|
||||||
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
|
|
||||||
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
|
|
||||||
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
|
|
||||||
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
|
|
||||||
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
|
|
||||||
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
|
|
||||||
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
|
|
||||||
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
|
|
||||||
- Infrastructure
|
|
||||||
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
|
|
||||||
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
|
|
||||||
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
|
|
||||||
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
|
|
||||||
- Tools:
|
|
||||||
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
|
|
||||||
- Trip Plugin
|
|
||||||
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
|
|
||||||
|
|
||||||
# 5.5.1
|
|
||||||
- Changes from 5.5.0
|
|
||||||
- API:
|
|
||||||
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
|
|
||||||
- Bugfixes
|
|
||||||
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
|
|
||||||
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
|
|
||||||
|
|
||||||
# 5.5.0
|
# 5.5.0
|
||||||
- Changes from 5.4.0
|
- Changes from 5.4.0
|
||||||
- API:
|
- API:
|
||||||
@@ -53,10 +5,6 @@
|
|||||||
- Shared memory now allows for multiple clients (multiple instances of libosrm on the same segment)
|
- Shared memory now allows for multiple clients (multiple instances of libosrm on the same segment)
|
||||||
- Polyline geometries can now be requested with precision 5 as well as with precision 6
|
- Polyline geometries can now be requested with precision 5 as well as with precision 6
|
||||||
- Profiles
|
- Profiles
|
||||||
- the car profile has been refactored into smaller functions
|
|
||||||
- get_value_by_key() is now guaranteed never to return empty strings, nil is returned instead.
|
|
||||||
- debug.lua was added to make it easier to test/develop profile code.
|
|
||||||
- `car.lua` now depends on lib/set.lua and lib/sequence.lua
|
|
||||||
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
|
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
|
||||||
- replaced lhs/rhs profiles by using test defined profiles
|
- replaced lhs/rhs profiles by using test defined profiles
|
||||||
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
|
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
|
||||||
@@ -67,7 +15,6 @@
|
|||||||
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
|
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
|
||||||
- Corrected the bearings returned for intermediate steps - requires reprocessing
|
- Corrected the bearings returned for intermediate steps - requires reprocessing
|
||||||
- Improved turn locations for collapsed turns
|
- Improved turn locations for collapsed turns
|
||||||
- Sliproad classification refinements: the situations we detect as Sliproads now resemble more closely the reality
|
|
||||||
- Trip Plugin
|
- Trip Plugin
|
||||||
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
|
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
@@ -75,17 +22,8 @@
|
|||||||
- fixed compile errors in tile unit-test framework
|
- fixed compile errors in tile unit-test framework
|
||||||
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
|
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
|
||||||
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
|
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
|
||||||
- fixed a bug in the tile plugin that resulted in discovering invalid edges for connections
|
|
||||||
- improved error messages when missing files during traffic updates (#3114)
|
|
||||||
- For single coordinate geometries the GeoJSON `Point` encoding was broken. We now always emit `LineString`s even in the one-coordinate-case (backwards compatible) (#3425)
|
|
||||||
- Debug Tiles
|
- Debug Tiles
|
||||||
- Added support for turn penalties
|
- Added support for turn penalties
|
||||||
- Internals
|
|
||||||
- Internal/Shared memory datafacades now share common memory layout and data loading code
|
|
||||||
- File reading now has much better error handling
|
|
||||||
- Misc
|
|
||||||
- Progress indicators now print newlines when stdout is not a TTY
|
|
||||||
- Prettier API documentation now generated via `npm run build-api-docs` output `build/docs`
|
|
||||||
|
|
||||||
# 5.4.3
|
# 5.4.3
|
||||||
- Changes from 5.4.2
|
- Changes from 5.4.2
|
||||||
@@ -425,3 +363,5 @@
|
|||||||
- `properties.use_turn_restrictions`
|
- `properties.use_turn_restrictions`
|
||||||
- `properties.u_turn_penalty`
|
- `properties.u_turn_penalty`
|
||||||
- `properties.allow_u_turn_at_via`
|
- `properties.allow_u_turn_at_via`
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+119
-218
@@ -7,65 +7,55 @@ Please create a directory and run cmake from there, passing the path to this sou
|
|||||||
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
|
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# detect if this is included as subproject and if so expose
|
|
||||||
# some variables to its parent scope
|
|
||||||
get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY)
|
|
||||||
if(BUILD_AS_SUBPROJECT)
|
|
||||||
message(STATUS "Building libosrm as subproject.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(ENABLE_MASON "Use mason for dependencies" OFF)
|
option(ENABLE_MASON "Use mason for dependencies" OFF)
|
||||||
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
||||||
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
||||||
option(BUILD_PACKAGE "Build OSRM package" OFF)
|
option(BUILD_COMPONENTS "Build osrm-components" OFF)
|
||||||
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
||||||
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
||||||
option(ENABLE_LTO "Use LTO if available" OFF)
|
option(ENABLE_LTO "Use LTO if available" ON)
|
||||||
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||||
|
|
||||||
if(ENABLE_MASON)
|
if(ENABLE_MASON)
|
||||||
|
|
||||||
# versions in use
|
# versions in use
|
||||||
set(MASON_BOOST_VERSION "1.63.0")
|
set(MASON_CLANG_VERSION "3.8.1")
|
||||||
|
set(MASON_BOOST_VERSION "1.61.0")
|
||||||
set(MASON_STXXL_VERSION "1.4.1")
|
set(MASON_STXXL_VERSION "1.4.1")
|
||||||
set(MASON_EXPAT_VERSION "2.2.0")
|
set(MASON_EXPAT_VERSION "2.1.1")
|
||||||
set(MASON_LUA_VERSION "5.2.4")
|
set(MASON_LUA_VERSION "5.2.4")
|
||||||
|
set(MASON_LUABIND_VERSION "e414c57bcb687bb3091b7c55bbff6947f052e46b")
|
||||||
set(MASON_BZIP2_VERSION "1.0.6")
|
set(MASON_BZIP2_VERSION "1.0.6")
|
||||||
set(MASON_TBB_VERSION "2017_20161128")
|
set(MASON_TBB_VERSION "43_20150316")
|
||||||
|
set(MASON_CCACHE_VERSION "3.3.1")
|
||||||
|
|
||||||
message(STATUS "Enabling mason")
|
message(STATUS "Enabling mason")
|
||||||
|
|
||||||
find_program(CURL_FOUND curl)
|
|
||||||
if(NOT CURL_FOUND)
|
|
||||||
message(FATAL_ERROR "curl command required with -DENABLE_MASON")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(MASON_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason)
|
set(MASON_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason.cmake)
|
||||||
|
if(NOT CMAKE_CXX_COMPILER)
|
||||||
|
mason_use(clang++ VERSION ${MASON_CLANG_VERSION})
|
||||||
|
message(STATUS "Setting compiler to clang++ ${MASON_CLANG_VERSION} (via mason) ${MASON_PACKAGE_clang++_PREFIX}/bin/clang++")
|
||||||
|
set(CMAKE_CXX_COMPILER "${MASON_PACKAGE_clang++_PREFIX}/bin/clang++")
|
||||||
|
set(CMAKE_C_COMPILER "${MASON_PACKAGE_clang++_PREFIX}/bin/clang")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# be compatible with version handling before cmake 3.x
|
|
||||||
if (POLICY CMP0048)
|
|
||||||
cmake_policy(SET CMP0048 OLD)
|
|
||||||
endif()
|
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
set(OSRM_VERSION_MINOR 5)
|
set(OSRM_VERSION_MINOR 5)
|
||||||
set(OSRM_VERSION_PATCH 0)
|
set(OSRM_VERSION_PATCH 0)
|
||||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
|
||||||
|
|
||||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
|
|
||||||
# these two functions build up custom variables:
|
# these two functions build up custom variables:
|
||||||
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
|
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
|
||||||
# These variables we want to pass to
|
# These variables we want to pass to
|
||||||
# include_directories and add_definitions for both
|
# include_directories and add_definitions for both
|
||||||
# this build and for sharing externally via pkg-config
|
# this build and for sharing externally via pkg-config
|
||||||
|
|
||||||
function(add_dependency_includes includes)
|
function(add_dependency_includes includes)
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${includes}")
|
list(APPEND OSRM_INCLUDE_PATHS "${includes}")
|
||||||
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
|
set(OSRM_INCLUDE_PATHS "${OSRM_INCLUDE_PATHS}" PARENT_SCOPE)
|
||||||
endfunction(add_dependency_includes)
|
endfunction(add_dependency_includes)
|
||||||
|
|
||||||
function(add_dependency_defines defines)
|
function(add_dependency_defines defines)
|
||||||
@@ -76,7 +66,6 @@ endfunction(add_dependency_defines)
|
|||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
@@ -92,21 +81,16 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
|
|||||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
|
||||||
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
|
||||||
endif()
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
|
||||||
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)
|
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/)
|
||||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
|
|
||||||
|
add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
|
||||||
|
"-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FingerPrint-Config.cmake"
|
||||||
|
COMMENT "Configuring revision fingerprint"
|
||||||
|
VERBATIM)
|
||||||
|
|
||||||
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
|
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
|
||||||
|
|
||||||
@@ -128,6 +112,7 @@ add_library(STORAGE OBJECT ${StorageGlob})
|
|||||||
add_library(ENGINE OBJECT ${EngineGlob})
|
add_library(ENGINE OBJECT ${EngineGlob})
|
||||||
add_library(SERVER OBJECT ${ServerGlob})
|
add_library(SERVER OBJECT ${ServerGlob})
|
||||||
|
|
||||||
|
add_dependencies(UTIL FingerPrintConfigure)
|
||||||
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
|
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
|
||||||
add_executable(osrm-extract src/tools/extract.cpp)
|
add_executable(osrm-extract src/tools/extract.cpp)
|
||||||
@@ -144,7 +129,6 @@ if(ENABLE_GOLD_LINKER)
|
|||||||
if("${LD_VERSION}" MATCHES "GNU gold")
|
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
|
||||||
message(STATUS "Using GNU gold as linker.")
|
message(STATUS "Using GNU gold as linker.")
|
||||||
|
|
||||||
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
|
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
|
||||||
@@ -199,8 +183,7 @@ endif()
|
|||||||
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
||||||
message(STATUS "Configuring release mode optimizations")
|
message(STATUS "Configuring release mode optimizations")
|
||||||
# Check if LTO is available
|
# Check if LTO is available
|
||||||
check_cxx_compiler_flag("-Wl,-flto" LTO_AVAILABLE)
|
check_cxx_compiler_flag("-flto" LTO_AVAILABLE)
|
||||||
|
|
||||||
if(ENABLE_LTO AND LTO_AVAILABLE)
|
if(ENABLE_LTO AND LTO_AVAILABLE)
|
||||||
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||||
# GCC in addition allows parallelizing LTO
|
# GCC in addition allows parallelizing LTO
|
||||||
@@ -215,57 +198,27 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
|||||||
check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS)
|
check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS)
|
||||||
if(LTO_WORKS)
|
if(LTO_WORKS)
|
||||||
message(STATUS "LTO working")
|
message(STATUS "LTO working")
|
||||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -flto")
|
|
||||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -flto")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
|
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "LTO broken")
|
message(STATUS "LTO broken")
|
||||||
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
||||||
set(ENABLE_LTO Off)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
|
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
|
||||||
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
|
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
|
||||||
find_program(GCC_AR gcc-ar)
|
message(STATUS "Using gcc specific binutils for LTO.")
|
||||||
find_program(GCC_RANLIB gcc-ranlib)
|
set(CMAKE_AR "/usr/bin/gcc-ar")
|
||||||
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")
|
||||||
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
|
|
||||||
else()
|
|
||||||
message(STATUS "Using GCC specific binutils for LTO:")
|
|
||||||
message(STATUS " ${GCC_AR}")
|
|
||||||
message(STATUS " ${GCC_RANLIB}")
|
|
||||||
set(CMAKE_AR ${GCC_AR})
|
|
||||||
set(CMAKE_RANLIB ${GCC_RANLIB})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Same for clang LTO requires their own toolchain
|
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
find_program(LLVM_AR llvm-ar)
|
|
||||||
find_program(LLVM_RANLIB llvm-ranlib)
|
|
||||||
if ("${LLVM_AR}" STREQUAL "LLVM_AR-NOTFOUND" OR "${LLVM_RANLIB}" STREQUAL "LLVM_RANLIB-NOTFOUND")
|
|
||||||
message(WARNING "LLVM specific binutils not found.")
|
|
||||||
else()
|
|
||||||
message(STATUS "Using LLVM specific binutils for LTO:")
|
|
||||||
message(STATUS " ${LLVM_AR}")
|
|
||||||
message(STATUS " ${LLVM_RANLIB}")
|
|
||||||
set(CMAKE_AR ${LLVM_AR})
|
|
||||||
set(CMAKE_RANLIB ${LLVM_RANLIB})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
|
||||||
message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038")
|
message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038")
|
||||||
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
||||||
set(ENABLE_LTO Off)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE AND ENABLE_MASON AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
|
if (ENABLE_MASON AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
|
||||||
message(WARNING "ENABLE_MASON and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux systems currently")
|
message(WARNING "ENABLE_MASON and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux systems currently")
|
||||||
message(WARNING "For more details see: https://github.com/Project-OSRM/osrm-backend/issues/3202")
|
message(WARNING "For more details see: https://github.com/Project-OSRM/osrm-backend/issues/3202")
|
||||||
endif()
|
endif()
|
||||||
@@ -281,12 +234,11 @@ if (ENABLE_COVERAGE)
|
|||||||
endif()
|
endif()
|
||||||
if (ENABLE_SANITIZER)
|
if (ENABLE_SANITIZER)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configuring compilers
|
# Configuring compilers
|
||||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
|
||||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||||
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
||||||
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
||||||
@@ -294,7 +246,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|||||||
set(COLOR_FLAG "")
|
set(COLOR_FLAG "")
|
||||||
endif()
|
endif()
|
||||||
# using GCC
|
# using GCC
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
|
||||||
if(WIN32) # using mingw
|
if(WIN32) # using mingw
|
||||||
add_dependency_defines(-DWIN32)
|
add_dependency_defines(-DWIN32)
|
||||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||||
@@ -328,11 +280,9 @@ if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld
|
|||||||
endif()
|
endif()
|
||||||
# Default linker optimization flags
|
# Default linker optimization flags
|
||||||
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common")
|
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common")
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using unknown linker, not setting linker optimizations")
|
message(STATUS "Using unknown linker, not setting linker optimizations")
|
||||||
endif ()
|
endif ()
|
||||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} ${LINKER_FLAGS}")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
@@ -340,7 +290,6 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|||||||
# Activate C++1y
|
# Activate C++1y
|
||||||
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
||||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++1y")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configuring other platform dependencies
|
# Configuring other platform dependencies
|
||||||
@@ -407,6 +356,10 @@ if(ENABLE_MASON)
|
|||||||
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
|
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
|
||||||
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
|
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
|
||||||
|
|
||||||
|
mason_use(luabind_lua524 VERSION ${MASON_LUABIND_VERSION})
|
||||||
|
add_dependency_includes(${MASON_PACKAGE_luabind_lua524_INCLUDE_DIRS})
|
||||||
|
set(LUABIND_LIBRARY ${MASON_PACKAGE_luabind_lua524_STATIC_LIBS})
|
||||||
|
|
||||||
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
|
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
|
||||||
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
|
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
|
||||||
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
|
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
|
||||||
@@ -418,42 +371,49 @@ if(ENABLE_MASON)
|
|||||||
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
|
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
|
||||||
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
|
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
|
||||||
endif()
|
endif()
|
||||||
set(TBB_LINKER_RPATHS "")
|
|
||||||
foreach(libpath ${MASON_PACKAGE_tbb_LIBRARY_DIRS})
|
foreach(libpath ${MASON_PACKAGE_tbb_LIBRARY_DIRS})
|
||||||
set(TBB_LINKER_RPATHS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,${libpath}")
|
if(UNIX AND NOT APPLE)
|
||||||
|
set(LINKER_FLAGS "-Wl,-rpath,${libpath}")
|
||||||
|
elseif(APPLE)
|
||||||
|
set(LINKER_FLAGS "-Wl,-rpath, -Wl,${libpath}")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
file(GLOB TBBGlob ${libpath}/*.*)
|
file(GLOB TBBGlob ${libpath}/*.*)
|
||||||
install(FILES ${TBBGlob} DESTINATION lib)
|
install(FILES ${TBBGlob} DESTINATION lib)
|
||||||
endforeach()
|
endforeach()
|
||||||
if(APPLE)
|
|
||||||
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@executable_path")
|
|
||||||
elseif(UNIX)
|
|
||||||
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
if(BUILD_COMPONENTS)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
message(FATAL_ERROR "BUILD_COMPONENTS is not supported with ENABLE_MASON")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
endif()
|
||||||
|
|
||||||
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
|
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
||||||
|
|
||||||
# note: we avoid calling find_package(Osmium ...) here to ensure that the
|
if(ENABLE_CCACHE)
|
||||||
# expat and bzip2 are used from mason rather than the system
|
mason_use(ccache VERSION ${MASON_CCACHE_VERSION})
|
||||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
|
message(STATUS "Setting ccache to ccache ${MASON_CCACHE_VERSION} (via mason) ${MASON_PACKAGE_ccache_PREFIX}/bin/ccache")
|
||||||
|
message(STATUS "Using ccache to speed up incremental builds")
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${MASON_PACKAGE_ccache_PREFIX}/bin/ccache)
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${MASON_PACKAGE_ccache_PREFIX}/bin/ccache)
|
||||||
|
set(ENV{CCACHE_CPP2} "true")
|
||||||
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||||
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
||||||
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
|
|
||||||
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(TBB REQUIRED)
|
find_package(TBB REQUIRED)
|
||||||
add_dependency_includes(${TBB_INCLUDE_DIR})
|
add_dependency_includes(${TBB_INCLUDE_DIR})
|
||||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
find_package(Luabind REQUIRED)
|
||||||
|
add_dependency_includes(${LUABIND_INCLUDE_DIR})
|
||||||
|
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
|
||||||
|
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||||
|
|
||||||
find_package(EXPAT REQUIRED)
|
find_package(EXPAT REQUIRED)
|
||||||
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
||||||
@@ -464,32 +424,9 @@ else()
|
|||||||
find_package(BZip2 REQUIRED)
|
find_package(BZip2 REQUIRED)
|
||||||
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
||||||
|
|
||||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
if(BUILD_COMPONENTS)
|
||||||
IF (LUA_FOUND)
|
find_package(GDAL)
|
||||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
endif()
|
||||||
ELSE()
|
|
||||||
FIND_PACKAGE(Lua 5.1 EXACT)
|
|
||||||
IF (LUA_FOUND)
|
|
||||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
|
||||||
ELSE()
|
|
||||||
# Now fall back to a lua verison without exact
|
|
||||||
# in case this cmake version also forces patch versions
|
|
||||||
FIND_PACKAGE(Lua 5.2)
|
|
||||||
IF (LUA_FOUND)
|
|
||||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
|
||||||
ELSE()
|
|
||||||
FIND_PACKAGE(Lua 5.1)
|
|
||||||
IF (LUA_FOUND)
|
|
||||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
|
||||||
ELSE()
|
|
||||||
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
|
|
||||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
|
||||||
|
|
||||||
# add a target to generate API documentation with Doxygen
|
# add a target to generate API documentation with Doxygen
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
@@ -502,23 +439,17 @@ else()
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# note libosmium depends on expat and bzip2
|
# prefix compilation with ccache by default if available and on clang or gcc
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
|
||||||
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
find_program(CCACHE_FOUND ccache)
|
||||||
find_package(Osmium REQUIRED COMPONENTS io)
|
if(CCACHE_FOUND)
|
||||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
message(STATUS "Using ccache to speed up incremental builds")
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||||
endif()
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||||
|
set(ENV{CCACHE_CPP2} "true")
|
||||||
# prefix compilation with ccache by default if available and on clang or gcc
|
endif()
|
||||||
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
|
|
||||||
find_program(CCACHE_FOUND ccache)
|
|
||||||
if(CCACHE_FOUND)
|
|
||||||
message(STATUS "Using ccache to speed up incremental builds")
|
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
||||||
set(ENV{CCACHE_CPP2} "true")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# even with mason builds we want to link to system zlib
|
# even with mason builds we want to link to system zlib
|
||||||
@@ -526,10 +457,16 @@ endif()
|
|||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
|
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
||||||
|
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
||||||
|
find_package(Osmium REQUIRED COMPONENTS io)
|
||||||
|
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
||||||
|
|
||||||
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||||
endif()
|
endif()
|
||||||
@@ -546,7 +483,7 @@ if(OPENMP_FOUND)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(${OSRM_DEFINES})
|
add_definitions(${OSRM_DEFINES})
|
||||||
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})
|
include_directories(SYSTEM ${OSRM_INCLUDE_PATHS})
|
||||||
|
|
||||||
set(BOOST_BASE_LIBRARIES
|
set(BOOST_BASE_LIBRARIES
|
||||||
${Boost_DATE_TIME_LIBRARY}
|
${Boost_DATE_TIME_LIBRARY}
|
||||||
@@ -562,10 +499,10 @@ set(BOOST_ENGINE_LIBRARIES
|
|||||||
${BOOST_BASE_LIBRARIES})
|
${BOOST_BASE_LIBRARIES})
|
||||||
|
|
||||||
# Binaries
|
# Binaries
|
||||||
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BOOST_BASE_LIBRARIES})
|
||||||
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY} ${BOOST_BASE_LIBRARIES})
|
||||||
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
target_link_libraries(osrm-contract ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BOOST_BASE_LIBRARIES} ${TBB_LIBRARIES} osrm_contract)
|
||||||
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BOOST_ENGINE_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
||||||
|
|
||||||
set(EXTRACTOR_LIBRARIES
|
set(EXTRACTOR_LIBRARIES
|
||||||
${BZIP2_LIBRARIES}
|
${BZIP2_LIBRARIES}
|
||||||
@@ -573,6 +510,7 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${EXPAT_LIBRARIES}
|
${EXPAT_LIBRARIES}
|
||||||
|
${LUABIND_LIBRARY}
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${OSMIUM_LIBRARIES}
|
${OSMIUM_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
@@ -582,6 +520,7 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
set(CONTRACTOR_LIBRARIES
|
set(CONTRACTOR_LIBRARIES
|
||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
|
${LUABIND_LIBRARY}
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
@@ -612,25 +551,33 @@ target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
|
|||||||
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
||||||
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
||||||
|
|
||||||
# BUILD_COMPONENTS
|
if(BUILD_COMPONENTS)
|
||||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
if(GDAL_FOUND)
|
||||||
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
install(TARGETS osrm-components DESTINATION bin)
|
target_link_libraries(osrm-components ${TBB_LIBRARIES})
|
||||||
|
include_directories(SYSTEM ${GDAL_INCLUDE_DIR})
|
||||||
|
target_link_libraries(osrm-components ${GDAL_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
||||||
|
install(TARGETS osrm-components DESTINATION bin)
|
||||||
|
else()
|
||||||
|
message(WARNING "libgdal and/or development headers not found")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(BUILD_TOOLS)
|
if(BUILD_TOOLS)
|
||||||
message(STATUS "Activating OSRM internal tools")
|
message(STATUS "Activating OSRM internal tools")
|
||||||
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
||||||
|
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
|
target_link_libraries(osrm-unlock-all ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
if(UNIX AND NOT APPLE)
|
||||||
|
target_link_libraries(osrm-unlock-all rt)
|
||||||
|
endif()
|
||||||
|
add_executable(osrm-springclean src/tools/springclean.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
|
target_link_libraries(osrm-springclean ${BOOST_BASE_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
||||||
|
install(TARGETS osrm-unlock-all DESTINATION bin)
|
||||||
find_package(Shapefile) # package libshp-dev
|
install(TARGETS osrm-springclean DESTINATION bin)
|
||||||
if(Shapefile_FOUND)
|
|
||||||
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
|
|
||||||
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
|
|
||||||
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LIBSHAPEFILE_LIBRARY})
|
|
||||||
install(TARGETS osrm-extract-conditionals DESTINATION bin)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_ASSERTIONS)
|
if (ENABLE_ASSERTIONS)
|
||||||
@@ -646,7 +593,7 @@ set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|||||||
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp)
|
file(GLOB VariantGlob third_party/variant/*.hpp)
|
||||||
file(GLOB LibraryGlob include/osrm/*.hpp)
|
file(GLOB LibraryGlob include/osrm/*.hpp)
|
||||||
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
||||||
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
|
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
|
||||||
@@ -661,7 +608,7 @@ install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
|
|||||||
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
|
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
|
||||||
install(FILES ${LibraryGlob} DESTINATION include/osrm)
|
install(FILES ${LibraryGlob} DESTINATION include/osrm)
|
||||||
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
||||||
install(FILES ${VariantGlob} DESTINATION include/mapbox)
|
install(FILES ${VariantGlob} DESTINATION include/variant)
|
||||||
install(TARGETS osrm-extract DESTINATION bin)
|
install(TARGETS osrm-extract DESTINATION bin)
|
||||||
install(TARGETS osrm-contract DESTINATION bin)
|
install(TARGETS osrm-contract DESTINATION bin)
|
||||||
install(TARGETS osrm-datastore DESTINATION bin)
|
install(TARGETS osrm-datastore DESTINATION bin)
|
||||||
@@ -671,16 +618,12 @@ install(TARGETS osrm_extract DESTINATION lib)
|
|||||||
install(TARGETS osrm_contract DESTINATION lib)
|
install(TARGETS osrm_contract DESTINATION lib)
|
||||||
install(TARGETS osrm_store DESTINATION lib)
|
install(TARGETS osrm_store DESTINATION lib)
|
||||||
|
|
||||||
|
foreach(lib ${ENGINE_LIBRARIES})
|
||||||
|
set(ENGINE_LIBRARY_LISTING "${ENGINE_LIBRARY_LISTING} ${lib}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Install profiles and support library to /usr/local/share/osrm/profiles by default
|
if(BUILD_DEBIAN_PACKAGE)
|
||||||
set(DefaultProfilesDir profiles)
|
include(CPackDebianConfig)
|
||||||
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
|
|
||||||
|
|
||||||
# Setup exporting variables for pkgconfig and subproject
|
|
||||||
#
|
|
||||||
|
|
||||||
if(BUILD_PACKAGE)
|
|
||||||
include(CPackConfig)
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -689,36 +632,12 @@ function(JOIN VALUES GLUE OUTPUT)
|
|||||||
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
JOIN("${OSRM_DEFINES}" " " TMP_OSRM_DEFINES)
|
# Set up variables, then write to pkgconfig file
|
||||||
set(LibOSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${TMP_OSRM_DEFINES}")
|
JOIN("${OSRM_DEFINES}" " " OSRM_DEFINES_STRING)
|
||||||
set(LibOSRM_LDFLAGS "${OSRM_LDFLAGS}")
|
JOIN("-I${OSRM_INCLUDE_PATHS}" " -I" OSRM_INCLUDE_PATHS_STRING)
|
||||||
|
|
||||||
if(BUILD_AS_SUBPROJECT)
|
|
||||||
set(LibOSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}" PARENT_SCOPE)
|
|
||||||
set(LibOSRM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
|
|
||||||
set(LibOSRM_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
|
||||||
set(LibOSRM_LIBRARIES "osrm" PARENT_SCOPE)
|
|
||||||
set(LibOSRM_DEPENDENT_LIBRARIES "${ENGINE_LIBRARIES}" PARENT_SCOPE)
|
|
||||||
set(LibOSRM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/osrm"
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party"
|
|
||||||
"${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
|
|
||||||
set(LibOSRM_LIBRARY_DIRS "${LibOSRM_LIBRARY_DIR}" PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# pkgconfig defines
|
|
||||||
set(PKGCONFIG_OSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}")
|
|
||||||
set(PKGCONFIG_OSRM_LDFLAGS "${LibOSRM_LDFLAGS}")
|
|
||||||
set(PKGCONFIG_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
|
||||||
set(PKGCONFIG_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
|
|
||||||
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}")
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm")
|
|
||||||
JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
|
|
||||||
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
|
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
|
||||||
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)
|
||||||
|
|
||||||
# uninstall target
|
# uninstall target
|
||||||
configure_file(
|
configure_file(
|
||||||
@@ -741,26 +660,8 @@ if (ENABLE_FUZZING)
|
|||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fsanitize=address")
|
|
||||||
|
|
||||||
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
|
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
|
||||||
|
|
||||||
add_subdirectory(fuzz)
|
add_subdirectory(fuzz)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
## add headers sanity check target that includes all headers independently
|
|
||||||
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
|
|
||||||
file(GLOB_RECURSE headers_to_check
|
|
||||||
${PROJECT_BINARY_DIR}/*.hpp
|
|
||||||
${PROJECT_SOURCE_DIR}/include/*.hpp)
|
|
||||||
foreach(header ${headers_to_check})
|
|
||||||
get_filename_component(filename ${header} NAME_WE)
|
|
||||||
set(filename "${check_headers_dir}/${filename}.cpp")
|
|
||||||
if (NOT EXISTS ${filename})
|
|
||||||
file(WRITE ${filename} "#include \"${header}\"\n")
|
|
||||||
endif()
|
|
||||||
list(APPEND sources ${filename})
|
|
||||||
endforeach()
|
|
||||||
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
|
|
||||||
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
|
|
||||||
|
|||||||
@@ -7,28 +7,6 @@ You can add a :+1: emoji to the issue if you want to express interest in this.
|
|||||||
# Developer
|
# Developer
|
||||||
|
|
||||||
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
||||||
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
|
|
||||||
To save development time a local hook `.git/hooks/pre-push`
|
|
||||||
```
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
remote="$1"
|
|
||||||
if [ x"$remote" = xorigin ] ; then
|
|
||||||
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
|
|
||||||
echo "Rejected push to $remote/master" ; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
./scripts/format.sh
|
|
||||||
if [ $? -ne 0 ] ; then
|
|
||||||
echo "Unstaged format changes" ; exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
```
|
|
||||||
could check code format, modify a local repository and reject push due to unstaged formatting changes.
|
|
||||||
Also `pre-push` hook rejects direct pushes to `origin/master`.
|
|
||||||
|
|
||||||
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
|
|
||||||
|
|
||||||
|
|
||||||
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
||||||
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
||||||
|
|||||||
@@ -1,87 +1,64 @@
|
|||||||
## Open Source Routing Machine
|
## About
|
||||||
|
|
||||||
| Linux / macOS | Windows | Code Coverage |
|
The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
|
||||||
| ------------- | ------- | ------------- |
|
|
||||||
| [](https://travis-ci.org/Project-OSRM/osrm-backend) | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
|
||||||
|
|
||||||
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
|
## Current build status
|
||||||
|
|
||||||
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
|
| build config | status |
|
||||||
- Nearest - Snaps coordinates to the street network and returns the nearest matches
|
|:-------------|:-------|
|
||||||
- Route - Finds the fastest route between coordinates
|
| Linux | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
||||||
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
|
| Windows | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||||
- Match - Snaps noisy GPS traces to the road network in the most plausible way
|
| Coverage | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||||
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
|
|
||||||
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
|
|
||||||
|
|
||||||
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
|
|
||||||
|
|
||||||
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
|
||||||
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
|
|
||||||
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
|
|
||||||
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
|
||||||
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
|
- IRC: server `irc.oftc.net`, channel: `#osrm` (see: `https://www.oftc.net`, and for a webchat: `https://webchat.oftc.net`)
|
||||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||||
|
|
||||||
## Quick Start
|
## Building
|
||||||
|
|
||||||
The following targets Ubuntu 16.04.
|
For instructions on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||||
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
|
||||||
|
|
||||||
#### Install dependencies
|
To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo apt install build-essential git cmake pkg-config \
|
|
||||||
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
|
|
||||||
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Compile and install OSRM binaries:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
mkdir -p build
|
|
||||||
cd build
|
|
||||||
cmake ..
|
|
||||||
cmake --build .
|
|
||||||
sudo cmake --build . --target install
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Pre-process the extract and start the HTTP server
|
|
||||||
|
|
||||||
```
|
|
||||||
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
|
|
||||||
osrm-contract berlin-latest.osrm
|
|
||||||
osrm-routed berlin-latest.osrm
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Running Queries
|
|
||||||
|
|
||||||
```
|
|
||||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
### Full documentation
|
### Full documentation
|
||||||
|
|
||||||
- [Hosted documentation](http://project-osrm.org)
|
|
||||||
- [osrm-routed HTTP API documentation](docs/http.md)
|
- [osrm-routed HTTP API documentation](docs/http.md)
|
||||||
- [libosrm API documentation](docs/libosrm.md)
|
- [libosrm API documentation](docs/libosrm.md)
|
||||||
|
|
||||||
|
### Quick start
|
||||||
|
|
||||||
|
Building OSRM assuming all dependencies are installed:
|
||||||
|
|
||||||
|
```
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||||
|
cmake --build .
|
||||||
|
sudo cmake --build . --target install
|
||||||
|
```
|
||||||
|
|
||||||
|
Loading preparing a dataset and starting the server:
|
||||||
|
|
||||||
|
```
|
||||||
|
osrm-extract data.osm.pbf -p profiles/car.lua
|
||||||
|
osrm-contract data.osrm
|
||||||
|
osrm-routed data.osrm
|
||||||
|
```
|
||||||
|
|
||||||
|
Running a query on your local server:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||||
|
```
|
||||||
|
|
||||||
### Running a request against the Demo Server
|
### Running a request against the Demo Server
|
||||||
|
|
||||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
First read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||||
Simple query with instructions and alternatives on Berlin:
|
|
||||||
|
Then run simple query with instructions and alternatives on Berlin:
|
||||||
|
|
||||||
```
|
```
|
||||||
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||||
@@ -109,3 +86,4 @@ When using the code in a (scientific) publication, please cite
|
|||||||
address = {New York, NY, USA},
|
address = {New York, NY, USA},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+2
-13
@@ -10,10 +10,10 @@ ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
|||||||
ECHO cmake^: && cmake --version
|
ECHO cmake^: && cmake --version
|
||||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
||||||
|
|
||||||
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
|
cmake --version | findstr /C:"3.7.0" && GOTO CMAKE_OK
|
||||||
|
|
||||||
:CMAKE_NOT_OK
|
:CMAKE_NOT_OK
|
||||||
SET CMAKE_VERSION=3.7.1
|
SET CMAKE_VERSION=3.7.0-rc2
|
||||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||||
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
@@ -119,27 +119,16 @@ SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
|||||||
ECHO running extractor-tests.exe ...
|
ECHO running extractor-tests.exe ...
|
||||||
unit_tests\%Configuration%\extractor-tests.exe
|
unit_tests\%Configuration%\extractor-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO running engine-tests.exe ...
|
ECHO running engine-tests.exe ...
|
||||||
unit_tests\%Configuration%\engine-tests.exe
|
unit_tests\%Configuration%\engine-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO running util-tests.exe ...
|
ECHO running util-tests.exe ...
|
||||||
unit_tests\%Configuration%\util-tests.exe
|
unit_tests\%Configuration%\util-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO running server-tests.exe ...
|
ECHO running server-tests.exe ...
|
||||||
unit_tests\%Configuration%\server-tests.exe
|
unit_tests\%Configuration%\server-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO running library-tests.exe ...
|
|
||||||
SET test_region=monaco
|
|
||||||
SET test_osm=%test_region%.osm.pbf
|
|
||||||
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
|
|
||||||
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
|
||||||
%Configuration%\osrm-contract.exe %test_region%.osrm
|
|
||||||
unit_tests\%Configuration%\library-tests.exe %test_region%.osrm
|
|
||||||
|
|
||||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
||||||
ECHO ========= CREATING PACKAGES ==========
|
ECHO ========= CREATING PACKAGES ==========
|
||||||
|
|
||||||
|
|||||||
+1
-11
@@ -3,9 +3,6 @@ environment:
|
|||||||
- configuration: Release
|
- configuration: Release
|
||||||
# - configuration: Debug
|
# - configuration: Debug
|
||||||
|
|
||||||
install:
|
|
||||||
- ps: Install-Product node 6
|
|
||||||
|
|
||||||
# scripts that are called at very beginning, before repo cloning
|
# scripts that are called at very beginning, before repo cloning
|
||||||
init:
|
init:
|
||||||
- git config --global core.autocrlf input
|
- git config --global core.autocrlf input
|
||||||
@@ -20,14 +17,7 @@ platform: x64
|
|||||||
build_script:
|
build_script:
|
||||||
- CALL appveyor-build.bat
|
- CALL appveyor-build.bat
|
||||||
|
|
||||||
before_test:
|
test: off
|
||||||
- node --version
|
|
||||||
- npm --version
|
|
||||||
- npm install
|
|
||||||
- npm link
|
|
||||||
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
|
|
||||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
|
||||||
- npm test
|
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: osrm_Release.zip
|
- path: osrm_Release.zip
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
||||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
|
|
||||||
ENDIF()
|
|
||||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
|
|
||||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
|
|
||||||
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
|
|
||||||
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
|
|
||||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
|
||||||
|
|
||||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
|
|
||||||
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
|
|
||||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
|
||||||
|
|
||||||
SET(CPACK_STRIP_FILES "TRUE")
|
|
||||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
|
||||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
|
|
||||||
|
|
||||||
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
|
||||||
if(DPKG_PROGRAM)
|
|
||||||
SET(CPACK_GENERATOR "DEB")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${DPKG_PROGRAM} --print-architecture
|
|
||||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
|
|
||||||
else(DPKG_PROGRAM)
|
|
||||||
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
|
|
||||||
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
|
|
||||||
if(RPMBUILD_PROGRAM)
|
|
||||||
SET(CPACK_GENERATOR "RPM")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${RPM_PROGRAM} --eval %{_arch}
|
|
||||||
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
|
||||||
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
|
|
||||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
|
||||||
endif(RPMBUILD_PROGRAM)
|
|
||||||
endif(DPKG_PROGRAM)
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
INCLUDE(FindDebArch)
|
||||||
|
|
||||||
|
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||||
|
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
|
||||||
|
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||||
|
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
|
||||||
|
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
|
||||||
|
|
||||||
|
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
|
||||||
|
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||||
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
|
||||||
|
|
||||||
|
# To create a proper Debian/Ubuntu package, the following CMake
|
||||||
|
# options should be used:
|
||||||
|
|
||||||
|
SET(CPACK_STRIP_FILES "TRUE")
|
||||||
|
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||||
|
SET(CPACK_GENERATOR "DEB")
|
||||||
|
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
|
||||||
|
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
|
||||||
|
)
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
|
||||||
|
|
||||||
|
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||||
|
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
|
||||||
+1
-7
@@ -172,18 +172,12 @@ if (LUA_LIBRARY)
|
|||||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||||
find_library(LUA_MATH_LIBRARY m)
|
find_library(LUA_MATH_LIBRARY m)
|
||||||
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||||
|
|
||||||
# include dl library for statically-linked Lua library
|
|
||||||
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
|
||||||
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
|
||||||
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For Windows and Mac, don't need to explicitly include the math library
|
# For Windows and Mac, don't need to explicitly include the math library
|
||||||
else ()
|
else ()
|
||||||
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
# Locate Luabind library
|
||||||
|
# This module defines
|
||||||
|
# LUABIND_FOUND, if false, do not try to link to Luabind
|
||||||
|
# LUABIND_LIBRARIES
|
||||||
|
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
|
||||||
|
|
||||||
|
# First we try using EXACT but in some verison of
|
||||||
|
# cmake this would also match patch versions
|
||||||
|
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||||
|
IF (LUA_FOUND)
|
||||||
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
ELSE()
|
||||||
|
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||||
|
IF (LUA_FOUND)
|
||||||
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
ELSE()
|
||||||
|
# Now fall back to a lua verison without exact
|
||||||
|
# in case this cmake version also forces patch versions
|
||||||
|
FIND_PACKAGE(Lua 5.2)
|
||||||
|
IF (LUA_FOUND)
|
||||||
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
ELSE()
|
||||||
|
FIND_PACKAGE(Lua 5.1)
|
||||||
|
IF (LUA_FOUND)
|
||||||
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
|
||||||
|
HINTS
|
||||||
|
$ENV{LUABIND_DIR}
|
||||||
|
PATH_SUFFIXES luabind include/luabind include
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local
|
||||||
|
/usr
|
||||||
|
/opt/local # DarwinPorts
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LUABIND_LIBRARY
|
||||||
|
NAMES luabind luabind09
|
||||||
|
HINTS
|
||||||
|
$ENV{LUABIND_DIR}
|
||||||
|
PATH_SUFFIXES lib64 lib
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local
|
||||||
|
/usr
|
||||||
|
/opt/local
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LUABIND_LIBRARY_DBG
|
||||||
|
NAMES luabindd
|
||||||
|
HINTS
|
||||||
|
$ENV{LUABIND_DIR}
|
||||||
|
PATH_SUFFIXES lib64 lib
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local
|
||||||
|
/usr
|
||||||
|
/opt/local
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(LUABIND_LIBRARY)
|
||||||
|
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
|
||||||
|
ENDIF(LUABIND_LIBRARY)
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
|
||||||
|
|
||||||
|
IF( NOT LUABIND_FIND_QUIETLY )
|
||||||
|
IF( LUABIND_FOUND )
|
||||||
|
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
|
||||||
|
ENDIF()
|
||||||
|
IF( LUABIND_LIBRARY_DBG )
|
||||||
|
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# - Try to find Shapefile C Library
|
|
||||||
# http://shapelib.maptools.org/
|
|
||||||
#
|
|
||||||
# Exports:
|
|
||||||
# Shapefile_FOUND
|
|
||||||
# LIBSHAPEFILE_INCLUDE_DIR
|
|
||||||
# LIBSHAPEFILE_LIBRARY
|
|
||||||
# Hints:
|
|
||||||
# LIBSHAPEFILE_LIBRARY_DIR
|
|
||||||
|
|
||||||
find_path(LIBSHAPEFILE_INCLUDE_DIR
|
|
||||||
shapefil.h)
|
|
||||||
|
|
||||||
find_library(LIBSHAPEFILE_LIBRARY
|
|
||||||
NAMES shp
|
|
||||||
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(Shapefile DEFAULT_MSG
|
|
||||||
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
|
|
||||||
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
|
||||||
|
set(NEWFILE ${OLDFILE}.tmp)
|
||||||
|
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
|
||||||
|
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
|
||||||
|
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
|
||||||
|
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
|
||||||
|
file(MD5 ${SOURCE_DIR}/include/engine/datafacade/internal_datafacade.hpp MD5OBJECTS)
|
||||||
|
|
||||||
|
CONFIGURE_FILE(${INFILE} ${NEWFILE})
|
||||||
|
|
||||||
|
file(MD5 ${NEWFILE} MD5NEW)
|
||||||
|
|
||||||
|
if (EXISTS ${OLDFILE})
|
||||||
|
file(MD5 ${OLDFILE} MD5OLD)
|
||||||
|
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
|
||||||
|
file(REMOVE_RECURSE ${OLDFILE})
|
||||||
|
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||||
|
else()
|
||||||
|
file(REMOVE_RECURSE ${NEWFILE})
|
||||||
|
message(STATUS "Fingerprint unchanged, not regenerating")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||||
|
endif()
|
||||||
+6
-6
@@ -1,11 +1,11 @@
|
|||||||
prefix=@CMAKE_INSTALL_PREFIX@
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
includedir=@PKGCONFIG_INCLUDE_DIR@
|
includedir=${prefix}/include
|
||||||
libdir=@PKGCONFIG_LIBRARY_DIR@
|
libdir=${prefix}/lib
|
||||||
|
|
||||||
Name: libOSRM
|
Name: libOSRM
|
||||||
Description: Project OSRM library
|
Description: Project OSRM library
|
||||||
Version: v@OSRM_VERSION@
|
Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
|
||||||
Requires:
|
Requires:
|
||||||
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
|
Libs: -L${libdir} -losrm
|
||||||
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
|
Libs.private: @ENGINE_LIBRARY_LISTING@
|
||||||
Cflags: @PKGCONFIG_OSRM_INCLUDE_FLAGS@ @PKGCONFIG_OSRM_CXXFLAGS@
|
Cflags: -I${includedir} -I${includedir}/osrm @OSRM_INCLUDE_PATHS_STRING@ @OSRM_DEFINES_STRING@ @CMAKE_CXX_FLAGS@
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ FROM ubuntu:14.04
|
|||||||
|
|
||||||
RUN apt-get update -y && apt-get install -y software-properties-common
|
RUN apt-get update -y && apt-get install -y software-properties-common
|
||||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
|
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||||
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libboost-all-dev ccache
|
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libluabind-dev libboost-all-dev ccache
|
||||||
RUN apt-get -y install curl cmake cmake-curses-gui git
|
RUN apt-get -y install curl cmake cmake-curses-gui git
|
||||||
|
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we pro
|
|||||||
|
|
||||||
The initialisation to do so looks like this:
|
The initialisation to do so looks like this:
|
||||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
||||||
Make sure to give the guar a name, so it actually gets a lifetime.
|
|
||||||
|
|
||||||
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
|
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
|
||||||
|
|
||||||
|
|||||||
+301
-402
@@ -1,44 +1,50 @@
|
|||||||
## General options
|
## Environent Variables
|
||||||
|
|
||||||
All OSRM HTTP requests use a common structure.
|
### SIGNAL_PARENT_WHEN_READY
|
||||||
|
|
||||||
The following syntax applies to all services, except as noted.
|
If the SIGNAL_PARENT_WHEN_READY environment variable is set osrm-routed will
|
||||||
|
send the USR1 signal to its parent when it will be running and waiting for
|
||||||
|
requests. This could be used to upgrade osrm-routed to a new binary on the fly
|
||||||
|
without any service downtime - no incoming requests will be lost.
|
||||||
|
|
||||||
### Requests
|
### DISABLE_ACCESS_LOGGING
|
||||||
|
|
||||||
```endpoint
|
If the DISABLE_ACCESS_LOGGING environment variable is set osrm-routed will
|
||||||
GET /{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
|
**not** log any http requests to standard output. This can be useful in high
|
||||||
|
traffic setup.
|
||||||
|
|
||||||
|
## HTTP API
|
||||||
|
|
||||||
|
`osrm-routed` supports only `GET` requests of the form. If you your response size
|
||||||
|
exceeds the limits of a simple URL encoding, consider using our [NodeJS bindings](https://github.com/Project-OSRM/node-osrm)
|
||||||
|
or using the [C++ library directly](libosrm.md).
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
|
||||||
```
|
```
|
||||||
|
|
||||||
| Parameter | Description |
|
- `server`: location of the server. Example: `127.0.0.1:5000` (default)
|
||||||
| --- | --- |
|
- `service`: Name of the service to be used. Support are the following services:
|
||||||
| `service` | One of the following values: [`route`](#route-service), [`nearest`](#nearest-service), [`table`](#table-service), [`match`](#match-service), [`trip`](#trip-service), [`tile`](#tile-service) |
|
|
||||||
| `version` | Version of the protocol implemented by the service. `v1` for all OSRM 5.x installations |
|
|
||||||
| `profile` | Mode of transportation, is determined statically by the Lua profile that is used to prepare the data using `osrm-extract`. Typically `car`, `bike` or `foot` if using one of the supplied profiles. |
|
|
||||||
| `coordinates`| String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`. |
|
|
||||||
| `format`| Only `json` is supported at the moment. This parameter is optional and defaults to `json`. |
|
|
||||||
|
|
||||||
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 by default and can be generated using [this package](https://www.npmjs.com/package/polyline).
|
| Service | Description |
|
||||||
|
|-------------|-----------------------------------------------------------|
|
||||||
|
| [`route`](#service-route) | fastest path between given coordinates |
|
||||||
|
| [`nearest`](#service-nearest) | returns the nearest street segment for a given coordinate |
|
||||||
|
| [`table`](#service-table) | computes distance tables for given coordinates |
|
||||||
|
| [`match`](#service-match) | matches given coordinates to the road network |
|
||||||
|
| [`trip`](#service-trip) | Compute the fastest round trip between given coordinates |
|
||||||
|
| [`tile`](#service-tile) | Return vector tiles containing debugging info |
|
||||||
|
|
||||||
|
- `version`: Version of the protocol implemented by the service.
|
||||||
|
- `profile`: Mode of transportation, is determined statically by the Lua profile that is used to prepare the data using `osrm-extract`.
|
||||||
|
- `coordinates`: String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`.
|
||||||
|
- `format`: Only `json` is supported at the moment. This parameter is optional and defaults to `json`.
|
||||||
|
|
||||||
|
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 and can be generated using [this package](https://www.npmjs.com/package/polyline).
|
||||||
To pass parameters to each location some options support an array like encoding:
|
To pass parameters to each location some options support an array like encoding:
|
||||||
|
|
||||||
**Request options**
|
|
||||||
|
|
||||||
| Option | Values | Description |
|
|
||||||
|----------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|
|
||||||
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|
|
||||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|
|
||||||
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|
|
||||||
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
|
|
||||||
|
|
||||||
Where the elements follow the following format:
|
|
||||||
|
|
||||||
| Element | Values |
|
|
||||||
|------------|--------------------------------------------------------|
|
|
||||||
|bearing |`{value},{range}` `integer 0 .. 360,integer 0 .. 180` |
|
|
||||||
|radius |`double >= 0` or `unlimited` (default) |
|
|
||||||
|hint |Base64 `string` |
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{option}={element};{element}[;{element} ... ]
|
{option}={element};{element}[;{element} ... ]
|
||||||
```
|
```
|
||||||
@@ -51,19 +57,48 @@ Example: 2nd location use the default value for `option`:
|
|||||||
{option}={element};;{element}
|
{option}={element};;{element}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Requests
|
## General options
|
||||||
|
|
||||||
```curl
|
| Option | Values | Description |
|
||||||
# Query on Berlin with three coordinates:
|
|------------|--------------------------------------------------------|--------------------------------------------------|
|
||||||
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
|
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|
||||||
|
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|
||||||
|
|hints |`{hint};{hint}[;{hint} ...]` |Hint to derive position in street network. |
|
||||||
|
|
||||||
# Using polyline:
|
Where the elements follow the following format:
|
||||||
curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'
|
|
||||||
|
| Element | Values |
|
||||||
|
|------------|--------------------------------------------------------|
|
||||||
|
|bearing |`{value},{range}` `integer 0 .. 360,integer 0 .. 180` |
|
||||||
|
|radius |`double >= 0` or `unlimited` (default) |
|
||||||
|
|hint |Base64 `string` |
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Query on Berlin with three coordinates:
|
||||||
|
|
||||||
|
```
|
||||||
|
http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
|
||||||
```
|
```
|
||||||
|
|
||||||
### Responses
|
Using polyline:
|
||||||
|
|
||||||
Every response object has a `code` property containing one of the strings below or a service dependent code:
|
```
|
||||||
|
http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
Every response object has a `code` field.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": {code},
|
||||||
|
"message": {message}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `code` is on one of the strings below or service dependent:
|
||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
|-------------------|----------------------------------------------------------------------------------|
|
|-------------------|----------------------------------------------------------------------------------|
|
||||||
@@ -77,27 +112,18 @@ Every response object has a `code` property containing one of the strings below
|
|||||||
| `NoSegment` | One of the supplied input coordinates could not snap to street segment. |
|
| `NoSegment` | One of the supplied input coordinates could not snap to street segment. |
|
||||||
| `TooBig` | The request size violates one of the service specific request size restrictions. |
|
| `TooBig` | The request size violates one of the service specific request size restrictions. |
|
||||||
|
|
||||||
- `message` is a **optional** human-readable error message. All other status types are service dependent.
|
`message` is a **optional** human-readable error message. All other status types are service dependent.
|
||||||
- In case of an error the HTTP status code will be `400`. Otherwise the HTTP status code will be `200` and `code` will be `Ok`.
|
|
||||||
|
|
||||||
#### Example response
|
In case of an error the HTTP status code will be `400`. Otherwise the HTTP status code will be `200` and `code` will be `Ok`.
|
||||||
|
|
||||||
|
## Service `nearest`
|
||||||
|
|
||||||
|
Snaps a coordinate to the street network and returns the nearest n matches.
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"code": "Ok",
|
|
||||||
"message": "Everything worked"
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
http://{server}/nearest/v1/{profile}/{coordinates}.json?number={number}
|
||||||
|
|
||||||
## Services
|
|
||||||
|
|
||||||
### Nearest service
|
|
||||||
|
|
||||||
Snaps a coordinate to the street network and returns the nearest `n` matches.
|
|
||||||
|
|
||||||
```endpoint
|
|
||||||
GET http://{server}/nearest/v1/{profile}/{coordinates}.json?number={number}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `coordinates` only supports a single `{longitude},{latitude}` entry.
|
Where `coordinates` only supports a single `{longitude},{latitude}` entry.
|
||||||
@@ -108,62 +134,26 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
|------------|------------------------------|----------------------------------------------------|
|
|------------|------------------------------|----------------------------------------------------|
|
||||||
|number |`integer >= 1` (default `1`) |Number of nearest segments that should be returned. |
|
|number |`integer >= 1` (default `1`) |Number of nearest segments that should be returned. |
|
||||||
|
|
||||||
**Response**
|
### Response
|
||||||
|
|
||||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||||
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
|
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
|
||||||
- `distance`: Distance in meters to the supplied input coordinate.
|
- `distance`: Distance in meters to the supplied input coordinate.
|
||||||
|
|
||||||
#### Example Requests
|
### Examples
|
||||||
|
|
||||||
```curl
|
Querying nearest three snapped locations of `13.388860,52.517037` with a bearing between `20° - 340°`.
|
||||||
# Querying nearest three snapped locations of `13.388860,52.517037` with a bearing between `20° - 340°`.
|
|
||||||
curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?number=3&bearings=0,20'
|
```
|
||||||
|
http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?number=3&bearings=0,20
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
## Service `route`
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"waypoints" : [
|
|
||||||
{
|
|
||||||
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
|
|
||||||
"distance" : 4.152629,
|
|
||||||
"name" : "Friedrichstraße",
|
|
||||||
"location" : [
|
|
||||||
13.388799,
|
|
||||||
52.517033
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hint" : "KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g",
|
|
||||||
"distance" : 11.811961,
|
|
||||||
"name" : "Friedrichstraße",
|
|
||||||
"location" : [
|
|
||||||
13.388782,
|
|
||||||
52.517132
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hint" : "KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g",
|
|
||||||
"distance" : 15.872438,
|
|
||||||
"name" : "Friedrichstraße",
|
|
||||||
"location" : [
|
|
||||||
13.388775,
|
|
||||||
52.51717
|
|
||||||
],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"code" : "Ok"
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
http://{server}/route/v1/{profile}/{coordinates}?alternatives={true|false}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={full|simplified|false}&annotations={true|false}
|
||||||
### Route service
|
|
||||||
|
|
||||||
Finds the fastest route between coordinates in the supplied order.
|
|
||||||
|
|
||||||
```endpoint
|
|
||||||
GET /route/v1/{profile}/{coordinates}?alternatives={true|false}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={full|simplified|false}&annotations={true|false}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||||
@@ -172,14 +162,14 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
||||||
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|
||||||
|steps |`true`, `false` (default) |Return route steps for each route leg |
|
|steps |`true`, `false` (default) |Return route steps for each route leg |
|
||||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
|continue_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile. |
|
||||||
|
|
||||||
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
|
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
|
||||||
|
|
||||||
**Response**
|
### Response
|
||||||
|
|
||||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||||
- `waypoints`: Array of `Waypoint` objects representing all waypoints in order:
|
- `waypoints`: Array of `Waypoint` objects representing all waypoints in order:
|
||||||
@@ -191,24 +181,25 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|-------------------|-----------------|
|
|-------------------|-----------------|
|
||||||
| `NoRoute` | No route found. |
|
| `NoRoute` | No route found. |
|
||||||
|
|
||||||
All other properties might be undefined.
|
All other fields might be undefined.
|
||||||
|
|
||||||
#### Example Request
|
### Example
|
||||||
|
|
||||||
```curl
|
Query on Berlin with three coordinates and no overview geometry returned:
|
||||||
# Query on Berlin with three coordinates and no overview geometry returned:
|
|
||||||
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
|
```
|
||||||
|
http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
|
||||||
```
|
```
|
||||||
|
|
||||||
### Table service
|
## Service `table`
|
||||||
|
### Request
|
||||||
Computes the duration of the fastest route between all pairs of supplied coordinates.
|
```
|
||||||
|
http://{server}/table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&destinations=[{elem}...]`
|
||||||
```endpoint
|
|
||||||
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&destinations=[{elem}...]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Coordinates**
|
This computes duration tables for the given locations. Allows for both symmetric and asymmetric tables.
|
||||||
|
|
||||||
|
### Coordinates
|
||||||
|
|
||||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||||
|
|
||||||
@@ -220,7 +211,7 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
|
Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
|
||||||
to number of input locations;
|
to number of input locations;
|
||||||
|
|
||||||
**Example:**
|
Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
sources=0;5;7&destinations=5;1;4;2;3;6
|
sources=0;5;7&destinations=5;1;4;2;3;6
|
||||||
@@ -230,20 +221,7 @@ sources=0;5;7&destinations=5;1;4;2;3;6
|
|||||||
|------------|-----------------------------|
|
|------------|-----------------------------|
|
||||||
|index |`0 <= integer < #locations` |
|
|index |`0 <= integer < #locations` |
|
||||||
|
|
||||||
#### Example Request
|
### Response
|
||||||
|
|
||||||
```curl
|
|
||||||
# Returns a 3x3 matrix:
|
|
||||||
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
|
|
||||||
|
|
||||||
# Returns a 1x3 matrix
|
|
||||||
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?sources=0'
|
|
||||||
|
|
||||||
# Returns a asymmetric 3x2 matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:
|
|
||||||
curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHulFzeMe`EuvKpnCglA)?sources=0;1;3&destinations=2;4'
|
|
||||||
```
|
|
||||||
|
|
||||||
**Response**
|
|
||||||
|
|
||||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||||
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
|
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
|
||||||
@@ -257,41 +235,55 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|-------------------|-----------------|
|
|-------------------|-----------------|
|
||||||
| `NoTable` | No route found. |
|
| `NoTable` | No route found. |
|
||||||
|
|
||||||
All other properties might be undefined.
|
All other fields might be undefined.
|
||||||
|
|
||||||
### Match service
|
#### Examples
|
||||||
|
|
||||||
Map matching matches/snaps given GPS points to the road network in the most plausible way.
|
Returns a `3x3` matrix:
|
||||||
Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found.
|
```
|
||||||
|
http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219
|
||||||
|
```
|
||||||
|
|
||||||
|
Returns a `1x3` matrix:
|
||||||
|
```
|
||||||
|
http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?sources=0
|
||||||
|
```
|
||||||
|
|
||||||
|
Returns a asymmetric 3x2 matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:
|
||||||
|
```
|
||||||
|
http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHulFzeMe`EuvKpnCglA)?sources=0;1;3&destinations=2;4
|
||||||
|
```
|
||||||
|
|
||||||
|
## Service `match`
|
||||||
|
|
||||||
|
Map matching matches given GPS points to the road network in the most plausible way.
|
||||||
|
Please note the request might result multiple sub-traces. Large jumps in the timestamps (>60s) or improbable transitions lead to trace splits if a complete matching could not be found.
|
||||||
The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
|
The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
|
||||||
|
|
||||||
```endpoint
|
### Request
|
||||||
GET /match/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}
|
|
||||||
|
```
|
||||||
|
http://{server}/match/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||||
|
|
||||||
|
|
||||||
|Option |Values |Description |
|
|Option |Values |Description |
|
||||||
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
||||||
|steps |`true`, `false` (default) |Return route steps for each route |
|
|steps |`true`, `false` (default) |Return route steps for each route |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamp of the input location. Timestamps need to be monotonically increasing. |
|
||||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
||||||
|
|
||||||
|Parameter |Values |
|
|Parameter |Values |
|
||||||
|------------|-----------------------------------|
|
|------------|------------------------------|
|
||||||
|timestamp |`integer` seconds since UNIX epoch |
|
|timestamp |`integer` UNIX-like timestamp |
|
||||||
|radius |`double >= 0` (default 5m) |
|
|radius |`double >= 0` (default 5m) |
|
||||||
|
|
||||||
The radius for each point should be the standard error of the location measured in meters from the true location.
|
|
||||||
Use `Location.getAccuracy()` on Android or `CLLocation.horizontalAccuracy` on iOS.
|
|
||||||
This value is used to determine which points should be considered as candidates (larger radius means more candidates) and how likely each candidate is (larger radius means far-away candidates are penalized less).
|
|
||||||
The area to search is chosen such that the correct candidate should be considered 99.9% of the time (for more details see [this ticket](https://github.com/Project-OSRM/osrm-backend/pull/3184)).
|
|
||||||
|
|
||||||
**Response**
|
|
||||||
|
|
||||||
|
### Response
|
||||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||||
- `tracepoints`: Array of `Waypoint` objects representing all points of the trace in order.
|
- `tracepoints`: Array of `Waypoint` objects representing all points of the trace in order.
|
||||||
If the trace point was ommited by map matching because it is an outlier, the entry will be `null`.
|
If the trace point was ommited by map matching because it is an outlier, the entry will be `null`.
|
||||||
@@ -307,66 +299,33 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|-------------------|---------------------|
|
|-------------------|---------------------|
|
||||||
| `NoMatch` | No matchings found. |
|
| `NoMatch` | No matchings found. |
|
||||||
|
|
||||||
All other properties might be undefined.
|
All other fields might be undefined.
|
||||||
|
|
||||||
### Trip service
|
## Service `trip`
|
||||||
|
|
||||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints.
|
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
|
||||||
The returned path does not have to be the fastest path. As TSP is NP-hard it only returns an approximation.
|
The returned path does not have to be the fastest path, as TSP is NP-hard it is only an approximation.
|
||||||
Note that all input coordinates have to be connected for the trip service to work.
|
Note that if the input coordinates can not be joined by a single trip (e.g. the coordinates are on several disconnected islands)
|
||||||
|
multiple trips for each connected component are returned.
|
||||||
|
|
||||||
```endpoint
|
### Request
|
||||||
GET /trip/v1/{profile}/{coordinates}?roundtrip={true|false}&source{any|first}&destination{any|last}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
|
|
||||||
|
```
|
||||||
|
http://{server}/trip/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||||
|
|
||||||
|Option |Values |Description |
|
|Option |Values |Description |
|
||||||
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|
||||||
|roundtrip |`true` (default), `false` |Return route is a roundtrip |
|
|
||||||
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|
|
||||||
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|
|
||||||
|steps |`true`, `false` (default) |Return route instructions for each trip |
|
|steps |`true`, `false` (default) |Return route instructions for each trip |
|
||||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
|
|
||||||
**Fixing Start and End Points**
|
### Response
|
||||||
|
|
||||||
It is possible to explicitely set the start or end coordinate of the trip.
|
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||||
When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
|
|
||||||
|
|
||||||
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
|
|
||||||
|
|
||||||
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
|
|
||||||
Right now, the following combinations are possible:
|
|
||||||
|
|
||||||
| roundtrip | source | destination | supported |
|
|
||||||
| :-- | :-- | :-- | :-- |
|
|
||||||
| true | first | last | **yes** |
|
|
||||||
| true | first | any | **yes** |
|
|
||||||
| true | any | last | **yes** |
|
|
||||||
| true | any | any | **yes** |
|
|
||||||
| false | first | last | **yes** |
|
|
||||||
| false | first | any | no |
|
|
||||||
| false | any | last | no |
|
|
||||||
| false | any | any | no |
|
|
||||||
|
|
||||||
#### Example Requests
|
|
||||||
|
|
||||||
```curl
|
|
||||||
# Round trip in Berlin with three stops:
|
|
||||||
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
|
|
||||||
```
|
|
||||||
|
|
||||||
```curl
|
|
||||||
# Round trip in Berlin with four stops, starting at the first stop, ending at the last:
|
|
||||||
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=last'
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Response
|
|
||||||
|
|
||||||
- `code`: if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
|
||||||
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
|
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
|
||||||
- `trips_index`: Index to `trips` of the sub-trip the point was matched to.
|
- `trips_index`: Index to `trips` of the sub-trip the point was matched to.
|
||||||
- `waypoint_index`: Index of the point in the trip.
|
- `waypoint_index`: Index of the point in the trip.
|
||||||
@@ -376,75 +335,27 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
|-------------------|---------------------|
|
|-------------------|---------------------|
|
||||||
| `NoTrips` | No trips found because input coordinates are not connected.|
|
| `NoTrips` | No trips found. |
|
||||||
| `NotImplemented` | This request is not supported |
|
|
||||||
|
|
||||||
All other properties might be undefined.
|
|
||||||
|
|
||||||
### Tile service
|
|
||||||
|
|
||||||
This service generates [Mapbox Vector Tiles](https://www.mapbox.com/developers/vector-tiles/) that can be viewed with a vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can be used to examine the routing graph. The tiles are generated directly from the data in-memory, so are in sync with actual routing results, and let you examine which roads are actually routable, and what weights they have applied.
|
|
||||||
|
|
||||||
```endpoint
|
|
||||||
GET /tile/v1/{profile}/tile({x},{y},{zoom}).mvt
|
|
||||||
```
|
|
||||||
|
|
||||||
The `x`, `y`, and `zoom` values are the same as described at https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames, and are supported by vector tile viewers like [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/).
|
|
||||||
|
|
||||||
#### Example request
|
|
||||||
|
|
||||||
```curl
|
|
||||||
# This fetches a Z=13 tile for downtown San Francisco:
|
|
||||||
curl 'http://router.project-osrm.org/tile/v1/car/tile(1310,3166,13).mvt'
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example response
|
|
||||||
|
|
||||||
> 
|
|
||||||
> http://map.project-osrm.org/debug/#14.33/52.5212/13.3919
|
|
||||||
|
|
||||||
The response object is either a binary encoded blob with a `Content-Type` of `application/x-protobuf`, or a `404` error. Note that OSRM is hard-coded to only return tiles from zoom level 12 and higher (to avoid accidentally returning extremely large vector tiles).
|
|
||||||
|
|
||||||
Vector tiles contain two layers:
|
|
||||||
|
|
||||||
`speeds` layer:
|
|
||||||
|
|
||||||
| Property | Type | Description |
|
|
||||||
| ------------ | --------- | ---------------------------------------- |
|
|
||||||
| `speed` | `integer` | the speed on that road segment, in km/h |
|
|
||||||
| `is_small` | `boolean` | whether this segment belongs to a small (< 1000 node) [strongly connected component](https://en.wikipedia.org/wiki/Strongly_connected_component) |
|
|
||||||
| `datasource` | `string` | the source for the speed value (normally `lua profile` unless you're using the [traffic update feature](https://github.com/Project-OSRM/osrm-backend/wiki/Traffic), in which case it contains the stem of the filename that supplied the speed value for this segment |
|
|
||||||
| `duration` | `float` | how long this segment takes to traverse, in seconds |
|
|
||||||
| `name` | `string` | the name of the road this segment belongs to |
|
|
||||||
|
|
||||||
`turns` layer:
|
|
||||||
|
|
||||||
| Property | Type | Description |
|
|
||||||
| ------------ | --------- | ---------------------------------------- |
|
|
||||||
| `bearing_in` | `integer` | the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East |
|
|
||||||
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
|
|
||||||
| `cost` | `float` | the time we think it takes to make that turn, in seconds. May be negative, depending on how the data model is constructed (some turns get a "bonus"). |
|
|
||||||
|
|
||||||
|
All other fields might be undefined.
|
||||||
|
|
||||||
## Result objects
|
## Result objects
|
||||||
|
|
||||||
### Route object
|
### Route
|
||||||
|
|
||||||
Represents a route through (potentially multiple) waypoints.
|
Represents a route through (potentially multiple) waypoints.
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `distance`: The distance traveled by the route, in `float` meters.
|
- `distance`: The distance traveled by the route, in `float` meters.
|
||||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||||
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` property for a parameter documentation.
|
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` field for a parameter documentation.
|
||||||
- `weight`: The calculated weight of the route.
|
|
||||||
- `weight_name`: The name of the weight profile used during extraction phase.
|
|
||||||
|
|
||||||
| overview | Description |
|
| overview | Description |
|
||||||
|------------|-----------------------------|
|
|------------|-----------------------------|
|
||||||
| simplified | Geometry is simplified according to the highest zoom level it can still be displayed on full. |
|
| simplified | Geometry is simplified according to the highest zoom level it can still be displayed on full. |
|
||||||
| full | Geometry is not simplified. |
|
| full | Geometry is not simplified. |
|
||||||
| false | Geometry is not added. |
|
| false | Geometry is not added. |
|
||||||
|
|
||||||
- `legs`: The legs between the given waypoints, an array of `RouteLeg` objects.
|
- `legs`: The legs between the given waypoints, an array of `RouteLeg` objects.
|
||||||
|
|
||||||
@@ -456,8 +367,6 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
|
|||||||
{
|
{
|
||||||
"distance": 90.0,
|
"distance": 90.0,
|
||||||
"duration": 300.0,
|
"duration": 300.0,
|
||||||
"weight": 300.0,
|
|
||||||
"weight_name": "duration",
|
|
||||||
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
|
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
|
||||||
"legs": [
|
"legs": [
|
||||||
{
|
{
|
||||||
@@ -474,35 +383,34 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### RouteLeg object
|
### RouteLeg
|
||||||
|
|
||||||
Represents a route between two waypoints.
|
Represents a route between two waypoints.
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `distance`: The distance traveled by this route leg, in `float` meters.
|
- `distance`: The distance traveled by this route leg, in `float` meters.
|
||||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||||
- `weight`: The calculated weight of the route leg.
|
|
||||||
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
|
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
|
||||||
|
|
||||||
| steps | |
|
| steps | |
|
||||||
|--------------|-----------------------------------------------------------------------|
|
|--------------|-----------------------------------------------------------------------|
|
||||||
| true | Names of the two major roads used. Can be empty if route is too short.|
|
| true | Names of the two major roads used. Can be empty if route is too short.|
|
||||||
| false | empty `string` |
|
| false | empty `string` |
|
||||||
|
|
||||||
- `steps`: Depends on the `steps` parameter.
|
- `steps`: Depends on the `steps` parameter.
|
||||||
|
|
||||||
| steps | |
|
| steps | |
|
||||||
|--------------|-----------------------------------------------------------------------|
|
|--------------|-----------------------------------------------------------------------|
|
||||||
| true | array of `RouteStep` objects describing the turn-by-turn instructions |
|
| true | array of `RouteStep` objects describing the turn-by-turn instructions |
|
||||||
| false | empty array |
|
| false | empty array |
|
||||||
|
|
||||||
- `annotation`: Additional details about each coordinate along the route geometry:
|
- `annotation`: Additional details about each coordinate along the route geometry:
|
||||||
|
|
||||||
| annotations | |
|
| annotations | |
|
||||||
|--------------|-----------------------------------------------------------------------|
|
|--------------|-----------------------------------------------------------------------|
|
||||||
| true | An `Annotation` object containing node ids, durations distances and |
|
| true | An `Annotation` object containing node ids, durations and distances |
|
||||||
| false | weights `undefined` |
|
| false | `undefined` |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -512,30 +420,26 @@ With `steps=false` and `annotations=true`:
|
|||||||
{
|
{
|
||||||
"distance": 30.0,
|
"distance": 30.0,
|
||||||
"duration": 100.0,
|
"duration": 100.0,
|
||||||
"weight": 100.0,
|
|
||||||
"steps": [],
|
"steps": [],
|
||||||
"annotation": {
|
"annotation": {
|
||||||
"distance": [5,5,10,5,5],
|
"distance": [5,5,10,5,5],
|
||||||
"duration": [15,15,40,15,15],
|
"duration": [15,15,40,15,15],
|
||||||
"datasources": [1,0,0,0,1],
|
"datasources": [1,0,0,0,1],
|
||||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
||||||
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Annotation object
|
### Annotation
|
||||||
|
|
||||||
Annotation of the whole route leg with fine-grained information about each segment or node id.
|
Annotation of the whole route leg with fine-grained information about each segment or node id.
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `distance`: The distance, in metres, between each pair of coordinates
|
- `distance`: The distance, in metres, between each pair of coordinates
|
||||||
- `duration`: The duration between each pair of coordinates, in seconds
|
- `duration`: The duration between each pair of coordinates, in seconds
|
||||||
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
||||||
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
||||||
- `weight`: The weights between each pair of coordinates
|
|
||||||
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
|
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -544,30 +448,28 @@ Annotation of the whole route leg with fine-grained information about each segme
|
|||||||
"distance": [5,5,10,5,5],
|
"distance": [5,5,10,5,5],
|
||||||
"duration": [15,15,40,15,15],
|
"duration": [15,15,40,15,15],
|
||||||
"datasources": [1,0,0,0,1],
|
"datasources": [1,0,0,0,1],
|
||||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
||||||
"weight": [15,15,40,15,15]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### RouteStep object
|
### RouteStep
|
||||||
|
|
||||||
A step consists of a maneuver such as a turn or merge, followed
|
A step consists of a maneuver such as a turn or merge, followed
|
||||||
by a distance of travel along a single way to the subsequent
|
by a distance of travel along a single way to the subsequent
|
||||||
step.
|
step.
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
|
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
|
||||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||||
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
|
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
|
||||||
- `weight`: The calculated weight of the step.
|
|
||||||
|
|
||||||
| `geometry` | |
|
| geometries | |
|
||||||
|------------|--------------------------------------------------------------------|
|
|------------|--------------------------------------------------------------------|
|
||||||
| polyline | [polyline](https://www.npmjs.com/package/polyline) with precision 5 in [latitude,longitude] encoding |
|
| polyline | [polyline](https://www.npmjs.com/package/polyline) with precision 5 in [latitude,longitude] encoding |
|
||||||
| polyline6 | [polyline](https://www.npmjs.com/package/polyline) with precision 6 in [latitude,longitude] encoding |
|
| polyline6 | [polyline](https://www.npmjs.com/package/polyline) with precision 6 in [latitude,longitude] encoding |
|
||||||
| geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) |
|
| geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) or [GeoJSON `Point`](http://geojson.org/geojson-spec.html#point) if it is only one coordinate (not wrapped by a GeoJSON feature)|
|
||||||
|
|
||||||
- `name`: The name of the way along which travel proceeds.
|
- `name`: The name of the way along which travel proceeds.
|
||||||
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
||||||
@@ -576,133 +478,127 @@ step.
|
|||||||
- `mode`: A string signifying the mode of transportation.
|
- `mode`: A string signifying the mode of transportation.
|
||||||
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
||||||
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
||||||
- `rotary_name`: The name for the rotary. Optionally included, if the step is a rotary and a rotary name is available.
|
|
||||||
- `rotary_pronunciation`: The pronunciation hint of the rotary name. Optionally included, if the step is a rotary and a rotary pronunciation is available.
|
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```json
|
```
|
||||||
{
|
{
|
||||||
"geometry" : "{lu_IypwpAVrAvAdI",
|
"distance":152.3,
|
||||||
"mode" : "driving",
|
"duration":15.6,
|
||||||
"duration" : 15.6,
|
"name":"Lortzingstraße",
|
||||||
"weight" : 15.6,
|
"maneuver":{
|
||||||
"intersections" : [
|
"type":"turn",
|
||||||
{ "bearings" : [ 10, 92, 184, 270 ],
|
"modifier":"right",
|
||||||
"lanes" : [
|
},
|
||||||
{ "indications" : [ "left", "straight" ],
|
"geometry":"{lu_IypwpAVrAvAdI",
|
||||||
"valid" : "false" },
|
"mode":"driving",
|
||||||
{ "valid" : "true",
|
"intersections":[
|
||||||
"indications" : [ "right" ] }
|
{"location":[13.39677,52.54366],
|
||||||
],
|
"in":3,
|
||||||
"out" : 2,
|
"out":2,
|
||||||
"in" : 3,
|
"bearings":[10,92,184,270],
|
||||||
"entry" : [ "true", "true", "true", "false" ],
|
"entry":["true","true","true","false"],
|
||||||
"location" : [ 13.39677, 52.54366 ]
|
"lanes":[
|
||||||
},
|
{"indications":["left","straight"], "valid":"false"},
|
||||||
{ "out" : 1,
|
{"indications":["right"], "valid":"true"}
|
||||||
"lanes" : [
|
]},
|
||||||
{ "indications" : [ "straight" ],
|
{"location":[13.394718,52.543096],
|
||||||
"valid" : "true" },
|
"in":0,
|
||||||
{ "indications" : [ "right" ],
|
"out":1,
|
||||||
"valid" : "false" }
|
"bearings":[60,240,330],
|
||||||
],
|
"entry":["false","true","true"]
|
||||||
"bearings" : [ 60, 240, 330 ],
|
"lanes":[
|
||||||
"in" : 0,
|
{"indications":["straight"], "valid":"true"},
|
||||||
"entry" : [ "false", "true", "true" ],
|
{"indications":["right"], "valid":"false"}
|
||||||
"location" : [ 13.394718, 52.543096 ]
|
]}
|
||||||
}
|
]}
|
||||||
],
|
|
||||||
"name" : "Lortzingstraße",
|
|
||||||
"distance" : 152.3,
|
|
||||||
"maneuver" : {
|
|
||||||
"modifier" : "right",
|
|
||||||
"type" : "turn"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### StepManeuver object
|
### StepManeuver
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
||||||
- `bearing_before`: The clockwise angle from true north to the
|
- `bearing_before`: The clockwise angle from true north to the
|
||||||
direction of travel immediately before the maneuver. Range 0-359.
|
direction of travel immediately before the maneuver.
|
||||||
- `bearing_after`: The clockwise angle from true north to the
|
- `bearing_after`: The clockwise angle from true north to the
|
||||||
direction of travel immediately after the maneuver. Range 0-359.
|
direction of travel immediately after the maneuver.
|
||||||
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
|
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
|
||||||
Types unknown to the client should be handled like the `turn` type, the existence of correct `modifier` values is guranteed.
|
Types unknown to the client should be handled like the `turn` type, the existance of correct `modifier` values is guranteed.
|
||||||
|
|
||||||
| `type` | Description |
|
| `type` | Description |
|
||||||
|------------------|--------------------------------------------------------------|
|
|------------------|--------------------------------------------------------------|
|
||||||
| `turn` | a basic turn into direction of the `modifier` |
|
| `turn` | a basic turn into direction of the `modifier` |
|
||||||
| `new name` | no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier`. |
|
| `new name` | no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier`. |
|
||||||
| `depart` | indicates the departure of the leg |
|
| `depart` | indicates the departure of the leg |
|
||||||
| `arrive` | indicates the destination of the leg |
|
| `arrive` | indicates the destination of the leg |
|
||||||
| `merge` | merge onto a street (e.g. getting on the highway from a ramp, the `modifier specifies the direction of the merge`) |
|
| `merge` | merge onto a street (e.g. getting on the highway from a ramp, the `modifier specifies the direction of the merge`) |
|
||||||
| `ramp` | **Deprecated**. Replaced by `on_ramp` and `off_ramp`. |
|
| `ramp` | **Deprecated**. Replaced by `on_ramp` and `off_ramp`. |
|
||||||
| `on ramp` | take a ramp to enter a highway (direction given my `modifier`) |
|
| `on ramp` | take a ramp to enter a highway (direction given my `modifier`) |
|
||||||
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
|
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
|
||||||
| `fork` | take the left/right side at a fork depending on `modifier` |
|
| `fork` | take the left/right side at a fork depending on `modifier` |
|
||||||
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
||||||
| `use lane` | going straight on a specific lane |
|
| `use lane` | going straight on a specific lane |
|
||||||
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
||||||
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
|
| `roundabout` | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
|
||||||
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |
|
| `rotary` | a larger version of a roundabout, can offer `rotary_name/rotary_pronunciation` in addition to the `exit` parameter. |
|
||||||
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
|
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
|
||||||
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
|
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
|
||||||
|
|
||||||
Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change
|
Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change
|
||||||
between all instructions. They only offer a fallback in case nothing else is to report.
|
between all instructions. They only offer a fallback in case nothing else is to report.
|
||||||
|
|
||||||
- `modifier` An optional `string` indicating the direction change of the maneuver.
|
- `modifier` An optional `string` indicating the direction change of the maneuver.
|
||||||
|
|
||||||
| `modifier` | Description |
|
| `modifier` | Description |
|
||||||
|-------------------|-------------------------------------------|
|
|-------------------|-------------------------------------------|
|
||||||
| `uturn` | indicates reversal of direction |
|
| `uturn` | indicates reversal of direction |
|
||||||
| `sharp right` | a sharp right turn |
|
| `sharp right` | a sharp right turn |
|
||||||
| `right` | a normal turn to the right |
|
| `right` | a normal turn to the right |
|
||||||
| `slight right` | a slight turn to the right |
|
| `slight right` | a slight turn to the right |
|
||||||
| `straight` | no relevant change in direction |
|
| `straight` | no relevant change in direction |
|
||||||
| `slight left` | a slight turn to the left |
|
| `slight left` | a slight turn to the left |
|
||||||
| `left` | a normal turn to the left |
|
| `left` | a normal turn to the left |
|
||||||
| `sharp left` | a sharp turn to the left |
|
| `sharp left` | a sharp turn to the left |
|
||||||
|
|
||||||
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
|
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
|
||||||
|
|
||||||
The meaning depends on the `type` property.
|
The meaning depends on the `type` field.
|
||||||
|
|
||||||
| `type` | Description |
|
| `type` | Description |
|
||||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
|
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
|
||||||
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
|
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
|
||||||
|
|
||||||
- `exit` An optional `integer` indicating number of the exit to take. The property exists for the `roundabout` / `rotary` property:
|
- `exit` An optional `integer` indicating number of the exit to take. The field exists for the following `type` field:
|
||||||
Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout.
|
|
||||||
|
| `type` | Description |
|
||||||
|
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `roundabout`/`rotary` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
|
||||||
|
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
|
||||||
|
|
||||||
|
|
||||||
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
||||||
|
|
||||||
### Lane object
|
### Lane
|
||||||
|
|
||||||
A `Lane` represents a turn lane at the corresponding turn location.
|
A `Lane` represents a turn lane at the corresponding turn location.
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `indications`: a indication (e.g. marking on the road) specifying the turn lane. A road can have multiple indications (e.g. an arrow pointing straight and left). The indications are given in an array, each containing one of the following types. Further indications might be added on without an API version change.
|
- `indications`: a indication (e.g. marking on the road) specifying the turn lane. A road can have multiple indications (e.g. an arrow pointing straight and left). The indications are given in an array, each containing one of the following types. Further indications might be added on without an API version change.
|
||||||
|
|
||||||
| `value` | Description |
|
| `value` | Description |
|
||||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `none` | No dedicated indication is shown. |
|
| `none` | No dedicated indication is shown. |
|
||||||
| `uturn` | An indication signaling the possibility to reverse (i.e. fully bend arrow). |
|
| `uturn` | An indication signaling the possibility to reverse (i.e. fully bend arrow). |
|
||||||
| `sharp right` | An indication indicating a sharp right turn (i.e. strongly bend arrow). |
|
| `sharp right` | An indication indicating a sharp right turn (i.e. strongly bend arrow). |
|
||||||
| `right` | An indication indicating a right turn (i.e. bend arrow). |
|
| `right` | An indication indicating a right turn (i.e. bend arrow). |
|
||||||
| `slight right` | An indication indicating a slight right turn (i.e. slightly bend arrow). |
|
| `slight right` | An indication indicating a slight right turn (i.e. slightly bend arrow). |
|
||||||
| `straight` | No dedicated indication is shown (i.e. straight arrow). |
|
| `straight` | No dedicated indication is shown (i.e. straight arrow). |
|
||||||
| `slight left` | An indication indicating a slight left turn (i.e. slightly bend arrow). |
|
| `slight left` | An indication indicating a slight left turn (i.e. slightly bend arrow). |
|
||||||
| `left` | An indication indicating a left turn (i.e. bend arrow). |
|
| `left` | An indication indicating a left turn (i.e. bend arrow). |
|
||||||
| `sharp left` | An indication indicating a sharp left turn (i.e. strongly bend arrow). |
|
| `sharp left` | An indication indicating a sharp left turn (i.e. strongly bend arrow). |
|
||||||
|
|
||||||
- `valid`: a boolean flag indicating whether the lane is a valid choice in the current maneuver
|
- `valid`: a boolean flag indicating whether the lane is a valid choice in the current maneuver
|
||||||
|
|
||||||
@@ -715,15 +611,15 @@ A `Lane` represents a turn lane at the corresponding turn location.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Intersection object
|
### Intersection
|
||||||
|
|
||||||
An intersection gives a full representation of any cross-way the path passes bay. For every step, the very first intersection (`intersections[0]`) corresponds to the
|
An intersection gives a full representation of any cross-way the path passes bay. For every step, the very first intersection (`intersections[0]`) corresponds to the
|
||||||
location of the StepManeuver. Further intersections are listed for every cross-way until the next turn instruction.
|
location of the StepManeuver. Further intersections are listed for every cross-way until the next turn instruction.
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
||||||
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
|
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection.
|
||||||
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
|
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
|
||||||
`false` indicates that the turn onto the respective road would violate a restriction.
|
`false` indicates that the turn onto the respective road would violate a restriction.
|
||||||
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
|
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
|
||||||
@@ -734,26 +630,26 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the intersection. If no lane information is available for an intersection, the `lanes` property will not be present.
|
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the intersection. If no lane information is available for an intersection, the `lanes` property will not be present.
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
```
|
||||||
```json
|
|
||||||
{
|
{
|
||||||
"location":[13.394718,52.543096],
|
"location":[13.394718,52.543096],
|
||||||
"in":0,
|
"in":0,
|
||||||
"out":2,
|
"out":2,
|
||||||
"bearings":[60,150,240,330],
|
"bearings":[60,150,240,330],
|
||||||
"entry":["false","true","true","true"],
|
"entry":["false","true","true","true"]
|
||||||
"lanes":{
|
"lanes":{
|
||||||
"indications": ["left", "straight"],
|
"indications": ["left", "straight"],
|
||||||
"valid": "false"
|
"valid": "false"
|
||||||
}
|
}
|
||||||
|
]}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Waypoint object
|
### Waypoint
|
||||||
|
|
||||||
Object used to describe waypoint on a route.
|
Object used to describe waypoint on a route.
|
||||||
|
|
||||||
**Properties**
|
#### Properties
|
||||||
|
|
||||||
- `name` Name of the street the coordinate snapped to
|
- `name` Name of the street the coordinate snapped to
|
||||||
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
|
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
|
||||||
@@ -761,16 +657,19 @@ Object used to describe waypoint on a route.
|
|||||||
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
|
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
|
||||||
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
|
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
|
||||||
|
|
||||||
#### Example
|
## Service `tile`
|
||||||
|
|
||||||
```json
|
This generates [Mapbox Vector Tiles](https://www.mapbox.com/developers/vector-tiles/) that can be viewed with a vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can be used to examine the routing graph. The tiles are generated directly from the data in-memory, so are in sync with actual routing results, and let you examine which roads are actually routable, and what weights they have applied.
|
||||||
{
|
|
||||||
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
|
### Request
|
||||||
"distance" : 4.152629,
|
|
||||||
"name" : "Friedrichstraße",
|
|
||||||
"location" : [
|
|
||||||
13.388799,
|
|
||||||
52.517033
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
http://{server}/tile/v1/{profile}/tile({x},{y},{zoom}).mvt
|
||||||
|
```
|
||||||
|
|
||||||
|
The `x`, `y`, and `zoom` values are the same as described at https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames, and are supported by vector tile viewers like [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/).
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
The response object is either a binary encoded blob with a `Content-Type` of `application/x-protobuf`, or a `404` error. Note that OSRM is hard-coded to only return tiles from zoom level 12 and higher (to avoid accidentally returning extremely large vector tiles).
|
||||||
|
|
||||||
|
Vector tiles contain just a single layer named `speeds`. Within that layer, features can have `speed` (int) and `is_small` (boolean) attributes.
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 694 KiB |
+6
-13
@@ -1,11 +1,7 @@
|
|||||||
## Introduction
|
|
||||||
|
|
||||||
OSRM can be used as a library (libosrm) via C++ instead of using it through the HTTP interface and `osrm-routed`. This allows for fine-tuning OSRM and has much less overhead. Here is a quick introduction into how to use `libosrm` in the upcoming v5 release.
|
OSRM can be used as a library (libosrm) via C++ instead of using it through the HTTP interface and `osrm-routed`. This allows for fine-tuning OSRM and has much less overhead. Here is a quick introduction into how to use `libosrm` in the upcoming v5 release.
|
||||||
|
|
||||||
Take a look at the example code that lives in the [example directory](https://github.com/Project-OSRM/osrm-backend/tree/master/example). Here is all you ever wanted to know about `libosrm`, that is a short description of what the types do and where to find documentation on it:
|
Take a look at the example code that lives in the [example directory](https://github.com/Project-OSRM/osrm-backend/tree/master/example). Here is all you ever wanted to know about `libosrm`, that is a short description of what the types do and where to find documentation on it:
|
||||||
|
|
||||||
## Important interface objects
|
|
||||||
|
|
||||||
- [`EngineConfig`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/engine_config.hpp) - for initializing an OSRM instance we can configure certain properties and constraints. E.g. the storage config is the base path such as `france.osm.osrm` from which we derive and load `france.osm.osrm.*` auxiliary files. This also lets you set constraints such as the maximum number of locations allowed for specific services.
|
- [`EngineConfig`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/engine_config.hpp) - for initializing an OSRM instance we can configure certain properties and constraints. E.g. the storage config is the base path such as `france.osm.osrm` from which we derive and load `france.osm.osrm.*` auxiliary files. This also lets you set constraints such as the maximum number of locations allowed for specific services.
|
||||||
|
|
||||||
- [`OSRM`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/osrm/osrm.hpp) - this is the main Routing Machine type with functions such as `Route` and `Table`. You initialize it with a `EngineConfig`. It does all the heavy lifting for you. Each function takes its own parameters, e.g. the `Route` function takes `RouteParameters`, and a out-reference to a JSON result that gets filled. The return value is a `Status`, indicating error or success.
|
- [`OSRM`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/osrm/osrm.hpp) - this is the main Routing Machine type with functions such as `Route` and `Table`. You initialize it with a `EngineConfig`. It does all the heavy lifting for you. Each function takes its own parameters, e.g. the `Route` function takes `RouteParameters`, and a out-reference to a JSON result that gets filled. The return value is a `Status`, indicating error or success.
|
||||||
@@ -20,14 +16,11 @@ Take a look at the example code that lives in the [example directory](https://gi
|
|||||||
|
|
||||||
- [Parameters for other services](https://github.com/Project-OSRM/osrm-backend/tree/master/include/engine/api) - here are all other `*Parameters` you need for other Routing Machine services.
|
- [Parameters for other services](https://github.com/Project-OSRM/osrm-backend/tree/master/include/engine/api) - here are all other `*Parameters` you need for other Routing Machine services.
|
||||||
|
|
||||||
- [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [HTTP API](#http-api).
|
- [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html) (Boost documentation is great). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [[v5 server API|Server-API-v5,-current]].
|
||||||
|
|
||||||
## Example
|
------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
See [the example folder](https://github.com/Project-OSRM/osrm-backend/tree/master/example) in the OSRM repository.
|
To summarize:
|
||||||
|
- create an `OSRM` instance initialized with a `EngineConfig`
|
||||||
## Workflow
|
- call the service function on the `OSRM` object providing service specific `*Parameters`
|
||||||
|
- check the return code and use the JSON result
|
||||||
- Create an `OSRM` instance initialized with a `EngineConfig`
|
|
||||||
- Call the service function on the `OSRM` object providing service specific `*Parameters`
|
|
||||||
- Check the return code and use the JSON result
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ We may introduce forward-compatible changes: query parameters and response prope
|
|||||||
|
|
||||||
- The `master` branch is for the bleeding edge development
|
- The `master` branch is for the bleeding edge development
|
||||||
- We create and maintain release branches `x.y` to control the release flow
|
- We create and maintain release branches `x.y` to control the release flow
|
||||||
- We create the release branch once we tagged the final version `x.y.0` version, RCs go on master
|
|
||||||
- No minor or major version will be released without a code-equal release candidates
|
- No minor or major version will be released without a code-equal release candidates
|
||||||
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
|
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
|
||||||
- Patch versions may be released without a release candidate
|
- Patch versions may be released without a release candidate
|
||||||
@@ -45,7 +44,6 @@ We may introduce forward-compatible changes: query parameters and response prope
|
|||||||
3. Make sure `CHANGELOG.md` is up to date.
|
3. Make sure `CHANGELOG.md` is up to date.
|
||||||
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||||
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||||
6. Use `npm run build-api-docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
|
||||||
6. Push tags and commits: `git push; git push --tags`
|
6. Push tags and commits: `git push; git push --tags`
|
||||||
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
|
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
|
||||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
## Environment Variables
|
|
||||||
|
|
||||||
### SIGNAL_PARENT_WHEN_READY
|
|
||||||
|
|
||||||
If the SIGNAL_PARENT_WHEN_READY environment variable is set osrm-routed will
|
|
||||||
send the USR1 signal to its parent when it will be running and waiting for
|
|
||||||
requests. This could be used to upgrade osrm-routed to a new binary on the fly
|
|
||||||
without any service downtime - no incoming requests will be lost.
|
|
||||||
|
|
||||||
### DISABLE_ACCESS_LOGGING
|
|
||||||
|
|
||||||
If the DISABLE_ACCESS_LOGGING environment variable is set osrm-routed will
|
|
||||||
**not** log any http requests to standard output. This can be useful in high
|
|
||||||
traffic setup.
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file exports the content of your website, as a bunch of concatenated
|
|
||||||
* Markdown files. By doing this explicitly, you can control the order
|
|
||||||
* of content without any level of abstraction.
|
|
||||||
*
|
|
||||||
* Using the brfs module, fs.readFileSync calls in this file are translated
|
|
||||||
* into strings of those files' content before the file is delivered to a
|
|
||||||
* browser: the content is read ahead-of-time and included in bundle.js.
|
|
||||||
*/
|
|
||||||
module.exports =
|
|
||||||
'# HTTP API\n' +
|
|
||||||
fs.readFileSync('./content/http.md', 'utf8') + '\n'+
|
|
||||||
'# libosrm C++ API\n' +
|
|
||||||
fs.readFileSync('./content/libosrm.md', 'utf8') + '\n';
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8' />
|
|
||||||
<meta http-equiv='X-UA-Compatible' content='IE=11' />
|
|
||||||
<title>OSRM API Documentation</title>
|
|
||||||
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
|
|
||||||
<link href='css/base.css' rel='stylesheet' />
|
|
||||||
<link href='css/style.css' rel='stylesheet' />
|
|
||||||
<link href='css/railscasts.css' rel='stylesheet' />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<!--START--><div id='app'></div><!--STOP-->
|
|
||||||
<script src='bundle.js'></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Brand names, in order to decreasing length, for different
|
|
||||||
* media queries.
|
|
||||||
*/
|
|
||||||
module.exports.brandNames = {
|
|
||||||
desktop: 'OSRM API Documentation',
|
|
||||||
tablet: 'OSRM API Docs',
|
|
||||||
mobile: 'OSRM API'
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Classes that define the top-left brand box.
|
|
||||||
*/
|
|
||||||
module.exports.brandClasses = 'fill-red';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Text for the link back to the linking website.
|
|
||||||
*/
|
|
||||||
module.exports.backLink = 'Back to project-osrm.org';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs after highlighting code samples. You can use this
|
|
||||||
* hook to, for instance, highlight a token and link it
|
|
||||||
* to some canonical part of documentation.
|
|
||||||
*/
|
|
||||||
module.exports.postHighlight = function(html) {
|
|
||||||
return html;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Highlight tokens in endpoint URLs, optionally linking to documentation
|
|
||||||
* or adding detail. This is the equivalent of postHighlight but it
|
|
||||||
* operates on endpoint URLs only.
|
|
||||||
*/
|
|
||||||
function highlightTokens(str) {
|
|
||||||
return str.replace(/{[\w_]+}/g,
|
|
||||||
(str) => '<span class="strong">' + str + '</span>');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Transform endpoints given as strings in a highlighted block like
|
|
||||||
*
|
|
||||||
* ```endpoint
|
|
||||||
* GET /foo/bar
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* Into HTML nodes that format those endpoints in nice ways.
|
|
||||||
*/
|
|
||||||
module.exports.transformURL = function(value) {
|
|
||||||
let parts = value.split(/\s+/);
|
|
||||||
return {
|
|
||||||
type: 'html',
|
|
||||||
value: `<div class='endpoint dark fill-dark round '>
|
|
||||||
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>${parts[0]}</div>
|
|
||||||
<div class='pad0 code small endpoint-url'>${highlightTokens(parts[1])}</div>
|
|
||||||
</div>`
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports.remarkPlugins = [];
|
|
||||||
+1
-102
@@ -1,6 +1,6 @@
|
|||||||
# Testsuite
|
# Testsuite
|
||||||
|
|
||||||
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing.
|
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucucmber.js for scenario driven testing.
|
||||||
|
|
||||||
## Unit Tests
|
## Unit Tests
|
||||||
|
|
||||||
@@ -28,29 +28,6 @@ This dataset is a small extract and may not even contain all tags or edge cases.
|
|||||||
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
|
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
|
||||||
See the library tests for how to add new dataset dependent tests.
|
See the library tests for how to add new dataset dependent tests.
|
||||||
|
|
||||||
To prepare the test data simply `cd test/data/` and then run `make`.
|
|
||||||
|
|
||||||
### Running Tests
|
|
||||||
|
|
||||||
To build the unit tests:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd build
|
|
||||||
cmake ..
|
|
||||||
make tests
|
|
||||||
```
|
|
||||||
|
|
||||||
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
|
|
||||||
|
|
||||||
```
|
|
||||||
./engine-tests
|
|
||||||
```
|
|
||||||
|
|
||||||
For `library-tests` you will need to provide a path to the test data:
|
|
||||||
|
|
||||||
```
|
|
||||||
./library-tests ../../test/data/monaco.osrm
|
|
||||||
```
|
|
||||||
|
|
||||||
## Cucumber
|
## Cucumber
|
||||||
|
|
||||||
@@ -332,81 +309,3 @@ And the relations
|
|||||||
```
|
```
|
||||||
|
|
||||||
Unless this format is used, OSRM will omit the (then ambiguous) turn restrictions and ignore them.
|
Unless this format is used, OSRM will omit the (then ambiguous) turn restrictions and ignore them.
|
||||||
|
|
||||||
## My Guidance Tests are Failing - Understanding what you can change
|
|
||||||
|
|
||||||
If you change some stuff in guidance, you will easily see tests change their result. E.g. if you change the angles for which we report `right`, then obviously some tests might not report a `direction modifier` named `right` anymore.
|
|
||||||
|
|
||||||
This small section will try to guide you in making the correct decisions for changing the behaviour of tests.
|
|
||||||
|
|
||||||
The difficulty in guidance tests is that not all items can be translated 1:1 from the ascii art into turn-angles.
|
|
||||||
|
|
||||||
The turn-angle calculation tries to find turn angles that would represent perceived turn angles, not the exact angle at the connection.
|
|
||||||
|
|
||||||
This is necessary, since connections in OSM are always bound by the paradigm that the way is supposed to be in the middle of the actual road.
|
|
||||||
For broad streets, you will see stronger angles than the actual turns.
|
|
||||||
|
|
||||||
### Don't change the test, change the expected behaviour
|
|
||||||
|
|
||||||
If we have a test that looks like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
Given a grid size of 5 m
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - b - - - - - - c
|
|
||||||
\
|
|
||||||
d - - - - - e
|
|
||||||
"""
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abc,bde,bde | depart,turn slight right,arrive|
|
|
||||||
```
|
|
||||||
|
|
||||||
And the test reports `turn right` for the route `a->e`, where before it said `slight right`.
|
|
||||||
|
|
||||||
If you changed the turn angles, obviously you can expect changes in the distinction between `slight right` and `right`.
|
|
||||||
In such a case it is, of course, reasonable to change the expected route to report `right` instead of `slight right`. You should consider inspecting the actual turn angles at `b` to see if you feel that change is justified.
|
|
||||||
|
|
||||||
However, you should never adjust the test itself.
|
|
||||||
If you look at a failure, the other way around
|
|
||||||
|
|
||||||
```
|
|
||||||
Given a grid size of 5 m
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - b - - - - - - c
|
|
||||||
\
|
|
||||||
d - - - - - e
|
|
||||||
"""
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abc,bde,bde | depart,turn right,arrive|
|
|
||||||
```
|
|
||||||
|
|
||||||
where we see a `slight right`, over the expected `right`.
|
|
||||||
We could be tempted to adjust the grid size (e.g. from `10 m` to `20` meters).
|
|
||||||
|
|
||||||
Such a change would fundamentally alter the tests, though.
|
|
||||||
Since the part `b-d` is a short offset, when we are looking at a grid of size `5 m`, the angle calculation will try and compensate for this offset.
|
|
||||||
|
|
||||||
In this case we would see a very slight turn angle. If your change now reports different turn angles, you can of course change the expected result. But you should not adjust the grid size. The test would be testing turn angles of `180` and `100` degrees, instead of `180` and `160`.
|
|
||||||
|
|
||||||
### Consider Post-Processing Impacts
|
|
||||||
|
|
||||||
Some changes you might see could look completely unrelated. To understand the impact of your changes, you can make use of the debugging utilities you can finde in `util/debug.hpp` (and potentially other related headers).
|
|
||||||
|
|
||||||
If your test is inspecting a series of turns (remember, a turn not necessarily equals an instruction), you could see interaction with post-processing.
|
|
||||||
To see the unprocessed turns, you should print the steps at the end of step assembly (`assembleSteps` in `engine/guidance/assemble_steps.hpp`).
|
|
||||||
|
|
||||||
If you see unexpected changes, you can consider adding the `locations` field to your test to study what location a turn is reported at.
|
|
||||||
|
|
||||||
To study a test without post-processing impacts, you can create a copy of the case on a very large grid (like 2000 meters). In such a grid, `turn collapsing` would be essentially disable.
|
|
||||||
|
|
||||||
Sadly, there is no general guideline.
|
|
||||||
|
|
||||||
### Use Caution
|
|
||||||
|
|
||||||
If in doubt, ask another person. Inspect as much of the data as possible (e.g. print un-collapsed steps, turn angles and so on) and use your best judgement, if the new result seems justified.
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|||||||
set(bitness 64)
|
set(bitness 64)
|
||||||
message(STATUS "Building on a 64 bit system")
|
message(STATUS "Building on a 64 bit system")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Building on a 32 bit system")
|
message(WARNING "Building on a 32 bit system is unsupported")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 AND MSVC_VERSION LESS 1900)
|
if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||||
@@ -33,4 +33,4 @@ find_package(LibOSRM REQUIRED)
|
|||||||
|
|
||||||
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
|
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
|
||||||
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LibOSRM_CXXFLAGS}")
|
set(CMAKE_CXX_FLAGS ${LibOSRM_CXXFLAGS})
|
||||||
|
|||||||
@@ -174,26 +174,3 @@ Feature: Bike - Access tags on ways
|
|||||||
| cycleway | | no | | x |
|
| cycleway | | no | | x |
|
||||||
| runway | | | yes | |
|
| runway | | | yes | |
|
||||||
| cycleway | | | no | x |
|
| cycleway | | | no | x |
|
||||||
|
|
||||||
Scenario: Bike - Bridleways when access is explicit
|
|
||||||
Then routability should be
|
|
||||||
| highway | horse | foot | bicycle | bothw |
|
|
||||||
| bridleway | | | yes | x |
|
|
||||||
| bridleway | | yes | | x |
|
|
||||||
| bridleway | designated | | | |
|
|
||||||
| bridleway | | | | |
|
|
||||||
|
|
||||||
Scenario: Bike - Tram with oneway when access is implicit
|
|
||||||
Then routability should be
|
|
||||||
| highway | railway | access | oneway | bothw |
|
|
||||||
| residential | tram | | yes | x |
|
|
||||||
| service | tram | psv | yes | x |
|
|
||||||
|
|
||||||
Scenario: Bike - Access combinations
|
|
||||||
Then routability should be
|
|
||||||
| highway | access | bothw |
|
|
||||||
| primary | permissive | x |
|
|
||||||
| steps | permissive | x |
|
|
||||||
| footway | permissive | x |
|
|
||||||
| garbagetag | permissive | x |
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ Feature: Bicycle - Handle cycling
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
||||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
||||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||||
|
|||||||
@@ -64,6 +64,6 @@ Feature: Bike - Handle ferry routes
|
|||||||
| abcd | | ferry | yes | 1:00 |
|
| abcd | | ferry | yes | 1:00 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | d | abcd,abcd | 3600s |
|
| a | d | abcd,abcd | 3600s +-10 |
|
||||||
| d | a | abcd,abcd | 3600s |
|
| d | a | abcd,abcd | 3600s +-10 |
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ Feature: Bike - Max speed restrictions
|
|||||||
|
|
||||||
Scenario: Bicycle - Respect maxspeeds when lower that way type speed
|
Scenario: Bicycle - Respect maxspeeds when lower that way type speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | bothw |
|
| highway | maxspeed | bothw |
|
||||||
| residential | | 15 km/h |
|
| residential | | 15 km/h +- 1 |
|
||||||
| residential | 10 | 9 km/h |
|
| residential | 10 | 10 km/h +- 1 |
|
||||||
|
|
||||||
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | bothw |
|
| highway | maxspeed | bothw |
|
||||||
| residential | | 15 km/h |
|
| residential | | 15 km/h +- 1 |
|
||||||
| residential | 80 | 15 km/h |
|
| residential | 80 | 15 km/h |
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
Scenario: Bicycle - Maxspeed formats
|
Scenario: Bicycle - Maxspeed formats
|
||||||
@@ -63,14 +63,14 @@ Feature: Bike - Max speed restrictions
|
|||||||
| snail | 720s ~10% |
|
| snail | 720s ~10% |
|
||||||
|
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||||
| | | | 15 km/h | 15 km/h |
|
| | | | 15 km/h +- 1 | 15 km/h +- 1 |
|
||||||
| 10 | | | 9 km/h | 9 km/h |
|
| 10 | | | 10 km/h +- 1 | 10 km/h +- 1 |
|
||||||
| | 10 | | 9 km/h | 15 km/h |
|
| | 10 | | 10 km/h +- 1 | 15 km/h +- 1 |
|
||||||
| | | 10 | 14 km/h | 9 km/h |
|
| | | 10 | 15 km/h | 10 km/h +- 1 |
|
||||||
| 2 | 10 | | 9 km/h | 2 km/h |
|
| 2 | 10 | | 10 km/h +- 1 | 2 km/h |
|
||||||
| 2 | | 10 | 2 km/h | 9 km/h |
|
| 2 | | 10 | 2 km/h | 10 km/h +- 1 |
|
||||||
| 2 | 5 | 10 | 5 km/h | 9 km/h |
|
| 2 | 5 | 10 | 5 km/h | 10 km/h +- 1 |
|
||||||
|
|
||||||
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -6,22 +6,21 @@ Feature: Bike - Surfaces
|
|||||||
|
|
||||||
Scenario: Bicycle - Slow surfaces
|
Scenario: Bicycle - Slow surfaces
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | surface | bothw |
|
| highway | surface | bothw |
|
||||||
| cycleway | | 48 s |
|
| cycleway | | 48 s |
|
||||||
| cycleway | asphalt | 48 s |
|
| cycleway | asphalt | 48 s |
|
||||||
| cycleway | cobblestone:flattened | 72 s |
|
| cycleway | cobblestone:flattened | 72 s |
|
||||||
| cycleway | paving_stones | 72 s |
|
| cycleway | paving_stones | 72 s |
|
||||||
| cycleway | compacted | 72 s |
|
| cycleway | compacted | 72 s |
|
||||||
| cycleway | cobblestone | 120 s |
|
| cycleway | cobblestone | 120 s |
|
||||||
| cycleway | fine_gravel | 120 s |
|
| cycleway | fine_gravel | 120 s |
|
||||||
| cycleway | gravel | 120 s |
|
| cycleway | gravel | 120 s |
|
||||||
| cycleway | pebblestone | 120.1 s |
|
| cycleway | pebblestone | 120 s |
|
||||||
| cycleway | dirt | 120 s |
|
| cycleway | dirt | 120 s |
|
||||||
| cycleway | earth | 120 s |
|
| cycleway | earth | 120 s |
|
||||||
| cycleway | grass | 120 s |
|
| cycleway | grass | 120 s |
|
||||||
| cycleway | mud | 240 s |
|
| cycleway | mud | 240 s |
|
||||||
| cycleway | sand | 240.1 s |
|
| cycleway | sand | 240 s |
|
||||||
| cycleway | sett | 72 s |
|
|
||||||
|
|
||||||
Scenario: Bicycle - Good surfaces on small paths
|
Scenario: Bicycle - Good surfaces on small paths
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
+41
-132
@@ -30,35 +30,6 @@ Feature: Car - Restricted access
|
|||||||
| | | no | yes | x |
|
| | | no | yes | x |
|
||||||
| | | yes | no | |
|
| | | yes | no | |
|
||||||
|
|
||||||
Scenario: Car - Access tag hierarchy and forward/backward
|
|
||||||
Then routability should be
|
|
||||||
| access | access:forward | access:backward | motorcar | motorcar:forward | motorcar:backward | forw | backw |
|
|
||||||
| | | | | | | x | x |
|
|
||||||
| yes | | | | | | x | x |
|
|
||||||
| yes | no | | | | | | x |
|
|
||||||
| yes | yes | | no | | | | |
|
|
||||||
| yes | yes | | yes | no | | | x |
|
|
||||||
| yes | | | | | | x | x |
|
|
||||||
| yes | | no | | | | x | |
|
|
||||||
| yes | | yes | no | | | | |
|
|
||||||
| yes | | yes | yes | | no | x | |
|
|
||||||
| no | | | | | | | |
|
|
||||||
| no | yes | | | | | x | |
|
|
||||||
| no | no | | yes | | | x | x |
|
|
||||||
| no | no | | no | yes | | x | |
|
|
||||||
| no | | | | | | | |
|
|
||||||
| no | | yes | | | | | x |
|
|
||||||
| no | | no | yes | | | x | x |
|
|
||||||
| no | | no | no | | yes | | x |
|
|
||||||
| | no | | | no | | | x |
|
|
||||||
| | | no | | | no | x | |
|
|
||||||
| | no | | | | no | | |
|
|
||||||
| | | no | no | | | | |
|
|
||||||
| | no | | | yes | | x | x |
|
|
||||||
| | | no | | | yes | x | x |
|
|
||||||
| | yes | | | no | | | x |
|
|
||||||
| | | yes | | | no | x | |
|
|
||||||
|
|
||||||
Scenario: Car - Access tag hierarchy on nodes
|
Scenario: Car - Access tag hierarchy on nodes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
|
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
|
||||||
@@ -119,13 +90,12 @@ Feature: Car - Restricted access
|
|||||||
| permissive | x |
|
| permissive | x |
|
||||||
| designated | x |
|
| designated | x |
|
||||||
| no | |
|
| no | |
|
||||||
| private | x |
|
| private | |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestry | |
|
||||||
| psv | |
|
| psv | |
|
||||||
| delivery | x |
|
| delivery | |
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
| destination | x |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Car - Access tags on nodes
|
Scenario: Car - Access tags on nodes
|
||||||
@@ -135,11 +105,11 @@ Feature: Car - Restricted access
|
|||||||
| permissive | x |
|
| permissive | x |
|
||||||
| designated | x |
|
| designated | x |
|
||||||
| no | |
|
| no | |
|
||||||
| private | x |
|
| private | |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestry | |
|
||||||
| psv | |
|
| psv | |
|
||||||
| delivery | x |
|
| delivery | |
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
|
||||||
Scenario: Car - Access tags on both node and way
|
Scenario: Car - Access tags on both node and way
|
||||||
@@ -157,15 +127,15 @@ Feature: Car - Restricted access
|
|||||||
|
|
||||||
Scenario: Car - Access combinations
|
Scenario: Car - Access combinations
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
|
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
|
||||||
| runway | private | | | permissive | x | x | |
|
| runway | private | | | permissive | x |
|
||||||
| primary | forestry | | yes | | x | x | |
|
| primary | forestry | | yes | | x |
|
||||||
| cycleway | | | designated | | x | x | |
|
| cycleway | | | designated | | x |
|
||||||
| residential | | yes | no | | | | |
|
| residential | | yes | no | | |
|
||||||
| motorway | yes | permissive | | private | x | | implied oneway |
|
| motorway | yes | permissive | | private | |
|
||||||
| trunk | agricultural | designated | permissive | no | | | |
|
| trunk | agricultural | designated | permissive | no | |
|
||||||
| pedestrian | | | | | | | |
|
| pedestrian | | | | | |
|
||||||
| pedestrian | | | | destination | x | x | |
|
| pedestrian | | | | destination | x |
|
||||||
|
|
||||||
Scenario: Car - Ignore access tags for other modes
|
Scenario: Car - Ignore access tags for other modes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -179,46 +149,33 @@ Feature: Car - Restricted access
|
|||||||
| runway | | | | yes | |
|
| runway | | | | yes | |
|
||||||
| primary | | | | no | x |
|
| primary | | | | no | x |
|
||||||
|
|
||||||
@hov
|
Scenario: Car - only designated HOV ways are ignored by default
|
||||||
Scenario: Car - designated HOV ways are rated low
|
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | hov | bothw | forw_rate | backw_rate |
|
| highway | hov | bothw |
|
||||||
| primary | designated | x | 18 | 18 |
|
| primary | designated | |
|
||||||
| primary | yes | x | 18 | 18 |
|
| primary | yes | x |
|
||||||
| primary | no | x | 18 | 18 |
|
| primary | no | x |
|
||||||
|
|
||||||
# Models:
|
Scenario: Car - a way with all lanes HOV-designated is inaccessible by default (similar to hov=designated)
|
||||||
# https://www.openstreetmap.org/way/124891268
|
|
||||||
# https://www.openstreetmap.org/way/237173472
|
|
||||||
@hov
|
|
||||||
Scenario: Car - I-66 use HOV-only roads with heavy penalty
|
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
|
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw |
|
||||||
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
|
| primary | designated | designated | | | | |
|
||||||
| motorway | lane | | 3 | designated | yes | x | | 25 |
|
| primary | | designated | | | x | |
|
||||||
|
| primary | designated | | | | | x |
|
||||||
@hov
|
| primary | designated\|designated | designated\|designated | | | | |
|
||||||
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
| primary | designated\|no | designated\|no | | | x | x |
|
||||||
Then routability should be
|
| primary | yes\|no | yes\|no | | | x | x |
|
||||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
| primary | | | | | x | x |
|
||||||
| primary | designated | designated | | | x | x | 18 | 18 |
|
| primary | designated | | | -1 | | |
|
||||||
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
| primary | | designated | | -1 | | x |
|
||||||
#| primary | | designated | | | x | x | 18 | 18 |
|
| primary | | | designated | yes | | |
|
||||||
#| primary | designated | | | | x | x | 18 | 18 |
|
| primary | | | designated | -1 | | |
|
||||||
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
|
| primary | | | designated\| | yes | x | |
|
||||||
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
|
| primary | | | designated\| | -1 | | x |
|
||||||
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
|
| primary | | | designated\|designated | yes | | |
|
||||||
| primary | | | | | x | x | 18 | 18 |
|
| primary | | | designated\|designated | -1 | | |
|
||||||
| primary | designated | | | -1 | | x | | 18 |
|
| primary | | | designated\|yes | yes | x | |
|
||||||
| primary | | designated | | -1 | | x | | 18 |
|
| primary | | | designated\|no | -1 | | x |
|
||||||
| primary | | | designated | yes | x | | 18 | |
|
|
||||||
| primary | | | designated | -1 | | x | | 18 |
|
|
||||||
| primary | | | designated\| | yes | x | | 18 | |
|
|
||||||
| primary | | | designated\| | -1 | | x | | 18 |
|
|
||||||
| primary | | | designated\|designated | yes | x | | 18 | |
|
|
||||||
| primary | | | designated\|designated | -1 | | x | | 18 |
|
|
||||||
| primary | | | designated\|yes | yes | x | | 18 | |
|
|
||||||
| primary | | | designated\|no | -1 | | x | | 18 |
|
|
||||||
|
|
||||||
Scenario: Car - these toll roads always work
|
Scenario: Car - these toll roads always work
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -226,57 +183,9 @@ Feature: Car - Restricted access
|
|||||||
| primary | no | x |
|
| primary | no | x |
|
||||||
| primary | snowmobile | x |
|
| primary | snowmobile | x |
|
||||||
|
|
||||||
Scenario: Car - toll=yes ways are enabled by default
|
# To test this we need issue #2781
|
||||||
|
@todo
|
||||||
|
Scenario: Car - only toll=yes ways are ignored by default
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | toll | bothw |
|
| highway | toll | bothw |
|
||||||
| primary | yes | x |
|
| primary | yes | |
|
||||||
|
|
||||||
Scenario: Car - directional access tags
|
|
||||||
Then routability should be
|
|
||||||
| highway | access | access:forward | access:backward | forw | backw |
|
|
||||||
| primary | yes | yes | yes | x | x |
|
|
||||||
| primary | yes | | no | x | |
|
|
||||||
| primary | yes | no | | | x |
|
|
||||||
| primary | yes | no | no | | |
|
|
||||||
| primary | no | no | no | | |
|
|
||||||
| primary | no | | yes | | x |
|
|
||||||
| primary | no | yes | | x | |
|
|
||||||
| primary | no | yes | yes | x | x |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
|
|
||||||
Then routability should be
|
|
||||||
| node/barrier | access | bothw |
|
|
||||||
| gate | | x |
|
|
||||||
| gate | no | |
|
|
||||||
| gate | yes | x |
|
|
||||||
| gate | permissive | x |
|
|
||||||
| gate | designated | x |
|
|
||||||
| gate | private | x |
|
|
||||||
| gate | garbagetag | x |
|
|
||||||
|
|
||||||
Scenario: Car - a way with conditional access
|
|
||||||
Then routability should be
|
|
||||||
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
|
|
||||||
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
|
|
||||||
|
|
||||||
Scenario: Car - a way with a list of tags
|
|
||||||
Then routability should be
|
|
||||||
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw |
|
|
||||||
| footway | | | destination | | x |
|
|
||||||
| track | destination;agricultural | destination | | x | x |
|
|
||||||
|
|
||||||
Scenario: Car - Don't route over steps even if marked as accessible
|
|
||||||
Then routability should be
|
|
||||||
| highway | access | forw | backw |
|
|
||||||
| steps | yes | | |
|
|
||||||
| steps | no | | |
|
|
||||||
| primary | | x | x |
|
|
||||||
|
|
||||||
Scenario: Car - Access combinations
|
|
||||||
Then routability should be
|
|
||||||
| highway | access | bothw |
|
|
||||||
| primary | permissive | x |
|
|
||||||
| steps | permissive | |
|
|
||||||
| footway | permissive | x |
|
|
||||||
| garbagetag | permissive | x |
|
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ Feature: Car - Barriers
|
|||||||
| gate | permissive | x |
|
| gate | permissive | x |
|
||||||
| gate | designated | x |
|
| gate | designated | x |
|
||||||
| gate | no | |
|
| gate | no | |
|
||||||
| gate | private | x |
|
| gate | private | |
|
||||||
| gate | agricultural | |
|
| gate | agricultural | |
|
||||||
| wall | | |
|
| wall | | |
|
||||||
| wall | yes | x |
|
| wall | yes | x |
|
||||||
| wall | permissive | x |
|
| wall | permissive | x |
|
||||||
| wall | designated | x |
|
| wall | designated | x |
|
||||||
| wall | no | |
|
| wall | no | |
|
||||||
| wall | private | x |
|
| wall | private | |
|
||||||
| wall | agricultural | |
|
| wall | agricultural | |
|
||||||
|
|
||||||
Scenario: Car - Rising bollard exception for barriers
|
Scenario: Car - Rising bollard exception for barriers
|
||||||
|
|||||||
@@ -29,27 +29,6 @@ Feature: Car - Handle driving
|
|||||||
| c | f | cde,efg,efg | driving,driving,driving |
|
| c | f | cde,efg,efg | driving,driving,driving |
|
||||||
| c | g | cde,efg,efg | driving,driving,driving |
|
| c | g | cde,efg,efg | driving,driving,driving |
|
||||||
|
|
||||||
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | bridge |
|
|
||||||
| abc | primary | |
|
|
||||||
| cde | | movable |
|
|
||||||
| efg | primary | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | modes | speed | time |
|
|
||||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
|
|
||||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
|
|
||||||
| c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
|
|
||||||
| e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
|
|
||||||
|
|
||||||
Scenario: Car - Properly handle durations
|
Scenario: Car - Properly handle durations
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -66,7 +45,7 @@ Feature: Car - Handle driving
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 7 km/h |
|
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 6 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 5 km/h |
|
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 4 km/h |
|
||||||
| c | e | cde,cde | driving,driving | 2 km/h |
|
| c | e | cde,cde | driving,driving | 2 km/h |
|
||||||
| e | c | cde,cde | driving,driving | 2 km/h |
|
| e | c | cde,cde | driving,driving | 2 km/h |
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@routing @car @destination
|
@routing @car @destination @todo
|
||||||
Feature: Car - Destination only, no passing through
|
Feature: Car - Destination only, no passing through
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
@@ -81,53 +81,3 @@ Feature: Car - Destination only, no passing through
|
|||||||
| e | a | de,cd,bc,ab,ab |
|
| e | a | de,cd,bc,ab,ab |
|
||||||
| b | d | bc,cd,cd |
|
| b | d | bc,cd,cd |
|
||||||
| d | b | cd,bc,bc |
|
| d | b | cd,bc,bc |
|
||||||
|
|
||||||
Scenario: Car - Routing around a way that becomes destination only
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
b
|
|
||||||
\
|
|
||||||
|
|
|
||||||
e++d++++++c--i
|
|
||||||
| \
|
|
||||||
\ h--a
|
|
||||||
\ |
|
|
||||||
\___________g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | access | oneway |
|
|
||||||
| ah | | no |
|
|
||||||
| ihg | | no |
|
|
||||||
| eg | | no |
|
|
||||||
| icde | | no |
|
|
||||||
| cde | destination | no |
|
|
||||||
| eb | | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | # |
|
|
||||||
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
|
|
||||||
| b | d | eb,cde,cde | # ends in restricted way correctly |
|
|
||||||
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
|
|
||||||
|
|
||||||
Scenario: Car - Routing around a way that becomes destination only
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a---c---b
|
|
||||||
+ \
|
|
||||||
+ |
|
|
||||||
d |
|
|
||||||
\___e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | access | oneway |
|
|
||||||
| acbe | | no |
|
|
||||||
| cd | destination | no |
|
|
||||||
| de | | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| e | a | acbe,acbe |
|
|
||||||
| d | a | de,acbe,acbe |
|
|
||||||
| c | d | cd,cd |
|
|
||||||
|
|||||||
+10
-31
@@ -29,27 +29,6 @@ Feature: Car - Handle ferry routes
|
|||||||
| c | f | cde,efg,efg | ferry,driving,driving |
|
| c | f | cde,efg,efg | ferry,driving,driving |
|
||||||
| c | g | cde,efg,efg | ferry,driving,driving |
|
| c | g | cde,efg,efg | ferry,driving,driving |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Car - Use default speeds to calculate duration if no duration given
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | route |
|
|
||||||
| abc | primary | |
|
|
||||||
| cde | | ferry |
|
|
||||||
| efg | primary | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | modes | speed | time |
|
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.4s |
|
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
|
|
||||||
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
|
||||||
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
|
||||||
Scenario: Car - Properly handle simple durations
|
Scenario: Car - Properly handle simple durations
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -65,11 +44,11 @@ Feature: Car - Handle ferry routes
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed | time |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||||
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||||
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||||
|
|
||||||
Scenario: Car - Properly handle ISO 8601 durations
|
Scenario: Car - Properly handle ISO 8601 durations
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -86,8 +65,8 @@ Feature: Car - Handle ferry routes
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed | time |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||||
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||||
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
@routing @car @hov
|
|
||||||
Feature: Car - Handle driving
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
And a grid size of 100 meters
|
|
||||||
|
|
||||||
Scenario: Car - Avoid hov when not on hov
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
b=========c========================e====j
|
|
||||||
~ ~ ~
|
|
||||||
a ~ f----m
|
|
||||||
| i |
|
|
||||||
| | ----------------l
|
|
||||||
| | /
|
|
||||||
g_______________h______k_____n
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | hov |
|
|
||||||
| ab | motorway_link | |
|
|
||||||
| bcej | motorway | designated |
|
|
||||||
| ag | primary | |
|
|
||||||
| ghkn | primary | |
|
|
||||||
| ih | primary | |
|
|
||||||
| kl | secondary | |
|
|
||||||
| lf | secondary | |
|
|
||||||
| ci | motorway_link | |
|
|
||||||
| ef | motorway_link | |
|
|
||||||
| fm | secondary | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| a | m | ag,ghkn,kl,lf,fm,fm |
|
|
||||||
| c | m | bcej,ef,fm,fm |
|
|
||||||
@@ -6,7 +6,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
|
|
||||||
Scenario: Car - Respect maxspeeds when lower than way type speed
|
Scenario: Car - Respect maxspeeds when lower that way type speed
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d e f g
|
a b c d e f g
|
||||||
@@ -23,7 +23,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 85 km/h |
|
| a | b | ab,ab | 68 km/h |
|
||||||
| b | c | bc,bc | 48 km/h |
|
| b | c | bc,bc | 48 km/h |
|
||||||
| c | d | cd,cd | 40 km/h |
|
| c | d | cd,cd | 40 km/h |
|
||||||
| d | e | de,de | 64 km/h |
|
| d | e | de,de | 64 km/h |
|
||||||
@@ -37,30 +37,26 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | maxspeed | # |
|
| nodes | highway | maxspeed |
|
||||||
| ab | residential | | default residential speed is 25 |
|
| ab | residential | |
|
||||||
| bc | residential | 90 | |
|
| bc | residential | 90 |
|
||||||
| cd | living_street | FR:urban | |
|
| cd | living_street | FR:urban |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 25 km/h |
|
| a | b | ab,ab | 20 km/h |
|
||||||
# default residential speed is 25, don't mess with this
|
|
||||||
| b | c | bc,bc | 72 km/h |
|
| b | c | bc,bc | 72 km/h |
|
||||||
# parsed maxspeeds are scaled by profile's speed_reduction value
|
|
||||||
| c | d | cd,cd | 40 km/h |
|
| c | d | cd,cd | 40 km/h |
|
||||||
# symbolic posted speeds without explicit exceptions are parsed
|
|
||||||
# from the profile's maxspeed_table_default table
|
|
||||||
|
|
||||||
Scenario: Car - Forward/backward maxspeed are scaled by profile's speed_reduction if explicitly set
|
Scenario: Car - Forward/backward maxspeed
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
|
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||||
| primary | | | | 65 km/h | 65 km/h |
|
| primary | | | | 52 km/h | 52 km/h |
|
||||||
| primary | 60 | | | 48 km/h | 48 km/h |
|
| primary | 60 | | | 48 km/h | 48 km/h |
|
||||||
| primary | | 60 | | 48 km/h | 65 km/h |
|
| primary | | 60 | | 48 km/h | 48 km/h +- 5 |
|
||||||
| primary | | | 60 | 65 km/h | 48 km/h |
|
| primary | | | 60 | 52 km/h | 52 km/h +- 5 |
|
||||||
| primary | 15 | 60 | | 48 km/h | 12 km/h |
|
| primary | 15 | 60 | | 48 km/h | 12 km/h |
|
||||||
| primary | 15 | | 60 | 12 km/h | 48 km/h |
|
| primary | 15 | | 60 | 12 km/h | 48 km/h |
|
||||||
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
|
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
|
||||||
@@ -85,55 +81,45 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
Scenario: Car - Too narrow streets should be ignored or incur a penalty
|
Scenario: Car - Too narrow streets should be ignored or incur a penalty
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|
||||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
| primary | | | | | 52 km/h | 52 km/h |
|
||||||
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
|
| primary | | 3 | | | 32 km/h | 32 km/h |
|
||||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
| primary | 60 | | | | 47 km/h | 47 km/h |
|
||||||
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 |
|
| primary | 60 | 3 | | | 29 km/h | 29 km/h |
|
||||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
| primary | | | 60 | | 47 km/h | 52 km/h |
|
||||||
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
| primary | | 3 | 60 | | 29 km/h | 32 km/h |
|
||||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
| primary | | | | 60 | 52 km/h | 47 km/h |
|
||||||
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
| primary | | 3 | | 60 | 32 km/h | 29 km/h |
|
||||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
| primary | 15 | | 60 | | 47 km/h | 12 km/h |
|
||||||
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
| primary | 15 | 3 | 60 | | 29 km/h | 7 km/h |
|
||||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
||||||
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
| primary | 15 | 3 | | 60 | 7 km/h | 29 km/h |
|
||||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
||||||
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
| primary | 15 | 3 | 30 | 60 | 14 km/h | 29 km/h |
|
||||||
|
|
||||||
Scenario: Car - Single lane streets be ignored or incur a penalty
|
Scenario: Car - Single lane streets be ignored or incur a penalty
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|
||||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
| primary | | | | | 52 km/h | 52 km/h |
|
||||||
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
|
| primary | | 1 | | | 32 km/h | 32 km/h |
|
||||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
| primary | 60 | | | | 47 km/h | 47 km/h |
|
||||||
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 |
|
| primary | 60 | 1 | | | 29 km/h | 29 km/h |
|
||||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
| primary | | | 60 | | 47 km/h | 52 km/h |
|
||||||
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
| primary | | 1 | 60 | | 29 km/h | 32 km/h |
|
||||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
| primary | | | | 60 | 52 km/h | 47 km/h |
|
||||||
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
| primary | | 1 | | 60 | 32 km/h | 29 km/h |
|
||||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
| primary | 15 | | 60 | | 47 km/h | 12 km/h |
|
||||||
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
| primary | 15 | 1 | 60 | | 29 km/h | 7 km/h |
|
||||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
||||||
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
| primary | 15 | 1 | | 60 | 7 km/h | 29 km/h |
|
||||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
||||||
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
| primary | 15 | 1 | 30 | 60 | 14 km/h | 29 km/h |
|
||||||
|
|
||||||
Scenario: Car - Single lane streets only incur a penalty for two-way streets
|
Scenario: Car - Single lane streets only incure a penalty for two-way streets
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
|
| highway | maxspeed | lanes | oneway | forw | backw |
|
||||||
| primary | 30 | 1 | yes | 23 km/h | | 7 | |
|
| primary | 30 | 1 | yes | 23 km/h | |
|
||||||
| primary | 30 | 1 | -1 | | 23 km/h | | 7 |
|
| primary | 30 | 1 | -1 | | 23 km/h |
|
||||||
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 |
|
| primary | 30 | 1 | | 15 km/h | 15 km/h |
|
||||||
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 |
|
| primary | 30 | 2 | | 23 km/h | 23 km/h |
|
||||||
|
|
||||||
Scenario: Car - Forward/backward maxspeed on reverse oneways
|
|
||||||
Then routability should be
|
|
||||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
|
|
||||||
| primary | | | | -1 | | 64 km/h | | 18 |
|
|
||||||
| primary | 30 | | | -1 | | 23 km/h | | 7 |
|
|
||||||
| primary | | 30 | | -1 | | 64 km/h | | 18 |
|
|
||||||
| primary | | | 30 | -1 | | 23 km/h | | 7 |
|
|
||||||
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
|
|
||||||
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
|
|
||||||
|
|||||||
+13
-13
@@ -78,24 +78,24 @@ Feature: Car - Street names in instructions
|
|||||||
Scenario: Inner city expressway with on road
|
Scenario: Inner city expressway with on road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b . . . c g
|
a b c g
|
||||||
`f .
|
f
|
||||||
`
|
|
||||||
.
|
|
||||||
.
|
|
||||||
d
|
d
|
||||||
.
|
|
||||||
.
|
|
||||||
.
|
|
||||||
e
|
e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | name:pronunciation | oneway |
|
| nodes | highway | name | name:pronunciation |
|
||||||
| abc | primary | road | roooaad | |
|
| abc | primary | road | roooaad |
|
||||||
| cg | primary | road | roooaad | |
|
| cg | primary | road | roooaad |
|
||||||
| bfd | trunk_link | sliproad | | yes |
|
| bfd | trunk_link | | |
|
||||||
| cde | trunk | trunk | truank | yes |
|
| cde | trunk | trunk | truank |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
|||||||
@@ -15,22 +15,6 @@ Feature: Car - Oneway streets
|
|||||||
| highway | oneway | forw | backw |
|
| highway | oneway | forw | backw |
|
||||||
| primary | -1 | | x |
|
| primary | -1 | | x |
|
||||||
|
|
||||||
Scenario: Car - Mode specific oneway
|
|
||||||
Then routability should be
|
|
||||||
| highway | oneway:motorcar | oneway:motor_vehicle | oneway:vehicle | oneway | forw | backw |
|
|
||||||
| primary | | | | | x | x |
|
|
||||||
| primary | yes | | | | x | |
|
|
||||||
| primary | | yes | | | x | |
|
|
||||||
| primary | | | yes | | x | |
|
|
||||||
| primary | | | | yes | x | |
|
|
||||||
| primary | yes | no | | | x | |
|
|
||||||
| primary | | yes | no | | x | |
|
|
||||||
| primary | | | yes | no | x | |
|
|
||||||
| primary | | | | yes | x | |
|
|
||||||
| primary | no | yes | | | x | x |
|
|
||||||
| primary | | no | yes | | x | x |
|
|
||||||
| primary | | | no | yes | x | x |
|
|
||||||
|
|
||||||
Scenario: Car - Implied oneways
|
Scenario: Car - Implied oneways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | junction | forw | backw | # |
|
| highway | junction | forw | backw | # |
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ Feature: Car - Surfaces
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
|
|
||||||
Scenario: Car - Ways tagged service should reduce speed
|
Scenario: Car - Surface should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | service | forw | backw | forw_rate |
|
| highway | service | forw | backw |
|
||||||
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | alley | 5 km/h +-1 | 5 km/h +-1 |
|
||||||
| service | emergency_access | | | |
|
| service | emergency_access | | |
|
||||||
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | driveway | 5 km/h +-1 | 5 km/h +-1 |
|
||||||
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | drive-through | 5 km/h +-1 | 5 km/h +-1 |
|
||||||
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | parking | 5 km/h +-1 | 5 km/h +-1 |
|
||||||
|
|||||||
+24
-40
@@ -5,49 +5,33 @@ Feature: Car - speeds
|
|||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
And a grid size of 1000 meters
|
And a grid size of 1000 meters
|
||||||
|
|
||||||
# should more or less match default speeds in car profile, but may be different due to rounding errors
|
|
||||||
Scenario: Car - speed of various way types
|
Scenario: Car - speed of various way types
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | bothw |
|
| highway | oneway | bothw |
|
||||||
| motorway | no | 89 km/h |
|
| motorway | no | 71 km/h |
|
||||||
| motorway_link | no | 44 km/h |
|
| motorway_link | no | 36 km/h |
|
||||||
| trunk | no | 85 km/h |
|
| trunk | no | 68 km/h |
|
||||||
| trunk_link | no | 39 km/h |
|
| trunk_link | no | 31 km/h |
|
||||||
| primary | no | 64 km/h |
|
| primary | no | 52 km/h |
|
||||||
| primary_link | no | 29 km/h |
|
| primary_link | no | 23 km/h |
|
||||||
| secondary | no | 55 km/h |
|
| secondary | no | 44 km/h |
|
||||||
| secondary_link | no | 24 km/h |
|
| secondary_link | no | 19 km/h |
|
||||||
| tertiary | no | 39 km/h |
|
| tertiary | no | 31 km/h |
|
||||||
| tertiary_link | no | 20 km/h |
|
| tertiary_link | no | 16 km/h |
|
||||||
| unclassified | no | 24 km/h |
|
| unclassified | no | 19 km/h |
|
||||||
| residential | no | 24 km/h |
|
| residential | no | 19 km/h |
|
||||||
| living_street | no | 9 km/h |
|
| living_street | no | 8 km/h |
|
||||||
| service | no | 15 km/h |
|
| service | no | 11 km/h |
|
||||||
|
|
||||||
# Alternating oneways scale rates but not speeds
|
# Alternating oneways have to take average waiting time into account.
|
||||||
Scenario: Car - scaled speeds for oneway=alternating
|
Scenario: Car - scaled speeds for oneway=alternating
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | junction | forw | backw | # |
|
| highway | oneway | junction | forw | backw | # |
|
||||||
| tertiary | | | 39 km/h | 39 km/h | |
|
| tertiary | | | 31 km/h | 31 km/h | |
|
||||||
| tertiary | alternating | | 39 km/h | 39 km/h | |
|
| tertiary | alternating | | 12 km/h +- 1 | 12 km/h +- 1 | |
|
||||||
| motorway | | | 89 km/h | | implied oneway |
|
| motorway | | | 71 km/h | | implied oneway |
|
||||||
| motorway | alternating | | 89 km/h | | implied oneway |
|
| motorway | alternating | | 28 km/h +- 1 | | implied oneway |
|
||||||
| motorway | reversible | | | | unroutable |
|
| motorway | reversible | | | | unroutable |
|
||||||
| primary | | roundabout | 64 km/h | | implied oneway |
|
| primary | | roundabout | 52 km/h | | implied oneway |
|
||||||
| primary | alternating | roundabout | 64 km/h | | implied oneway |
|
| primary | alternating | roundabout | 20 km/h +- 1 | | implied oneway |
|
||||||
| primary | reversible | roundabout | | | unroutable |
|
| primary | reversible | roundabout | | | unroutable |
|
||||||
|
|
||||||
Scenario: Car - Check roundoff errors
|
|
||||||
Then routability should be
|
|
||||||
|
|
||||||
| highway | maxspeed | forw | backw |
|
|
||||||
| primary | | 64 km/h | 64 km/h |
|
|
||||||
| primary | 60 | 47 km/h | 47 km/h |
|
|
||||||
| primary | 60 | 47 km/h | 47 km/h |
|
|
||||||
| primary | 60 | 47 km/h | 47 km/h |
|
|
||||||
|
|
||||||
Scenario: Car - Side road penalties
|
|
||||||
Then routability should be
|
|
||||||
|
|
||||||
| highway | side_road | forw | backw | forw_rate | backw_rate |
|
|
||||||
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
|
|
||||||
|
|||||||
@@ -27,10 +27,7 @@ Feature: Basic Routing
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | summary |
|
| waypoints | route | summary |
|
||||||
| a,e | road,,1 st,1 st | road, 1 st |
|
| a,e | road,,1 st,1 st | road, 1 st |
|
||||||
# The via node `d` belongs to `cd`, `de`, `df`, `dg` and depending on the edge
|
| a,d,f | road,,,street,street | road;street |
|
||||||
# summary can be "road;street", "road, 1 st;1 st, street", "road, blvd;blvd, street"
|
|
||||||
# The test must be fixed by #2287
|
|
||||||
#| a,d,f | road,,,street,street | road;street |
|
|
||||||
| a,e,f | road,,1 st,1 st,1 st,street,street | road, 1 st;1 st, street |
|
| a,e,f | road,,1 st,1 st,1 st,street,street | road, 1 st;1 st, street |
|
||||||
|
|
||||||
Scenario: Name Empty
|
Scenario: Name Empty
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ Feature: Car - Surfaces
|
|||||||
| highway | access | tracktype | smoothness | surface | forw | backw |
|
| highway | access | tracktype | smoothness | surface | forw | backw |
|
||||||
| motorway | | | | | x | |
|
| motorway | | | | | x | |
|
||||||
| motorway | no | grade1 | excellent | asphalt | | |
|
| motorway | no | grade1 | excellent | asphalt | | |
|
||||||
| motorway | private | grade1 | excellent | asphalt | x | |
|
| motorway | private | grade1 | excellent | asphalt | | |
|
||||||
| motorway | agricultural | grade1 | excellent | asphalt | | |
|
| motorway | agricultural | grade1 | excellent | asphalt | | |
|
||||||
| motorway | forestry | grade1 | excellent | asphalt | | |
|
| motorway | forestry | grade1 | excellent | asphalt | | |
|
||||||
| motorway | emergency | grade1 | excellent | asphalt | | |
|
| motorway | emergency | grade1 | excellent | asphalt | | |
|
||||||
| primary | | | | | x | x |
|
| primary | | | | | x | x |
|
||||||
| primary | private | grade1 | excellent | asphalt | x | x |
|
|
||||||
| primary | no | grade1 | excellent | asphalt | | |
|
| primary | no | grade1 | excellent | asphalt | | |
|
||||||
|
| primary | private | grade1 | excellent | asphalt | | |
|
||||||
| primary | agricultural | grade1 | excellent | asphalt | | |
|
| primary | agricultural | grade1 | excellent | asphalt | | |
|
||||||
| primary | forestry | grade1 | excellent | asphalt | | |
|
| primary | forestry | grade1 | excellent | asphalt | | |
|
||||||
| primary | emergency | grade1 | excellent | asphalt | | |
|
| primary | emergency | grade1 | excellent | asphalt | | |
|
||||||
@@ -64,65 +64,64 @@ Feature: Car - Surfaces
|
|||||||
Scenario: Car - Surface should reduce speed
|
Scenario: Car - Surface should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | surface | forw | backw |
|
| highway | oneway | surface | forw | backw |
|
||||||
| motorway | no | | 90 km/h | 90 km/h |
|
| motorway | no | | 72 km/h | 72 km/h |
|
||||||
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 |
|
| motorway | no | asphalt | 72 km/h | 72 km/h +-1 |
|
||||||
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 |
|
| motorway | no | concrete | 72 km/h +-1 | 72 km/h +-1 |
|
||||||
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 |
|
| motorway | no | concrete:plates | 72 km/h +-1 | 72 km/h +-1 |
|
||||||
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 |
|
| motorway | no | concrete:lanes | 72 km/h +-1 | 72 km/h +-1 |
|
||||||
| motorway | no | paved | 90 km/h +-1 | 90 km/h +-1 |
|
| motorway | no | paved | 72 km/h +-1 | 72 km/h +-1 |
|
||||||
| motorway | no | cement | 80 km/h +-1 | 80 km/h +-1 |
|
| motorway | no | cement | 64 km/h +-1 | 64 km/h +-1 |
|
||||||
| motorway | no | compacted | 80 km/h +-1 | 80 km/h +-1 |
|
| motorway | no | compacted | 64 km/h +-1 | 64 km/h +-1 |
|
||||||
| motorway | no | fine_gravel | 80 km/h +-1 | 80 km/h +-1 |
|
| motorway | no | fine_gravel | 64 km/h +-1 | 64 km/h +-1 |
|
||||||
| motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 |
|
| motorway | no | paving_stones | 48 km/h +-1 | 48 km/h +-1 |
|
||||||
| motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 |
|
| motorway | no | metal | 48 km/h +-1 | 48 km/h +-1 |
|
||||||
| motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 |
|
| motorway | no | bricks | 48 km/h +-1 | 48 km/h +-1 |
|
||||||
| motorway | no | grass | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | grass | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | wood | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | wood | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | sett | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | sett | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | grass_paver | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | grass_paver | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | gravel | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | gravel | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | unpaved | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | unpaved | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | ground | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | ground | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | dirt | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | dirt | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | pebblestone | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | pebblestone | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | tartan | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | tartan | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | cobblestone | 30 km/h +-1 | 30 km/h +-1 |
|
| motorway | no | cobblestone | 24 km/h +-1 | 24 km/h +-1 |
|
||||||
| motorway | no | clay | 30 km/h +-1 | 30 km/h +-1 |
|
| motorway | no | clay | 24 km/h +-1 | 24 km/h +-1 |
|
||||||
| motorway | no | earth | 20 km/h +-1 | 20 km/h +-1 |
|
| motorway | no | earth | 16 km/h +-1 | 16 km/h +-1 |
|
||||||
| motorway | no | stone | 20 km/h +-1 | 20 km/h +-1 |
|
| motorway | no | stone | 16 km/h +-1 | 16 km/h +-1 |
|
||||||
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 |
|
| motorway | no | rocky | 16 km/h +-1 | 16 km/h +-1 |
|
||||||
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 |
|
| motorway | no | sand | 16 km/h +-1 | 16 km/h +-1 |
|
||||||
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
|
|
||||||
|
|
||||||
Scenario: Car - Tracktypes should reduce speed
|
Scenario: Car - Tracktypes should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | tracktype | forw | backw |
|
| highway | oneway | tracktype | forw | backw |
|
||||||
| motorway | no | | 90 km/h | 90 km/h |
|
| motorway | no | | 72 km/h | 72 km/h |
|
||||||
| motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 |
|
| motorway | no | grade1 | 48 km/h +-1 | 48 km/h +-1 |
|
||||||
| motorway | no | grade2 | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | grade2 | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | grade3 | 30 km/h +-1 | 30 km/h +-1 |
|
| motorway | no | grade3 | 24 km/h +-1 | 24 km/h +-1 |
|
||||||
| motorway | no | grade4 | 25 km/h +-1 | 25 km/h +-1 |
|
| motorway | no | grade4 | 20 km/h +-1 | 20 km/h +-1 |
|
||||||
| motorway | no | grade5 | 20 km/h +-1 | 20 km/h +-1 |
|
| motorway | no | grade5 | 16 km/h +-1 | 16 km/h +-1 |
|
||||||
|
|
||||||
Scenario: Car - Smoothness should reduce speed
|
Scenario: Car - Smoothness should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | smoothness | forw | backw |
|
| highway | oneway | smoothness | forw | backw |
|
||||||
| motorway | no | | 90 km/h | 90 km/h |
|
| motorway | no | | 72 km/h | 72 km/h |
|
||||||
| motorway | no | intermediate | 80 km/h | 80 km/h |
|
| motorway | no | intermediate | 64 km/h | 64 km/h |
|
||||||
| motorway | no | bad | 40 km/h +-1 | 40 km/h +-1 |
|
| motorway | no | bad | 32 km/h +-1 | 32 km/h +-1 |
|
||||||
| motorway | no | very_bad | 20 km/h +-1 | 20 km/h +-1 |
|
| motorway | no | very_bad | 16 km/h +-1 | 16 km/h +-1 |
|
||||||
| motorway | no | horrible | 10 km/h +-1 | 10 km/h +-1 |
|
| motorway | no | horrible | 8 km/h +-1 | 8 km/h +-1 |
|
||||||
| motorway | no | very_horrible | 5 km/h +-1 | 5 km/h +-1 |
|
| motorway | no | very_horrible | 4 km/h +-1 | 4 km/h +-1 |
|
||||||
|
|
||||||
Scenario: Car - Combination of surface tags should use lowest speed
|
Scenario: Car - Combination of surface tags should use lowest speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | tracktype | surface | smoothness | bothw |
|
| highway | oneway | tracktype | surface | smoothness | backw | forw |
|
||||||
| motorway | no | | | | 90 km/h |
|
| motorway | no | | | | 72 km/h | 72 km/h |
|
||||||
| service | no | grade1 | asphalt | excellent | 15 km/h |
|
| service | no | grade1 | asphalt | excellent | 12 km/h | 12 km/h |
|
||||||
| motorway | no | grade5 | asphalt | excellent | 20 km/h |
|
| motorway | no | grade5 | asphalt | excellent | 16 km/h | 16 km/h |
|
||||||
| motorway | no | grade1 | mud | excellent | 10 km/h |
|
| motorway | no | grade1 | mud | excellent | 8 km/h | 8 km/h |
|
||||||
| motorway | no | grade1 | asphalt | very_horrible | 5 km/h |
|
| motorway | no | grade1 | asphalt | very_horrible | 4 km/h | 4 km/h |
|
||||||
| service | no | grade5 | mud | very_horrible | 5 km/h |
|
| service | no | grade5 | mud | very_horrible | 4 km/h | 4 km/h |
|
||||||
|
|
||||||
Scenario: Car - Surfaces should not affect oneway direction
|
Scenario: Car - Surfaces should not affect oneway direction
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
@routing @speed @traffic
|
||||||
|
Feature: Traffic - speeds
|
||||||
|
|
||||||
|
Background: Use specific speeds
|
||||||
|
|
||||||
|
Scenario: Weighting based on speed file
|
||||||
|
Given the node locations
|
||||||
|
| node | lat | lon |
|
||||||
|
| a | 0.1 | 0.1 |
|
||||||
|
| b | 0.05 | 0.1 |
|
||||||
|
| c | 0.0 | 0.1 |
|
||||||
|
| d | 0.05 | 0.03 |
|
||||||
|
| e | 0.05 | 0.066 |
|
||||||
|
| f | 0.075 | 0.066 |
|
||||||
|
| g | 0.075 | 0.1 |
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| ad | primary |
|
||||||
|
| bc | primary |
|
||||||
|
| dc | primary |
|
||||||
|
| de | primary |
|
||||||
|
| eb | primary |
|
||||||
|
| df | primary |
|
||||||
|
| fb | primary |
|
||||||
|
Given the profile "testbot"
|
||||||
|
Given the extract extra arguments "--generate-edge-lookup"
|
||||||
|
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,0
|
||||||
|
2,1,0
|
||||||
|
2,3,27
|
||||||
|
3,2,27
|
||||||
|
1,4,27
|
||||||
|
4,1,27
|
||||||
|
"""
|
||||||
|
And I route I should get
|
||||||
|
| from | to | route | speed |
|
||||||
|
| a | b | ad,de,eb,eb | 30 km/h |
|
||||||
|
| a | c | ad,dc,dc | 31 km/h |
|
||||||
|
| b | c | bc,bc | 27 km/h |
|
||||||
|
| a | d | ad,ad | 27 km/h |
|
||||||
|
| d | c | dc,dc | 36 km/h |
|
||||||
|
| g | b | fb,fb | 36 km/h |
|
||||||
|
| a | g | ad,df,fb,fb | 30 km/h |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Speeds that isolate a single node (a)
|
||||||
|
Given the node locations
|
||||||
|
| node | lat | lon |
|
||||||
|
| a | 0.1 | 0.1 |
|
||||||
|
| b | 0.05 | 0.1 |
|
||||||
|
| c | 0.0 | 0.1 |
|
||||||
|
| d | 0.05 | 0.03 |
|
||||||
|
| e | 0.05 | 0.066 |
|
||||||
|
| f | 0.075 | 0.066 |
|
||||||
|
| g | 0.075 | 0.1 |
|
||||||
|
| h | 2.075 | 19.1 |
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| ad | primary |
|
||||||
|
| bc | primary |
|
||||||
|
| dc | primary |
|
||||||
|
| de | primary |
|
||||||
|
| eb | primary |
|
||||||
|
| df | primary |
|
||||||
|
| fb | primary |
|
||||||
|
Given the profile "testbot"
|
||||||
|
Given the extract extra arguments "--generate-edge-lookup"
|
||||||
|
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,0
|
||||||
|
2,1,0
|
||||||
|
2,3,27
|
||||||
|
3,2,27
|
||||||
|
1,4,0
|
||||||
|
4,1,0
|
||||||
|
"""
|
||||||
|
And I route I should get
|
||||||
|
| from | to | route | speed |
|
||||||
|
| a | b | fb,fb | 36 km/h |
|
||||||
|
| a | c | fb,bc,bc | 30 km/h |
|
||||||
|
| b | c | bc,bc | 27 km/h |
|
||||||
|
| a | d | fb,df,df | 36 km/h |
|
||||||
|
| d | c | dc,dc | 36 km/h |
|
||||||
|
| g | b | fb,fb | 36 km/h |
|
||||||
|
| a | g | fb,fb | 36 km/h |
|
||||||
|
|
||||||
|
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||||
|
Given the node locations
|
||||||
|
| node | lat | lon |
|
||||||
|
| a | 0.1 | 0.1 |
|
||||||
|
| b | 0.05 | 0.1 |
|
||||||
|
| c | 0.0 | 0.1 |
|
||||||
|
| d | 0.05 | 0.03 |
|
||||||
|
| e | 0.05 | 0.066 |
|
||||||
|
| f | 0.075 | 0.066 |
|
||||||
|
| g | 0.075 | 0.1 |
|
||||||
|
| h | 1.075 | 10.1 |
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| ad | primary |
|
||||||
|
| bc | primary |
|
||||||
|
| dc | primary |
|
||||||
|
| de | primary |
|
||||||
|
| eb | primary |
|
||||||
|
| df | primary |
|
||||||
|
| fb | primary |
|
||||||
|
Given the profile "testbot"
|
||||||
|
Given the extract extra arguments "--generate-edge-lookup"
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,-10
|
||||||
|
2,1,-20
|
||||||
|
2,3,27
|
||||||
|
3,2,27
|
||||||
|
1,4,-3
|
||||||
|
4,1,-5
|
||||||
|
"""
|
||||||
|
And the data has been extracted
|
||||||
|
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||||
|
And stderr should contain "malformed"
|
||||||
|
And it should exit with an error
|
||||||
@@ -52,23 +52,23 @@ Feature: Traffic - turn penalties
|
|||||||
|
|
||||||
Scenario: Weighting not based on turn penalty file
|
Scenario: Weighting not based on turn penalty file
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | weight | time |
|
| from | to | route | speed | time |
|
||||||
| a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 |
|
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
||||||
# straight
|
# straight
|
||||||
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
|
| i | g | fim,fg,fg | 45 km/h | 16s +-1 |
|
||||||
# right
|
# right
|
||||||
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
|
| a | e | ad,def,def | 38 km/h | 19s +-1 |
|
||||||
# left
|
# left
|
||||||
| c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 |
|
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
||||||
# double straight
|
# double straight
|
||||||
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
|
| p | g | mp,fim,fg,fg | 48 km/h | 29s +-1 |
|
||||||
# straight-right
|
# straight-right
|
||||||
| a | l | ad,dhk,klm,klm | 53 km/h | 27s +-1 | 27s +-1 |
|
| a | l | ad,dhk,klm,klm | 44 km/h | 33s +-1 |
|
||||||
# straight-left
|
# straight-left
|
||||||
| l | e | klm,dhk,def,def | 55 km/h | 26s +-1 | 26s +-1 |
|
| l | e | klm,dhk,def,def | 45 km/h | 32s +-1 |
|
||||||
# double right
|
# double right
|
||||||
| g | n | fg,fim,mn,mn | 44 km/h | 32s +-1 | 32s +-1 |
|
| g | n | fg,fim,mn,mn | 38 km/h | 38s +-1 |
|
||||||
# double left
|
# double left
|
||||||
|
|
||||||
Scenario: Weighting based on turn penalty file
|
Scenario: Weighting based on turn penalty file
|
||||||
Given the turn penalty file
|
Given the turn penalty file
|
||||||
@@ -80,33 +80,27 @@ Feature: Traffic - turn penalties
|
|||||||
8,11,12,23
|
8,11,12,23
|
||||||
1,4,5,-0.2
|
1,4,5,-0.2
|
||||||
"""
|
"""
|
||||||
# ifg right turn
|
|
||||||
# imn left turn
|
|
||||||
# hdc left turn
|
|
||||||
# lkh right turn
|
|
||||||
# hkl left turn
|
|
||||||
# ade left turn
|
|
||||||
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | weight | time |
|
| from | to | route | speed | time |
|
||||||
| a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 |
|
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
||||||
# straight
|
# straight
|
||||||
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
|
| i | g | fim,fg,fg | 46 km/h | 15s +-1 |
|
||||||
# right - ifg penalty
|
# right - ifg penalty
|
||||||
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
|
| a | e | ad,def,def | 53 km/h | 14s +-1 |
|
||||||
# left - faster because of negative ade penalty
|
# left - faster because of negative ade penalty
|
||||||
| c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 |
|
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
||||||
# double straight
|
# double straight
|
||||||
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
|
| p | g | mp,fim,fg,fg | 49 km/h | 29s +-1 |
|
||||||
# straight-right - ifg penalty
|
# straight-right - ifg penalty
|
||||||
| a | l | ad,def,fim,klm,klm | 58 km/h | 37 | 37s +-1 |
|
| a | l | ad,def,fim,klm,klm | 48 km/h | 45s +-1 |
|
||||||
# was straight-left - forced around by hkl penalty
|
# was straight-left - forced around by hkl penalty
|
||||||
| l | e | klm,fim,def,def | 44 km/h | 32.6 | 32s +-1 |
|
| l | e | klm,fim,def,def | 38 km/h | 38s +-1 |
|
||||||
# double right - forced left by lkh penalty
|
# double right - forced left by lkh penalty
|
||||||
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
|
| g | n | fg,fim,mn,mn | 25 km/h | 57s +-1 |
|
||||||
# double left - imn penalty
|
# double left - imn penalty
|
||||||
| j | c | jk,klm,fim,def,cd,cd | 53 km/h | 54.6 | 54s +-1 |
|
| j | c | jk,klm,fim,def,cd,cd | 44 km/h | 65.8s +-1 |
|
||||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||||
|
|
||||||
Scenario: Too-negative penalty clamps, but does not fail
|
Scenario: Too-negative penalty clamps, but does not fail
|
||||||
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
|
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
@@ -117,9 +111,7 @@ Feature: Traffic - turn penalties
|
|||||||
"""
|
"""
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
# The target point `d` can be in `ad`, `cd`, `deh` and `dhk`
|
| a | d | ad,ad | 10s +-1 |
|
||||||
# The test must be fixed by #2287
|
|
||||||
#| a | d | ad,ad | 10s +-1 |
|
|
||||||
| a | e | ad,def,def | 10s +-1 |
|
| a | e | ad,def,def | 10s +-1 |
|
||||||
| b | f | bf,bf | 10s +-1 |
|
| b | f | bf,bf | 10s +-1 |
|
||||||
| b | g | bf,fg,fg | 20s +-1 |
|
| b | g | bf,fg,fg | 20s +-1 |
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
@routing @car @weight
|
|
||||||
Feature: Car - weights
|
|
||||||
|
|
||||||
Background: Use specific speeds
|
|
||||||
Given the profile "car"
|
|
||||||
|
|
||||||
Scenario: Only routes down service road when that's the destination
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a--b--c
|
|
||||||
|
|
|
||||||
d
|
|
||||||
|
|
|
||||||
e--f--g
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | residential |
|
|
||||||
| efg | residential |
|
|
||||||
| cg | tertiary |
|
|
||||||
| bdf | service |
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | speed | weight |
|
|
||||||
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
|
|
||||||
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
|
|
||||||
|
|
||||||
Scenario: Does not jump off the highway to go down service road
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
|
|
|
||||||
b
|
|
||||||
|\
|
|
||||||
| e
|
|
||||||
|/
|
|
||||||
c
|
|
||||||
|
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
And the nodes
|
|
||||||
| node | id |
|
|
||||||
| a | 1 |
|
|
||||||
| b | 2 |
|
|
||||||
| c | 3 |
|
|
||||||
| d | 4 |
|
|
||||||
| e | 5 |
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| ab | primary | yes |
|
|
||||||
| bc | primary | yes |
|
|
||||||
| cd | primary | yes |
|
|
||||||
| be | service | yes |
|
|
||||||
| ec | service | yes |
|
|
||||||
And the extract extra arguments "--generate-edge-lookup"
|
|
||||||
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
|
||||||
And the speed file
|
|
||||||
"""
|
|
||||||
2,5,8
|
|
||||||
"""
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | speed | weight |
|
|
||||||
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
|
|
||||||
| a | e | ab,be,be | 14 km/h | 112 |
|
|
||||||
@@ -95,25 +95,3 @@ Feature: Foot - Access tags on ways
|
|||||||
| footway | | no | | x |
|
| footway | | no | | x |
|
||||||
| motorway | | | yes | |
|
| motorway | | | yes | |
|
||||||
| footway | | | no | x |
|
| footway | | | no | x |
|
||||||
|
|
||||||
Scenario: Foot - Bridleways when access is explicit
|
|
||||||
Then routability should be
|
|
||||||
| highway | horse | bicycle | foot | bothw |
|
|
||||||
| bridleway | | | yes | x |
|
|
||||||
| bridleway | | yes | | |
|
|
||||||
| bridleway | designated | | | |
|
|
||||||
| bridleway | | | | |
|
|
||||||
|
|
||||||
Scenario: Foot - a way with missing :forward tag
|
|
||||||
Then routability should be
|
|
||||||
| highway | bicycle:backward | foot:backward | forw | backw |
|
|
||||||
| cycleway | designated | designated | | x |
|
|
||||||
|
|
||||||
Scenario: Foot - Access combinations
|
|
||||||
Then routability should be
|
|
||||||
| highway | access | bothw |
|
|
||||||
| primary | permissive | x |
|
|
||||||
| steps | permissive | x |
|
|
||||||
| footway | permissive | x |
|
|
||||||
| garbagetag | permissive | x |
|
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,6 @@ Feature: Foot - Handle ferry routes
|
|||||||
| abcd | | ferry | yes | 1:00 |
|
| abcd | | ferry | yes | 1:00 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | d | abcd,abcd | 3600s |
|
| a | d | abcd,abcd | 3600s +-10 |
|
||||||
| d | a | abcd,abcd | 3600s |
|
| d | a | abcd,abcd | 3600s +-10 |
|
||||||
|
|||||||
@@ -5,17 +5,13 @@ Feature: Turn Lane Guidance
|
|||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 3 meters
|
Given a grid size of 3 meters
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
@sliproads
|
||||||
Scenario: Separate Turn Lanes
|
Scenario: Separate Turn Lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
.
|
a b c g
|
||||||
a ... b ..... c . g
|
d
|
||||||
` .
|
|
||||||
`... d
|
|
||||||
.
|
|
||||||
f
|
f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -45,10 +41,8 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
a . . b . . . c g
|
a b c g
|
||||||
` .
|
d
|
||||||
` .
|
|
||||||
` d
|
|
||||||
f
|
f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -73,22 +67,21 @@ Feature: Turn Lane Guidance
|
|||||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
@sliproads
|
||||||
Scenario: Separate Turn Lanes Next to other turns
|
Scenario: Separate Turn Lanes Next to other turns
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
. e
|
e
|
||||||
a . . b . . . c g
|
a b c g
|
||||||
. ` .
|
d
|
||||||
. ` .
|
f
|
||||||
. d
|
|
||||||
. f
|
|
||||||
.
|
|
||||||
.
|
|
||||||
.
|
|
||||||
.
|
|
||||||
i . . h . . . j
|
i h j
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -116,7 +109,6 @@ Feature: Turn Lane Guidance
|
|||||||
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
|
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
|
||||||
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
|
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
|
||||||
|
|
||||||
|
|
||||||
@todo @2654 @none
|
@todo @2654 @none
|
||||||
#https://github.com/Project-OSRM/osrm-backend/issues/2645
|
#https://github.com/Project-OSRM/osrm-backend/issues/2645
|
||||||
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
|
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
|
||||||
@@ -124,10 +116,10 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g f
|
g f
|
||||||
| |
|
|
||||||
j --- h - e
|
j h e
|
||||||
| |
|
|
||||||
a --- b - c
|
a b c
|
||||||
i d
|
i d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -154,21 +146,21 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g j
|
g j
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |,f
|
f
|
||||||
|,e
|
e
|
||||||
,d |
|
d
|
||||||
a --------- b c |
|
a b c
|
||||||
/ | |
|
|
||||||
/ | |
|
|
||||||
/ | |
|
|
||||||
| | |
|
|
||||||
| | |
|
|
||||||
| | |
|
|
||||||
l h i
|
l h i
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -202,21 +194,21 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g j
|
g j
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |,f
|
f
|
||||||
|,e
|
e
|
||||||
,d |
|
d
|
||||||
a --------- b c |
|
a b c
|
||||||
/ | |
|
|
||||||
/ | |
|
|
||||||
/ | |
|
|
||||||
| | |
|
|
||||||
| | |
|
|
||||||
| | |
|
|
||||||
l h i
|
l h i
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -239,7 +231,6 @@ Feature: Turn Lane Guidance
|
|||||||
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
|
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
|
||||||
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
|
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Check sliproad handler loop's exit condition, Issue #2896
|
Scenario: Check sliproad handler loop's exit condition, Issue #2896
|
||||||
# http://www.openstreetmap.org/way/198481519
|
# http://www.openstreetmap.org/way/198481519
|
||||||
Given the node locations
|
Given the node locations
|
||||||
|
|||||||
@@ -783,72 +783,3 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn right,arrive | ,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:false right:true, |
|
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn right,arrive | ,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:false right:true, |
|
||||||
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
|
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
|
||||||
|
|
||||||
@anticipate
|
|
||||||
Scenario: Complex lane scenarios scale threshold for triggering Lane Anticipation
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a – b – x
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
c
|
|
||||||
|
|
|
||||||
e – d – y
|
|
||||||
"""
|
|
||||||
# With a grid size of 20m the duration is ~20s but our default threshold for Lane Anticipation is 15s.
|
|
||||||
# The additional lanes left and right of the turn scale the threshold up so that Lane Anticipation still triggers.
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | turn:lanes:forward | name |
|
|
||||||
| ab | through\|through\|right\|right | MySt |
|
|
||||||
| bx | | XSt |
|
|
||||||
| bc | | MySt |
|
|
||||||
| cd | left\|right | MySt |
|
|
||||||
| de | | MySt |
|
|
||||||
| dy | | YSt |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | lanes |
|
|
||||||
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
|
|
||||||
|
|
||||||
@anticipate
|
|
||||||
Scenario: Don't Overdo It
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
q r s t u v
|
|
||||||
| | | | | |
|
|
||||||
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
|
|
||||||
| | | | | | |
|
|
||||||
p o n m l k j
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | turn:lanes:forward | oneway |
|
|
||||||
| ab | road | left\|\|\| | yes |
|
|
||||||
| bc | road | left\|\|\| | yes |
|
|
||||||
| cd | road | left\|\|\| | yes |
|
|
||||||
| de | road | left\|\|\| | yes |
|
|
||||||
| ef | road | left\|\|\| | yes |
|
|
||||||
| fg | road | left\|\|\| | yes |
|
|
||||||
| gh | road | \|\|right | yes |
|
|
||||||
| hi | road | | yes |
|
|
||||||
| qbp | 1st | | no |
|
|
||||||
| rco | 2nd | | no |
|
|
||||||
| sdn | 3rd | | no |
|
|
||||||
| tem | 4th | | no |
|
|
||||||
| ufl | 5th | | no |
|
|
||||||
| vgk | 6th | | no |
|
|
||||||
| hj | 7th | | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations | lanes |
|
|
||||||
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
|
|
||||||
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
|
|
||||||
|
|||||||
@@ -1,139 +0,0 @@
|
|||||||
@routing @guidance @staggered-intersections
|
|
||||||
Feature: Staggered Intersections
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "bicycle"
|
|
||||||
Given a grid size of 1 meters
|
|
||||||
# Note the one meter grid size: staggered intersections make zig-zags of a couple of meters only
|
|
||||||
|
|
||||||
Scenario: Staggered Intersection - pushing in the middle
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
h
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| abc | residential | Oak St | |
|
|
||||||
| efg | residential | Oak St | |
|
|
||||||
| ihedcj | residential | Cedar Dr | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | cycling,pushing bike,cycling,cycling |
|
|
||||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
|
||||||
|
|
||||||
Scenario: Staggered Intersection - pushing at start
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
h
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| cba | residential | Oak St | yes |
|
|
||||||
| efg | residential | Oak St | |
|
|
||||||
| ihedcj | residential | Cedar Dr | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,cycling,cycling |
|
|
||||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
|
||||||
|
|
||||||
Scenario: Staggered Intersection - pushing at end
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
h
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| abc | residential | Oak St | |
|
|
||||||
| gfe | residential | Oak St | yes |
|
|
||||||
| ihedcj | residential | Cedar Dr | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | cycling,cycling,pushing bike,pushing bike |
|
|
||||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
|
||||||
|
|
||||||
Scenario: Staggered Intersection - pushing at start and end
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
h
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| cba | residential | Oak St | yes |
|
|
||||||
| gfe | residential | Oak St | yes |
|
|
||||||
| ihedcj | residential | Cedar Dr | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
|
|
||||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
|
||||||
|
|
||||||
Scenario: Staggered Intersection - pushing at start and end
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
h
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| cba | pedestrian | Oak St |
|
|
||||||
| gfe | pedestrian | Oak St |
|
|
||||||
| ihedcj | residential | Cedar Dr |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
|
|
||||||
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
|
|
||||||
|
|
||||||
Scenario: Staggered Intersection - control, all cycling on staggered intersection
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
h
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| cba | residential | Oak St |
|
|
||||||
| gfe | residential | Oak St |
|
|
||||||
| ihedcj | residential | Cedar Dr |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| a,g | Oak St,Oak St | depart,arrive | cycling,cycling |
|
|
||||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
|
||||||
@@ -50,20 +50,3 @@ Feature: Features related to bugs
|
|||||||
And the data has been saved to disk
|
And the data has been saved to disk
|
||||||
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
|
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
|
||||||
Then it should exit successfully
|
Then it should exit successfully
|
||||||
|
|
||||||
@3418
|
|
||||||
Scenario: Bearings should be between 0-359
|
|
||||||
Given the node locations
|
|
||||||
| node | lon | lat |
|
|
||||||
| a | -122.0232176 | 37.3282203 |
|
|
||||||
| b | -122.0232199 | 37.3302422 |
|
|
||||||
| c | -122.0232252 | 37.3312787 |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway |
|
|
||||||
| ab | Pear to Merrit | residential |
|
|
||||||
| bc | Merritt to Apricot | residential |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,c | Pear to Merrit,Merritt to Apricot,Merritt to Apricot | true:0;true:0 false:180;true:180 |
|
|
||||||
|
|||||||
@@ -1,282 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Rotary
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 30 meters
|
|
||||||
|
|
||||||
Scenario: Enter and Exit
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b
|
|
||||||
h g c d
|
|
||||||
e
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bgecb | circular |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
|
|
||||||
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
|
|
||||||
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
|
|
||||||
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
|
|
||||||
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
|
|
||||||
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
|
|
||||||
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
|
|
||||||
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
|
|
||||||
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
|
|
||||||
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
|
|
||||||
|
|
||||||
Scenario: Only Enter
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b
|
|
||||||
d c g h
|
|
||||||
e
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bcegb | circular |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
|
||||||
|
|
||||||
Scenario: Only Exit
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b
|
|
||||||
d c g h
|
|
||||||
e
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bcegb | circular |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
|
|
||||||
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
|
|
||||||
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
|
|
||||||
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
|
|
||||||
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
|
|
||||||
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
|
|
||||||
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
|
|
||||||
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
|
|
||||||
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
|
|
||||||
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
|
|
||||||
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
|
|
||||||
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
|
|
||||||
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
|
|
||||||
|
|
||||||
Scenario: Drive Around
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b
|
|
||||||
d c g h
|
|
||||||
e
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bcegb | circular |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| b,c | bcegb,bcegb | depart,arrive |
|
|
||||||
| b,e | bcegb,bcegb | depart,arrive |
|
|
||||||
| b,g | bcegb,bcegb | depart,arrive |
|
|
||||||
| c,e | bcegb,bcegb | depart,arrive |
|
|
||||||
| c,g | bcegb,bcegb | depart,arrive |
|
|
||||||
| c,b | bcegb,bcegb | depart,arrive |
|
|
||||||
| e,g | bcegb,bcegb | depart,arrive |
|
|
||||||
| e,b | bcegb,bcegb | depart,arrive |
|
|
||||||
| e,c | bcegb,bcegb | depart,arrive |
|
|
||||||
| g,b | bcegb,bcegb | depart,arrive |
|
|
||||||
| g,c | bcegb,bcegb | depart,arrive |
|
|
||||||
| g,e | bcegb,bcegb | depart,arrive |
|
|
||||||
|
|
||||||
#needs to be adjusted when name-discovery works for entrys
|
|
||||||
Scenario: Mixed Entry and Exit
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c a
|
|
||||||
j b f
|
|
||||||
k e
|
|
||||||
l h d
|
|
||||||
g i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction | oneway |
|
|
||||||
| abc | | yes |
|
|
||||||
| def | | yes |
|
|
||||||
| ghi | | yes |
|
|
||||||
| jkl | | yes |
|
|
||||||
| bkheb | circular | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
|
|
||||||
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
|
|
||||||
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
|
|
||||||
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
|
|
||||||
| d,f | def,def,def | depart,rotary-exit-1,arrive |
|
|
||||||
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
|
|
||||||
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
|
|
||||||
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
|
|
||||||
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
|
|
||||||
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
|
|
||||||
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
|
|
||||||
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
|
|
||||||
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
|
|
||||||
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
|
|
||||||
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
|
|
||||||
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b
|
|
||||||
c d f
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | circular |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
d
|
|
||||||
b c f
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ad | |
|
|
||||||
| bcdb | circular |
|
|
||||||
| be | |
|
|
||||||
| cf | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ad,be,be | depart,bcdb-exit-1,arrive |
|
|
||||||
| a,f | ad,cf,cf | depart,bcdb-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
c
|
|
||||||
d b f
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ac | |
|
|
||||||
| bcdb | circular |
|
|
||||||
| de | |
|
|
||||||
| bf | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ac,de,de | depart,bcdb-exit-1,arrive |
|
|
||||||
| a,f | ac,bf,bf | depart,bcdb-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
d c e
|
|
||||||
b
|
|
||||||
a
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | circular |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
d c e
|
|
||||||
b
|
|
||||||
a
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | circular |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
|
||||||
@@ -55,38 +55,3 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | road,road,road | depart,continue uturn,arrive |
|
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||||
| d,c | road,road,road | depart,continue uturn,arrive |
|
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||||
|
|
||||||
Scenario: Forking before a turn (forky)
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
g
|
|
||||||
.
|
|
||||||
c
|
|
||||||
a . . b .'
|
|
||||||
`d.
|
|
||||||
f e
|
|
||||||
"""
|
|
||||||
# note: check clooapse.feature for a similar test case where we do not
|
|
||||||
# classify the situation as Sliproad and therefore keep the fork inst.
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway | highway |
|
|
||||||
| ab | road | yes | primary |
|
|
||||||
| bd | road | yes | primary |
|
|
||||||
| bc | road | yes | primary |
|
|
||||||
| de | road | yes | primary |
|
|
||||||
| fd | cross | no | secondary |
|
|
||||||
| dc | cross | no | secondary |
|
|
||||||
| cg | cross | no | secondary |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | bd | dc | d | no_left_turn |
|
|
||||||
| restriction | bc | dc | c | no_right_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
|
||||||
| a,e | road,road,road | depart,continue right,arrive |
|
|
||||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
|
||||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
|
||||||
|
|||||||
@@ -1,162 +0,0 @@
|
|||||||
@routing @guidance @collapsing
|
|
||||||
Feature: Collapse
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 20 meters
|
|
||||||
|
|
||||||
Scenario: Collapse Steps While On Ferry
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j----a---c---b----k
|
|
||||||
~ ~ ~
|
|
||||||
~ ~ ~
|
|
||||||
~~~
|
|
||||||
d
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
e --- f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | route | name |
|
|
||||||
| jacbk | primary | | land |
|
|
||||||
| ad | | ferry | sea |
|
|
||||||
| bd | | ferry | sea |
|
|
||||||
| cd | | ferry | sea |
|
|
||||||
| de | | ferry | sea |
|
|
||||||
| ef | primary | | pennydog-island |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes | locations |
|
|
||||||
| f,j | pennydog-island,sea,land,land | depart,notification right,turn left,arrive | driving,ferry,driving,driving | f,e,b,j |
|
|
||||||
|
|
||||||
Scenario: Switching Ferry in a Harbour
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
e - a ~ ~ ~ ~ b
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
c
|
|
||||||
|
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | route | name |
|
|
||||||
| ea | primary | | melee-island |
|
|
||||||
| ab | | ferry | melee-island-ferry |
|
|
||||||
| cf | primary | | monkey-island |
|
|
||||||
| bd | primary | | scabb-island |
|
|
||||||
| bc | primary | ferry | monkey-island-ferry |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| e,f | melee-island,melee-island-ferry,monkey-island-ferry,monkey-island,monkey-island | depart,notification straight,turn right,notification straight,arrive | driving,ferry,ferry,driving,driving |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: End of Road Ferries
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - b ~ ~ ~ ~ c ~ ~ ~ ~ ~ d - e
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
f
|
|
||||||
|
|
|
||||||
g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | route | name |
|
|
||||||
| ab | primary | | land-left |
|
|
||||||
| de | primary | | land-right |
|
|
||||||
| gf | primary | | land-bottom |
|
|
||||||
| bcd | | ferry | ferry |
|
|
||||||
| fc | | ferry | ferry |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Ferries
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - b d - e
|
|
||||||
~ ~
|
|
||||||
~ ~
|
|
||||||
~ ~
|
|
||||||
~ ~
|
|
||||||
c
|
|
||||||
~
|
|
||||||
~
|
|
||||||
~
|
|
||||||
f
|
|
||||||
|
|
|
||||||
g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | route | name |
|
|
||||||
| ab | primary | | land-left |
|
|
||||||
| de | primary | | land-right |
|
|
||||||
| gf | primary | | land-bottom |
|
|
||||||
| cb | | ferry | ferry |
|
|
||||||
| cd | | ferry | ferry |
|
|
||||||
| fc | | ferry | ferry |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification right,arrive |
|
|
||||||
|
|
||||||
@negative
|
|
||||||
Scenario: Don't Detect Suppressed/Obvious Forks on Ferries
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
. . . . . . . . .d
|
|
||||||
a - b ~ ~ ~ ~ ~ c <
|
|
||||||
' ' ' ' ' ' ' ' 'e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | route | name |
|
|
||||||
| ab | primary | | cursed-island |
|
|
||||||
| bc | | ferry | beagle |
|
|
||||||
| cd | service | | forker |
|
|
||||||
| ce | primary | | screw-me-not |
|
|
||||||
|
|
||||||
#the turns here could be better, but intersection classification shows you if you go left or right. But we cannot fork here
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | cursed-island,beagle,forker,forker | depart,notification straight,turn straight,arrive |
|
|
||||||
| a,e | cursed-island,beagle,screw-me-not,screw-me-not | depart,notification straight,turn straight,arrive |
|
|
||||||
|
|
||||||
@uturn @dead-end @ferry @via
|
|
||||||
Scenario: U-Turn on a dead-end ferry
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - 1 - b ~ ~ ~ ~ ~ ~ ~ c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | route | name |
|
|
||||||
| ab | primary | | land |
|
|
||||||
| bc | | ferry | sea |
|
|
||||||
|
|
||||||
# we actually cannot check the route here, since two possible routes are equally valid:
|
|
||||||
# (ab)(bcb1) and (abcb)(b1) are exactly the same. Luckily, we only want to check for
|
|
||||||
# not asserting here.
|
|
||||||
When I route I should get
|
|
||||||
| waypoints |
|
|
||||||
| a,b,1 |
|
|
||||||
@@ -143,33 +143,37 @@ Feature: Collapse
|
|||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n m
|
n m
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
g h
|
g h
|
||||||
c - b - a
|
|
||||||
d - e - f
|
|
||||||
j i
|
c b a
|
||||||
| |
|
d e f
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
j i
|
||||||
| |
|
|
||||||
k l
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
k l
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway | lanes |
|
| nodes | highway | name | oneway |
|
||||||
| ab | primary | first | yes | |
|
| ab | primary | first | yes |
|
||||||
| bc | primary | first | yes | |
|
| bc | primary | first | yes |
|
||||||
| de | primary | first | yes | |
|
| de | primary | first | yes |
|
||||||
| ef | primary | first | yes | |
|
| ef | primary | first | yes |
|
||||||
| be | primary | first | no | |
|
| be | primary | first | no |
|
||||||
| ngbhm | primary | second | yes | 5 |
|
| ngbhm | primary | second | yes |
|
||||||
| liejk | primary | second | yes | 5 |
|
| liejk | primary | second | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -193,37 +197,33 @@ Feature: Collapse
|
|||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n m
|
n m
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
g h
|
||||||
| |
|
|
||||||
| |
|
|
||||||
g h
|
c b a
|
||||||
\ /
|
d e f
|
||||||
c - b - a
|
|
||||||
d - e - f
|
|
||||||
/ \
|
j i
|
||||||
j i
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
k l
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
k l
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway | lanes |
|
| nodes | highway | name | oneway |
|
||||||
| ab | primary | first | yes | |
|
| ab | primary | first | yes |
|
||||||
| bc | primary | first | yes | |
|
| bc | primary | first | yes |
|
||||||
| de | primary | first | yes | |
|
| de | primary | first | yes |
|
||||||
| ef | primary | first | yes | |
|
| ef | primary | first | yes |
|
||||||
| be | primary | second | no | |
|
| be | primary | second | no |
|
||||||
| ngbhm | primary | second | yes | 5 |
|
| ngbhm | primary | second | yes |
|
||||||
| liejk | primary | second | yes | 5 |
|
| liejk | primary | second | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -338,10 +338,10 @@ Feature: Collapse
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a f g
|
a f g
|
||||||
| | . '
|
|
||||||
b-e '
|
b e
|
||||||
/ /
|
|
||||||
/ /
|
|
||||||
c d
|
c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -425,28 +425,18 @@ Feature: Collapse
|
|||||||
Scenario: Pankenbruecke
|
Scenario: Pankenbruecke
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
k j
|
j h i
|
||||||
| |
|
b c d e f g
|
||||||
| |
|
k a
|
||||||
| |
|
|
||||||
a h
|
|
||||||
b
|
|
||||||
c
|
|
||||||
d
|
|
||||||
e
|
|
||||||
f-i
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway | lanes |
|
| nodes | highway | name | oneway |
|
||||||
| kabhj | primary | inroad | yes | 4 |
|
| kabhj | primary | inroad | yes |
|
||||||
| bc | primary | inroad | no | |
|
| bc | primary | inroad | no |
|
||||||
| cd | primary | bridge | no | |
|
| cd | primary | bridge | no |
|
||||||
| defg | primary | outroad | no | |
|
| defg | primary | outroad | no |
|
||||||
| fi | primary | cross | no | |
|
| fi | primary | cross | no |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -494,23 +484,6 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | road,road | depart,arrive |
|
| a,d | road,road | depart,arrive |
|
||||||
|
|
||||||
Scenario: No Name During Turns - Ferry
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
c d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | route |
|
|
||||||
| ab | tertiary | road | |
|
|
||||||
| bc | tertiary | | ferry |
|
|
||||||
| cd | tertiary | road | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | road,,road,road | depart,notification right,notification left,arrive |
|
|
||||||
|
|
||||||
Scenario: No Name During Turns, Random Oneway
|
Scenario: No Name During Turns, Random Oneway
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -711,15 +684,12 @@ Feature: Collapse
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g
|
g
|
||||||
.
|
|
||||||
c
|
c
|
||||||
a . . b .'
|
a b
|
||||||
` d.
|
d
|
||||||
f e
|
f e
|
||||||
"""
|
"""
|
||||||
# as it is right now we don't classify this as a sliproad,
|
|
||||||
# check collapse-detail.feature for a similar test case
|
|
||||||
# which removes the fork here due to it being a Sliproad.
|
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | oneway | highway |
|
| nodes | name | oneway | highway |
|
||||||
@@ -737,10 +707,11 @@ Feature: Collapse
|
|||||||
| restriction | bc | dc | c | no_right_turn |
|
| restriction | bc | dc | c | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | road,cross,cross | depart,fork left,arrive |
|
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||||
| a,e | road,road,road | depart,fork slight right,arrive |
|
| a,e | road,road,road | depart,continue slight right,arrive |
|
||||||
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive |
|
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||||
|
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
||||||
|
|
||||||
Scenario: On-Off on Highway
|
Scenario: On-Off on Highway
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -767,13 +738,12 @@ Feature: Collapse
|
|||||||
Scenario: Don't collapse going straight if actual turn
|
Scenario: Don't collapse going straight if actual turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
c e
|
||||||
c |
|
d f
|
||||||
\ d - - - f
|
|
||||||
\|
|
|
||||||
b
|
b
|
||||||
|
|
|
||||||
|
|
|
||||||
a
|
a
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -784,10 +754,10 @@ Feature: Collapse
|
|||||||
| df | right | residential |
|
| df | right | residential |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns |
|
||||||
| a,c | main,main | depart,arrive | a,c |
|
| a,c | main,main | depart,arrive |
|
||||||
| a,e | main,straight,straight | depart,turn straight,arrive | a,b,e |
|
| a,e | main,straight,straight | depart,turn straight,arrive |
|
||||||
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive | a,b,d,f |
|
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive |
|
||||||
|
|
||||||
Scenario: Entering a segregated road
|
Scenario: Entering a segregated road
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -959,17 +929,16 @@ Feature: Collapse
|
|||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/52.48778/13.30024
|
#http://www.openstreetmap.org/#map=19/52.48778/13.30024
|
||||||
Scenario: Hohenzollerdammbrücke
|
Scenario: Hohenzollerdammbrücke
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
q s
|
q s
|
||||||
p o
|
p o
|
||||||
.. ..
|
.. . .
|
||||||
. . . .
|
. . . .
|
||||||
j - i - - - h - - - g - f
|
j - i - - - h - - - g - f
|
||||||
> k < > l <
|
> k < > l <
|
||||||
a - b - - - c - - - d - e
|
a - b - - - c - - - d - e
|
||||||
. . . .
|
. . . .
|
||||||
.. ..
|
.. ..
|
||||||
m n
|
m n
|
||||||
t r
|
t r
|
||||||
@@ -1026,13 +995,13 @@ Feature: Collapse
|
|||||||
| restriction | ph | hi | h | no_right_turn |
|
| restriction | ph | hi | h | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns |
|
||||||
| a,e | hohe,hohe | depart,arrive | a,e |
|
| a,e | hohe,hohe | depart,arrive |
|
||||||
| a,s | hohe,a100,a100 | depart,on ramp left,arrive | a,b,s |
|
| a,s | hohe,a100,a100 | depart,on ramp left,arrive |
|
||||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
|
| a,t | hohe,a100,a100 | depart,on ramp right,arrive |
|
||||||
| a,j | | | |
|
| a,j | | |
|
||||||
| f,j | hohe,hohe | depart,arrive | f,j |
|
| f,j | hohe,hohe | depart,arrive |
|
||||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
|
| a,t | hohe,a100,a100 | depart,on ramp right,arrive |
|
||||||
| f,e | | | |
|
| f,e | | |
|
||||||
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j |
|
| q,j | a100,hohe,hohe | depart,turn right,arrive |
|
||||||
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
|
| q,e | a100,a100,hohe | depart,continue left,arrive |
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
a - b-d
|
a b d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -26,7 +26,7 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
a - b-d
|
a b d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -43,7 +43,7 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
a - b-d
|
a b d
|
||||||
e
|
e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ Feature: Continue Instructions
|
|||||||
Scenario: Road turning right
|
Scenario: Road turning right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a - b-d
|
a b d
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -80,9 +80,9 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
/
|
|
||||||
a - b
|
a b
|
||||||
`d
|
d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -98,9 +98,9 @@ Feature: Continue Instructions
|
|||||||
Scenario: Road turning slight right
|
Scenario: Road turning slight right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
,d
|
d
|
||||||
a - b
|
a b
|
||||||
\
|
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -117,11 +117,11 @@ Feature: Continue Instructions
|
|||||||
Scenario: Road Loop
|
Scenario: Road Loop
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f - e
|
f e
|
||||||
| |
|
|
||||||
a - b-g |
|
a b g
|
||||||
| |
|
|
||||||
c - d
|
c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
|
|||||||
@@ -9,148 +9,81 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
a b-----c-d
|
a b c d
|
||||||
`--h |
|
h
|
||||||
||
|
|
||||||
1||
|
1
|
||||||
||
|
|
||||||
`f
|
f
|
||||||
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name |
|
||||||
| abc | trunk | first | |
|
| abc | trunk | first |
|
||||||
| cd | trunk | first | |
|
| cd | trunk | first |
|
||||||
| bhf | trunk_link | | yes |
|
| bhf | trunk_link | |
|
||||||
| cfg | primary | second | yes |
|
| cfg | primary | second |
|
||||||
| ec | primary | second | |
|
| ec | primary | second |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | abc | cfg | c | no_right_turn |
|
| restriction | abc | cfg | c | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | first,second,second | depart,turn right,arrive |
|
| a,g | first,second,second | depart,turn right,arrive |
|
||||||
| a,1 | first,, | depart,turn right,arrive |
|
| a,1 | first,, | depart,turn slight right,arrive |
|
||||||
|
|
||||||
Scenario: Turn Instead of Ramp
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
e
|
|
||||||
a b-----c-d
|
|
||||||
`--h |
|
|
||||||
||
|
|
||||||
1||
|
|
||||||
||
|
|
||||||
`f
|
|
||||||
|
|
|
||||||
g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway | route |
|
|
||||||
| abc | trunk | first | yes | |
|
|
||||||
| cd | trunk | first | yes | |
|
|
||||||
| bhf | trunk_link | | yes | ferry |
|
|
||||||
| cfg | primary | second | yes | |
|
|
||||||
| ec | primary | second | yes | |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | abc | cfg | c | no_right_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,g | first,,second,second | depart,turn right,turn straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Turning Sliproad onto a ferry
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
e
|
|
||||||
a b-----c-d
|
|
||||||
`--h |
|
|
||||||
||
|
|
||||||
1||
|
|
||||||
||
|
|
||||||
`f
|
|
||||||
|
|
|
||||||
g
|
|
||||||
|
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway | route |
|
|
||||||
| abc | trunk | first | | |
|
|
||||||
| cd | trunk | first | | |
|
|
||||||
| bhf | trunk_link | | yes | |
|
|
||||||
| cf | primary | second | yes | |
|
|
||||||
| fg | primary | second | yes | ferry |
|
|
||||||
| ec | primary | second | yes | |
|
|
||||||
| gi | primary | second | yes | |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | abc | cf | c | no_right_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,i | first,,second,second,second | depart,turn right,turn straight,notification straight,arrive |
|
|
||||||
| a,1 | first,, | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Turn Instead of Ramp - Max-Speed
|
Scenario: Turn Instead of Ramp - Max-Speed
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
a-b-----c-------------------------d
|
a-b-----c-------------------------d
|
||||||
`--h |
|
`h |
|
||||||
||
|
||
|
||||||
1||
|
1||
|
||||||
||
|
`|
|
||||||
`f
|
f
|
||||||
|
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | maxspeed | oneway |
|
| nodes | highway | name | maxspeed |
|
||||||
| abc | trunk | first | 70 | |
|
| abc | trunk | first | 70 |
|
||||||
| cd | trunk | first | 2 | |
|
| cd | trunk | first | 2 |
|
||||||
| bhf | trunk_link | | 2 | yes |
|
| bhf | trunk_link | | 2 |
|
||||||
| cfg | primary | second | 50 | yes |
|
| cfg | primary | second | 50 |
|
||||||
| ec | primary | second | 50 | |
|
| ec | primary | second | 50 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | abc | cfg | c | no_right_turn |
|
| restriction | abc | cfg | c | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | first,second,second | depart,turn right,arrive |
|
| a,g | first,second,second | depart,turn right,arrive |
|
||||||
| a,1 | first,, | depart,turn right,arrive |
|
| a,1 | first,, | depart,turn slight right,arrive |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Turn Instead of Ramp
|
Scenario: Turn Instead of Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
|
|
a b c d
|
||||||
…
|
h
|
||||||
a-b-----c--d
|
|
||||||
`--h …
|
|
||||||
\|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
f
|
f
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -161,23 +94,21 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| efg | primary | second |
|
| efg | primary | second |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
|
| a,g | first,,second,second | depart,off ramp slight right,turn straight,arrive |
|
||||||
|
|
||||||
Scenario: Turn Instead of Ramp
|
Scenario: Turn Instead of Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
|
|
a b c d
|
||||||
…
|
h
|
||||||
a-b-----c-d
|
|
||||||
`--h …
|
|
||||||
\|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
f
|
f
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -188,30 +119,30 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| efg | primary | second |
|
| efg | primary | second |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
|
| a,g | first,,second,second | depart,off ramp slight right,turn straight,arrive |
|
||||||
|
|
||||||
Scenario: Inner city expressway with on road
|
Scenario: Inner city expressway with on road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b-------c-g
|
a b c g
|
||||||
`--f |
|
f
|
||||||
\|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
d
|
d
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
e
|
e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name |
|
||||||
| abc | primary | road | |
|
| abc | primary | road |
|
||||||
| cg | primary | road | |
|
| cg | primary | road |
|
||||||
| bfd | trunk_link | | yes |
|
| bfd | trunk_link | |
|
||||||
| cde | trunk | trunk | yes |
|
| cde | trunk | trunk |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
@@ -226,12 +157,12 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a f
|
a f
|
||||||
| |
|
|
||||||
b e
|
b e
|
||||||
|\ /|
|
|
||||||
| | |
|
|
||||||
| g |
|
g
|
||||||
| |
|
|
||||||
c d
|
c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -249,11 +180,11 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a f
|
a f
|
||||||
| |
|
|
||||||
b e
|
b e
|
||||||
|\g/|
|
g
|
||||||
| |
|
|
||||||
| |
|
|
||||||
c d
|
c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -309,8 +240,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| qe | secondary_link | Ettlinger Allee | | yes |
|
| qe | secondary_link | Ettlinger Allee | | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | ref |
|
| waypoints | route | turns | ref |
|
||||||
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,L561, |
|
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,L561, |
|
||||||
|
|
||||||
Scenario: Traffic Lights everywhere
|
Scenario: Traffic Lights everywhere
|
||||||
#http://map.project-osrm.org/?z=18¢er=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
|
#http://map.project-osrm.org/?z=18¢er=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
|
||||||
@@ -340,33 +271,33 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| jcghf | primary | Brauerstrasse | yes |
|
| jcghf | primary | Brauerstrasse | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
|
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||||
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
|
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||||
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
|
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
|
||||||
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive |
|
| a,1 | Ebertstrasse,, | depart,turn right,arrive |
|
||||||
|
|
||||||
#2839
|
#2839
|
||||||
Scenario: Self-Loop
|
Scenario: Self-Loop
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
/-l-----k---\
|
l k
|
||||||
/ `j--
|
j
|
||||||
m \
|
m
|
||||||
/ i
|
i
|
||||||
/ \
|
|
||||||
| \
|
|
||||||
| h
|
h
|
||||||
| |
|
|
||||||
n |
|
n
|
||||||
| |
|
|
||||||
| g
|
g
|
||||||
o |
|
o
|
||||||
/ /
|
|
||||||
| f
|
f
|
||||||
/- p /
|
p
|
||||||
/ e
|
e
|
||||||
a ------- b --------------- c ----------------- d ---/
|
a b c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -385,23 +316,23 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Scenario: Self-Loop - Bidirectional
|
Scenario: Self-Loop - Bidirectional
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
/-l-----k---\
|
l k
|
||||||
/ `j--
|
j
|
||||||
m \
|
m
|
||||||
/ i
|
i
|
||||||
/ \
|
|
||||||
| \
|
|
||||||
| h
|
h
|
||||||
| |
|
|
||||||
n |
|
n
|
||||||
| |
|
|
||||||
| g
|
g
|
||||||
o |
|
o
|
||||||
/ /
|
|
||||||
| f
|
f
|
||||||
/- p /
|
p
|
||||||
/ e
|
e
|
||||||
a ------- b --------------- c ----------------- d ---/
|
a b c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -418,30 +349,31 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
j
|
j
|
||||||
a-b ----------------------------------------- c ------------d
|
a b c d
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
e |
|
e
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
\ 1
|
1
|
||||||
`---------- f ------- g ----------\
|
|
||||||
| \
|
f g
|
||||||
|
|
||||||
i h
|
i h
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -466,20 +398,20 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Scenario: Turn Instead of Ramp
|
Scenario: Turn Instead of Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
/--------------------f
|
f
|
||||||
g-----------h--\ |
|
g h
|
||||||
d-----e
|
d e
|
||||||
i c-----------j--/
|
i c j
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
b
|
b
|
||||||
|
|
|
||||||
a
|
a
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -499,433 +431,3 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,i | road,road,road | depart,fork slight left,arrive |
|
| a,i | road,road,road | depart,fork slight left,arrive |
|
||||||
|
|
||||||
|
|
||||||
# The following tests are current false positives / false negatives #3199
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
# http://www.openstreetmap.org/#map=19/52.59847/13.14815
|
|
||||||
Scenario: Sliproad Detection
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a . . .
|
|
||||||
. .
|
|
||||||
b . . . . . . c . . . d
|
|
||||||
` . .
|
|
||||||
e . .
|
|
||||||
` . .
|
|
||||||
f . .
|
|
||||||
` . .
|
|
||||||
g i
|
|
||||||
` h .
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| abefgh | residential | Nachtigallensteig |
|
|
||||||
| bcd | residential | Kiebitzsteig |
|
|
||||||
| cg | residential | Haenflingsteig |
|
|
||||||
| hid | residential | Waldkauzsteig |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | Nachtigallensteig,Kiebitzsteig,Kiebitzsteig | depart,turn left,arrive |
|
|
||||||
| a,h | Nachtigallensteig,Nachtigallensteig | depart,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Not a obvious Sliproad
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . b . . c
|
|
||||||
` .
|
|
||||||
` e
|
|
||||||
.`
|
|
||||||
. `
|
|
||||||
f g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sabc | primary | sabc | |
|
|
||||||
| dbef | primary | dbef | yes |
|
|
||||||
| aeg | primary | aeg | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Through Street, not a Sliproad although obvious
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . b . . c
|
|
||||||
` .
|
|
||||||
` e
|
|
||||||
. `
|
|
||||||
. `
|
|
||||||
f g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sabc | primary | sabc | |
|
|
||||||
| dbef | primary | dbef | yes |
|
|
||||||
| aeg | primary | aeg | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Sliproad target turn is restricted
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . . . b . . c
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
`.
|
|
||||||
e
|
|
||||||
.`
|
|
||||||
f `
|
|
||||||
. ` g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sa | primary | sabc | |
|
|
||||||
| abc | primary | sabc | |
|
|
||||||
| dbe | primary | dbef | yes |
|
|
||||||
| ef | primary | dbef | |
|
|
||||||
| ae | primary | aeg | yes |
|
|
||||||
| eg | primary | aeg | |
|
|
||||||
# the reason we have to split ways at e is that otherwise we can't handle restrictions via e
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | ae | ef | e | no_right_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
|
|
||||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Not a Sliproad, road not continuing straight
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . b . . c
|
|
||||||
` .
|
|
||||||
` e . . g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sabc | primary | sabc | |
|
|
||||||
| dbe | primary | dbe | yes |
|
|
||||||
| aeg | primary | aeg | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,c | sabc,sabc | depart,arrive |
|
|
||||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Intersection too far away with Traffic Light shortly after initial split
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . . . . . . . . . . . . t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b . . c
|
|
||||||
` . . . . . . . . . . . .
|
|
||||||
` . . . . . . . . . . . .
|
|
||||||
` . . . . . . . . . . . .
|
|
||||||
` . . . . . . . . . . . .
|
|
||||||
` . . . . . . . . . . . .
|
|
||||||
` . . . . . . . . . . . .
|
|
||||||
` . . .
|
|
||||||
` e
|
|
||||||
.
|
|
||||||
f
|
|
||||||
.
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the nodes
|
|
||||||
| node | highway |
|
|
||||||
| t | traffic_signals |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| satbc | primary | sabc | |
|
|
||||||
| dbef | primary | dbef | yes |
|
|
||||||
| ae | primary | ae | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Traffic Signal on Sliproad
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . . . . b . . c
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
t .
|
|
||||||
` .
|
|
||||||
e
|
|
||||||
.
|
|
||||||
.
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the nodes
|
|
||||||
| node | highway |
|
|
||||||
| t | traffic_signals |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sabc | primary | sabc | |
|
|
||||||
| dbe | primary | dbe | yes |
|
|
||||||
| ef | primary | ef | |
|
|
||||||
| ate | primary | ate | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,f | sabc,ef,ef | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Sliproad tagged as link
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . . . . b . . c
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
e
|
|
||||||
.
|
|
||||||
.
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sabc | motorway | sabc | |
|
|
||||||
| dbef | motorway | dbef | yes |
|
|
||||||
| ae | motorway_link | ae | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Sliproad with same-ish names
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . b . . c
|
|
||||||
` .
|
|
||||||
. e
|
|
||||||
..
|
|
||||||
.
|
|
||||||
f
|
|
||||||
.
|
|
||||||
t
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | ref | oneway |
|
|
||||||
| sabc | primary | main | | |
|
|
||||||
| dbe | primary | crossing | r0 | yes |
|
|
||||||
| eft | primary | crossing | r0;r1 | yes |
|
|
||||||
| af | primary | sliproad | | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,t | main,crossing,crossing | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Not a Sliproad, name mismatch
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . b . . c
|
|
||||||
` .
|
|
||||||
. e
|
|
||||||
. .
|
|
||||||
..
|
|
||||||
.
|
|
||||||
f
|
|
||||||
.
|
|
||||||
t
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sabc | primary | main | |
|
|
||||||
| dbe | primary | top | yes |
|
|
||||||
| ef | primary | bottom | yes |
|
|
||||||
| ft | primary | away | yes |
|
|
||||||
| af | primary | sliproad | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,t | main,away,away | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Not a Sliproad, low road priority
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . b . . c
|
|
||||||
` .
|
|
||||||
. e
|
|
||||||
. .
|
|
||||||
..
|
|
||||||
.
|
|
||||||
f
|
|
||||||
.
|
|
||||||
t
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
# maxspeed otherwise service road will never be routed over and we won't see instructions
|
|
||||||
| nodes | highway | name | maxspeed | oneway |
|
|
||||||
| sabc | primary | main | 30 km/h | |
|
|
||||||
| dbe | primary | crossing | 30 km/h | yes |
|
|
||||||
| eft | primary | crossing | 30 km/h | yes |
|
|
||||||
| ft | primary | away | 30 km/h | yes |
|
|
||||||
| af | service | sliproad | 30 km/h | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,t | main,away,away | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Not a Sliproad, more than three roads at target intersection
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . . b . . c
|
|
||||||
` .
|
|
||||||
. e
|
|
||||||
. .
|
|
||||||
..
|
|
||||||
. h
|
|
||||||
f .
|
|
||||||
. g
|
|
||||||
t
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sabc | primary | main | |
|
|
||||||
| dbe | primary | top | yes |
|
|
||||||
| eft | primary | bottom | yes |
|
|
||||||
| fh | primary | another | |
|
|
||||||
| fg | primary | another | |
|
|
||||||
| af | primary | sliproad | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
|
|
||||||
|
|
||||||
@sliproads:
|
|
||||||
Scenario: Throughabout-Sliproad
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
t
|
|
||||||
|
|
|
||||||
- - e - -
|
|
||||||
/ \
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
z - s - a - - - - - - - b - - -x
|
|
||||||
' c y
|
|
||||||
| |
|
|
||||||
\ /
|
|
||||||
- -d - -
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | oneway | junction | # |
|
|
||||||
| zs | through | trunk | yes | | |
|
|
||||||
| sa | through | trunk | yes | | |
|
|
||||||
| ab | through | trunk | yes | | |
|
|
||||||
| bx | through | trunk | yes | | |
|
|
||||||
| ac | round | primary | yes | roundabout | |
|
|
||||||
| cdy | round | primary | yes | roundabout | |
|
|
||||||
| yb | round | primary | yes | roundabout | |
|
|
||||||
| be | round | primary | yes | roundabout | |
|
|
||||||
| ea | round | primary | yes | roundabout | |
|
|
||||||
| et | out | primary | yes | | the extraterrestrial |
|
|
||||||
| sc | | trunk_link | yes | | |
|
|
||||||
| yx | right | trunk_link | yes | | |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | sa | ab | a | only_straight |
|
|
||||||
| restriction | ab | bx | b | only_straight |
|
|
||||||
| restriction | yb | be | b | only_straight |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations |
|
|
||||||
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
|
|
||||||
|
|
||||||
Scenario: Sliproad before a roundabout
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
e
|
|
||||||
a - b - - c - d
|
|
||||||
'f|l'
|
|
||||||
m
|
|
||||||
g
|
|
||||||
|
|
|
||||||
.h-_
|
|
||||||
k - i |
|
|
||||||
'.j.'
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction | oneway | highway | name |
|
|
||||||
| ab | | yes | primary | road |
|
|
||||||
| bc | | yes | primary | road |
|
|
||||||
| cd | | yes | primary | road |
|
|
||||||
| ec | | yes | secondary | |
|
|
||||||
| cm | | yes | secondary | |
|
|
||||||
| mg | | yes | primary | |
|
|
||||||
| gh | | no | primary | |
|
|
||||||
| hijh | roundabout | yes | primary | |
|
|
||||||
| ik | | yes | primary | |
|
|
||||||
| bfm | | yes | primary | |
|
|
||||||
| gld | | yes | primary | |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | bc | cd | c | only_straight |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations |
|
|
||||||
| a,k | road,,, | depart,continue right,roundabout turn right exit-1,arrive | a,b,h,k |
|
|
||||||
|
|||||||
@@ -16,34 +16,28 @@ Feature: Destination Signs
|
|||||||
m n
|
m n
|
||||||
o p
|
o p
|
||||||
q r
|
q r
|
||||||
s t
|
|
||||||
u v
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | ref | destination | destination:ref | destination:street | oneway | # |
|
| nodes | name | ref | destination | destination:ref | oneway | # |
|
||||||
| ab | AB | E1 | | | | yes | |
|
| ab | AB | E1 | | | yes | |
|
||||||
| cd | CD | | Berlin | | | yes | |
|
| cd | CD | | Berlin | | yes | |
|
||||||
| ef | EF | | Berlin | A1 | | yes | |
|
| ef | EF | | Berlin | A1 | yes | |
|
||||||
| gh | | | Berlin | A1 | | yes | |
|
| gh | | | Berlin | A1 | yes | |
|
||||||
| ij | | | Berlin | | | yes | |
|
| ij | | | Berlin | | yes | |
|
||||||
| kl | KL | E1 | Berlin | A1 | | yes | |
|
| kl | KL | E1 | Berlin | A1 | yes | |
|
||||||
| mn | MN | | Berlin;Hamburg | A1;A2 | | yes | |
|
| mn | MN | | Berlin;Hamburg | A1;A2 | yes | |
|
||||||
| op | OP | | Berlin;Hamburg | A1;A2 | | no | mis-tagged destination: not a oneway |
|
| op | OP | | Berlin;Hamburg | A1;A2 | no | mis-tagged destination: not a oneway |
|
||||||
| qr | QR | | | A1;A2 | | yes | |
|
| qr | QR | | | A1;A2 | yes | |
|
||||||
| st | ST | | | | St Street | yes | |
|
|
||||||
| uv | UV | | Berlin | | St Street | yes | |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | destinations | ref | # |
|
| from | to | route | destinations | ref | # |
|
||||||
| a | b | AB,AB | , | E1,E1 | |
|
| a | b | AB,AB | , | E1,E1 | |
|
||||||
| c | d | CD,CD | Berlin,Berlin | , | |
|
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||||
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||||
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||||
| i | j | , | Berlin,Berlin | , | |
|
| i | j | , | Berlin,Berlin | , | |
|
||||||
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||||
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||||
| o | p | OP,OP | , | , | guard against mis-tagging |
|
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||||
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||||
| s | t | ST,ST | St Street,St Street | , | |
|
|
||||||
| u | v | UV,UV | Berlin,Berlin | , | city preferred over street |
|
|
||||||
|
|||||||
@@ -24,44 +24,6 @@ Feature: End Of Road Instructions
|
|||||||
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
||||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||||
|
|
||||||
@3605
|
|
||||||
Scenario: End of Road with oneway through street
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
a e b
|
|
||||||
f d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| aeb | primary | no |
|
|
||||||
| cbd | primary | yes |
|
|
||||||
| ef | primary | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
@3605
|
|
||||||
Scenario: End of Road fromnameless onto through street
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
a e b
|
|
||||||
f d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | name |
|
|
||||||
| aeb | primary | no | |
|
|
||||||
| cbd | primary | yes | cbd |
|
|
||||||
| ef | primary | no | ef |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ,cbd,cbd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
Scenario: End of Road with three streets
|
Scenario: End of Road with three streets
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Exceptions for routing onto low-priority roads
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Straight onto low-priority: same name
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
|
|
||||||
a b d
|
|
||||||
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| abd | residential | road |
|
|
||||||
| eb | service | service |
|
|
||||||
| bc | service | service |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| c,e | service,service | depart,arrive |
|
|
||||||
| e,c | service,service | depart,arrive |
|
|
||||||
|
|
||||||
Scenario: Straight onto low-priority: onto and from unnamed
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
|
|
||||||
a b d
|
|
||||||
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| abd | residential | road |
|
|
||||||
| eb | service | |
|
|
||||||
| bc | service | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| e,c | , | depart,arrive |
|
|
||||||
| c,e | , | depart,arrive |
|
|
||||||
|
|
||||||
Scenario: Straight onto low-priority: unnamed
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
|
|
||||||
a b d
|
|
||||||
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| abd | residential | road |
|
|
||||||
| eb | service | service |
|
|
||||||
| bc | service | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| e,c | service, | depart,arrive |
|
|
||||||
| c,e | ,service,service | depart,turn straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Straight onto low-priority
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | residential | road |
|
|
||||||
| bc | service | service |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | road,service,service | depart,new name straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Straight onto low-priority, with driveway
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
a b c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | residential | road |
|
|
||||||
| bc | service | road |
|
|
||||||
| bf | driveway | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | road,road | depart,arrive |
|
|
||||||
|
|
||||||
Scenario: Straight onto low-priority, with driveway
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
a b c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | residential | road |
|
|
||||||
| bc | service | |
|
|
||||||
| bf | driveway | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | road, | depart,arrive |
|
|
||||||
| c,a | ,road,road | depart,new name straight,arrive |
|
|
||||||
@@ -1,525 +0,0 @@
|
|||||||
@guidance @merge-segregated
|
|
||||||
Feature: Merge Segregated Roads
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 3 meters
|
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=18/52.49950/13.33916
|
|
||||||
@negative
|
|
||||||
Scenario: oneway link road
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f - - - - - - -_-_e - - - - d
|
|
||||||
...''
|
|
||||||
a - - - b'- - - - - - - - - c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| abc | road | yes |
|
|
||||||
| def | road | yes |
|
|
||||||
| be | road | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,c | road,road | true:90,true:75 true:90 false:270;true:270 |
|
|
||||||
| d,f | road,road | true:270,false:90 false:255 true:270;true:90 |
|
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=18/52.48337/13.36184
|
|
||||||
@negative
|
|
||||||
Scenario: Square Area - Same Name as road for in/out
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
i
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
a - - - - c e - - - - f
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
d
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
j
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ac | road | no |
|
|
||||||
| ef | road | no |
|
|
||||||
| cdegc | road | yes |
|
|
||||||
| ig | top | no |
|
|
||||||
| jd | bot | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,f | road,road,road,road | true:90,false:45 true:135 false:270;true:45 true:180 false:315;true:90 false:225 true:315;true:270 |
|
|
||||||
|
|
||||||
#https://www.openstreetmap.org/#map=19/52.50003/13.33915
|
|
||||||
@negative
|
|
||||||
Scenario: Short Segment due to different roads
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
. d
|
|
||||||
. '
|
|
||||||
. '
|
|
||||||
. '
|
|
||||||
. '
|
|
||||||
a - - - - - - - b - - c - - - - - - e
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
.
|
|
||||||
f
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| abce | pass | no |
|
|
||||||
| db | pass | yes |
|
|
||||||
| fg | aug | no |
|
|
||||||
| bfc | aug | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,e | pass,pass | true:90,false:60 true:90 true:165 false:270,true:90 false:195 false:270;true:270 |
|
|
||||||
|
|
||||||
@negative
|
|
||||||
Scenario: Tripple Merge should not be possible
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
|
||||||
.
|
|
||||||
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
|
||||||
'
|
|
||||||
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | in | no |
|
|
||||||
| gfb | merge | yes |
|
|
||||||
| be | merge | yes |
|
|
||||||
| dcb | merge | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,e | in,merge,merge | true:90;false:60 true:90 false:120 false:270;true:270 |
|
|
||||||
|
|
||||||
Scenario: Tripple Merge should not be possible
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
|
||||||
.
|
|
||||||
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
|
||||||
'
|
|
||||||
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | in | no |
|
|
||||||
| gfb | merge | yes |
|
|
||||||
| eb | merge | yes |
|
|
||||||
| bcd | merge | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,d | in,merge,merge | true:90;false:60 false:90 true:120 false:270;true:270 |
|
|
||||||
|
|
||||||
@negative
|
|
||||||
Scenario: Don't accept turn-restrictions
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
|
||||||
/ \
|
|
||||||
a - - - b g - - h
|
|
||||||
\ /
|
|
||||||
e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | yes |
|
|
||||||
| befgh | road | yes |
|
|
||||||
| bcdg | road | yes |
|
|
||||||
|
|
||||||
# This is an artificial scenario - not reasonable. It is only to test the merging on turn-restrictions
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | ab | bcdg | b | no_left_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,h | road,road | true:90,false:60 true:120 false:270,true:90 false:240 false:300;true:270 |
|
|
||||||
|
|
||||||
@negative
|
|
||||||
Scenario: Actual Turn into segregated ways
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - - - b - < - < - < - < - < - < - < - < - < - < - < c -
|
|
||||||
| \
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
d |
|
|
||||||
\ |
|
|
||||||
\ |
|
|
||||||
e > - > - > - > - > - > - > - > - > - > - > f - - - - - - g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | no |
|
|
||||||
| fcb | road | yes |
|
|
||||||
| bdef | road | yes |
|
|
||||||
| fg | road | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,g | road,road | true:90,false:90 true:150 false:270,true:90 false:270 true:345;true:270 |
|
|
||||||
|
|
||||||
Scenario: Merging parallel roads with intermediate bridges
|
|
||||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
|
||||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
|
|
|
||||||
.e.
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
g d
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
h c
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
b
|
|
||||||
|
|
|
||||||
a
|
|
||||||
|
|
|
||||||
|
|
|
||||||
r - x - s
|
|
||||||
|
|
|
||||||
|
|
|
||||||
y
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | oneway | lanes |
|
|
||||||
| ab | Hermannstr | secondary | | 2 |
|
|
||||||
| bc | Hermannstr | secondary | yes | 2 |
|
|
||||||
| cd | Hermannbruecke | secondary | yes | 2 |
|
|
||||||
| de | Hermannstr | secondary | yes | 2 |
|
|
||||||
| ef | Hermannstr | secondary | | 4 |
|
|
||||||
| eg | Hermannstr | secondary | yes | 2 |
|
|
||||||
| gh | Hermannbruecke | secondary | yes | 2 |
|
|
||||||
| hb | Hermannstr | secondary | yes | 2 |
|
|
||||||
| xa | Hermannstr | secondary | | 4 |
|
|
||||||
| yx | Hermannstr | secondary | | 4 |
|
|
||||||
| rxs | Silbersteinstr | tertiary | | 1 |
|
|
||||||
|
|
||||||
And the nodes
|
|
||||||
| node | highway |
|
|
||||||
| x | traffic_signals |
|
|
||||||
|
|
||||||
#the intermediate intersections of degree two indicate short segments of new names. At some point, we probably want to get rid of these
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route | intersections |
|
|
||||||
| a,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 false:180,true:0 false:180;true:180 |
|
|
||||||
| f,a | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180;true:0 |
|
|
||||||
| y,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 true:90 false:180 true:270,true:0 false:180,true:0 false:180;true:180 |
|
|
||||||
| f,y | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180,false:0 true:90 true:180 true:270;true:0 |
|
|
||||||
|
|
||||||
Scenario: Four Way Intersection Double Through Street Segregated
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
q p
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
b c
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
j - - - - - - - - - - - - - - - - - i . \ / , d - - - - - - - - - - - - - - - - - o
|
|
||||||
. \/ .
|
|
||||||
> a <
|
|
||||||
. /\ '
|
|
||||||
. / \ '
|
|
||||||
k - - - - - - - - - - - - - - - - - h / \ e - - - - - - - - - - - - - - - - - n
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
g f
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
l m
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | name | lanes |
|
|
||||||
| khaij | primary | yes | first | 4 |
|
|
||||||
| odaen | primary | yes | first | 4 |
|
|
||||||
| qbacp | primary | yes | second | 4 |
|
|
||||||
| mfagl | primary | yes | second | 4 |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| f,e | second,first,first | depart,turn right,arrive |
|
|
||||||
| f,c | second,second | depart,arrive |
|
|
||||||
| f,i | second,first,first | depart,turn left,arrive |
|
|
||||||
| f,g | second,second,second | depart,continue uturn,arrive |
|
|
||||||
| d,c | first,second,second | depart,turn right,arrive |
|
|
||||||
| d,i | first,first | depart,arrive |
|
|
||||||
| d,g | first,second,second | depart,turn left,arrive |
|
|
||||||
| d,e | first,first,first | depart,continue uturn,arrive |
|
|
||||||
| b,i | second,first,first | depart,turn right,arrive |
|
|
||||||
| b,g | second,second | depart,arrive |
|
|
||||||
| b,e | second,first,first | depart,turn left,arrive |
|
|
||||||
| b,c | second,second,second | depart,continue uturn,arrive |
|
|
||||||
| h,g | first,second,second | depart,turn right,arrive |
|
|
||||||
| h,e | first,first | depart,arrive |
|
|
||||||
| h,c | first,second,second | depart,turn left,arrive |
|
|
||||||
| h,i | first,first,first | depart,continue uturn,arrive |
|
|
||||||
|
|
||||||
Scenario: Middle Island Over Bridge
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
|
|
|
||||||
.b.
|
|
||||||
c h
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
1 2
|
|
||||||
| |
|
|
||||||
d g
|
|
||||||
'e'
|
|
||||||
|
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | no |
|
|
||||||
| ef | road | no |
|
|
||||||
| bc | road | yes |
|
|
||||||
| cd | bridge | yes |
|
|
||||||
| de | road | yes |
|
|
||||||
| eg | road | yes |
|
|
||||||
| gh | bridge | yes |
|
|
||||||
| hb | road | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route | intersections |
|
|
||||||
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
|
|
||||||
| c,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
|
|
||||||
| 1,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
|
|
||||||
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
|
|
||||||
| g,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
|
|
||||||
| 2,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
|
|
||||||
|
|
||||||
@negative
|
|
||||||
Scenario: Traffic Circle
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - - - - b - - - e - - - c - - - - d
|
|
||||||
\ /
|
|
||||||
\ /
|
|
||||||
f
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | left | no |
|
|
||||||
| bfceb | circle | yes |
|
|
||||||
| fg | bottom | no |
|
|
||||||
| cd | right | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
|
|
||||||
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
|
|
||||||
|
|
||||||
Scenario: Middle Island
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
|
|
|
||||||
b
|
|
||||||
c h
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
d g
|
|
||||||
e
|
|
||||||
|
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | no |
|
|
||||||
| ef | road | no |
|
|
||||||
| bcde | road | yes |
|
|
||||||
| eghb | road | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route |
|
|
||||||
| a,f | depart,arrive | road,road |
|
|
||||||
| c,f | depart,arrive | road,road |
|
|
||||||
| f,a | depart,arrive | road,road |
|
|
||||||
| g,a | depart,arrive | road,road |
|
|
||||||
|
|
||||||
Scenario: Traffic Island
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
a - - b < > d - - e
|
|
||||||
c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | no |
|
|
||||||
| de | road | no |
|
|
||||||
| bcdfb | road | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,e | road,road | true:90;true:270 |
|
|
||||||
|
|
||||||
@negative
|
|
||||||
Scenario: Turning Road, Don't remove sliproads
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
h - - - - - g - - - - - - f - - - - - e
|
|
||||||
_ '
|
|
||||||
.
|
|
||||||
a - - - - - b - - - - - - c - - - - - d
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | yes |
|
|
||||||
| bcd | road | yes |
|
|
||||||
| efgh | road | yes |
|
|
||||||
| fb | road | yes |
|
|
||||||
| bi | turn | yes |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | fb | bcd | b | no_left_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | intersections |
|
|
||||||
| a,d | road,road | depart,arrive | true:90,false:60 true:90 true:180 false:270;true:270 |
|
|
||||||
| e,h | road,road | depart,arrive | true:270,false:90 true:240 true:270;true:90 |
|
|
||||||
| e,i | road,turn,turn | depart,turn left,arrive | true:270;false:90 true:240 true:270,false:60 false:90 true:180 false:270;true:0 |
|
|
||||||
@negative
|
|
||||||
Scenario: Meeting Turn Roads
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
k l
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
h - - - - - g - - - - - - - f - - - - - e
|
|
||||||
| ' ' |
|
|
||||||
| x |
|
|
||||||
| . . |
|
|
||||||
a - - - - - b - - - - - - - c - - - - - d
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
i j
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | horiz | yes |
|
|
||||||
| bc | horiz | yes |
|
|
||||||
| cd | horiz | yes |
|
|
||||||
| ef | horiz | yes |
|
|
||||||
| fg | horiz | yes |
|
|
||||||
| gh | horiz | yes |
|
|
||||||
| kg | vert | yes |
|
|
||||||
| gb | vert | yes |
|
|
||||||
| bi | vert | yes |
|
|
||||||
| jc | vert | yes |
|
|
||||||
| cf | vert | yes |
|
|
||||||
| fl | vert | yes |
|
|
||||||
| gx | horiz | no |
|
|
||||||
| xc | horiz | no |
|
|
||||||
| fx | horiz | no |
|
|
||||||
| xb | horiz | no |
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | bc | cf | c | no_left_turn |
|
|
||||||
| restriction | fg | gb | g | no_left_turn |
|
|
||||||
| restriction | cf | fg | f | no_left_turn |
|
|
||||||
| restriction | gb | bc | b | no_left_turn |
|
|
||||||
| restriction | xb | bc | b | no_left_turn |
|
|
||||||
| restriction | xc | cf | c | no_left_turn |
|
|
||||||
| restriction | xf | fg | f | no_left_turn |
|
|
||||||
| restriction | xg | gb | g | no_left_turn |
|
|
||||||
|
|
||||||
# the goal here should be not to mention the intersection in the middle at all and also suppress the segregated parts
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,l | horiz,vert,vert | true:90;false:0 true:60 true:90 true:180 false:270,true:60 true:120 false:240 true:300,true:0 false:90 false:180 false:240 false:270;true:180 |
|
|
||||||
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
|
|
||||||
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,true:60 false:120 true:240 true:300,false:0 false:90 false:120 false:180 true:270;true:90 |
|
|
||||||
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
|
|
||||||
@@ -8,8 +8,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Right
|
Scenario: Ramp Exit Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-c-d-e
|
a b c d e
|
||||||
`--f-g
|
f g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -25,9 +25,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Right Curved Right
|
Scenario: Ramp Exit Right Curved Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-c
|
a b c
|
||||||
`f`d
|
f d
|
||||||
`g`e
|
g e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -43,11 +43,12 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Right Curved Left
|
Scenario: Ramp Exit Right Curved Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
,e
|
e
|
||||||
,d,g
|
d g
|
||||||
a-b-c-f
|
a b c f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | oneway |
|
| nodes | highway | oneway |
|
||||||
| abcde | motorway | |
|
| abcde | motorway | |
|
||||||
@@ -62,8 +63,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Left
|
Scenario: Ramp Exit Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
/--f-g
|
f g
|
||||||
a-b-c-d-e
|
a b c d e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -79,9 +80,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Left Curved Left
|
Scenario: Ramp Exit Left Curved Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
,g,e
|
g e
|
||||||
,f,d
|
f d
|
||||||
a-b-c
|
a b c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -97,9 +98,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Left Curved Right
|
Scenario: Ramp Exit Left Curved Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-c-f
|
a b c f
|
||||||
`d`g
|
d g
|
||||||
`e
|
e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -115,8 +116,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On Ramp Right
|
Scenario: On Ramp Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-c-d-e
|
a b c d e
|
||||||
f-g---'
|
f g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -132,8 +133,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On Ramp Left
|
Scenario: On Ramp Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f-g---,
|
f g
|
||||||
a-b-c-d-e
|
a b c d e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -149,9 +150,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Highway Fork
|
Scenario: Highway Fork
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
/--d-e
|
d e
|
||||||
a-b-c
|
a b c
|
||||||
\--f-g
|
f g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -167,9 +168,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Fork After Ramp
|
Scenario: Fork After Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
/--d-e
|
d e
|
||||||
a-b-c
|
a b c
|
||||||
\--f-g
|
f g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -186,8 +187,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On And Off Ramp Right
|
Scenario: On And Off Ramp Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b---c---d-e
|
a b c d e
|
||||||
f-g--/ \--h i
|
f g h i
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -206,8 +207,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On And Off Ramp Left
|
Scenario: On And Off Ramp Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f-g--\/---h-i
|
f g h i
|
||||||
a-b---c---d-e
|
a b c d e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -226,9 +227,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Merging Motorways
|
Scenario: Merging Motorways
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e\
|
e
|
||||||
a-b-c
|
a b c
|
||||||
d/
|
d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -245,8 +246,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Handle 90 degree off ramps correctly
|
Scenario: Handle 90 degree off ramps correctly
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a\
|
a
|
||||||
x-b---c-y
|
x b c y
|
||||||
d
|
d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -10,31 +10,26 @@ Feature: Simple Turns
|
|||||||
"""
|
"""
|
||||||
a
|
a
|
||||||
b
|
b
|
||||||
^
|
|
||||||
/ \
|
|
||||||
c d
|
c d
|
||||||
| |\
|
|
||||||
| | e
|
e
|
||||||
| |
|
|
||||||
| |
|
f
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
g f
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway |
|
| nodes | name | highway | oneway |
|
||||||
| ab | road | primary | no |
|
| ab | road | primary | no |
|
||||||
| bcg | road | primary | yes |
|
| bc | road | primary | yes |
|
||||||
| fdb | road | primary | yes |
|
| fdb | road | primary | yes |
|
||||||
| ed | turn | primary | yes |
|
| de | turn | primary | no |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route | intersections |
|
| waypoints | turns | route |
|
||||||
| f,a | depart,arrive | road,road | true:0,true:0 false:150 false:180;true:180 |
|
| f,a | depart,arrive | road,road |
|
||||||
| e,a | depart,turn slight right,arrive | turn,road,road | true:333;true:0 false:150 false:180;true:180 |
|
| e,a | depart,turn slight right,arrive | turn,road,road |
|
||||||
|
|
||||||
Scenario: Turning into splitting road
|
Scenario: Turning into splitting road
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -44,22 +39,16 @@ Feature: Simple Turns
|
|||||||
/\
|
/\
|
||||||
/ \
|
/ \
|
||||||
c d
|
c d
|
||||||
| |\
|
|\
|
||||||
| | e
|
| e
|
||||||
| |
|
|
|
||||||
| |
|
f
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
h f
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway |
|
| nodes | name | highway | oneway |
|
||||||
| ab | road | primary | no |
|
| ab | road | primary | no |
|
||||||
| bch | road | primary | yes |
|
| bc | road | primary | yes |
|
||||||
| fdb | road | primary | yes |
|
| fdb | road | primary | yes |
|
||||||
| de | turn | primary | no |
|
| de | turn | primary | no |
|
||||||
| bg | left | primary | yes |
|
| bg | left | primary | yes |
|
||||||
@@ -72,6 +61,108 @@ Feature: Simple Turns
|
|||||||
| f,g | depart,turn left,arrive | road,left,left |
|
| f,g | depart,turn left,arrive | road,left,left |
|
||||||
| f,c | depart,continue uturn,arrive | road,road,road |
|
| f,c | depart,continue uturn,arrive | road,road,road |
|
||||||
|
|
||||||
|
Scenario: Middle Island
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
|
||||||
|
b
|
||||||
|
c h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
d g
|
||||||
|
e
|
||||||
|
|
||||||
|
f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | no |
|
||||||
|
| ef | road | no |
|
||||||
|
| bcde | road | yes |
|
||||||
|
| eghb | road | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,f | depart,arrive | road,road |
|
||||||
|
| c,f | depart,arrive | road,road |
|
||||||
|
| f,a | depart,arrive | road,road |
|
||||||
|
| g,a | depart,arrive | road,road |
|
||||||
|
|
||||||
|
Scenario: Middle Island Over Bridge
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
|
||||||
|
b
|
||||||
|
c h
|
||||||
|
|
||||||
|
|
||||||
|
1 2
|
||||||
|
|
||||||
|
d g
|
||||||
|
e
|
||||||
|
|
||||||
|
f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | no |
|
||||||
|
| ef | road | no |
|
||||||
|
| bc | road | yes |
|
||||||
|
| cd | bridge | yes |
|
||||||
|
| de | road | yes |
|
||||||
|
| eg | road | yes |
|
||||||
|
| gh | bridge | yes |
|
||||||
|
| hb | road | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,f | depart,arrive | road,road |
|
||||||
|
| c,f | depart,new name straight,arrive | bridge,road,road |
|
||||||
|
| 1,f | depart,new name straight,arrive | bridge,road,road |
|
||||||
|
| f,a | depart,arrive | road,road |
|
||||||
|
| g,a | depart,new name straight,arrive | bridge,road,road |
|
||||||
|
| 2,a | depart,new name straight,arrive | bridge,road,road |
|
||||||
|
|
||||||
|
@negative
|
||||||
|
Scenario: Don't Collapse Places:
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
h
|
||||||
|
g
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
a b e f
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
c
|
||||||
|
d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | place | no |
|
||||||
|
| cd | bottom | no |
|
||||||
|
| ef | place | no |
|
||||||
|
| gh | top | no |
|
||||||
|
| bcegb | place | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,d | depart,turn right,arrive | place,bottom,bottom |
|
||||||
|
| a,f | depart,continue left,continue right,arrive | place,place,place,place |
|
||||||
|
| d,f | depart,turn right,continue right,arrive | bottom,place,place,place |
|
||||||
|
| d,h | depart,turn right,continue left,turn right,arrive | bottom,place,place,top,top |
|
||||||
|
|
||||||
@bug @not-sorted @3179
|
@bug @not-sorted @3179
|
||||||
Scenario: Adjusting road angles to not be sorted
|
Scenario: Adjusting road angles to not be sorted
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -271,8 +271,8 @@ Feature: Ramp Guidance
|
|||||||
| bc | | ferry | boaty mc boatface | m2 |
|
| bc | | ferry | boaty mc boatface | m2 |
|
||||||
| cf | | ferry | boaty mc boatface | |
|
| cf | | ferry | boaty mc boatface | |
|
||||||
| cd | | ferry | boaty mc boatface's cousin | |
|
| cd | | ferry | boaty mc boatface's cousin | |
|
||||||
| de | motorway_link | | | |
|
| de | motorway_link | | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route |
|
| waypoints | route |
|
||||||
| a,e | boarding,boaty mc boatface,, |
|
| a,e | boarding,boaty mc boatface,boaty mc boatface's cousin,, |
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
@routing @guidance @left-handed
|
|
||||||
Feature: Basic Roundabout
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
require 'car'
|
|
||||||
properties.left_hand_driving = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Roundabout exit counting for left sided driving
|
|
||||||
And a grid size of 10 meters
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b
|
|
||||||
h g c d
|
|
||||||
e
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bcegb | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
|
|
||||||
|
|
||||||
Scenario: Mixed Entry and Exit
|
|
||||||
And a grid size of 10 meters
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
c a
|
|
||||||
j b f
|
|
||||||
k e
|
|
||||||
l h d
|
|
||||||
g i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction | oneway |
|
|
||||||
| cba | | yes |
|
|
||||||
| fed | | yes |
|
|
||||||
| ihg | | yes |
|
|
||||||
| lkj | | yes |
|
|
||||||
| behkb | roundabout | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| c,a | cba,cba,cba | depart,roundabout-exit-1,arrive |
|
|
||||||
| l,a | lkj,cba,cba | depart,roundabout-exit-2,arrive |
|
|
||||||
| i,a | ihg,cba,cba | depart,roundabout-exit-3,arrive |
|
|
||||||
@@ -38,30 +38,6 @@ Feature: Basic Roundabout
|
|||||||
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||||
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||||
|
|
||||||
Scenario: Roundabout With Service
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a h
|
|
||||||
bg
|
|
||||||
d c
|
|
||||||
e
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction | highway |
|
|
||||||
| ab | | primary |
|
|
||||||
| cd | | primary |
|
|
||||||
| ef | | service |
|
|
||||||
| gh | | primary |
|
|
||||||
| bcegb | roundabout | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
#2927
|
#2927
|
||||||
Scenario: Only Roundabout
|
Scenario: Only Roundabout
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -492,192 +468,3 @@ Feature: Basic Roundabout
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| e,h | left,right,right | depart,roundabout-exit-2,arrive |
|
| e,h | left,right,right | depart,roundabout-exit-2,arrive |
|
||||||
|
|
||||||
@3361
|
|
||||||
Scenario: Bersarinplatz (Not a Roundabout)
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a n
|
|
||||||
|
|
||||||
b m
|
|
||||||
|
|
||||||
c l
|
|
||||||
|
|
||||||
d e j k
|
|
||||||
|
|
||||||
f h
|
|
||||||
|
|
||||||
g i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction | name | ref | highway | oneway |
|
|
||||||
| ab | | Petersburger Strasse | B 96a | primary | yes |
|
|
||||||
| bc | circular | Bersarinplatz | B 96a | primary | |
|
|
||||||
| ce | circular | Bersarinplatz | B 96a | primary | |
|
|
||||||
| ed | | Weidenweg | | residential | |
|
|
||||||
| ef | circular | Bersarinplatz | B 96a | primary | |
|
|
||||||
| fg | | Petersburger Strasse | B 96a | primary | yes |
|
|
||||||
| fh | circular | Bersarinplatz | | secondary | |
|
|
||||||
| ih | | Petersburger Strasse | B 96a | primary | yes |
|
|
||||||
| hj | circular | Bersarinplatz | | secondary | |
|
|
||||||
| jk | | Rigaer Strasse | | residential | |
|
|
||||||
| jl | circular | Bersarinplatz | | secondary | |
|
|
||||||
| lm | circular | Bersarinplatz | | secondary | |
|
|
||||||
| mb | circular | Bersarinplatz | | secondary | |
|
|
||||||
| mn | | Petersburger Strasse | B 96a | primary | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
|
|
||||||
| d,g | Weidenweg,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-1,arrive |
|
|
||||||
| i,k | Petersburger Strasse,Rigaer Strasse,Rigaer Strasse | depart,Bersarinplatz-exit-1,arrive |
|
|
||||||
| i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
|
|
||||||
| i,d | Petersburger Strasse,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,arrive |
|
|
||||||
| i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,arrive |
|
|
||||||
|
|
||||||
@turboroundabout
|
|
||||||
# http://www.openstreetmap.org/?mlat=48.782118&mlon=8.194456&zoom=16#map=19/48.78216/8.19457
|
|
||||||
Scenario: Turboroundabout, Baden-Baden
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a p
|
|
||||||
b o
|
|
||||||
d c m n
|
|
||||||
f e k l
|
|
||||||
g i
|
|
||||||
h j
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | junction | name | turn:lanes |
|
|
||||||
| ab | trunk_link | yes | | | |
|
|
||||||
| bc | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
|
||||||
| cd | trunk | yes | | Europastrasse | |
|
|
||||||
| ce | trunk | yes | roundabout | Europaplatz | |
|
|
||||||
| fe | trunk | yes | | Europastrasse | |
|
|
||||||
| eg | trunk | yes | roundabout | Europaplatz | |
|
|
||||||
| gh | residential | yes | | Allee Cite | |
|
|
||||||
| gi | trunk | yes | roundabout | Europaplatz | |
|
|
||||||
| ji | residential | yes | | Allee Cite | |
|
|
||||||
| ik | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
|
||||||
| kl | trunk | yes | | Europastrasse | |
|
|
||||||
| km | trunk | yes | roundabout | Europaplatz | |
|
|
||||||
| nm | trunk | yes | | Europastrasse | |
|
|
||||||
| mo | trunk | yes | roundabout | Europaplatz | |
|
|
||||||
| op | trunk_link | yes | | | |
|
|
||||||
| ob | trunk | yes | roundabout | Europaplatz | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | lanes |
|
|
||||||
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive | ,, |
|
|
||||||
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive | ,, |
|
|
||||||
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive | ,, |
|
|
||||||
| a,p | ,, | depart,Europaplatz-exit-4,arrive | ,, |
|
|
||||||
|
|
||||||
@turboroundabout
|
|
||||||
# http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506
|
|
||||||
Scenario: Turboroundabout, Königstein im Taunus
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b w t v
|
|
||||||
c s u
|
|
||||||
d r
|
|
||||||
f e q
|
|
||||||
g p
|
|
||||||
h i n
|
|
||||||
j k m
|
|
||||||
l o
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | junction | name | turn:lanes |
|
|
||||||
| ab | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
|
||||||
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
|
||||||
| bc | primary | yes | roundabout | | through\|through;right |
|
|
||||||
| cd | primary | yes | roundabout | | through\|through\|right;through |
|
|
||||||
| df | tertiary | yes | | Frankfurter Strasse | |
|
|
||||||
| de | primary | yes | roundabout | | through\|through\|right;through |
|
|
||||||
| fe | tertiary | yes | | Frankfurter Strasse | |
|
|
||||||
| eg | primary | yes | roundabout | | through\|through\|right;through |
|
|
||||||
| gh | primary | yes | | Bischof-Kaller-Strasse | |
|
|
||||||
| gi | primary | yes | roundabout | | left\|through;slight_left\|through |
|
|
||||||
| ji | primary | yes | | Bischof-Kaller-Strasse | |
|
|
||||||
| ik | primary | yes | roundabout | | left\|through;slight_left\|through |
|
|
||||||
| km | primary | yes | roundabout | | |
|
|
||||||
| kl | primary | yes | | Sodener Strasse | |
|
|
||||||
| mn | primary | yes | roundabout | | through\|through;right |
|
|
||||||
| on | primary | yes | | Sodener Strasse | |
|
|
||||||
| np | primary | yes | roundabout | | through\|through;right |
|
|
||||||
| pq | primary | yes | roundabout | | through\|through\|right;through |
|
|
||||||
| qr | primary | yes | | | |
|
|
||||||
| qs | primary | yes | roundabout | | |
|
|
||||||
| us | primary_link | yes | | | |
|
|
||||||
| st | primary | yes | roundabout | | |
|
|
||||||
| vt | primary | yes | | | |
|
|
||||||
| tw | primary | yes | roundabout | | left\|left\|right\|right |
|
|
||||||
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
|
||||||
| wb | primary | yes | roundabout | | through\|through;right |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | lanes |
|
|
||||||
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive | ,, |
|
|
||||||
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive | ,, |
|
|
||||||
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive | ,, |
|
|
||||||
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive | ,, |
|
|
||||||
| u,r | ,, | depart,roundabout-exit-5,arrive | ,, |
|
|
||||||
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive | ,, |
|
|
||||||
| n,m | , | depart,arrive | , |
|
|
||||||
|
|
||||||
@turboroundabout
|
|
||||||
# http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711
|
|
||||||
Scenario: Turboroundabout, Rheinfelden (Baden)
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
r w
|
|
||||||
a l k
|
|
||||||
b j
|
|
||||||
c
|
|
||||||
d i
|
|
||||||
s e f g h v
|
|
||||||
|
|
||||||
t u
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | junction |
|
|
||||||
| ar | secondary | yes | |
|
|
||||||
| ab | primary | yes | roundabout |
|
|
||||||
| rb | secondary | yes | |
|
|
||||||
| bc | primary | yes | roundabout |
|
|
||||||
| cd | primary | yes | roundabout |
|
|
||||||
| ds | primary | yes | |
|
|
||||||
| se | primary | yes | |
|
|
||||||
| de | primary | yes | roundabout |
|
|
||||||
| ef | primary | yes | roundabout |
|
|
||||||
| ft | unclassified | yes | |
|
|
||||||
| fg | primary | yes | roundabout |
|
|
||||||
| ug | unclassified | yes | |
|
|
||||||
| gh | primary | yes | roundabout |
|
|
||||||
| hv | primary | yes | |
|
|
||||||
| hi | primary | yes | roundabout |
|
|
||||||
| vi | primary | yes | |
|
|
||||||
| ij | primary | yes | roundabout |
|
|
||||||
| jw | tertiary | yes | |
|
|
||||||
| jk | primary | yes | roundabout |
|
|
||||||
| wk | tertiary | yes | |
|
|
||||||
| kl | primary | yes | roundabout |
|
|
||||||
| la | primary | yes | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| w,r | wk,ar,ar | depart,roundabout-exit-1,arrive |
|
|
||||||
| w,s | wk,ds,ds | depart,roundabout-exit-2,arrive |
|
|
||||||
| w,t | wk,ft,ft | depart,roundabout-exit-3,arrive |
|
|
||||||
| w,v | wk,hv,hv | depart,roundabout-exit-4,arrive |
|
|
||||||
| u,v | ug,hv,hv | depart,roundabout-exit-1,arrive |
|
|
||||||
| u,w | ug,jw,jw | depart,roundabout-exit-2,arrive |
|
|
||||||
| u,r | ug,ar,ar | depart,roundabout-exit-3,arrive |
|
|
||||||
| u,s | ug,ds,ds | depart,roundabout-exit-4,arrive |
|
|
||||||
| u,t | ug,ft,ft | depart,roundabout-exit-5,arrive |
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Feature: Staggered Intersections
|
|||||||
| jcdehi | residential | Cedar Dr |
|
| jcdehi | residential | Cedar Dr |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | Oak St,Oak St | depart,arrive |
|
| a,g | Oak St,Oak St | depart,arrive |
|
||||||
| g,a | Oak St,Oak St | depart,arrive |
|
| g,a | Oak St,Oak St | depart,arrive |
|
||||||
|
|
||||||
@@ -98,48 +98,3 @@ Feature: Staggered Intersections
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | Oak St,Cedar Dr,Elm St,Elm St | depart,turn right,turn left,arrive |
|
| a,g | Oak St,Cedar Dr,Elm St,Elm St | depart,turn right,turn left,arrive |
|
||||||
| g,a | Elm St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
| g,a | Elm St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||||
|
|
||||||
Scenario: Staggered Intersection: do not collapse if a mode change is involved
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
d
|
|
||||||
e f g
|
|
||||||
h
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | route |
|
|
||||||
| abc | primary | to_sea | |
|
|
||||||
| ef | | to_sea | ferry |
|
|
||||||
| fg | primary | road | |
|
|
||||||
| jcdeh | primary | road | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | modes |
|
|
||||||
| a,g | to_sea,road,to_sea,road,road | depart,turn right,turn left,notification straight,arrive | driving,driving,ferry,driving,driving |
|
|
||||||
| g,a | road,to_sea,road,to_sea,to_sea | depart,notification straight,turn right,turn left,arrive | driving,ferry,driving,driving,driving |
|
|
||||||
|
|
||||||
Scenario: Staggered Intersection: do not collapse intermediary intersections
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
j
|
|
||||||
a b c
|
|
||||||
e f g
|
|
||||||
d
|
|
||||||
k l m
|
|
||||||
i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| abc | primary | Oak St |
|
|
||||||
| efg | residential | Elm St |
|
|
||||||
| klm | residential | Oak St |
|
|
||||||
| jcedki | residential | Cedar Dr |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,m | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
|
||||||
| m,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Do not announce passing a exit ramp
|
Scenario: Do not announce passing a exit ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-c-d-e
|
a b c d e
|
||||||
\---f-g
|
f g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -24,7 +24,7 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Do not announce reference changes
|
Scenario: Do not announce reference changes
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-c-d-e-f
|
a b c d e f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -43,7 +43,7 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Don't Announce Turn on following major road class -- service
|
Scenario: Don't Announce Turn on following major road class -- service
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-d
|
a b d
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Don't Announce Turn on following major road class -- residential
|
Scenario: Don't Announce Turn on following major road class -- residential
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a-b-d
|
a b d
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -201,14 +201,14 @@ Feature: Simple Turns
|
|||||||
| ef | residential | road | 2 | yes |
|
| ef | residential | road | 2 | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns |
|
||||||
| a,c | road,road | depart,arrive | a,c |
|
| a,c | road,road | depart,arrive |
|
||||||
| c,a | road,road | depart,arrive | c,a |
|
| c,a | road,road | depart,arrive |
|
||||||
| g,a | turn,road,road | depart,turn left,arrive | g,b,a |
|
| g,a | turn,road,road | depart,turn left,arrive |
|
||||||
| g,c | turn,road,road | depart,turn right,arrive | g,b,c |
|
| g,c | turn,road,road | depart,turn right,arrive |
|
||||||
| g,f | turn,road,road | depart,turn left,arrive | g,e,f |
|
| g,f | turn,road | depart,arrive |
|
||||||
| c,f | road,road,road | depart,continue right,arrive | c,b,f |
|
| c,f | road,road,road | depart,continue right,arrive |
|
||||||
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f |
|
| a,f | road,road,road | depart,continue uturn,arrive |
|
||||||
|
|
||||||
# http://www.openstreetmap.org/#map=19/52.48753/13.52838
|
# http://www.openstreetmap.org/#map=19/52.48753/13.52838
|
||||||
Scenario: Traffic Circle
|
Scenario: Traffic Circle
|
||||||
@@ -249,7 +249,7 @@ Feature: Simple Turns
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | intersections |
|
| waypoints | route | turns | intersections |
|
||||||
| a,p | road,road,road | depart,roundabout turn straight exit-1,arrive | true:90;true:165 false:270 false:345,true:90 false:180 true:345;true:270 |
|
| a,p | road,road,road | depart,roundabout turn straight exit-1,arrive | true:90;true:135 false:270 false:345,true:90 false:180 true:345;true:270 |
|
||||||
|
|
||||||
Scenario: Splitting Road with many lanes
|
Scenario: Splitting Road with many lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -317,30 +317,30 @@ Feature: Simple Turns
|
|||||||
Scenario: Curved Turn At Cross
|
Scenario: Curved Turn At Cross
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
h
|
h
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
| . b - - - - - - - - - - - - - - - - - - - - - - - a
|
| . b - - - - - - - - - - - - - - - - - - a
|
||||||
| .
|
| .
|
||||||
| .
|
| .
|
||||||
| c
|
| c
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
d
|
d
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
e |
|
e |
|
||||||
. |
|
. |
|
||||||
. |
|
. |
|
||||||
g - - - - - - - - - - - - - - - - - - f |
|
g - - - - - - - - - - - - - f |
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
i
|
i
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -443,9 +443,9 @@ Feature: Simple Turns
|
|||||||
| ef | residential | road | 2 | yes |
|
| ef | residential | road | 2 | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations | # |
|
| waypoints | route | turns |
|
||||||
| g,f | turn,road | depart,arrive | g,f | #could offer an additional turn at `e` if you don't detect the turn in between as curve |
|
| g,f | turn,road,road | depart,turn left,arrive |
|
||||||
| c,f | road,road,road | depart,continue right,arrive | c,b,f | |
|
| c,f | road,road,road | depart,continue right,arrive |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/search?query=52.479264%2013.295617#map=19/52.47926/13.29562
|
#http://www.openstreetmap.org/search?query=52.479264%2013.295617#map=19/52.47926/13.29562
|
||||||
Scenario: Splitting Roads with curved split
|
Scenario: Splitting Roads with curved split
|
||||||
@@ -627,14 +627,12 @@ Feature: Simple Turns
|
|||||||
| 1,h | ,allee,allee | depart,turn left,arrive |
|
| 1,h | ,allee,allee | depart,turn left,arrive |
|
||||||
| 2,h | ,allee,allee | depart,turn left,arrive |
|
| 2,h | ,allee,allee | depart,turn left,arrive |
|
||||||
|
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=18/52.56251/13.32650
|
#http://www.openstreetmap.org/#map=18/52.56251/13.32650
|
||||||
@todo
|
|
||||||
Scenario: Curved Turn on Separated Directions
|
Scenario: Curved Turn on Separated Directions
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e d
|
e d
|
||||||
f c - - - - - - - - - - - j
|
f - - - - - - - - - - - - - - - c - - - - - - - - - - - j
|
||||||
| l ' |
|
| l ' |
|
||||||
| ' |
|
| ' |
|
||||||
| ' |
|
| ' |
|
||||||
@@ -682,58 +680,6 @@ Feature: Simple Turns
|
|||||||
| j,o | Kapweg,Kapweg,Kapweg | depart,continue uturn,arrive |
|
| j,o | Kapweg,Kapweg,Kapweg | depart,continue uturn,arrive |
|
||||||
| a,i | Kurt,Kurt,Kurt | depart,continue uturn,arrive |
|
| a,i | Kurt,Kurt,Kurt | depart,continue uturn,arrive |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=18/52.56251/13.32650
|
|
||||||
Scenario: Curved Turn on Separated Directions
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
e d
|
|
||||||
f c - - - - - - - - - - - j
|
|
||||||
| l ' |
|
|
||||||
| ' |
|
|
||||||
| ' |
|
|
||||||
| ' |
|
|
||||||
| ' |
|
|
||||||
| n |
|
|
||||||
| |
|
|
||||||
| ' |
|
|
||||||
| |
|
|
||||||
| ' |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
|' |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
g |
|
|
||||||
h - - - - - - - - - - - - - - - b - - - - - - - - - - - o
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
i a
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway | lanes | highway |
|
|
||||||
| jc | Kapweg | yes | 3 | primary |
|
|
||||||
| clngh | Kapweg | yes | | primary_link |
|
|
||||||
| hbo | Kapweg | yes | 2 | primary |
|
|
||||||
| efh | Kurt | yes | 4 | secondary |
|
|
||||||
| hi | Kurt | yes | 3 | primary |
|
|
||||||
| ab | Kurt | yes | 4 | primary |
|
|
||||||
| cd | Kurt | yes | 3 | secondary |
|
|
||||||
| bc | Kurt | yes | 2 | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| j,i | Kapweg,Kurt,Kurt | depart,turn left,arrive |
|
|
||||||
| j,o | Kapweg,Kapweg,Kapweg | depart,continue uturn,arrive |
|
|
||||||
| a,i | Kurt,Kurt,Kurt | depart,continue uturn,arrive |
|
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/52.53731/13.36033
|
#http://www.openstreetmap.org/#map=19/52.53731/13.36033
|
||||||
Scenario: Splitting Road to Left
|
Scenario: Splitting Road to Left
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -768,31 +714,7 @@ Feature: Simple Turns
|
|||||||
|
|
||||||
. .
|
. .
|
||||||
|
|
||||||
. .
|
g h
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
. .
|
|
||||||
|
|
||||||
g h
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the nodes
|
And the nodes
|
||||||
@@ -808,15 +730,15 @@ Feature: Simple Turns
|
|||||||
| cjk | Friede | no | | tertiary |
|
| cjk | Friede | no | | tertiary |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | intersections |
|
| waypoints | route | turns |
|
||||||
| a,g | Perle,Heide,Heide | depart,turn right,arrive | true:90;true:90 true:180 false:270 true:345;true:18 |
|
| a,g | Perle,Heide,Heide | depart,turn right,arrive |
|
||||||
| a,k | Perle,Friede,Friede | depart,turn left,arrive | true:90;true:90 true:180 false:270 true:345;true:153 |
|
| a,k | Perle,Friede,Friede | depart,turn left,arrive |
|
||||||
| a,e | Perle,Perle | depart,arrive | true:90,true:90 true:180 false:270 true:345;true:270 |
|
| a,e | Perle,Perle | depart,arrive |
|
||||||
| e,k | Perle,Friede,Friede | depart,turn right,arrive | true:270;false:90 true:180 true:270 true:345;true:153 |
|
| e,k | Perle,Friede,Friede | depart,turn right,arrive |
|
||||||
| e,g | Perle,Heide,Heide | depart,turn left,arrive | true:270;false:90 true:180 true:270 true:345;true:18 |
|
| e,g | Perle,Heide,Heide | depart,turn left,arrive |
|
||||||
| h,k | Heide,Friede,Friede | depart,new name straight,arrive | true:16;true:90 true:180 true:270 true:345;true:153 |
|
| h,k | Heide,Friede,Friede | depart,new name slight left,arrive |
|
||||||
| h,e | Heide,Perle,Perle | depart,turn right,arrive | true:16;true:90 true:180 true:270 true:345;true:270 |
|
| h,e | Heide,Perle,Perle | depart,turn right,arrive |
|
||||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:180 true:270 true:345;true:90 |
|
| h,a | Heide,Perle,Perle | depart,turn left,arrive |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
||||||
Scenario: Curved Exit from Curved Road
|
Scenario: Curved Exit from Curved Road
|
||||||
@@ -853,7 +775,7 @@ Feature: Simple Turns
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
|
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
|
||||||
| a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
|
| a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
|
||||||
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
|
| g,j | Erna,Siemens,Siemens | depart,turn sharp left,arrive |
|
||||||
| g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |
|
| g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/52.51303/13.32170
|
#http://www.openstreetmap.org/#map=19/52.51303/13.32170
|
||||||
@@ -954,36 +876,6 @@ Feature: Simple Turns
|
|||||||
. . .
|
. . .
|
||||||
. . .
|
. . .
|
||||||
i . .
|
i . .
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
e a
|
e a
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -1220,9 +1112,8 @@ Feature: Simple Turns
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | lanes | oneway |
|
| nodes | name | highway | lanes |
|
||||||
| abc | circled | residential | 1 | no |
|
| abcdefghijklmnopc | circled | residential | 1 |
|
||||||
| cdefghijklmnopc | circled | residential | 1 | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | bearings | route | turns |
|
| waypoints | bearings | route | turns |
|
||||||
@@ -1277,97 +1168,3 @@ Feature: Simple Turns
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route |
|
| waypoints | route |
|
||||||
| a,e | ab,bcde,bcde |
|
| a,e | ab,bcde,bcde |
|
||||||
|
|
||||||
|
|
||||||
@3401
|
|
||||||
Scenario: Curve With Duplicated Coordinates
|
|
||||||
Given the node locations
|
|
||||||
| node | lat | lon | # |
|
|
||||||
| a | 0.9999280745650984 | 1.0 | |
|
|
||||||
| b | 0.9999280745650984 | 1.0000179813587253 | |
|
|
||||||
| c | 0.9999280745650984 | 1.0000359627174509 | |
|
|
||||||
| d | 0.9999460559238238 | 1.0000674300952204 | |
|
|
||||||
| e | 0.9999640372825492 | 1.0000809161142643 | |
|
|
||||||
| f | 0.9999820186412746 | 1.0000854114539457 | |
|
|
||||||
| g | 1.0 | 1.0000854114539457 | |
|
|
||||||
| h | 1.0 | 1.0000854114539457 | #same as g |
|
|
||||||
| z | 0.9999100932063729 | 1.0000179813587253 | |
|
|
||||||
# g
|
|
||||||
# |
|
|
||||||
# f
|
|
||||||
# '
|
|
||||||
# e
|
|
||||||
# '
|
|
||||||
# d
|
|
||||||
# '
|
|
||||||
#a - b - c
|
|
||||||
# |
|
|
||||||
# z
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway | lanes | # |
|
|
||||||
| ab | yes | 1 | |
|
|
||||||
| zb | yes | 1 | |
|
|
||||||
| bcdefgh | yes | 1 | #intentional duplication |
|
|
||||||
|
|
||||||
# we don't care for turn instructions, this is a coordinate extraction bug check
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | intersections |
|
|
||||||
| a,g | ab,bcdefgh,bcdefgh | true:90;true:45 false:180 false:270;true:180 |
|
|
||||||
|
|
||||||
#https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580
|
|
||||||
Scenario: Oszillating Lower Priority Road
|
|
||||||
#Given the node map
|
|
||||||
# """
|
|
||||||
# a -db c
|
|
||||||
# f
|
|
||||||
# """
|
|
||||||
Given the node locations
|
|
||||||
| node | lat | lon | # |
|
|
||||||
| a | 1.0 | 1.0 | |
|
|
||||||
| b | 1.0000179813587253 | 1.0 | |
|
|
||||||
| c | 1.0000204580571323 | 1.0 | |
|
|
||||||
| d | 1.0000179813587253 | 1.0 | same as b |
|
|
||||||
| f | 1.0000179813587253 | 1.0000179813587253 | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway | lanes | highway |
|
|
||||||
| ab | yes | 1 | primary |
|
|
||||||
| bf | yes | 1 | primary |
|
|
||||||
| bcd | yes | 1 | service |
|
|
||||||
|
|
||||||
# we don't care for turn instructions, this is a coordinate extraction bug check
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route |
|
|
||||||
| a,d | ab,ab |
|
|
||||||
|
|
||||||
Scenario: Sharp Turn Onto A Bridge
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
e
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
ga - - -b
|
|
||||||
f /
|
|
||||||
d -c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway | lanes |
|
|
||||||
| gaf | yes | 1 |
|
|
||||||
| abcde | yes | 1 |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route |
|
|
||||||
| g,e | abcde,abcde |
|
|
||||||
|
|||||||
@@ -44,27 +44,6 @@ Feature: Turn Lane Guidance
|
|||||||
| a,c | in,straight,straight | depart,new name straight,arrive | ,straight:true right:false, |
|
| a,c | in,straight,straight | depart,new name straight,arrive | ,straight:true right:false, |
|
||||||
| a,d | in,right,right | depart,turn right,arrive | ,straight:false right:true, |
|
| a,d | in,right,right | depart,turn right,arrive | ,straight:false right:true, |
|
||||||
|
|
||||||
# Turn Lane onto a ferry could end up breaking in intersection generation
|
|
||||||
Scenario: Basic Turn Lane 3-way Turn with designated lane
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - b ~ ~ c - e
|
|
||||||
| |
|
|
||||||
d f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | turn:lanes:forward | name | route |
|
|
||||||
| ab | through\|through\|right | ferry-route | |
|
|
||||||
| bc | through\|through\|right | ferry-route | ferry |
|
|
||||||
| ce | | ferry-route | |
|
|
||||||
| bd | | right | |
|
|
||||||
| cf | | right | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ferry-route,ferry-route,ferry-route,ferry-route | depart,notification straight,notification straight,arrive |
|
|
||||||
|
|
||||||
@simple
|
@simple
|
||||||
Scenario: Basic Turn Lane 4-Way Turn
|
Scenario: Basic Turn Lane 4-Way Turn
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -116,25 +95,24 @@ Feature: Turn Lane Guidance
|
|||||||
Scenario: Basic Turn Lane 4-Way With U-Turn Lane
|
Scenario: Basic Turn Lane 4-Way With U-Turn Lane
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
f a-1-b---c
|
a 1 b c
|
||||||
d
|
d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | turn:lanes | turn:lanes:forward | name | # |
|
| nodes | turn:lanes | turn:lanes:forward | name |
|
||||||
| ab | | reverse;left\|through;right | in | |
|
| ab | | reverse;left\|through;right | in |
|
||||||
| bc | | | straight | |
|
| bc | | | straight |
|
||||||
| bd | | | right | |
|
| bd | | | right |
|
||||||
| be | | | left | |
|
| be | | | left |
|
||||||
| fa | | | uturn-avoider | #due to https://github.com/Project-OSRM/osrm-backend/issues/3359 |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | turns | lanes | locations |
|
| from | to | bearings | route | turns | lanes |
|
||||||
| a | c | 180,180 180,180 | in,straight,straight | depart,new name straight,arrive | ,left;uturn:false straight;right:true, | a,b,c |
|
| a | c | 180,180 180,180 | in,straight,straight | depart,new name straight,arrive | ,left;uturn:false straight;right:true, |
|
||||||
| a | d | 180,180 180,180 | in,right,right | depart,turn right,arrive | ,left;uturn:false straight;right:true, | a,b,d |
|
| a | d | 180,180 180,180 | in,right,right | depart,turn right,arrive | ,left;uturn:false straight;right:true, |
|
||||||
| a | e | 180,180 180,180 | in,left,left | depart,turn left,arrive | ,left;uturn:true straight;right:false, | a,b,e |
|
| a | e | 180,180 180,180 | in,left,left | depart,turn left,arrive | ,left;uturn:true straight;right:false, |
|
||||||
| 1 | a | 90,2 270,2 | in,in,in | depart,turn uturn,arrive | ,left;uturn:true straight;right:false, | _,b,a |
|
| 1 | a | 90,2 270,2 | in,in,in | depart,turn uturn,arrive | ,left;uturn:true straight;right:false, |
|
||||||
|
|
||||||
|
|
||||||
#this next test requires decision on how to announce lanes for going straight if there is no turn
|
#this next test requires decision on how to announce lanes for going straight if there is no turn
|
||||||
@@ -599,21 +577,22 @@ Feature: Turn Lane Guidance
|
|||||||
Scenario: Segregated Intersection Merges With Lanes
|
Scenario: Segregated Intersection Merges With Lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a e
|
f
|
||||||
| |
|
|
||||||
| |
|
e d
|
||||||
b d
|
c g
|
||||||
h c
|
a b
|
||||||
' -- g - - f
|
|
||||||
|
h
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | turn:lanes:forward | oneway | highway | lanes |
|
| nodes | name | turn:lanes:forward | oneway | highway |
|
||||||
| abc | road | left\|left\|left\|through\|through | yes | primary | 5 |
|
| abc | road | left\|left\|left\|through\|through | yes | primary |
|
||||||
| cde | road | | yes | primary | 3 |
|
| cde | road | | yes | primary |
|
||||||
| hc | cross | | yes | secondary | |
|
| hc | cross | | yes | secondary |
|
||||||
| cg | straight | | no | tertiary | |
|
| cg | straight | | no | tertiary |
|
||||||
| cf | left | | yes | primary | |
|
| cf | left | | yes | primary |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
@@ -1158,45 +1137,3 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | bearings | route | turns |
|
| waypoints | bearings | route | turns |
|
||||||
| 1,a | 90,2 180,180 | | |
|
| 1,a | 90,2 180,180 | | |
|
||||||
|
|
||||||
@3379
|
|
||||||
Scenario: Don't Turn through potential through lanes
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
|
|
|
||||||
a - - - - b - - - - - c
|
|
||||||
|
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway | turn:lanes:forward |
|
|
||||||
| ab | road | yes | left\|none\|none |
|
|
||||||
| bc | road | yes | |
|
|
||||||
| ebd | cross | no | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | lanes |
|
|
||||||
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
|
|
||||||
| a,c | road,road | depart,arrive | , |
|
|
||||||
|
|
||||||
@3379
|
|
||||||
Scenario: Don't Turn through potential through lanes
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
|
|
|
||||||
a - - - - b - - - - - c
|
|
||||||
|
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway | turn:lanes:forward |
|
|
||||||
| ab | road | yes | none\|none\|right |
|
|
||||||
| bc | road | yes | |
|
|
||||||
| ebd | cross | no | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | lanes |
|
|
||||||
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
|
|
||||||
| a,c | road,road | depart,arrive | , |
|
|
||||||
|
|||||||
+150
-35
@@ -278,6 +278,52 @@ Feature: Simple Turns
|
|||||||
| x | z | xy,yz,yz | depart,turn right,arrive |
|
| x | z | xy,yz,yz | depart,turn right,arrive |
|
||||||
| z | x | yz,xy,xy | depart,turn left,arrive |
|
| z | x | yz,xy,xy | depart,turn left,arrive |
|
||||||
|
|
||||||
|
Scenario: Four Way Intersection Double Through Street Segregated
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
q p
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
b c
|
||||||
|
j i d o
|
||||||
|
a
|
||||||
|
k h e n
|
||||||
|
g f
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
l m
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway | name |
|
||||||
|
| khaij | primary | yes | first |
|
||||||
|
| odaen | primary | yes | first |
|
||||||
|
| qbacp | primary | yes | second |
|
||||||
|
| mfagl | primary | yes | second |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| f,e | second,first,first | depart,turn right,arrive |
|
||||||
|
| f,c | second,second | depart,arrive |
|
||||||
|
| f,i | second,first,first | depart,turn left,arrive |
|
||||||
|
| f,g | second,second,second | depart,continue uturn,arrive |
|
||||||
|
| d,c | first,second,second | depart,turn right,arrive |
|
||||||
|
| d,i | first,first | depart,arrive |
|
||||||
|
| d,g | first,second,second | depart,turn left,arrive |
|
||||||
|
| d,e | first,first,first | depart,continue uturn,arrive |
|
||||||
|
| b,i | second,first,first | depart,turn right,arrive |
|
||||||
|
| b,g | second,second | depart,arrive |
|
||||||
|
| b,e | second,first,first | depart,turn left,arrive |
|
||||||
|
| b,c | second,second,second | depart,continue uturn,arrive |
|
||||||
|
| h,g | first,second,second | depart,turn right,arrive |
|
||||||
|
| h,e | first,first | depart,arrive |
|
||||||
|
| h,c | first,second,second | depart,turn left,arrive |
|
||||||
|
| h,i | first,first,first | depart,continue uturn,arrive |
|
||||||
|
|
||||||
Scenario: Three Way Similar Sharp Turns
|
Scenario: Three Way Similar Sharp Turns
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -1034,13 +1080,107 @@ Feature: Simple Turns
|
|||||||
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||||
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||||
|
|
||||||
|
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||||
|
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||||
|
Scenario: Collapse Turn Instruction, Issue #2725
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
f
|
||||||
|
e
|
||||||
|
|
||||||
|
|
||||||
|
g d
|
||||||
|
|
||||||
|
|
||||||
|
h c
|
||||||
|
|
||||||
|
|
||||||
|
b
|
||||||
|
a
|
||||||
|
|
||||||
|
|
||||||
|
r x s
|
||||||
|
y
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| ab | Hermannstr | secondary | |
|
||||||
|
| bc | Hermannstr | secondary | yes |
|
||||||
|
| cd | Hermannbruecke | secondary | yes |
|
||||||
|
| de | Hermannstr | secondary | yes |
|
||||||
|
| ef | Hermannstr | secondary | |
|
||||||
|
| eg | Hermannstr | secondary | yes |
|
||||||
|
| gh | Hermannbruecke | secondary | yes |
|
||||||
|
| hb | Hermannstr | secondary | yes |
|
||||||
|
| xa | Hermannstr | secondary | |
|
||||||
|
| yx | Hermannstr | secondary | |
|
||||||
|
| rxs | Silbersteinstr | tertiary | |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| x | traffic_signals |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
|
||||||
|
Scenario: Collapse Turn Instruction, Issue #2725 - not trivially mergable at e
|
||||||
|
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||||
|
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
f
|
||||||
|
e
|
||||||
|
g d
|
||||||
|
|
||||||
|
|
||||||
|
h c
|
||||||
|
|
||||||
|
|
||||||
|
b
|
||||||
|
a
|
||||||
|
|
||||||
|
|
||||||
|
r x s
|
||||||
|
y
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| ab | Hermannstr | secondary | |
|
||||||
|
| bc | Hermannstr | secondary | yes |
|
||||||
|
| cd | Hermannbruecke | secondary | yes |
|
||||||
|
| de | Hermannstr | secondary | yes |
|
||||||
|
| ef | Hermannstr | secondary | |
|
||||||
|
| eg | Hermannstr | secondary | yes |
|
||||||
|
| gh | Hermannbruecke | secondary | yes |
|
||||||
|
| hb | Hermannstr | secondary | yes |
|
||||||
|
| xa | Hermannstr | secondary | |
|
||||||
|
| yx | Hermannstr | secondary | |
|
||||||
|
| rxs | Silbersteinstr | tertiary | |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| x | traffic_signals |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||||
|
|
||||||
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291
|
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291
|
||||||
@3002
|
@3002
|
||||||
Scenario: Obvious Index wigh very narrow turn to the right
|
Scenario: Obvious Index wigh very narrow turn to the right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a - b -.-.- - - c
|
a b c
|
||||||
' ' 'd
|
d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -1058,8 +1198,8 @@ Feature: Simple Turns
|
|||||||
Scenario: Obvious Index wigh very narrow turn to the right
|
Scenario: Obvious Index wigh very narrow turn to the right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a - b - . -.- - c
|
a b c
|
||||||
e - -'-'d-f
|
e d f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -1078,8 +1218,8 @@ Feature: Simple Turns
|
|||||||
Scenario: Obvious Index wigh very narrow turn to the left
|
Scenario: Obvious Index wigh very narrow turn to the left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
. . .d
|
d
|
||||||
a - b -'-'- - - c
|
a b c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -1097,8 +1237,8 @@ Feature: Simple Turns
|
|||||||
Scenario: Obvious Index wigh very narrow turn to the left
|
Scenario: Obvious Index wigh very narrow turn to the left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e - -.- d-f
|
e d f
|
||||||
a - b - ' - - - c
|
a b c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -1233,30 +1373,5 @@ Feature: Simple Turns
|
|||||||
| kchm | Alexanderstr | primary | yes |
|
| kchm | Alexanderstr | primary | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route |
|
| waypoints | turns | route |
|
||||||
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |
|
| a,d | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/49.48761/8.47618
|
|
||||||
@todo @3365
|
|
||||||
Scenario: Turning Road - Segregated
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f d
|
|
||||||
| |
|
|
||||||
a - - - b - c
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
g e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | name | ref | oneway |
|
|
||||||
| ab | Goethe | B 38 | yes |
|
|
||||||
| bc | | B 38 | yes |
|
|
||||||
| ec | Fried | | yes |
|
|
||||||
| cd | Fried | B 38 | yes |
|
|
||||||
| fbg | Fried | | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | Goethe,Fried,Fried | depart,continue left,arrive |
|
|
||||||
| a,g | Goethe,Fried,Fried | depart,turn right,arrive |
|
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ class OSRMBaseLoader{
|
|||||||
|
|
||||||
osrmDown (callback) {
|
osrmDown (callback) {
|
||||||
if (this.osrmIsRunning()) {
|
if (this.osrmIsRunning()) {
|
||||||
this.child.on('exit', (code, signal) => { callback();});
|
this.child.on('exit', (code, signal) => {callback();});
|
||||||
this.child.kill('SIGINT');
|
this.child.kill();
|
||||||
} else callback();
|
} else callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,10 +78,9 @@ class OSRMDirectLoader extends OSRMBaseLoader {
|
|||||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||||
|
|
||||||
this.child = this.scope.runBin('osrm-routed', util.format("%s -p %d", this.inputFile, this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
this.child = this.scope.runBin('osrm-routed', util.format("%s -p %d", this.inputFile, this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
||||||
if (err && err.signal !== 'SIGINT') {
|
if (err) {
|
||||||
this.child = null;
|
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
@@ -116,8 +115,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
|||||||
if (this.osrmIsRunning()) return callback();
|
if (this.osrmIsRunning()) return callback();
|
||||||
|
|
||||||
this.child = this.scope.runBin('osrm-routed', util.format('--shared-memory=1 -p %d', this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
this.child = this.scope.runBin('osrm-routed', util.format('--shared-memory=1 -p %d', this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
||||||
if (err && err.signal !== 'SIGINT') {
|
if (err) {
|
||||||
this.child = null;
|
|
||||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+34
-103
@@ -7,117 +7,48 @@ var chalk = require('chalk');
|
|||||||
|
|
||||||
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
|
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
|
||||||
|
|
||||||
String.prototype.padLeft = function(char, length) {
|
|
||||||
return char.repeat(Math.max(0, length - this.length)) + this;
|
|
||||||
}
|
|
||||||
|
|
||||||
String.prototype.padRight = function(char, length) {
|
|
||||||
return this + char.repeat(Math.max(0, length - this.length));
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = function (expected, actual) {
|
module.exports = function (expected, actual) {
|
||||||
let headers = expected.raw()[0];
|
let headers = expected.raw()[0];
|
||||||
let expectedRows = expected.hashes();
|
let expected_keys = expected.hashes();
|
||||||
let tableError = false;
|
let diff = [];
|
||||||
let statusRows = [];
|
let hasErrors = false;
|
||||||
let columnStatus = {}
|
|
||||||
|
|
||||||
expectedRows.forEach((expectedRow, i) => {
|
var good = 0, bad = 0;
|
||||||
|
|
||||||
|
expected_keys.forEach((row, i) => {
|
||||||
var rowError = false;
|
var rowError = false;
|
||||||
statusRows[i] = {};
|
|
||||||
var statusRow = statusRows[i];
|
for (var j in row) {
|
||||||
for (var key in expectedRow) {
|
if (unescapeStr(row[j]) != actual[i][j]) {
|
||||||
var actualRow = actual[i]
|
rowError = true;
|
||||||
var row
|
hasErrors = true;
|
||||||
if (unescapeStr(expectedRow[key]) != actualRow[key]) {
|
break;
|
||||||
statusRow[key] = false;
|
|
||||||
tableError = true;
|
|
||||||
columnStatus[key] = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (!tableError) return null;
|
|
||||||
|
|
||||||
|
|
||||||
// determine column widths
|
|
||||||
var widths = {};
|
|
||||||
var wantStr = '(-) ';
|
|
||||||
var gotStr = '(+) ';
|
|
||||||
var okStr = ' ';
|
|
||||||
|
|
||||||
headers.forEach( (key) => {
|
|
||||||
widths[key] = key.length;
|
|
||||||
});
|
|
||||||
|
|
||||||
expectedRows.forEach((row,i) => {
|
|
||||||
var cells = []
|
|
||||||
headers.forEach( (key) => {
|
|
||||||
var content = row[key]
|
|
||||||
var length = content.length;
|
|
||||||
if(widths[key]==null || length > widths[key])
|
|
||||||
widths[key] = length;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// format
|
|
||||||
var lines = [chalk.red('Tables were not identical:')];
|
|
||||||
var cells;
|
|
||||||
|
|
||||||
// header row
|
|
||||||
cells = []
|
|
||||||
headers.forEach( (key) => {
|
|
||||||
var content = key.padRight(' ', widths[key] );
|
|
||||||
if (columnStatus[key] == false )
|
|
||||||
content = okStr + content;
|
|
||||||
cells.push( chalk.white( content ) );
|
|
||||||
});
|
|
||||||
lines.push( '| ' + cells.join(' | ') + ' |');
|
|
||||||
|
|
||||||
// content rows
|
|
||||||
expectedRows.forEach((row,i) => {
|
|
||||||
var cells;
|
|
||||||
var rowError = Object.keys(statusRows[i]).length > 0;
|
|
||||||
|
|
||||||
// expected row
|
|
||||||
cells = []
|
|
||||||
headers.forEach( (key) => {
|
|
||||||
var content = row[key].padRight(' ', widths[key] );
|
|
||||||
if (statusRows[i][key] == false)
|
|
||||||
cells.push( chalk.yellow( wantStr + content) );
|
|
||||||
else {
|
|
||||||
if (rowError) {
|
|
||||||
if (columnStatus[key]==false)
|
|
||||||
content = okStr + content
|
|
||||||
cells.push( chalk.yellow( content) );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (columnStatus[key]==false)
|
|
||||||
content = okStr + content
|
|
||||||
cells.push( chalk.green( content) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lines.push('| ' + cells.join(' | ') + ' |');
|
|
||||||
|
|
||||||
// if error in row, insert extra row showing actual result
|
|
||||||
if (rowError) {
|
if (rowError) {
|
||||||
cells = []
|
bad++;
|
||||||
headers.forEach( (key) => {
|
diff.push(Object.assign({}, row, {c_status: 'undefined'}));
|
||||||
var content = actual[i][key].padRight(' ', widths[key] );
|
diff.push(Object.assign({}, actual[i], {c_status: 'comment'}));
|
||||||
if (statusRows[i][key] == false)
|
} else {
|
||||||
cells.push( chalk.red( gotStr + content) );
|
good++;
|
||||||
else {
|
diff.push(row);
|
||||||
if (columnStatus[key]==false)
|
|
||||||
cells.push( chalk.red( okStr + content) );
|
|
||||||
else
|
|
||||||
cells.push( chalk.red( content) );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
lines.push('| ' + cells.join(' | ') + ' |');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return lines.join('\n');
|
|
||||||
|
if (!hasErrors) return null;
|
||||||
|
|
||||||
|
var s = ['Tables were not identical:'];
|
||||||
|
s.push(headers.map(key => ' ' + key).join(' | '));
|
||||||
|
diff.forEach((row) => {
|
||||||
|
var rowString = '| ';
|
||||||
|
headers.forEach((header) => {
|
||||||
|
if (!row.c_status) rowString += chalk.green(' ' + row[header] + ' | ');
|
||||||
|
else if (row.c_status === 'undefined') rowString += chalk.yellow('(-) ' + row[header] + ' | ');
|
||||||
|
else rowString += chalk.red('(+) ' + row[header] + ' | ');
|
||||||
|
});
|
||||||
|
s.push(rowString);
|
||||||
|
});
|
||||||
|
|
||||||
|
return s.join('\n') + '\nTODO this is a temp workaround waiting for https://github.com/cucumber/cucumber-js/issues/534';
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = {
|
|||||||
|
|
||||||
errorReason: (err) => {
|
errorReason: (err) => {
|
||||||
return err.signal ?
|
return err.signal ?
|
||||||
'killed by signal ' + err.signal :
|
util.format('killed by signal %s', err.signal) :
|
||||||
'exited with code ' + err.code;
|
util.format('exited with code %d', err.code);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,11 +28,3 @@ Feature: osrm-contract command line options: datasources
|
|||||||
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||||
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
|
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
|
||||||
And it should exit successfully
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-contract - Passing base file
|
|
||||||
Given the speed file
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
And the data has been extracted
|
|
||||||
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Feature: osrm-contract command line options: help
|
|||||||
Scenario: osrm-contract - Help should be shown when no options are passed
|
Scenario: osrm-contract - Help should be shown when no options are passed
|
||||||
When I try to run "osrm-contract"
|
When I try to run "osrm-contract"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -18,7 +18,7 @@ Feature: osrm-contract command line options: help
|
|||||||
Scenario: osrm-contract - Help, short
|
Scenario: osrm-contract - Help, short
|
||||||
When I run "osrm-contract -h"
|
When I run "osrm-contract -h"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -32,7 +32,7 @@ Feature: osrm-contract command line options: help
|
|||||||
Scenario: osrm-contract - Help, long
|
Scenario: osrm-contract - Help, long
|
||||||
When I run "osrm-contract --help"
|
When I run "osrm-contract --help"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
|
|||||||
@@ -3,14 +3,6 @@ Feature: osrm-contract command line options: invalid options
|
|||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been extracted
|
|
||||||
|
|
||||||
Scenario: osrm-contract - Non-existing option
|
Scenario: osrm-contract - Non-existing option
|
||||||
When I try to run "osrm-contract --fly-me-to-the-moon"
|
When I try to run "osrm-contract --fly-me-to-the-moon"
|
||||||
@@ -18,11 +10,3 @@ Feature: osrm-contract command line options: invalid options
|
|||||||
And stderr should contain "option"
|
And stderr should contain "option"
|
||||||
And stderr should contain "fly-me-to-the-moon"
|
And stderr should contain "fly-me-to-the-moon"
|
||||||
And it should exit with an error
|
And it should exit with an error
|
||||||
|
|
||||||
# This tests the error messages when you try to use --segment-speed-file,
|
|
||||||
# but osrm-extract has not been run with --generate-edge-lookup
|
|
||||||
Scenario: osrm-contract - Someone forgot --generate-edge-lookup on osrm-extract
|
|
||||||
When I try to run "osrm-contract --segment-speed-file /dev/null {processed_file}"
|
|
||||||
Then stderr should contain "Error while trying to mmap"
|
|
||||||
Then stderr should contain ".osrm.turn_penalties_index"
|
|
||||||
And it should exit with an error
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Feature: osrm-extract command line options: help
|
|||||||
Scenario: osrm-extract - Help should be shown when no options are passed
|
Scenario: osrm-extract - Help should be shown when no options are passed
|
||||||
When I run "osrm-extract"
|
When I run "osrm-extract"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -21,7 +21,7 @@ Feature: osrm-extract command line options: help
|
|||||||
Scenario: osrm-extract - Help, short
|
Scenario: osrm-extract - Help, short
|
||||||
When I run "osrm-extract -h"
|
When I run "osrm-extract -h"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -35,7 +35,7 @@ Feature: osrm-extract command line options: help
|
|||||||
Scenario: osrm-extract - Help, long
|
Scenario: osrm-extract - Help, long
|
||||||
When I run "osrm-extract --help"
|
When I run "osrm-extract --help"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
@extract
|
|
||||||
Feature: osrm-extract lua ways:get_nodes()
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
Scenario: osrm-extract - Passing base file
|
|
||||||
Given the profile file "testbot" extended with
|
|
||||||
"""
|
|
||||||
function way_function(way, result)
|
|
||||||
for _, node in ipairs(way:get_nodes()) do
|
|
||||||
print('node id ' .. node:id())
|
|
||||||
end
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.forward_speed = 1
|
|
||||||
end
|
|
||||||
"""
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "node id 1"
|
|
||||||
And stdout should contain "node id 2"
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
Feature: Profile API version 0
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given a grid size of 100 meters
|
|
||||||
|
|
||||||
Scenario: Not-defined API version
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
function way_function(way, result)
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.forward_speed = 1
|
|
||||||
end
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
ab
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I try to run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stderr should not contain "Invalid profile API version"
|
|
||||||
|
|
||||||
Scenario: Out-bound API version
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
api_version = 2
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
ab
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I try to run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit with an error
|
|
||||||
And stderr should contain "Invalid profile API version"
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Basic profile function calls and property values
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
api_version = 0
|
|
||||||
|
|
||||||
-- set profile properties
|
|
||||||
properties.u_turn_penalty = 20
|
|
||||||
properties.traffic_signal_penalty = 2
|
|
||||||
properties.max_speed_for_map_matching = 180/3.6
|
|
||||||
properties.use_turn_restrictions = true
|
|
||||||
properties.continue_straight_at_waypoint = true
|
|
||||||
properties.left_hand_driving = false
|
|
||||||
properties.weight_name = 'duration'
|
|
||||||
|
|
||||||
function node_function (node, result)
|
|
||||||
print ('node_function ' .. node:id())
|
|
||||||
end
|
|
||||||
|
|
||||||
function way_function(way, result)
|
|
||||||
result.name = way:get_value_by_key('name')
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.backward_mode = mode.driving
|
|
||||||
result.forward_speed = 36
|
|
||||||
result.backward_speed = 36
|
|
||||||
print ('way_function ' .. way:id() .. ' ' .. result.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
function turn_function (angle)
|
|
||||||
print('turn_function ' .. angle)
|
|
||||||
return angle == 0 and 0 or 42
|
|
||||||
end
|
|
||||||
|
|
||||||
function segment_function (source, target, distance, weight)
|
|
||||||
print ('segment_function ' .. source.lon .. ' ' .. source.lat)
|
|
||||||
end
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b c d
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ac |
|
|
||||||
| cb |
|
|
||||||
| cd |
|
|
||||||
| ce |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "node_function"
|
|
||||||
And stdout should contain "way_function"
|
|
||||||
And stdout should contain "turn_function"
|
|
||||||
And stdout should contain "segment_function"
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | time |
|
|
||||||
| a | b | ac,cb,cb | 24.2s |
|
|
||||||
| a | d | ac,cd,cd | 24.2s |
|
|
||||||
| a | e | ac,ce,ce | 20s |
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
Feature: Profile API version 1
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given a grid size of 100 meters
|
|
||||||
|
|
||||||
Scenario: Basic profile function calls and property values
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
api_version = 1
|
|
||||||
|
|
||||||
-- set profile properties
|
|
||||||
properties.max_speed_for_map_matching = 180/3.6
|
|
||||||
properties.use_turn_restrictions = true
|
|
||||||
properties.continue_straight_at_waypoint = true
|
|
||||||
properties.weight_name = 'test_version1'
|
|
||||||
|
|
||||||
function node_function (node, result)
|
|
||||||
print ('node_function ' .. node:id())
|
|
||||||
end
|
|
||||||
|
|
||||||
function way_function(way, result)
|
|
||||||
result.name = way:get_value_by_key('name')
|
|
||||||
result.weight = 10
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.backward_mode = mode.driving
|
|
||||||
result.forward_speed = 36
|
|
||||||
result.backward_speed = 36
|
|
||||||
print ('way_function ' .. way:id() .. ' ' .. result.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
function turn_function (turn)
|
|
||||||
print('turn_function', turn.angle, turn.turn_type, turn.direction_modifier, turn.has_traffic_light)
|
|
||||||
turn.weight = turn.angle == 0 and 0 or 4.2
|
|
||||||
turn.duration = turn.weight
|
|
||||||
end
|
|
||||||
|
|
||||||
function segment_function (segment)
|
|
||||||
print ('segment_function ' .. segment.source.lon .. ' ' .. segment.source.lat)
|
|
||||||
end
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
bcd
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ac |
|
|
||||||
| cb |
|
|
||||||
| cd |
|
|
||||||
| ce |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "node_function"
|
|
||||||
And stdout should contain "way_function"
|
|
||||||
And stdout should contain "turn_function"
|
|
||||||
And stdout should contain "segment_function"
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | time |
|
|
||||||
| a | b | ac,cb,cb | 19.2s |
|
|
||||||
| a | d | ac,cd,cd | 19.2s |
|
|
||||||
| a | e | ac,ce,ce | 20s |
|
|
||||||
@@ -7,7 +7,7 @@ Feature: osrm-routed command line options: help
|
|||||||
Scenario: osrm-routed - Help should be shown when no options are passed
|
Scenario: osrm-routed - Help should be shown when no options are passed
|
||||||
When I run "osrm-routed"
|
When I run "osrm-routed"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -26,7 +26,7 @@ Feature: osrm-routed command line options: help
|
|||||||
Scenario: osrm-routed - Help, short
|
Scenario: osrm-routed - Help, short
|
||||||
When I run "osrm-routed -h"
|
When I run "osrm-routed -h"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -45,7 +45,7 @@ Feature: osrm-routed command line options: help
|
|||||||
Scenario: osrm-routed - Help, long
|
Scenario: osrm-routed - Help, long
|
||||||
When I run "osrm-routed --help"
|
When I run "osrm-routed --help"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
|
|||||||
@@ -239,15 +239,13 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the profile file(?: "([^"]*)" extended with)?$/, (profile, data, callback) => {
|
this.Given(/^the profile file(?: "([^"]*)" extended with)?$/, (profile, data, callback) => {
|
||||||
const lua_profiles_path = this.PROFILES_PATH.split(path.sep).join('/');
|
let text = 'package.path = "' + this.PROFILES_PATH + '/?.lua;" .. package.path\n';
|
||||||
let text = 'package.path = "' + lua_profiles_path + '/?.lua;" .. package.path\n';
|
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
text += data + '\n';
|
text += data + '\n';
|
||||||
} else {
|
} else {
|
||||||
text += 'local f = assert(io.open("' + lua_profiles_path + '/' + profile + '.lua", "r"))\n';
|
text += 'local f = assert(io.open("' + this.PROFILES_PATH + '/' + profile + '.lua", "r"))\n';
|
||||||
text += 'local s = f:read("*all") .. [[\n' + data + '\n]]\n';
|
text += 'local m = assert(loadstring(f:read("*all") .. [[\n' + data + '\n]]))\n';
|
||||||
text += 'f:close()\n';
|
text += 'f:close()\n';
|
||||||
text += 'local m = assert(loadstring and loadstring(s) or load(s))\n';
|
|
||||||
text += 'm()\n';
|
text += 'm()\n';
|
||||||
}
|
}
|
||||||
this.profileFile = this.profileCacheFile;
|
this.profileFile = this.profileCacheFile;
|
||||||
|
|||||||
@@ -83,10 +83,7 @@ module.exports = function () {
|
|||||||
duration = json.matchings[0].duration;
|
duration = json.matchings[0].duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
// annotation response values are requested by 'a:{type_name}'
|
if (headers.has('annotation')) {
|
||||||
var found = false;
|
|
||||||
headers.forEach((h) => { if (h.match(/^a:/)) found = true; });
|
|
||||||
if (found) {
|
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
||||||
annotation = this.annotationList(json.matchings[0]);
|
annotation = this.annotationList(json.matchings[0]);
|
||||||
}
|
}
|
||||||
@@ -95,6 +92,11 @@ module.exports = function () {
|
|||||||
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
||||||
geometry = json.matchings[0].geometry;
|
geometry = json.matchings[0].geometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headers.has('OSM IDs')) {
|
||||||
|
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
||||||
|
OSMIDs = this.OSMIDList(json.matchings[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('turns')) {
|
if (headers.has('turns')) {
|
||||||
@@ -109,19 +111,9 @@ module.exports = function () {
|
|||||||
got.duration = duration.toString();
|
got.duration = duration.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if header matches 'a:*', parse out the values for *
|
if (headers.has('annotation')) {
|
||||||
// and return in that header
|
got.annotation = annotation.toString();
|
||||||
headers.forEach((k) => {
|
}
|
||||||
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight'];
|
|
||||||
if (k.match(/^a:/)) {
|
|
||||||
let a_type = k.slice(2);
|
|
||||||
if (whitelist.indexOf(a_type) == -1)
|
|
||||||
return cb(new Error('Unrecognized annotation field:' + a_type));
|
|
||||||
if (!annotation[a_type])
|
|
||||||
return cb(new Error('Annotation not found in response: ' + a_type));
|
|
||||||
got[k] = annotation[a_type];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (headers.has('geometry')) {
|
if (headers.has('geometry')) {
|
||||||
if (this.queryParams['geometries'] === 'polyline') {
|
if (this.queryParams['geometries'] === 'polyline') {
|
||||||
|
|||||||
@@ -70,9 +70,8 @@ module.exports = function () {
|
|||||||
assert.ok(this.stdout.indexOf(str) > -1);
|
assert.ok(this.stdout.indexOf(str) > -1);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
|
this.Then(/^stderr should contain "(.*?)"$/, (str) => {
|
||||||
const contains = this.stderr.indexOf(str) > -1;
|
assert.ok(this.stderr.indexOf(str) > -1);
|
||||||
assert.ok(typeof not === 'undefined' ? contains : !contains);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
||||||
|
|||||||
@@ -6,46 +6,19 @@ module.exports = function () {
|
|||||||
this.Then(/^routability should be$/, (table, callback) => {
|
this.Then(/^routability should be$/, (table, callback) => {
|
||||||
this.buildWaysFromTable(table, () => {
|
this.buildWaysFromTable(table, () => {
|
||||||
var directions = ['forw','backw','bothw'],
|
var directions = ['forw','backw','bothw'],
|
||||||
testedHeaders = ['forw','backw','bothw','forw_rate','backw_rate','bothw_rate'],
|
|
||||||
headers = new Set(Object.keys(table.hashes()[0]));
|
headers = new Set(Object.keys(table.hashes()[0]));
|
||||||
|
|
||||||
if (!testedHeaders.some(k => !!headers.has(k))) {
|
if (!directions.some(k => !!headers.has(k))) {
|
||||||
throw new Error('*** routability table must contain either "forw", "backw", "bothw", "forw_rate" or "backw_rate" column');
|
throw new Error('*** routability table must contain either "forw", "backw" or "bothw" column');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.reprocessAndLoadData((e) => {
|
this.reprocessAndLoadData((e) => {
|
||||||
if (e) return callback(e);
|
if (e) return callback(e);
|
||||||
var testRow = (row, i, cb) => {
|
var testRow = (row, i, cb) => {
|
||||||
var outputRow = Object.assign({}, row);
|
var outputRow = Object.assign({}, row);
|
||||||
// clear the fields that are tested for in the copied response object
|
|
||||||
for (var field in outputRow) {
|
|
||||||
if (testedHeaders.indexOf(field) != -1)
|
|
||||||
outputRow[field] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
testRoutabilityRow(i, (err, result) => {
|
testRoutabilityRow(i, (err, result) => {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
directions.filter(d => headers.has(d + '_rate')).forEach((direction) => {
|
|
||||||
var rate = direction + '_rate';
|
|
||||||
var want = row[rate];
|
|
||||||
|
|
||||||
switch (true) {
|
|
||||||
case '' === want:
|
|
||||||
outputRow[rate] = result[direction].status ?
|
|
||||||
result[direction].status.toString() : '';
|
|
||||||
break;
|
|
||||||
case /^\d+$/.test(want):
|
|
||||||
if (result[direction].rate !== undefined && !isNaN(result[direction].rate)) {
|
|
||||||
outputRow[rate] = result[direction].rate.toString();
|
|
||||||
} else {
|
|
||||||
outputRow[rate] = '';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error(util.format('*** Unknown expectation format: %s for header %s', want, rate));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
directions.filter(d => headers.has(d)).forEach((direction) => {
|
directions.filter(d => headers.has(d)).forEach((direction) => {
|
||||||
var usingShortcut = false,
|
var usingShortcut = false,
|
||||||
want = row[direction];
|
want = row[direction];
|
||||||
@@ -58,15 +31,13 @@ module.exports = function () {
|
|||||||
usingShortcut = row[direction];
|
usingShortcut = row[direction];
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO split out accessible/not accessible value from forw/backw headers
|
|
||||||
// rename forw/backw to forw/backw_speed
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case '' === want:
|
case '' === want:
|
||||||
case 'x' === want:
|
case 'x' === want:
|
||||||
outputRow[direction] = result[direction].status ?
|
outputRow[direction] = result[direction].status ?
|
||||||
result[direction].status.toString() : '';
|
result[direction].status.toString() : '';
|
||||||
break;
|
break;
|
||||||
case /^[\d\.]+ s/.test(want):
|
case /^\d+ s/.test(want):
|
||||||
// the result here can come back as a non-number value like
|
// the result here can come back as a non-number value like
|
||||||
// `diff`, but we only want to apply the unit when it comes
|
// `diff`, but we only want to apply the unit when it comes
|
||||||
// back as a number, for tableDiff's literal comparison
|
// back as a number, for tableDiff's literal comparison
|
||||||
@@ -92,7 +63,7 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.FuzzyMatch.match(outputRow[direction], want)) {
|
if (this.FuzzyMatch.match(outputRow[direction], want)) {
|
||||||
outputRow[direction] = usingShortcut ? usingShortcut : row[direction];
|
outputRow[direction] = [usingShortcut ? usingShortcut : row[direction]];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -104,10 +75,6 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// makes simple a-b request using the given cucumber test routability conditions
|
|
||||||
// result is an object containing the calculated values for 'rate', 'status',
|
|
||||||
// 'time', 'distance', and 'speed' for forwards and backwards routing, as well as
|
|
||||||
// a bothw object that diffs forwards/backwards
|
|
||||||
var testRoutabilityRow = (i, cb) => {
|
var testRoutabilityRow = (i, cb) => {
|
||||||
var result = {};
|
var result = {};
|
||||||
|
|
||||||
@@ -131,7 +98,6 @@ module.exports = function () {
|
|||||||
if (r.route.split(',')[0] === util.format('w%d', i)) {
|
if (r.route.split(',')[0] === util.format('w%d', i)) {
|
||||||
r.time = r.json.routes[0].duration;
|
r.time = r.json.routes[0].duration;
|
||||||
r.distance = r.json.routes[0].distance;
|
r.distance = r.json.routes[0].distance;
|
||||||
r.rate = Math.round(r.distance / r.json.routes[0].weight);
|
|
||||||
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
||||||
} else {
|
} else {
|
||||||
r.status = null;
|
r.status = null;
|
||||||
@@ -161,13 +127,30 @@ module.exports = function () {
|
|||||||
var parseRes = (key, scb) => {
|
var parseRes = (key, scb) => {
|
||||||
if (result.forw[key] === result.backw[key]) {
|
if (result.forw[key] === result.backw[key]) {
|
||||||
result.bothw[key] = result.forw[key];
|
result.bothw[key] = result.forw[key];
|
||||||
|
// FIXME these time and speed checks are stopgaps for precision errors in how
|
||||||
|
// OSRM returns inconsistent durations for rev/for requests along the same way
|
||||||
|
} else if (key === 'time') {
|
||||||
|
var range = [result.forw[key] - 1, result.forw[key] + 1];
|
||||||
|
if (result.backw[key] >= range[0] && result.backw[key] <= range[1])
|
||||||
|
// usually when we see minor differences here there's an integer
|
||||||
|
// duration value and one that comes back with a .9 or .1 rounding.
|
||||||
|
// This returns the integer one
|
||||||
|
result.bothw[key] = parseInt(result.forw[key]) === result.forw[key] ? result.forw[key] : result.backw[key];
|
||||||
|
else
|
||||||
|
result.bothw[key] = 'diff';
|
||||||
|
} else if (key === 'speed') {
|
||||||
|
if (Math.abs(result.backw.time - result.forw.time) < 0.2) {
|
||||||
|
result.bothw[key] = parseInt(result.forw[key]) === result.forw[key] ? result.forw[key] : result.backw[key];
|
||||||
|
} else {
|
||||||
|
result.bothw[key] = 'diff';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result.bothw[key] = 'diff';
|
result.bothw[key] = 'diff';
|
||||||
}
|
}
|
||||||
scb();
|
scb();
|
||||||
};
|
};
|
||||||
|
|
||||||
['rate', 'status', 'time', 'distance', 'speed'].forEach((key) => {
|
['status', 'time', 'distance', 'speed'].forEach((key) => {
|
||||||
sq.defer(parseRes, key);
|
sq.defer(parseRes, key);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ module.exports = function () {
|
|||||||
} else if (row[k]) {
|
} else if (row[k]) {
|
||||||
params[match[1]] = [row[k]];
|
params[match[1]] = [row[k]];
|
||||||
}
|
}
|
||||||
|
|
||||||
got[k] = row[k];
|
got[k] = row[k];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,11 +35,11 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('status')) {
|
if (headers.has('status')) {
|
||||||
got.status = json.code;
|
got.status = json.status.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('message')) {
|
if (headers.has('message')) {
|
||||||
got.message = json.message;
|
got.message = json.status_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('geometry')) {
|
if (headers.has('geometry')) {
|
||||||
@@ -58,7 +59,6 @@ module.exports = function () {
|
|||||||
|
|
||||||
var subTrips;
|
var subTrips;
|
||||||
var trip_durations;
|
var trip_durations;
|
||||||
var trip_distance;
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
if (headers.has('trips')) {
|
if (headers.has('trips')) {
|
||||||
subTrips = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map((sl, i) => {
|
subTrips = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map((sl, i) => {
|
||||||
@@ -74,19 +74,13 @@ module.exports = function () {
|
|||||||
})));
|
})));
|
||||||
trip_durations = all_durations.map( a => a.reduce(add, 0));
|
trip_durations = all_durations.map( a => a.reduce(add, 0));
|
||||||
}
|
}
|
||||||
if(headers.has('distance')) {
|
|
||||||
var all_distance = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map(sl => {
|
|
||||||
return sl.distance;
|
|
||||||
})));
|
|
||||||
trip_distance = all_distance.map( a => a.reduce(add, 0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var ok = true,
|
var ok = true,
|
||||||
encodedResult = '',
|
encodedResult = '',
|
||||||
extendedTarget = '';
|
extendedTarget = '';
|
||||||
|
|
||||||
if (json.trips) row.trips.split(',').forEach((sub, si) => {
|
row.trips.split(',').forEach((sub, si) => {
|
||||||
if (si >= subTrips.length) {
|
if (si >= subTrips.length) {
|
||||||
ok = false;
|
ok = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -111,10 +105,10 @@ module.exports = function () {
|
|||||||
got.via_points = row.via_points;
|
got.via_points = row.via_points;
|
||||||
} else {
|
} else {
|
||||||
got.trips = encodedResult;
|
got.trips = encodedResult;
|
||||||
|
got.trips = extendedTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
got.durations = trip_durations;
|
got.durations = trip_durations;
|
||||||
got.distance = trip_distance;
|
|
||||||
|
|
||||||
for (var key in row) {
|
for (var key in row) {
|
||||||
if (this.FuzzyMatch.match(got[key], row[key])) {
|
if (this.FuzzyMatch.match(got[key], row[key])) {
|
||||||
@@ -150,19 +144,6 @@ module.exports = function () {
|
|||||||
waypoints.push(node);
|
waypoints.push(node);
|
||||||
});
|
});
|
||||||
got = { waypoints: row.waypoints };
|
got = { waypoints: row.waypoints };
|
||||||
|
|
||||||
if (row.source) {
|
|
||||||
params.source = got.source = row.source;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (row.destination) {
|
|
||||||
params.destination = got.destination = row.destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (row.hasOwnProperty('roundtrip')) { //roundtrip is a boolean so row.roundtrip alone doesn't work as a check here
|
|
||||||
params.roundtrip = got.roundtrip = row.roundtrip;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.requestTrip(waypoints, params, afterRequest);
|
this.requestTrip(waypoints, params, afterRequest);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('*** no waypoints');
|
throw new Error('*** no waypoints');
|
||||||
|
|||||||
@@ -141,9 +141,7 @@ module.exports = function() {
|
|||||||
|
|
||||||
// converts the scenario titles in file prefixes
|
// converts the scenario titles in file prefixes
|
||||||
this.getScenarioID = (scenario) => {
|
this.getScenarioID = (scenario) => {
|
||||||
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\):\*#]/g, '')
|
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\)]/g, '').replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.');
|
||||||
.replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.')
|
|
||||||
.substring(0, 64);
|
|
||||||
return util.format('%d_%s', scenario.getLine(), name);
|
return util.format('%d_%s', scenario.getLine(), name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ module.exports = function () {
|
|||||||
q.awaitAll((err, actual) => {
|
q.awaitAll((err, actual) => {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
let diff = tableDiff(table, actual);
|
let diff = tableDiff(table, actual);
|
||||||
if (diff) callback(diff);
|
if (diff) callback(new Error(diff));
|
||||||
else callback();
|
else callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
+27
-17
@@ -27,11 +27,10 @@ module.exports = function () {
|
|||||||
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
|
||||||
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
||||||
this.DEFAULT_PROFILE = 'bicycle';
|
this.DEFAULT_PROFILE = 'bicycle';
|
||||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||||
this.DEFAULT_LOAD_METHOD = this.PLATFORM_WINDOWS ? 'directly' : 'datastore';
|
this.DEFAULT_LOAD_METHOD = 'datastore';
|
||||||
this.DEFAULT_ORIGIN = [1,1];
|
this.DEFAULT_ORIGIN = [1,1];
|
||||||
this.OSM_USER = 'osrm';
|
this.OSM_USER = 'osrm';
|
||||||
this.OSM_GENERATOR = 'osrm-test';
|
this.OSM_GENERATOR = 'osrm-test';
|
||||||
@@ -43,33 +42,44 @@ module.exports = function () {
|
|||||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||||
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
||||||
|
|
||||||
if (this.PLATFORM_WINDOWS) {
|
// TODO make sure this works on win
|
||||||
|
if (process.platform.match(/indows.*/)) {
|
||||||
this.TERMSIGNAL = 9;
|
this.TERMSIGNAL = 9;
|
||||||
this.EXE = '.exe';
|
this.EXE = '.exe';
|
||||||
|
this.LIB = '.dll';
|
||||||
|
this.QQ = '"';
|
||||||
} else {
|
} else {
|
||||||
this.TERMSIGNAL = 'SIGTERM';
|
this.TERMSIGNAL = 'SIGTERM';
|
||||||
this.EXE = '';
|
this.EXE = '';
|
||||||
}
|
|
||||||
|
|
||||||
// heuristically detect .so/.a/.dll/.lib suffix
|
// heuristically detect .so/.a suffix
|
||||||
this.LIB = ['lib%s.a', 'lib%s.so', '%s.dll', '%s.lib'].find((format) => {
|
this.LIB = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const lib = this.BIN_PATH + '/' + util.format(format, 'osrm');
|
const dot_a = util.format('%s/libosrm%s', this.BIN_PATH, '.a');
|
||||||
fs.accessSync(lib, fs.F_OK);
|
fs.accessSync(dot_a, fs.F_OK);
|
||||||
} catch(e) { return false; }
|
this.LIB = '.a';
|
||||||
return true;
|
} catch(e) { /*nop*/ }
|
||||||
});
|
|
||||||
|
|
||||||
if (this.LIB === undefined) {
|
try {
|
||||||
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
|
const dot_so = util.format('%s/libosrm%s', this.BIN_PATH, '.so');
|
||||||
|
fs.accessSync(dot_so, fs.F_OK);
|
||||||
|
this.LIB = '.so';
|
||||||
|
} catch(e) { /*nop*/ }
|
||||||
|
|
||||||
|
if (!this.LIB) {
|
||||||
|
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.QQ = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.OSRM_EXTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-extract', this.EXE));
|
this.OSRM_EXTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-extract', this.EXE));
|
||||||
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
||||||
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
||||||
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
|
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/libosrm_extract%s', this.BIN_PATH, this.LIB),
|
||||||
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
|
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/libosrm_contract%s', this.BIN_PATH, this.LIB),
|
||||||
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
|
this.LIB_OSRM_PATH = util.format('%s/libosrm%s', this.BIN_PATH, this.LIB);
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.info(util.format('Node Version', process.version));
|
console.info(util.format('Node Version', process.version));
|
||||||
@@ -98,7 +108,7 @@ module.exports = function () {
|
|||||||
var verify = (binPath, cb) => {
|
var verify = (binPath, cb) => {
|
||||||
fs.exists(binPath, (exists) => {
|
fs.exists(binPath, (exists) => {
|
||||||
if (!exists) return cb(new Error(util.format('%s is missing. Build failed?', binPath)));
|
if (!exists) return cb(new Error(util.format('%s is missing. Build failed?', binPath)));
|
||||||
var helpPath = util.format('%s --help', binPath);
|
var helpPath = util.format('%s --help > /dev/null 2>&1', binPath);
|
||||||
child_process.exec(helpPath, (err) => {
|
child_process.exec(helpPath, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return cb(new Error(util.format('*** %s exited with code %d', helpPath, err.code)));
|
return cb(new Error(util.format('*** %s exited with code %d', helpPath, err.code)));
|
||||||
|
|||||||
+13
-21
@@ -164,20 +164,20 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.annotationList = (instructions) => {
|
this.annotationList = (instructions) => {
|
||||||
if (!('annotation' in instructions.legs[0]))
|
function zip(list_1, list_2, list_3)
|
||||||
return '';
|
{
|
||||||
|
let tuples = [];
|
||||||
|
for (let i = 0; i < list_1.length; ++i) {
|
||||||
|
tuples.push([list_1[i], list_2[i], list_3[i]]);
|
||||||
|
}
|
||||||
|
return tuples;
|
||||||
|
}
|
||||||
|
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
|
||||||
|
};
|
||||||
|
|
||||||
var merged = {};
|
this.OSMIDList = (instructions) => {
|
||||||
instructions.legs.map(l => {
|
// OSM node IDs also come from the annotation list
|
||||||
Object.keys(l.annotation).forEach(a => {
|
return instructions.legs.map(l => l.annotation.nodes.map(n => n.toString()).join(',')).join(',');
|
||||||
if (!merged[a]) merged[a] = [];
|
|
||||||
merged[a].push(l.annotation[a].join(':'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Object.keys(merged).map(a => {
|
|
||||||
merged[a] = merged[a].join(',');
|
|
||||||
});
|
|
||||||
return merged;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.lanesList = (instructions) => {
|
this.lanesList = (instructions) => {
|
||||||
@@ -250,12 +250,4 @@ module.exports = function () {
|
|||||||
this.distanceList = (instructions) => {
|
this.distanceList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, s => s.distance + 'm');
|
return this.extractInstructionList(instructions, s => s.distance + 'm');
|
||||||
};
|
};
|
||||||
|
|
||||||
this.weightName = (instructions) => {
|
|
||||||
return instructions ? instructions.weight_name : '';
|
|
||||||
};
|
|
||||||
|
|
||||||
this.weightList = (instructions) => {
|
|
||||||
return this.extractInstructionList(instructions, s => s.weight);
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const path = require('path');
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
@@ -37,7 +36,7 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.runBin = (bin, options, env, callback) => {
|
this.runBin = (bin, options, env, callback) => {
|
||||||
let cmd = path.resolve(util.format('%s/%s%s', this.BIN_PATH, bin, this.EXE));
|
let cmd = util.format('%s%s/%s%s%s', this.QQ, this.BIN_PATH, bin, this.EXE, this.QQ);
|
||||||
let opts = options.split(' ').filter((x) => { return x && x.length > 0; });
|
let opts = options.split(' ').filter((x) => { return x && x.length > 0; });
|
||||||
let log = fs.createWriteStream(this.scenarioLogFile, {'flags': 'a'});
|
let log = fs.createWriteStream(this.scenarioLogFile, {'flags': 'a'});
|
||||||
log.write(util.format('*** running %s %s\n', cmd, options));
|
log.write(util.format('*** running %s %s\n', cmd, options));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ module.exports = function () {
|
|||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
if (body && body.length) {
|
if (body && body.length) {
|
||||||
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
||||||
distances, summary, intersections, lanes, locations, annotation, weight_name, weights;
|
distances, summary, intersections, lanes, locations;
|
||||||
|
|
||||||
let json = JSON.parse(body);
|
let json = JSON.parse(body);
|
||||||
|
|
||||||
@@ -55,9 +55,6 @@ module.exports = function () {
|
|||||||
lanes = this.lanesList(json.routes[0]);
|
lanes = this.lanesList(json.routes[0]);
|
||||||
summary = this.summary(json.routes[0]);
|
summary = this.summary(json.routes[0]);
|
||||||
locations = this.locations(json.routes[0]);
|
locations = this.locations(json.routes[0]);
|
||||||
annotation = this.annotationList(json.routes[0]);
|
|
||||||
weight_name = this.weightName(json.routes[0]);
|
|
||||||
weights = this.weightList(json.routes[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('status')) {
|
if (headers.has('status')) {
|
||||||
@@ -92,8 +89,7 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var distance = hasRoute && json.routes[0].distance,
|
var distance = hasRoute && json.routes[0].distance,
|
||||||
time = hasRoute && json.routes[0].duration,
|
time = hasRoute && json.routes[0].duration;
|
||||||
weight = hasRoute && json.routes[0].weight;
|
|
||||||
|
|
||||||
if (headers.has('distance')) {
|
if (headers.has('distance')) {
|
||||||
if (row.distance.length) {
|
if (row.distance.length) {
|
||||||
@@ -105,16 +101,6 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('weight')) {
|
|
||||||
if (row.weight.length) {
|
|
||||||
if (!row.weight.match(/[\d\.]+/))
|
|
||||||
return cb(new Error('*** Weight must be specified as a numeric value. (ex: 8)'));
|
|
||||||
got.weight = instructions ? util.format('%d', weight) : '';
|
|
||||||
} else {
|
|
||||||
got.weight = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('time')) {
|
if (headers.has('time')) {
|
||||||
if (!row.time.match(/\d+s/))
|
if (!row.time.match(/\d+s/))
|
||||||
return cb(new Error('*** Time must be specied in seconds. (ex: 60s)'));
|
return cb(new Error('*** Time must be specied in seconds. (ex: 60s)'));
|
||||||
@@ -144,20 +130,6 @@ module.exports = function () {
|
|||||||
got.locations = (locations || '').trim();
|
got.locations = (locations || '').trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if header matches 'a:*', parse out the values for *
|
|
||||||
// and return in that header
|
|
||||||
headers.forEach((k) => {
|
|
||||||
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight', 'speed'];
|
|
||||||
if (k.match(/^a:/)) {
|
|
||||||
let a_type = k.slice(2);
|
|
||||||
if (whitelist.indexOf(a_type) == -1)
|
|
||||||
return cb(new Error('Unrecognized annotation field', a_type));
|
|
||||||
if (!annotation[a_type])
|
|
||||||
return cb(new Error('Annotation not found in response', a_type));
|
|
||||||
got[k] = annotation[a_type];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var putValue = (key, value) => {
|
var putValue = (key, value) => {
|
||||||
if (headers.has(key)) got[key] = instructions ? value : '';
|
if (headers.has(key)) got[key] = instructions ? value : '';
|
||||||
};
|
};
|
||||||
@@ -170,9 +142,6 @@ module.exports = function () {
|
|||||||
putValue('distances', distances);
|
putValue('distances', distances);
|
||||||
putValue('pronunciations', pronunciations);
|
putValue('pronunciations', pronunciations);
|
||||||
putValue('destinations', destinations);
|
putValue('destinations', destinations);
|
||||||
putValue('weight_name', weight_name);
|
|
||||||
putValue('weights', weights);
|
|
||||||
putValue('weight', weight);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var key in row) {
|
for (var key in row) {
|
||||||
|
|||||||
@@ -37,18 +37,18 @@ Feature: Bearing parameter
|
|||||||
| bc |
|
| bc |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | bearing |
|
| from | to | bearings | route | bearing |
|
||||||
| 0 | c | 0 0 | | |
|
| 0 | c | 0 0 | | |
|
||||||
| 0 | c | 45 45 | bc,bc | 0->45,45->0 |
|
| 0 | c | 45 45 | bc,bc | 0->44,44->0 +- 1 |
|
||||||
| 0 | c | 85 85 | | |
|
| 0 | c | 85 85 | | |
|
||||||
| 0 | c | 95 95 | | |
|
| 0 | c | 95 95 | | |
|
||||||
| 0 | c | 135 135 | ac,ac | 0->135,135->0 |
|
| 0 | c | 135 135 | ac,ac | 0->135,135->0 +- 1|
|
||||||
| 0 | c | 180 180 | | |
|
| 0 | c | 180 180 | | |
|
||||||
|
|
||||||
Scenario: Testbot - Initial bearing on split way
|
Scenario: Testbot - Initial bearing on split way
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g d 2 1 c f
|
g d 1 c f
|
||||||
h a 0 b e
|
h a 0 b e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -64,17 +64,21 @@ Feature: Bearing parameter
|
|||||||
| ha | yes |
|
| ha | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | bearing |
|
| from | to | bearings | route | bearing |
|
||||||
| 0 | b | 10 10 | bc,bc | 0->0,0->0 |
|
| 0 | b | 10 10 | bc,bc | 0->0,0->0 |
|
||||||
| 0 | b | 90 90 | ab,ab | 0->90,90->0 |
|
| 0 | b | 90 90 | ab,ab | 0->90,90->0 |
|
||||||
| 0 | b | 170 170 | da,da | 0->0,0->0 |
|
# The returned bearing is wrong here, it's based on the snapped
|
||||||
| 0 | b | 189 189 | da,da | 0->0,0->0 |
|
# coordinates, not the acutal edge bearing. This should be
|
||||||
| 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 |
|
# fixed one day, but it's only a problem when we snap two vias
|
||||||
| 1 | 2 | 10 10 | bc,bc | 0->0,0->0 |
|
# to the same point - DP
|
||||||
| 1 | 2 | 90 90 | ab,bc,cd,da,ab,ab | 0->90,90->0,0->270,270->180,180->90,90->0 |
|
#| 0 | b | 170 170 | da | 180 |
|
||||||
| 1 | 0 | 189 189 | da,da | 0->180,180->0 |
|
#| 0 | b | 189 189 | da | 180 |
|
||||||
| 1 | 2 | 270 270 | cd,cd | 0->270,270->0 |
|
| 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 |
|
||||||
| 1 | 2 | 349 349 | | |
|
| 1 | d | 10 10 | bc,bc | 0->0,0->0 |
|
||||||
|
| 1 | d | 90 90 | ab,bc,cd,da,da | 0->90,90->0,0->270,270->180,180->0 |
|
||||||
|
| 1 | 0 | 189 189 | da,da | 0->180,180->0 |
|
||||||
|
| 1 | d | 270 270 | cd,cd | 0->270,270->0 |
|
||||||
|
| 1 | d | 349 349 | | |
|
||||||
|
|
||||||
Scenario: Testbot - Initial bearing in all direction
|
Scenario: Testbot - Initial bearing in all direction
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ Feature: Geometry Compression
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance | speed |
|
| from | to | route | distance | speed |
|
||||||
| b | e | abcdef,abcdef | 588.5m | 36 km/h |
|
| b | e | abcdef,abcdef | 588.8m | 36 km/h |
|
||||||
| e | b | abcdef,abcdef | 588.5m | 36 km/h |
|
| e | b | abcdef,abcdef | 588.8m | 36 km/h |
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ Feature: Distance calculation
|
|||||||
| ab |
|
| ab |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | ab,ab | 100m |
|
| a | b | ab,ab | 100m +- 2 |
|
||||||
|
|
||||||
Scenario: Distance should equal sum of segments, leftwinded
|
Scenario: Distance should equal sum of segments, leftwinded
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -33,7 +33,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | d | abcde,abcde | 300m +-1 |
|
| a | d | abcde,abcde | 300m +-2 |
|
||||||
|
|
||||||
Scenario: Distance should equal sum of segments, rightwinded
|
Scenario: Distance should equal sum of segments, rightwinded
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -49,7 +49,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | d | abcde,abcde | 300m +-1 |
|
| a | d | abcde,abcde | 300m +-2 |
|
||||||
|
|
||||||
Scenario: 10m distances
|
Scenario: 10m distances
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
@@ -65,12 +65,12 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abc,abc | 10m |
|
| a | b | abc,abc | 10m +-2 |
|
||||||
| b | a | abc,abc | 10m |
|
| b | a | abc,abc | 10m +-2 |
|
||||||
| b | c | abc,abc | 10m |
|
| b | c | abc,abc | 10m +-2 |
|
||||||
| c | b | abc,abc | 10m |
|
| c | b | abc,abc | 10m +-2 |
|
||||||
| a | c | abc,abc | 20m |
|
| a | c | abc,abc | 20m +-4 |
|
||||||
| c | a | abc,abc | 20m |
|
| c | a | abc,abc | 20m +-4 |
|
||||||
|
|
||||||
Scenario: 100m distances
|
Scenario: 100m distances
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
@@ -86,12 +86,12 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abc,abc | 100m |
|
| a | b | abc,abc | 100m +-2 |
|
||||||
| b | a | abc,abc | 100m |
|
| b | a | abc,abc | 100m +-2 |
|
||||||
| b | c | abc,abc | 100m |
|
| b | c | abc,abc | 100m +-2 |
|
||||||
| c | b | abc,abc | 100m |
|
| c | b | abc,abc | 100m +-2 |
|
||||||
| a | c | abc,abc | 200m |
|
| a | c | abc,abc | 200m +-4 |
|
||||||
| c | a | abc,abc | 200m |
|
| c | a | abc,abc | 200m +-4 |
|
||||||
|
|
||||||
Scenario: 1km distance
|
Scenario: 1km distance
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
@@ -107,12 +107,12 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abc,abc | 1000m +-1 |
|
| a | b | abc,abc | 1000m +-2 |
|
||||||
| b | a | abc,abc | 1000m +-1 |
|
| b | a | abc,abc | 1000m +-2 |
|
||||||
| b | c | abc,abc | 1000m +-1 |
|
| b | c | abc,abc | 1000m +-2 |
|
||||||
| c | b | abc,abc | 1000m +-1 |
|
| c | b | abc,abc | 1000m +-2 |
|
||||||
| a | c | abc,abc | 2000m +-1 |
|
| a | c | abc,abc | 2000m +-4 |
|
||||||
| c | a | abc,abc | 2000m +-1 |
|
| c | a | abc,abc | 2000m +-4 |
|
||||||
|
|
||||||
Scenario: Distance of a winding south-north path
|
Scenario: Distance of a winding south-north path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
@@ -130,13 +130,13 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abcdefgh,abcdefgh | 10m |
|
| a | b | abcdefgh,abcdefgh | 10m +-2 |
|
||||||
| a | c | abcdefgh,abcdefgh | 20m |
|
| a | c | abcdefgh,abcdefgh | 20m +-4 |
|
||||||
| a | d | abcdefgh,abcdefgh | 30m |
|
| a | d | abcdefgh,abcdefgh | 30m +-6 |
|
||||||
| a | e | abcdefgh,abcdefgh | 40m |
|
| a | e | abcdefgh,abcdefgh | 40m +-8 |
|
||||||
| a | f | abcdefgh,abcdefgh | 50m |
|
| a | f | abcdefgh,abcdefgh | 50m +-10 |
|
||||||
| a | g | abcdefgh,abcdefgh | 60m +-1 |
|
| a | g | abcdefgh,abcdefgh | 60m +-12 |
|
||||||
| a | h | abcdefgh,abcdefgh | 70m +-1 |
|
| a | h | abcdefgh,abcdefgh | 70m +-14 |
|
||||||
|
|
||||||
Scenario: Distance of a winding east-west path
|
Scenario: Distance of a winding east-west path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
@@ -152,13 +152,13 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abcdefgh,abcdefgh | 10m |
|
| a | b | abcdefgh,abcdefgh | 10m +-2 |
|
||||||
| a | c | abcdefgh,abcdefgh | 20m |
|
| a | c | abcdefgh,abcdefgh | 20m +-4 |
|
||||||
| a | d | abcdefgh,abcdefgh | 30m |
|
| a | d | abcdefgh,abcdefgh | 30m +-6 |
|
||||||
| a | e | abcdefgh,abcdefgh | 40m |
|
| a | e | abcdefgh,abcdefgh | 40m +-8 |
|
||||||
| a | f | abcdefgh,abcdefgh | 50m |
|
| a | f | abcdefgh,abcdefgh | 50m +-10 |
|
||||||
| a | g | abcdefgh,abcdefgh | 60m +-1 |
|
| a | g | abcdefgh,abcdefgh | 60m +-12 |
|
||||||
| a | h | abcdefgh,abcdefgh | 70m +-1 |
|
| a | h | abcdefgh,abcdefgh | 70m +-14 |
|
||||||
|
|
||||||
Scenario: Geometric distances
|
Scenario: Geometric distances
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
@@ -201,31 +201,31 @@ Feature: Distance calculation
|
|||||||
| xy |
|
| xy |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| x | a | xa,xa | 300m +-1 |
|
| x | a | xa,xa | 300m +-2 |
|
||||||
| x | b | xb,xb | 316m +-1 |
|
| x | b | xb,xb | 316m +-2 |
|
||||||
| x | c | xc,xc | 360m +-1 |
|
| x | c | xc,xc | 360m +-2 |
|
||||||
| x | d | xd,xd | 424m +-1 |
|
| x | d | xd,xd | 424m +-2 |
|
||||||
| x | e | xe,xe | 360m +-1 |
|
| x | e | xe,xe | 360m +-2 |
|
||||||
| x | f | xf,xf | 316m +-1 |
|
| x | f | xf,xf | 316m +-2 |
|
||||||
| x | g | xg,xg | 300m +-1 |
|
| x | g | xg,xg | 300m +-2 |
|
||||||
| x | h | xh,xh | 316m +-1 |
|
| x | h | xh,xh | 316m +-2 |
|
||||||
| x | i | xi,xi | 360m +-1 |
|
| x | i | xi,xi | 360m +-2 |
|
||||||
| x | j | xj,xj | 424m +-1 |
|
| x | j | xj,xj | 424m +-2 |
|
||||||
| x | k | xk,xk | 360m +-1 |
|
| x | k | xk,xk | 360m +-2 |
|
||||||
| x | l | xl,xl | 316m +-1 |
|
| x | l | xl,xl | 316m +-2 |
|
||||||
| x | m | xm,xm | 300m +-1 |
|
| x | m | xm,xm | 300m +-2 |
|
||||||
| x | n | xn,xn | 316m +-1 |
|
| x | n | xn,xn | 316m +-2 |
|
||||||
| x | o | xo,xo | 360m +-1 |
|
| x | o | xo,xo | 360m +-2 |
|
||||||
| x | p | xp,xp | 424m +-1 |
|
| x | p | xp,xp | 424m +-2 |
|
||||||
| x | q | xq,xq | 360m +-1 |
|
| x | q | xq,xq | 360m +-2 |
|
||||||
| x | r | xr,xr | 316m +-1 |
|
| x | r | xr,xr | 316m +-2 |
|
||||||
| x | s | xs,xs | 300m +-1 |
|
| x | s | xs,xs | 300m +-2 |
|
||||||
| x | t | xt,xt | 316m +-1 |
|
| x | t | xt,xt | 316m +-2 |
|
||||||
| x | u | xu,xu | 360m +-1 |
|
| x | u | xu,xu | 360m +-2 |
|
||||||
| x | v | xv,xv | 424m +-1 |
|
| x | v | xv,xv | 424m +-2 |
|
||||||
| x | w | xw,xw | 360m +-1 |
|
| x | w | xw,xw | 360m +-2 |
|
||||||
| x | y | xy,xy | 316m +-1 |
|
| x | y | xy,xy | 316m +-2 |
|
||||||
|
|
||||||
@maze
|
@maze
|
||||||
Scenario: Distance of a maze of short segments
|
Scenario: Distance of a maze of short segments
|
||||||
@@ -245,4 +245,4 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | t | abcdefghijklmnopqrst,abcdefghijklmnopqrst | 133m +-1 |
|
| a | t | abcdefghijklmnopqrst,abcdefghijklmnopqrst | 133m +-2 |
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user