Compare commits
226 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c9227d4d0 | |||
| ef66e271c1 | |||
| 7c3b587028 | |||
| d399014633 | |||
| e27ce0e518 | |||
| 1a1e16c5b4 | |||
| 01e7232add | |||
| c69f99f282 | |||
| 391163cba0 | |||
| 4cddec298f | |||
| c306a59854 | |||
| dcc1b5ab2b | |||
| 938dff011f | |||
| 9123c93a90 | |||
| a551286a8f | |||
| 86fd04e556 | |||
| b6dbf81206 | |||
| af47252efe | |||
| 3b81b39998 | |||
| 802b93fa9a | |||
| 7899444135 | |||
| 1ab2b87cc0 | |||
| 97c66c6c82 | |||
| 733207d4a1 | |||
| a0ed70f0a2 | |||
| d3a6b5a77e | |||
| 7a523713c7 | |||
| f7265892ed | |||
| be266c7c2b | |||
| b1b41435b6 | |||
| 8f32a80778 | |||
| 5d79e0ac2f | |||
| 47a6cd5462 | |||
| 7528b27f99 | |||
| a4f9499305 | |||
| bb244e28bb | |||
| 6fac14dbd8 | |||
| 8b144f22c9 | |||
| 146eb3a20e | |||
| d8e444e620 | |||
| da9d63a384 | |||
| c5e85f3d6d | |||
| e05750547c | |||
| 315823cce1 | |||
| 6ff07f4e82 | |||
| 41b54cf25d | |||
| 5ee15ee339 | |||
| 01b0bce2d5 | |||
| cb57ccacef | |||
| 7e0d14b113 | |||
| d06eec5e42 | |||
| 9648821a79 | |||
| 21fb18fe5e | |||
| 6a2518c0df | |||
| 7886d06839 | |||
| 5a9eb6ef72 | |||
| b6c3d1d5bf | |||
| 9b2f6585fb | |||
| 46fd17a9ff | |||
| da73bae9c6 | |||
| 766e2713ab | |||
| 9957254a5a | |||
| 9f6859561c | |||
| 88573a66cd | |||
| 3ccbe9842c | |||
| 5971822f82 | |||
| cdf6baba1d | |||
| 4b7ddb6826 | |||
| 06b74c1f08 | |||
| 3a0eed2ee5 | |||
| 2557bdcf39 | |||
| 12d478784b | |||
| 38fef77d70 | |||
| e8bae78749 | |||
| e14bc30428 | |||
| 9485c97738 | |||
| 11aed6c93e | |||
| d53c267129 | |||
| 2f6de614c1 | |||
| 087080a6c3 | |||
| 41b22916f3 | |||
| 89f1071947 | |||
| 464de785cb | |||
| 8986777c58 | |||
| 65def1a9e2 | |||
| 176c2244ad | |||
| b161e10b73 | |||
| 5bef5dcb04 | |||
| 46a4c27582 | |||
| acc6da86de | |||
| 4d84bc0f01 | |||
| c737635a3b | |||
| b7eeafb183 | |||
| 677306eeee | |||
| 2284ebaacb | |||
| 6b4975b2e4 | |||
| 94c38d115a | |||
| b1e309b4eb | |||
| e8ce119972 | |||
| 8b7cd2931b | |||
| 8bee57b0b0 | |||
| 6bfe3a2d41 | |||
| 7f71f0ed12 | |||
| 583aaff286 | |||
| b24f5c7c1a | |||
| 026f71934b | |||
| 1353d55880 | |||
| b09f637d02 | |||
| 979f9cab20 | |||
| eb6083daf5 | |||
| c4718495a0 | |||
| 0d36d472c9 | |||
| 35422a0fb5 | |||
| d012b44b7f | |||
| eda6d9dc7c | |||
| 63c86198a3 | |||
| 33bdfe9cf9 | |||
| a87c5998a1 | |||
| c918a7957b | |||
| 61e6afdef0 | |||
| 95dc36e908 | |||
| 951a4dc112 | |||
| c09b9b4c99 | |||
| b0873e2aa4 | |||
| 2bdb8fce63 | |||
| d8a692740a | |||
| 14797c421e | |||
| 280b000f07 | |||
| fb4834458e | |||
| c7a1576100 | |||
| aebf6fa0b1 | |||
| f76e3d4522 | |||
| eaf42ba437 | |||
| e83905b783 | |||
| 0b868969be | |||
| b4710633b1 | |||
| 7d076e9344 | |||
| 71d64e8cd9 | |||
| 748fd3efa9 | |||
| 1fc63e1e72 | |||
| fd6bb5ec1f | |||
| 261dbf3edd | |||
| 9e323d2d42 | |||
| 1309dd2a0f | |||
| 9b737230d6 | |||
| ecbd709535 | |||
| 060ec99678 | |||
| 3601d1d262 | |||
| 41ba20ca9a | |||
| 57e3f173d3 | |||
| 92c298c7cf | |||
| b25011ee60 | |||
| 0e017a6ce5 | |||
| 2431e15ffa | |||
| 396add1e9d | |||
| 86241a2793 | |||
| ee47afbe17 | |||
| 8831ca2f32 | |||
| abde215bc3 | |||
| 130d5298fc | |||
| 50cbba1620 | |||
| 2cc293ad16 | |||
| 6ac65a922f | |||
| 3d80f989d0 | |||
| 4fcb5d28a4 | |||
| 3ebdacf369 | |||
| 2ddc00c21e | |||
| e76e39a398 | |||
| 04667f1ed8 | |||
| 2091c3443b | |||
| 2b466b2fb2 | |||
| e17b306265 | |||
| b00b15ab98 | |||
| f4db79fe9b | |||
| 0e4061f858 | |||
| 043a1446e1 | |||
| 49221995e8 | |||
| 247a7488b8 | |||
| 1806198971 | |||
| 375331b80c | |||
| 8fdbe965cc | |||
| dc77d02e8a | |||
| 6265b8fa77 | |||
| 311b348d09 | |||
| ec02cdc4cc | |||
| 5905708111 | |||
| 5d91b759d1 | |||
| ec0a1a4ab1 | |||
| efa29edf09 | |||
| 2a05b70dfc | |||
| 8693e68271 | |||
| d21a9a514d | |||
| e03d132823 | |||
| 61ba985bc9 | |||
| 4629a20fe4 | |||
| a28125ee9a | |||
| df877aca1b | |||
| 05dc415aba | |||
| 6dedd9cb72 | |||
| 256d39b572 | |||
| d186ae1863 | |||
| fddc19e98d | |||
| 2592cd2e58 | |||
| 93b6438cea | |||
| f6746d88b7 | |||
| 34ace4dd4b | |||
| 41d0f42ddf | |||
| 2868f702a5 | |||
| ec4dcee8bd | |||
| 8c378191df | |||
| b98431e8e6 | |||
| 3c8781855e | |||
| 27a94f3ca6 | |||
| 04e334e3e2 | |||
| 12d4832037 | |||
| 6e4f6fec91 | |||
| 57c9525e5c | |||
| 543e4fb57d | |||
| 3881ead8e5 | |||
| 911d1e81b6 | |||
| ae06300c17 | |||
| 26879ca91a | |||
| 306744e5cb | |||
| 3ca32898a1 | |||
| 532fda267f | |||
| 494845b160 |
+1
-1
@@ -46,7 +46,7 @@ DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IncludeCategories:
|
||||
IncludeCategories:
|
||||
- Regex: '^<'
|
||||
Priority: 3
|
||||
- Regex: '^"(osrm|util|engine|extract|contract)/'
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Issue
|
||||
|
||||
What issue is this PR targeting? Is there no issue that covers the problem addressed here? Please open a corresponding issue and link it from here.
|
||||
|
||||
## Tasklist
|
||||
- [ ] ADD OWN TASKS HERE
|
||||
- [ ] add regression / cucumber cases (see docs/testing.md)
|
||||
- [ ] review
|
||||
- [ ] adjust for for comments
|
||||
|
||||
## Requirements / Relations
|
||||
Link any requirements here. Other pull requests this PR is based on?
|
||||
+10
-20
@@ -13,7 +13,7 @@ notifications:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- "5.2"
|
||||
- 5.4
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
@@ -25,6 +25,7 @@ env:
|
||||
global:
|
||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||
- CCACHE_COMPRESS=1
|
||||
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
||||
- JOBS=4
|
||||
|
||||
matrix:
|
||||
@@ -42,14 +43,6 @@ matrix:
|
||||
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', 'ccache']
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-4.8-debug"
|
||||
addons: &gcc48
|
||||
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', 'ccache']
|
||||
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Debug'
|
||||
|
||||
- os: linux
|
||||
compiler: "clang-3.8-debug"
|
||||
addons: &clang38
|
||||
@@ -72,14 +65,9 @@ matrix:
|
||||
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', 'ccache']
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||
|
||||
# Disabled because of CI slowness
|
||||
#- os: linux
|
||||
#- compiler: gcc
|
||||
#- addons: &gcc48
|
||||
#- 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: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Release'
|
||||
- os: linux
|
||||
compiler: "gcc-5-release-i686"
|
||||
env: TARGET_ARCH='i686' CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||
|
||||
# Disabled because of CI slowness
|
||||
#- os: linux
|
||||
@@ -115,19 +103,20 @@ matrix:
|
||||
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
before_install:
|
||||
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
|
||||
- if [[ $(uname -s) == 'Darwin' ]]; then sudo mdutil -i off /; fi;
|
||||
- source ./scripts/install_node.sh 4
|
||||
- npm install
|
||||
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
||||
- export PATH=${DEPS_DIR}/bin:${PATH} && mkdir -p ${DEPS_DIR}
|
||||
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/3.5.2.tar.gz"
|
||||
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}
|
||||
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR} || exit 1
|
||||
- |
|
||||
if [[ ${CLANG_VERSION:-false} != false ]]; then
|
||||
export CCOMPILER='clang'
|
||||
export CXXCOMPILER='clang++'
|
||||
CLANG_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/clang/${CLANG_VERSION}.tar.gz"
|
||||
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}
|
||||
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR} || exit 1
|
||||
fi
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
@@ -142,7 +131,7 @@ install:
|
||||
fi
|
||||
- mkdir build && pushd build
|
||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=ON
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=ON -DENABLE_CCACHE=ON
|
||||
- echo "travis_fold:start:MAKE"
|
||||
- make osrm-extract --jobs=3
|
||||
- make --jobs=${JOBS}
|
||||
@@ -162,6 +151,7 @@ install:
|
||||
- popd
|
||||
|
||||
script:
|
||||
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
||||
- echo "travis_fold:start:BENCHMARK"
|
||||
- make -C test/data benchmark
|
||||
- echo "travis_fold:end:BENCHMARK"
|
||||
|
||||
+101
-2
@@ -1,9 +1,108 @@
|
||||
# 5.4.0
|
||||
Changes from 5.3.0
|
||||
- Profiles
|
||||
- includes library guidance.lua that offers preliminary configuration on guidance.
|
||||
- added left_hand_driving flag in global profile properties
|
||||
- modified turn penalty function for car profile - better fit to real data
|
||||
- return `ref` and `name` as separate fields. Do no use ref or destination as fallback for name value
|
||||
- Guidance
|
||||
- Handle Access tags for lanes, only considering valid lanes in lane-guidance (think car | car | bike | car)
|
||||
- API:
|
||||
- `annotations=true` now returns the data source id for each segment as `datasources`
|
||||
- Reduced semantic of merge to refer only to merges from a lane onto a motorway-like road
|
||||
- new `ref` field in the `RouteStep` object. It contains the reference code or name of a way. Previously merged into the `name` property like `name (ref)` and are now separate fields.
|
||||
- Bugfixes
|
||||
- Fixed an issue that would result in segfaults for viaroutes with an invalid intermediate segment when u-turns were allowed at the via-location
|
||||
- Invalid only_* restrictions could result in loss of connectivity. As a fallback, we assume all turns allowed when the restriction is not valid
|
||||
- Fixed a bug that could result in an infinite loop when finding information about an upcoming intersection
|
||||
- Fixed a bug that led to not discovering if a road simply looses a considered prefix
|
||||
- BREAKING: Fixed a bug that could crash postprocessing of instructions on invalid roundabout taggings. This change requires reprocessing datasets with osrm-extract and osrm-contract
|
||||
- Fixed an issue that could emit `invalid` as instruction when ending on a sliproad after a traffic-light
|
||||
- Fixed an issue that would detect turning circles as sliproads
|
||||
- Fixed a bug where post-processing instructions (e.g. left + left -> uturn) could result in false pronunciations
|
||||
- Fixes a bug where a bearing range of zero would cause exhaustive graph traversals
|
||||
- Fixes a bug where certain looped geometries could cause an infinite loop during extraction
|
||||
- Infrastructure:
|
||||
- Adds a feature to limit results in nearest service with a default of 100 in `osrm-routed`
|
||||
|
||||
# 5.3.0
|
||||
Changes from 5.3.0-rc.3
|
||||
- Guidance
|
||||
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
||||
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
|
||||
- Bugfixes
|
||||
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
|
||||
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
|
||||
|
||||
Changes form 5.2.7
|
||||
- API
|
||||
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
|
||||
- Introduces `lanes` to the `Intersection` object. The lane data contains both the markings at the intersection and a flag indicating if they can be chosen for the next turn
|
||||
- Removed unused `-s` from `osrm-datastore`
|
||||
- Guidance
|
||||
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
||||
- Improved detection of obvious turns
|
||||
- Improved turn lane detection
|
||||
- Reduce the number of end-of-road instructions in obvious cases
|
||||
- Profile:
|
||||
- bicycle.lua: Surface speeds never increase the actual speed
|
||||
- Infrastructure
|
||||
- Add 32bit support
|
||||
- Add ARM NEON/VFP support
|
||||
- Fix Windows builds
|
||||
- Optimize speed file updates using mmap
|
||||
- Add option to disable LTO for older compilers
|
||||
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
|
||||
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
|
||||
- Bugfixes:
|
||||
- Fix devide by zero on updating speed data using osrm-contract
|
||||
|
||||
# 5.3.0 RC3
|
||||
Changes from 5.3.0-rc.2
|
||||
- Guidance
|
||||
- Improved detection of obvious turns
|
||||
- Improved turn lane detection
|
||||
- Bugfixes
|
||||
- Fix bug that didn't chose minimal weights on overlapping edges
|
||||
|
||||
# 5.3.0 RC2
|
||||
Changes from 5.3.0-rc.1
|
||||
- Bugfixes
|
||||
- Fixes invalid checks in the lane-extraction part of the car profile
|
||||
|
||||
# 5.3.0 RC1
|
||||
- API
|
||||
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
|
||||
- Introduces lanes to the route response. The lane data contains both the markings at the intersection and a flag indicating their involvement in the turn
|
||||
|
||||
- Infrastructure
|
||||
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
|
||||
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
|
||||
|
||||
# 5.2.5
|
||||
- Bugfixes
|
||||
- Fixes a segfault caused by incorrect trimming logic for very short steps.
|
||||
|
||||
# 5.2.4
|
||||
- Bugfixes:
|
||||
- Fixed in issue that arised on roundabouts in combination with intermediate intersections and sliproads
|
||||
|
||||
# 5.2.3
|
||||
- Bugfixes:
|
||||
- Fixed an issue with name changes in roundabouts that could result in crashes
|
||||
|
||||
# 5.2.2
|
||||
Changes from 5.2.1
|
||||
- Bugfixes:
|
||||
- Buffer overrun in tile plugin response handling
|
||||
|
||||
# 5.2.1
|
||||
Changes from 5.2.0
|
||||
Bugfixes:
|
||||
- Bugfixes:
|
||||
- Removed debug statement that was spamming the console
|
||||
|
||||
# 5.2.0
|
||||
Changes form 5.2.0 RC2
|
||||
Changes from 5.2.0 RC2
|
||||
- Bugfixes:
|
||||
- Fixed crash when loading shared memory caused by invalid OSM IDs segment size.
|
||||
- Various small instructions handling fixes
|
||||
|
||||
+45
-8
@@ -9,7 +9,7 @@ endif()
|
||||
|
||||
project(OSRM C CXX)
|
||||
set(OSRM_VERSION_MAJOR 5)
|
||||
set(OSRM_VERSION_MINOR 2)
|
||||
set(OSRM_VERSION_MINOR 4)
|
||||
set(OSRM_VERSION_PATCH 0)
|
||||
|
||||
# these two functions build up custom variables:
|
||||
@@ -39,7 +39,7 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(bitness 64)
|
||||
message(STATUS "Building on a 64 bit system")
|
||||
else()
|
||||
message(WARNING "Building on a 32 bit system is unsupported")
|
||||
message(STATUS "Building on a 32 bit system")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
@@ -53,6 +53,9 @@ option(BUILD_COMPONENTS "Build osrm-components" OFF)
|
||||
option(ENABLE_ASSERTIONS OFF)
|
||||
option(COVERAGE OFF)
|
||||
option(SANITIZER OFF)
|
||||
option(ENABLE_LTO "Use LTO if available" ON)
|
||||
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
@@ -114,11 +117,31 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_GOLD_LINKER)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
message(STATUS "Using GNU gold as linker.")
|
||||
|
||||
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
|
||||
string(REGEX REPLACE ".*\\(GNU Binutils[^\\)0-9]+([0-9]+\\.[0-9]+)[^\\)]*\\).*" "\\1" GOLD_BINUTILS_VERSION "${LD_VERSION}")
|
||||
if ("${GOLD_BINUTILS_VERSION}" VERSION_LESS "2.25")
|
||||
message(STATUS "Disabling gc-sections on gold binutils < 2.25, see: https://sourceware.org/bugzilla/show_bug.cgi?id=17639")
|
||||
set(LD_AVOID_GC_SECTIONS TRUE)
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "GNU gold linker isn't available.")
|
||||
set(ENABLE_GOLD_LINKER OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Release)
|
||||
message(STATUS "Configuring OSRM in release mode")
|
||||
# Check if LTO is available
|
||||
check_cxx_compiler_flag("-flto" LTO_AVAILABLE)
|
||||
if(LTO_AVAILABLE)
|
||||
if(ENABLE_LTO AND LTO_AVAILABLE)
|
||||
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
# GCC in addition allows parallelizing LTO
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
@@ -204,7 +227,7 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT
|
||||
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
|
||||
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
|
||||
message(STATUS "Setting linker optimizations")
|
||||
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||
if(NOT (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
|
||||
# Tell compiler to put every function in separate section, linker can then match sections and functions
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
|
||||
# Tell linker to do dead code and data eminination during link time discarding sections
|
||||
@@ -219,9 +242,9 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
|
||||
# Activate C++11
|
||||
# Activate C++1y
|
||||
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
||||
endif()
|
||||
|
||||
# Configuring other platform dependencies
|
||||
@@ -243,6 +266,7 @@ if(UNIX AND NOT APPLE)
|
||||
set(MAYBE_RT_LIBRARY rt)
|
||||
endif()
|
||||
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
||||
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
||||
find_package(Osmium REQUIRED COMPONENTS io)
|
||||
@@ -319,7 +343,7 @@ include_directories(SYSTEM ${OSRM_INCLUDE_PATHS})
|
||||
# Binaries
|
||||
target_link_libraries(osrm-datastore osrm_store ${Boost_LIBRARIES})
|
||||
target_link_libraries(osrm-extract osrm_extract ${Boost_LIBRARIES})
|
||||
target_link_libraries(osrm-contract osrm_contract ${Boost_LIBRARIES})
|
||||
target_link_libraries(osrm-contract ${Boost_LIBRARIES} ${TBB_LIBRARIES} osrm_contract)
|
||||
target_link_libraries(osrm-routed osrm ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
||||
|
||||
set(EXTRACTOR_LIBRARIES
|
||||
@@ -415,7 +439,7 @@ file(GLOB VariantGlob third_party/variant/*.hpp)
|
||||
file(GLOB LibraryGlob include/osrm/*.hpp)
|
||||
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
||||
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
|
||||
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp)
|
||||
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp)
|
||||
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
||||
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
||||
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
|
||||
@@ -497,3 +521,16 @@ add_custom_target(uninstall
|
||||
# Modular build system: each directory registered here provides its own CMakeLists.txt
|
||||
add_subdirectory(unit_tests)
|
||||
add_subdirectory(src/benchmarks)
|
||||
|
||||
if (ENABLE_FUZZING)
|
||||
# Requires libosrm being built with sanitizers; make configurable and default to ubsan
|
||||
set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing")
|
||||
set_property(CACHE FUZZ_SANITIZER PROPERTY STRINGS "undefined" "integer" "address" "memory" "thread" "leak")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
|
||||
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
|
||||
|
||||
add_subdirectory(fuzz)
|
||||
endif ()
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# User
|
||||
|
||||
Before you open a new issue, please search for older ones that cover the same issue.
|
||||
In general "me too" comments/issues are frowned upon.
|
||||
You can add a :+1: emoji to the issue if you want to express interest in this.
|
||||
|
||||
# Developer
|
||||
|
||||
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
||||
|
||||
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
||||
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
||||
|
||||
## Pull Request
|
||||
|
||||
Every pull-request that changes the API needs to update the docs in `docs/http.md` and add an entry to `CHANGELOG.md`.
|
||||
Breaking changes need to have a BREAKING prefix. See the [releasing documentation](docs/releasing.md) on how this affects the version.
|
||||
|
||||
Early feedback is also important.
|
||||
You will see that a lot of the PR have tags like `[not ready]` or `[wip]`.
|
||||
We like to open PRs as soon as we are starting to work on something to make it visible to the rest of the team.
|
||||
If your work is going in entirely the wrong direction, there is a good chance someone will pick up on this before it is too late.
|
||||
Everyone is encouraged to read PRs of other people and give feedback.
|
||||
|
||||
For every significant code change we require a pull request review before it is merged.
|
||||
If your pull request modifies the API this need to be signed of by a team discussion.
|
||||
This means you will need to find another member of the team with commit access and request a review of your pull request.
|
||||
|
||||
Once your pull request is reviewed you can merge it! If you don't have commit access, ping someone that has commit access.
|
||||
If you do have commit access there are in general two accepted styles to merging:
|
||||
|
||||
1. Make sure the branch is up to date with `master`. Run `git rebase master` to find out.
|
||||
2. Once that is ensured you can either:
|
||||
- Click the nice green merge button (for a non-fast-forward merge)
|
||||
- Merge by hand using a fast-forward merge
|
||||
|
||||
Which merge you prefer is up to personal preference. In general it is recommended to use fast-forward merges because it creates a history that is sequential and easier to understand.
|
||||
|
||||
# Maintainer
|
||||
|
||||
## Doing a release
|
||||
|
||||
There is an in-depth guide around how to push out a release once it is ready [here](docs/releasing.md).
|
||||
|
||||
## The API
|
||||
|
||||
Changes to the API need to be discussed and signed off by the team. Breaking changes even more so than additive changes.
|
||||
|
||||
## Milestones
|
||||
|
||||
If a pull request or an issue is applicable for the current or next milestone, depends on the target version number.
|
||||
Since we use semantic versioning we restrict breaking changes to major releases.
|
||||
After a Release Candidate is released we usually don't change the API anymore if it is not critical.
|
||||
Bigger code changes after a RC was released should also be avoided.
|
||||
|
||||
@@ -10,6 +10,11 @@ The Open Source Routing Machine is a high performance routing engine written in
|
||||
| Windows | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||
| Coverage | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
|
||||
## Contact
|
||||
|
||||
- IRC: server `irc.oftc.net`, channel: `#osrm` (see: `https://www.oftc.net`, and for a webchat: `https://webchat.oftc.net`)
|
||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||
|
||||
## Building
|
||||
|
||||
For instructions on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||
@@ -46,7 +51,7 @@ osrm-routed data.osrm
|
||||
Running a query on your local server:
|
||||
|
||||
```
|
||||
curl http://127.0.0.1:5000/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
```
|
||||
|
||||
### Running a request against the Demo Server
|
||||
@@ -56,7 +61,7 @@ First read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/w
|
||||
Then run simple query with instructions and alternatives on Berlin:
|
||||
|
||||
```
|
||||
curl https://router.project-osrm.org/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
```
|
||||
|
||||
## References in publications
|
||||
|
||||
+4
-13
@@ -1,18 +1,9 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y build-essential git-core python-pip python-software-properties software-properties-common
|
||||
|
||||
RUN apt-get -y install gcc-4.8 g++-4.8 libboost1.55-all-dev llvm-3.4
|
||||
RUN apt-get -y install libbz2-dev libstxxl-dev libstxxl1 libxml2-dev
|
||||
RUN apt-get -y install libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev
|
||||
RUN apt-get -y install curl cmake cmake-curses-gui
|
||||
|
||||
RUN pip install awscli
|
||||
|
||||
|
||||
# luabind
|
||||
RUN curl https://gist.githubusercontent.com/DennisOSRM/f2eb7b948e6fe1ae319e/raw/install-luabind.sh | sudo bash
|
||||
RUN apt-get update -y && apt-get install -y software-properties-common
|
||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libluabind-dev libboost-all-dev ccache
|
||||
RUN apt-get -y install curl cmake cmake-curses-gui git
|
||||
|
||||
WORKDIR /opt
|
||||
RUN git clone --depth 1 --branch v0.31.0 https://github.com/creationix/nvm.git
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@ set -o pipefail
|
||||
|
||||
docker run \
|
||||
-i \
|
||||
-e "CXX=g++" \
|
||||
-e "CXX=g++-5" \
|
||||
-e "CC=gcc-5" \
|
||||
-v `pwd`:/home/mapbox/osrm-backend \
|
||||
-t mapbox/osrm:linux \
|
||||
/bin/bash -lc "osrm-backend/docker/test.sh"
|
||||
|
||||
+130
-53
@@ -30,17 +30,17 @@ http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=va
|
||||
|
||||
| Service | Description |
|
||||
|-------------|-----------------------------------------------------------|
|
||||
| [`route`](#service-route) | shortest path between given coordinates |
|
||||
| [`route`](#service-route) | fastest path between given coordinates |
|
||||
| [`nearest`](#service-nearest) | returns the nearest street segment for a given coordinate |
|
||||
| [`table`](#service-table) | computes distance tables for given coordinates |
|
||||
| [`match`](#service-match) | matches given coordinates to the road network |
|
||||
| [`trip`](#service-trip) | Compute the shortest round trip between given coordinates |
|
||||
| [`trip`](#service-trip) | Compute the fastest round trip between given coordinates |
|
||||
| [`tile`](#service-tile) | Return vector tiles containing debugging info |
|
||||
|
||||
- `version`: Version of the protocol implemented by the service.
|
||||
- `profile`: Mode of transportation, is determined by the profile that is used to prepare the data
|
||||
- `coordinates`: String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`.
|
||||
- `format`: Only `json` is supportest at the moment. This parameter is optional and defaults to `json`.
|
||||
- `format`: Only `json` is supported at the moment. This parameter is optional and defaults to `json`.
|
||||
|
||||
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 and can be generated using [this package](https://www.npmjs.com/package/polyline).
|
||||
To pass parameters to each location some options support an array like encoding:
|
||||
@@ -181,6 +181,14 @@ In case of error the following `code`s are supported in addition to the general
|
||||
|
||||
All other fields might be undefined.
|
||||
|
||||
### Example
|
||||
|
||||
Query on Berlin with three coordinates and no overview geometry returned:
|
||||
|
||||
```
|
||||
http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
|
||||
```
|
||||
|
||||
## Service `table`
|
||||
### Request
|
||||
```
|
||||
@@ -294,7 +302,7 @@ All other fields might be undefined.
|
||||
## Service `trip`
|
||||
|
||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
|
||||
The returned path does not have to be the shortest path, as TSP is NP-hard it is only an approximation.
|
||||
The returned path does not have to be the fastest path, as TSP is NP-hard it is only an approximation.
|
||||
Note that if the input coordinates can not be joined by a single trip (e.g. the coordinates are on several disconnected islands)
|
||||
multiple trips for each connected component are returned.
|
||||
|
||||
@@ -357,7 +365,7 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
|
||||
{
|
||||
"distance": 90.0,
|
||||
"duration": 300.0,
|
||||
"geometry": {"type": "LineString", "coordinates": [[120., 10.], [120.1, 10.], [120.2, 10.], [120.3, 10.]]},
|
||||
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
|
||||
"legs": [
|
||||
{
|
||||
"distance": 30.0,
|
||||
@@ -399,8 +407,8 @@ Represents a route between two waypoints.
|
||||
|
||||
| annotations | |
|
||||
|--------------|-----------------------------------------------------------------------|
|
||||
| true | returns distance and durations of each coordinate along the route |
|
||||
| false | will not exist |
|
||||
| true | An `Annotation` object containing node ids, durations and distances |
|
||||
| false | `undefined` |
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -410,15 +418,39 @@ With `steps=false` and `annotations=true`:
|
||||
{
|
||||
"distance": 30.0,
|
||||
"duration": 100.0,
|
||||
"steps": []
|
||||
"steps": [],
|
||||
"annotation": {
|
||||
"distance": [5,5,10,5,5],
|
||||
"duration": [15,15,40,15,15],
|
||||
"datasources": [1,0,0,0,1],
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Annotation
|
||||
|
||||
Annotation of the whole route leg with fine-grained information about each segment or node id.
|
||||
|
||||
#### Properties
|
||||
|
||||
- `distance`: The distance, in metres, between each pair of coordinates
|
||||
- `duration`: The duration between each pair of coordinates, in seconds
|
||||
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
||||
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"distance": [5,5,10,5,5],
|
||||
"duration": [15,15,40,15,15],
|
||||
"datasources": [1,0,0,0,1],
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### RouteStep
|
||||
|
||||
A step consists of a maneuver such as a turn or merge, followed
|
||||
@@ -437,11 +469,12 @@ step.
|
||||
| geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) or [GeoJSON `Point`](http://geojson.org/geojson-spec.html#point) if it is only one coordinate (not wrapped by a GeoJSON feature)|
|
||||
|
||||
- `name`: The name of the way along which travel proceeds.
|
||||
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
||||
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
|
||||
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
|
||||
- `mode`: A string signifying the mode of transportation.
|
||||
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
||||
- `intersections`: A list of `Intersections` that are passed along the segment, the very first belonging to the StepManeuver
|
||||
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -451,22 +484,30 @@ step.
|
||||
"duration":15.6,
|
||||
"name":"Lortzingstraße",
|
||||
"maneuver":{
|
||||
"type":"depart",
|
||||
"modifier":"left"
|
||||
},
|
||||
"type":"turn",
|
||||
"modifier":"right",
|
||||
},
|
||||
"geometry":"{lu_IypwpAVrAvAdI",
|
||||
"mode":"driving",
|
||||
"intersections":[
|
||||
{"location":[13.39677,52.54366],
|
||||
"out":1,
|
||||
"bearings":[66,246],
|
||||
"entry":["true","true"]},
|
||||
"in":3,
|
||||
"out":2,
|
||||
"bearings":[10,92,184,270],
|
||||
"entry":["true","true","true","false"],
|
||||
"lanes":[
|
||||
{"indications":["left","straight"], "valid":"false"},
|
||||
{"indications":["right"], "valid":"true"}
|
||||
]},
|
||||
{"location":[13.394718,52.543096],
|
||||
"in":0,
|
||||
"out":2,
|
||||
"bearings":[60,150,240,330],
|
||||
"entry":["false","true","true","true"]
|
||||
}
|
||||
"out":1,
|
||||
"bearings":[60,240,330],
|
||||
"entry":["false","true","true"]
|
||||
"lanes":[
|
||||
{"indications":["straight"], "valid":"true"},
|
||||
{"indications":["right"], "valid":"false"}
|
||||
]}
|
||||
]}
|
||||
```
|
||||
|
||||
@@ -482,62 +523,92 @@ step.
|
||||
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
|
||||
Types unknown to the client should be handled like the `turn` type, the existance of correct `modifier` values is guranteed.
|
||||
|
||||
| `type` | Description |
|
||||
|-------------------|--------------------------------------------------------------|
|
||||
| turn | a basic turn into direction of the `modifier` |
|
||||
| new name | no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier`. |
|
||||
| depart | indicates the departure of the leg |
|
||||
| arrive | indicates the destination of the leg |
|
||||
| merge | merge onto a street (e.g. getting on the highway from a ramp, the `modifier specifies the direction of the merge`) |
|
||||
| ramp | **Deprecated**. Replaced by `on_ramp` and `off_ramp`. |
|
||||
| on ramp | take a ramp to enter a highway (direction given my `modifier`) |
|
||||
| off ramp | take a ramp to exit a highway (direction given my `modifier`) |
|
||||
| fork | take the left/right side at a fork depending on `modifier` |
|
||||
| end of road | road ends in a T intersection turn in direction of `modifier`|
|
||||
| continue | Turn in direction of `modifier` to stay on the same road |
|
||||
| roundabout | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
|
||||
| rotary | a larger version of a roundabout, can offer `rotary_name` in addition to the `exit` parameter. |
|
||||
| roundabout turn | Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
|
||||
| notification | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
|
||||
| `type` | Description |
|
||||
|------------------|--------------------------------------------------------------|
|
||||
| `turn` | a basic turn into direction of the `modifier` |
|
||||
| `new name` | no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier`. |
|
||||
| `depart` | indicates the departure of the leg |
|
||||
| `arrive` | indicates the destination of the leg |
|
||||
| `merge` | merge onto a street (e.g. getting on the highway from a ramp, the `modifier specifies the direction of the merge`) |
|
||||
| `ramp` | **Deprecated**. Replaced by `on_ramp` and `off_ramp`. |
|
||||
| `on ramp` | take a ramp to enter a highway (direction given my `modifier`) |
|
||||
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
|
||||
| `fork` | take the left/right side at a fork depending on `modifier` |
|
||||
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
||||
| `use lane` | going straight on a specific lane |
|
||||
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
||||
| `roundabout` | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
|
||||
| `rotary` | a larger version of a roundabout, can offer `rotary_name/rotary_pronunciation` in addition to the `exit` parameter. |
|
||||
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
|
||||
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
|
||||
|
||||
Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change
|
||||
between all instructions. They only offer a fallback in case nothing else is to report.
|
||||
|
||||
|
||||
- `modifier` An optional `string` indicating the direction change of the maneuver.
|
||||
|
||||
|
||||
| `modifier` | Description |
|
||||
|-------------------|-------------------------------------------|
|
||||
| uturn | indicates reversal of direction |
|
||||
| sharp right | a sharp right turn |
|
||||
| right | a normal turn to the right |
|
||||
| slight right | a slight turn to the right |
|
||||
| straight | no relevant change in direction |
|
||||
| slight left | a slight turn to the left |
|
||||
| left | a normal turn to the left |
|
||||
| sharp left | a sharp turn to the left |
|
||||
|
||||
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
|
||||
| `uturn` | indicates reversal of direction |
|
||||
| `sharp right` | a sharp right turn |
|
||||
| `right` | a normal turn to the right |
|
||||
| `slight right` | a slight turn to the right |
|
||||
| `straight` | no relevant change in direction |
|
||||
| `slight left` | a slight turn to the left |
|
||||
| `left` | a normal turn to the left |
|
||||
| `sharp left` | a sharp turn to the left |
|
||||
|
||||
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
|
||||
|
||||
The meaning depends on the `type` field.
|
||||
|
||||
|
||||
| `type` | Description |
|
||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
|
||||
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
|
||||
|
||||
|
||||
|
||||
- `exit` An optional `integer` indicating number of the exit to take. The field exists for the following `type` field:
|
||||
|
||||
| `type` | Description |
|
||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| `roundabout` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
|
||||
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
|
||||
|
||||
|
||||
|
||||
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
||||
|
||||
### Intersections
|
||||
### Lane
|
||||
|
||||
A `Lane` represents a turn lane at the corresponding turn location.
|
||||
|
||||
#### Properties
|
||||
|
||||
- `indications`: a indication (e.g. marking on the road) specifying the turn lane. A road can have multiple indications (e.g. an arrow pointing straight and left). The indications are given in an array, each containing one of the following types. Further indications might be added on without an API version change.
|
||||
|
||||
| `value` | Description |
|
||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| `none` | No dedicated indication is shown. |
|
||||
| `uturn` | An indication signaling the possibility to reverse (i.e. fully bend arrow). |
|
||||
| `sharp right` | An indication indicating a sharp right turn (i.e. strongly bend arrow). |
|
||||
| `right` | An indication indicating a right turn (i.e. bend arrow). |
|
||||
| `slight right` | An indication indicating a slight right turn (i.e. slightly bend arrow). |
|
||||
| `straight` | No dedicated indication is shown (i.e. straight arrow). |
|
||||
| `slight left` | An indication indicating a slight left turn (i.e. slightly bend arrow). |
|
||||
| `left` | An indication indicating a left turn (i.e. bend arrow). |
|
||||
| `sharp left` | An indication indicating a sharp left turn (i.e. strongly bend arrow). |
|
||||
|
||||
- `valid`: a boolean flag indicating whether the lane is a valid choice in the current maneuver
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"indications": ["left", "straight"],
|
||||
"valid": "false"
|
||||
}
|
||||
```
|
||||
|
||||
### Intersection
|
||||
|
||||
An intersection gives a full representation of any cross-way the path passes bay. For every step, the very first intersection (`intersections[0]`) corresponds to the
|
||||
location of the StepManeuver. Further intersections are listed for every cross-way until the next turn instruction.
|
||||
@@ -553,6 +624,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
||||
in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers.
|
||||
- `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the
|
||||
direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers.
|
||||
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the intersection. If no lane information is available for an intersection, the `lanes` property will not be present.
|
||||
|
||||
#### Example
|
||||
```
|
||||
@@ -562,6 +634,11 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
||||
"out":2,
|
||||
"bearings":[60,150,240,330],
|
||||
"entry":["false","true","true","true"]
|
||||
"lanes":{
|
||||
"indications": ["left", "straight"],
|
||||
"valid": "false"
|
||||
}
|
||||
]}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -32,3 +32,16 @@ Given an OpenStreetMap way, the way_function will either return nothing (meaning
|
||||
All other calculations stem from that, including the returned timings in driving directions, but also, less directly, it feeds into the actual routing decisions the engine will take (a way with a slow traversal speed, may be less favoured than a way with fast traversal speed, but it depends how long it is, and... what it connects to in the rest of the network graph)
|
||||
|
||||
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the way_function. Instead a way_function will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, before arriving at the result.
|
||||
|
||||
## Guidance
|
||||
|
||||
The guidance parameters in profiles are currently a work in progress. They can and will change.
|
||||
Please be aware of this when using guidance configuration possibilities.
|
||||
|
||||
### Road Classification
|
||||
|
||||
Guidance uses road classes to decide on when/if to emit specific instructions and to discover which road is obvious when following a route.
|
||||
Classification uses three flags and a priority-category.
|
||||
The flags indicate whether a road is a motorway (required for on/off ramps), a link type (the ramps itself, if also a motorway) and whether a road may be omittted in considerations (is considered purely for connectivity).
|
||||
The priority-category influences the decision which road is considered the obvious choice and which roads can be seen as fork.
|
||||
Forks can be emitted between roads of similar priority category only. Obvious choices follow a major priority road, if the priority difference is large.
|
||||
|
||||
+32
-32
@@ -1,50 +1,50 @@
|
||||
# Releasing a new OSRM version
|
||||
|
||||
Do decide if this is a major or minor version bump use: http://semver.org/
|
||||
We are using http://semver.org/ for versioning with major, minor and patch versions.
|
||||
|
||||
What we guarantee on major version changes:
|
||||
## Guarantees
|
||||
|
||||
- Breaking changes will be in the changelog
|
||||
- If we break an HTTP API we bump the version
|
||||
We are giving the following guarantees between versions:
|
||||
|
||||
What we guarantee on minor version changes:
|
||||
### Major version change
|
||||
|
||||
- HTTP API does not include breaking changes
|
||||
- C++ library API does not include breaking changes
|
||||
- node-osrm API does not include breaking changes
|
||||
- There are no guarantees about compatiblity of APIs or datasets
|
||||
- Breaking changes will be noted as `BREAKING` in the changelog
|
||||
|
||||
What we DO NOT guarantee on minor version changes:
|
||||
### Minor version change
|
||||
|
||||
- file format comp ability. Breakage will be listed in the changelog.
|
||||
- new turn types and fields may be introduced. How to handle this see [the HTTP API docs](http.md).
|
||||
We may introduce forward-compatible changes: query parameters and response properties may be added in responses, but existing properties may not be changed or removed. One exception to this is the addition of new turn types, which we see as forward-compatible changes.
|
||||
|
||||
What we guarantee on patch version changes:
|
||||
- Forward-compatible HTTP API
|
||||
- Forward-compatible C++ library API
|
||||
- Forward-compatible node-osrm API
|
||||
- No compatiblity between OSRM datasets (needs new processing)
|
||||
|
||||
- HTTP API does not include breaking changes
|
||||
- C++ library API does not include breaking changes
|
||||
- node-osrm API does not include breaking changes
|
||||
- full file format compatibility
|
||||
### Patch version change
|
||||
|
||||
## Major or Minor release x.y
|
||||
- No change of query parameters or response formats
|
||||
- Compatible HTTP API
|
||||
- Compatible C++ library API
|
||||
- Compatible node-osrm API
|
||||
- Compatible OSRM datasets
|
||||
|
||||
1. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||
2. Make sure `CHANGELOG.md` is up to date.
|
||||
3. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||
4. Use an annotated tag to mark the release: `git tag vx.y.0 -a` Body of the tag description should be the changelog entries.
|
||||
5. Push tags and commits: `git push; git push --tags`
|
||||
6. Branch of the `vx.y.0` tag to create a release branch `x.y`:
|
||||
`git branch x.y. vx.y.0; git push -u x.y:origin/x.y`
|
||||
7. Modify `.travis.yml` to allow builds for the `x.y` branch.
|
||||
8. Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
## Release and branch management
|
||||
|
||||
## Patch release x.y.z
|
||||
- The `master` branch is for the bleeding edge development
|
||||
- We create and maintain release branches `x.y` to control the release flow
|
||||
- No minor or major version will be released without a code-equal release candidates
|
||||
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
|
||||
- Patch versions may be released without a release candidate
|
||||
- We may backport fixes to older versions and release them as patch versions
|
||||
|
||||
1. Check out the appropriate release branch x.y
|
||||
2. Make sure all fixes are listed in the changelog and included in the branch
|
||||
3. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||
## Releasing a version
|
||||
|
||||
1. Check out the appropriate release branch `x.y`
|
||||
2. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||
3. Make sure `CHANGELOG.md` is up to date.
|
||||
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||
6. Push tags and commits: `git push; git push --tags`
|
||||
7. Proceede with the `node-osrm` release as outlined in the repository.
|
||||
8. Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
|
||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
|
||||
|
||||
+4
-8
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
int main(int argc, const char *argv[]) try
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
@@ -40,8 +40,8 @@ int main(int argc, const char *argv[]) try
|
||||
RouteParameters params;
|
||||
|
||||
// Route in monaco
|
||||
params.coordinates.push_back({util::FloatLongitude(7.419758), util::FloatLatitude(43.731142)});
|
||||
params.coordinates.push_back({util::FloatLongitude(7.419505), util::FloatLatitude(43.736825)});
|
||||
params.coordinates.push_back({util::FloatLongitude{7.419758}, util::FloatLatitude{43.731142}});
|
||||
params.coordinates.push_back({util::FloatLongitude{7.419505}, util::FloatLatitude{43.736825}});
|
||||
|
||||
// Response is in JSON format
|
||||
json::Object result;
|
||||
@@ -67,6 +67,7 @@ int main(int argc, const char *argv[]) try
|
||||
|
||||
std::cout << "Distance: " << distance << " meter\n";
|
||||
std::cout << "Duration: " << duration << " seconds\n";
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
else if (status == Status::Error)
|
||||
{
|
||||
@@ -78,8 +79,3 @@ int main(int argc, const char *argv[]) try
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << "Error: " << e.what() << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -46,14 +46,17 @@ Feature: Bike - Mode flag
|
||||
|
||||
Scenario: Bike - Mode when pushing bike against oneways
|
||||
Given the node map
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
| a | b | e |
|
||||
| f | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | |
|
||||
| bc | primary | yes |
|
||||
| cd | primary | |
|
||||
| be | primary | |
|
||||
| cf | primary | |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
|
||||
@@ -15,8 +15,8 @@ Feature: Bike - Street names in instructions
|
||||
| bc | Your Way | A7 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | My Way (A6),Your Way (A7),Your Way (A7) |
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,Your Way,Your Way | A6,A7,A7 |
|
||||
|
||||
@unnamed
|
||||
Scenario: Bike - Use way type to describe unnamed ways
|
||||
|
||||
@@ -18,8 +18,8 @@ Feature: Bike - Oneway streets
|
||||
|
||||
Scenario: Bike - Around the Block
|
||||
Given the node map
|
||||
| a | b |
|
||||
| d | c |
|
||||
| | a | b | |
|
||||
| f | d | c | e |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
@@ -27,6 +27,8 @@ Feature: Bike - Oneway streets
|
||||
| bc | | no |
|
||||
| cd | | no |
|
||||
| da | | no |
|
||||
| df | | no |
|
||||
| ce | | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
|
||||
@@ -87,14 +87,16 @@ Feature: Bike - Accessability of different way types
|
||||
|
||||
Scenario: Bike - Instructions when pushing bike on oneways
|
||||
Given the node map
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
| a | b | e |
|
||||
| f | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | |
|
||||
| bc | primary | yes |
|
||||
| cd | primary | |
|
||||
| be | primary | |
|
||||
| cf | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
|
||||
@@ -13,8 +13,8 @@ Feature: Bike - Way ref
|
||||
| ab | Utopia Drive | E7 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | Utopia Drive (E7),Utopia Drive (E7) |
|
||||
| from | to | route | ref |
|
||||
| a | b | Utopia Drive,Utopia Drive | E7,E7 |
|
||||
|
||||
Scenario: Bike - Way with only ref
|
||||
Given the node map
|
||||
@@ -25,8 +25,8 @@ Feature: Bike - Way ref
|
||||
| ab | | E7 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | E7,E7 |
|
||||
| from | to | route | ref |
|
||||
| a | b | {highway:primary},{highway:primary} | E7,E7 |
|
||||
|
||||
Scenario: Bike - Way with only name
|
||||
Given the node map
|
||||
|
||||
@@ -38,3 +38,20 @@ Feature: Bike - Surfaces
|
||||
| cycleway | | 48s |
|
||||
| nosense | | |
|
||||
| nosense | asphalt | |
|
||||
|
||||
Scenario: Bicycle - Surfaces should not increase speed when pushing bikes
|
||||
Given the node map
|
||||
| a | b |
|
||||
| c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | surface |
|
||||
| ab | primary | yes | asphalt |
|
||||
| cd | footway | | asphalt |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | b | ab,ab | cycling,cycling | 15 km/h |
|
||||
| b | a | ab,ab | pushing bike,pushing bike | 6 km/h |
|
||||
| c | d | cd,cd | pushing bike,pushing bike | 6 km/h |
|
||||
| d | c | cd,cd | pushing bike,pushing bike | 6 km/h |
|
||||
|
||||
@@ -5,7 +5,7 @@ Feature: Car - Restricted access
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Access tag hierarchy on ways
|
||||
Scenario: Car - Access tag hierarchy on ways
|
||||
Then routability should be
|
||||
| access | vehicle | motor_vehicle | motorcar | bothw |
|
||||
| | | | | x |
|
||||
@@ -148,3 +148,23 @@ Feature: Car - Restricted access
|
||||
| primary | | | no | | x |
|
||||
| runway | | | | yes | |
|
||||
| primary | | | | no | x |
|
||||
|
||||
Scenario: Car - only designated HOV ways are ignored by default
|
||||
Then routability should be
|
||||
| highway | hov | bothw |
|
||||
| primary | designated | |
|
||||
| primary | yes | x |
|
||||
| primary | no | x |
|
||||
|
||||
Scenario: Car - these toll roads always work
|
||||
Then routability should be
|
||||
| highway | toll | bothw |
|
||||
| primary | no | x |
|
||||
| primary | snowmobile | x |
|
||||
|
||||
# To test this we need issue #2781
|
||||
@todo
|
||||
Scenario: Car - only toll=yes ways are ignored by default
|
||||
Then routability should be
|
||||
| highway | toll | bothw |
|
||||
| primary | yes | |
|
||||
|
||||
@@ -41,10 +41,10 @@ Feature: Car - Handle ferry routes
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 12 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 12 km/h |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||
|
||||
Scenario: Car - Properly handle ISO 8601 durations
|
||||
Given the node map
|
||||
@@ -60,7 +60,7 @@ Feature: Car - Handle ferry routes
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 12 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 12 km/h |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||
|
||||
@@ -15,8 +15,8 @@ Feature: Car - Street names in instructions
|
||||
| bc | Your Way | A1 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | My Way,Your Way (A1),Your Way (A1) |
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,Your Way,Your Way | ,A1,A1|
|
||||
|
||||
Scenario: Car - A named street with pronunciation
|
||||
Given the node map
|
||||
@@ -25,15 +25,32 @@ Feature: Car - Street names in instructions
|
||||
| | c | |
|
||||
|
||||
And the ways
|
||||
| nodes | name |name:pronunciation | ref |
|
||||
| nodes | name |name:pronunciation | ref |
|
||||
| ab | My Way | | |
|
||||
| bd | My Way | meyeway | A1 |
|
||||
| cd | Your Way | yourewaye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | pronunciations |
|
||||
| a | d | My Way,My Way (A1) | ,meyeway |
|
||||
| 1 | c | Your Way,Your Way | yourewaye,yourewaye |
|
||||
| from | to | route | pronunciations | ref |
|
||||
| a | d | My Way,My Way | ,meyeway | ,A1 |
|
||||
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
|
||||
|
||||
# See #2860
|
||||
Scenario: Car - same street name but different pronunciation
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| | d | |
|
||||
| | e | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | name:pronunciation |
|
||||
| abc | Houston St | hew-stun |
|
||||
| bde | Houston St | how-stun |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | pronunciations |
|
||||
| a | c | Houston St,Houston St | hew-stun,hew-stun |
|
||||
| a | e | Houston St,Houston St,Houston St | hew-stun,how-stun,how-stun |
|
||||
|
||||
@todo
|
||||
Scenario: Car - Use way type to describe unnamed ways
|
||||
@@ -48,3 +65,31 @@ Feature: Car - Street names in instructions
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | tertiary,residential,residential |
|
||||
|
||||
Scenario: Inner city expressway with on road
|
||||
Given the node map
|
||||
| a | b | | | | c | g |
|
||||
| | | | | f | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | d | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | e | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | name:pronunciation |
|
||||
| abc | primary | road | roooaad |
|
||||
| cg | primary | road | roooaad |
|
||||
| bfd | trunk_link | | |
|
||||
| cde | trunk | trunk | truank |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cde | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | pronunciations |
|
||||
| a,e | road,trunk,trunk | depart,turn right,arrive | roooaad,truank,truank |
|
||||
|
||||
@@ -35,8 +35,8 @@ Feature: Car - Oneway streets
|
||||
|
||||
Scenario: Car - Around the Block
|
||||
Given the node map
|
||||
| a | b |
|
||||
| d | c |
|
||||
| | a | b | |
|
||||
| f | d | c | e |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
@@ -44,6 +44,8 @@ Feature: Car - Oneway streets
|
||||
| bc | |
|
||||
| cd | |
|
||||
| da | |
|
||||
| ce | |
|
||||
| df | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
|
||||
@@ -149,11 +149,27 @@ Feature: Car - Turn restrictions
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | wj | j | only_left_turn |
|
||||
|
||||
Scenario: Car - Only right turn, invalid
|
||||
Given the node map
|
||||
| | n | | |
|
||||
| w | j | e | r |
|
||||
| | s | | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
| re | -1 |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | er | j | only_right_on |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj,wj |
|
||||
| s | n | |
|
||||
| s | e | |
|
||||
| from | to | route |
|
||||
| s | r | sj,ej,re,re |
|
||||
|
||||
@only_turning
|
||||
Scenario: Car - Only right turn
|
||||
@@ -430,3 +446,27 @@ Feature: Car - Turn restrictions
|
||||
| a | b | ax,xy,yb,yb |
|
||||
| b | a | yb,xy,ax,ax |
|
||||
|
||||
@specific
|
||||
Scenario: Car - Ignore unrecognized restriction
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | wj | j | yield |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj,wj |
|
||||
| s | n | sj,nj,nj |
|
||||
| s | e | sj,ej,ej |
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
@routing @car @surface
|
||||
Feature: Car - Surfaces
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Surface should reduce speed
|
||||
Then routability should be
|
||||
| highway | service | forw | backw |
|
||||
| service | alley | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| service | emergency_access | | |
|
||||
| service | driveway | 15 km/h +-1| 15 km/h +-1 |
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Feature: Traffic - speeds
|
||||
|
||||
Background: Use specific speeds
|
||||
|
||||
Scenario: Weighting based on speed file
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
@@ -21,27 +23,106 @@ Feature: Traffic - speeds
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
And the speed file
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the contract extra arguments "--segment-speed-file speeds.csv"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,27
|
||||
2,1,27
|
||||
1,2,0
|
||||
2,1,0
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,27
|
||||
4,1,27
|
||||
"""
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ad,de,eb,eb | 30 km/h |
|
||||
| a | c | ad,dc,dc | 31 km/h |
|
||||
| b | c | bc,bc | 27 km/h |
|
||||
| a | d | ad,ad | 27 km/h |
|
||||
| d | c | dc,dc | 36 km/h |
|
||||
| g | b | fb,fb | 36 km/h |
|
||||
| a | g | ad,df,fb,fb | 30 km/h |
|
||||
|
||||
Scenario: Weighting based on speed file
|
||||
|
||||
Scenario: Speeds that isolate a single node (a)
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | .05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | .05 | .03 |
|
||||
| e | .05 | .066 |
|
||||
| f | .075 | .066 |
|
||||
| g | .075 | 0.1 |
|
||||
| h | 2.075 | 19.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the contract extra arguments "--segment-speed-file speeds.csv"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,0
|
||||
2,1,0
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,0
|
||||
4,1,0
|
||||
"""
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 27 km/h |
|
||||
| a | c | ab,bc,bc | 27 km/h |
|
||||
| b | c | bc,bc | 27 km/h |
|
||||
| a | d | ad,ad | 27 km/h |
|
||||
| d | c | dc,dc | 36 km/h |
|
||||
| g | b | ab,ab | 27 km/h |
|
||||
| a | g | ab,ab | 27 km/h |
|
||||
| from | to | route | speed |
|
||||
| a | b | fb,fb | 36 km/h |
|
||||
| a | c | fb,bc,bc | 30 km/h |
|
||||
| b | c | bc,bc | 27 km/h |
|
||||
| a | d | fb,df,df | 36 km/h |
|
||||
| d | c | dc,dc | 36 km/h |
|
||||
| g | b | fb,fb | 36 km/h |
|
||||
| a | g | fb,fb | 36 km/h |
|
||||
|
||||
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | .05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | .05 | .03 |
|
||||
| e | .05 | .066 |
|
||||
| f | .075 | .066 |
|
||||
| g | .075 | 0.1 |
|
||||
| h | 1.075 | 10.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the contract extra arguments "--segment-speed-file speeds.csv"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,-10
|
||||
2,1,-20
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,-3
|
||||
4,1,-5
|
||||
"""
|
||||
And the data has been extracted
|
||||
When I run "osrm-contract --segment-speed-file speeds.csv {extracted_base}.osrm"
|
||||
And stderr should contain "malformed"
|
||||
And it should exit with code not 0
|
||||
|
||||
@@ -33,19 +33,19 @@ Feature: Traffic - turn penalties
|
||||
| from | to | route | speed | time |
|
||||
| a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 59 km/h | 12s +-1 |
|
||||
| i | g | fim,fg,fg | 53 km/h | 13.5s +-1 |
|
||||
# right
|
||||
| a | e | ad,def,def | 57 km/h | 12.5s +-1 |
|
||||
| a | e | ad,def,def | 43 km/h | 16.7s +-1 |
|
||||
# left
|
||||
| c | g | cd,def,fg,fg | 63 km/h | 23s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 61 km/h | 23.5s +-1 |
|
||||
| p | g | mp,fim,fg,fg | 58 km/h | 24.9s +-1 |
|
||||
# straight-right
|
||||
| a | l | ad,dhk,klm,klm | 60 km/h | 24s +-1 |
|
||||
| a | l | ad,dhk,klm,klm | 51 km/h | 28.1s +-1 |
|
||||
# straight-left
|
||||
| l | e | klm,dhk,def,def | 59 km/h | 24.5s +-1 |
|
||||
| l | e | klm,dhk,def,def | 53 km/h | 27s +-1 |
|
||||
# double right
|
||||
| g | n | fg,fim,mn,mn | 57 km/h | 25s +-1 |
|
||||
| g | n | fg,fim,mn,mn | 43 km/h | 33.4s +-1 |
|
||||
# double left
|
||||
|
||||
Scenario: Weighting based on turn penalty file
|
||||
@@ -53,9 +53,9 @@ Feature: Traffic - turn penalties
|
||||
"""
|
||||
9,6,7,1.8
|
||||
9,13,14,24.5
|
||||
8,4,3,26
|
||||
8,4,3,30
|
||||
12,11,8,9
|
||||
8,11,12,13
|
||||
8,11,12,23
|
||||
1,4,5,-0.2
|
||||
"""
|
||||
And the contract extra arguments "--turn-penalty-file penalties.csv"
|
||||
@@ -71,13 +71,13 @@ Feature: Traffic - turn penalties
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 59 km/h | 24.5s +-1 |
|
||||
# straight-right - ifg penalty
|
||||
| a | l | ad,def,fim,klm,klm | 61 km/h | 35.5s +-1 |
|
||||
| a | l | ad,def,fim,klm,klm | 57 km/h | 38.2s +-1 |
|
||||
# was straight-left - forced around by hkl penalty
|
||||
| l | e | klm,fim,def,def | 57 km/h | 25s +-1 |
|
||||
| l | e | klm,fim,def,def | 43 km/h | 33.4s +-1 |
|
||||
# double right - forced left by lkh penalty
|
||||
| g | n | fg,fim,mn,mn | 30 km/h | 47.5s +-1 |
|
||||
| g | n | fg,fim,mn,mn | 27 km/h | 52.6s +-1 |
|
||||
# double left - imn penalty
|
||||
| j | c | jk,klm,fim,def,cd,cd | 60 km/h | 48s +-1 |
|
||||
| j | c | jk,klm,fim,def,cd,cd | 51 km/h | 56.2s +-1 |
|
||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||
|
||||
Scenario: Too-negative penalty clamps, but does not fail
|
||||
|
||||
@@ -16,7 +16,7 @@ Feature: Foot - Street names in instructions
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | My Way (A6),Your Way (B7),Your Way (B7) |
|
||||
| a | c | My Way,Your Way,Your Way |
|
||||
|
||||
@unnamed
|
||||
Scenario: Foot - Use way type to describe unnamed ways
|
||||
|
||||
@@ -14,7 +14,7 @@ Feature: Foot - Way ref
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | Utopia Drive (E7),Utopia Drive (E7) |
|
||||
| a | b | Utopia Drive,Utopia Drive |
|
||||
|
||||
Scenario: Foot - Way with only ref
|
||||
Given the node map
|
||||
@@ -25,8 +25,8 @@ Feature: Foot - Way ref
|
||||
| ab | | E7 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | E7,E7 |
|
||||
| from | to | route |
|
||||
| a | b | {highway:primary},{highway:primary} |
|
||||
|
||||
Scenario: Foot - Way with only name
|
||||
Given the node map
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
@routing @guidance @turn-lanes
|
||||
Feature: Turn Lane Guidance
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 3 meters
|
||||
|
||||
@sliproads
|
||||
Scenario: Separate Turn Lanes
|
||||
Given the node map
|
||||
| | | | | | | | e | |
|
||||
| a | | | b | | | | c | g |
|
||||
| | | | | | | | d | |
|
||||
| | | | | | | | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name | oneway |
|
||||
| ab | | in | yes |
|
||||
| bc | left\|through | in | yes |
|
||||
| bd | right | in | yes |
|
||||
| ec | | cross | no |
|
||||
| cd | | cross | no |
|
||||
| df | | cross | no |
|
||||
| cg | | straight | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | cd | d | no_left_turn |
|
||||
| restriction | bc | cd | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||
|
||||
@sliproads
|
||||
Scenario: Separate Turn Lanes
|
||||
Given the node map
|
||||
| | | | | | | | e | |
|
||||
| a | | | b | | | | c | g |
|
||||
| | | | | | | | d | |
|
||||
| | | | | | | | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name | oneway |
|
||||
| ab | | in | yes |
|
||||
| bc | left\|through | in | yes |
|
||||
| bd | right | in | yes |
|
||||
| ec | | cross | no |
|
||||
| cd | | cross | no |
|
||||
| df | | cross | no |
|
||||
| cg | | straight | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | cd | d | no_left_turn |
|
||||
| restriction | bc | cd | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||
|
||||
@sliproads
|
||||
Scenario: Separate Turn Lanes Next to other turns
|
||||
Given the node map
|
||||
| | | | | | | | e | |
|
||||
| a | | | b | | | | c | g |
|
||||
| | | | | | | | d | |
|
||||
| | | | | | | | f | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| i | | | h | | | | j | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name | oneway |
|
||||
| ab | | in | yes |
|
||||
| bc | left\|through | in | yes |
|
||||
| bd | right | in | yes |
|
||||
| ec | | cross | no |
|
||||
| cd | | cross | no |
|
||||
| df | | cross | no |
|
||||
| cg | | straight | no |
|
||||
| bh | left\|right | turn | yes |
|
||||
| ihj | | other | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | cd | d | no_left_turn |
|
||||
| restriction | bc | cd | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
|
||||
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
|
||||
|
||||
@todo @bug @2654 @none
|
||||
#https://github.com/Project-OSRM/osrm-backend/issues/2645
|
||||
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
|
||||
Scenario: Kurt-Schuhmacher-Damm
|
||||
Given the node map
|
||||
| | | | g | | f |
|
||||
| | | | | | |
|
||||
| j | | | h | | e |
|
||||
| | | | | | |
|
||||
| a | | | b | | c |
|
||||
| | | | i | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | turn:lanes |
|
||||
| ab | | motorway_link | yes | left\|none\|right |
|
||||
| bc | | primary_link | yes | |
|
||||
| cd | ksd | secondary | yes | |
|
||||
| cef | ksd | primary | yes | |
|
||||
| hj | | motorway_link | yes | |
|
||||
| eh | | secondary_link | yes | |
|
||||
| gh | ksd | primary | yes | |
|
||||
| hbi | ksd | secondary | yes | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,f | ,ksd,ksd | depart,turn left,arrive | ,left:true none:true right:false, |
|
||||
| a,i | ,ksd,ksd | depart,turn right,arrive | ,left:false none:true right:true, |
|
||||
|
||||
@todo @bug @2650 @sliproads
|
||||
#market and haight in SF, restricted turn
|
||||
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
|
||||
Scenario: Market/Haight without Through Street
|
||||
Given the node map
|
||||
| | | | | | | | g | j | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | f |
|
||||
| | | | | | | | | e | |
|
||||
| | | | | | | | d | | |
|
||||
| a | | | | | | b | c | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | l | | | h | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | turn:lanes:forward |
|
||||
| ab | ghough | secondary | yes | |
|
||||
| bc | ghough | secondary | yes | through\|through |
|
||||
| bd | ghough | secondary | yes | none\|through |
|
||||
| def | ghough | secondary | yes | |
|
||||
| gd | market | primary | yes | |
|
||||
| dc | market | primary | yes | |
|
||||
| ch | market | primary | yes | |
|
||||
| iej | market | primary | yes | |
|
||||
| bl | haight | residential | yes | left\|none |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| relation | bd | dc | d | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
|
||||
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
|
||||
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
|
||||
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
|
||||
|
||||
@todo @2650 @bug @sliproads
|
||||
#market and haight in SF, unrestricted
|
||||
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
|
||||
Scenario: Market/Haight without Through Street
|
||||
Given the node map
|
||||
| | | | | | | | g | j | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | f |
|
||||
| | | | | | | | | e | |
|
||||
| | | | | | | | d | | |
|
||||
| a | | | | | | b | c | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | | | | | | |
|
||||
| | | | | l | | | h | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | turn:lanes:forward |
|
||||
| ab | ghough | secondary | yes | |
|
||||
| bc | ghough | secondary | yes | through\|through |
|
||||
| bd | ghough | secondary | yes | none\|through |
|
||||
| def | ghough | secondary | yes | |
|
||||
| gd | market | primary | yes | |
|
||||
| dc | market | primary | yes | |
|
||||
| ch | market | primary | yes | |
|
||||
| iej | market | primary | yes | |
|
||||
| bl | haight | residential | yes | left\|none |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
|
||||
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
|
||||
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
|
||||
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
|
||||
|
||||
Scenario: Check sliproad handler loop's exit condition, Issue #2896
|
||||
# http://www.openstreetmap.org/way/198481519
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 7.6125350 | 126.5708309 |
|
||||
| b | 7.6125156 | 126.5707219 |
|
||||
| c | 7.6125363 | 126.5708337 |
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| cbac | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | c | , | depart,arrive |
|
||||
@@ -0,0 +1,717 @@
|
||||
@routing @guidance @turn-lanes
|
||||
Feature: Turn Lane Guidance
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 20 meters
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lane Change for subsequent multi-lane intersections
|
||||
Given the node map
|
||||
| a | | b | | x | | |
|
||||
| | | | | | | |
|
||||
| | | c | | d | | z |
|
||||
| | | | | | | |
|
||||
| | | y | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward |
|
||||
| ab | through\|right\|right\|right |
|
||||
| bx | |
|
||||
| bc | left\|left\|through |
|
||||
| cd | through\|right |
|
||||
| cy | |
|
||||
| dz | |
|
||||
| de | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes | # |
|
||||
| a,d | ab,bc,cd,cd | depart,turn right,turn left,arrive | ,straight:false right:true right:true right:false,left:true left:true straight:false, | 2 hops |
|
||||
| a,e | ab,bc,cd,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:false right:true right:false,left:false left:true straight:false,straight:false right:true, | 3 hops |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lane Change for quick same direction turns, staying on the same street
|
||||
Given the node map
|
||||
| a | | b | x |
|
||||
| | | | |
|
||||
| | | c | |
|
||||
| | | | |
|
||||
| e | | d | y |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | turn:lanes:backward | name |
|
||||
| ab | through\|right\|right | | MySt |
|
||||
| bx | | | XSt |
|
||||
| bc | | left\|right | MySt |
|
||||
| cd | left\|right | through\|through | MySt |
|
||||
| de | | left\|left\|through | MySt |
|
||||
| dy | | | YSt |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false right:false right:true,left:false right:true, |
|
||||
| e,a | MySt,MySt,MySt,MySt | depart,continue left,turn left,arrive | ,left:true left:false straight:false,left:true right:false, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lane Change for quick same direction turns, changing between streets
|
||||
Given the node map
|
||||
| a | | b | x |
|
||||
| | | | |
|
||||
| | | c | |
|
||||
| | | | |
|
||||
| e | | d | y |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | turn:lanes:backward | name |
|
||||
| ab | through\|right\|right | | AXSt |
|
||||
| bx | | | AXSt |
|
||||
| bc | | left\|right | BDSt |
|
||||
| cd | left\|right | through\|through | BDSt |
|
||||
| de | | left\|left\|through | EYSt |
|
||||
| dy | | | EYSt |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | AXSt,BDSt,EYSt,EYSt | depart,turn right,turn right,arrive | ,straight:false right:false right:true,left:false right:true, |
|
||||
| e,a | EYSt,BDSt,AXSt,AXSt | depart,turn left,turn left,arrive | ,left:true left:false straight:false,left:true right:false, |
|
||||
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lane Change for quick turns during a merge
|
||||
Given the node map
|
||||
| a | | | | |
|
||||
| x | b | | c | y |
|
||||
| | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name | highway | oneway |
|
||||
| ab | slight_left\|slight_left | On | motorway_link | yes |
|
||||
| xb | | Hwy | motorway | |
|
||||
| bc | through\|slight_right | Hwy | motorway | |
|
||||
| cd | | Off | motorway_link | yes |
|
||||
| cy | | Hwy | motorway | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,d | On,Hwy,Off,Off | depart,merge slight right,off ramp right,arrive | ,slight left:false slight left:true,straight:false slight right:true, |
|
||||
|
||||
|
||||
@anticipate
|
||||
Scenario: Schoenefelder Kreuz
|
||||
# https://www.openstreetmap.org/way/264306388#map=16/52.3202/13.5568
|
||||
Given the node map
|
||||
| a | b | x | | | i |
|
||||
| | | c | d | | |
|
||||
| | | | | | j |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | lanes | highway | oneway | name |
|
||||
| ab | none\|none\|none\|slight_right\|slight_right | 5 | motorway | | abx |
|
||||
| bx | | 3 | motorway | | abx |
|
||||
| bc | | 2 | motorway_link | yes | bcd |
|
||||
| cd | slight_left\|slight_left;slight_right\|slight_right | 3 | motorway_link | yes | bcd |
|
||||
| di | slight_left\|slight_right | 2 | motorway_link | yes | di |
|
||||
| dj | | 2 | motorway_link | yes | dj |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,i | abx,bcd,di,di | depart,off ramp right,fork slight left,arrive | ,none:false none:false none:false slight right:true slight right:true,slight left:true slight left;slight right:true slight right:false, |
|
||||
| a,j | abx,bcd,dj,dj | depart,off ramp right,fork slight right,arrive | ,none:false none:false none:false slight right:true slight right:true,slight left:false slight left;slight right:true slight right:true, |
|
||||
|
||||
|
||||
@anticipate
|
||||
Scenario: Kreuz Oranienburg
|
||||
# https://www.openstreetmap.org/way/4484007#map=18/52.70439/13.20269
|
||||
Given the node map
|
||||
| i | | | | | a |
|
||||
| j | | c | b | | x |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | lanes | highway | oneway | name |
|
||||
| ab | | 1 | motorway_link | yes | ab |
|
||||
| xb | | 1 | motorway_link | yes | xbcj |
|
||||
| bc | none\|slight_right | 2 | motorway_link | yes | xbcj |
|
||||
| ci | | 1 | motorway_link | yes | ci |
|
||||
| cj | | 1 | motorway_link | yes | xbcj |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,i | ab,ci,ci | depart,turn slight right,arrive | ,none:false slight right:true, |
|
||||
| a,j | ab,xbcj | depart,arrive | , |
|
||||
|
||||
|
||||
@anticipate
|
||||
Scenario: Lane anticipation for fan-in
|
||||
Given the node map
|
||||
| a | | b | | x | | |
|
||||
| | | | | | | |
|
||||
| | | c | | d | | z |
|
||||
| | | | | | | |
|
||||
| | | y | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|right\|right\|right | abx |
|
||||
| bx | | abx |
|
||||
| bc | left\|left\|through | bcy |
|
||||
| cy | | bcy |
|
||||
| cd | through\|right | cdz |
|
||||
| dz | | cdz |
|
||||
| de | | de |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:false right:true right:false,left:false left:true straight:false,straight:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Lane anticipation for fan-out
|
||||
Given the node map
|
||||
| a | | b | | x | | |
|
||||
| | | | | | | |
|
||||
| | | c | | d | | z |
|
||||
| | | | | | | |
|
||||
| | | y | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|right | abx |
|
||||
| bx | | abx |
|
||||
| bc | left\|left\|through | bcy |
|
||||
| cy | | bcy |
|
||||
| cd | through\|right\|right\|right | cdz |
|
||||
| dz | | cdz |
|
||||
| de | | de |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:true,left:true left:true straight:false,straight:false right:true right:true right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Lane anticipation for fan-in followed by fan-out
|
||||
Given the node map
|
||||
| a | | b | | x | | |
|
||||
| | | | | | | |
|
||||
| | | c | | d | | z |
|
||||
| | | | | | | |
|
||||
| | | y | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|right\|right\|right | abx |
|
||||
| bx | | abx |
|
||||
| bc | left\|left\|through | bcy |
|
||||
| cy | | bcy |
|
||||
| cd | through\|right\|right\|right | cdz |
|
||||
| dz | | cdz |
|
||||
| de | | de |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:true right:true right:false,left:true left:true straight:false,straight:false right:true right:true right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Lane anticipation for fan-out followed by fan-in
|
||||
Given the node map
|
||||
| a | | b | | x | | |
|
||||
| | | | | | | |
|
||||
| | | c | | d | | z |
|
||||
| | | | | | | |
|
||||
| | | y | | e | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|right | abx |
|
||||
| bx | | abx |
|
||||
| bc | left\|left\|through | bcy |
|
||||
| cy | | bcy |
|
||||
| cd | through\|right | cdz |
|
||||
| dz | | cdz |
|
||||
| de | | de |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:true,left:false left:true straight:false,straight:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Lane anticipation for multiple hops with same number of lanes
|
||||
Given the node map
|
||||
| a | | b | | x | | |
|
||||
| | | | | | | |
|
||||
| | | c | | d | | z |
|
||||
| | | | | | | |
|
||||
| | | y | | e | | f |
|
||||
| | | | | | | |
|
||||
| | | | | w | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|right\|right\|right | abx |
|
||||
| bx | | abx |
|
||||
| bc | left\|left\|through | bcy |
|
||||
| cy | | bcy |
|
||||
| cd | through\|right\|right | cdz |
|
||||
| dz | | cdz |
|
||||
| de | left\|through | dew |
|
||||
| ew | | dew |
|
||||
| ef | | ef |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,f | abx,bcy,cdz,dew,ef,ef | depart,turn right,turn left,turn right,turn left,arrive | ,straight:false right:true right:false right:false,left:true left:false straight:false,straight:false right:true right:false,left:true straight:false, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for through, through with lanes
|
||||
Given the node map
|
||||
| | | | f | g | |
|
||||
| | | | | | |
|
||||
| a | b | c | d | | e |
|
||||
| | | | | | |
|
||||
| | | | h | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | | main |
|
||||
| bc | left\|through\|through\|through\|right | main |
|
||||
| cd | left\|through\|right | main |
|
||||
| de | | main |
|
||||
| cf | | off |
|
||||
| ch | | off |
|
||||
| dg | | off |
|
||||
| di | | off |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | main,main,main | depart,use lane straight,arrive | ,left:false straight:false straight:true straight:false right:false, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for through and collapse multiple use lanes
|
||||
Given the node map
|
||||
| | | e | f | g |
|
||||
| | | | | |
|
||||
| a | b | c | d | |
|
||||
| | | | | |
|
||||
| | | h | i | j |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | left\|through\|through\|right | main |
|
||||
| bc | left\|through\|through\|right | main |
|
||||
| cd | left\|through\|through\|through\|right | main |
|
||||
| be | | off |
|
||||
| bh | | off |
|
||||
| cf | | off |
|
||||
| ci | | off |
|
||||
| dg | | off |
|
||||
| dj | | off |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,c | main,main | depart,arrive | , |
|
||||
| a,d | main,main | depart,arrive | , |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for through followed by left/right
|
||||
Given the node map
|
||||
| | | f | g | |
|
||||
| | | | | d |
|
||||
| a | b | c | x | |
|
||||
| | | | | e |
|
||||
| | | h | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | left\|through\|through\|through\|through\|right | main |
|
||||
| bc | left\|through\|through\|right | main |
|
||||
| cx | left\|right | main |
|
||||
| xd | | left |
|
||||
| xe | | right |
|
||||
| bf | | off |
|
||||
| bh | | off |
|
||||
| cg | | off |
|
||||
| ci | | off |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,d | main,main,main,left,left | depart,use lane straight,use lane straight,turn left,arrive | ,left:false straight:false straight:true straight:false straight:false right:false,left:false straight:true straight:false right:false,left:true right:false, |
|
||||
| a,e | main,main,main,right,right | depart,use lane straight,use lane straight,turn right,arrive | ,left:false straight:false straight:false straight:true straight:false right:false,left:false straight:false straight:true right:false,left:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for through with turn before / after
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| | d | |
|
||||
| f | e | g |
|
||||
| | h | |
|
||||
| j | i | l |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name | oneway |
|
||||
| ab | right\|right\|right\|right | ab | yes |
|
||||
| cb | left\|left\|left\|left | cb | yes |
|
||||
| bd | | bdehi | |
|
||||
| de | left\|left\|through\|through\|through\|through\|right\|right | bdehi | |
|
||||
| ef | | ef | |
|
||||
| eg | | eg | |
|
||||
| eh | | bdehi | |
|
||||
| hi | left\|left\|right\|right | bdehi | |
|
||||
| ij | | ij | |
|
||||
| il | | il | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes | # |
|
||||
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
||||
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
||||
| a,j | ab,bdehi,bdehi,ij,ij | depart,turn right,use lane straight,turn right,arrive | ,right:true right:true right:false right:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
|
||||
| a,l | ab,bdehi,bdehi,il,il | depart,turn right,use lane straight,turn left,arrive | ,right:false right:false right:true right:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
|
||||
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
||||
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
||||
| c,l | cb,bdehi,bdehi,il,il | depart,turn left,use lane straight,turn left,arrive | ,left:false left:false left:true left:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
|
||||
| c,j | cb,bdehi,bdehi,ij,ij | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false left:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for turns with through before and after
|
||||
Given the node map
|
||||
| a | b | q | | s | h | i |
|
||||
| | | e | f | g | | |
|
||||
| c | d | r | | t | j | k |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|right\|right\|right | top |
|
||||
| be | | top |
|
||||
| bq | | off |
|
||||
| ef | left\|through\|through\|through\|through\|right | main |
|
||||
| fg | left\|left\|right\|right | main |
|
||||
| fs | | off |
|
||||
| ft | | off |
|
||||
| gh | | top |
|
||||
| hi | | top |
|
||||
| cd | left\|left\|left\|through | bot |
|
||||
| de | | bot |
|
||||
| dr | | off |
|
||||
| gj | | bot |
|
||||
| jk | | bot |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,i | top,main,main,top,top | depart,turn right,use lane straight,turn left,arrive | ,straight:false right:false right:true right:true,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
||||
| a,k | top,main,main,bot,bot | depart,turn right,use lane straight,turn right,arrive | ,straight:false right:true right:true right:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
||||
| c,i | bot,main,main,top,top | depart,turn left,use lane straight,turn left,arrive | ,left:false left:true left:true straight:false,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
||||
| c,k | bot,main,main,bot,bot | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false straight:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for turn between throughs
|
||||
Given the node map
|
||||
| | q | | |
|
||||
| a | b | c | s |
|
||||
| | r | d | t |
|
||||
| | | e | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | left\|through\|through\|through\|through\|through\|right | main |
|
||||
| bq | | off |
|
||||
| br | | off |
|
||||
| bc | through\|through\|right\|right\|right | main |
|
||||
| cs | | off |
|
||||
| cd | left\|through\|through | main |
|
||||
| de | | main |
|
||||
| dt | | off |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | main,main,main,main | depart,use lane straight,continue right,arrive | ,left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true, |
|
||||
|
||||
@anticipate @todo @bug @2661
|
||||
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | b | | d | f |
|
||||
| | | c | | |
|
||||
| | | | | |
|
||||
| | | g | | |
|
||||
| k | h | | j | l |
|
||||
| | | i | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | junction | # |
|
||||
| ab | slight_right\|slight_right\|slight_right | primary | | |
|
||||
| bc | slight_left\|slight_right\|slight_right | primary | roundabout | top |
|
||||
| cd | | primary | roundabout | top |
|
||||
| de | | primary | roundabout | top |
|
||||
| eb | | primary | roundabout | top |
|
||||
| df | | primary | | |
|
||||
| cg | slight_right\|slight_right | primary | | |
|
||||
| gh | slight_left\|slight_right | primary | roundabout | bot |
|
||||
| hi | | primary | roundabout | bot |
|
||||
| ij | slight_left\|slight_right | primary | roundabout | bot |
|
||||
| jg | | primary | roundabout | bot |
|
||||
| hk | | primary | | |
|
||||
| jl | | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| # | waypoints | route | turns | lanes |
|
||||
| right-right | a,k | ab,cg,hk,hk | depart,roundabout-exit-1,roundabout-exit-1,arrive | ,slight right:false slight right:false slight right:true,slight right:false slight right:true, |
|
||||
| right-left | a,l | ab,cg,jl,jl | depart,roundabout-exit-1,roundabout-exit-2,arrive | ,slight right:false slight right:false slight right:true,slight right:false slight right:true, |
|
||||
| todo exits | a,f | ab,df,df | depart,roundabout-exit-2,arrive | ,slight right:false slight right:false slight right:true, |
|
||||
| todo exits | a,e | ab,bc,eb | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true slight right:true, |
|
||||
|
||||
@anticipate @todo
|
||||
Scenario: Roundabout with lanes only tagged on exit
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
| a | b | | d | f |
|
||||
| | | c | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | junction |
|
||||
| ab | | primary | |
|
||||
| bc | | primary | roundabout |
|
||||
| cd | slight_left\|slight_left\|slight_right | primary | roundabout |
|
||||
| de | | primary | roundabout |
|
||||
| eb | | primary | roundabout |
|
||||
| df | | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: No Lanes for Roundabouts, see #2626
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| | c | | g | h |
|
||||
| | | | | |
|
||||
| | d | | f | |
|
||||
| | | e | | |
|
||||
| x | | | | y |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | junction |
|
||||
| ab | slight_right\|slight_right | primary | |
|
||||
| bc | | primary | roundabout |
|
||||
| cd | | primary | roundabout |
|
||||
| de | | primary | roundabout |
|
||||
| ef | | primary | roundabout |
|
||||
| fg | through\|slight_right | primary | roundabout |
|
||||
| gb | | primary | roundabout |
|
||||
| gh | | primary | |
|
||||
| cx | | primary | |
|
||||
| dx | | primary | |
|
||||
| ey | | primary | |
|
||||
| fy | | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,, |
|
||||
|
||||
@anticipate
|
||||
Scenario: No Lanes for Roundabouts, see #2626
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| x | b | | d | y |
|
||||
| | | c | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | junction | name |
|
||||
| xb | slight_right\|slight_right | primary | | xb |
|
||||
| dy | | primary | | dy |
|
||||
| ab | | primary | roundabout | roundabout |
|
||||
| bc | | primary | roundabout | roundabout |
|
||||
| cd | left\|slight_right | primary | roundabout | roundabout |
|
||||
| da | | primary | roundabout | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
|
||||
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||
|
||||
@anticipate
|
||||
Scenario: No Lanes for Roundabouts, see #2626
|
||||
Given the profile "lhs"
|
||||
And the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | c | | g | |
|
||||
| | | | | |
|
||||
| | d | | f | |
|
||||
| | | e | | |
|
||||
| x | | | | y |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | junction |
|
||||
| ab | slight_left\|slight_left | primary | |
|
||||
| bg | | primary | roundabout |
|
||||
| gf | | primary | roundabout |
|
||||
| fe | | primary | roundabout |
|
||||
| ed | | primary | roundabout |
|
||||
| dc | slight_left | primary | roundabout |
|
||||
| cb | | primary | roundabout |
|
||||
| ch | | primary | |
|
||||
| ex | | primary | |
|
||||
| dx | | primary | |
|
||||
| gy | | primary | |
|
||||
| fy | | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,h | ab,ch,ch | depart,roundabout-exit-5,arrive | ,, |
|
||||
|
||||
@anticipate
|
||||
Scenario: No Lanes for Roundabouts, see #2626
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| x | b | | d | y |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | c | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | junction | name |
|
||||
| xb | slight_right\|slight_right | primary | | xb |
|
||||
| dy | | primary | | dy |
|
||||
| ab | | primary | roundabout | roundabout |
|
||||
| bc | | primary | roundabout | roundabout |
|
||||
| cd | left\|slight_right | primary | roundabout | roundabout |
|
||||
| da | | primary | roundabout | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
|
||||
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||
|
||||
@anticipate @todo @2032
|
||||
Scenario: No Lanes for Roundabouts, see #2626
|
||||
Given the node map
|
||||
| a | b | | | x |
|
||||
| | c | | | |
|
||||
| d | | f | g | z |
|
||||
| | e | | h | |
|
||||
| | | | | |
|
||||
| | y | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | junction | name |
|
||||
| ab | through\|right\|right\|right\|right | primary | | abx |
|
||||
| bx | | primary | | abx |
|
||||
| bc | right\|right\|right\|right | primary | | bc |
|
||||
| cd | | primary | roundabout | cdefc |
|
||||
| de | slight_left\|slight_left\|slight_left\|slight_right | primary | roundabout | cdefc |
|
||||
| ef | left\|slight_right\|slight_right | primary | roundabout | cdefc |
|
||||
| fc | | primary | roundabout | cdefc |
|
||||
| ey | | primary | | ey |
|
||||
| fg | through\|right | primary | | fg |
|
||||
| gz | | primary | | gz |
|
||||
| gh | | primary | | gh |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,h | abx,bc,fg,gh,gh | depart,turn right,cdefc-exit-2,turn right,arrive | ,straight:false right:false right:false right:false right:true,,straight:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate none tags
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| | d | |
|
||||
| f | e | g |
|
||||
| | h | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | name |
|
||||
| ab | none\|none\|right\|right | primary | abc |
|
||||
| bc | | primary | abc |
|
||||
| bd | | primary | bdeh |
|
||||
| de | left\|none\|none\|right | primary | bdeh |
|
||||
| eh | | primary | bdeh |
|
||||
| ef | | primary | feg |
|
||||
| eg | | primary | feg |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,g | abc,bdeh,feg,feg | depart,turn right,turn left,arrive | ,none:false none:false right:true right:false,left:true none:false none:false right:false, |
|
||||
| a,f | abc,bdeh,feg,feg | depart,turn right,turn right,arrive | ,none:false none:false right:false right:true,left:false none:false none:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Tripple Right keeping Left
|
||||
Given the node map
|
||||
| a | | | | b | | i |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| f | | e | | | | g |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | j | d | | c | | |
|
||||
| | | | | h | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | name |
|
||||
| abi | \|\|right\|right | primary | start |
|
||||
| bch | \|\|right\|right | primary | first |
|
||||
| cdj | \|\|right\|right | primary | second |
|
||||
| de | left\|right\|right | secondary | third |
|
||||
| feg | | tertiary | fourth |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,f | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,turn left,arrive | ,none:false none:false right:true right:false,none:false none:false right:true right:false,none:false none:false right:true right:false,left:true right:false right:false, |
|
||||
| a,g | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,turn right,arrive | ,none:false none:false right:true right:true,none:false none:false right:true right:true,none:false none:false right:true right:true,left:false right:true right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Tripple Left keeping Right
|
||||
Given the node map
|
||||
| i | | b | | | | a |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| g | | | | e | | f |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | c | | d | j | |
|
||||
| | | h | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | highway | name |
|
||||
| abi | left\|left\|\| | primary | start |
|
||||
| bch | left\|left\|\| | primary | first |
|
||||
| cdj | left\|left\|\| | primary | second |
|
||||
| de | left\|left\|right | secondary | third |
|
||||
| feg | | tertiary | fourth |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn right,arrive | ,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:false right:true, |
|
||||
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
|
||||
@@ -0,0 +1,35 @@
|
||||
@routing @guidance
|
||||
Feature: Features related to bugs
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 5 meters
|
||||
|
||||
@2852
|
||||
Scenario: Loop
|
||||
Given the node map
|
||||
| a | 1 | | g | | | b |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| e | | | | | | f |
|
||||
| | | | | | | |
|
||||
| | | | | | | 2 |
|
||||
| d | | | h | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| agb | top | yes |
|
||||
| bfc | right | yes |
|
||||
| chd | bottom | yes |
|
||||
| dea | left | yes |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| g | traffic_signals |
|
||||
| f | traffic_signals |
|
||||
| h | traffic_signals |
|
||||
| e | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| 1,2 | top,right,right | depart,new name right,arrive |
|
||||
@@ -0,0 +1,53 @@
|
||||
@routing @guidance @collapsing
|
||||
Feature: Collapse
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 5 meters
|
||||
|
||||
@reverse
|
||||
Scenario: Collapse U-Turn Triangle Intersection
|
||||
Given the node map
|
||||
| g | | f | | e | | d |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| a | | | b | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | primary | road | yes |
|
||||
| defg | primary | road | yes |
|
||||
| fb | primary_link | | |
|
||||
| be | primary_link | | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||
|
||||
@reverse @traffic-signals
|
||||
Scenario: Collapse U-Turn Triangle Intersection
|
||||
Given the node map
|
||||
| g | | f | | j | | e | | d |
|
||||
| | | | | | | | | |
|
||||
| | | | h | | i | | | |
|
||||
| | | | | | | | | |
|
||||
| a | | | | b | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | primary | road | yes |
|
||||
| dejfg | primary | road | yes |
|
||||
| fhb | primary_link | | |
|
||||
| bie | primary_link | | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| j | traffic_signals |
|
||||
| h | traffic_signals |
|
||||
| i | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||
@@ -136,6 +136,12 @@ Feature: Collapse
|
||||
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||
Given the node map
|
||||
| | n | | m | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | g | | h | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
@@ -144,6 +150,12 @@ Feature: Collapse
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | j | | i | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | k | | l | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
@@ -152,8 +164,8 @@ Feature: Collapse
|
||||
| de | primary | first | yes |
|
||||
| ef | primary | first | yes |
|
||||
| be | primary | first | no |
|
||||
| gbh | primary | second | yes |
|
||||
| iej | primary | second | yes |
|
||||
| ngbhm | primary | second | yes |
|
||||
| liejk | primary | second | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -176,6 +188,10 @@ Feature: Collapse
|
||||
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||
Given the node map
|
||||
| | n | | m | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | g | | h | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
@@ -184,6 +200,10 @@ Feature: Collapse
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | j | | i | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | k | | l | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
@@ -192,8 +212,8 @@ Feature: Collapse
|
||||
| de | primary | first | yes |
|
||||
| ef | primary | first | yes |
|
||||
| be | primary | second | no |
|
||||
| gbh | primary | second | yes |
|
||||
| iej | primary | second | yes |
|
||||
| ngbhm | primary | second | yes |
|
||||
| liejk | primary | second | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -302,12 +322,12 @@ Feature: Collapse
|
||||
|
||||
Scenario: Entering a segregated road
|
||||
Given the node map
|
||||
| | a | f | | |
|
||||
| | | | | g |
|
||||
| | b | e | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| c | d | | | |
|
||||
| | a | f | | | | g |
|
||||
| | | | | | | |
|
||||
| | b | e | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| c | d | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
@@ -325,7 +345,6 @@ Feature: Collapse
|
||||
| g,f | second,first,first | depart,turn right,arrive |
|
||||
| g,c | second,first,first | depart,end of road left,arrive |
|
||||
|
||||
|
||||
Scenario: Do not collapse turning roads
|
||||
Given the node map
|
||||
| | | e | | |
|
||||
@@ -333,12 +352,12 @@ Feature: Collapse
|
||||
| a | | b | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | first |
|
||||
| bc | primary | first |
|
||||
| cd | primary | first |
|
||||
| ce | primary | second |
|
||||
| bf | primary | third |
|
||||
| nodes | highway | name | oneway |
|
||||
| ab | primary | first | yes |
|
||||
| bc | primary | first | yes |
|
||||
| cd | primary | first | yes |
|
||||
| ce | primary | second | yes |
|
||||
| bf | primary | third | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -383,13 +402,13 @@ Feature: Collapse
|
||||
|
||||
Scenario: Pankenbruecke
|
||||
Given the node map
|
||||
| h | | | | | | i | | | | | | |
|
||||
| | | b | c | d | e | f | | | | | | g |
|
||||
| a | | | | | | | | | | | | |
|
||||
| j | | | | h | | | | | | i | | | | | | |
|
||||
| | | | | | | b | c | d | e | f | | | | | | g |
|
||||
| k | | | | a | | | | | | | | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abh | primary | inroad | yes |
|
||||
| kabhj | primary | inroad | yes |
|
||||
| bc | primary | inroad | no |
|
||||
| cd | primary | bridge | no |
|
||||
| defg | primary | outroad | no |
|
||||
@@ -506,6 +525,36 @@ Feature: Collapse
|
||||
| icf | secondary | in | yes |
|
||||
| gbj | secondary | out | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| i,h | in,road,road | depart,turn left,arrive |
|
||||
| a,d | road,road | depart,arrive |
|
||||
| a,j | road,out,out | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Segregated Intersection into Very Slight Turn
|
||||
Given the node map
|
||||
| h | | | | | | |
|
||||
| a | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | g | | | | |
|
||||
| | | b | | | | |
|
||||
| | | | f | | | |
|
||||
| | | | c | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | e |
|
||||
| | | | | | | d |
|
||||
| | | j | i | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abcd | primary | road | yes |
|
||||
| efgh | primary | road | yes |
|
||||
| icf | secondary | in | yes |
|
||||
| gbj | secondary | out | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| i,h | in,road,road | depart,turn slight left,arrive |
|
||||
@@ -525,9 +574,9 @@ Feature: Collapse
|
||||
| cf | secondary | bottom |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,continue right,end of road right,arrive | road,road,road,road |
|
||||
| d,a | depart,continue left,end of road left,arrive | road,road,road,road |
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,continue right,turn right,arrive | road,road,road,road |
|
||||
| d,a | depart,continue left,turn left,arrive | road,road,road,road |
|
||||
|
||||
Scenario: Forking before a turn
|
||||
Given the node map
|
||||
@@ -571,26 +620,28 @@ Feature: Collapse
|
||||
| bd | road | yes | primary |
|
||||
| bc | road | yes | primary |
|
||||
| de | road | yes | primary |
|
||||
| fdcg | cross | no | secondary |
|
||||
| fd | cross | no | secondary |
|
||||
| dc | cross | no | secondary |
|
||||
| cg | cross | no | secondary |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | fdcg | d | no_left_turn |
|
||||
| restriction | bc | fdcg | c | no_right_turn |
|
||||
| restriction | bd | dc | d | no_left_turn |
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road | depart,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road | depart,arrive |
|
||||
|
||||
Scenario: Forking before a turn (forky)
|
||||
Given the node map
|
||||
| | | | g | | |
|
||||
| | | | | | |
|
||||
| | | | c | | |
|
||||
| a | b | | | | |
|
||||
| | | | | d | |
|
||||
| | | | | f | e |
|
||||
| | | | | | g | | |
|
||||
| | | | | | | | |
|
||||
| | | | | | c | | |
|
||||
| a | | | b | | | | |
|
||||
| | | | | | | d | |
|
||||
| | | | | | | f | e |
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
@@ -598,21 +649,23 @@ Feature: Collapse
|
||||
| bd | road | yes | primary |
|
||||
| bc | road | yes | primary |
|
||||
| de | road | yes | primary |
|
||||
| fdcg | cross | no | secondary |
|
||||
| fd | cross | no | secondary |
|
||||
| dc | cross | no | secondary |
|
||||
| cg | cross | no | secondary |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | fdcg | d | no_left_turn |
|
||||
| restriction | bc | fdcg | c | no_right_turn |
|
||||
| restriction | bd | dc | d | no_left_turn |
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road,road | depart,continue slight right,arrive |
|
||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road,road | depart,continue slight right,arrive |
|
||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
||||
|
||||
Scenario: On-Off on Highway
|
||||
Scenario: On-Off on Highway
|
||||
Given the node map
|
||||
| f | | | |
|
||||
| a | b | c | d |
|
||||
@@ -630,3 +683,158 @@ Feature: Collapse
|
||||
| f,d | on,Hwy,Hwy | depart,merge slight right,arrive |
|
||||
| f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive |
|
||||
| a,e | Hwy,off,off | depart,off ramp right,arrive |
|
||||
|
||||
@negative @straight
|
||||
Scenario: Don't collapse going straight if actual turn
|
||||
Given the node map
|
||||
| | c | e | | |
|
||||
| | | d | | f |
|
||||
| | | | | |
|
||||
| | | b | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | a | | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway |
|
||||
| abc | main | primary |
|
||||
| bde | straight | residential |
|
||||
| df | right | residential |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | main,main | depart,arrive |
|
||||
| a,e | main,straight,straight | depart,turn straight,arrive |
|
||||
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive |
|
||||
|
||||
Scenario: Entering a segregated road
|
||||
Given the node map
|
||||
| | a | f | | |
|
||||
| | | | | g |
|
||||
| | b | e | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| c | d | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | primary | first | yes |
|
||||
| def | primary | first | yes |
|
||||
| be | primary | first | no |
|
||||
| ge | primary | second | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Entering a segregated road slight turn
|
||||
Given the node map
|
||||
| | | a | f | |
|
||||
| | | | | g |
|
||||
| | b | e | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| c | d | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | primary | first | yes |
|
||||
| def | primary | first | yes |
|
||||
| be | primary | first | no |
|
||||
| ge | primary | second | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Do not collapse UseLane step when lanes change
|
||||
Given the node map
|
||||
| | | | f | g | |
|
||||
| | | | | | |
|
||||
| a | b | c | d | | e |
|
||||
| | | | | | |
|
||||
| | | | h | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | | main |
|
||||
| bc | left\|through\|through\|through\|right | main |
|
||||
| cd | left\|through\|right | main |
|
||||
| de | | main |
|
||||
| cf | | off |
|
||||
| ch | | off |
|
||||
| dg | | off |
|
||||
| di | | off |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | main,main,main | depart,use lane straight,arrive |
|
||||
|
||||
Scenario: But _do_ collapse UseLane step when lanes stay the same
|
||||
Given the node map
|
||||
| | | | f | g | |
|
||||
| | | | | | |
|
||||
| a | b | c | d | | e |
|
||||
| | | | | | |
|
||||
| | | | h | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | | main |
|
||||
| bc | left\|through\|through\|through\|right | main |
|
||||
| cd | left\|through\|through\|through\|right | main |
|
||||
| de | | main |
|
||||
| cf | | off |
|
||||
| ch | | off |
|
||||
| dg | | off |
|
||||
| di | | off |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | main,main | depart,arrive |
|
||||
|
||||
Scenario: Don't collapse different travel modes
|
||||
Given the node map
|
||||
| g | | | | | | | h | |
|
||||
| a | b | | c | | | | e | f |
|
||||
| | | | | | d | | | |
|
||||
| | | | i | j | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | road |
|
||||
| bc | primary | ferry | |
|
||||
| cd | primary | | road |
|
||||
| de | | ferry | |
|
||||
| ef | primary | | road |
|
||||
| bg | service | | turn |
|
||||
| ci | service | | turn |
|
||||
| dj | service | | turn |
|
||||
| eh | service | | turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,f | road,,road,,road,road |
|
||||
|
||||
Scenario: U-Turn onto a Ferry
|
||||
Given the node map
|
||||
| | | | | | | i | | |
|
||||
| j | e | | | | | d | c | h |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| k | g | | | | | a | b | f |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name | oneway |
|
||||
| bf | primary | | road | yes |
|
||||
| hcd | primary | | road | yes |
|
||||
| bc | primary | | | yes |
|
||||
| di | service | | serv | yes |
|
||||
| ed | | ferry | ferry | |
|
||||
| gab | | ferry | ferry | |
|
||||
| kg | primary | | on | yes |
|
||||
| ej | primary | | off | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| k,j | on,ferry,,ferry,off,off | depart,new name straight,continue uturn,turn straight,new name straight,arrive |
|
||||
|
||||
@@ -52,25 +52,26 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| efg | primary | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp slight right,merge slight left,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp slight right,turn straight,arrive |
|
||||
|
||||
Scenario: Inner city expressway with on road
|
||||
Given the node map
|
||||
| a | b | | | | c |
|
||||
| | | | | f | |
|
||||
| | | | | | |
|
||||
| | | | | | |
|
||||
| | | | | | |
|
||||
| | | | | | d |
|
||||
| | | | | | |
|
||||
| | | | | | |
|
||||
| | | | | | |
|
||||
| | | | | | e |
|
||||
| a | b | | | | c | g |
|
||||
| | | | | f | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | d | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | e | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | primary | road |
|
||||
| cg | primary | road |
|
||||
| bfd | trunk_link | |
|
||||
| cde | trunk | trunk |
|
||||
|
||||
@@ -123,3 +124,143 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,f | road,road,road | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Schwarzwaldstrasse Autobahn
|
||||
Given the node map
|
||||
| | | | | i | | | | | | h | | | | | g |
|
||||
| | | j | | | | | | | | | | | | | |
|
||||
| a | | | | | | | k | | | | | | | | |
|
||||
| | | | b | | r | c | | d | | e | | | | | f |
|
||||
| | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | |
|
||||
| | | | | | l | | | | | | | | | | |
|
||||
| | | | | | m | | | | | | | | | | |
|
||||
| | | | | | | n | | q | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | |
|
||||
| | | | | | | o | | p | | | | | | | |
|
||||
|
||||
And the nodes
|
||||
# the traffic light at `l` is not actually in the data, but necessary for the test to check everything
|
||||
# http://www.openstreetmap.org/#map=19/48.99211/8.40336
|
||||
| node | highway |
|
||||
| r | traffic_signals |
|
||||
| l | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | ref | oneway |
|
||||
| abrcd | secondary | Schwarzwaldstrasse | L561 | yes |
|
||||
| hija | secondary | Schwarzwaldstrasse | L561 | yes |
|
||||
| def | secondary | Ettlinger Strasse | | yes |
|
||||
| gh | secondary | Ettlinger Strasse | | yes |
|
||||
| blmn | secondary_link | | L561 | yes |
|
||||
| hkc | secondary_link | Ettlinger Strasse | | yes |
|
||||
| qdki | secondary_link | Ettlinger Allee | | yes |
|
||||
| cn | secondary_link | Ettlinger Allee | | yes |
|
||||
| no | primary | Ettlinger Allee | | yes |
|
||||
| pq | primary | Ettlinger Allee | | yes |
|
||||
| qe | secondary_link | Ettlinger Allee | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | ref |
|
||||
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,, |
|
||||
|
||||
Scenario: Traffic Lights everywhere
|
||||
#http://map.project-osrm.org/?z=18¢er=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
|
||||
Given the node map
|
||||
| a | | | k | l | | | j | |
|
||||
| | | | | | d | b | c | i |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | e | g | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | 1 | | |
|
||||
| | | | | | | | h | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | f | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| b | traffic_signals |
|
||||
| e | traffic_signals |
|
||||
| g | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| aklbci | secondary | Ebertstrasse | yes |
|
||||
| kdeh | secondary_link | | yes |
|
||||
| jcghf | primary | Brauerstrasse | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
|
||||
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive |
|
||||
|
||||
#2839
|
||||
Scenario: Self-Loop
|
||||
Given the node map
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
||||
| | | | | | | | | | | | | | | | | | | | | | l | | | k | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | j | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | m | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | h |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | n | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g |
|
||||
| | | | | | | | | | | | | | | | | | | o | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f | |
|
||||
| | | | | | | | | | | | | | | | | | p | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | e | | | |
|
||||
| a | | | | | b | | | | | | | | | c | | | | | | | | | | d | | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway | lanes |
|
||||
| abc | circled | no | residential | 1 |
|
||||
| cdefghijklmnopc | circled | yes | residential | 1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | turns |
|
||||
| b,a | 90,10 270,10 | circled,circled | depart,arrive |
|
||||
|
||||
@todo
|
||||
#due to the current turn function, the left turn bcp is exactly the same cost as pcb, a right turn. The right turn should be way faster,though
|
||||
#for that reason we cannot distinguish between driving clockwise through the circle or counter-clockwise. Until this is improved, this case here
|
||||
#has to remain as todo (see #https://github.com/Project-OSRM/osrm-backend/pull/2849)
|
||||
Scenario: Self-Loop - Bidirectional
|
||||
Given the node map
|
||||
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
||||
| | | | | | | | | | | | | | | | | | | | | | l | | | k | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | j | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | m | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | h |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | n | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g |
|
||||
| | | | | | | | | | | | | | | | | | | o | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f | |
|
||||
| | | | | | | | | | | | | | | | | | p | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | e | | | |
|
||||
| a | | | | | b | | | | | | | | | c | | | | | | | | | | d | | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway | lanes |
|
||||
| abc | circled | no | residential | 1 |
|
||||
| cdefghijklmnopc | circled | no | residential | 1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | turns |
|
||||
| b,a | 90,10 270,10 | circled,circled | depart,arrive |
|
||||
|
||||
@@ -29,13 +29,13 @@ Feature: Destination Signs
|
||||
| qr | QR | | | A1;A2 | yes | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | destinations | # |
|
||||
| a | b | AB (E1),AB (E1) | , | |
|
||||
| c | d | CD (Berlin),CD (Berlin) | Berlin,Berlin | |
|
||||
| e | f | EF (A1: Berlin),EF (A1: Berlin) | A1: Berlin,A1: Berlin | |
|
||||
| g | h | , | A1: Berlin,A1: Berlin | |
|
||||
| i | j | , | Berlin,Berlin | |
|
||||
| k | l | KL (E1),KL (E1) | A1: Berlin,A1: Berlin | |
|
||||
| m | n | MN (A1, A2: Berlin, Hamburg),MN (A1, A2: Berlin, Hamburg) | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | |
|
||||
| o | p | OP,OP | , | guard against mis-tagging |
|
||||
| q | r | QR (A1, A2),QR (A1, A2) | A1, A2,A1, A2 | |
|
||||
| from | to | route | destinations | ref | # |
|
||||
| a | b | AB,AB | , | E1,E1 | |
|
||||
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||
| i | j | , | Berlin,Berlin | , | |
|
||||
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||
|
||||
@@ -8,116 +8,156 @@ Feature: End Of Road Instructions
|
||||
Scenario: End of Road with through street
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | | b |
|
||||
| | | d |
|
||||
| a | e | b |
|
||||
| | f | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| aeb | primary |
|
||||
| cbd | primary |
|
||||
| ef | 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 |
|
||||
| waypoints | route | turns |
|
||||
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with three streets
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | | b |
|
||||
| | | d |
|
||||
| a | e | b |
|
||||
| | f | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| aeb | primary |
|
||||
| cb | primary |
|
||||
| bd | primary |
|
||||
| ef | 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 |
|
||||
| waypoints | route | turns |
|
||||
| a,c | aeb,cb,cb | depart,end of road left,arrive |
|
||||
| a,d | aeb,bd,bd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with three streets, slightly angled
|
||||
Given the node map
|
||||
| a | | | | | c |
|
||||
| | | | | | b |
|
||||
| a | e | | | | c |
|
||||
| | f | | | | b |
|
||||
| | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| aeb | primary |
|
||||
| cb | primary |
|
||||
| bd | primary |
|
||||
| ef | 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 |
|
||||
| waypoints | route | turns |
|
||||
| a,c | aeb,cb,cb | depart,end of road left,arrive |
|
||||
| a,d | aeb,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 |
|
||||
| | f | | | | b |
|
||||
| a | e | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| aeb | primary |
|
||||
| ef | 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 |
|
||||
| waypoints | route | turns |
|
||||
| a,c | aeb,cb,cb | depart,end of road left,arrive |
|
||||
| a,d | aeb,bd,bd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with through street, slightly angled
|
||||
Given the node map
|
||||
| a | | | | | c |
|
||||
| | | | | | b |
|
||||
| a | e | | | | c |
|
||||
| | f | | | | b |
|
||||
| | | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| aeb | primary |
|
||||
| ef | 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 |
|
||||
| waypoints | route | turns |
|
||||
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | aeb,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 |
|
||||
| | f | | | | b |
|
||||
| a | e | | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| aeb | primary |
|
||||
| ef | 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 |
|
||||
| waypoints | route | turns |
|
||||
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | aeb,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 |
|
||||
| a | e | b |
|
||||
| | f | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| aeb | primary |
|
||||
| ef | primary |
|
||||
| bc | motorway_link |
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,bc,bc | depart,on ramp left,arrive |
|
||||
| a,d | ab,bd,bd | depart,on ramp right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,c | aeb,bc,bc | depart,on ramp left,arrive |
|
||||
| a,d | aeb,bd,bd | depart,on ramp right,arrive |
|
||||
|
||||
# http://www.openstreetmap.org/#map=19/52.49907/13.41836
|
||||
@end-of-road @negative
|
||||
Scenario: Don't Handle Circles as End-Of-Road
|
||||
Given the node map
|
||||
| | r | | | | q | | | | | | |
|
||||
| | | | | | a | s | | | | | |
|
||||
| | | | b | | | | | | | | |
|
||||
| | | | | | | | j | | | | |
|
||||
| | | | | | | | | | | | |
|
||||
| l | | c | | | | | i | | | | k |
|
||||
| | | | | | | | | | | | |
|
||||
| | | | | | | | h | | | | |
|
||||
| m | | | | | | | | | | | |
|
||||
| | | d | | | | | | | | | n |
|
||||
| | | | e | | | g | | | | | |
|
||||
| | | | | f | | | | | | | |
|
||||
| | | | | o | | p | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abcdefghijsa | secondary | kotti | yes |
|
||||
| ki | secondary | skal | yes |
|
||||
| cl | secondary | skal | yes |
|
||||
| md | secondary | skal | yes |
|
||||
| gn | secondary | skal | yes |
|
||||
| qa | tertiary | adal | no |
|
||||
| br | residential | rei | yes |
|
||||
| fo | secondary | kstr | yes |
|
||||
| pg | secondary | kstr | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | # |
|
||||
| k,l | skal,kotti,skal,skal | depart,turn right,turn right,arrive | # could be a case to find better turn instructions for |
|
||||
|
||||
@@ -296,3 +296,21 @@ Feature: Fork Instructions
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| a,d | abc,bd,bd | depart,turn slight right,arrive |
|
||||
|
||||
Scenario: Fork on motorway links - don't fork on through
|
||||
Given the node map
|
||||
| i | | | | | a |
|
||||
| j | | c | b | | x |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway |
|
||||
| xb | xbcj | motorway_link |
|
||||
| bc | xbcj | motorway_link |
|
||||
| cj | xbcj | motorway_link |
|
||||
| ci | off | motorway_link |
|
||||
| ab | on | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,j | on,xbcj | depart,arrive |
|
||||
| a,i | on,off,off | depart,turn slight right,arrive |
|
||||
|
||||
@@ -17,8 +17,8 @@ Feature: Intersections Data
|
||||
| bd | corner |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,c | through,through | depart,arrive | true:90,true:90 true:180 false:270;true:270 |
|
||||
| waypoints | route | intersections |
|
||||
| a,c | through,through | true:90,true:90 true:180 false:270;true:270 |
|
||||
|
||||
Scenario: Passing Three Way North
|
||||
Given the node map
|
||||
@@ -32,8 +32,8 @@ Feature: Intersections Data
|
||||
| bd | corner |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,c | through,through | depart,arrive | true:90,true:0 true:90 false:270;true:270 |
|
||||
| waypoints | route | intersections |
|
||||
| a,c | through,through | true:90,true:0 true:90 false:270;true:270 |
|
||||
|
||||
Scenario: Passing Oneway Street In
|
||||
Given the node map
|
||||
@@ -47,8 +47,8 @@ Feature: Intersections Data
|
||||
| db | corner | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,c | through,through | depart,arrive | true:90,false:0 true:90 false:270;true:270 |
|
||||
| waypoints | route | intersections |
|
||||
| a,c | through,through | true:90,false:0 true:90 false:270;true:270 |
|
||||
|
||||
Scenario: Passing Oneway Street Out
|
||||
Given the node map
|
||||
@@ -62,8 +62,8 @@ Feature: Intersections Data
|
||||
| bd | corner | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,c | through,through | depart,arrive | true:90,true:0 true:90 false:270;true:270 |
|
||||
| waypoints | route | intersections |
|
||||
| a,c | through,through | true:90,true:0 true:90 false:270;true:270 |
|
||||
|
||||
Scenario: Passing Two Intersections
|
||||
Given the node map
|
||||
@@ -80,27 +80,8 @@ Feature: Intersections Data
|
||||
| cf | corner |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,d | through,through | depart,arrive | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
|
||||
|
||||
Scenario: Regression test #2424
|
||||
Given the node map
|
||||
| | | e | | | | | | i | | | | |
|
||||
| a | | b | | c | | d | | h | | k | | m |
|
||||
| | | | | f | | | | | | l | | |
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| abcd | Fritz-Elsas-Straße |
|
||||
| hkm | Fritz-Elsas-Straße |
|
||||
| dhi | Martin-Luther-Straße |
|
||||
| be | corner |
|
||||
| kl | corner |
|
||||
| cf | corner |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,m | Fritz-Elsas-Straße,Fritz-Elsas-Straße| depart,arrive |
|
||||
| waypoints | route | intersections |
|
||||
| a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
|
||||
|
||||
Scenario: Passing Two Intersections, Collapsing
|
||||
Given the node map
|
||||
@@ -117,9 +98,9 @@ Feature: Intersections Data
|
||||
| cf | corner |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,d | through,through | depart,arrive | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
|
||||
| f,a | corner,through,through | depart,end of road left,arrive | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 |
|
||||
| waypoints | route | intersections |
|
||||
| a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
|
||||
| f,a | corner,through,through | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 |
|
||||
|
||||
Scenario: Roundabouts
|
||||
Given the node map
|
||||
@@ -144,10 +125,10 @@ Feature: Intersections Data
|
||||
| hd | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| e,f | ea,fb,fb | depart,abcda-exit-1,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:90 |
|
||||
| e,g | ea,gc,gc | depart,abcda-exit-2,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:0|
|
||||
| e,h | ea,hd,hd | depart,abcda-exit-3,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330,true:90 false:210 true:330;true:270 |
|
||||
| e,2 | ea,abcda,abcda | depart,abcda-exit-undefined,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:327 +-1|
|
||||
| 1,g | abcda,gc,gc | depart,abcda-exit-2,arrive | true:214;true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:0|
|
||||
| 1,3 | abcda,abcda | depart,arrive | true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:214|
|
||||
| waypoints | route | intersections |
|
||||
| e,f | ea,fb,fb | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:90 |
|
||||
| e,g | ea,gc,gc | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:0 |
|
||||
| e,h | ea,hd,hd | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330,true:90 false:210 true:330;true:270 |
|
||||
| e,2 | ea,abcda,abcda | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:327 +-1 |
|
||||
| 1,g | abcda,gc,gc | true:214;false:30 true:150 true:270,true:30 true:180 false:330;true:0 |
|
||||
| 1,3 | abcda,abcda | true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:214 |
|
||||
|
||||
@@ -3,13 +3,14 @@ Feature: Merging
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
And a grid size of 10 meters
|
||||
|
||||
@merge
|
||||
Scenario: Merge on Four Way Intersection
|
||||
Given the node map
|
||||
| d | | |
|
||||
| a | b | c |
|
||||
| e | | |
|
||||
| d | | | | | | | | | |
|
||||
| a | | b | | | | | | | c |
|
||||
| e | | | | | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
@@ -18,14 +19,15 @@ Feature: Merging
|
||||
| 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 |
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,turn straight,arrive |
|
||||
| e,c | eb,abc,abc | depart,turn straight,arrive |
|
||||
|
||||
@merge
|
||||
Scenario: Merge on Three Way Intersection Right
|
||||
Given the node map
|
||||
| d | | |
|
||||
| a | b | c |
|
||||
| d | | | | | | | | | |
|
||||
| a | | b | | | | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
@@ -33,13 +35,14 @@ Feature: Merging
|
||||
| db | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,merge slight right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,turn straight,arrive |
|
||||
|
||||
Scenario: Merge on Three Way Intersection Right
|
||||
@merge @negative
|
||||
Scenario: Don't Merge on Short-Three Way Intersection Right
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| d | | |
|
||||
| d | | | | | | | |
|
||||
| a | | b | | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
@@ -47,6 +50,67 @@ Feature: Merging
|
||||
| db | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,merge slight left,arrive |
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,turn slight left,arrive |
|
||||
|
||||
|
||||
@merge
|
||||
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,turn straight,arrive |
|
||||
|
||||
@merge
|
||||
Scenario: Merge onto a turning road
|
||||
Given the node map
|
||||
| | | | | | | e |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | d | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | c | | |
|
||||
| | | | b | | | |
|
||||
| a | | | | | | f |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abcde | primary | road |
|
||||
| fd | residential | in |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| f,e | depart,turn straight,arrive | in,road,road |
|
||||
| f,a | depart,turn sharp left,arrive | in,road,road |
|
||||
|
||||
@merge
|
||||
Scenario: Merge onto a motorway
|
||||
Given the node map
|
||||
| d | | | | | | | | | |
|
||||
| a | | | b | | | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| abc | A100 | motorway | yes |
|
||||
| db | | motorway_link | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | ,A100,A100 | depart,merge slight right,arrive |
|
||||
|
||||
@@ -216,3 +216,21 @@ Feature: Motorway Guidance
|
||||
| waypoints | route | turns |
|
||||
| d,c | db,abc,abc | depart,merge slight left,arrive |
|
||||
| e,c | eb,abc,abc | depart,merge slight right,arrive |
|
||||
|
||||
Scenario: Handle 90 degree off ramps correctly
|
||||
Given the node map
|
||||
| a | | | | |
|
||||
| x | b | | c | y |
|
||||
| | | | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | On | motorway_link | yes |
|
||||
| xb | Hwy | motorway | |
|
||||
| bc | Hwy | motorway | |
|
||||
| cd | Off | motorway_link | yes |
|
||||
| cy | Hwy | motorway | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | On,Hwy,Off,Off | depart,merge slight right,off ramp right,arrive |
|
||||
|
||||
@@ -125,10 +125,10 @@ Feature: New-Name Instructions
|
||||
| | | | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | residential |
|
||||
| bc | residential |
|
||||
| bd | service |
|
||||
| nodes | highway | oneway |
|
||||
| ab | residential | yes |
|
||||
| bc | residential | yes |
|
||||
| bd | service | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
@routing @guidance @perceived-angles
|
||||
Feature: Simple Turns
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 5 meters
|
||||
|
||||
Scenario: Turning into splitting road
|
||||
Given the node map
|
||||
| | a | | |
|
||||
| | b | | |
|
||||
| | | | |
|
||||
| | | | |
|
||||
| c | | d | |
|
||||
| | | | |
|
||||
| | | | e |
|
||||
| | | | |
|
||||
| | | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | road | primary | no |
|
||||
| bc | road | primary | yes |
|
||||
| fdb | road | primary | yes |
|
||||
| de | turn | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| e,a | depart,turn slight right,arrive | turn,road,road |
|
||||
|
||||
Scenario: Middle Island
|
||||
Given the node map
|
||||
| | a | |
|
||||
| | | |
|
||||
| | b | |
|
||||
| c | | h |
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
| d | | g |
|
||||
| | e | |
|
||||
| | | |
|
||||
| | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bcde | road | yes |
|
||||
| eghb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,arrive | road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,arrive | road,road |
|
||||
|
||||
Scenario: Middle Island Over Bridge
|
||||
Given the node map
|
||||
| | a | |
|
||||
| | | |
|
||||
| | b | |
|
||||
| c | | h |
|
||||
| | | |
|
||||
| | | |
|
||||
| 1 | | 2 |
|
||||
| | | |
|
||||
| d | | g |
|
||||
| | e | |
|
||||
| | | |
|
||||
| | f | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bc | road | yes |
|
||||
| cd | bridge | yes |
|
||||
| de | road | yes |
|
||||
| eg | road | yes |
|
||||
| gh | bridge | yes |
|
||||
| hb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,new name straight,arrive | bridge,road,road |
|
||||
| 1,f | depart,new name straight,arrive | bridge,road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,new name straight,arrive | bridge,road,road |
|
||||
| 2,a | depart,new name straight,arrive | bridge,road,road |
|
||||
|
||||
@negative
|
||||
Scenario: Don't Collapse Places:
|
||||
Given the node map
|
||||
| | | | | | | h | | | | | | |
|
||||
| | | | | | | g | | | | | | |
|
||||
| | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | |
|
||||
| a | b | | | | | | | | | | e | f |
|
||||
| | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | |
|
||||
| | | | | | | c | | | | | | |
|
||||
| | | | | | | d | | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | place | no |
|
||||
| cd | bottom | no |
|
||||
| ef | place | no |
|
||||
| gh | top | no |
|
||||
| bcegb | place | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,turn right,arrive | place,bottom,bottom |
|
||||
| a,f | depart,continue left,continue right,arrive | place,place,place,place |
|
||||
| d,f | depart,turn right,continue right,arrive | bottom,place,place,place |
|
||||
| d,h | depart,turn right,continue left,turn right,arrive | bottom,place,place,top,top |
|
||||
@@ -0,0 +1,22 @@
|
||||
@routing @guidance @post-processing
|
||||
Feature: General Post-Processing related features
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
# this testcase used to crash geometry generation (at that time handled during intersection generation)
|
||||
Scenario: Regression test #2424
|
||||
Given the node map
|
||||
| | | e | | | | | | i | | | | |
|
||||
| a | | b | | c | | d | | h | | k | | m |
|
||||
| | | | | f | | | | | | l | | |
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| abcd | Fritz-Elsas-Straße |
|
||||
| hkm | Fritz-Elsas-Straße |
|
||||
| dhi | Martin-Luther-Straße |
|
||||
| be | corner |
|
||||
| kl | corner |
|
||||
| cf | corner |
|
||||
@@ -83,14 +83,14 @@ Feature: Ramp Guidance
|
||||
|
||||
Scenario: Ramp Off Though Street
|
||||
Given the node map
|
||||
| | | c |
|
||||
| a | b | |
|
||||
| | d | |
|
||||
| | | | | c |
|
||||
| a | | | b | |
|
||||
| | | | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | tertiary |
|
||||
| bd | motorway_link |
|
||||
| nodes | highway | oneway |
|
||||
| abc | tertiary | yes |
|
||||
| bd | motorway_link | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -108,9 +108,9 @@ Feature: Ramp Guidance
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,on ramp straight,arrive |
|
||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,on ramp straight,arrive |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
|
||||
Scenario: Fork Ramp Off Turning Though Street
|
||||
Given the node map
|
||||
@@ -124,9 +124,9 @@ Feature: Ramp Guidance
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,on ramp right,arrive |
|
||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,on ramp right,arrive |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
|
||||
Scenario: Fork Ramp
|
||||
Given the node map
|
||||
@@ -174,9 +174,9 @@ Feature: Ramp Guidance
|
||||
| bd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,on ramp slight right,arrive |
|
||||
| a,c | abc,abc,abc | depart,continue slight left,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,d | abc,bd,bd | depart,on ramp slight right,arrive |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
|
||||
Scenario: Fork Slight Ramp on Obvious Through Street
|
||||
Given the node map
|
||||
|
||||
@@ -5,37 +5,6 @@ Feature: Basic Roundabout
|
||||
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 | | |
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
@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 turn left exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,roundabout turn left exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,roundabout turn straight exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,roundabout turn left exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,roundabout turn left exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,roundabout turn straight exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,roundabout turn right exit-1,arrive |
|
||||
@@ -389,3 +389,105 @@ Feature: Basic Roundabout
|
||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive | 0->180,180->224,180->0 |
|
||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive | 0->180,180->224,270->0 |
|
||||
|
||||
Scenario: Enter and Exit - Bearings
|
||||
Given the node map
|
||||
| | | | a | | | |
|
||||
| | | | | | | |
|
||||
| | | i | b | l | | |
|
||||
| h | | g | | c | | d |
|
||||
| | | j | e | k | | |
|
||||
| | | | | | | |
|
||||
| | | | f | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bigjekclb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | bearing |
|
||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive | 0->180,180->270,90->0 |
|
||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive | 0->180,180->270,180->0 |
|
||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive | 0->180,180->270,270->0 |
|
||||
|
||||
Scenario: Large radius Roundabout Intersection and ways modelled out: East Mission St, North 7th St
|
||||
# http://www.openstreetmap.org/way/348812150
|
||||
# Note: grid size is 3 meter, this roundabout is more like 5-10 meters in radius
|
||||
Given the node map
|
||||
| | | | a | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | b | | n | | | |
|
||||
| | | | | | | | | |
|
||||
| | | c | | | | m | | |
|
||||
| | | | | | | | | |
|
||||
| e | | d | | | | k | | l |
|
||||
| | | | | | | | | |
|
||||
| | | f | | | | j | | |
|
||||
| | | | | | | | | |
|
||||
| | | | g | | i | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | h | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction | highway | name |
|
||||
| ab | | tertiary | North 7th St |
|
||||
| ed | | tertiary | East Mission St |
|
||||
| hg | | tertiary | North 7th St |
|
||||
| lk | | tertiary | East Mission St |
|
||||
| bcdfgijkmnb | roundabout | tertiary | Roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | North 7th St,East Mission St,East Mission St | depart,roundabout turn right exit-1,arrive |
|
||||
| a,h | North 7th St,North 7th St,North 7th St | depart,roundabout turn straight exit-2,arrive |
|
||||
| a,l | North 7th St,East Mission St,East Mission St | depart,roundabout turn left exit-3,arrive |
|
||||
| h,l | North 7th St,East Mission St,East Mission St | depart,roundabout turn right exit-1,arrive |
|
||||
| h,a | North 7th St,North 7th St,North 7th St | depart,roundabout turn straight exit-2,arrive |
|
||||
| h,e | North 7th St,East Mission St,East Mission St | depart,roundabout turn left exit-3,arrive |
|
||||
| e,h | East Mission St,North 7th St,North 7th St | depart,roundabout turn right exit-1,arrive |
|
||||
| e,l | East Mission St,East Mission St,East Mission St | depart,roundabout turn straight exit-2,arrive |
|
||||
| e,a | East Mission St,North 7th St,North 7th St | depart,roundabout turn left exit-3,arrive |
|
||||
| l,a | East Mission St,North 7th St,North 7th St | depart,roundabout turn right exit-1,arrive |
|
||||
| l,e | East Mission St,East Mission St,East Mission St | depart,roundabout turn straight exit-2,arrive |
|
||||
| l,h | East Mission St,North 7th St,North 7th St | depart,roundabout turn left exit-3,arrive |
|
||||
|
||||
Scenario: Enter and Exit - Traffic Signals
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | i | b | l | |
|
||||
| h | g | | c | d |
|
||||
| | j | e | k | |
|
||||
| | | f | | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| i | traffic_signals |
|
||||
| j | traffic_signals |
|
||||
| k | traffic_signals |
|
||||
| l | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bigjekclb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,roundabout turn left exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,roundabout turn straight exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,roundabout turn left exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,roundabout turn left exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,roundabout turn straight exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,roundabout turn right exit-1,arrive |
|
||||
|
||||
@@ -5,37 +5,6 @@ Feature: Basic Roundabout
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Enter and Exit
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bgecb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
||||
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
|
||||
|
||||
Scenario: Only Enter
|
||||
Given the node map
|
||||
| | | a | | |
|
||||
@@ -260,7 +229,7 @@ Feature: Basic Roundabout
|
||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
||||
|
||||
Scenario: Collinear in Y
|
||||
Scenario: Collinear in Y
|
||||
Given the node map
|
||||
| | a |
|
||||
| | b |
|
||||
@@ -280,84 +249,138 @@ Feature: Basic Roundabout
|
||||
| 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
|
||||
Scenario: Motorway Roundabout
|
||||
#See 39.933742 -75.082345
|
||||
Given the node map
|
||||
| a | | |
|
||||
| b | | |
|
||||
| c | d | f |
|
||||
| e | | |
|
||||
| | | | | l | | | | a | | i |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | b | | | | |
|
||||
| | | | c | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | h | | |
|
||||
| n | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | d | | | | | | | | j |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | m | | | g | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | e | | f | | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| bcdb | roundabout |
|
||||
| ce | |
|
||||
| df | |
|
||||
| nodes | junction | name | highway | oneway | ref |
|
||||
| ab | | crescent | trunk | yes | US 130 |
|
||||
| bcd | roundabout | crescent | trunk | yes | US 130 |
|
||||
| de | | crescent | trunk | yes | US 130 |
|
||||
| fg | | crescent | trunk | yes | US 130 |
|
||||
| gh | roundabout | crescent | trunk | yes | US 130 |
|
||||
| hi | | crescent | trunk | yes | US 130 |
|
||||
| jh | | | trunk_link | yes | NJ 38 |
|
||||
| hb | roundabout | | trunk_link | yes | NJ 38 |
|
||||
| bl | | | trunk_link | yes | NJ 38 |
|
||||
| cnd | | kaighns | trunk_link | yes | |
|
||||
| dmg | roundabout | | trunk_link | yes | |
|
||||
|
||||
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 |
|
||||
| waypoints | route | turns | ref |
|
||||
| a,e | crescent,crescent,crescent | depart,roundabout-exit-3,arrive | US 130,US 130,US 130 |
|
||||
| j,l | ,, | depart,roundabout-exit-2,arrive | NJ 38,NJ 38,NJ 38 |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
Scenario: Double Roundabout with through-lane
|
||||
#http://map.project-osrm.org/?z=18¢er=38.911752%2C-77.048667&loc=38.912003%2C-77.050831&loc=38.909277%2C-77.042516&hl=en&alt=0
|
||||
Given the node map
|
||||
| a | | |
|
||||
| d | | |
|
||||
| b | c | f |
|
||||
| e | | |
|
||||
| | | | | o | | | | | | | | | | | | n | | | | |
|
||||
| | | | | e | | | | | | | | | | | | j | | | | |
|
||||
| | | | | | | | | | | | | | | | | | | | | |
|
||||
| | | | | | | q | | | | | | | | | | | | | | |
|
||||
| a | | b | | | | | | s | | f | | | | g | | | | i | | k |
|
||||
| | | | | | | r | | | | | | | | | | | p | | | |
|
||||
| | | | | | | | | | | t | | | | | | | | | | |
|
||||
| | | | | c | | d | | | | | | | | | | h | | | | |
|
||||
| | | | | l | | | | | | | | | | | | m | | | | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| i | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ad | |
|
||||
| bcdb | roundabout |
|
||||
| be | |
|
||||
| cf | |
|
||||
| nodes | junction | name | oneway |
|
||||
| bcdrqeb | roundabout | sheridan circle | yes |
|
||||
| ghi | roundabout | dupont circle | yes |
|
||||
| ijg | roundabout | dupont circle | yes |
|
||||
| ab | | massachusetts | no |
|
||||
| sfgpik | | massachusetts | no |
|
||||
| cl | | 23rd street | no |
|
||||
| oe | | r street | no |
|
||||
| jn | | new hampshire | no |
|
||||
| mh | | new hampshire | yes |
|
||||
| rsq | | massachusetts | yes |
|
||||
| ft | | suppressed | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sfgpik | ijg | i | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ad,be,be | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ad,cf,cf | depart,roundabout-exit-2,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,dupont circle-exit-1,arrive |
|
||||
|
||||
Scenario: Collinear in X,Y
|
||||
#2856 - http://www.openstreetmap.org/#map=19/47.23318/-1.56563
|
||||
Scenario: Linked Roundabouts
|
||||
Given the node map
|
||||
| a | | |
|
||||
| c | | |
|
||||
| d | b | f |
|
||||
| e | | |
|
||||
| | | | | | | | | | | | | | x |
|
||||
| | u | | | | | | | | | | | r | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | t | | | | | | | | | | |
|
||||
| | | | | | | | | | | s | | | |
|
||||
| | | v | | | i | | h | | g | | | | |
|
||||
| | | | | | | | | | | | q | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | j | | | | | | | | f | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | a | | | | | | | | e | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | b | | c | | d | | p | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | m | | | | | | | | n | | | |
|
||||
| | | | | l | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | k | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | | | | | | | | | | | | | |
|
||||
| | w | | | | | | | | | | o | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ac | |
|
||||
| bcdb | roundabout |
|
||||
| de | |
|
||||
| bf | |
|
||||
| nodes | junction | name | highway | oneway |
|
||||
| abija | roundabout | egg | primary | yes |
|
||||
| defgd | roundabout | egg | primary | yes |
|
||||
| bcd | roundabout | egg | primary | yes |
|
||||
| ghi | | egg | primary | yes |
|
||||
| amklb | | ll | primary | yes |
|
||||
| wk | | ll | primary | no |
|
||||
| dnope | | lr | secondary | yes |
|
||||
| fqrsg | | tr | primary | yes |
|
||||
| rx | | tr | primary | no |
|
||||
| ituvj | | tl | primary | yes |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| c | give_way |
|
||||
| h | give_way |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | ac,de,de | depart,roundabout-exit-1,arrive |
|
||||
| a,f | ac,bf,bf | depart,roundabout-exit-2,arrive |
|
||||
|
||||
Scenario: Enter and Exit - Bearings
|
||||
Given the node map
|
||||
| | | | a | | | |
|
||||
| | | | | | | |
|
||||
| | | i | b | l | | |
|
||||
| h | | g | | c | | d |
|
||||
| | | j | e | k | | |
|
||||
| | | | | | | |
|
||||
| | | | f | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bigjekclb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | bearing |
|
||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive | 0->180,180->270,90->0 |
|
||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive | 0->180,180->270,180->0 |
|
||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive | 0->180,180->270,270->0 |
|
||||
| waypoints | route | turns |
|
||||
# since we cannot handle these invalid roundabout tags yet, we cannout output roundabout taggings. This will hopefully change some day
|
||||
#| w,x | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive |
|
||||
| w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn slight left,arrive |
|
||||
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
@routing @guidance @staggered-intersections
|
||||
Feature: Staggered Intersections
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 1 meters
|
||||
# Note the one meter grid size: staggered intersections make zig-zags of a couple of meters only
|
||||
|
||||
# https://www.openstreetmap.org/#map=19/39.26022/-84.25144
|
||||
Scenario: Staggered Intersection: Oak St, Cedar Dr
|
||||
Given the node map
|
||||
| | | j | | |
|
||||
| a | b | c | | |
|
||||
| | | d | | |
|
||||
| | | e | f | g |
|
||||
| | | h | | |
|
||||
| | | i | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | residential | Oak St |
|
||||
| efg | residential | Oak St |
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Oak St | depart,arrive |
|
||||
| g,a | Oak St,Oak St | depart,arrive |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if long segment in between
|
||||
Given the node map
|
||||
| | | j | | |
|
||||
| a | b | c | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | d | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | e | f | g |
|
||||
| | | h | | |
|
||||
| | | i | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | residential | Oak St |
|
||||
| efg | residential | Oak St |
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if not left-right or right-left
|
||||
Given the node map
|
||||
| | | j | | |
|
||||
| a | b | c | | |
|
||||
| | | d | | |
|
||||
| g | f | e | | |
|
||||
| | | h | | |
|
||||
| | | i | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | residential | Oak St |
|
||||
| efg | residential | Oak St |
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
|
||||
| g,a | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if the names are not the same
|
||||
Given the node map
|
||||
| | | j | | |
|
||||
| a | b | c | | |
|
||||
| | | d | | |
|
||||
| | | e | f | g |
|
||||
| | | h | | |
|
||||
| | | i | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | residential | Oak St |
|
||||
| efg | residential | Elm St |
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Cedar Dr,Elm St,Elm St | depart,turn right,turn left,arrive |
|
||||
| g,a | Elm St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
@@ -3,7 +3,7 @@ Feature: Suppress New Names on dedicated Suffices
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
Given a grid size of 2000 meters
|
||||
|
||||
Scenario: Suffix To Suffix
|
||||
Given the node map
|
||||
@@ -28,8 +28,8 @@ Feature: Suppress New Names on dedicated Suffices
|
||||
| bc | 42 S | 101 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | 42 N,42 S (101) | depart,arrive |
|
||||
| waypoints | route | turns | ref |
|
||||
| a,c | 42 N,42 S | depart,arrive | ,101 |
|
||||
|
||||
Scenario: Prefix Change
|
||||
Given the node map
|
||||
@@ -44,6 +44,19 @@ Feature: Suppress New Names on dedicated Suffices
|
||||
| waypoints | route | turns |
|
||||
| a,c | West 42,East 42 | depart,arrive |
|
||||
|
||||
Scenario: Prefix Change ref
|
||||
Given the node map
|
||||
| a | | b | | c |
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| ab | West 42 |
|
||||
| bc | 42 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | West 42,42 | depart,arrive |
|
||||
|
||||
Scenario: Prefix Change and Reference
|
||||
Given the node map
|
||||
| a | | b | | c |
|
||||
@@ -54,8 +67,8 @@ Feature: Suppress New Names on dedicated Suffices
|
||||
| bc | East 42 | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | West 42 (101),East 42 | depart,arrive |
|
||||
| waypoints | route | turns | ref |
|
||||
| a,c | West 42,East 42 | depart,arrive | 101, |
|
||||
|
||||
Scenario: Suffix To Suffix - Turn
|
||||
Given the node map
|
||||
|
||||
@@ -32,8 +32,8 @@ Feature: Suppressed Turns
|
||||
| ef | motorway | highway | A1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,f | highway (A1),highway (A1) | depart,arrive |
|
||||
| waypoints | route | turns | ref |
|
||||
| a,f | highway,highway | depart,arrive | A1,A1 |
|
||||
|
||||
|
||||
Scenario: Don't Announce Turn on following major road class -- service
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
@routing @guidance @post-processing
|
||||
Feature: General Post-Processing related features
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 0.1 meters
|
||||
|
||||
# this testcase used to crash geometry generation (at that time handled during intersection generation)
|
||||
Scenario: Regression Test 2754
|
||||
Given the node map
|
||||
| a | b | c | d | e | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | | | | | |
|
||||
| | | | | f | g | h | i | j |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abcde |
|
||||
| ef |
|
||||
| fghij |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,j | ef,ef |
|
||||
File diff suppressed because it is too large
Load Diff
+244
-13
@@ -246,22 +246,28 @@ Feature: Simple Turns
|
||||
|
||||
Scenario: Four Way Intersection Double Through Street Segregated
|
||||
Given the node map
|
||||
| | b | | c | |
|
||||
| i | | | | d |
|
||||
| | | a | | |
|
||||
| h | | | | e |
|
||||
| | g | | f | |
|
||||
| | | | | q | | p | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | b | | c | | | | |
|
||||
| j | | | i | | | | d | | | o |
|
||||
| | | | | | a | | | | | |
|
||||
| k | | | h | | | | e | | | n |
|
||||
| | | | | g | | f | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | | | | | |
|
||||
| | | | | l | | m | | | | |
|
||||
|
||||
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 |
|
||||
| khaij | primary | yes | first |
|
||||
| odaen | primary | yes | first |
|
||||
| qbacp | primary | yes | second |
|
||||
| mfagl | primary | yes | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
@@ -833,3 +839,228 @@ Feature: Simple Turns
|
||||
| a,d | road,road | depart,arrive |
|
||||
| d,i | road,cross,cross | depart,turn left,arrive |
|
||||
| d,g | road,road | depart,arrive |
|
||||
|
||||
Scenario: Go onto turning major road
|
||||
Given the node map
|
||||
| | | | c |
|
||||
| | | | |
|
||||
| | | | |
|
||||
| a | | | b |
|
||||
| | | | |
|
||||
| | | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | primary | road |
|
||||
| bd | residential | in |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,c | depart,arrive | road,road |
|
||||
| d,a | depart,turn left,arrive | in,road,road |
|
||||
| d,c | depart,new name straight,arrive | in,road,road |
|
||||
|
||||
Scenario: Channing Street
|
||||
Given the node map
|
||||
| | | g | f | |
|
||||
| | | | | |
|
||||
| d | | c | b | a |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| | | h | e | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| c | traffic_signals |
|
||||
| b | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Channing Street Northeast | residential | no |
|
||||
| bcd | Channing Street Northwest | residential | yes |
|
||||
| ebf | North Capitol Street Northeast | primary | yes |
|
||||
| gch | North Capitol Street Northeast | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,arrive | Channing Street Northeast,Channing Street Northwest |
|
||||
| a,h | depart,turn left,arrive | Channing Street Northeast,North Capitol Street Northeast,North Capitol Street Northeast |
|
||||
|
||||
Scenario: V St NW, Florida Ave NW: Turn Instruction
|
||||
# https://www.mapillary.com/app/?focus=map&lat=38.91815595&lng=-77.03880249&z=17&pKey=sCxepTOCTZD3OoBXuqGEOw
|
||||
# http://www.openstreetmap.org/way/6062557#map=19/38.91805/-77.03892
|
||||
Given the node map
|
||||
| y | | | x | | |
|
||||
| | | c | | | |
|
||||
| | d | | | b | a |
|
||||
| | | | | | |
|
||||
| e | | | | | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| abc | V St NW | tertiary | yes |
|
||||
| xcde | Florida Ave NW | tertiary | yes |
|
||||
| yd | Champlain St NW | residential | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,e | depart,turn left,arrive | V St NW,Florida Ave NW,Florida Ave NW |
|
||||
|
||||
# http://www.openstreetmap.org/node/182805179
|
||||
Scenario: Make Sharp Left at Traffic Signal
|
||||
Given the node map
|
||||
| | | | g | | | |
|
||||
| | | | | | | |
|
||||
| | | | f | | | y |
|
||||
| i | | | | | | |
|
||||
| j | k | a | | b | | x |
|
||||
| | | | e | | c | |
|
||||
| | | | | d | | |
|
||||
| | | | | | | |
|
||||
| | | | h | | | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| f | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| yf | yf | trunk_link | yes |
|
||||
| gfeh | Centreville Road | primary | |
|
||||
| fi | fi | trunk_link | yes |
|
||||
| ij | Bloomingdale Road | residential | |
|
||||
| jkabx | Blue Star Memorial Hwy | trunk | |
|
||||
| bcde | bcde | trunk_link | yes |
|
||||
| kh | kh | trunk_link | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,h | depart,off ramp right,turn sharp left,arrive | Blue Star Memorial Hwy,bcde,Centreville Road,Centreville Road |
|
||||
|
||||
@todo
|
||||
# https://www.openstreetmap.org/#map=20/52.51609/13.41080
|
||||
Scenario: Unnecessary Slight Left onto Stralauer Strasse
|
||||
Given the node map
|
||||
| | e | | | | | |
|
||||
| | | | | | | |
|
||||
| a | | b | | c | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Molkenmarkt | secondary | yes |
|
||||
| bc | Stralauer Str | secondary | yes |
|
||||
| cd | Stralauer Str | secondary | yes |
|
||||
| ec | Molkenmarkt | secondary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,arrive | Molkenmarkt,Stralauer Str |
|
||||
| e,d | depart,arrive | Molkenmarkt,Stralauer Str |
|
||||
|
||||
Scenario: Unnecessary Slight Left onto Stralauer Strasse
|
||||
Given the node map
|
||||
| | e | | | | | |
|
||||
| | | | | | | |
|
||||
| a | | b | | c | | d |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Molkenmarkt | secondary | yes |
|
||||
| bc | Molkenmarkt | secondary | yes |
|
||||
| cd | Stralauer Str | secondary | yes |
|
||||
| ec | Molkenmarkt | secondary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Scenario: Collapse Turn Instruction, Issue #2725
|
||||
Given the node map
|
||||
| | f | |
|
||||
| | e | |
|
||||
| | | |
|
||||
| | | |
|
||||
| g | | d |
|
||||
| | | |
|
||||
| | | |
|
||||
| h | | c |
|
||||
| | | |
|
||||
| | | |
|
||||
| | b | |
|
||||
| | a | |
|
||||
| | | |
|
||||
| | | |
|
||||
| r | x | s |
|
||||
| | y | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Hermannstr | secondary | |
|
||||
| bc | Hermannstr | secondary | yes |
|
||||
| cd | Hermannbruecke | secondary | yes |
|
||||
| de | Hermannstr | secondary | yes |
|
||||
| ef | Hermannstr | secondary | |
|
||||
| eg | Hermannstr | secondary | yes |
|
||||
| gh | Hermannbruecke | secondary | yes |
|
||||
| hb | Hermannstr | secondary | yes |
|
||||
| xa | Hermannstr | secondary | |
|
||||
| yx | Hermannstr | secondary | |
|
||||
| rxs | Silbersteinstr | tertiary | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||
|
||||
Scenario: Collapse Turn Instruction, Issue #2725 - not trivially mergable at e
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Given the node map
|
||||
| | f | |
|
||||
| | e | |
|
||||
| g | | d |
|
||||
| | | |
|
||||
| | | |
|
||||
| h | | c |
|
||||
| | | |
|
||||
| | | |
|
||||
| | b | |
|
||||
| | a | |
|
||||
| | | |
|
||||
| | | |
|
||||
| r | x | s |
|
||||
| | y | |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Hermannstr | secondary | |
|
||||
| bc | Hermannstr | secondary | yes |
|
||||
| cd | Hermannbruecke | secondary | yes |
|
||||
| de | Hermannstr | secondary | yes |
|
||||
| ef | Hermannstr | secondary | |
|
||||
| eg | Hermannstr | secondary | yes |
|
||||
| gh | Hermannbruecke | secondary | yes |
|
||||
| hb | Hermannstr | secondary | yes |
|
||||
| xa | Hermannstr | secondary | |
|
||||
| yx | Hermannstr | secondary | |
|
||||
| rxs | Silbersteinstr | tertiary | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||
|
||||
@@ -7,7 +7,7 @@ Feature: osrm-routed command line options: invalid options
|
||||
Scenario: osrm-routed - Non-existing option
|
||||
When I run "osrm-routed --fly-me-to-the-moon"
|
||||
Then stdout should be empty
|
||||
And stderr should contain "exception"
|
||||
And stderr should contain "unrecognised"
|
||||
And stderr should contain "fly-me-to-the-moon"
|
||||
And it should exit with code 1
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = function () {
|
||||
this.setContractArgs(args, callback);
|
||||
});
|
||||
|
||||
this.Given(/^a grid size of (\d+) meters$/, (meters, callback) => {
|
||||
this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => {
|
||||
this.setGridSize(meters);
|
||||
callback();
|
||||
});
|
||||
|
||||
@@ -35,7 +35,8 @@ module.exports = function () {
|
||||
var actual = [];
|
||||
actual.push(table.headers);
|
||||
|
||||
this.reprocessAndLoadData(() => {
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
// compute matrix
|
||||
var params = this.queryParams;
|
||||
|
||||
|
||||
@@ -15,16 +15,4 @@ module.exports = function () {
|
||||
this.setOrigin(this.DEFAULT_ORIGIN);
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Before('@ignore-platform-windows', () => {
|
||||
this.skipThisScenario();
|
||||
});
|
||||
|
||||
this.Before('@ignore-platform-unix', () => {
|
||||
this.skipThisScenario();
|
||||
});
|
||||
|
||||
this.Before('@ignore-platform-mac', () => {
|
||||
this.skipThisScenario();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
var util = require('util');
|
||||
var d3 = require('d3-queue');
|
||||
var polyline = require('polyline');
|
||||
|
||||
module.exports = function () {
|
||||
this.When(/^I match I should get$/, (table, callback) => {
|
||||
var got;
|
||||
|
||||
this.reprocessAndLoadData(() => {
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
var testRow = (row, ri, cb) => {
|
||||
var afterRequest = (err, res) => {
|
||||
if (err) return cb(err);
|
||||
@@ -35,6 +37,7 @@ module.exports = function () {
|
||||
route = '',
|
||||
duration = '',
|
||||
annotation = '',
|
||||
geometry = '',
|
||||
OSMIDs = '';
|
||||
|
||||
|
||||
@@ -63,6 +66,11 @@ module.exports = function () {
|
||||
annotation = this.annotationList(json.matchings[0]);
|
||||
}
|
||||
|
||||
if (headers.has('geometry')) {
|
||||
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
||||
geometry = json.matchings[0].geometry;
|
||||
}
|
||||
|
||||
if (headers.has('OSM IDs')) {
|
||||
if (json.matchings.length != 1) throw new Error('*** CHecking annotation only supported for matchings with one subtrace');
|
||||
OSMIDs = this.OSMIDList(json.matchings[0]);
|
||||
@@ -85,6 +93,13 @@ module.exports = function () {
|
||||
got.annotation = annotation.toString();
|
||||
}
|
||||
|
||||
if (headers.has('geometry')) {
|
||||
if (this.queryParams['geometries'] === 'polyline')
|
||||
got.geometry = polyline.decode(geometry).toString();
|
||||
else
|
||||
got.geometry = geometry;
|
||||
}
|
||||
|
||||
if (headers.has('OSM IDs')) {
|
||||
got['OSM IDs'] = OSMIDs;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ var util = require('util');
|
||||
|
||||
module.exports = function () {
|
||||
this.When(/^I request nearest I should get$/, (table, callback) => {
|
||||
this.reprocessAndLoadData(() => {
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
var testRow = (row, ri, cb) => {
|
||||
var inNode = this.findNodeByName(row.in);
|
||||
if (!inNode) throw new Error(util.format('*** unknown in-node "%s"'), row.in);
|
||||
|
||||
@@ -30,6 +30,10 @@ module.exports = function () {
|
||||
assert.equal(this.exitCode, parseInt(code));
|
||||
});
|
||||
|
||||
this.Then(/^it should exit with code not (\d+)$/, (code) => {
|
||||
assert.notEqual(this.exitCode, parseInt(code));
|
||||
});
|
||||
|
||||
this.Then(/^stdout should contain "(.*?)"$/, (str) => {
|
||||
assert.ok(this.stdout.indexOf(str) > -1);
|
||||
});
|
||||
|
||||
@@ -2,7 +2,8 @@ var assert = require('assert');
|
||||
|
||||
module.exports = function () {
|
||||
this.When(/^I request \/(.*)$/, (path, callback) => {
|
||||
this.reprocessAndLoadData(() => {
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
this.requestPath(path, {}, (err, res, body) => {
|
||||
this.response = res;
|
||||
callback(err, res, body);
|
||||
|
||||
@@ -4,7 +4,8 @@ module.exports = function () {
|
||||
this.When(/^I plan a trip I should get$/, (table, callback) => {
|
||||
var got;
|
||||
|
||||
this.reprocessAndLoadData(() => {
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
var testRow = (row, ri, cb) => {
|
||||
var afterRequest = (err, res) => {
|
||||
if (err) return cb(err);
|
||||
|
||||
@@ -223,7 +223,7 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
['osrm', 'osrm.ebg', 'osrm.edges', 'osrm.enw', 'osrm.fileIndex', 'osrm.geometry', 'osrm.icd',
|
||||
'osrm.names', 'osrm.nodes', 'osrm.properties', 'osrm.ramIndex', 'osrm.restrictions'].forEach(file => {
|
||||
'osrm.names', 'osrm.nodes', 'osrm.properties', 'osrm.ramIndex', 'osrm.restrictions', 'osrm.tld', 'osrm.tls'].forEach(file => {
|
||||
q.defer(rename, file);
|
||||
});
|
||||
|
||||
@@ -283,7 +283,7 @@ module.exports = function () {
|
||||
|
||||
['osrm', 'osrm.core', 'osrm.datasource_indexes', 'osrm.datasource_names', 'osrm.ebg','osrm.edges',
|
||||
'osrm.enw', 'osrm.fileIndex', 'osrm.geometry', 'osrm.hsgr', 'osrm.icd','osrm.level', 'osrm.names',
|
||||
'osrm.nodes', 'osrm.properties', 'osrm.ramIndex', 'osrm.restrictions'].forEach((file) => {
|
||||
'osrm.nodes', 'osrm.properties', 'osrm.ramIndex', 'osrm.restrictions', 'osrm.tld', 'osrm.tls'].forEach((file) => {
|
||||
q.defer(rename, file);
|
||||
});
|
||||
|
||||
@@ -339,7 +339,8 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.reprocessAndLoadData = (callback) => {
|
||||
this.reprocess(() => {
|
||||
this.reprocess((e) => {
|
||||
if (e) return callback(e);
|
||||
this.OSRMLoader.load(util.format('%s.osrm', this.osmData.contractedFile), callback);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ module.exports = function () {
|
||||
this.DEFAULT_GRID_SIZE = 100; // meters
|
||||
this.PROFILES_PATH = path.resolve(this.ROOT_FOLDER, 'profiles');
|
||||
this.FIXTURES_PATH = path.resolve(this.ROOT_FOLDER, 'unit_tests/fixtures');
|
||||
this.BIN_PATH = path.resolve(this.ROOT_FOLDER, 'build');
|
||||
this.BIN_PATH = process.env.OSRM_BUILD_DIR && process.env.OSRM_BUILD_DIR || path.resolve(this.ROOT_FOLDER, 'build');
|
||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||
this.DEFAULT_ORIGIN = [1,1];
|
||||
this.DEFAULT_LOAD_METHOD = 'datastore';
|
||||
|
||||
@@ -33,9 +33,4 @@ module.exports = function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.Around('@stress', (scenario, callback) => {
|
||||
// TODO implement stress timeout? Around support is being dropped in cucumber-js anyway
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -139,6 +139,10 @@ module.exports = function () {
|
||||
return this.extractInstructionList(instructions, s => s.name);
|
||||
};
|
||||
|
||||
this.refList = (instructions) => {
|
||||
return this.extractInstructionList(instructions, s => s.ref || '');
|
||||
};
|
||||
|
||||
this.pronunciationList = (instructions) => {
|
||||
return this.extractInstructionList(instructions, s => s.pronunciation || '');
|
||||
};
|
||||
@@ -152,15 +156,15 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.annotationList = (instructions) => {
|
||||
function zip(list_1, list_2)
|
||||
function zip(list_1, list_2, list_3)
|
||||
{
|
||||
let pairs = [];
|
||||
let tuples = [];
|
||||
for (let i = 0; i < list_1.length; ++i) {
|
||||
pairs.push([list_1[i], list_2[i]]);
|
||||
tuples.push([list_1[i], list_2[i], list_3[i]]);
|
||||
}
|
||||
return pairs;
|
||||
return tuples;
|
||||
}
|
||||
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance).map(p => { return p.join(':'); }).join(','); }).join(',');
|
||||
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
|
||||
};
|
||||
|
||||
this.OSMIDList = (instructions) => {
|
||||
@@ -168,6 +172,17 @@ module.exports = function () {
|
||||
return instructions.legs.map(l => l.annotation.nodes.map(n => n.toString()).join(',')).join(',');
|
||||
};
|
||||
|
||||
this.lanesList = (instructions) => {
|
||||
return this.extractInstructionList(instructions, instruction => {
|
||||
if( 'lanes' in instruction.intersections[0] )
|
||||
{
|
||||
return instruction.intersections[0].lanes.map( p => { return (p.indications).join(';') + ':' + p.valid; } ).join(' ');
|
||||
} else
|
||||
{
|
||||
return '';
|
||||
}});
|
||||
};
|
||||
|
||||
this.turnList = (instructions) => {
|
||||
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
|
||||
.map(v => {
|
||||
|
||||
@@ -24,7 +24,8 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.WhenIRouteIShouldGet = (table, callback) => {
|
||||
this.reprocessAndLoadData(() => {
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
var headers = new Set(table.raw()[0]);
|
||||
|
||||
var requestRow = (row, ri, cb) => {
|
||||
@@ -33,7 +34,8 @@ module.exports = function () {
|
||||
var afterRequest = (err, res, body) => {
|
||||
if (err) return cb(err);
|
||||
if (body && body.length) {
|
||||
let destinations, pronunciations, instructions, bearings, turns, modes, times, distances, summary, intersections;
|
||||
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
||||
distances, summary, intersections, lanes;
|
||||
|
||||
let json = JSON.parse(body);
|
||||
|
||||
@@ -42,6 +44,7 @@ module.exports = function () {
|
||||
if (hasRoute) {
|
||||
instructions = this.wayList(json.routes[0]);
|
||||
pronunciations = this.pronunciationList(json.routes[0]);
|
||||
refs = this.refList(json.routes[0]);
|
||||
destinations = this.destinationsList(json.routes[0]);
|
||||
bearings = this.bearingList(json.routes[0]);
|
||||
turns = this.turnList(json.routes[0]);
|
||||
@@ -49,6 +52,7 @@ module.exports = function () {
|
||||
modes = this.modeList(json.routes[0]);
|
||||
times = this.timeList(json.routes[0]);
|
||||
distances = this.distanceList(json.routes[0]);
|
||||
lanes = this.lanesList(json.routes[0]);
|
||||
summary = this.summary(json.routes[0]);
|
||||
}
|
||||
|
||||
@@ -102,6 +106,10 @@ module.exports = function () {
|
||||
got.time = instructions ? util.format('%ds', time) : '';
|
||||
}
|
||||
|
||||
if (headers.has('lanes')) {
|
||||
got.lanes = (lanes || '').trim();
|
||||
}
|
||||
|
||||
if (headers.has('speed')) {
|
||||
if (row.speed !== '' && instructions) {
|
||||
if (!row.speed.match(/\d+ km\/h/))
|
||||
@@ -121,6 +129,7 @@ module.exports = function () {
|
||||
if (headers.has(key)) got[key] = instructions ? value : '';
|
||||
};
|
||||
|
||||
putValue('ref', refs);
|
||||
putValue('bearing', bearings);
|
||||
putValue('turns', turns);
|
||||
putValue('modes', modes);
|
||||
|
||||
@@ -233,7 +233,7 @@ Feature: Basic Routing
|
||||
| d | a | abcd,abcd |
|
||||
| a | m | aeim,aeim |
|
||||
| m | a | aeim,aeim |
|
||||
|
||||
|
||||
Scenario: Testbot - Triangle challenge
|
||||
Given the node map
|
||||
| | | | d |
|
||||
@@ -251,3 +251,39 @@ Feature: Basic Routing
|
||||
| from | to | route |
|
||||
| d | c | de,ce,ce |
|
||||
| e | d | de,de |
|
||||
|
||||
Scenario: Ambiguous edge weights - Use minimal edge weight
|
||||
Given the node map
|
||||
| a | b |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | tertiary | |
|
||||
| ab | primary | |
|
||||
| ab | secondary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | b | , | 10s |
|
||||
| b | a | , | 10s |
|
||||
|
||||
Scenario: Ambiguous edge names - Use lexicographically smallest name
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | |
|
||||
| ab | primary | Αβγ |
|
||||
| ab | primary | |
|
||||
| ab | primary | Abc |
|
||||
| ab | primary | |
|
||||
| ab | primary | Абв |
|
||||
| bc | primary | Ηθι |
|
||||
| bc | primary | Δεζ |
|
||||
| bc | primary | Где |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | Abc,Δεζ,Δεζ |
|
||||
| c | a | Δεζ,Abc,Abc |
|
||||
|
||||
@@ -59,10 +59,10 @@ Feature: Compass bearing
|
||||
|
||||
Scenario: Bearing in a roundabout
|
||||
Given the node map
|
||||
| | d | c | |
|
||||
| k | d | c | j |
|
||||
| e | | | b |
|
||||
| f | | | a |
|
||||
| | g | h | |
|
||||
| l | g | h | i |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
@@ -74,6 +74,14 @@ Feature: Compass bearing
|
||||
| fg | yes |
|
||||
| gh | yes |
|
||||
| ha | yes |
|
||||
| dk | no |
|
||||
| ke | no |
|
||||
| fl | no |
|
||||
| lg | no |
|
||||
| hi | no |
|
||||
| ia | no |
|
||||
| bj | no |
|
||||
| cj | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | bearing |
|
||||
@@ -82,8 +90,10 @@ Feature: Compass bearing
|
||||
|
||||
Scenario: Bearing should stay constant when zig-zagging
|
||||
Given the node map
|
||||
| i | j | k | |
|
||||
| b | d | f | h |
|
||||
| a | c | e | g |
|
||||
| | m | n | o |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
@@ -94,6 +104,12 @@ Feature: Compass bearing
|
||||
| ef |
|
||||
| fg |
|
||||
| gh |
|
||||
| bi |
|
||||
| cm |
|
||||
| dj |
|
||||
| en |
|
||||
| fk |
|
||||
| go |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | bearing |
|
||||
|
||||
@@ -14,11 +14,11 @@ Feature: Bearing parameter
|
||||
| ad |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| from | to | bearings | route | bearing |
|
||||
| b | c | 90 90 | ad,ad | 0->90,90->0|
|
||||
| b | c | 180 90 | | |
|
||||
| b | c | 180 90 | | |
|
||||
| b | c | 80 100 | ad,ad | 0->90,90->0|
|
||||
| b | c | 79 100 | | |
|
||||
| b | c | 79 100 | | |
|
||||
| b | c | 79,11 100 | ad,ad | 0->90,90->0|
|
||||
|
||||
Scenario: Testbot - Intial bearing in simple case
|
||||
@@ -33,13 +33,13 @@ Feature: Bearing parameter
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | c | 0 0 | | |
|
||||
| 0 | c | 45 45 | bc,bc | 0->44,44->0 +- 1|
|
||||
| 0 | c | 85 85 | | |
|
||||
| 0 | c | 95 95 | | |
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | c | 0 0 | | |
|
||||
| 0 | c | 45 45 | bc,bc | 0->44,44->0 +- 1 |
|
||||
| 0 | c | 85 85 | | |
|
||||
| 0 | c | 95 95 | | |
|
||||
| 0 | c | 135 135 | ac,ac | 0->135,135->0 +- 1|
|
||||
| 0 | c | 180 180 | | |
|
||||
| 0 | c | 180 180 | | |
|
||||
|
||||
Scenario: Testbot - Initial bearing on split way
|
||||
Given the node map
|
||||
@@ -58,21 +58,21 @@ Feature: Bearing parameter
|
||||
| ha | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | b | 10 10 | bc,bc | 0->0,0->0 |
|
||||
| 0 | b | 90 90 | ab,ab | 0->90,90->0 |
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | b | 10 10 | bc,bc | 0->0,0->0 |
|
||||
| 0 | b | 90 90 | ab,ab | 0->90,90->0 |
|
||||
# The returned bearing is wrong here, it's based on the snapped
|
||||
# coordinates, not the acutal edge bearing. This should be
|
||||
# fixed one day, but it's only a problem when we snap two vias
|
||||
# to the same point - DP
|
||||
#| 0 | b | 170 170 | da | 180 |
|
||||
#| 0 | b | 189 189 | da | 180 |
|
||||
| 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 |
|
||||
| 1 | d | 10 10 | bc,bc | 0->0,0->0 |
|
||||
#| 0 | b | 170 170 | da | 180 |
|
||||
#| 0 | b | 189 189 | da | 180 |
|
||||
| 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 |
|
||||
| 1 | d | 10 10 | bc,bc | 0->0,0->0 |
|
||||
| 1 | d | 90 90 | ab,bc,cd,da,da | 0->90,90->0,0->270,270->180,180->0 |
|
||||
| 1 | 0 | 189 189 | da,da | 0->180,180->0 |
|
||||
| 1 | d | 270 270 | cd,cd | 0->270,270->0 |
|
||||
| 1 | d | 349 349 | | |
|
||||
| 1 | 0 | 189 189 | da,da | 0->180,180->0 |
|
||||
| 1 | d | 270 270 | cd,cd | 0->270,270->0 |
|
||||
| 1 | d | 349 349 | | |
|
||||
|
||||
Scenario: Testbot - Initial bearing in all direction
|
||||
Given the node map
|
||||
@@ -104,12 +104,12 @@ Feature: Bearing parameter
|
||||
| ha | yes | ring |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | q | 0 90 | ia,ring,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | q | 90 90 | kc,ring,ring,ring,ring | 0->90,90->180,270->0,0->90,90->0 |
|
||||
| 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,0->90,90->0 |
|
||||
| 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,90->0 |
|
||||
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
|
||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | q | 0 90 | ia,ring,ring | 0->0,0->90,90->0 |
|
||||
| 0 | a | 45 90 | jb,ring,ring | 0->45,45->180,90->0 |
|
||||
| 0 | q | 90 90 | kc,ring,ring | 0->90,90->180,90->0 |
|
||||
| 0 | a | 135 90 | ld,ring,ring | 0->135,135->270,90->0 |
|
||||
| 0 | a | 180 90 | me,ring,ring | 0->180,180->270,90->0 |
|
||||
| 0 | a | 225 90 | nf,ring,ring | 0->225,225->0,90->0 |
|
||||
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
|
||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||
|
||||
@@ -3,7 +3,7 @@ Feature: U-turns at via points
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 100 meters
|
||||
Given a grid size of 250 meters
|
||||
|
||||
Scenario: Continue straight at waypoints enabled by default
|
||||
Given the node map
|
||||
|
||||
@@ -24,3 +24,18 @@ Feature: Fixed bugs, kept to check for regressions
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| x | y | abc,abc |
|
||||
|
||||
Scenario: Step trimming with very short segments
|
||||
Given a grid size of 0.1 meters
|
||||
Given the node map
|
||||
| a | 1 | b | c | d | 2 | e |
|
||||
|
||||
Given the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| bcd | yes |
|
||||
| de | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| 1 | 2 | bcd,bcd |
|
||||
|
||||
@@ -75,12 +75,12 @@ Feature: Avoid weird loops caused by rounding errors
|
||||
And the node map
|
||||
| a | | |
|
||||
| b | e | |
|
||||
| | | 1 |
|
||||
| h | | 1 |
|
||||
| | | |
|
||||
| | | 2 |
|
||||
| | | |
|
||||
| g | | |
|
||||
| | c | f |
|
||||
| | d | |
|
||||
| d | | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
@@ -90,6 +90,8 @@ Feature: Avoid weird loops caused by rounding errors
|
||||
| be | primary |
|
||||
| ef | primary |
|
||||
| cf | primary |
|
||||
| cg | primary |
|
||||
| bh | primary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
|
||||
@@ -4,6 +4,7 @@ Feature: Basic Map Matching
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
|
||||
Scenario: Testbot - Map matching with outlier that has no candidate
|
||||
Given a grid size of 100 meters
|
||||
@@ -118,13 +119,38 @@ Feature: Basic Map Matching
|
||||
| abcdegh | no |
|
||||
| ci | no |
|
||||
|
||||
And the speed file
|
||||
"""
|
||||
1,2,36
|
||||
"""
|
||||
|
||||
And the contract extra arguments "--segment-speed-file speeds.csv"
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | annotation |
|
||||
| abeh | abcedgh | 1:9.897633,0:0,1:10.008842,1:10.008842,1:10.008842,0:0,2:20.017685,1:10.008842 |
|
||||
| abci | abc,ci | 1:9.897633,0:0,1:10.008842,0:0.111209,1:10.010367 |
|
||||
| trace | matchings | annotation |
|
||||
| abeh | abcedgh | 1:9.897633:1,0:0:0,1:10.008842:0,1:10.008842:0,1:10.008842:0,0:0:0,2:20.017685:0,1:10.008842:0 |
|
||||
| abci | abc,ci | 1:9.897633:1,0:0:0,1:10.008842:0,0:0.111209:0,1:10.010367:0 |
|
||||
|
||||
# The following is the same as the above, but separated for readability (line length)
|
||||
When I match I should get
|
||||
| trace | matchings | OSM IDs |
|
||||
| abeh | abcedgh | 1,2,3,2,3,4,5,4,5,6,7 |
|
||||
| abci | abc,ci | 1,2,3,2,3,8,3,8 |
|
||||
|
||||
Scenario: Testbot - Geometry details
|
||||
Given the query options
|
||||
| overview | full |
|
||||
| geometries | polyline |
|
||||
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
| | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abc | no |
|
||||
| bd | no |
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | geometry |
|
||||
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
|
||||
|
||||
@@ -3,6 +3,7 @@ Feature: Testbot - oneways
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 250 meters
|
||||
|
||||
Scenario: Routing on a oneway roundabout
|
||||
Given the node map
|
||||
@@ -59,8 +60,8 @@ Feature: Testbot - oneways
|
||||
|
||||
Scenario: Testbot - Around the Block
|
||||
Given the node map
|
||||
| a | b |
|
||||
| d | c |
|
||||
| | a | b | |
|
||||
| e | d | c | f |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
@@ -68,6 +69,8 @@ Feature: Testbot - oneways
|
||||
| bc | | no |
|
||||
| cd | | no |
|
||||
| da | | no |
|
||||
| de | | no |
|
||||
| cf | | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
@routing @testbot @sidebias
|
||||
Feature: Testbot - side bias
|
||||
|
||||
Scenario: Left hand bias
|
||||
Given the profile "lhs"
|
||||
And the node map
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | | d | | |
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| bd |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| d | a | bd,ab,ab | 82s +-1 |
|
||||
| d | c | bd,bc,bc | 100s +-1 |
|
||||
|
||||
Scenario: Right hand bias
|
||||
Given the profile "rhs"
|
||||
And the node map
|
||||
| a | | b | | c |
|
||||
| | | | | |
|
||||
| | | d | | |
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| bd |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| d | a | bd,ab,ab | 100s +-1 |
|
||||
| d | c | bd,bc,bc | 82s +-1 |
|
||||
|
||||
Scenario: Roundabout exit counting for left sided driving
|
||||
Given the profile "lhs"
|
||||
And a grid size of 10 meters
|
||||
And the node map
|
||||
| | | a | | |
|
||||
| | | b | | |
|
||||
| h | g | | c | d |
|
||||
| | | e | | |
|
||||
| | | f | | |
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| ab | |
|
||||
| cd | |
|
||||
| ef | |
|
||||
| gh | |
|
||||
| bcegb | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
|
||||
|
||||
Scenario: Mixed Entry and Exit
|
||||
Given the profile "lhs"
|
||||
And a grid size of 10 meters
|
||||
And the node map
|
||||
| | c | | a | |
|
||||
| j | | b | | f |
|
||||
| | k | | e | |
|
||||
| l | | h | | d |
|
||||
| | g | | i | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway |
|
||||
| cba | | yes |
|
||||
| fed | | yes |
|
||||
| ihg | | yes |
|
||||
| lkj | | yes |
|
||||
| behkb | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| c,a | cba,cba,cba | depart,roundabout-exit-1,arrive |
|
||||
| l,a | lkj,cba,cba | depart,roundabout-exit-2,arrive |
|
||||
| i,a | ihg,cba,cba | depart,roundabout-exit-3,arrive |
|
||||
@@ -29,7 +29,7 @@ Feature: Basic Routing
|
||||
Scenario: Check handling empty values
|
||||
Given the node map
|
||||
| a | b | | c | | d | f |
|
||||
| | | | | | e |
|
||||
| | | | | | e | |
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
|
||||
@@ -145,14 +145,16 @@ Feature: Estimation of travel time
|
||||
|
||||
Scenario: Time of travel on a series of ways
|
||||
Given the node map
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
| a | b | e |
|
||||
| f | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| cd | primary |
|
||||
| be | primary |
|
||||
| cf | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
|
||||
@@ -23,7 +23,7 @@ Feature: Traffic - turn penalties applied to turn onto which a phantom node snap
|
||||
Scenario: Weighting based on turn penalty file, with an extreme negative value -- clamps and does not fail
|
||||
Given the turn penalty file
|
||||
"""
|
||||
1,2,5,0
|
||||
1,2,5,0,comment
|
||||
3,4,7,-20
|
||||
"""
|
||||
And the contract extra arguments "--turn-penalty-file penalties.csv"
|
||||
|
||||
@@ -19,3 +19,18 @@ Feature: Handling of UTF characters
|
||||
| a | b | Scandinavian København,Scandinavian København |
|
||||
| b | c | Japanese 東京,Japanese 東京 |
|
||||
| c | d | Cyrillic Москва,Cyrillic Москва |
|
||||
|
||||
|
||||
@todo
|
||||
Scenario: Up to 255 Unicode Code Points (255 x Panda Code Point)
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway |
|
||||
| ab | ab | primary |
|
||||
| bc | 🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 | primary |
|
||||
|
||||
When I route 100 times I should get
|
||||
| from | to | route |
|
||||
| a | c | ab,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 |
|
||||
|
||||
@@ -85,13 +85,16 @@ Feature: Via points
|
||||
Scenario: Via points on ring of oneways
|
||||
# xa it to avoid only having a single ring, which cna trigger edge cases
|
||||
Given the node map
|
||||
| x | | | | | | |
|
||||
| a | 1 | b | 2 | c | 3 | d |
|
||||
| f | | | | | | e |
|
||||
| | x | | | | | | g | |
|
||||
| | a | 1 | b | 2 | c | 3 | d | |
|
||||
| i | f | | | | | | e | h |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| xa | |
|
||||
| if | |
|
||||
| gd | |
|
||||
| eh | |
|
||||
| ab | yes |
|
||||
| bc | yes |
|
||||
| cd | yes |
|
||||
@@ -110,13 +113,16 @@ Feature: Via points
|
||||
Scenario: Via points on ring on the same oneway
|
||||
# xa it to avoid only having a single ring, which cna trigger edge cases
|
||||
Given the node map
|
||||
| x | | | | |
|
||||
| a | 1 | 2 | 3 | b |
|
||||
| d | | | | c |
|
||||
| | x | | | | e | |
|
||||
| | a | 1 | 2 | 3 | b | |
|
||||
| g | d | | | | c | f |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| xa | |
|
||||
| eb | |
|
||||
| cf | |
|
||||
| dg | |
|
||||
| ab | yes |
|
||||
| bc | yes |
|
||||
| cd | yes |
|
||||
@@ -167,7 +173,7 @@ Feature: Via points
|
||||
| c,d,a | abc,bd,bd,bd,abc,abc |
|
||||
|
||||
# See issue #2349
|
||||
@bug
|
||||
@bug @todo
|
||||
Scenario: Via point at a dead end with oneway
|
||||
Given the node map
|
||||
| a | b | c |
|
||||
@@ -256,3 +262,38 @@ Feature: Via points
|
||||
| 3,2,1 | ab,bc,cd,da,ab,ab,ab,bc,cd,da,ab,ab | 3000m +-1 |
|
||||
| 6,5,4 | bc,cd,da,ab,bc,bc,bc,cd,da,ab,bc,bc | 3000m +-1 |
|
||||
| 9,8,7 | cd,da,ab,bc,cd,cd,cd,da,ab,bc,cd,cd | 3000m +-1 |
|
||||
|
||||
# See issue #2706
|
||||
# this case is currently broken. It simply works as put here due to staggered intersections triggering a name collapse.
|
||||
# See 2824 for further information
|
||||
@todo
|
||||
Scenario: Incorrect ordering of nodes can produce multiple U-turns
|
||||
Given the node map
|
||||
| | a | | | |
|
||||
| e | b | c | d | f |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcd | no |
|
||||
| ebbdcf | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| e | f | ebbdcf,ebbdcf |
|
||||
|
||||
@2798
|
||||
Scenario: UTurns Enabled
|
||||
Given the node map
|
||||
| a | b | c | d | e |
|
||||
|
||||
And the query options
|
||||
| continue_straight | false |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abc | yes |
|
||||
| edc | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,b,e | |
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# Fuzz testing using LLVM's libFuzzer.
|
||||
#
|
||||
# See:
|
||||
# - http://llvm.org/docs/LibFuzzer.html
|
||||
# - http://llvm.org/releases/3.8.0/docs/LibFuzzer.html
|
||||
#
|
||||
# TODO(daniel-j-h):
|
||||
# - make more user friendly, at the moment we require you to build and install libFuzzer.a
|
||||
# - pick up LLVM_ROOT
|
||||
# - build libFuzzer on the fly
|
||||
#
|
||||
# clang++ -std=c++11 -stdlib=libc++ -c -g -O2 ~/llvm/lib/Fuzzer/*.cpp -I~/llvm/lib/Fuzzer
|
||||
# ar ruv libFuzzer.a Fuzzer*.o
|
||||
|
||||
if (ENABLE_FUZZING)
|
||||
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(nproc)
|
||||
|
||||
macro(add_fuzz_target binary)
|
||||
add_executable(${binary} ${binary}.cc $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:SERVER>)
|
||||
target_link_libraries(${binary} Fuzzer osrm)
|
||||
target_include_directories(${binary} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_custom_target(fuzz-${binary}
|
||||
DEPENDS ${binary}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "corpus/${binary}"
|
||||
COMMAND ${binary} -use_traces=1 -jobs=${nproc} -workers=${nproc} -max_len=4096 "corpus/${binary}"
|
||||
COMMENT "Fuzzing ${binary}" VERBATIM)
|
||||
endmacro ()
|
||||
|
||||
|
||||
set(ServerTargets
|
||||
"match_parameters"
|
||||
"nearest_parameters"
|
||||
"route_parameters"
|
||||
"table_parameters"
|
||||
"tile_parameters"
|
||||
"trip_parameters"
|
||||
"url_parser"
|
||||
"request_parser")
|
||||
|
||||
foreach (target ${ServerTargets})
|
||||
add_fuzz_target(${target})
|
||||
endforeach ()
|
||||
|
||||
|
||||
set(UtilTargets
|
||||
"escape_json"
|
||||
"uri_decode")
|
||||
|
||||
foreach (target ${UtilTargets})
|
||||
add_fuzz_target(${target})
|
||||
endforeach ()
|
||||
|
||||
|
||||
endif ()
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "util/string_util.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::util::escape_JSON;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
const std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
const auto escaped = escape_JSON(in);
|
||||
escape(escaped.data());
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "engine/api/match_parameters.hpp"
|
||||
#include "server/api/parameters_parser.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::api::parseParameters;
|
||||
using osrm::engine::api::MatchParameters;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
const auto last = end(in);
|
||||
|
||||
const auto param = parseParameters<MatchParameters>(first, last);
|
||||
escape(¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "engine/api/nearest_parameters.hpp"
|
||||
#include "server/api/parameters_parser.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::api::parseParameters;
|
||||
using osrm::engine::api::NearestParameters;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
const auto last = end(in);
|
||||
|
||||
const auto param = parseParameters<NearestParameters>(first, last);
|
||||
escape(¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include "server/request_parser.hpp"
|
||||
#include "server/http/request.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::RequestParser;
|
||||
using osrm::server::http::request;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
auto last = end(in);
|
||||
|
||||
RequestParser parser;
|
||||
request req;
|
||||
|
||||
// &(*it) is needed to go from iterator to underlying item to pointer to underlying item
|
||||
parser.parse(req, &(*first), &(*last));
|
||||
|
||||
escape(&req);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "engine/api/route_parameters.hpp"
|
||||
#include "server/api/parameters_parser.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::api::parseParameters;
|
||||
using osrm::engine::api::RouteParameters;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
const auto last = end(in);
|
||||
|
||||
const auto param = parseParameters<RouteParameters>(first, last);
|
||||
escape(¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "engine/api/table_parameters.hpp"
|
||||
#include "server/api/parameters_parser.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::api::parseParameters;
|
||||
using osrm::engine::api::TableParameters;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
const auto last = end(in);
|
||||
|
||||
const auto param = parseParameters<TableParameters>(first, last);
|
||||
escape(¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "engine/api/tile_parameters.hpp"
|
||||
#include "server/api/parameters_parser.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::api::parseParameters;
|
||||
using osrm::engine::api::TileParameters;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
const auto last = end(in);
|
||||
|
||||
const auto param = parseParameters<TileParameters>(first, last);
|
||||
escape(¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "engine/api/trip_parameters.hpp"
|
||||
#include "server/api/parameters_parser.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::api::parseParameters;
|
||||
using osrm::engine::api::TripParameters;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
const auto last = end(in);
|
||||
|
||||
const auto param = parseParameters<TripParameters>(first, last);
|
||||
escape(¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "server/api/url_parser.hpp"
|
||||
#include "util/string_util.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::util::URIDecode;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
const std::string in(reinterpret_cast<const char *>(data), size);
|
||||
std::string out;
|
||||
|
||||
(void)URIDecode(in, out);
|
||||
|
||||
escape(out.data());
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "server/api/url_parser.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::api::parseURL;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
const auto last = end(in);
|
||||
|
||||
const auto param = parseURL(first, last);
|
||||
escape(¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef OSRM_FUZZ_UTIL_HPP
|
||||
#define OSRM_FUZZ_UTIL_HPP
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
// Fakes observable side effects the compiler can not optimize away
|
||||
template <typename T> inline void escape(T p)
|
||||
{
|
||||
static_assert(std::is_pointer<T>::value, "");
|
||||
asm volatile("" : : "g"((void *)p) : "memory");
|
||||
}
|
||||
|
||||
// Possibly reads and writes all the memory in your system
|
||||
inline void clobber() { asm volatile("" : : : "memory"); }
|
||||
|
||||
#endif
|
||||
@@ -78,7 +78,7 @@ class Contractor
|
||||
private:
|
||||
ContractorConfig config;
|
||||
|
||||
std::size_t
|
||||
EdgeID
|
||||
LoadEdgeExpandedGraph(const std::string &edge_based_graph_path,
|
||||
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||
const std::string &edge_segment_lookup_path,
|
||||
|
||||
@@ -82,6 +82,9 @@ class IteratorbasedCRC32
|
||||
: "0"(crc), "c"(*str));
|
||||
++str;
|
||||
}
|
||||
#else
|
||||
(void)str;
|
||||
(void)len;
|
||||
#endif
|
||||
return crc;
|
||||
}
|
||||
@@ -95,8 +98,11 @@ class IteratorbasedCRC32
|
||||
}
|
||||
|
||||
#if defined(__MINGW64__) || defined(_MSC_VER) || !defined(__x86_64__)
|
||||
inline void
|
||||
__get_cpuid(int param, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx) const
|
||||
inline void __get_cpuid(int /*param*/,
|
||||
unsigned * /*eax*/,
|
||||
unsigned * /*ebx*/,
|
||||
unsigned *ecx,
|
||||
unsigned * /*edx*/) const
|
||||
{
|
||||
*ecx = 0;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "engine/guidance/assemble_overview.hpp"
|
||||
#include "engine/guidance/assemble_route.hpp"
|
||||
#include "engine/guidance/assemble_steps.hpp"
|
||||
#include "engine/guidance/lane_processing.hpp"
|
||||
#include "engine/guidance/post_processing.hpp"
|
||||
|
||||
#include "engine/internal_route_result.hpp"
|
||||
@@ -149,6 +150,9 @@ class RouteAPI : public BaseAPI
|
||||
leg_geometry,
|
||||
phantoms.source_phantom,
|
||||
phantoms.target_phantom);
|
||||
leg.steps = guidance::removeLanesFromRoundabouts(std::move(leg.steps));
|
||||
leg.steps = guidance::anticipateLaneChange(std::move(leg.steps));
|
||||
leg.steps = guidance::collapseUseLane(std::move(leg.steps));
|
||||
leg_geometry = guidance::resyncGeometry(std::move(leg_geometry), leg.steps);
|
||||
}
|
||||
|
||||
@@ -203,19 +207,22 @@ class RouteAPI : public BaseAPI
|
||||
util::json::Array durations;
|
||||
util::json::Array distances;
|
||||
util::json::Array nodes;
|
||||
util::json::Array datasources;
|
||||
auto &leg_geometry = leg_geometries[idx];
|
||||
|
||||
durations.values.reserve(leg_geometry.annotations.size());
|
||||
distances.values.reserve(leg_geometry.annotations.size());
|
||||
nodes.values.reserve(leg_geometry.osm_node_ids.size());
|
||||
datasources.values.reserve(leg_geometry.annotations.size());
|
||||
|
||||
std::for_each(
|
||||
leg_geometry.annotations.begin(),
|
||||
leg_geometry.annotations.end(),
|
||||
[this, &durations, &distances](const guidance::LegGeometry::Annotation &step) {
|
||||
durations.values.push_back(step.duration);
|
||||
distances.values.push_back(step.distance);
|
||||
});
|
||||
std::for_each(leg_geometry.annotations.begin(),
|
||||
leg_geometry.annotations.end(),
|
||||
[this, &durations, &distances, &datasources](
|
||||
const guidance::LegGeometry::Annotation &step) {
|
||||
durations.values.push_back(step.duration);
|
||||
distances.values.push_back(step.distance);
|
||||
datasources.values.push_back(step.datasource);
|
||||
});
|
||||
std::for_each(leg_geometry.osm_node_ids.begin(),
|
||||
leg_geometry.osm_node_ids.end(),
|
||||
[this, &nodes](const OSMNodeID &node_id) {
|
||||
@@ -225,6 +232,7 @@ class RouteAPI : public BaseAPI
|
||||
annotation.values["distance"] = std::move(distances);
|
||||
annotation.values["duration"] = std::move(durations);
|
||||
annotation.values["nodes"] = std::move(nodes);
|
||||
annotation.values["datasources"] = std::move(datasources);
|
||||
annotations.push_back(std::move(annotation));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "extractor/edge_based_node.hpp"
|
||||
#include "extractor/external_memory_node.hpp"
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "extractor/guidance/turn_lane_types.hpp"
|
||||
#include "engine/phantom_node.hpp"
|
||||
#include "util/exception.hpp"
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
@@ -138,6 +139,11 @@ class BaseDataFacade
|
||||
const int bearing,
|
||||
const int bearing_range) const = 0;
|
||||
|
||||
virtual bool hasLaneData(const EdgeID id) const = 0;
|
||||
virtual util::guidance::LaneTupelIdPair GetLaneData(const EdgeID id) const = 0;
|
||||
virtual extractor::guidance::TurnLaneDescription
|
||||
GetTurnDescription(const LaneDescriptionID lane_description_id) const = 0;
|
||||
|
||||
virtual unsigned GetCheckSum() const = 0;
|
||||
|
||||
virtual bool IsCoreNode(const NodeID id) const = 0;
|
||||
@@ -146,6 +152,8 @@ class BaseDataFacade
|
||||
|
||||
virtual std::string GetNameForID(const unsigned name_id) const = 0;
|
||||
|
||||
virtual std::string GetRefForID(const unsigned name_id) const = 0;
|
||||
|
||||
virtual std::string GetPronunciationForID(const unsigned name_id) const = 0;
|
||||
|
||||
virtual std::string GetDestinationsForID(const unsigned name_id) const = 0;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "storage/storage_config.hpp"
|
||||
#include "engine/geospatial_query.hpp"
|
||||
#include "util/graph_loader.hpp"
|
||||
#include "util/guidance/turn_lanes.hpp"
|
||||
#include "util/io.hpp"
|
||||
#include "util/packed_vector.hpp"
|
||||
#include "util/range_table.hpp"
|
||||
@@ -78,6 +79,8 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
util::ShM<NodeID, false>::vector m_via_node_list;
|
||||
util::ShM<unsigned, false>::vector m_name_ID_list;
|
||||
util::ShM<extractor::guidance::TurnInstruction, false>::vector m_turn_instruction_list;
|
||||
util::ShM<LaneDataID, false>::vector m_lane_data_id;
|
||||
util::ShM<util::guidance::LaneTupelIdPair, false>::vector m_lane_tupel_id_pairs;
|
||||
util::ShM<extractor::TravelMode, false>::vector m_travel_mode_list;
|
||||
util::ShM<char, false>::vector m_names_char_list;
|
||||
util::ShM<unsigned, false>::vector m_geometry_indices;
|
||||
@@ -86,6 +89,8 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
util::ShM<unsigned, false>::vector m_segment_weights;
|
||||
util::ShM<uint8_t, false>::vector m_datasource_list;
|
||||
util::ShM<std::string, false>::vector m_datasource_names;
|
||||
util::ShM<std::uint32_t, false>::vector m_lane_description_offsets;
|
||||
util::ShM<extractor::guidance::TurnLaneType::Mask, false>::vector m_lane_description_masks;
|
||||
extractor::ProfileProperties m_profile_properties;
|
||||
|
||||
std::unique_ptr<InternalRTree> m_static_rtree;
|
||||
@@ -118,6 +123,20 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
sizeof(m_profile_properties));
|
||||
}
|
||||
|
||||
void LoadLaneTupelIdPairs(const boost::filesystem::path &lane_data_path)
|
||||
{
|
||||
boost::filesystem::ifstream in_stream(lane_data_path);
|
||||
if (!in_stream)
|
||||
{
|
||||
throw util::exception("Could not open " + lane_data_path.string() + " for reading.");
|
||||
}
|
||||
std::uint64_t size;
|
||||
in_stream.read(reinterpret_cast<char *>(&size), sizeof(size));
|
||||
m_lane_tupel_id_pairs.resize(size);
|
||||
in_stream.read(reinterpret_cast<char *>(&m_lane_tupel_id_pairs[0]),
|
||||
sizeof(m_lane_tupel_id_pairs) * size);
|
||||
}
|
||||
|
||||
void LoadTimestamp(const boost::filesystem::path ×tamp_path)
|
||||
{
|
||||
util::SimpleLogger().Write() << "Loading Timestamp";
|
||||
@@ -173,6 +192,7 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
m_via_node_list.resize(number_of_edges);
|
||||
m_name_ID_list.resize(number_of_edges);
|
||||
m_turn_instruction_list.resize(number_of_edges);
|
||||
m_lane_data_id.resize(number_of_edges);
|
||||
m_travel_mode_list.resize(number_of_edges);
|
||||
m_entry_class_id_list.resize(number_of_edges);
|
||||
|
||||
@@ -184,6 +204,7 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
m_via_node_list[i] = current_edge_data.via_node;
|
||||
m_name_ID_list[i] = current_edge_data.name_id;
|
||||
m_turn_instruction_list[i] = current_edge_data.turn_instruction;
|
||||
m_lane_data_id[i] = current_edge_data.lane_data_id;
|
||||
m_travel_mode_list[i] = current_edge_data.travel_mode;
|
||||
m_entry_class_id_list[i] = current_edge_data.entry_classid;
|
||||
}
|
||||
@@ -251,9 +272,9 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
}
|
||||
BOOST_ASSERT(datasources_stream);
|
||||
|
||||
std::size_t number_of_datasources = 0;
|
||||
std::uint64_t number_of_datasources = 0;
|
||||
datasources_stream.read(reinterpret_cast<char *>(&number_of_datasources),
|
||||
sizeof(std::size_t));
|
||||
sizeof(number_of_datasources));
|
||||
if (number_of_datasources > 0)
|
||||
{
|
||||
m_datasource_list.resize(number_of_datasources);
|
||||
@@ -284,6 +305,15 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
new InternalGeospatialQuery(*m_static_rtree, m_coordinate_list, *this));
|
||||
}
|
||||
|
||||
void LoadLaneDescriptions(const boost::filesystem::path &lane_description_file)
|
||||
{
|
||||
if (!util::deserializeAdjacencyArray(lane_description_file.string(),
|
||||
m_lane_description_offsets,
|
||||
m_lane_description_masks))
|
||||
util::SimpleLogger().Write(logWARNING) << "Failed to read turn lane descriptions from "
|
||||
<< lane_description_file.string();
|
||||
}
|
||||
|
||||
void LoadStreetNames(const boost::filesystem::path &names_file)
|
||||
{
|
||||
boost::filesystem::ifstream name_stream(names_file, std::ios::binary);
|
||||
@@ -330,7 +360,7 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
std::vector<util::guidance::BearingClass> bearing_classes;
|
||||
// and the actual bearing values
|
||||
std::uint64_t num_bearings;
|
||||
intersection_stream >> num_bearings;
|
||||
intersection_stream.read(reinterpret_cast<char *>(&num_bearings), sizeof(num_bearings));
|
||||
m_bearing_values_table.resize(num_bearings);
|
||||
intersection_stream.read(reinterpret_cast<char *>(&m_bearing_values_table[0]),
|
||||
sizeof(m_bearing_values_table[0]) * num_bearings);
|
||||
@@ -386,11 +416,17 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
util::SimpleLogger().Write() << "loading street names";
|
||||
LoadStreetNames(config.names_data_path);
|
||||
|
||||
util::SimpleLogger().Write() << "loading lane tags";
|
||||
LoadLaneDescriptions(config.turn_lane_description_path);
|
||||
|
||||
util::SimpleLogger().Write() << "loading rtree";
|
||||
LoadRTree();
|
||||
|
||||
util::SimpleLogger().Write() << "loading intersection class data";
|
||||
LoadIntersectionClasses(config.intersection_class_path);
|
||||
|
||||
util::SimpleLogger().Write() << "Loading Lane Data Pairs";
|
||||
LoadLaneTupelIdPairs(config.turn_lane_data_path);
|
||||
}
|
||||
|
||||
// search graph access
|
||||
@@ -600,6 +636,15 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string GetRefForID(const unsigned name_id) const override final
|
||||
{
|
||||
// We store the ref after the name, destination and pronunciation of a street.
|
||||
// We do this to get around the street length limit of 255 which would hit
|
||||
// if we concatenate these. Order (see extractor_callbacks):
|
||||
// name (0), destination (1), pronunciation (2), ref (3)
|
||||
return GetNameForID(name_id + 3);
|
||||
}
|
||||
|
||||
std::string GetPronunciationForID(const unsigned name_id) const override final
|
||||
{
|
||||
// We store the pronunciation after the name and destination of a street.
|
||||
@@ -741,6 +786,29 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
{
|
||||
return m_entry_class_table.at(entry_class_id);
|
||||
}
|
||||
|
||||
bool hasLaneData(const EdgeID id) const override final
|
||||
{
|
||||
return m_lane_data_id[id] != INVALID_LANE_DATAID;
|
||||
}
|
||||
|
||||
util::guidance::LaneTupelIdPair GetLaneData(const EdgeID id) const override final
|
||||
{
|
||||
BOOST_ASSERT(hasLaneData(id));
|
||||
return m_lane_tupel_id_pairs[m_lane_data_id[id]];
|
||||
}
|
||||
|
||||
extractor::guidance::TurnLaneDescription
|
||||
GetTurnDescription(const LaneDescriptionID lane_description_id) const override final
|
||||
{
|
||||
if (lane_description_id == INVALID_LANE_DESCRIPTIONID)
|
||||
return {};
|
||||
else
|
||||
return extractor::guidance::TurnLaneDescription(
|
||||
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id],
|
||||
m_lane_description_masks.begin() +
|
||||
m_lane_description_offsets[lane_description_id + 1]);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user