Compare commits
454 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97c7bcd9c8 | |||
| c511b5a133 | |||
| e7ab764714 | |||
| cbc2283b58 | |||
| 598d5fbb67 | |||
| 823dcbf511 | |||
| 1933c5e8f4 | |||
| 807aa71a7c | |||
| 14d9b67b58 | |||
| 82df0ca766 | |||
| a6c7529a4e | |||
| 202bb6d3e2 | |||
| bc514926bf | |||
| 9fc16b6a83 | |||
| 2125e0175d | |||
| 6b5982d389 | |||
| a4a8aa63d4 | |||
| bedf451952 | |||
| 93b8f1993c | |||
| c693f4806b | |||
| b07275694a | |||
| 82177c101b | |||
| da6dbd2159 | |||
| b3957d87b4 | |||
| 5f9ccadd6c | |||
| 6e04da9f8f | |||
| 58c13d2c07 | |||
| bca8593eef | |||
| 3e2e10a4c3 | |||
| 6979763292 | |||
| 324f1739e4 | |||
| 1489662f57 | |||
| 1c1f407f67 | |||
| 8fb631417b | |||
| ae45ad1ad2 | |||
| 6b89803534 | |||
| d01b34f501 | |||
| fcad2fa471 | |||
| 589767fe6d | |||
| d6407e5095 | |||
| 8ff8dc7200 | |||
| 2f7b02c96f | |||
| 669e2a767a | |||
| 2b4f9feeab | |||
| 1554916639 | |||
| 32a3651231 | |||
| dbd4ecf89b | |||
| 7416653874 | |||
| 621ed970da | |||
| 457ba9ac62 | |||
| f9da5f2c80 | |||
| b6a793a1e2 | |||
| bf2ab3d8af | |||
| 02f75236cb | |||
| 5dff83c6e9 | |||
| 43725bae89 | |||
| 59c12506cf | |||
| be15a3b739 | |||
| 9f515dad09 | |||
| 5052c4ae3a | |||
| 9a617f5d41 | |||
| 4886d46d91 | |||
| 67834def5f | |||
| c51ffeb65a | |||
| 68ee4eab61 | |||
| fa6d4ac0bc | |||
| 3fa533d91e | |||
| c0db144906 | |||
| ea2ec168b0 | |||
| cb18c1a54d | |||
| 45bcb22270 | |||
| 2539fd53dc | |||
| 8a2bd09fd0 | |||
| def89ac079 | |||
| fe08726387 | |||
| 9bb4a68599 | |||
| 996a27dbd1 | |||
| 58ebadd7b3 | |||
| cae06ba2c1 | |||
| 0274afa0f7 | |||
| 221f70ac7b | |||
| d3dbca374d | |||
| 6f0b6a8158 | |||
| b25cd6aaf2 | |||
| d27025003a | |||
| 66eb90d9d0 | |||
| 6a81a9d191 | |||
| 64cb134113 | |||
| 891ff7dd80 | |||
| 6643e7f499 | |||
| fcbf527ba5 | |||
| dfd180a292 | |||
| fa0a5040e5 | |||
| 56ba2cb251 | |||
| dea12779cf | |||
| 6033c05ff0 | |||
| 407da8bd15 | |||
| 43413ff980 | |||
| 4d864b8267 | |||
| a516245c94 | |||
| b1ed268d0e | |||
| 83b86bf092 | |||
| 954caa6804 | |||
| 8b6da4d2fe | |||
| f2d70d972d | |||
| b20de76037 | |||
| a33bd9dfe6 | |||
| f2443c64db | |||
| 278ec04f5e | |||
| 95787255a1 | |||
| eaf9993dd9 | |||
| 470d7600b8 | |||
| 849baea544 | |||
| 4f1ca20dda | |||
| 97401ad99a | |||
| 59f5e364c1 | |||
| 29c2a117c0 | |||
| c209e31ce1 | |||
| 12608889e2 | |||
| 3343882876 | |||
| 6e50b5fc60 | |||
| c540c85cf8 | |||
| b17491ebe5 | |||
| 76b410b2ca | |||
| 069388eae0 | |||
| c6c25e609b | |||
| 9b52dd8bf7 | |||
| 2cf19010e3 | |||
| 89d56e1cd1 | |||
| ef1fb08723 | |||
| e60ebee3f2 | |||
| 4c88fe0fb1 | |||
| 13338414db | |||
| 96f49f3b53 | |||
| 75979d7e1c | |||
| 29a2447906 | |||
| 2f702f61a4 | |||
| 5a71acbe3c | |||
| ca3e8ef09e | |||
| 8c44084af1 | |||
| d829a390fd | |||
| 6b6597e453 | |||
| 97c550d5f6 | |||
| acfd6ab141 | |||
| 7e790c1aa6 | |||
| d1e2aa57a8 | |||
| 2e6e3bf0b0 | |||
| e5025665fc | |||
| 1a8097f810 | |||
| f45daad6ca | |||
| e4e85e6f7e | |||
| 5beaf695ed | |||
| d09827b501 | |||
| 97722adbfa | |||
| 006a8833d3 | |||
| 8111baa8f9 | |||
| d6e4dc0aa2 | |||
| 497da1d29b | |||
| cbc8b64854 | |||
| c06f2a50f1 | |||
| 825a422721 | |||
| 2c4ba90abb | |||
| 6dda899a60 | |||
| 8725e2f40d | |||
| 35c501c203 | |||
| 30a9bc3179 | |||
| f9350a276c | |||
| cd9addf0e2 | |||
| 2219b6507c | |||
| 09931d7ad8 | |||
| 7ce0c0ef9a | |||
| 49e2cb6c36 | |||
| 4b60fc4747 | |||
| 164fb09f2c | |||
| 5647e6c199 | |||
| a4d6544764 | |||
| e942f6e420 | |||
| 7174baa91e | |||
| 5c8b7542d0 | |||
| e8035ced5a | |||
| 70a086a9e1 | |||
| 08cb6d1f63 | |||
| c7f3645fe2 | |||
| 4b6a85aae0 | |||
| c8a8859d2f | |||
| 8c0f47f06c | |||
| 926290dd9c | |||
| 6ae3315bb9 | |||
| 8621b1890e | |||
| c726001a0e | |||
| eba5f7d275 | |||
| 2f793473cc | |||
| 91567cad9e | |||
| d48ee84ae7 | |||
| fd000cad86 | |||
| 6244063073 | |||
| f34de8422e | |||
| a33edd15b4 | |||
| 6a65261765 | |||
| 07f3e2d457 | |||
| 958199ffef | |||
| e5ebf74d76 | |||
| 126d2f85ac | |||
| 908e3a2af6 | |||
| 25e40d723a | |||
| 7a764ce78b | |||
| 8947c789a9 | |||
| 8ac403abb9 | |||
| 9752cb8e4d | |||
| e9be9dd8d0 | |||
| 5e6d638c6f | |||
| c47f6e2ca5 | |||
| cc09df1961 | |||
| db26d2b2d7 | |||
| 5b33efeecc | |||
| fda4656630 | |||
| 5829bbe22d | |||
| f4cfde719d | |||
| 1fd66f55c1 | |||
| a964bec0f8 | |||
| b65ba5c394 | |||
| d51eefa1c4 | |||
| 4025cbd555 | |||
| 3da27c06c3 | |||
| bc7824812b | |||
| baf7822340 | |||
| 82ee08fcaf | |||
| 51d153a5f7 | |||
| df608e8b43 | |||
| 8e477437a6 | |||
| e70f0eea02 | |||
| 8be93a0202 | |||
| d4f7f19a22 | |||
| 4441381042 | |||
| 61c9c69718 | |||
| 5beaab97da | |||
| 843a4b8eae | |||
| 9ec46222e3 | |||
| 210da11fbb | |||
| ee61ae360d | |||
| 890e0f4995 | |||
| 224c66e0dc | |||
| 88052cd194 | |||
| c22453f24a | |||
| 099a805260 | |||
| 7ed474af8d | |||
| 9d893d6d4d | |||
| e55af0c274 | |||
| 803fbf2541 | |||
| 061b2b63e9 | |||
| 1486098065 | |||
| 0f0db4c823 | |||
| c3e7e96dce | |||
| 3c5f6bd8ac | |||
| b6b59e5c08 | |||
| a7aa27c87c | |||
| 735b325d74 | |||
| f948380fa2 | |||
| 79cf1880fc | |||
| ca130e1dc4 | |||
| d67ce81438 | |||
| ec1a84c57a | |||
| 59163cb2fc | |||
| 419cf9e2b0 | |||
| 95c78eac9c | |||
| 51a4cf5e46 | |||
| 2472c5d6a1 | |||
| 59fbb289b9 | |||
| e82bc20422 | |||
| 1e753e98ce | |||
| 39b3cab1da | |||
| 87fbfc6475 | |||
| cb8bfa027e | |||
| 1b1274fd56 | |||
| 38db495879 | |||
| a781c36876 | |||
| 71c336d9dd | |||
| e10e8910f3 | |||
| 253496c7ee | |||
| 30a3ab68c0 | |||
| 663a7c52c7 | |||
| 4e8ccd6f7d | |||
| 879ccfc8c2 | |||
| a77574b3d7 | |||
| 50738f8ce0 | |||
| 5c01878542 | |||
| ea93f6f560 | |||
| 7bab34eeda | |||
| 0cc23dec6f | |||
| 71c0d5253d | |||
| a674028c37 | |||
| 29fff4f51b | |||
| 4309ccfa02 | |||
| 4e8fe89faa | |||
| 8218d5a47e | |||
| 4bbb587280 | |||
| 0f04fe75bd | |||
| 11b356e55f | |||
| 80f008684d | |||
| c9c2d8133c | |||
| ac9a4d1e0d | |||
| d7dd6acd9d | |||
| b5739cb3d8 | |||
| ea93d56ca8 | |||
| 10097a946f | |||
| c439594403 | |||
| 29cf9e05db | |||
| 298f68c966 | |||
| 0b3289ea37 | |||
| 5f457bff12 | |||
| 6c00ccca9a | |||
| 7e679ab252 | |||
| 0ca21dbc91 | |||
| d2590f1078 | |||
| eb3f550e26 | |||
| 06aa6dedab | |||
| f769478abe | |||
| ba5f0af5a4 | |||
| 5e5f72ae57 | |||
| f36037ebf2 | |||
| 0c276ac71e | |||
| 9e95d1f1fd | |||
| e00bda37a5 | |||
| e7ea5f500d | |||
| a8fc95d4e4 | |||
| 3f598a5121 | |||
| 81c5ec0777 | |||
| 32bb58b272 | |||
| aa4b786ab3 | |||
| 3f5968b60c | |||
| 251eeb534a | |||
| 90add9f840 | |||
| 770624d492 | |||
| c59758ef65 | |||
| 15752335f4 | |||
| 3e4b48e206 | |||
| 25c685527a | |||
| fbabd137c2 | |||
| 6e7cf68164 | |||
| b47a532eb4 | |||
| 7c30ea32bf | |||
| bb06e044f5 | |||
| 01318a08b4 | |||
| 119487f1aa | |||
| 911427a361 | |||
| 58628a4bfc | |||
| b08b360f38 | |||
| adb8d0e845 | |||
| e0f009b3b9 | |||
| f1aa03c360 | |||
| 2ba417cf9f | |||
| d8af074ff6 | |||
| daf2bbf991 | |||
| 6605f293b4 | |||
| 482e18ccdb | |||
| ef1e0e14ec | |||
| 33f083b213 | |||
| bcfbc0cf6c | |||
| 00d75ece64 | |||
| dc1b5d3424 | |||
| 58fb633df3 | |||
| 36f9366f3f | |||
| 712f1ca02a | |||
| 285b238f26 | |||
| 70fb12b10e | |||
| 6380a6be05 | |||
| 548fd92c15 | |||
| 86de53eb9a | |||
| e1616953db | |||
| c1dbab50fe | |||
| b6bb6a92a9 | |||
| 0ab80ad0a7 | |||
| 61744764da | |||
| 8eb98982f3 | |||
| 1090339331 | |||
| 804816f014 | |||
| 51e8318224 | |||
| 0d38a50dba | |||
| 72094acf74 | |||
| 1bd67943bb | |||
| 30101e129f | |||
| 9bb31678a6 | |||
| 5e5c52ff0a | |||
| d9d4742130 | |||
| 0fab6b7cab | |||
| f10286de8c | |||
| a0e0465704 | |||
| c8457a2619 | |||
| 14c36bc405 | |||
| 81319228bd | |||
| fcd7b05900 | |||
| 8378d95588 | |||
| b34f9b1795 | |||
| 35b098e656 | |||
| e05a45b080 | |||
| 715ee66b03 | |||
| 3d6e9da115 | |||
| 54410988eb | |||
| dded2c2463 | |||
| fcf5838019 | |||
| beafa18708 | |||
| bd371a11ad | |||
| 1895fee1c9 | |||
| 2200d0b678 | |||
| f3c4a7dd16 | |||
| 25834b89dd | |||
| 4d20dea271 | |||
| c59647ad2f | |||
| e466cbe0ce | |||
| a24de2d22a | |||
| f452a3025d | |||
| 3c58eaf49f | |||
| c75b497b2e | |||
| d572d77b48 | |||
| a4074332cc | |||
| c31ceb6a5b | |||
| b0863d8628 | |||
| c38a6d74dd | |||
| 7bec75b709 | |||
| 56ea24b03b | |||
| 277829c280 | |||
| c127aaae6b | |||
| c895848061 | |||
| 64e5ebb55f | |||
| 83addd6bba | |||
| d87a19b2f9 | |||
| b58edc980c | |||
| f3e72623e9 | |||
| 54ee76bcef | |||
| efe6faabfd | |||
| 3ee8b655ea | |||
| c70d138eb9 | |||
| af2a327310 | |||
| b27e0e2807 | |||
| 8267ed53f0 | |||
| aa90d7b4b7 | |||
| 6b69946b9e | |||
| f6116db957 | |||
| c824429458 | |||
| 23b2154d98 | |||
| 25c8711aad | |||
| cf30628d4e | |||
| 7675c730b6 | |||
| 2ce74c05e1 | |||
| 88e6558da3 | |||
| f1140ec903 | |||
| a2e114e852 | |||
| 8f6fc0146b | |||
| 6ad1cd3fb5 | |||
| 40443d1e25 | |||
| 4ec323c5cc | |||
| 300d901618 | |||
| fd6daa580a | |||
| c2fc47df34 |
@@ -80,6 +80,7 @@ stxxl.errlog
|
||||
/test/profile.lua
|
||||
/test/cache
|
||||
/test/speeds.csv
|
||||
/test/data/monaco.*
|
||||
node_modules
|
||||
|
||||
# Deprecated config file #
|
||||
|
||||
+37
-48
@@ -13,7 +13,7 @@ notifications:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- "5.0"
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
@@ -26,8 +26,8 @@ matrix:
|
||||
addons: &gcc5
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-5' BUILD_TYPE='Debug'
|
||||
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'pip']
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
@@ -35,20 +35,20 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-4.8' BUILD_TYPE='Debug'
|
||||
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Debug'
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons: &clang38
|
||||
apt:
|
||||
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
||||
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
|
||||
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
compiler: clang
|
||||
env: COMPILER='clang++' BUILD_TYPE='Debug'
|
||||
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Debug'
|
||||
|
||||
# Release Builds
|
||||
- os: linux
|
||||
@@ -57,7 +57,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-5' BUILD_TYPE='Release'
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
@@ -65,20 +65,20 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-4.8' BUILD_TYPE='Release'
|
||||
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons: &clang38
|
||||
apt:
|
||||
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
||||
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
|
||||
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
compiler: clang
|
||||
env: COMPILER='clang++' BUILD_TYPE='Release'
|
||||
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Release'
|
||||
|
||||
# Shared Library
|
||||
- os: linux
|
||||
@@ -87,39 +87,15 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons: &clang38
|
||||
apt:
|
||||
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
||||
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
|
||||
# Disabled until tests all pass on OSX:
|
||||
#
|
||||
# 3/ OSX Clang Builds
|
||||
#- os: osx
|
||||
# osx_image: xcode6.4
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Debug'
|
||||
|
||||
#- os: osx
|
||||
# osx_image: xcode6.4
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Release'
|
||||
|
||||
#- os: osx
|
||||
# osx_image: xcode6.4
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
#- os: osx
|
||||
# osx_image: xcode7
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
before_install:
|
||||
- source ./scripts/install_node.sh 4
|
||||
@@ -128,12 +104,15 @@ install:
|
||||
- npm install
|
||||
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
||||
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
|
||||
- |
|
||||
if [[ -n "${COVERAGE}" ]]; then
|
||||
pip install --user cpp-coveralls
|
||||
fi
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
|
||||
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
|
||||
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
|
||||
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
|
||||
|
||||
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
|
||||
brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum
|
||||
@@ -146,9 +125,9 @@ before_script:
|
||||
./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
fi
|
||||
- mkdir build && pushd build
|
||||
- export CXX=${COMPILER}
|
||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||
- export OSRM_PORT=5000 OSRM_TIMEOUT=6000
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
|
||||
|
||||
script:
|
||||
- make --jobs=2
|
||||
@@ -159,19 +138,29 @@ script:
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
sudo ldconfig
|
||||
fi
|
||||
- ./extractor-tests
|
||||
- ./engine-tests
|
||||
- ./util-tests
|
||||
- echo "travis_fold:start:UNIT_TESTS"
|
||||
- ./unit_tests/extractor-tests
|
||||
- ./unit_tests/engine-tests
|
||||
- ./unit_tests/util-tests
|
||||
- ./unit_tests/server-tests
|
||||
- echo "travis_fold:end:UNIT_TESTS"
|
||||
- popd
|
||||
- echo "travis_fold:start:CUCUMBER"
|
||||
- npm test
|
||||
- make -C test/data
|
||||
- ./build/library-tests test/data/monaco.osrm
|
||||
- echo "travis_fold:end:CUCUMBER"
|
||||
- echo "travis_fold:start:BENCHMARK"
|
||||
- make -C test/data benchmark
|
||||
- echo "travis_fold:end:BENCHMARK"
|
||||
- ./build/unit_tests/library-tests test/data/monaco.osrm
|
||||
- mkdir example/build && pushd example/build
|
||||
- cmake ..
|
||||
- make
|
||||
- ./osrm-example ../../test/data/monaco.osrm
|
||||
- popd
|
||||
|
||||
after_success:
|
||||
- |
|
||||
if [ -n "$RUN_CLANG_FORMAT" ]; then
|
||||
./scripts/format.sh || true # we don't want to fail just yet
|
||||
fi
|
||||
- coveralls --build-root build --exclude unit_tests --exclude third_party --exclude node_modules --gcov-options '\-lp'
|
||||
|
||||
@@ -1,3 +1,80 @@
|
||||
# 5.0.1
|
||||
- Fixes:
|
||||
- Issue #2309: Fixes local path looping, same coordinates crash
|
||||
- Issue #2311: Fixes invalid assertion in loop unpacking
|
||||
- Issue #2310: Local paths could falsely end up trying to remove the start step
|
||||
|
||||
# 5.0.0
|
||||
Changes with regard 5.0.0 RC2:
|
||||
- API:
|
||||
- if `geometry=geojson` is passed the resulting geometry can be a LineString or Point
|
||||
depending on how many coordinates are present.
|
||||
- the removal of the summary field was revered. for `steps=flase` the field will always be an empty string.
|
||||
|
||||
Changes with regard to 4.9.1:
|
||||
- API:
|
||||
- BREAKING: Complete rewrite of the HTTP and library API. See detailed documentation in the wiki.
|
||||
- BREAKING: The default coordinate order is now `longitude, latidue`. Exception: Polyline geometry
|
||||
which follow the original Google specification of `latitdue, longitude`.
|
||||
- BREAKING: Polyline geometries now use precision 5, instead of previously 6
|
||||
- BREAKING: Removed GPX support
|
||||
- New service `tile` which serves debug vector tiles of the road network
|
||||
- Completely new engine for guidance generation:
|
||||
- Support for highway ramps
|
||||
- Support for different intersection types (end of street, forks, merges)
|
||||
- Instruction post-processing to merge unimportant instructions
|
||||
- Improved handling of roundabouts
|
||||
|
||||
- Tools:
|
||||
- BREAKING: Renamed osrm-prepare to osrm-contract
|
||||
- BREAKING: Removes profiles from osrm-contract, only needed in osrm-extract.
|
||||
- Abort processing in osrm-extract if there are no snappable edges remaining.
|
||||
- Added .properties file to osrm-extract ouput.
|
||||
- Enables the use of multiple segment-speed-files on the osrm-contract command line
|
||||
|
||||
- Profile changes:
|
||||
- Remove movable bridge mode
|
||||
- Add `maxspeed=none` tag to car profile.
|
||||
- A `side_road` tag support for the OSRM car profile.
|
||||
|
||||
- Fixes:
|
||||
- Issue #2150: Prevents routing over delivery ways and nodes
|
||||
- Issue #1972: Provide uninstall target
|
||||
- Issue #2072: Disable alternatives by default and if core factor < 1.0
|
||||
- Issue #1999: Fix unpacking for self-loop nodes not in core.
|
||||
|
||||
- Infrastructure:
|
||||
- Cucumber test suit is now based on cucumber-js, removes Ruby as dependency
|
||||
- Updated to mapbox/variant v1.1
|
||||
- Updated to libosmium v2.6.1
|
||||
- Remove GeoJSON based debugging output, replaced by debug tiles
|
||||
|
||||
|
||||
# 5.0.0 RC2
|
||||
- Profiles:
|
||||
- `properties.allow_uturns_at_via` -> `properties.continue_straight_at_waypoint` (value is inverted!)
|
||||
- API:
|
||||
- Removed summary from legs property
|
||||
- Disable steps and alternatives by default
|
||||
- Fix `code` field: 'ok' -> 'Ok'
|
||||
- Allow 4.json and 4.3.json format
|
||||
- Conform to v5 spec and support "unlimited" as radiuses value.
|
||||
- `uturns` parameter was replaced by `continue_straight` (value is inverted!)
|
||||
- Features:
|
||||
- Report progress for gennerating edge expanded edges in the edge based graph factory
|
||||
- Add maxspeed=none tag to car profile.
|
||||
- Optimize StaticRTree code: speedup 2x (to RC1)
|
||||
- Optimize DouglasPeucker code: speedup 10x (to RC1)
|
||||
- Optimize WebMercator projection: speedup 2x (to RC1)
|
||||
- Bugs:
|
||||
- #2195: Resolves issues with multiple includedirs in pkg-config file
|
||||
- #2219: Internal server error when using the match plugin
|
||||
- #2027: basename -> filename
|
||||
- #2168: Report correct position where parsing failed
|
||||
- #2036: Add license to storage and storage config exposed in public API
|
||||
- Fix uturn detection in match plugin
|
||||
- Add missing -lz to fix linking of server-tests
|
||||
|
||||
# 5.0.0 RC1
|
||||
- Renamed osrm-prepare into osrm-contract
|
||||
- osrm-contract does not need a profile parameter anymore
|
||||
|
||||
+37
-43
@@ -32,8 +32,10 @@ endif()
|
||||
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
||||
option(ENABLE_JSON_LOGGING "Adds additional JSON debug logging to the response" OFF)
|
||||
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
||||
option(BUILD_COMPONENTS "Build OSRM tools" ON)
|
||||
option(BUILD_COMPONENTS "Build osrm-components" ON)
|
||||
option(ENABLE_ASSERTIONS OFF)
|
||||
option(COVERAGE OFF)
|
||||
option(SANITIZER OFF)
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
@@ -46,10 +48,7 @@ add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
|
||||
COMMENT "Configuring revision fingerprint"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(tests DEPENDS engine-tests extractor-tests util-tests server-tests library-tests)
|
||||
add_custom_target(benchmarks DEPENDS rtree-bench)
|
||||
|
||||
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread unit_test_framework)
|
||||
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread)
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
|
||||
@@ -61,12 +60,6 @@ file(GLOB ContractorGlob src/contractor/*.cpp)
|
||||
file(GLOB StorageGlob src/storage/*.cpp)
|
||||
file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
|
||||
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
|
||||
file(GLOB ExtractorTestsGlob unit_tests/extractor/*.cpp)
|
||||
file(GLOB EngineTestsGlob unit_tests/engine/*.cpp)
|
||||
file(GLOB UtilTestsGlob unit_tests/util/*.cpp)
|
||||
file(GLOB ServerTestsGlob unit_tests/server/*.cpp)
|
||||
file(GLOB LibraryTestsGlob unit_tests/library/*.cpp)
|
||||
file(GLOB IOTestsGlob unit_tests/io/*.cpp)
|
||||
|
||||
add_library(UTIL OBJECT ${UtilGlob})
|
||||
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
|
||||
@@ -87,21 +80,6 @@ add_library(osrm_extract $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
||||
|
||||
# Unit tests
|
||||
add_executable(engine-tests EXCLUDE_FROM_ALL unit_tests/engine_tests.cpp ${EngineTestsGlob} $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
||||
add_executable(extractor-tests EXCLUDE_FROM_ALL unit_tests/extractor_tests.cpp ${ExtractorTestsGlob} $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_executable(util-tests EXCLUDE_FROM_ALL unit_tests/util_tests.cpp ${UtilTestsGlob} $<TARGET_OBJECTS:UTIL>)
|
||||
add_executable(server-tests EXCLUDE_FROM_ALL unit_tests/server_tests.cpp ${ServerTestsGlob} $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:SERVER>)
|
||||
add_executable(library-tests EXCLUDE_FROM_ALL unit_tests/library_tests.cpp ${LibraryTestsGlob})
|
||||
|
||||
# Benchmarks
|
||||
add_executable(rtree-bench EXCLUDE_FROM_ALL src/benchmarks/static_rtree.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
|
||||
target_include_directories(engine-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
|
||||
target_include_directories(util-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
|
||||
target_include_directories(library-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/)
|
||||
target_include_directories(rtree-bench PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
|
||||
|
||||
# Check the release mode
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
@@ -157,8 +135,19 @@ if(CMAKE_BUILD_TYPE MATCHES Release)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
add_definitions(-DBOOST_TEST_DYN_LINK)
|
||||
set(MAYBE_COVERAGE_LIBRARIES "")
|
||||
if (COVERAGE)
|
||||
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
message(ERROR "COVERAGE=ON only make sense with a Debug build")
|
||||
endif()
|
||||
set(MAYBE_COVERAGE_LIBRARIES "gcov")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
endif()
|
||||
if (SANITIZER)
|
||||
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
message(ERROR "SANITIZER=ON only make sense with a Debug build")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||
endif()
|
||||
|
||||
# Configuring compilers
|
||||
@@ -242,11 +231,13 @@ find_package(Osmium REQUIRED COMPONENTS io)
|
||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
|
||||
|
||||
|
||||
find_package(Boost 1.49.0 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
|
||||
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
if(NOT WIN32)
|
||||
add_definitions(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3 -DBOOST_RESULT_OF_USE_DECLTYPE)
|
||||
add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3)
|
||||
add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE)
|
||||
add_definitions(-DBOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
@@ -257,7 +248,7 @@ if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
||||
endif()
|
||||
|
||||
find_package( Luabind REQUIRED )
|
||||
find_package(Luabind REQUIRED)
|
||||
include(check_luabind)
|
||||
include_directories(SYSTEM ${LUABIND_INCLUDE_DIR})
|
||||
|
||||
@@ -307,7 +298,8 @@ set(EXTRACTOR_LIBRARIES
|
||||
${OSMIUM_LIBRARIES}
|
||||
${STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES}
|
||||
${ZLIB_LIBRARY})
|
||||
${ZLIB_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(CONTRACTOR_LIBRARIES
|
||||
${Boost_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
@@ -315,35 +307,32 @@ set(CONTRACTOR_LIBRARIES
|
||||
${USED_LUA_LIBRARIES}
|
||||
${STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_RT_LIBRARY})
|
||||
${MAYBE_RT_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(ENGINE_LIBRARIES
|
||||
${Boost_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_RT_LIBRARY})
|
||||
${MAYBE_RT_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(STORAGE_LIBRARIES
|
||||
${Boost_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_RT_LIBRARY})
|
||||
${MAYBE_RT_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(UTIL_LIBRARIES
|
||||
${Boost_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES})
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
# Libraries
|
||||
target_link_libraries(osrm ${ENGINE_LIBRARIES})
|
||||
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
||||
# Tests
|
||||
target_link_libraries(engine-tests ${ENGINE_LIBRARIES})
|
||||
target_link_libraries(server-tests osrm ${Boost_LIBRARIES})
|
||||
target_link_libraries(extractor-tests ${EXTRACTOR_LIBRARIES})
|
||||
target_link_libraries(rtree-bench ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES})
|
||||
target_link_libraries(util-tests ${UTIL_LIBRARIES})
|
||||
target_link_libraries(library-tests osrm ${Boost_LIBRARIES})
|
||||
|
||||
if(BUILD_COMPONENTS)
|
||||
find_package(GDAL)
|
||||
@@ -460,3 +449,8 @@ configure_file(
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
|
||||
|
||||
|
||||
# Modular build system: each directory registered here provides its own CMakeLists.txt
|
||||
add_subdirectory(unit_tests)
|
||||
add_subdirectory(src/benchmarks)
|
||||
|
||||
@@ -10,6 +10,7 @@ The Open Source Routing Machine is a high performance routing engine written in
|
||||
| Linux | develop | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
||||
| Windows | master/develop | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||
| LUAbind fork | master | [](https://travis-ci.org/DennisOSRM/luabind) |
|
||||
| Coverage | develop | [](https://coveralls.io/github/Project-OSRM/osrm-backend?branch=develop) |
|
||||
|
||||
## Building
|
||||
|
||||
|
||||
+8
-5
@@ -116,14 +116,17 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
||||
|
||||
ECHO running engine-tests.exe ...
|
||||
%Configuration%\engine-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
ECHO running extractor-tests.exe ...
|
||||
%Configuration%\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 ...
|
||||
%Configuration%\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
|
||||
|
||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
includedir=${prefix}/include ${prefix}/include/osrm
|
||||
includedir=${prefix}/include
|
||||
libdir=${prefix}/lib
|
||||
|
||||
Name: libOSRM
|
||||
@@ -8,4 +8,4 @@ Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
|
||||
Requires:
|
||||
Libs: -L${libdir} -losrm
|
||||
Libs.private: @ENGINE_LIBRARY_LISTING@
|
||||
Cflags: -I${includedir}
|
||||
Cflags: -I${includedir} -I${includedir}/osrm
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
default: '--require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@guidance',
|
||||
verify: '--require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress --tags ~@guidance',
|
||||
default: '--require features --tags ~@stress --tags ~@todo',
|
||||
verify: '--require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress',
|
||||
jenkins: '--require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress',
|
||||
bugs: '--require features --tags @bug',
|
||||
todo: '--require features --tags @todo',
|
||||
|
||||
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on ways
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bike - Access tag hierachy on ways
|
||||
Scenario: Bike - Access tag hierarchy on ways
|
||||
Then routability should be
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| | | | | x |
|
||||
@@ -121,6 +121,7 @@ Feature: Bike - Access tags on ways
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | x |
|
||||
| | permissive | | x |
|
||||
| | designated | | x |
|
||||
@@ -129,6 +130,7 @@ Feature: Bike - Access tags on ways
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | x |
|
||||
| | | permissive | x |
|
||||
| | | designated | x |
|
||||
@@ -137,6 +139,7 @@ Feature: Bike - Access tags on ways
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
|
||||
Scenario: Bike - Access tags on both node and way
|
||||
Then routability should be
|
||||
|
||||
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on nodes
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bike - Access tag hierachy on nodes
|
||||
Scenario: Bike - Access tag hierarchy on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
|
||||
| | | | | x |
|
||||
@@ -47,6 +47,7 @@ Feature: Bike - Access tags on nodes
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | x |
|
||||
| | permissive | | x |
|
||||
| | designated | | x |
|
||||
@@ -55,6 +56,7 @@ Feature: Bike - Access tags on nodes
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | x |
|
||||
| | | permissive | x |
|
||||
| | | designated | x |
|
||||
@@ -63,3 +65,4 @@ Feature: Bike - Access tags on nodes
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
|
||||
@@ -4,7 +4,7 @@ Feature: Bike - Squares and other areas
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
@square @mokob @2154
|
||||
@square
|
||||
Scenario: Bike - Route along edge of a squares
|
||||
Given the node map
|
||||
| x | |
|
||||
@@ -50,7 +50,7 @@ Feature: Bike - Squares and other areas
|
||||
| d | a | xa,xa |
|
||||
| a | d | xa,xa |
|
||||
|
||||
@parking @mokob @2154
|
||||
@parking
|
||||
Scenario: Bike - parking areas
|
||||
Given the node map
|
||||
| e | | | f |
|
||||
@@ -78,7 +78,7 @@ Feature: Bike - Squares and other areas
|
||||
| a | d | abcda,abcda |
|
||||
|
||||
|
||||
@train @platform @mokob @2154
|
||||
@train @platform
|
||||
Scenario: Bike - railway platforms
|
||||
Given the node map
|
||||
| x | a | b | y |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@routing @bicycle @bridge
|
||||
Feature: Bicycle - Handle movable bridge
|
||||
Feature: Bicycle - Handle cycling
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
@@ -18,14 +18,14 @@ Feature: Bicycle - Handle movable bridge
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | g | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling |
|
||||
| b | f | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling |
|
||||
| e | c | cde,cde | movable bridge,movable bridge |
|
||||
| e | b | cde,abc,abc | movable bridge,cycling,cycling |
|
||||
| e | a | cde,abc,abc | movable bridge,cycling,cycling |
|
||||
| c | e | cde,cde | movable bridge,movable bridge |
|
||||
| c | f | cde,efg,efg | movable bridge,cycling,cycling |
|
||||
| c | g | cde,efg,efg | movable bridge,cycling,cycling |
|
||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
|
||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
|
||||
| e | c | cde,cde | cycling,cycling |
|
||||
| e | b | cde,abc,abc | cycling,cycling,cycling |
|
||||
| e | a | cde,abc,abc | cycling,cycling,cycling |
|
||||
| c | e | cde,cde | cycling,cycling |
|
||||
| c | f | cde,efg,efg | cycling,cycling,cycling |
|
||||
| c | g | cde,efg,efg | cycling,cycling,cycling |
|
||||
|
||||
Scenario: Bicycle - Properly handle durations
|
||||
Given the node map
|
||||
@@ -41,7 +41,7 @@ Feature: Bicycle - Handle movable bridge
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling | 5 km/h |
|
||||
| b | f | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling | 4 km/h |
|
||||
| c | e | cde,cde | movable bridge,movable bridge | 2 km/h |
|
||||
| e | c | cde,cde | movable bridge,movable bridge | 2 km/h |
|
||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||
|
||||
@@ -19,15 +19,15 @@ Feature: Bike - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab,bcd |
|
||||
| a | d | ab,bcd |
|
||||
| a | e | axye |
|
||||
| e | d | de |
|
||||
| e | c | de,bcd |
|
||||
| e | b | de,bcd |
|
||||
| e | a | axye |
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bcd,bcd |
|
||||
| a | d | ab,bcd,bcd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,bcd,bcd |
|
||||
| e | b | de,bcd,bcd |
|
||||
| e | a | axye,axye |
|
||||
|
||||
Scenario: Bike - Destination only street
|
||||
Given the node map
|
||||
@@ -45,15 +45,15 @@ Feature: Bike - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab,bc |
|
||||
| a | d | ab,bc,cd |
|
||||
| a | e | axye |
|
||||
| e | d | de |
|
||||
| e | c | de,dc |
|
||||
| e | b | de,dc,bc |
|
||||
| e | a | axye |
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bc,bc |
|
||||
| a | d | ab,bc,cd,cd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,cd,cd |
|
||||
| e | b | de,cd,bc,bc |
|
||||
| e | a | axye,axye |
|
||||
|
||||
Scenario: Bike - Routing inside a destination only area
|
||||
Given the node map
|
||||
@@ -70,8 +70,8 @@ Feature: Bike - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | e | ab,bc,cd,de |
|
||||
| e | a | de,cd,bc,ab |
|
||||
| b | d | bc,cd |
|
||||
| d | b | cd,bc |
|
||||
| from | to | route |
|
||||
| a | e | ab,bc,cd,de,de |
|
||||
| e | a | de,cd,bc,ab,ab |
|
||||
| b | d | bc,cd,cd |
|
||||
| d | b | cd,bc,bc |
|
||||
|
||||
@@ -16,13 +16,13 @@ Feature: Bike - Mode flag
|
||||
| cd | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,ferry,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,ferry,cycling,cycling |
|
||||
| c | a | bc,ab,ab | depart,left,arrive | ferry,cycling,cycling |
|
||||
| d | b | cd,bc,bc | depart,right,arrive | cycling,ferry,ferry |
|
||||
| a | c | ab,bc,bc | depart,right,arrive | cycling,ferry,ferry |
|
||||
| b | d | bc,cd,cd | depart,left,arrive | ferry,cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,ferry,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,ferry,cycling,cycling |
|
||||
| c | a | bc,ab,ab | ferry,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,ferry,ferry |
|
||||
| a | c | ab,bc,bc | cycling,ferry,ferry |
|
||||
| b | d | bc,cd,cd | ferry,cycling,cycling |
|
||||
|
||||
Scenario: Bike - Mode when using a train
|
||||
Given the node map
|
||||
@@ -36,13 +36,13 @@ Feature: Bike - Mode flag
|
||||
| cd | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,train,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,train,cycling,cycling |
|
||||
| c | a | bc,ab,ab | depart,left,arrive | train,cycling,cycling |
|
||||
| d | b | cd,bc,bc | depart,right,arrive | cycling,train,train |
|
||||
| a | c | ab,bc,bc | depart,right,arrive | cycling,train,train |
|
||||
| b | d | bc,cd,cd | depart,left,arrive | train,cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,train,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,train,cycling,cycling |
|
||||
| c | a | bc,ab,ab | train,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,train,train |
|
||||
| a | c | ab,bc,bc | cycling,train,train |
|
||||
| b | d | bc,cd,cd | train,cycling,cycling |
|
||||
|
||||
Scenario: Bike - Mode when pushing bike against oneways
|
||||
Given the node map
|
||||
@@ -56,13 +56,13 @@ Feature: Bike - Mode flag
|
||||
| cd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,cycling,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | depart,right,arrive | cycling,cycling,cycling |
|
||||
| b | d | bc,cd,cd | depart,left,arrive | cycling,cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | cycling,cycling,cycling |
|
||||
| b | d | bc,cd,cd | cycling,cycling,cycling |
|
||||
|
||||
Scenario: Bike - Mode when pushing on pedestrain streets
|
||||
Given the node map
|
||||
@@ -76,13 +76,13 @@ Feature: Bike - Mode flag
|
||||
| cd | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
|
||||
| b | d | bc,cd,cd | depart,left,arrive | pushing bike,cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
||||
|
||||
Scenario: Bike - Mode when pushing on pedestrain areas
|
||||
Given the node map
|
||||
@@ -116,13 +116,13 @@ Feature: Bike - Mode flag
|
||||
| cd | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
|
||||
| b | d | bc,cd,cd | depart,left,arrive | pushing bike,cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
||||
|
||||
Scenario: Bike - Mode when bicycle=dismount
|
||||
Given the node map
|
||||
@@ -136,13 +136,13 @@ Feature: Bike - Mode flag
|
||||
| cd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
|
||||
| b | d | bc,cd,cd | depart,left,arrive | pushing bike,cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
||||
|
||||
Scenario: Bicycle - Modes when starting on forward oneway
|
||||
Given the node map
|
||||
|
||||
@@ -63,7 +63,6 @@ Feature: Bike - Accessability of different way types
|
||||
| runway | | | |
|
||||
| runway | yes | foot | foot |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
|
||||
Then routability should be
|
||||
| highway | foot:forward | foot:backward | forw | backw |
|
||||
@@ -98,13 +97,12 @@ Feature: Bike - Accessability of different way types
|
||||
| cd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive |
|
||||
| c | a | bc,ab,ab | depart,left,arrive |
|
||||
| d | b | cd,bc,bc | depart,right,arrive |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
|
||||
Given the node map
|
||||
| a | b | |
|
||||
@@ -117,8 +115,8 @@ Feature: Bike - Accessability of different way types
|
||||
| cd | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive |
|
||||
| c | a | bc,ab,ab | depart,left,arrive |
|
||||
| d | b | cd,bc,bc | depart,right,arrive |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
@routing @bicycle @roundabout @instruction
|
||||
Feature: Roundabout Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bicycle - Roundabout instructions
|
||||
Given the node map
|
||||
| | | v | | |
|
||||
| | | d | | |
|
||||
| s | a | | c | u |
|
||||
| | | b | | |
|
||||
| | | t | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| sa | |
|
||||
| tb | |
|
||||
| uc | |
|
||||
| vd | |
|
||||
| abcda | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| s | t | sa,tb,tb | depart,roundabout-exit-1,arrive |
|
||||
| s | u | sa,uc,uc | depart,roundabout-exit-2,arrive |
|
||||
| s | v | sa,vd,vd | depart,roundabout-exit-3,arrive |
|
||||
| u | v | uc,vd,vd | depart,roundabout-exit-1,arrive |
|
||||
| u | s | uc,sa,sa | depart,roundabout-exit-2,arrive |
|
||||
| u | t | uc,tb,tb | depart,roundabout-exit-3,arrive |
|
||||
@@ -5,7 +5,7 @@ Feature: Car - Restricted access
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Access tag hierachy on ways
|
||||
Scenario: Car - Access tag hierarchy on ways
|
||||
Then routability should be
|
||||
| access | vehicle | motor_vehicle | motorcar | bothw |
|
||||
| | | | | x |
|
||||
@@ -30,7 +30,7 @@ Feature: Car - Restricted access
|
||||
| | | no | yes | x |
|
||||
| | | yes | no | |
|
||||
|
||||
Scenario: Car - Access tag hierachy on nodes
|
||||
Scenario: Car - Access tag hierarchy on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
|
||||
| | | | | x |
|
||||
@@ -94,6 +94,7 @@ Feature: Car - Restricted access
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | |
|
||||
| some_tag | x |
|
||||
|
||||
|
||||
@@ -108,6 +109,7 @@ Feature: Car - Restricted access
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | |
|
||||
| some_tag | x |
|
||||
|
||||
Scenario: Car - Access tags on both node and way
|
||||
|
||||
@@ -34,7 +34,6 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
| a | b | ab,ab | 47 km/h +- 1 |
|
||||
| b | c | bc,bc | 47 km/h +- 1 |
|
||||
|
||||
@mokob @2162
|
||||
Scenario: Car - Advisory speed overwrites backwards maxspeed
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
@@ -49,7 +48,6 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
| b | a | ab,ab | 47 km/h +- 1 |
|
||||
| c | b | bc,bc | 47 km/h +- 1 |
|
||||
|
||||
@mokob @2162 @deleteme
|
||||
Scenario: Car - Advisory speed overwrites backwards maxspeed
|
||||
Given the node map
|
||||
| a | b | c | d |
|
||||
@@ -65,7 +63,6 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
| c | b | bc,bc | 47 km/h +- 1 |
|
||||
| d | c | cd,cd | 47 km/h +- 1 |
|
||||
|
||||
@mokob @2162
|
||||
Scenario: Car - Directional advisory speeds play nice with eachother
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
|
||||
+13
-13
@@ -1,5 +1,5 @@
|
||||
@routing @car @bridge
|
||||
Feature: Car - Handle movable bridge
|
||||
Feature: Car - Handle driving
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
@@ -18,14 +18,14 @@ Feature: Car - Handle movable bridge
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | g | abc,cde,efg,efg | driving,movable bridge,driving,driving |
|
||||
| b | f | abc,cde,efg,efg | driving,movable bridge,driving,driving |
|
||||
| e | c | cde,cde | movable bridge,movable bridge |
|
||||
| e | b | cde,abc,abc | movable bridge,driving,driving |
|
||||
| e | a | cde,abc,abc | movable bridge,driving,driving |
|
||||
| c | e | cde,cde | movable bridge,movable bridge |
|
||||
| c | f | cde,efg,efg | movable bridge,driving,driving |
|
||||
| c | g | cde,efg,efg | movable bridge,driving,driving |
|
||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving |
|
||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving |
|
||||
| e | c | cde,cde | driving,driving |
|
||||
| e | b | cde,abc,abc | driving,driving,driving |
|
||||
| e | a | cde,abc,abc | driving,driving,driving |
|
||||
| c | e | cde,cde | driving,driving |
|
||||
| c | f | cde,efg,efg | driving,driving,driving |
|
||||
| c | g | cde,efg,efg | driving,driving,driving |
|
||||
|
||||
Scenario: Car - Properly handle durations
|
||||
Given the node map
|
||||
@@ -41,7 +41,7 @@ Feature: Car - Handle movable bridge
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,movable bridge,driving,driving | 7 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,movable bridge,driving,driving | 5 km/h |
|
||||
| c | e | cde,cde | movable bridge,movable bridge | 2 km/h |
|
||||
| e | c | cde,cde | movable bridge,movable bridge | 2 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 |
|
||||
|
||||
@@ -19,15 +19,15 @@ Feature: Car - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab,bcd |
|
||||
| a | d | ab,bcd |
|
||||
| a | e | axye |
|
||||
| e | d | de |
|
||||
| e | c | de,bcd |
|
||||
| e | b | de,bcd |
|
||||
| e | a | axye |
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bcd,bcd |
|
||||
| a | d | ab,bcd,bcd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,bcd,bcd |
|
||||
| e | b | de,bcd,bcd |
|
||||
| e | a | axye,axye |
|
||||
|
||||
Scenario: Car - Destination only street
|
||||
Given the node map
|
||||
@@ -45,15 +45,15 @@ Feature: Car - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab,bc |
|
||||
| a | d | ab,bc,cd |
|
||||
| a | e | axye |
|
||||
| e | d | de |
|
||||
| e | c | de,dc |
|
||||
| e | b | de,dc,bc |
|
||||
| e | a | axye |
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bc,bc |
|
||||
| a | d | ab,bc,cd,cd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,cd,cd |
|
||||
| e | b | de,cd,bc,bc |
|
||||
| e | a | axye,axye |
|
||||
|
||||
Scenario: Car - Routing inside a destination only area
|
||||
Given the node map
|
||||
@@ -70,8 +70,8 @@ Feature: Car - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | e | ab,bc,cd,de |
|
||||
| e | a | de,cd,bc,ab |
|
||||
| b | d | bc,cd |
|
||||
| d | b | cd,bc |
|
||||
| from | to | route |
|
||||
| a | e | ab,bc,cd,de,de |
|
||||
| e | a | de,cd,bc,ab,ab |
|
||||
| b | d | bc,cd,cd |
|
||||
| d | b | cd,bc,bc |
|
||||
|
||||
@@ -15,13 +15,13 @@ Feature: Car - Mode flag
|
||||
| cd | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd,cd | depart,right,left,arrive | driving,ferry,driving,driving |
|
||||
| d | a | cd,bc,ab,ab | depart,right,left,arrive | driving,ferry,driving,driving |
|
||||
| c | a | bc,ab,ab | depart,left,arrive | ferry,driving,driving |
|
||||
| d | b | cd,bc,bc | depart,right,arrive | driving,ferry,ferry |
|
||||
| a | c | ab,bc,bc | depart,right,arrive | driving,ferry,ferry |
|
||||
| b | d | bc,cd,cd | depart,left,arrive | ferry,driving,driving |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | driving,ferry,driving,driving |
|
||||
| d | a | cd,bc,ab,ab | driving,ferry,driving,driving |
|
||||
| c | a | bc,ab,ab | ferry,driving,driving |
|
||||
| d | b | cd,bc,bc | driving,ferry,ferry |
|
||||
| a | c | ab,bc,bc | driving,ferry,ferry |
|
||||
| b | d | bc,cd,cd | ferry,driving,driving |
|
||||
|
||||
Scenario: Car - Snapping when using a ferry
|
||||
Given the node map
|
||||
@@ -34,7 +34,7 @@ Feature: Car - Mode flag
|
||||
| ef | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes | time |
|
||||
| c | d | bcde,bcde | depart,arrive | ferry,ferry | 600s |
|
||||
| from | to | route | modes | time |
|
||||
| c | d | bcde,bcde | ferry,ferry | 600s |
|
||||
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
@routing @car @roundabout @instruction
|
||||
Feature: Roundabout Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Roundabout instructions
|
||||
Given the node map
|
||||
| | | v | | |
|
||||
| | | d | | |
|
||||
| s | a | | c | u |
|
||||
| | | b | | |
|
||||
| | | t | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| sa | |
|
||||
| tb | |
|
||||
| uc | |
|
||||
| vd | |
|
||||
| abcda | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| s | t | sa,tb,tb | depart,roundabout-exit-1,arrive |
|
||||
| s | u | sa,uc,uc | depart,roundabout-exit-2,arrive |
|
||||
| s | v | sa,vd,vd | depart,roundabout-exit-3,arrive |
|
||||
| u | v | uc,vd,vd | depart,roundabout-exit-1,arrive |
|
||||
| u | s | uc,sa,sa | depart,roundabout-exit-2,arrive |
|
||||
| u | t | uc,tb,tb | depart,roundabout-exit-3,arrive |
|
||||
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on ways
|
||||
Background:
|
||||
Given the profile "foot"
|
||||
|
||||
Scenario: Foot - Access tag hierachy on ways
|
||||
Scenario: Foot - Access tag hierarchy on ways
|
||||
Then routability should be
|
||||
| highway | access | foot | bothw |
|
||||
| footway | | | x |
|
||||
@@ -52,6 +52,7 @@ Feature: Foot - Access tags on ways
|
||||
| private | | |
|
||||
| agricultural | | |
|
||||
| forestry | | |
|
||||
| delivery | | |
|
||||
| | yes | x |
|
||||
| | permissive | x |
|
||||
| | designated | x |
|
||||
@@ -60,6 +61,7 @@ Feature: Foot - Access tags on ways
|
||||
| | private | |
|
||||
| | agricultural | |
|
||||
| | forestry | |
|
||||
| | delivery | |
|
||||
|
||||
Scenario: Foot - Access tags on both node and way
|
||||
Then routability should be
|
||||
|
||||
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on nodes
|
||||
Background:
|
||||
Given the profile "foot"
|
||||
|
||||
Scenario: Foot - Access tag hierachy on nodes
|
||||
Scenario: Foot - Access tag hierarchy on nodes
|
||||
Then routability should be
|
||||
| node/access | node/foot | bothw |
|
||||
| | | x |
|
||||
@@ -40,6 +40,7 @@ Feature: Foot - Access tags on nodes
|
||||
| private | | |
|
||||
| agricultural | | |
|
||||
| forestry | | |
|
||||
| delivery | | |
|
||||
| no | yes | x |
|
||||
| no | permissive | x |
|
||||
| no | designated | x |
|
||||
@@ -48,3 +49,4 @@ Feature: Foot - Access tags on nodes
|
||||
| yes | private | |
|
||||
| yes | agricultural | |
|
||||
| yes | forestry | |
|
||||
| yes | delivery | |
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
@routing @guidance
|
||||
Feature: Continue Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Road turning left
|
||||
Given the node map
|
||||
| | | c | |
|
||||
| a | | b | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
||||
| a,d | abc,bd,bd | depart,new name straight,arrive |
|
||||
|
||||
Scenario: Road turning right
|
||||
Given the node map
|
||||
| a | | b | d |
|
||||
| | | c | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,continue right,arrive |
|
||||
| a,d | abc,bd,bd | depart,new name straight,arrive |
|
||||
|
||||
Scenario: Road turning slight left
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| | | | | |
|
||||
| a | | b | | |
|
||||
| | | | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
|
||||
Scenario: Road turning slight right
|
||||
Given the node map
|
||||
| | | | d | |
|
||||
| a | | b | | |
|
||||
| | | | | |
|
||||
| | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,continue right,arrive |
|
||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
||||
|
||||
Scenario: Road Loop
|
||||
Given the node map
|
||||
| | | f | | e |
|
||||
| | | | | |
|
||||
| a | | b | g | |
|
||||
| | | | | |
|
||||
| | | c | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abcdefb | primary |
|
||||
| bg | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
|
||||
| a,f | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
|
||||
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
|
||||
| a,e | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
|
||||
@@ -0,0 +1,123 @@
|
||||
@routing @guidance
|
||||
Feature: End Of Road Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: End of Road with through street
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | | b |
|
||||
| | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cbd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with three streets
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | | b |
|
||||
| | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cb | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,end of road left,arrive |
|
||||
| a,d | ab,bd,bd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with three streets, slightly angled
|
||||
Given the node map
|
||||
| a | | | | | c |
|
||||
| | | | | | b |
|
||||
| | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cb | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,end of road left,arrive |
|
||||
| a,d | ab,bd,bd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with three streets, slightly angled
|
||||
Given the node map
|
||||
| | | | | | c |
|
||||
| | | | | | b |
|
||||
| a | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cb | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,end of road left,arrive |
|
||||
| a,d | ab,bd,bd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with through street, slightly angled
|
||||
Given the node map
|
||||
| a | | | | | c |
|
||||
| | | | | | b |
|
||||
| | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cbd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with through street, slightly angled
|
||||
Given the node map
|
||||
| | | | | | c |
|
||||
| | | | | | b |
|
||||
| a | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cbd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with two ramps - prefer ramp over end of road
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | | b |
|
||||
| | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | motorway_link |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,ramp left,arrive |
|
||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
@routing @guidance
|
||||
Feature: Fork Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Fork Same Road Class
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| a | | b | | |
|
||||
| | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Do not fork on link type
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| a | | b | | |
|
||||
| | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary_link |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Fork in presence of other roads
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| a | | b | | |
|
||||
| | e | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| bd | primary |
|
||||
| eb | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork Turning Slight Left
|
||||
Given the node map
|
||||
| | | | | | c |
|
||||
| | | | | | |
|
||||
| a | | b | | | |
|
||||
| | | | | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork Turning Slight Right
|
||||
Given the node map
|
||||
| | | | | c | |
|
||||
| a | | b | | | |
|
||||
| | | | | | |
|
||||
| | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Do not fork on service
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| a | | b | | |
|
||||
| | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | residential |
|
||||
| bd | service |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Fork Both Turning Slight Right
|
||||
Given the node map
|
||||
| a | | b | | | |
|
||||
| | | | | | c |
|
||||
| | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork Both Turning Slight Left
|
||||
Given the node map
|
||||
| | | | | | c |
|
||||
| | | | | | d |
|
||||
| a | | b | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork Both Turning Slight Right - Unnamed
|
||||
Given the node map
|
||||
| a | | b | | | |
|
||||
| | | | | | c |
|
||||
| | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | |
|
||||
| bc | primary | |
|
||||
| bd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ,, | depart,fork slight left,arrive |
|
||||
| a,d | ,, | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork Both Turning Slight Left - Unnamed
|
||||
Given the node map
|
||||
| | | | | | c |
|
||||
| | | | | | d |
|
||||
| a | | b | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | |
|
||||
| bc | primary | |
|
||||
| bd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ,, | depart,fork slight left,arrive |
|
||||
| a,d | ,, | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork Both Turning Very Slightly Right - Unnamed
|
||||
Given the node map
|
||||
| a | | b | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | c | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | |
|
||||
| bc | primary | |
|
||||
| bd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ,, | depart,fork slight left,arrive |
|
||||
| a,d | ,, | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork Both Turning Very Slightly Right - Unnamed Ramps
|
||||
Given the node map
|
||||
| a | | b | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | c | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | motorway_link | |
|
||||
| bc | motorway_link | |
|
||||
| bd | motorway_link | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ,, | depart,fork slight left,arrive |
|
||||
| a,d | ,, | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Non-Fork on complex intersection - left
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| a | | b | | |
|
||||
| | e | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | secondary |
|
||||
| bd | tertiary |
|
||||
| eb | tertiary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Non-Fork on complex intersection - right
|
||||
Given the node map
|
||||
| | e | | | c |
|
||||
| a | | b | | |
|
||||
| | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abd | secondary |
|
||||
| bc | tertiary |
|
||||
| eb | tertiary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abd,bc,bc | depart,turn slight left,arrive |
|
||||
| a,d | abd,abd | depart,arrive |
|
||||
|
||||
@pr2275 @bug
|
||||
Scenario: Tripple fork
|
||||
Given the node map
|
||||
| | | | | | | | | c |
|
||||
| a | | b | | d | | | | |
|
||||
| | | | | | | | | e |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | secondary |
|
||||
| bc | secondary |
|
||||
| bd | secondary |
|
||||
| be | secondary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,fork slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,fork straight,arrive |
|
||||
| a,e | ab,be,be | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Tripple fork -- middle obvious
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| a | | b | | d |
|
||||
| | | | | e |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abd | secondary |
|
||||
| bc | secondary |
|
||||
| be | secondary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abd,bc,bc | depart,turn slight left,arrive |
|
||||
| a,d | abd,abd | depart,arrive |
|
||||
| a,e | abd,be,be | depart,turn slight right,arrive |
|
||||
@@ -0,0 +1,52 @@
|
||||
@routing @guidance
|
||||
Feature: Merging
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Merge on Four Way Intersection
|
||||
Given the node map
|
||||
| d | | |
|
||||
| a | b | c |
|
||||
| e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| db | primary |
|
||||
| eb | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,merge slight right,arrive |
|
||||
| e,c | eb,abc,abc | depart,merge slight left,arrive |
|
||||
|
||||
Scenario: Merge on Three Way Intersection Right
|
||||
Given the node map
|
||||
| d | | |
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| db | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,merge slight right,arrive |
|
||||
|
||||
Scenario: Merge on Three Way Intersection Right
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| d | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| db | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,merge slight left,arrive |
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@routing @guidance
|
||||
Feature: Basic Roundabout
|
||||
Feature: Motorway Guidance
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Ramp Exit Right
|
||||
@@ -16,9 +16,9 @@ Feature: Basic Roundabout
|
||||
| bfg | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| a,g | abcde, bfg, bfg | depart, ramp-slight-right, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| a,g | abcde,bfg,bfg | depart,ramp slight right,arrive |
|
||||
|
||||
Scenario: Ramp Exit Right Curved Right
|
||||
Given the node map
|
||||
@@ -32,9 +32,9 @@ Feature: Basic Roundabout
|
||||
| bfg | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| a,g | abcde, bfg, bfg | depart, ramp-slight-right, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| a,g | abcde,bfg,bfg | depart,ramp right,arrive |
|
||||
|
||||
Scenario: Ramp Exit Right Curved Left
|
||||
Given the node map
|
||||
@@ -49,9 +49,9 @@ Feature: Basic Roundabout
|
||||
| cfg | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| a,g | abcde, cfg, cfg | depart, ramp-slight-right, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| a,g | abcde,cfg,cfg | depart,ramp slight right,arrive |
|
||||
|
||||
|
||||
Scenario: Ramp Exit Left
|
||||
@@ -65,9 +65,9 @@ Feature: Basic Roundabout
|
||||
| bfg | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| a,g | abcde, bfg, bfg | depart, ramp-slight-left, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| a,g | abcde,bfg,bfg | depart,ramp slight left,arrive |
|
||||
|
||||
Scenario: Ramp Exit Left Curved Left
|
||||
Given the node map
|
||||
@@ -81,9 +81,9 @@ Feature: Basic Roundabout
|
||||
| bfg | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| a,g | abcde, bfg, bfg | depart, ramp-slight-left, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| a,g | abcde,bfg,bfg | depart,ramp left,arrive |
|
||||
|
||||
Scenario: Ramp Exit Left Curved Right
|
||||
Given the node map
|
||||
@@ -97,9 +97,9 @@ Feature: Basic Roundabout
|
||||
| cfg | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| a,g | abcde, cfg, cfg | depart, ramp-slight-left, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| a,g | abcde,cfg,cfg | depart,ramp slight left,arrive |
|
||||
|
||||
Scenario: On Ramp Right
|
||||
Given the node map
|
||||
@@ -112,9 +112,9 @@ Feature: Basic Roundabout
|
||||
| fgd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| f,e | abcde, fgd, fgd | depart, merge-slight-left, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| f,e | fgd,abcde,abcde | depart,merge slight left,arrive |
|
||||
|
||||
Scenario: On Ramp Left
|
||||
Given the node map
|
||||
@@ -127,9 +127,9 @@ Feature: Basic Roundabout
|
||||
| fgd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| f,e | abcde, fgd, fgd | depart, merge-slight-right, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| f,e | fgd,abcde,abcde | depart,merge slight right,arrive |
|
||||
|
||||
Scenario: Highway Fork
|
||||
Given the node map
|
||||
@@ -143,9 +143,9 @@ Feature: Basic Roundabout
|
||||
| cfg | motorway |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde, abcde | depart, fork-left, arrive |
|
||||
| a,g | abcde, cfg, cfg | depart, fork-right, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde,abcde | depart,fork slight left,arrive |
|
||||
| a,g | abcde,cfg,cfg | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: Fork After Ramp
|
||||
Given the node map
|
||||
@@ -160,9 +160,9 @@ Feature: Basic Roundabout
|
||||
| cfg | motorway |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abc, cde, cde | depart, fork-left, arrive |
|
||||
| a,g | abc, cfg, cfg | depart, fork-right, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abc,cde,cde | depart,fork slight left,arrive |
|
||||
| a,g | abc,cfg,cfg | depart,fork slight right,arrive |
|
||||
|
||||
Scenario: On And Off Ramp Right
|
||||
Given the node map
|
||||
@@ -176,11 +176,11 @@ Feature: Basic Roundabout
|
||||
| chi | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| f,e | fgc, abcde, abcde | depart, merge-slight-left, arrive |
|
||||
| a,i | abcde, chi, chi | depart, ramp-slight-right, arrive |
|
||||
| f,i | fgc, chi, chi | depart, turn-slight-right, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| f,e | fgc,abcde,abcde | depart,merge slight left,arrive |
|
||||
| a,i | abcde,chi,chi | depart,ramp slight right,arrive |
|
||||
| f,i | fgc,chi,chi | depart,ramp right,arrive |
|
||||
|
||||
Scenario: On And Off Ramp Left
|
||||
Given the node map
|
||||
@@ -194,9 +194,25 @@ Feature: Basic Roundabout
|
||||
| chi | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde, abcde | depart, arrive |
|
||||
| f,e | fgc, abcde, abcde | depart, merge-slight-right, arrive |
|
||||
| a,i | abcde, chi, chi | depart, ramp-slight-left, arrive |
|
||||
| f,i | fgc, chi, chi | depart, turn-slight-left, arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| f,e | fgc,abcde,abcde | depart,merge slight right,arrive |
|
||||
| a,i | abcde,chi,chi | depart,ramp slight left,arrive |
|
||||
| f,i | fgc,chi,chi | depart,ramp left,arrive |
|
||||
|
||||
Scenario: Merging Motorways
|
||||
Given the node map
|
||||
| e | | |
|
||||
| a | b | c |
|
||||
| d | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | motorway |
|
||||
| db | motorway |
|
||||
| eb | motorway |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,merge slight left,arrive |
|
||||
| e,c | eb,abc,abc | depart,merge slight right,arrive |
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
@routing @guidance
|
||||
Feature: New-Name Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Undisturbed name Change
|
||||
Given the node map
|
||||
| a | | b | | c |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name straight,arrive |
|
||||
|
||||
|
||||
Scenario: Undisturbed Name Change with unannounced Turn Right
|
||||
Given the node map
|
||||
| a | | b | | |
|
||||
| | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name slight right,arrive |
|
||||
|
||||
Scenario: Undisturbed Name Change with unannounced Turn Left
|
||||
Given the node map
|
||||
| | | | | c |
|
||||
| a | | b | | |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name slight left,arrive |
|
||||
|
||||
Scenario: Disturbed Name Change with Turn
|
||||
Given the node map
|
||||
| a | | b | | |
|
||||
| | d | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| db |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name slight right,arrive |
|
||||
|
||||
Scenario: Undisturbed Name Change with announced Turn Left
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | | b |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name left,arrive |
|
||||
|
||||
Scenario: Undisturbed Name Change with announced Turn Sharp Left
|
||||
Given the node map
|
||||
| c | | |
|
||||
| a | | b |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name sharp left,arrive |
|
||||
|
||||
Scenario: Undisturbed Name Change with announced Turn Right
|
||||
Given the node map
|
||||
| a | | b |
|
||||
| | | c |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name right,arrive |
|
||||
|
||||
Scenario: Undisturbed Name Change with announced Turn Sharp Right
|
||||
Given the node map
|
||||
| a | | b |
|
||||
| c | | |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name sharp right,arrive |
|
||||
|
||||
|
||||
Scenario: Disturbed Name Change with minor road class
|
||||
Given the node map
|
||||
| a | | b | | d |
|
||||
| | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | residential |
|
||||
| bc | residential |
|
||||
| bd | service |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,new name slight right,arrive |
|
||||
@@ -0,0 +1,229 @@
|
||||
@routing @guidance
|
||||
Feature: Ramp Guidance
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Ramp On Through Street Right
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
||||
|
||||
Scenario: Ramp On Through Street Left
|
||||
Given the node map
|
||||
| | d | |
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp left,arrive |
|
||||
|
||||
Scenario: Ramp On Through Street Left and Right
|
||||
Given the node map
|
||||
| | e | |
|
||||
| a | b | c |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| be | motorway_link |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
||||
| a,e | abc,be,be | depart,ramp left,arrive |
|
||||
|
||||
Scenario: Ramp On Three Way Intersection Right
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | tertiary |
|
||||
| bc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
||||
|
||||
Scenario: Ramp On Three Way Intersection Right
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | b | |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | tertiary |
|
||||
| bc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
||||
|
||||
Scenario: Ramp Off Though Street
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | b | |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
|
||||
Scenario: Straight Ramp Off Turning Though Street
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | b | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp straight,arrive |
|
||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
||||
|
||||
Scenario: Fork Ramp Off Turning Though Street
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | b | |
|
||||
| | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp right,arrive |
|
||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
||||
|
||||
Scenario: Fork Ramp
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | b | |
|
||||
| | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | tertiary |
|
||||
| bc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd,bd | depart,ramp right,arrive |
|
||||
| a,c | ab,bc,bc | depart,turn left,arrive |
|
||||
|
||||
Scenario: Fork Slight Ramp
|
||||
Given the node map
|
||||
| | | | c |
|
||||
| a | b | | |
|
||||
| | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | tertiary |
|
||||
| bc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd,bd | depart,ramp slight right,arrive |
|
||||
| a,c | ab,bc,bc | depart,turn slight left,arrive |
|
||||
|
||||
Scenario: Fork Slight Ramp on Through Street
|
||||
Given the node map
|
||||
| | | | c |
|
||||
| a | b | | |
|
||||
| | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp slight right,arrive |
|
||||
| a,c | abc,abc,abc | depart,continue slight left,arrive |
|
||||
|
||||
Scenario: Fork Slight Ramp on Obvious Through Street
|
||||
Given the node map
|
||||
| | | | c |
|
||||
| a | b | | |
|
||||
| | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,ramp slight right,arrive |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
|
||||
Scenario: Two Ramps Joining into common Motorway
|
||||
Given the node map
|
||||
| a | | | |
|
||||
| | | c | d |
|
||||
| b | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ac | motorway_link |
|
||||
| bc | motorway_link |
|
||||
| cd | motorway |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ac,cd,cd | depart,new name slight left,arrive |
|
||||
| b,d | bc,cd,cd | depart,new name slight right,arrive |
|
||||
|
||||
Scenario: Two Ramps Joining into common Motorway Unnamed
|
||||
Given the node map
|
||||
| a | | | |
|
||||
| | | c | d |
|
||||
| b | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ac | motorway_link | |
|
||||
| bc | motorway_link | |
|
||||
| cd | motorway | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | , | depart,arrive |
|
||||
| b,d | , | depart,arrive |
|
||||
@@ -0,0 +1,167 @@
|
||||
@routing @guidance
|
||||
Feature: Rotary
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given a grid size of 30 meters
|
||||
|
||||
Scenario: Enter and Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bgecb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
|
||||
|
||||
Scenario: Only Enter
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
|
||||
Scenario: Only Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
|
||||
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
|
||||
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
|
||||
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
|
||||
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
|
||||
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
|
||||
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
|
||||
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
|
||||
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
|
||||
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
|
||||
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
|
||||
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
|
||||
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
|
||||
|
||||
Scenario: Drive Around
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,c | bcegb,bcegb | depart,arrive |
|
||||
| b,e | bcegb,bcegb | depart,arrive |
|
||||
| b,g | bcegb,bcegb | depart,arrive |
|
||||
| c,e | bcegb,bcegb | depart,arrive |
|
||||
| c,g | bcegb,bcegb | depart,arrive |
|
||||
| c,b | bcegb,bcegb | depart,arrive |
|
||||
| e,g | bcegb,bcegb | depart,arrive |
|
||||
| e,b | bcegb,bcegb | depart,arrive |
|
||||
| e,c | bcegb,bcegb | depart,arrive |
|
||||
| g,b | bcegb,bcegb | depart,arrive |
|
||||
| g,c | bcegb,bcegb | depart,arrive |
|
||||
| g,e | bcegb,bcegb | depart,arrive |
|
||||
|
||||
#needs to be adjusted when name-discovery works for entrys
|
||||
Scenario: Mixed Entry and Exit
|
||||
Given the node map
|
||||
| | c | | a | |
|
||||
| j | | b | | f |
|
||||
| | k | | e | |
|
||||
| l | | h | | d |
|
||||
| | g | | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| abc | | yes |
|
||||
| def | | yes |
|
||||
| ghi | | yes |
|
||||
| jkl | | yes |
|
||||
| bkheb | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
|
||||
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
|
||||
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
|
||||
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
|
||||
| d,f | def,def,def | depart,rotary-exit-1,arrive |
|
||||
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
|
||||
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
|
||||
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
|
||||
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
|
||||
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
|
||||
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
|
||||
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
|
||||
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
|
||||
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
|
||||
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
|
||||
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
|
||||
@@ -0,0 +1,262 @@
|
||||
@routing @guidance
|
||||
Feature: Rotary
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 30 meters
|
||||
|
||||
Scenario: Enter and Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bgecb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
|
||||
|
||||
Scenario: Only Enter
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
|
||||
|
||||
Scenario: Only Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
|
||||
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
|
||||
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
|
||||
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
|
||||
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
|
||||
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
|
||||
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
|
||||
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
|
||||
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
|
||||
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
|
||||
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
|
||||
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
|
||||
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
|
||||
|
||||
Scenario: Drive Around
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,c | bcegb,bcegb | depart,arrive |
|
||||
| b,e | bcegb,bcegb | depart,arrive |
|
||||
| b,g | bcegb,bcegb | depart,arrive |
|
||||
| c,e | bcegb,bcegb | depart,arrive |
|
||||
| c,g | bcegb,bcegb | depart,arrive |
|
||||
| c,b | bcegb,bcegb | depart,arrive |
|
||||
| e,g | bcegb,bcegb | depart,arrive |
|
||||
| e,b | bcegb,bcegb | depart,arrive |
|
||||
| e,c | bcegb,bcegb | depart,arrive |
|
||||
| g,b | bcegb,bcegb | depart,arrive |
|
||||
| g,c | bcegb,bcegb | depart,arrive |
|
||||
| g,e | bcegb,bcegb | depart,arrive |
|
||||
|
||||
#needs to be adjusted when name-discovery works for entrys
|
||||
Scenario: Mixed Entry and Exit
|
||||
Given the node map
|
||||
| | c | | a | |
|
||||
| j | | b | | f |
|
||||
| | k | | e | |
|
||||
| l | | h | | d |
|
||||
| | g | | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| abc | | yes |
|
||||
| def | | yes |
|
||||
| ghi | | yes |
|
||||
| jkl | | yes |
|
||||
| bkheb | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
|
||||
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
|
||||
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
|
||||
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
|
||||
| d,f | def,def,def | depart,rotary-exit-1,arrive |
|
||||
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
|
||||
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
|
||||
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
|
||||
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
|
||||
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
|
||||
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
|
||||
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
|
||||
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
|
||||
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
|
||||
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
|
||||
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| a | | |
|
||||
| b | | |
|
||||
| c | d | f |
|
||||
| e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| a | | |
|
||||
| d | | |
|
||||
| b | c | f |
|
||||
| e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| a | | |
|
||||
| c | | |
|
||||
| d | b | f |
|
||||
| e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| f | | |
|
||||
| d | c | e |
|
||||
| | b | |
|
||||
| | a | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| f | | |
|
||||
| d | c | e |
|
||||
| b | | |
|
||||
| a | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
|
||||
@@ -0,0 +1,166 @@
|
||||
@routing @guidance
|
||||
Feature: Basic Roundabout
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Enter and Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bgecb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
|
||||
|
||||
Scenario: Only Enter
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| a,e | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| a,g | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| d,e | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| d,g | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| d,b | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| f,g | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| f,b | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| f,c | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| h,b | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
|
||||
Scenario: Only Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
|
||||
| b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
|
||||
| b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
|
||||
| c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
|
||||
| c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
|
||||
| c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
|
||||
| e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
|
||||
| e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
|
||||
| e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
|
||||
| g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
|
||||
| g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
|
||||
| g,f | bcegb,ef,ef | depart,roundabout-exit-3,arrive |
|
||||
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
|
||||
|
||||
Scenario: Drive Around
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,c | bcegb,bcegb | depart,arrive |
|
||||
| b,e | bcegb,bcegb | depart,arrive |
|
||||
| b,g | bcegb,bcegb | depart,arrive |
|
||||
| c,e | bcegb,bcegb | depart,arrive |
|
||||
| c,g | bcegb,bcegb | depart,arrive |
|
||||
| c,b | bcegb,bcegb | depart,arrive |
|
||||
| e,g | bcegb,bcegb | depart,arrive |
|
||||
| e,b | bcegb,bcegb | depart,arrive |
|
||||
| e,c | bcegb,bcegb | depart,arrive |
|
||||
| g,b | bcegb,bcegb | depart,arrive |
|
||||
| g,c | bcegb,bcegb | depart,arrive |
|
||||
| g,e | bcegb,bcegb | depart,arrive |
|
||||
|
||||
Scenario: Mixed Entry and Exit
|
||||
Given the node map
|
||||
| | c | | a | |
|
||||
| j | | b | | f |
|
||||
| | k | | e | |
|
||||
| l | | h | | d |
|
||||
| | g | | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| abc | | yes |
|
||||
| def | | yes |
|
||||
| ghi | | yes |
|
||||
| jkl | | yes |
|
||||
| bkheb | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
|
||||
| a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
|
||||
| a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
|
||||
| a,f | abc,def,def | depart,roundabout-exit-4,arrive |
|
||||
| d,f | def,def,def | depart,roundabout-exit-1,arrive |
|
||||
| d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
|
||||
| d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
|
||||
| d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
|
||||
| g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
|
||||
| g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
|
||||
| g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
|
||||
| g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
|
||||
| j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
|
||||
| j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
|
||||
| j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
|
||||
| j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
|
||||
@@ -2,7 +2,7 @@
|
||||
Feature: Basic Roundabout
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Enter and Exit
|
||||
@@ -19,28 +19,28 @@ Feature: Basic Roundabout
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
| bgecb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,roundabout-exit-1,arrive |
|
||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout-exit-3,arrive |
|
||||
| d,f | cd,ef,ef | depart,roundabout-exit-1,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,roundabout-exit-3,arrive |
|
||||
| f,h | ef,gh,gh | depart,roundabout-exit-1,arrive |
|
||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,roundabout-exit-3,arrive |
|
||||
| h,a | gh,ab,ab | depart,roundabout-exit-1,arrive |
|
||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,roundabout-exit-3,arrive |
|
||||
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
|
||||
|
||||
Scenario: Only Enter
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
@@ -53,29 +53,25 @@ Feature: Basic Roundabout
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,b | ab,ab | depart,arrive |
|
||||
| a,c | ab,bcegb | depart,roundabout-enter,arrive |
|
||||
| a,e | ab,bcegb | depart,roundabout-enter,arrive |
|
||||
| a,g | ab,bcegb | depart,roundabout-enter,arrive |
|
||||
| d,c | cd,cd | depart,arrive |
|
||||
| d,e | cd,bcegb | depart,roundabout-enter,arrive |
|
||||
| d,g | cd,bcegb | depart,roundabout-enter,arrive |
|
||||
| d,b | cd,bcegb | depart,roundabout-enter,arrive |
|
||||
| f,e | ef,ef | depart,arrive |
|
||||
| f,g | ef,bcegb | depart,roundabout-enter,arrive |
|
||||
| f,b | ef,bcegb | depart,roundabout-enter,arrive |
|
||||
| f,c | ef,bcegb | depart,roundabout-enter,arrive |
|
||||
| h,g | gh,gh | depart,arrive |
|
||||
| h,b | gh,bcegb | depart,roundabout-enter,arrive |
|
||||
| h,c | gh,bcegb | depart,roundabout-enter,arrive |
|
||||
| h,e | gh,bcegb | depart,roundabout-enter,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| a,e | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| a,g | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| d,e | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| d,g | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| d,b | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| f,g | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| f,b | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| f,c | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| h,b | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||
|
||||
Scenario: Only Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
@@ -89,28 +85,25 @@ Feature: Basic Roundabout
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,a | ab,ab | depart,arrive |
|
||||
| b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
|
||||
| b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
|
||||
| b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
|
||||
| c,d | cd,cd | depart,arrive |
|
||||
| c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
|
||||
| c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
|
||||
| c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
|
||||
| e,f | ef,ef | depart,arrive |
|
||||
| e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
|
||||
| e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
|
||||
| e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
|
||||
| g,h | gh,gh | depart,arrive |
|
||||
| g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
|
||||
| g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
|
||||
| g,f | bcegb,ef,ef | depart,roundabout-exit-3,arrive |
|
||||
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
|
||||
|
||||
Scenario: Drive Around
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| d | c | | g | h |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
@@ -139,11 +132,11 @@ Feature: Basic Roundabout
|
||||
|
||||
Scenario: Mixed Entry and Exit
|
||||
Given the node map
|
||||
| | a | | c | |
|
||||
| l | | b | | d |
|
||||
| | c | | a | |
|
||||
| j | | b | | f |
|
||||
| | k | | e | |
|
||||
| j | | h | | f |
|
||||
| | i | | g | |
|
||||
| l | | h | | d |
|
||||
| | g | | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
@@ -151,23 +144,118 @@ Feature: Basic Roundabout
|
||||
| def | | yes |
|
||||
| ghi | | yes |
|
||||
| jkl | | yes |
|
||||
| behkb | roundabout | yes |
|
||||
| bkheb | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
|
||||
| a,f | abc,def,def | depart,roundabout-exit-2,arrive |
|
||||
| a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
|
||||
| a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
|
||||
| a,l | abc,jkl,jkl | depart,roundabout-exit-4,arrive |
|
||||
| a,f | abc,def,def | depart,roundabout-exit-4,arrive |
|
||||
| d,f | def,def,def | depart,roundabout-exit-1,arrive |
|
||||
| d,i | def,ghi,ghi | depart,roundabout-exit-2,arrive |
|
||||
| d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
|
||||
| d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
|
||||
| d,c | def,abc,abc | depart,roundabout-exit-4,arrive |
|
||||
| d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
|
||||
| g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
|
||||
| g,l | ghi,jkl,jkl | depart,roundabout-exit-2,arrive |
|
||||
| g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
|
||||
| g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
|
||||
| g,f | ghi,edf,edf | depart,roundabout-exit-4,arrive |
|
||||
| g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
|
||||
| j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
|
||||
| j,c | jkl,abc,abc | depart,roundabout-exit-2,arrive |
|
||||
| j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
|
||||
| j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
|
||||
| j,i | jkl,ghi,ghi | depart,roundabout-exit-4,arrive |
|
||||
| j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
|
||||
|
||||
Scenario: Collinear in X
|
||||
Given the node map
|
||||
| a | b | c | d | f |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in Y
|
||||
Given the node map
|
||||
| a | |
|
||||
| b | |
|
||||
| c | e |
|
||||
| d | |
|
||||
| f | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| a | | |
|
||||
| b | | |
|
||||
| c | d | f |
|
||||
| e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| a | | |
|
||||
| d | | |
|
||||
| b | c | f |
|
||||
| e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Given the node map
|
||||
| a | | |
|
||||
| c | | |
|
||||
| d | b | f |
|
||||
| e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
@routing @guidance
|
||||
Feature: Suppressed Turns
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Do not announce passing a exit ramp
|
||||
Given the node map
|
||||
| a | b | c | d | e |
|
||||
| | | | f | g |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abcde | motorway |
|
||||
| bfg | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
|
||||
Scenario: Do not announce reference changes
|
||||
Given the node map
|
||||
| a | b | c | d | e | f |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | ref |
|
||||
| ab | motorway | highway | A1 |
|
||||
| bc | motorway | highway | A1,A2 |
|
||||
| cd | motorway | highway | A2 |
|
||||
| de | motorway | highway | |
|
||||
| ef | motorway | highway | A1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,f | highway (A1),highway (A1) | depart,arrive |
|
||||
|
||||
|
||||
Scenario: Don't Announce Turn on following major road class -- service
|
||||
Given the node map
|
||||
| a | b | d |
|
||||
| | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | service |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
|
||||
Scenario: Don't Announce Turn on following major road class -- residential
|
||||
Given the node map
|
||||
| a | b | d |
|
||||
| | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | residential |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| a,d | abc,bd,bd | depart,turn straight,arrive |
|
||||
@@ -0,0 +1,813 @@
|
||||
@routing @guidance
|
||||
Feature: Simple Turns
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Four Way Intersection
|
||||
Given the node map
|
||||
| | c | |
|
||||
| a | b | e |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cb | primary |
|
||||
| db | primary |
|
||||
| eb | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
||||
| a,e | ab,eb,eb | depart,new name straight,arrive |
|
||||
| a,d | ab,db,db | depart,turn right,arrive |
|
||||
| c,a | cb,ab,ab | depart,turn right,arrive |
|
||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
||||
| c,e | cb,eb,eb | depart,turn left,arrive |
|
||||
| d,a | db,ab,ab | depart,turn left,arrive |
|
||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
||||
| d,e | db,eb,eb | depart,turn right,arrive |
|
||||
| e,a | eb,ab,ab | depart,new name straight,arrive |
|
||||
| e,c | eb,cb,cb | depart,turn right,arrive |
|
||||
| e,d | eb,db,db | depart,turn left,arrive |
|
||||
|
||||
Scenario: Rotated Four Way Intersection
|
||||
Given the node map
|
||||
| a | | c |
|
||||
| | b | |
|
||||
| d | | e |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cb | primary |
|
||||
| db | primary |
|
||||
| eb | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
||||
| a,e | ab,eb,eb | depart,new name straight,arrive |
|
||||
| a,d | ab,db,db | depart,turn right,arrive |
|
||||
| c,a | cb,ab,ab | depart,turn right,arrive |
|
||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
||||
| c,e | cb,eb,eb | depart,turn left,arrive |
|
||||
| d,a | db,ab,ab | depart,turn left,arrive |
|
||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
||||
| d,e | db,eb,eb | depart,turn right,arrive |
|
||||
| e,a | eb,ab,ab | depart,new name straight,arrive |
|
||||
| e,c | eb,cb,cb | depart,turn right,arrive |
|
||||
| e,d | eb,db,db | depart,turn left,arrive |
|
||||
|
||||
|
||||
Scenario: Four Way Intersection Through Street
|
||||
Given the node map
|
||||
| | c | |
|
||||
| a | b | e |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abe | primary |
|
||||
| cb | primary |
|
||||
| db | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abe,cb,cb | depart,turn left,arrive |
|
||||
| a,e | abe,abe | depart,arrive |
|
||||
| a,d | abe,db,db | depart,turn right,arrive |
|
||||
| c,a | cb,abe,abe | depart,turn right,arrive |
|
||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
||||
| c,e | cb,abe,abe | depart,turn left,arrive |
|
||||
| d,a | db,abe,abe | depart,turn left,arrive |
|
||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
||||
| d,e | db,abe,abe | depart,turn right,arrive |
|
||||
| e,a | abe,abe | depart,arrive |
|
||||
| e,c | abe,cb,cb | depart,turn right,arrive |
|
||||
| e,d | abe,db,db | depart,turn left,arrive |
|
||||
|
||||
Scenario: Four Way Intersection Double Through Street
|
||||
Given the node map
|
||||
| | c | |
|
||||
| a | b | e |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abe | primary |
|
||||
| cbd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abe,cbd,cbd | depart,turn left,arrive |
|
||||
| a,e | abe,abe | depart,arrive |
|
||||
| a,d | abe,cbd,cbd | depart,turn right,arrive |
|
||||
| c,a | cbd,abe,abe | depart,turn right,arrive |
|
||||
| c,d | cbd,cbd | depart,arrive |
|
||||
| c,e | cbd,abe,abe | depart,turn left,arrive |
|
||||
| d,a | cbd,abe,abe | depart,turn left,arrive |
|
||||
| d,c | cbd,cbd | depart,arrive |
|
||||
| d,e | cbd,abe,abe | depart,turn right,arrive |
|
||||
| e,a | abe,abe | depart,arrive |
|
||||
| e,c | abe,cbd,cbd | depart,turn right,arrive |
|
||||
| e,d | abe,cbd,cbd | depart,turn left,arrive |
|
||||
|
||||
Scenario: Three Way Intersection
|
||||
Given the node map
|
||||
| | c | |
|
||||
| a | b | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| cb | primary |
|
||||
| db | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
||||
| a,d | ab,db,db | depart,new name straight,arrive |
|
||||
| d,c | db,cb,cb | depart,turn right,arrive |
|
||||
| d,a | db,ab,ab | depart,new name straight,arrive |
|
||||
|
||||
Scenario: Three Way Intersection on Through Street
|
||||
Given the node map
|
||||
| | d | |
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| db | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| a,d | abc,db,db | depart,turn left,arrive |
|
||||
| c,a | abc,abc | depart,arrive |
|
||||
| c,d | abc,db,db | depart,turn right,arrive |
|
||||
|
||||
Scenario: High Degree Intersection
|
||||
Given the node map
|
||||
| i | | b | | c |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| h | | a | | d |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| g | | f | | e |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ac | primary |
|
||||
| ad | primary |
|
||||
| ae | primary |
|
||||
| af | primary |
|
||||
| ag | primary |
|
||||
| ah | primary |
|
||||
| ai | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
|
||||
| b,d | ab,ad,ad | depart,turn left,arrive |
|
||||
| b,e | ab,ae,ae | depart,turn slight left,arrive |
|
||||
| b,f | ab,af,af | depart,new name straight,arrive |
|
||||
| b,g | ab,ag,ag | depart,turn slight right,arrive |
|
||||
| b,h | ab,ah,ah | depart,turn right,arrive |
|
||||
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
|
||||
|
||||
Scenario: Disturbed High Degree Intersection
|
||||
Given the node map
|
||||
| | | b | | |
|
||||
| i | | | | c |
|
||||
| | | | | |
|
||||
| h | | a | | d |
|
||||
| | | | | |
|
||||
| g | | | | e |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ac | primary |
|
||||
| ad | primary |
|
||||
| ae | primary |
|
||||
| af | primary |
|
||||
| ag | primary |
|
||||
| ah | primary |
|
||||
| ai | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
|
||||
| b,d | ab,ad,ad | depart,turn left,arrive |
|
||||
| b,e | ab,ae,ae | depart,turn slight left,arrive |
|
||||
| b,f | ab,af,af | depart,new name straight,arrive |
|
||||
| b,g | ab,ag,ag | depart,turn slight right,arrive |
|
||||
| b,h | ab,ah,ah | depart,turn right,arrive |
|
||||
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
|
||||
|
||||
Scenario: Turn instructions at high latitude
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 55.68740 | 12.52430 |
|
||||
| b | 55.68745 | 12.52409 |
|
||||
| c | 55.68711 | 12.52383 |
|
||||
| d | 55.68745 | 12.52450 |
|
||||
| e | 55.68755 | 12.52450 |
|
||||
| x | -55.68740 | 12.52430 |
|
||||
| y | -55.68745 | 12.52409 |
|
||||
| z | -55.68711 | 12.52383 |
|
||||
| v | -55.68745 | 12.52450 |
|
||||
| w | -55.68755 | 12.52450 |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| bd |
|
||||
| be |
|
||||
| xy |
|
||||
| yz |
|
||||
| vy |
|
||||
| wy |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | c | ab,bc,bc | depart,turn left,arrive |
|
||||
| c | a | bc,ab,ab | depart,turn right,arrive |
|
||||
| x | z | xy,yz,yz | depart,turn right,arrive |
|
||||
| z | x | yz,xy,xy | depart,turn left,arrive |
|
||||
|
||||
Scenario: Four Way Intersection Double Through Street Segregated
|
||||
Given the node map
|
||||
| | b | | c | |
|
||||
| i | | | | d |
|
||||
| | | a | | |
|
||||
| h | | | | e |
|
||||
| | g | | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | name |
|
||||
| ha | primary | yes | first |
|
||||
| ai | primary | yes | first |
|
||||
| ae | primary | yes | first |
|
||||
| da | primary | yes | first |
|
||||
| ba | primary | yes | second |
|
||||
| ac | primary | yes | second |
|
||||
| fa | primary | yes | second |
|
||||
| ag | primary | yes | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| f,e | second,first,first | depart,turn right,arrive |
|
||||
| f,c | second,second | depart,arrive |
|
||||
| f,i | second,first,first | depart,turn left,arrive |
|
||||
| f,g | second,second,second | depart,continue uturn,arrive |
|
||||
| d,c | first,second,second | depart,turn right,arrive |
|
||||
| d,i | first,first | depart,arrive |
|
||||
| d,g | first,second,second | depart,turn left,arrive |
|
||||
| d,e | first,first,first | depart,continue uturn,arrive |
|
||||
| b,i | second,first,first | depart,turn right,arrive |
|
||||
| b,g | second,second | depart,arrive |
|
||||
| b,e | second,first,first | depart,turn left,arrive |
|
||||
| b,c | second,second,second | depart,continue uturn,arrive |
|
||||
| h,g | first,second,second | depart,turn right,arrive |
|
||||
| h,e | first,first | depart,arrive |
|
||||
| h,c | first,second,second | depart,turn left,arrive |
|
||||
| h,i | first,first,first | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Three Way Similar Sharp Turns
|
||||
Given the node map
|
||||
| a | | | | b |
|
||||
| c | | | | |
|
||||
| | d | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| bd | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,turn sharp right,arrive |
|
||||
| a,d | ab,bd,bd | depart,turn sharp right,arrive |
|
||||
| d,c | bd,bc,bc | depart,turn sharp left,arrive |
|
||||
| d,a | bd,ab,ab | depart,turn sharp left,arrive |
|
||||
|
||||
Scenario: Left Turn Assignment (1)
|
||||
Given the node map
|
||||
| | | | | d |
|
||||
| a | | b | | c |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn slight left,arrive |
|
||||
|
||||
Scenario: Left Turn Assignment (2)
|
||||
Given the node map
|
||||
| | | | | d |
|
||||
| | | | | |
|
||||
| a | | b | | c |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
||||
|
||||
Scenario: Left Turn Assignment (3)
|
||||
Given the node map
|
||||
| | | | d | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| a | | b | | c |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
||||
|
||||
Scenario: Left Turn Assignment (4)
|
||||
Given the node map
|
||||
| | | d | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| a | | b | | c |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
||||
|
||||
Scenario: Left Turn Assignment (5)
|
||||
Given the node map
|
||||
| | d | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| a | | b | | c |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn left,arrive |
|
||||
|
||||
@bug @pr2275
|
||||
Scenario: Left Turn Assignment (6)
|
||||
Given the node map
|
||||
| d | | | | |
|
||||
| | | | | |
|
||||
| a | | b | | c |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn sharp left,arrive |
|
||||
|
||||
Scenario: Left Turn Assignment (7)
|
||||
Given the node map
|
||||
| d | | | | |
|
||||
| a | | b | | c |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn sharp left,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment (1)
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | | b | | c |
|
||||
| | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment (2)
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment (3)
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment (4)
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | d | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment (5)
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | d | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
|
||||
@bug @pr2275
|
||||
Scenario: Right Turn Assignment (6)
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| d | | | | |
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment (7)
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | | b | | c |
|
||||
| d | | | | |
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Two Turns
|
||||
Given the node map
|
||||
| | | f | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| d | e | | | |
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
| bf | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
||||
| a,e | abc,be,be | depart,turn right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Two Turns (2)
|
||||
Given the node map
|
||||
| | | f | c | |
|
||||
| a | | b | | |
|
||||
| | | | | e |
|
||||
| | | | d | |
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
| bf | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
| a,e | abc,be,be | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Two Turns (3)
|
||||
Given the node map
|
||||
| | | f | | |
|
||||
| a | | b | | c |
|
||||
| | | | | e |
|
||||
| | | | d | |
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
| bf | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
| a,e | abc,be,be | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Two Turns (4)
|
||||
Given the node map
|
||||
| | | f | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | | d | | e |
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
| bf | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn right,arrive |
|
||||
| a,e | abc,be,be | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Three Turns
|
||||
Given the node map
|
||||
| | | g | | |
|
||||
| a | | b | | c |
|
||||
| | d | | f | |
|
||||
| | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
| bf | primary |
|
||||
| bg | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
||||
| a,e | abc,be,be | depart,turn right,arrive |
|
||||
| a,f | abc,bf,bf | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Slight Turn involving Oneways
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | | | |
|
||||
| | | b | | e |
|
||||
| d | | | | |
|
||||
| | | c | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abc | primary | yes |
|
||||
| dbe | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| d,e | dbe,dbe | depart,arrive |
|
||||
| e,d | dbe,dbe | depart,arrive |
|
||||
|
||||
@bug @pr2275
|
||||
Scenario: Slight Turn involving Oneways
|
||||
Given the node map
|
||||
| | | | a | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | b | | e |
|
||||
| d | | | | |
|
||||
| | | c | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abc | primary | yes |
|
||||
| dbe | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| d,e | dbe,dbe | depart,arrive |
|
||||
| e,d | dbe,dbe | depart,arrive |
|
||||
|
||||
|
||||
Scenario: Slight Turn involving Oneways - Name Change
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | | | |
|
||||
| | | b | | e |
|
||||
| d | | | | |
|
||||
| | | c | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abc | primary | yes |
|
||||
| db | primary | no |
|
||||
| be | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| d,e | db,be,be | depart,new name slight right,arrive |
|
||||
| e,d | be,db,db | depart,new name slight left,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 1
|
||||
Given the node map
|
||||
| | | g | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | d | e | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abc | primary | no |
|
||||
| db | primary | yes |
|
||||
| eb | primary | no |
|
||||
| fb | primary | no |
|
||||
| bg | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abc,eb,eb | depart,turn right,arrive |
|
||||
| a,f | abc,fb,fb | depart,turn slight right,arrive |
|
||||
|
||||
@bug @pr2275
|
||||
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 2
|
||||
Given the node map
|
||||
| | | g | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | d | e | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abc | primary | no |
|
||||
| db | primary | no |
|
||||
| eb | primary | yes |
|
||||
| fb | primary | no |
|
||||
| bg | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,db,db | depart,turn sharp right,arrive |
|
||||
| a,f | abc,fb,fb | depart,turn right,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 3
|
||||
Given the node map
|
||||
| | | g | | |
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | d | e | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abc | primary | no |
|
||||
| db | primary | no |
|
||||
| be | primary | no |
|
||||
| fb | primary | yes |
|
||||
| bg | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,db,db | depart,turn sharp right,arrive |
|
||||
| a,e | abc,be,be | depart,turn right,arrive |
|
||||
|
||||
Scenario: Conflicting Turns with well distinguished turn
|
||||
Given the node map
|
||||
| a | | | b | | | c |
|
||||
| | | | | | | |
|
||||
| f | | | | | | d |
|
||||
| | | | | | | e |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
| bf | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
||||
| a,e | abc,be,be | depart,turn right,arrive |
|
||||
| a,f | abc,bf,bf | depart,turn sharp right,arrive |
|
||||
|
||||
@bug @pr2275
|
||||
Scenario: Conflicting Turns with well distinguished turn (back)
|
||||
Given the node map
|
||||
| a | | | b | | | c |
|
||||
| | | | | | | |
|
||||
| d | | | | | | f |
|
||||
| | e | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| bd | primary |
|
||||
| be | primary |
|
||||
| bf | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
|
||||
| a,e | abc,be,be | depart,turn right,arrive |
|
||||
| a,f | abc,bf,bf | depart,turn slight right,arrive |
|
||||
|
||||
@@ -44,12 +44,9 @@ module.exports = function () {
|
||||
|
||||
this.Then(/^response should be a well-formed route$/, () => {
|
||||
this.ShouldBeWellFormed();
|
||||
assert.equal(typeof this.json.status_message, 'string');
|
||||
assert.equal(typeof this.json.route_summary, 'object');
|
||||
assert.equal(typeof this.json.route_geometry, 'string');
|
||||
assert.ok(Array.isArray(this.json.route_instructions));
|
||||
assert.ok(Array.isArray(this.json.via_points));
|
||||
assert.ok(Array.isArray(this.json.via_indices));
|
||||
assert.equal(this.json.code, 'ok');
|
||||
assert.ok(Array.isArray(this.json.routes));
|
||||
assert.ok(Array.isArray(this.json.waypoints));
|
||||
});
|
||||
|
||||
this.Then(/^"([^"]*)" should return code (\d+)$/, (binary, code) => {
|
||||
|
||||
@@ -110,6 +110,7 @@ module.exports = function () {
|
||||
} else {
|
||||
var params = this.queryParams,
|
||||
waypoints = [];
|
||||
params['steps'] = 'true';
|
||||
if (row.from && row.to) {
|
||||
var fromNode = this.findNodeByName(row.from);
|
||||
if (!fromNode) throw new Error(util.format('*** unknown from-node "%s"', row.from));
|
||||
|
||||
@@ -7,7 +7,8 @@ var d3 = require('d3-queue');
|
||||
module.exports = function () {
|
||||
this.initializeEnv = (callback) => {
|
||||
this.DEFAULT_PORT = 5000;
|
||||
this.DEFAULT_TIMEOUT = 2000;
|
||||
// OSX builds on Travis hit a timeout of ~2000 from time to time
|
||||
this.DEFAULT_TIMEOUT = 5000;
|
||||
this.setDefaultTimeout(this.DEFAULT_TIMEOUT);
|
||||
this.ROOT_FOLDER = process.cwd();
|
||||
this.OSM_USER = 'osrm';
|
||||
|
||||
@@ -144,9 +144,14 @@ module.exports = function () {
|
||||
return v.maneuver.type;
|
||||
case 'roundabout':
|
||||
return 'roundabout-exit-' + v.maneuver.exit;
|
||||
case 'rotary':
|
||||
if( 'rotary_name' in v )
|
||||
return v.rotary_name + '-exit-' + v.maneuver.exit;
|
||||
else
|
||||
return 'rotary-exit-' + v.maneuver.exit;
|
||||
// FIXME this is a little bit over-simplistic for merge/fork instructions
|
||||
default:
|
||||
return v.maneuver.modifier;
|
||||
return v.maneuver.type + ' ' + v.maneuver.modifier;
|
||||
}
|
||||
})
|
||||
.join(',');
|
||||
|
||||
@@ -35,7 +35,7 @@ module.exports = function () {
|
||||
|
||||
var json = JSON.parse(body);
|
||||
|
||||
var hasRoute = json.code === 'ok';
|
||||
var hasRoute = json.code === 'Ok';
|
||||
|
||||
if (hasRoute) {
|
||||
instructions = this.wayList(json.routes[0]);
|
||||
@@ -59,14 +59,6 @@ module.exports = function () {
|
||||
got['#'] = row['#'];
|
||||
}
|
||||
|
||||
if (headers.has('start')) {
|
||||
got.start = instructions ? json.route_summary.start_point : null;
|
||||
}
|
||||
|
||||
if (headers.has('end')) {
|
||||
got.end = instructions ? json.route_summary.end_point : null;
|
||||
}
|
||||
|
||||
if (headers.has('geometry')) {
|
||||
got.geometry = json.routes[0].geometry;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@routing @uturn @via @testbot
|
||||
@routing @continue_straight @via @testbot
|
||||
Feature: U-turns at via points
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
Scenario: U-turns at via points disabled by default
|
||||
Scenario: Continue straight at waypoints enabled by default
|
||||
Given the node map
|
||||
| a | b | c | d |
|
||||
| | e | f | g |
|
||||
@@ -20,16 +20,16 @@ Feature: U-turns at via points
|
||||
| fg |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e,c | ab,be,be,ef,fg,dg,cd,cd | depart,right,arrive,depart,straight,left,left,arrive |
|
||||
| waypoints | route |
|
||||
| a,e,c | ab,be,be,ef,fg,dg,cd,cd |
|
||||
|
||||
Scenario: Query param to allow U-turns at all via points
|
||||
Scenario: Query parameter to disallow changing direction at all waypoints
|
||||
Given the node map
|
||||
| a | b | c | d |
|
||||
| | e | f | g |
|
||||
|
||||
And the query options
|
||||
| uturns | true |
|
||||
| continue_straight | false |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
@@ -45,14 +45,13 @@ Feature: U-turns at via points
|
||||
| waypoints | route |
|
||||
| a,e,c | ab,be,be,be,bc,bc |
|
||||
|
||||
@todo
|
||||
Scenario: Instructions at via points at u-turns
|
||||
Scenario: Instructions at waypoints at u-turns
|
||||
Given the node map
|
||||
| a | b | c | d |
|
||||
| | e | f | g |
|
||||
|
||||
And the query options
|
||||
| uturns | true |
|
||||
| continue_straight | false |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
@@ -65,8 +64,8 @@ Feature: U-turns at via points
|
||||
| fg |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e,c | ab,be,be,bc,bc | depart,right,uturn,right,arrive |
|
||||
| waypoints | route |
|
||||
| a,e,c | ab,be,be,be,bc,bc |
|
||||
|
||||
Scenario: u-turn mixed with non-uturn vias
|
||||
Given the node map
|
||||
@@ -75,19 +74,19 @@ Feature: U-turns at via points
|
||||
| | | e | | f | | g |
|
||||
|
||||
And the query options
|
||||
| uturns | true |
|
||||
| continue_straight | false |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| cd |
|
||||
| be |
|
||||
| dg |
|
||||
| ef |
|
||||
| fg |
|
||||
| nodes | oneway |
|
||||
| ab | no |
|
||||
| bc | no |
|
||||
| cd | no |
|
||||
| be | yes |
|
||||
| dg | no |
|
||||
| ef | no |
|
||||
| fg | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| 1,2,3,4,5 | ab,be,be,be,bc,bc,bc,be,ef,fg,dg,dg,dg,cd,cd |
|
||||
| waypoints | route |
|
||||
| 1,2,3,4,5 | ab,be,be,be,ef,fg,dg,cd,bc,bc,bc,cd,dg,dg,dg,cd,cd |
|
||||
|
||||
@@ -36,5 +36,5 @@ Feature: Basic Routing
|
||||
| fy | last |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| x | y | first,compr,last,last | depart,right,left,arrive |
|
||||
| from | to | route |
|
||||
| x | y | first,compr,last,last |
|
||||
|
||||
@@ -85,3 +85,22 @@ Feature: Basic Map Matching
|
||||
| trace | matchings |
|
||||
| dcba | hgfe |
|
||||
|
||||
Scenario: Testbot - Matching with oneway streets
|
||||
Given a grid size of 10 meters
|
||||
Given the node map
|
||||
| a | b | c | d |
|
||||
| e | f | g | h |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| bc | yes |
|
||||
| cd | yes |
|
||||
| hg | yes |
|
||||
| gf | yes |
|
||||
| fe | yes |
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings |
|
||||
| dcba | hg,gf,fe |
|
||||
| efgh | ab,bc,cd |
|
||||
|
||||
@@ -12,7 +12,6 @@ Feature: Testbot - Travel mode
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
@mokob @2166
|
||||
Scenario: Testbot - Always announce mode change
|
||||
Given the node map
|
||||
| a | b | c | d |
|
||||
@@ -28,7 +27,6 @@ Feature: Testbot - Travel mode
|
||||
| a | d | foo,foo,foo,foo | driving,river downstream,driving,driving |
|
||||
| b | d | foo,foo,foo | river downstream,driving,driving |
|
||||
|
||||
@mokob @2166
|
||||
Scenario: Testbot - Compressed Modes
|
||||
Given the node map
|
||||
| a | b | c | d | e | f | g |
|
||||
@@ -44,7 +42,6 @@ Feature: Testbot - Travel mode
|
||||
| a | g | road,liquid,solid,solid | driving,river downstream,driving,driving |
|
||||
| c | g | liquid,solid,solid | river downstream,driving,driving |
|
||||
|
||||
@mokob @2166
|
||||
Scenario: Testbot - Modes in each direction, different forward/backward speeds
|
||||
Given the node map
|
||||
| | 0 | 1 | |
|
||||
@@ -79,7 +76,7 @@ Feature: Testbot - Travel mode
|
||||
| 0 | 1 | ab,ab | steps down,steps down | 60s +-1 |
|
||||
| 1 | 0 | ab,ab | steps up,steps up | 60s +-1 |
|
||||
|
||||
@oneway @mokob @2166
|
||||
@oneway
|
||||
Scenario: Testbot - Modes for oneway, different forward/backward speeds
|
||||
Given the node map
|
||||
| a | b |
|
||||
@@ -107,7 +104,7 @@ Feature: Testbot - Travel mode
|
||||
| a | b | ab,ab | steps down,steps down |
|
||||
| b | a | | |
|
||||
|
||||
@oneway @mokob @2166
|
||||
@oneway
|
||||
Scenario: Testbot - Modes for reverse oneway, different forward/backward speeds
|
||||
Given the node map
|
||||
| a | b |
|
||||
@@ -135,7 +132,7 @@ Feature: Testbot - Travel mode
|
||||
| a | b | | |
|
||||
| b | a | ab,ab | steps up,steps up |
|
||||
|
||||
@via @mokob @2166
|
||||
@via
|
||||
Scenario: Testbot - Mode should be set at via points
|
||||
Given the node map
|
||||
| a | 1 | b |
|
||||
@@ -149,7 +146,6 @@ Feature: Testbot - Travel mode
|
||||
| a,1,b | ab,ab,ab,ab | river downstream,river downstream,river downstream,river downstream |
|
||||
| b,1,a | ab,ab,ab,ab | river upstream,river upstream,river upstream,river upstream |
|
||||
|
||||
@mokob @2166
|
||||
Scenario: Testbot - Starting at a tricky node
|
||||
Given the node map
|
||||
| | a | | | |
|
||||
@@ -164,7 +160,6 @@ Feature: Testbot - Travel mode
|
||||
| from | to | route | modes |
|
||||
| b | a | ab,ab | river upstream,river upstream |
|
||||
|
||||
@mokob @2166
|
||||
Scenario: Testbot - Mode changes on straight way without name change
|
||||
Given the node map
|
||||
| a | 1 | b | 2 | c |
|
||||
@@ -204,7 +199,6 @@ Feature: Testbot - Travel mode
|
||||
| b | d | bc,cd,cd | route,driving,driving |
|
||||
| a | f | ab,bc,cd,de,ef,ef | driving,route,driving,driving,driving,driving |
|
||||
|
||||
@mokob @2166
|
||||
Scenario: Testbot - Modes, triangle map
|
||||
Given the node map
|
||||
| | | | | | | d |
|
||||
@@ -239,7 +233,6 @@ Feature: Testbot - Travel mode
|
||||
| a | d | abc,cd,cd | driving,driving,driving |
|
||||
| d | a | de,ce,abc,abc | driving,river upstream,driving,driving |
|
||||
|
||||
@mokob @2166
|
||||
Scenario: Testbot - River in the middle
|
||||
Given the node map
|
||||
| a | b | c | | |
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
@routing @testbot @overlap
|
||||
@routing @testbot @overlap @todo
|
||||
Feature: Testbot - overlapping ways
|
||||
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
@bug @610
|
||||
Scenario: Testbot - multiple way between same nodes
|
||||
Note that cb is connecting the same two nodes as bc
|
||||
Given the node map
|
||||
@@ -18,11 +17,10 @@ Feature: Testbot - overlapping ways
|
||||
| cb | secondary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | ab,bc,cd |
|
||||
| d | a | cd,bc,ab |
|
||||
|
||||
@bug @610
|
||||
| from | to | route |
|
||||
| a | d | ab,bc,cd,cd |
|
||||
| d | a | cd,bc,ab,ab |
|
||||
|
||||
Scenario: Testbot - area on top of way
|
||||
Given the node map
|
||||
| x | a | b | y |
|
||||
@@ -34,6 +32,6 @@ Feature: Testbot - overlapping ways
|
||||
| abcda | secondary | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| x | y | xaby |
|
||||
| y | x | xaby |
|
||||
| from | to | route |
|
||||
| x | y | xaby,xaby |
|
||||
| y | x | xaby,xaby |
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
@routing @testbot @roundabout @instruction
|
||||
Feature: Roundabout Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
Scenario: Testbot - Roundabout
|
||||
Given the node map
|
||||
| | | v | | |
|
||||
| | | d | | |
|
||||
| s | a | | c | u |
|
||||
| | | b | | |
|
||||
| | | t | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| sa | |
|
||||
| tb | |
|
||||
| uc | |
|
||||
| vd | |
|
||||
| abcda | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| s | t | sa,tb,tb | depart,roundabout-exit-1,arrive |
|
||||
| s | u | sa,uc,uc | depart,roundabout-exit-2,arrive |
|
||||
| s | v | sa,vd,vd | depart,roundabout-exit-3,arrive |
|
||||
| t | u | tb,uc,uc | depart,roundabout-exit-1,arrive |
|
||||
| t | v | tb,vd,vd | depart,roundabout-exit-2,arrive |
|
||||
| t | s | tb,sa,sa | depart,roundabout-exit-3,arrive |
|
||||
| u | v | uc,vd,vd | depart,roundabout-exit-1,arrive |
|
||||
| u | s | uc,sa,sa | depart,roundabout-exit-2,arrive |
|
||||
| u | t | uc,tb,tb | depart,roundabout-exit-3,arrive |
|
||||
| v | s | vd,sa,sa | depart,roundabout-exit-1,arrive |
|
||||
| v | t | vd,tb,tb | depart,roundabout-exit-2,arrive |
|
||||
| v | u | vd,uc,uc | depart,roundabout-exit-3,arrive |
|
||||
|
||||
Scenario: Testbot - Roundabout with oneway links
|
||||
Given the node map
|
||||
| | | p | o | | |
|
||||
| | | h | g | | |
|
||||
| i | a | | | f | n |
|
||||
| j | b | | | e | m |
|
||||
| | | c | d | | |
|
||||
| | | k | l | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| ai | | yes |
|
||||
| jb | | yes |
|
||||
| ck | | yes |
|
||||
| ld | | yes |
|
||||
| em | | yes |
|
||||
| nf | | yes |
|
||||
| go | | yes |
|
||||
| ph | | yes |
|
||||
| abcdefgha | roundabout | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| j | k | jb,ck,ck | depart,roundabout-exit-1,arrive |
|
||||
| j | m | jb,em,em | depart,roundabout-exit-2,arrive |
|
||||
| j | o | jb,go,go | depart,roundabout-exit-3,arrive |
|
||||
| j | i | jb,ai,ai | depart,roundabout-exit-4,arrive |
|
||||
| l | m | ld,em,em | depart,roundabout-exit-1,arrive |
|
||||
| l | o | ld,go,go | depart,roundabout-exit-2,arrive |
|
||||
| l | i | ld,ai,ai | depart,roundabout-exit-3,arrive |
|
||||
| l | k | ld,ck,ck | depart,roundabout-exit-4,arrive |
|
||||
| n | o | nf,go,go | depart,roundabout-exit-1,arrive |
|
||||
| n | i | nf,ai,ai | depart,roundabout-exit-2,arrive |
|
||||
| n | k | nf,ck,ck | depart,roundabout-exit-3,arrive |
|
||||
| n | m | nf,em,em | depart,roundabout-exit-4,arrive |
|
||||
| p | i | ph,ai,ai | depart,roundabout-exit-1,arrive |
|
||||
| p | k | ph,ck,ck | depart,roundabout-exit-2,arrive |
|
||||
| p | m | ph,em,em | depart,roundabout-exit-3,arrive |
|
||||
| p | o | ph,go,go | depart,roundabout-exit-4,arrive |
|
||||
@@ -46,22 +46,22 @@ Feature: Status messages
|
||||
| ab |
|
||||
|
||||
When I route I should get
|
||||
| request | status | message |
|
||||
| route/v1/driving/1,1;1,2 | 200 | |
|
||||
| nonsense | 400 | URL string malformed close to position 0: "/no" |
|
||||
| nonsense/v1/driving/1,1;1,2 | 400 | Service nonsense not found! |
|
||||
| | 400 | URL string malformed close to position 0: "/" |
|
||||
| / | 400 | URL string malformed close to position 0: "//" |
|
||||
| ? | 400 | URL string malformed close to position 0: "/?" |
|
||||
| route/v1/driving | 400 | URL string malformed close to position 0: "/ro" |
|
||||
| route/v1/driving/ | 400 | URL string malformed close to position 0: "/ro" |
|
||||
| route/v1/driving/1 | 400 | Query string malformed close to position 0 |
|
||||
| route/v1/driving/1,1 | 400 | Number of coordinates needs to be at least two. |
|
||||
| route/v1/driving/1,1,1 | 400 | Query string malformed close to position 3 |
|
||||
| route/v1/driving/x | 400 | Query string malformed close to position 0 |
|
||||
| route/v1/driving/x,y | 400 | Query string malformed close to position 0 |
|
||||
| route/v1/driving/1,1; | 400 | Query string malformed close to position 3 |
|
||||
| route/v1/driving/1,1;1 | 400 | Query string malformed close to position 3 |
|
||||
| route/v1/driving/1,1;1,1,1 | 400 | Query string malformed close to position 7 |
|
||||
| route/v1/driving/1,1;x | 400 | Query string malformed close to position 3 |
|
||||
| route/v1/driving/1,1;x,y | 400 | Query string malformed close to position 3 |
|
||||
| request | status | message |
|
||||
| route/v1/driving/1,1;1,2 | 200 | |
|
||||
| nonsense | 400 | URL string malformed close to position 9: "nse" |
|
||||
| nonsense/v1/driving/1,1;1,2 | 400 | Service nonsense not found! |
|
||||
| | 400 | URL string malformed close to position 1: "/" |
|
||||
| / | 400 | URL string malformed close to position 1: "//" |
|
||||
| ? | 400 | URL string malformed close to position 1: "/?" |
|
||||
| route/v1/driving | 400 | URL string malformed close to position 17: "ing" |
|
||||
| route/v1/driving/ | 400 | URL string malformed close to position 18: "ng/" |
|
||||
| route/v1/driving/1 | 400 | Query string malformed close to position 1 |
|
||||
| route/v1/driving/1,1 | 400 | Number of coordinates needs to be at least two. |
|
||||
| route/v1/driving/1,1,1 | 400 | Query string malformed close to position 3 |
|
||||
| route/v1/driving/x | 400 | Query string malformed close to position 0 |
|
||||
| route/v1/driving/x,y | 400 | Query string malformed close to position 0 |
|
||||
| route/v1/driving/1,1; | 400 | Query string malformed close to position 3 |
|
||||
| route/v1/driving/1,1;1 | 400 | Query string malformed close to position 5 |
|
||||
| route/v1/driving/1,1;1,1,1 | 400 | Query string malformed close to position 7 |
|
||||
| route/v1/driving/1,1;x | 400 | Query string malformed close to position 3 |
|
||||
| route/v1/driving/1,1;x,y | 400 | Query string malformed close to position 3 |
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
@routing @testbot @via
|
||||
Feature: Via points
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
And a grid size of 4 meters
|
||||
|
||||
Scenario: Basic Right Turn
|
||||
Given the node map
|
||||
| a | b | c | d | e | f | g |
|
||||
| | | | | | h | |
|
||||
| | | | | | i | |
|
||||
| | | | | | j | |
|
||||
| | | | | | k | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcdefg | yes |
|
||||
| ehijk | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance | turns |
|
||||
| a | k | abcdefg,ehijk,ehijk | 34m +-1 | depart,right,arrive |
|
||||
|
||||
Scenario: Slight Turn
|
||||
Given the node map
|
||||
| a | b | c | d | e | f | g | |
|
||||
| | | | | | h | i | |
|
||||
| | | | | | | | j |
|
||||
| | | | | | | | k |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcdefg | yes |
|
||||
| ehijk | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance | turns |
|
||||
| a | k | abcdefg,ehijk,ehijk | 35m +-1 | depart,slight right,arrive |
|
||||
|
||||
Scenario: Nearly Slight Turn
|
||||
Given the node map
|
||||
| a | b | c | d | e | f | g | |
|
||||
| | | | | | h | | |
|
||||
| | | | | | | i | |
|
||||
| | | | | | | | j |
|
||||
| | | | | | | | k |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcdefg | yes |
|
||||
| ehijk | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance | turns |
|
||||
| a | k | abcdefg,ehijk,ehijk | 37m +-1 | depart,right,arrive |
|
||||
|
||||
Scenario: Nearly Slight Turn (Variation)
|
||||
Given the node map
|
||||
| a | b | c | d | e | f | g | |
|
||||
| | | | | | h | | |
|
||||
| | | | | | | i | |
|
||||
| | | | | | | j | |
|
||||
| | | | | | | | k |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcdefg | yes |
|
||||
| ehijk | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance | turns |
|
||||
| a | k | abcdefg,ehijk,ehijk | 37m +-1 | depart,right,arrive |
|
||||
@@ -1,115 +0,0 @@
|
||||
@routing @turns @testbot
|
||||
Feature: Turn directions/codes
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
Scenario: Turn directions
|
||||
Given the node map
|
||||
| o | p | a | b | c |
|
||||
| n | | | | d |
|
||||
| m | | x | | e |
|
||||
| l | | | | f |
|
||||
| k | j | i | h | g |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| xi |
|
||||
| xk |
|
||||
| xm |
|
||||
| xo |
|
||||
| xa |
|
||||
| xc |
|
||||
| xe |
|
||||
| xg |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| i | k | xi,xk,xk | depart,sharp left,arrive |
|
||||
| i | m | xi,xm,xm | depart,left,arrive |
|
||||
| i | o | xi,xo,xo | depart,slight left,arrive |
|
||||
| i | a | xi,xa,xa | depart,straight,arrive |
|
||||
| i | c | xi,xc,xc | depart,slight right,arrive |
|
||||
| i | e | xi,xe,xe | depart,right,arrive |
|
||||
| i | g | xi,xg,xg | depart,sharp right,arrive |
|
||||
|
||||
| k | m | xk,xm,xm | depart,sharp left,arrive |
|
||||
| k | o | xk,xo,xo | depart,left,arrive |
|
||||
| k | a | xk,xa,xa | depart,slight left,arrive |
|
||||
| k | c | xk,xc,xc | depart,straight,arrive |
|
||||
| k | e | xk,xe,xe | depart,slight right,arrive |
|
||||
| k | g | xk,xg,xg | depart,right,arrive |
|
||||
| k | i | xk,xi,xi | depart,sharp right,arrive |
|
||||
|
||||
| m | o | xm,xo,xo | depart,sharp left,arrive |
|
||||
| m | a | xm,xa,xa | depart,left,arrive |
|
||||
| m | c | xm,xc,xc | depart,slight left,arrive |
|
||||
| m | e | xm,xe,xe | depart,straight,arrive |
|
||||
| m | g | xm,xg,xg | depart,slight right,arrive |
|
||||
| m | i | xm,xi,xi | depart,right,arrive |
|
||||
| m | k | xm,xk,xk | depart,sharp right,arrive |
|
||||
|
||||
| o | a | xo,xa,xa | depart,sharp left,arrive |
|
||||
| o | c | xo,xc,xc | depart,left,arrive |
|
||||
| o | e | xo,xe,xe | depart,slight left,arrive |
|
||||
| o | g | xo,xg,xg | depart,straight,arrive |
|
||||
| o | i | xo,xi,xi | depart,slight right,arrive |
|
||||
| o | k | xo,xk,xk | depart,right,arrive |
|
||||
| o | m | xo,xm,xm | depart,sharp right,arrive |
|
||||
|
||||
| a | c | xa,xc,xc | depart,sharp left,arrive |
|
||||
| a | e | xa,xe,xe | depart,left,arrive |
|
||||
| a | g | xa,xg,xg | depart,slight left,arrive |
|
||||
| a | i | xa,xi,xi | depart,straight,arrive |
|
||||
| a | k | xa,xk,xk | depart,slight right,arrive |
|
||||
| a | m | xa,xm,xm | depart,right,arrive |
|
||||
| a | o | xa,xo,xo | depart,sharp right,arrive |
|
||||
|
||||
| c | e | xc,xe,xe | depart,sharp left,arrive |
|
||||
| c | g | xc,xg,xg | depart,left,arrive |
|
||||
| c | i | xc,xi,xi | depart,slight left,arrive |
|
||||
| c | k | xc,xk,xk | depart,straight,arrive |
|
||||
| c | m | xc,xm,xm | depart,slight right,arrive |
|
||||
| c | o | xc,xo,xo | depart,right,arrive |
|
||||
| c | a | xc,xa,xa | depart,sharp right,arrive |
|
||||
|
||||
| e | g | xe,xg,xg | depart,sharp left,arrive |
|
||||
| e | i | xe,xi,xi | depart,left,arrive |
|
||||
| e | k | xe,xk,xk | depart,slight left,arrive |
|
||||
| e | m | xe,xm,xm | depart,straight,arrive |
|
||||
| e | o | xe,xo,xo | depart,slight right,arrive |
|
||||
| e | a | xe,xa,xa | depart,right,arrive |
|
||||
| e | c | xe,xc,xc | depart,sharp right,arrive |
|
||||
|
||||
| g | i | xg,xi,xi | depart,sharp left,arrive |
|
||||
| g | k | xg,xk,xk | depart,left,arrive |
|
||||
| g | m | xg,xm,xm | depart,slight left,arrive |
|
||||
| g | o | xg,xo,xo | depart,straight,arrive |
|
||||
| g | a | xg,xa,xa | depart,slight right,arrive |
|
||||
| g | c | xg,xc,xc | depart,right,arrive |
|
||||
| g | e | xg,xe,xe | depart,sharp right,arrive |
|
||||
|
||||
Scenario: Turn instructions at high latitude
|
||||
# https://github.com/DennisOSRM/Project-OSRM/issues/532
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 55.68740 | 12.52430 |
|
||||
| b | 55.68745 | 12.52409 |
|
||||
| c | 55.68711 | 12.52383 |
|
||||
| x | -55.68740 | 12.52430 |
|
||||
| y | -55.68745 | 12.52409 |
|
||||
| z | -55.68711 | 12.52383 |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| xy |
|
||||
| yz |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | c | ab,bc,bc | depart,left,arrive |
|
||||
| c | a | bc,ab,ab | depart,right,arrive |
|
||||
| x | z | xy,yz,yz | depart,right,arrive |
|
||||
| z | x | yz,xy,xy | depart,left,arrive |
|
||||
@@ -46,7 +46,6 @@ Feature: Via points
|
||||
| a,d,c | abc,bd,bd,bd,abc,abc |
|
||||
| c,d,a | abc,bd,bd,bd,abc,abc |
|
||||
|
||||
@mokob
|
||||
Scenario: Multiple via points
|
||||
Given the node map
|
||||
| a | | | | e | f | g | |
|
||||
|
||||
@@ -342,7 +342,7 @@ class GraphContractor
|
||||
// remaining graph
|
||||
std::vector<NodeID> new_node_id_from_orig_id_map(number_of_nodes, SPECIAL_NODEID);
|
||||
|
||||
for (const auto new_node_id : util::irange<std::size_t>(0, remaining_nodes.size()))
|
||||
for (const auto new_node_id : util::irange<std::size_t>(0UL, remaining_nodes.size()))
|
||||
{
|
||||
auto &node = remaining_nodes[new_node_id];
|
||||
BOOST_ASSERT(node_priorities.size() > node.id);
|
||||
@@ -352,7 +352,7 @@ class GraphContractor
|
||||
}
|
||||
|
||||
// build forward and backward renumbering map and remap ids in remaining_nodes
|
||||
for (const auto new_node_id : util::irange<std::size_t>(0, remaining_nodes.size()))
|
||||
for (const auto new_node_id : util::irange<std::size_t>(0UL, remaining_nodes.size()))
|
||||
{
|
||||
auto &node = remaining_nodes[new_node_id];
|
||||
// create renumbering maps in both directions
|
||||
@@ -362,7 +362,7 @@ class GraphContractor
|
||||
}
|
||||
// walk over all nodes
|
||||
for (const auto source :
|
||||
util::irange<NodeID>(0, contractor_graph->GetNumberOfNodes()))
|
||||
util::irange<NodeID>(0UL, contractor_graph->GetNumberOfNodes()))
|
||||
{
|
||||
for (auto current_edge : contractor_graph->GetAdjacentEdgeRange(source))
|
||||
{
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
@@ -47,13 +48,25 @@ template <typename ForwardIter> util::json::String makePolyline(ForwardIter begi
|
||||
}
|
||||
|
||||
template <typename ForwardIter>
|
||||
util::json::Object makeGeoJSONLineString(ForwardIter begin, ForwardIter end)
|
||||
util::json::Object makeGeoJSONGeometry(ForwardIter begin, ForwardIter end)
|
||||
{
|
||||
auto num_coordinates = std::distance(begin, end);
|
||||
BOOST_ASSERT(num_coordinates != 0);
|
||||
util::json::Object geojson;
|
||||
geojson.values["type"] = "LineString";
|
||||
util::json::Array coordinates;
|
||||
std::transform(begin, end, std::back_inserter(coordinates.values), &detail::coordinateToLonLat);
|
||||
geojson.values["coordinates"] = std::move(coordinates);
|
||||
if (num_coordinates > 1)
|
||||
{
|
||||
geojson.values["type"] = "LineString";
|
||||
util::json::Array coordinates;
|
||||
std::transform(begin, end, std::back_inserter(coordinates.values), &detail::coordinateToLonLat);
|
||||
geojson.values["coordinates"] = std::move(coordinates);
|
||||
}
|
||||
else if (num_coordinates > 0)
|
||||
{
|
||||
geojson.values["type"] = "Point";
|
||||
util::json::Array coordinates;
|
||||
coordinates.values.push_back(detail::coordinateToLonLat(*begin));
|
||||
geojson.values["coordinates"] = std::move(coordinates);
|
||||
}
|
||||
return geojson;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class MatchAPI final : public RouteAPI
|
||||
}
|
||||
response.values["tracepoints"] = MakeTracepoints(sub_matchings);
|
||||
response.values["matchings"] = std::move(routes);
|
||||
response.values["code"] = "ok";
|
||||
response.values["code"] = "Ok";
|
||||
}
|
||||
|
||||
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
|
||||
@@ -90,7 +90,7 @@ class MatchAPI final : public RouteAPI
|
||||
}
|
||||
}
|
||||
|
||||
for (auto trace_index : util::irange(0UL, parameters.coordinates.size()))
|
||||
for (auto trace_index : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
||||
{
|
||||
auto matching_index = trace_idx_to_matching_idx[trace_index];
|
||||
if (matching_index.NotMatched())
|
||||
|
||||
@@ -43,7 +43,7 @@ class NearestAPI final : public BaseAPI
|
||||
return waypoint;
|
||||
});
|
||||
|
||||
response.values["code"] = "ok";
|
||||
response.values["code"] = "Ok";
|
||||
response.values["waypoints"] = std::move(waypoints);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
#define ENGINE_API_ROUTE_HPP
|
||||
|
||||
#include "engine/api/base_api.hpp"
|
||||
#include "engine/api/route_parameters.hpp"
|
||||
#include "engine/api/json_factory.hpp"
|
||||
#include "engine/api/route_parameters.hpp"
|
||||
|
||||
#include "engine/datafacade/datafacade_base.hpp"
|
||||
|
||||
#include "engine/guidance/assemble_leg.hpp"
|
||||
#include "engine/guidance/assemble_route.hpp"
|
||||
#include "engine/guidance/assemble_geometry.hpp"
|
||||
#include "engine/guidance/assemble_leg.hpp"
|
||||
#include "engine/guidance/assemble_overview.hpp"
|
||||
#include "engine/guidance/assemble_route.hpp"
|
||||
#include "engine/guidance/assemble_steps.hpp"
|
||||
#include "engine/guidance/post_processing.hpp"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/integer_range.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
@@ -54,7 +55,7 @@ class RouteAPI : public BaseAPI
|
||||
}
|
||||
response.values["waypoints"] = BaseAPI::MakeWaypoints(raw_route.segment_end_coordinates);
|
||||
response.values["routes"] = std::move(routes);
|
||||
response.values["code"] = "ok";
|
||||
response.values["code"] = "Ok";
|
||||
}
|
||||
|
||||
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
|
||||
@@ -68,7 +69,7 @@ class RouteAPI : public BaseAPI
|
||||
}
|
||||
|
||||
BOOST_ASSERT(parameters.geometries == RouteParameters::GeometriesType::GeoJSON);
|
||||
return json::makeGeoJSONLineString(begin, end);
|
||||
return json::makeGeoJSONGeometry(begin, end);
|
||||
}
|
||||
|
||||
util::json::Object MakeRoute(const std::vector<PhantomNodes> &segment_end_coordinates,
|
||||
@@ -82,7 +83,7 @@ class RouteAPI : public BaseAPI
|
||||
legs.reserve(number_of_legs);
|
||||
leg_geometries.reserve(number_of_legs);
|
||||
|
||||
for (auto idx : util::irange(0UL, number_of_legs))
|
||||
for (auto idx : util::irange<std::size_t>(0UL, number_of_legs))
|
||||
{
|
||||
const auto &phantoms = segment_end_coordinates[idx];
|
||||
const auto &path_data = unpacked_path_segments[idx];
|
||||
@@ -92,8 +93,8 @@ class RouteAPI : public BaseAPI
|
||||
|
||||
auto leg_geometry = guidance::assembleGeometry(
|
||||
BaseAPI::facade, path_data, phantoms.source_phantom, phantoms.target_phantom);
|
||||
auto leg = guidance::assembleLeg(BaseAPI::facade, path_data, leg_geometry,
|
||||
phantoms.source_phantom, phantoms.target_phantom, reversed_target);
|
||||
auto leg = guidance::assembleLeg(facade, path_data, leg_geometry, phantoms.source_phantom,
|
||||
phantoms.target_phantom, reversed_target, parameters.steps);
|
||||
|
||||
if (parameters.steps)
|
||||
{
|
||||
@@ -155,13 +156,12 @@ class RouteAPI : public BaseAPI
|
||||
}
|
||||
|
||||
std::vector<util::json::Value> step_geometries;
|
||||
for (const auto idx : util::irange(0UL, legs.size()))
|
||||
for (const auto idx : util::irange<std::size_t>(0UL, legs.size()))
|
||||
{
|
||||
auto &leg_geometry = leg_geometries[idx];
|
||||
std::transform(
|
||||
legs[idx].steps.begin(), legs[idx].steps.end(), std::back_inserter(step_geometries),
|
||||
[this, &leg_geometry](const guidance::RouteStep &step)
|
||||
{
|
||||
[this, &leg_geometry](const guidance::RouteStep &step) {
|
||||
if (parameters.geometries == RouteParameters::GeometriesType::Polyline)
|
||||
{
|
||||
return static_cast<util::json::Value>(
|
||||
@@ -169,7 +169,7 @@ class RouteAPI : public BaseAPI
|
||||
leg_geometry.locations.begin() + step.geometry_end));
|
||||
}
|
||||
BOOST_ASSERT(parameters.geometries == RouteParameters::GeometriesType::GeoJSON);
|
||||
return static_cast<util::json::Value>(json::makeGeoJSONLineString(
|
||||
return static_cast<util::json::Value>(json::makeGeoJSONGeometry(
|
||||
leg_geometry.locations.begin() + step.geometry_begin,
|
||||
leg_geometry.locations.begin() + step.geometry_end));
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace api
|
||||
* - geometries: route geometry encoded in Polyline or GeoJSON
|
||||
* - overview: adds overview geometry either Full, Simplified (according to highest zoom level) or
|
||||
* False (not at all)
|
||||
* - uturns: enable or disable uturns (disabled by default)
|
||||
* - continue_straight: enable or disable continue_straight (disabled by default)
|
||||
*
|
||||
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
|
||||
* NearestParameters, TripParameters, MatchParameters and TileParameters
|
||||
@@ -74,18 +74,18 @@ struct RouteParameters : public BaseParameters
|
||||
const bool alternatives_,
|
||||
const GeometriesType geometries_,
|
||||
const OverviewType overview_,
|
||||
const boost::optional<bool> uturns_,
|
||||
const boost::optional<bool> continue_straight_,
|
||||
Args... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
geometries{geometries_}, overview{overview_}, uturns{uturns_}
|
||||
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_}
|
||||
{
|
||||
}
|
||||
|
||||
bool steps = true;
|
||||
bool alternatives = true;
|
||||
bool steps = false;
|
||||
bool alternatives = false;
|
||||
GeometriesType geometries = GeometriesType::Polyline;
|
||||
OverviewType overview = OverviewType::Simplified;
|
||||
boost::optional<bool> uturns;
|
||||
boost::optional<bool> continue_straight;
|
||||
|
||||
bool IsValid() const { return coordinates.size() >= 2 && BaseParameters::IsValid(); }
|
||||
};
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include <boost/range/algorithm/transform.hpp>
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
@@ -65,7 +67,7 @@ class TableAPI final : public BaseAPI
|
||||
|
||||
response.values["durations"] =
|
||||
MakeTable(durations, number_of_sources, number_of_destinations);
|
||||
response.values["code"] = "ok";
|
||||
response.values["code"] = "Ok";
|
||||
}
|
||||
|
||||
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
|
||||
@@ -103,7 +105,7 @@ class TableAPI final : public BaseAPI
|
||||
std::size_t number_of_columns) const
|
||||
{
|
||||
util::json::Array json_table;
|
||||
for (const auto row : util::irange<std::size_t>(0, number_of_rows))
|
||||
for (const auto row : util::irange<std::size_t>(0UL, number_of_rows))
|
||||
{
|
||||
util::json::Array json_row;
|
||||
auto row_begin_iterator = values.begin() + (row * number_of_columns);
|
||||
|
||||
@@ -44,7 +44,7 @@ class TripAPI final : public RouteAPI
|
||||
}
|
||||
response.values["waypoints"] = MakeWaypoints(sub_trips, phantoms);
|
||||
response.values["trips"] = std::move(routes);
|
||||
response.values["code"] = "ok";
|
||||
response.values["code"] = "Ok";
|
||||
}
|
||||
|
||||
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
|
||||
@@ -77,17 +77,17 @@ class TripAPI final : public RouteAPI
|
||||
};
|
||||
|
||||
std::vector<TripIndex> input_idx_to_trip_idx(parameters.coordinates.size());
|
||||
for (auto sub_trip_index : util::irange(0u, static_cast<unsigned>(sub_trips.size())))
|
||||
for (auto sub_trip_index : util::irange<unsigned>(0u, sub_trips.size()))
|
||||
{
|
||||
for (auto point_index :
|
||||
util::irange(0u, static_cast<unsigned>(sub_trips[sub_trip_index].size())))
|
||||
util::irange<unsigned>(0u, sub_trips[sub_trip_index].size()))
|
||||
{
|
||||
input_idx_to_trip_idx[sub_trips[sub_trip_index][point_index]] =
|
||||
TripIndex{sub_trip_index, point_index};
|
||||
}
|
||||
}
|
||||
|
||||
for (auto input_index : util::irange(0UL, parameters.coordinates.size()))
|
||||
for (auto input_index : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
||||
{
|
||||
auto trip_index = input_idx_to_trip_idx[input_index];
|
||||
BOOST_ASSERT(!trip_index.NotUsed());
|
||||
|
||||
@@ -144,7 +144,7 @@ class BaseDataFacade
|
||||
|
||||
virtual std::string GetTimestamp() const = 0;
|
||||
|
||||
virtual bool GetUTurnsDefault() const = 0;
|
||||
virtual bool GetContinueStraightDefault() const = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
|
||||
std::string GetTimestamp() const override final { return m_timestamp; }
|
||||
|
||||
bool GetUTurnsDefault() const override final { return m_profile_properties.allow_u_turn_at_via; }
|
||||
bool GetContinueStraightDefault() const override final { return m_profile_properties.continue_straight_at_waypoint; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@@ -708,7 +709,7 @@ class SharedDataFacade final : public BaseDataFacade
|
||||
|
||||
std::string GetTimestamp() const override final { return m_timestamp; }
|
||||
|
||||
bool GetUTurnsDefault() const override final { return m_profile_properties->allow_u_turn_at_via; }
|
||||
bool GetContinueStraightDefault() const override final { return m_profile_properties->continue_straight_at_waypoint; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,26 +12,47 @@ namespace engine
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
const constexpr int DOUGLAS_PEUCKER_THRESHOLDS[19] = {
|
||||
512440, // z0
|
||||
256720, // z1
|
||||
122560, // z2
|
||||
56780, // z3
|
||||
28800, // z4
|
||||
14400, // z5
|
||||
7200, // z6
|
||||
3200, // z7
|
||||
2400, // z8
|
||||
1000, // z9
|
||||
600, // z10
|
||||
120, // z11
|
||||
60, // z12
|
||||
45, // z13
|
||||
36, // z14
|
||||
20, // z15
|
||||
8, // z16
|
||||
6, // z17
|
||||
4, // z18
|
||||
|
||||
// This is derived from the following formular:
|
||||
// x = b * (1 + lon/180) => dx = b * dlon/180
|
||||
// y = b * (1 - lat/180) => dy = b * dlat/180
|
||||
// dx^2 + dy^2 < min_pixel^2
|
||||
// => dlon^2 + dlat^2 < min_pixel^2 / b^2 * 180^2
|
||||
inline std::vector<std::uint64_t> generateThreshold(double min_pixel, unsigned number_of_zoomlevels)
|
||||
{
|
||||
std::vector<std::uint64_t> thresholds(number_of_zoomlevels);
|
||||
for (unsigned zoom = 0; zoom < number_of_zoomlevels; ++zoom)
|
||||
{
|
||||
const double shift = (1u << zoom) * 256;
|
||||
const double b = shift / 2.0;
|
||||
const double pixel_to_deg = 180. / b;
|
||||
const std::uint64_t min_deg = min_pixel * pixel_to_deg * COORDINATE_PRECISION;
|
||||
thresholds[zoom] = min_deg * min_deg;
|
||||
}
|
||||
|
||||
return thresholds;
|
||||
}
|
||||
|
||||
const constexpr std::uint64_t DOUGLAS_PEUCKER_THRESHOLDS[19] = {
|
||||
49438476562500, // z0
|
||||
12359619140625, // z1
|
||||
3089903027344, // z2
|
||||
772475756836, // z3
|
||||
193118939209, // z4
|
||||
48279515076, // z5
|
||||
12069878769, // z6
|
||||
3017414761, // z7
|
||||
754326225, // z8
|
||||
188567824, // z9
|
||||
47141956, // z10
|
||||
11785489, // z11
|
||||
2944656, // z12
|
||||
736164, // z13
|
||||
184041, // z14
|
||||
45796, // z15
|
||||
11449, // z16
|
||||
2809, // z17
|
||||
676, // z18
|
||||
};
|
||||
|
||||
const constexpr auto DOUGLAS_PEUCKER_THRESHOLDS_SIZE =
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "engine/phantom_node.hpp"
|
||||
#include "util/bearing.hpp"
|
||||
#include "util/rectangle.hpp"
|
||||
#include "util/web_mercator.hpp"
|
||||
|
||||
#include "osrm/coordinate.hpp"
|
||||
|
||||
@@ -424,10 +425,11 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
||||
BOOST_ASSERT(segment.data.reverse_segment_id.id != SPECIAL_SEGMENTID ||
|
||||
!segment.data.reverse_segment_id.enabled);
|
||||
|
||||
Coordinate wsg84_coordinate = util::coordinate_calculation::mercator::toWGS84(
|
||||
segment.fixed_projected_coordinate);
|
||||
Coordinate wsg84_coordinate =
|
||||
util::web_mercator::toWGS84(segment.fixed_projected_coordinate);
|
||||
|
||||
return util::coordinate_calculation::haversineDistance(input_coordinate, wsg84_coordinate) > max_distance;
|
||||
return util::coordinate_calculation::haversineDistance(input_coordinate, wsg84_coordinate) >
|
||||
max_distance;
|
||||
}
|
||||
|
||||
std::pair<bool, bool> checkSegmentBearing(const CandidateSegment &segment,
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
#ifndef ENGINE_GUIDANCE_ASSEMBLE_LEG_HPP_
|
||||
#define ENGINE_GUIDANCE_ASSEMBLE_LEG_HPP_
|
||||
|
||||
#include "engine/datafacade/datafacade_base.hpp"
|
||||
#include "engine/guidance/leg_geometry.hpp"
|
||||
#include "engine/guidance/route_leg.hpp"
|
||||
#include "engine/guidance/route_step.hpp"
|
||||
#include "engine/guidance/leg_geometry.hpp"
|
||||
#include "engine/internal_route_result.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <numeric>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -27,7 +28,7 @@ namespace detail
|
||||
const constexpr std::size_t MAX_USED_SEGMENTS = 2;
|
||||
struct NamedSegment
|
||||
{
|
||||
double duration;
|
||||
EdgeWeight duration;
|
||||
std::uint32_t position;
|
||||
std::uint32_t name_id;
|
||||
};
|
||||
@@ -61,7 +62,7 @@ std::array<std::uint32_t, SegmentNumber> summarizeRoute(const std::vector<PathDa
|
||||
std::transform(
|
||||
route_data.begin(), route_data.end(), segments.begin(), [&index](const PathData &point)
|
||||
{
|
||||
return NamedSegment{point.duration_until_turn / 10.0, index++, point.name_id};
|
||||
return NamedSegment{point.duration_until_turn, index++, point.name_id};
|
||||
});
|
||||
// this makes sure that the segment with the lowest position comes first
|
||||
std::sort(segments.begin(), segments.end(), [](const NamedSegment &lhs, const NamedSegment &rhs)
|
||||
@@ -95,13 +96,13 @@ std::array<std::uint32_t, SegmentNumber> summarizeRoute(const std::vector<PathDa
|
||||
}
|
||||
}
|
||||
|
||||
template <typename DataFacadeT>
|
||||
RouteLeg assembleLeg(const DataFacadeT &facade,
|
||||
const std::vector<PathData> &route_data,
|
||||
const LegGeometry &leg_geometry,
|
||||
const PhantomNode &source_node,
|
||||
const PhantomNode &target_node,
|
||||
const bool target_traversed_in_reverse)
|
||||
inline RouteLeg assembleLeg(const datafacade::BaseDataFacade &facade,
|
||||
const std::vector<PathData> &route_data,
|
||||
const LegGeometry &leg_geometry,
|
||||
const PhantomNode &source_node,
|
||||
const PhantomNode &target_node,
|
||||
const bool target_traversed_in_reverse,
|
||||
const bool needs_summary)
|
||||
{
|
||||
const auto target_duration =
|
||||
(target_traversed_in_reverse ? target_node.reverse_weight : target_node.forward_weight) /
|
||||
@@ -110,8 +111,7 @@ RouteLeg assembleLeg(const DataFacadeT &facade,
|
||||
auto distance = std::accumulate(leg_geometry.segment_distances.begin(),
|
||||
leg_geometry.segment_distances.end(), 0.);
|
||||
auto duration = std::accumulate(route_data.begin(), route_data.end(), 0.,
|
||||
[](const double sum, const PathData &data)
|
||||
{
|
||||
[](const double sum, const PathData &data) {
|
||||
return sum + data.duration_until_turn;
|
||||
}) /
|
||||
10.;
|
||||
@@ -140,24 +140,29 @@ RouteLeg assembleLeg(const DataFacadeT &facade,
|
||||
duration = duration + target_duration;
|
||||
if (route_data.empty())
|
||||
{
|
||||
duration -=
|
||||
(target_traversed_in_reverse ? source_node.reverse_weight : source_node.forward_weight) / 10;
|
||||
duration -= (target_traversed_in_reverse ? source_node.reverse_weight
|
||||
: source_node.forward_weight) /
|
||||
10.0;
|
||||
}
|
||||
auto summary_array = detail::summarizeRoute<detail::MAX_USED_SEGMENTS>(route_data);
|
||||
|
||||
BOOST_ASSERT(detail::MAX_USED_SEGMENTS > 0);
|
||||
BOOST_ASSERT(summary_array.begin() != summary_array.end());
|
||||
std::string summary =
|
||||
std::accumulate(std::next(summary_array.begin()), summary_array.end(),
|
||||
facade.GetNameForID(summary_array.front()),
|
||||
[&facade](std::string previous, const std::uint32_t name_id)
|
||||
{
|
||||
if (name_id != 0)
|
||||
{
|
||||
previous += ", " + facade.GetNameForID(name_id);
|
||||
}
|
||||
return previous;
|
||||
});
|
||||
std::string summary;
|
||||
if (needs_summary)
|
||||
{
|
||||
auto summary_array = detail::summarizeRoute<detail::MAX_USED_SEGMENTS>(route_data);
|
||||
|
||||
BOOST_ASSERT(detail::MAX_USED_SEGMENTS > 0);
|
||||
BOOST_ASSERT(summary_array.begin() != summary_array.end());
|
||||
summary = std::accumulate(std::next(summary_array.begin()), summary_array.end(),
|
||||
facade.GetNameForID(summary_array.front()),
|
||||
[&facade](std::string previous, const std::uint32_t name_id)
|
||||
{
|
||||
if (name_id != 0)
|
||||
{
|
||||
previous += ", " + facade.GetNameForID(name_id);
|
||||
}
|
||||
return previous;
|
||||
});
|
||||
}
|
||||
|
||||
return RouteLeg{duration, distance, summary, {}};
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
#ifndef ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
||||
#define ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
||||
|
||||
#include "engine/guidance/leg_geometry.hpp"
|
||||
#include "engine/guidance/route_step.hpp"
|
||||
#include "engine/guidance/step_maneuver.hpp"
|
||||
#include "engine/guidance/leg_geometry.hpp"
|
||||
#include "engine/guidance/toolkit.hpp"
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "engine/internal_route_result.hpp"
|
||||
#include "engine/phantom_node.hpp"
|
||||
#include "util/coordinate_calculation.hpp"
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/bearing.hpp"
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "extractor/travel_mode.hpp"
|
||||
#include "util/bearing.hpp"
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/coordinate_calculation.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <boost/optional.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -44,6 +44,7 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
|
||||
const bool target_traversed_in_reverse)
|
||||
{
|
||||
const double constexpr ZERO_DURATION = 0., ZERO_DISTANCE = 0.;
|
||||
const constexpr char *NO_ROTARY_NAME = "";
|
||||
const EdgeWeight source_duration =
|
||||
source_traversed_in_reverse ? source_node.reverse_weight : source_node.forward_weight;
|
||||
const auto source_mode = source_traversed_in_reverse ? source_node.backward_travel_mode
|
||||
@@ -84,13 +85,9 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
|
||||
BOOST_ASSERT(segment_duration >= 0);
|
||||
const auto name = facade.GetNameForID(path_point.name_id);
|
||||
const auto distance = leg_geometry.segment_distances[segment_index];
|
||||
steps.push_back(RouteStep{path_point.name_id,
|
||||
name,
|
||||
segment_duration / 10.0,
|
||||
distance,
|
||||
path_point.travel_mode,
|
||||
maneuver,
|
||||
leg_geometry.FrontIndex(segment_index),
|
||||
steps.push_back(RouteStep{path_point.name_id, name, NO_ROTARY_NAME,
|
||||
segment_duration / 10.0, distance, path_point.travel_mode,
|
||||
maneuver, leg_geometry.FrontIndex(segment_index),
|
||||
leg_geometry.BackIndex(segment_index) + 1});
|
||||
maneuver = detail::stepManeuverFromGeometry(path_point.turn_instruction,
|
||||
leg_geometry, segment_index);
|
||||
@@ -101,12 +98,8 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
|
||||
const auto distance = leg_geometry.segment_distances[segment_index];
|
||||
const int duration = segment_duration + target_duration;
|
||||
BOOST_ASSERT(duration >= 0);
|
||||
steps.push_back(RouteStep{target_node.name_id,
|
||||
facade.GetNameForID(target_node.name_id),
|
||||
duration / 10.,
|
||||
distance,
|
||||
target_mode,
|
||||
maneuver,
|
||||
steps.push_back(RouteStep{target_node.name_id, facade.GetNameForID(target_node.name_id),
|
||||
NO_ROTARY_NAME, duration / 10., distance, target_mode, maneuver,
|
||||
leg_geometry.FrontIndex(segment_index),
|
||||
leg_geometry.BackIndex(segment_index) + 1});
|
||||
}
|
||||
@@ -124,13 +117,10 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
|
||||
int duration = target_duration - source_duration;
|
||||
BOOST_ASSERT(duration >= 0);
|
||||
|
||||
steps.push_back(RouteStep{source_node.name_id,
|
||||
facade.GetNameForID(source_node.name_id),
|
||||
duration / 10.,
|
||||
leg_geometry.segment_distances[segment_index],
|
||||
source_mode,
|
||||
std::move(maneuver),
|
||||
leg_geometry.FrontIndex(segment_index),
|
||||
steps.push_back(RouteStep{source_node.name_id, facade.GetNameForID(source_node.name_id),
|
||||
NO_ROTARY_NAME, duration / 10.,
|
||||
leg_geometry.segment_distances[segment_index], source_mode,
|
||||
std::move(maneuver), leg_geometry.FrontIndex(segment_index),
|
||||
leg_geometry.BackIndex(segment_index) + 1});
|
||||
}
|
||||
|
||||
@@ -138,13 +128,11 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
|
||||
// This step has length zero, the only reason we need it is the target location
|
||||
auto final_maneuver = detail::stepManeuverFromGeometry(
|
||||
extractor::guidance::TurnInstruction::NO_TURN(), WaypointType::Arrive, leg_geometry);
|
||||
steps.push_back(RouteStep{target_node.name_id,
|
||||
facade.GetNameForID(target_node.name_id),
|
||||
ZERO_DURATION,
|
||||
ZERO_DISTANCE,
|
||||
target_mode,
|
||||
final_maneuver,
|
||||
leg_geometry.locations.size(),
|
||||
|
||||
BOOST_ASSERT(!leg_geometry.locations.empty());
|
||||
steps.push_back(RouteStep{target_node.name_id, facade.GetNameForID(target_node.name_id),
|
||||
NO_ROTARY_NAME, ZERO_DURATION, ZERO_DISTANCE, target_mode,
|
||||
final_maneuver, leg_geometry.locations.size()-1,
|
||||
leg_geometry.locations.size()});
|
||||
|
||||
return steps;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef ROUTE_STEP_HPP
|
||||
#define ROUTE_STEP_HPP
|
||||
|
||||
#include "extractor/travel_mode.hpp"
|
||||
#include "engine/guidance/step_maneuver.hpp"
|
||||
#include "extractor/travel_mode.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
@@ -25,6 +25,7 @@ struct RouteStep
|
||||
{
|
||||
unsigned name_id;
|
||||
std::string name;
|
||||
std::string rotary_name;
|
||||
double duration;
|
||||
double distance;
|
||||
extractor::TravelMode mode;
|
||||
|
||||
@@ -70,8 +70,8 @@ static_assert(ENCODED_HINT_SIZE / 4 * 3 >= sizeof(Hint),
|
||||
"ENCODED_HINT_SIZE does not match size of Hint");
|
||||
#else
|
||||
// PhantomNode is bigger under windows because MSVC does not support bit packing
|
||||
static_assert(sizeof(Hint) == 64 + 4, "Hint is bigger than expected");
|
||||
constexpr std::size_t ENCODED_HINT_SIZE = 92;
|
||||
static_assert(sizeof(Hint) == 72 + 4, "Hint is bigger than expected");
|
||||
constexpr std::size_t ENCODED_HINT_SIZE = 104;
|
||||
static_assert(ENCODED_HINT_SIZE / 4 * 3 >= sizeof(Hint),
|
||||
"ENCODED_HINT_SIZE does not match size of Hint");
|
||||
#endif
|
||||
|
||||
@@ -69,7 +69,7 @@ template <class CandidateLists> struct HiddenMarkovModel
|
||||
path_distances.resize(candidates_list.size());
|
||||
pruned.resize(candidates_list.size());
|
||||
breakage.resize(candidates_list.size());
|
||||
for (const auto i : util::irange<std::size_t>(0u, candidates_list.size()))
|
||||
for (const auto i : util::irange<std::size_t>(0UL, candidates_list.size()))
|
||||
{
|
||||
const auto &num_candidates = candidates_list[i].size();
|
||||
// add empty vectors
|
||||
@@ -107,7 +107,7 @@ template <class CandidateLists> struct HiddenMarkovModel
|
||||
{
|
||||
BOOST_ASSERT(initial_timestamp < num_points);
|
||||
|
||||
for (const auto s : util::irange<std::size_t>(0u, viterbi[initial_timestamp].size()))
|
||||
for (const auto s : util::irange<std::size_t>(0UL, viterbi[initial_timestamp].size()))
|
||||
{
|
||||
viterbi[initial_timestamp][s] = emission_log_probabilities[initial_timestamp][s];
|
||||
parents[initial_timestamp][s] = std::make_pair(initial_timestamp, s);
|
||||
|
||||
@@ -168,7 +168,7 @@ struct PhantomNode
|
||||
#ifndef _MSC_VER
|
||||
static_assert(sizeof(PhantomNode) == 60, "PhantomNode has more padding then expected");
|
||||
#else
|
||||
static_assert(sizeof(PhantomNode) == 64, "PhantomNode has more padding then expected");
|
||||
static_assert(sizeof(PhantomNode) == 72, "PhantomNode has more padding then expected");
|
||||
#endif
|
||||
|
||||
using PhantomNodePair = std::pair<PhantomNode, PhantomNode>;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "util/integer_range.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -122,7 +123,7 @@ class BasePlugin
|
||||
const bool use_hints = !parameters.hints.empty();
|
||||
const bool use_bearings = !parameters.bearings.empty();
|
||||
|
||||
for (const auto i : util::irange<std::size_t>(0, parameters.coordinates.size()))
|
||||
for (const auto i : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
||||
{
|
||||
if (use_hints && parameters.hints[i] &&
|
||||
parameters.hints[i]->IsValid(parameters.coordinates[i], facade))
|
||||
@@ -161,7 +162,7 @@ class BasePlugin
|
||||
const bool use_radiuses = !parameters.radiuses.empty();
|
||||
|
||||
BOOST_ASSERT(parameters.IsValid());
|
||||
for (const auto i : util::irange<std::size_t>(0, parameters.coordinates.size()))
|
||||
for (const auto i : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
||||
{
|
||||
if (use_hints && parameters.hints[i] &&
|
||||
parameters.hints[i]->IsValid(parameters.coordinates[i], facade))
|
||||
@@ -221,7 +222,7 @@ class BasePlugin
|
||||
const bool use_radiuses = !parameters.radiuses.empty();
|
||||
|
||||
BOOST_ASSERT(parameters.IsValid());
|
||||
for (const auto i : util::irange<std::size_t>(0, parameters.coordinates.size()))
|
||||
for (const auto i : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
||||
{
|
||||
if (use_hints && parameters.hints[i] &&
|
||||
parameters.hints[i]->IsValid(parameters.coordinates[i], facade))
|
||||
|
||||
@@ -84,19 +84,25 @@ class AlternativeRouting final
|
||||
int upper_bound_to_shortest_path_distance = INVALID_EDGE_WEIGHT;
|
||||
NodeID middle_node = SPECIAL_NODEID;
|
||||
const EdgeWeight min_edge_offset =
|
||||
std::min(phantom_node_pair.source_phantom.forward_segment_id.enabled ? -phantom_node_pair.source_phantom.GetForwardWeightPlusOffset() : 0,
|
||||
phantom_node_pair.source_phantom.reverse_segment_id.enabled ? -phantom_node_pair.source_phantom.GetReverseWeightPlusOffset() : 0);
|
||||
std::min(phantom_node_pair.source_phantom.forward_segment_id.enabled
|
||||
? -phantom_node_pair.source_phantom.GetForwardWeightPlusOffset()
|
||||
: 0,
|
||||
phantom_node_pair.source_phantom.reverse_segment_id.enabled
|
||||
? -phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()
|
||||
: 0);
|
||||
|
||||
if (phantom_node_pair.source_phantom.forward_segment_id.enabled)
|
||||
{
|
||||
BOOST_ASSERT(phantom_node_pair.source_phantom.forward_segment_id.id != SPECIAL_SEGMENTID);
|
||||
BOOST_ASSERT(phantom_node_pair.source_phantom.forward_segment_id.id !=
|
||||
SPECIAL_SEGMENTID);
|
||||
forward_heap1.Insert(phantom_node_pair.source_phantom.forward_segment_id.id,
|
||||
-phantom_node_pair.source_phantom.GetForwardWeightPlusOffset(),
|
||||
phantom_node_pair.source_phantom.forward_segment_id.id);
|
||||
}
|
||||
if (phantom_node_pair.source_phantom.reverse_segment_id.enabled)
|
||||
{
|
||||
BOOST_ASSERT(phantom_node_pair.source_phantom.reverse_segment_id.id != SPECIAL_SEGMENTID);
|
||||
BOOST_ASSERT(phantom_node_pair.source_phantom.reverse_segment_id.id !=
|
||||
SPECIAL_SEGMENTID);
|
||||
forward_heap1.Insert(phantom_node_pair.source_phantom.reverse_segment_id.id,
|
||||
-phantom_node_pair.source_phantom.GetReverseWeightPlusOffset(),
|
||||
phantom_node_pair.source_phantom.reverse_segment_id.id);
|
||||
@@ -104,14 +110,16 @@ class AlternativeRouting final
|
||||
|
||||
if (phantom_node_pair.target_phantom.forward_segment_id.enabled)
|
||||
{
|
||||
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_segment_id.id != SPECIAL_SEGMENTID);
|
||||
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_segment_id.id !=
|
||||
SPECIAL_SEGMENTID);
|
||||
reverse_heap1.Insert(phantom_node_pair.target_phantom.forward_segment_id.id,
|
||||
phantom_node_pair.target_phantom.GetForwardWeightPlusOffset(),
|
||||
phantom_node_pair.target_phantom.forward_segment_id.id);
|
||||
}
|
||||
if (phantom_node_pair.target_phantom.reverse_segment_id.enabled)
|
||||
{
|
||||
BOOST_ASSERT(phantom_node_pair.target_phantom.reverse_segment_id.id != SPECIAL_SEGMENTID);
|
||||
BOOST_ASSERT(phantom_node_pair.target_phantom.reverse_segment_id.id !=
|
||||
SPECIAL_SEGMENTID);
|
||||
reverse_heap1.Insert(phantom_node_pair.target_phantom.reverse_segment_id.id,
|
||||
phantom_node_pair.target_phantom.GetReverseWeightPlusOffset(),
|
||||
phantom_node_pair.target_phantom.reverse_segment_id.id);
|
||||
@@ -308,9 +316,11 @@ class AlternativeRouting final
|
||||
BOOST_ASSERT(!packed_shortest_path.empty());
|
||||
raw_route_data.unpacked_path_segments.resize(1);
|
||||
raw_route_data.source_traversed_in_reverse.push_back(
|
||||
(packed_shortest_path.front() != phantom_node_pair.source_phantom.forward_segment_id.id));
|
||||
(packed_shortest_path.front() !=
|
||||
phantom_node_pair.source_phantom.forward_segment_id.id));
|
||||
raw_route_data.target_traversed_in_reverse.push_back(
|
||||
(packed_shortest_path.back() != phantom_node_pair.target_phantom.forward_segment_id.id));
|
||||
(packed_shortest_path.back() !=
|
||||
phantom_node_pair.target_phantom.forward_segment_id.id));
|
||||
|
||||
super::UnpackPath(
|
||||
// -- packed input
|
||||
@@ -329,10 +339,12 @@ class AlternativeRouting final
|
||||
RetrievePackedAlternatePath(forward_heap1, reverse_heap1, forward_heap2, reverse_heap2,
|
||||
s_v_middle, v_t_middle, packed_alternate_path);
|
||||
|
||||
raw_route_data.alt_source_traversed_in_reverse.push_back((
|
||||
packed_alternate_path.front() != phantom_node_pair.source_phantom.forward_segment_id.id));
|
||||
raw_route_data.alt_source_traversed_in_reverse.push_back(
|
||||
(packed_alternate_path.front() !=
|
||||
phantom_node_pair.source_phantom.forward_segment_id.id));
|
||||
raw_route_data.alt_target_traversed_in_reverse.push_back(
|
||||
(packed_alternate_path.back() != phantom_node_pair.target_phantom.forward_segment_id.id));
|
||||
(packed_alternate_path.back() !=
|
||||
phantom_node_pair.target_phantom.forward_segment_id.id));
|
||||
|
||||
// unpack the alternate path
|
||||
super::UnpackPath(packed_alternate_path.begin(), packed_alternate_path.end(),
|
||||
@@ -429,9 +441,9 @@ class AlternativeRouting final
|
||||
|
||||
// partial unpacking, compute sharing
|
||||
// First partially unpack s-->v until paths deviate, note length of common path.
|
||||
const int64_t s_v_min_path_size =
|
||||
static_cast<int64_t>(std::min(packed_s_v_path.size(), packed_shortest_path.size())) - 1;
|
||||
for (const int64_t current_node : util::irange<int64_t>(0, s_v_min_path_size))
|
||||
const auto s_v_min_path_size =
|
||||
std::min(packed_s_v_path.size(), packed_shortest_path.size()) - 1;
|
||||
for (const auto current_node : util::irange<std::size_t>(0UL, s_v_min_path_size))
|
||||
{
|
||||
if (packed_s_v_path[current_node] == packed_shortest_path[current_node] &&
|
||||
packed_s_v_path[current_node + 1] == packed_shortest_path[current_node + 1])
|
||||
|
||||
@@ -244,14 +244,14 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
|
||||
((haversine_distance + max_distance_delta) * 0.25) * 10;
|
||||
|
||||
// compute d_t for this timestamp and the next one
|
||||
for (const auto s : util::irange<std::size_t>(0u, prev_viterbi.size()))
|
||||
for (const auto s : util::irange<std::size_t>(0UL, prev_viterbi.size()))
|
||||
{
|
||||
if (prev_pruned[s])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const auto s_prime : util::irange<std::size_t>(0u, current_viterbi.size()))
|
||||
for (const auto s_prime : util::irange<std::size_t>(0UL, current_viterbi.size()))
|
||||
{
|
||||
const double emission_pr = emission_log_probabilities[t][s_prime];
|
||||
double new_value = prev_viterbi[s] + emission_pr;
|
||||
|
||||
@@ -373,8 +373,7 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
|
||||
// t: fwd_segment 3
|
||||
// -> (U, v), (v, w), (w, x)
|
||||
// note that (x, t) is _not_ included but needs to be added later.
|
||||
BOOST_ASSERT(start_index <= end_index);
|
||||
for (std::size_t i = start_index; i != end_index; ++i)
|
||||
for (std::size_t i = start_index; i != end_index; (start_index < end_index ? ++i : --i))
|
||||
{
|
||||
BOOST_ASSERT(i < id_vector.size());
|
||||
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_travel_mode > 0);
|
||||
@@ -559,9 +558,7 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
|
||||
// make sure to correctly unpack loops
|
||||
if (distance != forward_heap.GetKey(middle) + reverse_heap.GetKey(middle))
|
||||
{
|
||||
// self loop
|
||||
BOOST_ASSERT(forward_heap.GetData(middle).parent == middle &&
|
||||
reverse_heap.GetData(middle).parent == middle);
|
||||
// self loop makes up the full path
|
||||
packed_leg.push_back(middle);
|
||||
packed_leg.push_back(middle);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ class ShortestPathRouting final
|
||||
|
||||
raw_route_data.shortest_path_length = shortest_path_length;
|
||||
|
||||
for (const auto current_leg : util::irange<std::size_t>(0, packed_leg_begin.size() - 1))
|
||||
for (const auto current_leg : util::irange<std::size_t>(0UL, packed_leg_begin.size() - 1))
|
||||
{
|
||||
auto leg_begin = total_packed_path.begin() + packed_leg_begin[current_leg];
|
||||
auto leg_end = total_packed_path.begin() + packed_leg_begin[current_leg + 1];
|
||||
@@ -245,10 +245,10 @@ class ShortestPathRouting final
|
||||
}
|
||||
|
||||
void operator()(const std::vector<PhantomNodes> &phantom_nodes_vector,
|
||||
const boost::optional<bool> uturns,
|
||||
const boost::optional<bool> continue_straight_at_waypoint,
|
||||
InternalRouteResult &raw_route_data) const
|
||||
{
|
||||
const bool allow_u_turn_at_via = uturns ? *uturns : super::facade->GetUTurnsDefault();
|
||||
const bool allow_uturn_at_waypoint = !(continue_straight_at_waypoint ? *continue_straight_at_waypoint : super::facade->GetContinueStraightDefault());
|
||||
|
||||
engine_working_data.InitializeOrClearFirstThreadLocalStorage(
|
||||
super::facade->GetNumberOfNodes());
|
||||
@@ -299,7 +299,7 @@ class ShortestPathRouting final
|
||||
|
||||
if (search_to_reverse_node || search_to_forward_node)
|
||||
{
|
||||
if (allow_u_turn_at_via)
|
||||
if (allow_uturn_at_waypoint)
|
||||
{
|
||||
SearchWithUTurn(forward_heap, reverse_heap, forward_core_heap,
|
||||
reverse_core_heap, search_from_forward_node,
|
||||
@@ -309,7 +309,7 @@ class ShortestPathRouting final
|
||||
new_total_distance_to_forward, packed_leg_to_forward);
|
||||
// if only the reverse node is valid (e.g. when using the match plugin) we
|
||||
// actually need to move
|
||||
if (target_phantom.forward_segment_id.enabled)
|
||||
if (!target_phantom.forward_segment_id.enabled)
|
||||
{
|
||||
BOOST_ASSERT(target_phantom.reverse_segment_id.enabled);
|
||||
new_total_distance_to_reverse = new_total_distance_to_forward;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace extractor
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
const bool constexpr INVERT = true;
|
||||
|
||||
// what angle is interpreted as going straight
|
||||
const double constexpr STRAIGHT_ANGLE = 180.;
|
||||
// if a turn deviates this much from going straight, it will be kept straight
|
||||
const double constexpr MAXIMAL_ALLOWED_NO_TURN_DEVIATION = 3.;
|
||||
// angle that lies between two nearly indistinguishable roads
|
||||
const double constexpr NARROW_TURN_ANGLE = 40.;
|
||||
const double constexpr GROUP_ANGLE = 90;
|
||||
// angle difference that can be classified as straight, if its the only narrow turn
|
||||
const double constexpr FUZZY_ANGLE_DIFFERENCE = 15.;
|
||||
const double constexpr DISTINCTION_RATIO = 2;
|
||||
const unsigned constexpr INVALID_NAME_ID = 0;
|
||||
|
||||
const double constexpr MAX_ROUNDABOUT_RADIUS = 15; // 30 m diameter as final distinction
|
||||
const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace extractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
|
||||
@@ -0,0 +1,66 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "util/typedefs.hpp" // EdgeID
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace extractor
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
// Every Turn Operation describes a way of switching onto a segment, indicated by an EdgeID. The
|
||||
// associated turn is described by an angle and an instruction that is used to announce it.
|
||||
// The Turn Operation indicates what is exposed to the outside of the turn analysis.
|
||||
struct TurnOperation final
|
||||
{
|
||||
EdgeID eid;
|
||||
double angle;
|
||||
TurnInstruction instruction;
|
||||
};
|
||||
|
||||
// A Connected Road is the internal representation of a potential turn. Internally, we require
|
||||
// full list of all connected roads to determine the outcome.
|
||||
// The reasoning behind is that even invalid turns can influence the perceived angles, or even
|
||||
// instructions themselves. An pososible example can be described like this:
|
||||
//
|
||||
// aaa(2)aa
|
||||
// a - bbbbb
|
||||
// aaa(1)aa
|
||||
//
|
||||
// will not be perceived as a turn from (1) -> b, and as a U-turn from (1) -> (2).
|
||||
// In addition, they can influence whether a turn is obvious or not. b->(2) would also be no
|
||||
// turn-operation,
|
||||
// but rather a name change.
|
||||
//
|
||||
// If this were a normal intersection with
|
||||
//
|
||||
// cccccccc
|
||||
// o bbbbb
|
||||
// aaaaaaaa
|
||||
//
|
||||
// We would perceive a->c as a sharp turn, a->b as a slight turn, and b->c as a slight turn.
|
||||
struct ConnectedRoad final
|
||||
{
|
||||
ConnectedRoad(const TurnOperation turn, const bool entry_allowed = false);
|
||||
|
||||
// a turn may be relevant to good instructions, even if we cannot enter the road
|
||||
bool entry_allowed;
|
||||
TurnOperation turn;
|
||||
};
|
||||
|
||||
// small helper function to print the content of a connected road
|
||||
std::string toString(const ConnectedRoad &road);
|
||||
|
||||
typedef std::vector<ConnectedRoad> Intersection;
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace extractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_*/
|
||||
@@ -0,0 +1,68 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_GENERATOR_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_GENERATOR_HPP_
|
||||
|
||||
#include "extractor/compressed_edge_container.hpp"
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
#include "extractor/restriction_map.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace extractor
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
// The Intersection Generator is given a turn location and generates an intersection representation
|
||||
// from it. For this all turn possibilities are analysed.
|
||||
// We consider turn restrictions to indicate possible turns. U-turns are generated based on profile
|
||||
// decisions.
|
||||
|
||||
class IntersectionGenerator
|
||||
{
|
||||
public:
|
||||
IntersectionGenerator(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const RestrictionMap &restriction_map,
|
||||
const std::unordered_set<NodeID> &barrier_nodes,
|
||||
const std::vector<QueryNode> &node_info_list,
|
||||
const CompressedEdgeContainer &compressed_edge_container);
|
||||
|
||||
Intersection operator()(const NodeID nid, const EdgeID via_eid) const;
|
||||
|
||||
private:
|
||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||
const RestrictionMap &restriction_map;
|
||||
const std::unordered_set<NodeID> &barrier_nodes;
|
||||
const std::vector<QueryNode> &node_info_list;
|
||||
const CompressedEdgeContainer &compressed_edge_container;
|
||||
|
||||
// Check for restrictions/barriers and generate a list of valid and invalid turns present at
|
||||
// the
|
||||
// node reached
|
||||
// from `from_node` via `via_eid`
|
||||
// The resulting candidates have to be analysed for their actual instructions later on.
|
||||
Intersection getConnectedRoads(const NodeID from_node, const EdgeID via_eid) const;
|
||||
|
||||
// Merge segregated roads to omit invalid turns in favor of treating segregated roads as
|
||||
// one.
|
||||
// This function combines roads the following way:
|
||||
//
|
||||
// * *
|
||||
// * is converted to *
|
||||
// v ^ +
|
||||
// v ^ +
|
||||
//
|
||||
// The treatment results in a straight turn angle of 180º rather than a turn angle of approx
|
||||
// 160
|
||||
Intersection mergeSegregatedRoads(Intersection intersection) const;
|
||||
};
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace extractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_GENERATOR_HPP_ */
|
||||
@@ -0,0 +1,71 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_
|
||||
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "util/name_table.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace extractor
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
// Intersection handlers deal with all issues related to intersections.
|
||||
// They assign appropriate turn operations to the TurnOperations.
|
||||
// This base class provides both the interface and implementations for
|
||||
// common functions.
|
||||
class IntersectionHandler
|
||||
{
|
||||
public:
|
||||
IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const std::vector<QueryNode> &node_info_list,
|
||||
const util::NameTable &name_table);
|
||||
virtual ~IntersectionHandler();
|
||||
|
||||
// check whether the handler can actually handle the intersection
|
||||
virtual bool
|
||||
canProcess(const NodeID nid, const EdgeID via_eid, const Intersection &intersection) const = 0;
|
||||
|
||||
// process the intersection
|
||||
virtual Intersection
|
||||
operator()(const NodeID nid, const EdgeID via_eid, Intersection intersection) const = 0;
|
||||
|
||||
protected:
|
||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||
const std::vector<QueryNode> &node_info_list;
|
||||
const util::NameTable &name_table;
|
||||
|
||||
// counts the number on allowed entry roads
|
||||
std::size_t countValid(const Intersection &intersection) const;
|
||||
|
||||
// Decide on a basic turn types
|
||||
TurnType findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
|
||||
|
||||
// Get the Instruction for an obvious turn
|
||||
TurnInstruction getInstructionForObvious(const std::size_t number_of_candidates,
|
||||
const EdgeID via_edge,
|
||||
const bool through_street,
|
||||
const ConnectedRoad &candidate) const;
|
||||
|
||||
// Treating potential forks
|
||||
void assignFork(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
|
||||
void assignFork(const EdgeID via_edge,
|
||||
ConnectedRoad &left,
|
||||
ConnectedRoad ¢er,
|
||||
ConnectedRoad &right) const;
|
||||
|
||||
bool isThroughStreet(const std::size_t index, const Intersection &intersection) const;
|
||||
};
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace extractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_*/
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_
|
||||
|
||||
#include "extractor/guidance/intersection_handler.hpp"
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "util/name_table.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace extractor
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
// Intersection handlers deal with all issues related to intersections.
|
||||
// They assign appropriate turn operations to the TurnOperations.
|
||||
class MotorwayHandler : public IntersectionHandler
|
||||
{
|
||||
public:
|
||||
MotorwayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const std::vector<QueryNode> &node_info_list,
|
||||
const util::NameTable &name_table);
|
||||
~MotorwayHandler() override final;
|
||||
|
||||
// check whether the handler can actually handle the intersection
|
||||
bool canProcess(const NodeID nid,
|
||||
const EdgeID via_eid,
|
||||
const Intersection &intersection) const override final;
|
||||
|
||||
// process the intersection
|
||||
Intersection operator()(const NodeID nid,
|
||||
const EdgeID via_eid,
|
||||
Intersection intersection) const override final;
|
||||
|
||||
private:
|
||||
Intersection fromMotorway(const EdgeID via_edge, Intersection intersection) const;
|
||||
Intersection fromRamp(const EdgeID via_edge, Intersection intersection) const;
|
||||
|
||||
Intersection fallback(Intersection intersection) const;
|
||||
};
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace extractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_*/
|
||||
@@ -0,0 +1,71 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
|
||||
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/guidance/intersection_handler.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "util/name_table.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace extractor
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
struct RoundaboutFlags
|
||||
{
|
||||
bool on_roundabout;
|
||||
bool can_enter;
|
||||
bool can_exit_separately;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
// The roundabout handler processes all roundabout related instructions.
|
||||
// It performs both the distinction between rotaries and roundabouts and
|
||||
// assigns appropriate entry/exit instructions.
|
||||
class RoundaboutHandler : public IntersectionHandler
|
||||
{
|
||||
public:
|
||||
RoundaboutHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const std::vector<QueryNode> &node_info_list,
|
||||
const util::NameTable &name_table);
|
||||
|
||||
~RoundaboutHandler() override final;
|
||||
|
||||
// check whether the handler can actually handle the intersection
|
||||
bool canProcess(const NodeID from_nid, const EdgeID via_eid, const Intersection &intersection) const override final;
|
||||
|
||||
// process the intersection
|
||||
Intersection operator()(const NodeID from_nid, const EdgeID via_eid, Intersection intersection) const override final;
|
||||
|
||||
private:
|
||||
detail::RoundaboutFlags getRoundaboutFlags(const NodeID from_nid, const EdgeID via_eid, const Intersection &intersection) const;
|
||||
|
||||
// decide whether we lookk at a roundabout or a rotary
|
||||
bool isRotary(const NodeID nid) const;
|
||||
|
||||
// TODO handle bike/walk cases that allow crossing a roundabout!
|
||||
// Processing of roundabouts
|
||||
// Produces instructions to enter/exit a roundabout or to stay on it.
|
||||
// Performs the distinction between roundabout and rotaries.
|
||||
Intersection handleRoundabouts(const bool is_rotary,
|
||||
const EdgeID via_edge,
|
||||
const bool on_roundabout,
|
||||
const bool can_exit_roundabout,
|
||||
Intersection intersection) const;
|
||||
};
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace extractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_*/
|
||||
@@ -8,14 +8,14 @@
|
||||
#include "extractor/compressed_edge_container.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "extractor/guidance/discrete_angle.hpp"
|
||||
#include "extractor/guidance/classification_data.hpp"
|
||||
#include "extractor/guidance/discrete_angle.hpp"
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
@@ -42,22 +42,21 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
const util::Coordinate final_coordinate,
|
||||
const std::vector<extractor::QueryNode> &query_nodes)
|
||||
{
|
||||
const auto extractCoordinateFromNode = [](const extractor::QueryNode &node) -> util::Coordinate
|
||||
{
|
||||
const auto extractCoordinateFromNode =
|
||||
[](const extractor::QueryNode &node) -> util::Coordinate {
|
||||
return {node.lon, node.lat};
|
||||
};
|
||||
double distance_to_current_coordinate = 0;
|
||||
double distance_to_next_coordinate = 0;
|
||||
|
||||
// get the length that is missing from the current segment to reach DESIRED_SEGMENT_LENGTH
|
||||
const auto getFactor = [](const double first_distance, const double second_distance)
|
||||
{
|
||||
const auto getFactor = [](const double first_distance, const double second_distance) {
|
||||
BOOST_ASSERT(first_distance < detail::DESIRED_SEGMENT_LENGTH);
|
||||
double segment_length = second_distance - first_distance;
|
||||
BOOST_ASSERT(segment_length > 0);
|
||||
BOOST_ASSERT(second_distance >= detail::DESIRED_SEGMENT_LENGTH);
|
||||
double missing_distance = detail::DESIRED_SEGMENT_LENGTH - first_distance;
|
||||
return missing_distance / segment_length;
|
||||
return std::max(0., std::min(missing_distance / segment_length, 1.0));
|
||||
};
|
||||
|
||||
for (auto compressed_geometry_itr = compressed_geometry_begin;
|
||||
@@ -85,7 +84,8 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
util::coordinate_calculation::haversineDistance(current_coordinate, final_coordinate);
|
||||
|
||||
// reached point where coordinates switch between
|
||||
if (distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
|
||||
if (distance_to_current_coordinate < detail::DESIRED_SEGMENT_LENGTH &&
|
||||
distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
|
||||
return util::coordinate_calculation::interpolateLinear(
|
||||
getFactor(distance_to_current_coordinate, distance_to_next_coordinate),
|
||||
current_coordinate, final_coordinate);
|
||||
@@ -104,8 +104,8 @@ getRepresentativeCoordinate(const NodeID from_node,
|
||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||
const std::vector<extractor::QueryNode> &query_nodes)
|
||||
{
|
||||
const auto extractCoordinateFromNode = [](const extractor::QueryNode &node) -> util::Coordinate
|
||||
{
|
||||
const auto extractCoordinateFromNode =
|
||||
[](const extractor::QueryNode &node) -> util::Coordinate {
|
||||
return {node.lon, node.lat};
|
||||
};
|
||||
|
||||
@@ -298,14 +298,10 @@ inline DirectionModifier getTurnDirection(const double angle)
|
||||
// swaps left <-> right modifier types
|
||||
inline DirectionModifier mirrorDirectionModifier(const DirectionModifier modifier)
|
||||
{
|
||||
const constexpr DirectionModifier results[] = {DirectionModifier::UTurn,
|
||||
DirectionModifier::SharpLeft,
|
||||
DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft,
|
||||
DirectionModifier::Straight,
|
||||
DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right,
|
||||
DirectionModifier::SharpRight};
|
||||
const constexpr DirectionModifier results[] = {
|
||||
DirectionModifier::UTurn, DirectionModifier::SharpLeft, DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft, DirectionModifier::Straight, DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right, DirectionModifier::SharpRight};
|
||||
return results[modifier];
|
||||
}
|
||||
|
||||
@@ -345,13 +341,14 @@ inline bool requiresNameAnnounced(const std::string &from, const std::string &to
|
||||
std::string to_ref;
|
||||
|
||||
// Split from the format "{name} ({ref})" -> name, ref
|
||||
auto split = [](const std::string &name, std::string &out_name, std::string &out_ref)
|
||||
{
|
||||
auto split = [](const std::string &name, std::string &out_name, std::string &out_ref) {
|
||||
const auto ref_begin = name.find_first_of('(');
|
||||
if (ref_begin != std::string::npos)
|
||||
{
|
||||
out_name = name.substr(0, ref_begin);
|
||||
out_ref = name.substr(ref_begin + 1, name.find_first_of(')') - 1);
|
||||
if (ref_begin != 0)
|
||||
out_name = name.substr(0, ref_begin - 1);
|
||||
const auto ref_end = name.find_first_of(')');
|
||||
out_ref = name.substr(ref_begin + 1, ref_end - ref_begin - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -363,35 +360,38 @@ inline bool requiresNameAnnounced(const std::string &from, const std::string &to
|
||||
split(to, to_name, to_ref);
|
||||
|
||||
// check similarity of names
|
||||
auto names_are_empty = from_name.empty() && to_name.empty();
|
||||
auto names_are_equal = from_name == to_name;
|
||||
auto name_is_removed = !from_name.empty() && to_name.empty();
|
||||
const auto names_are_empty = from_name.empty() && to_name.empty();
|
||||
const auto names_are_equal = from_name == to_name;
|
||||
const auto name_is_removed = !from_name.empty() && to_name.empty();
|
||||
// references are contained in one another
|
||||
auto refs_are_empty = from_ref.empty() && to_ref.empty();
|
||||
auto ref_is_contained =
|
||||
!from_ref.empty() && !to_ref.empty() &&
|
||||
const auto refs_are_empty = from_ref.empty() && to_ref.empty();
|
||||
const auto ref_is_contained =
|
||||
from_ref.empty() || to_ref.empty() ||
|
||||
(from_ref.find(to_ref) != std::string::npos || to_ref.find(from_ref) != std::string::npos);
|
||||
auto ref_is_removed = !from_ref.empty() && to_ref.empty();
|
||||
const auto ref_is_removed = !from_ref.empty() && to_ref.empty();
|
||||
|
||||
auto obvious_change = ref_is_contained || names_are_equal ||
|
||||
(names_are_empty && refs_are_empty) || name_is_removed || ref_is_removed;
|
||||
const auto obvious_change =
|
||||
(names_are_empty && refs_are_empty) || (names_are_equal && ref_is_contained) ||
|
||||
(names_are_equal && refs_are_empty) || name_is_removed || ref_is_removed;
|
||||
|
||||
return !obvious_change;
|
||||
}
|
||||
|
||||
inline int getPriority( const FunctionalRoadClass road_class )
|
||||
inline int getPriority(const FunctionalRoadClass road_class)
|
||||
{
|
||||
//The road priorities indicate which roads can bee seen as more or less equal.
|
||||
//They are used in Fork-Discovery. Possibly should be moved to profiles post v5?
|
||||
//A fork can happen between road types that are at most 1 priority apart from each other
|
||||
const constexpr int road_priority[] = {10, 0, 10, 2, 10, 4, 10, 6, 10, 8, 10, 11, 10, 12, 10, 14};
|
||||
// The road priorities indicate which roads can bee seen as more or less equal.
|
||||
// They are used in Fork-Discovery. Possibly should be moved to profiles post v5?
|
||||
// A fork can happen between road types that are at most 1 priority apart from each other
|
||||
const constexpr int road_priority[] = {10, 0, 10, 2, 10, 4, 10, 6,
|
||||
10, 8, 10, 11, 10, 12, 10, 14};
|
||||
return road_priority[static_cast<int>(road_class)];
|
||||
}
|
||||
|
||||
inline bool canBeSeenAsFork(const FunctionalRoadClass first, const FunctionalRoadClass second)
|
||||
{
|
||||
// forks require similar road categories
|
||||
// Based on the priorities assigned above, we can set forks only if the road priorities match closely.
|
||||
// Based on the priorities assigned above, we can set forks only if the road priorities match
|
||||
// closely.
|
||||
// Potentially we could include features like number of lanes here and others?
|
||||
// Should also be moved to profiles
|
||||
return std::abs(getPriority(first) - getPriority(second)) <= 1;
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
#ifndef OSRM_EXTRACTOR_TURN_ANALYSIS
|
||||
#define OSRM_EXTRACTOR_TURN_ANALYSIS
|
||||
|
||||
#include "extractor/guidance/turn_classification.hpp"
|
||||
#include "extractor/guidance/toolkit.hpp"
|
||||
#include "extractor/restriction_map.hpp"
|
||||
#include "extractor/compressed_edge_container.hpp"
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/guidance/intersection_generator.hpp"
|
||||
#include "extractor/guidance/toolkit.hpp"
|
||||
#include "extractor/guidance/turn_classification.hpp"
|
||||
#include "extractor/guidance/roundabout_handler.hpp"
|
||||
#include "extractor/guidance/motorway_handler.hpp"
|
||||
#include "extractor/guidance/turn_handler.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
#include "extractor/restriction_map.hpp"
|
||||
|
||||
#include "util/name_table.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -23,46 +30,6 @@ namespace extractor
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
// What is exposed to the outside
|
||||
struct TurnOperation final
|
||||
{
|
||||
EdgeID eid;
|
||||
double angle;
|
||||
TurnInstruction instruction;
|
||||
};
|
||||
|
||||
// For the turn analysis, we require a full list of all connected roads to determine the outcome.
|
||||
// Invalid turns can influence the perceived angles
|
||||
//
|
||||
// aaa(2)aa
|
||||
// a - bbbbb
|
||||
// aaa(1)aa
|
||||
//
|
||||
// will not be perceived as a turn from (1) -> b, and as a U-turn from (1) -> (2).
|
||||
// In addition, they can influence whether a turn is obvious or not.
|
||||
struct ConnectedRoad final
|
||||
{
|
||||
ConnectedRoad(const TurnOperation turn, const bool entry_allowed = false);
|
||||
|
||||
TurnOperation turn;
|
||||
bool entry_allowed; // a turn may be relevant to good instructions, even if we cannot take
|
||||
// the road
|
||||
|
||||
std::string toString() const
|
||||
{
|
||||
std::string result = "[connection] ";
|
||||
result += std::to_string(turn.eid);
|
||||
result += " allows entry: ";
|
||||
result += std::to_string(entry_allowed);
|
||||
result += " angle: ";
|
||||
result += std::to_string(turn.angle);
|
||||
result += " instruction: ";
|
||||
result += std::to_string(static_cast<std::int32_t>(turn.instruction.type)) + " " +
|
||||
std::to_string(static_cast<std::int32_t>(turn.instruction.direction_modifier));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
class TurnAnalysis
|
||||
{
|
||||
|
||||
@@ -79,120 +46,14 @@ class TurnAnalysis
|
||||
|
||||
private:
|
||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||
const std::vector<QueryNode> &node_info_list;
|
||||
const RestrictionMap &restriction_map;
|
||||
const std::unordered_set<NodeID> &barrier_nodes;
|
||||
const CompressedEdgeContainer &compressed_edge_container;
|
||||
const util::NameTable &name_table;
|
||||
|
||||
// Check for restrictions/barriers and generate a list of valid and invalid turns present at
|
||||
// the
|
||||
// node reached
|
||||
// from `from_node` via `via_eid`
|
||||
// The resulting candidates have to be analysed for their actual instructions later on.
|
||||
std::vector<ConnectedRoad> getConnectedRoads(const NodeID from_node,
|
||||
const EdgeID via_eid) const;
|
||||
|
||||
// Merge segregated roads to omit invalid turns in favor of treating segregated roads as
|
||||
// one.
|
||||
// This function combines roads the following way:
|
||||
//
|
||||
// * *
|
||||
// * is converted to *
|
||||
// v ^ +
|
||||
// v ^ +
|
||||
//
|
||||
// The treatment results in a straight turn angle of 180º rather than a turn angle of approx
|
||||
// 160
|
||||
std::vector<ConnectedRoad> mergeSegregatedRoads(std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// TODO distinguish roundabouts and rotaries
|
||||
// TODO handle bike/walk cases that allow crossing a roundabout!
|
||||
|
||||
// Processing of roundabouts
|
||||
// Produces instructions to enter/exit a roundabout or to stay on it.
|
||||
// Performs the distinction between roundabout and rotaries.
|
||||
std::vector<ConnectedRoad> handleRoundabouts(const EdgeID via_edge,
|
||||
const bool on_roundabout,
|
||||
const bool can_exit_roundabout,
|
||||
std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// Indicates a Junction containing a motoryway
|
||||
bool isMotorwayJunction(const EdgeID via_edge,
|
||||
const std::vector<ConnectedRoad> &intersection) const;
|
||||
|
||||
// Decide whether a turn is a turn or a ramp access
|
||||
TurnType findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
|
||||
|
||||
// Get the Instruction for an obvious turn
|
||||
// Instruction will be a silent instruction
|
||||
TurnInstruction getInstructionForObvious(const std::size_t number_of_candidates,
|
||||
const EdgeID via_edge,
|
||||
const ConnectedRoad &candidate) const;
|
||||
|
||||
// Helper Function that decides between NoTurn or NewName
|
||||
TurnInstruction
|
||||
noTurnOrNewName(const NodeID from, const EdgeID via_edge, const ConnectedRoad &candidate) const;
|
||||
|
||||
// Basic Turn Handling
|
||||
|
||||
// Dead end.
|
||||
std::vector<ConnectedRoad> handleOneWayTurn(std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// Mode Changes, new names...
|
||||
std::vector<ConnectedRoad> handleTwoWayTurn(const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// Forks, T intersections and similar
|
||||
std::vector<ConnectedRoad> handleThreeWayTurn(const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// Handling of turns larger then degree three
|
||||
std::vector<ConnectedRoad> handleComplexTurn(const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// Any Junction containing motorways
|
||||
std::vector<ConnectedRoad> handleMotorwayJunction(
|
||||
const EdgeID via_edge, std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
std::vector<ConnectedRoad> handleFromMotorway(const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
std::vector<ConnectedRoad> handleMotorwayRamp(const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection) const;
|
||||
const IntersectionGenerator intersection_generator;
|
||||
const RoundaboutHandler roundabout_handler;
|
||||
const MotorwayHandler motorway_handler;
|
||||
const TurnHandler turn_handler;
|
||||
|
||||
// Utility function, setting basic turn types. Prepares for normal turn handling.
|
||||
std::vector<ConnectedRoad> setTurnTypes(const NodeID from,
|
||||
const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// Assignment of specific turn types
|
||||
void assignFork(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
|
||||
void assignFork(const EdgeID via_edge,
|
||||
ConnectedRoad &left,
|
||||
ConnectedRoad ¢er,
|
||||
ConnectedRoad &right) const;
|
||||
|
||||
void
|
||||
handleDistinctConflict(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
|
||||
|
||||
// Type specific fallbacks
|
||||
std::vector<ConnectedRoad>
|
||||
fallbackTurnAssignmentMotorway(std::vector<ConnectedRoad> intersection) const;
|
||||
|
||||
// Classification
|
||||
std::size_t findObviousTurn(const EdgeID via_edge,
|
||||
const std::vector<ConnectedRoad> &intersection) const;
|
||||
std::pair<std::size_t, std::size_t>
|
||||
findFork(const std::vector<ConnectedRoad> &intersection) const;
|
||||
|
||||
std::vector<ConnectedRoad> assignLeftTurns(const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection,
|
||||
const std::size_t starting_at) const;
|
||||
std::vector<ConnectedRoad> assignRightTurns(const EdgeID via_edge,
|
||||
std::vector<ConnectedRoad> intersection,
|
||||
const std::size_t up_to) const;
|
||||
|
||||
Intersection
|
||||
setTurnTypes(const NodeID from, const EdgeID via_edge, Intersection intersection) const;
|
||||
}; // class TurnAnalysis
|
||||
|
||||
} // namespace guidance
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_TURN_HANDLER_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_TURN_HANDLER_HPP_
|
||||
|
||||
#include "extractor/guidance/intersection_handler.hpp"
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "util/name_table.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace extractor
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
// Intersection handlers deal with all issues related to intersections.
|
||||
// They assign appropriate turn operations to the TurnOperations.
|
||||
class TurnHandler : public IntersectionHandler
|
||||
{
|
||||
public:
|
||||
TurnHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const std::vector<QueryNode> &node_info_list,
|
||||
const util::NameTable &name_table);
|
||||
~TurnHandler() override final;
|
||||
|
||||
// check whether the handler can actually handle the intersection
|
||||
bool canProcess(const NodeID nid,
|
||||
const EdgeID via_eid,
|
||||
const Intersection &intersection) const override final;
|
||||
|
||||
// process the intersection
|
||||
Intersection operator()(const NodeID nid,
|
||||
const EdgeID via_eid,
|
||||
Intersection intersection) const override final;
|
||||
|
||||
private:
|
||||
// Dead end.
|
||||
Intersection handleOneWayTurn(Intersection intersection) const;
|
||||
|
||||
// Mode Changes, new names...
|
||||
Intersection handleTwoWayTurn(const EdgeID via_edge, Intersection intersection) const;
|
||||
|
||||
// Forks, T intersections and similar
|
||||
Intersection handleThreeWayTurn(const EdgeID via_edge, Intersection intersection) const;
|
||||
|
||||
// Handling of turns larger then degree three
|
||||
Intersection handleComplexTurn(const EdgeID via_edge, Intersection intersection) const;
|
||||
|
||||
void
|
||||
handleDistinctConflict(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
|
||||
|
||||
// Classification
|
||||
std::size_t findObviousTurn(const EdgeID via_edge, const Intersection &intersection) const;
|
||||
std::pair<std::size_t, std::size_t> findFork(const Intersection &intersection) const;
|
||||
|
||||
Intersection assignLeftTurns(const EdgeID via_edge,
|
||||
Intersection intersection,
|
||||
const std::size_t starting_at) const;
|
||||
Intersection assignRightTurns(const EdgeID via_edge,
|
||||
Intersection intersection,
|
||||
const std::size_t up_to) const;
|
||||
};
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace extractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_TURN_HANDLER_HPP_*/
|
||||
@@ -89,24 +89,32 @@ struct TurnInstruction
|
||||
return TurnInstruction(TurnType::NoTurn, DirectionModifier::UTurn);
|
||||
}
|
||||
|
||||
static TurnInstruction REMAIN_ROUNDABOUT(const DirectionModifier modifier)
|
||||
static TurnInstruction REMAIN_ROUNDABOUT(bool is_rotary, const DirectionModifier modifier)
|
||||
{
|
||||
(void)is_rotary; // staying does not require a different instruction at the moment
|
||||
return TurnInstruction(TurnType::StayOnRoundabout, modifier);
|
||||
}
|
||||
|
||||
static TurnInstruction ENTER_ROUNDABOUT(const DirectionModifier modifier)
|
||||
static TurnInstruction ENTER_ROUNDABOUT(bool is_rotary, const DirectionModifier modifier)
|
||||
{
|
||||
return TurnInstruction(TurnType::EnterRoundabout, modifier);
|
||||
return {is_rotary ? TurnType::EnterRotary : TurnType::EnterRoundabout, modifier};
|
||||
}
|
||||
|
||||
static TurnInstruction EXIT_ROUNDABOUT(const DirectionModifier modifier)
|
||||
static TurnInstruction EXIT_ROUNDABOUT(bool is_rotary, const DirectionModifier modifier)
|
||||
{
|
||||
return TurnInstruction(TurnType::ExitRoundabout, modifier);
|
||||
return {is_rotary ? TurnType::ExitRotary : TurnType::ExitRoundabout, modifier};
|
||||
}
|
||||
|
||||
static TurnInstruction ENTER_AND_EXIT_ROUNDABOUT(bool is_rotary,
|
||||
const DirectionModifier modifier)
|
||||
{
|
||||
return {is_rotary ? TurnType::EnterAndExitRotary : TurnType::EnterAndExitRoundabout,
|
||||
modifier};
|
||||
}
|
||||
|
||||
static TurnInstruction SUPPRESSED(const DirectionModifier modifier)
|
||||
{
|
||||
return TurnInstruction{TurnType::Suppressed, modifier};
|
||||
return {TurnType::Suppressed, modifier};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace extractor
|
||||
struct ProfileProperties
|
||||
{
|
||||
ProfileProperties()
|
||||
: traffic_signal_penalty(0), u_turn_penalty(0), allow_u_turn_at_via(false), use_turn_restrictions(false)
|
||||
: traffic_signal_penalty(0), u_turn_penalty(0), continue_straight_at_waypoint(true), use_turn_restrictions(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ struct ProfileProperties
|
||||
int traffic_signal_penalty;
|
||||
//! penalty to do a uturn in deci-seconds
|
||||
int u_turn_penalty;
|
||||
bool allow_u_turn_at_via;
|
||||
bool continue_straight_at_waypoint;
|
||||
bool use_turn_restrictions;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace osrm
|
||||
namespace extractor
|
||||
{
|
||||
|
||||
class ProfileProperties;
|
||||
struct ProfileProperties;
|
||||
|
||||
/**
|
||||
* Parses the relations that represents turn restrictions.
|
||||
|
||||
@@ -46,7 +46,6 @@ const constexpr osrm::extractor::TravelMode TRAVEL_MODE_WALKING = 3;
|
||||
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_FERRY = 4;
|
||||
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_TRAIN = 5;
|
||||
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_PUSHING_BIKE = 6;
|
||||
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_MOVABLE_BRIDGE = 7;
|
||||
// FIXME only for testbot.lua
|
||||
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_STEPS_UP = 8;
|
||||
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_STEPS_DOWN = 9;
|
||||
|
||||
@@ -3,22 +3,15 @@
|
||||
|
||||
#include "engine/api/base_parameters.hpp"
|
||||
|
||||
#include "engine/polyline_compressor.hpp"
|
||||
#include "engine/hint.hpp"
|
||||
#include "engine/bearing.hpp"
|
||||
#include "engine/hint.hpp"
|
||||
#include "engine/polyline_compressor.hpp"
|
||||
|
||||
#include <boost/spirit/include/qi_lit.hpp>
|
||||
#include <boost/spirit/include/qi_char_.hpp>
|
||||
#include <boost/spirit/include/qi_int.hpp>
|
||||
#include <boost/spirit/include/qi_real.hpp>
|
||||
#include <boost/spirit/include/qi_grammar.hpp>
|
||||
#include <boost/spirit/include/qi_action.hpp>
|
||||
#include <boost/spirit/include/qi_optional.hpp>
|
||||
#include <boost/spirit/include/qi_attr_cast.hpp>
|
||||
#include <boost/spirit/include/qi_operator.hpp>
|
||||
#include <boost/spirit/include/qi_repeat.hpp>
|
||||
#include <boost/spirit/include/qi_as_string.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
@@ -29,60 +22,99 @@ namespace api
|
||||
{
|
||||
|
||||
namespace qi = boost::spirit::qi;
|
||||
|
||||
template <typename T, char... Fmt> struct no_trailing_dot_policy : qi::real_policies<T>
|
||||
{
|
||||
template <typename Iterator> static bool parse_dot(Iterator &first, Iterator const &last)
|
||||
{
|
||||
if (first == last || *first != '.')
|
||||
return false;
|
||||
|
||||
static const constexpr char fmt[sizeof...(Fmt)] = {Fmt...};
|
||||
|
||||
if (first + sizeof(fmt) < last && std::equal(fmt, fmt + sizeof(fmt), first + 1u))
|
||||
return false;
|
||||
|
||||
++first;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename Iterator> static bool parse_exp(Iterator &, const Iterator &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename Iterator, typename Attribute>
|
||||
static bool parse_exp_n(Iterator &, const Iterator &, Attribute &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename Iterator, typename Attribute>
|
||||
static bool parse_nan(Iterator &, const Iterator &, Attribute &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename Iterator, typename Attribute>
|
||||
static bool parse_inf(Iterator &, const Iterator &, Attribute &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
struct BaseParametersGrammar : boost::spirit::qi::grammar<std::string::iterator>
|
||||
{
|
||||
using Iterator = std::string::iterator;
|
||||
using RadiusesT = std::vector<boost::optional<double>>;
|
||||
using json_policy = no_trailing_dot_policy<double, 'j', 's', 'o', 'n'>;
|
||||
|
||||
BaseParametersGrammar(qi::rule<Iterator> &root_rule_, engine::api::BaseParameters ¶meters_)
|
||||
: BaseParametersGrammar::base_type(root_rule_), base_parameters(parameters_)
|
||||
{
|
||||
const auto add_bearing =
|
||||
[this](boost::optional<boost::fusion::vector2<short, short>> bearing_range)
|
||||
{
|
||||
boost::optional<engine::Bearing> bearing;
|
||||
if (bearing_range)
|
||||
{
|
||||
bearing = engine::Bearing{boost::fusion::at_c<0>(*bearing_range),
|
||||
boost::fusion::at_c<1>(*bearing_range)};
|
||||
}
|
||||
base_parameters.bearings.push_back(std::move(bearing));
|
||||
};
|
||||
const auto set_radiuses = [this](RadiusesT &radiuses)
|
||||
{
|
||||
[this](boost::optional<boost::fusion::vector2<short, short>> bearing_range) {
|
||||
boost::optional<engine::Bearing> bearing;
|
||||
if (bearing_range)
|
||||
{
|
||||
bearing = engine::Bearing{boost::fusion::at_c<0>(*bearing_range),
|
||||
boost::fusion::at_c<1>(*bearing_range)};
|
||||
}
|
||||
base_parameters.bearings.push_back(std::move(bearing));
|
||||
};
|
||||
const auto set_radiuses = [this](RadiusesT radiuses) {
|
||||
base_parameters.radiuses = std::move(radiuses);
|
||||
};
|
||||
const auto add_hint = [this](const std::string &hint_string)
|
||||
{
|
||||
const auto add_hint = [this](const std::string &hint_string) {
|
||||
if (hint_string.size() > 0)
|
||||
{
|
||||
base_parameters.hints.push_back(engine::Hint::FromBase64(hint_string));
|
||||
}
|
||||
};
|
||||
const auto add_coordinate = [this](const boost::fusion::vector<double, double> &lonLat)
|
||||
{
|
||||
const auto add_coordinate = [this](const boost::fusion::vector<double, double> &lonLat) {
|
||||
base_parameters.coordinates.emplace_back(util::Coordinate(
|
||||
util::FixedLongitude(boost::fusion::at_c<0>(lonLat) * COORDINATE_PRECISION),
|
||||
util::FixedLatitude(boost::fusion::at_c<1>(lonLat) * COORDINATE_PRECISION)));
|
||||
};
|
||||
const auto polyline_to_coordinates = [this](const std::string &polyline)
|
||||
{
|
||||
const auto polyline_to_coordinates = [this](const std::string &polyline) {
|
||||
base_parameters.coordinates = engine::decodePolyline(polyline);
|
||||
};
|
||||
|
||||
alpha_numeral = +qi::char_("a-zA-Z0-9");
|
||||
polyline_chars = qi::char_("a-zA-Z0-9_.--[]{}@?|\\%~`^");
|
||||
base64_char = qi::char_("a-zA-Z0-9--_");
|
||||
base64_char = qi::char_("a-zA-Z0-9--_=");
|
||||
|
||||
radiuses_rule = qi::lit("radiuses=") >> -qi::double_ % ";";
|
||||
unlimited.add("unlimited", std::numeric_limits<double>::infinity());
|
||||
|
||||
radiuses_rule = qi::lit("radiuses=") > -(unlimited | qi::double_) % ";";
|
||||
hints_rule =
|
||||
qi::lit("hints=") >>
|
||||
qi::lit("hints=") >
|
||||
qi::as_string[qi::repeat(engine::ENCODED_HINT_SIZE)[base64_char]][add_hint] % ";";
|
||||
bearings_rule =
|
||||
qi::lit("bearings=") >> (-(qi::short_ >> ',' >> qi::short_))[add_bearing] % ";";
|
||||
polyline_rule = qi::as_string[qi::lit("polyline(") >> +polyline_chars >>
|
||||
qi::lit(")")][polyline_to_coordinates];
|
||||
location_rule = (qi::double_ >> qi::lit(',') >> qi::double_)[add_coordinate];
|
||||
qi::lit("bearings=") > (-(qi::short_ > ',' > qi::short_))[add_bearing] % ";";
|
||||
polyline_rule = qi::as_string[qi::lit("polyline(") > +polyline_chars > qi::lit(")")]
|
||||
[polyline_to_coordinates];
|
||||
location_rule = (double_ > qi::lit(',') > double_)[add_coordinate];
|
||||
query_rule = (location_rule % ';') | polyline_rule;
|
||||
|
||||
base_rule = bearings_rule | radiuses_rule[set_radiuses] | hints_rule;
|
||||
@@ -97,9 +129,11 @@ struct BaseParametersGrammar : boost::spirit::qi::grammar<std::string::iterator>
|
||||
qi::rule<Iterator> bearings_rule;
|
||||
qi::rule<Iterator> hints_rule;
|
||||
qi::rule<Iterator> polyline_rule, location_rule;
|
||||
qi::symbols<char, double> unlimited;
|
||||
qi::rule<Iterator, RadiusesT()> radiuses_rule;
|
||||
qi::rule<Iterator, unsigned char()> base64_char;
|
||||
qi::rule<Iterator, std::string()> alpha_numeral, polyline_chars;
|
||||
qi::real_parser<double, json_policy> double_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,10 @@
|
||||
#define MATCH_PARAMETERS_GRAMMAR_HPP
|
||||
|
||||
#include "engine/api/match_parameters.hpp"
|
||||
|
||||
#include "server/api/base_parameters_grammar.hpp"
|
||||
|
||||
#include <boost/spirit/include/qi_lit.hpp>
|
||||
#include <boost/spirit/include/qi_uint.hpp>
|
||||
#include <boost/spirit/include/qi_bool.hpp>
|
||||
#include <boost/spirit/include/qi_grammar.hpp>
|
||||
#include <boost/spirit/include/qi_action.hpp>
|
||||
#include <boost/spirit/include/qi_optional.hpp>
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -31,47 +26,38 @@ struct MatchParametersGrammar final : public BaseParametersGrammar
|
||||
|
||||
MatchParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
|
||||
{
|
||||
const auto set_geojson_type = [this]()
|
||||
{
|
||||
const auto set_geojson_type = [this] {
|
||||
parameters.geometries = engine::api::RouteParameters::GeometriesType::GeoJSON;
|
||||
};
|
||||
const auto set_polyline_type = [this]()
|
||||
{
|
||||
const auto set_polyline_type = [this] {
|
||||
parameters.geometries = engine::api::RouteParameters::GeometriesType::Polyline;
|
||||
};
|
||||
|
||||
const auto set_simplified_type = [this]()
|
||||
{
|
||||
const auto set_simplified_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::Simplified;
|
||||
};
|
||||
const auto set_full_type = [this]()
|
||||
{
|
||||
const auto set_full_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::Full;
|
||||
};
|
||||
const auto set_false_type = [this]()
|
||||
{
|
||||
const auto set_false_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::False;
|
||||
};
|
||||
const auto set_steps = [this](const StepsT steps)
|
||||
{
|
||||
parameters.steps = steps;
|
||||
};
|
||||
const auto set_timestamps = [this](TimestampsT ×tamps)
|
||||
{
|
||||
const auto set_steps = [this](const StepsT steps) { parameters.steps = steps; };
|
||||
const auto set_timestamps = [this](TimestampsT timestamps) {
|
||||
parameters.timestamps = std::move(timestamps);
|
||||
};
|
||||
|
||||
steps_rule = qi::lit("steps=") >> qi::bool_;
|
||||
steps_rule = qi::lit("steps=") > qi::bool_;
|
||||
geometries_rule = qi::lit("geometries=geojson")[set_geojson_type] |
|
||||
qi::lit("geometries=polyline")[set_polyline_type];
|
||||
overview_rule = qi::lit("overview=simplified")[set_simplified_type] |
|
||||
qi::lit("overview=full")[set_full_type] |
|
||||
qi::lit("overview=false")[set_false_type];
|
||||
timestamps_rule = qi::lit("timestamps=") >> qi::uint_ % ";";
|
||||
timestamps_rule = qi::lit("timestamps=") > qi::uint_ % ";";
|
||||
match_rule = steps_rule[set_steps] | geometries_rule | overview_rule |
|
||||
timestamps_rule[set_timestamps];
|
||||
root_rule =
|
||||
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (match_rule | base_rule) % '&');
|
||||
query_rule > -qi::lit(".json") > -(qi::lit("?") > (match_rule | base_rule) % '&');
|
||||
}
|
||||
|
||||
engine::api::MatchParameters parameters;
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
#define NEAREST_PARAMETERS_GRAMMAR_HPP
|
||||
|
||||
#include "engine/api/nearest_parameters.hpp"
|
||||
|
||||
#include "server/api/base_parameters_grammar.hpp"
|
||||
|
||||
#include <boost/spirit/include/qi_lit.hpp>
|
||||
#include <boost/spirit/include/qi_uint.hpp>
|
||||
#include <boost/spirit/include/qi_grammar.hpp>
|
||||
#include <boost/spirit/include/qi_action.hpp>
|
||||
#include <boost/spirit/include/qi_optional.hpp>
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -26,13 +22,12 @@ struct NearestParametersGrammar final : public BaseParametersGrammar
|
||||
|
||||
NearestParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
|
||||
{
|
||||
const auto set_number = [this](const unsigned number)
|
||||
{
|
||||
const auto set_number = [this](const unsigned number) {
|
||||
parameters.number_of_results = number;
|
||||
};
|
||||
nearest_rule = (qi::lit("number=") >> qi::uint_)[set_number];
|
||||
nearest_rule = (qi::lit("number=") > qi::uint_)[set_number];
|
||||
root_rule =
|
||||
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (nearest_rule | base_rule) % '&');
|
||||
query_rule > -qi::lit(".json") > -(qi::lit("?") > (nearest_rule | base_rule) % '&');
|
||||
}
|
||||
|
||||
engine::api::NearestParameters parameters;
|
||||
|
||||
@@ -30,7 +30,7 @@ using is_parameter_t =
|
||||
// Starts parsing and iter and modifies it until iter == end or parsing failed
|
||||
template <typename ParameterT,
|
||||
typename std::enable_if<detail::is_parameter_t<ParameterT>::value, int>::type = 0>
|
||||
boost::optional<ParameterT> parseParameters(std::string::iterator &iter, std::string::iterator end);
|
||||
boost::optional<ParameterT> parseParameters(std::string::iterator &iter, const std::string::iterator end);
|
||||
|
||||
// Copy on purpose because we need mutability
|
||||
template <typename ParameterT,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "util/coordinate.hpp"
|
||||
|
||||
#include <boost/fusion/include/adapt_struct.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -13,15 +15,23 @@ namespace server
|
||||
namespace api
|
||||
{
|
||||
|
||||
struct ParsedURL
|
||||
struct ParsedURL final
|
||||
{
|
||||
std::string service;
|
||||
unsigned version;
|
||||
std::string profile;
|
||||
std::string query;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // api
|
||||
} // server
|
||||
} // osrm
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT(osrm::server::api::ParsedURL,
|
||||
(std::string, service)
|
||||
(unsigned, version)
|
||||
(std::string, profile)
|
||||
(std::string, query)
|
||||
)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
#define ROUTE_PARAMETERS_GRAMMAR_HPP
|
||||
|
||||
#include "engine/api/route_parameters.hpp"
|
||||
|
||||
#include "server/api/base_parameters_grammar.hpp"
|
||||
|
||||
#include <boost/spirit/include/qi_lit.hpp>
|
||||
#include <boost/spirit/include/qi_bool.hpp>
|
||||
#include <boost/spirit/include/qi_grammar.hpp>
|
||||
#include <boost/spirit/include/qi_action.hpp>
|
||||
#include <boost/spirit/include/qi_optional.hpp>
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -31,53 +27,41 @@ struct RouteParametersGrammar : public BaseParametersGrammar
|
||||
|
||||
RouteParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
|
||||
{
|
||||
const auto set_geojson_type = [this]()
|
||||
{
|
||||
const auto set_geojson_type = [this] {
|
||||
parameters.geometries = engine::api::RouteParameters::GeometriesType::GeoJSON;
|
||||
};
|
||||
const auto set_polyline_type = [this]()
|
||||
{
|
||||
const auto set_polyline_type = [this] {
|
||||
parameters.geometries = engine::api::RouteParameters::GeometriesType::Polyline;
|
||||
};
|
||||
|
||||
const auto set_simplified_type = [this]()
|
||||
{
|
||||
const auto set_simplified_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::Simplified;
|
||||
};
|
||||
const auto set_full_type = [this]()
|
||||
{
|
||||
const auto set_full_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::Full;
|
||||
};
|
||||
const auto set_false_type = [this]()
|
||||
{
|
||||
const auto set_false_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::False;
|
||||
};
|
||||
const auto set_steps = [this](const StepsT steps)
|
||||
{
|
||||
parameters.steps = steps;
|
||||
};
|
||||
const auto set_alternatives = [this](const AlternativeT alternatives)
|
||||
{
|
||||
const auto set_steps = [this](const StepsT steps) { parameters.steps = steps; };
|
||||
const auto set_alternatives = [this](const AlternativeT alternatives) {
|
||||
parameters.alternatives = alternatives;
|
||||
};
|
||||
const auto set_uturns = [this](UturnsT &uturns)
|
||||
{
|
||||
parameters.uturns = std::move(uturns);
|
||||
};
|
||||
const auto set_continue_straight = [this](UturnsT continue_straight) { parameters.continue_straight = std::move(continue_straight); };
|
||||
|
||||
alternatives_rule = qi::lit("alternatives=") >> qi::bool_;
|
||||
steps_rule = qi::lit("steps=") >> qi::bool_;
|
||||
alternatives_rule = qi::lit("alternatives=") > qi::bool_;
|
||||
steps_rule = qi::lit("steps=") > qi::bool_;
|
||||
geometries_rule = qi::lit("geometries=geojson")[set_geojson_type] |
|
||||
qi::lit("geometries=polyline")[set_polyline_type];
|
||||
overview_rule = qi::lit("overview=simplified")[set_simplified_type] |
|
||||
qi::lit("overview=full")[set_full_type] |
|
||||
qi::lit("overview=false")[set_false_type];
|
||||
uturns_rule = qi::lit("uturns=default") | (qi::lit("uturns=") >> qi::bool_)[set_uturns];
|
||||
continue_straight_rule = qi::lit("continue_straight=default") | (qi::lit("continue_straight=") > qi::bool_)[set_continue_straight];
|
||||
route_rule = steps_rule[set_steps] | alternatives_rule[set_alternatives] | geometries_rule |
|
||||
overview_rule | uturns_rule;
|
||||
overview_rule | continue_straight_rule;
|
||||
|
||||
root_rule =
|
||||
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (route_rule | base_rule) % '&');
|
||||
query_rule > -qi::lit(".json") > -(qi::lit("?") > (route_rule | base_rule) % '&');
|
||||
}
|
||||
|
||||
engine::api::RouteParameters parameters;
|
||||
@@ -85,7 +69,7 @@ struct RouteParametersGrammar : public BaseParametersGrammar
|
||||
private:
|
||||
qi::rule<Iterator> root_rule;
|
||||
qi::rule<Iterator> route_rule, geometries_rule, overview_rule;
|
||||
qi::rule<Iterator, UturnsT()> uturns_rule;
|
||||
qi::rule<Iterator, UturnsT()> continue_straight_rule;
|
||||
qi::rule<Iterator, StepsT()> steps_rule;
|
||||
qi::rule<Iterator, AlternativeT()> alternatives_rule;
|
||||
};
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
#define TABLE_PARAMETERS_GRAMMAR_HPP
|
||||
|
||||
#include "engine/api/table_parameters.hpp"
|
||||
|
||||
#include "server/api/base_parameters_grammar.hpp"
|
||||
|
||||
#include <boost/spirit/include/qi_lit.hpp>
|
||||
#include <boost/spirit/include/qi_uint.hpp>
|
||||
#include <boost/spirit/include/qi_grammar.hpp>
|
||||
#include <boost/spirit/include/qi_action.hpp>
|
||||
#include <boost/spirit/include/qi_optional.hpp>
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -28,22 +24,24 @@ struct TableParametersGrammar final : public BaseParametersGrammar
|
||||
|
||||
TableParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
|
||||
{
|
||||
const auto set_destiantions = [this](DestinationsT &dests)
|
||||
{
|
||||
const auto set_destiantions = [this](DestinationsT dests) {
|
||||
parameters.destinations = std::move(dests);
|
||||
};
|
||||
const auto set_sources = [this](SourcesT &sources)
|
||||
{
|
||||
const auto set_sources = [this](SourcesT sources) {
|
||||
parameters.sources = std::move(sources);
|
||||
};
|
||||
destinations_rule = (qi::lit("destinations=") >> (qi::ulong_ % ";")[set_destiantions]) |
|
||||
qi::lit("destinations=all");
|
||||
sources_rule =
|
||||
(qi::lit("sources=") >> (qi::ulong_ % ";")[set_sources]) | qi::lit("sources=all");
|
||||
// TODO: ulonglong -> size_t not only on Windows but on all 32 bit platforms; unsupported anyway as of now
|
||||
#ifdef WIN32
|
||||
destinations_rule = qi::lit("destinations=all") | (qi::lit("destinations=") > (qi::ulong_long % ";")[set_destiantions]);
|
||||
sources_rule = qi::lit("sources=all") | (qi::lit("sources=") > (qi::ulong_long % ";")[set_sources]);
|
||||
#else
|
||||
destinations_rule = qi::lit("destinations=all") | (qi::lit("destinations=") > (qi::ulong_ % ";")[set_destiantions]);
|
||||
sources_rule = qi::lit("sources=all") | (qi::lit("sources=") > (qi::ulong_ % ";")[set_sources]);
|
||||
#endif
|
||||
table_rule = destinations_rule | sources_rule;
|
||||
|
||||
root_rule =
|
||||
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (table_rule | base_rule) % '&');
|
||||
query_rule > -qi::lit(".json") > -(qi::lit("?") > (table_rule | base_rule) % '&');
|
||||
}
|
||||
|
||||
engine::api::TableParameters parameters;
|
||||
|
||||
@@ -3,14 +3,11 @@
|
||||
|
||||
#include "engine/api/tile_parameters.hpp"
|
||||
|
||||
#include "engine/polyline_compressor.hpp"
|
||||
#include "engine/hint.hpp"
|
||||
#include "engine/polyline_compressor.hpp"
|
||||
|
||||
#include <boost/spirit/include/qi_lit.hpp>
|
||||
#include <boost/spirit/include/qi_uint.hpp>
|
||||
#include <boost/spirit/include/qi_grammar.hpp>
|
||||
#include <boost/spirit/include/qi_action.hpp>
|
||||
#include <boost/spirit/include/qi_operator.hpp>
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -28,23 +25,15 @@ struct TileParametersGrammar final : boost::spirit::qi::grammar<std::string::ite
|
||||
|
||||
TileParametersGrammar() : TileParametersGrammar::base_type(root_rule)
|
||||
{
|
||||
const auto set_x = [this](const unsigned x_)
|
||||
{
|
||||
parameters.x = x_;
|
||||
};
|
||||
const auto set_y = [this](const unsigned y_)
|
||||
{
|
||||
parameters.y = y_;
|
||||
};
|
||||
const auto set_z = [this](const unsigned z_)
|
||||
{
|
||||
parameters.z = z_;
|
||||
};
|
||||
const auto set_x = [this](const unsigned x_) { parameters.x = x_; };
|
||||
const auto set_y = [this](const unsigned y_) { parameters.y = y_; };
|
||||
const auto set_z = [this](const unsigned z_) { parameters.z = z_; };
|
||||
|
||||
query_rule = qi::lit("tile(") >> qi::uint_[set_x] >> qi::lit(",") >> qi::uint_[set_y] >>
|
||||
qi::lit(",") >> qi::uint_[set_z] >> qi::lit(")");
|
||||
query_rule = qi::lit("tile(") > qi::uint_[set_x] //
|
||||
> qi::lit(",") > qi::uint_[set_y] > //
|
||||
qi::lit(",") > qi::uint_[set_z] > qi::lit(")"); //
|
||||
|
||||
root_rule = query_rule >> qi::lit(".mvt");
|
||||
root_rule = query_rule > qi::lit(".mvt");
|
||||
}
|
||||
engine::api::TileParameters parameters;
|
||||
|
||||
|
||||
@@ -2,15 +2,10 @@
|
||||
#define TRIP_PARAMETERS_GRAMMAR_HPP
|
||||
|
||||
#include "engine/api/trip_parameters.hpp"
|
||||
|
||||
#include "server/api/base_parameters_grammar.hpp"
|
||||
|
||||
#include <boost/spirit/include/qi_lit.hpp>
|
||||
#include <boost/spirit/include/qi_uint.hpp>
|
||||
#include <boost/spirit/include/qi_bool.hpp>
|
||||
#include <boost/spirit/include/qi_grammar.hpp>
|
||||
#include <boost/spirit/include/qi_action.hpp>
|
||||
#include <boost/spirit/include/qi_optional.hpp>
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -30,33 +25,25 @@ struct TripParametersGrammar final : public BaseParametersGrammar
|
||||
|
||||
TripParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
|
||||
{
|
||||
const auto set_geojson_type = [this]()
|
||||
{
|
||||
const auto set_geojson_type = [this] {
|
||||
parameters.geometries = engine::api::RouteParameters::GeometriesType::GeoJSON;
|
||||
};
|
||||
const auto set_polyline_type = [this]()
|
||||
{
|
||||
const auto set_polyline_type = [this] {
|
||||
parameters.geometries = engine::api::RouteParameters::GeometriesType::Polyline;
|
||||
};
|
||||
|
||||
const auto set_simplified_type = [this]()
|
||||
{
|
||||
const auto set_simplified_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::Simplified;
|
||||
};
|
||||
const auto set_full_type = [this]()
|
||||
{
|
||||
const auto set_full_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::Full;
|
||||
};
|
||||
const auto set_false_type = [this]()
|
||||
{
|
||||
const auto set_false_type = [this] {
|
||||
parameters.overview = engine::api::RouteParameters::OverviewType::False;
|
||||
};
|
||||
const auto set_steps = [this](const StepsT steps)
|
||||
{
|
||||
parameters.steps = steps;
|
||||
};
|
||||
const auto set_steps = [this](const StepsT steps) { parameters.steps = steps; };
|
||||
|
||||
steps_rule = qi::lit("steps=") >> qi::bool_;
|
||||
steps_rule = qi::lit("steps=") > qi::bool_;
|
||||
geometries_rule = qi::lit("geometries=geojson")[set_geojson_type] |
|
||||
qi::lit("geometries=polyline")[set_polyline_type];
|
||||
overview_rule = qi::lit("overview=simplified")[set_simplified_type] |
|
||||
@@ -65,7 +52,7 @@ struct TripParametersGrammar final : public BaseParametersGrammar
|
||||
trip_rule = steps_rule[set_steps] | geometries_rule | overview_rule;
|
||||
|
||||
root_rule =
|
||||
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (trip_rule | base_rule) % '&');
|
||||
query_rule > -qi::lit(".json") > -(qi::lit("?") > (trip_rule | base_rule) % '&');
|
||||
}
|
||||
|
||||
engine::api::TripParameters parameters;
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace api
|
||||
{
|
||||
|
||||
// Starts parsing and iter and modifies it until iter == end or parsing failed
|
||||
boost::optional<ParsedURL> parseURL(std::string::iterator &iter, std::string::iterator end);
|
||||
// copy on purpose because we need mutability
|
||||
boost::optional<ParsedURL> parseURL(std::string::iterator &iter, const std::string::iterator end);
|
||||
|
||||
inline boost::optional<ParsedURL> parseURL(std::string url_string)
|
||||
{
|
||||
auto iter = url_string.begin();
|
||||
|
||||
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2016, Project OSRM contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list
|
||||
of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef STORAGE_HPP
|
||||
#define STORAGE_HPP
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user