Compare commits

..

1 Commits

Author SHA1 Message Date
Daniel Patterson 1cd1d187d2 Official 5.11.0 release 2017-08-17 14:43:50 -07:00
605 changed files with 18020 additions and 30613 deletions
-1
View File
@@ -13,4 +13,3 @@
!profiles/* !profiles/*
!profiles/lib/* !profiles/lib/*
!profiles/examples/* !profiles/examples/*
!scripts/node_install.sh
+28 -48
View File
@@ -7,13 +7,16 @@ git:
sudo: required sudo: required
dist: trusty dist: trusty
node_js:
- "4"
- "6"
notifications: notifications:
email: false email: false
branches: branches:
only: only:
- master - master
- "5.13"
# enable building tags # enable building tags
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ - /^v\d+\.\d+(\.\d+)?(-\S*)?$/
@@ -69,34 +72,25 @@ matrix:
addons: &gcc6 addons: &gcc6
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'lcov'] packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000 env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
before_script:
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --zerocounters # clean cached da files
after_success: after_success:
# Creating report - bash <(curl -s https://codecov.io/bash)
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --capture --output-file coverage.info # capture coverage info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
- lcov --list coverage.info #debug info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
- os: linux - os: linux
compiler: "gcc-6-debug-asan" compiler: "gcc-6-debug-asan"
addons: &gcc6 addons: &gcc6
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf" env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000
- os: linux - os: linux
compiler: "clang-4.0-debug" compiler: "clang-4.0-debug"
addons: &clang40 addons: &clang40
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev'] packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
- os: linux - os: linux
@@ -104,8 +98,8 @@ matrix:
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf" env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON
# Release Builds # Release Builds
- os: linux - os: linux
@@ -113,7 +107,7 @@ matrix:
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
- os: linux - os: linux
@@ -121,7 +115,7 @@ matrix:
addons: &gcc6 addons: &gcc6
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
- os: linux - os: linux
@@ -135,7 +129,7 @@ matrix:
addons: &gcc6 addons: &gcc6
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' ENABLE_STXXL=On env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' ENABLE_STXXL=On
- os: linux - os: linux
@@ -143,22 +137,14 @@ matrix:
addons: &gcc49 addons: &gcc49
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'ccache'] packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release' env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
- os: osx - os: osx
osx_image: xcode8.2 osx_image: xcode8.2
compiler: "mason-osx-release" compiler: "mason-osx-release"
# we use the xcode provides clang and don't install our own # we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="4" env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON
after_success:
- ./scripts/travis/publish.sh
- os: osx
osx_image: xcode8.2
compiler: "mason-osx-release"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="6"
after_success: after_success:
- ./scripts/travis/publish.sh - ./scripts/travis/publish.sh
@@ -168,7 +154,7 @@ matrix:
#- addons: &clang40 #- addons: &clang40
#- apt: #- apt:
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test'] #- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev'] #- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' #- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release'
# Shared Library # Shared Library
@@ -177,7 +163,7 @@ matrix:
addons: &gcc6 addons: &gcc6
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
# Disabled because CI slowness # Disabled because CI slowness
@@ -186,7 +172,7 @@ matrix:
#- addons: &clang40 #- addons: &clang40
#- apt: #- apt:
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test'] #- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev'] #- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON #- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
# Node build jobs. These skip running the tests. # Node build jobs. These skip running the tests.
@@ -196,7 +182,7 @@ matrix:
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
@@ -205,8 +191,7 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \ -DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \ -DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS} - make --jobs=${JOBS}
- popd - popd
script: script:
@@ -220,7 +205,7 @@ matrix:
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
@@ -229,8 +214,7 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \ -DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \ -DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS} - make --jobs=${JOBS}
- popd - popd
script: script:
@@ -244,7 +228,7 @@ matrix:
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
@@ -253,8 +237,7 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \ -DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \ -DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS} - make --jobs=${JOBS}
- popd - popd
script: script:
@@ -268,7 +251,7 @@ matrix:
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
@@ -277,8 +260,7 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \ -DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \ -DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS} - make --jobs=${JOBS}
- popd - popd
script: script:
@@ -352,8 +334,7 @@ install:
-DENABLE_STXXL=${ENABLE_STXXL:-OFF} \ -DENABLE_STXXL=${ENABLE_STXXL:-OFF} \
-DBUILD_TOOLS=ON \ -DBUILD_TOOLS=ON \
-DENABLE_CCACHE=ON \ -DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF}
- echo "travis_fold:start:MAKE" - echo "travis_fold:start:MAKE"
- make --jobs=${JOBS} - make --jobs=${JOBS}
- make tests --jobs=${JOBS} - make tests --jobs=${JOBS}
@@ -380,7 +361,6 @@ script:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
- ./unit_tests/library-tests - ./unit_tests/library-tests
- ./unit_tests/extractor-tests - ./unit_tests/extractor-tests
- ./unit_tests/contractor-tests
- ./unit_tests/engine-tests - ./unit_tests/engine-tests
- ./unit_tests/util-tests - ./unit_tests/util-tests
- ./unit_tests/server-tests - ./unit_tests/server-tests
+1 -54
View File
@@ -1,56 +1,3 @@
# 5.13.0
- Changes from 5.12:
- Profile:
- Append cardinal directions from route relations to ref fields to improve instructions; off by default see `profile.cardinal_directions`
- Support of `distance` weight in foot and bicycle profiles
- Support of relations processing
- Added `way:get_location_tag(key)` method to get location-dependent tags https://github.com/Project-OSRM/osrm-backend/wiki/Using-location-dependent-data-in-profiles
- Added `forward_ref` and `backward_ref` support
- Left-side driving mode is specified by a local Boolean flag `is_left_hand_driving` in `ExtractionWay` and `ExtractionTurn`
- Support literal values for maxspeeds in NO, PL and ZA
- Infrastructure:
- Lua 5.1 support is removed due to lack of support in sol2 https://github.com/ThePhD/sol2/issues/302
- Fixed pkg-config version of OSRM
- Removed `.osrm.core` file since CoreCH is deprecated now.
- Tools:
- Because of boost/program_options#32 with boost 1.65+ we needed to change the behavior of the following flags to not accept `={true|false}` anymore:
- `--use-locations-cache=false` becomes `--disable-location-cache`
- `--parse-conditional-restrictions=true` becomes `--parse-conditional-restrictions`
- The deprecated options `--use-level-cache` and `--generate-edge-lookup`
- Bugfixes:
- Fixed #4348: Some cases of sliproads pre-processing were broken
- Fixed #4331: Correctly compute left/right modifiers of forks in case the fork is curved.
- Fixed #4472: Correctly count the number of lanes using the delimter in `turn:lanes` tag.
- Fixed #4214: Multiple runs of `osrm-partition` lead to crash.
- Fixed #4348: Fix assorted problems around slip roads.
- Fixed #4420: A bug that would result in unnecessary instructions, due to problems in suffix/prefix detection
- Algorithm
- Deprecate CoreCH functionality. Usage of CoreCH specific options will fall back to using CH with core_factor of 1.0
- MLD uses a unidirectional Dijkstra for 1-to-N and N-to-1 matrices which yields speedup.
# 5.12.0
- Changes from 5.11:
- Guidance
- now announcing turning onto oneways at the end of a road (e.g. onto dual carriageways)
- Adds new instruction types at the exit of roundabouts and rotaries `exit roundabout` and `exit rotary`.
- HTTP:
- New query parameter for route/table/match/trip plugings:
`exclude=` that can be used to exclude certain classes (e.g. exclude=motorway, exclude=toll).
This is configurable in the profile.
- NodeJS:
- New query option `exclude` for the route/table/match/trip plugins. (e.g. `exclude: ["motorway", "toll"]`)
- Profile:
- New property for profile table: `excludable` that can be used to configure which classes are excludable at query time.
- New optional property for profile table: `classes` that allows you to specify which classes you expect to be used.
We recommend this for better error messages around classes, otherwise the possible class names are infered automatically.
- Traffic:
- If traffic data files contain an empty 4th column, they will update edge durations but not modify the edge weight. This is useful for
updating ETAs returned, without changing route selection (for example, in a distance-based profile with traffic data loaded).
- Infrastructure:
- New file `.osrm.cell_metrics` created by `osrm-customize`.
- Debug tiles:
- Added new properties `type` and `modifier` to `turns` layer, useful for viewing guidance calculated turn types on the map
# 5.11.0 # 5.11.0
- Changes from 5.10: - Changes from 5.10:
- Features - Features
@@ -92,7 +39,7 @@
- Bugfixes - Bugfixes
- Properly save/retrieve datasource annotations for road segments ([#4346](https://github.com/Project-OSRM/osrm-backend/issues/4346) - Properly save/retrieve datasource annotations for road segments ([#4346](https://github.com/Project-OSRM/osrm-backend/issues/4346)
- Fix conditional restriction grammer parsing so it works for single-day-of-week restrictions ([#4357](https://github.com/Project-OSRM/osrm-backend/pull/4357)) - Fix conditional restriction grammer parsing so it works for single-day-of-week restrictions ([#4357](https://github.com/Project-OSRM/osrm-backend/pull/4357))
- Algorithm - Algorithm)
- BREAKING: the file format requires re-processing due to the changes on via-ways - BREAKING: the file format requires re-processing due to the changes on via-ways
- Added support for via-way restrictions - Added support for via-way restrictions
+44 -31
View File
@@ -31,13 +31,12 @@ option(ENABLE_LTO "Use LTO if available" OFF)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON) option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
option(ENABLE_GLIBC_WORKAROUND "Workaround GLIBC symbol exports" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(ENABLE_MASON) if(ENABLE_MASON)
# versions in use # versions in use
set(MASON_BOOST_VERSION "1.65.1") set(MASON_BOOST_VERSION "1.63.0")
set(MASON_STXXL_VERSION "1.4.1-1") set(MASON_STXXL_VERSION "1.4.1-1")
set(MASON_EXPAT_VERSION "2.2.0") set(MASON_EXPAT_VERSION "2.2.0")
set(MASON_LUA_VERSION "5.2.4") set(MASON_LUA_VERSION "5.2.4")
@@ -61,7 +60,7 @@ if (POLICY CMP0048)
endif() endif()
project(OSRM C CXX) project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5) set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 13) set(OSRM_VERSION_MINOR 11)
set(OSRM_VERSION_PATCH 0) set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}") set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
@@ -212,19 +211,19 @@ endif()
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring debug mode flags") message(STATUS "Configuring debug mode flags")
set(ENABLE_ASSERTIONS ON) set(ENABLE_ASSERTIONS ON)
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline -fno-omit-frame-pointer")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ggdb")
else()
# Don't override the -O parameter for RelWithDebInfo, we want an optimized build
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
endif()
endif()
endif()
endif() endif()
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fno-inline -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -fno-omit-frame-pointer")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -ggdb")
endif()
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring release mode optimizations") message(STATUS "Configuring release mode optimizations")
# Check if LTO is available # Check if LTO is available
@@ -304,11 +303,10 @@ if (ENABLE_COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug") if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build") message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build")
endif() endif()
message(STATUS "Enabling coverage") message(INFO "Enabling coverage")
set(MAYBE_COVERAGE_LIBRARIES "-lgcov") set(MAYBE_COVERAGE_LIBRARIES "-lgcov")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ftest-coverage -fprofile-arcs") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
endif() endif()
if (ENABLE_SANITIZER) if (ENABLE_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address") set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
@@ -381,8 +379,8 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# Activate C++1y # Activate C++1y
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++14") set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++1y")
endif() endif()
# Configuring other platform dependencies # Configuring other platform dependencies
@@ -470,7 +468,7 @@ if(ENABLE_MASON)
install(FILES ${TBBGlob} DESTINATION lib) install(FILES ${TBBGlob} DESTINATION lib)
endforeach() endforeach()
if(APPLE) if(APPLE)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@loader_path") set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@executable_path")
elseif(UNIX) elseif(UNIX)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin") set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin")
endif() endif()
@@ -519,10 +517,29 @@ else()
find_package(BZip2 REQUIRED) find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR}) add_dependency_includes(${BZIP2_INCLUDE_DIR})
find_package(Lua 5.2 REQUIRED) FIND_PACKAGE(Lua 5.2 EXACT)
if (LUA_FOUND) IF (LUA_FOUND)
message(STATUS "Using Lua ${LUA_VERSION_STRING}") MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
endif() ELSE()
FIND_PACKAGE(Lua 5.1 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
# Now fall back to a lua verison without exact
# in case this cmake version also forces patch versions
FIND_PACKAGE(Lua 5.2)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES}) set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
add_dependency_includes(${LUA_INCLUDE_DIR}) add_dependency_includes(${LUA_INCLUDE_DIR})
@@ -675,10 +692,10 @@ set(UTIL_LIBRARIES
# Libraries # Libraries
target_link_libraries(osrm ${ENGINE_LIBRARIES}) target_link_libraries(osrm ${ENGINE_LIBRARIES})
target_link_libraries(osrm_update ${UPDATER_LIBRARIES}) target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store) target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update)
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES}) target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES}) target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store) target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update)
target_link_libraries(osrm_store ${STORAGE_LIBRARIES}) target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# BUILD_COMPONENTS # BUILD_COMPONENTS
@@ -721,7 +738,7 @@ file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp)
file(GLOB LibraryGlob include/osrm/*.hpp) file(GLOB LibraryGlob include/osrm/*.hpp)
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp) file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp) set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp) set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp) set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp) set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp) set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
@@ -812,10 +829,6 @@ add_custom_target(uninstall
add_subdirectory(unit_tests) add_subdirectory(unit_tests)
add_subdirectory(src/benchmarks) add_subdirectory(src/benchmarks)
if (ENABLE_GLIBC_WORKAROUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLIBC_WORKAROUND")
endif()
if (ENABLE_NODE_BINDINGS) if (ENABLE_NODE_BINDINGS)
add_subdirectory(src/nodejs) add_subdirectory(src/nodejs)
endif() endif()
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
+25 -16
View File
@@ -41,14 +41,6 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
The easiest and quickest way to setup your own routing engine is to use Docker images we provide. The easiest and quickest way to setup your own routing engine is to use Docker images we provide.
There are two pre-processing pipelines available:
- Contraction Hierarchies (CH)
- Multi-Level Dijkstra (MLD)
we recommend using MLD by default except for special use-cases such as very large distance matrices where CH is still a better fit for the time being.
In the following we explain the MLD pipeline.
If you want to use the CH pipeline instead replace `osrm-partition` and `osrm-customize` with a single `osrm-contract` and change the algorithm option for `osrm-routed` to `--algorithm ch`.
### Using Docker ### Using Docker
We base our Docker images ([backend](https://hub.docker.com/r/osrm/osrm-backend/), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Alpine Linux and make sure they are as lightweight as possible. We base our Docker images ([backend](https://hub.docker.com/r/osrm/osrm-backend/), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Alpine Linux and make sure they are as lightweight as possible.
@@ -60,10 +52,9 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000 Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-partition /data/berlin-latest.osrm docker run -t -v $(pwd):/data osrm/osrm-backend osrm-contract /data/berlin-latest.osrm
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed /data/berlin-latest.osrm
Make requests against the HTTP server Make requests against the HTTP server
@@ -99,8 +90,8 @@ Install dependencies
```bash ```bash
sudo apt install build-essential git cmake pkg-config \ sudo apt install build-essential git cmake pkg-config \
libbz2-dev libxml2-dev libzip-dev libboost-all-dev \ libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
lua5.2 liblua5.2-dev libtbb-dev libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
``` ```
Compile and install OSRM binaries Compile and install OSRM binaries
@@ -113,6 +104,26 @@ cmake --build .
sudo cmake --build . --target install sudo cmake --build . --target install
``` ```
Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
```bash
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
```
Pre-process the extract and start the HTTP server
```
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm
```
Running Queries
```
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
```
### Request Against the Demo Server ### Request Against the Demo Server
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy). Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
@@ -146,9 +157,7 @@ which will check and use pre-built binaries if they're available for this releas
to always force building the Node.js bindings from source. to always force building the Node.js bindings from source.
For usage details have a look [these API docs](docs/nodejs/api.md). For usage details have a look [these API docs](docs/nodejs/api.md).
An exemplary implementation by a 3rd party with Docker and Node.js can be found [here](https://github.com/door2door-io/osrm-express-server-demo).
## References in publications ## References in publications
+5 -8
View File
@@ -7,22 +7,19 @@ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET PROJECT_DIR=%CD% SET PROJECT_DIR=%CD%
ECHO PROJECT_DIR^: %PROJECT_DIR% ECHO PROJECT_DIR^: %PROJECT_DIR%
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS% ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
:: Check CMake version
SET CMAKE_VERSION=3.9.2
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
ECHO cmake^: && cmake --version ECHO cmake^: && cmake --version
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
cmake --version | findstr /C:%CMAKE_VERSION% && GOTO CMAKE_OK cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
:CMAKE_NOT_OK :CMAKE_NOT_OK
SET CMAKE_VERSION=3.7.1
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION% ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
powershell Invoke-WebRequest https://cmake.org/files/v3.9/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive" IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
:CMAKE_OK :CMAKE_OK
ECHO CMAKE_OK ECHO CMAKE_OK
@@ -40,7 +37,7 @@ ECHO msbuild version
msbuild /version msbuild /version
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive :: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
SET DEPSPKG=osrm-deps-win-x64-14.0-2017.09.7z SET DEPSPKG=osrm-deps-win-x64-14.0.7z
:: local development :: local development
ECHO. ECHO.
-3
View File
@@ -36,8 +36,6 @@
# This is because, the lua location is not standardized and may exist in # This is because, the lua location is not standardized and may exist in
# locations other than lua/ # locations other than lua/
include(FindPkgConfig)
unset(_lua_include_subdirs) unset(_lua_include_subdirs)
unset(_lua_library_names) unset(_lua_library_names)
unset(_lua_append_versions) unset(_lua_append_versions)
@@ -83,7 +81,6 @@ function(_lua_set_version_vars)
lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2} lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2} lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
) )
pkg_check_modules(LUA QUIET "lua${ver}")
endforeach () endforeach ()
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE) set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
+1 -1
View File
@@ -4,7 +4,7 @@ libdir=@PKGCONFIG_LIBRARY_DIR@
Name: libOSRM Name: libOSRM
Description: Project OSRM library Description: Project OSRM library
Version: @OSRM_VERSION@ Version: v@OSRM_VERSION@
Requires: Requires:
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@ Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@ Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
+2 -2
View File
@@ -3,5 +3,5 @@ module.exports = {
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions', verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
todo: '--strict --tags @todo --require features/support --require features/step_definitions', todo: '--strict --tags @todo --require features/support --require features/step_definitions',
all: '--strict --require features/support --require features/step_definitions', all: '--strict --require features/support --require features/step_definitions',
mld: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions -f progress' mld: '--strict --tags ~@stress --tags ~@todo --tags ~@alternative --require features/support --require features/step_definitions -f progress'
}; }
+3 -3
View File
@@ -7,7 +7,7 @@ RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \ apk update && \
apk upgrade && \ apk upgrade && \
apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.2-dev libtbb@testing libtbb-dev@testing && \ apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.1-dev libtbb@testing libtbb-dev@testing && \
\ \
echo "Building libstxxl" && \ echo "Building libstxxl" && \
cd /opt && \ cd /opt && \
@@ -46,8 +46,8 @@ RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
rm /usr/local/lib/libstxxl* && \ rm /usr/local/lib/libstxxl* && \
cd /opt && \ cd /opt && \
apk del boost-dev && \ apk del boost-dev && \
apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.2-dev git make gcc && \ apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.1-dev git make gcc && \
apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.2 expat && \ apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.1 expat && \
rm -rf /src /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm* rm -rf /src /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm*
EXPOSE 5000 EXPOSE 5000
+1 -1
View File
@@ -20,7 +20,7 @@ A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we pro
The initialisation to do so looks like this: The initialisation to do so looks like this:
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);` `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
Make sure to give the guard a name, so it actually gets a lifetime. Make sure to give the guar a name, so it actually gets a lifetime.
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`). The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
+1 -10
View File
@@ -31,7 +31,6 @@ To pass parameters to each location some options support an array like encoding:
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. | |generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. | |hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
|approaches |`{approach};{approach}[;{approach} ...]` |Keep waypoints on curb side. | |approaches |`{approach};{approach}[;{approach} ...]` |Keep waypoints on curb side. |
|exclude |`{class}[,{class}]` |Additive list of classes to avoid, order does not matter. |
Where the elements follow the following format: Where the elements follow the following format:
@@ -41,13 +40,12 @@ Where the elements follow the following format:
|radius |`double >= 0` or `unlimited` (default) | |radius |`double >= 0` or `unlimited` (default) |
|hint |Base64 `string` | |hint |Base64 `string` |
|approach |`curb` or `unrestricted` (default) | |approach |`curb` or `unrestricted` (default) |
|class |A class name determined by the profile or `none`. |
``` ```
{option}={element};{element}[;{element} ... ] {option}={element};{element}[;{element} ... ]
``` ```
The number of elements must match exactly the number of locations (except for `generate_hints` and `exclude`). If you don't want to pass a value but instead use the default you can pass an empty `element`. The number of elements must match exactly the number of locations. If you don't want to pass a value but instead use the default you can pass an empty `element`.
Example: 2nd location use the default value for `option`: Example: 2nd location use the default value for `option`:
@@ -61,9 +59,6 @@ Example: 2nd location use the default value for `option`:
# Query on Berlin with three coordinates: # Query on Berlin with three coordinates:
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false' curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
# Query on Berlin excluding the usage of motorways:
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407?exclude=motorway'
# Using polyline: # Using polyline:
curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false' curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'
``` ```
@@ -437,8 +432,6 @@ Vector tiles contain two layers:
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right | | `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
| `cost` | `float` | the time we think it takes to make that turn, in seconds. May be negative, depending on how the data model is constructed (some turns get a "bonus"). | | `cost` | `float` | the time we think it takes to make that turn, in seconds. May be negative, depending on how the data model is constructed (some turns get a "bonus"). |
| `weight` | `float` | the weight we think it takes to make that turn. May be negative, depending on how the data model is constructed (some turns get a "bonus"). ACTUAL ROUTING USES THIS VALUE | | `weight` | `float` | the weight we think it takes to make that turn. May be negative, depending on how the data model is constructed (some turns get a "bonus"). ACTUAL ROUTING USES THIS VALUE |
| `type` | `string` | the type of this turn - values like `turn`, `continue`, etc. See the `StepManeuver` for a partial list, this field also exposes internal turn types that are never returned with an API response |
| `modifier` | `string` | the direction modifier of the turn (`left`, `sharp left`, etc) |
## Result objects ## Result objects
@@ -668,8 +661,6 @@ step.
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). | | `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. | | `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode or classes. If the road takes a turn itself, the `modifier` describes the direction | | `notification` | not an actual turn but a change in the driving conditions. For example the travel mode or classes. If the road takes a turn itself, the `modifier` describes the direction |
| `exit roundabout`| Describes a maneuver exiting a roundabout (usually preceeded by a `roundabout` instruction) |
| `exit rotary` | Describes the maneuver exiting a rotary (large named roundabout) |
Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change
between all instructions. They only offer a fallback in case nothing else is to report. between all instructions. They only offer a fallback in case nothing else is to report.
+9 -25
View File
@@ -47,7 +47,7 @@ Profiles can also define a `process_segment` function to handle differences in s
At the end of the file, a table if returned with references to the setup and processing functions the profile has defined. At the end of the file, a table if returned with references to the setup and processing functions the profile has defined.
## Understanding speed, weight and rate ## Understanding speed, weight and rate
When computing a route from A to B there can be different measure of what is the best route. That's why there's a need for different profiles. When computing a route from A to B there can be different measure of what is the best route. That's why there's a need for different profiles.
Because speeds very on different types of roads, the shortest and the fastest route are typically different. But there are many other possible preferences. For example a user might prefer a bicycle route that follow parks or other green areas, even though both duration and distance are a bit longer. Because speeds very on different types of roads, the shortest and the fastest route are typically different. But there are many other possible preferences. For example a user might prefer a bicycle route that follow parks or other green areas, even though both duration and distance are a bit longer.
@@ -91,7 +91,7 @@ The `setup` function is called once when the profile is loaded and must return a
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA iinterpreter will have it's own set of globals. Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA iinterpreter will have it's own set of globals.
The following global properties can be set under `properties` in the hash you return in the `setup` function: The following global properties can be set under `properties` in the hash you return in the `setup` function:
Attribute | Type | Notes Attribute | Type | Notes
-------------------------------------|----------|---------------------------------------------------------------------------- -------------------------------------|----------|----------------------------------------------------------------------------
@@ -104,19 +104,7 @@ max_speed_for_map_matching | Float | Maximum vehicle speed to be as
max_turn_weight | Float | Maximum turn penalty weight max_turn_weight | Float | Maximum turn penalty weight
force_split_edges | Boolean | True value forces a split of forward and backward edges of extracted ways and guarantees that `process_segment` will be called for all segments (default `false`) force_split_edges | Boolean | True value forces a split of forward and backward edges of extracted ways and guarantees that `process_segment` will be called for all segments (default `false`)
### process_node(profile, node, result)
The following additional global properties can be set in the hash you return in the `setup` function:
Attribute | Type | Notes
-------------------------------------|------------------|----------------------------------------------------------------------------
excludable | Sequence of Sets | Determines which class-combinations are supported by the `exclude` option at query time.
| | E.g. `Sequence{Set{"ferry", "motorway"}, Set{"motorway"}}` will allow you to exclude ferries and motorways, or only motorways.
classes | Sequence | Determines the allowed classes that can be referenced using `{forward,backward}_classes` on the way in the `process_way` function.
restrictions | Sequence | Determines which turn restrictions will be used for this profile.
suffix_list | Set | List of name suffixes needed for determining if "Highway 101 NW" the same road as "Highway 101 ES".
relation_types | Sequence | Determines wich relations should be cached for processing in this profile. It contains relations types
### process_node(profile, node, result, relations)
Process an OSM node to determine whether this node is a barrier or can be passed and whether passing it incurs a delay. Process an OSM node to determine whether this node is a barrier or can be passed and whether passing it incurs a delay.
Argument | Description Argument | Description
@@ -124,7 +112,6 @@ Argument | Description
profile | The configuration table you returned in `setup`. profile | The configuration table you returned in `setup`.
node | The input node to process (read-only). node | The input node to process (read-only).
result | The output that you will modify. result | The output that you will modify.
relations| Storage of relations to access relations, where `node` is a member.
The following attributes can be set on `result`: The following attributes can be set on `result`:
@@ -133,7 +120,7 @@ Attribute | Type | Notes
barrier | Boolean | Is it an impassable barrier? barrier | Boolean | Is it an impassable barrier?
traffic_lights | Boolean | Is it a traffic light (incurs delay in `process_turn`)? traffic_lights | Boolean | Is it a traffic light (incurs delay in `process_turn`)?
### process_way(profile, way, result, relations) ## process_way(profile, way, result)
Given an OpenStreetMap way, the `process_way` function will either return nothing (meaning we are not going to route over this way at all), or it will set up a result hash. Given an OpenStreetMap way, the `process_way` function will either return nothing (meaning we are not going to route over this way at all), or it will set up a result hash.
Argument | Description Argument | Description
@@ -141,7 +128,6 @@ Argument | Description
profile | The configuration table you returned in `setup`. profile | The configuration table you returned in `setup`.
node | The input way to process (read-only). node | The input way to process (read-only).
result | The output that you will modify. result | The output that you will modify.
relations| Storage of relations to access relations, where `way` is a member.
Importantly it will set `result.forward_mode` and `result.backward_mode` to indicate the travel mode in each direction, as well as set `result.forward_speed` and `result.backward_speed` to integer values representing the speed for traversing the way. Importantly it will set `result.forward_mode` and `result.backward_mode` to indicate the travel mode in each direction, as well as set `result.forward_speed` and `result.backward_speed` to integer values representing the speed for traversing the way.
@@ -171,9 +157,7 @@ is_startpoint | Boolean | Can a journey start on this
roundabout | Boolean | Is this part of a roundabout? roundabout | Boolean | Is this part of a roundabout?
circular | Boolean | Is this part of a non-roundabout circular junction? circular | Boolean | Is this part of a non-roundabout circular junction?
name | String | Name of the way name | String | Name of the way
ref | String | Road number (equal to set `forward_ref` and `backward_ref` with one value) ref | String | Road number
forward_ref | String | Road number in forward way direction
backward_ref | String | Road number in backward way direction
destinations | String | The road's destinations destinations | String | The road's destinations
exits | String | The ramp's exit numbers or names exits | String | The ramp's exit numbers or names
pronunciation | String | Name pronunciation pronunciation | String | Name pronunciation
@@ -184,9 +168,9 @@ road_classification.may_be_ignored | Boolean | Guidance: way is non-highwa
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
### process_segment(profile, segment) ### process_segment(profile, segment)
The `process_segment` function is called for every segment of OSM ways. A segment is a straight line between two OSM nodes. The `process_segment` function is called for every segment of OSM ways. A segment is a straight line between two OSM nodes.
On OpenStreetMap way cannot have different tags on different parts of a way. Instead you would split the way into several smaller ways. However many ways are long. For example, many ways pass hills without any change in tags. On OpenStreetMap way cannot have different tags on different parts of a way. Instead you would split the way into several smaller ways. However many ways are long. For example, many ways pass hills without any change in tags.
Processing each segment of an OSM way makes it possible to have different speeds on different parts of a way based on external data like data about elevation, pollution, noise or scenic value and adjust weight and duration of the segment. Processing each segment of an OSM way makes it possible to have different speeds on different parts of a way based on external data like data about elevation, pollution, noise or scenic value and adjust weight and duration of the segment.
@@ -271,7 +255,7 @@ Example:
function process_segment (profile, segment) function process_segment (profile, segment)
local sourceData = raster:query(profile.raster_source, segment.source.lon, segment.source.lat) local sourceData = raster:query(profile.raster_source, segment.source.lon, segment.source.lat)
local targetData = raster:query(profile.raster_source, segment.target.lon, segment.target.lat) local targetData = raster:query(profile.raster_source, segment.target.lon, segment.target.lat)
local invalid = sourceData.invalid_data() local invalid = sourceData.invalid_data()
if sourceData.datum ~= invalid and targetData.datum ~= invalid then if sourceData.datum ~= invalid and targetData.datum ~= invalid then
-- use values to adjust weight and duration -- use values to adjust weight and duration
@@ -288,4 +272,4 @@ durationIsValid
parseDuration parseDuration
trimLaneString trimLaneString
applyAccessTokens applyAccessTokens
canonicalizeStringList canonicalizeStringList
-35
View File
@@ -1,35 +0,0 @@
@routing @bicycle
Feature: Bike - Use distance weight
Background:
Given a grid size of 200 meters
Scenario: Bike - Check distance weight
Given the profile file
"""
local functions = require('bicycle')
functions.setup_testbot = functions.setup
functions.setup = function()
local profile = functions.setup_testbot()
profile.properties.weight_name = 'distance'
return profile
end
return functions
"""
Given the node map
"""
a-b-c
"""
And the ways
| nodes | highway |
| abc | residential |
When I route I should get
| from | to | route | weight | time | distance |
| a | b | abc,abc | 200 | 48s | 200m +-1 |
| a | c | abc,abc | 400 | 96s | 400m +-1 |
+9 -10
View File
@@ -157,16 +157,15 @@ Feature: Car - Restricted access
Scenario: Car - Access combinations Scenario: Car - Access combinations
Then routability should be Then routability should be
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # | | highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
| runway | private | | | permissive | x | x | | | runway | private | | | permissive | x | x | |
| primary | forestry | | yes | | x | x | | | primary | forestry | | yes | | x | x | |
| cycleway | | | designated | | x | x | | | cycleway | | | designated | | x | x | |
| unclassified | | | destination | destination | x | x | | | residential | | yes | no | | | | |
| residential | | yes | no | | | | | | motorway | yes | permissive | | private | x | | implied oneway |
| motorway | yes | permissive | | private | x | | implied oneway | | trunk | agricultural | designated | permissive | no | | | |
| trunk | agricultural | designated | permissive | no | | | | | pedestrian | | | | | | | |
| pedestrian | | | | | | | | | pedestrian | | | | destination | | | temporary disabled #3773 |
| pedestrian | | | | destination | | | temporary disabled #3773 |
Scenario: Car - Ignore access tags for other modes Scenario: Car - Ignore access tags for other modes
Then routability should be Then routability should be
+2 -2
View File
@@ -122,6 +122,6 @@ Feature: Car - Mode flag
| df | yes | motorway| | yes | | df | yes | motorway| | yes |
When I route I should get When I route I should get
| from | to | route | turns | classes | | from | to | route | turns | classes |
| a | f | ab,df,df,df | depart,roundabout-exit-2,exit roundabout slight right,arrive | [()],[(),(motorway)],[(toll,motorway)],[()] | | a | f | ab,df,df | depart,roundabout-exit-2,arrive | [()],[(),(motorway),(toll,motorway)],[()] |
+179 -179
View File
@@ -17,27 +17,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | only_right_turn @ (has_pygmies > 10 p) | | restriction | ej | nj | j | only_right_turn @ (has_pygmies > 10 p) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,jc,jc | | e | s | ej,js,js |
| b | a | bj,aj,aj | | e | n | ej,nj,nj |
| b | d | bj,jd,jd | | e | p | ej,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Restriction would be on, but the restriction was badly tagged Scenario: Car - Restriction would be on, but the restriction was badly tagged
@@ -48,29 +48,29 @@ Feature: Car - Turn restrictions
Given the node map Given the node map
""" """
a n
p | p |
\ | \ |
j j
| \ | \
c m s m
""" """
And the ways And the ways
| nodes | | nodes |
| aj | | nj |
| jc | | js |
| pjm | | pjm |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | aj | pjm | j | no_left_turn @ (Mo-Fr 07:00-10:30) | | restriction | nj | pjm | j | no_left_turn @ (Mo-Fr 07:00-10:30) |
| restriction | jc | pjm | j | no_right_turn @ (Mo-Fr 07:00-10:30) | | restriction | js | pjm | j | no_right_turn @ (Mo-Fr 07:00-10:30) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | m | aj,pjm,pjm | | n | m | nj,pjm,pjm |
| c | m | jc,pjm,pjm | | s | m | js,pjm,pjm |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Restriction With Compressed Geometry Scenario: Car - Restriction With Compressed Geometry
@@ -149,29 +149,29 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | no | | ej | no |
| jd | no | | jp | no |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | except | | type | way:from | way:to | node:via | restriction:conditional | except |
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 08:00-12:00) | motorcar | | restriction | ej | nj | j | only_right_turn @ (Mo-Su 08:00-12:00) | motorcar |
| restriction | jd | aj | j | only_left_turn @ (Mo-Su 08:00-12:00) | bus | | restriction | jp | nj | j | only_left_turn @ (Mo-Su 08:00-12:00) | bus |
When I route I should get When I route I should get
| from | to | route | # | | from | to | route | # |
| b | c | bj,jc,jc | | | e | s | ej,js,js | |
| b | a | bj,aj,aj | restriction does not apply to cars | | e | n | ej,nj,nj | restriction does not apply to cars |
| b | d | bj,jd,jd | | | e | p | ej,jp,jp | |
| d | c | jd,aj,aj,jc,jc | restriction excepting busses still applies to cars | | p | s | jp,nj,nj,js,js | restriction excepting busses still applies to cars |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - only_right_turn Scenario: Car - only_right_turn
@@ -181,27 +181,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) | | restriction | ej | nj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,aj,aj,jc,jc | | e | s | ej,nj,nj,js,js |
| b | a | bj,aj,aj | | e | n | ej,nj,nj |
| b | d | bj,aj,aj,jd,jd | | e | p | ej,nj,nj,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - No right turn Scenario: Car - No right turn
@@ -211,27 +211,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) | | restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
When I route I should get When I route I should get
| from | to | route | # | | from | to | route | # |
| b | c | bj,jc,jc | normal turn | | e | s | ej,js,js | normal turn |
| b | a | bj,jc,jc,aj,aj | avoids right turn | | e | n | ej,js,js,nj,nj | avoids right turn |
| b | d | bj,jd,jd | normal maneuver | | e | p | ej,jp,jp | normal maneuver |
@only_turning @conditionals @only_turning @conditionals
Scenario: Car - only_left_turn Scenario: Car - only_left_turn
@@ -241,27 +241,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) | | restriction | ej | js | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,jc,jc | | e | s | ej,js,js |
| b | a | bj,jc,jc,aj,aj | | e | n | ej,js,js,nj,nj |
| b | d | bj,jc,jc,jd,jd | | e | p | ej,js,js,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - No left turn Scenario: Car - No left turn
@@ -271,27 +271,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) | | restriction | ej | js | j | no_left_turn @ (Mo-Su 00:00-23:59) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,aj,aj,jc,jc | | e | s | ej,nj,nj,js,js |
| b | a | bj,aj,aj | | e | n | ej,nj,nj |
| b | d | bj,jd,jd | | e | p | ej,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Conditional restriction is off Scenario: Car - Conditional restriction is off
@@ -301,27 +301,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) | | restriction | ej | nj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,jc,jc | | e | s | ej,js,js |
| b | a | bj,aj,aj | | e | n | ej,nj,nj |
| b | d | bj,jd,jd | | e | p | ej,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Conditional restriction is on Scenario: Car - Conditional restriction is on
@@ -331,27 +331,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) | | restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,jc,jc | | e | s | ej,js,js |
| b | a | bj,jc,jc,aj,aj | | e | n | ej,js,js,nj,nj |
| b | d | bj,jd,jd | | e | p | ej,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Conditional restriction with multiple time windows Scenario: Car - Conditional restriction with multiple time windows
@@ -362,28 +362,28 @@ Feature: Car - Turn restrictions
Given the node map Given the node map
""" """
a n
p | p |
\ | \ |
j j
| \ | \
c m s m
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| jp | yes | | jp | yes |
| mj | yes | | mj | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) | | restriction | nj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | p | aj,jc,jc,jp,jp | | n | p | nj,js,js,jp,jp |
| m | p | mj,jp,jp | | m | p | mj,jp,jp |
@no_turning @conditionals @no_turning @conditionals
@@ -394,27 +394,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) | | restriction | ej | nj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,aj,aj,jc,jc | | e | s | ej,nj,nj,js,js |
| b | a | bj,aj,aj | | e | n | ej,nj,nj |
| b | d | bj,aj,aj,jd,jd | | e | p | ej,nj,nj,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - No right turn Scenario: Car - No right turn
@@ -424,27 +424,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) | | restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
When I route I should get When I route I should get
| from | to | route | # | | from | to | route | # |
| b | c | bj,jc,jc | normal turn | | e | s | ej,js,js | normal turn |
| b | a | bj,jc,jc,aj,aj | avoids right turn | | e | n | ej,js,js,nj,nj | avoids right turn |
| b | d | bj,jd,jd | normal maneuver | | e | p | ej,jp,jp | normal maneuver |
@only_turning @conditionals @only_turning @conditionals
Scenario: Car - only_left_turn Scenario: Car - only_left_turn
@@ -454,27 +454,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) | | restriction | ej | js | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,jc,jc | | e | s | ej,js,js |
| b | a | bj,jc,jc,aj,aj | | e | n | ej,js,js,nj,nj |
| b | d | bj,jc,jc,jd,jd | | e | p | ej,js,js,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - No left turn Scenario: Car - No left turn
@@ -484,27 +484,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) | | restriction | ej | js | j | no_left_turn @ (Mo-Su 00:00-23:59) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,aj,aj,jc,jc | | e | s | ej,nj,nj,js,js |
| b | a | bj,aj,aj | | e | n | ej,nj,nj |
| b | d | bj,jd,jd | | e | p | ej,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Conditional restriction is off Scenario: Car - Conditional restriction is off
@@ -514,27 +514,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) | | restriction | ej | nj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,jc,jc | | e | s | ej,js,js |
| b | a | bj,aj,aj | | e | n | ej,nj,nj |
| b | d | bj,jd,jd | | e | p | ej,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Conditional restriction is on Scenario: Car - Conditional restriction is on
@@ -544,27 +544,27 @@ Feature: Car - Turn restrictions
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
Given the node map Given the node map
""" """
a n
d j b p j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| bj | yes | | ej | yes |
| jd | yes | | jp | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | jb | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) | | restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| b | c | bj,jc,jc | | e | s | ej,js,js |
| b | a | bj,jc,jc,aj,aj | | e | n | ej,js,js,nj,nj |
| b | d | bj,jd,jd | | e | p | ej,jp,jp |
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - Conditional restriction with multiple time windows Scenario: Car - Conditional restriction with multiple time windows
@@ -575,28 +575,28 @@ Feature: Car - Turn restrictions
Given the node map Given the node map
""" """
a n
p | p |
\ | \ |
j j
| \ | \
c m s m
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| aj | no | | nj | no |
| jc | no | | js | no |
| jp | yes | | jp | yes |
| mj | yes | | mj | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:conditional | | type | way:from | way:to | node:via | restriction:conditional |
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) | | restriction | nj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | p | aj,jc,jc,jp,jp | | n | p | nj,js,js,jp,jp |
| m | p | mj,jp,jp | | m | p | mj,jp,jp |
@restriction-way @restriction-way
@@ -677,7 +677,7 @@ Feature: Car - Turn restrictions
# https://www.openstreetmap.org/#map=18/38.91099/-77.00888 # https://www.openstreetmap.org/#map=18/38.91099/-77.00888
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - DC North capitol situation, two on one off Scenario: Car - DC North capitol situation, two on one off
Given the extract extra arguments "--parse-conditional-restrictions" Given the extract extra arguments "--parse-conditional-restrictions=1"
# 9pm Wed 02 May, 2017 UTC, 5pm EDT # 9pm Wed 02 May, 2017 UTC, 5pm EDT
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200" Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200"
@@ -724,7 +724,7 @@ Feature: Car - Turn restrictions
@no_turning @conditionals @no_turning @conditionals
Scenario: Car - DC North capitol situation, one on two off Scenario: Car - DC North capitol situation, one on two off
Given the extract extra arguments "--parse-conditional-restrictions" Given the extract extra arguments "--parse-conditional-restrictions=1"
# 10:30am utc, wed, 6:30am est # 10:30am utc, wed, 6:30am est
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400" Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400"
@@ -848,7 +848,7 @@ Feature: Car - Turn restrictions
@only_turning @conditionals @only_turning @conditionals
Scenario: Car - Somewhere in London, the UK, GMT timezone Scenario: Car - Somewhere in London, the UK, GMT timezone
Given the extract extra arguments "--parse-conditional-restrictions" Given the extract extra arguments "--parse-conditional-restrictions=1"
# 9am UTC, 10am BST # 9am UTC, 10am BST
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000" Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000" Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000"
+128 -134
View File
@@ -11,27 +11,27 @@ Feature: Car - Turn restrictions
Scenario: Car - No left turn Scenario: Car - No left turn
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | dj | j | no_left_turn | | restriction | sj | wj | j | no_left_turn |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | | | s | w | |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | cj,bj,bj | | s | e | sj,ej,ej |
@no_turning @no_turning
Scenario: Car - No straight on Scenario: Car - No straight on
@@ -67,259 +67,253 @@ Feature: Car - Turn restrictions
Scenario: Car - No right turn Scenario: Car - No right turn
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | bj | j | no_right_turn | | restriction | sj | ej | j | no_right_turn |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | cj,dj,dj | | s | w | sj,wj,wj |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | | | s | e | |
@no_turning @no_turning
Scenario: Car - No u-turn Scenario: Car - No u-turn
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | dj | j | no_u_turn | | restriction | sj | wj | j | no_u_turn |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | | | s | w | |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | cj,bj,bj | | s | e | sj,ej,ej |
@no_turning @no_turning
Scenario: Car - Handle any no_* relation Scenario: Car - Handle any no_* relation
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | dj | j | no_weird_zigzags | | restriction | sj | wj | j | no_weird_zigzags |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | | | s | w | |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | cj,bj,bj | | s | e | sj,ej,ej |
@only_turning @only_turning
Scenario: Car - Only left turn Scenario: Car - Only left turn
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | dj | j | only_left_turn | | restriction | sj | wj | j | only_left_turn |
When I route I should get
| from | to | route |
| c | a | |
| c | b | |
| c | d | cj,dj,dj |
Scenario: Car - Only right turn, invalid Scenario: Car - Only right turn, invalid
Given the node map Given the node map
""" """
a n
d j b r w j e r
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
| rb | -1 | | re | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | br | j | only_right_on | | restriction | sj | er | j | only_right_on |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | r | cj,bj,rb,rb | | s | r | sj,ej,re,re |
@only_turning @only_turning
Scenario: Car - Only right turn Scenario: Car - Only right turn
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | bj | j | only_right_turn | | restriction | sj | ej | j | only_right_turn |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | | | s | w | |
| c | a | | | s | n | |
| c | b | cj,bj,bj | | s | e | sj,ej,ej |
@only_turning @only_turning
Scenario: Car - Only straight on Scenario: Car - Only straight on
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | aj | j | only_straight_on | | restriction | sj | nj | j | only_straight_on |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | | | s | w | |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | | | s | e | |
@no_turning @no_turning
Scenario: Car - Handle any only_* restriction Scenario: Car - Handle any only_* restriction
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | aj | j | only_weird_zigzags | | restriction | sj | nj | j | only_weird_zigzags |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | | | s | w | |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | | | s | e | |
@specific @specific
Scenario: Car - :hgv-qualified on a standard turn restriction Scenario: Car - :hgv-qualified on a standard turn restriction
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:hgv | | type | way:from | way:to | node:via | restriction:hgv |
| restriction | cj | aj | j | no_straight_on | | restriction | sj | nj | j | no_straight_on |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | cj,dj,dj | | s | w | sj,wj,wj |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | cj,bj,bj | | s | e | sj,ej,ej |
@specific @specific
Scenario: Car - :motorcar-qualified on a standard turn restriction Scenario: Car - :motorcar-qualified on a standard turn restriction
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction:motorcar | | type | way:from | way:to | node:via | restriction:motorcar |
| restriction | cj | aj | j | no_straight_on | | restriction | sj | nj | j | no_straight_on |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | cj,dj,dj | | s | w | sj,wj,wj |
| c | a | | | s | n | |
| c | b | cj,bj,bj | | s | e | sj,ej,ej |
@except @except
Scenario: Car - Except tag and on no_ restrictions Scenario: Car - Except tag and on no_ restrictions
@@ -490,27 +484,27 @@ Feature: Car - Turn restrictions
Scenario: Car - Ignore unrecognized restriction Scenario: Car - Ignore unrecognized restriction
Given the node map Given the node map
""" """
a n
d j b w j e
c s
""" """
And the ways And the ways
| nodes | oneway | | nodes | oneway |
| cj | yes | | sj | yes |
| aj | -1 | | nj | -1 |
| dj | -1 | | wj | -1 |
| bj | -1 | | ej | -1 |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | cj | dj | j | yield | | restriction | sj | wj | j | yield |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| c | d | cj,dj,dj | | s | w | sj,wj,wj |
| c | a | cj,aj,aj | | s | n | sj,nj,nj |
| c | b | cj,bj,bj | | s | e | sj,ej,ej |
@restriction @compression @restriction @compression
Scenario: Restriction On Compressed Geometry Scenario: Restriction On Compressed Geometry
-329
View File
@@ -1,329 +0,0 @@
@routing @car @relations
Feature: Car - route relations
Background:
Given the profile "car"
Scenario: Assignment using relation membership roles
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | way:east | way:west | route | ref | network |
| route | cd | ba | road | 80 | US:I |
| route | cd | ba | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80 $west,I 80 $west |
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
Scenario: No cardinal directions by default
Given the profile file "car" initialized with
"""
profile.cardinal_directions = false
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | way:east | way:west | route | ref | network |
| route | cd | ba | road | 80 | US:I |
| route | cd | ba | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80,I 80 |
| c,d | eastbound,eastbound | I 80; CO 93,I 80; CO 93 |
Scenario: No cardinal directions by default
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | way:east | way:west | route | ref | network |
| route | cd | ba | road | 80 | US:I |
| route | cd | ba | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80,I 80 |
| c,d | eastbound,eastbound | I 80; CO 93,I 80; CO 93 |
Scenario: Assignment using relation direction property (no role on members)
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | direction | way | route | ref | network |
| route | west | ba | road | 80 | US:I |
| route | east | cd | road | 80 | US:I |
| route | east | cd | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80 $west,I 80 $west |
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
Scenario: Forward assignment on one-way roads using relation direction property
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | direction | way:forward | route | ref | network |
| route | west | ba | road | 80 | US:I |
| route | east | cd | road | 80 | US:I |
| route | east | cd | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80 $west,I 80 $west |
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
Scenario: Forward/backward assignment on non-divided roads with role direction tag
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref | oneway |
| ab | mainroad | motorway | I 80 | no |
And the relations
| type | direction | way:forward | route | ref | network |
| route | west | ab | road | 80 | US:I |
And the relations
| type | direction | way:backward | route | ref | network |
| route | east | ab | road | 80 | US:I |
When I route I should get
| waypoints | route | ref |
| a,b | mainroad,mainroad | I 80 $west,I 80 $west |
| b,a | mainroad,mainroad | I 80 $east,I 80 $east |
Scenario: Conflict between role and direction
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | direction | way:east | route | ref | network |
| route | west | ab | road | 80 | US:I |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80,I 80 |
Scenario: Conflict between role and superrelation direction
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:east | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | direction | relation | route | ref | network | name |
| route | west | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80,I 80 |
Scenario: Conflict between role and superrelation role
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:east | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | relation:west | route | ref | network | name |
| route | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80,I 80 |
Scenario: Direction only available via superrelation role
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:forward | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | relation:east | route | ref | network | name |
| route | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80 $east,I 80 $east |
Scenario: Direction only available via superrelation direction
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:forward | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | direction | relation | route | ref | network | name |
| route | east | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80 $east,I 80 $east |
# Scenario: Three levels of indirection
# Given the node map
# """
# a----------------b
# """
#
# And the ways
# | nodes | name | highway | ref |
# | ab | eastbound | motorway | I 80 |
#
# And the relations
# | type | way:forward | route | ref | network | name |
# | route | ab | road | 80 | US:I | baserelation |
#
# And the relations
# | type | relation | route | ref | network | name |
# | route | baserelation | road | 80 | US:I | superrelation1 |
#
# And the relations
# | type | direction | relation | route | ref | network | name |
# | route | east | superrelation1 | road | 80 | US:I | superrelation2 |
#
# When I route I should get
# | waypoints | route | ref |
# | a,b | eastbound,eastbound | I 80 $east,I 80 $east |
+8 -48
View File
@@ -5,9 +5,9 @@ Feature: Testbot - side bias
Given the profile file "car" initialized with Given the profile file "car" initialized with
""" """
profile.left_hand_driving = true profile.left_hand_driving = true
profile.turn_bias = 1.075 profile.turn_bias = 1/1.075
""" """
And the node map Given the node map
""" """
a b c a b c
@@ -28,7 +28,7 @@ Feature: Testbot - side bias
Given the profile file "car" initialized with Given the profile file "car" initialized with
""" """
profile.left_hand_driving = true profile.left_hand_driving = true
profile.turn_bias = 1 / 1.075 profile.turn_bias = 1.075
""" """
And the node map And the node map
""" """
@@ -43,14 +43,16 @@ Feature: Testbot - side bias
| bd | | bd |
When I route I should get When I route I should get
| from | to | route | time | # | | from | to | route | time |
| d | a | bd,ab,ab | 27s +-1 | should be inverse of left hand bias | | d | a | bd,ab,ab | 27s +-1 |
| d | c | bd,bc,bc | 24s +-1 | | # should be inverse of left hand bias
| d | c | bd,bc,bc | 24s +-1 |
Scenario: Roundabout exit counting for left sided driving Scenario: Roundabout exit counting for left sided driving
Given the profile file "testbot" initialized with Given the profile file "testbot" initialized with
""" """
profile.left_hand_driving = true profile.left_hand_driving = true
profile.turn_bias = 1/1.075
""" """
And a grid size of 10 meters And a grid size of 10 meters
And the node map And the node map
@@ -74,45 +76,3 @@ Feature: Testbot - side bias
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive | | 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,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive | | a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
Scenario: Left-hand bias via location-dependent tags
Given the profile "car"
And the node map
"""
a b c
d
"""
And the ways with locations
| nodes |
| ab |
| bc |
| bd |
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 24s +-1 |
| d | c | bd,bc,bc | 27s +-1 |
Scenario: Left-hand bias via OSM tags
Given the profile "car"
And the node map
"""
a b c
d
"""
And the ways with locations
| nodes | driving_side |
| ab | right |
| bc | right |
| bd | right |
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 27s +-1 |
| d | c | bd,bc,bc | 24s +-1 |
-35
View File
@@ -1,35 +0,0 @@
@routing @foot
Feature: Foot - Use distance weight
Background:
Given a grid size of 200 meters
Scenario: Foot - Check distance weight
Given the profile file
"""
local functions = require('foot')
functions.setup_testbot = functions.setup
functions.setup = function()
local profile = functions.setup_testbot()
profile.properties.weight_name = 'distance'
return profile
end
return functions
"""
Given the node map
"""
a-b-c
"""
And the ways
| nodes | highway |
| abc | residential |
When I route I should get
| from | to | route | weight | time | distance |
| a | b | abc,abc | 200 | 144s | 200m +-1 |
| a | c | abc,abc | 400 | 288s | 400m +-1 |
+20 -20
View File
@@ -553,8 +553,8 @@ Feature: Turn Lane Guidance
| fy | | primary | | | fy | | primary | |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,h | ab,gh,gh,gh | depart,roundabout-exit-5,exit roundabout right,arrive | ,;;;;,, | | a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,;;;;;, |
@anticipate @anticipate
Scenario: No Lanes for Roundabouts, see #2626 Scenario: No Lanes for Roundabouts, see #2626
@@ -569,16 +569,16 @@ Feature: Turn Lane Guidance
| nodes | turn:lanes:forward | highway | junction | name | | nodes | turn:lanes:forward | highway | junction | name |
| xb | slight_right\|slight_right | primary | | xb | | xb | slight_right\|slight_right | primary | | xb |
| dy | | primary | | dy | | dy | | primary | | dy |
| ab | | primary | roundabout | rotary | | ab | | primary | roundabout | roundabout |
| bc | | primary | roundabout | rotary | | bc | | primary | roundabout | roundabout |
| cd | left\|slight_right | primary | roundabout | rotary | | cd | left\|slight_right | primary | roundabout | roundabout |
| da | | primary | roundabout | rotary | | da | | primary | roundabout | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| x,y | xb,dy,dy,dy | depart,rotary-exit-1,exit rotary right,arrive | ,,, | | x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,;, |
| x,c | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,, | | x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,;, | | x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,;, |
@anticipate @anticipate
Scenario: No Lanes for Roundabouts, see #2626 Scenario: No Lanes for Roundabouts, see #2626
@@ -614,8 +614,8 @@ Feature: Turn Lane Guidance
| fy | | primary | | | fy | | primary | |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,h | ab,ch,ch,ch | depart,roundabout-exit-5,exit roundabout left,arrive | ,;;;;,, | | a,h | ab,ch,ch | depart,roundabout-exit-5,arrive | ,;;;;;, |
@anticipate @anticipate
Scenario: No Lanes for Roundabouts, see #2626 Scenario: No Lanes for Roundabouts, see #2626
@@ -635,16 +635,16 @@ Feature: Turn Lane Guidance
| nodes | turn:lanes:forward | highway | junction | name | | nodes | turn:lanes:forward | highway | junction | name |
| xb | slight_right\|slight_right | primary | | xb | | xb | slight_right\|slight_right | primary | | xb |
| dy | | primary | | dy | | dy | | primary | | dy |
| ab | | primary | roundabout | rotary | | ab | | primary | roundabout | roundabout |
| bc | | primary | roundabout | rotary | | bc | | primary | roundabout | roundabout |
| cd | left\|slight_right | primary | roundabout | rotary | | cd | left\|slight_right | primary | roundabout | roundabout |
| da | | primary | roundabout | rotary | | da | | primary | roundabout | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| x,y | xb,dy,dy,dy | depart,rotary-exit-1,exit rotary right,arrive | ,,, | | x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,;, |
| x,c | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,, | | x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,;, | | x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,;, |
@anticipate @todo @2032 @anticipate @todo @2032
Scenario: No Lanes for Roundabouts, see #2626 Scenario: No Lanes for Roundabouts, see #2626
+257 -17
View File
@@ -1,8 +1,5 @@
@routing @guidance @routing @guidance
Feature: Circular Feature: Rotary
# Circular tags are treated just as rotaries. We can rely on the rotary tests for their handling on special cases.
# Here we only ensure that the `circular` tag is handled and assigned a rotary type
Background: Background:
Given the profile "car" Given the profile "car"
@@ -27,16 +24,259 @@ Feature: Circular
| bgecb | circular | | bgecb | circular |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,cd,cd,cd | depart,bgecb-exit-3,exit rotary right,arrive | | a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
| a,f | ab,ef,ef,ef | depart,bgecb-exit-2,exit rotary right,arrive | | a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
| a,h | ab,gh,gh,gh | depart,bgecb-exit-1,exit rotary right,arrive | | a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
| d,f | cd,ef,ef,ef | depart,bgecb-exit-3,exit rotary right,arrive | | d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
| d,h | cd,gh,gh,gh | depart,bgecb-exit-2,exit rotary right,arrive | | d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
| d,a | cd,ab,ab,ab | depart,bgecb-exit-1,exit rotary right,arrive | | d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
| f,h | ef,gh,gh,gh | depart,bgecb-exit-3,exit rotary right,arrive | | f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
| f,a | ef,ab,ab,ab | depart,bgecb-exit-2,exit rotary right,arrive | | f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
| f,d | ef,cd,cd,cd | depart,bgecb-exit-1,exit rotary right,arrive | | f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
| h,a | gh,ab,ab,ab | depart,bgecb-exit-3,exit rotary right,arrive | | h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
| h,d | gh,cd,cd,cd | depart,bgecb-exit-2,exit rotary right,arrive | | h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
| h,f | gh,ef,ef,ef | depart,bgecb-exit-1,exit rotary right,arrive | | h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
Scenario: Only Enter
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
Scenario: Only Exit
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| b,c | bcegb,bcegb | depart,arrive |
| b,e | bcegb,bcegb | depart,arrive |
| b,g | bcegb,bcegb | depart,arrive |
| c,e | bcegb,bcegb | depart,arrive |
| c,g | bcegb,bcegb | depart,arrive |
| c,b | bcegb,bcegb | depart,arrive |
| e,g | bcegb,bcegb | depart,arrive |
| e,b | bcegb,bcegb | depart,arrive |
| e,c | bcegb,bcegb | depart,arrive |
| g,b | bcegb,bcegb | depart,arrive |
| g,c | bcegb,bcegb | depart,arrive |
| g,e | bcegb,bcegb | depart,arrive |
#needs to be adjusted when name-discovery works for entrys
Scenario: Mixed Entry and Exit
Given the node map
"""
c a
j b f
k e
l h d
g i
"""
And the ways
| nodes | junction | oneway |
| abc | | yes |
| def | | yes |
| ghi | | yes |
| jkl | | yes |
| bkheb | circular | yes |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
| d,f | def,def,def | depart,rotary-exit-1,arrive |
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
b
c d f
e
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
d
b c f
e
"""
And the ways
| nodes | junction |
| ad | |
| bcdb | circular |
| be | |
| cf | |
When I route I should get
| waypoints | route | turns |
| a,e | ad,be,be | depart,bcdb-exit-1,arrive |
| a,f | ad,cf,cf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
c
d b f
e
"""
And the ways
| nodes | junction |
| ac | |
| bcdb | circular |
| de | |
| bf | |
When I route I should get
| waypoints | route | turns |
| a,e | ac,de,de | depart,bcdb-exit-1,arrive |
| a,f | ac,bf,bf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
f
d c e
b
a
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
f
d c e
b
a
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
-29
View File
@@ -147,32 +147,3 @@ Feature: Collapse
| waypoints | route | turns | | waypoints | route | turns |
| a,d | road,left,left | depart,turn left,arrive | | a,d | road,left,left | depart,turn left,arrive |
| a,e | road,right,right | depart,turn right,arrive | | a,e | road,right,right | depart,turn right,arrive |
# https://www.openstreetmap.org/#map=18/53.89755/27.54306
Scenario: Wide turn into invalid u-turn
Given the node map
"""
g
|
|
f - - - - e
|
|
|
h - - d
|
|
|
a - - - - b - - - - c
"""
And the ways
| nodes | highway | name |
| abc | secondary | road |
| bdfg | service | |
| hd | service | |
| fe | service | |
When I route I should get
| waypoints | route | turns |
| c,e | road,,, | depart,turn right,turn right,arrive |
-34
View File
@@ -22,40 +22,6 @@ Feature: Continue Instructions
| a,c | abc,abc,abc | depart,continue left,arrive | | a,c | abc,abc,abc | depart,continue left,arrive |
| a,d | abc,bd,bd | depart,turn straight,arrive | | a,d | abc,bd,bd | depart,turn straight,arrive |
Scenario: Road turning left, Suffix changes
Given the node map
"""
c
a - b-d
"""
And the ways
| nodes | highway | name |
| ab | primary | North Capitol Northeast |
| bc | primary | North Capitol Northwest |
| bd | primary | some random street |
When I route I should get
| waypoints | route | turns |
| a,c | North Capitol Northeast,North Capitol Northwest,North Capitol Northwest | depart,continue left,arrive |
Scenario: Road turning left, Suffix changes, no-spaces
Given the node map
"""
c
a - b-d
"""
And the ways
| nodes | highway | name |
| ab | primary | North CapitolNortheast |
| bc | primary | North CapitolNorthwest |
| bd | primary | some random street |
When I route I should get
| waypoints | route | turns |
| a,c | North CapitolNortheast,North CapitolNorthwest,North CapitolNorthwest | depart,continue left,arrive |
Scenario: Road turning left and straight Scenario: Road turning left and straight
Given the node map Given the node map
""" """
+4 -59
View File
@@ -905,8 +905,8 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | yb | be | b | only_straight | | restriction | yb | be | b | only_straight |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns | locations |
| z,t | through,,out,out,out | depart,off ramp slight right,round-exit-3,exit rotary right,arrive | z,s,c,e,t | | z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
Scenario: Sliproad before a roundabout Scenario: Sliproad before a roundabout
Given the node map Given the node map
@@ -942,8 +942,8 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | bc | cd | c | only_straight | | restriction | bc | cd | c | only_straight |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns | locations |
| a,k | road,,, | depart,turn right,roundabout turn right exit-1,arrive | a,b,h,k | | a,k | road,,, | depart,turn right,roundabout turn right exit-1,arrive | a,b,h,k |
@sliproads @sliproads
Scenario: Sliproad with 4 roads at target Scenario: Sliproad with 4 roads at target
@@ -996,58 +996,3 @@ Feature: Slipways and Dedicated Turn Lanes
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns | locations |
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f | | s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
@sliproads
Scenario: Sliproad from link via link to primary
Given the node map
"""
d
.
s . a . b
` .
` .
'.
c
.
f
"""
And the ways
| nodes | highway | name | oneway |
| sab | primary_link | sab | |
| dbcf | primary | dbcf | |
| ac | primary_link | ae | yes |
When I route I should get
| waypoints | route | turns | locations |
| s,f | sab,dbcf,dbcf | depart,turn right,arrive | s,a,f |
@sliproads
Scenario: Sliproad with a single intersection in a cross-road
Given the node map
"""
d
.
s . a . b
` .
' c . g
..
e
.
f
"""
And the ways
| nodes | highway | name | oneway |
| sab | primary | sab | |
| dbcef | primary | dbcef | |
| ae | primary_link | sab | yes |
| cg | primary | cg | |
When I route I should get
| waypoints | route | turns | locations |
| s,f | sab,dbcef,dbcef | depart,turn right,arrive | s,a,f |
-19
View File
@@ -24,25 +24,6 @@ Feature: End Of Road Instructions
| a,c | aeb,cbd,cbd | depart,end of road left,arrive | | a,c | aeb,cbd,cbd | depart,end of road left,arrive |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive | | a,d | aeb,cbd,cbd | depart,end of road right,arrive |
# http://map.project-osrm.org/?z=18&center=38.906632%2C-77.008265&loc=38.906463%2C-77.007621&loc=38.906822%2C-77.008860&hl=en&alt=0
Scenario: End of Road, unnamed oneway
Given the node map
"""
c
a e b
f d
"""
And the ways
| nodes | highway | name | oneway |
| aeb | primary | road | yes |
| cbd | primary | | yes |
| ef | primary | turn | yes |
When I route I should get
| waypoints | route | turns |
| a,d | road,, | depart,end of road right,arrive |
@3605 @3605
Scenario: End of Road with oneway through street Scenario: End of Road with oneway through street
Given the node map Given the node map
+4 -4
View File
@@ -140,9 +140,9 @@ Feature: Intersections Data
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | intersections |
| e,f | ea,fb,fb,fb | true:180;false:0 false:150 true:210;false:30 true:150 true:270;true:90 | | 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,gc | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:30 true:180 false:330;true:0 | | 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,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,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 | | 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,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 | | 1,3 | abcda,abcda | true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:214 |
@@ -523,42 +523,3 @@ Feature: Merge Segregated Roads
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 | | a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,false:60 false:120 false:240 true:300,false:0 false:90 false:120 true:180 true:270;true:90 | | j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,false:60 false:120 false:240 true:300,false:0 false:90 false:120 true:180 true:270;true:90 |
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 | | j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
Scenario: Square Area - Don't merge almost circular roads
Given a grid size of 2 meters
Given the node map
"""
i
/
/
/
b---- g .
/ p .
a / \ f
\ / o /
\ / \ /
c n /
/ \ \/
/ k e
/ \ /
h l /
\ /
m . d
/
j
"""
And the ways
| nodes | name | oneway |
| ac | Halenseestraße | yes |
| gb | Halenseestraße | yes |
| cklmdenopgc | Rathenauplatz | yes |
| ig | Kurfürstendamm | yes |
| ef | Kurfürstendamm | yes |
| ch | Hubertusallee | yes |
| jd | Hubertusallee | yes |
When I route I should get
| waypoints | route | turns |
| i,h | Kurfürstendamm,Hubertusallee,Hubertusallee | depart,turn straight,arrive |
+4 -4
View File
@@ -274,8 +274,8 @@ Feature: New-Name Instructions
| bc | Central Expressway | US 75 | motorway | | bc | Central Expressway | US 75 | motorway |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | North Central Expressway,Central Expressway | depart,arrive | | a,c | North Central Expressway,Central Expressway,Central Expressway | depart,new name straight,arrive |
Scenario: Prefix Change Scenario: Prefix Change
Given the node map Given the node map
@@ -289,8 +289,8 @@ Feature: New-Name Instructions
| cb | Central Expressway | US 75 | motorway | | cb | Central Expressway | US 75 | motorway |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| c,a | Central Expressway,North Central Expressway | depart,arrive | | c,a | Central Expressway,North Central Expressway,North Central Expressway | depart,new name straight,arrive |
Scenario: No Name, Same Reference Scenario: No Name, Same Reference
Given the node map Given the node map
+177
View File
@@ -0,0 +1,177 @@
@routing @guidance
Feature: Rotary
Background:
Given the profile "bicycle"
Given a grid size of 30 meters
Scenario: Enter and Exit
Given the node map
"""
a
b
h g c d
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bgecb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
Scenario: Only Enter
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
Scenario: Only Exit
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| b,c | bcegb,bcegb | depart,arrive |
| b,e | bcegb,bcegb | depart,arrive |
| b,g | bcegb,bcegb | depart,arrive |
| c,e | bcegb,bcegb | depart,arrive |
| c,g | bcegb,bcegb | depart,arrive |
| c,b | bcegb,bcegb | depart,arrive |
| e,g | bcegb,bcegb | depart,arrive |
| e,b | bcegb,bcegb | depart,arrive |
| e,c | bcegb,bcegb | depart,arrive |
| g,b | bcegb,bcegb | depart,arrive |
| g,c | bcegb,bcegb | depart,arrive |
| g,e | bcegb,bcegb | depart,arrive |
#needs to be adjusted when name-discovery works for entrys
Scenario: Mixed Entry and Exit
Given the node map
"""
c a
j b f
k e
l h d
g i
"""
And the ways
| nodes | junction | oneway |
| abc | | yes |
| def | | yes |
| ghi | | yes |
| jkl | | yes |
| bkheb | roundabout | yes |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
| d,f | def,def,def | depart,rotary-exit-1,arrive |
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
+58 -58
View File
@@ -24,19 +24,19 @@ Feature: Rotary
| bgecb | roundabout | | bgecb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,cd,cd,cd | depart,bgecb-exit-3,exit rotary right,arrive | | a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
| a,f | ab,ef,ef,ef | depart,bgecb-exit-2,exit rotary right,arrive | | a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
| a,h | ab,gh,gh,gh | depart,bgecb-exit-1,exit rotary right,arrive | | a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
| d,f | cd,ef,ef,ef | depart,bgecb-exit-3,exit rotary right,arrive | | d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
| d,h | cd,gh,gh,gh | depart,bgecb-exit-2,exit rotary right,arrive | | d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
| d,a | cd,ab,ab,ab | depart,bgecb-exit-1,exit rotary right,arrive | | d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
| f,h | ef,gh,gh,gh | depart,bgecb-exit-3,exit rotary right,arrive | | f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
| f,a | ef,ab,ab,ab | depart,bgecb-exit-2,exit rotary right,arrive | | f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
| f,d | ef,cd,cd,cd | depart,bgecb-exit-1,exit rotary right,arrive | | f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
| h,a | gh,ab,ab,ab | depart,bgecb-exit-3,exit rotary right,arrive | | h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
| h,d | gh,cd,cd,cd | depart,bgecb-exit-2,exit rotary right,arrive | | h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
| h,f | gh,ef,ef,ef | depart,bgecb-exit-1,exit rotary right,arrive | | h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
Scenario: Only Enter Scenario: Only Enter
Given the node map Given the node map
@@ -90,19 +90,19 @@ Feature: Rotary
| bcegb | roundabout | | bcegb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,exit rotary right,arrive | | b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,exit rotary right,arrive | | b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,exit rotary right,arrive | | b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,exit rotary right,arrive | | c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,exit rotary right,arrive | | c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,exit rotary right,arrive | | c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,exit rotary right,arrive | | e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,exit rotary right,arrive | | e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,exit rotary right,arrive | | e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,exit rotary right,arrive | | g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,exit rotary right,arrive | | g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,exit rotary right,arrive | | g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits #phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around Scenario: Drive Around
@@ -158,23 +158,23 @@ Feature: Rotary
| bkheb | roundabout | yes | | bkheb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc,abc | depart,exit rotary right,arrive | | a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
| a,l | abc,jkl,jkl,jkl | depart,bkheb-exit-2,exit rotary straight,arrive | | a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
| a,i | abc,ghi,ghi,ghi | depart,bkheb-exit-3,exit rotary straight,arrive | | a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
| a,f | abc,def,def,def | depart,bkheb-exit-4,exit rotary straight,arrive | | a,f | abc,def,def | depart,bkheb-exit-4,arrive |
| d,f | def,def,def | depart,exit rotary right,arrive | | d,f | def,def,def | depart,rotary-exit-1,arrive |
| d,c | def,abc,abc,abc | depart,bkheb-exit-2,exit rotary straight,arrive | | d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
| d,l | def,jkl,jkl,jkl | depart,bkheb-exit-3,exit rotary straight,arrive | | d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
| d,i | def,ghi,ghi,ghi | depart,bkheb-exit-4,exit rotary straight,arrive | | d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,exit rotary right,arrive | | g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
| g,f | ghi,def,def,def | depart,bkheb-exit-2,exit rotary straight,arrive | | g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
| g,c | ghi,abc,abc,abc | depart,bkheb-exit-3,exit rotary straight,arrive | | g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
| g,l | ghi,jkl,jkl,jkl | depart,bkheb-exit-4,exit rotary straight,arrive | | g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,exit rotary right,arrive | | j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
| j,i | jkl,ghi,ghi,ghi | depart,bkheb-exit-2,exit rotary straight,arrive | | j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
| j,f | jkl,def,def,def | depart,bkheb-exit-3,exit rotary straight,arrive | | j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
| j,c | jkl,abc,abc,abc | depart,bkheb-exit-4,exit rotary straight,arrive | | j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
Scenario: Collinear in X,Y Scenario: Collinear in X,Y
Given the node map Given the node map
@@ -193,9 +193,9 @@ Feature: Rotary
| df | | | df | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,e | ab,ce,ce,ce | depart,bcdb-exit-1,exit rotary straight,arrive | | a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df,df | depart,bcdb-exit-2,exit rotary straight,arrive | | a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y Scenario: Collinear in X,Y
Given the node map Given the node map
@@ -214,9 +214,9 @@ Feature: Rotary
| cf | | | cf | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,e | ad,be,be,be | depart,bcdb-exit-1,exit rotary straight,arrive | | a,e | ad,be,be | depart,bcdb-exit-1,arrive |
| a,f | ad,cf,cf,cf | depart,bcdb-exit-2,exit rotary straight,arrive | | a,f | ad,cf,cf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y Scenario: Collinear in X,Y
Given the node map Given the node map
@@ -235,9 +235,9 @@ Feature: Rotary
| bf | | | bf | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,e | ac,de,de,de | depart,bcdb-exit-1,exit rotary straight,arrive | | a,e | ac,de,de | depart,bcdb-exit-1,arrive |
| a,f | ac,bf,bf,bf | depart,bcdb-exit-2,exit rotary straight,arrive | | a,f | ac,bf,bf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y Scenario: Collinear in X,Y
Given the node map Given the node map
@@ -256,9 +256,9 @@ Feature: Rotary
| df | | | df | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,e | ab,ce,ce,ce | depart,bcdb-exit-1,exit rotary right,arrive | | a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df,df | depart,bcdb-exit-2,exit rotary right,arrive | | a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y Scenario: Collinear in X,Y
Given the node map Given the node map
@@ -277,6 +277,6 @@ Feature: Rotary
| df | | | df | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,e | ab,ce,ce,ce | depart,bcdb-exit-1,exit rotary right,arrive | | a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df,df | depart,bcdb-exit-2,exit rotary right,arrive | | a,f | ab,df,df | depart,bcdb-exit-2,arrive |
+96 -30
View File
@@ -5,6 +5,39 @@ Feature: Basic Roundabout
Given the profile "bicycle" Given the profile "bicycle"
Given a grid size of 10 meters Given a grid size of 10 meters
Scenario: Only Enter
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
Scenario: Only Exit Scenario: Only Exit
Given the node map Given the node map
""" """
@@ -24,21 +57,54 @@ Feature: Basic Roundabout
| bcegb | roundabout | | bcegb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | g,f | bcegb,ef,ef | depart,roundabout-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits #phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| b,c | bcegb,bcegb | depart,arrive |
| b,e | bcegb,bcegb | depart,arrive |
| b,g | bcegb,bcegb | depart,arrive |
| c,e | bcegb,bcegb | depart,arrive |
| c,g | bcegb,bcegb | depart,arrive |
| c,b | bcegb,bcegb | depart,arrive |
| e,g | bcegb,bcegb | depart,arrive |
| e,b | bcegb,bcegb | depart,arrive |
| e,c | bcegb,bcegb | depart,arrive |
| g,b | bcegb,bcegb | depart,arrive |
| g,c | bcegb,bcegb | depart,arrive |
| g,e | bcegb,bcegb | depart,arrive |
Scenario: Mixed Entry and Exit Scenario: Mixed Entry and Exit
Given the node map Given the node map
""" """
@@ -58,20 +124,20 @@ Feature: Basic Roundabout
| bkheb | roundabout | yes | | bkheb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc,abc | depart,exit roundabout right,arrive | | a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
| a,l | abc,jkl,jkl,jkl | depart,roundabout-exit-2,exit roundabout straight,arrive | | a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
| a,i | abc,ghi,ghi,ghi | depart,roundabout-exit-3,exit roundabout straight,arrive | | a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
| a,f | abc,def,def,def | depart,roundabout-exit-4,exit roundabout straight,arrive | | a,f | abc,def,def | depart,roundabout-exit-4,arrive |
| d,f | def,def,def | depart,exit roundabout right,arrive | | d,f | def,def,def | depart,roundabout-exit-1,arrive |
| d,c | def,abc,abc,abc | depart,roundabout-exit-2,exit roundabout straight,arrive | | d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
| d,l | def,jkl,jkl,jkl | depart,roundabout-exit-3,exit roundabout straight,arrive | | d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
| d,i | def,ghi,ghi,ghi | depart,roundabout-exit-4,exit roundabout straight,arrive | | d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,exit roundabout right,arrive | | g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
| g,f | ghi,def,def,def | depart,roundabout-exit-2,exit roundabout straight,arrive | | g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
| g,c | ghi,abc,abc,abc | depart,roundabout-exit-3,exit roundabout straight,arrive | | g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
| g,l | ghi,jkl,jkl,jkl | depart,roundabout-exit-4,exit roundabout straight,arrive | | g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,exit roundabout right,arrive | | j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
| j,i | jkl,ghi,ghi,ghi | depart,roundabout-exit-2,exit roundabout straight,arrive | | j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
| j,f | jkl,def,def,def | depart,roundabout-exit-3,exit roundabout straight,arrive | | j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
| j,c | jkl,abc,abc,abc | depart,roundabout-exit-4,exit roundabout straight,arrive | | j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
@@ -5,7 +5,7 @@ Feature: Basic Roundabout
Given a grid size of 10 meters Given a grid size of 10 meters
Given the profile file "car" initialized with Given the profile file "car" initialized with
""" """
profile.left_hand_driving = true profile.properties.left_hand_driving = true
""" """
Scenario: Roundabout exit counting for left sided driving Scenario: Roundabout exit counting for left sided driving
@@ -52,7 +52,7 @@ Feature: Basic Roundabout
| behkb | roundabout | yes | | behkb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| c,a | cba,cba,cba | depart,exit roundabout left,arrive | | c,a | cba,cba,cba | depart,roundabout-exit-1,arrive |
| l,a | lkj,cba,cba,cba | depart,roundabout-exit-2,exit roundabout straight,arrive | | l,a | lkj,cba,cba | depart,roundabout-exit-2,arrive |
| i,a | ihg,cba,cba,cba | depart,roundabout-exit-3,exit roundabout straight,arrive | | i,a | ihg,cba,cba | depart,roundabout-exit-3,arrive |
+46 -13
View File
@@ -5,6 +5,39 @@ Feature: Basic Roundabout
Given the profile "bicycle" Given the profile "bicycle"
Given a grid size of 10 meters 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 |
# https://www.openstreetmap.org/way/223225602 # https://www.openstreetmap.org/way/223225602
Scenario: Enter and Exit with changing mode Scenario: Enter and Exit with changing mode
Given the node map Given the node map
@@ -25,16 +58,16 @@ Feature: Basic Roundabout
| bgecb | roundabout | residential | | bgecb | roundabout | residential |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive | | a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
| a,f | ab,ef,ef,ef | depart,roundabout turn straight exit-1,exit roundabout right,arrive | | a,f | ab,ef,ef,ef | depart,roundabout turn left exit-1,notification right,arrive |
| a,h | ab,gh,gh,gh | depart,roundabout turn right exit-1,exit roundabout right,arrive | | a,h | ab,bgecb,gh,gh | depart,roundabout turn right exit-1,notification right,arrive |
| d,f | cd,ef,ef,ef | depart,roundabout turn left exit-2,exit roundabout right,arrive | | d,f | cd,ef,ef,ef | depart,roundabout turn sharp left exit-2,notification right,arrive |
| d,h | cd,gh,gh,gh | depart,roundabout turn straight exit-2,exit roundabout right,arrive | | d,h | cd,gh,gh,gh | depart,roundabout turn left exit-2,notification right,arrive |
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive | | d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
| f,h | ef,gh,gh,gh | depart,roundabout turn left exit-3,exit roundabout right,arrive | | f,h | ef,gh,gh,gh | depart,roundabout turn sharp left exit-3,notification right,arrive |
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,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 | | f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
| h,a | gh,ab,ab | depart,roundabout turn left exit-2,arrive | | h,a | gh,ab,ab | depart,roundabout turn left exit-2,arrive |
| h,d | gh,cd,cd | depart,roundabout turn straight exit-1,arrive | | h,d | gh,cd,cd | depart,roundabout turn straight exit-1,arrive |
| h,f | gh,ef,ef,ef | depart,roundabout turn right exit-1,exit roundabout right,arrive | | h,f | gh,bgecb,ef,ef | depart,roundabout turn right exit-1,notification right,arrive |
+86 -86
View File
@@ -56,19 +56,19 @@ Feature: Basic Roundabout
| bgecb | roundabout | | bgecb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive | | 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,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,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,f | cd,ef,ef | depart,roundabout turn left exit-3,arrive |
| d,h | cd,gh,gh | depart,roundabout turn straight exit-2,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 | | 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,h | ef,gh,gh | depart,roundabout turn left exit-3,arrive |
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,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 | | 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,a | gh,ab,ab | depart,roundabout turn left exit-3,arrive |
| h,d | gh,cd,cd | depart,roundabout turn straight exit-2,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 | | h,f | gh,ef,ef | depart,roundabout turn right exit-1,arrive |
Scenario: Only Enter Scenario: Only Enter
Given the node map Given the node map
@@ -122,19 +122,19 @@ Feature: Basic Roundabout
| bcegb | roundabout | | bcegb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | g,f | bcegb,ef,ef | depart,roundabout-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits #phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around Scenario: Drive Around
@@ -189,23 +189,23 @@ Feature: Basic Roundabout
| bkheb | roundabout | yes | | bkheb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc,abc | depart,exit roundabout right,arrive | | a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
| a,l | abc,jkl,jkl,jkl | depart,roundabout-exit-2,exit roundabout straight,arrive | | a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
| a,i | abc,ghi,ghi,ghi | depart,roundabout-exit-3,exit roundabout straight,arrive | | a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
| a,f | abc,def,def,def | depart,roundabout-exit-4,exit roundabout straight,arrive | | a,f | abc,def,def | depart,roundabout-exit-4,arrive |
| d,f | def,def,def | depart,exit roundabout right,arrive | | d,f | def,def,def | depart,roundabout-exit-1,arrive |
| d,c | def,abc,abc,abc | depart,roundabout-exit-2,exit roundabout straight,arrive | | d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
| d,l | def,jkl,jkl,jkl | depart,roundabout-exit-3,exit roundabout straight,arrive | | d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
| d,i | def,ghi,ghi,ghi | depart,roundabout-exit-4,exit roundabout straight,arrive | | d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,exit roundabout right,arrive | | g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
| g,f | ghi,def,def,def | depart,roundabout-exit-2,exit roundabout straight,arrive | | g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
| g,c | ghi,abc,abc,abc | depart,roundabout-exit-3,exit roundabout straight,arrive | | g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
| g,l | ghi,jkl,jkl,jkl | depart,roundabout-exit-4,exit roundabout straight,arrive | | g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,exit roundabout right,arrive | | j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
| j,i | jkl,ghi,ghi,ghi | depart,roundabout-exit-2,exit roundabout straight,arrive | | j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
| j,f | jkl,def,def,def | depart,roundabout-exit-3,exit roundabout straight,arrive | | j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
| j,c | jkl,abc,abc,abc | depart,roundabout-exit-4,exit roundabout straight,arrive | | j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
Scenario: Segregated roads - Not an intersection Scenario: Segregated roads - Not an intersection
Given the node map Given the node map
@@ -226,23 +226,23 @@ Feature: Basic Roundabout
| bkheb | roundabout | yes | | bkheb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc,abc,abc | depart,roundabout-exit-4,exit roundabout right,arrive | | a,c | abc,abc,abc | depart,roundabout-exit-4,arrive |
| a,l | abc,jkl,jkl,jkl | depart,roundabout-exit-1,exit roundabout right,arrive | | a,l | abc,jkl,jkl | depart,roundabout-exit-1,arrive |
| a,i | abc,ghi,ghi,ghi | depart,roundabout-exit-2,exit roundabout right,arrive | | a,i | abc,ghi,ghi | depart,roundabout-exit-2,arrive |
| a,f | abc,def,def,def | depart,roundabout-exit-3,exit roundabout right,arrive | | a,f | abc,def,def | depart,roundabout-exit-3,arrive |
| d,f | def,def,def,def | depart,roundabout-exit-4,exit roundabout right,arrive | | d,f | def,def,def | depart,roundabout-exit-4,arrive |
| d,c | def,abc,abc,abc | depart,roundabout-exit-1,exit roundabout right,arrive | | d,c | def,abc,abc | depart,roundabout-exit-1,arrive |
| d,l | def,jkl,jkl,jkl | depart,roundabout-exit-2,exit roundabout right,arrive | | d,l | def,jkl,jkl | depart,roundabout-exit-2,arrive |
| d,i | def,ghi,ghi,ghi | depart,roundabout-exit-3,exit roundabout right,arrive | | d,i | def,ghi,ghi | depart,roundabout-exit-3,arrive |
| g,i | ghi,ghi,ghi,ghi | depart,roundabout-exit-4,exit roundabout right,arrive | | g,i | ghi,ghi,ghi | depart,roundabout-exit-4,arrive |
| g,f | ghi,def,def,def | depart,roundabout-exit-1,exit roundabout right,arrive | | g,f | ghi,def,def | depart,roundabout-exit-1,arrive |
| g,c | ghi,abc,abc,abc | depart,roundabout-exit-2,exit roundabout right,arrive | | g,c | ghi,abc,abc | depart,roundabout-exit-2,arrive |
| g,l | ghi,jkl,jkl,jkl | depart,roundabout-exit-3,exit roundabout right,arrive | | g,l | ghi,jkl,jkl | depart,roundabout-exit-3,arrive |
| j,l | jkl,jkl,jkl,jkl | depart,roundabout-exit-4,exit roundabout right,arrive | | j,l | jkl,jkl,jkl | depart,roundabout-exit-4,arrive |
| j,i | jkl,ghi,ghi,ghi | depart,roundabout-exit-1,exit roundabout right,arrive | | j,i | jkl,ghi,ghi | depart,roundabout-exit-1,arrive |
| j,f | jkl,def,def,def | depart,roundabout-exit-2,exit roundabout right,arrive | | j,f | jkl,def,def | depart,roundabout-exit-2,arrive |
| j,c | jkl,abc,abc,abc | depart,roundabout-exit-3,exit roundabout right,arrive | | j,c | jkl,abc,abc | depart,roundabout-exit-3,arrive |
Scenario: Collinear in X Scenario: Collinear in X
Given the node map Given the node map
@@ -368,19 +368,19 @@ Feature: Basic Roundabout
| bigecb | roundabout | | bigecb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,cd,cd,cd | depart,roundabout-exit-4,exit roundabout right,arrive | | a,d | ab,cd,cd | depart,roundabout-exit-4,arrive |
| a,f | ab,ef,ef,ef | depart,roundabout-exit-3,exit roundabout right,arrive | | a,f | ab,ef,ef | depart,roundabout-exit-3,arrive |
| a,h | ab,gh,gh,gh | depart,roundabout-exit-2,exit roundabout right,arrive | | a,h | ab,gh,gh | depart,roundabout-exit-2,arrive |
| d,f | cd,ef,ef,ef | depart,roundabout-exit-4,exit roundabout right,arrive | | d,f | cd,ef,ef | depart,roundabout-exit-4,arrive |
| d,h | cd,gh,gh,gh | depart,roundabout-exit-3,exit roundabout right,arrive | | d,h | cd,gh,gh | depart,roundabout-exit-3,arrive |
| d,a | cd,ab,ab,ab | depart,roundabout-exit-1,exit roundabout right,arrive | | d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
| f,h | ef,gh,gh,gh | depart,roundabout-exit-4,exit roundabout right,arrive | | f,h | ef,gh,gh | depart,roundabout-exit-4,arrive |
| f,a | ef,ab,ab,ab | depart,roundabout-exit-2,exit roundabout right,arrive | | f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
| f,d | ef,cd,cd,cd | depart,roundabout-exit-1,exit roundabout right,arrive | | f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
| h,a | gh,ab,ab,ab | depart,roundabout-exit-3,exit roundabout right,arrive | | h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
| h,d | gh,cd,cd,cd | depart,roundabout-exit-2,exit roundabout right,arrive | | h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
| h,f | gh,ef,ef,ef | depart,roundabout-exit-1,exit roundabout right,arrive | | h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
Scenario: Enter and Exit -- Non-Distinct Scenario: Enter and Exit -- Non-Distinct
Given the node map Given the node map
@@ -401,19 +401,19 @@ Feature: Basic Roundabout
| bgecb | roundabout | | bgecb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,cd,cd,cd | depart,roundabout-exit-3,exit roundabout right,arrive | | a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
| a,f | ab,ef,ef,ef | depart,roundabout-exit-2,exit roundabout right,arrive | | a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
| a,h | ab,gh,gh,gh | depart,roundabout-exit-1,exit roundabout straight,arrive | | a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
| d,f | cd,ef,ef,ef | depart,roundabout-exit-3,exit roundabout right,arrive | | d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
| d,h | cd,gh,gh,gh | depart,roundabout-exit-2,exit roundabout straight,arrive | | d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
| d,a | cd,ab,ab,ab | depart,roundabout-exit-1,exit roundabout right,arrive | | d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
| f,h | ef,gh,gh,gh | depart,roundabout-exit-3,exit roundabout straight,arrive | | f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
| f,a | ef,ab,ab,ab | depart,roundabout-exit-2,exit roundabout right,arrive | | f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
| f,d | ef,cd,cd,cd | depart,roundabout-exit-1,exit roundabout right,arrive | | f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
| h,a | gh,ab,ab,ab | depart,roundabout-exit-3,exit roundabout right,arrive | | h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
| h,d | gh,cd,cd,cd | depart,roundabout-exit-2,exit roundabout right,arrive | | h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
| h,f | gh,ef,ef,ef | depart,roundabout-exit-1,exit roundabout right,arrive | | h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
Scenario: Enter and Exit -- Bearing Scenario: Enter and Exit -- Bearing
Given the node map Given the node map
+161 -160
View File
@@ -57,10 +57,10 @@ Feature: Basic Roundabout
| bcegb | roundabout | primary | | bcegb | roundabout | primary |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,cd,cd,cd | depart,roundabout-exit-1,exit roundabout right,arrive | | a,d | ab,cd,cd | depart,roundabout-exit-1,arrive |
| a,h | ab,gh,gh,gh | depart,roundabout-exit-2,exit roundabout straight,arrive | | a,h | ab,gh,gh | depart,roundabout-exit-2,arrive |
| a,f | ab,ef,ef,ef | depart,roundabout-exit-2,exit roundabout right,arrive | | a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
#2927 #2927
Scenario: Only Roundabout Scenario: Only Roundabout
@@ -98,19 +98,19 @@ Feature: Basic Roundabout
| bcegb | roundabout | | bcegb | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,exit roundabout right,arrive | | e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,exit roundabout right,arrive | | g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,exit roundabout right,arrive | | g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,exit roundabout right,arrive | | g,f | bcegb,ef,ef | depart,roundabout-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits #phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around Scenario: Drive Around
@@ -165,23 +165,23 @@ Feature: Basic Roundabout
| bkheb | roundabout | yes | | bkheb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc,abc | depart,exit roundabout right,arrive | | a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
| a,l | abc,jkl,jkl,jkl | depart,roundabout-exit-2,exit roundabout straight,arrive | | a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
| a,i | abc,ghi,ghi,ghi | depart,roundabout-exit-3,exit roundabout straight,arrive | | a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
| a,f | abc,def,def,def | depart,roundabout-exit-4,exit roundabout straight,arrive | | a,f | abc,def,def | depart,roundabout-exit-4,arrive |
| d,f | def,def,def | depart,exit roundabout right,arrive | | d,f | def,def,def | depart,roundabout-exit-1,arrive |
| d,c | def,abc,abc,abc | depart,roundabout-exit-2,exit roundabout straight,arrive | | d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
| d,l | def,jkl,jkl,jkl | depart,roundabout-exit-3,exit roundabout straight,arrive | | d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
| d,i | def,ghi,ghi,ghi | depart,roundabout-exit-4,exit roundabout straight,arrive | | d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,exit roundabout right,arrive | | g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
| g,f | ghi,def,def,def | depart,roundabout-exit-2,exit roundabout straight,arrive | | g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
| g,c | ghi,abc,abc,abc | depart,roundabout-exit-3,exit roundabout straight,arrive | | g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
| g,l | ghi,jkl,jkl,jkl | depart,roundabout-exit-4,exit roundabout straight,arrive | | g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,exit roundabout right,arrive | | j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
| j,i | jkl,ghi,ghi,ghi | depart,roundabout-exit-2,exit roundabout straight,arrive | | j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
| j,f | jkl,def,def,def | depart,roundabout-exit-3,exit roundabout straight,arrive | | j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
| j,c | jkl,abc,abc,abc | depart,roundabout-exit-4,exit roundabout straight,arrive | | j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
Scenario: Mixed Entry and Exit - segregated roads Scenario: Mixed Entry and Exit - segregated roads
Given the node map Given the node map
@@ -204,23 +204,23 @@ Feature: Basic Roundabout
| bkheb | roundabout | yes | | bkheb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc,abc,abc | depart,roundabout-exit-4,exit roundabout right,arrive | | a,c | abc,abc,abc | depart,roundabout-exit-4,arrive |
| a,l | abc,jkl,jkl,jkl | depart,roundabout-exit-1,exit roundabout right,arrive | | a,l | abc,jkl,jkl | depart,roundabout-exit-1,arrive |
| a,i | abc,ghi,ghi,ghi | depart,roundabout-exit-2,exit roundabout right,arrive | | a,i | abc,ghi,ghi | depart,roundabout-exit-2,arrive |
| a,f | abc,def,def,def | depart,roundabout-exit-3,exit roundabout right,arrive | | a,f | abc,def,def | depart,roundabout-exit-3,arrive |
| d,f | def,def,def,def | depart,roundabout-exit-4,exit roundabout right,arrive | | d,f | def,def,def | depart,roundabout-exit-4,arrive |
| d,c | def,abc,abc,abc | depart,roundabout-exit-1,exit roundabout right,arrive | | d,c | def,abc,abc | depart,roundabout-exit-1,arrive |
| d,l | def,jkl,jkl,jkl | depart,roundabout-exit-2,exit roundabout right,arrive | | d,l | def,jkl,jkl | depart,roundabout-exit-2,arrive |
| d,i | def,ghi,ghi,ghi | depart,roundabout-exit-3,exit roundabout right,arrive | | d,i | def,ghi,ghi | depart,roundabout-exit-3,arrive |
| g,i | ghi,ghi,ghi,ghi | depart,roundabout-exit-4,exit roundabout right,arrive | | g,i | ghi,ghi,ghi | depart,roundabout-exit-4,arrive |
| g,f | ghi,def,def,def | depart,roundabout-exit-1,exit roundabout right,arrive | | g,f | ghi,def,def | depart,roundabout-exit-1,arrive |
| g,c | ghi,abc,abc,abc | depart,roundabout-exit-2,exit roundabout right,arrive | | g,c | ghi,abc,abc | depart,roundabout-exit-2,arrive |
| g,l | ghi,jkl,jkl,jkl | depart,roundabout-exit-3,exit roundabout right,arrive | | g,l | ghi,jkl,jkl | depart,roundabout-exit-3,arrive |
| j,l | jkl,jkl,jkl,jkl | depart,roundabout-exit-4,exit roundabout right,arrive | | j,l | jkl,jkl,jkl | depart,roundabout-exit-4,arrive |
| j,i | jkl,ghi,ghi,ghi | depart,roundabout-exit-1,exit roundabout right,arrive | | j,i | jkl,ghi,ghi | depart,roundabout-exit-1,arrive |
| j,f | jkl,def,def,def | depart,roundabout-exit-2,exit roundabout right,arrive | | j,f | jkl,def,def | depart,roundabout-exit-2,arrive |
| j,c | jkl,abc,abc,abc | depart,roundabout-exit-3,exit roundabout right,arrive | | j,c | jkl,abc,abc | depart,roundabout-exit-3,arrive |
Scenario: Mixed Entry and Exit - clockwise order Scenario: Mixed Entry and Exit - clockwise order
Given the node map Given the node map
@@ -241,23 +241,23 @@ Feature: Basic Roundabout
| behkb | roundabout | yes | | behkb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc,abc,abc | depart,roundabout-exit-4,exit roundabout left,arrive | | a,c | abc,abc,abc | depart,roundabout-exit-4,arrive |
| a,l | abc,jkl,jkl,jkl | depart,roundabout-exit-3,exit roundabout left,arrive | | a,l | abc,jkl,jkl | depart,roundabout-exit-3,arrive |
| a,i | abc,ghi,ghi,ghi | depart,roundabout-exit-2,exit roundabout left,arrive | | a,i | abc,ghi,ghi | depart,roundabout-exit-2,arrive |
| a,f | abc,def,def,def | depart,roundabout-exit-1,exit roundabout left,arrive | | a,f | abc,def,def | depart,roundabout-exit-1,arrive |
| d,f | def,def,def,def | depart,roundabout-exit-4,exit roundabout left,arrive | | d,f | def,def,def | depart,roundabout-exit-4,arrive |
| d,c | def,abc,abc,abc | depart,roundabout-exit-3,exit roundabout left,arrive | | d,c | def,abc,abc | depart,roundabout-exit-3,arrive |
| d,l | def,jkl,jkl,jkl | depart,roundabout-exit-2,exit roundabout left,arrive | | d,l | def,jkl,jkl | depart,roundabout-exit-2,arrive |
| d,i | def,ghi,ghi,ghi | depart,roundabout-exit-1,exit roundabout left,arrive | | d,i | def,ghi,ghi | depart,roundabout-exit-1,arrive |
| g,i | ghi,ghi,ghi,ghi | depart,roundabout-exit-4,exit roundabout left,arrive | | g,i | ghi,ghi,ghi | depart,roundabout-exit-4,arrive |
| g,f | ghi,def,def,def | depart,roundabout-exit-3,exit roundabout left,arrive | | g,f | ghi,def,def | depart,roundabout-exit-3,arrive |
| g,c | ghi,abc,abc,abc | depart,roundabout-exit-2,exit roundabout left,arrive | | g,c | ghi,abc,abc | depart,roundabout-exit-2,arrive |
| g,l | ghi,jkl,jkl,jkl | depart,roundabout-exit-1,exit roundabout left,arrive | | g,l | ghi,jkl,jkl | depart,roundabout-exit-1,arrive |
| j,l | jkl,jkl,jkl,jkl | depart,roundabout-exit-4,exit roundabout left,arrive | | j,l | jkl,jkl,jkl | depart,roundabout-exit-4,arrive |
| j,i | jkl,ghi,ghi,ghi | depart,roundabout-exit-3,exit roundabout left,arrive | | j,i | jkl,ghi,ghi | depart,roundabout-exit-3,arrive |
| j,f | jkl,def,def,def | depart,roundabout-exit-2,exit roundabout left,arrive | | j,f | jkl,def,def | depart,roundabout-exit-2,arrive |
| j,c | jkl,abc,abc,abc | depart,roundabout-exit-1,exit roundabout left,arrive | | j,c | jkl,abc,abc | depart,roundabout-exit-1,arrive |
Scenario: Mixed Entry and Exit - segregated roads, different names Scenario: Mixed Entry and Exit - segregated roads, different names
Given the node map Given the node map
@@ -284,23 +284,23 @@ Feature: Basic Roundabout
| bkheb | roundabout | yes | | bkheb | roundabout | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | ab,bc,bc,bc | depart,roundabout-exit-4,exit roundabout right,arrive | | a,c | ab,bc,bc | depart,roundabout-exit-4,arrive |
| a,l | ab,kl,kl,kl | depart,roundabout-exit-1,exit roundabout right,arrive | | a,l | ab,kl,kl | depart,roundabout-exit-1,arrive |
| a,i | ab,hi,hi,hi | depart,roundabout-exit-2,exit roundabout right,arrive | | a,i | ab,hi,hi | depart,roundabout-exit-2,arrive |
| a,f | ab,ef,ef,ef | depart,roundabout-exit-3,exit roundabout right,arrive | | a,f | ab,ef,ef | depart,roundabout-exit-3,arrive |
| d,f | de,ef,ef,ef | depart,roundabout-exit-4,exit roundabout right,arrive | | d,f | de,ef,ef | depart,roundabout-exit-4,arrive |
| d,c | de,bc,bc,bc | depart,roundabout-exit-1,exit roundabout right,arrive | | d,c | de,bc,bc | depart,roundabout-exit-1,arrive |
| d,l | de,kl,kl,kl | depart,roundabout-exit-2,exit roundabout right,arrive | | d,l | de,kl,kl | depart,roundabout-exit-2,arrive |
| d,i | de,hi,hi,hi | depart,roundabout-exit-3,exit roundabout right,arrive | | d,i | de,hi,hi | depart,roundabout-exit-3,arrive |
| g,i | gh,hi,hi,hi | depart,roundabout-exit-4,exit roundabout right,arrive | | g,i | gh,hi,hi | depart,roundabout-exit-4,arrive |
| g,f | gh,ef,ef,ef | depart,roundabout-exit-1,exit roundabout right,arrive | | g,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
| g,c | gh,bc,bc,bc | depart,roundabout-exit-2,exit roundabout right,arrive | | g,c | gh,bc,bc | depart,roundabout-exit-2,arrive |
| g,l | gh,kl,kl,kl | depart,roundabout-exit-3,exit roundabout right,arrive | | g,l | gh,kl,kl | depart,roundabout-exit-3,arrive |
| j,l | jk,kl,kl,kl | depart,roundabout-exit-4,exit roundabout right,arrive | | j,l | jk,kl,kl | depart,roundabout-exit-4,arrive |
| j,i | jk,hi,hi,hi | depart,roundabout-exit-1,exit roundabout right,arrive | | j,i | jk,hi,hi | depart,roundabout-exit-1,arrive |
| j,f | jk,ef,ef,ef | depart,roundabout-exit-2,exit roundabout right,arrive | | j,f | jk,ef,ef | depart,roundabout-exit-2,arrive |
| j,c | jk,bc,bc,bc | depart,roundabout-exit-3,exit roundabout right,arrive | | j,c | jk,bc,bc | depart,roundabout-exit-3,arrive |
Scenario: Motorway Roundabout Scenario: Motorway Roundabout
#See 39.933742 -75.082345 #See 39.933742 -75.082345
@@ -338,10 +338,11 @@ Feature: Basic Roundabout
| dmg | roundabout | | trunk_link | yes | | | dmg | roundabout | | trunk_link | yes | |
When I route I should get When I route I should get
| waypoints | route | turns | ref | | waypoints | route | turns | ref |
| a,e | crescent,crescent,crescent,crescent | depart,roundabout-exit-3,exit roundabout straight,arrive | US 130,US 130,US 130,US 130 | | a,e | crescent,crescent,crescent | depart,roundabout-exit-3,arrive | US 130,US 130,US 130 |
| j,l | ,,, | depart,roundabout-exit-2,exit roundabout straight,arrive | NJ 38,NJ 38,NJ 38,NJ 38 | | j,l | ,, | depart,roundabout-exit-2,arrive | NJ 38,NJ 38,NJ 38 |
@todo
# this test previously only passed by accident. We need to handle throughabouts correctly, since staying on massachusetts is actually # this test previously only passed by accident. We need to handle throughabouts correctly, since staying on massachusetts is actually
# the desired setting. Rotary instructions here are not wanted but rather no instruction at all to go through the roundabout (or add # the desired setting. Rotary instructions here are not wanted but rather no instruction at all to go through the roundabout (or add
# a throughabout instruction) # a throughabout instruction)
@@ -388,8 +389,8 @@ Feature: Basic Roundabout
| restriction | pi | ij | i | no_left_turn | | restriction | pi | ij | i | no_left_turn |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,exit rotary right,arrive | | a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,rotary-exit-1,arrive |
#2856 - http://www.openstreetmap.org/#map=19/47.23318/-1.56563 #2856 - http://www.openstreetmap.org/#map=19/47.23318/-1.56563
Scenario: Linked Roundabouts Scenario: Linked Roundabouts
@@ -476,8 +477,8 @@ Feature: Basic Roundabout
| cdefib | roundabout | roundabout | yes | | | cdefib | roundabout | roundabout | yes | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| 1,h | roundabout,right-bot-out,right-bot-out | depart,exit rotary straight,arrive | | 1,h | roundabout,right-bot-out,right-bot-out | depart,roundabout-exit-1,arrive |
@3254 @3254
Scenario: Driving up to and through a roundabout Scenario: Driving up to and through a roundabout
@@ -494,15 +495,15 @@ Feature: Basic Roundabout
And the ways And the ways
| nodes | junction | name | highway | | nodes | junction | name | highway |
| abcda | roundabout | rotary | residential | | abcda | roundabout | roundabout | residential |
| gfi | | side | residential | | gfi | | side | residential |
| efb | | left | residential | | efb | | left | residential |
| dh | | right | residential | | dh | | right | residential |
| ck | | bottom | residential | | ck | | bottom | residential |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| e,h | left,right,right,right | depart,rotary-exit-2,exit rotary right,arrive | | e,h | left,right,right | depart,roundabout-exit-2,arrive |
@3254 @3254
Scenario: Driving up to and through a roundabout Scenario: Driving up to and through a roundabout
@@ -519,15 +520,15 @@ Feature: Basic Roundabout
And the ways And the ways
| nodes | junction | name | highway | | nodes | junction | name | highway |
| abcda | roundabout | rotary | residential | | abcda | roundabout | roundabout | residential |
| gfi | | side | residential | | gfi | | side | residential |
| efb | | left | residential | | efb | | left | residential |
| dh | | right | residential | | dh | | right | residential |
| ck | | bottom | residential | | ck | | bottom | residential |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| e,h | left,right,right,right | depart,rotary-exit-2,exit rotary right,arrive | | e,h | left,right,right | depart,roundabout-exit-2,arrive |
@3361 @3361
Scenario: Bersarinplatz (Not a Roundabout) Scenario: Bersarinplatz (Not a Roundabout)
@@ -564,13 +565,13 @@ Feature: Basic Roundabout
| mn | | Petersburger Strasse | B 96a | primary | yes | | mn | | Petersburger Strasse | B 96a | primary | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,exit rotary straight,arrive | | a,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
| d,g | Weidenweg,Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-1,exit rotary straight,arrive | | d,g | Weidenweg,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-1,arrive |
| i,k | Petersburger Strasse,Rigaer Strasse,Rigaer Strasse,Rigaer Strasse | depart,Bersarinplatz-exit-1,exit rotary right,arrive | | i,k | Petersburger Strasse,Rigaer Strasse,Rigaer Strasse | depart,Bersarinplatz-exit-1,arrive |
| i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,exit rotary straight,arrive | | i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
| i,d | Petersburger Strasse,Weidenweg,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,exit rotary right,arrive | | i,d | Petersburger Strasse,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,arrive |
| i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,exit rotary straight,arrive | | i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,arrive |
@turboroundabout @turboroundabout
# http://www.openstreetmap.org/?mlat=48.782118&mlon=8.194456&zoom=16#map=19/48.78216/8.19457 # http://www.openstreetmap.org/?mlat=48.782118&mlon=8.194456&zoom=16#map=19/48.78216/8.19457
@@ -605,11 +606,11 @@ Feature: Basic Roundabout
| ob | trunk | yes | roundabout | Europaplatz | | | ob | trunk | yes | roundabout | Europaplatz | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ,Europastrasse,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,exit rotary right,arrive | | a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive |
| a,h | ,Allee Cite,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,exit rotary right,arrive | | a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive |
| a,l | ,Europastrasse,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,exit rotary right,arrive | | a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive |
| a,p | ,,, | depart,Europaplatz-exit-4,exit rotary right,arrive | | a,p | ,, | depart,Europaplatz-exit-4,arrive |
@turboroundabout @turboroundabout
# http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506 # http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506
@@ -657,14 +658,14 @@ Feature: Basic Roundabout
| wb | primary | yes | roundabout | | through\|through;right | | wb | primary | yes | roundabout | | through\|through;right |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive | | a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive |
| a,r | Le-Cannet-Rocheville-Strasse,,, | depart,roundabout-exit-4,exit roundabout right,arrive | | a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive |
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,exit roundabout right,arrive | | a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive |
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,exit roundabout right,arrive | | a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive |
| u,r | ,,, | depart,roundabout-exit-5,exit roundabout right,arrive | | u,r | ,, | depart,roundabout-exit-5,arrive |
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,exit roundabout right,arrive | | j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive |
| n,m | , | depart,arrive | | n,m | , | depart,arrive |
@turboroundabout @turboroundabout
# http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711 # http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711
@@ -707,16 +708,17 @@ Feature: Basic Roundabout
| la | primary | yes | roundabout | | la | primary | yes | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| w,r | wk,ar,ar,ar | depart,roundabout-exit-1,exit roundabout slight right,arrive | | w,r | wk,ar,ar | depart,roundabout-exit-1,arrive |
| w,s | wk,ds,ds,ds | depart,roundabout-exit-2,exit roundabout right,arrive | | w,s | wk,ds,ds | depart,roundabout-exit-2,arrive |
| w,t | wk,ft,ft,ft | depart,roundabout-exit-3,exit roundabout right,arrive | | w,t | wk,ft,ft | depart,roundabout-exit-3,arrive |
| w,v | wk,hv,hv,hv | depart,roundabout-exit-4,exit roundabout straight,arrive | | w,v | wk,hv,hv | depart,roundabout-exit-4,arrive |
| u,v | ug,hv,hv,hv | depart,roundabout-exit-1,exit roundabout straight,arrive | | u,v | ug,hv,hv | depart,roundabout-exit-1,arrive |
| u,w | ug,jw,jw,jw | depart,roundabout-exit-2,exit roundabout slight right,arrive | | u,w | ug,jw,jw | depart,roundabout-exit-2,arrive |
| u,r | ug,ar,ar,ar | depart,roundabout-exit-3,exit roundabout slight right,arrive | | u,r | ug,ar,ar | depart,roundabout-exit-3,arrive |
| u,s | ug,ds,ds,ds | depart,roundabout-exit-4,exit roundabout right,arrive | | u,s | ug,ds,ds | depart,roundabout-exit-4,arrive |
| u,t | ug,ft,ft,ft | depart,roundabout-exit-5,exit roundabout right,arrive | | u,t | ug,ft,ft | depart,roundabout-exit-5,arrive |
@3762 @3762
Scenario: Only Enter Scenario: Only Enter
@@ -740,8 +742,8 @@ Feature: Basic Roundabout
| bcjdeb | roundabout | | | bcjdeb | roundabout | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,h | ab,ef,ef,fh,fh | depart,roundabout-exit-4,exit roundabout slight right,notification straight,arrive | | a,h | ab,ef,ef,fh,fh | depart,roundabout-exit-4,notification slight right,notification straight,arrive |
Scenario: Drive through roundabout Scenario: Drive through roundabout
@@ -760,12 +762,12 @@ Feature: Basic Roundabout
| gch | | yes | | gch | | yes |
When I route I should get When I route I should get
| waypoints | bearings | route | turns | | waypoints | bearings | route | turns |
| e,f | 90 90 | edf,edf | depart,arrive | | e,f | 90 90 | edf,edf | depart,arrive |
| e,h | 90 135 | edf,gch,gch,gch | depart,roundabout-exit-2,exit roundabout straight,arrive | | e,h | 90 135 | edf,gch,gch | depart,roundabout-exit-2,arrive |
| g,f | 45 90 | gch,edf,edf,edf | depart,roundabout-exit-2,exit roundabout right,arrive | | g,f | 45 90 | gch,edf,edf | depart,roundabout-exit-2,arrive |
| g,h | 45 135 | gch,gch,gch | depart,exit roundabout right,arrive | | g,h | 45 135 | gch,gch,gch | depart,roundabout-exit-1,arrive |
| e,e | 90 270 | edf,edf,edf,edf | depart,roundabout-exit-3,exit roundabout sharp left,arrive | | e,e | 90 270 | edf,edf,edf | depart,roundabout-exit-3,arrive |
Scenario: CCW and CW roundabouts with overlaps Scenario: CCW and CW roundabouts with overlaps
Given the node map Given the node map
@@ -785,13 +787,12 @@ Feature: Basic Roundabout
| kg | tertiary | | | kg | tertiary | |
| hl | tertiary | | | hl | tertiary | |
# the turn angles here are quite strange, so we do get uturns for exiting
When I route I should get When I route I should get
| from | to | route | turns | distance | | from | to | route | turns | distance |
| e | f | ed,af,af,af | depart,roundabout-exit-1,exit roundabout left,arrive | 80.1m | | e | f | ed,af,af | depart,roundabout-exit-1,arrive | 80.1m |
| f | e | af,ed,ed,ed | depart,roundabout-exit-1,exit roundabout uturn,arrive | 120.1m | | f | e | af,ed,ed | depart,roundabout-exit-1,arrive | 120.1m |
| k | l | kg,hl,hl,hl | depart,roundabout-exit-1,exit roundabout right,arrive | 80.1m | | k | l | kg,hl,hl | depart,roundabout-exit-1,arrive | 80.1m |
| l | k | hl,kg,kg,kg | depart,roundabout-exit-1,exit roundabout uturn,arrive | 120.1m | | l | k | hl,kg,kg | depart,roundabout-exit-1,arrive | 120.1m |
@4030 @4075 @4030 @4075
Scenario: Service roundabout with service exits Scenario: Service roundabout with service exits
@@ -810,11 +811,11 @@ Feature: Basic Roundabout
| bh | service | | | bh | service | |
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| 1 | e | abcda,ce,ce | depart,exit roundabout straight,arrive | | 1 | e | abcda,ce,ce | depart,roundabout-exit-1,arrive |
| 1 | f | abcda,df,df | depart,exit roundabout right,arrive | | 1 | f | abcda,df,df | depart,roundabout-exit-2,arrive |
| 1 | g | abcda,ag,ag | depart,exit roundabout straight,arrive | | 1 | g | abcda,ag,ag | depart,roundabout-exit-3,arrive |
| 1 | h | abcda,bh,bh | depart,exit roundabout right,arrive | | 1 | h | abcda,bh,bh | depart,roundabout-exit-4,arrive |
Scenario: Collapsing a sliproad step after roundabouts Scenario: Collapsing a sliproad step after roundabouts
Given the node map Given the node map
@@ -829,19 +830,19 @@ Feature: Basic Roundabout
""" """
And the ways And the ways
| nodes | highway | junction | oneway | # | | nodes | highway | junction | oneway | # |
| abcda | tertiary | roundabout | | circle | | abcda | tertiary | roundabout | | circle |
| ebds | tertiary | | | road | | ebds | tertiary | | | road |
| cm | tertiary | | | | | cm | tertiary | | | |
| ds | tertiary | | | road | | ds | tertiary | | | road |
| rstur | tertiary | roundabout | | circle2 | | rstur | tertiary | roundabout | | circle2 |
| ufghl | tertiary | | | road | | ufghl | tertiary | | | road |
| tv | tertiary | | | | | tv | tertiary | | | |
| gi | tertiary_link | | yes | sliproad | | gi | tertiary | | yes | sliproad |
| jhik | tertiary | | | crossroad | | jhik | tertiary | | | crossroad |
When I route I should get When I route I should get
| from | to | route | turns | distance | | from | to | route | turns | distance |
| e | k | ebds,ufghl,ufghl,jhik,jhik | depart,rstur-exit-2,exit rotary right,turn right,arrive | 189.1m | | e | k | ebds,ufghl,jhik,jhik | depart,rstur-exit-2,turn right,arrive | 189.1m |
| 1 | k | ebds,ufghl,ufghl,jhik,jhik | depart,rstur-exit-2,exit rotary right,turn right,arrive | 159.1m | | 1 | k | ebds,ufghl,jhik,jhik | depart,rstur-exit-2,turn right,arrive | 159.1m |
+6 -35
View File
@@ -248,8 +248,8 @@ Feature: Simple Turns
| bcdefghijklmnob | residential | road | 1 | yes | roundabout | | bcdefghijklmnob | residential | road | 1 | yes | roundabout |
When I route I should get When I route I should get
| waypoints | route | turns | intersections | | waypoints | route | turns | intersections |
| a,p | road,road,road | depart,roundabout turn straight exit-1,arrive | true:90;true:165 false:270 false:345,true:90 false:180 true:345;true:270 | | a,p | road,road,road | depart,roundabout turn straight exit-1,arrive | true:90;true:165 false:270 false:345,true:90 false:180 true:345;true:270 |
Scenario: Splitting Road with many lanes Scenario: Splitting Road with many lanes
Given the node map Given the node map
@@ -280,35 +280,6 @@ Feature: Simple Turns
| a,d | road,road | depart,arrive | | a,d | road,road | depart,arrive |
| e,a | road,road | depart,arrive | | e,a | road,road | depart,arrive |
Scenario: Splitting Road with many lanes; same as above makes sure len(turn:lanes) work as expected
Given the node map
"""
f - - - - - - - - - - - - - - - - - - - - e
'
'
'
'
'
a - - - - - b
'
'
'
'
'
c - - - - - - - - - - - - - - - - - - - - d
"""
And the ways
| nodes | highway | name | turn:lanes | oneway |
| ab | primary | road | left\|left\|right\|right | no |
| bcd | primary | road | through\|through | yes |
| efb | primary | road | through\|through | yes |
When I route I should get
| waypoints | route | turns |
| a,d | road,road | depart,arrive |
| e,a | road,road | depart,arrive |
@todo @todo
# currently the intersections don't match up do to the `merging` process. # currently the intersections don't match up do to the `merging` process.
# The intermediate intersection is technically no-turn at all, since the road continues. # The intermediate intersection is technically no-turn at all, since the road continues.
@@ -1346,11 +1317,11 @@ Feature: Simple Turns
#https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580 #https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580
Scenario: Oszillating Lower Priority Road Scenario: Oszillating Lower Priority Road
#Given the node map #Given the node map
# """ # """
# a -db c # a -db c
# f # f
# """ # """
Given the node locations Given the node locations
| node | lat | lon | # | | node | lat | lon | # |
| a | 1.0 | 1.0 | | | a | 1.0 | 1.0 | |
-21
View File
@@ -1349,24 +1349,3 @@ Feature: Simple Turns
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,dc,dc | depart,turn left,arrive | | a,d | ab,dc,dc | depart,turn left,arrive |
# https://www.openstreetmap.org/node/1332083066
Scenario: Turns ordering must respect initial bearings
Given the node map
"""
a . be .
\ c.
d/ .f . g
"""
And the ways
| nodes | highway | oneway |
| ab | primary | yes |
| bcd | primary | yes |
| befg | primary | yes |
When I route I should get
| waypoints | route | turns |
| a,d | ab,bcd,bcd | depart,fork slight right,arrive |
| a,g | ab,befg,befg | depart,fork slight left,arrive |
+2 -2
View File
@@ -20,11 +20,11 @@ module.exports = {
}); });
}, },
hashOfFile: (path, additional_content, cb) => { hashOfFile: (path, cb) => {
fs.readFile(path, (err, result) => { fs.readFile(path, (err, result) => {
if (err) return cb(err); if (err) return cb(err);
let checksum = crypto.createHash('md5'); let checksum = crypto.createHash('md5');
checksum.update(result + (additional_content || "") ); checksum.update(result);
cb(null, checksum.digest('hex')); cb(null, checksum.digest('hex'));
}); });
} }
+6 -13
View File
@@ -61,13 +61,8 @@ class DB {
}); });
w.nodes.forEach((k) => { w.nodes.forEach((k) => {
way.ele('nd')
let nd = way.ele('nd')
.att('ref', k.id); .att('ref', k.id);
if (w.add_locations) {
nd.att('lon', k.lon);
nd.att('lat', k.lat);
}
}); });
for (var k in w.tags) { for (var k in w.tags) {
@@ -86,12 +81,11 @@ class DB {
}); });
r.members.forEach((m) => { r.members.forEach((m) => {
var d = { relation.ele('member', {
type: m.type, type: m.type,
ref: m.id ref: m.id,
}; role: m.role
if (m.role) d.role = m.role; });
relation.ele('member', d);
}); });
for (var k in r.tags) { for (var k in r.tags) {
@@ -126,14 +120,13 @@ class Node {
} }
class Way { class Way {
constructor (id, OSM_USER, OSM_TIMESTAMP, OSM_UID, add_locations) { constructor (id, OSM_USER, OSM_TIMESTAMP, OSM_UID) {
this.id = id; this.id = id;
this.OSM_USER = OSM_USER; this.OSM_USER = OSM_USER;
this.OSM_TIMESTAMP = OSM_TIMESTAMP; this.OSM_TIMESTAMP = OSM_TIMESTAMP;
this.OSM_UID = OSM_UID; this.OSM_UID = OSM_UID;
this.tags = {}; this.tags = {};
this.nodes = []; this.nodes = [];
this.add_locations = add_locations;
} }
addNode (node) { addNode (node) {
+1 -1
View File
@@ -18,5 +18,5 @@ Feature: osrm-contract command line options: files
Scenario: osrm-contract - Missing input file Scenario: osrm-contract - Missing input file
When I try to run "osrm-contract over-the-rainbow.osrm" When I try to run "osrm-contract over-the-rainbow.osrm"
And stderr should contain "over-the-rainbow.osrm" And stderr should contain "over-the-rainbow.osrm"
And stderr should contain "Missing/Broken" And stderr should contain "not found"
And it should exit with an error And it should exit with an error
+3 -3
View File
@@ -8,10 +8,10 @@ Feature: osrm-contract command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--core" And stdout should contain "--core"
And stdout should contain "--level-cache"
And stdout should contain "--segment-speed-file" And stdout should contain "--segment-speed-file"
And it should exit with an error And it should exit with an error
@@ -22,10 +22,10 @@ Feature: osrm-contract command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--core" And stdout should contain "--core"
And stdout should contain "--level-cache"
And stdout should contain "--segment-speed-file" And stdout should contain "--segment-speed-file"
And it should exit successfully And it should exit successfully
@@ -36,9 +36,9 @@ Feature: osrm-contract command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--core" And stdout should contain "--core"
And stdout should contain "--level-cache"
And stdout should contain "--segment-speed-file" And stdout should contain "--segment-speed-file"
And it should exit successfully And it should exit successfully
+1 -1
View File
@@ -8,7 +8,7 @@ Feature: osrm-contract command line options: version
Given the profile "testbot" Given the profile "testbot"
Scenario: osrm-contract - Version, short Scenario: osrm-contract - Version, short
When I run "osrm-contract -v" When I run "osrm-contract --v"
Then stderr should be empty Then stderr should be empty
And stdout should contain 1 line And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/ And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
+1 -1
View File
@@ -19,5 +19,5 @@ Feature: osrm-contract command line options: files
Scenario: osrm-customize - Missing input file Scenario: osrm-customize - Missing input file
When I try to run "osrm-customize over-the-rainbow.osrm" When I try to run "osrm-customize over-the-rainbow.osrm"
And stderr should contain "over-the-rainbow.osrm" And stderr should contain "over-the-rainbow.osrm"
And stderr should contain "Missing/Broken" And stderr should contain "not found"
And it should exit with an error And it should exit with an error
-3
View File
@@ -8,7 +8,6 @@ Feature: osrm-customize command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And it should exit with an error And it should exit with an error
@@ -20,7 +19,6 @@ Feature: osrm-customize command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And it should exit successfully And it should exit successfully
@@ -32,7 +30,6 @@ Feature: osrm-customize command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And it should exit successfully And it should exit successfully
+1 -1
View File
@@ -5,7 +5,7 @@ Feature: osrm-customize command line options: version
Given the profile "testbot" Given the profile "testbot"
Scenario: osrm-customize - Version, short Scenario: osrm-customize - Version, short
When I run "osrm-customize -v" When I run "osrm-customize --v"
Then stderr should be empty Then stderr should be empty
And stdout should contain 1 line And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/ And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
-3
View File
@@ -11,7 +11,6 @@ Feature: osrm-extract command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--profile" And stdout should contain "--profile"
And stdout should contain "--threads" And stdout should contain "--threads"
@@ -25,7 +24,6 @@ Feature: osrm-extract command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--profile" And stdout should contain "--profile"
And stdout should contain "--threads" And stdout should contain "--threads"
@@ -39,7 +37,6 @@ Feature: osrm-extract command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--profile" And stdout should contain "--profile"
And stdout should contain "--threads" And stdout should contain "--threads"
+12 -130
View File
@@ -1,12 +1,22 @@
@extract @extract
Feature: osrm-extract lua ways:get_nodes() Feature: osrm-extract lua ways:get_nodes()
Background:
Given the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
Scenario: osrm-extract - Passing base file Scenario: osrm-extract - Passing base file
Given the profile file Given the profile file
""" """
functions = require('testbot') functions = require('testbot')
functions.process_way = function(profile, way, result) function way_function(profile, way, result)
for _, node in ipairs(way:get_nodes()) do for _, node in ipairs(way:get_nodes()) do
print('node id ' .. node:id()) print('node id ' .. node:id())
end end
@@ -14,138 +24,10 @@ Feature: osrm-extract lua ways:get_nodes()
result.forward_speed = 1 result.forward_speed = 1
end end
functions.process_way = way_function
return functions return functions
""" """
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file}" When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully Then it should exit successfully
And stdout should contain "node id 1" And stdout should contain "node id 1"
And stdout should contain "node id 2" And stdout should contain "node id 2"
Scenario: osrm-extract location-dependent data without add-locations-to-ways preprocessing and node locations cache
Given the profile file
"""
functions = require('testbot')
functions.process_way = function(profile, way, result, relations)
print(way:get_location_tag('driving_side'))
end
return functions
"""
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
When I try to run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson --disable-location-cache"
Then it should exit with an error
And stderr should contain "invalid location"
Scenario: osrm-extract location-dependent data
Given the profile file
"""
functions = require('testbot')
functions.process_way = function(profile, way, result, relations)
for _, key in ipairs({'answer', 'boolean', 'object', 'array'}) do
print (key .. ' ' .. tostring(way:get_location_tag(key)))
end
result.forward_mode = mode.driving
result.forward_speed = 1
end
return functions
"""
And the node map
"""
a b
"""
And the ways with locations
| nodes |
| ab |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson --disable-location-cache"
Then it should exit successfully
And stdout should contain "answer 42"
And stdout should contain "boolean true"
And stdout should contain "array nil"
And stdout should contain "object nil"
Scenario: osrm-extract location-dependent data with multi-polygons
Given the profile file
"""
functions = require('testbot')
functions.process_way = function(profile, way, result, relations)
print('ISO3166-1 ' .. (way:get_location_tag('ISO3166-1') or 'none'))
print('answer ' .. (way:get_location_tag('answer') or 'none'))
result.forward_mode = mode.driving
result.forward_speed = 1
end
return functions
"""
And the node locations
| node | lat | lon | id |
| a | 22.4903670 | 113.9455227 | 1 |
| b | 22.4901701 | 113.9455899 | 2 |
| c | 22.4901852 | 113.9458608 | 3 |
| d | 22.4904033 | 113.9456999 | 4 |
| e | 1.1 | 1 | 5 |
| f | 1.2 | 1 | 6 |
And the ways with locations
| nodes | # |
| ab | Hong Kong |
| cd | China Mainland |
| ef | Null Island |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson --location-dependent-data test/data/regions/hong-kong.geojson --disable-location-cache"
Then it should exit successfully
And stdout should not contain "1 GeoJSON polygon"
And stdout should contain "2 GeoJSON polygons"
And stdout should contain "ISO3166-1 HK"
And stdout should contain "ISO3166-1 none"
And stdout should contain "answer 42"
Scenario: osrm-extract location-dependent data via locations cache
Given the profile file
"""
functions = require('testbot')
functions.process_way = function(profile, way, result, relations)
print ('answer ' .. tostring(way:get_location_tag('answer')))
result.forward_mode = mode.driving
result.forward_speed = 1
end
return functions
"""
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson"
Then it should exit successfully
And stdout should contain "answer 42"
@@ -1,32 +0,0 @@
@extract
Feature: osrm-extract must be silent with NONE
Background:
Given the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
Scenario: osrm-extract - Passing base file with verbosity NONE
Given the profile file
"""
functions = require('testbot')
function way_function(profile, way, result)
result.forward_mode = mode.driving
result.forward_speed = 1
end
functions.process_way = way_function
return functions
"""
When I run "osrm-extract --profile {profile_file} {osm_file} --verbosity NONE"
Then it should exit successfully
And stdout should not contain "[info]"
And stdout should not contain "[error]"
And stdout should not contain "10%"
And stderr should be empty
+1 -1
View File
@@ -8,7 +8,7 @@ Feature: osrm-extract command line options: version
Given the profile "testbot" Given the profile "testbot"
Scenario: osrm-extract - Version, short Scenario: osrm-extract - Version, short
When I run "osrm-extract -v" When I run "osrm-extract --v"
Then stderr should be empty Then stderr should be empty
And stdout should contain 1 line And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/ And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
-3
View File
@@ -8,7 +8,6 @@ Feature: osrm-partition command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--balance" And stdout should contain "--balance"
@@ -25,7 +24,6 @@ Feature: osrm-partition command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--balance" And stdout should contain "--balance"
@@ -42,7 +40,6 @@ Feature: osrm-partition command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--balance" And stdout should contain "--balance"
+1 -1
View File
@@ -5,7 +5,7 @@ Feature: osrm-partition command line options: version
Given the profile "testbot" Given the profile "testbot"
Scenario: osrm-partition - Version, short Scenario: osrm-partition - Version, short
When I run "osrm-partition -v" When I run "osrm-partition --v"
Then stderr should be empty Then stderr should be empty
And stdout should contain 1 line And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/ And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
@@ -24,7 +24,7 @@ Feature: Invalid profile API versions
Scenario: Profile API version too high Scenario: Profile API version too high
Given the profile file Given the profile file
""" """
api_version = 4 api_version = 3
""" """
And the node map And the node map
""" """
-101
View File
@@ -1,101 +0,0 @@
Feature: Profile API version 3
Background:
Given a grid size of 100 meters
Scenario: Basic profile function calls and property values
Given the profile file
"""
api_version = 3
Set = require('lib/set')
Sequence = require('lib/sequence')
Handlers = require("lib/way_handlers")
find_access_tag = require("lib/access").find_access_tag
limit = require("lib/maxspeed").limit
function setup()
return {
properties = {
max_speed_for_map_matching = 180/3.6,
use_turn_restrictions = true,
continue_straight_at_waypoint = true,
weight_name = 'test_version2',
weight_precision = 2
},
relation_types = Sequence { "route" }
}
end
function process_node(profile, node, result, relations)
print ('process_node ' .. node:id())
end
function process_way(profile, way, result, relations)
result.name = way:get_value_by_key('name')
result.weight = 10
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.forward_speed = 36
result.backward_speed = 36
local rel_id_list = relations:get_relations(way)
for i, rel_id in ipairs(rel_id_list) do
local rel = relations:relation(rel_id)
local role = rel:get_role(way)
print('role_' .. role)
end
print ('process_way ' .. way:id() .. ' ' .. result.name)
end
function process_turn (profile, turn)
print('process_turn', turn.angle, turn.turn_type, turn.direction_modifier, turn.has_traffic_light)
turn.weight = turn.angle == 0 and 0 or 4.2
turn.duration = turn.weight
end
function process_segment (profile, segment)
print ('process_segment ' .. segment.source.lon .. ' ' .. segment.source.lat)
end
return {
setup = setup,
process_node = process_node,
process_way = process_way,
process_relation = process_relation,
process_segment = process_segment,
process_turn = process_turn
}
"""
And the node map
"""
a
bcd
e
"""
And the ways
| nodes |
| ac |
| cb |
| cd |
| ce |
And the relations
| type | way:north | route |
| route | ac | road |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
And stdout should contain "process_node"
And stdout should contain "process_way"
And stdout should contain "process_turn"
And stdout should contain "process_segment"
And stdout should contain "role_north"
When I route I should get
| from | to | route | time |
| a | b | ac,cb,cb | 19.2s |
| a | d | ac,cd,cd | 19.2s |
| a | e | ac,ce | 20s |
-3
View File
@@ -11,7 +11,6 @@ Feature: osrm-routed command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "--trial" And stdout should contain "--trial"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--ip" And stdout should contain "--ip"
@@ -31,7 +30,6 @@ Feature: osrm-routed command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "--trial" And stdout should contain "--trial"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--ip" And stdout should contain "--ip"
@@ -51,7 +49,6 @@ Feature: osrm-routed command line options: help
And stdout should contain "Options:" And stdout should contain "Options:"
And stdout should contain "--version" And stdout should contain "--version"
And stdout should contain "--help" And stdout should contain "--help"
And stdout should contain "--verbosity"
And stdout should contain "--trial" And stdout should contain "--trial"
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--ip" And stdout should contain "--ip"
+1 -1
View File
@@ -8,7 +8,7 @@ Feature: osrm-routed command line options: version
Given the profile "testbot" Given the profile "testbot"
Scenario: osrm-routed - Version, short Scenario: osrm-routed - Version, short
When I run "osrm-routed -v" When I run "osrm-routed --v"
Then stderr should be empty Then stderr should be empty
And stdout should contain 1 line And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/ And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
+5 -20
View File
@@ -8,7 +8,7 @@ var OSM = require('../lib/osm');
module.exports = function () { module.exports = function () {
this.Given(/^the profile "([^"]*)"$/, (profile, callback) => { this.Given(/^the profile "([^"]*)"$/, (profile, callback) => {
this.profile = this.OSRM_PROFILE || profile; this.profile = profile;
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua'); this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
callback(); callback();
}); });
@@ -129,13 +129,13 @@ module.exports = function () {
q.awaitAll(callback); q.awaitAll(callback);
}); });
this.Given(/^the ways( with locations)?$/, (add_locations, table, callback) => { this.Given(/^the ways$/, (table, callback) => {
if (this.osm_str) throw new Error('*** Map data already defined - did you pass an input file in this scenario?'); if (this.osm_str) throw new Error('*** Map data already defined - did you pass an input file in this scenario?');
let q = d3.queue(); let q = d3.queue();
let addWay = (row, cb) => { let addWay = (row, cb) => {
let way = new OSM.Way(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID, !!add_locations); let way = new OSM.Way(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
let nodes = row.nodes; let nodes = row.nodes;
if (this.nameWayHash.nodes) throw new Error(util.format('*** duplicate way %s', nodes)); if (this.nameWayHash.nodes) throw new Error(util.format('*** duplicate way %s', nodes));
@@ -188,12 +188,9 @@ module.exports = function () {
let addRelation = (row, cb) => { let addRelation = (row, cb) => {
let relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID); let relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
var name = null;
for (let key in row) { for (let key in row) {
let isNode = key.match(/^node:?(.*)/), let isNode = key.match(/^node:(.*)/),
isWay = key.match(/^way:?(.*)/), isWay = key.match(/^way:(.*)/),
isRelation = key.match(/^relation:?(.*)/),
isColonSeparated = key.match(/^(.*):(.*)/); isColonSeparated = key.match(/^(.*):(.*)/);
if (isNode) { if (isNode) {
row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => { row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
@@ -208,26 +205,14 @@ module.exports = function () {
if (!way) throw new Error(util.format('*** unknown relation way member "%s"', wayName)); if (!way) throw new Error(util.format('*** unknown relation way member "%s"', wayName));
relation.addMember('way', way.id, isWay[1]); relation.addMember('way', way.id, isWay[1]);
}); });
} else if (isRelation) {
row[key].split(',').map(function(v) { return v.trim(); }).forEach((relName) => {
let otherrelation = this.findRelationByName(relName);
if (!otherrelation) throw new Error(util.format('*** unknown relation relation member "%s"', relName));
relation.addMember('relation', otherrelation.id, isRelation[1]);
});
} else if (isColonSeparated && isColonSeparated[1] !== 'restriction') { } else if (isColonSeparated && isColonSeparated[1] !== 'restriction') {
throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"', isColonSeparated[1], isColonSeparated[2])); throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"', isColonSeparated[1], isColonSeparated[2]));
} else { } else {
relation.addTag(key, row[key]); relation.addTag(key, row[key]);
if (key.match(/name/)) name = row[key];
} }
} }
relation.uid = this.OSM_UID; relation.uid = this.OSM_UID;
if (name) {
this.nameRelationHash[name] = relation;
}
this.OSMDB.addRelation(relation); this.OSMDB.addRelation(relation);
cb(); cb();
+1 -1
View File
@@ -11,7 +11,7 @@ module.exports = function () {
var waypoints = [], var waypoints = [],
columnHeaders = tableRows[0].slice(1), columnHeaders = tableRows[0].slice(1),
rowHeaders = tableRows.map((h) => h[0]).slice(1), rowHeaders = tableRows.map((h) => h[0]).slice(1),
symmetric = columnHeaders.length == rowHeaders.length && columnHeaders.every((ele, i) => ele === rowHeaders[i]); symmetric = columnHeaders.every((ele, i) => ele === rowHeaders[i]);
if (symmetric) { if (symmetric) {
columnHeaders.forEach((nodeName) => { columnHeaders.forEach((nodeName) => {
+2 -4
View File
@@ -54,14 +54,12 @@ module.exports = function () {
this.Then(/^stdout should( not)? contain "(.*?)"$/, (not, str) => { this.Then(/^stdout should( not)? contain "(.*?)"$/, (not, str) => {
const contains = this.stdout.indexOf(str) > -1; const contains = this.stdout.indexOf(str) > -1;
assert.ok(typeof not === 'undefined' ? contains : !contains, assert.ok(typeof not === 'undefined' ? contains : !contains);
'stdout ' + (typeof not === 'undefined' ? 'does not contain' : 'contains') + ' "' + str + '"');
}); });
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => { this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
const contains = this.stderr.indexOf(str) > -1; const contains = this.stderr.indexOf(str) > -1;
assert.ok(typeof not === 'undefined' ? contains : !contains, assert.ok(typeof not === 'undefined' ? contains : !contains);
'stderr ' + (typeof not === 'undefined' ? 'does not contain' : 'contains') + ' "' + str + '"');
}); });
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => { this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
+2 -5
View File
@@ -28,16 +28,13 @@ module.exports = function() {
let uri = feature.getUri(); let uri = feature.getUri();
// setup cache for feature data // setup cache for feature data
// if OSRM_PROFILE is set to force a specific profile, then hash.hashOfFile(uri, (err, hash) => {
// include the profile name in the hash of the profile file
hash.hashOfFile(uri, this.OSRM_PROFILE, (err, hash) => {
if (err) return callback(err); if (err) return callback(err);
// shorten uri to be realtive to 'features/' // shorten uri to be realtive to 'features/'
let featurePath = path.relative(path.resolve('./features'), uri); let featurePath = path.relative(path.resolve('./features'), uri);
// bicycle/bollards/{HASH}/ // bicycle/bollards/{HASH}/
let featureID = path.join(featurePath, hash); let featureID = path.join(featurePath, hash);
let featureCacheDirectory = this.getFeatureCacheDirectory(featureID); let featureCacheDirectory = this.getFeatureCacheDirectory(featureID);
let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash); let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash);
this.featureIDs[uri] = featureID; this.featureIDs[uri] = featureID;
-5
View File
@@ -144,10 +144,6 @@ module.exports = function () {
return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')]; return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')];
}; };
this.findRelationByName = (s) => {
return this.nameRelationHash[s.toString()] || this.nameRelationHash[s.toString().split('').reverse().join('')];
};
this.makeOSMId = () => { this.makeOSMId = () => {
this.osmID = this.osmID + 1; this.osmID = this.osmID + 1;
return this.osmID; return this.osmID;
@@ -159,7 +155,6 @@ module.exports = function () {
this.locationHash = {}; this.locationHash = {};
this.shortcutsHash = {}; this.shortcutsHash = {};
this.nameWayHash = {}; this.nameWayHash = {};
this.nameRelationHash = {};
this.osmID = 0; this.osmID = 0;
}; };
-2
View File
@@ -44,8 +44,6 @@ module.exports = function () {
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000; this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT; this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
if (this.PLATFORM_WINDOWS) { if (this.PLATFORM_WINDOWS) {
this.TERMSIGNAL = 9; this.TERMSIGNAL = 9;
+1 -1
View File
@@ -22,7 +22,7 @@ module.exports = function () {
}); });
this.BeforeFeature((feature, callback) => { this.BeforeFeature((feature, callback) => {
this.profile = this.OSRM_PROFILE || this.DEFAULT_PROFILE; this.profile = this.DEFAULT_PROFILE;
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua'); this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
this.setupFeatureCache(feature); this.setupFeatureCache(feature);
callback(); callback();
-3
View File
@@ -12,9 +12,6 @@ Feature: Alternative route
g h i j g h i j
""" """
# enforce multiple cells for filterUnpackedPathsBySharing check
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16"
And the ways And the ways
| nodes | | nodes |
| ab | | ab |
+1 -4
View File
@@ -31,10 +31,7 @@ Feature: Alternative route
| 5 | 6 | dc,ca,ab,bd,dc,dc | | | 5 | 6 | dc,ca,ab,bd,dc,dc | |
| 7 | 8 | ca,ab,bd,dc,ca,ca | | | 7 | 8 | ca,ab,bd,dc,ca,ca | |
# This test case does not work in a platform independent way @4111
# since it depends on a specific CH structure that is only
# present on linux it seems.
@4111 @todo
Scenario: Alternative Loop Paths with single node path Scenario: Alternative Loop Paths with single node path
Given the node map Given the node map
""" """
+13 -49
View File
@@ -2,11 +2,11 @@
Feature: Approach parameter Feature: Approach parameter
Background: Background:
Given a grid size of 10 meters Given the profile "testbot"
And a grid size of 10 meters
Scenario: Start End same approach, option unrestricted for Start and End Scenario: Start End same approach, option unrestricted for Start and End
Given the profile "testbot" Given the node map
And the node map
""" """
s e s e
a------b------c a------b------c
@@ -22,8 +22,7 @@ Feature: Approach parameter
| s | e | unrestricted unrestricted | ab,bc | | s | e | unrestricted unrestricted | ab,bc |
Scenario: Start End same approach, option unrestricted for Start and curb for End Scenario: Start End same approach, option unrestricted for Start and curb for End
Given the profile "testbot" Given the node map
And the node map
""" """
s e s e
a------b------c a------b------c
@@ -39,8 +38,7 @@ Feature: Approach parameter
| s | e | unrestricted curb | ab,bc,bc | | s | e | unrestricted curb | ab,bc,bc |
Scenario: Start End opposite approach, option unrestricted for Start and End Scenario: Start End opposite approach, option unrestricted for Start and End
Given the profile "testbot" Given the node map
And the node map
""" """
s s
a------b------c a------b------c
@@ -57,8 +55,7 @@ Feature: Approach parameter
| s | e | unrestricted unrestricted | ab,bc | | s | e | unrestricted unrestricted | ab,bc |
Scenario: Start End opposite approach, option unrestricted for Start and curb for End Scenario: Start End opposite approach, option unrestricted for Start and curb for End
Given the profile "testbot" Given the node map
And the node map
""" """
s s
a------b------c a------b------c
@@ -80,8 +77,7 @@ Feature: Approach parameter
Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and End Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and End
Given the profile "testbot" Given the node map
And the node map
""" """
s e s e
a------b------c a------b------c
@@ -97,8 +93,7 @@ Feature: Approach parameter
| s | e | unrestricted unrestricted | ab,bc | | s | e | unrestricted unrestricted | ab,bc |
Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and curb for End Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and curb for End
Given the profile "testbot" Given the node map
And the node map
""" """
s e s e
a------b------c a------b------c
@@ -114,8 +109,7 @@ Feature: Approach parameter
| s | e | unrestricted curb | ab,bc | | s | e | unrestricted curb | ab,bc |
Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and End Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and End
Given the profile "testbot" Given the node map
And the node map
""" """
s s
a------b------c a------b------c
@@ -132,8 +126,7 @@ Feature: Approach parameter
| s | e | unrestricted unrestricted | ab,bc | | s | e | unrestricted unrestricted | ab,bc |
Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and curb for End Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and curb for End
Given the profile "testbot" Given the node map
And the node map
""" """
s s
a------b------c a------b------c
@@ -154,8 +147,7 @@ Feature: Approach parameter
############## ##############
Scenario: UTurn test, router can't found a route because uturn unauthorized on the segment selected Scenario: UTurn test, router can't found a route because uturn unauthorized on the segment selected
Given the profile "testbot" Given the node map
And the node map
""" """
s e s e
a------b------c a------b------c
@@ -175,9 +167,8 @@ Feature: Approach parameter
| s | e | unrestricted curb | | | s | e | unrestricted curb | |
Scenario: UTurn test, router can find a route because he can use the roundabout Scenario: UTurn test, router can found a route because he can use the roundabout
Given the profile "testbot" Given the node map
And the node map
""" """
h h
s e / \ s e / \
@@ -199,30 +190,3 @@ Feature: Approach parameter
When I route I should get When I route I should get
| from | to | approaches | route | | from | to | approaches | route |
| s | e | unrestricted curb | ab,bc,bc | | s | e | unrestricted curb | ab,bc,bc |
Scenario: Start End same approach, option unrestricted for Start and curb for End, left-hand driving
Given the profile file
"""
local functions = require('testbot')
local testbot_process_way = functions.process_way
functions.process_way = function(profile, way, result)
testbot_process_way(profile, way, result)
result.is_left_hand_driving = true
end
return functions
"""
And the node map
"""
s e
a------b------c
"""
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| from | to | approaches | route |
| s | e | unrestricted curb | ab,bc |
+11 -11
View File
@@ -67,8 +67,8 @@ Feature: Bearing parameter
| from | to | bearings | route | bearing | | from | to | bearings | route | bearing |
| 0 | b | 10 10 | bc,bc | 0->0,0->0 | | 0 | b | 10 10 | bc,bc | 0->0,0->0 |
| 0 | b | 90 90 | ab,ab | 0->90,90->0 | | 0 | b | 90 90 | ab,ab | 0->90,90->0 |
| 0 | b | 170 170 | da,da | 0->180,180->0 | | 0 | b | 170 170 | da,da | 0->0,0->0 |
| 0 | b | 189 189 | da,da | 0->180,180->0 | | 0 | b | 189 189 | da,da | 0->0,0->0 |
| 0 | 1 | 90 270 | ab,cd,cd | 0->90,90->0,270->0 | | 0 | 1 | 90 270 | ab,cd,cd | 0->90,90->0,270->0 |
| 1 | 2 | 10 10 | bc,bc | 0->0,0->0 | | 1 | 2 | 10 10 | bc,bc | 0->0,0->0 |
| 1 | 2 | 90 90 | ab,cd,ab,ab | 0->90,90->0,270->180,90->0 | | 1 | 2 | 90 90 | ab,cd,ab,ab | 0->90,90->0,270->180,90->0 |
@@ -108,12 +108,12 @@ Feature: Bearing parameter
| ha | yes | ring | | ha | yes | ring |
When I route I should get When I route I should get
| from | to | bearings | route | bearing | | from | to | bearings | route | bearing |
| 0 | q | 0 90 | ia,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,90->0 | | 0 | q | 0 90 | ia,ring,ring | 0->0,0->90,90->0 |
| 0 | a | 45 90 | jb,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,90->0 | | 0 | a | 45 90 | jb,ring,ring | 0->45,45->180,90->0 |
| 0 | q | 90 90 | kc,ring,ring,ring | 0->90,90->180,270->0,90->0 | | 0 | q | 90 90 | kc,ring,ring | 0->90,90->180,90->0 |
| 0 | a | 135 90 | ld,ring,ring,ring | 0->135,135->270,270->0,90->0 | | 0 | a | 135 90 | ld,ring,ring | 0->135,135->270,90->0 |
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,270->0,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 | 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 | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 | | 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
+1 -102
View File
@@ -6,7 +6,6 @@ Feature: Basic Distance Matrix
Background: Background:
Given the profile "testbot" Given the profile "testbot"
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16"
Scenario: Testbot - Travel time matrix of minimal network Scenario: Testbot - Travel time matrix of minimal network
Given the node map Given the node map
@@ -42,17 +41,6 @@ Feature: Basic Distance Matrix
| c | 30 | 20 | 0 | 30 | | c | 30 | 20 | 0 | 30 |
| d | 60 | 50 | 30 | 0 | | d | 60 | 50 | 30 | 0 |
When I request a travel time matrix I should get
| | a | b | c | d |
| a | 0 | 10 | 30 | 60 |
When I request a travel time matrix I should get
| | a |
| a | 0 |
| b | 10 |
| c | 30 |
| d | 60 |
Scenario: Testbot - Travel time matrix with fuzzy match Scenario: Testbot - Travel time matrix with fuzzy match
Given the node map Given the node map
""" """
@@ -125,7 +113,7 @@ Feature: Basic Distance Matrix
| d | 20 | 30 | 0 | 30 | | d | 20 | 30 | 0 | 30 |
| e | 30 | 40 | 10 | 0 | | e | 30 | 40 | 10 | 0 |
Scenario: Testbot - Rectangular travel time matrix Scenario: Testbot - Travel time matrix and with only one source
Given the node map Given the node map
""" """
a b c a b c
@@ -144,46 +132,6 @@ Feature: Basic Distance Matrix
| | a | b | e | f | | | a | b | e | f |
| a | 0 | 10 | 20 | 30 | | a | 0 | 10 | 20 | 30 |
When I request a travel time matrix I should get
| | a |
| a | 0 |
| b | 10 |
| e | 20 |
| f | 30 |
When I request a travel time matrix I should get
| | a | b | e | f |
| a | 0 | 10 | 20 | 30 |
| b | 10 | 0 | 10 | 20 |
When I request a travel time matrix I should get
| | a | b |
| a | 0 | 10 |
| b | 10 | 0 |
| e | 20 | 10 |
| f | 30 | 20 |
When I request a travel time matrix I should get
| | a | b | e | f |
| a | 0 | 10 | 20 | 30 |
| b | 10 | 0 | 10 | 20 |
| e | 20 | 10 | 0 | 10 |
When I request a travel time matrix I should get
| | a | b | e |
| a | 0 | 10 | 20 |
| b | 10 | 0 | 10 |
| e | 20 | 10 | 0 |
| f | 30 | 20 | 10 |
When I request a travel time matrix I should get
| | a | b | e | f |
| a | 0 | 10 | 20 | 30 |
| b | 10 | 0 | 10 | 20 |
| e | 20 | 10 | 0 | 10 |
| f | 30 | 20 | 10 | 0 |
Scenario: Testbot - Travel time 3x2 matrix Scenario: Testbot - Travel time 3x2 matrix
Given the node map Given the node map
""" """
@@ -360,52 +308,3 @@ Feature: Basic Distance Matrix
| 6 | 7 | 6 | 10 | 9 | 1 | 0 | 3.9 | 2.9 | | 6 | 7 | 6 | 10 | 9 | 1 | 0 | 3.9 | 2.9 |
| 7 | 3.1 | 2.1 | 6.1 | 5.1 | 9.1 | 8.1 | 0 | 11 | | 7 | 3.1 | 2.1 | 6.1 | 5.1 | 9.1 | 8.1 | 0 | 11 |
| 8 | 4.1 | 3.1 | 7.1 | 6.1 | 10.1 | 9.1 | 1 | 0 | | 8 | 4.1 | 3.1 | 7.1 | 6.1 | 10.1 | 9.1 | 1 | 0 |
Scenario: Testbot - Travel time matrix with ties
Given the profile file
"""
local functions = require('testbot')
functions.process_segment = function(profile, segment)
segment.weight = 1
segment.duration = 1
end
functions.process_turn = function(profile, turn)
if turn.angle >= 0 then
turn.duration = 16
else
turn.duration = 4
end
turn.weight = 0
end
return functions
"""
And the node map
"""
a b
c d
"""
And the ways
| nodes |
| ab |
| ac |
| bd |
| dc |
When I route I should get
| from | to | route | distance | time | weight |
| a | c | ac,ac | 200m | 5s | 5 |
When I request a travel time matrix I should get
| | a | b | c | d |
| a | 0 | 1 | 5 | 10 |
When I request a travel time matrix I should get
| | a |
| a | 0 |
| b | 1 |
| c | 15 |
| d | 10 |
-99
View File
@@ -1,99 +0,0 @@
@routing @testbot @exclude
Feature: Testbot - Exclude flags
Background:
Given the profile "testbot"
Given the node map
"""
a....b-----c-$-$-d
$ $ :
e.$.$.f.....g
"""
And the ways
| nodes | highway | toll | # |
| ab | primary | | always drivable |
| bc | motorway | | not drivable for exclude=motorway and exclude=motorway,toll |
| be | primary | yes | not drivable for exclude=toll and exclude=motorway,toll |
| ef | primary | yes | not drivable for exclude=toll and exclude=motorway,toll |
| fc | primary | yes | not drivable for exclude=toll and exclude=motorway,toll |
| cd | motorway | yes | not drivable for exclude=motorway exclude=toll and exclude=motorway,toll |
| fg | primary | | always drivable |
| gd | primary | | always drivable |
Scenario: Testbot - exclude nothing
When I route I should get
| from | to | route |
| a | d | ab,bc,cd,cd |
| a | g | ab,be,ef,fg,fg |
| a | c | ab,bc,bc |
| a | f | ab,be,ef,ef |
When I match I should get
| trace | matchings | duration |
| ad | ad | 115 |
When I request a travel time matrix I should get
| | a | d |
| a | 0 | 115 |
| d | 115 | 0 |
Scenario: Testbot - exclude motorway
Given the query options
| exclude | motorway |
When I route I should get
| from | to | route |
| a | d | ab,be,ef,fg,gd,gd |
| a | g | ab,be,ef,fg,fg |
| a | c | ab,be,ef,fc,fc |
| a | f | ab,be,ef,ef |
When I match I should get
| trace | matchings | duration |
| ad | ad | 125 |
When I request a travel time matrix I should get
| | a | d |
| a | 0 | 125 |
| d | 125 | 0 |
Scenario: Testbot - exclude toll
Given the query options
| exclude | toll |
When I route I should get
| from | to | route |
| a | d | |
| a | g | |
| a | c | ab,bc,bc |
| a | f | |
| f | d | fg,gd,gd |
Scenario: Testbot - exclude motorway and toll
Given the query options
| exclude | motorway,toll |
When I route I should get
| from | to | route |
| a | d | |
| a | g | |
| a | c | |
| a | f | |
| f | d | fg,gd,gd |
Scenario: Testbot - exclude with unsupported exclude combination
Given the query options
| exclude | TwoWords2 |
When I route I should get
| from | to | status | message |
| a | d | 400 | Exclude flag combination is not supported. |
Scenario: Testbot - exclude with invalid exclude class name
Given the query options
| exclude | foo |
When I route I should get
| from | to | status | message |
| a | d | 400 | Exclude flag combination is not supported. |
@@ -63,7 +63,6 @@ Feature: Multi level routing
| cm | primary | | cm | primary |
| hj | primary | | hj | primary |
| kp | primary | | kp | primary |
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 4,16"
When I route I should get When I route I should get
| from | to | route | time | | from | to | route | time |
@@ -83,28 +82,6 @@ Feature: Multi level routing
| l | 144.7 | 124.7 | 0 | 60 | | l | 144.7 | 124.7 | 0 | 60 |
| o | 124.7 | 144.7 | 60 | 0 | | o | 124.7 | 144.7 | 60 | 0 |
When I request a travel time matrix I should get
| | a | f | l | o |
| a | 0 | 229.4 | 144.7 | 124.7 |
When I request a travel time matrix I should get
| | a |
| a | 0 |
| f | 229.4 |
| l | 144.7 |
| o | 124.7 |
When I request a travel time matrix I should get
| | a | f | l | o |
| a | 0 | 229.4 | 144.7 | 124.7 |
| o | 124.7 | 144.7 | 60 | 0 |
When I request a travel time matrix I should get
| | a | o |
| a | 0 | 124.7 |
| f | 229.4 | 144.7 |
| l | 144.7 | 60 |
| o | 124.7 | 0 |
Scenario: Testbot - Multi level routing: horizontal road Scenario: Testbot - Multi level routing: horizontal road
Given the node map Given the node map
+1
View File
@@ -167,3 +167,4 @@ Feature: Traffic - speeds
And the data has been extracted And the data has been extracted
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}" When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
And it should exit successfully And it should exit successfully
-33
View File
@@ -379,36 +379,3 @@ Feature: Weight tests
| a,d | abcd,abcd | 59.9m | 6.996,0 | 7s,0s | | a,d | abcd,abcd | 59.9m | 6.996,0 | 7s,0s |
| a,e | abcd,ce,ce | 60.1m | 6.005,2.002,0 | 6s,2s,0s | | a,e | abcd,ce,ce | 60.1m | 6.005,2.002,0 | 6s,2s,0s |
| d,e | abcd,ce,ce | 39.9m | 1.991,2.002,0 | 2s,2s,0s | | d,e | abcd,ce,ce | 39.9m | 1.991,2.002,0 | 2s,2s,0s |
@traffic @speed
Scenario: Updating speeds without affecting weights.
Given the profile file "testbot" initialized with
"""
profile.properties.weight_precision = 3
"""
And the node map
"""
a-----------b
\ /
c----d
"""
And the ways
| nodes | highway | maxspeed |
| ab | living_street | 5 |
| acdb | motorway | 100 |
# Note the comma on the last column - this indicates 'keep existing weight value'
And the speed file
"""
1,2,100,
1,3,5,,junk
3,4,5,,
4,2,5,
"""
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the customize extra arguments "--segment-speed-file {speeds_file}"
When I route I should get
| waypoints | route | distance | weights | times |
| a,b | acdb,acdb | 78.3m | 11.744,0 | 56.4s,0s |
@@ -1,95 +0,0 @@
#ifndef OSRM_CONTRACTOR_CONTRACT_EXCLUDABLE_GRAPH_HPP
#define OSRM_CONTRACTOR_CONTRACT_EXCLUDABLE_GRAPH_HPP
#include "contractor/contracted_edge_container.hpp"
#include "contractor/contractor_graph.hpp"
#include "contractor/graph_contractor.hpp"
#include "contractor/graph_contractor_adaptors.hpp"
#include "contractor/query_graph.hpp"
namespace osrm
{
namespace contractor
{
using GraphAndFilter = std::tuple<QueryGraph, std::vector<std::vector<bool>>>;
inline auto contractFullGraph(ContractorGraph contractor_graph,
std::vector<EdgeWeight> node_weights)
{
auto num_nodes = contractor_graph.GetNumberOfNodes();
contractGraph(contractor_graph, node_weights);
auto edges = toEdges<QueryEdge>(std::move(contractor_graph));
std::vector<bool> edge_filter(edges.size(), true);
return GraphAndFilter{QueryGraph{num_nodes, std::move(edges)}, {std::move(edge_filter)}};
}
inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
std::vector<EdgeWeight> node_weights,
const std::vector<std::vector<bool>> &filters)
{
if (filters.size() == 1)
{
if (std::all_of(filters.front().begin(), filters.front().end(), [](auto v) { return v; }))
{
return contractFullGraph(std::move(contractor_graph_), std::move(node_weights));
}
}
auto num_nodes = contractor_graph_.GetNumberOfNodes();
ContractedEdgeContainer edge_container;
ContractorGraph shared_core_graph;
std::vector<bool> is_shared_core;
{
ContractorGraph contractor_graph = std::move(contractor_graph_);
std::vector<bool> always_allowed(num_nodes, true);
for (const auto &filter : filters)
{
for (const auto node : util::irange<NodeID>(0, num_nodes))
{
always_allowed[node] = always_allowed[node] && filter[node];
}
}
// By not contracting all contractable nodes we avoid creating
// a very dense core. This increases the overall graph sizes a little bit
// but increases the final CH quality and contraction speed.
constexpr float BASE_CORE = 0.9;
is_shared_core =
contractGraph(contractor_graph, std::move(always_allowed), node_weights, BASE_CORE);
// Add all non-core edges to container
{
auto non_core_edges = toEdges<QueryEdge>(contractor_graph);
auto new_end =
std::remove_if(non_core_edges.begin(), non_core_edges.end(), [&](const auto &edge) {
return is_shared_core[edge.source] && is_shared_core[edge.target];
});
non_core_edges.resize(new_end - non_core_edges.begin());
edge_container.Insert(std::move(non_core_edges));
}
// Extract core graph for further contraction
shared_core_graph = contractor_graph.Filter(
[&is_shared_core](const NodeID node) { return is_shared_core[node]; });
}
for (const auto &filter : filters)
{
auto filtered_core_graph =
shared_core_graph.Filter([&filter](const NodeID node) { return filter[node]; });
contractGraph(filtered_core_graph, is_shared_core, is_shared_core, node_weights);
edge_container.Merge(toEdges<QueryEdge>(std::move(filtered_core_graph)));
}
return GraphAndFilter{QueryGraph{num_nodes, std::move(edge_container.edges)},
edge_container.MakeEdgeFilters()};
}
}
}
#endif
@@ -1,151 +0,0 @@
#ifndef OSRM_CONTRACTOR_CONTRACTED_EDGE_CONTAINER_HPP
#define OSRM_CONTRACTOR_CONTRACTED_EDGE_CONTAINER_HPP
#include "contractor/query_edge.hpp"
#include "util/integer_range.hpp"
#include "util/permutation.hpp"
#include <tbb/parallel_sort.h>
#include <algorithm>
#include <climits>
#include <cstdint>
#include <numeric>
#include <vector>
namespace osrm
{
namespace contractor
{
struct ContractedEdgeContainer
{
private:
using MergedFlags = std::uint8_t;
static constexpr auto ALL_FLAGS = 0xFF;
static bool mergeCompare(const QueryEdge &lhs, const QueryEdge &rhs)
{
return std::tie(lhs.source,
lhs.target,
lhs.data.shortcut,
lhs.data.turn_id,
lhs.data.weight,
lhs.data.duration,
lhs.data.forward,
lhs.data.backward) < std::tie(rhs.source,
rhs.target,
rhs.data.shortcut,
rhs.data.turn_id,
rhs.data.weight,
rhs.data.duration,
rhs.data.forward,
rhs.data.backward);
}
static bool mergable(const QueryEdge &lhs, const QueryEdge &rhs)
{
// only true if both are equal
return !mergeCompare(lhs, rhs) && !mergeCompare(rhs, lhs);
}
public:
void Insert(std::vector<QueryEdge> new_edges)
{
BOOST_ASSERT(edges.size() == 0);
BOOST_ASSERT(flags.empty());
edges = std::move(new_edges);
flags.resize(edges.size(), ALL_FLAGS);
}
void Merge(std::vector<QueryEdge> new_edges)
{
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
const MergedFlags flag = 1 << index++;
auto edge_iter = edges.cbegin();
auto edge_end = edges.cend();
auto flags_iter = flags.begin();
// Remove all edges that are contained in the old set of edges and set the appropriate flag.
auto new_end =
std::remove_if(new_edges.begin(), new_edges.end(), [&](const QueryEdge &edge) {
// check if the new edge would be sorted before the currend old edge
// if so it is not contained yet in the set of old edges
if (edge_iter == edge_end || mergeCompare(edge, *edge_iter))
{
return false;
}
// find the first old edge that is equal or greater then the new edge
while (edge_iter != edge_end && mergeCompare(*edge_iter, edge))
{
BOOST_ASSERT(flags_iter != flags.end());
edge_iter++;
flags_iter++;
}
// all new edges will be sorted after the old edges
if (edge_iter == edge_end)
{
return false;
}
BOOST_ASSERT(edge_iter != edge_end);
if (mergable(edge, *edge_iter))
{
*flags_iter = *flags_iter | flag;
return true;
}
BOOST_ASSERT(mergeCompare(edge, *edge_iter));
return false;
});
// append new edges
edges.insert(edges.end(), new_edges.begin(), new_end);
auto edges_size = edges.size();
auto new_edges_size = std::distance(new_edges.begin(), new_end);
BOOST_ASSERT(edges_size >= new_edges_size);
flags.resize(edges_size);
std::fill(flags.begin() + edges_size - new_edges_size, flags.end(), flag);
// enforce sorting for next merge step
std::vector<unsigned> ordering(edges_size);
std::iota(ordering.begin(), ordering.end(), 0);
tbb::parallel_sort(
ordering.begin(), ordering.end(), [&](const auto lhs_idx, const auto rhs_idx) {
return mergeCompare(edges[lhs_idx], edges[rhs_idx]);
});
auto permutation = util::orderingToPermutation(ordering);
util::inplacePermutation(edges.begin(), edges.end(), permutation);
util::inplacePermutation(flags.begin(), flags.end(), permutation);
BOOST_ASSERT(std::is_sorted(edges.begin(), edges.end(), mergeCompare));
}
auto MakeEdgeFilters() const
{
std::vector<std::vector<bool>> filters(index);
for (const auto flag_index : util::irange<std::size_t>(0, index))
{
MergedFlags mask = 1 << flag_index;
for (const auto flag : flags)
{
filters[flag_index].push_back(flag & mask);
}
}
return filters;
}
std::size_t index = 0;
std::vector<MergedFlags> flags;
std::vector<QueryEdge> edges;
};
}
}
#endif
+21 -1
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
@@ -29,6 +29,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CONTRACTOR_CONTRACTOR_HPP #define CONTRACTOR_CONTRACTOR_HPP
#include "contractor/contractor_config.hpp" #include "contractor/contractor_config.hpp"
#include "contractor/query_edge.hpp"
#include "extractor/edge_based_edge.hpp"
#include "extractor/edge_based_node_segment.hpp"
#include "util/deallocating_vector.hpp"
#include "util/typedefs.hpp"
#include <string>
#include <vector>
#include <cstddef>
namespace osrm namespace osrm
{ {
@@ -39,6 +49,8 @@ namespace contractor
class Contractor class Contractor
{ {
public: public:
using EdgeData = QueryEdge::EdgeData;
explicit Contractor(const ContractorConfig &config_) : config{config_} {} explicit Contractor(const ContractorConfig &config_) : config{config_} {}
Contractor(const Contractor &) = delete; Contractor(const Contractor &) = delete;
@@ -46,6 +58,14 @@ class Contractor
int Run(); int Run();
protected:
void ContractGraph(const unsigned max_edge_id,
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
util::DeallocatingVector<QueryEdge> &contracted_edge_list,
std::vector<EdgeWeight> &&node_weights,
std::vector<bool> &is_core_node,
std::vector<float> &inout_node_levels) const;
private: private:
ContractorConfig config; ContractorConfig config;
}; };
+7 -6
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
@@ -43,9 +43,12 @@ namespace contractor
struct ContractorConfig final : storage::IOConfig struct ContractorConfig final : storage::IOConfig
{ {
ContractorConfig() ContractorConfig()
: IOConfig({".osrm.ebg", ".osrm.ebg_nodes", ".osrm.properties"}, : IOConfig(
{}, {
{".osrm.hsgr", ".osrm.enw"}), ".osrm",
},
{},
{".osrm.level", ".osrm.core", ".osrm.hsgr", ".osrm.enw"}),
requested_num_threads(0) requested_num_threads(0)
{ {
} }
@@ -61,12 +64,10 @@ struct ContractorConfig final : storage::IOConfig
updater::UpdaterConfig updater_config; updater::UpdaterConfig updater_config;
// DEPRECATED to be removed in v6.0
bool use_cached_priority; bool use_cached_priority;
unsigned requested_num_threads; unsigned requested_num_threads;
// DEPRECATED to be removed in v6.0
// A percentage of vertices that will be contracted for the hierarchy. // A percentage of vertices that will be contracted for the hierarchy.
// Offers a trade-off between preprocessing and query time. // Offers a trade-off between preprocessing and query time.
// The remaining vertices form the core of the hierarchy // The remaining vertices form the core of the hierarchy
@@ -0,0 +1,50 @@
#ifndef OSRM_CONTRACTOR_DIJKSTRA_HPP
#define OSRM_CONTRACTOR_DIJKSTRA_HPP
#include "contractor/contractor_graph.hpp"
#include "contractor/contractor_heap.hpp"
#include "util/typedefs.hpp"
#include <cstddef>
namespace osrm
{
namespace contractor
{
// allow access to the heap itself, add Dijkstra functionality on top
class ContractorDijkstra
{
public:
ContractorDijkstra(std::size_t heap_size);
// search the graph up
void Run(const unsigned number_of_targets,
const int node_limit,
const int weight_limit,
const NodeID forbidden_node,
const ContractorGraph &graph);
// adaption of the heap interface
void Clear();
bool WasInserted(const NodeID node) const;
void Insert(const NodeID node,
const ContractorHeap::WeightType weight,
const ContractorHeap::DataType &data);
// cannot be const due to node-hash access in the binary heap :(
ContractorHeap::WeightType GetKey(const NodeID node);
private:
void RelaxNode(const NodeID node,
const int node_weight,
const NodeID forbidden_node,
const ContractorGraph &graph);
ContractorHeap heap;
};
} // namespace contractor
} // namespace osrm
#endif // OSRM_CONTRACTOR_DIJKSTRA_HPP
+6 -4
View File
@@ -12,7 +12,8 @@ namespace contractor
struct ContractorEdgeData struct ContractorEdgeData
{ {
ContractorEdgeData() ContractorEdgeData()
: weight(0), duration(0), id(0), originalEdges(0), shortcut(0), forward(0), backward(0) : weight(0), duration(0), id(0), originalEdges(0), shortcut(0), forward(0), backward(0),
is_original_via_node_ID(false)
{ {
} }
ContractorEdgeData(EdgeWeight weight, ContractorEdgeData(EdgeWeight weight,
@@ -23,17 +24,18 @@ struct ContractorEdgeData
bool forward, bool forward,
bool backward) bool backward)
: weight(weight), duration(duration), id(id), : weight(weight), duration(duration), id(id),
originalEdges(std::min((1u << 29) - 1u, original_edges)), shortcut(shortcut), originalEdges(std::min((1u << 28) - 1u, original_edges)), shortcut(shortcut),
forward(forward), backward(backward) forward(forward), backward(backward), is_original_via_node_ID(false)
{ {
} }
EdgeWeight weight; EdgeWeight weight;
EdgeWeight duration; EdgeWeight duration;
unsigned id; unsigned id;
unsigned originalEdges : 29; unsigned originalEdges : 28;
bool shortcut : 1; bool shortcut : 1;
bool forward : 1; bool forward : 1;
bool backward : 1; bool backward : 1;
bool is_original_via_node_ID : 1;
}; };
using ContractorGraph = util::DynamicGraph<ContractorEdgeData>; using ContractorGraph = util::DynamicGraph<ContractorEdgeData>;
-26
View File
@@ -1,26 +0,0 @@
#ifndef OSRM_CONTRACTOR_SEARCH_HPP
#define OSRM_CONTRACTOR_SEARCH_HPP
#include "contractor/contractor_graph.hpp"
#include "contractor/contractor_heap.hpp"
#include "util/typedefs.hpp"
#include <cstddef>
namespace osrm
{
namespace contractor
{
void search(ContractorHeap &heap,
const ContractorGraph &graph,
const unsigned number_of_targets,
const int node_limit,
const EdgeWeight weight_limit,
const NodeID forbidden_node);
} // namespace contractor
} // namespace osrm
#endif // OSRM_CONTRACTOR_DIJKSTRA_HPP
+45 -27
View File
@@ -14,56 +14,74 @@ namespace contractor
{ {
namespace files namespace files
{ {
// reads .osrm.core
template <typename CoreVectorT>
void readCoreMarker(const boost::filesystem::path &path, CoreVectorT &is_core_node)
{
static_assert(util::is_view_or_vector<bool, CoreVectorT>::value,
"is_core_node must be a vector");
storage::io::FileReader reader(path, storage::io::FileReader::VerifyFingerprint);
storage::serialization::read(reader, is_core_node);
}
// writes .osrm.core
template <typename CoreVectorT>
void writeCoreMarker(const boost::filesystem::path &path, const CoreVectorT &is_core_node)
{
static_assert(util::is_view_or_vector<bool, CoreVectorT>::value,
"is_core_node must be a vector");
storage::io::FileWriter writer(path, storage::io::FileWriter::GenerateFingerprint);
storage::serialization::write(writer, is_core_node);
}
// reads .osrm.hsgr file // reads .osrm.hsgr file
template <typename QueryGraphT, typename EdgeFilterT> template <typename QueryGraphT>
inline void readGraph(const boost::filesystem::path &path, inline void readGraph(const boost::filesystem::path &path, unsigned &checksum, QueryGraphT &graph)
unsigned &checksum,
QueryGraphT &graph,
std::vector<EdgeFilterT> &edge_filter)
{ {
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value || static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
std::is_same<QueryGraph, QueryGraphT>::value, std::is_same<QueryGraph, QueryGraphT>::value,
"graph must be of type QueryGraph<>"); "graph must be of type QueryGraph<>");
static_assert(std::is_same<EdgeFilterT, std::vector<bool>>::value ||
std::is_same<EdgeFilterT, util::vector_view<bool>>::value,
"edge_filter must be a container of vector<bool> or vector_view<bool>");
const auto fingerprint = storage::io::FileReader::VerifyFingerprint; const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
storage::io::FileReader reader{path, fingerprint}; storage::io::FileReader reader{path, fingerprint};
reader.ReadInto(checksum); reader.ReadInto(checksum);
util::serialization::read(reader, graph); util::serialization::read(reader, graph);
auto count = reader.ReadElementCount64();
edge_filter.resize(count);
for (const auto index : util::irange<std::size_t>(0, count))
{
storage::serialization::read(reader, edge_filter[index]);
}
} }
// writes .osrm.hsgr file // writes .osrm.hsgr file
template <typename QueryGraphT, typename EdgeFilterT> template <typename QueryGraphT>
inline void writeGraph(const boost::filesystem::path &path, inline void
unsigned checksum, writeGraph(const boost::filesystem::path &path, unsigned checksum, const QueryGraphT &graph)
const QueryGraphT &graph,
const std::vector<EdgeFilterT> &edge_filter)
{ {
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value || static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
std::is_same<QueryGraph, QueryGraphT>::value, std::is_same<QueryGraph, QueryGraphT>::value,
"graph must be of type QueryGraph<>"); "graph must be of type QueryGraph<>");
static_assert(std::is_same<EdgeFilterT, std::vector<bool>>::value ||
std::is_same<EdgeFilterT, util::vector_view<bool>>::value,
"edge_filter must be a container of vector<bool> or vector_view<bool>");
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint; const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
storage::io::FileWriter writer{path, fingerprint}; storage::io::FileWriter writer{path, fingerprint};
writer.WriteOne(checksum); writer.WriteOne(checksum);
util::serialization::write(writer, graph); util::serialization::write(writer, graph);
writer.WriteElementCount64(edge_filter.size()); }
for (const auto &filter : edge_filter)
{ // reads .levels file
storage::serialization::write(writer, filter); inline void readLevels(const boost::filesystem::path &path, std::vector<float> &node_levels)
} {
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
storage::io::FileReader reader{path, fingerprint};
storage::serialization::read(reader, node_levels);
}
// writes .levels file
inline void writeLevels(const boost::filesystem::path &path, const std::vector<float> &node_levels)
{
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
storage::io::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, node_levels);
} }
} }
} }
+409 -23
View File
@@ -1,41 +1,427 @@
#ifndef OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP #ifndef OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP
#define OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP #define OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP
#include "contractor/contractor_dijkstra.hpp"
#include "contractor/contractor_graph.hpp" #include "contractor/contractor_graph.hpp"
#include "contractor/query_edge.hpp"
#include "util/deallocating_vector.hpp"
#include "util/integer_range.hpp"
#include "util/log.hpp"
#include "util/percent.hpp"
#include "util/timing_util.hpp"
#include "util/typedefs.hpp"
#include "util/xor_fast_hash.hpp"
#include "util/filtered_graph.hpp" #include <boost/assert.hpp>
#include <tuple> #include <tbb/enumerable_thread_specific.h>
#include <tbb/parallel_for.h>
#include <tbb/parallel_sort.h>
#include <algorithm>
#include <limits>
#include <memory>
#include <vector> #include <vector>
#if USE_STXXL_LIBRARY
#include <stxxl/vector>
#endif
namespace osrm namespace osrm
{ {
namespace contractor namespace contractor
{ {
std::vector<bool> contractGraph(ContractorGraph &graph, class GraphContractor
std::vector<bool> node_is_uncontracted,
std::vector<bool> node_is_contractable,
std::vector<EdgeWeight> node_weights,
double core_factor = 1.0);
// Overload for contracting all nodes
inline auto contractGraph(ContractorGraph &graph,
std::vector<EdgeWeight> node_weights,
double core_factor = 1.0)
{ {
return contractGraph(graph, {}, {}, std::move(node_weights), core_factor); private:
} #if USE_STXXL_LIBRARY
template <typename T> using ExternalVector = stxxl::vector<T>;
#else
template <typename T> using ExternalVector = std::vector<T>;
#endif
// Overload no contracted nodes struct ContractorThreadData
inline auto contractGraph(ContractorGraph &graph, {
std::vector<bool> node_is_contractable, ContractorDijkstra dijkstra;
std::vector<EdgeWeight> node_weights, std::vector<ContractorEdge> inserted_edges;
double core_factor = 1.0) std::vector<NodeID> neighbours;
{ explicit ContractorThreadData(NodeID nodes) : dijkstra(nodes) {}
return contractGraph( };
graph, {}, std::move(node_is_contractable), std::move(node_weights), core_factor);
} using NodeDepth = int;
struct ContractionStats
{
int edges_deleted_count;
int edges_added_count;
int original_edges_deleted_count;
int original_edges_added_count;
ContractionStats()
: edges_deleted_count(0), edges_added_count(0), original_edges_deleted_count(0),
original_edges_added_count(0)
{
}
};
struct RemainingNodeData
{
RemainingNodeData() : id(0), is_independent(false) {}
NodeID id : 31;
bool is_independent : 1;
};
struct ThreadDataContainer
{
explicit ThreadDataContainer(int number_of_nodes) : number_of_nodes(number_of_nodes) {}
inline ContractorThreadData *GetThreadData()
{
bool exists = false;
auto &ref = data.local(exists);
if (!exists)
{
// ref = std::make_shared<ContractorThreadData>(number_of_nodes);
ref = std::make_shared<ContractorThreadData>(4000);
}
return ref.get();
}
int number_of_nodes;
using EnumerableThreadData =
tbb::enumerable_thread_specific<std::shared_ptr<ContractorThreadData>>;
EnumerableThreadData data;
};
public:
GraphContractor(int nodes, std::vector<ContractorEdge> input_edge_list);
GraphContractor(int nodes,
std::vector<ContractorEdge> edges,
std::vector<float> node_levels_,
std::vector<EdgeWeight> node_weights_);
/* Flush all data from the contraction to disc and reorder stuff for better locality */
void FlushDataAndRebuildContractorGraph(ThreadDataContainer &thread_data_list,
std::vector<RemainingNodeData> &remaining_nodes,
std::vector<float> &node_priorities);
void Run(double core_factor = 1.0);
std::vector<bool> GetCoreMarker();
std::vector<float> GetNodeLevels();
template <class Edge> inline util::DeallocatingVector<Edge> GetEdges()
{
util::DeallocatingVector<Edge> edges;
util::UnbufferedLog log;
log << "Getting edges of minimized graph ";
util::Percent p(log, contractor_graph->GetNumberOfNodes());
const NodeID number_of_nodes = contractor_graph->GetNumberOfNodes();
if (contractor_graph->GetNumberOfNodes())
{
Edge new_edge;
for (const auto node : util::irange(0u, number_of_nodes))
{
p.PrintStatus(node);
for (auto edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const NodeID target = contractor_graph->GetTarget(edge);
const ContractorGraph::EdgeData &data = contractor_graph->GetEdgeData(edge);
if (!orig_node_id_from_new_node_id_map.empty())
{
new_edge.source = orig_node_id_from_new_node_id_map[node];
new_edge.target = orig_node_id_from_new_node_id_map[target];
}
else
{
new_edge.source = node;
new_edge.target = target;
}
BOOST_ASSERT_MSG(SPECIAL_NODEID != new_edge.source, "Source id invalid");
BOOST_ASSERT_MSG(SPECIAL_NODEID != new_edge.target, "Target id invalid");
new_edge.data.weight = data.weight;
new_edge.data.duration = data.duration;
new_edge.data.shortcut = data.shortcut;
if (!data.is_original_via_node_ID && !orig_node_id_from_new_node_id_map.empty())
{
// tranlate the _node id_ of the shortcutted node
new_edge.data.turn_id = orig_node_id_from_new_node_id_map[data.id];
}
else
{
new_edge.data.turn_id = data.id;
}
BOOST_ASSERT_MSG(new_edge.data.turn_id != INT_MAX, // 2^31
"edge id invalid");
new_edge.data.forward = data.forward;
new_edge.data.backward = data.backward;
edges.push_back(new_edge);
}
}
}
contractor_graph.reset();
orig_node_id_from_new_node_id_map.clear();
orig_node_id_from_new_node_id_map.shrink_to_fit();
BOOST_ASSERT(0 == orig_node_id_from_new_node_id_map.capacity());
edges.append(external_edge_list.begin(), external_edge_list.end());
external_edge_list.clear();
// sort and remove duplicates
tbb::parallel_sort(edges.begin(), edges.end());
auto new_end = std::unique(edges.begin(), edges.end());
edges.resize(new_end - edges.begin());
return edges;
}
private:
float EvaluateNodePriority(ContractorThreadData *const data,
const NodeDepth node_depth,
const NodeID node);
template <bool RUNSIMULATION>
bool
ContractNode(ContractorThreadData *data, const NodeID node, ContractionStats *stats = nullptr)
{
auto &dijkstra = data->dijkstra;
std::size_t inserted_edges_size = data->inserted_edges.size();
std::vector<ContractorEdge> &inserted_edges = data->inserted_edges;
constexpr bool SHORTCUT_ARC = true;
constexpr bool FORWARD_DIRECTION_ENABLED = true;
constexpr bool FORWARD_DIRECTION_DISABLED = false;
constexpr bool REVERSE_DIRECTION_ENABLED = true;
constexpr bool REVERSE_DIRECTION_DISABLED = false;
for (auto in_edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const ContractorEdgeData &in_data = contractor_graph->GetEdgeData(in_edge);
const NodeID source = contractor_graph->GetTarget(in_edge);
if (source == node)
continue;
if (RUNSIMULATION)
{
BOOST_ASSERT(stats != nullptr);
++stats->edges_deleted_count;
stats->original_edges_deleted_count += in_data.originalEdges;
}
if (!in_data.backward)
{
continue;
}
dijkstra.Clear();
dijkstra.Insert(source, 0, ContractorHeapData{});
EdgeWeight max_weight = 0;
unsigned number_of_targets = 0;
for (auto out_edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const ContractorEdgeData &out_data = contractor_graph->GetEdgeData(out_edge);
if (!out_data.forward)
{
continue;
}
const NodeID target = contractor_graph->GetTarget(out_edge);
if (node == target)
{
continue;
}
const EdgeWeight path_weight = in_data.weight + out_data.weight;
if (target == source)
{
if (path_weight < node_weights[node])
{
if (RUNSIMULATION)
{
// make sure to prune better, but keep inserting this loop if it should
// still be the best
// CAREFUL: This only works due to the independent node-setting. This
// guarantees that source is not connected to another node that is
// contracted
node_weights[source] = path_weight + 1;
BOOST_ASSERT(stats != nullptr);
stats->edges_added_count += 2;
stats->original_edges_added_count +=
2 * (out_data.originalEdges + in_data.originalEdges);
}
else
{
// CAREFUL: This only works due to the independent node-setting. This
// guarantees that source is not connected to another node that is
// contracted
node_weights[source] = path_weight; // make sure to prune better
inserted_edges.emplace_back(source,
target,
path_weight,
in_data.duration + out_data.duration,
out_data.originalEdges +
in_data.originalEdges,
node,
SHORTCUT_ARC,
FORWARD_DIRECTION_ENABLED,
REVERSE_DIRECTION_DISABLED);
inserted_edges.emplace_back(target,
source,
path_weight,
in_data.duration + out_data.duration,
out_data.originalEdges +
in_data.originalEdges,
node,
SHORTCUT_ARC,
FORWARD_DIRECTION_DISABLED,
REVERSE_DIRECTION_ENABLED);
}
}
continue;
}
max_weight = std::max(max_weight, path_weight);
if (!dijkstra.WasInserted(target))
{
dijkstra.Insert(target, INVALID_EDGE_WEIGHT, ContractorHeapData{0, true});
++number_of_targets;
}
}
if (RUNSIMULATION)
{
const int constexpr SIMULATION_SEARCH_SPACE_SIZE = 1000;
dijkstra.Run(number_of_targets,
SIMULATION_SEARCH_SPACE_SIZE,
max_weight,
node,
*contractor_graph);
}
else
{
const int constexpr FULL_SEARCH_SPACE_SIZE = 2000;
dijkstra.Run(
number_of_targets, FULL_SEARCH_SPACE_SIZE, max_weight, node, *contractor_graph);
}
for (auto out_edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const ContractorEdgeData &out_data = contractor_graph->GetEdgeData(out_edge);
if (!out_data.forward)
{
continue;
}
const NodeID target = contractor_graph->GetTarget(out_edge);
if (target == node)
continue;
const EdgeWeight path_weight = in_data.weight + out_data.weight;
const EdgeWeight weight = dijkstra.GetKey(target);
if (path_weight < weight)
{
if (RUNSIMULATION)
{
BOOST_ASSERT(stats != nullptr);
stats->edges_added_count += 2;
stats->original_edges_added_count +=
2 * (out_data.originalEdges + in_data.originalEdges);
}
else
{
inserted_edges.emplace_back(source,
target,
path_weight,
in_data.duration + out_data.duration,
out_data.originalEdges + in_data.originalEdges,
node,
SHORTCUT_ARC,
FORWARD_DIRECTION_ENABLED,
REVERSE_DIRECTION_DISABLED);
inserted_edges.emplace_back(target,
source,
path_weight,
in_data.duration + out_data.duration,
out_data.originalEdges + in_data.originalEdges,
node,
SHORTCUT_ARC,
FORWARD_DIRECTION_DISABLED,
REVERSE_DIRECTION_ENABLED);
}
}
}
}
// Check For One-Way Streets to decide on the creation of self-loops
if (!RUNSIMULATION)
{
std::size_t iend = inserted_edges.size();
for (std::size_t i = inserted_edges_size; i < iend; ++i)
{
bool found = false;
for (std::size_t other = i + 1; other < iend; ++other)
{
if (inserted_edges[other].source != inserted_edges[i].source)
{
continue;
}
if (inserted_edges[other].target != inserted_edges[i].target)
{
continue;
}
if (inserted_edges[other].data.weight != inserted_edges[i].data.weight)
{
continue;
}
if (inserted_edges[other].data.shortcut != inserted_edges[i].data.shortcut)
{
continue;
}
inserted_edges[other].data.forward |= inserted_edges[i].data.forward;
inserted_edges[other].data.backward |= inserted_edges[i].data.backward;
found = true;
break;
}
if (!found)
{
inserted_edges[inserted_edges_size++] = inserted_edges[i];
}
}
inserted_edges.resize(inserted_edges_size);
}
return true;
}
void DeleteIncomingEdges(ContractorThreadData *data, const NodeID node);
bool UpdateNodeNeighbours(std::vector<float> &priorities,
std::vector<NodeDepth> &node_depth,
ContractorThreadData *const data,
const NodeID node);
bool IsNodeIndependent(const std::vector<float> &priorities,
ContractorThreadData *const data,
NodeID node) const;
// This bias function takes up 22 assembly instructions in total on X86
bool Bias(const NodeID a, const NodeID b) const;
std::shared_ptr<ContractorGraph> contractor_graph;
ExternalVector<QueryEdge> external_edge_list;
std::vector<NodeID> orig_node_id_from_new_node_id_map;
std::vector<float> node_levels;
// A list of weights for every node in the graph.
// The weight represents the cost for a u-turn on the segment in the base-graph in addition to
// its traversal.
// During contraction, self-loops are checked against this node weight to ensure that necessary
// self-loops are added.
std::vector<EdgeWeight> node_weights;
std::vector<bool> is_core_node;
util::XORFastHash<> fast_hash;
};
} // namespace contractor } // namespace contractor
} // namespace osrm } // namespace osrm
@@ -2,11 +2,7 @@
#define OSRM_CONTRACTOR_GRAPH_CONTRACTION_ADAPTORS_HPP_ #define OSRM_CONTRACTOR_GRAPH_CONTRACTION_ADAPTORS_HPP_
#include "contractor/contractor_graph.hpp" #include "contractor/contractor_graph.hpp"
#include "util/log.hpp" #include "util/log.hpp"
#include "util/percent.hpp"
#include <tbb/parallel_sort.h>
#include <vector> #include <vector>
@@ -17,7 +13,7 @@ namespace contractor
// Make sure to move in the input edge list! // Make sure to move in the input edge list!
template <typename InputEdgeContainer> template <typename InputEdgeContainer>
ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer input_edge_list) std::vector<ContractorEdge> adaptToContractorInput(InputEdgeContainer input_edge_list)
{ {
std::vector<ContractorEdge> edges; std::vector<ContractorEdge> edges;
edges.reserve(input_edge_list.size() * 2); edges.reserve(input_edge_list.size() * 2);
@@ -56,117 +52,9 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
false, false,
input_edge.data.backward ? true : false, input_edge.data.backward ? true : false,
input_edge.data.forward ? true : false); input_edge.data.forward ? true : false);
};
tbb::parallel_sort(edges.begin(), edges.end());
NodeID edge = 0;
for (NodeID i = 0; i < edges.size();)
{
const NodeID source = edges[i].source;
const NodeID target = edges[i].target;
const NodeID id = edges[i].data.id;
// remove eigenloops
if (source == target)
{
++i;
continue;
}
ContractorEdge forward_edge;
ContractorEdge reverse_edge;
forward_edge.source = reverse_edge.source = source;
forward_edge.target = reverse_edge.target = target;
forward_edge.data.forward = reverse_edge.data.backward = true;
forward_edge.data.backward = reverse_edge.data.forward = false;
forward_edge.data.shortcut = reverse_edge.data.shortcut = false;
forward_edge.data.id = reverse_edge.data.id = id;
forward_edge.data.originalEdges = reverse_edge.data.originalEdges = 1;
forward_edge.data.weight = reverse_edge.data.weight = INVALID_EDGE_WEIGHT;
forward_edge.data.duration = reverse_edge.data.duration = MAXIMAL_EDGE_DURATION;
// remove parallel edges
while (i < edges.size() && edges[i].source == source && edges[i].target == target)
{
if (edges[i].data.forward)
{
forward_edge.data.weight = std::min(edges[i].data.weight, forward_edge.data.weight);
forward_edge.data.duration =
std::min(edges[i].data.duration, forward_edge.data.duration);
}
if (edges[i].data.backward)
{
reverse_edge.data.weight = std::min(edges[i].data.weight, reverse_edge.data.weight);
reverse_edge.data.duration =
std::min(edges[i].data.duration, reverse_edge.data.duration);
}
++i;
}
// merge edges (s,t) and (t,s) into bidirectional edge
if (forward_edge.data.weight == reverse_edge.data.weight)
{
if ((int)forward_edge.data.weight != INVALID_EDGE_WEIGHT)
{
forward_edge.data.backward = true;
edges[edge++] = forward_edge;
}
}
else
{ // insert seperate edges
if (((int)forward_edge.data.weight) != INVALID_EDGE_WEIGHT)
{
edges[edge++] = forward_edge;
}
if ((int)reverse_edge.data.weight != INVALID_EDGE_WEIGHT)
{
edges[edge++] = reverse_edge;
}
}
} }
util::Log() << "merged " << edges.size() - edge << " edges out of " << edges.size(); // FIXME not sure if we need this
edges.resize(edge);
return ContractorGraph{number_of_nodes, edges};
}
template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT graph)
{
std::vector<Edge> edges;
edges.reserve(graph.GetNumberOfEdges());
util::UnbufferedLog log;
log << "Getting edges of minimized graph ";
util::Percent p(log, graph.GetNumberOfNodes());
const NodeID number_of_nodes = graph.GetNumberOfNodes();
if (graph.GetNumberOfNodes())
{
Edge new_edge;
for (const auto node : util::irange(0u, number_of_nodes))
{
p.PrintStatus(node);
for (auto edge : graph.GetAdjacentEdgeRange(node))
{
const NodeID target = graph.GetTarget(edge);
const ContractorGraph::EdgeData &data = graph.GetEdgeData(edge);
new_edge.source = node;
new_edge.target = target;
BOOST_ASSERT_MSG(SPECIAL_NODEID != new_edge.target, "Target id invalid");
new_edge.data.weight = data.weight;
new_edge.data.duration = data.duration;
new_edge.data.shortcut = data.shortcut;
new_edge.data.turn_id = data.id;
BOOST_ASSERT_MSG(new_edge.data.turn_id != INT_MAX, // 2^31
"edge id invalid");
new_edge.data.forward = data.forward;
new_edge.data.backward = data.backward;
edges.push_back(new_edge);
}
}
}
// sort and remove duplicates
tbb::parallel_sort(edges.begin(), edges.end());
auto new_end = std::unique(edges.begin(), edges.end());
edges.resize(new_end - edges.begin());
edges.shrink_to_fit(); edges.shrink_to_fit();
return edges; return edges;
} }
-11
View File
@@ -21,17 +21,6 @@ struct QueryEdge
{ {
} }
EdgeData(const NodeID turn_id,
const bool shortcut,
const EdgeWeight weight,
const EdgeWeight duration,
const bool forward,
const bool backward)
: turn_id(turn_id), shortcut(shortcut), weight(weight), duration(duration),
forward(forward), backward(backward)
{
}
template <class OtherT> EdgeData(const OtherT &other) template <class OtherT> EdgeData(const OtherT &other)
{ {
weight = other.weight; weight = other.weight;
+17 -53
View File
@@ -31,33 +31,16 @@ class CellCustomizer
CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {} CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {}
template <typename GraphT> template <typename GraphT>
void Customize(const GraphT &graph, void Customize(
Heap &heap, const GraphT &graph, Heap &heap, partition::CellStorage &cells, LevelID level, CellID id)
const partition::CellStorage &cells,
const std::vector<bool> &allowed_nodes,
CellMetric &metric,
LevelID level,
CellID id) const
{ {
auto cell = cells.GetCell(metric, level, id); auto cell = cells.GetCell(level, id);
auto destinations = cell.GetDestinationNodes(); auto destinations = cell.GetDestinationNodes();
// for each source do forward search // for each source do forward search
for (auto source : cell.GetSourceNodes()) for (auto source : cell.GetSourceNodes())
{ {
if (!allowed_nodes[source]) std::unordered_set<NodeID> destinations_set(destinations.begin(), destinations.end());
{
continue;
}
std::unordered_set<NodeID> destinations_set;
for (const auto destination : destinations)
{
if (allowed_nodes[destination])
{
destinations_set.insert(destination);
}
}
heap.Clear(); heap.Clear();
heap.Insert(source, 0, {false, 0}); heap.Insert(source, 0, {false, 0});
@@ -68,7 +51,10 @@ class CellCustomizer
const EdgeWeight weight = heap.GetKey(node); const EdgeWeight weight = heap.GetKey(node);
const EdgeDuration duration = heap.GetData(node).duration; const EdgeDuration duration = heap.GetData(node).duration;
RelaxNode(graph, cells, allowed_nodes, metric, heap, level, node, weight, duration); if (level == 1)
RelaxNode<true>(graph, cells, heap, level, node, weight, duration);
else
RelaxNode<false>(graph, cells, heap, level, node, weight, duration);
destinations_set.erase(node); destinations_set.erase(node);
} }
@@ -94,11 +80,7 @@ class CellCustomizer
} }
} }
template <typename GraphT> template <typename GraphT> void Customize(const GraphT &graph, partition::CellStorage &cells)
void Customize(const GraphT &graph,
const partition::CellStorage &cells,
const std::vector<bool> &allowed_nodes,
CellMetric &metric) const
{ {
Heap heap_exemplar(graph.GetNumberOfNodes()); Heap heap_exemplar(graph.GetNumberOfNodes());
HeapPtr heaps(heap_exemplar); HeapPtr heaps(heap_exemplar);
@@ -110,26 +92,22 @@ class CellCustomizer
auto &heap = heaps.local(); auto &heap = heaps.local();
for (auto id = range.begin(), end = range.end(); id != end; ++id) for (auto id = range.begin(), end = range.end(); id != end; ++id)
{ {
Customize( Customize(graph, heap, cells, level, id);
graph, heap, cells, allowed_nodes, metric, level, id);
} }
}); });
} }
} }
private: private:
template <typename GraphT> template <bool first_level, typename GraphT>
void RelaxNode(const GraphT &graph, void RelaxNode(const GraphT &graph,
const partition::CellStorage &cells, const partition::CellStorage &cells,
const std::vector<bool> &allowed_nodes,
const CellMetric &metric,
Heap &heap, Heap &heap,
LevelID level, LevelID level,
NodeID node, NodeID node,
EdgeWeight weight, EdgeWeight weight,
EdgeDuration duration) const EdgeDuration duration) const
{ {
auto first_level = level == 1;
BOOST_ASSERT(heap.WasInserted(node)); BOOST_ASSERT(heap.WasInserted(node));
if (!first_level) if (!first_level)
@@ -145,7 +123,7 @@ class CellCustomizer
{ {
// Relax sub-cell nodes // Relax sub-cell nodes
auto subcell_id = partition.GetCell(level - 1, node); auto subcell_id = partition.GetCell(level - 1, node);
auto subcell = cells.GetCell(metric, level - 1, subcell_id); auto subcell = cells.GetCell(level - 1, subcell_id);
auto subcell_destination = subcell.GetDestinationNodes().begin(); auto subcell_destination = subcell.GetDestinationNodes().begin();
auto subcell_duration = subcell.GetOutDuration(node).begin(); auto subcell_duration = subcell.GetOutDuration(node).begin();
for (auto subcell_weight : subcell.GetOutWeight(node)) for (auto subcell_weight : subcell.GetOutWeight(node))
@@ -153,22 +131,15 @@ class CellCustomizer
if (subcell_weight != INVALID_EDGE_WEIGHT) if (subcell_weight != INVALID_EDGE_WEIGHT)
{ {
const NodeID to = *subcell_destination; const NodeID to = *subcell_destination;
if (!allowed_nodes[to])
{
continue;
}
const EdgeWeight to_weight = weight + subcell_weight; const EdgeWeight to_weight = weight + subcell_weight;
const EdgeDuration to_duration = duration + *subcell_duration;
if (!heap.WasInserted(to)) if (!heap.WasInserted(to))
{ {
heap.Insert(to, to_weight, {true, to_duration}); heap.Insert(to, to_weight, {true, duration + *subcell_duration});
} }
else if (std::tie(to_weight, to_duration) < else if (to_weight < heap.GetKey(to))
std::tie(heap.GetKey(to), heap.GetData(to).duration))
{ {
heap.DecreaseKey(to, to_weight); heap.DecreaseKey(to, to_weight);
heap.GetData(to) = {true, to_duration}; heap.GetData(to) = {true, duration + *subcell_duration};
} }
} }
@@ -182,27 +153,20 @@ class CellCustomizer
for (auto edge : graph.GetInternalEdgeRange(level, node)) for (auto edge : graph.GetInternalEdgeRange(level, node))
{ {
const NodeID to = graph.GetTarget(edge); const NodeID to = graph.GetTarget(edge);
if (!allowed_nodes[to])
{
continue;
}
const auto &data = graph.GetEdgeData(edge); const auto &data = graph.GetEdgeData(edge);
if (data.forward && if (data.forward &&
(first_level || (first_level ||
partition.GetCell(level - 1, node) != partition.GetCell(level - 1, to))) partition.GetCell(level - 1, node) != partition.GetCell(level - 1, to)))
{ {
const EdgeWeight to_weight = weight + data.weight; const EdgeWeight to_weight = weight + data.weight;
const EdgeDuration to_duration = duration + data.duration;
if (!heap.WasInserted(to)) if (!heap.WasInserted(to))
{ {
heap.Insert(to, to_weight, {false, duration + data.duration}); heap.Insert(to, to_weight, {false, duration + data.duration});
} }
else if (std::tie(to_weight, to_duration) < else if (to_weight < heap.GetKey(to))
std::tie(heap.GetKey(to), heap.GetData(to).duration))
{ {
heap.DecreaseKey(to, to_weight); heap.DecreaseKey(to, to_weight);
heap.GetData(to) = {false, to_duration}; heap.GetData(to) = {false, duration + data.duration};
} }
} }
} }
-31
View File
@@ -1,31 +0,0 @@
#ifndef OSRM_CUSTOMIZER_CELL_METRIC_HPP
#define OSRM_CUSTOMIZER_CELL_METRIC_HPP
#include "storage/io_fwd.hpp"
#include "storage/shared_memory_ownership.hpp"
#include "util/typedefs.hpp"
#include "util/vector_view.hpp"
namespace osrm
{
namespace customizer
{
namespace detail
{
// Encapsulated one metric to make it easily replacable in CelLStorage
template <storage::Ownership Ownership> struct CellMetricImpl
{
template <typename T> using Vector = util::ViewOrVector<T, Ownership>;
Vector<EdgeWeight> weights;
Vector<EdgeDuration> durations;
};
}
using CellMetric = detail::CellMetricImpl<storage::Ownership::Container>;
using CellMetricView = detail::CellMetricImpl<storage::Ownership::View>;
}
}
#endif
+6 -7
View File
@@ -17,13 +17,12 @@ namespace customizer
struct CustomizationConfig final : storage::IOConfig struct CustomizationConfig final : storage::IOConfig
{ {
CustomizationConfig() CustomizationConfig()
: IOConfig({".osrm.ebg", : IOConfig(
".osrm.partition", {
".osrm.cells", ".osrm",
".osrm.ebg_nodes", },
".osrm.properties"}, {},
{}, {".osrm.ebg", ".osrm.partition", ".osrm.cells", ".osrm.mldgr"}),
{".osrm.cell_metrics", ".osrm.mldgr"}),
requested_num_threads(0) requested_num_threads(0)
{ {
} }
-59
View File
@@ -1,59 +0,0 @@
#ifndef OSRM_CUSTOMIZER_FILES_HPP
#define OSRM_CUSTOMIZER_FILES_HPP
#include "customizer/serialization.hpp"
#include "storage/io.hpp"
#include "util/integer_range.hpp"
namespace osrm
{
namespace customizer
{
namespace files
{
// reads .osrm.cell_metrics file
template <typename CellMetricT>
inline void readCellMetrics(const boost::filesystem::path &path, std::vector<CellMetricT> &metrics)
{
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
std::is_same<CellMetric, CellMetricT>::value,
"");
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
storage::io::FileReader reader{path, fingerprint};
auto num_metrics = reader.ReadElementCount64();
metrics.resize(num_metrics);
for (auto &metric : metrics)
{
serialization::read(reader, metric);
}
}
// writes .osrm.cell_metrics file
template <typename CellMetricT>
inline void writeCellMetrics(const boost::filesystem::path &path,
const std::vector<CellMetricT> &metrics)
{
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
std::is_same<CellMetric, CellMetricT>::value,
"");
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
storage::io::FileWriter writer{path, fingerprint};
writer.WriteElementCount64(metrics.size());
for (const auto &metric : metrics)
{
serialization::write(writer, metric);
}
}
}
}
}
#endif
-34
View File
@@ -1,34 +0,0 @@
#ifndef OSRM_CUSTOMIZER_SERIALIZATION_HPP
#define OSRM_CUSTOMIZER_SERIALIZATION_HPP
#include "partition/cell_storage.hpp"
#include "storage/io.hpp"
#include "storage/serialization.hpp"
#include "storage/shared_memory_ownership.hpp"
namespace osrm
{
namespace customizer
{
namespace serialization
{
template <storage::Ownership Ownership>
inline void read(storage::io::FileReader &reader, detail::CellMetricImpl<Ownership> &metric)
{
storage::serialization::read(reader, metric.weights);
storage::serialization::read(reader, metric.durations);
}
template <storage::Ownership Ownership>
inline void write(storage::io::FileWriter &writer, const detail::CellMetricImpl<Ownership> &metric)
{
storage::serialization::write(writer, metric.weights);
storage::serialization::write(writer, metric.durations);
}
}
}
}
#endif
+21 -7
View File
@@ -17,6 +17,13 @@ struct Algorithm final
{ {
}; };
} }
// Contraction Hiearchy with core
namespace corech
{
struct Algorithm final
{
};
}
// Multi-Level Dijkstra // Multi-Level Dijkstra
namespace mld namespace mld
{ {
@@ -28,6 +35,7 @@ struct Algorithm final
// Algorithm names // Algorithm names
template <typename AlgorithmT> const char *name(); template <typename AlgorithmT> const char *name();
template <> inline const char *name<ch::Algorithm>() { return "CH"; } template <> inline const char *name<ch::Algorithm>() { return "CH"; }
template <> inline const char *name<corech::Algorithm>() { return "CoreCH"; }
template <> inline const char *name<mld::Algorithm>() { return "MLD"; } template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
@@ -48,9 +56,6 @@ template <typename AlgorithmT> struct HasManyToManySearch final : std::false_typ
template <typename AlgorithmT> struct HasGetTileTurns final : std::false_type template <typename AlgorithmT> struct HasGetTileTurns final : std::false_type
{ {
}; };
template <typename AlgorithmT> struct HasExcludeFlags final : std::false_type
{
};
// Algorithms supported by Contraction Hierarchies // Algorithms supported by Contraction Hierarchies
template <> struct HasAlternativePathSearch<ch::Algorithm> final : std::true_type template <> struct HasAlternativePathSearch<ch::Algorithm> final : std::true_type
@@ -71,7 +76,19 @@ template <> struct HasManyToManySearch<ch::Algorithm> final : std::true_type
template <> struct HasGetTileTurns<ch::Algorithm> final : std::true_type template <> struct HasGetTileTurns<ch::Algorithm> final : std::true_type
{ {
}; };
template <> struct HasExcludeFlags<ch::Algorithm> final : std::true_type
// Algorithms supported by Contraction Hierarchies with core
// the rest is disabled because of performance reasons
template <> struct HasShortestPathSearch<corech::Algorithm> final : std::true_type
{
};
template <> struct HasDirectShortestPathSearch<corech::Algorithm> final : std::true_type
{
};
template <> struct HasMapMatching<corech::Algorithm> final : std::true_type
{
};
template <> struct HasGetTileTurns<corech::Algorithm> final : std::true_type
{ {
}; };
@@ -94,9 +111,6 @@ template <> struct HasManyToManySearch<mld::Algorithm> final : std::true_type
template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
{ {
}; };
template <> struct HasExcludeFlags<mld::Algorithm> final : std::true_type
{
};
} }
} }
} }
+3 -5
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
@@ -68,7 +68,6 @@ struct BaseParameters
std::vector<boost::optional<double>> radiuses; std::vector<boost::optional<double>> radiuses;
std::vector<boost::optional<Bearing>> bearings; std::vector<boost::optional<Bearing>> bearings;
std::vector<boost::optional<Approach>> approaches; std::vector<boost::optional<Approach>> approaches;
std::vector<std::string> exclude;
// Adds hints to response which can be included in subsequent requests, see `hints` above. // Adds hints to response which can be included in subsequent requests, see `hints` above.
bool generate_hints = true; bool generate_hints = true;
@@ -78,10 +77,9 @@ struct BaseParameters
std::vector<boost::optional<double>> radiuses_ = {}, std::vector<boost::optional<double>> radiuses_ = {},
std::vector<boost::optional<Bearing>> bearings_ = {}, std::vector<boost::optional<Bearing>> bearings_ = {},
std::vector<boost::optional<Approach>> approaches_ = {}, std::vector<boost::optional<Approach>> approaches_ = {},
bool generate_hints_ = true, bool generate_hints_ = true)
std::vector<std::string> exclude = {})
: coordinates(coordinates_), hints(hints_), radiuses(radiuses_), bearings(bearings_), : coordinates(coordinates_), hints(hints_), radiuses(radiuses_), bearings(bearings_),
approaches(approaches_), exclude(std::move(exclude)), generate_hints(generate_hints_) approaches(approaches_), generate_hints(generate_hints_)
{ {
} }
-9
View File
@@ -36,15 +36,6 @@ namespace detail
std::string instructionTypeToString(extractor::guidance::TurnType::Enum type); std::string instructionTypeToString(extractor::guidance::TurnType::Enum type);
std::string instructionModifierToString(extractor::guidance::DirectionModifier::Enum modifier); std::string instructionModifierToString(extractor::guidance::DirectionModifier::Enum modifier);
/**
* Returns a string representing all instruction types (including internal types that
* are normally not exposed in route responses)
*
* @param type the TurnType value to convert into a string
* @return a string representing the turn type (e.g. `turn` or `continue`)
*/
std::string internalInstructionTypeToString(extractor::guidance::TurnType::Enum type);
util::json::Array coordinateToLonLat(const util::Coordinate coordinate); util::json::Array coordinateToLonLat(const util::Coordinate coordinate);
std::string modeToString(const extractor::TravelMode mode); std::string modeToString(const extractor::TravelMode mode);
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
+3 -3
View File
@@ -167,12 +167,12 @@ class RouteAPI : public BaseAPI
* the overall response consistent. * the overall response consistent.
* *
* CAUTION: order of post-processing steps is important * CAUTION: order of post-processing steps is important
* - handleRoundabouts must be called before collapseTurnInstructions that * - postProcess must be called before collapseTurnInstructions that expects
* expects post-processed roundabouts * post-processed roundabouts without Exit instructions
*/ */
guidance::trimShortSegments(steps, leg_geometry); guidance::trimShortSegments(steps, leg_geometry);
leg.steps = guidance::handleRoundabouts(std::move(steps)); leg.steps = guidance::postProcess(std::move(steps));
leg.steps = guidance::collapseTurnInstructions(std::move(leg.steps)); leg.steps = guidance::collapseTurnInstructions(std::move(leg.steps));
leg.steps = guidance::anticipateLaneChange(std::move(leg.steps)); leg.steps = guidance::anticipateLaneChange(std::move(leg.steps));
leg.steps = guidance::buildIntersections(std::move(leg.steps)); leg.steps = guidance::buildIntersections(std::move(leg.steps));
+5 -11
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
@@ -88,17 +88,11 @@ struct RouteParameters : public BaseParameters
const OverviewType overview_, const OverviewType overview_,
const boost::optional<bool> continue_straight_, const boost::optional<bool> continue_straight_,
Args... args_) Args... args_)
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one : BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
// below. number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{false},
: BaseParameters{std::forward<Args>(args_)...}, annotations_type{AnnotationsType::None}, geometries{geometries_}, overview{overview_},
steps{steps_},
alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u},
annotations{false},
annotations_type{AnnotationsType::None},
geometries{geometries_},
overview{overview_},
continue_straight{continue_straight_} continue_straight{continue_straight_}
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one below.
{ {
} }
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2017, Project OSRM contributors Copyright (c) 2016, Project OSRM contributors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,

Some files were not shown because too many files have changed in this diff Show More