Compare commits
135 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a558e5de4f | |||
| d62f8bc994 | |||
| f11dc9b978 | |||
| 93a05b7f70 | |||
| 9b75ff98c9 | |||
| b28d1a00d6 | |||
| 8ddbbb0889 | |||
| 8345648c02 | |||
| 15fa82405b | |||
| e53e1cbe0f | |||
| a48e5e4804 | |||
| 9519ff2e30 | |||
| 7543de4480 | |||
| 93e8c42589 | |||
| 9e140d1e0f | |||
| bf73834a72 | |||
| b637fffc01 | |||
| f31617dd9c | |||
| 28ed237f9a | |||
| 973785d1eb | |||
| b04919db51 | |||
| 0ccce27fdf | |||
| 5e82ee60e7 | |||
| 05f1c85de3 | |||
| aca943723f | |||
| d82d7cf66e | |||
| c608b77a43 | |||
| 07dba1c325 | |||
| f06a636e7d | |||
| 3060f4414d | |||
| bf01038e63 | |||
| c6004d4401 | |||
| d8759b7a2e | |||
| 304f361077 | |||
| aeb435a2f7 | |||
| fca25b45cd | |||
| 2402a1341a | |||
| c9a0c0da1c | |||
| 9c5d0f1e91 | |||
| f47f008e7d | |||
| 1fe9012c29 | |||
| 9db0b029aa | |||
| c48e5f5ee2 | |||
| 5eb8990739 | |||
| 533d6c0a6b | |||
| 2a454c4272 | |||
| 908fd98824 | |||
| 4f0a84e8de | |||
| 6883fdca5c | |||
| 396e14d46e | |||
| 951ffe8484 | |||
| 6aa12b1dd6 | |||
| 74fe0beef6 | |||
| 383c9619ec | |||
| b85270e540 | |||
| b06dddaf5e | |||
| 3fa9672d9a | |||
| 6547978906 | |||
| 9087a01aac | |||
| ad56ed8832 | |||
| 4b46dec169 | |||
| 6f5c3067f1 | |||
| 41600eeadc | |||
| 6dd23b2984 | |||
| 91b97ae7f7 | |||
| 28de928a5d | |||
| 209d1ada6a | |||
| 399a2233f3 | |||
| d4009e11d5 | |||
| 8c9100cd9e | |||
| 3a7d527a7e | |||
| c96a485108 | |||
| c2de49ccab | |||
| ae8dde6afe | |||
| 6bc3f5d6da | |||
| dbab7b421c | |||
| 4dd6dfbfe2 | |||
| f039da95ec | |||
| 5626182c60 | |||
| 721cc32acb | |||
| 0ec5f06a2f | |||
| 32982c7609 | |||
| 828767ba18 | |||
| 83deae637b | |||
| 88f9cf5aea | |||
| f5e79f5c7e | |||
| 3f7056ee30 | |||
| 0aa98454f5 | |||
| eb179af1ce | |||
| 03a230a768 | |||
| 0bd658c304 | |||
| 0c8113943b | |||
| ef790e8e82 | |||
| cd4dbfac42 | |||
| 6b72c007f9 | |||
| 007e4a69c8 | |||
| fab343d0d3 | |||
| 8d4ee327cd | |||
| ba2feca497 | |||
| a9872a4892 | |||
| 0369634886 | |||
| b10bd7c45e | |||
| 2134162fc6 | |||
| 00b3147c9b | |||
| 3b6d6bbbf2 | |||
| 52653c8ffa | |||
| 891ac48d1c | |||
| 26dd3c8cd7 | |||
| 820d0444fb | |||
| b1a11aa567 | |||
| 0c970e4035 | |||
| c21e0855e9 | |||
| 1b2bbd086e | |||
| 8eee4c23cc | |||
| 7e1c164937 | |||
| 6fecce23fc | |||
| 7abb7ed0e1 | |||
| 097771879b | |||
| 2d558a0b83 | |||
| 23a5edb29b | |||
| 942c71814d | |||
| 482aa63001 | |||
| 989bbfb250 | |||
| decf976489 | |||
| 88a501f77c | |||
| 98beea7649 | |||
| 2bd8efd140 | |||
| 73e71765ab | |||
| a57680323f | |||
| 75f356fcc6 | |||
| d35c862a8b | |||
| df236b72fb | |||
| 8b2b153465 | |||
| 26ffdf2dcb | |||
| 3377bf8faf |
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"rules": {
|
|
||||||
"indent": [
|
|
||||||
2,
|
|
||||||
4
|
|
||||||
],
|
|
||||||
"quotes": [
|
|
||||||
1,
|
|
||||||
"single"
|
|
||||||
],
|
|
||||||
"linebreak-style": [
|
|
||||||
2,
|
|
||||||
"unix"
|
|
||||||
],
|
|
||||||
"semi": [
|
|
||||||
2,
|
|
||||||
"always"
|
|
||||||
],
|
|
||||||
"no-console": [
|
|
||||||
1
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"es6": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": "eslint:recommended"
|
|
||||||
}
|
|
||||||
@@ -41,7 +41,6 @@ Thumbs.db
|
|||||||
#######################
|
#######################
|
||||||
/build/
|
/build/
|
||||||
/example/build/
|
/example/build/
|
||||||
/test/data/monaco*
|
|
||||||
/cmake/postinst
|
/cmake/postinst
|
||||||
|
|
||||||
# Eclipse related files #
|
# Eclipse related files #
|
||||||
@@ -75,13 +74,7 @@ stxxl.errlog
|
|||||||
###################
|
###################
|
||||||
/sandbox/
|
/sandbox/
|
||||||
|
|
||||||
# Test related files #
|
|
||||||
######################
|
|
||||||
/test/profile.lua
|
/test/profile.lua
|
||||||
/test/cache
|
|
||||||
/test/speeds.csv
|
|
||||||
/test/data/monaco.*
|
|
||||||
node_modules
|
|
||||||
|
|
||||||
# Deprecated config file #
|
# Deprecated config file #
|
||||||
##########################
|
##########################
|
||||||
|
|||||||
+59
-49
@@ -13,7 +13,7 @@ notifications:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- "5.0"
|
- develop
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
@@ -26,29 +26,29 @@ matrix:
|
|||||||
addons: &gcc5
|
addons: &gcc5
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['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', 'pip']
|
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
|
env: COMPILER='g++-5' BUILD_TYPE='Debug'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
addons: &gcc48
|
addons: &gcc48
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-4.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: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Debug'
|
env: COMPILER='g++-4.8' BUILD_TYPE='Debug'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
addons: &clang38
|
addons: &clang38
|
||||||
apt:
|
apt:
|
||||||
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||||
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', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
|
env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode7.3
|
osx_image: xcode7.3
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Debug'
|
env: COMPILER='clang++' BUILD_TYPE='Debug'
|
||||||
|
|
||||||
# Release Builds
|
# Release Builds
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -56,29 +56,29 @@ matrix:
|
|||||||
addons: &gcc5
|
addons: &gcc5
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['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']
|
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
env: COMPILER='g++-5' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
addons: &gcc48
|
addons: &gcc48
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-4.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: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Release'
|
env: COMPILER='g++-4.8' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
addons: &clang38
|
addons: &clang38
|
||||||
apt:
|
apt:
|
||||||
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||||
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', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
|
env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode7.3
|
osx_image: xcode7.3
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Release'
|
env: COMPILER='clang++' BUILD_TYPE='Release'
|
||||||
|
|
||||||
# Shared Library
|
# Shared Library
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -86,33 +86,51 @@ matrix:
|
|||||||
addons: &gcc5
|
addons: &gcc5
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['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']
|
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
env: COMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
addons: &clang38
|
addons: &clang38
|
||||||
apt:
|
apt:
|
||||||
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||||
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', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
env: COMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||||
|
|
||||||
|
|
||||||
|
# Disabled until tests all pass on OSX:
|
||||||
|
#
|
||||||
|
# 3/ OSX Clang Builds
|
||||||
|
#- os: osx
|
||||||
|
# osx_image: xcode6.4
|
||||||
|
# compiler: clang
|
||||||
|
# env: COMPILER='clang++' BUILD_TYPE='Debug'
|
||||||
|
|
||||||
|
#- os: osx
|
||||||
|
# osx_image: xcode6.4
|
||||||
|
# compiler: clang
|
||||||
|
# env: COMPILER='clang++' BUILD_TYPE='Release'
|
||||||
|
|
||||||
|
#- os: osx
|
||||||
|
# osx_image: xcode6.4
|
||||||
|
# compiler: clang
|
||||||
|
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||||
|
|
||||||
|
#- os: osx
|
||||||
|
# osx_image: xcode7
|
||||||
|
# compiler: clang
|
||||||
|
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||||
|
|
||||||
before_install:
|
|
||||||
- source ./scripts/install_node.sh 4
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install
|
|
||||||
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
||||||
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
|
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
|
||||||
- |
|
|
||||||
if [[ -n "${COVERAGE}" ]]; then
|
|
||||||
pip install --user cpp-coveralls
|
|
||||||
fi
|
|
||||||
- |
|
- |
|
||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||||
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
|
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
|
||||||
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
|
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
|
||||||
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
|
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
|
||||||
|
|
||||||
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||||
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
|
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
|
||||||
brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum
|
brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum
|
||||||
@@ -124,10 +142,13 @@ before_script:
|
|||||||
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
|
||||||
|
- rvm use 1.9.3
|
||||||
|
- gem install bundler
|
||||||
|
- bundle install
|
||||||
- mkdir build && pushd build
|
- mkdir build && pushd build
|
||||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
- export CXX=${COMPILER}
|
||||||
- export OSRM_PORT=5000 OSRM_TIMEOUT=6000
|
- export OSRM_PORT=5000 OSRM_TIMEOUT=60
|
||||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
|
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make --jobs=2
|
- make --jobs=2
|
||||||
@@ -138,29 +159,18 @@ script:
|
|||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
fi
|
fi
|
||||||
- echo "travis_fold:start:UNIT_TESTS"
|
- ./extractor-tests
|
||||||
- ./unit_tests/extractor-tests
|
- ./engine-tests
|
||||||
- ./unit_tests/engine-tests
|
- ./util-tests
|
||||||
- ./unit_tests/util-tests
|
|
||||||
- ./unit_tests/server-tests
|
|
||||||
- echo "travis_fold:end:UNIT_TESTS"
|
|
||||||
- popd
|
- popd
|
||||||
- echo "travis_fold:start:CUCUMBER"
|
- cucumber -p verify
|
||||||
- npm test
|
- make -C test/data
|
||||||
- echo "travis_fold:end:CUCUMBER"
|
|
||||||
- echo "travis_fold:start:BENCHMARK"
|
|
||||||
- make -C test/data benchmark
|
|
||||||
- echo "travis_fold:end:BENCHMARK"
|
|
||||||
- ./build/unit_tests/library-tests test/data/monaco.osrm
|
|
||||||
- mkdir example/build && pushd example/build
|
- mkdir example/build && pushd example/build
|
||||||
- cmake ..
|
- cmake ..
|
||||||
- make
|
- make
|
||||||
- ./osrm-example ../../test/data/monaco.osrm
|
- ./osrm-example ../../test/data/monaco.osrm
|
||||||
- popd
|
- popd
|
||||||
|
|
||||||
after_success:
|
|
||||||
- |
|
- |
|
||||||
if [ -n "$RUN_CLANG_FORMAT" ]; then
|
if [ -n "$RUN_CLANG_FORMAT" ]; then
|
||||||
./scripts/format.sh || true # we don't want to fail just yet
|
./scripts/format.sh || true # we don't want to fail just yet
|
||||||
fi
|
fi
|
||||||
- coveralls --build-root build --exclude unit_tests --exclude third_party --exclude node_modules --gcov-options '\-lp'
|
|
||||||
|
|||||||
@@ -1,98 +1,3 @@
|
|||||||
# 5.0.2
|
|
||||||
- Fixes:
|
|
||||||
- Issue #2335, map matching was using shortest path with uturns disabled
|
|
||||||
|
|
||||||
# 5.0.1
|
|
||||||
- Fixes:
|
|
||||||
- Issue #2309: Fixes local path looping, same coordinates crash
|
|
||||||
- Issue #2311: Fixes invalid assertion in loop unpacking
|
|
||||||
- Issue #2310: Local paths could falsely end up trying to remove the start step
|
|
||||||
|
|
||||||
# 5.0.0
|
# 5.0.0
|
||||||
Changes with regard 5.0.0 RC2:
|
|
||||||
- API:
|
|
||||||
- if `geometry=geojson` is passed the resulting geometry can be a LineString or Point
|
|
||||||
depending on how many coordinates are present.
|
|
||||||
- the removal of the summary field was revered. for `steps=flase` the field will always be an empty string.
|
|
||||||
|
|
||||||
Changes with regard to 4.9.1:
|
|
||||||
- API:
|
|
||||||
- BREAKING: Complete rewrite of the HTTP and library API. See detailed documentation in the wiki.
|
|
||||||
- BREAKING: The default coordinate order is now `longitude, latidue`. Exception: Polyline geometry
|
|
||||||
which follow the original Google specification of `latitdue, longitude`.
|
|
||||||
- BREAKING: Polyline geometries now use precision 5, instead of previously 6
|
|
||||||
- BREAKING: Removed GPX support
|
|
||||||
- New service `tile` which serves debug vector tiles of the road network
|
|
||||||
- Completely new engine for guidance generation:
|
|
||||||
- Support for highway ramps
|
|
||||||
- Support for different intersection types (end of street, forks, merges)
|
|
||||||
- Instruction post-processing to merge unimportant instructions
|
|
||||||
- Improved handling of roundabouts
|
|
||||||
|
|
||||||
- Tools:
|
|
||||||
- BREAKING: Renamed osrm-prepare to osrm-contract
|
|
||||||
- BREAKING: Removes profiles from osrm-contract, only needed in osrm-extract.
|
|
||||||
- Abort processing in osrm-extract if there are no snappable edges remaining.
|
|
||||||
- Added .properties file to osrm-extract ouput.
|
|
||||||
- Enables the use of multiple segment-speed-files on the osrm-contract command line
|
|
||||||
|
|
||||||
- Profile changes:
|
|
||||||
- Remove movable bridge mode
|
|
||||||
- Add `maxspeed=none` tag to car profile.
|
|
||||||
- A `side_road` tag support for the OSRM car profile.
|
|
||||||
|
|
||||||
- Fixes:
|
|
||||||
- Issue #2150: Prevents routing over delivery ways and nodes
|
|
||||||
- Issue #1972: Provide uninstall target
|
|
||||||
- Issue #2072: Disable alternatives by default and if core factor < 1.0
|
|
||||||
- Issue #1999: Fix unpacking for self-loop nodes not in core.
|
|
||||||
|
|
||||||
- Infrastructure:
|
|
||||||
- Cucumber test suit is now based on cucumber-js, removes Ruby as dependency
|
|
||||||
- Updated to mapbox/variant v1.1
|
|
||||||
- Updated to libosmium v2.6.1
|
|
||||||
- Remove GeoJSON based debugging output, replaced by debug tiles
|
|
||||||
|
|
||||||
|
|
||||||
# 5.0.0 RC2
|
|
||||||
- Profiles:
|
|
||||||
- `properties.allow_uturns_at_via` -> `properties.continue_straight_at_waypoint` (value is inverted!)
|
|
||||||
- API:
|
|
||||||
- Removed summary from legs property
|
|
||||||
- Disable steps and alternatives by default
|
|
||||||
- Fix `code` field: 'ok' -> 'Ok'
|
|
||||||
- Allow 4.json and 4.3.json format
|
|
||||||
- Conform to v5 spec and support "unlimited" as radiuses value.
|
|
||||||
- `uturns` parameter was replaced by `continue_straight` (value is inverted!)
|
|
||||||
- Features:
|
|
||||||
- Report progress for gennerating edge expanded edges in the edge based graph factory
|
|
||||||
- Add maxspeed=none tag to car profile.
|
|
||||||
- Optimize StaticRTree code: speedup 2x (to RC1)
|
|
||||||
- Optimize DouglasPeucker code: speedup 10x (to RC1)
|
|
||||||
- Optimize WebMercator projection: speedup 2x (to RC1)
|
|
||||||
- Bugs:
|
|
||||||
- #2195: Resolves issues with multiple includedirs in pkg-config file
|
|
||||||
- #2219: Internal server error when using the match plugin
|
|
||||||
- #2027: basename -> filename
|
|
||||||
- #2168: Report correct position where parsing failed
|
|
||||||
- #2036: Add license to storage and storage config exposed in public API
|
|
||||||
- Fix uturn detection in match plugin
|
|
||||||
- Add missing -lz to fix linking of server-tests
|
|
||||||
|
|
||||||
# 5.0.0 RC1
|
|
||||||
- Renamed osrm-prepare into osrm-contract
|
- Renamed osrm-prepare into osrm-contract
|
||||||
- osrm-contract does not need a profile parameter anymore
|
- osrm-contract does not need a profile parameter anymore
|
||||||
- New public HTTP API, find documentation [here](https://github.com/Project-OSRM/osrm-backend/wiki/New-Server-api)
|
|
||||||
- POST support is discontinued, please use library bindings for more complex requests
|
|
||||||
- Removed timestamp plugin
|
|
||||||
- Coordinate order is now Longitude,Latitude
|
|
||||||
- Cucumber tests now based on Javascript (run with `npm test`)
|
|
||||||
- Profile API changed:
|
|
||||||
- `forward_mode` and `backward_mode` now need to be selected from a pre-defined list
|
|
||||||
- Global profile properties are now stored in a global `properties` element. This includes:
|
|
||||||
- `properties.traffic_signal_penalty`
|
|
||||||
- `properties.use_turn_restrictions`
|
|
||||||
- `properties.u_turn_penalty`
|
|
||||||
- `properties.allow_u_turn_at_via`
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+44
-53
@@ -7,9 +7,9 @@ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. P
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 4)
|
||||||
set(OSRM_VERSION_MINOR 0)
|
set(OSRM_VERSION_MINOR 9)
|
||||||
set(OSRM_VERSION_PATCH 0)
|
set(OSRM_VERSION_PATCH 1)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
@@ -32,10 +32,7 @@ endif()
|
|||||||
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
||||||
option(ENABLE_JSON_LOGGING "Adds additional JSON debug logging to the response" OFF)
|
option(ENABLE_JSON_LOGGING "Adds additional JSON debug logging to the response" OFF)
|
||||||
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
||||||
option(BUILD_COMPONENTS "Build osrm-components" ON)
|
|
||||||
option(ENABLE_ASSERTIONS OFF)
|
option(ENABLE_ASSERTIONS OFF)
|
||||||
option(COVERAGE OFF)
|
|
||||||
option(SANITIZER OFF)
|
|
||||||
|
|
||||||
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/)
|
||||||
@@ -48,7 +45,10 @@ add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
|
|||||||
COMMENT "Configuring revision fingerprint"
|
COMMENT "Configuring revision fingerprint"
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
|
|
||||||
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread)
|
add_custom_target(tests DEPENDS engine-tests extractor-tests util-tests server-tests)
|
||||||
|
add_custom_target(benchmarks DEPENDS rtree-bench)
|
||||||
|
|
||||||
|
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread unit_test_framework)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
|
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
|
||||||
@@ -60,6 +60,11 @@ file(GLOB ContractorGlob src/contractor/*.cpp)
|
|||||||
file(GLOB StorageGlob src/storage/*.cpp)
|
file(GLOB StorageGlob src/storage/*.cpp)
|
||||||
file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
|
file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
|
||||||
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
|
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
|
||||||
|
file(GLOB ExtractorTestsGlob unit_tests/extractor/*.cpp)
|
||||||
|
file(GLOB EngineTestsGlob unit_tests/engine/*.cpp)
|
||||||
|
file(GLOB UtilTestsGlob unit_tests/util/*.cpp)
|
||||||
|
file(GLOB ServerTestsGlob unit_tests/server/*.cpp)
|
||||||
|
file(GLOB IOTestsGlob unit_tests/io/*.cpp)
|
||||||
|
|
||||||
add_library(UTIL OBJECT ${UtilGlob})
|
add_library(UTIL OBJECT ${UtilGlob})
|
||||||
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
|
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
|
||||||
@@ -75,11 +80,23 @@ add_executable(osrm-extract src/tools/extract.cpp)
|
|||||||
add_executable(osrm-contract src/tools/contract.cpp)
|
add_executable(osrm-contract src/tools/contract.cpp)
|
||||||
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
|
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_extract $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_extract $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
||||||
|
|
||||||
|
# Unit tests
|
||||||
|
add_executable(engine-tests EXCLUDE_FROM_ALL unit_tests/engine_tests.cpp ${EngineTestsGlob} $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL>)
|
||||||
|
add_executable(extractor-tests EXCLUDE_FROM_ALL unit_tests/extractor_tests.cpp ${ExtractorTestsGlob} $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||||
|
add_executable(util-tests EXCLUDE_FROM_ALL unit_tests/util_tests.cpp ${UtilTestsGlob} $<TARGET_OBJECTS:UTIL>)
|
||||||
|
add_executable(server-tests EXCLUDE_FROM_ALL unit_tests/server_tests.cpp ${ServerTestsGlob} $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:SERVER>)
|
||||||
|
|
||||||
|
# Benchmarks
|
||||||
|
add_executable(rtree-bench EXCLUDE_FROM_ALL src/benchmarks/static_rtree.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
|
|
||||||
|
target_include_directories(util-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
|
||||||
|
target_include_directories(rtree-bench PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
|
||||||
|
|
||||||
# Check the release mode
|
# Check the release mode
|
||||||
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
@@ -135,19 +152,8 @@ if(CMAKE_BUILD_TYPE MATCHES Release)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(MAYBE_COVERAGE_LIBRARIES "")
|
if(NOT WIN32)
|
||||||
if (COVERAGE)
|
add_definitions(-DBOOST_TEST_DYN_LINK)
|
||||||
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
||||||
message(ERROR "COVERAGE=ON only make sense with a Debug build")
|
|
||||||
endif()
|
|
||||||
set(MAYBE_COVERAGE_LIBRARIES "gcov")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
|
|
||||||
endif()
|
|
||||||
if (SANITIZER)
|
|
||||||
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
||||||
message(ERROR "SANITIZER=ON only make sense with a Debug build")
|
|
||||||
endif()
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configuring compilers
|
# Configuring compilers
|
||||||
@@ -171,10 +177,8 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
|
|||||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib)
|
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib)
|
||||||
add_definitions(-DBOOST_LIB_DIAGNOSTIC)
|
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
add_definitions(-DNOMINMAX) # avoid min and max macros that can break compilation
|
add_definitions(-DNOMINMAX) # avoid min and max macros that can break compilation
|
||||||
add_definitions(-D_USE_MATH_DEFINES) #needed for M_PI with cmath.h
|
|
||||||
add_definitions(-D_WIN32_WINNT=0x0501)
|
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||||
add_definitions(-DXML_STATIC)
|
add_definitions(-DXML_STATIC)
|
||||||
find_library(ws2_32_LIBRARY_PATH ws2_32)
|
find_library(ws2_32_LIBRARY_PATH ws2_32)
|
||||||
@@ -231,13 +235,8 @@ find_package(Osmium REQUIRED COMPONENTS io)
|
|||||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
|
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
|
||||||
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost 1.49.0 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
|
||||||
if(NOT WIN32)
|
add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_SPIRIT_USE_PHOENIX_V3 -DBOOST_RESULT_OF_USE_DECLTYPE)
|
||||||
add_definitions(-DBOOST_TEST_DYN_LINK)
|
|
||||||
endif()
|
|
||||||
add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3)
|
|
||||||
add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE)
|
|
||||||
add_definitions(-DBOOST_FILESYSTEM_NO_DEPRECATED)
|
|
||||||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
@@ -248,7 +247,7 @@ 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)
|
find_package( Luabind REQUIRED )
|
||||||
include(check_luabind)
|
include(check_luabind)
|
||||||
include_directories(SYSTEM ${LUABIND_INCLUDE_DIR})
|
include_directories(SYSTEM ${LUABIND_INCLUDE_DIR})
|
||||||
|
|
||||||
@@ -298,8 +297,7 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
${OSMIUM_LIBRARIES}
|
${OSMIUM_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${ZLIB_LIBRARY}
|
${ZLIB_LIBRARY})
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
|
||||||
set(CONTRACTOR_LIBRARIES
|
set(CONTRACTOR_LIBRARIES
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
@@ -307,34 +305,37 @@ set(CONTRACTOR_LIBRARIES
|
|||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_RT_LIBRARY}
|
${MAYBE_RT_LIBRARY})
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
|
||||||
set(ENGINE_LIBRARIES
|
set(ENGINE_LIBRARIES
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_RT_LIBRARY}
|
${MAYBE_RT_LIBRARY})
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
|
||||||
set(STORAGE_LIBRARIES
|
set(STORAGE_LIBRARIES
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_RT_LIBRARY}
|
${MAYBE_RT_LIBRARY})
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
|
||||||
set(UTIL_LIBRARIES
|
set(UTIL_LIBRARIES
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES})
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
|
||||||
# Libraries
|
# Libraries
|
||||||
target_link_libraries(osrm ${ENGINE_LIBRARIES})
|
target_link_libraries(osrm ${ENGINE_LIBRARIES})
|
||||||
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
|
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})
|
||||||
|
# Tests
|
||||||
|
target_link_libraries(engine-tests ${ENGINE_LIBRARIES})
|
||||||
|
target_link_libraries(server-tests osrm ${Boost_LIBRARIES})
|
||||||
|
target_link_libraries(extractor-tests ${EXTRACTOR_LIBRARIES})
|
||||||
|
target_link_libraries(rtree-bench ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES})
|
||||||
|
target_link_libraries(util-tests ${UTIL_LIBRARIES})
|
||||||
|
|
||||||
if(BUILD_COMPONENTS)
|
if(BUILD_TOOLS)
|
||||||
|
message(STATUS "Activating OSRM internal tools")
|
||||||
find_package(GDAL)
|
find_package(GDAL)
|
||||||
if(GDAL_FOUND)
|
if(GDAL_FOUND)
|
||||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
@@ -345,10 +346,6 @@ if(BUILD_COMPONENTS)
|
|||||||
else()
|
else()
|
||||||
message(WARNING "libgdal and/or development headers not found")
|
message(WARNING "libgdal and/or development headers not found")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILD_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_LIBRARIES})
|
target_link_libraries(osrm-io-benchmark ${Boost_LIBRARIES})
|
||||||
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
@@ -384,10 +381,9 @@ set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp incl
|
|||||||
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp)
|
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp)
|
||||||
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
||||||
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
||||||
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
|
#set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
|
||||||
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
|
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
|
||||||
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
|
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
|
||||||
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
|
|
||||||
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
|
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)
|
||||||
@@ -449,8 +445,3 @@ configure_file(
|
|||||||
|
|
||||||
add_custom_target(uninstall
|
add_custom_target(uninstall
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
|
||||||
|
|
||||||
|
|
||||||
# Modular build system: each directory registered here provides its own CMakeLists.txt
|
|
||||||
add_subdirectory(unit_tests)
|
|
||||||
add_subdirectory(src/benchmarks)
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ RECURSIVE = YES
|
|||||||
|
|
||||||
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/third_party \
|
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/third_party \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/build \
|
@CMAKE_CURRENT_SOURCE_DIR@/build \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/node_modules \
|
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/unit_tests \
|
@CMAKE_CURRENT_SOURCE_DIR@/unit_tests \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
|
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/features
|
@CMAKE_CURRENT_SOURCE_DIR@/features
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
source "http://rubygems.org"
|
||||||
|
|
||||||
|
gem "cucumber"
|
||||||
|
gem "rake"
|
||||||
|
gem "osmlib-base"
|
||||||
|
gem "sys-proctable"
|
||||||
|
gem "rspec-expectations"
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
GEM
|
||||||
|
remote: http://rubygems.org/
|
||||||
|
specs:
|
||||||
|
builder (3.2.2)
|
||||||
|
cucumber (2.0.0)
|
||||||
|
builder (>= 2.1.2)
|
||||||
|
cucumber-core (~> 1.1.3)
|
||||||
|
diff-lcs (>= 1.1.3)
|
||||||
|
gherkin (~> 2.12)
|
||||||
|
multi_json (>= 1.7.5, < 2.0)
|
||||||
|
multi_test (>= 0.1.2)
|
||||||
|
cucumber-core (1.1.3)
|
||||||
|
gherkin (~> 2.12.0)
|
||||||
|
diff-lcs (1.2.5)
|
||||||
|
gherkin (2.12.2)
|
||||||
|
multi_json (~> 1.3)
|
||||||
|
multi_json (1.11.0)
|
||||||
|
multi_test (0.1.2)
|
||||||
|
osmlib-base (0.1.4)
|
||||||
|
rake (10.4.2)
|
||||||
|
rspec-expectations (3.2.1)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.2.0)
|
||||||
|
rspec-support (3.2.2)
|
||||||
|
sys-proctable (0.9.8)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
cucumber
|
||||||
|
osmlib-base
|
||||||
|
rake
|
||||||
|
rspec-expectations
|
||||||
|
sys-proctable
|
||||||
@@ -10,7 +10,6 @@ The Open Source Routing Machine is a high performance routing engine written in
|
|||||||
| Linux | develop | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
| Linux | develop | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
||||||
| Windows | master/develop | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
| Windows | master/develop | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||||
| LUAbind fork | master | [](https://travis-ci.org/DennisOSRM/luabind) |
|
| LUAbind fork | master | [](https://travis-ci.org/DennisOSRM/luabind) |
|
||||||
| Coverage | develop | [](https://coveralls.io/github/Project-OSRM/osrm-backend?branch=develop) |
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,190 @@
|
|||||||
|
require 'OSM/StreamParser'
|
||||||
|
require 'socket'
|
||||||
|
require 'digest/sha1'
|
||||||
|
require 'cucumber/rake/task'
|
||||||
|
require 'sys/proctable'
|
||||||
|
|
||||||
|
BUILD_FOLDER = 'build'
|
||||||
|
DATA_FOLDER = 'sandbox'
|
||||||
|
PROFILE = 'bicycle'
|
||||||
|
OSRM_PORT = 5000
|
||||||
|
PROFILES_FOLDER = '../profiles'
|
||||||
|
|
||||||
|
Cucumber::Rake::Task.new do |t|
|
||||||
|
t.cucumber_opts = %w{--format pretty}
|
||||||
|
end
|
||||||
|
|
||||||
|
areas = {
|
||||||
|
:kbh => { :country => 'denmark', :bbox => 'top=55.6972 left=12.5222 right=12.624 bottom=55.6376' },
|
||||||
|
:frd => { :country => 'denmark', :bbox => 'top=55.7007 left=12.4765 bottom=55.6576 right=12.5698' },
|
||||||
|
:regh => { :country => 'denmark', :bbox => 'top=56.164 left=11.792 bottom=55.403 right=12.731' },
|
||||||
|
:denmark => { :country => 'denmark', :bbox => nil },
|
||||||
|
:skaane => { :country => 'sweden', :bbox => 'top=56.55 left=12.4 bottom=55.3 right=14.6' }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
osm_data_area_name = ARGV[1] ? ARGV[1].to_s.to_sym : :kbh
|
||||||
|
raise "Unknown data area." unless areas[osm_data_area_name]
|
||||||
|
osm_data_country = areas[osm_data_area_name][:country]
|
||||||
|
osm_data_area_bbox = areas[osm_data_area_name][:bbox]
|
||||||
|
|
||||||
|
|
||||||
|
task osm_data_area_name.to_sym {} #define empty task to prevent rake from whining. will break if area has same name as a task
|
||||||
|
|
||||||
|
|
||||||
|
def each_process name, &block
|
||||||
|
Sys::ProcTable.ps do |process|
|
||||||
|
if process.comm.strip == name.strip && process.state != 'zombie'
|
||||||
|
yield process.pid.to_i, process.state.strip
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def up?
|
||||||
|
find_pid('osrm-routed') != nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_pid name
|
||||||
|
each_process(name) { |pid,state| return pid.to_i }
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def wait_for_shutdown name
|
||||||
|
timeout = 10
|
||||||
|
(timeout*10).times do
|
||||||
|
return if find_pid(name) == nil
|
||||||
|
sleep 0.1
|
||||||
|
end
|
||||||
|
raise "*** Could not terminate #{name}."
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
desc "Rebuild and run tests."
|
||||||
|
task :default => [:build]
|
||||||
|
|
||||||
|
desc "Build using CMake."
|
||||||
|
task :build do
|
||||||
|
if Dir.exists? BUILD_FOLDER
|
||||||
|
Dir.chdir BUILD_FOLDER do
|
||||||
|
system "make"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
system "mkdir build; cd build; cmake ..; make"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Setup config files."
|
||||||
|
task :setup do
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Download OSM data."
|
||||||
|
task :download do
|
||||||
|
Dir.mkdir "#{DATA_FOLDER}" unless File.exist? "#{DATA_FOLDER}"
|
||||||
|
puts "Downloading..."
|
||||||
|
puts "curl http://download.geofabrik.de/europe/#{osm_data_country}-latest.osm.pbf -o #{DATA_FOLDER}/#{osm_data_country}.osm.pbf"
|
||||||
|
raise "Error while downloading data." unless system "curl http://download.geofabrik.de/europe/#{osm_data_country}-latest.osm.pbf -o #{DATA_FOLDER}/#{osm_data_country}.osm.pbf"
|
||||||
|
if osm_data_area_bbox
|
||||||
|
puts "Cropping and converting to protobuffer..."
|
||||||
|
raise "Error while cropping data." unless system "osmosis --read-pbf file=#{DATA_FOLDER}/#{osm_data_country}.osm.pbf --bounding-box #{osm_data_area_bbox} --write-pbf file=#{DATA_FOLDER}/#{osm_data_area_name}.osm.pbf omitmetadata=true"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Crop OSM data"
|
||||||
|
task :crop do
|
||||||
|
if osm_data_area_bbox
|
||||||
|
raise "Error while cropping data." unless system "osmosis --read-pbf file=#{DATA_FOLDER}/#{osm_data_country}.osm.pbf --bounding-box #{osm_data_area_bbox} --write-pbf file=#{DATA_FOLDER}/#{osm_data_area_name}.osm.pbf omitmetadata=true"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Reprocess OSM data."
|
||||||
|
task :process => [:extract,:contract] do
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Extract OSM data."
|
||||||
|
task :extract do
|
||||||
|
Dir.chdir DATA_FOLDER do
|
||||||
|
raise "Error while extracting data." unless system "../#{BUILD_FOLDER}/osrm-extract #{osm_data_area_name}.osm.pbf --profile ../profiles/#{PROFILE}.lua"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Contract OSM data."
|
||||||
|
task :contract do
|
||||||
|
Dir.chdir DATA_FOLDER do
|
||||||
|
raise "Error while contracting data." unless system "../#{BUILD_FOLDER}/osrm-contract #{osm_data_area_name}.osrm"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Delete preprocessing files."
|
||||||
|
task :clean do
|
||||||
|
File.delete *Dir.glob("#{DATA_FOLDER}/*.osrm")
|
||||||
|
File.delete *Dir.glob("#{DATA_FOLDER}/*.osrm.*")
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Run all cucumber test"
|
||||||
|
task :test do
|
||||||
|
system "cucumber"
|
||||||
|
puts
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Run the routing server in the terminal. Press Ctrl-C to stop."
|
||||||
|
task :run do
|
||||||
|
Dir.chdir DATA_FOLDER do
|
||||||
|
system "../#{BUILD_FOLDER}/osrm-routed #{osm_data_area_name}.osrm --port #{OSRM_PORT}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Launch the routing server in the background. Use rake:down to stop it."
|
||||||
|
task :up do
|
||||||
|
Dir.chdir DATA_FOLDER do
|
||||||
|
abort("Already up.") if up?
|
||||||
|
pipe = IO.popen("../#{BUILD_FOLDER}/osrm-routed #{osm_data_area_name}.osrm --port #{OSRM_PORT} 1>>osrm-routed.log 2>>osrm-routed.log")
|
||||||
|
timeout = 5
|
||||||
|
(timeout*10).times do
|
||||||
|
begin
|
||||||
|
socket = TCPSocket.new('localhost', OSRM_PORT)
|
||||||
|
socket.puts 'ping'
|
||||||
|
rescue Errno::ECONNREFUSED
|
||||||
|
sleep 0.1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Stop the routing server."
|
||||||
|
task :down do
|
||||||
|
pid = find_pid 'osrm-routed'
|
||||||
|
if pid
|
||||||
|
Process.kill 'TERM', pid
|
||||||
|
else
|
||||||
|
puts "Already down."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Kill all osrm-extract, osrm-contract and osrm-routed processes."
|
||||||
|
task :kill do
|
||||||
|
each_process('osrm-routed') { |pid,state| Process.kill 'KILL', pid }
|
||||||
|
each_process('osrm-contract') { |pid,state| Process.kill 'KILL', pid }
|
||||||
|
each_process('osrm-extract') { |pid,state| Process.kill 'KILL', pid }
|
||||||
|
wait_for_shutdown 'osrm-routed'
|
||||||
|
wait_for_shutdown 'osrm-contract'
|
||||||
|
wait_for_shutdown 'osrm-extract'
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Get PIDs of all osrm-extract, osrm-contract and osrm-routed processes."
|
||||||
|
task :pid do
|
||||||
|
each_process 'osrm-routed' do |pid,state|
|
||||||
|
puts "#{pid}\t#{state}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Stop, reprocess and restart."
|
||||||
|
task :update => [:down,:process,:up] do
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
desc "Remove test cache files."
|
||||||
|
task :sweep do
|
||||||
|
system "rm test/cache/*"
|
||||||
|
end
|
||||||
|
|
||||||
+7
-45
@@ -8,39 +8,16 @@ SET PROJECT_DIR=%CD%
|
|||||||
ECHO PROJECT_DIR^: %PROJECT_DIR%
|
ECHO PROJECT_DIR^: %PROJECT_DIR%
|
||||||
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
||||||
ECHO cmake^: && cmake --version
|
ECHO cmake^: && cmake --version
|
||||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found GOTO ERROR
|
|
||||||
|
|
||||||
FOR /F %%G IN ("--version") DO cmake %%G 2>&1 | findstr /C:"3.5.0" > nul && goto CMAKE_NOT_OK
|
|
||||||
GOTO CMAKE_OK
|
|
||||||
|
|
||||||
:CMAKE_NOT_OK
|
|
||||||
ECHO CMAKE NOT OK - downloading new CMake
|
|
||||||
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.5/cmake-3.5.1-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|
||||||
IF NOT EXIST cmake-3.5.1-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
|
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|
||||||
SET PATH=%PROJECT_DIR%\cmake-3.5.1-win32-x86\bin;%PATH%
|
|
||||||
|
|
||||||
:CMAKE_OK
|
|
||||||
ECHO CMAKE_OK
|
|
||||||
cmake --version
|
|
||||||
|
|
||||||
ECHO activating VS command prompt ...
|
ECHO activating VS command prompt ...
|
||||||
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
|
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
|
||||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||||
|
|
||||||
ECHO platform^: %platform%
|
ECHO platform^: %platform%
|
||||||
|
|
||||||
ECHO cl.exe version
|
|
||||||
cl
|
|
||||||
ECHO msbuild version
|
|
||||||
msbuild /version
|
|
||||||
|
|
||||||
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
||||||
SET DEPSPKG=osrm-deps-win-x64-14.0.7z
|
SET DEPSPKG=osrm-deps-win-x64-14.0.7z
|
||||||
|
|
||||||
:: local development
|
:: local development
|
||||||
ECHO.
|
|
||||||
ECHO LOCAL_DEV^: %LOCAL_DEV%
|
ECHO LOCAL_DEV^: %LOCAL_DEV%
|
||||||
IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0
|
IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0
|
||||||
IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL
|
IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL
|
||||||
@@ -56,39 +33,27 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|||||||
|
|
||||||
IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps
|
IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
IF EXIST build ECHO deleting build dir... && RD /S /Q build
|
IF EXIST build ECHO deletings build dir... && RD /S /Q build
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive"
|
7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive"
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
::tree osrm-deps
|
|
||||||
|
|
||||||
MKDIR build
|
MKDIR build
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
cd build
|
cd build
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
SET OSRMDEPSDIR=%PROJECT_DIR%/osrm-deps
|
SET OSRMDEPSDIR=%PROJECT_DIR%\osrm-deps
|
||||||
set PREFIX=%OSRMDEPSDIR%/libs
|
set PREFIX=%OSRMDEPSDIR%/libs
|
||||||
set BOOST_ROOT=%OSRMDEPSDIR%/boost
|
set BOOST_ROOT=%OSRMDEPSDIR%/boost
|
||||||
set BOOST_LIBRARYDIR=%BOOST_ROOT%/lib
|
|
||||||
set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb
|
set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb
|
||||||
set TBB_ARCH_PLATFORM=intel64/vc14
|
set TBB_ARCH_PLATFORM=intel64/vc14
|
||||||
|
|
||||||
ECHO OSRMDEPSDIR ^: %OSRMDEPSDIR%
|
|
||||||
ECHO PREFIX ^: %PREFIX%
|
|
||||||
ECHO BOOST_ROOT ^: %BOOST_ROOT%
|
|
||||||
ECHO BOOST_LIBRARYDIR ^: %BOOST_LIBRARYDIR%
|
|
||||||
ECHO TBB_INSTALL_DIR ^: %TBB_INSTALL_DIR%
|
|
||||||
ECHO TBB_ARCH_PLATFORM ^: %TBB_ARCH_PLATFORM%
|
|
||||||
|
|
||||||
|
|
||||||
ECHO calling cmake ....
|
ECHO calling cmake ....
|
||||||
cmake .. ^
|
cmake .. ^
|
||||||
-G "Visual Studio 14 2015 Win64" ^
|
-G "Visual Studio 14 2015 Win64" ^
|
||||||
-DBOOST_ROOT=%BOOST_ROOT% ^
|
-DBOOST_ROOT=%BOOST_ROOT% ^
|
||||||
-DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^
|
|
||||||
-DBoost_ADDITIONAL_VERSIONS=1.58 ^
|
-DBoost_ADDITIONAL_VERSIONS=1.58 ^
|
||||||
-DBoost_USE_MULTITHREADED=ON ^
|
-DBoost_USE_MULTITHREADED=ON ^
|
||||||
-DBoost_USE_STATIC_LIBS=ON ^
|
-DBoost_USE_STATIC_LIBS=ON ^
|
||||||
@@ -116,17 +81,14 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|||||||
|
|
||||||
SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
||||||
|
|
||||||
ECHO running extractor-tests.exe ...
|
|
||||||
unit_tests\%Configuration%\extractor-tests.exe
|
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|
||||||
ECHO running engine-tests.exe ...
|
ECHO running engine-tests.exe ...
|
||||||
unit_tests\%Configuration%\engine-tests.exe
|
%Configuration%\engine-tests.exe
|
||||||
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
ECHO running extractor-tests.exe ...
|
||||||
|
%Configuration%\extractor-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
|
%Configuration%\util-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|
||||||
ECHO running server-tests.exe ...
|
|
||||||
unit_tests\%Configuration%\server-tests.exe
|
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
|
IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
|
||||||
|
|||||||
@@ -41,3 +41,9 @@ deploy:
|
|||||||
folder: /
|
folder: /
|
||||||
enable_ssl: true
|
enable_ssl: true
|
||||||
active_mode: false
|
active_mode: false
|
||||||
|
|
||||||
|
# notifications:
|
||||||
|
# - provider: HipChat
|
||||||
|
# auth_token:
|
||||||
|
# secure: boLE7BjcahdIUxv9jkN7U3F8iOASF+MkhtctlVoWJoo=
|
||||||
|
# room: Directions
|
||||||
|
|||||||
+1
-2
@@ -11,8 +11,7 @@ SET CONFIGURATION=Release
|
|||||||
FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
|
FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
|
||||||
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%
|
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%
|
||||||
|
|
||||||
::SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.5.0-win32-x86\bin;%PATH%
|
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.4.0-win32-x86\bin;%PATH%
|
||||||
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.5.1-win32-x86\bin;%PATH%
|
|
||||||
SET PATH=C:\Program Files\7-Zip;%PATH%
|
SET PATH=C:\Program Files\7-Zip;%PATH%
|
||||||
|
|
||||||
powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
|
powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
prefix=@CMAKE_INSTALL_PREFIX@
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
includedir=${prefix}/include
|
includedir=${prefix}/include ${prefix}/include/osrm
|
||||||
libdir=${prefix}/lib
|
libdir=${prefix}/lib
|
||||||
|
|
||||||
Name: libOSRM
|
Name: libOSRM
|
||||||
@@ -8,4 +8,4 @@ Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
|
|||||||
Requires:
|
Requires:
|
||||||
Libs: -L${libdir} -losrm
|
Libs: -L${libdir} -losrm
|
||||||
Libs.private: @ENGINE_LIBRARY_LISTING@
|
Libs.private: @ENGINE_LIBRARY_LISTING@
|
||||||
Cflags: -I${includedir} -I${includedir}/osrm
|
Cflags: -I${includedir}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# config/cucumber.yml
|
||||||
|
##YAML Template
|
||||||
|
---
|
||||||
|
default: --require features --tags ~@todo --tags ~@bug --tag ~@stress
|
||||||
|
verify: --require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress
|
||||||
|
jenkins: --require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress
|
||||||
|
bugs: --require features --tags @bug
|
||||||
|
todo: --require features --tags @todo
|
||||||
|
all: --require features
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
default: '--require features --tags ~@stress --tags ~@todo',
|
|
||||||
verify: '--require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress',
|
|
||||||
jenkins: '--require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress',
|
|
||||||
bugs: '--require features --tags @bug',
|
|
||||||
todo: '--require features --tags @todo',
|
|
||||||
all: '--require features'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+1
-2
@@ -29,8 +29,7 @@ int main(int argc, const char *argv[]) try
|
|||||||
using namespace osrm;
|
using namespace osrm;
|
||||||
|
|
||||||
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
|
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
|
||||||
EngineConfig config;
|
EngineConfig config{argv[1]};
|
||||||
config.storage_config = {argv[1]};
|
|
||||||
config.use_shared_memory = false;
|
config.use_shared_memory = false;
|
||||||
|
|
||||||
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on ways
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
Scenario: Bike - Access tag hierarchy on ways
|
Scenario: Bike - Access tag hierachy on ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | access | vehicle | bicycle | bothw |
|
| highway | access | vehicle | bicycle | bothw |
|
||||||
| | | | | x |
|
| | | | | x |
|
||||||
@@ -121,7 +121,6 @@ Feature: Bike - Access tags on ways
|
|||||||
| private | | | |
|
| private | | | |
|
||||||
| agricultural | | | |
|
| agricultural | | | |
|
||||||
| forestry | | | |
|
| forestry | | | |
|
||||||
| delivery | | | |
|
|
||||||
| | yes | | x |
|
| | yes | | x |
|
||||||
| | permissive | | x |
|
| | permissive | | x |
|
||||||
| | designated | | x |
|
| | designated | | x |
|
||||||
@@ -130,7 +129,6 @@ Feature: Bike - Access tags on ways
|
|||||||
| | private | | |
|
| | private | | |
|
||||||
| | agricultural | | |
|
| | agricultural | | |
|
||||||
| | forestry | | |
|
| | forestry | | |
|
||||||
| | delivery | | |
|
|
||||||
| | | yes | x |
|
| | | yes | x |
|
||||||
| | | permissive | x |
|
| | | permissive | x |
|
||||||
| | | designated | x |
|
| | | designated | x |
|
||||||
@@ -139,7 +137,6 @@ Feature: Bike - Access tags on ways
|
|||||||
| | | private | |
|
| | | private | |
|
||||||
| | | agricultural | |
|
| | | agricultural | |
|
||||||
| | | forestry | |
|
| | | forestry | |
|
||||||
| | | delivery | |
|
|
||||||
|
|
||||||
Scenario: Bike - Access tags on both node and way
|
Scenario: Bike - Access tags on both node and way
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on nodes
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
Scenario: Bike - Access tag hierarchy on nodes
|
Scenario: Bike - Access tag hierachy on nodes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
|
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
|
||||||
| | | | | x |
|
| | | | | x |
|
||||||
@@ -47,7 +47,6 @@ Feature: Bike - Access tags on nodes
|
|||||||
| private | | | |
|
| private | | | |
|
||||||
| agricultural | | | |
|
| agricultural | | | |
|
||||||
| forestry | | | |
|
| forestry | | | |
|
||||||
| delivery | | | |
|
|
||||||
| | yes | | x |
|
| | yes | | x |
|
||||||
| | permissive | | x |
|
| | permissive | | x |
|
||||||
| | designated | | x |
|
| | designated | | x |
|
||||||
@@ -56,7 +55,6 @@ Feature: Bike - Access tags on nodes
|
|||||||
| | private | | |
|
| | private | | |
|
||||||
| | agricultural | | |
|
| | agricultural | | |
|
||||||
| | forestry | | |
|
| | forestry | | |
|
||||||
| | delivery | | |
|
|
||||||
| | | yes | x |
|
| | | yes | x |
|
||||||
| | | permissive | x |
|
| | | permissive | x |
|
||||||
| | | designated | x |
|
| | | designated | x |
|
||||||
@@ -65,4 +63,3 @@ Feature: Bike - Access tags on nodes
|
|||||||
| | | private | |
|
| | | private | |
|
||||||
| | | agricultural | |
|
| | | agricultural | |
|
||||||
| | | forestry | |
|
| | | forestry | |
|
||||||
| | | delivery | |
|
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ Feature: Bike - Squares and other areas
|
|||||||
| abcda | yes | residential |
|
| abcda | yes | residential |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | abcda,abcda |
|
| a | b | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
| b | c | abcda,abcda |
|
| b | c | abcda |
|
||||||
| c | b | abcda,abcda |
|
| c | b | abcda |
|
||||||
| c | d | abcda,abcda |
|
| c | d | abcda |
|
||||||
| d | c | abcda,abcda |
|
| d | c | abcda |
|
||||||
| d | a | abcda,abcda |
|
| d | a | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
|
|
||||||
@building
|
@building
|
||||||
Scenario: Bike - Don't route on buildings
|
Scenario: Bike - Don't route on buildings
|
||||||
@@ -41,14 +41,14 @@ Feature: Bike - Squares and other areas
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | xa,xa |
|
| a | b | xa |
|
||||||
| a | d | xa,xa |
|
| a | d | xa |
|
||||||
| b | c | xa,xa |
|
| b | c | xa |
|
||||||
| c | b | xa,xa |
|
| c | b | xa |
|
||||||
| c | d | xa,xa |
|
| c | d | xa |
|
||||||
| d | c | xa,xa |
|
| d | c | xa |
|
||||||
| d | a | xa,xa |
|
| d | a | xa |
|
||||||
| a | d | xa,xa |
|
| a | d | xa |
|
||||||
|
|
||||||
@parking
|
@parking
|
||||||
Scenario: Bike - parking areas
|
Scenario: Bike - parking areas
|
||||||
@@ -65,18 +65,17 @@ Feature: Bike - Squares and other areas
|
|||||||
| abcda | (nil) | parking |
|
| abcda | (nil) | parking |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,abcda,by,by |
|
| x | y | xa,abcda,by |
|
||||||
| y | x | by,abcda,xa,xa |
|
| y | x | by,abcda,xa |
|
||||||
| a | b | abcda,abcda |
|
| a | b | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
| b | c | abcda,abcda |
|
| b | c | abcda |
|
||||||
| c | b | abcda,abcda |
|
| c | b | abcda |
|
||||||
| c | d | abcda,abcda |
|
| c | d | abcda |
|
||||||
| d | c | abcda,abcda |
|
| d | c | abcda |
|
||||||
| d | a | abcda,abcda |
|
| d | a | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
|
|
||||||
|
|
||||||
@train @platform
|
@train @platform
|
||||||
Scenario: Bike - railway platforms
|
Scenario: Bike - railway platforms
|
||||||
@@ -91,14 +90,14 @@ Feature: Bike - Squares and other areas
|
|||||||
| abcda | (nil) | platform |
|
| abcda | (nil) | platform |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,abcda,by,by |
|
| x | y | xa,abcda,by |
|
||||||
| y | x | by,abcda,xa,xa |
|
| y | x | by,abcda,xa |
|
||||||
| a | b | abcda,abcda |
|
| a | b | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
| b | c | abcda,abcda |
|
| b | c | abcda |
|
||||||
| c | b | abcda,abcda |
|
| c | b | abcda |
|
||||||
| c | d | abcda,abcda |
|
| c | d | abcda |
|
||||||
| d | c | abcda,abcda |
|
| d | c | abcda |
|
||||||
| d | a | abcda,abcda |
|
| d | a | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
@routing @bicycle @bridge
|
@routing @bicycle @bridge
|
||||||
Feature: Bicycle - Handle cycling
|
Feature: Bicycle - Handle movable bridge
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
Scenario: Bicycle - Use a ferry route
|
Scenario: Car - Use a ferry route
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c | | |
|
| a | b | c | | |
|
||||||
| | | d | | |
|
| | | d | | |
|
||||||
@@ -17,17 +17,17 @@ Feature: Bicycle - Handle cycling
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | modes |
|
||||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
|
| a | g | abc,cde,efg | 1,5,1 |
|
||||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
|
| b | f | abc,cde,efg | 1,5,1 |
|
||||||
| e | c | cde,cde | cycling,cycling |
|
| e | c | cde | 5 |
|
||||||
| e | b | cde,abc,abc | cycling,cycling,cycling |
|
| e | b | cde,abc | 5,1 |
|
||||||
| e | a | cde,abc,abc | cycling,cycling,cycling |
|
| e | a | cde,abc | 5,1 |
|
||||||
| c | e | cde,cde | cycling,cycling |
|
| c | e | cde | 5 |
|
||||||
| c | f | cde,efg,efg | cycling,cycling,cycling |
|
| c | f | cde,efg | 5,1 |
|
||||||
| c | g | cde,efg,efg | cycling,cycling,cycling |
|
| c | g | cde,efg | 5,1 |
|
||||||
|
|
||||||
Scenario: Bicycle - Properly handle durations
|
Scenario: Car - Properly handle durations
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c | | |
|
| a | b | c | | |
|
||||||
| | | d | | |
|
| | | d | | |
|
||||||
@@ -40,8 +40,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 | 1,5,1 | 5 km/h |
|
||||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
| b | f | abc,cde,efg | 1,5,1 | 4 km/h |
|
||||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
| c | e | cde | 5 | 2 km/h |
|
||||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
| e | c | cde | 5 | 2 km/h |
|
||||||
|
|||||||
@@ -19,15 +19,15 @@ Feature: Bike - Destination only, no passing through
|
|||||||
| axye | |
|
| axye | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ab,ab |
|
| a | b | ab |
|
||||||
| a | c | ab,bcd,bcd |
|
| a | c | ab,bcd |
|
||||||
| a | d | ab,bcd,bcd |
|
| a | d | ab,bcd |
|
||||||
| a | e | axye,axye |
|
| a | e | axye |
|
||||||
| e | d | de,de |
|
| e | d | de |
|
||||||
| e | c | de,bcd,bcd |
|
| e | c | de,bcd |
|
||||||
| e | b | de,bcd,bcd |
|
| e | b | de,bcd |
|
||||||
| e | a | axye,axye |
|
| e | a | axye |
|
||||||
|
|
||||||
Scenario: Bike - Destination only street
|
Scenario: Bike - Destination only street
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -45,15 +45,15 @@ Feature: Bike - Destination only, no passing through
|
|||||||
| axye | |
|
| axye | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ab,ab |
|
| a | b | ab |
|
||||||
| a | c | ab,bc,bc |
|
| a | c | ab,bc |
|
||||||
| a | d | ab,bc,cd,cd |
|
| a | d | ab,bc,cd |
|
||||||
| a | e | axye,axye |
|
| a | e | axye |
|
||||||
| e | d | de,de |
|
| e | d | de |
|
||||||
| e | c | de,cd,cd |
|
| e | c | de,dc |
|
||||||
| e | b | de,cd,bc,bc |
|
| e | b | de,dc,bc |
|
||||||
| e | a | axye,axye |
|
| e | a | axye |
|
||||||
|
|
||||||
Scenario: Bike - Routing inside a destination only area
|
Scenario: Bike - Routing inside a destination only area
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -70,8 +70,8 @@ Feature: Bike - Destination only, no passing through
|
|||||||
| axye | |
|
| axye | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | e | ab,bc,cd,de,de |
|
| a | e | ab,bc,cd,de |
|
||||||
| e | a | de,cd,bc,ab,ab |
|
| e | a | de,cd,bc,ab |
|
||||||
| b | d | bc,cd,cd |
|
| b | d | bc,cd |
|
||||||
| d | b | cd,bc,bc |
|
| d | b | cd,bc |
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ Feature: Bike - Handle ferry routes
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | g | abc,cde,efg,efg |
|
| a | g | abc,cde,efg |
|
||||||
| b | f | abc,cde,efg,efg |
|
| b | f | abc,cde,efg |
|
||||||
| e | c | cde,cde |
|
| e | c | cde |
|
||||||
| e | b | cde,abc,abc |
|
| e | b | cde,abc |
|
||||||
| e | a | cde,abc,abc |
|
| e | a | cde,abc |
|
||||||
| c | e | cde,cde |
|
| c | e | cde |
|
||||||
| c | f | cde,efg,efg |
|
| c | f | cde,efg |
|
||||||
| c | g | cde,efg,efg |
|
| c | g | cde,efg |
|
||||||
|
|
||||||
Scenario: Bike - Ferry duration, single node
|
Scenario: Bike - Ferry duration, single node
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -59,5 +59,5 @@ Feature: Bike - Handle ferry routes
|
|||||||
|
|
||||||
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 +-10 |
|
| a | d | abcd | 3600s +-10 |
|
||||||
| d | a | abcd,abcd | 3600s +-10 |
|
| d | a | abcd | 3600s +-10 |
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ Feature: Bike - Max speed restrictions
|
|||||||
| bc | residential | 80 |
|
| bc | residential | 80 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 15 km/h |
|
| a | b | ab | 15 km/h |
|
||||||
| b | c | bc,bc | 15 km/h |
|
| b | c | bc | 15 km/h |
|
||||||
|
|
||||||
Scenario: Bike - Forward/backward maxspeed
|
Scenario: Bike - Forward/backward maxspeed
|
||||||
Given the shortcuts
|
Given the shortcuts
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
@routing @bicycle @mode
|
@routing @bicycle @mode
|
||||||
Feature: Bike - Mode flag
|
Feature: Bike - Mode flag
|
||||||
|
|
||||||
|
# bicycle modes:
|
||||||
|
# 1 bike
|
||||||
|
# 2 pushing
|
||||||
|
# 3 ferry
|
||||||
|
# 4 train
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
Scenario: Bike - Mode when using a ferry
|
Scenario: Bike - Mode when using a ferry
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | |
|
| a | b | |
|
||||||
@@ -16,13 +22,13 @@ Feature: Bike - Mode flag
|
|||||||
| cd | primary | | |
|
| cd | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns | modes |
|
||||||
| a | d | ab,bc,cd,cd | cycling,ferry,cycling,cycling |
|
| a | d | ab,bc,cd | head,right,left,destination | 1,3,1 |
|
||||||
| d | a | cd,bc,ab,ab | cycling,ferry,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination | 1,3,1 |
|
||||||
| c | a | bc,ab,ab | ferry,cycling,cycling |
|
| c | a | bc,ab | head,left,destination | 3,1 |
|
||||||
| d | b | cd,bc,bc | cycling,ferry,ferry |
|
| d | b | cd,bc | head,right,destination | 1,3 |
|
||||||
| a | c | ab,bc,bc | cycling,ferry,ferry |
|
| a | c | ab,bc | head,right,destination | 1,3 |
|
||||||
| b | d | bc,cd,cd | ferry,cycling,cycling |
|
| b | d | bc,cd | head,left,destination | 3,1 |
|
||||||
|
|
||||||
Scenario: Bike - Mode when using a train
|
Scenario: Bike - Mode when using a train
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -36,13 +42,13 @@ Feature: Bike - Mode flag
|
|||||||
| cd | primary | | |
|
| cd | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns | modes |
|
||||||
| a | d | ab,bc,cd,cd | cycling,train,cycling,cycling |
|
| a | d | ab,bc,cd | head,right,left,destination | 1,4,1 |
|
||||||
| d | a | cd,bc,ab,ab | cycling,train,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination | 1,4,1 |
|
||||||
| c | a | bc,ab,ab | train,cycling,cycling |
|
| c | a | bc,ab | head,left,destination | 4,1 |
|
||||||
| d | b | cd,bc,bc | cycling,train,train |
|
| d | b | cd,bc | head,right,destination | 1,4 |
|
||||||
| a | c | ab,bc,bc | cycling,train,train |
|
| a | c | ab,bc | head,right,destination | 1,4 |
|
||||||
| b | d | bc,cd,cd | train,cycling,cycling |
|
| b | d | bc,cd | head,left,destination | 4,1 |
|
||||||
|
|
||||||
Scenario: Bike - Mode when pushing bike against oneways
|
Scenario: Bike - Mode when pushing bike against oneways
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -56,13 +62,13 @@ Feature: Bike - Mode flag
|
|||||||
| cd | primary | |
|
| cd | primary | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns | modes |
|
||||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
| a | d | ab,bc,cd | head,straight,straight,destination | 1,1,1 |
|
||||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||||
| a | c | ab,bc,bc | cycling,cycling,cycling |
|
| a | c | ab,bc | head,straight,destination | 1,1 |
|
||||||
| b | d | bc,cd,cd | cycling,cycling,cycling |
|
| b | d | bc,cd | head,straight,destination | 1,1 |
|
||||||
|
|
||||||
Scenario: Bike - Mode when pushing on pedestrain streets
|
Scenario: Bike - Mode when pushing on pedestrain streets
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -76,13 +82,13 @@ Feature: Bike - Mode flag
|
|||||||
| cd | primary |
|
| cd | primary |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns | modes |
|
||||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
|
||||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||||
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
|
| a | c | ab,bc | head,right,destination | 1,2 |
|
||||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
| b | d | bc,cd | head,left,destination | 2,1 |
|
||||||
|
|
||||||
Scenario: Bike - Mode when pushing on pedestrain areas
|
Scenario: Bike - Mode when pushing on pedestrain areas
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -96,13 +102,13 @@ Feature: Bike - Mode flag
|
|||||||
| df | primary | |
|
| df | primary | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | modes |
|
||||||
| a | f | ab,bcd,df,df | cycling,pushing bike,cycling,cycling |
|
| a | f | ab,bcd,df | 1,2,1 |
|
||||||
| f | a | df,bcd,ab,ab | cycling,pushing bike,cycling,cycling |
|
| f | a | df,bcd,ab | 1,2,1 |
|
||||||
| d | a | bcd,ab,ab | pushing bike,cycling,cycling |
|
| d | a | bcd,ab | 2,1 |
|
||||||
| f | b | df,bcd,bcd | cycling,pushing bike,pushing bike |
|
| f | b | df,bcd | 1,2 |
|
||||||
| a | d | ab,bcd,bcd | cycling,pushing bike,pushing bike |
|
| a | d | ab,bcd | 1,2 |
|
||||||
| b | f | bcd,df,df | pushing bike,cycling,cycling |
|
| b | f | bcd,df | 2,1 |
|
||||||
|
|
||||||
Scenario: Bike - Mode when pushing on steps
|
Scenario: Bike - Mode when pushing on steps
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -116,13 +122,13 @@ Feature: Bike - Mode flag
|
|||||||
| cd | primary |
|
| cd | primary |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns | modes |
|
||||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
|
||||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||||
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
|
| a | c | ab,bc | head,right,destination | 1,2 |
|
||||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
| b | d | bc,cd | head,left,destination | 2,1 |
|
||||||
|
|
||||||
Scenario: Bike - Mode when bicycle=dismount
|
Scenario: Bike - Mode when bicycle=dismount
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -136,13 +142,13 @@ Feature: Bike - Mode flag
|
|||||||
| cd | primary | |
|
| cd | primary | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns | modes |
|
||||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
|
||||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||||
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
|
| a | c | ab,bc | head,right,destination | 1,2 |
|
||||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
| b | d | bc,cd | head,left,destination | 2,1 |
|
||||||
|
|
||||||
Scenario: Bicycle - Modes when starting on forward oneway
|
Scenario: Bicycle - Modes when starting on forward oneway
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -153,9 +159,9 @@ Feature: Bike - Mode flag
|
|||||||
| ab | yes |
|
| ab | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | modes |
|
||||||
| a | b | ab,ab | cycling,cycling |
|
| a | b | ab | 1 |
|
||||||
| b | a | ab,ab | pushing bike,pushing bike |
|
| b | a | ab | 2 |
|
||||||
|
|
||||||
Scenario: Bicycle - Modes when starting on reverse oneway
|
Scenario: Bicycle - Modes when starting on reverse oneway
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -166,6 +172,6 @@ Feature: Bike - Mode flag
|
|||||||
| ab | -1 |
|
| ab | -1 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | modes |
|
||||||
| a | b | ab,ab | pushing bike,pushing bike |
|
| a | b | ab | 2 |
|
||||||
| b | a | ab,ab | cycling,cycling |
|
| b | a | ab | 1 |
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ Feature: Bike - Street names in instructions
|
|||||||
| bc | Your Way |
|
| bc | Your Way |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | My Way,Your Way,Your Way |
|
| a | c | My Way,Your Way |
|
||||||
|
|
||||||
@unnamed
|
@unnamed
|
||||||
Scenario: Bike - Use way type to describe unnamed ways
|
Scenario: Bike - Use way type to describe unnamed ways
|
||||||
@@ -29,5 +29,5 @@ Feature: Bike - Street names in instructions
|
|||||||
| bcd | track | |
|
| bcd | track | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | d | {highway:cycleway},{highway:track},{highway:track} |
|
| a | d | {highway:cycleway},{highway:track} |
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ Feature: Bike - Oneway streets
|
|||||||
| da | | no |
|
| da | | no |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ab,ab |
|
| a | b | ab |
|
||||||
| b | a | bc,cd,da,da |
|
| b | a | bc,cd,da |
|
||||||
|
|
||||||
Scenario: Bike - Handle various oneway tag values
|
Scenario: Bike - Handle various oneway tag values
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -124,5 +124,5 @@ Feature: Bike - Oneway streets
|
|||||||
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | ab,bc,bc |
|
| a | c | ab,bc |
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Feature: Bike - Accessability of different way types
|
|||||||
| primary | -1 | foot | bike |
|
| primary | -1 | foot | bike |
|
||||||
| pedestrian | -1 | foot | foot |
|
| pedestrian | -1 | foot | foot |
|
||||||
|
|
||||||
@square
|
@square
|
||||||
Scenario: Bike - Push bikes on pedestrian areas
|
Scenario: Bike - Push bikes on pedestrian areas
|
||||||
Given the node map
|
Given the node map
|
||||||
| x | |
|
| x | |
|
||||||
@@ -46,14 +46,14 @@ Feature: Bike - Accessability of different way types
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | abcda,abcda |
|
| a | b | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
| b | c | abcda,abcda |
|
| b | c | abcda |
|
||||||
| c | b | abcda,abcda |
|
| c | b | abcda |
|
||||||
| c | d | abcda,abcda |
|
| c | d | abcda |
|
||||||
| d | c | abcda,abcda |
|
| d | c | abcda |
|
||||||
| d | a | abcda,abcda |
|
| d | a | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
|
|
||||||
Scenario: Bike - Pushing bikes on ways with foot=yes
|
Scenario: Bike - Pushing bikes on ways with foot=yes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -62,7 +62,8 @@ Feature: Bike - Accessability of different way types
|
|||||||
| motorway | yes | foot | |
|
| motorway | yes | foot | |
|
||||||
| runway | | | |
|
| runway | | | |
|
||||||
| runway | yes | foot | foot |
|
| runway | yes | foot | foot |
|
||||||
|
|
||||||
|
@todo
|
||||||
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
|
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | foot:forward | foot:backward | forw | backw |
|
| highway | foot:forward | foot:backward | forw | backw |
|
||||||
@@ -71,20 +72,20 @@ Feature: Bike - Accessability of different way types
|
|||||||
| motorway | | yes | | foot |
|
| motorway | | yes | | foot |
|
||||||
|
|
||||||
@construction
|
@construction
|
||||||
Scenario: Bike - Don't allow routing on ways still under construction
|
Scenario: Bike - Don't allow routing on ways still under construction
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | foot | bicycle | bothw |
|
| highway | foot | bicycle | bothw |
|
||||||
| primary | | | x |
|
| primary | | | x |
|
||||||
| construction | | | |
|
| construction | | | |
|
||||||
| construction | yes | | |
|
| construction | yes | | |
|
||||||
| construction | | yes | |
|
| construction | | yes | |
|
||||||
|
|
||||||
@roundabout
|
@roundabout
|
||||||
Scenario: Bike - Don't push bikes against oneway flow on roundabouts
|
Scenario: Bike - Don't push bikes against oneway flow on roundabouts
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| junction | forw | backw |
|
| junction | forw | backw |
|
||||||
| roundabout | x | |
|
| roundabout | x | |
|
||||||
|
|
||||||
Scenario: Bike - Instructions when pushing bike on oneways
|
Scenario: Bike - Instructions when pushing bike on oneways
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | |
|
| a | b | |
|
||||||
@@ -97,12 +98,13 @@ Feature: Bike - Accessability of different way types
|
|||||||
| cd | primary | |
|
| cd | primary | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns |
|
||||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
| a | d | ab,bc,cd | head,straight,straight,destination |
|
||||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination |
|
||||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
| c | a | bc,ab | head,left,destination |
|
||||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
| d | b | cd,bc | head,right,destination |
|
||||||
|
|
||||||
|
@todo
|
||||||
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
|
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | |
|
| a | b | |
|
||||||
@@ -115,8 +117,8 @@ Feature: Bike - Accessability of different way types
|
|||||||
| cd | primary |
|
| cd | primary |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns |
|
||||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
| a | d | ab,bc,cd | head,right,left,destination |
|
||||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
| d | a | cd,bc,ab | head,right,left,destination |
|
||||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
| c | a | bc,ab | head,left,destination |
|
||||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
| d | b | cd,bc | head,right,destination |
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ Feature: Bike - Way ref
|
|||||||
| ab | Utopia Drive | E7 |
|
| ab | Utopia Drive | E7 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | Utopia Drive / E7,Utopia Drive / E7 |
|
| a | b | Utopia Drive / E7 |
|
||||||
|
|
||||||
Scenario: Bike - Way with only ref
|
Scenario: Bike - Way with only ref
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -26,7 +26,7 @@ Feature: Bike - Way ref
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | E7,E7 |
|
| a | b | E7 |
|
||||||
|
|
||||||
Scenario: Bike - Way with only name
|
Scenario: Bike - Way with only name
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -37,5 +37,5 @@ Feature: Bike - Way ref
|
|||||||
| ab | Utopia Drive |
|
| ab | Utopia Drive |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | Utopia Drive,Utopia Drive |
|
| a | b | Utopia Drive |
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_left_turn |
|
| restriction | sj | wj | j | no_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Bike - No right turn
|
Scenario: Bike - No right turn
|
||||||
@@ -49,10 +49,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | ej | j | no_right_turn |
|
| restriction | sj | ej | j | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Bike - No u-turn
|
Scenario: Bike - No u-turn
|
||||||
@@ -73,10 +73,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_u_turn |
|
| restriction | sj | wj | j | no_u_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Bike - Handle any no_* relation
|
Scenario: Bike - Handle any no_* relation
|
||||||
@@ -97,10 +97,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_weird_zigzags |
|
| restriction | sj | wj | j | no_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Bike - Only left turn
|
Scenario: Bike - Only left turn
|
||||||
@@ -121,10 +121,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | wj | j | only_left_turn |
|
| restriction | sj | wj | j | only_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Bike - Only right turn
|
Scenario: Bike - Only right turn
|
||||||
@@ -145,10 +145,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | ej | j | only_right_turn |
|
| restriction | sj | ej | j | only_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Bike - Only straight on
|
Scenario: Bike - Only straight on
|
||||||
@@ -169,10 +169,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | nj | j | only_straight_on |
|
| restriction | sj | nj | j | only_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Bike - Handle any only_* restriction
|
Scenario: Bike - Handle any only_* restriction
|
||||||
@@ -193,10 +193,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | nj | j | only_weird_zigzags |
|
| restriction | sj | nj | j | only_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Bike - Except tag and on no_ restrictions
|
Scenario: Bike - Except tag and on no_ restrictions
|
||||||
@@ -222,11 +222,11 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | dj | j | no_right_turn | bicycle |
|
| restriction | sj | dj | j | no_right_turn | bicycle |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,aj,aj |
|
| s | a | sj,aj |
|
||||||
| s | b | sj,bj,bj |
|
| s | b | sj,bj |
|
||||||
| s | c | sj,cj,cj |
|
| s | c | sj,cj |
|
||||||
| s | d | sj,dj,dj |
|
| s | d | sj,dj |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Bike - Except tag and on only_ restrictions
|
Scenario: Bike - Except tag and on only_ restrictions
|
||||||
@@ -246,9 +246,9 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | aj | j | only_straight_on | bicycle |
|
| restriction | sj | aj | j | only_straight_on | bicycle |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,aj,aj |
|
| s | a | sj,aj |
|
||||||
| s | b | sj,bj,bj |
|
| s | b | sj,bj |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Bike - Multiple except tag values
|
Scenario: Bike - Multiple except tag values
|
||||||
@@ -280,10 +280,10 @@ Feature: Bike - Turn restrictions
|
|||||||
| restriction | sj | jf | j | no_straight_on | bicycle, bus |
|
| restriction | sj | jf | j | no_straight_on | bicycle, bus |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,ja,ja |
|
| s | a | sj,ja |
|
||||||
| s | b | sj,jb,jb |
|
| s | b | sj,jb |
|
||||||
| s | c | sj,jc,jc |
|
| s | c | sj,jc |
|
||||||
| s | d | sj,jd,jd |
|
| s | d | sj,jd |
|
||||||
| s | e | sj,je,je |
|
| s | e | sj,je |
|
||||||
| s | f | sj,jf,jf |
|
| s | f | sj,jf |
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
@routing @bicycle @roundabout @instruction
|
||||||
|
Feature: Roundabout Instructions
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "bicycle"
|
||||||
|
|
||||||
|
Scenario: Bicycle - Roundabout instructions
|
||||||
|
Given the node map
|
||||||
|
| | | v | | |
|
||||||
|
| | | d | | |
|
||||||
|
| s | a | | c | u |
|
||||||
|
| | | b | | |
|
||||||
|
| | | t | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction |
|
||||||
|
| sa | |
|
||||||
|
| tb | |
|
||||||
|
| uc | |
|
||||||
|
| vd | |
|
||||||
|
| abcda | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns |
|
||||||
|
| s | t | sa,tb | head,enter_roundabout-1,destination |
|
||||||
|
| s | u | sa,uc | head,enter_roundabout-2,destination |
|
||||||
|
| s | v | sa,vd | head,enter_roundabout-3,destination |
|
||||||
|
| u | v | uc,vd | head,enter_roundabout-1,destination |
|
||||||
|
| u | s | uc,sa | head,enter_roundabout-2,destination |
|
||||||
|
| u | t | uc,tb | head,enter_roundabout-3,destination |
|
||||||
@@ -31,7 +31,7 @@ Feature: Bike - Stop areas for public transport
|
|||||||
| public_transport | stop_area | c | st |
|
| public_transport | stop_area | c | st |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | d | abcd,abcd |
|
| a | d | abcd |
|
||||||
| s | t | st,st |
|
| s | t | st |
|
||||||
| s | d | /st,.+,abcd/,abcd/ |
|
| s | d | /st,.+,abcd/ |
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ Feature: Turn Penalties
|
|||||||
| jg |
|
| jg |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time | distance |
|
| from | to | route | time | distance |
|
||||||
| s | a | sj,ja,ja | 39s +-1 | 242m +-1 |
|
| s | a | sj,ja | 39s +-1 | 242m +-1 |
|
||||||
| s | b | sj,jb,jb | 30s +-1 | 200m +-1 |
|
| s | b | sj,jb | 30s +-1 | 200m +-1 |
|
||||||
| s | c | sj,jc,jc | 29s +-1 | 242m +-1 |
|
| s | c | sj,jc | 29s +-1 | 242m +-1 |
|
||||||
| s | d | sj,jd,jd | 20s +-1 | 200m +-1 |
|
| s | d | sj,jd | 20s +-1 | 200m +-1 |
|
||||||
| s | e | sj,je,je | 29s +-1 | 242m +-1 |
|
| s | e | sj,je | 29s +-1 | 242m +-1 |
|
||||||
| s | f | sj,jf,jf | 30s +-1 | 200m +-1 |
|
| s | f | sj,jf | 30s +-1 | 200m +-1 |
|
||||||
| s | g | sj,jg,jg | 39s +-1 | 242m +-1 |
|
| s | g | sj,jg | 39s +-1 | 242m +-1 |
|
||||||
@@ -5,7 +5,7 @@ Feature: Car - Restricted access
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
|
|
||||||
Scenario: Car - Access tag hierarchy on ways
|
Scenario: Car - Access tag hierachy on ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| access | vehicle | motor_vehicle | motorcar | bothw |
|
| access | vehicle | motor_vehicle | motorcar | bothw |
|
||||||
| | | | | x |
|
| | | | | x |
|
||||||
@@ -30,7 +30,7 @@ Feature: Car - Restricted access
|
|||||||
| | | no | yes | x |
|
| | | no | yes | x |
|
||||||
| | | yes | no | |
|
| | | yes | no | |
|
||||||
|
|
||||||
Scenario: Car - Access tag hierarchy on nodes
|
Scenario: Car - Access tag hierachy 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 |
|
||||||
| | | | | x |
|
| | | | | x |
|
||||||
@@ -94,7 +94,6 @@ Feature: Car - Restricted access
|
|||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestry | |
|
||||||
| psv | |
|
| psv | |
|
||||||
| delivery | |
|
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
|
||||||
|
|
||||||
@@ -109,7 +108,6 @@ Feature: Car - Restricted access
|
|||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestry | |
|
||||||
| psv | |
|
| psv | |
|
||||||
| 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
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ 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 | 47 km/h +- 1 |
|
| a | b | ab | 47 km/h +- 1 |
|
||||||
| b | c | bc,bc | 47 km/h +- 1 |
|
| b | c | bc | 47 km/h +- 1 |
|
||||||
|
|
||||||
Scenario: Car - Advisory speed overwrites forward maxspeed
|
Scenario: Car - Advisory speed overwrites forward maxspeed
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -31,8 +31,8 @@ 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 | 47 km/h +- 1 |
|
| a | b | ab | 47 km/h +- 1 |
|
||||||
| b | c | bc,bc | 47 km/h +- 1 |
|
| b | c | bc | 47 km/h +- 1 |
|
||||||
|
|
||||||
Scenario: Car - Advisory speed overwrites backwards maxspeed
|
Scenario: Car - Advisory speed overwrites backwards maxspeed
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -45,23 +45,8 @@ 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 |
|
||||||
| b | a | ab,ab | 47 km/h +- 1 |
|
| b | a | ab | 47 km/h +- 1 |
|
||||||
| c | b | bc,bc | 47 km/h +- 1 |
|
| c | b | bc | 47 km/h +- 1 |
|
||||||
|
|
||||||
Scenario: Car - Advisory speed overwrites backwards maxspeed
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | maxspeed:backward | maxspeed:advisory:backward |
|
|
||||||
| ab | residential | | 45 |
|
|
||||||
| bc | residential | 90 | 45 |
|
|
||||||
| cd | residential | | 45 |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | speed |
|
|
||||||
| c | b | bc,bc | 47 km/h +- 1 |
|
|
||||||
| d | c | cd,cd | 47 km/h +- 1 |
|
|
||||||
|
|
||||||
Scenario: Car - Directional advisory speeds play nice with eachother
|
Scenario: Car - Directional advisory speeds play nice with eachother
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -74,9 +59,9 @@ 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 | 47 km/h +- 1 |
|
| a | b | ab | 47 km/h +- 1 |
|
||||||
| b | a | ab,ab | 59 km/h +- 1 |
|
| b | a | ab | 59 km/h +- 1 |
|
||||||
| b | c | bc,bc | 59 km/h +- 1 |
|
| b | c | bc | 59 km/h +- 1 |
|
||||||
| c | b | bc,bc | 47 km/h +- 1 |
|
| c | b | bc | 47 km/h +- 1 |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -1,5 +1,5 @@
|
|||||||
@routing @car @bridge
|
@routing @car @bridge
|
||||||
Feature: Car - Handle driving
|
Feature: Car - Handle movable bridge
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
@@ -17,15 +17,15 @@ Feature: Car - Handle driving
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | modes |
|
||||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving |
|
| a | g | abc,cde,efg | 1,3,1 |
|
||||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving |
|
| b | f | abc,cde,efg | 1,3,1 |
|
||||||
| e | c | cde,cde | driving,driving |
|
| e | c | cde | 3 |
|
||||||
| e | b | cde,abc,abc | driving,driving,driving |
|
| e | b | cde,abc | 3,1 |
|
||||||
| e | a | cde,abc,abc | driving,driving,driving |
|
| e | a | cde,abc | 3,1 |
|
||||||
| c | e | cde,cde | driving,driving |
|
| c | e | cde | 3 |
|
||||||
| c | f | cde,efg,efg | driving,driving,driving |
|
| c | f | cde,efg | 3,1 |
|
||||||
| c | g | cde,efg,efg | driving,driving,driving |
|
| c | g | cde,efg | 3,1 |
|
||||||
|
|
||||||
Scenario: Car - Properly handle durations
|
Scenario: Car - Properly handle durations
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -40,8 +40,8 @@ Feature: Car - Handle driving
|
|||||||
| 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 | driving,driving,driving,driving | 7 km/h |
|
| a | g | abc,cde,efg | 1,3,1 | 7 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 5 km/h |
|
| b | f | abc,cde,efg | 1,3,1 | 5 km/h |
|
||||||
| c | e | cde,cde | driving,driving | 2 km/h |
|
| c | e | cde | 3 | 2 km/h |
|
||||||
| e | c | cde,cde | driving,driving | 2 km/h |
|
| e | c | cde | 3 | 2 km/h |
|
||||||
|
|||||||
@@ -19,15 +19,15 @@ Feature: Car - Destination only, no passing through
|
|||||||
| axye | |
|
| axye | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ab,ab |
|
| a | b | ab |
|
||||||
| a | c | ab,bcd,bcd |
|
| a | c | ab,bcd |
|
||||||
| a | d | ab,bcd,bcd |
|
| a | d | ab,bcd |
|
||||||
| a | e | axye,axye |
|
| a | e | axye |
|
||||||
| e | d | de,de |
|
| e | d | de |
|
||||||
| e | c | de,bcd,bcd |
|
| e | c | de,bcd |
|
||||||
| e | b | de,bcd,bcd |
|
| e | b | de,bcd |
|
||||||
| e | a | axye,axye |
|
| e | a | axye |
|
||||||
|
|
||||||
Scenario: Car - Destination only street
|
Scenario: Car - Destination only street
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -45,15 +45,15 @@ Feature: Car - Destination only, no passing through
|
|||||||
| axye | |
|
| axye | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ab,ab |
|
| a | b | ab |
|
||||||
| a | c | ab,bc,bc |
|
| a | c | ab,bc |
|
||||||
| a | d | ab,bc,cd,cd |
|
| a | d | ab,bc,cd |
|
||||||
| a | e | axye,axye |
|
| a | e | axye |
|
||||||
| e | d | de,de |
|
| e | d | de |
|
||||||
| e | c | de,cd,cd |
|
| e | c | de,dc |
|
||||||
| e | b | de,cd,bc,bc |
|
| e | b | de,dc,bc |
|
||||||
| e | a | axye,axye |
|
| e | a | axye |
|
||||||
|
|
||||||
Scenario: Car - Routing inside a destination only area
|
Scenario: Car - Routing inside a destination only area
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -70,8 +70,8 @@ Feature: Car - Destination only, no passing through
|
|||||||
| axye | |
|
| axye | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | e | ab,bc,cd,de,de |
|
| a | e | ab,bc,cd,de |
|
||||||
| e | a | de,cd,bc,ab,ab |
|
| e | a | de,cd,bc,ab |
|
||||||
| b | d | bc,cd,cd |
|
| b | d | bc,cd |
|
||||||
| d | b | cd,bc,bc |
|
| d | b | cd,bc |
|
||||||
|
|||||||
+19
-19
@@ -17,15 +17,15 @@ 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 |
|
| from | to | route | modes |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving |
|
| a | g | abc,cde,efg | 1,2,1 |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving |
|
| b | f | abc,cde,efg | 1,2,1 |
|
||||||
| e | c | cde,cde | ferry,ferry |
|
| e | c | cde | 2 |
|
||||||
| e | b | cde,abc,abc | ferry,driving,driving |
|
| e | b | cde,abc | 2,1 |
|
||||||
| e | a | cde,abc,abc | ferry,driving,driving |
|
| e | a | cde,abc | 2,1 |
|
||||||
| c | e | cde,cde | ferry,ferry |
|
| c | e | cde | 2 |
|
||||||
| c | f | cde,efg,efg | ferry,driving,driving |
|
| c | f | cde,efg | 2,1 |
|
||||||
| c | g | cde,efg,efg | ferry,driving,driving |
|
| c | g | cde,efg | 2,1 |
|
||||||
|
|
||||||
Scenario: Car - Properly handle simple durations
|
Scenario: Car - Properly handle simple durations
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -40,11 +40,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 |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
|
| a | g | abc,cde,efg | 1,2,1 | 25 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
|
| b | f | abc,cde,efg | 1,2,1 | 20 km/h |
|
||||||
| c | e | cde,cde | ferry,ferry | 12 km/h |
|
| c | e | cde | 2 | 12 km/h |
|
||||||
| e | c | cde,cde | ferry,ferry | 12 km/h |
|
| e | c | cde | 2 | 12 km/h |
|
||||||
|
|
||||||
Scenario: Car - Properly handle ISO 8601 durations
|
Scenario: Car - Properly handle ISO 8601 durations
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -59,8 +59,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 |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
|
| a | g | abc,cde,efg | 1,2,1 | 25 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
|
| b | f | abc,cde,efg | 1,2,1 | 20 km/h |
|
||||||
| c | e | cde,cde | ferry,ferry | 12 km/h |
|
| c | e | cde | 2 | 12 km/h |
|
||||||
| e | c | cde,cde | ferry,ferry | 12 km/h |
|
| e | c | cde | 2 | 12 km/h |
|
||||||
|
|||||||
+15
-15
@@ -24,9 +24,9 @@ Feature: Car - Speed on links
|
|||||||
| dy | unclassified |
|
| dy | unclassified |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,ae,ef,fd,dy,dy |
|
| x | y | xa,ae,ef,fd,dy |
|
||||||
| b | c | bc,bc |
|
| b | c | bc |
|
||||||
|
|
||||||
Scenario: Car - Use trunk_link when reasonable
|
Scenario: Car - Use trunk_link when reasonable
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -44,9 +44,9 @@ Feature: Car - Speed on links
|
|||||||
| fd | trunk |
|
| fd | trunk |
|
||||||
| dy | unclassified |
|
| dy | unclassified |
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,ae,ef,fd,dy,dy |
|
| x | y | xa,ae,ef,fd,dy |
|
||||||
| b | c | bc,bc |
|
| b | c | bc |
|
||||||
|
|
||||||
Scenario: Car - Use primary_link when reasonable
|
Scenario: Car - Use primary_link when reasonable
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -64,9 +64,9 @@ Feature: Car - Speed on links
|
|||||||
| fd | primary |
|
| fd | primary |
|
||||||
| dy | unclassified |
|
| dy | unclassified |
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,ae,ef,fd,dy,dy |
|
| x | y | xa,ae,ef,fd,dy |
|
||||||
| b | c | bc,bc |
|
| b | c | bc |
|
||||||
|
|
||||||
Scenario: Car - Use secondary_link when reasonable
|
Scenario: Car - Use secondary_link when reasonable
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -85,9 +85,9 @@ Feature: Car - Speed on links
|
|||||||
| dy | unclassified |
|
| dy | unclassified |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,ae,ef,fd,dy,dy |
|
| x | y | xa,ae,ef,fd,dy |
|
||||||
| b | c | bc,bc |
|
| b | c | bc |
|
||||||
|
|
||||||
Scenario: Car - Use tertiary_link when reasonable
|
Scenario: Car - Use tertiary_link when reasonable
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -106,6 +106,6 @@ Feature: Car - Speed on links
|
|||||||
| dy | unclassified |
|
| dy | unclassified |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,ae,ef,fd,dy,dy |
|
| x | y | xa,ae,ef,fd,dy |
|
||||||
| b | c | bc,bc |
|
| b | c | bc |
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ 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 | 79 km/h |
|
| a | b | ab | 78 km/h |
|
||||||
| b | c | bc,bc | 59 km/h +- 1 |
|
| b | c | bc | 59 km/h +- 1 |
|
||||||
| c | d | cd,cd | 51 km/h |
|
| c | d | cd | 51 km/h |
|
||||||
| d | e | de,de | 75 km/h |
|
| d | e | de | 75 km/h |
|
||||||
| e | f | ef,ef | 91 km/h |
|
| e | f | ef | 90 km/h |
|
||||||
| f | g | fg,fg | 107 km/h |
|
| f | g | fg | 106 km/h |
|
||||||
|
|
||||||
Scenario: Car - Do not ignore maxspeed when higher than way speed
|
Scenario: Car - Do not ignore maxspeed when higher than way speed
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -40,9 +40,9 @@ 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 | 31 km/h |
|
| a | b | ab | 31 km/h |
|
||||||
| b | c | bc,bc | 83 km/h +- 1 |
|
| b | c | bc | 83 km/h +- 1 |
|
||||||
| c | d | cd,cd | 51 km/h |
|
| c | d | cd | 51 km/h |
|
||||||
|
|
||||||
Scenario: Car - Forward/backward maxspeed
|
Scenario: Car - Forward/backward maxspeed
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ Feature: Car - Mode flag
|
|||||||
| cd | primary | | |
|
| cd | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | turns | modes |
|
||||||
| a | d | ab,bc,cd,cd | driving,ferry,driving,driving |
|
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
|
||||||
| d | a | cd,bc,ab,ab | driving,ferry,driving,driving |
|
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||||
| c | a | bc,ab,ab | ferry,driving,driving |
|
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||||
| d | b | cd,bc,bc | driving,ferry,ferry |
|
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||||
| a | c | ab,bc,bc | driving,ferry,ferry |
|
| a | c | ab,bc | head,right,destination | 1,2 |
|
||||||
| b | d | bc,cd,cd | ferry,driving,driving |
|
| b | d | bc,cd | head,left,destination | 2,1 |
|
||||||
|
|
||||||
Scenario: Car - Snapping when using a ferry
|
Scenario: Car - Snapping when using a ferry
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -34,7 +34,7 @@ Feature: Car - Mode flag
|
|||||||
| ef | primary | | |
|
| ef | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | time |
|
| from | to | route | turns | modes | time |
|
||||||
| c | d | bcde,bcde | ferry,ferry | 600s |
|
| c | d | bcde | head,destination | 2 | 600s |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ Feature: Car - Street names in instructions
|
|||||||
| bc | Your Way | A1 |
|
| bc | Your Way | A1 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | My Way,Your Way (A1),Your Way (A1) |
|
| a | c | My Way,Your Way (A1) |
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
Scenario: Car - Use way type to describe unnamed ways
|
Scenario: Car - Use way type to describe unnamed ways
|
||||||
@@ -29,5 +29,5 @@ Feature: Car - Street names in instructions
|
|||||||
| bcd | residential | |
|
| bcd | residential | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | tertiary,residential,residential |
|
| a | c | tertiary,residential |
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ Feature: Car - Oneway streets
|
|||||||
| da | |
|
| da | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ab,ab |
|
| a | b | ab |
|
||||||
| b | a | bc,cd,da,da |
|
| b | a | bc,cd,da |
|
||||||
|
|
||||||
Scenario: Car - Cars should not be affected by bicycle tags
|
Scenario: Car - Cars should not be affected by bicycle tags
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -75,5 +75,5 @@ Feature: Car - Oneway streets
|
|||||||
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | ab,bc,bc |
|
| a | c | ab,bc |
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_left_turn |
|
| restriction | sj | wj | j | no_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| s | w | |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - No straight on
|
Scenario: Car - No straight on
|
||||||
@@ -55,8 +55,8 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | bj | jd | j | no_straight_on |
|
| restriction | bj | jd | j | no_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | e | av,vw,wx,xy,yz,ze,ze |
|
| a | e | av,vw,wx,xy,yz,ze |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - No right turn
|
Scenario: Car - No right turn
|
||||||
@@ -77,10 +77,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | ej | j | no_right_turn |
|
| restriction | sj | ej | j | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | |
|
| s | e | |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - No u-turn
|
Scenario: Car - No u-turn
|
||||||
@@ -101,10 +101,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_u_turn |
|
| restriction | sj | wj | j | no_u_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| s | w | |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - Handle any no_* relation
|
Scenario: Car - Handle any no_* relation
|
||||||
@@ -125,10 +125,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_weird_zigzags |
|
| restriction | sj | wj | j | no_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| s | w | |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only left turn
|
Scenario: Car - Only left turn
|
||||||
@@ -149,10 +149,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | wj | j | only_left_turn |
|
| restriction | sj | wj | j | only_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | |
|
| s | n | |
|
||||||
| s | e | |
|
| s | e | |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only right turn
|
Scenario: Car - Only right turn
|
||||||
@@ -173,10 +173,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | ej | j | only_right_turn |
|
| restriction | sj | ej | j | only_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| s | w | |
|
||||||
| s | n | |
|
| s | n | |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only straight on
|
Scenario: Car - Only straight on
|
||||||
@@ -197,10 +197,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | nj | j | only_straight_on |
|
| restriction | sj | nj | j | only_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| s | w | |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | |
|
| s | e | |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - Handle any only_* restriction
|
Scenario: Car - Handle any only_* restriction
|
||||||
@@ -221,10 +221,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | nj | j | only_weird_zigzags |
|
| restriction | sj | nj | j | only_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| s | w | |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | |
|
| s | e | |
|
||||||
|
|
||||||
@specific
|
@specific
|
||||||
Scenario: Car - :hgv-qualified on a standard turn restriction
|
Scenario: Car - :hgv-qualified on a standard turn restriction
|
||||||
@@ -245,10 +245,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | nj | j | no_straight_on |
|
| restriction | sj | nj | j | no_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@specific
|
@specific
|
||||||
Scenario: Car - :motorcar-qualified on a standard turn restriction
|
Scenario: Car - :motorcar-qualified on a standard turn restriction
|
||||||
@@ -269,10 +269,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | nj | j | no_straight_on |
|
| restriction | sj | nj | j | no_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | |
|
| s | n | |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Car - Except tag and on no_ restrictions
|
Scenario: Car - Except tag and on no_ restrictions
|
||||||
@@ -298,11 +298,11 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | dj | j | no_right_turn | motorcar |
|
| restriction | sj | dj | j | no_right_turn | motorcar |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,aj,aj |
|
| s | a | sj,aj |
|
||||||
| s | b | |
|
| s | b | |
|
||||||
| s | c | |
|
| s | c | |
|
||||||
| s | d | sj,dj,dj |
|
| s | d | sj,dj |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Car - Except tag and on only_ restrictions
|
Scenario: Car - Except tag and on only_ restrictions
|
||||||
@@ -322,9 +322,9 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | sj | aj | j | only_straight_on | motorcar |
|
| restriction | sj | aj | j | only_straight_on | motorcar |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,aj,aj |
|
| s | a | sj,aj |
|
||||||
| s | b | sj,bj,bj |
|
| s | b | sj,bj |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Car - Several only_ restrictions at the same segment
|
Scenario: Car - Several only_ restrictions at the same segment
|
||||||
@@ -356,10 +356,10 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | da | ae | a | only_right_turn |
|
| restriction | da | ae | a | only_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | f | ae,xa,bx,fb,fb |
|
| e | f | ae,xa,bx,fb |
|
||||||
| c | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
|
| c | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb |
|
||||||
| d | f | da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
|
| d | f | da,ae,ge,hg,hg,ge,ae,xa,bx,fb |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Car - two only_ restrictions share same to-way
|
Scenario: Car - two only_ restrictions share same to-way
|
||||||
@@ -391,9 +391,9 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | by | xy | y | only_straight_on |
|
| restriction | by | xy | y | only_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ax,xy,yb,yb |
|
| a | b | ax,xy,yb |
|
||||||
| b | a | yb,xy,ax,ax |
|
| b | a | yb,xy,ax |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Car - two only_ restrictions share same from-way
|
Scenario: Car - two only_ restrictions share same from-way
|
||||||
@@ -425,7 +425,7 @@ Feature: Car - Turn restrictions
|
|||||||
| restriction | xy | yb | y | only_straight_on |
|
| restriction | xy | yb | y | only_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | ax,xy,yb,yb |
|
| a | b | ax,xy,yb |
|
||||||
| b | a | yb,xy,ax,ax |
|
| b | a | yb,xy,ax |
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
@routing @car @roundabout @instruction
|
||||||
|
Feature: Roundabout Instructions
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
|
||||||
|
Scenario: Car - Roundabout instructions
|
||||||
|
Given the node map
|
||||||
|
| | | v | | |
|
||||||
|
| | | d | | |
|
||||||
|
| s | a | | c | u |
|
||||||
|
| | | b | | |
|
||||||
|
| | | t | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction |
|
||||||
|
| sa | |
|
||||||
|
| tb | |
|
||||||
|
| uc | |
|
||||||
|
| vd | |
|
||||||
|
| abcda | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns |
|
||||||
|
| s | t | sa,tb | head,enter_roundabout-1,destination |
|
||||||
|
| s | u | sa,uc | head,enter_roundabout-2,destination |
|
||||||
|
| s | v | sa,vd | head,enter_roundabout-3,destination |
|
||||||
|
| u | v | uc,vd | head,enter_roundabout-1,destination |
|
||||||
|
| u | s | uc,sa | head,enter_roundabout-2,destination |
|
||||||
|
| u | t | uc,tb | head,enter_roundabout-3,destination |
|
||||||
@@ -19,13 +19,13 @@ Feature: Car - Handle ferryshuttle train routes
|
|||||||
| gh | primary | | no |
|
| gh | primary | | no |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | f | abc,cde,ef,ef |
|
| a | f | abc,cde,ef |
|
||||||
| b | f | abc,cde,ef,ef |
|
| b | f | abc,cde,ef |
|
||||||
| e | c | cde,cde |
|
| e | c | cde |
|
||||||
| e | b | cde,abc,abc |
|
| e | b | cde,abc |
|
||||||
| e | a | cde,abc,abc |
|
| e | a | cde,abc |
|
||||||
| c | e | cde,cde |
|
| c | e | cde |
|
||||||
| c | f | cde,ef,ef |
|
| c | f | cde,ef |
|
||||||
| f | g | |
|
| f | g | |
|
||||||
| g | h | gh,gh |
|
| g | h | gh |
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ Feature: Traffic - speeds
|
|||||||
Given the extract extra arguments "--generate-edge-lookup"
|
Given the extract extra arguments "--generate-edge-lookup"
|
||||||
Given the contract extra arguments "--segment-speed-file speeds.csv"
|
Given the contract extra arguments "--segment-speed-file speeds.csv"
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 27 km/h |
|
| a | b | ab | 27 km/h |
|
||||||
| a | c | ab,bc,bc | 27 km/h |
|
| a | c | ab,bc | 27 km/h |
|
||||||
| b | c | bc,bc | 27 km/h |
|
| b | c | bc | 27 km/h |
|
||||||
| a | d | ad,ad | 27 km/h |
|
| a | d | ad | 27 km/h |
|
||||||
| d | c | dc,dc | 36 km/h |
|
| d | c | dc | 36 km/h |
|
||||||
| g | b | ab,ab | 27 km/h |
|
| g | b | ab | 27 km/h |
|
||||||
| a | g | ab,ab | 27 km/h |
|
| a | g | ab | 27 km/h |
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on ways
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "foot"
|
Given the profile "foot"
|
||||||
|
|
||||||
Scenario: Foot - Access tag hierarchy on ways
|
Scenario: Foot - Access tag hierachy on ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | access | foot | bothw |
|
| highway | access | foot | bothw |
|
||||||
| footway | | | x |
|
| footway | | | x |
|
||||||
@@ -52,7 +52,6 @@ Feature: Foot - Access tags on ways
|
|||||||
| private | | |
|
| private | | |
|
||||||
| agricultural | | |
|
| agricultural | | |
|
||||||
| forestry | | |
|
| forestry | | |
|
||||||
| delivery | | |
|
|
||||||
| | yes | x |
|
| | yes | x |
|
||||||
| | permissive | x |
|
| | permissive | x |
|
||||||
| | designated | x |
|
| | designated | x |
|
||||||
@@ -61,7 +60,6 @@ Feature: Foot - Access tags on ways
|
|||||||
| | private | |
|
| | private | |
|
||||||
| | agricultural | |
|
| | agricultural | |
|
||||||
| | forestry | |
|
| | forestry | |
|
||||||
| | delivery | |
|
|
||||||
|
|
||||||
Scenario: Foot - Access tags on both node and way
|
Scenario: Foot - Access tags on both node and way
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on nodes
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "foot"
|
Given the profile "foot"
|
||||||
|
|
||||||
Scenario: Foot - Access tag hierarchy on nodes
|
Scenario: Foot - Access tag hierachy on nodes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| node/access | node/foot | bothw |
|
| node/access | node/foot | bothw |
|
||||||
| | | x |
|
| | | x |
|
||||||
@@ -40,7 +40,6 @@ Feature: Foot - Access tags on nodes
|
|||||||
| private | | |
|
| private | | |
|
||||||
| agricultural | | |
|
| agricultural | | |
|
||||||
| forestry | | |
|
| forestry | | |
|
||||||
| delivery | | |
|
|
||||||
| no | yes | x |
|
| no | yes | x |
|
||||||
| no | permissive | x |
|
| no | permissive | x |
|
||||||
| no | designated | x |
|
| no | designated | x |
|
||||||
@@ -49,4 +48,3 @@ Feature: Foot - Access tags on nodes
|
|||||||
| yes | private | |
|
| yes | private | |
|
||||||
| yes | agricultural | |
|
| yes | agricultural | |
|
||||||
| yes | forestry | |
|
| yes | forestry | |
|
||||||
| yes | delivery | |
|
|
||||||
|
|||||||
+39
-39
@@ -17,15 +17,15 @@ Feature: Foot - Squares and other areas
|
|||||||
| abcda | yes | residential |
|
| abcda | yes | residential |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | abcda,abcda |
|
| a | b | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
| b | c | abcda,abcda |
|
| b | c | abcda |
|
||||||
| c | b | abcda,abcda |
|
| c | b | abcda |
|
||||||
| c | d | abcda,abcda |
|
| c | d | abcda |
|
||||||
| d | c | abcda,abcda |
|
| d | c | abcda |
|
||||||
| d | a | abcda,abcda |
|
| d | a | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
|
|
||||||
@building
|
@building
|
||||||
Scenario: Foot - Don't route on buildings
|
Scenario: Foot - Don't route on buildings
|
||||||
@@ -41,14 +41,14 @@ Feature: Foot - Squares and other areas
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | xa,xa |
|
| a | b | xa |
|
||||||
| a | d | xa,xa |
|
| a | d | xa |
|
||||||
| b | c | xa,xa |
|
| b | c | xa |
|
||||||
| c | b | xa,xa |
|
| c | b | xa |
|
||||||
| c | d | xa,xa |
|
| c | d | xa |
|
||||||
| d | c | xa,xa |
|
| d | c | xa |
|
||||||
| d | a | xa,xa |
|
| d | a | xa |
|
||||||
| a | d | xa,xa |
|
| a | d | xa |
|
||||||
|
|
||||||
@parking
|
@parking
|
||||||
Scenario: Foot - parking areas
|
Scenario: Foot - parking areas
|
||||||
@@ -65,17 +65,17 @@ Feature: Foot - Squares and other areas
|
|||||||
| abcda | (nil) | parking |
|
| abcda | (nil) | parking |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,abcda,by,by |
|
| x | y | xa,abcda,by |
|
||||||
| y | x | by,abcda,xa,xa |
|
| y | x | by,abcda,xa |
|
||||||
| a | b | abcda,abcda |
|
| a | b | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
| b | c | abcda,abcda |
|
| b | c | abcda |
|
||||||
| c | b | abcda,abcda |
|
| c | b | abcda |
|
||||||
| c | d | abcda,abcda |
|
| c | d | abcda |
|
||||||
| d | c | abcda,abcda |
|
| d | c | abcda |
|
||||||
| d | a | abcda,abcda |
|
| d | a | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
|
|
||||||
@train @platform
|
@train @platform
|
||||||
Scenario: Foot - railway platforms
|
Scenario: Foot - railway platforms
|
||||||
@@ -90,14 +90,14 @@ Feature: Foot - Squares and other areas
|
|||||||
| abcda | (nil) | platform |
|
| abcda | (nil) | platform |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| x | y | xa,abcda,by,by |
|
| x | y | xa,abcda,by |
|
||||||
| y | x | by,abcda,xa,xa |
|
| y | x | by,abcda,xa |
|
||||||
| a | b | abcda,abcda |
|
| a | b | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
| b | c | abcda,abcda |
|
| b | c | abcda |
|
||||||
| c | b | abcda,abcda |
|
| c | b | abcda |
|
||||||
| c | d | abcda,abcda |
|
| c | d | abcda |
|
||||||
| d | c | abcda,abcda |
|
| d | c | abcda |
|
||||||
| d | a | abcda,abcda |
|
| d | a | abcda |
|
||||||
| a | d | abcda,abcda |
|
| a | d | abcda |
|
||||||
|
|||||||
+12
-12
@@ -17,15 +17,15 @@ Feature: Foot - Handle ferry routes
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes |
|
| from | to | route | modes |
|
||||||
| a | g | abc,cde,efg,efg | walking,ferry,walking,walking |
|
| a | g | abc,cde,efg | 1,2,1 |
|
||||||
| b | f | abc,cde,efg,efg | walking,ferry,walking,walking |
|
| b | f | abc,cde,efg | 1,2,1 |
|
||||||
| e | c | cde,cde | ferry,ferry |
|
| e | c | cde | 2 |
|
||||||
| e | b | cde,abc,abc | ferry,walking,walking |
|
| e | b | cde,abc | 2,1 |
|
||||||
| e | a | cde,abc,abc | ferry,walking,walking |
|
| e | a | cde,abc | 2,1 |
|
||||||
| c | e | cde,cde | ferry,ferry |
|
| c | e | cde | 2 |
|
||||||
| c | f | cde,efg,efg | ferry,walking,walking |
|
| c | f | cde,efg | 2,1 |
|
||||||
| c | g | cde,efg,efg | ferry,walking,walking |
|
| c | g | cde,efg | 2,1 |
|
||||||
|
|
||||||
Scenario: Foot - Ferry duration, single node
|
Scenario: Foot - Ferry duration, single node
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -58,6 +58,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 +-10 |
|
| a | d | abcd | 3600s +-10 |
|
||||||
| d | a | abcd,abcd | 3600s +-10 |
|
| d | a | abcd | 3600s +-10 |
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ Feature: Foot - Street names in instructions
|
|||||||
| bc | Your Way |
|
| bc | Your Way |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | My Way,Your Way,Your Way |
|
| a | c | My Way,Your Way |
|
||||||
|
|
||||||
@unnamed
|
@unnamed
|
||||||
Scenario: Foot - Use way type to describe unnamed ways
|
Scenario: Foot - Use way type to describe unnamed ways
|
||||||
@@ -29,5 +29,5 @@ Feature: Foot - Street names in instructions
|
|||||||
| bcd | track | |
|
| bcd | track | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | d | {highway:footway},{highway:track},{highway:track} |
|
| a | d | {highway:footway},{highway:track} |
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ Feature: Foot - Way ref
|
|||||||
| ab | Utopia Drive | E7 |
|
| ab | Utopia Drive | E7 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | Utopia Drive / E7,Utopia Drive / E7 |
|
| a | b | Utopia Drive / E7 |
|
||||||
|
|
||||||
Scenario: Foot - Way with only ref
|
Scenario: Foot - Way with only ref
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -26,7 +26,7 @@ Feature: Foot - Way ref
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | E7,E7 |
|
| a | b | E7 |
|
||||||
|
|
||||||
Scenario: Foot - Way with only name
|
Scenario: Foot - Way with only name
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -37,5 +37,5 @@ Feature: Foot - Way ref
|
|||||||
| ab | Utopia Drive |
|
| ab | Utopia Drive |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | Utopia Drive,Utopia Drive |
|
| a | b | Utopia Drive |
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_left_turn |
|
| restriction | sj | wj | j | no_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Foot - No right turn
|
Scenario: Foot - No right turn
|
||||||
@@ -48,10 +48,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | ej | j | no_right_turn |
|
| restriction | sj | ej | j | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Foot - No u-turn
|
Scenario: Foot - No u-turn
|
||||||
@@ -72,10 +72,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_u_turn |
|
| restriction | sj | wj | j | no_u_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Foot - Handle any no_* relation
|
Scenario: Foot - Handle any no_* relation
|
||||||
@@ -96,10 +96,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | wj | j | no_weird_zigzags |
|
| restriction | sj | wj | j | no_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Foot - Only left turn
|
Scenario: Foot - Only left turn
|
||||||
@@ -120,10 +120,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | wj | j | only_left_turn |
|
| restriction | sj | wj | j | only_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Foot - Only right turn
|
Scenario: Foot - Only right turn
|
||||||
@@ -144,10 +144,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | ej | j | only_right_turn |
|
| restriction | sj | ej | j | only_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Foot - Only straight on
|
Scenario: Foot - Only straight on
|
||||||
@@ -168,10 +168,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | nj | j | only_straight_on |
|
| restriction | sj | nj | j | only_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Foot - Handle any only_* restriction
|
Scenario: Foot - Handle any only_* restriction
|
||||||
@@ -192,10 +192,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | nj | j | only_weird_zigzags |
|
| restriction | sj | nj | j | only_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | w | sj,wj |
|
||||||
| s | n | sj,nj,nj |
|
| s | n | sj,nj |
|
||||||
| s | e | sj,ej,ej |
|
| s | e | sj,ej |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Foot - Except tag and on no_ restrictions
|
Scenario: Foot - Except tag and on no_ restrictions
|
||||||
@@ -221,11 +221,11 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | dj | j | no_right_turn | foot |
|
| restriction | sj | dj | j | no_right_turn | foot |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,aj,aj |
|
| s | a | sj,aj |
|
||||||
| s | b | sj,bj,bj |
|
| s | b | sj,bj |
|
||||||
| s | c | sj,cj,cj |
|
| s | c | sj,cj |
|
||||||
| s | d | sj,dj,dj |
|
| s | d | sj,dj |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Foot - Except tag and on only_ restrictions
|
Scenario: Foot - Except tag and on only_ restrictions
|
||||||
@@ -245,9 +245,9 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | aj | j | only_straight_on | foot |
|
| restriction | sj | aj | j | only_straight_on | foot |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,aj,aj |
|
| s | a | sj,aj |
|
||||||
| s | b | sj,bj,bj |
|
| s | b | sj,bj |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Foot - Multiple except tag values
|
Scenario: Foot - Multiple except tag values
|
||||||
@@ -279,10 +279,10 @@ Feature: Foot - Turn restrictions
|
|||||||
| restriction | sj | jf | j | no_straight_on | foot, bus |
|
| restriction | sj | jf | j | no_straight_on | foot, bus |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | a | sj,ja,ja |
|
| s | a | sj,ja |
|
||||||
| s | b | sj,jb,jb |
|
| s | b | sj,jb |
|
||||||
| s | c | sj,jc,jc |
|
| s | c | sj,jc |
|
||||||
| s | d | sj,jd,jd |
|
| s | d | sj,jd |
|
||||||
| s | e | sj,je,je |
|
| s | e | sj,je |
|
||||||
| s | f | sj,jf,jf |
|
| s | f | sj,jf |
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ Feature: Roundabout Instructions
|
|||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "foot"
|
Given the profile "foot"
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
Scenario: Foot - Roundabout instructions
|
Scenario: Foot - Roundabout instructions
|
||||||
# You can walk in both directions on a roundabout, bu the normal roundabout instructions don't
|
# You can walk in both directions on a roundabout, bu the normal roundabout instructions don't
|
||||||
# make sense when you're going the opposite way around the roundabout.
|
# make sense when you're going the opposite way around the roundabout.
|
||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | v | | |
|
| | | v | | |
|
||||||
| | | d | | |
|
| | | d | | |
|
||||||
@@ -25,10 +25,10 @@ Feature: Roundabout Instructions
|
|||||||
| abcda | roundabout |
|
| abcda | roundabout |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | turns |
|
| from | to | route | turns |
|
||||||
| s | t | sa,tb | depart,roundabout-exit-1,arrive |
|
| s | t | sa,tb | head,enter_roundabout-1,destination |
|
||||||
| s | u | sa,uc | depart,roundabout-exit-2,arrive |
|
| s | u | sa,uc | head,enter_roundabout-2,destination |
|
||||||
| s | v | sa,vd | depart,roundabout-exit-3,arrive |
|
| s | v | sa,vd | head,enter_roundabout-3,destination |
|
||||||
| u | v | uc,vd | depart,roundabout-exit-1,arrive |
|
| u | v | uc,vd | head,enter_roundabout-1,destination |
|
||||||
| u | s | uc,sa | depart,roundabout-exit-2,arrive |
|
| u | s | uc,sa | head,enter_roundabout-2,destination |
|
||||||
| u | t | uc,tb | depart,roundabout-exit-3,arrive |
|
| u | t | uc,tb | head,enter_roundabout-3,destination |
|
||||||
|
|||||||
@@ -1,90 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Continue Instructions
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Road turning left
|
|
||||||
Given the node map
|
|
||||||
| | | c | |
|
|
||||||
| a | | b | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,new name straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Road turning right
|
|
||||||
Given the node map
|
|
||||||
| a | | b | d |
|
|
||||||
| | | c | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc,abc | depart,continue right,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,new name straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Road turning slight left
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| | | | | |
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Road turning slight right
|
|
||||||
Given the node map
|
|
||||||
| | | | d | |
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc,abc | depart,continue right,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Road Loop
|
|
||||||
Given the node map
|
|
||||||
| | | f | | e |
|
|
||||||
| | | | | |
|
|
||||||
| a | | b | g | |
|
|
||||||
| | | | | |
|
|
||||||
| | | c | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcdefb | primary |
|
|
||||||
| bg | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
|
|
||||||
| a,f | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
|
|
||||||
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
|
|
||||||
| a,e | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: End Of Road Instructions
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: End of Road with through street
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | | b |
|
|
||||||
| | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cbd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
|
|
||||||
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
Scenario: End of Road with three streets
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | | b |
|
|
||||||
| | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cb | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cb,cb | depart,end of road left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
Scenario: End of Road with three streets, slightly angled
|
|
||||||
Given the node map
|
|
||||||
| a | | | | | c |
|
|
||||||
| | | | | | b |
|
|
||||||
| | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cb | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cb,cb | depart,end of road left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
Scenario: End of Road with three streets, slightly angled
|
|
||||||
Given the node map
|
|
||||||
| | | | | | c |
|
|
||||||
| | | | | | b |
|
|
||||||
| a | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cb | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cb,cb | depart,end of road left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
Scenario: End of Road with through street, slightly angled
|
|
||||||
Given the node map
|
|
||||||
| a | | | | | c |
|
|
||||||
| | | | | | b |
|
|
||||||
| | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cbd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
|
|
||||||
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
Scenario: End of Road with through street, slightly angled
|
|
||||||
Given the node map
|
|
||||||
| | | | | | c |
|
|
||||||
| | | | | | b |
|
|
||||||
| a | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cbd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
|
|
||||||
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
|
|
||||||
|
|
||||||
Scenario: End of Road with two ramps - prefer ramp over end of road
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | | b |
|
|
||||||
| | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | motorway_link |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,ramp left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
|
||||||
|
|
||||||
@@ -1,284 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Fork Instructions
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Fork Same Road Class
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Do not fork on link type
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary_link |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork in presence of other roads
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| a | | b | | |
|
|
||||||
| | e | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| eb | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Turning Slight Left
|
|
||||||
Given the node map
|
|
||||||
| | | | | | c |
|
|
||||||
| | | | | | |
|
|
||||||
| a | | b | | | |
|
|
||||||
| | | | | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Turning Slight Right
|
|
||||||
Given the node map
|
|
||||||
| | | | | c | |
|
|
||||||
| a | | b | | | |
|
|
||||||
| | | | | | |
|
|
||||||
| | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Do not fork on service
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | residential |
|
|
||||||
| bd | service |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Both Turning Slight Right
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | | |
|
|
||||||
| | | | | | c |
|
|
||||||
| | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Both Turning Slight Left
|
|
||||||
Given the node map
|
|
||||||
| | | | | | c |
|
|
||||||
| | | | | | d |
|
|
||||||
| a | | b | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Both Turning Slight Right - Unnamed
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | | |
|
|
||||||
| | | | | | c |
|
|
||||||
| | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | primary | |
|
|
||||||
| bc | primary | |
|
|
||||||
| bd | primary | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ,, | depart,fork slight left,arrive |
|
|
||||||
| a,d | ,, | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Both Turning Slight Left - Unnamed
|
|
||||||
Given the node map
|
|
||||||
| | | | | | c |
|
|
||||||
| | | | | | d |
|
|
||||||
| a | | b | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | primary | |
|
|
||||||
| bc | primary | |
|
|
||||||
| bd | primary | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ,, | depart,fork slight left,arrive |
|
|
||||||
| a,d | ,, | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Both Turning Very Slightly Right - Unnamed
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | | | | | | | | | | | | | | |
|
|
||||||
| | | | | | | | | | | | c | | | | | | |
|
|
||||||
| | | | | | | | | | | | | | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | primary | |
|
|
||||||
| bc | primary | |
|
|
||||||
| bd | primary | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ,, | depart,fork slight left,arrive |
|
|
||||||
| a,d | ,, | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Both Turning Very Slightly Right - Unnamed Ramps
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | | | | | | | | | | | | | | |
|
|
||||||
| | | | | | | | | | | | c | | | | | | |
|
|
||||||
| | | | | | | | | | | | | | | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | motorway_link | |
|
|
||||||
| bc | motorway_link | |
|
|
||||||
| bd | motorway_link | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ,, | depart,fork slight left,arrive |
|
|
||||||
| a,d | ,, | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Non-Fork on complex intersection - left
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| a | | b | | |
|
|
||||||
| | e | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | secondary |
|
|
||||||
| bd | tertiary |
|
|
||||||
| eb | tertiary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Non-Fork on complex intersection - right
|
|
||||||
Given the node map
|
|
||||||
| | e | | | c |
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abd | secondary |
|
|
||||||
| bc | tertiary |
|
|
||||||
| eb | tertiary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abd,bc,bc | depart,turn slight left,arrive |
|
|
||||||
| a,d | abd,abd | depart,arrive |
|
|
||||||
|
|
||||||
@pr2275 @bug
|
|
||||||
Scenario: Tripple fork
|
|
||||||
Given the node map
|
|
||||||
| | | | | | | | | c |
|
|
||||||
| a | | b | | d | | | | |
|
|
||||||
| | | | | | | | | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | secondary |
|
|
||||||
| bc | secondary |
|
|
||||||
| bd | secondary |
|
|
||||||
| be | secondary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,fork straight,arrive |
|
|
||||||
| a,e | ab,be,be | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Tripple fork -- middle obvious
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| a | | b | | d |
|
|
||||||
| | | | | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abd | secondary |
|
|
||||||
| bc | secondary |
|
|
||||||
| be | secondary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abd,bc,bc | depart,turn slight left,arrive |
|
|
||||||
| a,d | abd,abd | depart,arrive |
|
|
||||||
| a,e | abd,be,be | depart,turn slight right,arrive |
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Merging
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Merge on Four Way Intersection
|
|
||||||
Given the node map
|
|
||||||
| d | | |
|
|
||||||
| a | b | c |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| db | primary |
|
|
||||||
| eb | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| d,c | db,abc,abc | depart,merge slight right,arrive |
|
|
||||||
| e,c | eb,abc,abc | depart,merge slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: Merge on Three Way Intersection Right
|
|
||||||
Given the node map
|
|
||||||
| d | | |
|
|
||||||
| a | b | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| db | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| d,c | db,abc,abc | depart,merge slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Merge on Three Way Intersection Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | c |
|
|
||||||
| d | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| db | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| d,c | db,abc,abc | depart,merge slight left,arrive |
|
|
||||||
|
|
||||||
@@ -1,218 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Motorway Guidance
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Ramp Exit Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | d | e |
|
|
||||||
| | | | f | g |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| bfg | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| a,g | abcde,bfg,bfg | depart,ramp slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp Exit Right Curved Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | | |
|
|
||||||
| | | f | d | |
|
|
||||||
| | | | g | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| bfg | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| a,g | abcde,bfg,bfg | depart,ramp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp Exit Right Curved Left
|
|
||||||
Given the node map
|
|
||||||
| | | | | e |
|
|
||||||
| | | | d | g |
|
|
||||||
| a | b | c | f | |
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| cfg | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| a,g | abcde,cfg,cfg | depart,ramp slight right,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Ramp Exit Left
|
|
||||||
Given the node map
|
|
||||||
| | | | f | g |
|
|
||||||
| a | b | c | d | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| bfg | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| a,g | abcde,bfg,bfg | depart,ramp slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp Exit Left Curved Left
|
|
||||||
Given the node map
|
|
||||||
| | | | g | e |
|
|
||||||
| | | f | d | |
|
|
||||||
| a | b | c | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| bfg | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| a,g | abcde,bfg,bfg | depart,ramp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp Exit Left Curved Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | f | |
|
|
||||||
| | | | d | g |
|
|
||||||
| | | | | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| cfg | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| a,g | abcde,cfg,cfg | depart,ramp slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: On Ramp Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | d | e |
|
|
||||||
| f | g | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| fgd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| f,e | fgd,abcde,abcde | depart,merge slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: On Ramp Left
|
|
||||||
Given the node map
|
|
||||||
| f | g | | | |
|
|
||||||
| a | b | c | d | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| fgd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| f,e | fgd,abcde,abcde | depart,merge slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Highway Fork
|
|
||||||
Given the node map
|
|
||||||
| | | | | d | e |
|
|
||||||
| a | b | c | | | |
|
|
||||||
| | | | | f | g |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| cfg | motorway |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde,abcde | depart,fork slight left,arrive |
|
|
||||||
| a,g | abcde,cfg,cfg | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork After Ramp
|
|
||||||
Given the node map
|
|
||||||
| | | | | d | e |
|
|
||||||
| a | b | c | | | |
|
|
||||||
| | | | | f | g |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | motorway_link |
|
|
||||||
| cde | motorway |
|
|
||||||
| cfg | motorway |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abc,cde,cde | depart,fork slight left,arrive |
|
|
||||||
| a,g | abc,cfg,cfg | depart,fork slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: On And Off Ramp Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | | c | | d | e |
|
|
||||||
| f | g | | | | h | i |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| fgc | motorway_link |
|
|
||||||
| chi | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| f,e | fgc,abcde,abcde | depart,merge slight left,arrive |
|
|
||||||
| a,i | abcde,chi,chi | depart,ramp slight right,arrive |
|
|
||||||
| f,i | fgc,chi,chi | depart,ramp right,arrive |
|
|
||||||
|
|
||||||
Scenario: On And Off Ramp Left
|
|
||||||
Given the node map
|
|
||||||
| f | g | | | | h | i |
|
|
||||||
| a | b | | c | | d | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| fgc | motorway_link |
|
|
||||||
| chi | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| f,e | fgc,abcde,abcde | depart,merge slight right,arrive |
|
|
||||||
| a,i | abcde,chi,chi | depart,ramp slight left,arrive |
|
|
||||||
| f,i | fgc,chi,chi | depart,ramp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Merging Motorways
|
|
||||||
Given the node map
|
|
||||||
| e | | |
|
|
||||||
| a | b | c |
|
|
||||||
| d | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | motorway |
|
|
||||||
| db | motorway |
|
|
||||||
| eb | motorway |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| d,c | db,abc,abc | depart,merge slight left,arrive |
|
|
||||||
| e,c | eb,abc,abc | depart,merge slight right,arrive |
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: New-Name Instructions
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Undisturbed name Change
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name straight,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Undisturbed Name Change with unannounced Turn Right
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Undisturbed Name Change with unannounced Turn Left
|
|
||||||
Given the node map
|
|
||||||
| | | | | c |
|
|
||||||
| a | | b | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: Disturbed Name Change with Turn
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | |
|
|
||||||
| | d | | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
| db |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Undisturbed Name Change with announced Turn Left
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | | b |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name left,arrive |
|
|
||||||
|
|
||||||
Scenario: Undisturbed Name Change with announced Turn Sharp Left
|
|
||||||
Given the node map
|
|
||||||
| c | | |
|
|
||||||
| a | | b |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name sharp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Undisturbed Name Change with announced Turn Right
|
|
||||||
Given the node map
|
|
||||||
| a | | b |
|
|
||||||
| | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name right,arrive |
|
|
||||||
|
|
||||||
Scenario: Undisturbed Name Change with announced Turn Sharp Right
|
|
||||||
Given the node map
|
|
||||||
| a | | b |
|
|
||||||
| c | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name sharp right,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Disturbed Name Change with minor road class
|
|
||||||
Given the node map
|
|
||||||
| a | | b | | d |
|
|
||||||
| | | | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | residential |
|
|
||||||
| bc | residential |
|
|
||||||
| bd | service |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,new name slight right,arrive |
|
|
||||||
@@ -1,229 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Ramp Guidance
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Ramp On Through Street Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | c |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp On Through Street Left
|
|
||||||
Given the node map
|
|
||||||
| | d | |
|
|
||||||
| a | b | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp On Through Street Left and Right
|
|
||||||
Given the node map
|
|
||||||
| | e | |
|
|
||||||
| a | b | c |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| be | motorway_link |
|
|
||||||
| abc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,ramp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp On Three Way Intersection Right
|
|
||||||
Given the node map
|
|
||||||
| a | b | c |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | tertiary |
|
|
||||||
| bc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp On Three Way Intersection Right
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | b | |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | tertiary |
|
|
||||||
| bc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Ramp Off Though Street
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | b | |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
|
|
||||||
Scenario: Straight Ramp Off Turning Though Street
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | b | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp straight,arrive |
|
|
||||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Ramp Off Turning Though Street
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | b | |
|
|
||||||
| | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
|
||||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Ramp
|
|
||||||
Given the node map
|
|
||||||
| | | c |
|
|
||||||
| a | b | |
|
|
||||||
| | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | tertiary |
|
|
||||||
| bc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
|
||||||
| a,c | ab,bc,bc | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Slight Ramp
|
|
||||||
Given the node map
|
|
||||||
| | | | c |
|
|
||||||
| a | b | | |
|
|
||||||
| | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | tertiary |
|
|
||||||
| bc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,bd,bd | depart,ramp slight right,arrive |
|
|
||||||
| a,c | ab,bc,bc | depart,turn slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Slight Ramp on Through Street
|
|
||||||
Given the node map
|
|
||||||
| | | | c |
|
|
||||||
| a | b | | |
|
|
||||||
| | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | tertiary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp slight right,arrive |
|
|
||||||
| a,c | abc,abc,abc | depart,continue slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: Fork Slight Ramp on Obvious Through Street
|
|
||||||
Given the node map
|
|
||||||
| | | | c |
|
|
||||||
| a | b | | |
|
|
||||||
| | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,ramp slight right,arrive |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
|
|
||||||
Scenario: Two Ramps Joining into common Motorway
|
|
||||||
Given the node map
|
|
||||||
| a | | | |
|
|
||||||
| | | c | d |
|
|
||||||
| b | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ac | motorway_link |
|
|
||||||
| bc | motorway_link |
|
|
||||||
| cd | motorway |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ac,cd,cd | depart,new name slight left,arrive |
|
|
||||||
| b,d | bc,cd,cd | depart,new name slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Two Ramps Joining into common Motorway Unnamed
|
|
||||||
Given the node map
|
|
||||||
| a | | | |
|
|
||||||
| | | c | d |
|
|
||||||
| b | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ac | motorway_link | |
|
|
||||||
| bc | motorway_link | |
|
|
||||||
| cd | motorway | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | , | depart,arrive |
|
|
||||||
| b,d | , | depart,arrive |
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Rotary
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "bicycle"
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout | 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 |
|
|
||||||
@@ -1,262 +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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
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 | roundabout | 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 | roundabout |
|
|
||||||
| 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 |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| 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 | | |
|
|
||||||
| c | | |
|
|
||||||
| d | b | f |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| 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 | roundabout |
|
|
||||||
| 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 | roundabout |
|
|
||||||
| 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 |
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Basic Roundabout
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "bicycle"
|
|
||||||
Given a grid size of 10 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 | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
|
||||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
|
||||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
|
||||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
|
||||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
|
||||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
|
||||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
|
||||||
| h,f | gh,ef,ef | depart,roundabout-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 | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| a,e | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| a,g | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| d,e | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| d,g | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| d,b | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| f,g | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| f,b | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| f,c | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| h,b | 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 |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
|
|
||||||
| b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
|
|
||||||
| c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
|
|
||||||
| c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
|
|
||||||
| e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
|
|
||||||
| e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
|
|
||||||
| e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
|
|
||||||
| g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
|
|
||||||
| g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
|
|
||||||
| g,f | bcegb,ef,ef | depart,roundabout-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 | roundabout |
|
|
||||||
|
|
||||||
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 |
|
|
||||||
|
|
||||||
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 | roundabout | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
|
|
||||||
| a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
|
|
||||||
| a,f | abc,def,def | depart,roundabout-exit-4,arrive |
|
|
||||||
| d,f | def,def,def | depart,roundabout-exit-1,arrive |
|
|
||||||
| d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
|
|
||||||
| d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
|
|
||||||
| d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
|
|
||||||
| g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
|
|
||||||
| g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
|
|
||||||
| g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
|
|
||||||
| g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
|
|
||||||
| j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
|
|
||||||
| j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
|
|
||||||
| j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
|
|
||||||
| j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
|
|
||||||
@@ -1,261 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Basic Roundabout
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 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 | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
|
||||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
|
||||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
|
||||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
|
||||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
|
||||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
|
||||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
|
||||||
| h,f | gh,ef,ef | depart,roundabout-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 | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| a,e | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| a,g | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| d,e | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| d,g | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| d,b | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| f,g | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| f,b | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| f,c | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
|
||||||
| h,b | 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 |
|
|
||||||
|
|
||||||
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 | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
|
|
||||||
| b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
|
|
||||||
| c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
|
|
||||||
| c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
|
|
||||||
| e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
|
|
||||||
| e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
|
|
||||||
| e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
|
|
||||||
| g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
|
|
||||||
| g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
|
|
||||||
| g,f | bcegb,ef,ef | depart,roundabout-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 | roundabout |
|
|
||||||
|
|
||||||
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 |
|
|
||||||
|
|
||||||
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 | roundabout | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
|
|
||||||
| a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
|
|
||||||
| a,f | abc,def,def | depart,roundabout-exit-4,arrive |
|
|
||||||
| d,f | def,def,def | depart,roundabout-exit-1,arrive |
|
|
||||||
| d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
|
|
||||||
| d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
|
|
||||||
| d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
|
|
||||||
| g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
|
|
||||||
| g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
|
|
||||||
| g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
|
|
||||||
| g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
|
|
||||||
| j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
|
|
||||||
| j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
|
|
||||||
| j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
|
|
||||||
| j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | d | f |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in Y
|
|
||||||
Given the node map
|
|
||||||
| a | |
|
|
||||||
| b | |
|
|
||||||
| c | e |
|
|
||||||
| d | |
|
|
||||||
| f | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
| a | | |
|
|
||||||
| b | | |
|
|
||||||
| c | d | f |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
| a | | |
|
|
||||||
| d | | |
|
|
||||||
| b | c | f |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
| a | | |
|
|
||||||
| c | | |
|
|
||||||
| d | b | f |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Suppressed Turns
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Do not announce passing a exit ramp
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | d | e |
|
|
||||||
| | | | f | g |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abcde | motorway |
|
|
||||||
| bfg | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
|
|
||||||
Scenario: Do not announce reference changes
|
|
||||||
Given the node map
|
|
||||||
| a | b | c | d | e | f |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | ref |
|
|
||||||
| ab | motorway | highway | A1 |
|
|
||||||
| bc | motorway | highway | A1,A2 |
|
|
||||||
| cd | motorway | highway | A2 |
|
|
||||||
| de | motorway | highway | |
|
|
||||||
| ef | motorway | highway | A1 |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,f | highway (A1),highway (A1) | depart,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Don't Announce Turn on following major road class -- service
|
|
||||||
Given the node map
|
|
||||||
| a | b | d |
|
|
||||||
| | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | service |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
|
|
||||||
Scenario: Don't Announce Turn on following major road class -- residential
|
|
||||||
Given the node map
|
|
||||||
| a | b | d |
|
|
||||||
| | | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | residential |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| a,d | abc,bd,bd | depart,turn straight,arrive |
|
|
||||||
@@ -1,813 +0,0 @@
|
|||||||
@routing @guidance
|
|
||||||
Feature: Simple Turns
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Four Way Intersection
|
|
||||||
Given the node map
|
|
||||||
| | c | |
|
|
||||||
| a | b | e |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cb | primary |
|
|
||||||
| db | primary |
|
|
||||||
| eb | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
|
||||||
| a,e | ab,eb,eb | depart,new name straight,arrive |
|
|
||||||
| a,d | ab,db,db | depart,turn right,arrive |
|
|
||||||
| c,a | cb,ab,ab | depart,turn right,arrive |
|
|
||||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
|
||||||
| c,e | cb,eb,eb | depart,turn left,arrive |
|
|
||||||
| d,a | db,ab,ab | depart,turn left,arrive |
|
|
||||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
|
||||||
| d,e | db,eb,eb | depart,turn right,arrive |
|
|
||||||
| e,a | eb,ab,ab | depart,new name straight,arrive |
|
|
||||||
| e,c | eb,cb,cb | depart,turn right,arrive |
|
|
||||||
| e,d | eb,db,db | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Rotated Four Way Intersection
|
|
||||||
Given the node map
|
|
||||||
| a | | c |
|
|
||||||
| | b | |
|
|
||||||
| d | | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cb | primary |
|
|
||||||
| db | primary |
|
|
||||||
| eb | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
|
||||||
| a,e | ab,eb,eb | depart,new name straight,arrive |
|
|
||||||
| a,d | ab,db,db | depart,turn right,arrive |
|
|
||||||
| c,a | cb,ab,ab | depart,turn right,arrive |
|
|
||||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
|
||||||
| c,e | cb,eb,eb | depart,turn left,arrive |
|
|
||||||
| d,a | db,ab,ab | depart,turn left,arrive |
|
|
||||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
|
||||||
| d,e | db,eb,eb | depart,turn right,arrive |
|
|
||||||
| e,a | eb,ab,ab | depart,new name straight,arrive |
|
|
||||||
| e,c | eb,cb,cb | depart,turn right,arrive |
|
|
||||||
| e,d | eb,db,db | depart,turn left,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Four Way Intersection Through Street
|
|
||||||
Given the node map
|
|
||||||
| | c | |
|
|
||||||
| a | b | e |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abe | primary |
|
|
||||||
| cb | primary |
|
|
||||||
| db | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abe,cb,cb | depart,turn left,arrive |
|
|
||||||
| a,e | abe,abe | depart,arrive |
|
|
||||||
| a,d | abe,db,db | depart,turn right,arrive |
|
|
||||||
| c,a | cb,abe,abe | depart,turn right,arrive |
|
|
||||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
|
||||||
| c,e | cb,abe,abe | depart,turn left,arrive |
|
|
||||||
| d,a | db,abe,abe | depart,turn left,arrive |
|
|
||||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
|
||||||
| d,e | db,abe,abe | depart,turn right,arrive |
|
|
||||||
| e,a | abe,abe | depart,arrive |
|
|
||||||
| e,c | abe,cb,cb | depart,turn right,arrive |
|
|
||||||
| e,d | abe,db,db | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Four Way Intersection Double Through Street
|
|
||||||
Given the node map
|
|
||||||
| | c | |
|
|
||||||
| a | b | e |
|
|
||||||
| | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abe | primary |
|
|
||||||
| cbd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abe,cbd,cbd | depart,turn left,arrive |
|
|
||||||
| a,e | abe,abe | depart,arrive |
|
|
||||||
| a,d | abe,cbd,cbd | depart,turn right,arrive |
|
|
||||||
| c,a | cbd,abe,abe | depart,turn right,arrive |
|
|
||||||
| c,d | cbd,cbd | depart,arrive |
|
|
||||||
| c,e | cbd,abe,abe | depart,turn left,arrive |
|
|
||||||
| d,a | cbd,abe,abe | depart,turn left,arrive |
|
|
||||||
| d,c | cbd,cbd | depart,arrive |
|
|
||||||
| d,e | cbd,abe,abe | depart,turn right,arrive |
|
|
||||||
| e,a | abe,abe | depart,arrive |
|
|
||||||
| e,c | abe,cbd,cbd | depart,turn right,arrive |
|
|
||||||
| e,d | abe,cbd,cbd | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Three Way Intersection
|
|
||||||
Given the node map
|
|
||||||
| | c | |
|
|
||||||
| a | b | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| cb | primary |
|
|
||||||
| db | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
|
||||||
| a,d | ab,db,db | depart,new name straight,arrive |
|
|
||||||
| d,c | db,cb,cb | depart,turn right,arrive |
|
|
||||||
| d,a | db,ab,ab | depart,new name straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Three Way Intersection on Through Street
|
|
||||||
Given the node map
|
|
||||||
| | d | |
|
|
||||||
| a | b | c |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| db | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| a,d | abc,db,db | depart,turn left,arrive |
|
|
||||||
| c,a | abc,abc | depart,arrive |
|
|
||||||
| c,d | abc,db,db | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: High Degree Intersection
|
|
||||||
Given the node map
|
|
||||||
| i | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| h | | a | | d |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| g | | f | | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| ac | primary |
|
|
||||||
| ad | primary |
|
|
||||||
| ae | primary |
|
|
||||||
| af | primary |
|
|
||||||
| ag | primary |
|
|
||||||
| ah | primary |
|
|
||||||
| ai | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
|
|
||||||
| b,d | ab,ad,ad | depart,turn left,arrive |
|
|
||||||
| b,e | ab,ae,ae | depart,turn slight left,arrive |
|
|
||||||
| b,f | ab,af,af | depart,new name straight,arrive |
|
|
||||||
| b,g | ab,ag,ag | depart,turn slight right,arrive |
|
|
||||||
| b,h | ab,ah,ah | depart,turn right,arrive |
|
|
||||||
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Disturbed High Degree Intersection
|
|
||||||
Given the node map
|
|
||||||
| | | b | | |
|
|
||||||
| i | | | | c |
|
|
||||||
| | | | | |
|
|
||||||
| h | | a | | d |
|
|
||||||
| | | | | |
|
|
||||||
| g | | | | e |
|
|
||||||
| | | f | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| ac | primary |
|
|
||||||
| ad | primary |
|
|
||||||
| ae | primary |
|
|
||||||
| af | primary |
|
|
||||||
| ag | primary |
|
|
||||||
| ah | primary |
|
|
||||||
| ai | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
|
|
||||||
| b,d | ab,ad,ad | depart,turn left,arrive |
|
|
||||||
| b,e | ab,ae,ae | depart,turn slight left,arrive |
|
|
||||||
| b,f | ab,af,af | depart,new name straight,arrive |
|
|
||||||
| b,g | ab,ag,ag | depart,turn slight right,arrive |
|
|
||||||
| b,h | ab,ah,ah | depart,turn right,arrive |
|
|
||||||
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Turn instructions at high latitude
|
|
||||||
Given the node locations
|
|
||||||
| node | lat | lon |
|
|
||||||
| a | 55.68740 | 12.52430 |
|
|
||||||
| b | 55.68745 | 12.52409 |
|
|
||||||
| c | 55.68711 | 12.52383 |
|
|
||||||
| d | 55.68745 | 12.52450 |
|
|
||||||
| e | 55.68755 | 12.52450 |
|
|
||||||
| x | -55.68740 | 12.52430 |
|
|
||||||
| y | -55.68745 | 12.52409 |
|
|
||||||
| z | -55.68711 | 12.52383 |
|
|
||||||
| v | -55.68745 | 12.52450 |
|
|
||||||
| w | -55.68755 | 12.52450 |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
| bd |
|
|
||||||
| be |
|
|
||||||
| xy |
|
|
||||||
| yz |
|
|
||||||
| vy |
|
|
||||||
| wy |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | turns |
|
|
||||||
| a | c | ab,bc,bc | depart,turn left,arrive |
|
|
||||||
| c | a | bc,ab,ab | depart,turn right,arrive |
|
|
||||||
| x | z | xy,yz,yz | depart,turn right,arrive |
|
|
||||||
| z | x | yz,xy,xy | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Four Way Intersection Double Through Street Segregated
|
|
||||||
Given the node map
|
|
||||||
| | b | | c | |
|
|
||||||
| i | | | | d |
|
|
||||||
| | | a | | |
|
|
||||||
| h | | | | e |
|
|
||||||
| | g | | f | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | name |
|
|
||||||
| ha | primary | yes | first |
|
|
||||||
| ai | primary | yes | first |
|
|
||||||
| ae | primary | yes | first |
|
|
||||||
| da | primary | yes | first |
|
|
||||||
| ba | primary | yes | second |
|
|
||||||
| ac | primary | yes | second |
|
|
||||||
| fa | primary | yes | second |
|
|
||||||
| ag | 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
|
|
||||||
Given the node map
|
|
||||||
| a | | | | b |
|
|
||||||
| c | | | | |
|
|
||||||
| | d | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ab,bc,bc | depart,turn sharp right,arrive |
|
|
||||||
| a,d | ab,bd,bd | depart,turn sharp right,arrive |
|
|
||||||
| d,c | bd,bc,bc | depart,turn sharp left,arrive |
|
|
||||||
| d,a | bd,ab,ab | depart,turn sharp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Left Turn Assignment (1)
|
|
||||||
Given the node map
|
|
||||||
| | | | | d |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: Left Turn Assignment (2)
|
|
||||||
Given the node map
|
|
||||||
| | | | | d |
|
|
||||||
| | | | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Left Turn Assignment (3)
|
|
||||||
Given the node map
|
|
||||||
| | | | d | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Left Turn Assignment (4)
|
|
||||||
Given the node map
|
|
||||||
| | | d | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Left Turn Assignment (5)
|
|
||||||
Given the node map
|
|
||||||
| | d | | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
|
||||||
|
|
||||||
@bug @pr2275
|
|
||||||
Scenario: Left Turn Assignment (6)
|
|
||||||
Given the node map
|
|
||||||
| d | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn sharp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Left Turn Assignment (7)
|
|
||||||
Given the node map
|
|
||||||
| d | | | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn sharp left,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment (1)
|
|
||||||
Given the node map
|
|
||||||
| | | e | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment (2)
|
|
||||||
Given the node map
|
|
||||||
| | | e | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | d |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment (3)
|
|
||||||
Given the node map
|
|
||||||
| | | e | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | d | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment (4)
|
|
||||||
Given the node map
|
|
||||||
| | | e | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | d | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment (5)
|
|
||||||
Given the node map
|
|
||||||
| | | e | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| | d | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
|
|
||||||
@bug @pr2275
|
|
||||||
Scenario: Right Turn Assignment (6)
|
|
||||||
Given the node map
|
|
||||||
| | | e | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| d | | | | |
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment (7)
|
|
||||||
Given the node map
|
|
||||||
| | | e | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| d | | | | |
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment Two Turns
|
|
||||||
Given the node map
|
|
||||||
| | | f | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| d | e | | | |
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
| bf | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment Two Turns (2)
|
|
||||||
Given the node map
|
|
||||||
| | | f | c | |
|
|
||||||
| a | | b | | |
|
|
||||||
| | | | | e |
|
|
||||||
| | | | d | |
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
| bf | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment Two Turns (3)
|
|
||||||
Given the node map
|
|
||||||
| | | f | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | e |
|
|
||||||
| | | | d | |
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
| bf | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment Two Turns (4)
|
|
||||||
Given the node map
|
|
||||||
| | | f | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | | d | | e |
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
| bf | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment Three Turns
|
|
||||||
Given the node map
|
|
||||||
| | | g | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | d | | f | |
|
|
||||||
| | | e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
| bf | primary |
|
|
||||||
| bg | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn right,arrive |
|
|
||||||
| a,f | abc,bf,bf | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
Scenario: Slight Turn involving Oneways
|
|
||||||
Given the node map
|
|
||||||
| | | a | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | b | | e |
|
|
||||||
| d | | | | |
|
|
||||||
| | | c | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| abc | primary | yes |
|
|
||||||
| dbe | primary | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| d,e | dbe,dbe | depart,arrive |
|
|
||||||
| e,d | dbe,dbe | depart,arrive |
|
|
||||||
|
|
||||||
@bug @pr2275
|
|
||||||
Scenario: Slight Turn involving Oneways
|
|
||||||
Given the node map
|
|
||||||
| | | | a | |
|
|
||||||
| | | | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | b | | e |
|
|
||||||
| d | | | | |
|
|
||||||
| | | c | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| abc | primary | yes |
|
|
||||||
| dbe | primary | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| d,e | dbe,dbe | depart,arrive |
|
|
||||||
| e,d | dbe,dbe | depart,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Slight Turn involving Oneways - Name Change
|
|
||||||
Given the node map
|
|
||||||
| | | a | | |
|
|
||||||
| | | | | |
|
|
||||||
| | | b | | e |
|
|
||||||
| d | | | | |
|
|
||||||
| | | c | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| abc | primary | yes |
|
|
||||||
| db | primary | no |
|
|
||||||
| be | primary | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | abc,abc | depart,arrive |
|
|
||||||
| d,e | db,be,be | depart,new name slight right,arrive |
|
|
||||||
| e,d | be,db,db | depart,new name slight left,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 1
|
|
||||||
Given the node map
|
|
||||||
| | | g | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | d | e | f | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| abc | primary | no |
|
|
||||||
| db | primary | yes |
|
|
||||||
| eb | primary | no |
|
|
||||||
| fb | primary | no |
|
|
||||||
| bg | primary | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abc,eb,eb | depart,turn right,arrive |
|
|
||||||
| a,f | abc,fb,fb | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
@bug @pr2275
|
|
||||||
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 2
|
|
||||||
Given the node map
|
|
||||||
| | | g | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | d | e | f | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| abc | primary | no |
|
|
||||||
| db | primary | no |
|
|
||||||
| eb | primary | yes |
|
|
||||||
| fb | primary | no |
|
|
||||||
| bg | primary | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,db,db | depart,turn sharp right,arrive |
|
|
||||||
| a,f | abc,fb,fb | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 3
|
|
||||||
Given the node map
|
|
||||||
| | | g | | |
|
|
||||||
| a | | b | | c |
|
|
||||||
| | | | | |
|
|
||||||
| | d | e | f | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| abc | primary | no |
|
|
||||||
| db | primary | no |
|
|
||||||
| be | primary | no |
|
|
||||||
| fb | primary | yes |
|
|
||||||
| bg | primary | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,db,db | depart,turn sharp right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: Conflicting Turns with well distinguished turn
|
|
||||||
Given the node map
|
|
||||||
| a | | | b | | | c |
|
|
||||||
| | | | | | | |
|
|
||||||
| f | | | | | | d |
|
|
||||||
| | | | | | | e |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
| bf | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn right,arrive |
|
|
||||||
| a,f | abc,bf,bf | depart,turn sharp right,arrive |
|
|
||||||
|
|
||||||
@bug @pr2275
|
|
||||||
Scenario: Conflicting Turns with well distinguished turn (back)
|
|
||||||
Given the node map
|
|
||||||
| a | | | b | | | c |
|
|
||||||
| | | | | | | |
|
|
||||||
| d | | | | | | f |
|
|
||||||
| | e | | | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | primary |
|
|
||||||
| bd | primary |
|
|
||||||
| be | primary |
|
|
||||||
| bf | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
|
||||||
| a,e | abc,be,be | depart,turn right,arrive |
|
|
||||||
| a,f | abc,bf,bf | depart,turn slight right,arrive |
|
|
||||||
|
|
||||||
@@ -13,6 +13,13 @@ Feature: osrm-routed command line options: help
|
|||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
And stdout should contain "--trial"
|
And stdout should contain "--trial"
|
||||||
And stdout should contain "Configuration:"
|
And stdout should contain "Configuration:"
|
||||||
|
And stdout should contain "--hsgrdata arg"
|
||||||
|
And stdout should contain "--nodesdata arg"
|
||||||
|
And stdout should contain "--edgesdata arg"
|
||||||
|
And stdout should contain "--ramindex arg"
|
||||||
|
And stdout should contain "--fileindex arg"
|
||||||
|
And stdout should contain "--namesdata arg"
|
||||||
|
And stdout should contain "--timestamp arg"
|
||||||
And stdout should contain "--ip"
|
And stdout should contain "--ip"
|
||||||
And stdout should contain "--port"
|
And stdout should contain "--port"
|
||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
@@ -32,6 +39,13 @@ Feature: osrm-routed command line options: help
|
|||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
And stdout should contain "--trial"
|
And stdout should contain "--trial"
|
||||||
And stdout should contain "Configuration:"
|
And stdout should contain "Configuration:"
|
||||||
|
And stdout should contain "--hsgrdata arg"
|
||||||
|
And stdout should contain "--nodesdata arg"
|
||||||
|
And stdout should contain "--edgesdata arg"
|
||||||
|
And stdout should contain "--ramindex arg"
|
||||||
|
And stdout should contain "--fileindex arg"
|
||||||
|
And stdout should contain "--namesdata arg"
|
||||||
|
And stdout should contain "--timestamp arg"
|
||||||
And stdout should contain "--ip"
|
And stdout should contain "--ip"
|
||||||
And stdout should contain "--port"
|
And stdout should contain "--port"
|
||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
@@ -51,6 +65,13 @@ Feature: osrm-routed command line options: help
|
|||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
And stdout should contain "--trial"
|
And stdout should contain "--trial"
|
||||||
And stdout should contain "Configuration:"
|
And stdout should contain "Configuration:"
|
||||||
|
And stdout should contain "--hsgrdata arg"
|
||||||
|
And stdout should contain "--nodesdata arg"
|
||||||
|
And stdout should contain "--edgesdata arg"
|
||||||
|
And stdout should contain "--ramindex arg"
|
||||||
|
And stdout should contain "--fileindex arg"
|
||||||
|
And stdout should contain "--namesdata arg"
|
||||||
|
And stdout should contain "--timestamp arg"
|
||||||
And stdout should contain "--ip"
|
And stdout should contain "--ip"
|
||||||
And stdout should contain "--port"
|
And stdout should contain "--port"
|
||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Feature: osrm-routed command line options: invalid options
|
|||||||
|
|
||||||
Scenario: osrm-routed - Missing file
|
Scenario: osrm-routed - Missing file
|
||||||
When I run "osrm-routed over-the-rainbow.osrm"
|
When I run "osrm-routed over-the-rainbow.osrm"
|
||||||
Then stderr should contain "over-the-rainbow.osrm"
|
Then stdout should contain "over-the-rainbow.osrm"
|
||||||
|
And stderr should contain "exception"
|
||||||
And stderr should contain "not found"
|
And stderr should contain "not found"
|
||||||
And it should exit with code 1
|
And it should exit with code 1
|
||||||
|
|||||||
@@ -28,19 +28,18 @@ Feature: Raster - weights
|
|||||||
0 0 0 250
|
0 0 0 250
|
||||||
0 0 0 0
|
0 0 0 0
|
||||||
"""
|
"""
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
Scenario: Weighting not based on raster sources
|
Scenario: Weighting not based on raster sources
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
||||||
And I run "osrm-contract {osm_base}.osm"
|
And I run "osrm-contract {osm_base}.osm"
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 36 km/h |
|
| a | b | ab | 36 km/h |
|
||||||
| a | c | ab,bc,bc | 36 km/h |
|
| a | c | ab,bc | 36 km/h |
|
||||||
| b | c | bc,bc | 36 km/h |
|
| b | c | bc | 36 km/h |
|
||||||
| a | d | ad,ad | 36 km/h |
|
| a | d | ad | 36 km/h |
|
||||||
| d | c | dc,dc | 36 km/h |
|
| d | c | dc | 36 km/h |
|
||||||
|
|
||||||
Scenario: Weighting based on raster sources
|
Scenario: Weighting based on raster sources
|
||||||
Given the profile "rasterbot"
|
Given the profile "rasterbot"
|
||||||
@@ -48,32 +47,32 @@ Feature: Raster - weights
|
|||||||
Then stdout should contain "evaluating segment"
|
Then stdout should contain "evaluating segment"
|
||||||
And I run "osrm-contract {osm_base}.osm"
|
And I run "osrm-contract {osm_base}.osm"
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 8 km/h |
|
| a | b | ab | 8 km/h |
|
||||||
| a | c | ad,dc,dc | 15 km/h |
|
| a | c | ad,dc | 15 km/h |
|
||||||
| b | c | bc,bc | 8 km/h |
|
| b | c | bc | 8 km/h |
|
||||||
| a | d | ad,ad | 15 km/h |
|
| a | d | ad | 15 km/h |
|
||||||
| d | c | dc,dc | 15 km/h |
|
| d | c | dc | 15 km/h |
|
||||||
| d | e | de,de | 10 km/h |
|
| d | e | de | 10 km/h |
|
||||||
| e | b | eb,eb | 10 km/h |
|
| e | b | eb | 10 km/h |
|
||||||
| d | f | df,df | 15 km/h |
|
| d | f | df | 15 km/h |
|
||||||
| f | b | fb,fb | 7 km/h |
|
| f | b | fb | 7 km/h |
|
||||||
| d | b | de,eb,eb | 10 km/h |
|
| d | b | de,eb | 10 km/h |
|
||||||
|
|
||||||
Scenario: Weighting based on raster sources
|
Scenario: Weighting based on raster sources
|
||||||
Given the profile "rasterbotinterp"
|
Given the profile "rasterbot-interp"
|
||||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
||||||
Then stdout should contain "evaluating segment"
|
Then stdout should contain "evaluating segment"
|
||||||
And I run "osrm-contract {osm_base}.osm"
|
And I run "osrm-contract {osm_base}.osm"
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 8 km/h |
|
| a | b | ab | 8 km/h |
|
||||||
| a | c | ad,dc,dc | 15 km/h |
|
| a | c | ad,dc | 15 km/h |
|
||||||
| b | c | bc,bc | 8 km/h |
|
| b | c | bc | 8 km/h |
|
||||||
| a | d | ad,ad | 15 km/h |
|
| a | d | ad | 15 km/h |
|
||||||
| d | c | dc,dc | 15 km/h |
|
| d | c | dc | 15 km/h |
|
||||||
| d | e | de,de | 10 km/h |
|
| d | e | de | 10 km/h |
|
||||||
| e | b | eb,eb | 10 km/h |
|
| e | b | eb | 10 km/h |
|
||||||
| d | f | df,df | 15 km/h |
|
| d | f | df | 15 km/h |
|
||||||
| f | b | fb,fb | 7 km/h |
|
| f | b | fb | 7 km/h |
|
||||||
| d | b | de,eb,eb | 10 km/h |
|
| d | b | de,eb | 10 km/h |
|
||||||
|
|||||||
@@ -1,273 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
var path = require('path');
|
|
||||||
var fs = require('fs');
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
var OSM = require('../support/build_osm');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.Given(/^the profile "([^"]*)"$/, (profile, callback) => {
|
|
||||||
this.setProfile(profile, callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the extract extra arguments "(.*?)"$/, (args, callback) => {
|
|
||||||
this.setExtractArgs(args);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the contract extra arguments "(.*?)"$/, (args, callback) => {
|
|
||||||
this.setContractArgs(args);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^a grid size of (\d+) meters$/, (meters, callback) => {
|
|
||||||
this.setGridSize(meters);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the origin ([-+]?[0-9]*\.?[0-9]+),([-+]?[0-9]*\.?[0-9]+)$/, (lat, lon, callback) => {
|
|
||||||
this.setOrigin([parseFloat(lon), parseFloat(lat)]);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the shortcuts$/, (table, callback) => {
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var addShortcut = (row, cb) => {
|
|
||||||
this.shortcutsHash[row.key] = row.value;
|
|
||||||
cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
table.hashes().forEach((row) => {
|
|
||||||
q.defer(addShortcut, row);
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the node map$/, (table, callback) => {
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var addNode = (name, ri, ci, cb) => {
|
|
||||||
if (name) {
|
|
||||||
if (name.length !== 1) throw new Error(util.format('*** node invalid name %s, must be single characters', name));
|
|
||||||
if (!name.match(/[a-z0-9]/)) throw new Error(util.format('*** invalid node name %s, must me alphanumeric', name));
|
|
||||||
|
|
||||||
var lonLat;
|
|
||||||
if (name.match(/[a-z]/)) {
|
|
||||||
if (this.nameNodeHash[name]) throw new Error(util.format('*** duplicate node %s', name));
|
|
||||||
lonLat = this.tableCoordToLonLat(ci, ri);
|
|
||||||
this.addOSMNode(name, lonLat[0], lonLat[1], null);
|
|
||||||
} else {
|
|
||||||
if (this.locationHash[name]) throw new Error(util.format('*** duplicate node %s'), name);
|
|
||||||
lonLat = this.tableCoordToLonLat(ci, ri);
|
|
||||||
this.addLocation(name, lonLat[0], lonLat[1], null);
|
|
||||||
}
|
|
||||||
|
|
||||||
cb();
|
|
||||||
}
|
|
||||||
else cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
table.raw().forEach((row, ri) => {
|
|
||||||
row.forEach((name, ci) => {
|
|
||||||
q.defer(addNode, name, ri, ci);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the node locations$/, (table, callback) => {
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var addNodeLocations = (row, cb) => {
|
|
||||||
var name = row.node;
|
|
||||||
if (this.findNodeByName(name)) throw new Error(util.format('*** duplicate node %s'), name);
|
|
||||||
|
|
||||||
if (name.match(/[a-z]/)) {
|
|
||||||
var id = row.id && parseInt(row.id);
|
|
||||||
this.addOSMNode(name, row.lon, row.lat, id);
|
|
||||||
} else {
|
|
||||||
this.addLocation(name, row.lon, row.lat);
|
|
||||||
}
|
|
||||||
|
|
||||||
cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
table.hashes().forEach((row) => q.defer(addNodeLocations, row));
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the nodes$/, (table, callback) => {
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var addNode = (row, cb) => {
|
|
||||||
var name = row.node,
|
|
||||||
node = this.findNodeByName(name);
|
|
||||||
delete row.node;
|
|
||||||
if (!node) throw new Error(util.format('*** unknown node %s'), name);
|
|
||||||
for (var key in row) {
|
|
||||||
node.addTag(key, row[key]);
|
|
||||||
}
|
|
||||||
cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
table.hashes().forEach((row) => q.defer(addNode, row));
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the ways$/, (table, callback) => {
|
|
||||||
if (this.osm_str) throw new Error('*** Map data already defined - did you pass an input file in this scenario?');
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var addWay = (row, cb) => {
|
|
||||||
var way = new OSM.Way(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
|
||||||
|
|
||||||
var nodes = row.nodes;
|
|
||||||
if (this.nameWayHash.nodes) throw new Error(util.format('*** duplicate way %s', nodes));
|
|
||||||
|
|
||||||
for (var i=0; i<nodes.length; i++) {
|
|
||||||
var c = nodes[i];
|
|
||||||
if (!c.match(/[a-z]/)) throw new Error(util.format('*** ways can only use names a-z (%s)', c));
|
|
||||||
var node = this.findNodeByName(c);
|
|
||||||
if (!node) throw new Error(util.format('*** unknown node %s', c));
|
|
||||||
way.addNode(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
var tags = {
|
|
||||||
highway: 'primary'
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var key in row) {
|
|
||||||
tags[key] = row[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
delete tags.nodes;
|
|
||||||
|
|
||||||
if (row.highway === '(nil)') delete tags.highway;
|
|
||||||
|
|
||||||
if (row.name === undefined)
|
|
||||||
tags.name = nodes;
|
|
||||||
else if (row.name === '""' || row.name === "''") // eslint-disable-line quotes
|
|
||||||
tags.name = '';
|
|
||||||
else if (row.name === '' || row.name === '(nil)')
|
|
||||||
delete tags.name;
|
|
||||||
else
|
|
||||||
tags.name = row.name;
|
|
||||||
|
|
||||||
way.setTags(tags);
|
|
||||||
this.OSMDB.addWay(way);
|
|
||||||
this.nameWayHash[nodes] = way;
|
|
||||||
cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
table.hashes().forEach((row) => q.defer(addWay, row));
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the relations$/, (table, callback) => {
|
|
||||||
if (this.osm_str) throw new Error('*** Map data already defined - did you pass an input file in this scenario?');
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var addRelation = (row, cb) => {
|
|
||||||
var relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
|
||||||
|
|
||||||
for (var key in row) {
|
|
||||||
var isNode = key.match(/^node:(.*)/),
|
|
||||||
isWay = key.match(/^way:(.*)/),
|
|
||||||
isColonSeparated = key.match(/^(.*):(.*)/);
|
|
||||||
if (isNode) {
|
|
||||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
|
||||||
if (nodeName.length !== 1) throw new Error(util.format('*** invalid relation node member "%s"'), nodeName);
|
|
||||||
var node = this.findNodeByName(nodeName);
|
|
||||||
if (!node) throw new Error(util.format('*** unknown relation node member "%s"'), nodeName);
|
|
||||||
relation.addMember('node', node.id, isNode[1]);
|
|
||||||
});
|
|
||||||
} else if (isWay) {
|
|
||||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((wayName) => {
|
|
||||||
var way = this.findWayByName(wayName);
|
|
||||||
if (!way) throw new Error(util.format('*** unknown relation way member "%s"'), wayName);
|
|
||||||
relation.addMember('way', way.id, isWay[1]);
|
|
||||||
});
|
|
||||||
} else if (isColonSeparated && isColonSeparated[1] !== 'restriction') {
|
|
||||||
throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"'), isColonSeparated[1], isColonSeparated[2]);
|
|
||||||
} else {
|
|
||||||
relation.addTag(key, row[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
relation.uid = this.OSM_UID;
|
|
||||||
|
|
||||||
this.OSMDB.addRelation(relation);
|
|
||||||
|
|
||||||
cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
table.hashes().forEach((row) => q.defer(addRelation, row));
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the input file ([^"]*)$/, (file, callback) => {
|
|
||||||
if (path.extname(file) !== '.osm') throw new Error('*** Input file must be in .osm format');
|
|
||||||
fs.readFile(file, 'utf8', (err, data) => {
|
|
||||||
if (!err) this.osm_str = data.toString();
|
|
||||||
callback(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the raster source$/, (data, callback) => {
|
|
||||||
fs.writeFile(path.resolve(this.TEST_FOLDER, 'rastersource.asc'), data, callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the speed file$/, (data, callback) => {
|
|
||||||
fs.writeFile(path.resolve(this.TEST_FOLDER, 'speeds.csv'), data, callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the data has been saved to disk$/, (callback) => {
|
|
||||||
try {
|
|
||||||
this.reprocess(callback);
|
|
||||||
} catch(e) {
|
|
||||||
this.processError = e;
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the data has been extracted$/, (callback) => {
|
|
||||||
this.writeAndExtract((err) => {
|
|
||||||
if (err) this.processError = err;
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the data has been contracted$/, (callback) => {
|
|
||||||
this.reprocess((err) => {
|
|
||||||
if (err) this.processError = err;
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^osrm\-routed is stopped$/, (callback) => {
|
|
||||||
this.OSRMLoader.shutdown((err) => {
|
|
||||||
if (err) this.processError = err;
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^data is loaded directly/, () => {
|
|
||||||
this.loadMethod = 'directly';
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^data is loaded with datastore$/, () => {
|
|
||||||
this.loadMethod = 'datastore';
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the HTTP method "([^"]*)"$/, (method, callback) => {
|
|
||||||
this.httpMethod = method;
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
Given /^the profile "([^"]*)"$/ do |profile|
|
||||||
|
set_profile profile
|
||||||
|
end
|
||||||
|
|
||||||
|
Given(/^the import format "(.*?)"$/) do |format|
|
||||||
|
set_input_format format
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the extract extra arguments "(.*?)"$/ do |args|
|
||||||
|
set_extract_args args
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the contract extra arguments "(.*?)"$/ do |args|
|
||||||
|
set_contract_args args
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^a grid size of (\d+) meters$/ do |meters|
|
||||||
|
set_grid_size meters
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the origin ([-+]?[0-9]*\.?[0-9]+),([-+]?[0-9]*\.?[0-9]+)$/ do |lat,lon|
|
||||||
|
set_origin [lon.to_f,lat.to_f]
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the shortcuts$/ do |table|
|
||||||
|
table.hashes.each do |row|
|
||||||
|
shortcuts_hash[ row['key'] ] = row['value']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the node map$/ do |table|
|
||||||
|
table.raw.each_with_index do |row,ri|
|
||||||
|
row.each_with_index do |name,ci|
|
||||||
|
unless name.empty?
|
||||||
|
raise "*** node invalid name '#{name}', must be single characters" unless name.size == 1
|
||||||
|
raise "*** invalid node name '#{name}', must me alphanumeric" unless name.match /[a-z0-9]/
|
||||||
|
if name.match /[a-z]/
|
||||||
|
raise "*** duplicate node '#{name}'" if name_node_hash[name]
|
||||||
|
add_osm_node name, *table_coord_to_lonlat(ci,ri), nil
|
||||||
|
else
|
||||||
|
raise "*** duplicate node '#{name}'" if location_hash[name]
|
||||||
|
add_location name, *table_coord_to_lonlat(ci,ri)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the node locations$/ do |table|
|
||||||
|
table.hashes.each do |row|
|
||||||
|
name = row['node']
|
||||||
|
raise "*** duplicate node '#{name}'" if find_node_by_name name
|
||||||
|
if name.match /[a-z]/
|
||||||
|
id = row['id']
|
||||||
|
id = id.to_i if id
|
||||||
|
add_osm_node name, row['lon'].to_f, row['lat'].to_f, id
|
||||||
|
else
|
||||||
|
add_location name, row['lon'].to_f, row['lat'].to_f
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the nodes$/ do |table|
|
||||||
|
table.hashes.each do |row|
|
||||||
|
name = row.delete 'node'
|
||||||
|
node = find_node_by_name(name)
|
||||||
|
raise "*** unknown node '#{c}'" unless node
|
||||||
|
node << row
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the ways$/ do |table|
|
||||||
|
raise "*** Map data already defined - did you pass an input file in this scenaria?" if @osm_str
|
||||||
|
table.hashes.each do |row|
|
||||||
|
way = OSM::Way.new make_osm_id, OSM_USER, OSM_TIMESTAMP
|
||||||
|
way.uid = OSM_UID
|
||||||
|
|
||||||
|
nodes = row.delete 'nodes'
|
||||||
|
raise "*** duplicate way '#{nodes}'" if name_way_hash[nodes]
|
||||||
|
nodes.each_char do |c|
|
||||||
|
raise "*** ways can only use names a-z, '#{name}'" unless c.match /[a-z]/
|
||||||
|
node = find_node_by_name(c)
|
||||||
|
raise "*** unknown node '#{c}'" unless node
|
||||||
|
way << node
|
||||||
|
end
|
||||||
|
|
||||||
|
defaults = { 'highway' => 'primary' }
|
||||||
|
tags = defaults.merge(row)
|
||||||
|
|
||||||
|
if row['highway'] == '(nil)'
|
||||||
|
tags.delete 'highway'
|
||||||
|
end
|
||||||
|
|
||||||
|
if row['name'] == nil
|
||||||
|
tags['name'] = nodes
|
||||||
|
elsif (row['name'] == '""') || (row['name'] == "''")
|
||||||
|
tags['name'] = ''
|
||||||
|
elsif row['name'] == '' || row['name'] == '(nil)'
|
||||||
|
tags.delete 'name'
|
||||||
|
else
|
||||||
|
tags['name'] = row['name']
|
||||||
|
end
|
||||||
|
|
||||||
|
way << tags
|
||||||
|
osm_db << way
|
||||||
|
name_way_hash[nodes] = way
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the relations$/ do |table|
|
||||||
|
raise "*** Map data already defined - did you pass an input file in this scenaria?" if @osm_str
|
||||||
|
table.hashes.each do |row|
|
||||||
|
relation = OSM::Relation.new make_osm_id, OSM_USER, OSM_TIMESTAMP
|
||||||
|
row.each_pair do |key,value|
|
||||||
|
if key =~ /^node:(.*)/
|
||||||
|
value.split(',').map { |v| v.strip }.each do |node_name|
|
||||||
|
raise "***invalid relation node member '#{node_name}', must be single character" unless node_name.size == 1
|
||||||
|
node = find_node_by_name(node_name)
|
||||||
|
raise "*** unknown relation node member '#{node_name}'" unless node
|
||||||
|
relation << OSM::Member.new( 'node', node.id, $1 )
|
||||||
|
end
|
||||||
|
elsif key =~ /^way:(.*)/
|
||||||
|
value.split(',').map { |v| v.strip }.each do |way_name|
|
||||||
|
way = find_way_by_name(way_name)
|
||||||
|
raise "*** unknown relation way member '#{way_name}'" unless way
|
||||||
|
relation << OSM::Member.new( 'way', way.id, $1 )
|
||||||
|
end
|
||||||
|
elsif key =~ /^(.*):(.*)/ && "#{$1}" != 'restriction'
|
||||||
|
raise "*** unknown relation member type '#{$1}:#{$2}', must be either 'node' or 'way'"
|
||||||
|
else
|
||||||
|
relation << { key => value }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
relation.uid = OSM_UID
|
||||||
|
osm_db << relation
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the defaults$/ do
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the input file ([^"]*)$/ do |file|
|
||||||
|
raise "*** Input file must in .osm format" unless File.extname(file)=='.osm'
|
||||||
|
@osm_str = File.read file
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the raster source$/ do |data|
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
File.open("rastersource.asc", "w") {|f| f.write(data)}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the speed file$/ do |data|
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
File.open("speeds.csv", "w") {|f| f.write(data)}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the data has been saved to disk$/ do
|
||||||
|
begin
|
||||||
|
write_input_data
|
||||||
|
rescue OSRMError => e
|
||||||
|
@process_error = e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the data has been extracted$/ do
|
||||||
|
begin
|
||||||
|
write_input_data
|
||||||
|
extract_data unless extracted?
|
||||||
|
rescue OSRMError => e
|
||||||
|
@process_error = e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the data has been contracted$/ do
|
||||||
|
begin
|
||||||
|
reprocess
|
||||||
|
rescue OSRMError => e
|
||||||
|
@process_error = e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^osrm\-routed is stopped$/ do
|
||||||
|
begin
|
||||||
|
OSRMLoader.shutdown
|
||||||
|
rescue OSRMError => e
|
||||||
|
@process_error = e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^data is loaded directly/ do
|
||||||
|
@load_method = 'directly'
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^data is loaded with datastore$/ do
|
||||||
|
@load_method = 'datastore'
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^the HTTP method "([^"]*)"$/ do |method|
|
||||||
|
@http_method = method
|
||||||
|
end
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.When(/^I request a travel time matrix I should get$/, (table, callback) => {
|
|
||||||
var NO_ROUTE = 2147483647; // MAX_INT
|
|
||||||
|
|
||||||
var tableRows = table.raw();
|
|
||||||
|
|
||||||
if (tableRows[0][0] !== '') throw new Error('*** Top-left cell of matrix table must be empty');
|
|
||||||
|
|
||||||
var waypoints = [],
|
|
||||||
columnHeaders = tableRows[0].slice(1),
|
|
||||||
rowHeaders = tableRows.map((h) => h[0]).slice(1),
|
|
||||||
symmetric = columnHeaders.every((ele, i) => ele === rowHeaders[i]);
|
|
||||||
|
|
||||||
if (symmetric) {
|
|
||||||
columnHeaders.forEach((nodeName) => {
|
|
||||||
var node = this.findNodeByName(nodeName);
|
|
||||||
if (!node) throw new Error(util.format('*** unknown node "%s"'), nodeName);
|
|
||||||
waypoints.push({ coord: node, type: 'loc' });
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
columnHeaders.forEach((nodeName) => {
|
|
||||||
var node = this.findNodeByName(nodeName);
|
|
||||||
if (!node) throw new Error(util.format('*** unknown node "%s"'), nodeName);
|
|
||||||
waypoints.push({ coord: node, type: 'dst' });
|
|
||||||
});
|
|
||||||
rowHeaders.forEach((nodeName) => {
|
|
||||||
var node = this.findNodeByName(nodeName);
|
|
||||||
if (!node) throw new Error(util.format('*** unknown node "%s"'), nodeName);
|
|
||||||
waypoints.push({ coord: node, type: 'src' });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var actual = [];
|
|
||||||
actual.push(table.headers);
|
|
||||||
|
|
||||||
this.reprocessAndLoadData(() => {
|
|
||||||
// compute matrix
|
|
||||||
var params = this.queryParams;
|
|
||||||
|
|
||||||
this.requestTable(waypoints, params, (err, response) => {
|
|
||||||
if (err) return callback(err);
|
|
||||||
if (!response.body.length) return callback(new Error('Invalid response body'));
|
|
||||||
|
|
||||||
var json = JSON.parse(response.body);
|
|
||||||
|
|
||||||
var result = json['durations'].map(row => {
|
|
||||||
var hashes = {};
|
|
||||||
row.forEach((v, i) => { hashes[tableRows[0][i+1]] = isNaN(parseInt(v)) ? '' : v; });
|
|
||||||
return hashes;
|
|
||||||
});
|
|
||||||
|
|
||||||
var testRow = (row, ri, cb) => {
|
|
||||||
var ok = true;
|
|
||||||
|
|
||||||
for (var k in result[ri]) {
|
|
||||||
if (this.FuzzyMatch.match(result[ri][k], row[k])) {
|
|
||||||
result[ri][k] = row[k];
|
|
||||||
} else if (row[k] === '' && result[ri][k] === NO_ROUTE) {
|
|
||||||
result[ri][k] = '';
|
|
||||||
} else {
|
|
||||||
result[ri][k] = result[ri][k].toString();
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
var failed = { attempt: 'distance_matrix', query: this.query, response: response };
|
|
||||||
this.logFail(row, result[ri], [failed]);
|
|
||||||
}
|
|
||||||
|
|
||||||
result[ri][''] = row[''];
|
|
||||||
cb(null, result[ri]);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.processRowsAndDiff(table, testRow, callback);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
When /^I request a travel time matrix I should get$/ do |table|
|
||||||
|
no_route = 2147483647 # MAX_INT
|
||||||
|
|
||||||
|
raise "*** Top-left cell of matrix table must be empty" unless table.headers[0]==""
|
||||||
|
|
||||||
|
waypoints = []
|
||||||
|
column_headers = table.headers[1..-1]
|
||||||
|
row_headers = table.rows.map { |h| h.first }
|
||||||
|
symmetric = Set.new(column_headers) == Set.new(row_headers)
|
||||||
|
if symmetric then
|
||||||
|
column_headers.each do |node_name|
|
||||||
|
node = find_node_by_name(node_name)
|
||||||
|
raise "*** unknown node '#{node_name}" unless node
|
||||||
|
waypoints << {:coord => node, :type => "loc"}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
column_headers.each do |node_name|
|
||||||
|
node = find_node_by_name(node_name)
|
||||||
|
raise "*** unknown node '#{node_name}" unless node
|
||||||
|
waypoints << {:coord => node, :type => "dst"}
|
||||||
|
end
|
||||||
|
row_headers.each do |node_name|
|
||||||
|
node = find_node_by_name(node_name)
|
||||||
|
raise "*** unknown node '#{node_name}" unless node
|
||||||
|
waypoints << {:coord => node, :type => "src"}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
reprocess
|
||||||
|
actual = []
|
||||||
|
actual << table.headers
|
||||||
|
OSRMLoader.load(self,"#{contracted_file}.osrm") do
|
||||||
|
|
||||||
|
# compute matrix
|
||||||
|
params = @query_params
|
||||||
|
response = request_table waypoints, params
|
||||||
|
if response.body.empty? == false
|
||||||
|
json_result = JSON.parse response.body
|
||||||
|
result = json_result["distance_table"]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# compare actual and expected result, one row at a time
|
||||||
|
table.rows.each_with_index do |row,ri|
|
||||||
|
# fuzzy match
|
||||||
|
ok = true
|
||||||
|
0.upto(result[ri].size-1) do |i|
|
||||||
|
if FuzzyMatch.match result[ri][i], row[i+1]
|
||||||
|
result[ri][i] = row[i+1]
|
||||||
|
elsif row[i+1]=="" and result[ri][i]==no_route
|
||||||
|
result[ri][i] = ""
|
||||||
|
else
|
||||||
|
result[ri][i] = result[ri][i].to_s
|
||||||
|
ok = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# add row header
|
||||||
|
r = [row[0],result[ri]].flatten
|
||||||
|
|
||||||
|
# store row for comparison
|
||||||
|
actual << r
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.diff! actual
|
||||||
|
end
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.Before((scenario, callback) => {
|
|
||||||
this.scenarioTitle = scenario.getName();
|
|
||||||
|
|
||||||
this.loadMethod = this.DEFAULT_LOAD_METHOD;
|
|
||||||
this.queryParams = {};
|
|
||||||
var d = new Date();
|
|
||||||
this.scenarioTime = util.format('%d-%d-%dT%s:%s:%sZ', d.getFullYear(), d.getMonth()+1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds());
|
|
||||||
this.resetData();
|
|
||||||
this.hasLoggedPreprocessInfo = false;
|
|
||||||
this.hasLoggedScenarioInfo = false;
|
|
||||||
this.setGridSize(this.DEFAULT_GRID_SIZE);
|
|
||||||
this.setOrigin(this.DEFAULT_ORIGIN);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Before('@ignore-platform-windows', () => {
|
|
||||||
this.skipThisScenario();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Before('@ignore-platform-unix', () => {
|
|
||||||
this.skipThisScenario();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Before('@ignore-platform-mac', () => {
|
|
||||||
this.skipThisScenario();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Before '@ignore-platform-windows' do
|
||||||
|
skip_this_scenario
|
||||||
|
end
|
||||||
|
|
||||||
|
Before '@ignore-platform-unix' do
|
||||||
|
skip_this_scenario
|
||||||
|
end
|
||||||
|
|
||||||
|
Before '@ignore-platform-mac' do
|
||||||
|
skip_this_scenario
|
||||||
|
end
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.When(/^I match I should get$/, (table, callback) => {
|
|
||||||
var got;
|
|
||||||
|
|
||||||
this.reprocessAndLoadData(() => {
|
|
||||||
var testRow = (row, ri, cb) => {
|
|
||||||
var afterRequest = (err, res) => {
|
|
||||||
if (err) return cb(err);
|
|
||||||
var json;
|
|
||||||
|
|
||||||
var headers = new Set(table.raw()[0]);
|
|
||||||
|
|
||||||
if (res.body.length) {
|
|
||||||
json = JSON.parse(res.body);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('status')) {
|
|
||||||
got.status = json.status.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('message')) {
|
|
||||||
got.message = json.status_message;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('#')) {
|
|
||||||
// comment column
|
|
||||||
got['#'] = row['#'];
|
|
||||||
}
|
|
||||||
|
|
||||||
var subMatchings = [],
|
|
||||||
turns = '',
|
|
||||||
route = '',
|
|
||||||
duration = '';
|
|
||||||
|
|
||||||
if (res.statusCode === 200) {
|
|
||||||
if (headers.has('matchings')) {
|
|
||||||
subMatchings = json.matchings.filter(m => !!m).map(sub => sub.matched_points);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('turns')) {
|
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking turns only supported for matchings with one subtrace');
|
|
||||||
turns = this.turnList(json.matchings[0].instructions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('route')) {
|
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking route only supported for matchings with one subtrace');
|
|
||||||
route = this.wayList(json.matchings[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('duration')) {
|
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking duration only supported for matchings with one subtrace');
|
|
||||||
duration = json.matchings[0].duration;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('turns')) {
|
|
||||||
got.turns = turns;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('route')) {
|
|
||||||
got.route = route;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('duration')) {
|
|
||||||
got.duration = duration.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
var ok = true;
|
|
||||||
var encodedResult = '',
|
|
||||||
extendedTarget = '';
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var testSubMatching = (sub, si, scb) => {
|
|
||||||
if (si >= subMatchings.length) {
|
|
||||||
ok = false;
|
|
||||||
q.abort();
|
|
||||||
scb();
|
|
||||||
} else {
|
|
||||||
var sq = d3.queue();
|
|
||||||
|
|
||||||
var testSubNode = (ni, ncb) => {
|
|
||||||
var node = this.findNodeByName(sub[ni]),
|
|
||||||
outNode = subMatchings[si][ni];
|
|
||||||
|
|
||||||
if (this.FuzzyMatch.matchLocation(outNode, node)) {
|
|
||||||
encodedResult += sub[ni];
|
|
||||||
extendedTarget += sub[ni];
|
|
||||||
} else {
|
|
||||||
encodedResult += util.format('? [%s,%s]', outNode[0], outNode[1]);
|
|
||||||
extendedTarget += util.format('%s [%d,%d]', node.lat, node.lon);
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
ncb();
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i=0; i<sub.length; i++) {
|
|
||||||
sq.defer(testSubNode, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
sq.awaitAll(scb);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
row.matchings.split(',').forEach((sub, si) => {
|
|
||||||
q.defer(testSubMatching, sub, si);
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll(() => {
|
|
||||||
if (ok) {
|
|
||||||
if (headers.has('matchings')) {
|
|
||||||
got.matchings = row.matchings;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('timestamps')) {
|
|
||||||
got.timestamps = row.timestamps;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
got.matchings = encodedResult;
|
|
||||||
row.matchings = extendedTarget;
|
|
||||||
this.logFail(row, got, { matching: { query: this.query, response: res } });
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, got);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
if (row.request) {
|
|
||||||
got = {};
|
|
||||||
got.request = row.request;
|
|
||||||
this.requestUrl(row.request, afterRequest);
|
|
||||||
} else {
|
|
||||||
var params = this.queryParams;
|
|
||||||
got = {};
|
|
||||||
for (var k in row) {
|
|
||||||
var match = k.match(/param:(.*)/);
|
|
||||||
if (match) {
|
|
||||||
if (row[k] === '(nil)') {
|
|
||||||
params[match[1]] = null;
|
|
||||||
} else if (row[k]) {
|
|
||||||
params[match[1]] = [row[k]];
|
|
||||||
}
|
|
||||||
got[k] = row[k];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var trace = [],
|
|
||||||
timestamps = [];
|
|
||||||
|
|
||||||
if (row.trace) {
|
|
||||||
for (var i=0; i<row.trace.length; i++) {
|
|
||||||
var n = row.trace[i],
|
|
||||||
node = this.findNodeByName(n);
|
|
||||||
if (!node) throw new Error(util.format('*** unknown waypoint node "%s"'), n);
|
|
||||||
trace.push(node);
|
|
||||||
}
|
|
||||||
if (row.timestamps) {
|
|
||||||
timestamps = row.timestamps.split(' ').filter(s => !!s).map(t => parseInt(t, 10));
|
|
||||||
}
|
|
||||||
got.trace = row.trace;
|
|
||||||
this.requestMatching(trace, timestamps, params, afterRequest);
|
|
||||||
} else {
|
|
||||||
throw new Error('*** no trace');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.processRowsAndDiff(table, testRow, callback);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
When /^I match I should get$/ do |table|
|
||||||
|
reprocess
|
||||||
|
actual = []
|
||||||
|
OSRMLoader.load(self,"#{contracted_file}.osrm") do
|
||||||
|
table.hashes.each_with_index do |row,ri|
|
||||||
|
if row['request']
|
||||||
|
got = {'request' => row['request'] }
|
||||||
|
response = request_url row['request']
|
||||||
|
else
|
||||||
|
params = @query_params
|
||||||
|
got = {}
|
||||||
|
row.each_pair do |k,v|
|
||||||
|
if k =~ /param:(.*)/
|
||||||
|
if v=='(nil)'
|
||||||
|
params[$1]=nil
|
||||||
|
elsif v!=nil
|
||||||
|
params[$1]=[v]
|
||||||
|
end
|
||||||
|
got[k]=v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
trace = []
|
||||||
|
timestamps = []
|
||||||
|
if row['trace']
|
||||||
|
row['trace'].each_char do |n|
|
||||||
|
node = find_node_by_name(n.strip)
|
||||||
|
raise "*** unknown waypoint node '#{n.strip}" unless node
|
||||||
|
trace << node
|
||||||
|
end
|
||||||
|
if row['timestamps']
|
||||||
|
timestamps = row['timestamps'].split(" ").compact.map { |t| t.to_i}
|
||||||
|
end
|
||||||
|
got = got.merge({'trace' => row['trace'] })
|
||||||
|
response = request_matching trace, timestamps, params
|
||||||
|
else
|
||||||
|
raise "*** no trace"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if response.body.empty? == false
|
||||||
|
json = JSON.parse response.body
|
||||||
|
end
|
||||||
|
|
||||||
|
if table.headers.include? 'status'
|
||||||
|
got['status'] = json['status'].to_s
|
||||||
|
end
|
||||||
|
if table.headers.include? 'message'
|
||||||
|
got['message'] = json['status_message']
|
||||||
|
end
|
||||||
|
if table.headers.include? '#' # comment column
|
||||||
|
got['#'] = row['#'] # copy value so it always match
|
||||||
|
end
|
||||||
|
|
||||||
|
sub_matchings = []
|
||||||
|
turns = ''
|
||||||
|
route = ''
|
||||||
|
duration = ''
|
||||||
|
if response.code == "200"
|
||||||
|
if table.headers.include? 'matchings'
|
||||||
|
sub_matchings = json['matchings'].compact.map { |sub| sub['matched_points']}
|
||||||
|
end
|
||||||
|
if table.headers.include? 'turns'
|
||||||
|
raise "*** Checking turns only support for matchings with one subtrace" unless json['matchings'].size == 1
|
||||||
|
turns = turn_list json['matchings'][0]['instructions']
|
||||||
|
end
|
||||||
|
if table.headers.include? 'route'
|
||||||
|
raise "*** Checking route only support for matchings with one subtrace" unless json['matchings'].size == 1
|
||||||
|
route = way_list json['matchings'][0]['instructions']
|
||||||
|
if table.headers.include? 'duration'
|
||||||
|
raise "*** Checking duration only support for matchings with one subtrace" unless json['matchings'].size == 1
|
||||||
|
duration = json['matchings'][0]['route_summary']['total_time']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if table.headers.include? 'turns'
|
||||||
|
got['turns'] = turns
|
||||||
|
end
|
||||||
|
if table.headers.include? 'route'
|
||||||
|
got['route'] = route
|
||||||
|
end
|
||||||
|
if table.headers.include? 'duration'
|
||||||
|
got['duration'] = duration.to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
ok = true
|
||||||
|
encoded_result = ""
|
||||||
|
extended_target = ""
|
||||||
|
row['matchings'].split(',').each_with_index do |sub, sub_idx|
|
||||||
|
if sub_idx >= sub_matchings.length
|
||||||
|
ok = false
|
||||||
|
break
|
||||||
|
end
|
||||||
|
sub.length.times do |node_idx|
|
||||||
|
node = find_node_by_name(sub[node_idx])
|
||||||
|
out_node = sub_matchings[sub_idx][node_idx]
|
||||||
|
if FuzzyMatch.match_location out_node, node
|
||||||
|
encoded_result += sub[node_idx]
|
||||||
|
extended_target += sub[node_idx]
|
||||||
|
else
|
||||||
|
encoded_result += "? [#{out_node[0]},#{out_node[1]}]"
|
||||||
|
extended_target += "#{sub[node_idx]} [#{node.lat},#{node.lon}]"
|
||||||
|
ok = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if ok
|
||||||
|
if table.headers.include? 'matchings'
|
||||||
|
got['matchings'] = row['matchings']
|
||||||
|
end
|
||||||
|
if table.headers.include? 'timestamps'
|
||||||
|
got['timestamps'] = row['timestamps']
|
||||||
|
end
|
||||||
|
else
|
||||||
|
got['matchings'] = encoded_result
|
||||||
|
row['matchings'] = extended_target
|
||||||
|
log_fail row,got, { 'matching' => {:query => @query, :response => response} }
|
||||||
|
end
|
||||||
|
|
||||||
|
actual << got
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.diff! actual
|
||||||
|
end
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.When(/^I request nearest I should get$/, (table, callback) => {
|
|
||||||
this.reprocessAndLoadData(() => {
|
|
||||||
var testRow = (row, ri, cb) => {
|
|
||||||
var inNode = this.findNodeByName(row.in);
|
|
||||||
if (!inNode) throw new Error(util.format('*** unknown in-node "%s"'), row.in);
|
|
||||||
|
|
||||||
var outNode = this.findNodeByName(row.out);
|
|
||||||
if (!outNode) throw new Error(util.format('*** unknown out-node "%s"'), row.out);
|
|
||||||
|
|
||||||
this.requestNearest(inNode, this.queryParams, (err, response) => {
|
|
||||||
if (err) return cb(err);
|
|
||||||
var coord;
|
|
||||||
|
|
||||||
if (response.statusCode === 200 && response.body.length) {
|
|
||||||
var json = JSON.parse(response.body);
|
|
||||||
|
|
||||||
coord = json.waypoints[0].location;
|
|
||||||
|
|
||||||
var got = { in: row.in, out: row.out };
|
|
||||||
|
|
||||||
var ok = true;
|
|
||||||
|
|
||||||
Object.keys(row).forEach((key) => {
|
|
||||||
if (key === 'out') {
|
|
||||||
if (this.FuzzyMatch.matchLocation(coord, outNode)) {
|
|
||||||
got[key] = row[key];
|
|
||||||
} else {
|
|
||||||
row[key] = util.format('%s [%d,%d]', row[key], outNode.lat, outNode.lon);
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
var failed = { attempt: 'nearest', query: this.query, response: response };
|
|
||||||
this.logFail(row, got, [failed]);
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, got);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cb();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.processRowsAndDiff(table, testRow, callback);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
When /^I request nearest I should get$/ do |table|
|
||||||
|
reprocess
|
||||||
|
actual = []
|
||||||
|
OSRMLoader.load(self,"#{contracted_file}.osrm") do
|
||||||
|
table.hashes.each_with_index do |row,ri|
|
||||||
|
in_node = find_node_by_name row['in']
|
||||||
|
raise "*** unknown in-node '#{row['in']}" unless in_node
|
||||||
|
|
||||||
|
out_node = find_node_by_name row['out']
|
||||||
|
raise "*** unknown out-node '#{row['out']}" unless out_node
|
||||||
|
|
||||||
|
response = request_nearest in_node, @query_params
|
||||||
|
if response.code == "200" && response.body.empty? == false
|
||||||
|
json = JSON.parse response.body
|
||||||
|
if json['status'] == 200
|
||||||
|
coord = json['mapped_coordinate']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
got = {'in' => row['in'], 'out' => coord }
|
||||||
|
|
||||||
|
ok = true
|
||||||
|
row.keys.each do |key|
|
||||||
|
if key=='out'
|
||||||
|
if FuzzyMatch.match_location coord, out_node
|
||||||
|
got[key] = row[key]
|
||||||
|
else
|
||||||
|
row[key] = "#{row[key]} [#{out_node.lat},#{out_node.lon}]"
|
||||||
|
ok = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
unless ok
|
||||||
|
failed = { :attempt => 'nearest', :query => @query, :response => response }
|
||||||
|
log_fail row,got,[failed]
|
||||||
|
end
|
||||||
|
|
||||||
|
actual << got
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.diff! actual
|
||||||
|
end
|
||||||
|
|
||||||
|
When /^I request nearest (\d+) times I should get$/ do |n,table|
|
||||||
|
ok = true
|
||||||
|
n.to_i.times do
|
||||||
|
ok = false unless step "I request nearest I should get", table
|
||||||
|
end
|
||||||
|
ok
|
||||||
|
end
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.When(/^I run "osrm\-routed\s?(.*?)"$/, { timeout: this.SHUTDOWN_TIMEOUT }, (options, callback) => {
|
|
||||||
this.runBin('osrm-routed', options, () => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.When(/^I run "osrm\-extract\s?(.*?)"$/, (options, callback) => {
|
|
||||||
this.runBin('osrm-extract', options, () => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.When(/^I run "osrm\-contract\s?(.*?)"$/, (options, callback) => {
|
|
||||||
this.runBin('osrm-contract', options, () => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.When(/^I run "osrm\-datastore\s?(.*?)"$/, (options, callback) => {
|
|
||||||
this.runBin('osrm-datastore', options, () => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^it should exit with code (\d+)$/, (code) => {
|
|
||||||
assert.equal(this.exitCode, parseInt(code));
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^stdout should contain "(.*?)"$/, (str) => {
|
|
||||||
assert.ok(this.stdout.indexOf(str) > -1);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^stderr should contain "(.*?)"$/, (str) => {
|
|
||||||
assert.ok(this.stderr.indexOf(str) > -1);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
|
||||||
var re = new RegExp(regexStr);
|
|
||||||
assert.ok(this.stdout.match(re));
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^stderr should contain \/(.*)\/$/, (regexStr) => {
|
|
||||||
var re = new RegExp(regexStr);
|
|
||||||
assert.ok(this.stdout.match(re));
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^stdout should be empty$/, () => {
|
|
||||||
assert.equal(this.stdout.trim(), '');
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^stderr should be empty$/, () => {
|
|
||||||
assert.equal(this.stderr.trim(), '');
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^stdout should contain (\d+) lines?$/, (lines) => {
|
|
||||||
assert.equal(this.stdout.split('\n').length - 1, parseInt(lines));
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^the query options$/, (table, callback) => {
|
|
||||||
table.raw().forEach(tuple => {
|
|
||||||
this.queryParams[tuple[0]] = tuple[1];
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
When(/^I run "osrm\-routed\s?(.*?)"$/) do |options|
|
||||||
|
begin
|
||||||
|
Timeout.timeout(SHUTDOWN_TIMEOUT) { run_bin 'osrm-routed', options }
|
||||||
|
rescue Timeout::Error
|
||||||
|
raise "*** osrm-routed didn't quit. Maybe the --trial option wasn't used?"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
When(/^I run "osrm\-extract\s?(.*?)"$/) do |options|
|
||||||
|
run_bin 'osrm-extract', options
|
||||||
|
end
|
||||||
|
|
||||||
|
When(/^I run "osrm\-contract\s?(.*?)"$/) do |options|
|
||||||
|
run_bin 'osrm-contract', options
|
||||||
|
end
|
||||||
|
|
||||||
|
When(/^I run "osrm\-datastore\s?(.*?)"$/) do |options|
|
||||||
|
run_bin 'osrm-datastore', options
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^it should exit with code (\d+)$/ do |code|
|
||||||
|
expect(@exit_code).to eq( code.to_i )
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^stdout should contain "(.*?)"$/ do |str|
|
||||||
|
expect(@stdout).to include(str)
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^stderr should contain "(.*?)"$/ do |str|
|
||||||
|
expect(@stderr).to include(str)
|
||||||
|
end
|
||||||
|
|
||||||
|
Then(/^stdout should contain \/(.*)\/$/) do |regex_str|
|
||||||
|
regex = Regexp.new regex_str
|
||||||
|
expect(@stdout).to match( regex )
|
||||||
|
end
|
||||||
|
|
||||||
|
Then(/^stderr should contain \/(.*)\/$/) do |regex_str|
|
||||||
|
regex = Regexp.new regex_str
|
||||||
|
expect(@stderr).to match( regex )
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^stdout should be empty$/ do
|
||||||
|
expect(@stdout).to eq("")
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^stderr should be empty$/ do
|
||||||
|
expect(@stderr).to eq("")
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^stdout should contain (\d+) lines?$/ do |lines|
|
||||||
|
expect(@stdout.lines.count).to eq( lines.to_i )
|
||||||
|
end
|
||||||
|
|
||||||
|
Given (/^the query options$/) do |table|
|
||||||
|
table.rows_hash.each { |k,v| @query_params << [k, v] }
|
||||||
|
end
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.When(/^I request \/(.*)$/, (path, callback) => {
|
|
||||||
this.reprocessAndLoadData(() => {
|
|
||||||
this.requestPath(path, {}, (err, res, body) => {
|
|
||||||
this.response = res;
|
|
||||||
callback(err, res, body);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^I should get a response/, () => {
|
|
||||||
this.ShouldGetAResponse();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^response should be valid JSON$/, (callback) => {
|
|
||||||
this.ShouldBeValidJSON(callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^response should be well-formed$/, () => {
|
|
||||||
this.ShouldBeWellFormed();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^status code should be (\d+)$/, (code, callback) => {
|
|
||||||
try {
|
|
||||||
this.json = JSON.parse(this.response.body);
|
|
||||||
} catch(e) {
|
|
||||||
return callback(e);
|
|
||||||
}
|
|
||||||
assert.equal(this.json.status, parseInt(code));
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^status message should be "(.*?)"$/, (message, callback) => {
|
|
||||||
try {
|
|
||||||
this.json = JSON.parse(this.response.body);
|
|
||||||
} catch(e) {
|
|
||||||
return callback(e);
|
|
||||||
}
|
|
||||||
assert(this.json.status_message, message);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^response should be a well-formed route$/, () => {
|
|
||||||
this.ShouldBeWellFormed();
|
|
||||||
assert.equal(this.json.code, 'ok');
|
|
||||||
assert.ok(Array.isArray(this.json.routes));
|
|
||||||
assert.ok(Array.isArray(this.json.waypoints));
|
|
||||||
});
|
|
||||||
|
|
||||||
this.Then(/^"([^"]*)" should return code (\d+)$/, (binary, code) => {
|
|
||||||
assert.ok(this.processError instanceof this.OSRMError);
|
|
||||||
assert.equal(this.processError.process, binary);
|
|
||||||
assert.equal(parseInt(this.processError.code), parseInt(code));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
When /^I request \/(.*)$/ do |path|
|
||||||
|
reprocess
|
||||||
|
OSRMLoader.load(self,"#{contracted_file}.osrm") do
|
||||||
|
@response = request_path path, []
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^I should get a response/ do
|
||||||
|
expect(@response.code).to eq("200")
|
||||||
|
expect(@response.body).not_to eq(nil)
|
||||||
|
expect(@response.body).not_to eq('')
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^response should be valid JSON$/ do
|
||||||
|
@json = JSON.parse @response.body
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^response should be well-formed$/ do
|
||||||
|
expect(@json['status'].class).to eq(Fixnum)
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^status code should be (\d+)$/ do |code|
|
||||||
|
@json = JSON.parse @response.body
|
||||||
|
expect(@json['status']).to eq(code.to_i)
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^status message should be "(.*?)"$/ do |message|
|
||||||
|
@json = JSON.parse @response.body
|
||||||
|
expect(@json['status_message']).to eq(message)
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^response should be a well-formed route$/ do
|
||||||
|
step "response should be well-formed"
|
||||||
|
expect(@json['status_message'].class).to eq(String)
|
||||||
|
expect(@json['route_summary'].class).to eq(Hash)
|
||||||
|
expect(@json['route_geometry'].class).to eq(String)
|
||||||
|
expect(@json['route_instructions'].class).to eq(Array)
|
||||||
|
expect(@json['via_points'].class).to eq(Array)
|
||||||
|
expect(@json['via_indices'].class).to eq(Array)
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^"([^"]*)" should return code (\d+)$/ do |binary, code|
|
||||||
|
expect(@process_error.is_a?(OSRMError)).to eq(true)
|
||||||
|
expect(@process_error.process).to eq(binary)
|
||||||
|
expect(@process_error.code.to_i).to eq(code.to_i)
|
||||||
|
end
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
var classes = require('../support/data_classes');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.Then(/^routability should be$/, (table, callback) => {
|
|
||||||
this.buildWaysFromTable(table, () => {
|
|
||||||
var directions = ['forw','backw','bothw'],
|
|
||||||
headers = new Set(Object.keys(table.hashes()[0]));
|
|
||||||
|
|
||||||
if (!directions.some(k => !!headers.has(k))) {
|
|
||||||
throw new Error('*** routability table must contain either "forw", "backw" or "bothw" column');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.reprocessAndLoadData(() => {
|
|
||||||
var testRow = (row, i, cb) => {
|
|
||||||
var outputRow = row;
|
|
||||||
|
|
||||||
testRoutabilityRow(i, (err, result) => {
|
|
||||||
if (err) return cb(err);
|
|
||||||
directions.filter(d => headers.has(d)).forEach((direction) => {
|
|
||||||
var want = this.shortcutsHash[row[direction]] || row[direction];
|
|
||||||
|
|
||||||
switch (true) {
|
|
||||||
case '' === want:
|
|
||||||
case 'x' === want:
|
|
||||||
outputRow[direction] = result[direction].status ?
|
|
||||||
result[direction].status.toString() : '';
|
|
||||||
break;
|
|
||||||
case /^\d+s/.test(want):
|
|
||||||
break;
|
|
||||||
case /^\d+ km\/h/.test(want):
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error(util.format('*** Unknown expectation format: %s', want));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.FuzzyMatch.match(outputRow[direction], want)) {
|
|
||||||
outputRow[direction] = row[direction];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (outputRow != row) {
|
|
||||||
this.logFail(row, outputRow, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, outputRow);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.processRowsAndDiff(table, testRow, callback);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
var testRoutabilityRow = (i, cb) => {
|
|
||||||
var result = {};
|
|
||||||
|
|
||||||
var testDirection = (dir, callback) => {
|
|
||||||
var a = new classes.Location(this.origin[0] + (1+this.WAY_SPACING*i) * this.zoom, this.origin[1]),
|
|
||||||
b = new classes.Location(this.origin[0] + (3+this.WAY_SPACING*i) * this.zoom, this.origin[1]),
|
|
||||||
r = {};
|
|
||||||
|
|
||||||
r.which = dir;
|
|
||||||
|
|
||||||
this.requestRoute((dir === 'forw' ? [a, b] : [b, a]), [], this.queryParams, (err, res, body) => {
|
|
||||||
if (err) return callback(err);
|
|
||||||
|
|
||||||
r.query = this.query;
|
|
||||||
r.json = JSON.parse(body);
|
|
||||||
r.status = res.statusCode === 200 ? 'x' : null;
|
|
||||||
if (r.status) {
|
|
||||||
r.route = this.wayList(r.json.routes[0]);
|
|
||||||
|
|
||||||
if (r.route.split(',')[0] === util.format('w%d', i)) {
|
|
||||||
r.time = r.json.routes[0].duration;
|
|
||||||
r.distance = r.json.routes[0].distance;
|
|
||||||
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
|
||||||
} else {
|
|
||||||
r.status = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(null, r);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
d3.queue(1)
|
|
||||||
.defer(testDirection, 'forw')
|
|
||||||
.defer(testDirection, 'backw')
|
|
||||||
.awaitAll((err, res) => {
|
|
||||||
if (err) return cb(err);
|
|
||||||
// check if forw and backw returned the same values
|
|
||||||
res.forEach((dirRes) => {
|
|
||||||
var which = dirRes.which;
|
|
||||||
delete dirRes.which;
|
|
||||||
result[which] = dirRes;
|
|
||||||
});
|
|
||||||
|
|
||||||
result.bothw = {};
|
|
||||||
|
|
||||||
var sq = d3.queue();
|
|
||||||
|
|
||||||
var parseRes = (key, scb) => {
|
|
||||||
if (result.forw[key] === result.backw[key]) {
|
|
||||||
result.bothw[key] = result.forw[key];
|
|
||||||
} else {
|
|
||||||
result.bothw[key] = 'diff';
|
|
||||||
}
|
|
||||||
scb();
|
|
||||||
};
|
|
||||||
|
|
||||||
['status', 'time', 'distance', 'speed'].forEach((key) => {
|
|
||||||
sq.defer(parseRes, key);
|
|
||||||
});
|
|
||||||
|
|
||||||
sq.awaitAll(() => { cb(null, result); });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
def test_routability_row i
|
||||||
|
result = {}
|
||||||
|
['forw','backw'].each do |direction|
|
||||||
|
a = Location.new @origin[0]+(1+WAY_SPACING*i)*@zoom, @origin[1]
|
||||||
|
b = Location.new @origin[0]+(3+WAY_SPACING*i)*@zoom, @origin[1]
|
||||||
|
r = {}
|
||||||
|
r[:response] = request_route (direction=='forw' ? [a,b] : [b,a]), [], @query_params
|
||||||
|
r[:query] = @query
|
||||||
|
r[:json] = JSON.parse(r[:response].body)
|
||||||
|
|
||||||
|
r[:status] = (route_status r[:response]) == 200 ? 'x' : nil
|
||||||
|
if r[:status] then
|
||||||
|
r[:route] = way_list r[:json]['route_instructions']
|
||||||
|
|
||||||
|
if r[:route]=="w#{i}"
|
||||||
|
r[:time] = r[:json]['route_summary']['total_time']
|
||||||
|
r[:distance] = r[:json]['route_summary']['total_distance']
|
||||||
|
r[:speed] = r[:time]>0 ? (3.6*r[:distance]/r[:time]).to_i : nil
|
||||||
|
else
|
||||||
|
# if we hit the wrong way segment, we assume it's
|
||||||
|
# because the one we tested was not unroutable
|
||||||
|
r[:status] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
result[direction] = r
|
||||||
|
end
|
||||||
|
|
||||||
|
# check if forw and backw returned the same values
|
||||||
|
result['bothw'] = {}
|
||||||
|
[:status,:time,:distance,:speed].each do |key|
|
||||||
|
if result['forw'][key] == result['backw'][key]
|
||||||
|
result['bothw'][key] = result['forw'][key]
|
||||||
|
else
|
||||||
|
result['bothw'][key] = 'diff'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
result
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^routability should be$/ do |table|
|
||||||
|
build_ways_from_table table
|
||||||
|
reprocess
|
||||||
|
actual = []
|
||||||
|
if table.headers&["forw","backw","bothw"] == []
|
||||||
|
raise "*** routability tabel must contain either 'forw', 'backw' or 'bothw' column"
|
||||||
|
end
|
||||||
|
OSRMLoader.load(self,"#{contracted_file}.osrm") do
|
||||||
|
table.hashes.each_with_index do |row,i|
|
||||||
|
output_row = row.dup
|
||||||
|
attempts = []
|
||||||
|
result = test_routability_row i
|
||||||
|
directions = ['forw','backw','bothw']
|
||||||
|
(directions & table.headers).each do |direction|
|
||||||
|
want = shortcuts_hash[row[direction]] || row[direction] #expand shortcuts
|
||||||
|
case want
|
||||||
|
when '', 'x'
|
||||||
|
output_row[direction] = result[direction][:status] ? result[direction][:status].to_s : ''
|
||||||
|
when /^\d+s/
|
||||||
|
output_row[direction] = result[direction][:time] ? "#{result[direction][:time]}s" : ''
|
||||||
|
when /^\d+ km\/h/
|
||||||
|
output_row[direction] = result[direction][:speed] ? "#{result[direction][:speed]} km/h" : ''
|
||||||
|
else
|
||||||
|
raise "*** Unknown expectation format: #{want}"
|
||||||
|
end
|
||||||
|
|
||||||
|
if FuzzyMatch.match output_row[direction], want
|
||||||
|
output_row[direction] = row[direction]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if output_row != row
|
||||||
|
log_fail row,output_row,result
|
||||||
|
end
|
||||||
|
actual << output_row
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.diff! actual
|
||||||
|
end
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
var d3 = require('d3-queue');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.When(/^I route I should get$/, this.WhenIRouteIShouldGet);
|
|
||||||
|
|
||||||
// This is used to route 100 times; timeout for entire step is therefore set to 100 * STRESS_TIMEOUT
|
|
||||||
this.When(/^I route (\d+) times I should get$/, { timeout: 30000 }, (n, table, callback) => {
|
|
||||||
var q = d3.queue(1);
|
|
||||||
|
|
||||||
for (var i=0; i<n; i++) {
|
|
||||||
q.defer(this.WhenIRouteIShouldGet, table);
|
|
||||||
}
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
When /^I route I should get$/ do |table|
|
||||||
|
reprocess
|
||||||
|
actual = []
|
||||||
|
OSRMLoader.load(self,"#{contracted_file}.osrm") do
|
||||||
|
table.hashes.each_with_index do |row,ri|
|
||||||
|
if row['request']
|
||||||
|
got = {'request' => row['request'] }
|
||||||
|
response = request_url row['request']
|
||||||
|
else
|
||||||
|
default_params = @query_params
|
||||||
|
user_params = []
|
||||||
|
got = {}
|
||||||
|
row.each_pair do |k,v|
|
||||||
|
if k =~ /param:(.*)/
|
||||||
|
if v=='(nil)'
|
||||||
|
user_params << [$1, nil]
|
||||||
|
elsif v!=nil
|
||||||
|
user_params << [$1, v]
|
||||||
|
end
|
||||||
|
got[k]=v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
params = overwrite_params default_params, user_params
|
||||||
|
waypoints = []
|
||||||
|
bearings = []
|
||||||
|
if row['bearings']
|
||||||
|
got['bearings'] = row['bearings']
|
||||||
|
bearings = row['bearings'].split(' ').compact
|
||||||
|
end
|
||||||
|
if row['from'] and row['to']
|
||||||
|
node = find_node_by_name(row['from'])
|
||||||
|
raise "*** unknown from-node '#{row['from']}" unless node
|
||||||
|
waypoints << node
|
||||||
|
|
||||||
|
node = find_node_by_name(row['to'])
|
||||||
|
raise "*** unknown to-node '#{row['to']}" unless node
|
||||||
|
waypoints << node
|
||||||
|
|
||||||
|
got = got.merge({'from' => row['from'], 'to' => row['to'] })
|
||||||
|
response = request_route waypoints, bearings, params
|
||||||
|
elsif row['waypoints']
|
||||||
|
row['waypoints'].split(',').each do |n|
|
||||||
|
node = find_node_by_name(n.strip)
|
||||||
|
raise "*** unknown waypoint node '#{n.strip}" unless node
|
||||||
|
waypoints << node
|
||||||
|
end
|
||||||
|
got = got.merge({'waypoints' => row['waypoints'] })
|
||||||
|
response = request_route waypoints, bearings, params
|
||||||
|
else
|
||||||
|
raise "*** no waypoints"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if response.body.empty? == false
|
||||||
|
json = JSON.parse response.body
|
||||||
|
end
|
||||||
|
|
||||||
|
if response.body.empty? == false
|
||||||
|
if json['status'] == 200
|
||||||
|
instructions = way_list json['route_instructions']
|
||||||
|
bearings = bearing_list json['route_instructions']
|
||||||
|
compasses = compass_list json['route_instructions']
|
||||||
|
turns = turn_list json['route_instructions']
|
||||||
|
modes = mode_list json['route_instructions']
|
||||||
|
times = time_list json['route_instructions']
|
||||||
|
distances = distance_list json['route_instructions']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if table.headers.include? 'status'
|
||||||
|
got['status'] = json['status'].to_s
|
||||||
|
end
|
||||||
|
if table.headers.include? 'message'
|
||||||
|
got['message'] = json['status_message']
|
||||||
|
end
|
||||||
|
if table.headers.include? '#' # comment column
|
||||||
|
got['#'] = row['#'] # copy value so it always match
|
||||||
|
end
|
||||||
|
|
||||||
|
if table.headers.include? 'start'
|
||||||
|
got['start'] = instructions ? json['route_summary']['start_point'] : nil
|
||||||
|
end
|
||||||
|
if table.headers.include? 'end'
|
||||||
|
got['end'] = instructions ? json['route_summary']['end_point'] : nil
|
||||||
|
end
|
||||||
|
if table.headers.include? 'geometry'
|
||||||
|
got['geometry'] = json['route_geometry']
|
||||||
|
end
|
||||||
|
if table.headers.include? 'route'
|
||||||
|
got['route'] = (instructions || '').strip
|
||||||
|
if table.headers.include?('alternative')
|
||||||
|
got['alternative'] =
|
||||||
|
if json['found_alternative']
|
||||||
|
way_list json['alternative_instructions'].first
|
||||||
|
else
|
||||||
|
""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if table.headers.include?('distance')
|
||||||
|
if row['distance']!=''
|
||||||
|
raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/
|
||||||
|
end
|
||||||
|
got['distance'] = instructions ? "#{json['route_summary']['total_distance'].to_s}m" : ''
|
||||||
|
end
|
||||||
|
if table.headers.include?('time')
|
||||||
|
raise "*** Time must be specied in seconds. (ex: 60s)" unless row['time'] =~ /\d+s/
|
||||||
|
got['time'] = instructions ? "#{json['route_summary']['total_time'].to_s}s" : ''
|
||||||
|
end
|
||||||
|
if table.headers.include?('speed')
|
||||||
|
if row['speed'] != '' && instructions
|
||||||
|
raise "*** Speed must be specied in km/h. (ex: 50 km/h)" unless row['speed'] =~ /\d+ km\/h/
|
||||||
|
time = json['route_summary']['total_time']
|
||||||
|
distance = json['route_summary']['total_distance']
|
||||||
|
speed = time>0 ? (3.6*distance/time).round : nil
|
||||||
|
got['speed'] = "#{speed} km/h"
|
||||||
|
else
|
||||||
|
got['speed'] = ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if table.headers.include? 'bearing'
|
||||||
|
got['bearing'] = instructions ? bearings : ''
|
||||||
|
end
|
||||||
|
if table.headers.include? 'compass'
|
||||||
|
got['compass'] = instructions ? compasses : ''
|
||||||
|
end
|
||||||
|
if table.headers.include? 'turns'
|
||||||
|
got['turns'] = instructions ? turns : ''
|
||||||
|
end
|
||||||
|
if table.headers.include? 'modes'
|
||||||
|
got['modes'] = instructions ? modes : ''
|
||||||
|
end
|
||||||
|
if table.headers.include? 'times'
|
||||||
|
got['times'] = instructions ? times : ''
|
||||||
|
end
|
||||||
|
if table.headers.include? 'distances'
|
||||||
|
got['distances'] = instructions ? distances : ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
ok = true
|
||||||
|
row.keys.each do |key|
|
||||||
|
if FuzzyMatch.match got[key], row[key]
|
||||||
|
got[key] = row[key]
|
||||||
|
else
|
||||||
|
ok = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
unless ok
|
||||||
|
log_fail row,got, { 'route' => {:query => @query, :response => response} }
|
||||||
|
end
|
||||||
|
|
||||||
|
actual << got
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.diff! actual
|
||||||
|
end
|
||||||
|
|
||||||
|
When /^I route (\d+) times I should get$/ do |n,table|
|
||||||
|
ok = true
|
||||||
|
n.to_i.times do
|
||||||
|
ok = false unless step "I route I should get", table
|
||||||
|
end
|
||||||
|
ok
|
||||||
|
end
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.Then(/^I should get a valid timestamp/, (callback) => {
|
|
||||||
this.ShouldGetAResponse();
|
|
||||||
this.ShouldBeValidJSON((err) => {
|
|
||||||
this.ShouldBeWellFormed();
|
|
||||||
assert.equal(typeof this.json.timestamp, 'string');
|
|
||||||
assert.equal(this.json.timestamp, '2000-01-01T00:00:00Z');
|
|
||||||
callback(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Then /^I should get a valid timestamp/ do
|
||||||
|
step "I should get a response"
|
||||||
|
step "response should be valid JSON"
|
||||||
|
step "response should be well-formed"
|
||||||
|
expect(@json['timestamp'].class).to eq(String)
|
||||||
|
expect(@json['timestamp']).to eq("2000-01-01T00:00:00Z")
|
||||||
|
end
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.When(/^I plan a trip I should get$/, (table, callback) => {
|
|
||||||
var got;
|
|
||||||
|
|
||||||
this.reprocessAndLoadData(() => {
|
|
||||||
var testRow = (row, ri, cb) => {
|
|
||||||
var afterRequest = (err, res) => {
|
|
||||||
if (err) return cb(err);
|
|
||||||
var headers = new Set(table.raw()[0]);
|
|
||||||
|
|
||||||
for (var k in row) {
|
|
||||||
var match = k.match(/param:(.*)/);
|
|
||||||
if (match) {
|
|
||||||
if (row[k] === '(nil)') {
|
|
||||||
params[match[1]] = null;
|
|
||||||
} else if (row[k]) {
|
|
||||||
params[match[1]] = [row[k]];
|
|
||||||
}
|
|
||||||
|
|
||||||
got[k] = row[k];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var json;
|
|
||||||
if (res.body.length) {
|
|
||||||
json = JSON.parse(res.body);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('status')) {
|
|
||||||
got.status = json.status.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('message')) {
|
|
||||||
got.message = json.status_message;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headers.has('#')) {
|
|
||||||
// comment column
|
|
||||||
got['#'] = row['#'];
|
|
||||||
}
|
|
||||||
|
|
||||||
var subTrips;
|
|
||||||
if (res.statusCode === 200) {
|
|
||||||
if (headers.has('trips')) {
|
|
||||||
subTrips = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map((sl, i) => {
|
|
||||||
var toAdd = [];
|
|
||||||
if (i === 0) toAdd.push(sl.steps[0].maneuver.location);
|
|
||||||
toAdd.push(sl.steps[sl.steps.length-1].maneuver.location);
|
|
||||||
return toAdd;
|
|
||||||
})));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var ok = true,
|
|
||||||
encodedResult = '',
|
|
||||||
extendedTarget = '';
|
|
||||||
|
|
||||||
row.trips.split(',').forEach((sub, si) => {
|
|
||||||
if (si >= subTrips.length) {
|
|
||||||
ok = false;
|
|
||||||
} else {
|
|
||||||
ok = false;
|
|
||||||
// TODO: Check all rotations of the round trip
|
|
||||||
for (var ni=0; ni<sub.length; ni++) {
|
|
||||||
var node = this.findNodeByName(sub[ni]),
|
|
||||||
outNode = subTrips[si][ni];
|
|
||||||
if (this.FuzzyMatch.matchLocation(outNode, node)) {
|
|
||||||
encodedResult += sub[ni];
|
|
||||||
extendedTarget += sub[ni];
|
|
||||||
ok = true;
|
|
||||||
} else {
|
|
||||||
encodedResult += util.format('? [%s,%s]', outNode[0], outNode[1]);
|
|
||||||
extendedTarget += util.format('%s [%d,%d]', sub[ni], node.lat, node.lon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (ok) {
|
|
||||||
got.trips = row.trips;
|
|
||||||
got.via_points = row.via_points;
|
|
||||||
} else {
|
|
||||||
got.trips = encodedResult;
|
|
||||||
got.trips = extendedTarget;
|
|
||||||
this.logFail(row, got, { trip: { query: this.query, response: res }});
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = true;
|
|
||||||
|
|
||||||
for (var key in row) {
|
|
||||||
if (this.FuzzyMatch.match(got[key], row[key])) {
|
|
||||||
got[key] = row[key];
|
|
||||||
} else {
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
this.logFail(row, got, { trip: { query: this.query, response: res }});
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, got);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (row.request) {
|
|
||||||
got.request = row.request;
|
|
||||||
this.requestUrl(row.request, afterRequest);
|
|
||||||
} else {
|
|
||||||
var params = this.queryParams,
|
|
||||||
waypoints = [];
|
|
||||||
params['steps'] = 'true';
|
|
||||||
if (row.from && row.to) {
|
|
||||||
var fromNode = this.findNodeByName(row.from);
|
|
||||||
if (!fromNode) throw new Error(util.format('*** unknown from-node "%s"', row.from));
|
|
||||||
waypoints.push(fromNode);
|
|
||||||
|
|
||||||
var toNode = this.findNodeByName(row.to);
|
|
||||||
if (!toNode) throw new Error(util.format('*** unknown to-node "%s"', row.to));
|
|
||||||
waypoints.push(toNode);
|
|
||||||
|
|
||||||
got = { from: row.from, to: row.to };
|
|
||||||
this.requestTrip(waypoints, params, afterRequest);
|
|
||||||
} else if (row.waypoints) {
|
|
||||||
row.waypoints.split(',').forEach((n) => {
|
|
||||||
var node = this.findNodeByName(n);
|
|
||||||
if (!node) throw new Error(util.format('*** unknown waypoint node "%s"', n.trim()));
|
|
||||||
waypoints.push(node);
|
|
||||||
});
|
|
||||||
got = { waypoints: row.waypoints };
|
|
||||||
this.requestTrip(waypoints, params, afterRequest);
|
|
||||||
} else {
|
|
||||||
throw new Error('*** no waypoints');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.processRowsAndDiff(table, testRow, callback);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
When /^I plan a trip I should get$/ do |table|
|
||||||
|
reprocess
|
||||||
|
actual = []
|
||||||
|
OSRMLoader.load(self,"#{contracted_file}.osrm") do
|
||||||
|
table.hashes.each_with_index do |row,ri|
|
||||||
|
if row['request']
|
||||||
|
got = {'request' => row['request'] }
|
||||||
|
response = request_url row['request']
|
||||||
|
else
|
||||||
|
params = @query_params
|
||||||
|
waypoints = []
|
||||||
|
if row['from'] and row['to']
|
||||||
|
node = find_node_by_name(row['from'])
|
||||||
|
raise "*** unknown from-node '#{row['from']}" unless node
|
||||||
|
waypoints << node
|
||||||
|
|
||||||
|
node = find_node_by_name(row['to'])
|
||||||
|
raise "*** unknown to-node '#{row['to']}" unless node
|
||||||
|
waypoints << node
|
||||||
|
|
||||||
|
got = {'from' => row['from'], 'to' => row['to'] }
|
||||||
|
response = request_trip waypoints, params
|
||||||
|
elsif row['waypoints']
|
||||||
|
row['waypoints'].split(',').each do |n|
|
||||||
|
node = find_node_by_name(n.strip)
|
||||||
|
raise "*** unknown waypoint node '#{n.strip}" unless node
|
||||||
|
waypoints << node
|
||||||
|
end
|
||||||
|
got = {'waypoints' => row['waypoints'] }
|
||||||
|
response = request_trip waypoints, params
|
||||||
|
else
|
||||||
|
raise "*** no waypoints"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
row.each_pair do |k,v|
|
||||||
|
if k =~ /param:(.*)/
|
||||||
|
if v=='(nil)'
|
||||||
|
params[$1]=nil
|
||||||
|
elsif v!=nil
|
||||||
|
params[$1]=[v]
|
||||||
|
end
|
||||||
|
got[k]=v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if response.body.empty? == false
|
||||||
|
json = JSON.parse response.body
|
||||||
|
end
|
||||||
|
|
||||||
|
if table.headers.include? 'status'
|
||||||
|
got['status'] = json['status'].to_s
|
||||||
|
end
|
||||||
|
if table.headers.include? 'message'
|
||||||
|
got['message'] = json['status_message']
|
||||||
|
end
|
||||||
|
if table.headers.include? '#' # comment column
|
||||||
|
got['#'] = row['#'] # copy value so it always match
|
||||||
|
end
|
||||||
|
|
||||||
|
if response.code == "200"
|
||||||
|
if table.headers.include? 'trips'
|
||||||
|
sub_trips = json['trips'].compact.map { |sub| sub['via_points']}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
######################
|
||||||
|
ok = true
|
||||||
|
encoded_result = ""
|
||||||
|
extended_target = ""
|
||||||
|
row['trips'].split(',').each_with_index do |sub, sub_idx|
|
||||||
|
if sub_idx >= sub_trips.length
|
||||||
|
ok = false
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
ok = false;
|
||||||
|
#TODO: Check all rotations of the round trip
|
||||||
|
sub.length.times do |node_idx|
|
||||||
|
node = find_node_by_name(sub[node_idx])
|
||||||
|
out_node = sub_trips[sub_idx][node_idx]
|
||||||
|
if FuzzyMatch.match_location out_node, node
|
||||||
|
encoded_result += sub[node_idx]
|
||||||
|
extended_target += sub[node_idx]
|
||||||
|
ok = true
|
||||||
|
else
|
||||||
|
encoded_result += "? [#{out_node[0]},#{out_node[1]}]"
|
||||||
|
extended_target += "#{sub[node_idx]} [#{node.lat},#{node.lon}]"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ok
|
||||||
|
got['trips'] = row['trips']
|
||||||
|
got['via_points'] = row['via_points']
|
||||||
|
else
|
||||||
|
got['trips'] = encoded_result
|
||||||
|
row['trips'] = extended_target
|
||||||
|
log_fail row,got, { 'trip' => {:query => @query, :response => response} }
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
ok = true
|
||||||
|
row.keys.each do |key|
|
||||||
|
if FuzzyMatch.match got[key], row[key]
|
||||||
|
got[key] = row[key]
|
||||||
|
else
|
||||||
|
ok = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
unless ok
|
||||||
|
log_fail row,got, { 'trip' => {:query => @query, :response => response} }
|
||||||
|
end
|
||||||
|
|
||||||
|
actual << got
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.diff! actual
|
||||||
|
end
|
||||||
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
var builder = require('xmlbuilder');
|
|
||||||
|
|
||||||
var ensureDecimal = (i) => {
|
|
||||||
if (parseInt(i) === i) return i.toFixed(1);
|
|
||||||
else return i;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DB {
|
|
||||||
constructor () {
|
|
||||||
this.nodes = new Array();
|
|
||||||
this.ways = new Array();
|
|
||||||
this.relations = new Array();
|
|
||||||
}
|
|
||||||
|
|
||||||
addNode (node) {
|
|
||||||
this.nodes.push(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
addWay (way) {
|
|
||||||
this.ways.push(way);
|
|
||||||
}
|
|
||||||
|
|
||||||
addRelation (relation) {
|
|
||||||
this.relations.push(relation);
|
|
||||||
}
|
|
||||||
|
|
||||||
clear () {
|
|
||||||
this.nodes = [];
|
|
||||||
this.ways = [];
|
|
||||||
this.relations = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
toXML (callback) {
|
|
||||||
var xml = builder.create('osm', {'encoding':'UTF-8'});
|
|
||||||
xml.att('generator', 'osrm-test')
|
|
||||||
.att('version', '0.6');
|
|
||||||
|
|
||||||
this.nodes.forEach((n) => {
|
|
||||||
var node = xml.ele('node', {
|
|
||||||
id: n.id,
|
|
||||||
version: 1,
|
|
||||||
uid: n.OSM_UID,
|
|
||||||
user: n.OSM_USER,
|
|
||||||
timestamp: n.OSM_TIMESTAMP,
|
|
||||||
lon: ensureDecimal(n.lon),
|
|
||||||
lat: ensureDecimal(n.lat)
|
|
||||||
});
|
|
||||||
|
|
||||||
for (var k in n.tags) {
|
|
||||||
node.ele('tag')
|
|
||||||
.att('k', k)
|
|
||||||
.att('v', n.tags[k]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.ways.forEach((w) => {
|
|
||||||
var way = xml.ele('way', {
|
|
||||||
id: w.id,
|
|
||||||
version: 1,
|
|
||||||
uid: w.OSM_UID,
|
|
||||||
user: w.OSM_USER,
|
|
||||||
timestamp: w.OSM_TIMESTAMP
|
|
||||||
});
|
|
||||||
|
|
||||||
w.nodes.forEach((k) => {
|
|
||||||
way.ele('nd')
|
|
||||||
.att('ref', k.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
for (var k in w.tags) {
|
|
||||||
way.ele('tag')
|
|
||||||
.att('k', k)
|
|
||||||
.att('v', w.tags[k]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.relations.forEach((r) => {
|
|
||||||
var relation = xml.ele('relation', {
|
|
||||||
id: r.id,
|
|
||||||
user: r.OSM_USER,
|
|
||||||
timestamp: r.OSM_TIMESTAMP,
|
|
||||||
uid: r.OSM_UID
|
|
||||||
});
|
|
||||||
|
|
||||||
r.members.forEach((m) => {
|
|
||||||
relation.ele('member', {
|
|
||||||
type: m.type,
|
|
||||||
ref: m.id,
|
|
||||||
role: m.role
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
for (var k in r.tags) {
|
|
||||||
relation.ele('tag')
|
|
||||||
.att('k', k)
|
|
||||||
.att('v', r.tags[k]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
callback(xml.end({ pretty: true, indent: ' ' }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Node {
|
|
||||||
constructor (id, OSM_USER, OSM_TIMESTAMP, OSM_UID, lon, lat, tags) {
|
|
||||||
this.id = id;
|
|
||||||
this.OSM_USER = OSM_USER;
|
|
||||||
this.OSM_TIMESTAMP = OSM_TIMESTAMP;
|
|
||||||
this.OSM_UID = OSM_UID;
|
|
||||||
this.lon = lon;
|
|
||||||
this.lat = lat;
|
|
||||||
this.tags = tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
addTag (k, v) {
|
|
||||||
this.tags[k] = v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Way {
|
|
||||||
constructor (id, OSM_USER, OSM_TIMESTAMP, OSM_UID) {
|
|
||||||
this.id = id;
|
|
||||||
this.OSM_USER = OSM_USER;
|
|
||||||
this.OSM_TIMESTAMP = OSM_TIMESTAMP;
|
|
||||||
this.OSM_UID = OSM_UID;
|
|
||||||
this.tags = {};
|
|
||||||
this.nodes = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
addNode (node) {
|
|
||||||
this.nodes.push(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTags (tags) {
|
|
||||||
this.tags = tags;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Relation {
|
|
||||||
constructor (id, OSM_USER, OSM_TIMESTAMP, OSM_UID) {
|
|
||||||
this.id = id;
|
|
||||||
this.OSM_USER = OSM_USER;
|
|
||||||
this.OSM_TIMESTAMP = OSM_TIMESTAMP;
|
|
||||||
this.OSM_UID = OSM_UID;
|
|
||||||
this.members = [];
|
|
||||||
this.tags = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
addMember (memberType, id, role) {
|
|
||||||
this.members.push({type: memberType, id: id, role: role});
|
|
||||||
}
|
|
||||||
|
|
||||||
addTag (k, v) {
|
|
||||||
this.tags[k] = v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
DB: DB,
|
|
||||||
Node: Node,
|
|
||||||
Way: Way,
|
|
||||||
Relation: Relation
|
|
||||||
};
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var path = require('path');
|
|
||||||
var util = require('util');
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
var OSM = require('./build_osm');
|
|
||||||
var classes = require('./data_classes');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.initializeOptions = (callback) => {
|
|
||||||
this.profile = this.profile || this.DEFAULT_SPEEDPROFILE;
|
|
||||||
|
|
||||||
this.OSMDB = this.OSMDB || new OSM.DB();
|
|
||||||
|
|
||||||
this.nameNodeHash = this.nameNodeHash || {};
|
|
||||||
|
|
||||||
this.locationHash = this.locationHash || {};
|
|
||||||
|
|
||||||
this.nameWayHash = this.nameWayHash || {};
|
|
||||||
|
|
||||||
this.osmData = new classes.osmData(this);
|
|
||||||
|
|
||||||
this.STRESS_TIMEOUT = 300;
|
|
||||||
|
|
||||||
this.OSRMLoader = this._OSRMLoader();
|
|
||||||
|
|
||||||
this.PREPROCESS_LOG_FILE = path.resolve(this.TEST_FOLDER, 'preprocessing.log');
|
|
||||||
|
|
||||||
this.LOG_FILE = path.resolve(this.TEST_FOLDER, 'fail.log');
|
|
||||||
|
|
||||||
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
|
||||||
|
|
||||||
this.DESTINATION_REACHED = 15; // OSRM instruction code
|
|
||||||
|
|
||||||
this.shortcutsHash = this.shortcutsHash || {};
|
|
||||||
|
|
||||||
var hashLuaLib = (cb) => {
|
|
||||||
fs.readdir(path.normalize(this.PROFILES_PATH + '/lib/'), (err, files) => {
|
|
||||||
if (err) cb(err);
|
|
||||||
var luaFiles = files.filter(f => !!f.match(/\.lua$/)).map(f => path.normalize(this.PROFILES_PATH + '/lib/' + f));
|
|
||||||
this.hashOfFiles(luaFiles, hash => {
|
|
||||||
this.luaLibHash = hash;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashProfile = (cb) => {
|
|
||||||
this.hashProfile((hash) => {
|
|
||||||
this.profileHash = hash;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashExtract = (cb) => {
|
|
||||||
this.hashOfFiles(util.format('%s/osrm-extract%s', this.BIN_PATH, this.EXE), (hash) => {
|
|
||||||
this.binExtractHash = hash;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashContract = (cb) => {
|
|
||||||
this.hashOfFiles(util.format('%s/osrm-contract%s', this.BIN_PATH, this.EXE), (hash) => {
|
|
||||||
this.binContractHash = hash;
|
|
||||||
this.fingerprintContract = this.hashString(this.binContractHash);
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashRouted = (cb) => {
|
|
||||||
this.hashOfFiles(util.format('%s/osrm-routed%s', this.BIN_PATH, this.EXE), (hash) => {
|
|
||||||
this.binRoutedHash = hash;
|
|
||||||
this.fingerprintRoute = this.hashString(this.binRoutedHash);
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
d3.queue()
|
|
||||||
.defer(hashLuaLib)
|
|
||||||
.defer(hashProfile)
|
|
||||||
.defer(hashExtract)
|
|
||||||
.defer(hashContract)
|
|
||||||
.defer(hashRouted)
|
|
||||||
.awaitAll(() => {
|
|
||||||
this.fingerprintExtract = this.hashString([this.profileHash, this.luaLibHash, this.binExtractHash].join('-'));
|
|
||||||
this.AfterConfiguration(() => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setProfileBasedHashes = () => {
|
|
||||||
this.fingerprintExtract = this.hashString([this.profileHash, this.luaLibHash, this.binExtractHash].join('-'));
|
|
||||||
this.fingerprintContract = this.hashString(this.binContractHash);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setProfile = (profile, cb) => {
|
|
||||||
var lastProfile = this.profile;
|
|
||||||
if (profile !== lastProfile) {
|
|
||||||
this.profile = profile;
|
|
||||||
this.hashProfile((hash) => {
|
|
||||||
this.profileHash = hash;
|
|
||||||
this.setProfileBasedHashes();
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
} else cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setExtractArgs = (args) => {
|
|
||||||
this.extractArgs = args;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setContractArgs = (args) => {
|
|
||||||
this.contractArgs = args;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
def profile
|
||||||
|
@profile ||= reset_profile
|
||||||
|
end
|
||||||
|
|
||||||
|
def reset_profile
|
||||||
|
@profile = nil
|
||||||
|
set_profile DEFAULT_SPEEDPROFILE
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_profile profile
|
||||||
|
@profile = profile
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_extract_args args
|
||||||
|
@extract_args = args
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_contract_args args
|
||||||
|
@contract_args = args
|
||||||
|
end
|
||||||
@@ -1,340 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var path = require('path');
|
|
||||||
var util = require('util');
|
|
||||||
var exec = require('child_process').exec;
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
|
|
||||||
var OSM = require('./build_osm');
|
|
||||||
var classes = require('./data_classes');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.setGridSize = (meters) => {
|
|
||||||
// the constant is calculated (with BigDecimal as: 1.0/(DEG_TO_RAD*EARTH_RADIUS_IN_METERS
|
|
||||||
// see ApproximateDistance() in ExtractorStructs.h
|
|
||||||
// it's only accurate when measuring along the equator, or going exactly north-south
|
|
||||||
this.zoom = parseFloat(meters) * 0.8990679362704610899694577444566908445396483347536032203503E-5;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setOrigin = (origin) => {
|
|
||||||
this.origin = origin;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.buildWaysFromTable = (table, callback) => {
|
|
||||||
// add one unconnected way for each row
|
|
||||||
var buildRow = (row, ri, cb) => {
|
|
||||||
// comments ported directly from ruby suite:
|
|
||||||
// NOTE: currently osrm crashes when processing an isolated oneway with just 2 nodes, so we use 4 edges
|
|
||||||
// this is related to the fact that a oneway dead-end street doesn't make a lot of sense
|
|
||||||
|
|
||||||
// if we stack ways on different x coordinates, routability tests get messed up, because osrm might pick a neighboring way if the one test can't be used.
|
|
||||||
// instead we place all lines as a string on the same y coordinate. this prevents using neighboring ways.
|
|
||||||
|
|
||||||
// add some nodes
|
|
||||||
|
|
||||||
var makeFakeNode = (namePrefix, offset) => {
|
|
||||||
return new OSM.Node(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP,
|
|
||||||
this.OSM_UID, this.origin[0]+(offset + this.WAY_SPACING * ri) * this.zoom,
|
|
||||||
this.origin[1], {name: util.format('%s%d', namePrefix, ri)});
|
|
||||||
};
|
|
||||||
|
|
||||||
var nodes = ['a','b','c','d','e'].map((l, i) => makeFakeNode(l, i));
|
|
||||||
|
|
||||||
nodes.forEach(node => { this.OSMDB.addNode(node); });
|
|
||||||
|
|
||||||
// ...with a way between them
|
|
||||||
var way = new OSM.Way(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
|
||||||
|
|
||||||
nodes.forEach(node => { way.addNode(node); });
|
|
||||||
|
|
||||||
// remove tags that describe expected test result, reject empty tags
|
|
||||||
var tags = {};
|
|
||||||
for (var rkey in row) {
|
|
||||||
if (!rkey.match(/^forw\b/) &&
|
|
||||||
!rkey.match(/^backw\b/) &&
|
|
||||||
!rkey.match(/^bothw\b/) &&
|
|
||||||
row[rkey].length)
|
|
||||||
tags[rkey] = row[rkey];
|
|
||||||
}
|
|
||||||
|
|
||||||
var wayTags = { highway: 'primary' },
|
|
||||||
nodeTags = {};
|
|
||||||
|
|
||||||
for (var key in tags) {
|
|
||||||
var nodeMatch = key.match(/node\/(.*)/);
|
|
||||||
if (nodeMatch) {
|
|
||||||
if (tags[key] === '(nil)') {
|
|
||||||
delete nodeTags[key];
|
|
||||||
} else {
|
|
||||||
nodeTags[nodeMatch[1]] = tags[key];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (tags[key] === '(nil)') {
|
|
||||||
delete wayTags[key];
|
|
||||||
} else {
|
|
||||||
wayTags[key] = tags[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wayTags.name = util.format('w%d', ri);
|
|
||||||
way.setTags(wayTags);
|
|
||||||
this.OSMDB.addWay(way);
|
|
||||||
|
|
||||||
for (var k in nodeTags) {
|
|
||||||
nodes[2].addTag(k, nodeTags[k]);
|
|
||||||
}
|
|
||||||
cb();
|
|
||||||
};
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
table.hashes().forEach((row, ri) => {
|
|
||||||
q.defer(buildRow, row, ri);
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.ensureDecimal = (i) => {
|
|
||||||
if (parseInt(i) === i) return i.toFixed(1);
|
|
||||||
else return i;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.tableCoordToLonLat = (ci, ri) => {
|
|
||||||
return [this.origin[0] + ci * this.zoom, this.origin[1] - ri * this.zoom].map(this.ensureDecimal);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.addOSMNode = (name, lon, lat, id) => {
|
|
||||||
id = id || this.makeOSMId();
|
|
||||||
var node = new OSM.Node(id, this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID, lon, lat, {name: name});
|
|
||||||
this.OSMDB.addNode(node);
|
|
||||||
this.nameNodeHash[name] = node;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.addLocation = (name, lon, lat) => {
|
|
||||||
this.locationHash[name] = new classes.Location(lon, lat);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.findNodeByName = (s) => {
|
|
||||||
if (s.length !== 1) throw new Error(util.format('*** invalid node name "%s", must be single characters', s));
|
|
||||||
if (!s.match(/[a-z0-9]/)) throw new Error(util.format('*** invalid node name "%s", must be alphanumeric', s));
|
|
||||||
|
|
||||||
var fromNode;
|
|
||||||
if (s.match(/[a-z]/)) {
|
|
||||||
fromNode = this.nameNodeHash[s.toString()];
|
|
||||||
} else {
|
|
||||||
fromNode = this.locationHash[s.toString()];
|
|
||||||
}
|
|
||||||
|
|
||||||
return fromNode;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.findWayByName = (s) => {
|
|
||||||
return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')];
|
|
||||||
};
|
|
||||||
|
|
||||||
this.resetData = () => {
|
|
||||||
this.resetOSM();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.makeOSMId = () => {
|
|
||||||
this.osmID = this.osmID + 1;
|
|
||||||
return this.osmID;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.resetOSM = () => {
|
|
||||||
this.OSMDB.clear();
|
|
||||||
this.osmData.reset();
|
|
||||||
this.nameNodeHash = {};
|
|
||||||
this.locationHash = {};
|
|
||||||
this.nameWayHash = {};
|
|
||||||
this.osmID = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.writeOSM = (callback) => {
|
|
||||||
fs.exists(this.DATA_FOLDER, (exists) => {
|
|
||||||
var mkDirFn = exists ? (cb) => { cb(); } : fs.mkdir.bind(fs.mkdir, this.DATA_FOLDER);
|
|
||||||
mkDirFn((err) => {
|
|
||||||
if (err) return callback(err);
|
|
||||||
var osmPath = path.resolve(this.DATA_FOLDER, util.format('%s.osm', this.osmData.osmFile));
|
|
||||||
fs.exists(osmPath, (exists) => {
|
|
||||||
if (!exists) fs.writeFile(osmPath, this.osmData.str, callback);
|
|
||||||
else callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.isExtracted = (callback) => {
|
|
||||||
fs.exists(util.format('%s.osrm', this.osmData.extractedFile), (core) => {
|
|
||||||
if (!core) return callback(false);
|
|
||||||
fs.exists(util.format('%s.osrm.names', this.osmData.extractedFile), (names) => {
|
|
||||||
if (!names) return callback(false);
|
|
||||||
fs.exists(util.format('%s.osrm.restrictions', this.osmData.extractedFile), (restrictions) => {
|
|
||||||
return callback(restrictions);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.isContracted = (callback) => {
|
|
||||||
fs.exists(util.format('%s.osrm.hsgr', this.osmData.contractedFile), callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.writeTimestamp = (callback) => {
|
|
||||||
fs.writeFile(util.format('%s.osrm.timestamp', this.osmData.contractedFile), this.OSM_TIMESTAMP, callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.writeInputData = (callback) => {
|
|
||||||
this.writeOSM((err) => {
|
|
||||||
if (err) return callback(err);
|
|
||||||
this.writeTimestamp(callback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.extractData = (callback) => {
|
|
||||||
this.logPreprocessInfo();
|
|
||||||
this.log(util.format('== Extracting %s.osm...', this.osmData.osmFile), 'preprocess');
|
|
||||||
var cmd = util.format('%s%s/osrm-extract %s.osm %s --profile %s/%s.lua >>%s 2>&1',
|
|
||||||
this.LOAD_LIBRARIES, this.BIN_PATH, this.osmData.osmFile, this.extractArgs || '', this.PROFILES_PATH, this.profile, this.PREPROCESS_LOG_FILE);
|
|
||||||
this.log(cmd);
|
|
||||||
process.chdir(this.TEST_FOLDER);
|
|
||||||
exec(cmd, (err) => {
|
|
||||||
if (err) {
|
|
||||||
this.log(util.format('*** Exited with code %d', err.code), 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
return callback(this.ExtractError(err.code, util.format('osrm-extract exited with code %d', err.code)));
|
|
||||||
}
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var rename = (file, cb) => {
|
|
||||||
this.log(util.format('Renaming %s.%s to %s.%s', this.osmData.osmFile, file, this.osmData.extractedFile, file), 'preprocess');
|
|
||||||
fs.rename([this.osmData.osmFile, file].join('.'), [this.osmData.extractedFile, file].join('.'), (err) => {
|
|
||||||
if (err) return cb(this.FileError(null, 'failed to rename data file after extracting'));
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var renameIfExists = (file, cb) => {
|
|
||||||
fs.stat([this.osmData.osmFile, file].join('.'), (doesNotExistErr, exists) => {
|
|
||||||
if (exists) rename(file, cb);
|
|
||||||
else cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
['osrm','osrm.names','osrm.restrictions','osrm.ebg','osrm.enw','osrm.edges','osrm.fileIndex','osrm.geometry','osrm.nodes','osrm.ramIndex','osrm.properties'].forEach(file => {
|
|
||||||
q.defer(rename, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
['osrm.edge_segment_lookup','osrm.edge_penalties'].forEach(file => {
|
|
||||||
q.defer(renameIfExists, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll((err) => {
|
|
||||||
this.log('Finished extracting ' + this.osmData.extractedFile, 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
callback(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.contractData = (callback) => {
|
|
||||||
this.logPreprocessInfo();
|
|
||||||
this.log(util.format('== Contracting %s.osm...', this.osmData.extractedFile), 'preprocess');
|
|
||||||
var cmd = util.format('%s%s/osrm-contract %s %s.osrm >>%s 2>&1',
|
|
||||||
this.LOAD_LIBRARIES, this.BIN_PATH, this.contractArgs || '', this.osmData.extractedFile, this.PREPROCESS_LOG_FILE);
|
|
||||||
this.log(cmd);
|
|
||||||
process.chdir(this.TEST_FOLDER);
|
|
||||||
exec(cmd, (err) => {
|
|
||||||
if (err) {
|
|
||||||
this.log(util.format('*** Exited with code %d', err.code), 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
return callback(this.ContractError(err.code, util.format('osrm-contract exited with code %d', err.code)));
|
|
||||||
}
|
|
||||||
|
|
||||||
var rename = (file, cb) => {
|
|
||||||
this.log(util.format('Renaming %s.%s to %s.%s', this.osmData.extractedFile, file, this.osmData.contractedFile, file), 'preprocess');
|
|
||||||
fs.rename([this.osmData.extractedFile, file].join('.'), [this.osmData.contractedFile, file].join('.'), (err) => {
|
|
||||||
if (err) return cb(this.FileError(null, 'failed to rename data file after contracting.'));
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var copy = (file, cb) => {
|
|
||||||
this.log(util.format('Copying %s.%s to %s.%s', this.osmData.extractedFile, file, this.osmData.contractedFile, file), 'preprocess');
|
|
||||||
fs.createReadStream([this.osmData.extractedFile, file].join('.'))
|
|
||||||
.pipe(fs.createWriteStream([this.osmData.contractedFile, file].join('.'))
|
|
||||||
.on('finish', cb)
|
|
||||||
)
|
|
||||||
.on('error', () => {
|
|
||||||
return cb(this.FileError(null, 'failed to copy data after contracting.'));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
['osrm.hsgr','osrm.fileIndex','osrm.geometry','osrm.nodes','osrm.ramIndex','osrm.core','osrm.edges','osrm.datasource_indexes','osrm.datasource_names','osrm.level'].forEach((file) => {
|
|
||||||
q.defer(rename, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
['osrm.names','osrm.restrictions','osrm.properties','osrm'].forEach((file) => {
|
|
||||||
q.defer(copy, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll((err) => {
|
|
||||||
this.log('Finished contracting ' + this.osmData.contractedFile, 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
callback(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var noop = (cb) => cb();
|
|
||||||
|
|
||||||
this.reprocess = (callback) => {
|
|
||||||
this.writeAndExtract((e) => {
|
|
||||||
if (e) return callback(e);
|
|
||||||
this.isContracted((isContracted) => {
|
|
||||||
var contractFn = isContracted ? noop : this.contractData;
|
|
||||||
if (isContracted) this.log('Already contracted ' + this.osmData.contractedFile, 'preprocess');
|
|
||||||
contractFn((e) => {
|
|
||||||
if (e) return callback(e);
|
|
||||||
this.logPreprocessDone();
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.writeAndExtract = (callback) => {
|
|
||||||
this.osmData.populate(() => {
|
|
||||||
this.writeInputData((e) => {
|
|
||||||
if (e) return callback(e);
|
|
||||||
this.isExtracted((isExtracted) => {
|
|
||||||
var extractFn = isExtracted ? noop : this.extractData;
|
|
||||||
if (isExtracted) this.log('Already extracted ' + this.osmData.extractedFile, 'preprocess');
|
|
||||||
extractFn((e) => {
|
|
||||||
callback(e);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.reprocessAndLoadData = (callback) => {
|
|
||||||
this.reprocess(() => {
|
|
||||||
this.OSRMLoader.load(util.format('%s.osrm', this.osmData.contractedFile), callback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.processRowsAndDiff = (table, fn, callback) => {
|
|
||||||
var q = d3.queue(1);
|
|
||||||
|
|
||||||
table.hashes().forEach((row, i) => { q.defer(fn, row, i); });
|
|
||||||
|
|
||||||
q.awaitAll((err, actual) => {
|
|
||||||
if (err) return callback(err);
|
|
||||||
this.diffTables(table, actual, {}, callback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,321 @@
|
|||||||
|
require 'OSM/objects' #osmlib gem
|
||||||
|
require 'OSM/Database'
|
||||||
|
require 'builder'
|
||||||
|
require 'fileutils'
|
||||||
|
|
||||||
|
class Location
|
||||||
|
attr_accessor :lon,:lat
|
||||||
|
|
||||||
|
def initialize lon,lat
|
||||||
|
@lat = lat
|
||||||
|
@lon = lon
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def set_input_format format
|
||||||
|
raise '*** Input format must be eiter "osm" or "pbf"' unless ['pbf','osm'].include? format.to_s
|
||||||
|
@input_format = format.to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
def input_format
|
||||||
|
@input_format || DEFAULT_INPUT_FORMAT
|
||||||
|
end
|
||||||
|
|
||||||
|
def sanitized_scenario_title
|
||||||
|
@sanitized_scenario_title ||= @scenario_title.to_s.gsub /[^0-9A-Za-z.\-]/, '_'
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_grid_size meters
|
||||||
|
#the constant is calculated (with BigDecimal as: 1.0/(DEG_TO_RAD*EARTH_RADIUS_IN_METERS
|
||||||
|
#see ApproximateDistance() in ExtractorStructs.h
|
||||||
|
#it's only accurate when measuring along the equator, or going exactly north-south
|
||||||
|
@zoom = meters.to_f*0.8990679362704610899694577444566908445396483347536032203503E-5
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_origin origin
|
||||||
|
@origin = origin
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_ways_from_table table
|
||||||
|
#add one unconnected way for each row
|
||||||
|
table.hashes.each_with_index do |row,ri|
|
||||||
|
#NOTE:
|
||||||
|
#currently osrm crashes when processing an isolated oneway with just 2 nodes, so we use 4 edges
|
||||||
|
#this is relatated to the fact that a oneway dead-end street doesn't make a lot of sense
|
||||||
|
|
||||||
|
#if we stack ways on different x coordinates, routability tests get messed up, because osrm might pick a neighboring way if the one test can't be used.
|
||||||
|
#instead we place all lines as a string on the same y coordinate. this prevents using neightboring ways.
|
||||||
|
|
||||||
|
#a few nodes...
|
||||||
|
node1 = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, @origin[0]+(0+WAY_SPACING*ri)*@zoom, @origin[1]
|
||||||
|
node2 = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, @origin[0]+(1+WAY_SPACING*ri)*@zoom, @origin[1]
|
||||||
|
node3 = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, @origin[0]+(2+WAY_SPACING*ri)*@zoom, @origin[1]
|
||||||
|
node4 = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, @origin[0]+(3+WAY_SPACING*ri)*@zoom, @origin[1]
|
||||||
|
node5 = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, @origin[0]+(4+WAY_SPACING*ri)*@zoom, @origin[1]
|
||||||
|
node1.uid = OSM_UID
|
||||||
|
node2.uid = OSM_UID
|
||||||
|
node3.uid = OSM_UID
|
||||||
|
node4.uid = OSM_UID
|
||||||
|
node5.uid = OSM_UID
|
||||||
|
node1 << { :name => "a#{ri}" }
|
||||||
|
node2 << { :name => "b#{ri}" }
|
||||||
|
node3 << { :name => "c#{ri}" }
|
||||||
|
node4 << { :name => "d#{ri}" }
|
||||||
|
node5 << { :name => "e#{ri}" }
|
||||||
|
|
||||||
|
osm_db << node1
|
||||||
|
osm_db << node2
|
||||||
|
osm_db << node3
|
||||||
|
osm_db << node4
|
||||||
|
osm_db << node5
|
||||||
|
|
||||||
|
#...with a way between them
|
||||||
|
way = OSM::Way.new make_osm_id, OSM_USER, OSM_TIMESTAMP
|
||||||
|
way.uid = OSM_UID
|
||||||
|
way << node1
|
||||||
|
way << node2
|
||||||
|
way << node3
|
||||||
|
way << node4
|
||||||
|
way << node5
|
||||||
|
|
||||||
|
tags = row.dup
|
||||||
|
|
||||||
|
# remove tags that describe expected test result
|
||||||
|
tags.reject! do |k,v|
|
||||||
|
k =~ /^forw\b/ ||
|
||||||
|
k =~ /^backw\b/ ||
|
||||||
|
k =~ /^bothw\b/
|
||||||
|
end
|
||||||
|
|
||||||
|
##remove empty tags
|
||||||
|
tags.reject! { |k,v| v=='' }
|
||||||
|
|
||||||
|
# sort tag keys in the form of 'node/....'
|
||||||
|
way_tags = { 'highway' => 'primary' }
|
||||||
|
|
||||||
|
node_tags = {}
|
||||||
|
tags.each_pair do |k,v|
|
||||||
|
if k =~ /node\/(.*)/
|
||||||
|
if v=='(nil)'
|
||||||
|
node_tags.delete k
|
||||||
|
else
|
||||||
|
node_tags[$1] = v
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if v=='(nil)'
|
||||||
|
way_tags.delete k
|
||||||
|
else
|
||||||
|
way_tags[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
way_tags['name'] = "w#{ri}"
|
||||||
|
way << way_tags
|
||||||
|
node3 << node_tags
|
||||||
|
|
||||||
|
osm_db << way
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def table_coord_to_lonlat ci,ri
|
||||||
|
[@origin[0]+ci*@zoom, @origin[1]-ri*@zoom]
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_osm_node name,lon,lat,id
|
||||||
|
id = make_osm_id if id == nil
|
||||||
|
node = OSM::Node.new id, OSM_USER, OSM_TIMESTAMP, lon, lat
|
||||||
|
node << { :name => name }
|
||||||
|
node.uid = OSM_UID
|
||||||
|
osm_db << node
|
||||||
|
name_node_hash[name] = node
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_location name,lon,lat
|
||||||
|
location_hash[name] = Location.new(lon,lat)
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_node_by_name s
|
||||||
|
raise "***invalid node name '#{s}', must be single characters" unless s.size == 1
|
||||||
|
raise "*** invalid node name '#{s}', must be alphanumeric" unless s.match /[a-z0-9]/
|
||||||
|
if s.match /[a-z]/
|
||||||
|
from_node = name_node_hash[ s.to_s ]
|
||||||
|
else
|
||||||
|
from_node = location_hash[ s.to_s ]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_way_by_name s
|
||||||
|
name_way_hash[s.to_s] || name_way_hash[s.to_s.reverse]
|
||||||
|
end
|
||||||
|
|
||||||
|
def reset_data
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
#clear_log
|
||||||
|
#clear_data_files
|
||||||
|
end
|
||||||
|
reset_profile
|
||||||
|
reset_osm
|
||||||
|
@fingerprint_osm = nil
|
||||||
|
@fingerprint_extract = nil
|
||||||
|
@fingerprint_prepare = nil
|
||||||
|
@fingerprint_route = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def make_osm_id
|
||||||
|
@osm_id = @osm_id+1
|
||||||
|
end
|
||||||
|
|
||||||
|
def reset_osm
|
||||||
|
osm_db.clear
|
||||||
|
name_node_hash.clear
|
||||||
|
location_hash.clear
|
||||||
|
name_way_hash.clear
|
||||||
|
@osm_str = nil
|
||||||
|
@osm_hash = nil
|
||||||
|
@osm_id = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def clear_data_files
|
||||||
|
File.delete *Dir.glob("#{DATA_FOLDER}/test.*")
|
||||||
|
end
|
||||||
|
|
||||||
|
def clear_log
|
||||||
|
File.delete *Dir.glob("*.log")
|
||||||
|
end
|
||||||
|
|
||||||
|
def osm_db
|
||||||
|
@osm_db ||= OSM::Database.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def name_node_hash
|
||||||
|
@name_node_hash ||= {}
|
||||||
|
end
|
||||||
|
|
||||||
|
def location_hash
|
||||||
|
@location_hash ||= {}
|
||||||
|
end
|
||||||
|
|
||||||
|
def name_way_hash
|
||||||
|
@name_way_hash ||= {}
|
||||||
|
end
|
||||||
|
|
||||||
|
def osm_str
|
||||||
|
return @osm_str if @osm_str
|
||||||
|
@osm_str = ''
|
||||||
|
doc = Builder::XmlMarkup.new :indent => 2, :target => @osm_str
|
||||||
|
doc.instruct!
|
||||||
|
osm_db.to_xml doc, OSM_GENERATOR
|
||||||
|
@osm_str
|
||||||
|
end
|
||||||
|
|
||||||
|
def osm_file
|
||||||
|
@osm_file ||= "#{DATA_FOLDER}/#{fingerprint_osm}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def extracted_file
|
||||||
|
@extracted_file ||= "#{osm_file}_#{fingerprint_extract}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def contracted_file
|
||||||
|
@contracted_file ||= "#{osm_file}_#{fingerprint_extract}_#{fingerprint_prepare}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def write_osm
|
||||||
|
Dir.mkdir DATA_FOLDER unless File.exist? DATA_FOLDER
|
||||||
|
unless File.exist?("#{osm_file}.osm")
|
||||||
|
File.open( "#{osm_file}.osm", 'w') {|f| f.write(osm_str) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def extracted?
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
File.exist?("#{extracted_file}.osrm") &&
|
||||||
|
File.exist?("#{extracted_file}.osrm.names") &&
|
||||||
|
File.exist?("#{extracted_file}.osrm.restrictions")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def contracted?
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
File.exist?("#{contracted_file}.osrm.hsgr")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def write_timestamp
|
||||||
|
File.open( "#{contracted_file}.osrm.timestamp", 'w') {|f| f.write(OSM_TIMESTAMP) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def write_input_data
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
write_osm
|
||||||
|
write_timestamp
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def extract_data
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
log_preprocess_info
|
||||||
|
log "== Extracting #{osm_file}.osm...", :preprocess
|
||||||
|
log "#{LOAD_LIBRARIES}#{BIN_PATH}/osrm-extract #{osm_file}.osm #{@extract_args} --profile #{PROFILES_PATH}/#{@profile}.lua >>#{PREPROCESS_LOG_FILE} 2>&1"
|
||||||
|
unless system "#{LOAD_LIBRARIES}#{BIN_PATH}/osrm-extract #{osm_file}.osm #{@extract_args} --profile #{PROFILES_PATH}/#{@profile}.lua >>#{PREPROCESS_LOG_FILE} 2>&1"
|
||||||
|
log "*** Exited with code #{$?.exitstatus}.", :preprocess
|
||||||
|
raise ExtractError.new $?.exitstatus, "osrm-extract exited with code #{$?.exitstatus}."
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
["osrm","osrm.names","osrm.restrictions","osrm.ebg","osrm.enw","osrm.edges","osrm.fileIndex","osrm.geometry","osrm.nodes","osrm.ramIndex"].each do |file|
|
||||||
|
log "Renaming #{osm_file}.#{file} to #{extracted_file}.#{file}", :preprocess
|
||||||
|
File.rename "#{osm_file}.#{file}", "#{extracted_file}.#{file}"
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
raise FileError.new nil, "failed to rename data file after extracting."
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
["osrm.edge_segment_lookup","osrm.edge_penalties"].each do |file|
|
||||||
|
if File.exists?("#{osm_file}.#{file}")
|
||||||
|
log "Renaming #{osm_file}.#{file} to #{extracted_file}.#{file}", :preprocess
|
||||||
|
File.rename "#{osm_file}.#{file}", "#{extracted_file}.#{file}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
raise FileError.new nil, "failed to rename data file after extracting."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def prepare_data
|
||||||
|
Dir.chdir TEST_FOLDER do
|
||||||
|
log_preprocess_info
|
||||||
|
log "== Preparing #{extracted_file}.osm...", :preprocess
|
||||||
|
log "#{LOAD_LIBRARIES}#{BIN_PATH}/osrm-contract #{@contract_args} #{extracted_file}.osrm >>#{PREPROCESS_LOG_FILE} 2>&1"
|
||||||
|
unless system "#{LOAD_LIBRARIES}#{BIN_PATH}/osrm-contract #{@contract_args} #{extracted_file}.osrm >>#{PREPROCESS_LOG_FILE} 2>&1"
|
||||||
|
log "*** Exited with code #{$?.exitstatus}.", :preprocess
|
||||||
|
raise PrepareError.new $?.exitstatus, "osrm-contract exited with code #{$?.exitstatus}."
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
["osrm.hsgr","osrm.fileIndex","osrm.geometry","osrm.nodes","osrm.ramIndex","osrm.core","osrm.edges"].each do |file|
|
||||||
|
log "Renaming #{extracted_file}.#{file} to #{contracted_file}.#{file}", :preprocess
|
||||||
|
File.rename "#{extracted_file}.#{file}", "#{contracted_file}.#{file}"
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
raise FileError.new nil, "failed to rename data file after preparing."
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
["osrm.names","osrm.restrictions","osrm"].each do |file|
|
||||||
|
log "Copying #{extracted_file}.#{file} to #{contracted_file}.#{file}", :preprocess
|
||||||
|
FileUtils.cp "#{extracted_file}.#{file}", "#{contracted_file}.#{file}"
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
raise FileError.new nil, "failed to copy data file after preparing."
|
||||||
|
end
|
||||||
|
log '', :preprocess
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def reprocess
|
||||||
|
write_input_data
|
||||||
|
extract_data unless extracted?
|
||||||
|
prepare_data unless contracted?
|
||||||
|
log_preprocess_done
|
||||||
|
end
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
var util = require('util');
|
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
Location: class {
|
|
||||||
constructor (lon, lat) {
|
|
||||||
this.lon = lon;
|
|
||||||
this.lat = lat;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
osmData: class {
|
|
||||||
constructor (scope) {
|
|
||||||
this.scope = scope;
|
|
||||||
this.str = null;
|
|
||||||
this.hash = null;
|
|
||||||
this.fingerprintOSM = null;
|
|
||||||
this.osmFile = null;
|
|
||||||
this.extractedFile = null;
|
|
||||||
this.contractedFile = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
populate (callback) {
|
|
||||||
this.scope.OSMDB.toXML((str) => {
|
|
||||||
this.str = str;
|
|
||||||
|
|
||||||
this.hash = this.scope.hashString(str);
|
|
||||||
this.fingerprintOSM = this.scope.hashString(this.hash);
|
|
||||||
|
|
||||||
this.osmFile = path.resolve(this.scope.DATA_FOLDER, this.fingerprintOSM);
|
|
||||||
|
|
||||||
this.extractedFile = path.resolve([this.osmFile, this.scope.fingerprintExtract].join('_'));
|
|
||||||
this.contractedFile = path.resolve([this.osmFile, this.scope.fingerprintExtract, this.scope.fingerprintContract].join('_'));
|
|
||||||
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
reset () {
|
|
||||||
this.str = null;
|
|
||||||
this.hash = null;
|
|
||||||
this.fingerprintOSM = null;
|
|
||||||
this.osmFile = null;
|
|
||||||
this.extractedFile = null;
|
|
||||||
this.contractedFile = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
FuzzyMatch: class {
|
|
||||||
match (got, want) {
|
|
||||||
var matchPercent = want.match(/(.*)\s+~(.+)%$/),
|
|
||||||
matchAbs = want.match(/(.*)\s+\+\-(.+)$/),
|
|
||||||
matchRe = want.match(/^\/(.*)\/$/);
|
|
||||||
|
|
||||||
if (got === want) {
|
|
||||||
return true;
|
|
||||||
} else if (matchPercent) { // percentage range: 100 ~ 5%
|
|
||||||
var target = parseFloat(matchPercent[1]),
|
|
||||||
percentage = parseFloat(matchPercent[2]);
|
|
||||||
if (target === 0) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
var ratio = Math.abs(1 - parseFloat(got) / target);
|
|
||||||
return 100 * ratio < percentage;
|
|
||||||
}
|
|
||||||
} else if (matchAbs) { // absolute range: 100 +-5
|
|
||||||
var margin = parseFloat(matchAbs[2]),
|
|
||||||
fromR = parseFloat(matchAbs[1]) - margin,
|
|
||||||
toR = parseFloat(matchAbs[1]) + margin;
|
|
||||||
return parseFloat(got) >= fromR && parseFloat(got) <= toR;
|
|
||||||
} else if (matchRe) { // regex: /a,b,.*/
|
|
||||||
return got.match(matchRe[1]);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
matchLocation (got, want) {
|
|
||||||
return this.match(got[0], util.format('%d ~0.0025%', want.lon)) &&
|
|
||||||
this.match(got[1], util.format('%d ~0.0025%', want.lat));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
var path = require('path');
|
|
||||||
var util = require('util');
|
|
||||||
var fs = require('fs');
|
|
||||||
var exec = require('child_process').exec;
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.initializeEnv = (callback) => {
|
|
||||||
this.DEFAULT_PORT = 5000;
|
|
||||||
// OSX builds on Travis hit a timeout of ~2000 from time to time
|
|
||||||
this.DEFAULT_TIMEOUT = 5000;
|
|
||||||
this.setDefaultTimeout(this.DEFAULT_TIMEOUT);
|
|
||||||
this.ROOT_FOLDER = process.cwd();
|
|
||||||
this.OSM_USER = 'osrm';
|
|
||||||
this.OSM_GENERATOR = 'osrm-test';
|
|
||||||
this.OSM_UID = 1;
|
|
||||||
this.TEST_FOLDER = path.resolve(this.ROOT_FOLDER, 'test');
|
|
||||||
this.DATA_FOLDER = path.resolve(this.TEST_FOLDER, 'cache');
|
|
||||||
this.OSM_TIMESTAMP = '2000-01-01T00:00:00Z';
|
|
||||||
this.DEFAULT_SPEEDPROFILE = 'bicycle';
|
|
||||||
this.WAY_SPACING = 100;
|
|
||||||
this.DEFAULT_GRID_SIZE = 100; // meters
|
|
||||||
this.PROFILES_PATH = path.resolve(this.ROOT_FOLDER, 'profiles');
|
|
||||||
this.FIXTURES_PATH = path.resolve(this.ROOT_FOLDER, 'unit_tests/fixtures');
|
|
||||||
this.BIN_PATH = path.resolve(this.ROOT_FOLDER, 'build');
|
|
||||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
|
||||||
this.DEFAULT_ORIGIN = [1,1];
|
|
||||||
this.LAUNCH_TIMEOUT = 1000;
|
|
||||||
this.SHUTDOWN_TIMEOUT = 10000;
|
|
||||||
this.DEFAULT_LOAD_METHOD = 'datastore';
|
|
||||||
this.OSRM_ROUTED_LOG_FILE = path.resolve(this.TEST_FOLDER, 'osrm-routed.log');
|
|
||||||
this.ERROR_LOG_FILE = path.resolve(this.TEST_FOLDER, 'error.log');
|
|
||||||
|
|
||||||
// OS X shim to ensure shared libraries from custom locations can be loaded
|
|
||||||
// This is needed in OS X >= 10.11 because DYLD_LIBRARY_PATH is blocked
|
|
||||||
// https://forums.developer.apple.com/thread/9233
|
|
||||||
this.LOAD_LIBRARIES = process.env.OSRM_SHARED_LIBRARY_PATH ? util.format('DYLD_LIBRARY_PATH=%s ', process.env.OSRM_SHARED_LIBRARY_PATH) : '';
|
|
||||||
|
|
||||||
// TODO make sure this works on win
|
|
||||||
if (process.platform.match(/indows.*/)) {
|
|
||||||
this.TERMSIGNAL = 9;
|
|
||||||
this.EXE = '.exe';
|
|
||||||
this.QQ = '"';
|
|
||||||
} else {
|
|
||||||
this.TERMSIGNAL = 'SIGTERM';
|
|
||||||
this.EXE = '';
|
|
||||||
this.QQ = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.info(util.format('Node Version', process.version));
|
|
||||||
if (parseInt(process.version.match(/v(\d)/)[1]) < 4) throw new Error('*** PLease upgrade to Node 4.+ to run OSRM cucumber tests');
|
|
||||||
|
|
||||||
if (process.env.OSRM_PORT) {
|
|
||||||
this.OSRM_PORT = parseInt(process.env.OSRM_PORT);
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.info(util.format('Port set to %d', this.OSRM_PORT));
|
|
||||||
} else {
|
|
||||||
this.OSRM_PORT = this.DEFAULT_PORT;
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.info(util.format('Using default port %d', this.OSRM_PORT));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.env.OSRM_TIMEOUT) {
|
|
||||||
this.OSRM_TIMEOUT = parseInt(process.env.OSRM_TIMEOUT);
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.info(util.format('Timeout set to %d', this.OSRM_TIMEOUT));
|
|
||||||
} else {
|
|
||||||
this.OSRM_TIMEOUT = this.DEFAULT_TIMEOUT;
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.info(util.format('Using default timeout %d', this.OSRM_TIMEOUT));
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.exists(this.TEST_FOLDER, (exists) => {
|
|
||||||
if (!exists) throw new Error(util.format('*** Test folder %s doesn\'t exist.', this.TEST_FOLDER));
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.verifyOSRMIsNotRunning = () => {
|
|
||||||
if (this.OSRMLoader.up()) {
|
|
||||||
throw new Error('*** osrm-routed is already running.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.verifyExistenceOfBinaries = (callback) => {
|
|
||||||
var verify = (bin, cb) => {
|
|
||||||
var binPath = path.resolve(util.format('%s/%s%s', this.BIN_PATH, bin, this.EXE));
|
|
||||||
fs.exists(binPath, (exists) => {
|
|
||||||
if (!exists) throw new Error(util.format('%s is missing. Build failed?', binPath));
|
|
||||||
var helpPath = util.format('%s%s --help > /dev/null 2>&1', this.LOAD_LIBRARIES, binPath);
|
|
||||||
exec(helpPath, (err) => {
|
|
||||||
if (err) {
|
|
||||||
this.log(util.format('*** Exited with code %d', err.code), 'preprocess');
|
|
||||||
throw new Error(util.format('*** %s exited with code %d', helpPath, err.code));
|
|
||||||
}
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
['osrm-extract', 'osrm-contract', 'osrm-routed'].forEach(bin => { q.defer(verify, bin); });
|
|
||||||
q.awaitAll(() => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.AfterConfiguration = (callback) => {
|
|
||||||
this.clearLogFiles(() => {
|
|
||||||
this.verifyOSRMIsNotRunning();
|
|
||||||
this.verifyExistenceOfBinaries(() => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
process.on('exit', () => {
|
|
||||||
if (this.OSRMLoader.loader) this.OSRMLoader.shutdown(() => {});
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on('SIGINT', () => {
|
|
||||||
process.exit(2);
|
|
||||||
// TODO need to handle for windows??
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user