Compare commits
451 Commits
v5.5.0-rc.1
...
v5.6.5
| Author | SHA1 | Date | |
|---|---|---|---|
| dc26ea2672 | |||
| af94b3aebf | |||
| fd1d8052ac | |||
| 3b0b896501 | |||
| cc0c28f366 | |||
| 66cc99703c | |||
| f7fbca3e5e | |||
| 9695eaa28a | |||
| 0d7546a510 | |||
| 9dc8136240 | |||
| a02a83f8bd | |||
| 9b18f55d29 | |||
| a3434e7ae9 | |||
| 64b15028e4 | |||
| d8e466fdaa | |||
| 43bbe8f2ae | |||
| b5c10b1fbf | |||
| 57d93fc5dc | |||
| 3aba2bc2d0 | |||
| c42478f0ee | |||
| ea583a77ff | |||
| dd999e112e | |||
| 69c54bef72 | |||
| cfee0f1109 | |||
| c7ce758e1c | |||
| 3ac4fb5933 | |||
| 2afe5e971b | |||
| 519b744502 | |||
| d3c2ac671f | |||
| 07a1a907f8 | |||
| 062cae82a0 | |||
| 316c7781a3 | |||
| e11bcfece5 | |||
| cb8dee3e60 | |||
| a1abe71d9f | |||
| d54c837e51 | |||
| 106d17541d | |||
| ad29b237e3 | |||
| febefb4684 | |||
| d28713b845 | |||
| 2e6428e917 | |||
| 1f3a8d4538 | |||
| 140f1ad923 | |||
| 1c25070572 | |||
| 24fe881d03 | |||
| 25ab51f4f0 | |||
| 46f96af360 | |||
| ce685da92c | |||
| 2218658969 | |||
| 3e2db47cc8 | |||
| 28a8154cee | |||
| 005124fe1c | |||
| 1e4c8eeeb6 | |||
| 72455a2733 | |||
| 112cf55aae | |||
| aa3f208032 | |||
| 919386bdaf | |||
| ae835cc04f | |||
| ef4d32a492 | |||
| 2a5ebf84bc | |||
| 768dc8d817 | |||
| 0c04c6cafb | |||
| bf690df97a | |||
| 880b982eeb | |||
| 53011755a2 | |||
| ddb60c34e6 | |||
| 543f0e5e44 | |||
| 1e9e420d91 | |||
| c885d03830 | |||
| ab91a05680 | |||
| 84261fd214 | |||
| 734df348cb | |||
| 41064e2d7b | |||
| 8d7aae8687 | |||
| 7256b6d0d4 | |||
| 3106b5dd9e | |||
| f1427a834d | |||
| 04954de9c6 | |||
| a6cd0863bc | |||
| 9f28873cb1 | |||
| 10c5d76909 | |||
| d81ef3f4db | |||
| 3abab16bf3 | |||
| 6e1c4bfecd | |||
| cedeb15ade | |||
| f2663acfc6 | |||
| c48fc58eb2 | |||
| 5f1c7efd41 | |||
| 9e5d45d86a | |||
| 5fd6355829 | |||
| 6da4d918d0 | |||
| 1628ebb871 | |||
| eaed5c7a8e | |||
| 9d2628b74f | |||
| 11ee632cfe | |||
| 97c0a74c04 | |||
| b3ef27d104 | |||
| c22ce3ae1f | |||
| 36c944ef53 | |||
| 5b24758742 | |||
| a572719484 | |||
| ad594cb2e4 | |||
| 6b143c5e1d | |||
| 25baf51a2c | |||
| c059d15cb9 | |||
| 279f8aabfb | |||
| e463733138 | |||
| 7deff5837c | |||
| 46ac9d05d9 | |||
| c7640903c3 | |||
| 445225bf6d | |||
| 47b1a56b12 | |||
| b5e289adc3 | |||
| e0a1a43449 | |||
| 337ecefa45 | |||
| 7961fa8863 | |||
| 88eb9e5499 | |||
| df449d3b5c | |||
| d8c54fb815 | |||
| 6f27aae022 | |||
| 5c93609142 | |||
| c277b95f03 | |||
| b1f1c26703 | |||
| a5d0707dd0 | |||
| d129b0ef24 | |||
| f2c3b9859e | |||
| bb1f4a025a | |||
| 8c36012653 | |||
| 66cb75f4a3 | |||
| 0c6dee4bef | |||
| 49d3467ec7 | |||
| a48cf58468 | |||
| fbc7189cf8 | |||
| e8167b2e4e | |||
| c03aa8a273 | |||
| a40abacfca | |||
| b8beac2d00 | |||
| 75e0b5a5c4 | |||
| c03b230e84 | |||
| 6b06c5bd32 | |||
| 226ee62981 | |||
| fce3bb180c | |||
| 1ae69fe40d | |||
| e4dc2aa45c | |||
| d0f1347ff1 | |||
| 70e899378d | |||
| dbd70d4884 | |||
| 71044e88f3 | |||
| b8f631f6f6 | |||
| 3837f9d015 | |||
| 763ad0d047 | |||
| b6f9ec2a33 | |||
| 5d3a348b76 | |||
| 104e23abf3 | |||
| a7bb26f2d6 | |||
| 710ba20acc | |||
| fce8d72895 | |||
| 774b8688ca | |||
| fe2beb6f68 | |||
| 71e7d6d6b8 | |||
| 29f736f1c8 | |||
| bb4f13a47c | |||
| bb0b03bbce | |||
| 59ad7dddb2 | |||
| f12fdeb23e | |||
| f896aaf881 | |||
| a2a2cf84d1 | |||
| 4e897aad50 | |||
| 5e8bdbfa0c | |||
| fd57c5b48b | |||
| 1d4d3b80b5 | |||
| f82740ed93 | |||
| c1f833c80f | |||
| 813e16b9b4 | |||
| 06ef3053de | |||
| 9fa7e6c74f | |||
| a7d63283ab | |||
| 78a443bfb2 | |||
| 84b8d3cfb9 | |||
| b3483f95a7 | |||
| 32f63e5e0c | |||
| 185e9dc7f3 | |||
| 6794f52cb2 | |||
| 06e6b9ea6f | |||
| 93d89ad686 | |||
| 7c8176b077 | |||
| 7ef95e9918 | |||
| f313cb9913 | |||
| 15c8fd326f | |||
| f7e8581a1b | |||
| c01ea2ea3e | |||
| 1153b78c06 | |||
| b5d5f309a3 | |||
| 5100f2cc7b | |||
| f6fef5c166 | |||
| 559c88b36d | |||
| 7dea7476f1 | |||
| dc81f581a0 | |||
| 300283d572 | |||
| aad2124faa | |||
| aced058c4a | |||
| 24ab71a346 | |||
| 2640a319c1 | |||
| e6ff17ab2a | |||
| f7ad2e1e26 | |||
| 2ed6b181c8 | |||
| f48bbb78de | |||
| bd2a5ebe10 | |||
| f8499957fa | |||
| 5db134bbba | |||
| 8645d8c7fc | |||
| b8e13d9b1b | |||
| 421caa1856 | |||
| ed9d10e96c | |||
| 0f3a463854 | |||
| b9b52cb857 | |||
| 9af67c5a9f | |||
| 8ffe915395 | |||
| b376c97db8 | |||
| 7b11cd3a11 | |||
| 76de3b6ace | |||
| bc081b7132 | |||
| 3cbac0f012 | |||
| f40b34af9d | |||
| cc14fb8bff | |||
| c5e3fa916f | |||
| dff7fe214b | |||
| 3b2ca720a8 | |||
| df4231341f | |||
| 0a2f934c87 | |||
| 3721f8c887 | |||
| 1ba5ff44cc | |||
| 5ecd2e4c67 | |||
| b1f6797aab | |||
| f04d146ca3 | |||
| 8c50a42ec4 | |||
| c4b3cdfd80 | |||
| 37051e1583 | |||
| d3ef993d5f | |||
| 9832825abd | |||
| d584bcad11 | |||
| e48ca65af4 | |||
| f429e08851 | |||
| de062d4ca3 | |||
| d83ab9d905 | |||
| 4618b502ac | |||
| 94854b5c90 | |||
| f8dd965435 | |||
| 6e29f9889b | |||
| 48d4e91d98 | |||
| 708ac04562 | |||
| 38b2ad298d | |||
| a51ef67db8 | |||
| 67ce19cb14 | |||
| 1b51163b1d | |||
| 84b618ed1a | |||
| dc8e6bd8d9 | |||
| 68e38880df | |||
| d5904d5756 | |||
| 0f59b78c02 | |||
| 6e7fe5feb0 | |||
| 3dfbf42e61 | |||
| f88f51fd98 | |||
| 98659fb0a0 | |||
| 8a1afe456f | |||
| f1384f5e44 | |||
| 1cd5394a16 | |||
| 8c7f744b1a | |||
| 896445a337 | |||
| 8c21e1267e | |||
| ad3fd46da5 | |||
| 62f0e11bfa | |||
| 03d653c0bb | |||
| cbfb055f81 | |||
| 2288704bb5 | |||
| 97dcf4eef9 | |||
| 17e15033e1 | |||
| 875f482203 | |||
| df3c39cef5 | |||
| a28a20a1ba | |||
| 17a18b5c7c | |||
| 423c083038 | |||
| 468d8c0031 | |||
| 6f4c6e84ae | |||
| 4b1aae40af | |||
| 0e6863aec1 | |||
| 949d505783 | |||
| d11927046f | |||
| 9461c83511 | |||
| 532cbfce13 | |||
| 0fbd18b0dd | |||
| 3f07a830e6 | |||
| 24b01fae00 | |||
| 0817cd6dfd | |||
| 9d8b92f418 | |||
| 928a6f0c7d | |||
| 29b3caf529 | |||
| 20c8ac0272 | |||
| c99c8bccbc | |||
| 735191255d | |||
| da6ca640a7 | |||
| f6f7a9290f | |||
| 9687a9325c | |||
| 43566bfd14 | |||
| 110e6c3689 | |||
| 561b7cc58e | |||
| 5775679f64 | |||
| 560d8ffec0 | |||
| 2544c3f20e | |||
| 5a311012af | |||
| ef087f963d | |||
| a1127c3e09 | |||
| 01a57ff1d8 | |||
| 37824e2954 | |||
| 4489c8dfc2 | |||
| ee63e39ff5 | |||
| ce5bcc797b | |||
| fe5cc55b0e | |||
| 12d58ace10 | |||
| 4636aaabfe | |||
| 186cc8340a | |||
| e343f71541 | |||
| 0df0d31d83 | |||
| aaf42a1caf | |||
| d02dd67e95 | |||
| a49bd70985 | |||
| b2c27fbd25 | |||
| 9fe0e91d92 | |||
| 08b7270f5c | |||
| fc52dd85fe | |||
| 6d961d4a15 | |||
| 0bd08224bf | |||
| 2a383efbf6 | |||
| b84d70d305 | |||
| 3bade8625f | |||
| 844300b95a | |||
| dd811539a3 | |||
| 79c2ae46d8 | |||
| d023e7c581 | |||
| 4ccb08983f | |||
| 8c941d1344 | |||
| 841c032a0d | |||
| a764fd1f29 | |||
| 3687864cc1 | |||
| 4b5466629f | |||
| f19bf70b55 | |||
| 24fa94af59 | |||
| 95a584a30d | |||
| 6ba36a2bc7 | |||
| 039989a339 | |||
| a7559077a0 | |||
| bbe80192aa | |||
| 9b16b757a4 | |||
| 3680fc9d90 | |||
| 836e8bdff0 | |||
| 3d4b39be7d | |||
| 193dfd9d8b | |||
| 305e813489 | |||
| a5756fc764 | |||
| f5bf788814 | |||
| 00f7d7776d | |||
| dce685c780 | |||
| 173a39fd8b | |||
| 5d564ee510 | |||
| 24c2708d1e | |||
| d87a972c66 | |||
| f90736b6b3 | |||
| 9aeb3086cb | |||
| 9e361a8178 | |||
| c3aeef4e09 | |||
| 50090e6447 | |||
| b9e5d26e3a | |||
| 184cfab33b | |||
| fd95b2da76 | |||
| ce04a608b8 | |||
| cff69178e8 | |||
| 6c682b2258 | |||
| c1087eaecc | |||
| 8bb183bc8c | |||
| 15359befdc | |||
| 2c9e18d5a9 | |||
| 4f81e31d63 | |||
| b73c59088c | |||
| 44e4728bde | |||
| ba2629456f | |||
| 1b4779a58c | |||
| 1eaf9f3269 | |||
| 73e365d398 | |||
| d5bf508046 | |||
| 47b097038a | |||
| a4264c7849 | |||
| 463228d0bf | |||
| 6f885b5bdb | |||
| 1dde5d288d | |||
| 820feb3a04 | |||
| 46b00e1378 | |||
| eb12c16fd6 | |||
| 17c32f5ce7 | |||
| 53ef2e2955 | |||
| 7b1131b982 | |||
| 1fc969e6c8 | |||
| 49f960064c | |||
| 83a9d0590d | |||
| d8b016b92a | |||
| 608044305d | |||
| 4760b85930 | |||
| 9e2782d923 | |||
| 2dfeb0cabc | |||
| 2f9b5788d0 | |||
| be496eb4e3 | |||
| 97244557b1 | |||
| e2e5eb0169 | |||
| 6949d7ee5b | |||
| 02303904b8 | |||
| 4ad6d88888 | |||
| e226b52f21 | |||
| b1125b7f1f | |||
| 33ff92d27e | |||
| de4fd76d57 | |||
| bf6df74d44 | |||
| 8f6dd805e5 | |||
| 3235f30a98 | |||
| 7e4020c010 | |||
| 538bbd47d1 | |||
| 78583d2c8c | |||
| fa1a0a1325 | |||
| 6df1437cfc | |||
| 15ed53d4a7 | |||
| 63be191775 | |||
| 6ec505281e | |||
| 5a293e891b | |||
| b57169e221 | |||
| 045d25041f | |||
| 170923874b | |||
| 8137e95fbb | |||
| 0375af197d | |||
| babbda98a6 | |||
| 72bfbed1f1 | |||
| feeae05f1c | |||
| f88ac989ea | |||
| 41f083cded | |||
| 12ded539aa | |||
| 827a1fbd7a | |||
| e84a0ea37c | |||
| 88208bfa5d | |||
| 7073403f1b | |||
| 2501882adb | |||
| 4f2bb19b0f | |||
| de77befb23 | |||
| a5db3d72f1 | |||
| b8898ef410 |
@@ -94,3 +94,6 @@ node_modules
|
||||
/server.ini
|
||||
|
||||
*.swp
|
||||
|
||||
# local lua debugging file
|
||||
debug.lua
|
||||
+61
-50
@@ -13,6 +13,7 @@ notifications:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- "5.6"
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
@@ -25,7 +26,9 @@ env:
|
||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||
- CCACHE_COMPRESS=1
|
||||
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
||||
- JOBS=4
|
||||
- CCACHE_VERSION=3.3.1
|
||||
- CMAKE_VERSION=3.6.2
|
||||
- MASON="$(pwd)/third_party/mason/mason"
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
@@ -39,42 +42,53 @@ matrix:
|
||||
addons: &gcc6
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "clang-3.8-debug"
|
||||
compiler: "clang-3.9-debug"
|
||||
addons: &clang38
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CLANG_VERSION='3.8.1' CLANG_PACKAGE="clang++" BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
|
||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Debug' BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
compiler: clang
|
||||
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Debug' JOBS=1 CUCUMBER_TIMEOUT=60000
|
||||
osx_image: xcode8.2
|
||||
compiler: "mason-osx-release"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON
|
||||
|
||||
# Release Builds
|
||||
- os: linux
|
||||
compiler: "mason-release"
|
||||
compiler: "mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev', 'ccache']
|
||||
env: BUILD_TYPE='Release' ENABLE_MASON=ON
|
||||
packages: ['libstdc++-5-dev']
|
||||
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release"
|
||||
addons: &gcc6
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_COMPONENTS=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release-i686"
|
||||
env: TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
env: >
|
||||
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-4.9-release"
|
||||
addons: &gcc49
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
||||
|
||||
# Disabled because of CI slowness
|
||||
#- os: linux
|
||||
@@ -85,19 +99,13 @@ matrix:
|
||||
#- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
|
||||
|
||||
# Disabled because of CI slowness
|
||||
#- os: osx
|
||||
#- osx_image: xcode7.3
|
||||
#- compiler: clang
|
||||
#- env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Release'
|
||||
|
||||
# Shared Library
|
||||
- os: linux
|
||||
compiler: "gcc-6-release-shared"
|
||||
addons: &gcc6
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON BUILD_COMPONENTS=ON
|
||||
|
||||
# Disabled because CI slowness
|
||||
@@ -111,24 +119,36 @@ matrix:
|
||||
|
||||
before_install:
|
||||
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
|
||||
- if [[ $(uname -s) == 'Darwin' ]]; then sudo mdutil -i off /; fi;
|
||||
- source ./scripts/install_node.sh 4
|
||||
- npm install
|
||||
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
||||
- export PATH=${DEPS_DIR}/bin:${PATH} && mkdir -p ${DEPS_DIR}
|
||||
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/3.5.2.tar.gz"
|
||||
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR} || exit 1
|
||||
- |
|
||||
if [[ ${CLANG_VERSION:-false} != false ]]; then
|
||||
export CCOMPILER='clang'
|
||||
export CXXCOMPILER='clang++'
|
||||
CLANG_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/${CLANG_PACKAGE}/${CLANG_VERSION}.tar.gz"
|
||||
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR} || exit 1
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
export JOBS=$((`nproc` + 1))
|
||||
fi
|
||||
- |
|
||||
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
||||
${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh
|
||||
fi
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
|
||||
brew install libzip libstxxl lua51 luabind tbb md5sha1sum ccache
|
||||
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
||||
sudo mdutil -i off /
|
||||
fi
|
||||
- echo "Using ${JOBS} jobs"
|
||||
- source ./scripts/install_node.sh 4
|
||||
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
|
||||
- npm install
|
||||
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
|
||||
- ${MASON} install cmake ${CMAKE_VERSION} && export PATH=$(${MASON} prefix cmake ${CMAKE_VERSION})/bin:${PATH}
|
||||
- |
|
||||
if [[ ! -z ${CLANG_VERSION} ]]; then
|
||||
export CCOMPILER='clang'
|
||||
export CXXCOMPILER='clang++'
|
||||
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH}
|
||||
# we only enable lto for release builds
|
||||
# and therefore don't need to us ld.gold or llvm tools for linking
|
||||
# for debug builds
|
||||
if [[ ${BUILD_TYPE} == 'Release' ]]; then
|
||||
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH}
|
||||
fi
|
||||
fi
|
||||
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
||||
|
||||
@@ -137,11 +157,11 @@ install:
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
fi
|
||||
- mkdir build && pushd build
|
||||
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
|
||||
- mkdir ${OSRM_BUILD_DIR} && pushd ${OSRM_BUILD_DIR}
|
||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON
|
||||
- echo "travis_fold:start:MAKE"
|
||||
- make osrm-extract --jobs=3
|
||||
- make --jobs=${JOBS}
|
||||
- make tests --jobs=${JOBS}
|
||||
- make benchmarks --jobs=${JOBS}
|
||||
@@ -152,18 +172,13 @@ install:
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
sudo ldconfig
|
||||
fi
|
||||
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
|
||||
- popd
|
||||
- |
|
||||
if [[ ${ENABLE_MASON:-OFF} == 'ON' ]]; then
|
||||
# for mason builds we need to point the example
|
||||
# at the clang++ installed by the CMakeLists.txt automatically
|
||||
export CXX=$(./third_party/mason/mason prefix clang++ 3.8.1)/bin/clang++
|
||||
export CC=$(./third_party/mason/mason prefix clang++ 3.8.1)/bin/clang
|
||||
fi
|
||||
- mkdir example/build && pushd example/build
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||
- make
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
- npm run build-api-docs
|
||||
|
||||
script:
|
||||
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
||||
@@ -172,7 +187,7 @@ script:
|
||||
- echo "travis_fold:end:BENCHMARK"
|
||||
- ./example/build/osrm-example test/data/monaco.osrm
|
||||
# All tests assume to be run from the build directory
|
||||
- pushd build
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- ./unit_tests/library-tests ../test/data/monaco.osrm
|
||||
- ./unit_tests/extractor-tests
|
||||
- ./unit_tests/engine-tests
|
||||
@@ -182,10 +197,6 @@ script:
|
||||
- npm test
|
||||
|
||||
after_success:
|
||||
- |
|
||||
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
||||
./scripts/format.sh # we don't want to fail just yet
|
||||
fi
|
||||
- |
|
||||
if [ -n "${ENABLE_COVERAGE}" ]; then
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
+83
-2
@@ -1,3 +1,72 @@
|
||||
# 5.6.5
|
||||
- Changes from 5.6.4
|
||||
- Bugfixes
|
||||
- Fix #3873 excessive usage of disk and memory during osrm-extract because edge deduplication was broken
|
||||
|
||||
# 5.6.4
|
||||
- Changes from 5.6.3
|
||||
- Bugfixes
|
||||
- Fix #3838 throws errors if write streams have failed
|
||||
|
||||
# 5.6.3
|
||||
- Changes from 5.6.2
|
||||
- Bugfixes
|
||||
- #3790 Fix incorrect speed values in tile plugin
|
||||
|
||||
# 5.6.2
|
||||
- Changes from 5.6.1
|
||||
- Bugfixes
|
||||
- Fix incorrect forward datasources getter in facade
|
||||
- Fix include `access=private` non-car roads in the car profile
|
||||
|
||||
# 5.6.1
|
||||
- Changes from 5.6.0
|
||||
- Bugfixes
|
||||
- Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
|
||||
|
||||
# 5.6.0
|
||||
- Changes from 5.5
|
||||
- Bugfixes
|
||||
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
|
||||
- Fix #3515 adjusted number of `nodes` in `annotation`
|
||||
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
|
||||
- Fix #2844 handle up to 16777215 code units in OSM names
|
||||
- Infrastructure
|
||||
- Support building rpm packages.
|
||||
- Guidance
|
||||
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
|
||||
- Profiles
|
||||
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
|
||||
- `properties` object has a new `weight_name` field, default value is "duration"
|
||||
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
|
||||
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
|
||||
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
|
||||
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
|
||||
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
|
||||
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
|
||||
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
|
||||
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
|
||||
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
|
||||
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
|
||||
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
|
||||
- Infrastructure
|
||||
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
|
||||
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
|
||||
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
|
||||
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
|
||||
- Tools:
|
||||
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
|
||||
- Trip Plugin
|
||||
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
|
||||
|
||||
# 5.5.1
|
||||
- Changes from 5.5.0
|
||||
- API:
|
||||
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
|
||||
- Bugfixes
|
||||
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
|
||||
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
|
||||
|
||||
# 5.5.0
|
||||
- Changes from 5.4.0
|
||||
- API:
|
||||
@@ -5,6 +74,10 @@
|
||||
- Shared memory now allows for multiple clients (multiple instances of libosrm on the same segment)
|
||||
- Polyline geometries can now be requested with precision 5 as well as with precision 6
|
||||
- Profiles
|
||||
- the car profile has been refactored into smaller functions
|
||||
- get_value_by_key() is now guaranteed never to return empty strings, nil is returned instead.
|
||||
- debug.lua was added to make it easier to test/develop profile code.
|
||||
- `car.lua` now depends on lib/set.lua and lib/sequence.lua
|
||||
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
|
||||
- replaced lhs/rhs profiles by using test defined profiles
|
||||
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
|
||||
@@ -15,6 +88,7 @@
|
||||
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
|
||||
- Corrected the bearings returned for intermediate steps - requires reprocessing
|
||||
- Improved turn locations for collapsed turns
|
||||
- Sliproad classification refinements: the situations we detect as Sliproads now resemble more closely the reality
|
||||
- Trip Plugin
|
||||
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
|
||||
- Bugfixes
|
||||
@@ -22,8 +96,17 @@
|
||||
- fixed compile errors in tile unit-test framework
|
||||
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
|
||||
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
|
||||
- fixed a bug in the tile plugin that resulted in discovering invalid edges for connections
|
||||
- improved error messages when missing files during traffic updates (#3114)
|
||||
- For single coordinate geometries the GeoJSON `Point` encoding was broken. We now always emit `LineString`s even in the one-coordinate-case (backwards compatible) (#3425)
|
||||
- Debug Tiles
|
||||
- Added support for turn penalties
|
||||
- Internals
|
||||
- Internal/Shared memory datafacades now share common memory layout and data loading code
|
||||
- File reading now has much better error handling
|
||||
- Misc
|
||||
- Progress indicators now print newlines when stdout is not a TTY
|
||||
- Prettier API documentation now generated via `npm run build-api-docs` output `build/docs`
|
||||
|
||||
# 5.4.3
|
||||
- Changes from 5.4.2
|
||||
@@ -363,5 +446,3 @@
|
||||
- `properties.use_turn_restrictions`
|
||||
- `properties.u_turn_penalty`
|
||||
- `properties.allow_u_turn_at_via`
|
||||
|
||||
|
||||
|
||||
+219
-120
@@ -7,55 +7,65 @@ Please create a directory and run cmake from there, passing the path to this sou
|
||||
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
|
||||
endif()
|
||||
|
||||
# detect if this is included as subproject and if so expose
|
||||
# some variables to its parent scope
|
||||
get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY)
|
||||
if(BUILD_AS_SUBPROJECT)
|
||||
message(STATUS "Building libosrm as subproject.")
|
||||
endif()
|
||||
|
||||
option(ENABLE_MASON "Use mason for dependencies" OFF)
|
||||
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
||||
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
||||
option(BUILD_COMPONENTS "Build osrm-components" OFF)
|
||||
option(BUILD_PACKAGE "Build OSRM package" OFF)
|
||||
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
||||
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
||||
option(ENABLE_LTO "Use LTO if available" ON)
|
||||
option(ENABLE_LTO "Use LTO if available" OFF)
|
||||
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||
|
||||
if(ENABLE_MASON)
|
||||
|
||||
# versions in use
|
||||
set(MASON_CLANG_VERSION "3.8.1")
|
||||
set(MASON_BOOST_VERSION "1.61.0")
|
||||
set(MASON_BOOST_VERSION "1.63.0")
|
||||
set(MASON_STXXL_VERSION "1.4.1")
|
||||
set(MASON_EXPAT_VERSION "2.1.1")
|
||||
set(MASON_EXPAT_VERSION "2.2.0")
|
||||
set(MASON_LUA_VERSION "5.2.4")
|
||||
set(MASON_LUABIND_VERSION "e414c57bcb687bb3091b7c55bbff6947f052e46b")
|
||||
set(MASON_BZIP2_VERSION "1.0.6")
|
||||
set(MASON_TBB_VERSION "43_20150316")
|
||||
set(MASON_CCACHE_VERSION "3.3.1")
|
||||
set(MASON_TBB_VERSION "2017_20161128")
|
||||
|
||||
message(STATUS "Enabling mason")
|
||||
|
||||
find_program(CURL_FOUND curl)
|
||||
if(NOT CURL_FOUND)
|
||||
message(FATAL_ERROR "curl command required with -DENABLE_MASON")
|
||||
endif()
|
||||
|
||||
set(MASON_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason.cmake)
|
||||
if(NOT CMAKE_CXX_COMPILER)
|
||||
mason_use(clang++ VERSION ${MASON_CLANG_VERSION})
|
||||
message(STATUS "Setting compiler to clang++ ${MASON_CLANG_VERSION} (via mason) ${MASON_PACKAGE_clang++_PREFIX}/bin/clang++")
|
||||
set(CMAKE_CXX_COMPILER "${MASON_PACKAGE_clang++_PREFIX}/bin/clang++")
|
||||
set(CMAKE_C_COMPILER "${MASON_PACKAGE_clang++_PREFIX}/bin/clang")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# be compatible with version handling before cmake 3.x
|
||||
if (POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
endif()
|
||||
project(OSRM C CXX)
|
||||
set(OSRM_VERSION_MAJOR 5)
|
||||
set(OSRM_VERSION_MINOR 4)
|
||||
set(OSRM_VERSION_MINOR 5)
|
||||
set(OSRM_VERSION_PATCH 0)
|
||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
|
||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
# these two functions build up custom variables:
|
||||
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
|
||||
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
|
||||
# These variables we want to pass to
|
||||
# include_directories and add_definitions for both
|
||||
# this build and for sharing externally via pkg-config
|
||||
|
||||
function(add_dependency_includes includes)
|
||||
list(APPEND OSRM_INCLUDE_PATHS "${includes}")
|
||||
set(OSRM_INCLUDE_PATHS "${OSRM_INCLUDE_PATHS}" PARENT_SCOPE)
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${includes}")
|
||||
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||
endfunction(add_dependency_includes)
|
||||
|
||||
function(add_dependency_defines defines)
|
||||
@@ -66,6 +76,7 @@ endfunction(add_dependency_defines)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
@@ -81,16 +92,21 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||
endif()
|
||||
|
||||
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
||||
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/)
|
||||
|
||||
add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
|
||||
"-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FingerPrint-Config.cmake"
|
||||
COMMENT "Configuring revision fingerprint"
|
||||
VERBATIM)
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
|
||||
|
||||
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
|
||||
|
||||
@@ -112,7 +128,6 @@ add_library(STORAGE OBJECT ${StorageGlob})
|
||||
add_library(ENGINE OBJECT ${EngineGlob})
|
||||
add_library(SERVER OBJECT ${ServerGlob})
|
||||
|
||||
add_dependencies(UTIL FingerPrintConfigure)
|
||||
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
add_executable(osrm-extract src/tools/extract.cpp)
|
||||
@@ -129,6 +144,7 @@ if(ENABLE_GOLD_LINKER)
|
||||
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
message(STATUS "Using GNU gold as linker.")
|
||||
|
||||
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
|
||||
@@ -183,7 +199,8 @@ endif()
|
||||
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
||||
message(STATUS "Configuring release mode optimizations")
|
||||
# Check if LTO is available
|
||||
check_cxx_compiler_flag("-flto" LTO_AVAILABLE)
|
||||
check_cxx_compiler_flag("-Wl,-flto" LTO_AVAILABLE)
|
||||
|
||||
if(ENABLE_LTO AND LTO_AVAILABLE)
|
||||
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
# GCC in addition allows parallelizing LTO
|
||||
@@ -198,27 +215,57 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
||||
check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS)
|
||||
if(LTO_WORKS)
|
||||
message(STATUS "LTO working")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -flto")
|
||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -flto")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
|
||||
else()
|
||||
message(STATUS "LTO broken")
|
||||
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
||||
set(ENABLE_LTO Off)
|
||||
endif()
|
||||
|
||||
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
|
||||
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
|
||||
message(STATUS "Using gcc specific binutils for LTO.")
|
||||
set(CMAKE_AR "/usr/bin/gcc-ar")
|
||||
set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")
|
||||
find_program(GCC_AR gcc-ar)
|
||||
find_program(GCC_RANLIB gcc-ranlib)
|
||||
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
||||
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
|
||||
else()
|
||||
message(STATUS "Using GCC specific binutils for LTO:")
|
||||
message(STATUS " ${GCC_AR}")
|
||||
message(STATUS " ${GCC_RANLIB}")
|
||||
set(CMAKE_AR ${GCC_AR})
|
||||
set(CMAKE_RANLIB ${GCC_RANLIB})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Same for clang LTO requires their own toolchain
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
find_program(LLVM_AR llvm-ar)
|
||||
find_program(LLVM_RANLIB llvm-ranlib)
|
||||
if ("${LLVM_AR}" STREQUAL "LLVM_AR-NOTFOUND" OR "${LLVM_RANLIB}" STREQUAL "LLVM_RANLIB-NOTFOUND")
|
||||
message(WARNING "LLVM specific binutils not found.")
|
||||
else()
|
||||
message(STATUS "Using LLVM specific binutils for LTO:")
|
||||
message(STATUS " ${LLVM_AR}")
|
||||
message(STATUS " ${LLVM_RANLIB}")
|
||||
set(CMAKE_AR ${LLVM_AR})
|
||||
set(CMAKE_RANLIB ${LLVM_RANLIB})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
|
||||
message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038")
|
||||
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
||||
set(ENABLE_LTO Off)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_MASON AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
|
||||
if(UNIX AND NOT APPLE AND ENABLE_MASON AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
|
||||
message(WARNING "ENABLE_MASON and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux systems currently")
|
||||
message(WARNING "For more details see: https://github.com/Project-OSRM/osrm-backend/issues/3202")
|
||||
endif()
|
||||
@@ -234,11 +281,12 @@ if (ENABLE_COVERAGE)
|
||||
endif()
|
||||
if (ENABLE_SANITIZER)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
|
||||
endif()
|
||||
|
||||
# Configuring compilers
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
||||
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
||||
@@ -246,7 +294,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(COLOR_FLAG "")
|
||||
endif()
|
||||
# using GCC
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
||||
if(WIN32) # using mingw
|
||||
add_dependency_defines(-DWIN32)
|
||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||
@@ -280,9 +328,11 @@ if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld
|
||||
endif()
|
||||
# Default linker optimization flags
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common")
|
||||
|
||||
else()
|
||||
message(STATUS "Using unknown linker, not setting linker optimizations")
|
||||
endif ()
|
||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
@@ -290,6 +340,7 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
# Activate C++1y
|
||||
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++1y")
|
||||
endif()
|
||||
|
||||
# Configuring other platform dependencies
|
||||
@@ -356,10 +407,6 @@ if(ENABLE_MASON)
|
||||
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
|
||||
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
|
||||
|
||||
mason_use(luabind_lua524 VERSION ${MASON_LUABIND_VERSION})
|
||||
add_dependency_includes(${MASON_PACKAGE_luabind_lua524_INCLUDE_DIRS})
|
||||
set(LUABIND_LIBRARY ${MASON_PACKAGE_luabind_lua524_STATIC_LIBS})
|
||||
|
||||
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
|
||||
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
|
||||
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
|
||||
@@ -371,49 +418,42 @@ if(ENABLE_MASON)
|
||||
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
|
||||
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
|
||||
endif()
|
||||
set(TBB_LINKER_RPATHS "")
|
||||
foreach(libpath ${MASON_PACKAGE_tbb_LIBRARY_DIRS})
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(LINKER_FLAGS "-Wl,-rpath,${libpath}")
|
||||
elseif(APPLE)
|
||||
set(LINKER_FLAGS "-Wl,-rpath, -Wl,${libpath}")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(TBB_LINKER_RPATHS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,${libpath}")
|
||||
file(GLOB TBBGlob ${libpath}/*.*)
|
||||
install(FILES ${TBBGlob} DESTINATION lib)
|
||||
endforeach()
|
||||
|
||||
if(BUILD_COMPONENTS)
|
||||
message(FATAL_ERROR "BUILD_COMPONENTS is not supported with ENABLE_MASON")
|
||||
if(APPLE)
|
||||
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@executable_path")
|
||||
elseif(UNIX)
|
||||
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin")
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
|
||||
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
||||
|
||||
if(ENABLE_CCACHE)
|
||||
mason_use(ccache VERSION ${MASON_CCACHE_VERSION})
|
||||
message(STATUS "Setting ccache to ccache ${MASON_CCACHE_VERSION} (via mason) ${MASON_PACKAGE_ccache_PREFIX}/bin/ccache")
|
||||
message(STATUS "Using ccache to speed up incremental builds")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${MASON_PACKAGE_ccache_PREFIX}/bin/ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${MASON_PACKAGE_ccache_PREFIX}/bin/ccache)
|
||||
set(ENV{CCACHE_CPP2} "true")
|
||||
endif()
|
||||
# note: we avoid calling find_package(Osmium ...) here to ensure that the
|
||||
# expat and bzip2 are used from mason rather than the system
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
|
||||
|
||||
else()
|
||||
|
||||
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
||||
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
|
||||
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
|
||||
endif()
|
||||
|
||||
find_package(TBB REQUIRED)
|
||||
add_dependency_includes(${TBB_INCLUDE_DIR})
|
||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
||||
endif()
|
||||
find_package(Luabind REQUIRED)
|
||||
add_dependency_includes(${LUABIND_INCLUDE_DIR})
|
||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
|
||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||
|
||||
find_package(EXPAT REQUIRED)
|
||||
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
||||
@@ -424,9 +464,32 @@ else()
|
||||
find_package(BZip2 REQUIRED)
|
||||
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
||||
|
||||
if(BUILD_COMPONENTS)
|
||||
find_package(GDAL)
|
||||
endif()
|
||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
# Now fall back to a lua verison without exact
|
||||
# in case this cmake version also forces patch versions
|
||||
FIND_PACKAGE(Lua 5.2)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
|
||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||
|
||||
# add a target to generate API documentation with Doxygen
|
||||
find_package(Doxygen)
|
||||
@@ -439,34 +502,34 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
# prefix compilation with ccache by default if available and on clang or gcc
|
||||
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if(CCACHE_FOUND)
|
||||
message(STATUS "Using ccache to speed up incremental builds")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
set(ENV{CCACHE_CPP2} "true")
|
||||
endif()
|
||||
endif()
|
||||
# note libosmium depends on expat and bzip2
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
||||
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
||||
find_package(Osmium REQUIRED COMPONENTS io)
|
||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
||||
|
||||
endif()
|
||||
|
||||
# prefix compilation with ccache by default if available and on clang or gcc
|
||||
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if(CCACHE_FOUND)
|
||||
message(STATUS "Using ccache to speed up incremental builds")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
set(ENV{CCACHE_CPP2} "true")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# even with mason builds we want to link to system zlib
|
||||
# to ensure that osrm binaries play well with other binaries like nodejs
|
||||
find_package(ZLIB REQUIRED)
|
||||
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
||||
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
||||
find_package(Osmium REQUIRED COMPONENTS io)
|
||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
||||
|
||||
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
@@ -483,7 +546,7 @@ if(OPENMP_FOUND)
|
||||
endif()
|
||||
|
||||
add_definitions(${OSRM_DEFINES})
|
||||
include_directories(SYSTEM ${OSRM_INCLUDE_PATHS})
|
||||
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})
|
||||
|
||||
set(BOOST_BASE_LIBRARIES
|
||||
${Boost_DATE_TIME_LIBRARY}
|
||||
@@ -499,10 +562,10 @@ set(BOOST_ENGINE_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES})
|
||||
|
||||
# Binaries
|
||||
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BOOST_BASE_LIBRARIES})
|
||||
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY} ${BOOST_BASE_LIBRARIES})
|
||||
target_link_libraries(osrm-contract ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BOOST_BASE_LIBRARIES} ${TBB_LIBRARIES} osrm_contract)
|
||||
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BOOST_ENGINE_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
||||
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
||||
|
||||
set(EXTRACTOR_LIBRARIES
|
||||
${BZIP2_LIBRARIES}
|
||||
@@ -510,7 +573,6 @@ set(EXTRACTOR_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${EXPAT_LIBRARIES}
|
||||
${LUABIND_LIBRARY}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${OSMIUM_LIBRARIES}
|
||||
${STXXL_LIBRARY}
|
||||
@@ -520,7 +582,6 @@ set(EXTRACTOR_LIBRARIES
|
||||
set(CONTRACTOR_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${LUABIND_LIBRARY}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES}
|
||||
@@ -551,33 +612,25 @@ target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
||||
|
||||
if(BUILD_COMPONENTS)
|
||||
if(GDAL_FOUND)
|
||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-components ${TBB_LIBRARIES})
|
||||
include_directories(SYSTEM ${GDAL_INCLUDE_DIR})
|
||||
target_link_libraries(osrm-components ${GDAL_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
||||
install(TARGETS osrm-components DESTINATION bin)
|
||||
else()
|
||||
message(WARNING "libgdal and/or development headers not found")
|
||||
endif()
|
||||
endif()
|
||||
# BUILD_COMPONENTS
|
||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
||||
install(TARGETS osrm-components DESTINATION bin)
|
||||
|
||||
if(BUILD_TOOLS)
|
||||
message(STATUS "Activating OSRM internal tools")
|
||||
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
||||
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-unlock-all ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_link_libraries(osrm-unlock-all rt)
|
||||
endif()
|
||||
add_executable(osrm-springclean src/tools/springclean.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-springclean ${BOOST_BASE_LIBRARIES})
|
||||
|
||||
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
||||
install(TARGETS osrm-unlock-all DESTINATION bin)
|
||||
install(TARGETS osrm-springclean DESTINATION bin)
|
||||
|
||||
find_package(Shapefile) # package libshp-dev
|
||||
if(Shapefile_FOUND)
|
||||
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
|
||||
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LIBSHAPEFILE_LIBRARY})
|
||||
install(TARGETS osrm-extract-conditionals DESTINATION bin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_ASSERTIONS)
|
||||
@@ -593,7 +646,7 @@ set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
file(GLOB VariantGlob third_party/variant/*.hpp)
|
||||
file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp)
|
||||
file(GLOB LibraryGlob include/osrm/*.hpp)
|
||||
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
||||
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
|
||||
@@ -608,7 +661,7 @@ install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
|
||||
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
|
||||
install(FILES ${LibraryGlob} DESTINATION include/osrm)
|
||||
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
||||
install(FILES ${VariantGlob} DESTINATION include/variant)
|
||||
install(FILES ${VariantGlob} DESTINATION include/mapbox)
|
||||
install(TARGETS osrm-extract DESTINATION bin)
|
||||
install(TARGETS osrm-contract DESTINATION bin)
|
||||
install(TARGETS osrm-datastore DESTINATION bin)
|
||||
@@ -618,12 +671,16 @@ install(TARGETS osrm_extract DESTINATION lib)
|
||||
install(TARGETS osrm_contract DESTINATION lib)
|
||||
install(TARGETS osrm_store DESTINATION lib)
|
||||
|
||||
foreach(lib ${ENGINE_LIBRARIES})
|
||||
set(ENGINE_LIBRARY_LISTING "${ENGINE_LIBRARY_LISTING} ${lib}")
|
||||
endforeach()
|
||||
|
||||
if(BUILD_DEBIAN_PACKAGE)
|
||||
include(CPackDebianConfig)
|
||||
# Install profiles and support library to /usr/local/share/osrm/profiles by default
|
||||
set(DefaultProfilesDir profiles)
|
||||
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
|
||||
|
||||
# Setup exporting variables for pkgconfig and subproject
|
||||
#
|
||||
|
||||
if(BUILD_PACKAGE)
|
||||
include(CPackConfig)
|
||||
include(CPack)
|
||||
endif()
|
||||
|
||||
@@ -632,12 +689,36 @@ function(JOIN VALUES GLUE OUTPUT)
|
||||
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Set up variables, then write to pkgconfig file
|
||||
JOIN("${OSRM_DEFINES}" " " OSRM_DEFINES_STRING)
|
||||
JOIN("-I${OSRM_INCLUDE_PATHS}" " -I" OSRM_INCLUDE_PATHS_STRING)
|
||||
JOIN("${OSRM_DEFINES}" " " TMP_OSRM_DEFINES)
|
||||
set(LibOSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${TMP_OSRM_DEFINES}")
|
||||
set(LibOSRM_LDFLAGS "${OSRM_LDFLAGS}")
|
||||
|
||||
if(BUILD_AS_SUBPROJECT)
|
||||
set(LibOSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}" PARENT_SCOPE)
|
||||
set(LibOSRM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
|
||||
set(LibOSRM_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
||||
set(LibOSRM_LIBRARIES "osrm" PARENT_SCOPE)
|
||||
set(LibOSRM_DEPENDENT_LIBRARIES "${ENGINE_LIBRARIES}" PARENT_SCOPE)
|
||||
set(LibOSRM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/osrm"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party"
|
||||
"${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||
set(LibOSRM_LIBRARY_DIRS "${LibOSRM_LIBRARY_DIR}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# pkgconfig defines
|
||||
set(PKGCONFIG_OSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}")
|
||||
set(PKGCONFIG_OSRM_LDFLAGS "${LibOSRM_LDFLAGS}")
|
||||
set(PKGCONFIG_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
set(PKGCONFIG_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
|
||||
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}")
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm")
|
||||
JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
|
||||
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
# uninstall target
|
||||
configure_file(
|
||||
@@ -660,8 +741,26 @@ if (ENABLE_FUZZING)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fsanitize=address")
|
||||
|
||||
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
|
||||
|
||||
add_subdirectory(fuzz)
|
||||
endif ()
|
||||
|
||||
|
||||
## add headers sanity check target that includes all headers independently
|
||||
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
|
||||
file(GLOB_RECURSE headers_to_check
|
||||
${PROJECT_BINARY_DIR}/*.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/*.hpp)
|
||||
foreach(header ${headers_to_check})
|
||||
get_filename_component(filename ${header} NAME_WE)
|
||||
set(filename "${check_headers_dir}/${filename}.cpp")
|
||||
if (NOT EXISTS ${filename})
|
||||
file(WRITE ${filename} "#include \"${header}\"\n")
|
||||
endif()
|
||||
list(APPEND sources ${filename})
|
||||
endforeach()
|
||||
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
|
||||
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
|
||||
|
||||
@@ -7,6 +7,28 @@ You can add a :+1: emoji to the issue if you want to express interest in this.
|
||||
# Developer
|
||||
|
||||
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
||||
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
|
||||
To save development time a local hook `.git/hooks/pre-push`
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
remote="$1"
|
||||
if [ x"$remote" = xorigin ] ; then
|
||||
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
|
||||
echo "Rejected push to $remote/master" ; exit 1
|
||||
fi
|
||||
|
||||
./scripts/format.sh
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "Unstaged format changes" ; exit 1
|
||||
fi
|
||||
fi
|
||||
```
|
||||
could check code format, modify a local repository and reject push due to unstaged formatting changes.
|
||||
Also `pre-push` hook rejects direct pushes to `origin/master`.
|
||||
|
||||
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
|
||||
|
||||
|
||||
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
||||
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
||||
|
||||
@@ -1,64 +1,87 @@
|
||||
## About
|
||||
## Open Source Routing Machine
|
||||
|
||||
The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
|
||||
| Linux / macOS | Windows | Code Coverage |
|
||||
| ------------- | ------- | ------------- |
|
||||
| [](https://travis-ci.org/Project-OSRM/osrm-backend) | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
|
||||
## Current build status
|
||||
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
|
||||
|
||||
| build config | status |
|
||||
|:-------------|:-------|
|
||||
| Linux | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
||||
| Windows | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||
| Coverage | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
|
||||
- Nearest - Snaps coordinates to the street network and returns the nearest matches
|
||||
- Route - Finds the fastest route between coordinates
|
||||
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
|
||||
- Match - Snaps noisy GPS traces to the road network in the most plausible way
|
||||
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
|
||||
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
|
||||
|
||||
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
|
||||
|
||||
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
||||
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
|
||||
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
|
||||
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
|
||||
|
||||
## Contact
|
||||
|
||||
- IRC: server `irc.oftc.net`, channel: `#osrm` (see: `https://www.oftc.net`, and for a webchat: `https://webchat.oftc.net`)
|
||||
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
|
||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||
|
||||
## Building
|
||||
## Quick Start
|
||||
|
||||
For instructions on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||
The following targets Ubuntu 16.04.
|
||||
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||
|
||||
To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
|
||||
#### Install dependencies
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential git cmake pkg-config \
|
||||
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
|
||||
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
|
||||
```
|
||||
|
||||
#### Compile and install OSRM binaries:
|
||||
|
||||
```bash
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
sudo cmake --build . --target install
|
||||
```
|
||||
|
||||
#### Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
|
||||
|
||||
```bash
|
||||
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
||||
```
|
||||
|
||||
#### Pre-process the extract and start the HTTP server
|
||||
|
||||
```
|
||||
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
|
||||
osrm-contract berlin-latest.osrm
|
||||
osrm-routed berlin-latest.osrm
|
||||
```
|
||||
|
||||
#### Running Queries
|
||||
|
||||
```
|
||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
### Full documentation
|
||||
|
||||
- [Hosted documentation](http://project-osrm.org)
|
||||
- [osrm-routed HTTP API documentation](docs/http.md)
|
||||
- [libosrm API documentation](docs/libosrm.md)
|
||||
|
||||
### Quick start
|
||||
|
||||
Building OSRM assuming all dependencies are installed:
|
||||
|
||||
```
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build .
|
||||
sudo cmake --build . --target install
|
||||
```
|
||||
|
||||
Loading preparing a dataset and starting the server:
|
||||
|
||||
```
|
||||
osrm-extract data.osm.pbf -p profiles/car.lua
|
||||
osrm-contract data.osrm
|
||||
osrm-routed data.osrm
|
||||
```
|
||||
|
||||
Running a query on your local server:
|
||||
|
||||
```
|
||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
```
|
||||
|
||||
### Running a request against the Demo Server
|
||||
|
||||
First read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||
|
||||
Then run simple query with instructions and alternatives on Berlin:
|
||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||
Simple query with instructions and alternatives on Berlin:
|
||||
|
||||
```
|
||||
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
@@ -86,4 +109,3 @@ When using the code in a (scientific) publication, please cite
|
||||
address = {New York, NY, USA},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
+13
-2
@@ -10,10 +10,10 @@ ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
||||
ECHO cmake^: && cmake --version
|
||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
||||
|
||||
cmake --version | findstr /C:"3.7.0" && GOTO CMAKE_OK
|
||||
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
|
||||
|
||||
:CMAKE_NOT_OK
|
||||
SET CMAKE_VERSION=3.7.0-rc2
|
||||
SET CMAKE_VERSION=3.7.1
|
||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
@@ -119,16 +119,27 @@ 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 ...
|
||||
unit_tests\%Configuration%\engine-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO running util-tests.exe ...
|
||||
unit_tests\%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
|
||||
|
||||
ECHO running library-tests.exe ...
|
||||
SET test_region=monaco
|
||||
SET test_osm=%test_region%.osm.pbf
|
||||
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
|
||||
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
||||
%Configuration%\osrm-contract.exe %test_region%.osrm
|
||||
unit_tests\%Configuration%\library-tests.exe %test_region%.osrm
|
||||
|
||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
||||
ECHO ========= CREATING PACKAGES ==========
|
||||
|
||||
|
||||
+11
-1
@@ -3,6 +3,9 @@ environment:
|
||||
- configuration: Release
|
||||
# - configuration: Debug
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 6
|
||||
|
||||
# scripts that are called at very beginning, before repo cloning
|
||||
init:
|
||||
- git config --global core.autocrlf input
|
||||
@@ -17,7 +20,14 @@ platform: x64
|
||||
build_script:
|
||||
- CALL appveyor-build.bat
|
||||
|
||||
test: off
|
||||
before_test:
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm install
|
||||
- npm link
|
||||
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
|
||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||
- npm test
|
||||
|
||||
artifacts:
|
||||
- path: osrm_Release.zip
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
|
||||
ENDIF()
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
|
||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
|
||||
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
||||
|
||||
SET(CPACK_STRIP_FILES "TRUE")
|
||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
|
||||
|
||||
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
||||
if(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
execute_process(
|
||||
COMMAND ${DPKG_PROGRAM} --print-architecture
|
||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
|
||||
else(DPKG_PROGRAM)
|
||||
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||
if(RPMBUILD_PROGRAM)
|
||||
SET(CPACK_GENERATOR "RPM")
|
||||
execute_process(
|
||||
COMMAND ${RPM_PROGRAM} --eval %{_arch}
|
||||
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
||||
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
|
||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
endif(RPMBUILD_PROGRAM)
|
||||
endif(DPKG_PROGRAM)
|
||||
@@ -1,41 +0,0 @@
|
||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(FindDebArch)
|
||||
|
||||
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
|
||||
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
|
||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
|
||||
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
|
||||
|
||||
# To create a proper Debian/Ubuntu package, the following CMake
|
||||
# options should be used:
|
||||
|
||||
SET(CPACK_STRIP_FILES "TRUE")
|
||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
|
||||
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
|
||||
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
|
||||
)
|
||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
|
||||
|
||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
|
||||
|
||||
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
|
||||
+7
-1
@@ -172,12 +172,18 @@ if (LUA_LIBRARY)
|
||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||
|
||||
# include dl library for statically-linked Lua library
|
||||
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
||||
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
||||
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else ()
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
# Locate Luabind library
|
||||
# This module defines
|
||||
# LUABIND_FOUND, if false, do not try to link to Luabind
|
||||
# LUABIND_LIBRARIES
|
||||
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
|
||||
|
||||
# First we try using EXACT but in some verison of
|
||||
# cmake this would also match patch versions
|
||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
# Now fall back to a lua verison without exact
|
||||
# in case this cmake version also forces patch versions
|
||||
FIND_PACKAGE(Lua 5.2)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES luabind include/luabind include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local # DarwinPorts
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY
|
||||
NAMES luabind luabind09
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY_DBG
|
||||
NAMES luabindd
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local
|
||||
/opt
|
||||
)
|
||||
|
||||
IF(LUABIND_LIBRARY)
|
||||
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
|
||||
ENDIF(LUABIND_LIBRARY)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
|
||||
|
||||
IF( NOT LUABIND_FIND_QUIETLY )
|
||||
IF( LUABIND_FOUND )
|
||||
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
|
||||
ENDIF()
|
||||
IF( LUABIND_LIBRARY_DBG )
|
||||
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
|
||||
@@ -0,0 +1,21 @@
|
||||
# - Try to find Shapefile C Library
|
||||
# http://shapelib.maptools.org/
|
||||
#
|
||||
# Exports:
|
||||
# Shapefile_FOUND
|
||||
# LIBSHAPEFILE_INCLUDE_DIR
|
||||
# LIBSHAPEFILE_LIBRARY
|
||||
# Hints:
|
||||
# LIBSHAPEFILE_LIBRARY_DIR
|
||||
|
||||
find_path(LIBSHAPEFILE_INCLUDE_DIR
|
||||
shapefil.h)
|
||||
|
||||
find_library(LIBSHAPEFILE_LIBRARY
|
||||
NAMES shp
|
||||
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Shapefile DEFAULT_MSG
|
||||
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
|
||||
@@ -1,24 +0,0 @@
|
||||
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
|
||||
set(NEWFILE ${OLDFILE}.tmp)
|
||||
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
|
||||
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
|
||||
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
|
||||
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
|
||||
file(MD5 ${SOURCE_DIR}/include/engine/datafacade/internal_datafacade.hpp MD5OBJECTS)
|
||||
|
||||
CONFIGURE_FILE(${INFILE} ${NEWFILE})
|
||||
|
||||
file(MD5 ${NEWFILE} MD5NEW)
|
||||
|
||||
if (EXISTS ${OLDFILE})
|
||||
file(MD5 ${OLDFILE} MD5OLD)
|
||||
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
|
||||
file(REMOVE_RECURSE ${OLDFILE})
|
||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||
else()
|
||||
file(REMOVE_RECURSE ${NEWFILE})
|
||||
message(STATUS "Fingerprint unchanged, not regenerating")
|
||||
endif()
|
||||
else()
|
||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||
endif()
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
includedir=${prefix}/include
|
||||
libdir=${prefix}/lib
|
||||
includedir=@PKGCONFIG_INCLUDE_DIR@
|
||||
libdir=@PKGCONFIG_LIBRARY_DIR@
|
||||
|
||||
Name: libOSRM
|
||||
Description: Project OSRM library
|
||||
Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
|
||||
Version: v@OSRM_VERSION@
|
||||
Requires:
|
||||
Libs: -L${libdir} -losrm
|
||||
Libs.private: @ENGINE_LIBRARY_LISTING@
|
||||
Cflags: -I${includedir} -I${includedir}/osrm @OSRM_INCLUDE_PATHS_STRING@ @OSRM_DEFINES_STRING@ @CMAKE_CXX_FLAGS@
|
||||
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
|
||||
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
|
||||
Cflags: @PKGCONFIG_OSRM_INCLUDE_FLAGS@ @PKGCONFIG_OSRM_CXXFLAGS@
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ FROM ubuntu:14.04
|
||||
|
||||
RUN apt-get update -y && apt-get install -y software-properties-common
|
||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libluabind-dev libboost-all-dev ccache
|
||||
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libboost-all-dev ccache
|
||||
RUN apt-get -y install curl cmake cmake-curses-gui git
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
@@ -20,6 +20,7 @@ A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we pro
|
||||
|
||||
The initialisation to do so looks like this:
|
||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
||||
Make sure to give the guar a name, so it actually gets a lifetime.
|
||||
|
||||
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
|
||||
|
||||
|
||||
+417
-316
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 694 KiB |
+13
-6
@@ -1,7 +1,11 @@
|
||||
## Introduction
|
||||
|
||||
OSRM can be used as a library (libosrm) via C++ instead of using it through the HTTP interface and `osrm-routed`. This allows for fine-tuning OSRM and has much less overhead. Here is a quick introduction into how to use `libosrm` in the upcoming v5 release.
|
||||
|
||||
Take a look at the example code that lives in the [example directory](https://github.com/Project-OSRM/osrm-backend/tree/master/example). Here is all you ever wanted to know about `libosrm`, that is a short description of what the types do and where to find documentation on it:
|
||||
|
||||
## Important interface objects
|
||||
|
||||
- [`EngineConfig`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/engine_config.hpp) - for initializing an OSRM instance we can configure certain properties and constraints. E.g. the storage config is the base path such as `france.osm.osrm` from which we derive and load `france.osm.osrm.*` auxiliary files. This also lets you set constraints such as the maximum number of locations allowed for specific services.
|
||||
|
||||
- [`OSRM`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/osrm/osrm.hpp) - this is the main Routing Machine type with functions such as `Route` and `Table`. You initialize it with a `EngineConfig`. It does all the heavy lifting for you. Each function takes its own parameters, e.g. the `Route` function takes `RouteParameters`, and a out-reference to a JSON result that gets filled. The return value is a `Status`, indicating error or success.
|
||||
@@ -16,11 +20,14 @@ Take a look at the example code that lives in the [example directory](https://gi
|
||||
|
||||
- [Parameters for other services](https://github.com/Project-OSRM/osrm-backend/tree/master/include/engine/api) - here are all other `*Parameters` you need for other Routing Machine services.
|
||||
|
||||
- [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html) (Boost documentation is great). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [[v5 server API|Server-API-v5,-current]].
|
||||
- [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [HTTP API](#http-api).
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------
|
||||
## Example
|
||||
|
||||
To summarize:
|
||||
- create an `OSRM` instance initialized with a `EngineConfig`
|
||||
- call the service function on the `OSRM` object providing service specific `*Parameters`
|
||||
- check the return code and use the JSON result
|
||||
See [the example folder](https://github.com/Project-OSRM/osrm-backend/tree/master/example) in the OSRM repository.
|
||||
|
||||
## Workflow
|
||||
|
||||
- Create an `OSRM` instance initialized with a `EngineConfig`
|
||||
- Call the service function on the `OSRM` object providing service specific `*Parameters`
|
||||
- Check the return code and use the JSON result
|
||||
|
||||
@@ -32,6 +32,7 @@ We may introduce forward-compatible changes: query parameters and response prope
|
||||
|
||||
- The `master` branch is for the bleeding edge development
|
||||
- We create and maintain release branches `x.y` to control the release flow
|
||||
- We create the release branch once we tagged the final version `x.y.0` version, RCs go on master
|
||||
- No minor or major version will be released without a code-equal release candidates
|
||||
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
|
||||
- Patch versions may be released without a release candidate
|
||||
@@ -44,6 +45,7 @@ We may introduce forward-compatible changes: query parameters and response prope
|
||||
3. Make sure `CHANGELOG.md` is up to date.
|
||||
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||
6. Use `npm run build-api-docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
||||
6. Push tags and commits: `git push; git push --tags`
|
||||
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
|
||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
## Environment Variables
|
||||
|
||||
### SIGNAL_PARENT_WHEN_READY
|
||||
|
||||
If the SIGNAL_PARENT_WHEN_READY environment variable is set osrm-routed will
|
||||
send the USR1 signal to its parent when it will be running and waiting for
|
||||
requests. This could be used to upgrade osrm-routed to a new binary on the fly
|
||||
without any service downtime - no incoming requests will be lost.
|
||||
|
||||
### DISABLE_ACCESS_LOGGING
|
||||
|
||||
If the DISABLE_ACCESS_LOGGING environment variable is set osrm-routed will
|
||||
**not** log any http requests to standard output. This can be useful in high
|
||||
traffic setup.
|
||||
@@ -0,0 +1,16 @@
|
||||
var fs = require('fs');
|
||||
|
||||
/**
|
||||
* This file exports the content of your website, as a bunch of concatenated
|
||||
* Markdown files. By doing this explicitly, you can control the order
|
||||
* of content without any level of abstraction.
|
||||
*
|
||||
* Using the brfs module, fs.readFileSync calls in this file are translated
|
||||
* into strings of those files' content before the file is delivered to a
|
||||
* browser: the content is read ahead-of-time and included in bundle.js.
|
||||
*/
|
||||
module.exports =
|
||||
'# HTTP API\n' +
|
||||
fs.readFileSync('./content/http.md', 'utf8') + '\n'+
|
||||
'# libosrm C++ API\n' +
|
||||
fs.readFileSync('./content/libosrm.md', 'utf8') + '\n';
|
||||
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<meta http-equiv='X-UA-Compatible' content='IE=11' />
|
||||
<title>OSRM API Documentation</title>
|
||||
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
|
||||
<link href='css/base.css' rel='stylesheet' />
|
||||
<link href='css/style.css' rel='stylesheet' />
|
||||
<link href='css/railscasts.css' rel='stylesheet' />
|
||||
</head>
|
||||
<body>
|
||||
<!--START--><div id='app'></div><!--STOP-->
|
||||
<script src='bundle.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,63 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Brand names, in order to decreasing length, for different
|
||||
* media queries.
|
||||
*/
|
||||
module.exports.brandNames = {
|
||||
desktop: 'OSRM API Documentation',
|
||||
tablet: 'OSRM API Docs',
|
||||
mobile: 'OSRM API'
|
||||
};
|
||||
|
||||
/**
|
||||
* Classes that define the top-left brand box.
|
||||
*/
|
||||
module.exports.brandClasses = 'fill-red';
|
||||
|
||||
|
||||
/**
|
||||
* Text for the link back to the linking website.
|
||||
*/
|
||||
module.exports.backLink = 'Back to project-osrm.org';
|
||||
|
||||
/**
|
||||
* Runs after highlighting code samples. You can use this
|
||||
* hook to, for instance, highlight a token and link it
|
||||
* to some canonical part of documentation.
|
||||
*/
|
||||
module.exports.postHighlight = function(html) {
|
||||
return html;
|
||||
};
|
||||
|
||||
/**
|
||||
* Highlight tokens in endpoint URLs, optionally linking to documentation
|
||||
* or adding detail. This is the equivalent of postHighlight but it
|
||||
* operates on endpoint URLs only.
|
||||
*/
|
||||
function highlightTokens(str) {
|
||||
return str.replace(/{[\w_]+}/g,
|
||||
(str) => '<span class="strong">' + str + '</span>');
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform endpoints given as strings in a highlighted block like
|
||||
*
|
||||
* ```endpoint
|
||||
* GET /foo/bar
|
||||
* ```
|
||||
*
|
||||
* Into HTML nodes that format those endpoints in nice ways.
|
||||
*/
|
||||
module.exports.transformURL = function(value) {
|
||||
let parts = value.split(/\s+/);
|
||||
return {
|
||||
type: 'html',
|
||||
value: `<div class='endpoint dark fill-dark round '>
|
||||
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>${parts[0]}</div>
|
||||
<div class='pad0 code small endpoint-url'>${highlightTokens(parts[1])}</div>
|
||||
</div>`
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.remarkPlugins = [];
|
||||
+102
-1
@@ -1,6 +1,6 @@
|
||||
# Testsuite
|
||||
|
||||
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucucmber.js for scenario driven testing.
|
||||
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing.
|
||||
|
||||
## Unit Tests
|
||||
|
||||
@@ -28,6 +28,29 @@ This dataset is a small extract and may not even contain all tags or edge cases.
|
||||
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
|
||||
See the library tests for how to add new dataset dependent tests.
|
||||
|
||||
To prepare the test data simply `cd test/data/` and then run `make`.
|
||||
|
||||
### Running Tests
|
||||
|
||||
To build the unit tests:
|
||||
|
||||
```
|
||||
cd build
|
||||
cmake ..
|
||||
make tests
|
||||
```
|
||||
|
||||
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
|
||||
|
||||
```
|
||||
./engine-tests
|
||||
```
|
||||
|
||||
For `library-tests` you will need to provide a path to the test data:
|
||||
|
||||
```
|
||||
./library-tests ../../test/data/monaco.osrm
|
||||
```
|
||||
|
||||
## Cucumber
|
||||
|
||||
@@ -309,3 +332,81 @@ And the relations
|
||||
```
|
||||
|
||||
Unless this format is used, OSRM will omit the (then ambiguous) turn restrictions and ignore them.
|
||||
|
||||
## My Guidance Tests are Failing - Understanding what you can change
|
||||
|
||||
If you change some stuff in guidance, you will easily see tests change their result. E.g. if you change the angles for which we report `right`, then obviously some tests might not report a `direction modifier` named `right` anymore.
|
||||
|
||||
This small section will try to guide you in making the correct decisions for changing the behaviour of tests.
|
||||
|
||||
The difficulty in guidance tests is that not all items can be translated 1:1 from the ascii art into turn-angles.
|
||||
|
||||
The turn-angle calculation tries to find turn angles that would represent perceived turn angles, not the exact angle at the connection.
|
||||
|
||||
This is necessary, since connections in OSM are always bound by the paradigm that the way is supposed to be in the middle of the actual road.
|
||||
For broad streets, you will see stronger angles than the actual turns.
|
||||
|
||||
### Don't change the test, change the expected behaviour
|
||||
|
||||
If we have a test that looks like this:
|
||||
|
||||
```
|
||||
Given a grid size of 5 m
|
||||
Given the node map
|
||||
"""
|
||||
a - b - - - - - - c
|
||||
\
|
||||
d - - - - - e
|
||||
"""
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abc,bde,bde | depart,turn slight right,arrive|
|
||||
```
|
||||
|
||||
And the test reports `turn right` for the route `a->e`, where before it said `slight right`.
|
||||
|
||||
If you changed the turn angles, obviously you can expect changes in the distinction between `slight right` and `right`.
|
||||
In such a case it is, of course, reasonable to change the expected route to report `right` instead of `slight right`. You should consider inspecting the actual turn angles at `b` to see if you feel that change is justified.
|
||||
|
||||
However, you should never adjust the test itself.
|
||||
If you look at a failure, the other way around
|
||||
|
||||
```
|
||||
Given a grid size of 5 m
|
||||
Given the node map
|
||||
"""
|
||||
a - b - - - - - - c
|
||||
\
|
||||
d - - - - - e
|
||||
"""
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abc,bde,bde | depart,turn right,arrive|
|
||||
```
|
||||
|
||||
where we see a `slight right`, over the expected `right`.
|
||||
We could be tempted to adjust the grid size (e.g. from `10 m` to `20` meters).
|
||||
|
||||
Such a change would fundamentally alter the tests, though.
|
||||
Since the part `b-d` is a short offset, when we are looking at a grid of size `5 m`, the angle calculation will try and compensate for this offset.
|
||||
|
||||
In this case we would see a very slight turn angle. If your change now reports different turn angles, you can of course change the expected result. But you should not adjust the grid size. The test would be testing turn angles of `180` and `100` degrees, instead of `180` and `160`.
|
||||
|
||||
### Consider Post-Processing Impacts
|
||||
|
||||
Some changes you might see could look completely unrelated. To understand the impact of your changes, you can make use of the debugging utilities you can finde in `util/debug.hpp` (and potentially other related headers).
|
||||
|
||||
If your test is inspecting a series of turns (remember, a turn not necessarily equals an instruction), you could see interaction with post-processing.
|
||||
To see the unprocessed turns, you should print the steps at the end of step assembly (`assembleSteps` in `engine/guidance/assemble_steps.hpp`).
|
||||
|
||||
If you see unexpected changes, you can consider adding the `locations` field to your test to study what location a turn is reported at.
|
||||
|
||||
To study a test without post-processing impacts, you can create a copy of the case on a very large grid (like 2000 meters). In such a grid, `turn collapsing` would be essentially disable.
|
||||
|
||||
Sadly, there is no general guideline.
|
||||
|
||||
### Use Caution
|
||||
|
||||
If in doubt, ask another person. Inspect as much of the data as possible (e.g. print un-collapsed steps, turn angles and so on) and use your best judgement, if the new result seems justified.
|
||||
|
||||
@@ -19,7 +19,7 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(bitness 64)
|
||||
message(STATUS "Building on a 64 bit system")
|
||||
else()
|
||||
message(WARNING "Building on a 32 bit system is unsupported")
|
||||
message(STATUS "Building on a 32 bit system")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
@@ -33,4 +33,4 @@ find_package(LibOSRM REQUIRED)
|
||||
|
||||
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
|
||||
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
|
||||
set(CMAKE_CXX_FLAGS ${LibOSRM_CXXFLAGS})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LibOSRM_CXXFLAGS}")
|
||||
|
||||
@@ -174,3 +174,26 @@ Feature: Bike - Access tags on ways
|
||||
| cycleway | | no | | x |
|
||||
| runway | | | yes | |
|
||||
| cycleway | | | no | x |
|
||||
|
||||
Scenario: Bike - Bridleways when access is explicit
|
||||
Then routability should be
|
||||
| highway | horse | foot | bicycle | bothw |
|
||||
| bridleway | | | yes | x |
|
||||
| bridleway | | yes | | x |
|
||||
| bridleway | designated | | | |
|
||||
| bridleway | | | | |
|
||||
|
||||
Scenario: Bike - Tram with oneway when access is implicit
|
||||
Then routability should be
|
||||
| highway | railway | access | oneway | bothw |
|
||||
| residential | tram | | yes | x |
|
||||
| service | tram | psv | yes | x |
|
||||
|
||||
Scenario: Bike - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | x |
|
||||
| steps | permissive | x |
|
||||
| footway | permissive | x |
|
||||
| garbagetag | permissive | x |
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ Feature: Bicycle - Handle cycling
|
||||
| efg | primary | | |
|
||||
|
||||
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 |
|
||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||
|
||||
@@ -64,6 +64,6 @@ Feature: Bike - Handle ferry routes
|
||||
| abcd | | ferry | yes | 1:00 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s +-10 |
|
||||
| d | a | abcd,abcd | 3600s +-10 |
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s |
|
||||
| d | a | abcd,abcd | 3600s |
|
||||
|
||||
@@ -7,15 +7,15 @@ Feature: Bike - Max speed restrictions
|
||||
|
||||
Scenario: Bicycle - Respect maxspeeds when lower that way type speed
|
||||
Then routability should be
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h +- 1 |
|
||||
| residential | 10 | 10 km/h +- 1 |
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h |
|
||||
| residential | 10 | 9 km/h |
|
||||
|
||||
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
||||
Then routability should be
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h +- 1 |
|
||||
| residential | 80 | 15 km/h |
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h |
|
||||
| residential | 80 | 15 km/h |
|
||||
|
||||
@todo
|
||||
Scenario: Bicycle - Maxspeed formats
|
||||
@@ -63,14 +63,14 @@ Feature: Bike - Max speed restrictions
|
||||
| snail | 720s ~10% |
|
||||
|
||||
Then routability should be
|
||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| | | | 15 km/h +- 1 | 15 km/h +- 1 |
|
||||
| 10 | | | 10 km/h +- 1 | 10 km/h +- 1 |
|
||||
| | 10 | | 10 km/h +- 1 | 15 km/h +- 1 |
|
||||
| | | 10 | 15 km/h | 10 km/h +- 1 |
|
||||
| 2 | 10 | | 10 km/h +- 1 | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 10 km/h +- 1 |
|
||||
| 2 | 5 | 10 | 5 km/h | 10 km/h +- 1 |
|
||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| | | | 15 km/h | 15 km/h |
|
||||
| 10 | | | 9 km/h | 9 km/h |
|
||||
| | 10 | | 9 km/h | 15 km/h |
|
||||
| | | 10 | 14 km/h | 9 km/h |
|
||||
| 2 | 10 | | 9 km/h | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 9 km/h |
|
||||
| 2 | 5 | 10 | 5 km/h | 9 km/h |
|
||||
|
||||
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
||||
Then routability should be
|
||||
|
||||
@@ -6,21 +6,22 @@ Feature: Bike - Surfaces
|
||||
|
||||
Scenario: Bicycle - Slow surfaces
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| cycleway | asphalt | 48 s |
|
||||
| cycleway | cobblestone:flattened | 72 s |
|
||||
| cycleway | paving_stones | 72 s |
|
||||
| cycleway | compacted | 72 s |
|
||||
| cycleway | cobblestone | 120 s |
|
||||
| cycleway | fine_gravel | 120 s |
|
||||
| cycleway | gravel | 120 s |
|
||||
| cycleway | pebblestone | 120 s |
|
||||
| cycleway | dirt | 120 s |
|
||||
| cycleway | earth | 120 s |
|
||||
| cycleway | grass | 120 s |
|
||||
| cycleway | mud | 240 s |
|
||||
| cycleway | sand | 240 s |
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| cycleway | asphalt | 48 s |
|
||||
| cycleway | cobblestone:flattened | 72 s |
|
||||
| cycleway | paving_stones | 72 s |
|
||||
| cycleway | compacted | 72 s |
|
||||
| cycleway | cobblestone | 120 s |
|
||||
| cycleway | fine_gravel | 120 s |
|
||||
| cycleway | gravel | 120 s |
|
||||
| cycleway | pebblestone | 120.1 s |
|
||||
| cycleway | dirt | 120 s |
|
||||
| cycleway | earth | 120 s |
|
||||
| cycleway | grass | 120 s |
|
||||
| cycleway | mud | 240 s |
|
||||
| cycleway | sand | 240.1 s |
|
||||
| cycleway | sett | 72 s |
|
||||
|
||||
Scenario: Bicycle - Good surfaces on small paths
|
||||
Then routability should be
|
||||
|
||||
+155
-41
@@ -30,6 +30,35 @@ Feature: Car - Restricted access
|
||||
| | | no | yes | x |
|
||||
| | | yes | no | |
|
||||
|
||||
Scenario: Car - Access tag hierarchy and forward/backward
|
||||
Then routability should be
|
||||
| access | access:forward | access:backward | motorcar | motorcar:forward | motorcar:backward | forw | backw |
|
||||
| | | | | | | x | x |
|
||||
| yes | | | | | | x | x |
|
||||
| yes | no | | | | | | x |
|
||||
| yes | yes | | no | | | | |
|
||||
| yes | yes | | yes | no | | | x |
|
||||
| yes | | | | | | x | x |
|
||||
| yes | | no | | | | x | |
|
||||
| yes | | yes | no | | | | |
|
||||
| yes | | yes | yes | | no | x | |
|
||||
| no | | | | | | | |
|
||||
| no | yes | | | | | x | |
|
||||
| no | no | | yes | | | x | x |
|
||||
| no | no | | no | yes | | x | |
|
||||
| no | | | | | | | |
|
||||
| no | | yes | | | | | x |
|
||||
| no | | no | yes | | | x | x |
|
||||
| no | | no | no | | yes | | x |
|
||||
| | no | | | no | | | x |
|
||||
| | | no | | | no | x | |
|
||||
| | no | | | | no | | |
|
||||
| | | no | no | | | | |
|
||||
| | no | | | yes | | x | x |
|
||||
| | | no | | | yes | x | x |
|
||||
| | yes | | | no | | | x |
|
||||
| | | yes | | | no | x | |
|
||||
|
||||
Scenario: Car - Access tag hierarchy on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
|
||||
@@ -90,12 +119,13 @@ Feature: Car - Restricted access
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | |
|
||||
| private | x |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | |
|
||||
| delivery | x |
|
||||
| some_tag | x |
|
||||
| destination | x |
|
||||
|
||||
|
||||
Scenario: Car - Access tags on nodes
|
||||
@@ -105,11 +135,11 @@ Feature: Car - Restricted access
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | |
|
||||
| private | x |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | |
|
||||
| delivery | x |
|
||||
| some_tag | x |
|
||||
|
||||
Scenario: Car - Access tags on both node and way
|
||||
@@ -127,15 +157,15 @@ Feature: Car - Restricted access
|
||||
|
||||
Scenario: Car - Access combinations
|
||||
Then routability should be
|
||||
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
|
||||
| runway | private | | | permissive | x |
|
||||
| primary | forestry | | yes | | x |
|
||||
| cycleway | | | designated | | x |
|
||||
| residential | | yes | no | | |
|
||||
| motorway | yes | permissive | | private | |
|
||||
| trunk | agricultural | designated | permissive | no | |
|
||||
| pedestrian | | | | | |
|
||||
| pedestrian | | | | destination | x |
|
||||
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
|
||||
| runway | private | | | permissive | x | x | |
|
||||
| primary | forestry | | yes | | x | x | |
|
||||
| cycleway | | | designated | | x | x | |
|
||||
| residential | | yes | no | | | | |
|
||||
| motorway | yes | permissive | | private | x | | implied oneway |
|
||||
| trunk | agricultural | designated | permissive | no | | | |
|
||||
| pedestrian | | | | | | | |
|
||||
| pedestrian | | | | destination | | | temporary disabled #3773 |
|
||||
|
||||
Scenario: Car - Ignore access tags for other modes
|
||||
Then routability should be
|
||||
@@ -149,33 +179,46 @@ Feature: Car - Restricted access
|
||||
| runway | | | | yes | |
|
||||
| primary | | | | no | x |
|
||||
|
||||
Scenario: Car - only designated HOV ways are ignored by default
|
||||
@hov
|
||||
Scenario: Car - designated HOV ways are rated low
|
||||
Then routability should be
|
||||
| highway | hov | bothw |
|
||||
| primary | designated | |
|
||||
| primary | yes | x |
|
||||
| primary | no | x |
|
||||
| highway | hov | bothw | forw_rate | backw_rate |
|
||||
| primary | designated | x | 18 | 18 |
|
||||
| primary | yes | x | 18 | 18 |
|
||||
| primary | no | x | 18 | 18 |
|
||||
|
||||
Scenario: Car - a way with all lanes HOV-designated is inaccessible by default (similar to hov=designated)
|
||||
# Models:
|
||||
# https://www.openstreetmap.org/way/124891268
|
||||
# https://www.openstreetmap.org/way/237173472
|
||||
@hov
|
||||
Scenario: Car - I-66 use HOV-only roads with heavy penalty
|
||||
Then routability should be
|
||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw |
|
||||
| primary | designated | designated | | | | |
|
||||
| primary | | designated | | | x | |
|
||||
| primary | designated | | | | | x |
|
||||
| primary | designated\|designated | designated\|designated | | | | |
|
||||
| primary | designated\|no | designated\|no | | | x | x |
|
||||
| primary | yes\|no | yes\|no | | | x | x |
|
||||
| primary | | | | | x | x |
|
||||
| primary | designated | | | -1 | | |
|
||||
| primary | | designated | | -1 | | x |
|
||||
| primary | | | designated | yes | | |
|
||||
| primary | | | designated | -1 | | |
|
||||
| primary | | | designated\| | yes | x | |
|
||||
| primary | | | designated\| | -1 | | x |
|
||||
| primary | | | designated\|designated | yes | | |
|
||||
| primary | | | designated\|designated | -1 | | |
|
||||
| primary | | | designated\|yes | yes | x | |
|
||||
| primary | | | designated\|no | -1 | | x |
|
||||
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
|
||||
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
|
||||
| motorway | lane | | 3 | designated | yes | x | | 25 |
|
||||
|
||||
@hov
|
||||
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
||||
Then routability should be
|
||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | designated | designated | | | x | x | 18 | 18 |
|
||||
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
||||
#| primary | | designated | | | x | x | 18 | 18 |
|
||||
#| primary | designated | | | | x | x | 18 | 18 |
|
||||
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
|
||||
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
|
||||
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
|
||||
| primary | | | | | x | x | 18 | 18 |
|
||||
| primary | designated | | | -1 | | x | | 18 |
|
||||
| primary | | designated | | -1 | | x | | 18 |
|
||||
| primary | | | designated | yes | x | | 18 | |
|
||||
| primary | | | designated | -1 | | x | | 18 |
|
||||
| primary | | | designated\| | yes | x | | 18 | |
|
||||
| primary | | | designated\| | -1 | | x | | 18 |
|
||||
| primary | | | designated\|designated | yes | x | | 18 | |
|
||||
| primary | | | designated\|designated | -1 | | x | | 18 |
|
||||
| primary | | | designated\|yes | yes | x | | 18 | |
|
||||
| primary | | | designated\|no | -1 | | x | | 18 |
|
||||
|
||||
Scenario: Car - these toll roads always work
|
||||
Then routability should be
|
||||
@@ -183,9 +226,80 @@ Feature: Car - Restricted access
|
||||
| primary | no | x |
|
||||
| primary | snowmobile | x |
|
||||
|
||||
# To test this we need issue #2781
|
||||
@todo
|
||||
Scenario: Car - only toll=yes ways are ignored by default
|
||||
Scenario: Car - toll=yes ways are enabled by default
|
||||
Then routability should be
|
||||
| highway | toll | bothw |
|
||||
| primary | yes | |
|
||||
| primary | yes | x |
|
||||
|
||||
Scenario: Car - directional access tags
|
||||
Then routability should be
|
||||
| highway | access | access:forward | access:backward | forw | backw |
|
||||
| primary | yes | yes | yes | x | x |
|
||||
| primary | yes | | no | x | |
|
||||
| primary | yes | no | | | x |
|
||||
| primary | yes | no | no | | |
|
||||
| primary | no | no | no | | |
|
||||
| primary | no | | yes | | x |
|
||||
| primary | no | yes | | x | |
|
||||
| primary | no | yes | yes | x | x |
|
||||
|
||||
|
||||
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
|
||||
Then routability should be
|
||||
| node/barrier | access | bothw |
|
||||
| gate | | x |
|
||||
| gate | no | |
|
||||
| gate | yes | x |
|
||||
| gate | permissive | x |
|
||||
| gate | designated | x |
|
||||
| gate | private | x |
|
||||
| gate | garbagetag | x |
|
||||
|
||||
Scenario: Car - a way with conditional access
|
||||
Then routability should be
|
||||
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
|
||||
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
|
||||
|
||||
Scenario: Car - a way with a list of tags
|
||||
Then routability should be
|
||||
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw | # |
|
||||
| primary | | no | destination | | x | |
|
||||
| primary | destination;agricultural | destination | | x | x | |
|
||||
| footway | | | destination | | | temporary #3373 |
|
||||
| track | destination;agricultural | destination | | | x | temporary #3373 |
|
||||
|
||||
Scenario: Car - Don't route over steps even if marked as accessible
|
||||
Then routability should be
|
||||
| highway | access | forw | backw |
|
||||
| steps | yes | | |
|
||||
| steps | no | | |
|
||||
| primary | | x | x |
|
||||
|
||||
Scenario: Car - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | x |
|
||||
| steps | permissive | |
|
||||
| footway | permissive | x |
|
||||
| garbagetag | permissive | x |
|
||||
|
||||
Scenario: Car - Access private blacklist
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| footway | yes | x |
|
||||
| pedestrian | private | |
|
||||
| footway | private | |
|
||||
| service | private | |
|
||||
| cycleway | private | |
|
||||
| track | private | |
|
||||
|
||||
Scenario: Car - Access blacklist
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | | x |
|
||||
| primary | customer | |
|
||||
| primary | emergency | |
|
||||
| primary | forestry | |
|
||||
| primary | agricultural | |
|
||||
| primary | psv | |
|
||||
| primary | no | |
|
||||
|
||||
@@ -29,14 +29,14 @@ Feature: Car - Barriers
|
||||
| gate | permissive | x |
|
||||
| gate | designated | x |
|
||||
| gate | no | |
|
||||
| gate | private | |
|
||||
| gate | private | x |
|
||||
| gate | agricultural | |
|
||||
| wall | | |
|
||||
| wall | yes | x |
|
||||
| wall | permissive | x |
|
||||
| wall | designated | x |
|
||||
| wall | no | |
|
||||
| wall | private | |
|
||||
| wall | private | x |
|
||||
| wall | agricultural | |
|
||||
|
||||
Scenario: Car - Rising bollard exception for barriers
|
||||
|
||||
@@ -29,6 +29,27 @@ Feature: Car - Handle driving
|
||||
| c | f | cde,efg,efg | driving,driving,driving |
|
||||
| c | g | cde,efg,efg | driving,driving,driving |
|
||||
|
||||
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | bridge |
|
||||
| abc | primary | |
|
||||
| cde | | movable |
|
||||
| efg | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
|
||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
|
||||
| c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
|
||||
| e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
|
||||
|
||||
Scenario: Car - Properly handle durations
|
||||
Given the node map
|
||||
"""
|
||||
@@ -45,7 +66,7 @@ Feature: Car - Handle driving
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 6 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 4 km/h |
|
||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 7 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 5 km/h |
|
||||
| c | e | cde,cde | driving,driving | 2 km/h |
|
||||
| e | c | cde,cde | driving,driving | 2 km/h |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@routing @car @destination @todo
|
||||
@routing @car @destination
|
||||
Feature: Car - Destination only, no passing through
|
||||
|
||||
Background:
|
||||
@@ -81,3 +81,53 @@ Feature: Car - Destination only, no passing through
|
||||
| e | a | de,cd,bc,ab,ab |
|
||||
| b | d | bc,cd,cd |
|
||||
| d | b | cd,bc,bc |
|
||||
|
||||
Scenario: Car - Routing around a way that becomes destination only
|
||||
Given the node map
|
||||
"""
|
||||
b
|
||||
\
|
||||
|
|
||||
e++d++++++c--i
|
||||
| \
|
||||
\ h--a
|
||||
\ |
|
||||
\___________g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | access | oneway |
|
||||
| ah | | no |
|
||||
| ihg | | no |
|
||||
| eg | | no |
|
||||
| icde | | no |
|
||||
| cde | destination | no |
|
||||
| eb | | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | # |
|
||||
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
|
||||
| b | d | eb,cde,cde | # ends in restricted way correctly |
|
||||
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
|
||||
|
||||
Scenario: Car - Routing around a way that becomes destination only
|
||||
Given the node map
|
||||
"""
|
||||
a---c---b
|
||||
+ \
|
||||
+ |
|
||||
d |
|
||||
\___e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | access | oneway |
|
||||
| acbe | | no |
|
||||
| cd | destination | no |
|
||||
| de | | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| e | a | acbe,acbe |
|
||||
| d | a | de,acbe,acbe |
|
||||
| c | d | cd,cd |
|
||||
|
||||
+31
-10
@@ -29,6 +29,27 @@ Feature: Car - Handle ferry routes
|
||||
| c | f | cde,efg,efg | ferry,driving,driving |
|
||||
| c | g | cde,efg,efg | ferry,driving,driving |
|
||||
|
||||
|
||||
Scenario: Car - Use default speeds to calculate duration if no duration given
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route |
|
||||
| abc | primary | |
|
||||
| cde | | ferry |
|
||||
| efg | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.4s |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
|
||||
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
||||
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
||||
Scenario: Car - Properly handle simple durations
|
||||
Given the node map
|
||||
"""
|
||||
@@ -44,11 +65,11 @@ Feature: Car - Handle ferry routes
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
|
||||
Scenario: Car - Properly handle ISO 8601 durations
|
||||
Given the node map
|
||||
@@ -65,8 +86,8 @@ Feature: Car - Handle ferry routes
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
@routing @car @hov
|
||||
Feature: Car - Handle driving
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
And a grid size of 100 meters
|
||||
|
||||
Scenario: Car - Avoid hov when not on hov
|
||||
Given the node map
|
||||
"""
|
||||
b=========c========================e====j
|
||||
~ ~ ~
|
||||
a ~ f----m
|
||||
| i |
|
||||
| | ----------------l
|
||||
| | /
|
||||
g_______________h______k_____n
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | hov |
|
||||
| ab | motorway_link | |
|
||||
| bcej | motorway | designated |
|
||||
| ag | primary | |
|
||||
| ghkn | primary | |
|
||||
| ih | primary | |
|
||||
| kl | secondary | |
|
||||
| lf | secondary | |
|
||||
| ci | motorway_link | |
|
||||
| ef | motorway_link | |
|
||||
| fm | secondary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | m | ag,ghkn,kl,lf,fm,fm |
|
||||
| c | m | bcej,ef,fm,fm |
|
||||
@@ -6,7 +6,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
Given the profile "car"
|
||||
Given a grid size of 1000 meters
|
||||
|
||||
Scenario: Car - Respect maxspeeds when lower that way type speed
|
||||
Scenario: Car - Respect maxspeeds when lower than way type speed
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e f g
|
||||
@@ -23,7 +23,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 68 km/h |
|
||||
| a | b | ab,ab | 85 km/h |
|
||||
| b | c | bc,bc | 48 km/h |
|
||||
| c | d | cd,cd | 40 km/h |
|
||||
| d | e | de,de | 64 km/h |
|
||||
@@ -37,26 +37,30 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed |
|
||||
| ab | residential | |
|
||||
| bc | residential | 90 |
|
||||
| cd | living_street | FR:urban |
|
||||
| nodes | highway | maxspeed | # |
|
||||
| ab | residential | | default residential speed is 25 |
|
||||
| bc | residential | 90 | |
|
||||
| cd | living_street | FR:urban | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 20 km/h |
|
||||
| a | b | ab,ab | 25 km/h |
|
||||
# default residential speed is 25, don't mess with this
|
||||
| b | c | bc,bc | 72 km/h |
|
||||
# parsed maxspeeds are scaled by profile's speed_reduction value
|
||||
| c | d | cd,cd | 40 km/h |
|
||||
# symbolic posted speeds without explicit exceptions are parsed
|
||||
# from the profile's maxspeed_table_default table
|
||||
|
||||
Scenario: Car - Forward/backward maxspeed
|
||||
Scenario: Car - Forward/backward maxspeed are scaled by profile's speed_reduction if explicitly set
|
||||
Given a grid size of 100 meters
|
||||
|
||||
Then routability should be
|
||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| primary | | | | 52 km/h | 52 km/h |
|
||||
| primary | | | | 65 km/h | 65 km/h |
|
||||
| primary | 60 | | | 48 km/h | 48 km/h |
|
||||
| primary | | 60 | | 48 km/h | 48 km/h +- 5 |
|
||||
| primary | | | 60 | 52 km/h | 52 km/h +- 5 |
|
||||
| primary | | 60 | | 48 km/h | 65 km/h |
|
||||
| primary | | | 60 | 65 km/h | 48 km/h |
|
||||
| primary | 15 | 60 | | 48 km/h | 12 km/h |
|
||||
| primary | 15 | | 60 | 12 km/h | 48 km/h |
|
||||
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
|
||||
@@ -81,45 +85,55 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
Scenario: Car - Too narrow streets should be ignored or incur a penalty
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| primary | | | | | 52 km/h | 52 km/h |
|
||||
| primary | | 3 | | | 32 km/h | 32 km/h |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 3 | | | 29 km/h | 29 km/h |
|
||||
| primary | | | 60 | | 47 km/h | 52 km/h |
|
||||
| primary | | 3 | 60 | | 29 km/h | 32 km/h |
|
||||
| primary | | | | 60 | 52 km/h | 47 km/h |
|
||||
| primary | | 3 | | 60 | 32 km/h | 29 km/h |
|
||||
| primary | 15 | | 60 | | 47 km/h | 12 km/h |
|
||||
| primary | 15 | 3 | 60 | | 29 km/h | 7 km/h |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
||||
| primary | 15 | 3 | | 60 | 7 km/h | 29 km/h |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
||||
| primary | 15 | 3 | 30 | 60 | 14 km/h | 29 km/h |
|
||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
||||
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 |
|
||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
||||
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
||||
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
||||
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
||||
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
||||
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
||||
|
||||
Scenario: Car - Single lane streets be ignored or incur a penalty
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| primary | | | | | 52 km/h | 52 km/h |
|
||||
| primary | | 1 | | | 32 km/h | 32 km/h |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 1 | | | 29 km/h | 29 km/h |
|
||||
| primary | | | 60 | | 47 km/h | 52 km/h |
|
||||
| primary | | 1 | 60 | | 29 km/h | 32 km/h |
|
||||
| primary | | | | 60 | 52 km/h | 47 km/h |
|
||||
| primary | | 1 | | 60 | 32 km/h | 29 km/h |
|
||||
| primary | 15 | | 60 | | 47 km/h | 12 km/h |
|
||||
| primary | 15 | 1 | 60 | | 29 km/h | 7 km/h |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
||||
| primary | 15 | 1 | | 60 | 7 km/h | 29 km/h |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
||||
| primary | 15 | 1 | 30 | 60 | 14 km/h | 29 km/h |
|
||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
||||
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 |
|
||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
||||
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
||||
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
||||
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
||||
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
||||
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
||||
|
||||
Scenario: Car - Single lane streets only incure a penalty for two-way streets
|
||||
Scenario: Car - Single lane streets only incur a penalty for two-way streets
|
||||
Then routability should be
|
||||
| highway | maxspeed | lanes | oneway | forw | backw |
|
||||
| primary | 30 | 1 | yes | 23 km/h | |
|
||||
| primary | 30 | 1 | -1 | | 23 km/h |
|
||||
| primary | 30 | 1 | | 15 km/h | 15 km/h |
|
||||
| primary | 30 | 2 | | 23 km/h | 23 km/h |
|
||||
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | 30 | 1 | yes | 23 km/h | | 7 | |
|
||||
| primary | 30 | 1 | -1 | | 23 km/h | | 7 |
|
||||
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 |
|
||||
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 |
|
||||
|
||||
Scenario: Car - Forward/backward maxspeed on reverse oneways
|
||||
Then routability should be
|
||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | -1 | | 64 km/h | | 18 |
|
||||
| primary | 30 | | | -1 | | 23 km/h | | 7 |
|
||||
| primary | | 30 | | -1 | | 64 km/h | | 18 |
|
||||
| primary | | | 30 | -1 | | 23 km/h | | 7 |
|
||||
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
|
||||
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
|
||||
|
||||
+13
-13
@@ -78,24 +78,24 @@ Feature: Car - Street names in instructions
|
||||
Scenario: Inner city expressway with on road
|
||||
Given the node map
|
||||
"""
|
||||
a b c g
|
||||
f
|
||||
|
||||
|
||||
|
||||
a b . . . c g
|
||||
`f .
|
||||
`
|
||||
.
|
||||
.
|
||||
d
|
||||
|
||||
|
||||
|
||||
.
|
||||
.
|
||||
.
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | name:pronunciation |
|
||||
| abc | primary | road | roooaad |
|
||||
| cg | primary | road | roooaad |
|
||||
| bfd | trunk_link | | |
|
||||
| cde | trunk | trunk | truank |
|
||||
| nodes | highway | name | name:pronunciation | oneway |
|
||||
| abc | primary | road | roooaad | |
|
||||
| cg | primary | road | roooaad | |
|
||||
| bfd | trunk_link | sliproad | | yes |
|
||||
| cde | trunk | trunk | truank | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
|
||||
@@ -15,6 +15,22 @@ Feature: Car - Oneway streets
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | -1 | | x |
|
||||
|
||||
Scenario: Car - Mode specific oneway
|
||||
Then routability should be
|
||||
| highway | oneway:motorcar | oneway:motor_vehicle | oneway:vehicle | oneway | forw | backw |
|
||||
| primary | | | | | x | x |
|
||||
| primary | yes | | | | x | |
|
||||
| primary | | yes | | | x | |
|
||||
| primary | | | yes | | x | |
|
||||
| primary | | | | yes | x | |
|
||||
| primary | yes | no | | | x | |
|
||||
| primary | | yes | no | | x | |
|
||||
| primary | | | yes | no | x | |
|
||||
| primary | | | | yes | x | |
|
||||
| primary | no | yes | | | x | x |
|
||||
| primary | | no | yes | | x | x |
|
||||
| primary | | | no | yes | x | x |
|
||||
|
||||
Scenario: Car - Implied oneways
|
||||
Then routability should be
|
||||
| highway | junction | forw | backw | # |
|
||||
|
||||
@@ -4,11 +4,11 @@ Feature: Car - Surfaces
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Surface should reduce speed
|
||||
Scenario: Car - Ways tagged service should reduce speed
|
||||
Then routability should be
|
||||
| highway | service | forw | backw |
|
||||
| service | alley | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| service | emergency_access | | |
|
||||
| service | driveway | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| service | drive-through | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| service | parking | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| highway | service | forw | backw | forw_rate |
|
||||
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
| service | emergency_access | | | |
|
||||
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
|
||||
@@ -9,13 +9,10 @@ Feature: Testbot - side bias
|
||||
"""
|
||||
|
||||
Scenario: Left hand bias
|
||||
Given the profile file "testbot" extended with
|
||||
Given the profile file "car" extended with
|
||||
"""
|
||||
properties.left_hand_driving = true
|
||||
function turn_function (angle)
|
||||
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
|
||||
return (angle >= 0) and k * 1.2 or k / 1.2
|
||||
end
|
||||
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
||||
"""
|
||||
Given the node map
|
||||
"""
|
||||
@@ -31,17 +28,14 @@ Feature: Testbot - side bias
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| d | a | bd,ab,ab | 82s +-1 |
|
||||
| d | c | bd,bc,bc | 100s +-1 |
|
||||
| d | a | bd,ab,ab | 24s +-1 |
|
||||
| d | c | bd,bc,bc | 27s +-1 |
|
||||
|
||||
Scenario: Right hand bias
|
||||
Given the profile file "testbot" extended with
|
||||
Given the profile file "car" extended with
|
||||
"""
|
||||
properties.left_hand_driving = false
|
||||
function turn_function (angle)
|
||||
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
|
||||
return (angle >= 0) and k / 1.2 or k * 1.2
|
||||
end
|
||||
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
@@ -57,8 +51,9 @@ Feature: Testbot - side bias
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| d | a | bd,ab,ab | 100s +-1 |
|
||||
| d | c | bd,bc,bc | 82s +-1 |
|
||||
| d | a | bd,ab,ab | 27s +-1 |
|
||||
# should be inverse of left hand bias
|
||||
| d | c | bd,bc,bc | 24s +-1 |
|
||||
|
||||
Scenario: Roundabout exit counting for left sided driving
|
||||
And a grid size of 10 meters
|
||||
@@ -83,28 +78,3 @@ Feature: Testbot - side bias
|
||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
|
||||
|
||||
Scenario: Mixed Entry and Exit
|
||||
And a grid size of 10 meters
|
||||
And the node map
|
||||
"""
|
||||
c a
|
||||
j b f
|
||||
k e
|
||||
l h d
|
||||
g i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| cba | | yes |
|
||||
| fed | | yes |
|
||||
| ihg | | yes |
|
||||
| lkj | | yes |
|
||||
| behkb | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| c,a | cba,cba,cba | depart,roundabout-exit-1,arrive |
|
||||
| l,a | lkj,cba,cba | depart,roundabout-exit-2,arrive |
|
||||
| i,a | ihg,cba,cba | depart,roundabout-exit-3,arrive |
|
||||
+40
-24
@@ -5,33 +5,49 @@ Feature: Car - speeds
|
||||
Given the profile "car"
|
||||
And a grid size of 1000 meters
|
||||
|
||||
# should more or less match default speeds in car profile, but may be different due to rounding errors
|
||||
Scenario: Car - speed of various way types
|
||||
Then routability should be
|
||||
| highway | oneway | bothw |
|
||||
| motorway | no | 71 km/h |
|
||||
| motorway_link | no | 36 km/h |
|
||||
| trunk | no | 68 km/h |
|
||||
| trunk_link | no | 31 km/h |
|
||||
| primary | no | 52 km/h |
|
||||
| primary_link | no | 23 km/h |
|
||||
| secondary | no | 44 km/h |
|
||||
| secondary_link | no | 19 km/h |
|
||||
| tertiary | no | 31 km/h |
|
||||
| tertiary_link | no | 16 km/h |
|
||||
| unclassified | no | 19 km/h |
|
||||
| residential | no | 19 km/h |
|
||||
| living_street | no | 8 km/h |
|
||||
| service | no | 11 km/h |
|
||||
| motorway | no | 89 km/h |
|
||||
| motorway_link | no | 44 km/h |
|
||||
| trunk | no | 85 km/h |
|
||||
| trunk_link | no | 39 km/h |
|
||||
| primary | no | 64 km/h |
|
||||
| primary_link | no | 29 km/h |
|
||||
| secondary | no | 55 km/h |
|
||||
| secondary_link | no | 24 km/h |
|
||||
| tertiary | no | 39 km/h |
|
||||
| tertiary_link | no | 20 km/h |
|
||||
| unclassified | no | 24 km/h |
|
||||
| residential | no | 24 km/h |
|
||||
| living_street | no | 9 km/h |
|
||||
| service | no | 15 km/h |
|
||||
|
||||
# Alternating oneways have to take average waiting time into account.
|
||||
# Alternating oneways scale rates but not speeds
|
||||
Scenario: Car - scaled speeds for oneway=alternating
|
||||
Then routability should be
|
||||
| highway | oneway | junction | forw | backw | # |
|
||||
| tertiary | | | 31 km/h | 31 km/h | |
|
||||
| tertiary | alternating | | 12 km/h +- 1 | 12 km/h +- 1 | |
|
||||
| motorway | | | 71 km/h | | implied oneway |
|
||||
| motorway | alternating | | 28 km/h +- 1 | | implied oneway |
|
||||
| motorway | reversible | | | | unroutable |
|
||||
| primary | | roundabout | 52 km/h | | implied oneway |
|
||||
| primary | alternating | roundabout | 20 km/h +- 1 | | implied oneway |
|
||||
| primary | reversible | roundabout | | | unroutable |
|
||||
| highway | oneway | junction | forw | backw | # |
|
||||
| tertiary | | | 39 km/h | 39 km/h | |
|
||||
| tertiary | alternating | | 39 km/h | 39 km/h | |
|
||||
| motorway | | | 89 km/h | | implied oneway |
|
||||
| motorway | alternating | | 89 km/h | | implied oneway |
|
||||
| motorway | reversible | | | | unroutable |
|
||||
| primary | | roundabout | 64 km/h | | implied oneway |
|
||||
| primary | alternating | roundabout | 64 km/h | | implied oneway |
|
||||
| primary | reversible | roundabout | | | unroutable |
|
||||
|
||||
Scenario: Car - Check roundoff errors
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | forw | backw |
|
||||
| primary | | 64 km/h | 64 km/h |
|
||||
| primary | 60 | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 47 km/h | 47 km/h |
|
||||
|
||||
Scenario: Car - Side road penalties
|
||||
Then routability should be
|
||||
|
||||
| highway | side_road | forw | backw | forw_rate | backw_rate |
|
||||
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
|
||||
|
||||
@@ -27,7 +27,10 @@ Feature: Basic Routing
|
||||
When I route I should get
|
||||
| waypoints | route | summary |
|
||||
| a,e | road,,1 st,1 st | road, 1 st |
|
||||
| a,d,f | road,,,street,street | road;street |
|
||||
# The via node `d` belongs to `cd`, `de`, `df`, `dg` and depending on the edge
|
||||
# summary can be "road;street", "road, 1 st;1 st, street", "road, blvd;blvd, street"
|
||||
# The test must be fixed by #2287
|
||||
#| a,d,f | road,,,street,street | road;street |
|
||||
| a,e,f | road,,1 st,1 st,1 st,street,street | road, 1 st;1 st, street |
|
||||
|
||||
Scenario: Name Empty
|
||||
|
||||
@@ -40,13 +40,13 @@ Feature: Car - Surfaces
|
||||
| highway | access | tracktype | smoothness | surface | forw | backw |
|
||||
| motorway | | | | | x | |
|
||||
| motorway | no | grade1 | excellent | asphalt | | |
|
||||
| motorway | private | grade1 | excellent | asphalt | | |
|
||||
| motorway | private | grade1 | excellent | asphalt | x | |
|
||||
| motorway | agricultural | grade1 | excellent | asphalt | | |
|
||||
| motorway | forestry | grade1 | excellent | asphalt | | |
|
||||
| motorway | emergency | grade1 | excellent | asphalt | | |
|
||||
| primary | | | | | x | x |
|
||||
| primary | private | grade1 | excellent | asphalt | x | x |
|
||||
| primary | no | grade1 | excellent | asphalt | | |
|
||||
| primary | private | grade1 | excellent | asphalt | | |
|
||||
| primary | agricultural | grade1 | excellent | asphalt | | |
|
||||
| primary | forestry | grade1 | excellent | asphalt | | |
|
||||
| primary | emergency | grade1 | excellent | asphalt | | |
|
||||
@@ -64,64 +64,65 @@ Feature: Car - Surfaces
|
||||
Scenario: Car - Surface should reduce speed
|
||||
Then routability should be
|
||||
| highway | oneway | surface | forw | backw |
|
||||
| motorway | no | | 72 km/h | 72 km/h |
|
||||
| motorway | no | asphalt | 72 km/h | 72 km/h +-1 |
|
||||
| motorway | no | concrete | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | concrete:plates | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | concrete:lanes | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | paved | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | cement | 64 km/h +-1 | 64 km/h +-1 |
|
||||
| motorway | no | compacted | 64 km/h +-1 | 64 km/h +-1 |
|
||||
| motorway | no | fine_gravel | 64 km/h +-1 | 64 km/h +-1 |
|
||||
| motorway | no | paving_stones | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | metal | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | bricks | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | grass | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | wood | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | sett | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | grass_paver | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | gravel | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | unpaved | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | ground | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | dirt | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | pebblestone | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | tartan | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | cobblestone | 24 km/h +-1 | 24 km/h +-1 |
|
||||
| motorway | no | clay | 24 km/h +-1 | 24 km/h +-1 |
|
||||
| motorway | no | earth | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | stone | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | rocky | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | sand | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | | 90 km/h | 90 km/h |
|
||||
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 |
|
||||
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | paved | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | cement | 80 km/h +-1 | 80 km/h +-1 |
|
||||
| motorway | no | compacted | 80 km/h +-1 | 80 km/h +-1 |
|
||||
| motorway | no | fine_gravel | 80 km/h +-1 | 80 km/h +-1 |
|
||||
| motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | grass | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | wood | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | sett | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | grass_paver | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | gravel | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | unpaved | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | ground | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | dirt | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | pebblestone | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | tartan | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | cobblestone | 30 km/h +-1 | 30 km/h +-1 |
|
||||
| motorway | no | clay | 30 km/h +-1 | 30 km/h +-1 |
|
||||
| motorway | no | earth | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | stone | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
|
||||
|
||||
Scenario: Car - Tracktypes should reduce speed
|
||||
Then routability should be
|
||||
| highway | oneway | tracktype | forw | backw |
|
||||
| motorway | no | | 72 km/h | 72 km/h |
|
||||
| motorway | no | grade1 | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | grade2 | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | grade3 | 24 km/h +-1 | 24 km/h +-1 |
|
||||
| motorway | no | grade4 | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | grade5 | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | | 90 km/h | 90 km/h |
|
||||
| motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | grade2 | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | grade3 | 30 km/h +-1 | 30 km/h +-1 |
|
||||
| motorway | no | grade4 | 25 km/h +-1 | 25 km/h +-1 |
|
||||
| motorway | no | grade5 | 20 km/h +-1 | 20 km/h +-1 |
|
||||
|
||||
Scenario: Car - Smoothness should reduce speed
|
||||
Then routability should be
|
||||
| highway | oneway | smoothness | forw | backw |
|
||||
| motorway | no | | 72 km/h | 72 km/h |
|
||||
| motorway | no | intermediate | 64 km/h | 64 km/h |
|
||||
| motorway | no | bad | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | very_bad | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | horrible | 8 km/h +-1 | 8 km/h +-1 |
|
||||
| motorway | no | very_horrible | 4 km/h +-1 | 4 km/h +-1 |
|
||||
| motorway | no | | 90 km/h | 90 km/h |
|
||||
| motorway | no | intermediate | 80 km/h | 80 km/h |
|
||||
| motorway | no | bad | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | very_bad | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | horrible | 10 km/h +-1 | 10 km/h +-1 |
|
||||
| motorway | no | very_horrible | 5 km/h +-1 | 5 km/h +-1 |
|
||||
|
||||
Scenario: Car - Combination of surface tags should use lowest speed
|
||||
Then routability should be
|
||||
| highway | oneway | tracktype | surface | smoothness | backw | forw |
|
||||
| motorway | no | | | | 72 km/h | 72 km/h |
|
||||
| service | no | grade1 | asphalt | excellent | 12 km/h | 12 km/h |
|
||||
| motorway | no | grade5 | asphalt | excellent | 16 km/h | 16 km/h |
|
||||
| motorway | no | grade1 | mud | excellent | 8 km/h | 8 km/h |
|
||||
| motorway | no | grade1 | asphalt | very_horrible | 4 km/h | 4 km/h |
|
||||
| service | no | grade5 | mud | very_horrible | 4 km/h | 4 km/h |
|
||||
| highway | oneway | tracktype | surface | smoothness | bothw |
|
||||
| motorway | no | | | | 90 km/h |
|
||||
| service | no | grade1 | asphalt | excellent | 15 km/h |
|
||||
| motorway | no | grade5 | asphalt | excellent | 20 km/h |
|
||||
| motorway | no | grade1 | mud | excellent | 10 km/h |
|
||||
| motorway | no | grade1 | asphalt | very_horrible | 5 km/h |
|
||||
| service | no | grade5 | mud | very_horrible | 5 km/h |
|
||||
|
||||
Scenario: Car - Surfaces should not affect oneway direction
|
||||
Then routability should be
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
@routing @speed @traffic
|
||||
Feature: Traffic - speeds
|
||||
|
||||
Background: Use specific speeds
|
||||
|
||||
Scenario: Weighting based on speed file
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | 0.05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | 0.05 | 0.03 |
|
||||
| e | 0.05 | 0.066 |
|
||||
| f | 0.075 | 0.066 |
|
||||
| g | 0.075 | 0.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,0
|
||||
2,1,0
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,27
|
||||
4,1,27
|
||||
"""
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ad,de,eb,eb | 30 km/h |
|
||||
| a | c | ad,dc,dc | 31 km/h |
|
||||
| b | c | bc,bc | 27 km/h |
|
||||
| a | d | ad,ad | 27 km/h |
|
||||
| d | c | dc,dc | 36 km/h |
|
||||
| g | b | fb,fb | 36 km/h |
|
||||
| a | g | ad,df,fb,fb | 30 km/h |
|
||||
|
||||
|
||||
Scenario: Speeds that isolate a single node (a)
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | 0.05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | 0.05 | 0.03 |
|
||||
| e | 0.05 | 0.066 |
|
||||
| f | 0.075 | 0.066 |
|
||||
| g | 0.075 | 0.1 |
|
||||
| h | 2.075 | 19.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,0
|
||||
2,1,0
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,0
|
||||
4,1,0
|
||||
"""
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | fb,fb | 36 km/h |
|
||||
| a | c | fb,bc,bc | 30 km/h |
|
||||
| b | c | bc,bc | 27 km/h |
|
||||
| a | d | fb,df,df | 36 km/h |
|
||||
| d | c | dc,dc | 36 km/h |
|
||||
| g | b | fb,fb | 36 km/h |
|
||||
| a | g | fb,fb | 36 km/h |
|
||||
|
||||
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | 0.05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | 0.05 | 0.03 |
|
||||
| e | 0.05 | 0.066 |
|
||||
| f | 0.075 | 0.066 |
|
||||
| g | 0.075 | 0.1 |
|
||||
| h | 1.075 | 10.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,-10
|
||||
2,1,-20
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,-3
|
||||
4,1,-5
|
||||
"""
|
||||
And the data has been extracted
|
||||
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||
And stderr should contain "malformed"
|
||||
And it should exit with an error
|
||||
@@ -52,23 +52,23 @@ Feature: Traffic - turn penalties
|
||||
|
||||
Scenario: Weighting not based on turn penalty file
|
||||
When I route I should get
|
||||
| from | to | route | speed | time |
|
||||
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 45 km/h | 16s +-1 |
|
||||
# right
|
||||
| a | e | ad,def,def | 38 km/h | 19s +-1 |
|
||||
# left
|
||||
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 48 km/h | 29s +-1 |
|
||||
# straight-right
|
||||
| a | l | ad,dhk,klm,klm | 44 km/h | 33s +-1 |
|
||||
# straight-left
|
||||
| l | e | klm,dhk,def,def | 45 km/h | 32s +-1 |
|
||||
# double right
|
||||
| g | n | fg,fim,mn,mn | 38 km/h | 38s +-1 |
|
||||
# double left
|
||||
| from | to | route | speed | weight | time |
|
||||
| a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
|
||||
# right
|
||||
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
|
||||
# left
|
||||
| c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
|
||||
# straight-right
|
||||
| a | l | ad,dhk,klm,klm | 53 km/h | 27s +-1 | 27s +-1 |
|
||||
# straight-left
|
||||
| l | e | klm,dhk,def,def | 55 km/h | 26s +-1 | 26s +-1 |
|
||||
# double right
|
||||
| g | n | fg,fim,mn,mn | 44 km/h | 32s +-1 | 32s +-1 |
|
||||
# double left
|
||||
|
||||
Scenario: Weighting based on turn penalty file
|
||||
Given the turn penalty file
|
||||
@@ -80,27 +80,33 @@ Feature: Traffic - turn penalties
|
||||
8,11,12,23
|
||||
1,4,5,-0.2
|
||||
"""
|
||||
# ifg right turn
|
||||
# imn left turn
|
||||
# hdc left turn
|
||||
# lkh right turn
|
||||
# hkl left turn
|
||||
# ade left turn
|
||||
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||
When I route I should get
|
||||
| from | to | route | speed | time |
|
||||
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 46 km/h | 15s +-1 |
|
||||
# right - ifg penalty
|
||||
| a | e | ad,def,def | 53 km/h | 14s +-1 |
|
||||
# left - faster because of negative ade penalty
|
||||
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 49 km/h | 29s +-1 |
|
||||
# straight-right - ifg penalty
|
||||
| a | l | ad,def,fim,klm,klm | 48 km/h | 45s +-1 |
|
||||
# was straight-left - forced around by hkl penalty
|
||||
| l | e | klm,fim,def,def | 38 km/h | 38s +-1 |
|
||||
# double right - forced left by lkh penalty
|
||||
| g | n | fg,fim,mn,mn | 25 km/h | 57s +-1 |
|
||||
# double left - imn penalty
|
||||
| j | c | jk,klm,fim,def,cd,cd | 44 km/h | 65.8s +-1 |
|
||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||
| from | to | route | speed | weight | time |
|
||||
| a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
|
||||
# right - ifg penalty
|
||||
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
|
||||
# left - faster because of negative ade penalty
|
||||
| c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
|
||||
# straight-right - ifg penalty
|
||||
| a | l | ad,def,fim,klm,klm | 58 km/h | 37 | 37s +-1 |
|
||||
# was straight-left - forced around by hkl penalty
|
||||
| l | e | klm,fim,def,def | 44 km/h | 32.6 | 32s +-1 |
|
||||
# double right - forced left by lkh penalty
|
||||
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
|
||||
# double left - imn penalty
|
||||
| j | c | jk,klm,fim,def,cd,cd | 53 km/h | 54.6 | 54s +-1 |
|
||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||
|
||||
Scenario: Too-negative penalty clamps, but does not fail
|
||||
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||
@@ -111,7 +117,9 @@ Feature: Traffic - turn penalties
|
||||
"""
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | d | ad,ad | 10s +-1 |
|
||||
# The target point `d` can be in `ad`, `cd`, `deh` and `dhk`
|
||||
# The test must be fixed by #2287
|
||||
#| a | d | ad,ad | 10s +-1 |
|
||||
| a | e | ad,def,def | 10s +-1 |
|
||||
| b | f | bf,bf | 10s +-1 |
|
||||
| b | g | bf,fg,fg | 20s +-1 |
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
@routing @car @weight
|
||||
Feature: Car - weights
|
||||
|
||||
Background: Use specific speeds
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Only routes down service road when that's the destination
|
||||
Given the node map
|
||||
"""
|
||||
a--b--c
|
||||
|
|
||||
d
|
||||
|
|
||||
e--f--g
|
||||
"""
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | residential |
|
||||
| efg | residential |
|
||||
| cg | tertiary |
|
||||
| bdf | service |
|
||||
When I route I should get
|
||||
| from | to | route | speed | weight |
|
||||
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
|
||||
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
|
||||
|
||||
Scenario: Does not jump off the highway to go down service road
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
b
|
||||
|\
|
||||
| e
|
||||
|/
|
||||
c
|
||||
|
|
||||
d
|
||||
"""
|
||||
And the nodes
|
||||
| node | id |
|
||||
| a | 1 |
|
||||
| b | 2 |
|
||||
| c | 3 |
|
||||
| d | 4 |
|
||||
| e | 5 |
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | yes |
|
||||
| bc | primary | yes |
|
||||
| cd | primary | yes |
|
||||
| be | service | yes |
|
||||
| ec | service | yes |
|
||||
And the extract extra arguments "--generate-edge-lookup"
|
||||
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||
And the speed file
|
||||
"""
|
||||
2,5,8
|
||||
"""
|
||||
When I route I should get
|
||||
| from | to | route | speed | weight |
|
||||
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
|
||||
| a | e | ab,be,be | 14 km/h | 112 |
|
||||
@@ -95,3 +95,25 @@ Feature: Foot - Access tags on ways
|
||||
| footway | | no | | x |
|
||||
| motorway | | | yes | |
|
||||
| footway | | | no | x |
|
||||
|
||||
Scenario: Foot - Bridleways when access is explicit
|
||||
Then routability should be
|
||||
| highway | horse | bicycle | foot | bothw |
|
||||
| bridleway | | | yes | x |
|
||||
| bridleway | | yes | | |
|
||||
| bridleway | designated | | | |
|
||||
| bridleway | | | | |
|
||||
|
||||
Scenario: Foot - a way with missing :forward tag
|
||||
Then routability should be
|
||||
| highway | bicycle:backward | foot:backward | forw | backw |
|
||||
| cycleway | designated | designated | | x |
|
||||
|
||||
Scenario: Foot - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | x |
|
||||
| steps | permissive | x |
|
||||
| footway | permissive | x |
|
||||
| garbagetag | permissive | x |
|
||||
|
||||
|
||||
@@ -64,6 +64,6 @@ Feature: Foot - Handle ferry routes
|
||||
| abcd | | ferry | yes | 1:00 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s +-10 |
|
||||
| d | a | abcd,abcd | 3600s +-10 |
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s |
|
||||
| d | a | abcd,abcd | 3600s |
|
||||
|
||||
@@ -5,13 +5,17 @@ Feature: Turn Lane Guidance
|
||||
Given the profile "car"
|
||||
Given a grid size of 3 meters
|
||||
|
||||
|
||||
@sliproads
|
||||
Scenario: Separate Turn Lanes
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c g
|
||||
d
|
||||
.
|
||||
a ... b ..... c . g
|
||||
` .
|
||||
`... d
|
||||
.
|
||||
f
|
||||
"""
|
||||
|
||||
@@ -41,8 +45,10 @@ Feature: Turn Lane Guidance
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c g
|
||||
d
|
||||
a . . b . . . c g
|
||||
` .
|
||||
` .
|
||||
` d
|
||||
f
|
||||
"""
|
||||
|
||||
@@ -67,21 +73,22 @@ Feature: Turn Lane Guidance
|
||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||
|
||||
|
||||
@sliproads
|
||||
Scenario: Separate Turn Lanes Next to other turns
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c g
|
||||
d
|
||||
f
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
i h j
|
||||
. e
|
||||
a . . b . . . c g
|
||||
. ` .
|
||||
. ` .
|
||||
. d
|
||||
. f
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
i . . h . . . j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -109,6 +116,7 @@ Feature: Turn Lane Guidance
|
||||
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
|
||||
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
|
||||
|
||||
|
||||
@todo @2654 @none
|
||||
#https://github.com/Project-OSRM/osrm-backend/issues/2645
|
||||
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
|
||||
@@ -116,10 +124,10 @@ Feature: Turn Lane Guidance
|
||||
Given the node map
|
||||
"""
|
||||
g f
|
||||
|
||||
j h e
|
||||
|
||||
a b c
|
||||
| |
|
||||
j --- h - e
|
||||
| |
|
||||
a --- b - c
|
||||
i d
|
||||
"""
|
||||
|
||||
@@ -146,21 +154,21 @@ Feature: Turn Lane Guidance
|
||||
Given the node map
|
||||
"""
|
||||
g j
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
f
|
||||
e
|
||||
d
|
||||
a b c
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |,f
|
||||
|,e
|
||||
,d |
|
||||
a --------- b c |
|
||||
/ | |
|
||||
/ | |
|
||||
/ | |
|
||||
| | |
|
||||
| | |
|
||||
| | |
|
||||
l h i
|
||||
"""
|
||||
|
||||
@@ -194,21 +202,21 @@ Feature: Turn Lane Guidance
|
||||
Given the node map
|
||||
"""
|
||||
g j
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
f
|
||||
e
|
||||
d
|
||||
a b c
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |,f
|
||||
|,e
|
||||
,d |
|
||||
a --------- b c |
|
||||
/ | |
|
||||
/ | |
|
||||
/ | |
|
||||
| | |
|
||||
| | |
|
||||
| | |
|
||||
l h i
|
||||
"""
|
||||
|
||||
@@ -231,6 +239,7 @@ Feature: Turn Lane Guidance
|
||||
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
|
||||
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
|
||||
|
||||
|
||||
Scenario: Check sliproad handler loop's exit condition, Issue #2896
|
||||
# http://www.openstreetmap.org/way/198481519
|
||||
Given the node locations
|
||||
|
||||
@@ -783,3 +783,72 @@ Feature: Turn Lane Guidance
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn right,arrive | ,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:false right:true, |
|
||||
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Complex lane scenarios scale threshold for triggering Lane Anticipation
|
||||
Given the node map
|
||||
"""
|
||||
a – b – x
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
c
|
||||
|
|
||||
e – d – y
|
||||
"""
|
||||
# With a grid size of 20m the duration is ~20s but our default threshold for Lane Anticipation is 15s.
|
||||
# The additional lanes left and right of the turn scale the threshold up so that Lane Anticipation still triggers.
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|through\|right\|right | MySt |
|
||||
| bx | | XSt |
|
||||
| bc | | MySt |
|
||||
| cd | left\|right | MySt |
|
||||
| de | | MySt |
|
||||
| dy | | YSt |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Don't Overdo It
|
||||
Given the node map
|
||||
"""
|
||||
q r s t u v
|
||||
| | | | | |
|
||||
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
|
||||
| | | | | | |
|
||||
p o n m l k j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | turn:lanes:forward | oneway |
|
||||
| ab | road | left\|\|\| | yes |
|
||||
| bc | road | left\|\|\| | yes |
|
||||
| cd | road | left\|\|\| | yes |
|
||||
| de | road | left\|\|\| | yes |
|
||||
| ef | road | left\|\|\| | yes |
|
||||
| fg | road | left\|\|\| | yes |
|
||||
| gh | road | \|\|right | yes |
|
||||
| hi | road | | yes |
|
||||
| qbp | 1st | | no |
|
||||
| rco | 2nd | | no |
|
||||
| sdn | 3rd | | no |
|
||||
| tem | 4th | | no |
|
||||
| ufl | 5th | | no |
|
||||
| vgk | 6th | | no |
|
||||
| hj | 7th | | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations | lanes |
|
||||
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
|
||||
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
@routing @guidance @staggered-intersections
|
||||
Feature: Staggered Intersections
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given a grid size of 1 meters
|
||||
# Note the one meter grid size: staggered intersections make zig-zags of a couple of meters only
|
||||
|
||||
Scenario: Staggered Intersection - pushing in the middle
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
h
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | residential | Oak St | |
|
||||
| efg | residential | Oak St | |
|
||||
| ihedcj | residential | Cedar Dr | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
||||
|
||||
Scenario: Staggered Intersection - pushing at start
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
h
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| cba | residential | Oak St | yes |
|
||||
| efg | residential | Oak St | |
|
||||
| ihedcj | residential | Cedar Dr | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,cycling,cycling |
|
||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
||||
|
||||
Scenario: Staggered Intersection - pushing at end
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
h
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | residential | Oak St | |
|
||||
| gfe | residential | Oak St | yes |
|
||||
| ihedcj | residential | Cedar Dr | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | cycling,cycling,pushing bike,pushing bike |
|
||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
||||
|
||||
Scenario: Staggered Intersection - pushing at start and end
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
h
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| cba | residential | Oak St | yes |
|
||||
| gfe | residential | Oak St | yes |
|
||||
| ihedcj | residential | Cedar Dr | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
|
||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
||||
|
||||
Scenario: Staggered Intersection - pushing at start and end
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
h
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| cba | pedestrian | Oak St |
|
||||
| gfe | pedestrian | Oak St |
|
||||
| ihedcj | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
|
||||
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
|
||||
|
||||
Scenario: Staggered Intersection - control, all cycling on staggered intersection
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
h
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| cba | residential | Oak St |
|
||||
| gfe | residential | Oak St |
|
||||
| ihedcj | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | Oak St,Oak St | depart,arrive | cycling,cycling |
|
||||
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
|
||||
@@ -50,3 +50,20 @@ Feature: Features related to bugs
|
||||
And the data has been saved to disk
|
||||
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
|
||||
Then it should exit successfully
|
||||
|
||||
@3418
|
||||
Scenario: Bearings should be between 0-359
|
||||
Given the node locations
|
||||
| node | lon | lat |
|
||||
| a | -122.0232176 | 37.3282203 |
|
||||
| b | -122.0232199 | 37.3302422 |
|
||||
| c | -122.0232252 | 37.3312787 |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway |
|
||||
| ab | Pear to Merrit | residential |
|
||||
| bc | Merritt to Apricot | residential |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,c | Pear to Merrit,Merritt to Apricot,Merritt to Apricot | true:0;true:0 false:180;true:180 |
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
@routing @guidance
|
||||
Feature: Rotary
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 30 meters
|
||||
|
||||
Scenario: Enter and Exit
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b
|
||||
h g c d
|
||||
e
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bgecb | circular |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
|
||||
|
||||
Scenario: Only Enter
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b
|
||||
d c g h
|
||||
e
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | circular |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
|
||||
Scenario: Only Exit
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b
|
||||
d c g h
|
||||
e
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | circular |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
|
||||
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
|
||||
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
|
||||
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
|
||||
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
|
||||
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
|
||||
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
|
||||
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
|
||||
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
|
||||
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
|
||||
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
|
||||
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
|
||||
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
|
||||
|
||||
Scenario: Drive Around
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b
|
||||
d c g h
|
||||
e
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | circular |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,c | bcegb,bcegb | depart,arrive |
|
||||
| b,e | bcegb,bcegb | depart,arrive |
|
||||
| b,g | bcegb,bcegb | depart,arrive |
|
||||
| c,e | bcegb,bcegb | depart,arrive |
|
||||
| c,g | bcegb,bcegb | depart,arrive |
|
||||
| c,b | bcegb,bcegb | depart,arrive |
|
||||
| e,g | bcegb,bcegb | depart,arrive |
|
||||
| e,b | bcegb,bcegb | depart,arrive |
|
||||
| e,c | bcegb,bcegb | depart,arrive |
|
||||
| g,b | bcegb,bcegb | depart,arrive |
|
||||
| g,c | bcegb,bcegb | depart,arrive |
|
||||
| g,e | bcegb,bcegb | depart,arrive |
|
||||
|
||||
#needs to be adjusted when name-discovery works for entrys
|
||||
Scenario: Mixed Entry and Exit
|
||||
Given the node map
|
||||
"""
|
||||
c a
|
||||
j b f
|
||||
k e
|
||||
l h d
|
||||
g i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| abc | | yes |
|
||||
| def | | yes |
|
||||
| ghi | | yes |
|
||||
| jkl | | yes |
|
||||
| bkheb | circular | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
|
||||
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
|
||||
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
|
||||
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
|
||||
| d,f | def,def,def | depart,rotary-exit-1,arrive |
|
||||
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
|
||||
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
|
||||
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
|
||||
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
|
||||
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
|
||||
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
|
||||
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
|
||||
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
|
||||
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
|
||||
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
|
||||
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b
|
||||
c d f
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | circular |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d
|
||||
b c f
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ad | |
|
||||
| bcdb | circular |
|
||||
| be | |
|
||||
| cf | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ad,be,be | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ad,cf,cf | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
c
|
||||
d b f
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ac | |
|
||||
| bcdb | circular |
|
||||
| de | |
|
||||
| bf | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ac,de,de | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ac,bf,bf | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
d c e
|
||||
b
|
||||
a
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | circular |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
d c e
|
||||
b
|
||||
a
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | circular |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
@@ -55,3 +55,38 @@ Feature: Collapse
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Forking before a turn (forky)
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
.
|
||||
c
|
||||
a . . b .'
|
||||
`d.
|
||||
f e
|
||||
"""
|
||||
# note: check clooapse.feature for a similar test case where we do not
|
||||
# classify the situation as Sliproad and therefore keep the fork inst.
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
| ab | road | yes | primary |
|
||||
| bd | road | yes | primary |
|
||||
| bc | road | yes | primary |
|
||||
| de | road | yes | primary |
|
||||
| fd | cross | no | secondary |
|
||||
| dc | cross | no | secondary |
|
||||
| cg | cross | no | secondary |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | dc | d | no_left_turn |
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road,road | depart,continue right,arrive |
|
||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
@routing @guidance @collapsing
|
||||
Feature: Collapse
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 20 meters
|
||||
|
||||
Scenario: Collapse Steps While On Ferry
|
||||
Given the node map
|
||||
"""
|
||||
j----a---c---b----k
|
||||
~ ~ ~
|
||||
~ ~ ~
|
||||
~~~
|
||||
d
|
||||
~
|
||||
~
|
||||
~
|
||||
e --- f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| jacbk | primary | | land |
|
||||
| ad | | ferry | sea |
|
||||
| bd | | ferry | sea |
|
||||
| cd | | ferry | sea |
|
||||
| de | | ferry | sea |
|
||||
| ef | primary | | pennydog-island |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes | locations |
|
||||
| f,j | pennydog-island,sea,land,land | depart,notification right,turn left,arrive | driving,ferry,driving,driving | f,e,b,j |
|
||||
|
||||
Scenario: Switching Ferry in a Harbour
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
|
|
||||
|
|
||||
e - a ~ ~ ~ ~ b
|
||||
~
|
||||
~
|
||||
~
|
||||
c
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ea | primary | | melee-island |
|
||||
| ab | | ferry | melee-island-ferry |
|
||||
| cf | primary | | monkey-island |
|
||||
| bd | primary | | scabb-island |
|
||||
| bc | primary | ferry | monkey-island-ferry |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| e,f | melee-island,melee-island-ferry,monkey-island-ferry,monkey-island,monkey-island | depart,notification straight,turn right,notification straight,arrive | driving,ferry,ferry,driving,driving |
|
||||
|
||||
|
||||
Scenario: End of Road Ferries
|
||||
Given the node map
|
||||
"""
|
||||
a - b ~ ~ ~ ~ c ~ ~ ~ ~ ~ d - e
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | land-left |
|
||||
| de | primary | | land-right |
|
||||
| gf | primary | | land-bottom |
|
||||
| bcd | | ferry | ferry |
|
||||
| fc | | ferry | ferry |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification straight,arrive |
|
||||
|
||||
Scenario: Fork Ferries
|
||||
Given the node map
|
||||
"""
|
||||
a - b d - e
|
||||
~ ~
|
||||
~ ~
|
||||
~ ~
|
||||
~ ~
|
||||
c
|
||||
~
|
||||
~
|
||||
~
|
||||
f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | land-left |
|
||||
| de | primary | | land-right |
|
||||
| gf | primary | | land-bottom |
|
||||
| cb | | ferry | ferry |
|
||||
| cd | | ferry | ferry |
|
||||
| fc | | ferry | ferry |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification right,arrive |
|
||||
|
||||
@negative
|
||||
Scenario: Don't Detect Suppressed/Obvious Forks on Ferries
|
||||
Given the node map
|
||||
"""
|
||||
. . . . . . . . .d
|
||||
a - b ~ ~ ~ ~ ~ c <
|
||||
' ' ' ' ' ' ' ' 'e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | cursed-island |
|
||||
| bc | | ferry | beagle |
|
||||
| cd | service | | forker |
|
||||
| ce | primary | | screw-me-not |
|
||||
|
||||
#the turns here could be better, but intersection classification shows you if you go left or right. But we cannot fork here
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | cursed-island,beagle,forker,forker | depart,notification straight,turn straight,arrive |
|
||||
| a,e | cursed-island,beagle,screw-me-not,screw-me-not | depart,notification straight,turn straight,arrive |
|
||||
|
||||
@uturn @dead-end @ferry @via
|
||||
Scenario: U-Turn on a dead-end ferry
|
||||
Given the node map
|
||||
"""
|
||||
a - 1 - b ~ ~ ~ ~ ~ ~ ~ c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | land |
|
||||
| bc | | ferry | sea |
|
||||
|
||||
# we actually cannot check the route here, since two possible routes are equally valid:
|
||||
# (ab)(bcb1) and (abcb)(b1) are exactly the same. Luckily, we only want to check for
|
||||
# not asserting here.
|
||||
When I route I should get
|
||||
| waypoints |
|
||||
| a,b,1 |
|
||||
@@ -143,37 +143,33 @@ Feature: Collapse
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||
Given the node map
|
||||
"""
|
||||
n m
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
g h
|
||||
|
||||
|
||||
c b a
|
||||
d e f
|
||||
|
||||
|
||||
j i
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
k l
|
||||
n m
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
g h
|
||||
c - b - a
|
||||
d - e - f
|
||||
j i
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
k l
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| ab | primary | first | yes |
|
||||
| bc | primary | first | yes |
|
||||
| de | primary | first | yes |
|
||||
| ef | primary | first | yes |
|
||||
| be | primary | first | no |
|
||||
| ngbhm | primary | second | yes |
|
||||
| liejk | primary | second | yes |
|
||||
| nodes | highway | name | oneway | lanes |
|
||||
| ab | primary | first | yes | |
|
||||
| bc | primary | first | yes | |
|
||||
| de | primary | first | yes | |
|
||||
| ef | primary | first | yes | |
|
||||
| be | primary | first | no | |
|
||||
| ngbhm | primary | second | yes | 5 |
|
||||
| liejk | primary | second | yes | 5 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -197,33 +193,37 @@ Feature: Collapse
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||
Given the node map
|
||||
"""
|
||||
n m
|
||||
|
||||
|
||||
|
||||
g h
|
||||
|
||||
|
||||
c b a
|
||||
d e f
|
||||
|
||||
|
||||
j i
|
||||
|
||||
|
||||
|
||||
k l
|
||||
n m
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
g h
|
||||
\ /
|
||||
c - b - a
|
||||
d - e - f
|
||||
/ \
|
||||
j i
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
k l
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| ab | primary | first | yes |
|
||||
| bc | primary | first | yes |
|
||||
| de | primary | first | yes |
|
||||
| ef | primary | first | yes |
|
||||
| be | primary | second | no |
|
||||
| ngbhm | primary | second | yes |
|
||||
| liejk | primary | second | yes |
|
||||
| nodes | highway | name | oneway | lanes |
|
||||
| ab | primary | first | yes | |
|
||||
| bc | primary | first | yes | |
|
||||
| de | primary | first | yes | |
|
||||
| ef | primary | first | yes | |
|
||||
| be | primary | second | no | |
|
||||
| ngbhm | primary | second | yes | 5 |
|
||||
| liejk | primary | second | yes | 5 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -338,10 +338,10 @@ Feature: Collapse
|
||||
Given the node map
|
||||
"""
|
||||
a f g
|
||||
|
||||
b e
|
||||
|
||||
|
||||
| | . '
|
||||
b-e '
|
||||
/ /
|
||||
/ /
|
||||
c d
|
||||
"""
|
||||
|
||||
@@ -425,18 +425,28 @@ Feature: Collapse
|
||||
Scenario: Pankenbruecke
|
||||
Given the node map
|
||||
"""
|
||||
j h i
|
||||
b c d e f g
|
||||
k a
|
||||
k j
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
a h
|
||||
b
|
||||
c
|
||||
d
|
||||
e
|
||||
f-i
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| kabhj | primary | inroad | yes |
|
||||
| bc | primary | inroad | no |
|
||||
| cd | primary | bridge | no |
|
||||
| defg | primary | outroad | no |
|
||||
| fi | primary | cross | no |
|
||||
| nodes | highway | name | oneway | lanes |
|
||||
| kabhj | primary | inroad | yes | 4 |
|
||||
| bc | primary | inroad | no | |
|
||||
| cd | primary | bridge | no | |
|
||||
| defg | primary | outroad | no | |
|
||||
| fi | primary | cross | no | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -484,6 +494,23 @@ Feature: Collapse
|
||||
| waypoints | route | turns |
|
||||
| a,d | road,road | depart,arrive |
|
||||
|
||||
Scenario: No Name During Turns - Ferry
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | route |
|
||||
| ab | tertiary | road | |
|
||||
| bc | tertiary | | ferry |
|
||||
| cd | tertiary | road | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | road,,road,road | depart,notification right,notification left,arrive |
|
||||
|
||||
Scenario: No Name During Turns, Random Oneway
|
||||
Given the node map
|
||||
"""
|
||||
@@ -684,12 +711,15 @@ Feature: Collapse
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
|
||||
.
|
||||
c
|
||||
a b
|
||||
d
|
||||
a . . b .'
|
||||
` d.
|
||||
f e
|
||||
"""
|
||||
# as it is right now we don't classify this as a sliproad,
|
||||
# check collapse-detail.feature for a similar test case
|
||||
# which removes the fork here due to it being a Sliproad.
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
@@ -707,11 +737,10 @@ Feature: Collapse
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road,road | depart,continue slight right,arrive |
|
||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,fork left,arrive |
|
||||
| a,e | road,road,road | depart,fork slight right,arrive |
|
||||
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive |
|
||||
|
||||
Scenario: On-Off on Highway
|
||||
Given the node map
|
||||
@@ -738,12 +767,13 @@ Feature: Collapse
|
||||
Scenario: Don't collapse going straight if actual turn
|
||||
Given the node map
|
||||
"""
|
||||
c e
|
||||
d f
|
||||
|
||||
e
|
||||
c |
|
||||
\ d - - - f
|
||||
\|
|
||||
b
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
a
|
||||
"""
|
||||
|
||||
@@ -754,10 +784,10 @@ Feature: Collapse
|
||||
| df | right | residential |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | main,main | depart,arrive |
|
||||
| a,e | main,straight,straight | depart,turn straight,arrive |
|
||||
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,c | main,main | depart,arrive | a,c |
|
||||
| a,e | main,straight,straight | depart,turn straight,arrive | a,b,e |
|
||||
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive | a,b,d,f |
|
||||
|
||||
Scenario: Entering a segregated road
|
||||
Given the node map
|
||||
@@ -929,16 +959,17 @@ Feature: Collapse
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.48778/13.30024
|
||||
Scenario: Hohenzollerdammbrücke
|
||||
Given a grid size of 10 meters
|
||||
Given the node map
|
||||
"""
|
||||
q s
|
||||
p o
|
||||
.. . .
|
||||
. . . .
|
||||
.. ..
|
||||
. . . .
|
||||
j - i - - - h - - - g - f
|
||||
> k < > l <
|
||||
a - b - - - c - - - d - e
|
||||
. . . .
|
||||
. . . .
|
||||
.. ..
|
||||
m n
|
||||
t r
|
||||
@@ -995,13 +1026,13 @@ Feature: Collapse
|
||||
| restriction | ph | hi | h | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | hohe,hohe | depart,arrive |
|
||||
| a,s | hohe,a100,a100 | depart,on ramp left,arrive |
|
||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive |
|
||||
| a,j | | |
|
||||
| f,j | hohe,hohe | depart,arrive |
|
||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive |
|
||||
| f,e | | |
|
||||
| q,j | a100,hohe,hohe | depart,turn right,arrive |
|
||||
| q,e | a100,a100,hohe | depart,continue left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,e | hohe,hohe | depart,arrive | a,e |
|
||||
| a,s | hohe,a100,a100 | depart,on ramp left,arrive | a,b,s |
|
||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
|
||||
| a,j | | | |
|
||||
| f,j | hohe,hohe | depart,arrive | f,j |
|
||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
|
||||
| f,e | | | |
|
||||
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j |
|
||||
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
|
||||
|
||||
@@ -9,7 +9,7 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a b d
|
||||
a - b-d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -26,7 +26,7 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a b d
|
||||
a - b-d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -43,7 +43,7 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a b d
|
||||
a - b-d
|
||||
e
|
||||
"""
|
||||
|
||||
@@ -62,7 +62,7 @@ Feature: Continue Instructions
|
||||
Scenario: Road turning right
|
||||
Given the node map
|
||||
"""
|
||||
a b d
|
||||
a - b-d
|
||||
c
|
||||
"""
|
||||
|
||||
@@ -80,9 +80,9 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
|
||||
a b
|
||||
d
|
||||
/
|
||||
a - b
|
||||
`d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -98,9 +98,9 @@ Feature: Continue Instructions
|
||||
Scenario: Road turning slight right
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
a b
|
||||
|
||||
,d
|
||||
a - b
|
||||
\
|
||||
c
|
||||
"""
|
||||
|
||||
@@ -117,11 +117,11 @@ Feature: Continue Instructions
|
||||
Scenario: Road Loop
|
||||
Given the node map
|
||||
"""
|
||||
f e
|
||||
|
||||
a b g
|
||||
|
||||
c d
|
||||
f - e
|
||||
| |
|
||||
a - b-g |
|
||||
| |
|
||||
c - d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
|
||||
@@ -9,81 +9,148 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c d
|
||||
h
|
||||
|
||||
1
|
||||
|
||||
f
|
||||
|
||||
a b-----c-d
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | trunk | first |
|
||||
| cd | trunk | first |
|
||||
| bhf | trunk_link | |
|
||||
| cfg | primary | second |
|
||||
| ec | primary | second |
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | trunk | first | |
|
||||
| cd | trunk | first | |
|
||||
| bhf | trunk_link | | yes |
|
||||
| cfg | primary | second | yes |
|
||||
| ec | primary | second | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cfg | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,second,second | depart,turn right,arrive |
|
||||
| a,1 | first,, | depart,turn slight right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,second,second | depart,turn right,arrive |
|
||||
| a,1 | first,, | depart,turn right,arrive |
|
||||
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b-----c-d
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway | route |
|
||||
| abc | trunk | first | yes | |
|
||||
| cd | trunk | first | yes | |
|
||||
| bhf | trunk_link | | yes | ferry |
|
||||
| cfg | primary | second | yes | |
|
||||
| ec | primary | second | yes | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cfg | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,turn right,turn straight,arrive |
|
||||
|
||||
Scenario: Turning Sliproad onto a ferry
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b-----c-d
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
|
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway | route |
|
||||
| abc | trunk | first | | |
|
||||
| cd | trunk | first | | |
|
||||
| bhf | trunk_link | | yes | |
|
||||
| cf | primary | second | yes | |
|
||||
| fg | primary | second | yes | ferry |
|
||||
| ec | primary | second | yes | |
|
||||
| gi | primary | second | yes | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cf | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,i | first,,second,second,second | depart,turn right,turn straight,notification straight,arrive |
|
||||
| a,1 | first,, | depart,turn right,arrive |
|
||||
|
||||
Scenario: Turn Instead of Ramp - Max-Speed
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a-b-----c-------------------------d
|
||||
`h |
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
`|
|
||||
f
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | maxspeed |
|
||||
| abc | trunk | first | 70 |
|
||||
| cd | trunk | first | 2 |
|
||||
| bhf | trunk_link | | 2 |
|
||||
| cfg | primary | second | 50 |
|
||||
| ec | primary | second | 50 |
|
||||
| nodes | highway | name | maxspeed | oneway |
|
||||
| abc | trunk | first | 70 | |
|
||||
| cd | trunk | first | 2 | |
|
||||
| bhf | trunk_link | | 2 | yes |
|
||||
| cfg | primary | second | 50 | yes |
|
||||
| ec | primary | second | 50 | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cfg | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,second,second | depart,turn right,arrive |
|
||||
| a,1 | first,, | depart,turn slight right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,second,second | depart,turn right,arrive |
|
||||
| a,1 | first,, | depart,turn right,arrive |
|
||||
|
||||
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c d
|
||||
h
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
||||
…
|
||||
a-b-----c--d
|
||||
`--h …
|
||||
\|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
f
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
@@ -94,21 +161,23 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| efg | primary | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp slight right,turn straight,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
|
||||
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c d
|
||||
h
|
||||
|
||||
|
||||
|
||||
|
|
||||
…
|
||||
a-b-----c-d
|
||||
`--h …
|
||||
\|
|
||||
|
|
||||
|
|
||||
f
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
@@ -119,30 +188,30 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| efg | primary | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp slight right,turn straight,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
|
||||
|
||||
Scenario: Inner city expressway with on road
|
||||
Given the node map
|
||||
"""
|
||||
a b c g
|
||||
f
|
||||
|
||||
|
||||
|
||||
a b-------c-g
|
||||
`--f |
|
||||
\|
|
||||
|
|
||||
|
|
||||
d
|
||||
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
|
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | primary | road |
|
||||
| cg | primary | road |
|
||||
| bfd | trunk_link | |
|
||||
| cde | trunk | trunk |
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | primary | road | |
|
||||
| cg | primary | road | |
|
||||
| bfd | trunk_link | | yes |
|
||||
| cde | trunk | trunk | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
@@ -157,12 +226,12 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Given the node map
|
||||
"""
|
||||
a f
|
||||
|
||||
| |
|
||||
b e
|
||||
|
||||
|
||||
g
|
||||
|
||||
|\ /|
|
||||
| | |
|
||||
| g |
|
||||
| |
|
||||
c d
|
||||
"""
|
||||
|
||||
@@ -180,11 +249,11 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Given the node map
|
||||
"""
|
||||
a f
|
||||
|
||||
| |
|
||||
b e
|
||||
g
|
||||
|
||||
|
||||
|\g/|
|
||||
| |
|
||||
| |
|
||||
c d
|
||||
"""
|
||||
|
||||
@@ -240,8 +309,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| qe | secondary_link | Ettlinger Allee | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | ref |
|
||||
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,L561, |
|
||||
| waypoints | route | turns | ref |
|
||||
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,L561, |
|
||||
|
||||
Scenario: Traffic Lights everywhere
|
||||
#http://map.project-osrm.org/?z=18¢er=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
|
||||
@@ -271,33 +340,33 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| jcghf | primary | Brauerstrasse | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
|
||||
| a,1 | Ebertstrasse,, | depart,turn right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
|
||||
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive |
|
||||
|
||||
#2839
|
||||
Scenario: Self-Loop
|
||||
Given the node map
|
||||
"""
|
||||
l k
|
||||
j
|
||||
m
|
||||
i
|
||||
|
||||
|
||||
h
|
||||
|
||||
n
|
||||
|
||||
g
|
||||
o
|
||||
|
||||
f
|
||||
p
|
||||
e
|
||||
a b c d
|
||||
/-l-----k---\
|
||||
/ `j--
|
||||
m \
|
||||
/ i
|
||||
/ \
|
||||
| \
|
||||
| h
|
||||
| |
|
||||
n |
|
||||
| |
|
||||
| g
|
||||
o |
|
||||
/ /
|
||||
| f
|
||||
/- p /
|
||||
/ e
|
||||
a ------- b --------------- c ----------------- d ---/
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -316,23 +385,23 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Scenario: Self-Loop - Bidirectional
|
||||
Given the node map
|
||||
"""
|
||||
l k
|
||||
j
|
||||
m
|
||||
i
|
||||
|
||||
|
||||
h
|
||||
|
||||
n
|
||||
|
||||
g
|
||||
o
|
||||
|
||||
f
|
||||
p
|
||||
e
|
||||
a b c d
|
||||
/-l-----k---\
|
||||
/ `j--
|
||||
m \
|
||||
/ i
|
||||
/ \
|
||||
| \
|
||||
| h
|
||||
| |
|
||||
n |
|
||||
| |
|
||||
| g
|
||||
o |
|
||||
/ /
|
||||
| f
|
||||
/- p /
|
||||
/ e
|
||||
a ------- b --------------- c ----------------- d ---/
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -349,31 +418,30 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c d
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
e
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
|
||||
|
||||
f g
|
||||
|
||||
a-b ----------------------------------------- c ------------d
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
e |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ 1
|
||||
`---------- f ------- g ----------\
|
||||
| \
|
||||
i h
|
||||
"""
|
||||
|
||||
@@ -398,20 +466,20 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
g h
|
||||
d e
|
||||
i c j
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/--------------------f
|
||||
g-----------h--\ |
|
||||
d-----e
|
||||
i c-----------j--/
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
b
|
||||
|
||||
|
|
||||
a
|
||||
"""
|
||||
|
||||
@@ -431,3 +499,433 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,i | road,road,road | depart,fork slight left,arrive |
|
||||
|
||||
|
||||
# The following tests are current false positives / false negatives #3199
|
||||
|
||||
@sliproads
|
||||
# http://www.openstreetmap.org/#map=19/52.59847/13.14815
|
||||
Scenario: Sliproad Detection
|
||||
Given the node map
|
||||
"""
|
||||
a . . .
|
||||
. .
|
||||
b . . . . . . c . . . d
|
||||
` . .
|
||||
e . .
|
||||
` . .
|
||||
f . .
|
||||
` . .
|
||||
g i
|
||||
` h .
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abefgh | residential | Nachtigallensteig |
|
||||
| bcd | residential | Kiebitzsteig |
|
||||
| cg | residential | Haenflingsteig |
|
||||
| hid | residential | Waldkauzsteig |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | Nachtigallensteig,Kiebitzsteig,Kiebitzsteig | depart,turn left,arrive |
|
||||
| a,h | Nachtigallensteig,Nachtigallensteig | depart,arrive |
|
||||
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a obvious Sliproad
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . b . . c
|
||||
` .
|
||||
` e
|
||||
.`
|
||||
. `
|
||||
f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sabc | primary | sabc | |
|
||||
| dbef | primary | dbef | yes |
|
||||
| aeg | primary | aeg | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Through Street, not a Sliproad although obvious
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . b . . c
|
||||
` .
|
||||
` e
|
||||
. `
|
||||
. `
|
||||
f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sabc | primary | sabc | |
|
||||
| dbef | primary | dbef | yes |
|
||||
| aeg | primary | aeg | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad target turn is restricted
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . . . b . . c
|
||||
` .
|
||||
` .
|
||||
` .
|
||||
` .
|
||||
`.
|
||||
e
|
||||
.`
|
||||
f `
|
||||
. ` g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sa | primary | sabc | |
|
||||
| abc | primary | sabc | |
|
||||
| dbe | primary | dbef | yes |
|
||||
| ef | primary | dbef | |
|
||||
| ae | primary | aeg | yes |
|
||||
| eg | primary | aeg | |
|
||||
# the reason we have to split ways at e is that otherwise we can't handle restrictions via e
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | ae | ef | e | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
|
||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, road not continuing straight
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . b . . c
|
||||
` .
|
||||
` e . . g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sabc | primary | sabc | |
|
||||
| dbe | primary | dbe | yes |
|
||||
| aeg | primary | aeg | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,c | sabc,sabc | depart,arrive |
|
||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Intersection too far away with Traffic Light shortly after initial split
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . . . . . . . . . . . . t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b . . c
|
||||
` . . . . . . . . . . . .
|
||||
` . . . . . . . . . . . .
|
||||
` . . . . . . . . . . . .
|
||||
` . . . . . . . . . . . .
|
||||
` . . . . . . . . . . . .
|
||||
` . . . . . . . . . . . .
|
||||
` . . .
|
||||
` e
|
||||
.
|
||||
f
|
||||
.
|
||||
"""
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| t | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| satbc | primary | sabc | |
|
||||
| dbef | primary | dbef | yes |
|
||||
| ae | primary | ae | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Traffic Signal on Sliproad
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . . . . b . . c
|
||||
` .
|
||||
` .
|
||||
` .
|
||||
t .
|
||||
` .
|
||||
e
|
||||
.
|
||||
.
|
||||
f
|
||||
"""
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| t | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sabc | primary | sabc | |
|
||||
| dbe | primary | dbe | yes |
|
||||
| ef | primary | ef | |
|
||||
| ate | primary | ate | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,ef,ef | depart,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad tagged as link
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . . . . b . . c
|
||||
` .
|
||||
` .
|
||||
` .
|
||||
` .
|
||||
` .
|
||||
e
|
||||
.
|
||||
.
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sabc | motorway | sabc | |
|
||||
| dbef | motorway | dbef | yes |
|
||||
| ae | motorway_link | ae | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad with same-ish names
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . b . . c
|
||||
` .
|
||||
. e
|
||||
..
|
||||
.
|
||||
f
|
||||
.
|
||||
t
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | ref | oneway |
|
||||
| sabc | primary | main | | |
|
||||
| dbe | primary | crossing | r0 | yes |
|
||||
| eft | primary | crossing | r0;r1 | yes |
|
||||
| af | primary | sliproad | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,t | main,crossing,crossing | depart,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, name mismatch
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . b . . c
|
||||
` .
|
||||
. e
|
||||
. .
|
||||
..
|
||||
.
|
||||
f
|
||||
.
|
||||
t
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sabc | primary | main | |
|
||||
| dbe | primary | top | yes |
|
||||
| ef | primary | bottom | yes |
|
||||
| ft | primary | away | yes |
|
||||
| af | primary | sliproad | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,t | main,away,away | depart,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, low road priority
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . b . . c
|
||||
` .
|
||||
. e
|
||||
. .
|
||||
..
|
||||
.
|
||||
f
|
||||
.
|
||||
t
|
||||
"""
|
||||
|
||||
And the ways
|
||||
# maxspeed otherwise service road will never be routed over and we won't see instructions
|
||||
| nodes | highway | name | maxspeed | oneway |
|
||||
| sabc | primary | main | 30 km/h | |
|
||||
| dbe | primary | crossing | 30 km/h | yes |
|
||||
| eft | primary | crossing | 30 km/h | yes |
|
||||
| ft | primary | away | 30 km/h | yes |
|
||||
| af | service | sliproad | 30 km/h | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,t | main,away,away | depart,turn right,arrive |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, more than three roads at target intersection
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
s . a . . b . . c
|
||||
` .
|
||||
. e
|
||||
. .
|
||||
..
|
||||
. h
|
||||
f .
|
||||
. g
|
||||
t
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| sabc | primary | main | |
|
||||
| dbe | primary | top | yes |
|
||||
| eft | primary | bottom | yes |
|
||||
| fh | primary | another | |
|
||||
| fg | primary | another | |
|
||||
| af | primary | sliproad | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
|
||||
|
||||
@sliproads:
|
||||
Scenario: Throughabout-Sliproad
|
||||
Given the node map
|
||||
"""
|
||||
t
|
||||
|
|
||||
- - e - -
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
z - s - a - - - - - - - b - - -x
|
||||
' c y
|
||||
| |
|
||||
\ /
|
||||
- -d - -
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | junction | # |
|
||||
| zs | through | trunk | yes | | |
|
||||
| sa | through | trunk | yes | | |
|
||||
| ab | through | trunk | yes | | |
|
||||
| bx | through | trunk | yes | | |
|
||||
| ac | round | primary | yes | roundabout | |
|
||||
| cdy | round | primary | yes | roundabout | |
|
||||
| yb | round | primary | yes | roundabout | |
|
||||
| be | round | primary | yes | roundabout | |
|
||||
| ea | round | primary | yes | roundabout | |
|
||||
| et | out | primary | yes | | the extraterrestrial |
|
||||
| sc | | trunk_link | yes | | |
|
||||
| yx | right | trunk_link | yes | | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sa | ab | a | only_straight |
|
||||
| restriction | ab | bx | b | only_straight |
|
||||
| restriction | yb | be | b | only_straight |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
|
||||
|
||||
Scenario: Sliproad before a roundabout
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a - b - - c - d
|
||||
'f|l'
|
||||
m
|
||||
g
|
||||
|
|
||||
.h-_
|
||||
k - i |
|
||||
'.j.'
|
||||
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway | highway | name |
|
||||
| ab | | yes | primary | road |
|
||||
| bc | | yes | primary | road |
|
||||
| cd | | yes | primary | road |
|
||||
| ec | | yes | secondary | |
|
||||
| cm | | yes | secondary | |
|
||||
| mg | | yes | primary | |
|
||||
| gh | | no | primary | |
|
||||
| hijh | roundabout | yes | primary | |
|
||||
| ik | | yes | primary | |
|
||||
| bfm | | yes | primary | |
|
||||
| gld | | yes | primary | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bc | cd | c | only_straight |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,k | road,,, | depart,continue right,roundabout turn right exit-1,arrive | a,b,h,k |
|
||||
|
||||
@@ -16,28 +16,34 @@ Feature: Destination Signs
|
||||
m n
|
||||
o p
|
||||
q r
|
||||
s t
|
||||
u v
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | ref | destination | destination:ref | oneway | # |
|
||||
| ab | AB | E1 | | | yes | |
|
||||
| cd | CD | | Berlin | | yes | |
|
||||
| ef | EF | | Berlin | A1 | yes | |
|
||||
| gh | | | Berlin | A1 | yes | |
|
||||
| ij | | | Berlin | | yes | |
|
||||
| kl | KL | E1 | Berlin | A1 | yes | |
|
||||
| mn | MN | | Berlin;Hamburg | A1;A2 | yes | |
|
||||
| op | OP | | Berlin;Hamburg | A1;A2 | no | mis-tagged destination: not a oneway |
|
||||
| qr | QR | | | A1;A2 | yes | |
|
||||
| nodes | name | ref | destination | destination:ref | destination:street | oneway | # |
|
||||
| ab | AB | E1 | | | | yes | |
|
||||
| cd | CD | | Berlin | | | yes | |
|
||||
| ef | EF | | Berlin | A1 | | yes | |
|
||||
| gh | | | Berlin | A1 | | yes | |
|
||||
| ij | | | Berlin | | | yes | |
|
||||
| kl | KL | E1 | Berlin | A1 | | yes | |
|
||||
| mn | MN | | Berlin;Hamburg | A1;A2 | | yes | |
|
||||
| op | OP | | Berlin;Hamburg | A1;A2 | | no | mis-tagged destination: not a oneway |
|
||||
| qr | QR | | | A1;A2 | | yes | |
|
||||
| st | ST | | | | St Street | yes | |
|
||||
| uv | UV | | Berlin | | St Street | yes | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | destinations | ref | # |
|
||||
| a | b | AB,AB | , | E1,E1 | |
|
||||
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||
| i | j | , | Berlin,Berlin | , | |
|
||||
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||
| from | to | route | destinations | ref | # |
|
||||
| a | b | AB,AB | , | E1,E1 | |
|
||||
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||
| i | j | , | Berlin,Berlin | , | |
|
||||
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||
| s | t | ST,ST | St Street,St Street | , | |
|
||||
| u | v | UV,UV | Berlin,Berlin | , | city preferred over street |
|
||||
|
||||
@@ -36,4 +36,4 @@ Feature: Destination Signs
|
||||
| h | g | GH,GH | A2: Hamburg,A2: Hamburg | , | |
|
||||
| i | j | IJ,IJ | A1: Berlin,A1: Berlin | , | |
|
||||
| l | k | KL,KL | A2: Hamburg,A2: Hamburg | , | |
|
||||
| m | n | MN,MN | , | , | guard against mis-tagging |
|
||||
| m | n | MN,MN | , | , | guard against mis-tagging |
|
||||
|
||||
@@ -24,6 +24,44 @@ Feature: End Of Road Instructions
|
||||
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
@3605
|
||||
Scenario: End of Road with oneway through street
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a e b
|
||||
f d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| aeb | primary | no |
|
||||
| cbd | primary | yes |
|
||||
| ef | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
@3605
|
||||
Scenario: End of Road fromnameless onto through street
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a e b
|
||||
f d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | name |
|
||||
| aeb | primary | no | |
|
||||
| cbd | primary | yes | cbd |
|
||||
| ef | primary | no | ef |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with three streets
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
@routing @guidance
|
||||
Feature: Exceptions for routing onto low-priority roads
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Straight onto low-priority: same name
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
|
||||
a b d
|
||||
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abd | residential | road |
|
||||
| eb | service | service |
|
||||
| bc | service | service |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| c,e | service,service | depart,arrive |
|
||||
| e,c | service,service | depart,arrive |
|
||||
|
||||
Scenario: Straight onto low-priority: onto and from unnamed
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
|
||||
a b d
|
||||
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abd | residential | road |
|
||||
| eb | service | |
|
||||
| bc | service | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| e,c | , | depart,arrive |
|
||||
| c,e | , | depart,arrive |
|
||||
|
||||
Scenario: Straight onto low-priority: unnamed
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
|
||||
a b d
|
||||
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abd | residential | road |
|
||||
| eb | service | service |
|
||||
| bc | service | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| e,c | service, | depart,arrive |
|
||||
| c,e | ,service,service | depart,turn straight,arrive |
|
||||
|
||||
Scenario: Straight onto low-priority
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | residential | road |
|
||||
| bc | service | service |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | road,service,service | depart,new name straight,arrive |
|
||||
|
||||
Scenario: Straight onto low-priority, with driveway
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
a b c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | residential | road |
|
||||
| bc | service | road |
|
||||
| bf | driveway | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | road,road | depart,arrive |
|
||||
|
||||
Scenario: Straight onto low-priority, with driveway
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
a b c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | residential | road |
|
||||
| bc | service | |
|
||||
| bf | driveway | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | road, | depart,arrive |
|
||||
| c,a | ,road,road | depart,new name straight,arrive |
|
||||
@@ -0,0 +1,525 @@
|
||||
@guidance @merge-segregated
|
||||
Feature: Merge Segregated Roads
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 3 meters
|
||||
|
||||
#http://www.openstreetmap.org/#map=18/52.49950/13.33916
|
||||
@negative
|
||||
Scenario: oneway link road
|
||||
Given the node map
|
||||
"""
|
||||
f - - - - - - -_-_e - - - - d
|
||||
...''
|
||||
a - - - b'- - - - - - - - - c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| abc | road | yes |
|
||||
| def | road | yes |
|
||||
| be | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,c | road,road | true:90,true:75 true:90 false:270;true:270 |
|
||||
| d,f | road,road | true:270,false:90 false:255 true:270;true:90 |
|
||||
|
||||
#http://www.openstreetmap.org/#map=18/52.48337/13.36184
|
||||
@negative
|
||||
Scenario: Square Area - Same Name as road for in/out
|
||||
Given the node map
|
||||
"""
|
||||
i
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
a - - - - c e - - - - f
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
d
|
||||
|
|
||||
|
|
||||
|
|
||||
j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ac | road | no |
|
||||
| ef | road | no |
|
||||
| cdegc | road | yes |
|
||||
| ig | top | no |
|
||||
| jd | bot | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,f | road,road,road,road | true:90,false:45 true:135 false:270;true:45 true:180 false:315;true:90 false:225 true:315;true:270 |
|
||||
|
||||
#https://www.openstreetmap.org/#map=19/52.50003/13.33915
|
||||
@negative
|
||||
Scenario: Short Segment due to different roads
|
||||
Given the node map
|
||||
"""
|
||||
. d
|
||||
. '
|
||||
. '
|
||||
. '
|
||||
. '
|
||||
a - - - - - - - b - - c - - - - - - e
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
.
|
||||
f
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| abce | pass | no |
|
||||
| db | pass | yes |
|
||||
| fg | aug | no |
|
||||
| bfc | aug | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,e | pass,pass | true:90,false:60 true:90 true:165 false:270,true:90 false:195 false:270;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Tripple Merge should not be possible
|
||||
Given the node map
|
||||
"""
|
||||
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
||||
.
|
||||
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
||||
'
|
||||
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | in | no |
|
||||
| gfb | merge | yes |
|
||||
| be | merge | yes |
|
||||
| dcb | merge | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,e | in,merge,merge | true:90;false:60 true:90 false:120 false:270;true:270 |
|
||||
|
||||
Scenario: Tripple Merge should not be possible
|
||||
Given the node map
|
||||
"""
|
||||
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
||||
.
|
||||
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
||||
'
|
||||
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | in | no |
|
||||
| gfb | merge | yes |
|
||||
| eb | merge | yes |
|
||||
| bcd | merge | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,d | in,merge,merge | true:90;false:60 false:90 true:120 false:270;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Don't accept turn-restrictions
|
||||
Given the node map
|
||||
"""
|
||||
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||
/ \
|
||||
a - - - b g - - h
|
||||
\ /
|
||||
e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | yes |
|
||||
| befgh | road | yes |
|
||||
| bcdg | road | yes |
|
||||
|
||||
# This is an artificial scenario - not reasonable. It is only to test the merging on turn-restrictions
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | ab | bcdg | b | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,h | road,road | true:90,false:60 true:120 false:270,true:90 false:240 false:300;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Actual Turn into segregated ways
|
||||
Given the node map
|
||||
"""
|
||||
a - - - b - < - < - < - < - < - < - < - < - < - < - < c -
|
||||
| \
|
||||
| |
|
||||
| |
|
||||
d |
|
||||
\ |
|
||||
\ |
|
||||
e > - > - > - > - > - > - > - > - > - > - > f - - - - - - g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| fcb | road | yes |
|
||||
| bdef | road | yes |
|
||||
| fg | road | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,g | road,road | true:90,false:90 true:150 false:270,true:90 false:270 true:345;true:270 |
|
||||
|
||||
Scenario: Merging parallel roads with intermediate bridges
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
|
|
||||
.e.
|
||||
/ \
|
||||
/ \
|
||||
g d
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
h c
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
b
|
||||
|
|
||||
a
|
||||
|
|
||||
|
|
||||
r - x - s
|
||||
|
|
||||
|
|
||||
y
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | lanes |
|
||||
| ab | Hermannstr | secondary | | 2 |
|
||||
| bc | Hermannstr | secondary | yes | 2 |
|
||||
| cd | Hermannbruecke | secondary | yes | 2 |
|
||||
| de | Hermannstr | secondary | yes | 2 |
|
||||
| ef | Hermannstr | secondary | | 4 |
|
||||
| eg | Hermannstr | secondary | yes | 2 |
|
||||
| gh | Hermannbruecke | secondary | yes | 2 |
|
||||
| hb | Hermannstr | secondary | yes | 2 |
|
||||
| xa | Hermannstr | secondary | | 4 |
|
||||
| yx | Hermannstr | secondary | | 4 |
|
||||
| rxs | Silbersteinstr | tertiary | | 1 |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
#the intermediate intersections of degree two indicate short segments of new names. At some point, we probably want to get rid of these
|
||||
When I route I should get
|
||||
| waypoints | turns | route | intersections |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 false:180,true:0 false:180;true:180 |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180;true:0 |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 true:90 false:180 true:270,true:0 false:180,true:0 false:180;true:180 |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180,false:0 true:90 true:180 true:270;true:0 |
|
||||
|
||||
Scenario: Four Way Intersection Double Through Street Segregated
|
||||
Given the node map
|
||||
"""
|
||||
q p
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
b c
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
j - - - - - - - - - - - - - - - - - i . \ / , d - - - - - - - - - - - - - - - - - o
|
||||
. \/ .
|
||||
> a <
|
||||
. /\ '
|
||||
. / \ '
|
||||
k - - - - - - - - - - - - - - - - - h / \ e - - - - - - - - - - - - - - - - - n
|
||||
/ \
|
||||
/ \
|
||||
g f
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
l m
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | name | lanes |
|
||||
| khaij | primary | yes | first | 4 |
|
||||
| odaen | primary | yes | first | 4 |
|
||||
| qbacp | primary | yes | second | 4 |
|
||||
| mfagl | primary | yes | second | 4 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| f,e | second,first,first | depart,turn right,arrive |
|
||||
| f,c | second,second | depart,arrive |
|
||||
| f,i | second,first,first | depart,turn left,arrive |
|
||||
| f,g | second,second,second | depart,continue uturn,arrive |
|
||||
| d,c | first,second,second | depart,turn right,arrive |
|
||||
| d,i | first,first | depart,arrive |
|
||||
| d,g | first,second,second | depart,turn left,arrive |
|
||||
| d,e | first,first,first | depart,continue uturn,arrive |
|
||||
| b,i | second,first,first | depart,turn right,arrive |
|
||||
| b,g | second,second | depart,arrive |
|
||||
| b,e | second,first,first | depart,turn left,arrive |
|
||||
| b,c | second,second,second | depart,continue uturn,arrive |
|
||||
| h,g | first,second,second | depart,turn right,arrive |
|
||||
| h,e | first,first | depart,arrive |
|
||||
| h,c | first,second,second | depart,turn left,arrive |
|
||||
| h,i | first,first,first | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Middle Island Over Bridge
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
.b.
|
||||
c h
|
||||
| |
|
||||
| |
|
||||
1 2
|
||||
| |
|
||||
d g
|
||||
'e'
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bc | road | yes |
|
||||
| cd | bridge | yes |
|
||||
| de | road | yes |
|
||||
| eg | road | yes |
|
||||
| gh | bridge | yes |
|
||||
| hb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route | intersections |
|
||||
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
|
||||
| c,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
|
||||
| 1,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
|
||||
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
|
||||
| g,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
|
||||
| 2,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
|
||||
|
||||
@negative
|
||||
Scenario: Traffic Circle
|
||||
Given the node map
|
||||
"""
|
||||
a - - - - b - - - e - - - c - - - - d
|
||||
\ /
|
||||
\ /
|
||||
f
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | left | no |
|
||||
| bfceb | circle | yes |
|
||||
| fg | bottom | no |
|
||||
| cd | right | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
|
||||
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
|
||||
|
||||
Scenario: Middle Island
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
b
|
||||
c h
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
d g
|
||||
e
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bcde | road | yes |
|
||||
| eghb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,arrive | road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,arrive | road,road |
|
||||
|
||||
Scenario: Traffic Island
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
a - - b < > d - - e
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| de | road | no |
|
||||
| bcdfb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,e | road,road | true:90;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Turning Road, Don't remove sliproads
|
||||
Given the node map
|
||||
"""
|
||||
h - - - - - g - - - - - - f - - - - - e
|
||||
_ '
|
||||
.
|
||||
a - - - - - b - - - - - - c - - - - - d
|
||||
|
|
||||
|
|
||||
|
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | yes |
|
||||
| bcd | road | yes |
|
||||
| efgh | road | yes |
|
||||
| fb | road | yes |
|
||||
| bi | turn | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | fb | bcd | b | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,d | road,road | depart,arrive | true:90,false:60 true:90 true:180 false:270;true:270 |
|
||||
| e,h | road,road | depart,arrive | true:270,false:90 true:240 true:270;true:90 |
|
||||
| e,i | road,turn,turn | depart,turn left,arrive | true:270;false:90 true:240 true:270,false:60 false:90 true:180 false:270;true:0 |
|
||||
@negative
|
||||
Scenario: Meeting Turn Roads
|
||||
Given the node map
|
||||
"""
|
||||
k l
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
h - - - - - g - - - - - - - f - - - - - e
|
||||
| ' ' |
|
||||
| x |
|
||||
| . . |
|
||||
a - - - - - b - - - - - - - c - - - - - d
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
i j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | horiz | yes |
|
||||
| bc | horiz | yes |
|
||||
| cd | horiz | yes |
|
||||
| ef | horiz | yes |
|
||||
| fg | horiz | yes |
|
||||
| gh | horiz | yes |
|
||||
| kg | vert | yes |
|
||||
| gb | vert | yes |
|
||||
| bi | vert | yes |
|
||||
| jc | vert | yes |
|
||||
| cf | vert | yes |
|
||||
| fl | vert | yes |
|
||||
| gx | horiz | no |
|
||||
| xc | horiz | no |
|
||||
| fx | horiz | no |
|
||||
| xb | horiz | no |
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bc | cf | c | no_left_turn |
|
||||
| restriction | fg | gb | g | no_left_turn |
|
||||
| restriction | cf | fg | f | no_left_turn |
|
||||
| restriction | gb | bc | b | no_left_turn |
|
||||
| restriction | xb | bc | b | no_left_turn |
|
||||
| restriction | xc | cf | c | no_left_turn |
|
||||
| restriction | xf | fg | f | no_left_turn |
|
||||
| restriction | xg | gb | g | no_left_turn |
|
||||
|
||||
# the goal here should be not to mention the intersection in the middle at all and also suppress the segregated parts
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,l | horiz,vert,vert | true:90;false:0 true:60 true:90 true:180 false:270,true:60 true:120 false:240 true:300,true:0 false:90 false:180 false:240 false:270;true:180 |
|
||||
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
|
||||
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,true:60 false:120 true:240 true:300,false:0 false:90 false:120 false:180 true:270;true:90 |
|
||||
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
|
||||
@@ -8,8 +8,8 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g
|
||||
a-b-c-d-e
|
||||
`--f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -25,9 +25,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Right Curved Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
f d
|
||||
g e
|
||||
a-b-c
|
||||
`f`d
|
||||
`g`e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -43,12 +43,11 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Right Curved Left
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
d g
|
||||
a b c f
|
||||
,e
|
||||
,d,g
|
||||
a-b-c-f
|
||||
"""
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abcde | motorway | |
|
||||
@@ -63,8 +62,8 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Left
|
||||
Given the node map
|
||||
"""
|
||||
f g
|
||||
a b c d e
|
||||
/--f-g
|
||||
a-b-c-d-e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -80,9 +79,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Left Curved Left
|
||||
Given the node map
|
||||
"""
|
||||
g e
|
||||
f d
|
||||
a b c
|
||||
,g,e
|
||||
,f,d
|
||||
a-b-c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -98,9 +97,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Left Curved Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c f
|
||||
d g
|
||||
e
|
||||
a-b-c-f
|
||||
`d`g
|
||||
`e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -116,8 +115,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On Ramp Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g
|
||||
a-b-c-d-e
|
||||
f-g---'
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -133,8 +132,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On Ramp Left
|
||||
Given the node map
|
||||
"""
|
||||
f g
|
||||
a b c d e
|
||||
f-g---,
|
||||
a-b-c-d-e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -150,9 +149,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Highway Fork
|
||||
Given the node map
|
||||
"""
|
||||
d e
|
||||
a b c
|
||||
f g
|
||||
/--d-e
|
||||
a-b-c
|
||||
\--f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -168,9 +167,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Fork After Ramp
|
||||
Given the node map
|
||||
"""
|
||||
d e
|
||||
a b c
|
||||
f g
|
||||
/--d-e
|
||||
a-b-c
|
||||
\--f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -187,8 +186,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On And Off Ramp Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g h i
|
||||
a-b---c---d-e
|
||||
f-g--/ \--h i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -207,8 +206,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On And Off Ramp Left
|
||||
Given the node map
|
||||
"""
|
||||
f g h i
|
||||
a b c d e
|
||||
f-g--\/---h-i
|
||||
a-b---c---d-e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -227,9 +226,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Merging Motorways
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c
|
||||
d
|
||||
e\
|
||||
a-b-c
|
||||
d/
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -246,8 +245,8 @@ Feature: Motorway Guidance
|
||||
Scenario: Handle 90 degree off ramps correctly
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
x b c y
|
||||
a\
|
||||
x-b---c-y
|
||||
d
|
||||
"""
|
||||
|
||||
|
||||
@@ -10,26 +10,31 @@ Feature: Simple Turns
|
||||
"""
|
||||
a
|
||||
b
|
||||
|
||||
|
||||
^
|
||||
/ \
|
||||
c d
|
||||
|
||||
e
|
||||
|
||||
f
|
||||
| |\
|
||||
| | e
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
g f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | road | primary | no |
|
||||
| bc | road | primary | yes |
|
||||
| bcg | road | primary | yes |
|
||||
| fdb | road | primary | yes |
|
||||
| de | turn | primary | no |
|
||||
| ed | turn | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| e,a | depart,turn slight right,arrive | turn,road,road |
|
||||
| waypoints | turns | route | intersections |
|
||||
| f,a | depart,arrive | road,road | true:0,true:0 false:150 false:180;true:180 |
|
||||
| e,a | depart,turn slight right,arrive | turn,road,road | true:333;true:0 false:150 false:180;true:180 |
|
||||
|
||||
Scenario: Turning into splitting road
|
||||
Given the node map
|
||||
@@ -39,16 +44,22 @@ Feature: Simple Turns
|
||||
/\
|
||||
/ \
|
||||
c d
|
||||
|\
|
||||
| e
|
||||
|
|
||||
f
|
||||
| |\
|
||||
| | e
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
h f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | road | primary | no |
|
||||
| bc | road | primary | yes |
|
||||
| bch | road | primary | yes |
|
||||
| fdb | road | primary | yes |
|
||||
| de | turn | primary | no |
|
||||
| bg | left | primary | yes |
|
||||
@@ -61,108 +72,6 @@ Feature: Simple Turns
|
||||
| f,g | depart,turn left,arrive | road,left,left |
|
||||
| f,c | depart,continue uturn,arrive | road,road,road |
|
||||
|
||||
Scenario: Middle Island
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
||||
b
|
||||
c h
|
||||
|
||||
|
||||
|
||||
|
||||
d g
|
||||
e
|
||||
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bcde | road | yes |
|
||||
| eghb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,arrive | road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,arrive | road,road |
|
||||
|
||||
Scenario: Middle Island Over Bridge
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
||||
b
|
||||
c h
|
||||
|
||||
|
||||
1 2
|
||||
|
||||
d g
|
||||
e
|
||||
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bc | road | yes |
|
||||
| cd | bridge | yes |
|
||||
| de | road | yes |
|
||||
| eg | road | yes |
|
||||
| gh | bridge | yes |
|
||||
| hb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,new name straight,arrive | bridge,road,road |
|
||||
| 1,f | depart,new name straight,arrive | bridge,road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,new name straight,arrive | bridge,road,road |
|
||||
| 2,a | depart,new name straight,arrive | bridge,road,road |
|
||||
|
||||
@negative
|
||||
Scenario: Don't Collapse Places:
|
||||
Given the node map
|
||||
"""
|
||||
h
|
||||
g
|
||||
|
||||
|
||||
|
||||
|
||||
a b e f
|
||||
|
||||
|
||||
|
||||
|
||||
c
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | place | no |
|
||||
| cd | bottom | no |
|
||||
| ef | place | no |
|
||||
| gh | top | no |
|
||||
| bcegb | place | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,turn right,arrive | place,bottom,bottom |
|
||||
| a,f | depart,continue left,continue right,arrive | place,place,place,place |
|
||||
| d,f | depart,turn right,continue right,arrive | bottom,place,place,place |
|
||||
| d,h | depart,turn right,continue left,turn right,arrive | bottom,place,place,top,top |
|
||||
|
||||
@bug @not-sorted @3179
|
||||
Scenario: Adjusting road angles to not be sorted
|
||||
Given the node map
|
||||
|
||||
@@ -261,7 +261,7 @@ Feature: Ramp Guidance
|
||||
"""
|
||||
d - e - g
|
||||
|
|
||||
a - b ~ ~ ~ ~ ~ ~ ~ c
|
||||
a - b ~ ~ ~ ~ ~ ~ ~ c
|
||||
` f
|
||||
"""
|
||||
|
||||
@@ -271,8 +271,8 @@ Feature: Ramp Guidance
|
||||
| bc | | ferry | boaty mc boatface | m2 |
|
||||
| cf | | ferry | boaty mc boatface | |
|
||||
| cd | | ferry | boaty mc boatface's cousin | |
|
||||
| de | motorway_link | | | |
|
||||
| de | motorway_link | | | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,e | boarding,boaty mc boatface,boaty mc boatface's cousin,, |
|
||||
| waypoints | route |
|
||||
| a,e | boarding,boaty mc boatface,, |
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
@routing @guidance @left-handed
|
||||
Feature: Basic Roundabout
|
||||
|
||||
Background:
|
||||
Given a grid size of 10 meters
|
||||
Given the profile file
|
||||
"""
|
||||
require 'car'
|
||||
properties.left_hand_driving = true
|
||||
"""
|
||||
|
||||
Scenario: Roundabout exit counting for left sided driving
|
||||
And a grid size of 10 meters
|
||||
And the node map
|
||||
"""
|
||||
a
|
||||
b
|
||||
h g c d
|
||||
e
|
||||
f
|
||||
"""
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
|
||||
|
||||
Scenario: Mixed Entry and Exit
|
||||
And a grid size of 10 meters
|
||||
And the node map
|
||||
"""
|
||||
c a
|
||||
j b f
|
||||
k e
|
||||
l h d
|
||||
g i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| cba | | yes |
|
||||
| fed | | yes |
|
||||
| ihg | | yes |
|
||||
| lkj | | yes |
|
||||
| behkb | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| c,a | cba,cba,cba | depart,roundabout-exit-1,arrive |
|
||||
| l,a | lkj,cba,cba | depart,roundabout-exit-2,arrive |
|
||||
| i,a | ihg,cba,cba | depart,roundabout-exit-3,arrive |
|
||||
@@ -38,6 +38,30 @@ Feature: Basic Roundabout
|
||||
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
|
||||
Scenario: Roundabout With Service
|
||||
Given the node map
|
||||
"""
|
||||
a h
|
||||
bg
|
||||
d c
|
||||
e
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | highway |
|
||||
| ab | | primary |
|
||||
| cd | | primary |
|
||||
| ef | | service |
|
||||
| gh | | primary |
|
||||
| bcegb | roundabout | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,roundabout-exit-1,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout-exit-2,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
||||
|
||||
#2927
|
||||
Scenario: Only Roundabout
|
||||
Given the node map
|
||||
@@ -468,3 +492,192 @@ Feature: Basic Roundabout
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| e,h | left,right,right | depart,roundabout-exit-2,arrive |
|
||||
|
||||
@3361
|
||||
Scenario: Bersarinplatz (Not a Roundabout)
|
||||
Given the node map
|
||||
"""
|
||||
a n
|
||||
|
||||
b m
|
||||
|
||||
c l
|
||||
|
||||
d e j k
|
||||
|
||||
f h
|
||||
|
||||
g i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | name | ref | highway | oneway |
|
||||
| ab | | Petersburger Strasse | B 96a | primary | yes |
|
||||
| bc | circular | Bersarinplatz | B 96a | primary | |
|
||||
| ce | circular | Bersarinplatz | B 96a | primary | |
|
||||
| ed | | Weidenweg | | residential | |
|
||||
| ef | circular | Bersarinplatz | B 96a | primary | |
|
||||
| fg | | Petersburger Strasse | B 96a | primary | yes |
|
||||
| fh | circular | Bersarinplatz | | secondary | |
|
||||
| ih | | Petersburger Strasse | B 96a | primary | yes |
|
||||
| hj | circular | Bersarinplatz | | secondary | |
|
||||
| jk | | Rigaer Strasse | | residential | |
|
||||
| jl | circular | Bersarinplatz | | secondary | |
|
||||
| lm | circular | Bersarinplatz | | secondary | |
|
||||
| mb | circular | Bersarinplatz | | secondary | |
|
||||
| mn | | Petersburger Strasse | B 96a | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
|
||||
| d,g | Weidenweg,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-1,arrive |
|
||||
| i,k | Petersburger Strasse,Rigaer Strasse,Rigaer Strasse | depart,Bersarinplatz-exit-1,arrive |
|
||||
| i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
|
||||
| i,d | Petersburger Strasse,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,arrive |
|
||||
| i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,arrive |
|
||||
|
||||
@turboroundabout
|
||||
# http://www.openstreetmap.org/?mlat=48.782118&mlon=8.194456&zoom=16#map=19/48.78216/8.19457
|
||||
Scenario: Turboroundabout, Baden-Baden
|
||||
Given the node map
|
||||
"""
|
||||
a p
|
||||
b o
|
||||
d c m n
|
||||
f e k l
|
||||
g i
|
||||
h j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | junction | name | turn:lanes |
|
||||
| ab | trunk_link | yes | | | |
|
||||
| bc | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
||||
| cd | trunk | yes | | Europastrasse | |
|
||||
| ce | trunk | yes | roundabout | Europaplatz | |
|
||||
| fe | trunk | yes | | Europastrasse | |
|
||||
| eg | trunk | yes | roundabout | Europaplatz | |
|
||||
| gh | residential | yes | | Allee Cite | |
|
||||
| gi | trunk | yes | roundabout | Europaplatz | |
|
||||
| ji | residential | yes | | Allee Cite | |
|
||||
| ik | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
||||
| kl | trunk | yes | | Europastrasse | |
|
||||
| km | trunk | yes | roundabout | Europaplatz | |
|
||||
| nm | trunk | yes | | Europastrasse | |
|
||||
| mo | trunk | yes | roundabout | Europaplatz | |
|
||||
| op | trunk_link | yes | | | |
|
||||
| ob | trunk | yes | roundabout | Europaplatz | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive | ,, |
|
||||
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive | ,, |
|
||||
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive | ,, |
|
||||
| a,p | ,, | depart,Europaplatz-exit-4,arrive | ,, |
|
||||
|
||||
@turboroundabout
|
||||
# http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506
|
||||
Scenario: Turboroundabout, Königstein im Taunus
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b w t v
|
||||
c s u
|
||||
d r
|
||||
f e q
|
||||
g p
|
||||
h i n
|
||||
j k m
|
||||
l o
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | junction | name | turn:lanes |
|
||||
| ab | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||
| bc | primary | yes | roundabout | | through\|through;right |
|
||||
| cd | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| df | tertiary | yes | | Frankfurter Strasse | |
|
||||
| de | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| fe | tertiary | yes | | Frankfurter Strasse | |
|
||||
| eg | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| gh | primary | yes | | Bischof-Kaller-Strasse | |
|
||||
| gi | primary | yes | roundabout | | left\|through;slight_left\|through |
|
||||
| ji | primary | yes | | Bischof-Kaller-Strasse | |
|
||||
| ik | primary | yes | roundabout | | left\|through;slight_left\|through |
|
||||
| km | primary | yes | roundabout | | |
|
||||
| kl | primary | yes | | Sodener Strasse | |
|
||||
| mn | primary | yes | roundabout | | through\|through;right |
|
||||
| on | primary | yes | | Sodener Strasse | |
|
||||
| np | primary | yes | roundabout | | through\|through;right |
|
||||
| pq | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| qr | primary | yes | | | |
|
||||
| qs | primary | yes | roundabout | | |
|
||||
| us | primary_link | yes | | | |
|
||||
| st | primary | yes | roundabout | | |
|
||||
| vt | primary | yes | | | |
|
||||
| tw | primary | yes | roundabout | | left\|left\|right\|right |
|
||||
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||
| wb | primary | yes | roundabout | | through\|through;right |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive | ,, |
|
||||
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive | ,, |
|
||||
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive | ,, |
|
||||
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive | ,, |
|
||||
| u,r | ,, | depart,roundabout-exit-5,arrive | ,, |
|
||||
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive | ,, |
|
||||
| n,m | , | depart,arrive | , |
|
||||
|
||||
@turboroundabout
|
||||
# http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711
|
||||
Scenario: Turboroundabout, Rheinfelden (Baden)
|
||||
Given the node map
|
||||
"""
|
||||
r w
|
||||
a l k
|
||||
b j
|
||||
c
|
||||
d i
|
||||
s e f g h v
|
||||
|
||||
t u
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | junction |
|
||||
| ar | secondary | yes | |
|
||||
| ab | primary | yes | roundabout |
|
||||
| rb | secondary | yes | |
|
||||
| bc | primary | yes | roundabout |
|
||||
| cd | primary | yes | roundabout |
|
||||
| ds | primary | yes | |
|
||||
| se | primary | yes | |
|
||||
| de | primary | yes | roundabout |
|
||||
| ef | primary | yes | roundabout |
|
||||
| ft | unclassified | yes | |
|
||||
| fg | primary | yes | roundabout |
|
||||
| ug | unclassified | yes | |
|
||||
| gh | primary | yes | roundabout |
|
||||
| hv | primary | yes | |
|
||||
| hi | primary | yes | roundabout |
|
||||
| vi | primary | yes | |
|
||||
| ij | primary | yes | roundabout |
|
||||
| jw | tertiary | yes | |
|
||||
| jk | primary | yes | roundabout |
|
||||
| wk | tertiary | yes | |
|
||||
| kl | primary | yes | roundabout |
|
||||
| la | primary | yes | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| w,r | wk,ar,ar | depart,roundabout-exit-1,arrive |
|
||||
| w,s | wk,ds,ds | depart,roundabout-exit-2,arrive |
|
||||
| w,t | wk,ft,ft | depart,roundabout-exit-3,arrive |
|
||||
| w,v | wk,hv,hv | depart,roundabout-exit-4,arrive |
|
||||
| u,v | ug,hv,hv | depart,roundabout-exit-1,arrive |
|
||||
| u,w | ug,jw,jw | depart,roundabout-exit-2,arrive |
|
||||
| u,r | ug,ar,ar | depart,roundabout-exit-3,arrive |
|
||||
| u,s | ug,ds,ds | depart,roundabout-exit-4,arrive |
|
||||
| u,t | ug,ft,ft | depart,roundabout-exit-5,arrive |
|
||||
|
||||
@@ -25,7 +25,7 @@ Feature: Staggered Intersections
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Oak St | depart,arrive |
|
||||
| g,a | Oak St,Oak St | depart,arrive |
|
||||
|
||||
@@ -98,3 +98,48 @@ Feature: Staggered Intersections
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Cedar Dr,Elm St,Elm St | depart,turn right,turn left,arrive |
|
||||
| g,a | Elm St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if a mode change is involved
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | route |
|
||||
| abc | primary | to_sea | |
|
||||
| ef | | to_sea | ferry |
|
||||
| fg | primary | road | |
|
||||
| jcdeh | primary | road | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | to_sea,road,to_sea,road,road | depart,turn right,turn left,notification straight,arrive | driving,driving,ferry,driving,driving |
|
||||
| g,a | road,to_sea,road,to_sea,to_sea | depart,notification straight,turn right,turn left,arrive | driving,ferry,driving,driving,driving |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse intermediary intersections
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
e f g
|
||||
d
|
||||
k l m
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | primary | Oak St |
|
||||
| efg | residential | Elm St |
|
||||
| klm | residential | Oak St |
|
||||
| jcedki | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,m | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
| m,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
|
||||
@@ -8,8 +8,8 @@ Feature: Suppressed Turns
|
||||
Scenario: Do not announce passing a exit ramp
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g
|
||||
a-b-c-d-e
|
||||
\---f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -24,7 +24,7 @@ Feature: Suppressed Turns
|
||||
Scenario: Do not announce reference changes
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e f
|
||||
a-b-c-d-e-f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -43,7 +43,7 @@ Feature: Suppressed Turns
|
||||
Scenario: Don't Announce Turn on following major road class -- service
|
||||
Given the node map
|
||||
"""
|
||||
a b d
|
||||
a-b-d
|
||||
c
|
||||
"""
|
||||
|
||||
@@ -59,7 +59,7 @@ Feature: Suppressed Turns
|
||||
Scenario: Don't Announce Turn on following major road class -- residential
|
||||
Given the node map
|
||||
"""
|
||||
a b d
|
||||
a-b-d
|
||||
c
|
||||
"""
|
||||
|
||||
|
||||
@@ -201,14 +201,14 @@ Feature: Simple Turns
|
||||
| ef | residential | road | 2 | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | road,road | depart,arrive |
|
||||
| c,a | road,road | depart,arrive |
|
||||
| g,a | turn,road,road | depart,turn left,arrive |
|
||||
| g,c | turn,road,road | depart,turn right,arrive |
|
||||
| g,f | turn,road | depart,arrive |
|
||||
| c,f | road,road,road | depart,continue right,arrive |
|
||||
| a,f | road,road,road | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,c | road,road | depart,arrive | a,c |
|
||||
| c,a | road,road | depart,arrive | c,a |
|
||||
| g,a | turn,road,road | depart,turn left,arrive | g,b,a |
|
||||
| g,c | turn,road,road | depart,turn right,arrive | g,b,c |
|
||||
| g,f | turn,road,road | depart,turn left,arrive | g,e,f |
|
||||
| c,f | road,road,road | depart,continue right,arrive | c,b,f |
|
||||
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f |
|
||||
|
||||
# http://www.openstreetmap.org/#map=19/52.48753/13.52838
|
||||
Scenario: Traffic Circle
|
||||
@@ -249,7 +249,7 @@ Feature: Simple Turns
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,p | road,road,road | depart,roundabout turn straight exit-1,arrive | true:90;true:135 false:270 false:345,true:90 false:180 true:345;true:270 |
|
||||
| a,p | road,road,road | depart,roundabout turn straight exit-1,arrive | true:90;true:165 false:270 false:345,true:90 false:180 true:345;true:270 |
|
||||
|
||||
Scenario: Splitting Road with many lanes
|
||||
Given the node map
|
||||
@@ -317,30 +317,30 @@ Feature: Simple Turns
|
||||
Scenario: Curved Turn At Cross
|
||||
Given the node map
|
||||
"""
|
||||
h
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
| . b - - - - - - - - - - - - - - - - - - a
|
||||
| .
|
||||
| .
|
||||
| c
|
||||
|
|
||||
|
|
||||
|
|
||||
d
|
||||
|
|
||||
|
|
||||
|
|
||||
e |
|
||||
. |
|
||||
. |
|
||||
g - - - - - - - - - - - - - f |
|
||||
|
|
||||
|
|
||||
|
|
||||
i
|
||||
h
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
| . b - - - - - - - - - - - - - - - - - - - - - - - a
|
||||
| .
|
||||
| .
|
||||
| c
|
||||
|
|
||||
|
|
||||
|
|
||||
d
|
||||
|
|
||||
|
|
||||
|
|
||||
e |
|
||||
. |
|
||||
. |
|
||||
g - - - - - - - - - - - - - - - - - - f |
|
||||
|
|
||||
|
|
||||
|
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -443,9 +443,9 @@ Feature: Simple Turns
|
||||
| ef | residential | road | 2 | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,f | turn,road,road | depart,turn left,arrive |
|
||||
| c,f | road,road,road | depart,continue right,arrive |
|
||||
| waypoints | route | turns | locations | # |
|
||||
| g,f | turn,road | depart,arrive | g,f | #could offer an additional turn at `e` if you don't detect the turn in between as curve |
|
||||
| c,f | road,road,road | depart,continue right,arrive | c,b,f | |
|
||||
|
||||
#http://www.openstreetmap.org/search?query=52.479264%2013.295617#map=19/52.47926/13.29562
|
||||
Scenario: Splitting Roads with curved split
|
||||
@@ -627,12 +627,14 @@ Feature: Simple Turns
|
||||
| 1,h | ,allee,allee | depart,turn left,arrive |
|
||||
| 2,h | ,allee,allee | depart,turn left,arrive |
|
||||
|
||||
|
||||
#http://www.openstreetmap.org/#map=18/52.56251/13.32650
|
||||
@todo
|
||||
Scenario: Curved Turn on Separated Directions
|
||||
Given the node map
|
||||
"""
|
||||
e d
|
||||
f - - - - - - - - - - - - - - - c - - - - - - - - - - - j
|
||||
f c - - - - - - - - - - - j
|
||||
| l ' |
|
||||
| ' |
|
||||
| ' |
|
||||
@@ -680,6 +682,58 @@ Feature: Simple Turns
|
||||
| j,o | Kapweg,Kapweg,Kapweg | depart,continue uturn,arrive |
|
||||
| a,i | Kurt,Kurt,Kurt | depart,continue uturn,arrive |
|
||||
|
||||
#http://www.openstreetmap.org/#map=18/52.56251/13.32650
|
||||
Scenario: Curved Turn on Separated Directions
|
||||
Given the node map
|
||||
"""
|
||||
e d
|
||||
f c - - - - - - - - - - - j
|
||||
| l ' |
|
||||
| ' |
|
||||
| ' |
|
||||
| ' |
|
||||
| ' |
|
||||
| n |
|
||||
| |
|
||||
| ' |
|
||||
| |
|
||||
| ' |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|' |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
g |
|
||||
h - - - - - - - - - - - - - - - b - - - - - - - - - - - o
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
i a
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | lanes | highway |
|
||||
| jc | Kapweg | yes | 3 | primary |
|
||||
| clngh | Kapweg | yes | | primary_link |
|
||||
| hbo | Kapweg | yes | 2 | primary |
|
||||
| efh | Kurt | yes | 4 | secondary |
|
||||
| hi | Kurt | yes | 3 | primary |
|
||||
| ab | Kurt | yes | 4 | primary |
|
||||
| cd | Kurt | yes | 3 | secondary |
|
||||
| bc | Kurt | yes | 2 | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| j,i | Kapweg,Kurt,Kurt | depart,turn left,arrive |
|
||||
| j,o | Kapweg,Kapweg,Kapweg | depart,continue uturn,arrive |
|
||||
| a,i | Kurt,Kurt,Kurt | depart,continue uturn,arrive |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.53731/13.36033
|
||||
Scenario: Splitting Road to Left
|
||||
Given the node map
|
||||
@@ -714,7 +768,31 @@ Feature: Simple Turns
|
||||
|
||||
. .
|
||||
|
||||
g h
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
g h
|
||||
"""
|
||||
|
||||
And the nodes
|
||||
@@ -730,15 +808,15 @@ Feature: Simple Turns
|
||||
| cjk | Friede | no | | tertiary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Perle,Heide,Heide | depart,turn right,arrive |
|
||||
| a,k | Perle,Friede,Friede | depart,turn left,arrive |
|
||||
| a,e | Perle,Perle | depart,arrive |
|
||||
| e,k | Perle,Friede,Friede | depart,turn right,arrive |
|
||||
| e,g | Perle,Heide,Heide | depart,turn left,arrive |
|
||||
| h,k | Heide,Friede,Friede | depart,new name slight left,arrive |
|
||||
| h,e | Heide,Perle,Perle | depart,turn right,arrive |
|
||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive |
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,g | Perle,Heide,Heide | depart,turn right,arrive | true:90;true:90 true:180 false:270 true:345;true:18 |
|
||||
| a,k | Perle,Friede,Friede | depart,turn left,arrive | true:90;true:90 true:180 false:270 true:345;true:153 |
|
||||
| a,e | Perle,Perle | depart,arrive | true:90,true:90 true:180 false:270 true:345;true:270 |
|
||||
| e,k | Perle,Friede,Friede | depart,turn right,arrive | true:270;false:90 true:180 true:270 true:345;true:153 |
|
||||
| e,g | Perle,Heide,Heide | depart,turn left,arrive | true:270;false:90 true:180 true:270 true:345;true:18 |
|
||||
| h,k | Heide,Friede,Friede | depart,new name straight,arrive | true:16;true:90 true:180 true:270 true:345;true:153 |
|
||||
| h,e | Heide,Perle,Perle | depart,turn right,arrive | true:16;true:90 true:180 true:270 true:345;true:270 |
|
||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:180 true:270 true:345;true:90 |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
||||
Scenario: Curved Exit from Curved Road
|
||||
@@ -775,7 +853,7 @@ Feature: Simple Turns
|
||||
| waypoints | route | turns |
|
||||
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
|
||||
| a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
|
||||
| g,j | Erna,Siemens,Siemens | depart,turn sharp left,arrive |
|
||||
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
|
||||
| g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.51303/13.32170
|
||||
@@ -876,6 +954,36 @@ Feature: Simple Turns
|
||||
. . .
|
||||
. . .
|
||||
i . .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
e a
|
||||
"""
|
||||
|
||||
@@ -1112,8 +1220,9 @@ Feature: Simple Turns
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | lanes |
|
||||
| abcdefghijklmnopc | circled | residential | 1 |
|
||||
| nodes | name | highway | lanes | oneway |
|
||||
| abc | circled | residential | 1 | no |
|
||||
| cdefghijklmnopc | circled | residential | 1 | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | turns |
|
||||
@@ -1168,3 +1277,97 @@ Feature: Simple Turns
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,e | ab,bcde,bcde |
|
||||
|
||||
|
||||
@3401
|
||||
Scenario: Curve With Duplicated Coordinates
|
||||
Given the node locations
|
||||
| node | lat | lon | # |
|
||||
| a | 0.9999280745650984 | 1.0 | |
|
||||
| b | 0.9999280745650984 | 1.0000179813587253 | |
|
||||
| c | 0.9999280745650984 | 1.0000359627174509 | |
|
||||
| d | 0.9999460559238238 | 1.0000674300952204 | |
|
||||
| e | 0.9999640372825492 | 1.0000809161142643 | |
|
||||
| f | 0.9999820186412746 | 1.0000854114539457 | |
|
||||
| g | 1.0 | 1.0000854114539457 | |
|
||||
| h | 1.0 | 1.0000854114539457 | #same as g |
|
||||
| z | 0.9999100932063729 | 1.0000179813587253 | |
|
||||
# g
|
||||
# |
|
||||
# f
|
||||
# '
|
||||
# e
|
||||
# '
|
||||
# d
|
||||
# '
|
||||
#a - b - c
|
||||
# |
|
||||
# z
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | lanes | # |
|
||||
| ab | yes | 1 | |
|
||||
| zb | yes | 1 | |
|
||||
| bcdefgh | yes | 1 | #intentional duplication |
|
||||
|
||||
# we don't care for turn instructions, this is a coordinate extraction bug check
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,g | ab,bcdefgh,bcdefgh | true:90;true:45 false:180 false:270;true:180 |
|
||||
|
||||
#https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580
|
||||
Scenario: Oszillating Lower Priority Road
|
||||
#Given the node map
|
||||
# """
|
||||
# a -db c
|
||||
# f
|
||||
# """
|
||||
Given the node locations
|
||||
| node | lat | lon | # |
|
||||
| a | 1.0 | 1.0 | |
|
||||
| b | 1.0000179813587253 | 1.0 | |
|
||||
| c | 1.0000204580571323 | 1.0 | |
|
||||
| d | 1.0000179813587253 | 1.0 | same as b |
|
||||
| f | 1.0000179813587253 | 1.0000179813587253 | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | lanes | highway |
|
||||
| ab | yes | 1 | primary |
|
||||
| bf | yes | 1 | primary |
|
||||
| bcd | yes | 1 | service |
|
||||
|
||||
# we don't care for turn instructions, this is a coordinate extraction bug check
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,d | ab,ab |
|
||||
|
||||
Scenario: Sharp Turn Onto A Bridge
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
ga - - -b
|
||||
f /
|
||||
d -c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | lanes |
|
||||
| gaf | yes | 1 |
|
||||
| abcde | yes | 1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| g,e | abcde,abcde |
|
||||
|
||||
@@ -44,6 +44,27 @@ Feature: Turn Lane Guidance
|
||||
| a,c | in,straight,straight | depart,new name straight,arrive | ,straight:true right:false, |
|
||||
| a,d | in,right,right | depart,turn right,arrive | ,straight:false right:true, |
|
||||
|
||||
# Turn Lane onto a ferry could end up breaking in intersection generation
|
||||
Scenario: Basic Turn Lane 3-way Turn with designated lane
|
||||
Given the node map
|
||||
"""
|
||||
a - b ~ ~ c - e
|
||||
| |
|
||||
d f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name | route |
|
||||
| ab | through\|through\|right | ferry-route | |
|
||||
| bc | through\|through\|right | ferry-route | ferry |
|
||||
| ce | | ferry-route | |
|
||||
| bd | | right | |
|
||||
| cf | | right | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ferry-route,ferry-route,ferry-route,ferry-route | depart,notification straight,notification straight,arrive |
|
||||
|
||||
@simple
|
||||
Scenario: Basic Turn Lane 4-Way Turn
|
||||
Given the node map
|
||||
@@ -95,24 +116,25 @@ Feature: Turn Lane Guidance
|
||||
Scenario: Basic Turn Lane 4-Way With U-Turn Lane
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a 1 b c
|
||||
d
|
||||
e
|
||||
f a-1-b---c
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes | turn:lanes:forward | name |
|
||||
| ab | | reverse;left\|through;right | in |
|
||||
| bc | | | straight |
|
||||
| bd | | | right |
|
||||
| be | | | left |
|
||||
| nodes | turn:lanes | turn:lanes:forward | name | # |
|
||||
| ab | | reverse;left\|through;right | in | |
|
||||
| bc | | | straight | |
|
||||
| bd | | | right | |
|
||||
| be | | | left | |
|
||||
| fa | | | uturn-avoider | #due to https://github.com/Project-OSRM/osrm-backend/issues/3359 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | turns | lanes |
|
||||
| a | c | 180,180 180,180 | in,straight,straight | depart,new name straight,arrive | ,left;uturn:false straight;right:true, |
|
||||
| a | d | 180,180 180,180 | in,right,right | depart,turn right,arrive | ,left;uturn:false straight;right:true, |
|
||||
| a | e | 180,180 180,180 | in,left,left | depart,turn left,arrive | ,left;uturn:true straight;right:false, |
|
||||
| 1 | a | 90,2 270,2 | in,in,in | depart,turn uturn,arrive | ,left;uturn:true straight;right:false, |
|
||||
| from | to | bearings | route | turns | lanes | locations |
|
||||
| a | c | 180,180 180,180 | in,straight,straight | depart,new name straight,arrive | ,left;uturn:false straight;right:true, | a,b,c |
|
||||
| a | d | 180,180 180,180 | in,right,right | depart,turn right,arrive | ,left;uturn:false straight;right:true, | a,b,d |
|
||||
| a | e | 180,180 180,180 | in,left,left | depart,turn left,arrive | ,left;uturn:true straight;right:false, | a,b,e |
|
||||
| 1 | a | 90,2 270,2 | in,in,in | depart,turn uturn,arrive | ,left;uturn:true straight;right:false, | _,b,a |
|
||||
|
||||
|
||||
#this next test requires decision on how to announce lanes for going straight if there is no turn
|
||||
@@ -577,22 +599,21 @@ Feature: Turn Lane Guidance
|
||||
Scenario: Segregated Intersection Merges With Lanes
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
|
||||
e d
|
||||
c g
|
||||
a b
|
||||
|
||||
h
|
||||
a e
|
||||
| |
|
||||
| |
|
||||
b d
|
||||
h c
|
||||
' -- g - - f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | turn:lanes:forward | oneway | highway |
|
||||
| abc | road | left\|left\|left\|through\|through | yes | primary |
|
||||
| cde | road | | yes | primary |
|
||||
| hc | cross | | yes | secondary |
|
||||
| cg | straight | | no | tertiary |
|
||||
| cf | left | | yes | primary |
|
||||
| nodes | name | turn:lanes:forward | oneway | highway | lanes |
|
||||
| abc | road | left\|left\|left\|through\|through | yes | primary | 5 |
|
||||
| cde | road | | yes | primary | 3 |
|
||||
| hc | cross | | yes | secondary | |
|
||||
| cg | straight | | no | tertiary | |
|
||||
| cf | left | | yes | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
@@ -1137,3 +1158,45 @@ Feature: Turn Lane Guidance
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | turns |
|
||||
| 1,a | 90,2 180,180 | | |
|
||||
|
||||
@3379
|
||||
Scenario: Don't Turn through potential through lanes
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
a - - - - b - - - - - c
|
||||
|
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | name | oneway | turn:lanes:forward |
|
||||
| ab | road | yes | left\|none\|none |
|
||||
| bc | road | yes | |
|
||||
| ebd | cross | no | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
|
||||
| a,c | road,road | depart,arrive | , |
|
||||
|
||||
@3379
|
||||
Scenario: Don't Turn through potential through lanes
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
a - - - - b - - - - - c
|
||||
|
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | name | oneway | turn:lanes:forward |
|
||||
| ab | road | yes | none\|none\|right |
|
||||
| bc | road | yes | |
|
||||
| ebd | cross | no | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
|
||||
| a,c | road,road | depart,arrive | , |
|
||||
|
||||
+35
-150
@@ -278,52 +278,6 @@ Feature: Simple Turns
|
||||
| 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
|
||||
"""
|
||||
q p
|
||||
|
||||
|
||||
|
||||
|
||||
b c
|
||||
j i d o
|
||||
a
|
||||
k h e n
|
||||
g f
|
||||
|
||||
|
||||
|
||||
|
||||
l m
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | name |
|
||||
| khaij | primary | yes | first |
|
||||
| odaen | primary | yes | first |
|
||||
| qbacp | primary | yes | second |
|
||||
| mfagl | primary | yes | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| f,e | second,first,first | depart,turn right,arrive |
|
||||
| f,c | second,second | depart,arrive |
|
||||
| f,i | second,first,first | depart,turn left,arrive |
|
||||
| f,g | second,second,second | depart,continue uturn,arrive |
|
||||
| d,c | first,second,second | depart,turn right,arrive |
|
||||
| d,i | first,first | depart,arrive |
|
||||
| d,g | first,second,second | depart,turn left,arrive |
|
||||
| d,e | first,first,first | depart,continue uturn,arrive |
|
||||
| b,i | second,first,first | depart,turn right,arrive |
|
||||
| b,g | second,second | depart,arrive |
|
||||
| b,e | second,first,first | depart,turn left,arrive |
|
||||
| b,c | second,second,second | depart,continue uturn,arrive |
|
||||
| h,g | first,second,second | depart,turn right,arrive |
|
||||
| h,e | first,first | depart,arrive |
|
||||
| h,c | first,second,second | depart,turn left,arrive |
|
||||
| h,i | first,first,first | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Three Way Similar Sharp Turns
|
||||
Given the node map
|
||||
"""
|
||||
@@ -1080,107 +1034,13 @@ Feature: Simple Turns
|
||||
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Scenario: Collapse Turn Instruction, Issue #2725
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
e
|
||||
|
||||
|
||||
g d
|
||||
|
||||
|
||||
h c
|
||||
|
||||
|
||||
b
|
||||
a
|
||||
|
||||
|
||||
r x s
|
||||
y
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Hermannstr | secondary | |
|
||||
| bc | Hermannstr | secondary | yes |
|
||||
| cd | Hermannbruecke | secondary | yes |
|
||||
| de | Hermannstr | secondary | yes |
|
||||
| ef | Hermannstr | secondary | |
|
||||
| eg | Hermannstr | secondary | yes |
|
||||
| gh | Hermannbruecke | secondary | yes |
|
||||
| hb | Hermannstr | secondary | yes |
|
||||
| xa | Hermannstr | secondary | |
|
||||
| yx | Hermannstr | secondary | |
|
||||
| rxs | Silbersteinstr | tertiary | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||
|
||||
Scenario: Collapse Turn Instruction, Issue #2725 - not trivially mergable at e
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
e
|
||||
g d
|
||||
|
||||
|
||||
h c
|
||||
|
||||
|
||||
b
|
||||
a
|
||||
|
||||
|
||||
r x s
|
||||
y
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Hermannstr | secondary | |
|
||||
| bc | Hermannstr | secondary | yes |
|
||||
| cd | Hermannbruecke | secondary | yes |
|
||||
| de | Hermannstr | secondary | yes |
|
||||
| ef | Hermannstr | secondary | |
|
||||
| eg | Hermannstr | secondary | yes |
|
||||
| gh | Hermannbruecke | secondary | yes |
|
||||
| hb | Hermannstr | secondary | yes |
|
||||
| xa | Hermannstr | secondary | |
|
||||
| yx | Hermannstr | secondary | |
|
||||
| rxs | Silbersteinstr | tertiary | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||
|
||||
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291
|
||||
@3002
|
||||
Scenario: Obvious Index wigh very narrow turn to the right
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
a - b -.-.- - - c
|
||||
' ' 'd
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -1198,8 +1058,8 @@ Feature: Simple Turns
|
||||
Scenario: Obvious Index wigh very narrow turn to the right
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
e d f
|
||||
a - b - . -.- - c
|
||||
e - -'-'d-f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -1218,8 +1078,8 @@ Feature: Simple Turns
|
||||
Scenario: Obvious Index wigh very narrow turn to the left
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
a b c
|
||||
. . .d
|
||||
a - b -'-'- - - c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -1237,8 +1097,8 @@ Feature: Simple Turns
|
||||
Scenario: Obvious Index wigh very narrow turn to the left
|
||||
Given the node map
|
||||
"""
|
||||
e d f
|
||||
a b c
|
||||
e - -.- d-f
|
||||
a - b - ' - - - c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -1373,5 +1233,30 @@ Feature: Simple Turns
|
||||
| kchm | Alexanderstr | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/49.48761/8.47618
|
||||
@todo @3365
|
||||
Scenario: Turning Road - Segregated
|
||||
Given the node map
|
||||
"""
|
||||
f d
|
||||
| |
|
||||
a - - - b - c
|
||||
| |
|
||||
| |
|
||||
g e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | name | ref | oneway |
|
||||
| ab | Goethe | B 38 | yes |
|
||||
| bc | | B 38 | yes |
|
||||
| ec | Fried | | yes |
|
||||
| cd | Fried | B 38 | yes |
|
||||
| fbg | Fried | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | Goethe,Fried,Fried | depart,continue left,arrive |
|
||||
| a,g | Goethe,Fried,Fried | depart,turn right,arrive |
|
||||
|
||||
@@ -36,8 +36,8 @@ class OSRMBaseLoader{
|
||||
|
||||
osrmDown (callback) {
|
||||
if (this.osrmIsRunning()) {
|
||||
this.child.on('exit', (code, signal) => {callback();});
|
||||
this.child.kill();
|
||||
this.child.on('exit', (code, signal) => { callback();});
|
||||
this.child.kill('SIGINT');
|
||||
} else callback();
|
||||
}
|
||||
|
||||
@@ -78,9 +78,10 @@ class OSRMDirectLoader extends OSRMBaseLoader {
|
||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||
|
||||
this.child = this.scope.runBin('osrm-routed', util.format("%s -p %d", this.inputFile, this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
||||
if (err) {
|
||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||
}
|
||||
if (err && err.signal !== 'SIGINT') {
|
||||
this.child = null;
|
||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||
}
|
||||
});
|
||||
callback();
|
||||
}
|
||||
@@ -115,7 +116,8 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
||||
if (this.osrmIsRunning()) return callback();
|
||||
|
||||
this.child = this.scope.runBin('osrm-routed', util.format('--shared-memory=1 -p %d', this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
||||
if (err) {
|
||||
if (err && err.signal !== 'SIGINT') {
|
||||
this.child = null;
|
||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||
}
|
||||
});
|
||||
|
||||
+103
-34
@@ -7,48 +7,117 @@ var chalk = require('chalk');
|
||||
|
||||
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
|
||||
|
||||
String.prototype.padLeft = function(char, length) {
|
||||
return char.repeat(Math.max(0, length - this.length)) + this;
|
||||
}
|
||||
|
||||
String.prototype.padRight = function(char, length) {
|
||||
return this + char.repeat(Math.max(0, length - this.length));
|
||||
}
|
||||
|
||||
module.exports = function (expected, actual) {
|
||||
let headers = expected.raw()[0];
|
||||
let expected_keys = expected.hashes();
|
||||
let diff = [];
|
||||
let hasErrors = false;
|
||||
let expectedRows = expected.hashes();
|
||||
let tableError = false;
|
||||
let statusRows = [];
|
||||
let columnStatus = {}
|
||||
|
||||
var good = 0, bad = 0;
|
||||
|
||||
expected_keys.forEach((row, i) => {
|
||||
expectedRows.forEach((expectedRow, i) => {
|
||||
var rowError = false;
|
||||
|
||||
for (var j in row) {
|
||||
if (unescapeStr(row[j]) != actual[i][j]) {
|
||||
rowError = true;
|
||||
hasErrors = true;
|
||||
break;
|
||||
statusRows[i] = {};
|
||||
var statusRow = statusRows[i];
|
||||
for (var key in expectedRow) {
|
||||
var actualRow = actual[i]
|
||||
var row
|
||||
if (unescapeStr(expectedRow[key]) != actualRow[key]) {
|
||||
statusRow[key] = false;
|
||||
tableError = true;
|
||||
columnStatus[key] = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!tableError) return null;
|
||||
|
||||
|
||||
// determine column widths
|
||||
var widths = {};
|
||||
var wantStr = '(-) ';
|
||||
var gotStr = '(+) ';
|
||||
var okStr = ' ';
|
||||
|
||||
headers.forEach( (key) => {
|
||||
widths[key] = key.length;
|
||||
});
|
||||
|
||||
expectedRows.forEach((row,i) => {
|
||||
var cells = []
|
||||
headers.forEach( (key) => {
|
||||
var content = row[key]
|
||||
var length = content.length;
|
||||
if(widths[key]==null || length > widths[key])
|
||||
widths[key] = length;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// format
|
||||
var lines = [chalk.red('Tables were not identical:')];
|
||||
var cells;
|
||||
|
||||
// header row
|
||||
cells = []
|
||||
headers.forEach( (key) => {
|
||||
var content = key.padRight(' ', widths[key] );
|
||||
if (columnStatus[key] == false )
|
||||
content = okStr + content;
|
||||
cells.push( chalk.white( content ) );
|
||||
});
|
||||
lines.push( '| ' + cells.join(' | ') + ' |');
|
||||
|
||||
// content rows
|
||||
expectedRows.forEach((row,i) => {
|
||||
var cells;
|
||||
var rowError = Object.keys(statusRows[i]).length > 0;
|
||||
|
||||
// expected row
|
||||
cells = []
|
||||
headers.forEach( (key) => {
|
||||
var content = row[key].padRight(' ', widths[key] );
|
||||
if (statusRows[i][key] == false)
|
||||
cells.push( chalk.yellow( wantStr + content) );
|
||||
else {
|
||||
if (rowError) {
|
||||
if (columnStatus[key]==false)
|
||||
content = okStr + content
|
||||
cells.push( chalk.yellow( content) );
|
||||
}
|
||||
else {
|
||||
if (columnStatus[key]==false)
|
||||
content = okStr + content
|
||||
cells.push( chalk.green( content) );
|
||||
}
|
||||
}
|
||||
});
|
||||
lines.push('| ' + cells.join(' | ') + ' |');
|
||||
|
||||
// if error in row, insert extra row showing actual result
|
||||
if (rowError) {
|
||||
bad++;
|
||||
diff.push(Object.assign({}, row, {c_status: 'undefined'}));
|
||||
diff.push(Object.assign({}, actual[i], {c_status: 'comment'}));
|
||||
} else {
|
||||
good++;
|
||||
diff.push(row);
|
||||
cells = []
|
||||
headers.forEach( (key) => {
|
||||
var content = actual[i][key].padRight(' ', widths[key] );
|
||||
if (statusRows[i][key] == false)
|
||||
cells.push( chalk.red( gotStr + content) );
|
||||
else {
|
||||
if (columnStatus[key]==false)
|
||||
cells.push( chalk.red( okStr + content) );
|
||||
else
|
||||
cells.push( chalk.red( content) );
|
||||
}
|
||||
});
|
||||
|
||||
lines.push('| ' + cells.join(' | ') + ' |');
|
||||
}
|
||||
});
|
||||
|
||||
if (!hasErrors) return null;
|
||||
|
||||
var s = ['Tables were not identical:'];
|
||||
s.push(headers.map(key => ' ' + key).join(' | '));
|
||||
diff.forEach((row) => {
|
||||
var rowString = '| ';
|
||||
headers.forEach((header) => {
|
||||
if (!row.c_status) rowString += chalk.green(' ' + row[header] + ' | ');
|
||||
else if (row.c_status === 'undefined') rowString += chalk.yellow('(-) ' + row[header] + ' | ');
|
||||
else rowString += chalk.red('(+) ' + row[header] + ' | ');
|
||||
});
|
||||
s.push(rowString);
|
||||
});
|
||||
|
||||
return s.join('\n') + '\nTODO this is a temp workaround waiting for https://github.com/cucumber/cucumber-js/issues/534';
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
|
||||
errorReason: (err) => {
|
||||
return err.signal ?
|
||||
util.format('killed by signal %s', err.signal) :
|
||||
util.format('exited with code %d', err.code);
|
||||
'killed by signal ' + err.signal :
|
||||
'exited with code ' + err.code;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,3 +28,11 @@ Feature: osrm-contract command line options: datasources
|
||||
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
|
||||
And it should exit successfully
|
||||
|
||||
Scenario: osrm-contract - Passing base file
|
||||
Given the speed file
|
||||
"""
|
||||
"""
|
||||
And the data has been extracted
|
||||
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||
Then it should exit successfully
|
||||
|
||||
@@ -4,7 +4,7 @@ Feature: osrm-contract command line options: help
|
||||
Scenario: osrm-contract - Help should be shown when no options are passed
|
||||
When I try to run "osrm-contract"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
@@ -18,7 +18,7 @@ Feature: osrm-contract command line options: help
|
||||
Scenario: osrm-contract - Help, short
|
||||
When I run "osrm-contract -h"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
@@ -32,7 +32,7 @@ Feature: osrm-contract command line options: help
|
||||
Scenario: osrm-contract - Help, long
|
||||
When I run "osrm-contract --help"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
|
||||
@@ -3,6 +3,14 @@ Feature: osrm-contract command line options: invalid options
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
And the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
And the data has been extracted
|
||||
|
||||
Scenario: osrm-contract - Non-existing option
|
||||
When I try to run "osrm-contract --fly-me-to-the-moon"
|
||||
@@ -10,3 +18,11 @@ Feature: osrm-contract command line options: invalid options
|
||||
And stderr should contain "option"
|
||||
And stderr should contain "fly-me-to-the-moon"
|
||||
And it should exit with an error
|
||||
|
||||
# This tests the error messages when you try to use --segment-speed-file,
|
||||
# but osrm-extract has not been run with --generate-edge-lookup
|
||||
Scenario: osrm-contract - Someone forgot --generate-edge-lookup on osrm-extract
|
||||
When I try to run "osrm-contract --segment-speed-file /dev/null {processed_file}"
|
||||
Then stderr should contain "Error while trying to mmap"
|
||||
Then stderr should contain ".osrm.turn_penalties_index"
|
||||
And it should exit with an error
|
||||
|
||||
@@ -7,7 +7,7 @@ Feature: osrm-extract command line options: help
|
||||
Scenario: osrm-extract - Help should be shown when no options are passed
|
||||
When I run "osrm-extract"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
||||
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
@@ -21,7 +21,7 @@ Feature: osrm-extract command line options: help
|
||||
Scenario: osrm-extract - Help, short
|
||||
When I run "osrm-extract -h"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
||||
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
@@ -35,7 +35,7 @@ Feature: osrm-extract command line options: help
|
||||
Scenario: osrm-extract - Help, long
|
||||
When I run "osrm-extract --help"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
||||
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
@extract
|
||||
Feature: osrm-extract lua ways:get_nodes()
|
||||
|
||||
Background:
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
And the data has been saved to disk
|
||||
|
||||
Scenario: osrm-extract - Passing base file
|
||||
Given the profile file "testbot" extended with
|
||||
"""
|
||||
function way_function(way, result)
|
||||
for _, node in ipairs(way:get_nodes()) do
|
||||
print('node id ' .. node:id())
|
||||
end
|
||||
result.forward_mode = mode.driving
|
||||
result.forward_speed = 1
|
||||
end
|
||||
"""
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "node id 1"
|
||||
And stdout should contain "node id 2"
|
||||
@@ -0,0 +1,107 @@
|
||||
Feature: Profile API version 0
|
||||
|
||||
Background:
|
||||
Given a grid size of 100 meters
|
||||
|
||||
Scenario: Not-defined API version
|
||||
Given the profile file
|
||||
"""
|
||||
function way_function(way, result)
|
||||
result.forward_mode = mode.driving
|
||||
result.forward_speed = 1
|
||||
end
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
ab
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I try to run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stderr should not contain "Invalid profile API version"
|
||||
|
||||
Scenario: Out-bound API version
|
||||
Given the profile file
|
||||
"""
|
||||
api_version = 2
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
ab
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I try to run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit with an error
|
||||
And stderr should contain "Invalid profile API version"
|
||||
|
||||
|
||||
Scenario: Basic profile function calls and property values
|
||||
Given the profile file
|
||||
"""
|
||||
api_version = 0
|
||||
|
||||
-- set profile properties
|
||||
properties.u_turn_penalty = 20
|
||||
properties.traffic_signal_penalty = 2
|
||||
properties.max_speed_for_map_matching = 180/3.6
|
||||
properties.use_turn_restrictions = true
|
||||
properties.continue_straight_at_waypoint = true
|
||||
properties.left_hand_driving = false
|
||||
properties.weight_name = 'duration'
|
||||
|
||||
function node_function (node, result)
|
||||
print ('node_function ' .. node:id())
|
||||
end
|
||||
|
||||
function way_function(way, result)
|
||||
result.name = way:get_value_by_key('name')
|
||||
result.forward_mode = mode.driving
|
||||
result.backward_mode = mode.driving
|
||||
result.forward_speed = 36
|
||||
result.backward_speed = 36
|
||||
print ('way_function ' .. way:id() .. ' ' .. result.name)
|
||||
end
|
||||
|
||||
function turn_function (angle)
|
||||
print('turn_function ' .. angle)
|
||||
return angle == 0 and 0 or 42
|
||||
end
|
||||
|
||||
function segment_function (source, target, distance, weight)
|
||||
print ('segment_function ' .. source.lon .. ' ' .. source.lat)
|
||||
end
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
a
|
||||
b c d
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ac |
|
||||
| cb |
|
||||
| cd |
|
||||
| ce |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "node_function"
|
||||
And stdout should contain "way_function"
|
||||
And stdout should contain "turn_function"
|
||||
And stdout should contain "segment_function"
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | b | ac,cb,cb | 24.2s |
|
||||
| a | d | ac,cd,cd | 24.2s |
|
||||
| a | e | ac,ce,ce | 20s |
|
||||
@@ -0,0 +1,66 @@
|
||||
Feature: Profile API version 1
|
||||
|
||||
Background:
|
||||
Given a grid size of 100 meters
|
||||
|
||||
Scenario: Basic profile function calls and property values
|
||||
Given the profile file
|
||||
"""
|
||||
api_version = 1
|
||||
|
||||
-- set profile properties
|
||||
properties.max_speed_for_map_matching = 180/3.6
|
||||
properties.use_turn_restrictions = true
|
||||
properties.continue_straight_at_waypoint = true
|
||||
properties.weight_name = 'test_version1'
|
||||
|
||||
function node_function (node, result)
|
||||
print ('node_function ' .. node:id())
|
||||
end
|
||||
|
||||
function way_function(way, result)
|
||||
result.name = way:get_value_by_key('name')
|
||||
result.weight = 10
|
||||
result.forward_mode = mode.driving
|
||||
result.backward_mode = mode.driving
|
||||
result.forward_speed = 36
|
||||
result.backward_speed = 36
|
||||
print ('way_function ' .. way:id() .. ' ' .. result.name)
|
||||
end
|
||||
|
||||
function turn_function (turn)
|
||||
print('turn_function', turn.angle, turn.turn_type, turn.direction_modifier, turn.has_traffic_light)
|
||||
turn.weight = turn.angle == 0 and 0 or 4.2
|
||||
turn.duration = turn.weight
|
||||
end
|
||||
|
||||
function segment_function (segment)
|
||||
print ('segment_function ' .. segment.source.lon .. ' ' .. segment.source.lat)
|
||||
end
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
a
|
||||
bcd
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ac |
|
||||
| cb |
|
||||
| cd |
|
||||
| ce |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "node_function"
|
||||
And stdout should contain "way_function"
|
||||
And stdout should contain "turn_function"
|
||||
And stdout should contain "segment_function"
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | b | ac,cb,cb | 19.2s |
|
||||
| a | d | ac,cd,cd | 19.2s |
|
||||
| a | e | ac,ce,ce | 20s |
|
||||
@@ -7,7 +7,7 @@ Feature: osrm-routed command line options: help
|
||||
Scenario: osrm-routed - Help should be shown when no options are passed
|
||||
When I run "osrm-routed"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
||||
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
@@ -26,7 +26,7 @@ Feature: osrm-routed command line options: help
|
||||
Scenario: osrm-routed - Help, short
|
||||
When I run "osrm-routed -h"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
||||
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
@@ -45,7 +45,7 @@ Feature: osrm-routed command line options: help
|
||||
Scenario: osrm-routed - Help, long
|
||||
When I run "osrm-routed --help"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
||||
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
|
||||
@@ -239,13 +239,15 @@ module.exports = function () {
|
||||
});
|
||||
|
||||
this.Given(/^the profile file(?: "([^"]*)" extended with)?$/, (profile, data, callback) => {
|
||||
let text = 'package.path = "' + this.PROFILES_PATH + '/?.lua;" .. package.path\n';
|
||||
const lua_profiles_path = this.PROFILES_PATH.split(path.sep).join('/');
|
||||
let text = 'package.path = "' + lua_profiles_path + '/?.lua;" .. package.path\n';
|
||||
if (profile == null) {
|
||||
text += data + '\n';
|
||||
} else {
|
||||
text += 'local f = assert(io.open("' + this.PROFILES_PATH + '/' + profile + '.lua", "r"))\n';
|
||||
text += 'local m = assert(loadstring(f:read("*all") .. [[\n' + data + '\n]]))\n';
|
||||
text += 'local f = assert(io.open("' + lua_profiles_path + '/' + profile + '.lua", "r"))\n';
|
||||
text += 'local s = f:read("*all") .. [[\n' + data + '\n]]\n';
|
||||
text += 'f:close()\n';
|
||||
text += 'local m = assert(loadstring and loadstring(s) or load(s))\n';
|
||||
text += 'm()\n';
|
||||
}
|
||||
this.profileFile = this.profileCacheFile;
|
||||
|
||||
@@ -83,7 +83,10 @@ module.exports = function () {
|
||||
duration = json.matchings[0].duration;
|
||||
}
|
||||
|
||||
if (headers.has('annotation')) {
|
||||
// annotation response values are requested by 'a:{type_name}'
|
||||
var found = false;
|
||||
headers.forEach((h) => { if (h.match(/^a:/)) found = true; });
|
||||
if (found) {
|
||||
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
||||
annotation = this.annotationList(json.matchings[0]);
|
||||
}
|
||||
@@ -92,11 +95,6 @@ module.exports = function () {
|
||||
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
||||
geometry = json.matchings[0].geometry;
|
||||
}
|
||||
|
||||
if (headers.has('OSM IDs')) {
|
||||
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
||||
OSMIDs = this.OSMIDList(json.matchings[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (headers.has('turns')) {
|
||||
@@ -111,9 +109,19 @@ module.exports = function () {
|
||||
got.duration = duration.toString();
|
||||
}
|
||||
|
||||
if (headers.has('annotation')) {
|
||||
got.annotation = annotation.toString();
|
||||
}
|
||||
// if header matches 'a:*', parse out the values for *
|
||||
// and return in that header
|
||||
headers.forEach((k) => {
|
||||
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight'];
|
||||
if (k.match(/^a:/)) {
|
||||
let a_type = k.slice(2);
|
||||
if (whitelist.indexOf(a_type) == -1)
|
||||
return cb(new Error('Unrecognized annotation field:' + a_type));
|
||||
if (!annotation[a_type])
|
||||
return cb(new Error('Annotation not found in response: ' + a_type));
|
||||
got[k] = annotation[a_type];
|
||||
}
|
||||
});
|
||||
|
||||
if (headers.has('geometry')) {
|
||||
if (this.queryParams['geometries'] === 'polyline') {
|
||||
|
||||
@@ -70,8 +70,9 @@ module.exports = function () {
|
||||
assert.ok(this.stdout.indexOf(str) > -1);
|
||||
});
|
||||
|
||||
this.Then(/^stderr should contain "(.*?)"$/, (str) => {
|
||||
assert.ok(this.stderr.indexOf(str) > -1);
|
||||
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
|
||||
const contains = this.stderr.indexOf(str) > -1;
|
||||
assert.ok(typeof not === 'undefined' ? contains : !contains);
|
||||
});
|
||||
|
||||
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
||||
|
||||
@@ -6,19 +6,46 @@ module.exports = function () {
|
||||
this.Then(/^routability should be$/, (table, callback) => {
|
||||
this.buildWaysFromTable(table, () => {
|
||||
var directions = ['forw','backw','bothw'],
|
||||
testedHeaders = ['forw','backw','bothw','forw_rate','backw_rate','bothw_rate'],
|
||||
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');
|
||||
if (!testedHeaders.some(k => !!headers.has(k))) {
|
||||
throw new Error('*** routability table must contain either "forw", "backw", "bothw", "forw_rate" or "backw_rate" column');
|
||||
}
|
||||
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
var testRow = (row, i, cb) => {
|
||||
var outputRow = Object.assign({}, row);
|
||||
// clear the fields that are tested for in the copied response object
|
||||
for (var field in outputRow) {
|
||||
if (testedHeaders.indexOf(field) != -1)
|
||||
outputRow[field] = '';
|
||||
}
|
||||
|
||||
testRoutabilityRow(i, (err, result) => {
|
||||
if (err) return cb(err);
|
||||
directions.filter(d => headers.has(d + '_rate')).forEach((direction) => {
|
||||
var rate = direction + '_rate';
|
||||
var want = row[rate];
|
||||
|
||||
switch (true) {
|
||||
case '' === want:
|
||||
outputRow[rate] = result[direction].status ?
|
||||
result[direction].status.toString() : '';
|
||||
break;
|
||||
case /^\d+$/.test(want):
|
||||
if (result[direction].rate !== undefined && !isNaN(result[direction].rate)) {
|
||||
outputRow[rate] = result[direction].rate.toString();
|
||||
} else {
|
||||
outputRow[rate] = '';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new Error(util.format('*** Unknown expectation format: %s for header %s', want, rate));
|
||||
}
|
||||
});
|
||||
|
||||
directions.filter(d => headers.has(d)).forEach((direction) => {
|
||||
var usingShortcut = false,
|
||||
want = row[direction];
|
||||
@@ -31,13 +58,15 @@ module.exports = function () {
|
||||
usingShortcut = row[direction];
|
||||
}
|
||||
|
||||
// TODO split out accessible/not accessible value from forw/backw headers
|
||||
// rename forw/backw to forw/backw_speed
|
||||
switch (true) {
|
||||
case '' === want:
|
||||
case 'x' === want:
|
||||
outputRow[direction] = result[direction].status ?
|
||||
result[direction].status.toString() : '';
|
||||
break;
|
||||
case /^\d+ s/.test(want):
|
||||
case /^[\d\.]+ s/.test(want):
|
||||
// the result here can come back as a non-number value like
|
||||
// `diff`, but we only want to apply the unit when it comes
|
||||
// back as a number, for tableDiff's literal comparison
|
||||
@@ -63,7 +92,7 @@ module.exports = function () {
|
||||
}
|
||||
|
||||
if (this.FuzzyMatch.match(outputRow[direction], want)) {
|
||||
outputRow[direction] = [usingShortcut ? usingShortcut : row[direction]];
|
||||
outputRow[direction] = usingShortcut ? usingShortcut : row[direction];
|
||||
}
|
||||
});
|
||||
|
||||
@@ -75,6 +104,10 @@ module.exports = function () {
|
||||
});
|
||||
});
|
||||
|
||||
// makes simple a-b request using the given cucumber test routability conditions
|
||||
// result is an object containing the calculated values for 'rate', 'status',
|
||||
// 'time', 'distance', and 'speed' for forwards and backwards routing, as well as
|
||||
// a bothw object that diffs forwards/backwards
|
||||
var testRoutabilityRow = (i, cb) => {
|
||||
var result = {};
|
||||
|
||||
@@ -98,6 +131,7 @@ module.exports = function () {
|
||||
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.rate = Math.round(r.distance / r.json.routes[0].weight);
|
||||
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
||||
} else {
|
||||
r.status = null;
|
||||
@@ -127,30 +161,13 @@ module.exports = function () {
|
||||
var parseRes = (key, scb) => {
|
||||
if (result.forw[key] === result.backw[key]) {
|
||||
result.bothw[key] = result.forw[key];
|
||||
// FIXME these time and speed checks are stopgaps for precision errors in how
|
||||
// OSRM returns inconsistent durations for rev/for requests along the same way
|
||||
} else if (key === 'time') {
|
||||
var range = [result.forw[key] - 1, result.forw[key] + 1];
|
||||
if (result.backw[key] >= range[0] && result.backw[key] <= range[1])
|
||||
// usually when we see minor differences here there's an integer
|
||||
// duration value and one that comes back with a .9 or .1 rounding.
|
||||
// This returns the integer one
|
||||
result.bothw[key] = parseInt(result.forw[key]) === result.forw[key] ? result.forw[key] : result.backw[key];
|
||||
else
|
||||
result.bothw[key] = 'diff';
|
||||
} else if (key === 'speed') {
|
||||
if (Math.abs(result.backw.time - result.forw.time) < 0.2) {
|
||||
result.bothw[key] = parseInt(result.forw[key]) === result.forw[key] ? result.forw[key] : result.backw[key];
|
||||
} else {
|
||||
result.bothw[key] = 'diff';
|
||||
}
|
||||
} else {
|
||||
result.bothw[key] = 'diff';
|
||||
}
|
||||
scb();
|
||||
};
|
||||
|
||||
['status', 'time', 'distance', 'speed'].forEach((key) => {
|
||||
['rate', 'status', 'time', 'distance', 'speed'].forEach((key) => {
|
||||
sq.defer(parseRes, key);
|
||||
});
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ module.exports = function () {
|
||||
} else if (row[k]) {
|
||||
params[match[1]] = [row[k]];
|
||||
}
|
||||
|
||||
got[k] = row[k];
|
||||
}
|
||||
}
|
||||
@@ -35,11 +34,11 @@ module.exports = function () {
|
||||
}
|
||||
|
||||
if (headers.has('status')) {
|
||||
got.status = json.status.toString();
|
||||
got.status = json.code;
|
||||
}
|
||||
|
||||
if (headers.has('message')) {
|
||||
got.message = json.status_message;
|
||||
got.message = json.message;
|
||||
}
|
||||
|
||||
if (headers.has('geometry')) {
|
||||
@@ -59,6 +58,7 @@ module.exports = function () {
|
||||
|
||||
var subTrips;
|
||||
var trip_durations;
|
||||
var trip_distance;
|
||||
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) => {
|
||||
@@ -74,13 +74,19 @@ module.exports = function () {
|
||||
})));
|
||||
trip_durations = all_durations.map( a => a.reduce(add, 0));
|
||||
}
|
||||
if(headers.has('distance')) {
|
||||
var all_distance = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map(sl => {
|
||||
return sl.distance;
|
||||
})));
|
||||
trip_distance = all_distance.map( a => a.reduce(add, 0));
|
||||
}
|
||||
}
|
||||
|
||||
var ok = true,
|
||||
encodedResult = '',
|
||||
extendedTarget = '';
|
||||
|
||||
row.trips.split(',').forEach((sub, si) => {
|
||||
if (json.trips) row.trips.split(',').forEach((sub, si) => {
|
||||
if (si >= subTrips.length) {
|
||||
ok = false;
|
||||
} else {
|
||||
@@ -105,10 +111,10 @@ module.exports = function () {
|
||||
got.via_points = row.via_points;
|
||||
} else {
|
||||
got.trips = encodedResult;
|
||||
got.trips = extendedTarget;
|
||||
}
|
||||
|
||||
got.durations = trip_durations;
|
||||
got.distance = trip_distance;
|
||||
|
||||
for (var key in row) {
|
||||
if (this.FuzzyMatch.match(got[key], row[key])) {
|
||||
@@ -144,6 +150,19 @@ module.exports = function () {
|
||||
waypoints.push(node);
|
||||
});
|
||||
got = { waypoints: row.waypoints };
|
||||
|
||||
if (row.source) {
|
||||
params.source = got.source = row.source;
|
||||
}
|
||||
|
||||
if (row.destination) {
|
||||
params.destination = got.destination = row.destination;
|
||||
}
|
||||
|
||||
if (row.hasOwnProperty('roundtrip')) { //roundtrip is a boolean so row.roundtrip alone doesn't work as a check here
|
||||
params.roundtrip = got.roundtrip = row.roundtrip;
|
||||
}
|
||||
|
||||
this.requestTrip(waypoints, params, afterRequest);
|
||||
} else {
|
||||
throw new Error('*** no waypoints');
|
||||
|
||||
@@ -141,7 +141,9 @@ module.exports = function() {
|
||||
|
||||
// converts the scenario titles in file prefixes
|
||||
this.getScenarioID = (scenario) => {
|
||||
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\)]/g, '').replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.');
|
||||
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\):\*#]/g, '')
|
||||
.replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.')
|
||||
.substring(0, 64);
|
||||
return util.format('%d_%s', scenario.getLine(), name);
|
||||
};
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ module.exports = function () {
|
||||
q.awaitAll((err, actual) => {
|
||||
if (err) return callback(err);
|
||||
let diff = tableDiff(table, actual);
|
||||
if (diff) callback(new Error(diff));
|
||||
if (diff) callback(diff);
|
||||
else callback();
|
||||
});
|
||||
};
|
||||
|
||||
+17
-27
@@ -27,10 +27,11 @@ module.exports = function () {
|
||||
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
||||
}
|
||||
|
||||
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
||||
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
||||
this.DEFAULT_PROFILE = 'bicycle';
|
||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||
this.DEFAULT_LOAD_METHOD = 'datastore';
|
||||
this.DEFAULT_LOAD_METHOD = this.PLATFORM_WINDOWS ? 'directly' : 'datastore';
|
||||
this.DEFAULT_ORIGIN = [1,1];
|
||||
this.OSM_USER = 'osrm';
|
||||
this.OSM_GENERATOR = 'osrm-test';
|
||||
@@ -42,44 +43,33 @@ module.exports = function () {
|
||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
||||
|
||||
// TODO make sure this works on win
|
||||
if (process.platform.match(/indows.*/)) {
|
||||
if (this.PLATFORM_WINDOWS) {
|
||||
this.TERMSIGNAL = 9;
|
||||
this.EXE = '.exe';
|
||||
this.LIB = '.dll';
|
||||
this.QQ = '"';
|
||||
} else {
|
||||
this.TERMSIGNAL = 'SIGTERM';
|
||||
this.EXE = '';
|
||||
}
|
||||
|
||||
// heuristically detect .so/.a suffix
|
||||
this.LIB = null;
|
||||
|
||||
// heuristically detect .so/.a/.dll/.lib suffix
|
||||
this.LIB = ['lib%s.a', 'lib%s.so', '%s.dll', '%s.lib'].find((format) => {
|
||||
try {
|
||||
const dot_a = util.format('%s/libosrm%s', this.BIN_PATH, '.a');
|
||||
fs.accessSync(dot_a, fs.F_OK);
|
||||
this.LIB = '.a';
|
||||
} catch(e) { /*nop*/ }
|
||||
const lib = this.BIN_PATH + '/' + util.format(format, 'osrm');
|
||||
fs.accessSync(lib, fs.F_OK);
|
||||
} catch(e) { return false; }
|
||||
return true;
|
||||
});
|
||||
|
||||
try {
|
||||
const dot_so = util.format('%s/libosrm%s', this.BIN_PATH, '.so');
|
||||
fs.accessSync(dot_so, fs.F_OK);
|
||||
this.LIB = '.so';
|
||||
} catch(e) { /*nop*/ }
|
||||
|
||||
if (!this.LIB) {
|
||||
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
|
||||
}
|
||||
|
||||
this.QQ = '';
|
||||
if (this.LIB === undefined) {
|
||||
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
|
||||
}
|
||||
|
||||
this.OSRM_EXTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-extract', this.EXE));
|
||||
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
||||
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
||||
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/libosrm_extract%s', this.BIN_PATH, this.LIB),
|
||||
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/libosrm_contract%s', this.BIN_PATH, this.LIB),
|
||||
this.LIB_OSRM_PATH = util.format('%s/libosrm%s', this.BIN_PATH, this.LIB);
|
||||
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
|
||||
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
|
||||
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.info(util.format('Node Version', process.version));
|
||||
@@ -108,7 +98,7 @@ module.exports = function () {
|
||||
var verify = (binPath, cb) => {
|
||||
fs.exists(binPath, (exists) => {
|
||||
if (!exists) return cb(new Error(util.format('%s is missing. Build failed?', binPath)));
|
||||
var helpPath = util.format('%s --help > /dev/null 2>&1', binPath);
|
||||
var helpPath = util.format('%s --help', binPath);
|
||||
child_process.exec(helpPath, (err) => {
|
||||
if (err) {
|
||||
return cb(new Error(util.format('*** %s exited with code %d', helpPath, err.code)));
|
||||
|
||||
+21
-13
@@ -164,20 +164,20 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.annotationList = (instructions) => {
|
||||
function zip(list_1, list_2, list_3)
|
||||
{
|
||||
let tuples = [];
|
||||
for (let i = 0; i < list_1.length; ++i) {
|
||||
tuples.push([list_1[i], list_2[i], list_3[i]]);
|
||||
}
|
||||
return tuples;
|
||||
}
|
||||
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
|
||||
};
|
||||
if (!('annotation' in instructions.legs[0]))
|
||||
return '';
|
||||
|
||||
this.OSMIDList = (instructions) => {
|
||||
// OSM node IDs also come from the annotation list
|
||||
return instructions.legs.map(l => l.annotation.nodes.map(n => n.toString()).join(',')).join(',');
|
||||
var merged = {};
|
||||
instructions.legs.map(l => {
|
||||
Object.keys(l.annotation).forEach(a => {
|
||||
if (!merged[a]) merged[a] = [];
|
||||
merged[a].push(l.annotation[a].join(':'));
|
||||
});
|
||||
});
|
||||
Object.keys(merged).map(a => {
|
||||
merged[a] = merged[a].join(',');
|
||||
});
|
||||
return merged;
|
||||
};
|
||||
|
||||
this.lanesList = (instructions) => {
|
||||
@@ -250,4 +250,12 @@ module.exports = function () {
|
||||
this.distanceList = (instructions) => {
|
||||
return this.extractInstructionList(instructions, s => s.distance + 'm');
|
||||
};
|
||||
|
||||
this.weightName = (instructions) => {
|
||||
return instructions ? instructions.weight_name : '';
|
||||
};
|
||||
|
||||
this.weightList = (instructions) => {
|
||||
return this.extractInstructionList(instructions, s => s.weight);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const util = require('util');
|
||||
const child_process = require('child_process');
|
||||
@@ -36,7 +37,7 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.runBin = (bin, options, env, callback) => {
|
||||
let cmd = util.format('%s%s/%s%s%s', this.QQ, this.BIN_PATH, bin, this.EXE, this.QQ);
|
||||
let cmd = path.resolve(util.format('%s/%s%s', this.BIN_PATH, bin, this.EXE));
|
||||
let opts = options.split(' ').filter((x) => { return x && x.length > 0; });
|
||||
let log = fs.createWriteStream(this.scenarioLogFile, {'flags': 'a'});
|
||||
log.write(util.format('*** running %s %s\n', cmd, options));
|
||||
|
||||
@@ -35,7 +35,7 @@ module.exports = function () {
|
||||
if (err) return cb(err);
|
||||
if (body && body.length) {
|
||||
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
||||
distances, summary, intersections, lanes, locations;
|
||||
distances, summary, intersections, lanes, locations, annotation, weight_name, weights;
|
||||
|
||||
let json = JSON.parse(body);
|
||||
|
||||
@@ -55,6 +55,9 @@ module.exports = function () {
|
||||
lanes = this.lanesList(json.routes[0]);
|
||||
summary = this.summary(json.routes[0]);
|
||||
locations = this.locations(json.routes[0]);
|
||||
annotation = this.annotationList(json.routes[0]);
|
||||
weight_name = this.weightName(json.routes[0]);
|
||||
weights = this.weightList(json.routes[0]);
|
||||
}
|
||||
|
||||
if (headers.has('status')) {
|
||||
@@ -89,7 +92,8 @@ module.exports = function () {
|
||||
}
|
||||
|
||||
var distance = hasRoute && json.routes[0].distance,
|
||||
time = hasRoute && json.routes[0].duration;
|
||||
time = hasRoute && json.routes[0].duration,
|
||||
weight = hasRoute && json.routes[0].weight;
|
||||
|
||||
if (headers.has('distance')) {
|
||||
if (row.distance.length) {
|
||||
@@ -101,6 +105,16 @@ module.exports = function () {
|
||||
}
|
||||
}
|
||||
|
||||
if (headers.has('weight')) {
|
||||
if (row.weight.length) {
|
||||
if (!row.weight.match(/[\d\.]+/))
|
||||
return cb(new Error('*** Weight must be specified as a numeric value. (ex: 8)'));
|
||||
got.weight = instructions ? util.format('%d', weight) : '';
|
||||
} else {
|
||||
got.weight = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (headers.has('time')) {
|
||||
if (!row.time.match(/\d+s/))
|
||||
return cb(new Error('*** Time must be specied in seconds. (ex: 60s)'));
|
||||
@@ -130,6 +144,20 @@ module.exports = function () {
|
||||
got.locations = (locations || '').trim();
|
||||
}
|
||||
|
||||
// if header matches 'a:*', parse out the values for *
|
||||
// and return in that header
|
||||
headers.forEach((k) => {
|
||||
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight', 'speed'];
|
||||
if (k.match(/^a:/)) {
|
||||
let a_type = k.slice(2);
|
||||
if (whitelist.indexOf(a_type) == -1)
|
||||
return cb(new Error('Unrecognized annotation field', a_type));
|
||||
if (!annotation[a_type])
|
||||
return cb(new Error('Annotation not found in response', a_type));
|
||||
got[k] = annotation[a_type];
|
||||
}
|
||||
});
|
||||
|
||||
var putValue = (key, value) => {
|
||||
if (headers.has(key)) got[key] = instructions ? value : '';
|
||||
};
|
||||
@@ -142,6 +170,9 @@ module.exports = function () {
|
||||
putValue('distances', distances);
|
||||
putValue('pronunciations', pronunciations);
|
||||
putValue('destinations', destinations);
|
||||
putValue('weight_name', weight_name);
|
||||
putValue('weights', weights);
|
||||
putValue('weight', weight);
|
||||
}
|
||||
|
||||
for (var key in row) {
|
||||
|
||||
@@ -37,18 +37,18 @@ Feature: Bearing parameter
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | c | 0 0 | | |
|
||||
| 0 | c | 45 45 | bc,bc | 0->44,44->0 +- 1 |
|
||||
| 0 | c | 85 85 | | |
|
||||
| 0 | c | 95 95 | | |
|
||||
| 0 | c | 135 135 | ac,ac | 0->135,135->0 +- 1|
|
||||
| 0 | c | 180 180 | | |
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | c | 0 0 | | |
|
||||
| 0 | c | 45 45 | bc,bc | 0->45,45->0 |
|
||||
| 0 | c | 85 85 | | |
|
||||
| 0 | c | 95 95 | | |
|
||||
| 0 | c | 135 135 | ac,ac | 0->135,135->0 |
|
||||
| 0 | c | 180 180 | | |
|
||||
|
||||
Scenario: Testbot - Initial bearing on split way
|
||||
Given the node map
|
||||
"""
|
||||
g d 1 c f
|
||||
g d 2 1 c f
|
||||
h a 0 b e
|
||||
"""
|
||||
|
||||
@@ -64,21 +64,17 @@ Feature: Bearing parameter
|
||||
| ha | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | b | 10 10 | bc,bc | 0->0,0->0 |
|
||||
| 0 | b | 90 90 | ab,ab | 0->90,90->0 |
|
||||
# The returned bearing is wrong here, it's based on the snapped
|
||||
# coordinates, not the acutal edge bearing. This should be
|
||||
# fixed one day, but it's only a problem when we snap two vias
|
||||
# to the same point - DP
|
||||
#| 0 | b | 170 170 | da | 180 |
|
||||
#| 0 | b | 189 189 | da | 180 |
|
||||
| 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 |
|
||||
| 1 | d | 10 10 | bc,bc | 0->0,0->0 |
|
||||
| 1 | d | 90 90 | ab,bc,cd,da,da | 0->90,90->0,0->270,270->180,180->0 |
|
||||
| 1 | 0 | 189 189 | da,da | 0->180,180->0 |
|
||||
| 1 | d | 270 270 | cd,cd | 0->270,270->0 |
|
||||
| 1 | d | 349 349 | | |
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | b | 10 10 | bc,bc | 0->0,0->0 |
|
||||
| 0 | b | 90 90 | ab,ab | 0->90,90->0 |
|
||||
| 0 | b | 170 170 | da,da | 0->0,0->0 |
|
||||
| 0 | b | 189 189 | da,da | 0->0,0->0 |
|
||||
| 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 |
|
||||
| 1 | 2 | 10 10 | bc,bc | 0->0,0->0 |
|
||||
| 1 | 2 | 90 90 | ab,bc,cd,da,ab,ab | 0->90,90->0,0->270,270->180,180->90,90->0 |
|
||||
| 1 | 0 | 189 189 | da,da | 0->180,180->0 |
|
||||
| 1 | 2 | 270 270 | cd,cd | 0->270,270->0 |
|
||||
| 1 | 2 | 349 349 | | |
|
||||
|
||||
Scenario: Testbot - Initial bearing in all direction
|
||||
Given the node map
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user