Compare commits
112 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49c4df0617 | |||
| db869786a4 | |||
| a3a46c20c4 | |||
| 9500facd9c | |||
| 615e015700 | |||
| 02922ecf5e | |||
| bae1b9c5e2 | |||
| 4c35352707 | |||
| c362a3d46d | |||
| 293a7177d0 | |||
| 8af54ffe83 | |||
| 253c2dc570 | |||
| 0c6bb534fd | |||
| 2d02fad09b | |||
| 361e6b998f | |||
| 210fa9d545 | |||
| 7eafb48d20 | |||
| df0f407591 | |||
| f9a8bcc75c | |||
| f815daf026 | |||
| f393f47d43 | |||
| 1e258ed3fa | |||
| de084f201c | |||
| e34a74d4ac | |||
| bd1391f6f7 | |||
| f54631619a | |||
| 070fa1a24c | |||
| f15285e9ee | |||
| bae21f0d5d | |||
| 305df1fb6e | |||
| 9ab0fca31c | |||
| e2e398edc5 | |||
| b87366132b | |||
| f4ef4b022e | |||
| 81d479304e | |||
| 92b53e5be0 | |||
| cc73e753bd | |||
| 725dc396c7 | |||
| 890f0d8d7e | |||
| c9017090a2 | |||
| e7061591e3 | |||
| 5ede5577d1 | |||
| 0bfbe5ad16 | |||
| 54ceb05420 | |||
| fef0344be0 | |||
| b12fee5c0a | |||
| 1ef75c7a61 | |||
| 8c5ac84f0c | |||
| 44739f2dc3 | |||
| d52d530cbe | |||
| 5fb00ff7bf | |||
| 4c7aa8f1c0 | |||
| 2522f70f86 | |||
| e47e8ed335 | |||
| 2927b491c3 | |||
| ba2a0b3566 | |||
| 98caa0bcd9 | |||
| 4a2a100569 | |||
| 3073f4c0d1 | |||
| 7d900e3b5a | |||
| 6d78c11fd2 | |||
| 1bee82e288 | |||
| a41caf0efb | |||
| a3e0eb03db | |||
| 34f62b4894 | |||
| b28077a437 | |||
| 359ab2b56e | |||
| e42c23686b | |||
| d98f1a2632 | |||
| aa736dbe3a | |||
| 3534203083 | |||
| 517cb5f094 | |||
| b910ab9bcb | |||
| 5a29e29535 | |||
| 0fd71260d3 | |||
| 54367bfa98 | |||
| 1e9806f872 | |||
| 1e704aa7f2 | |||
| 8a404ea850 | |||
| e2e279bc85 | |||
| c914afdbf1 | |||
| 49a057ebc0 | |||
| d660c1609c | |||
| 74bc8966a8 | |||
| 9d8a3e3c97 | |||
| a308b86056 | |||
| 1b540fe0ba | |||
| 929e5a4de6 | |||
| df4f0d043a | |||
| 09df8d47a5 | |||
| c8b75c9046 | |||
| dd8f5ac01d | |||
| 22479ff5d8 | |||
| 688b1f8bef | |||
| e5464526c8 | |||
| 37b8d3acd4 | |||
| 4f13208ce8 | |||
| 383640caaf | |||
| 42f3401dd7 | |||
| 7fb57c924f | |||
| 97592e5bc3 | |||
| 9922c0f4f7 | |||
| f27434f2fb | |||
| 32d39b7b49 | |||
| 5c20c7b295 | |||
| df000debe9 | |||
| 31511416ed | |||
| 99b02cedfb | |||
| 4136bf2808 | |||
| 93d6fd05a9 | |||
| 73c4bc1411 | |||
| dc9b4bcfec |
@@ -0,0 +1,15 @@
|
|||||||
|
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Explicitly declare text files you want to always be normalized and converted
|
||||||
|
# to native line endings on checkout.
|
||||||
|
*.cpp text
|
||||||
|
*.hpp text
|
||||||
|
|
||||||
|
# Declare files that will always have CRLF line endings on checkout.
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
*.ps1 text eol=crlf
|
||||||
|
|
||||||
|
# Declare files that will always have LF line endings on checkout.
|
||||||
|
*.sh text eol=lf
|
||||||
@@ -61,6 +61,11 @@ Thumbs.db
|
|||||||
.cproject
|
.cproject
|
||||||
.project
|
.project
|
||||||
|
|
||||||
|
# Visual Studio (Code) related files #
|
||||||
|
######################################
|
||||||
|
/.vs*
|
||||||
|
/*.local.bat
|
||||||
|
|
||||||
# stxxl related files #
|
# stxxl related files #
|
||||||
#######################
|
#######################
|
||||||
.stxxl
|
.stxxl
|
||||||
|
|||||||
+18
-8
@@ -19,6 +19,7 @@ branches:
|
|||||||
- master
|
- master
|
||||||
# enable building tags
|
# enable building tags
|
||||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||||
|
- "5.9"
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
yarn: true
|
yarn: true
|
||||||
@@ -72,7 +73,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', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-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' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
||||||
after_success:
|
after_success:
|
||||||
- bash <(curl -s https://codecov.io/bash)
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
@@ -82,7 +83,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', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-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
|
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
|
||||||
@@ -90,7 +91,7 @@ matrix:
|
|||||||
addons: &clang40
|
addons: &clang40
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
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
|
||||||
@@ -115,7 +116,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', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-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
|
||||||
@@ -124,12 +125,20 @@ matrix:
|
|||||||
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: "gcc-6-stxxl"
|
||||||
|
addons: &gcc6
|
||||||
|
apt:
|
||||||
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
|
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
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-4.9-release"
|
compiler: "gcc-4.9-release"
|
||||||
addons: &gcc49
|
addons: &gcc49
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
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
|
||||||
@@ -146,7 +155,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', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-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
|
||||||
@@ -155,7 +164,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', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-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
|
||||||
@@ -164,7 +173,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', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-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.
|
||||||
@@ -323,6 +332,7 @@ install:
|
|||||||
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
|
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
|
||||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-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}
|
||||||
|
|||||||
@@ -1,3 +1,39 @@
|
|||||||
|
# 5.9.2
|
||||||
|
- API:
|
||||||
|
- `annotations=durations,weights,speeds` values no longer include turn penalty values ([#4330](https://github.com/Project-OSRM/osrm-backend/issues/4330))
|
||||||
|
|
||||||
|
# 5.9.1
|
||||||
|
- Changes from 5.9.0:
|
||||||
|
- #4322: Deprecated `UseLane`. Use the intersections array if you require lanes between steps
|
||||||
|
- #4321: Fixes a potential crash in the MLD alternative code path when not even a shortest path can be found
|
||||||
|
- #4324: STXXL is not required by default
|
||||||
|
|
||||||
|
# 5.9.0
|
||||||
|
- Changes from 5.8:
|
||||||
|
- Algorithm:
|
||||||
|
- Multi-Level Dijkstra:
|
||||||
|
- Plugins supported: `table`
|
||||||
|
- Adds alternative routes support (see [#4047](https://github.com/Project-OSRM/osrm-backend/pull/4047) and [3905](https://github.com/Project-OSRM/osrm-backend/issues/3905)): provides reasonably looking alternative routes (many, if possible) with reasonable query times.
|
||||||
|
- API:
|
||||||
|
- Exposes `alternatives=Number` parameter overload in addition to the boolean flag.
|
||||||
|
- Support for exits numbers and names. New member `exits` in `RouteStep`, based on `junction:ref` on ways
|
||||||
|
- `Intersection` now has new parameter `classes` that can be set in the profile on each way.
|
||||||
|
- Profiles:
|
||||||
|
- `result.exits` allows you to set a way's exit numbers and names, see [`junction:ref`](http://wiki.openstreetmap.org/wiki/Proposed_features/junction_details)
|
||||||
|
- `ExtractionWay` now as new property `forward_classes` and `backward_classes` that can set in the `way_function`.
|
||||||
|
The maximum number of classes is 8.
|
||||||
|
- We now respect the `construction` tag. If the `construction` tag value is not on our whitelist (`minor`, `widening`, `no`) we will exclude the road.
|
||||||
|
- Node.js Bindings:
|
||||||
|
- Exposes `alternatives=Number` parameter overload in addition to the boolean flag
|
||||||
|
- Expose `EngineConfig` options in the node bindings
|
||||||
|
- Tools:
|
||||||
|
- Exposes engine limit on number of alternatives to generate `--max-alternatives` in `osrm-routed` (3 by default)
|
||||||
|
- Infrastructure
|
||||||
|
- STXXL is not required to build OSRM and is an optional dependency for back-compatibility (ENABLE_STXXL=On)
|
||||||
|
- OpenMP is only required when the optional STXXL dependency is used
|
||||||
|
- Bug fixes:
|
||||||
|
- #4278: Remove superflous continious instruction on a motorway.
|
||||||
|
|
||||||
# 5.8.0
|
# 5.8.0
|
||||||
- Changes from 5.7
|
- Changes from 5.7
|
||||||
- API:
|
- API:
|
||||||
@@ -26,6 +62,7 @@
|
|||||||
- Fixed a copy/paste issue assigning wrong directions in similar turns (left over right)
|
- Fixed a copy/paste issue assigning wrong directions in similar turns (left over right)
|
||||||
- #4074: fixed a bug that would announce entering highway ramps as u-turns
|
- #4074: fixed a bug that would announce entering highway ramps as u-turns
|
||||||
- #4122: osrm-routed/libosrm should throw exception when a dataset incompatible with the requested algorithm is loaded
|
- #4122: osrm-routed/libosrm should throw exception when a dataset incompatible with the requested algorithm is loaded
|
||||||
|
- Avoid collapsing u-turns into combined turn instructions
|
||||||
|
|
||||||
# 5.7.1
|
# 5.7.1
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
|
|||||||
+26
-10
@@ -21,6 +21,7 @@ option(BUILD_PACKAGE "Build OSRM package" OFF)
|
|||||||
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
||||||
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
||||||
|
option(ENABLE_STXXL "Use STXXL library" OFF)
|
||||||
option(ENABLE_LTO "Use LTO if available" OFF)
|
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)
|
||||||
@@ -54,8 +55,8 @@ 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 8)
|
set(OSRM_VERSION_MINOR 9)
|
||||||
set(OSRM_VERSION_PATCH 0)
|
set(OSRM_VERSION_PATCH 2)
|
||||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||||
|
|
||||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
@@ -428,9 +429,12 @@ if(ENABLE_MASON)
|
|||||||
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
|
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
|
||||||
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
|
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
|
||||||
|
|
||||||
|
if (ENABLE_STXXL)
|
||||||
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
|
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
|
||||||
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
|
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
|
||||||
set(STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
|
set(MAYBE_STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
|
||||||
|
add_definitions(-DUSE_STXXL_LIBRARY)
|
||||||
|
endif()
|
||||||
|
|
||||||
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
|
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
|
||||||
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
|
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
|
||||||
@@ -493,8 +497,16 @@ else()
|
|||||||
find_package(EXPAT REQUIRED)
|
find_package(EXPAT REQUIRED)
|
||||||
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(STXXL REQUIRED)
|
if (ENABLE_STXXL)
|
||||||
|
find_package(STXXL)
|
||||||
|
if (STXXL_FOUND)
|
||||||
add_dependency_includes(${STXXL_INCLUDE_DIR})
|
add_dependency_includes(${STXXL_INCLUDE_DIR})
|
||||||
|
set(MAYBE_STXXL_LIBRARY ${STXXL_LIBRARY})
|
||||||
|
add_definitions(-DUSE_STXXL_LIBRARY)
|
||||||
|
else()
|
||||||
|
MESSAGE(STATUS "STXXL was requested but not found, default STL will be used")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(BZip2 REQUIRED)
|
find_package(BZip2 REQUIRED)
|
||||||
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
||||||
@@ -578,11 +590,13 @@ add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
|
|||||||
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
|
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
|
||||||
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
|
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
|
||||||
|
|
||||||
set(OpenMP_FIND_QUIETLY ON)
|
if (ENABLE_STXXL)
|
||||||
find_package(OpenMP)
|
set(OpenMP_FIND_QUIETLY ON)
|
||||||
if(OPENMP_FOUND)
|
find_package(OpenMP)
|
||||||
|
if(OPENMP_FOUND)
|
||||||
message(STATUS "OpenMP support found. Linking just in case for stxxl")
|
message(STATUS "OpenMP support found. Linking just in case for stxxl")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(${OSRM_DEFINES})
|
add_definitions(${OSRM_DEFINES})
|
||||||
@@ -617,7 +631,7 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
${EXPAT_LIBRARIES}
|
${EXPAT_LIBRARIES}
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${OSMIUM_LIBRARIES}
|
${OSMIUM_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${MAYBE_STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${ZLIB_LIBRARY}
|
${ZLIB_LIBRARY}
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
${MAYBE_COVERAGE_LIBRARIES})
|
||||||
@@ -645,7 +659,7 @@ set(CONTRACTOR_LIBRARIES
|
|||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${MAYBE_STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_RT_LIBRARY}
|
${MAYBE_RT_LIBRARY}
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
${MAYBE_COVERAGE_LIBRARIES})
|
||||||
@@ -665,7 +679,7 @@ set(STORAGE_LIBRARIES
|
|||||||
set(UTIL_LIBRARIES
|
set(UTIL_LIBRARIES
|
||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${STXXL_LIBRARY}
|
${MAYBE_STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
${MAYBE_COVERAGE_LIBRARIES})
|
||||||
|
|
||||||
@@ -734,12 +748,14 @@ install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
|||||||
install(FILES ${VariantGlob} DESTINATION include/mapbox)
|
install(FILES ${VariantGlob} DESTINATION include/mapbox)
|
||||||
install(TARGETS osrm-extract DESTINATION bin)
|
install(TARGETS osrm-extract DESTINATION bin)
|
||||||
install(TARGETS osrm-partition DESTINATION bin)
|
install(TARGETS osrm-partition DESTINATION bin)
|
||||||
|
install(TARGETS osrm-customize DESTINATION bin)
|
||||||
install(TARGETS osrm-contract DESTINATION bin)
|
install(TARGETS osrm-contract DESTINATION bin)
|
||||||
install(TARGETS osrm-datastore DESTINATION bin)
|
install(TARGETS osrm-datastore DESTINATION bin)
|
||||||
install(TARGETS osrm-routed DESTINATION bin)
|
install(TARGETS osrm-routed DESTINATION bin)
|
||||||
install(TARGETS osrm DESTINATION lib)
|
install(TARGETS osrm DESTINATION lib)
|
||||||
install(TARGETS osrm_extract DESTINATION lib)
|
install(TARGETS osrm_extract DESTINATION lib)
|
||||||
install(TARGETS osrm_partition DESTINATION lib)
|
install(TARGETS osrm_partition DESTINATION lib)
|
||||||
|
install(TARGETS osrm_customize DESTINATION lib)
|
||||||
install(TARGETS osrm_update DESTINATION lib)
|
install(TARGETS osrm_update DESTINATION lib)
|
||||||
install(TARGETS osrm_contract DESTINATION lib)
|
install(TARGETS osrm_contract DESTINATION lib)
|
||||||
install(TARGETS osrm_store DESTINATION lib)
|
install(TARGETS osrm_store DESTINATION lib)
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ The following services are available via HTTP API, C++ library interface and Nod
|
|||||||
|
|
||||||
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
|
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
|
||||||
|
|
||||||
|
For a quick introduction about how the road network is represented in OpenStreetMap and how to map specific road network features have a look at [this guide about mapping for navigation](https://www.mapbox.com/mapping/mapping-for-navigation/).
|
||||||
|
|
||||||
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
||||||
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
|
- [node-osrm](https://www.npmjs.com/package/osrm) - Production-ready NodeJs bindings for the routing engine
|
||||||
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
|
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
|
||||||
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
|
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
|
||||||
- [osrm-backend-docker](https://hub.docker.com/r/osrm/osrm-backend/) - Ready to use Docker images
|
- [osrm-backend-docker](https://hub.docker.com/r/osrm/osrm-backend/) - Ready to use Docker images
|
||||||
@@ -119,7 +121,7 @@ osrm-routed berlin-latest.osrm
|
|||||||
Running Queries
|
Running Queries
|
||||||
|
|
||||||
```
|
```
|
||||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
|
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
|
||||||
@@ -128,9 +130,36 @@ Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Ap
|
|||||||
Simple query with instructions and alternatives on Berlin:
|
Simple query with instructions and alternatives on Berlin:
|
||||||
|
|
||||||
```
|
```
|
||||||
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
curl "https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using the Node.js Bindings
|
||||||
|
|
||||||
|
The Node.js bindings provide read-only access to the routing engine.
|
||||||
|
We provide API documentation and examples [here](docs/nodejs/api.md).
|
||||||
|
|
||||||
|
You will need a modern `libstdc++` toolchain (`>= GLIBCXX_3.4.20`) for binary compatibility if you want to use the pre-built binaries.
|
||||||
|
For older Ubuntu systems you can upgrade your standard library for example with:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y libstdc++-5-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
You can install the Node.js bindings via `npm install osrm` or from this repository either via
|
||||||
|
|
||||||
|
npm install
|
||||||
|
|
||||||
|
which will check and use pre-built binaries if they're available for this release and your Node version, or via
|
||||||
|
|
||||||
|
npm install --build-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).
|
||||||
|
|
||||||
|
|
||||||
## References in publications
|
## References in publications
|
||||||
|
|
||||||
When using the code in a (scientific) publication, please cite
|
When using the code in a (scientific) publication, please cite
|
||||||
|
|||||||
+1
-1
@@ -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 --tags ~@alternative --tags ~@matrix --tags ~@trip --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'
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-13
@@ -165,21 +165,21 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
|
|||||||
Finds the fastest route between coordinates in the supplied order.
|
Finds the fastest route between coordinates in the supplied order.
|
||||||
|
|
||||||
```endpoint
|
```endpoint
|
||||||
GET /route/v1/{profile}/{coordinates}?alternatives={true|false}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={full|simplified|false}&annotations={true|false}
|
GET /route/v1/{profile}/{coordinates}?alternatives={true|false|number}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={full|simplified|false}&annotations={true|false}
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||||
|
|
||||||
|Option |Values |Description |
|
|Option |Values |Description |
|
||||||
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
||||||
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|
|alternatives|`true`, `false` (default), or Number |Search for alternative routes. Passing a number `alternatives=n` searches for up to `n` alternative routes.\* |
|
||||||
|steps |`true`, `false` (default) |Return route steps for each route leg |
|
|steps |`true`, `false` (default) |Returned route steps for each route leg |
|
||||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
||||||
|
|
||||||
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
|
\* Please note that even if alternative routes are requested, a result cannot be guaranteed.
|
||||||
|
|
||||||
**Response**
|
**Response**
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
|
|
||||||
|Option |Values |Description |
|
|Option |Values |Description |
|
||||||
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
||||||
|steps |`true`, `false` (default) |Return route steps for each route |
|
|steps |`true`, `false` (default) |Returned route steps for each route |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
@@ -328,10 +328,10 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
|
|
||||||
|Option |Values |Description |
|
|Option |Values |Description |
|
||||||
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|
||||||
|roundtrip |`true` (default), `false` |Return route is a roundtrip (route returns to first location) |
|
|roundtrip |`true` (default), `false` |Returned route is a roundtrip (route returns to first location) |
|
||||||
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|
|source |`any` (default), `first` |Returned route starts at `any` or `first` coordinate |
|
||||||
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|
|destination |`any` (default), `last` |Returned route ends at `any` or `last` coordinate |
|
||||||
|steps |`true`, `false` (default) |Return route instructions for each trip |
|
|steps |`true`, `false` (default) |Returned route instructions for each trip |
|
||||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
@@ -539,10 +539,10 @@ Annotation of the whole route leg with fine-grained information about each segme
|
|||||||
**Properties**
|
**Properties**
|
||||||
|
|
||||||
- `distance`: The distance, in metres, between each pair of coordinates
|
- `distance`: The distance, in metres, between each pair of coordinates
|
||||||
- `duration`: The duration between each pair of coordinates, in seconds
|
- `duration`: The duration between each pair of coordinates, in seconds. Does not include the duration of any turns.
|
||||||
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
||||||
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
||||||
- `weight`: The weights between each pair of coordinates
|
- `weight`: The weights between each pair of coordinates. Does not include any turn costs.
|
||||||
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
|
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
@@ -581,6 +581,7 @@ step.
|
|||||||
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
||||||
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
|
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
|
||||||
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
|
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
|
||||||
|
- `exits`: The exit numbers or names of the way. Will be `undefined` if there are no exit numbers or names.
|
||||||
- `mode`: A string signifying the mode of transportation.
|
- `mode`: A string signifying the mode of transportation.
|
||||||
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
||||||
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
||||||
@@ -654,12 +655,12 @@ step.
|
|||||||
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
|
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
|
||||||
| `fork` | take the left/right side at a fork depending on `modifier` |
|
| `fork` | take the left/right side at a fork depending on `modifier` |
|
||||||
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
||||||
| `use lane` | going straight on a specific lane |
|
| `use lane` | **Deprecated** replaced by lanes on all intersection entries |
|
||||||
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
||||||
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
|
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
|
||||||
| `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. 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 |
|
||||||
|
|
||||||
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.
|
||||||
@@ -732,6 +733,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
|
|
||||||
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
||||||
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
|
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
|
||||||
|
- `classes`: An array of strings signifying the classes (as specified in the profile) of the road exiting the intersection.
|
||||||
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
|
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
|
||||||
`false` indicates that the turn onto the respective road would violate a restriction.
|
`false` indicates that the turn onto the respective road would violate a restriction.
|
||||||
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
|
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
|
||||||
@@ -750,6 +752,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
"out":2,
|
"out":2,
|
||||||
"bearings":[60,150,240,330],
|
"bearings":[60,150,240,330],
|
||||||
"entry":["false","true","true","true"],
|
"entry":["false","true","true","true"],
|
||||||
|
"classes": ["toll", "restricted"],
|
||||||
"lanes":{
|
"lanes":{
|
||||||
"indications": ["left", "straight"],
|
"indications": ["left", "straight"],
|
||||||
"valid": "false"
|
"valid": "false"
|
||||||
|
|||||||
+27
-21
@@ -26,6 +26,12 @@ var osrm = new OSRM('network.osrm');
|
|||||||
- `options.shared_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Connects to the persistent shared memory datastore.
|
- `options.shared_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Connects to the persistent shared memory datastore.
|
||||||
This requires you to run `osrm-datastore` prior to creating an `OSRM` object.
|
This requires you to run `osrm-datastore` prior to creating an `OSRM` object.
|
||||||
- `options.path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The path to the `.osrm` files. This is mutually exclusive with setting {options.shared_memory} to true.
|
- `options.path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The path to the `.osrm` files. This is mutually exclusive with setting {options.shared_memory} to true.
|
||||||
|
- `options.max_locations_trip` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in trip query (default: unlimited).
|
||||||
|
- `options.max_locations_viaroute` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in viaroute query 9default: unlimited).
|
||||||
|
- `options.max_locations_distance_table` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in distance table query (default: unlimited).
|
||||||
|
- `options.max_locations_map_matching` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in map matching query (default: unlimited).
|
||||||
|
- `options.max_results_nearest` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. results supported in nearest query (default: unlimited).
|
||||||
|
- `options.max_alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. number of alternative routes supported (default: 3).
|
||||||
|
|
||||||
### route
|
### route
|
||||||
|
|
||||||
@@ -41,7 +47,7 @@ Returns the fastest route between two or more coordinates while visiting the way
|
|||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
- `options.alternatives` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes and return as well.
|
- `options.alternatives` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes and return as well.
|
||||||
_Please note that even if an alternative route is requested, a result cannot be guaranteed._ (optional, default `false`)
|
_Please note that even if an alternative route is requested, a result cannot be guaranteed._ (optional, default `false`)
|
||||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route leg. (optional, default `false`)
|
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returned route steps for each route leg. (optional, default `false`)
|
||||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||||
@@ -188,7 +194,7 @@ if they can not be matched successfully.
|
|||||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returned route steps for each route. (optional, default `false`)
|
||||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||||
@@ -229,7 +235,25 @@ The trip plugin solves the Traveling Salesman Problem using a greedy heuristic
|
|||||||
waypoints. The returned path does not have to be the shortest path, _ as TSP is NP-hard it is
|
waypoints. The returned path does not have to be the shortest path, _ as TSP is NP-hard it is
|
||||||
only an approximation.
|
only an approximation.
|
||||||
|
|
||||||
Note that all input coordinates have to be connected for the trip service to work.
|
**Parameters**
|
||||||
|
|
||||||
|
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||||
|
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||||
|
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||||
|
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||||
|
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `double >= 0` or `null` (unlimited, default).
|
||||||
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
|
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returned route steps for each route. (optional, default `false`)
|
||||||
|
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||||
|
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||||
|
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
|
||||||
|
- `options.roundtrip` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returned route is a roundtrip (route returns to first location). (optional, default `true`)
|
||||||
|
- `options.source` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route starts at `any` or `first` coordinate. (optional, default `any`)
|
||||||
|
- `options.destination` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route ends at `any` or `last` coordinate. (optional, default `any`)
|
||||||
|
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||||
|
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||||
|
|
||||||
|
A requirement for computing trips is that all input coordinates are connected.
|
||||||
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
|
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
|
||||||
Right now, the following combinations are possible:
|
Right now, the following combinations are possible:
|
||||||
|
|
||||||
@@ -244,24 +268,6 @@ Right now, the following combinations are possible:
|
|||||||
| false | any | last | no |
|
| false | any | last | no |
|
||||||
| false | any | any | no |
|
| false | any | any | no |
|
||||||
|
|
||||||
**Parameters**
|
|
||||||
|
|
||||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
|
||||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
|
||||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
|
||||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
|
||||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `double >= 0` or `null` (unlimited, default).
|
|
||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
|
||||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
|
||||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
|
||||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
|
||||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
|
|
||||||
- `options.roundtrip` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route is a roundtrip. (optional, default `true`)
|
|
||||||
- `options.source` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route starts at `any` or `first` coordinate. (optional, default `any`)
|
|
||||||
- `options.destination` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route ends at `any` or `last` coordinate. (optional, default `any`)
|
|
||||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
|
||||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
|
||||||
|
|
||||||
**Examples**
|
**Examples**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|||||||
+5
-1
@@ -28,7 +28,7 @@ As you scroll down the file you'll see local variables, and then local functions
|
|||||||
The following global properties can be set in your profile:
|
The following global properties can be set in your profile:
|
||||||
|
|
||||||
Attribute | Type | Notes
|
Attribute | Type | Notes
|
||||||
------------------------------|----------|----------------------------------------------------------------------------
|
-------------------------------------|----------|----------------------------------------------------------------------------
|
||||||
weight_name | String | Name used in output for the routing weight property (default `'duration'`)
|
weight_name | String | Name used in output for the routing weight property (default `'duration'`)
|
||||||
weight_precision | Unsigned | Decimal precision of edge weights (default `1`)
|
weight_precision | Unsigned | Decimal precision of edge weights (default `1`)
|
||||||
left_hand_driving | Boolean | Are vehicles assumed to drive on the left? (used in guidance, default `false`)
|
left_hand_driving | Boolean | Are vehicles assumed to drive on the left? (used in guidance, default `false`)
|
||||||
@@ -56,6 +56,8 @@ forward_rate | Float | Routing weight, expressed a
|
|||||||
backward_rate | Float | " "
|
backward_rate | Float | " "
|
||||||
forward_mode | Enum | Mode of travel (e.g. `car`, `ferry`). Mandatory. Defined in `include/extractor/travel_mode.hpp`.
|
forward_mode | Enum | Mode of travel (e.g. `car`, `ferry`). Mandatory. Defined in `include/extractor/travel_mode.hpp`.
|
||||||
backward_mode | Enum | " "
|
backward_mode | Enum | " "
|
||||||
|
forward_classes | Table | Mark this way as being of a specific class, e.g. `result.classes["toll"] = true`. This will be exposed in the API as `classes` on each `RouteStep`.
|
||||||
|
backward_classes | Table | " "
|
||||||
duration | Float | Alternative setter for duration of the whole way in both directions
|
duration | Float | Alternative setter for duration of the whole way in both directions
|
||||||
weight | Float | Alternative setter for weight of the whole way in both directions
|
weight | Float | Alternative setter for weight of the whole way in both directions
|
||||||
turn_lanes_forward | String | Directions for individual lanes (normalised OSM `turn:lanes` value)
|
turn_lanes_forward | String | Directions for individual lanes (normalised OSM `turn:lanes` value)
|
||||||
@@ -67,6 +69,8 @@ roundabout | Boolean | Is this part of a roundabou
|
|||||||
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
|
ref | String | Road number
|
||||||
|
destinations | String | The road's destinations
|
||||||
|
exits | String | The ramp's exit numbers or names
|
||||||
pronunciation | String | Name pronunciation
|
pronunciation | String | Name pronunciation
|
||||||
road_classification.motorway_class | Boolean | Guidance: way is a motorway
|
road_classification.motorway_class | Boolean | Guidance: way is a motorway
|
||||||
road_classification.link_class | Boolean | Guidance: way is a slip/link road
|
road_classification.link_class | Boolean | Guidance: way is a slip/link road
|
||||||
|
|||||||
@@ -86,12 +86,12 @@ Feature: Bike - Cycle tracks/lanes
|
|||||||
| motorway | track | yes | cycling | |
|
| motorway | track | yes | cycling | |
|
||||||
| residential | track | yes | cycling | pushing bike |
|
| residential | track | yes | cycling | pushing bike |
|
||||||
| cycleway | track | yes | cycling | pushing bike |
|
| cycleway | track | yes | cycling | pushing bike |
|
||||||
| footway | track | yes | pushing bike | pushing bike |
|
| footway | track | yes | cycling | pushing bike |
|
||||||
|
|
||||||
Scenario: Bike - Cycleway on oneways, speeds
|
Scenario: Bike - Cycleway on oneways, speeds
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | cycleway | oneway | forw | backw |
|
| highway | cycleway | oneway | forw | backw |
|
||||||
| motorway | track | yes | 15 km/h | |
|
| motorway | track | yes | 15 km/h | |
|
||||||
| residential | track | yes | 15 km/h | 6 km/h |
|
| residential | track | yes | 15 km/h | 6 km/h +-1 |
|
||||||
| cycleway | track | yes | 15 km/h | 6 km/h |
|
| cycleway | track | yes | 15 km/h | 6 km/h +-1 |
|
||||||
| footway | track | yes | 6 km/h +-1 | 6 km/h +-1 |
|
| footway | track | yes | 15 km/h | 6 km/h +-1 |
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ Feature: Bike - Handle ferry routes
|
|||||||
Scenario: Bike - Ferry duration, multiple nodes
|
Scenario: Bike - Ferry duration, multiple nodes
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
x y
|
x a b c d y
|
||||||
a b c d
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
|
|||||||
@@ -134,3 +134,12 @@ Feature: Bike - Oneway streets
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | ab,bc,bc |
|
| a | c | ab,bc,bc |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Bike - Left/right cycleways on oneways
|
||||||
|
Then routability should be
|
||||||
|
| highway | oneway | cycleway:left | cycleway:right | forw | backw |
|
||||||
|
| primary | yes | | | cycling | pushing bike |
|
||||||
|
| primary | yes | | track | cycling | pushing bike |
|
||||||
|
| primary | yes | track | | cycling | cycling |
|
||||||
|
| primary | yes | track | track | cycling | cycling |
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
@routing @bicycle @safety
|
||||||
|
Feature: Bicycle - Adds penalties to unsafe roads
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile file
|
||||||
|
"""
|
||||||
|
require 'bicycle'
|
||||||
|
properties.weight_name = 'cyclability'
|
||||||
|
"""
|
||||||
|
|
||||||
|
Scenario: Bike - Apply penalties to ways without cycleways
|
||||||
|
Then routability should be
|
||||||
|
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||||
|
| motorway | | | | | |
|
||||||
|
| primary | | 15 km/h | 15 km/h | 2.9 | 2.9 |
|
||||||
|
| secondary | | 15 km/h | 15 km/h | 3.1 | 3.1 |
|
||||||
|
| tertiary | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||||
|
| primary_link | | 15 km/h | 15 km/h | 2.9 | 2.9 |
|
||||||
|
| secondary_link | | 15 km/h | 15 km/h | 3.1 | 3.1 |
|
||||||
|
| tertiary_link | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||||
|
| residential | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| cycleway | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| footway | | 6 km/h +-1 | 6 km/h +-1 | 1.7 | 1.7 |
|
||||||
|
|
||||||
|
Scenario: Bike - Apply no penalties to ways with cycleways
|
||||||
|
Then routability should be
|
||||||
|
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||||
|
| motorway | track | 15 km/h | | 4.2 | |
|
||||||
|
| primary | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| secondary | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| tertiary | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| primary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| secondary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| tertiary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| residential | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| cycleway | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| footway | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| motorway | lane | 15 km/h | | 4.2 | |
|
||||||
|
| primary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| secondary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| tertiary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| primary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| secondary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| tertiary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| residential | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| cycleway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| footway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| motorway | shared_lane | 15 km/h | | 4.2 | |
|
||||||
|
| primary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
|
||||||
|
Scenario: Bike - Apply no penalties to ways in direction of cycleways
|
||||||
|
Then routability should be
|
||||||
|
| highway | cycleway:right | cycleway:left | forw | backw | forw_rate | backw_rate |
|
||||||
|
| motorway | track | | 15 km/h | | 4.2 | |
|
||||||
|
| primary | track | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
|
| secondary | track | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||||
|
| tertiary | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||||
|
| primary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
|
| secondary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||||
|
| tertiary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||||
|
| residential | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| cycleway | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| footway | track | | 15 km/h | 6 km/h +-1 | 4.2 | 1.7 |
|
||||||
|
| motorway | | track | | 15 km/h | | 4.2 |
|
||||||
|
| primary | | track | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
|
| secondary | | track | 15 km/h | 15 km/h | 3.1 | 4.2 |
|
||||||
|
| tertiary | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
|
| primary_link | | track | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
|
| secondary_link | | track | 15 km/h | 15 km/h | 3.1 | 4.2 |
|
||||||
|
| tertiary_link | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
|
| residential | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| cycleway | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| footway | | track | 6 km/h +-1 | 15 km/h | 1.7 | 4.2 |
|
||||||
|
| motorway | lane | | 15 km/h | | 4.2 | |
|
||||||
|
| primary | lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
|
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||||
|
| tertiary | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||||
|
| primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
|
| secondary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||||
|
| tertiary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||||
|
| residential | lane | | 15 km/h +-1 | 15 km/h +-1 | 4.2 | 4.2 |
|
||||||
|
| cycleway | lane | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| footway | lane | | 15 km/h | 6 km/h +-1 | 4.2 | 1.7 |
|
||||||
|
| motorway | | lane | | 15 km/h | | 4.2 |
|
||||||
|
| primary | | lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
|
| secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 3.1 | 4.2 |
|
||||||
|
| tertiary | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
|
| primary_link | | lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
|
| secondary_link | | lane | 15 km/h | 15 km/h | 3.1 | 4.2 |
|
||||||
|
| tertiary_link | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
|
| residential | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| cycleway | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| footway | | lane | 6 km/h +-1 | 15 km/h | 1.7 | 4.2 |
|
||||||
|
| motorway | shared_lane | | 15 km/h | | 4.2 | |
|
||||||
|
| primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
|
| motorway | | shared_lane | | 15 km/h | | 4.2 |
|
||||||
|
| primary | | shared_lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Bike - Don't apply penalties for all kind of cycleways
|
||||||
|
Then routability should be
|
||||||
|
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||||
|
| tertiary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| tertiary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
|
| tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
@routing @bicycle @startpoint
|
||||||
|
Feature: Bike - Allowed start/end modes
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "bicycle"
|
||||||
|
|
||||||
|
Scenario: Bike - Don't start/stop on ferries
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b 2 c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| bc | | ferry | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| 1 | 2 | ab,ab | cycling,cycling |
|
||||||
|
| 2 | 1 | ab,ab | cycling,cycling |
|
||||||
|
|
||||||
|
Scenario: Bike - Don't start/stop on trains
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b 2 c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | railway | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| bc | | train | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| 1 | 2 | ab,ab | cycling,cycling |
|
||||||
|
| 2 | 1 | ab,ab | cycling,cycling |
|
||||||
|
|
||||||
|
Scenario: Bike - OK to start pushing bike
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b 2 c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| bc | steps |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| 1 | 2 | ab,bc,bc | cycling,pushing bike,pushing bike |
|
||||||
|
| 2 | 1 | bc,ab,ab | pushing bike,cycling,cycling |
|
||||||
@@ -1,39 +1,71 @@
|
|||||||
@routing @bicycle @train
|
@routing @bicycle @train
|
||||||
Feature: Bike - Handle ferry routes
|
Feature: Bike - Handle ferry routes
|
||||||
# Bringing bikes on trains and subways
|
# Bringing bikes on trains and subways
|
||||||
|
# We cannot currently use a 'routability' type test, since the bike
|
||||||
|
# profile does not allow starting/stopping on trains, and
|
||||||
|
# it's not possible to modify the bicycle profile table because it's
|
||||||
|
# defined as local.
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
|
|
||||||
Scenario: Bike - Bringing bikes on trains
|
Scenario: Bike - Bringing bikes on trains
|
||||||
Then routability should be
|
Given the node map
|
||||||
| highway | railway | bicycle | bothw |
|
"""
|
||||||
| primary | | | cycling |
|
a 1 b c 2 d e 3 f g 4 h
|
||||||
| (nil) | train | | |
|
"""
|
||||||
| (nil) | train | no | |
|
|
||||||
| (nil) | train | yes | train |
|
And the ways
|
||||||
| (nil) | railway | | |
|
| nodes | highway | railway | bicycle |
|
||||||
| (nil) | railway | no | |
|
| ab | primary | | |
|
||||||
| (nil) | railway | yes | train |
|
| cd | primary | | |
|
||||||
| (nil) | subway | | |
|
| ef | primary | | |
|
||||||
| (nil) | subway | no | |
|
| gh | primary | | |
|
||||||
| (nil) | subway | yes | train |
|
| bc | | train | |
|
||||||
| (nil) | tram | | |
|
| de | | train | yes |
|
||||||
| (nil) | tram | no | |
|
| fg | | train | no |
|
||||||
| (nil) | tram | yes | train |
|
|
||||||
| (nil) | light_rail | | |
|
When I route I should get
|
||||||
| (nil) | light_rail | no | |
|
| from | to | route |
|
||||||
| (nil) | light_rail | yes | train |
|
| 1 | 2 | |
|
||||||
| (nil) | monorail | | |
|
| 2 | 3 | cd,de,ef,ef |
|
||||||
| (nil) | monorail | no | |
|
| 3 | 4 | |
|
||||||
| (nil) | monorail | yes | train |
|
|
||||||
| (nil) | some_tag | | |
|
Scenario: Bike - Bringing bikes on trains, invalid railway tag is accepted if access specified
|
||||||
| (nil) | some_tag | no | |
|
Given the node map
|
||||||
| (nil) | some_tag | yes | cycling |
|
"""
|
||||||
|
a 1 b c 2 d e 3 f g 4 h
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | railway | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| cd | primary | | |
|
||||||
|
| ef | primary | | |
|
||||||
|
| gh | primary | | |
|
||||||
|
| bc | | invalid_tag | |
|
||||||
|
| de | | invalid_tag | yes |
|
||||||
|
| fg | | invalid_tag | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| 1 | 2 | |
|
||||||
|
| 2 | 3 | cd,de,ef|
|
||||||
|
| 3 | 4 | |
|
||||||
|
|
||||||
@construction
|
@construction
|
||||||
Scenario: Bike - Don't route on railways under construction
|
Scenario: Bike - Don't route on railways under construction
|
||||||
Then routability should be
|
Given the node map
|
||||||
| highway | railway | bicycle | bothw |
|
"""
|
||||||
| primary | | | cycling |
|
a 1 b c 2 d
|
||||||
| (nil) | construction | yes | |
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | railway | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| cd | primary | | |
|
||||||
|
| bc | | construction | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| 1 | 2 | |
|
||||||
|
|||||||
+20
-20
@@ -183,9 +183,9 @@ Feature: Car - Restricted access
|
|||||||
Scenario: Car - designated HOV ways are rated low
|
Scenario: Car - designated HOV ways are rated low
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | hov | bothw | forw_rate | backw_rate |
|
| highway | hov | bothw | forw_rate | backw_rate |
|
||||||
| primary | designated | x | 18 | 18 |
|
| primary | designated | x | 18.2 | 18.2 |
|
||||||
| primary | yes | x | 18 | 18 |
|
| primary | yes | x | 18.2 | 18.2 |
|
||||||
| primary | no | x | 18 | 18 |
|
| primary | no | x | 18.2 | 18.2 |
|
||||||
|
|
||||||
# Models:
|
# Models:
|
||||||
# https://www.openstreetmap.org/way/124891268
|
# https://www.openstreetmap.org/way/124891268
|
||||||
@@ -201,24 +201,24 @@ Feature: Car - Restricted access
|
|||||||
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | designated | designated | | | x | x | 18 | 18 |
|
| primary | designated | designated | | | x | x | 18.2 | 18.2 |
|
||||||
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
||||||
#| primary | | designated | | | x | x | 18 | 18 |
|
#| primary | | designated | | | x | x | 18.2 | 18.2 |
|
||||||
#| primary | designated | | | | x | x | 18 | 18 |
|
#| primary | designated | | | | x | x | 18.2 | 18.2 |
|
||||||
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
|
| primary | designated\|designated | designated\|designated | | | x | x | 18.2 | 18.2 |
|
||||||
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
|
| primary | designated\|no | designated\|no | | | x | x | 18.2 | 18.2 |
|
||||||
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
|
| primary | yes\|no | yes\|no | | | x | x | 18.2 | 18.2 |
|
||||||
| primary | | | | | x | x | 18 | 18 |
|
| primary | | | | | x | x | 18.2 | 18.2 |
|
||||||
| primary | designated | | | -1 | | x | | 18 |
|
| primary | designated | | | -1 | | x | | 18.2 |
|
||||||
| primary | | designated | | -1 | | x | | 18 |
|
| primary | | designated | | -1 | | x | | 18.2 |
|
||||||
| primary | | | designated | yes | x | | 18 | |
|
| primary | | | designated | yes | x | | 18.2 | |
|
||||||
| primary | | | designated | -1 | | x | | 18 |
|
| primary | | | designated | -1 | | x | | 18.2 |
|
||||||
| primary | | | designated\| | yes | x | | 18 | |
|
| primary | | | designated\| | yes | x | | 18.2 | |
|
||||||
| primary | | | designated\| | -1 | | x | | 18 |
|
| primary | | | designated\| | -1 | | x | | 18.2 |
|
||||||
| primary | | | designated\|designated | yes | x | | 18 | |
|
| primary | | | designated\|designated | yes | x | | 18.2 | |
|
||||||
| primary | | | designated\|designated | -1 | | x | | 18 |
|
| primary | | | designated\|designated | -1 | | x | | 18.2 |
|
||||||
| primary | | | designated\|yes | yes | x | | 18 | |
|
| primary | | | designated\|yes | yes | x | | 18.2 | |
|
||||||
| primary | | | designated\|no | -1 | | x | | 18 |
|
| primary | | | designated\|no | -1 | | x | | 18.2 |
|
||||||
|
|
||||||
Scenario: Car - these toll roads always work
|
Scenario: Car - these toll roads always work
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
@routing @car @mode
|
||||||
|
Feature: Car - Mode flag
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
|
||||||
|
Scenario: Car - We tag ferries with a class
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
c d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route |
|
||||||
|
| ab | primary | |
|
||||||
|
| bc | | ferry |
|
||||||
|
| cd | primary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns | classes |
|
||||||
|
| a | d | ab,bc,cd,cd | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] |
|
||||||
|
| d | a | cd,bc,ab,ab | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] |
|
||||||
|
| c | a | bc,ab,ab | depart,notification left,arrive | [(ferry)],[()],[()] |
|
||||||
|
| d | b | cd,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] |
|
||||||
|
| a | c | ab,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] |
|
||||||
|
| b | d | bc,cd,cd | depart,notification left,arrive | [(ferry)],[()],[()] |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Car - We tag motorways with a class
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
c d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| bc | motorway|
|
||||||
|
| cd | primary |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns | classes |
|
||||||
|
| a | d | ab,cd | depart,arrive | [(),(motorway),()],[()] |
|
||||||
|
| a | c | ab,bc | depart,arrive | [(),(motorway)],[()] |
|
||||||
|
| b | d | bc,cd | depart,arrive | [(motorway),()],[()] |
|
||||||
|
|
||||||
|
Scenario: Car - We tag motorway_link with a class
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
c d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| bc | motorway_link |
|
||||||
|
| cd | primary |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns | classes | # |
|
||||||
|
| a | d | ab,bc,cd | depart,on ramp right,arrive | [()],[(motorway),()],[()] | on-ramp at class change |
|
||||||
|
| a | c | ab,bc,bc | depart,on ramp right,arrive | [()],[(motorway)],[()] | " " |
|
||||||
|
| b | d | bc,cd | depart,arrive | [(motorway),()],[()] | no announcement |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Car - We tag restricted with a class
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
c d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | access |
|
||||||
|
| ab | primary | private |
|
||||||
|
| bc | motorway| private |
|
||||||
|
| cd | primary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns | classes |
|
||||||
|
| a | d | ab,cd | depart,arrive| [(restricted),(motorway,restricted),()],[()] |
|
||||||
|
|
||||||
|
Scenario: Car - We toll restricted with a class
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
c d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | toll |
|
||||||
|
| ab | primary | yes |
|
||||||
|
| bc | motorway| yes |
|
||||||
|
| cd | primary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns | classes |
|
||||||
|
| a | d | ab,cd | depart,arrive | [(toll),(motorway,toll),()],[()] |
|
||||||
|
|
||||||
|
Scenario: Car - From roundabout on toll road
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
c
|
||||||
|
/ \
|
||||||
|
a---b d---f
|
||||||
|
\ /
|
||||||
|
e
|
||||||
|
|
|
||||||
|
g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway | highway | junction | toll |
|
||||||
|
| ab | yes | primary | | |
|
||||||
|
| cb | yes | primary | roundabout | |
|
||||||
|
| dc | yes | primary | roundabout | |
|
||||||
|
| be | yes | primary | roundabout | |
|
||||||
|
| ed | yes | motorway| roundabout | |
|
||||||
|
| eg | yes | primary | | |
|
||||||
|
| df | yes | motorway| | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns | classes |
|
||||||
|
| a | f | ab,df,df | depart,roundabout-exit-2,arrive | [()],[(),(motorway),(toll,motorway)],[()] |
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
@routing @car @construction
|
||||||
|
Feature: Car - all construction tags the OpenStreetMap community could think of and then some
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
|
||||||
|
Scenario: Various ways to tag construction and proposed roads
|
||||||
|
Then routability should be
|
||||||
|
| highway | construction | proposed | bothw |
|
||||||
|
| primary | | | x |
|
||||||
|
| construction | | | |
|
||||||
|
| proposed | | | |
|
||||||
|
| primary | yes | | |
|
||||||
|
| primary | | yes | |
|
||||||
|
| primary | no | | x |
|
||||||
|
| primary | widening | | x |
|
||||||
|
| primary | minor | | x |
|
||||||
@@ -88,18 +88,18 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||||
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
|
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
| primary | 60 | | | | 47 km/h | 47 km/h | 13.3 | 13.3 |
|
||||||
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 |
|
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 6.7 | 6.7 |
|
||||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
| primary | | | 60 | | 47 km/h | 64 km/h | 13.3 | 18 |
|
||||||
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 6.7 | 9 |
|
||||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13.3 |
|
||||||
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 6.7 |
|
||||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13.3 | 3.3 |
|
||||||
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 6.7 | 1.7 |
|
||||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3.3 | 13.3 |
|
||||||
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 1.7 | 6.7 |
|
||||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 6.7 | 13.3 |
|
||||||
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3.3 | 6.7 |
|
||||||
|
|
||||||
Scenario: Car - Single lane streets be ignored or incur a penalty
|
Scenario: Car - Single lane streets be ignored or incur a penalty
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -107,33 +107,33 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||||
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
|
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
| primary | 60 | | | | 47 km/h | 47 km/h | 13.3 | 13.3 |
|
||||||
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 |
|
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 6.7 | 6.7 |
|
||||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
| primary | | | 60 | | 47 km/h | 64 km/h | 13.3 | 18 |
|
||||||
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 6.7 | 9 |
|
||||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13.3 |
|
||||||
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 6.7 |
|
||||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13.3 | 3.3 |
|
||||||
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 6.7 | 1.7 |
|
||||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3.3 | 13.3 |
|
||||||
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 1.7 | 6.7 |
|
||||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 6.7 | 13.3 |
|
||||||
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3.3 | 6.7 |
|
||||||
|
|
||||||
Scenario: Car - Single lane streets only incur a penalty for two-way streets
|
Scenario: Car - Single lane streets only incur a penalty for two-way streets
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
|
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | 30 | 1 | yes | 23 km/h | | 7 | |
|
| primary | 30 | 1 | yes | 23 km/h | | 6.7 | |
|
||||||
| primary | 30 | 1 | -1 | | 23 km/h | | 7 |
|
| primary | 30 | 1 | -1 | | 23 km/h | | 6.7 |
|
||||||
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 |
|
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3.3 | 3.3 |
|
||||||
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 |
|
| primary | 30 | 2 | | 23 km/h | 23 km/h | 6.7 | 6.7 |
|
||||||
|
|
||||||
Scenario: Car - Forward/backward maxspeed on reverse oneways
|
Scenario: Car - Forward/backward maxspeed on reverse oneways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
|
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | | | | -1 | | 64 km/h | | 18 |
|
| primary | | | | -1 | | 64 km/h | | 18 |
|
||||||
| primary | 30 | | | -1 | | 23 km/h | | 7 |
|
| primary | 30 | | | -1 | | 23 km/h | | 6.7 |
|
||||||
| primary | | 30 | | -1 | | 64 km/h | | 18 |
|
| primary | | 30 | | -1 | | 64 km/h | | 18 |
|
||||||
| primary | | | 30 | -1 | | 23 km/h | | 7 |
|
| primary | | | 30 | -1 | | 23 km/h | | 6.7 |
|
||||||
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
|
| primary | 20 | 30 | | -1 | | 15 km/h | | 4.4 |
|
||||||
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
|
| primary | 20 | | 30 | -1 | | 23 km/h | | 6.7 |
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ Feature: Car - Surfaces
|
|||||||
Scenario: Car - Ways tagged service should reduce speed
|
Scenario: Car - Ways tagged service should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | service | forw | backw | forw_rate |
|
| highway | service | forw | backw | forw_rate |
|
||||||
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2.1 |
|
||||||
| service | emergency_access | | | |
|
| service | emergency_access | | | |
|
||||||
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2.1 |
|
||||||
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2.1 |
|
||||||
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2.1 |
|
||||||
|
|||||||
@@ -50,4 +50,4 @@ Feature: Car - speeds
|
|||||||
Then routability should be
|
Then routability should be
|
||||||
|
|
||||||
| highway | side_road | forw | backw | forw_rate | backw_rate |
|
| highway | side_road | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
|
| primary | yes | 64 km/h | 64 km/h | 14.4 | 14.4 |
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
@routing @car @startpoint
|
||||||
|
Feature: Car - Allowed start/end modes
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
|
||||||
|
Scenario: Car - Don't start/stop on ferries
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b 2 c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| bc | | ferry | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| 1 | 2 | ab,ab | driving,driving |
|
||||||
|
| 2 | 1 | ab,ab | driving,driving |
|
||||||
|
|
||||||
|
Scenario: Car - Don't start/stop on trains
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b 2 c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | railway | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| bc | | train | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| 1 | 2 | ab,ab | driving,driving |
|
||||||
|
| 2 | 1 | ab,ab | driving,driving |
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
@routing @foot @startpoint
|
||||||
|
Feature: Foot - Allowed start/end modes
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "foot"
|
||||||
|
|
||||||
|
Scenario: Foot - Don't start/stop on ferries
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b 2 c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| bc | | ferry | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| 1 | 2 | ab,ab | walking,walking |
|
||||||
|
| 2 | 1 | ab,ab | walking,walking |
|
||||||
|
|
||||||
|
Scenario: Foot - Don't start/stop on trains
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b 2 c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | railway | bicycle |
|
||||||
|
| ab | primary | | |
|
||||||
|
| bc | | train | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| 1 | 2 | ab,ab | walking,walking |
|
||||||
|
| 2 | 1 | ab,ab | walking,walking |
|
||||||
@@ -36,9 +36,9 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false, |
|
||||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
| a,g | in,straight,straight | depart,new name straight,arrive | ;,left:false straight:true, |
|
||||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
| a,f | in,cross,cross | depart,continue right,arrive | ,;right:true, |
|
||||||
|
|
||||||
@sliproads
|
@sliproads
|
||||||
Scenario: Separate Turn Lanes
|
Scenario: Separate Turn Lanes
|
||||||
@@ -69,9 +69,9 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false right:false, |
|
||||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
| a,g | in,straight,straight | depart,new name straight,arrive | ;,left:false straight:true right:false, |
|
||||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true;left:false straight:false right:true, |
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
@sliproads
|
||||||
@@ -110,9 +110,9 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false right:false, |
|
||||||
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
| a,g | in,straight,straight | depart,new name straight,arrive | ;,left:false straight:true right:false, |
|
||||||
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true;left:false straight:false right:true, |
|
||||||
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
|
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
|
||||||
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
|
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 20 meters
|
Given a grid size of 100 meters
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Anticipate Lane Change for subsequent multi-lane intersections
|
Scenario: Anticipate Lane Change for subsequent multi-lane intersections
|
||||||
@@ -152,8 +152,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,i | ab,ci,ci | depart,turn slight right,arrive | ,none:false slight right:true, |
|
| a,i | ab,ci,ci | depart,turn slight right,arrive | ;,none:false slight right:true, |
|
||||||
| a,j | ab,xbcj | depart,arrive | , |
|
| a,j | ab,xbcj | depart,arrive | ;;none:true slight right:false, |
|
||||||
|
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
@@ -308,8 +308,8 @@ Feature: Turn Lane Guidance
|
|||||||
| di | | off | | yes |
|
| di | | off | | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | destinations | lanes | locations |
|
| waypoints | route | turns | destinations | locations | lanes |
|
||||||
| a,e | main,main,main | depart,use lane straight,arrive | One,Two,Three | ,left:false straight:false straight:true straight:false right:false, | a,c,e |
|
| a,e | main,main | depart,arrive | One,Three | a,e | ;left:false straight:false straight:true straight:false right:false;left:false straight:true right:false, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Anticipate Lanes for through and collapse multiple use lanes
|
Scenario: Anticipate Lanes for through and collapse multiple use lanes
|
||||||
@@ -336,8 +336,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,c | main,main | depart,arrive | , |
|
| a,c | main,main | depart,arrive | ;left:false straight:true straight:true right:false, |
|
||||||
| a,d | main,main | depart,arrive | , |
|
| a,d | main,main | depart,arrive | ;left:false straight:true straight:true right:false;left:false straight:true straight:true right:false, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Anticipate Lanes for through followed by left/right
|
Scenario: Anticipate Lanes for through followed by left/right
|
||||||
@@ -364,15 +364,15 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,d | main,main,main,left,left | depart,use lane straight,use lane straight,turn left,arrive | ,left:false straight:false straight:true straight:false straight:false right:false,left:false straight:true straight:false right:false,left:true right:false, |
|
| a,d | main,left,left | depart,end of road left,arrive | ;left:false straight:false straight:true straight:false straight:false right:false;left:false straight:true straight:false right:false,left:true right:false, |
|
||||||
| a,e | main,main,main,right,right | depart,use lane straight,use lane straight,turn right,arrive | ,left:false straight:false straight:false straight:true straight:false right:false,left:false straight:false straight:true right:false,left:false right:true, |
|
| a,e | main,right,right | depart,end of road right,arrive | ;left:false straight:false straight:false straight:true straight:false right:false;left:false straight:false straight:true right:false,left:false right:true, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Anticipate Lanes for through with turn before / after
|
Scenario: Anticipate Lanes for through with turn before / after
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c g l
|
c g l
|
||||||
b – d – e – h - i
|
b d e h i
|
||||||
a f j
|
a f j
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -393,12 +393,12 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes | # |
|
| waypoints | route | turns | lanes | # |
|
||||||
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
||||||
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
||||||
| a,j | ab,bdehi,bdehi,ij,ij | depart,turn right,use lane straight,turn right,arrive | ,right:true right:true right:false right:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
|
| a,j | ab,bdehi,ij,ij | depart,turn right,end of road right,arrive | ,right:true right:true right:false right:false;left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
|
||||||
| a,l | ab,bdehi,bdehi,il,il | depart,turn right,use lane straight,turn left,arrive | ,right:false right:false right:true right:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
|
| a,l | ab,bdehi,il,il | depart,turn right,end of road left,arrive | ,right:false right:false right:true right:true;left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
|
||||||
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
||||||
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
||||||
| c,l | cb,bdehi,bdehi,il,il | depart,turn left,use lane straight,turn left,arrive | ,left:false left:false left:true left:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
|
| c,l | cb,bdehi,il,il | depart,turn left,end of road left,arrive | ,left:false left:false left:true left:true;left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
|
||||||
| c,j | cb,bdehi,bdehi,ij,ij | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false left:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
|
| c,j | cb,bdehi,ij,ij | depart,turn left,end of road right,arrive | ,left:true left:true left:false left:false;left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Anticipate Lanes for turns with through before and after
|
Scenario: Anticipate Lanes for turns with through before and after
|
||||||
@@ -432,10 +432,10 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,i | top,main,main,top,top | depart,turn right,use lane straight,turn left,arrive | ,straight:false right:false right:true right:true,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
| a,i | top,main,top,top | depart,turn right,turn left,arrive | ,straight:false right:true right:true right:true;;left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
||||||
| a,k | top,main,main,bot,bot | depart,turn right,use lane straight,turn right,arrive | ,straight:false right:true right:true right:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
| a,k | top,main,bot,bot | depart,turn right,turn right,arrive | ,straight:false right:true right:true right:true;;left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
||||||
| c,i | bot,main,main,top,top | depart,turn left,use lane straight,turn left,arrive | ,left:false left:true left:true straight:false,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
| c,i | bot,main,top,top | depart,turn left,turn left,arrive | ,left:true left:true left:true straight:false;;left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
||||||
| c,k | bot,main,main,bot,bot | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false straight:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
| c,k | bot,main,bot,bot | depart,turn left,turn right,arrive | ,left:true left:true left:true straight:false;;left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Anticipate Lanes for turn between throughs
|
Scenario: Anticipate Lanes for turn between throughs
|
||||||
@@ -463,7 +463,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,e | main,main,main,main | depart,use lane straight,continue right,arrive | ,left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true, |
|
| a,e | main,main,main | depart,continue right,arrive | ;left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true;left:false straight:true straight:true, |
|
||||||
|
|
||||||
@anticipate @todo @2661
|
@anticipate @todo @2661
|
||||||
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
|
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
|
||||||
@@ -520,8 +520,8 @@ Feature: Turn Lane Guidance
|
|||||||
| df | | primary | |
|
| df | | primary | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes | intersection_lanes |
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
|
| a,f | ab,df,df | depart,roundabout-exit-1,arrive | ,, | |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: No Lanes for Roundabouts, see #2626
|
Scenario: No Lanes for Roundabouts, see #2626
|
||||||
@@ -554,7 +554,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
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 | depart,roundabout-exit-5,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
|
||||||
@@ -576,9 +576,9 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
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 | depart,roundabout-exit-1,arrive | ,, |
|
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,;, |
|
||||||
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||||
| x,a | xb,roundabout,roundabout | depart,roundabout-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
|
||||||
@@ -615,7 +615,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
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 | depart,roundabout-exit-5,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
|
||||||
@@ -627,36 +627,7 @@ Feature: Turn Lane Guidance
|
|||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
| |
|
\ /
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -671,9 +642,9 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
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 | depart,roundabout-exit-1,arrive | ,, |
|
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,;, |
|
||||||
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||||
| x,a | xb,roundabout,roundabout | depart,roundabout-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
|
||||||
@@ -789,13 +760,6 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a – b – x
|
a – b – x
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
@@ -824,9 +788,7 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
q r s t u v
|
q r s t u v
|
||||||
| | | | | |
|
a - - b - - c - - d - - e - - f - g - h - i
|
||||||
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
|
|
||||||
| | | | | | |
|
|
||||||
p o n m l k j
|
p o n m l k j
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -850,5 +812,5 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations | lanes |
|
| waypoints | route | turns | locations | lanes |
|
||||||
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
|
| a,i | road,road | depart,arrive | a,i | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:false;none:true none:true right:false, |
|
||||||
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
|
| a,j | road,7th,7th | depart,turn right,arrive | a,h,j | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:false none:false none:true;left:false none:false none:false none:true,none:false none:false right:true, |
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ Feature: Collapse
|
|||||||
| a,g | first,second,second | depart,turn left,arrive | a,b,g |
|
| a,g | first,second,second | depart,turn left,arrive | a,b,g |
|
||||||
| d,g | first,second,second | depart,turn right,arrive | d,e,g |
|
| d,g | first,second,second | depart,turn right,arrive | d,e,g |
|
||||||
| g,f | second,first,first | depart,turn right,arrive | g,e,f |
|
| g,f | second,first,first | depart,turn right,arrive | g,e,f |
|
||||||
| g,c | second,first,first | depart,end of road left,arrive | g,b,c |
|
| g,c | second,first,first | depart,turn left,arrive | g,e,c |
|
||||||
|
|
||||||
Scenario: Do not collapse turning roads
|
Scenario: Do not collapse turning roads
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -691,7 +691,7 @@ Feature: Collapse
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
|
| a,g | road,road,cross,cross | depart,continue slight left,turn left,arrive | a,b,c,g |
|
||||||
| a,e | road,road | depart,arrive | a,e |
|
| a,e | road,road | depart,arrive | a,e |
|
||||||
|
|
||||||
Scenario: On-Off on Highway
|
Scenario: On-Off on Highway
|
||||||
@@ -807,8 +807,8 @@ Feature: Collapse
|
|||||||
| di | | off |
|
| di | | off |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations | lanes |
|
||||||
| a,e | main,main,main | depart,use lane straight,arrive | a,c,e |
|
| a,e | main,main | depart,arrive | a,e | ;left:false straight:false straight:true straight:false right:false;left:false straight:true right:false, |
|
||||||
|
|
||||||
Scenario: But _do_ collapse UseLane step when lanes stay the same
|
Scenario: But _do_ collapse UseLane step when lanes stay the same
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -1016,7 +1016,7 @@ Feature: Collapse
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,g | road,cross,cross | depart,fork left,arrive | a,b,g |
|
| a,g | road,road,cross,cross | depart,fork slight left,turn left,arrive | a,b,c,g |
|
||||||
| a,e | road,road,road | depart,fork slight right,arrive | a,b,e |
|
| a,e | road,road,road | depart,fork slight right,arrive | a,b,e |
|
||||||
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | a,b,d,f |
|
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | a,b,d,f |
|
||||||
|
|
||||||
@@ -1055,3 +1055,22 @@ Feature: Collapse
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,i | President Avenue,Princes Highway,Princes Highway | depart,turn left,arrive | a,b,i |
|
| a,i | President Avenue,Princes Highway,Princes Highway | depart,turn left,arrive | a,b,i |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Don't combine uturns
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
2 d
|
||||||
|
a - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - c
|
||||||
|
1
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | tertiary |
|
||||||
|
| bc | tertiary |
|
||||||
|
| bd | service |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | bearings | route | turns | locations |
|
||||||
|
| 1,2 | 90 270 | ab,bd,bd,ab,ab | depart,turn left,continue uturn,turn right,arrive | _,b,d,b,_ |
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
@driveway @guidance
|
||||||
|
Feature: Driveways intersections
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 5 meters
|
||||||
|
|
||||||
|
Scenario: Road with a turn to service road
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
~.
|
||||||
|
b----c----d
|
||||||
|
|
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abc | trunk | first | yes |
|
||||||
|
| cd | trunk | second | yes |
|
||||||
|
| be | service | parking | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | locations |
|
||||||
|
| a,d | first,second | depart,arrive | a,d |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Turn Instead of Ramp
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
~.
|
||||||
|
b----c----d
|
||||||
|
|
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| ab | trunk | | yes |
|
||||||
|
| bc | trunk | | yes |
|
||||||
|
| cd | trunk | second | yes |
|
||||||
|
| be | service | parking | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | locations |
|
||||||
|
| a,d | ,second | depart,arrive | a,d |
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
@routing @guidance
|
||||||
|
Feature: Exit Numbers and Names
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 10 meters
|
||||||
|
|
||||||
|
Scenario: Exit number on the way after the motorway junction
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a . . b . c . . d
|
||||||
|
` e . . f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| b | motorway_junction |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | junction:ref |
|
||||||
|
| abcd | motorway | MainRoad | |
|
||||||
|
| be | motorway_link | ExitRamp | 3 |
|
||||||
|
| ef | motorway_link | ExitRamp | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | exits |
|
||||||
|
| a,f | MainRoad,ExitRamp,ExitRamp | depart,off ramp slight right,arrive | ,3, |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Exit number on the way, motorway junction node tag missing, multiple numbers
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a . . b . c . . d
|
||||||
|
` e . . f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | junction:ref |
|
||||||
|
| abcd | motorway | MainRoad | |
|
||||||
|
| be | motorway_link | ExitRamp | 10;12 |
|
||||||
|
| ef | motorway_link | ExitRamp | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | exits |
|
||||||
|
| a,f | MainRoad,ExitRamp,ExitRamp | depart,off ramp slight right,arrive | ,10; 12, |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Exit number on the ways after the motorway junction, multiple exits
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a . . b . c . . d
|
||||||
|
` e . . f
|
||||||
|
` g . . h
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| b | motorway_junction |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | junction:ref |
|
||||||
|
| abcd | motorway | MainRoad | |
|
||||||
|
| be | motorway_link | ExitRamp | 3 |
|
||||||
|
| ef | motorway_link | ExitRamp | |
|
||||||
|
| bg | motorway_link | ExitRamp | 3 |
|
||||||
|
| gh | motorway_link | ExitRamp | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | exits |
|
||||||
|
| a,f | MainRoad,ExitRamp,ExitRamp | depart,off ramp slight right,arrive | ,3, |
|
||||||
|
| a,h | MainRoad,ExitRamp,ExitRamp | depart,off ramp right,arrive | ,3, |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# http://www.openstreetmap.org/way/417524818#map=17/37.38663/-121.97972
|
||||||
|
Scenario: Exit 393 on Bayshore Freeway
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
` b
|
||||||
|
` c
|
||||||
|
. ` d
|
||||||
|
f ` e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| c | motorway_junction |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | junction:ref | oneway | destination |
|
||||||
|
| abcde | motorway | Bayshore Freeway | | yes | |
|
||||||
|
| cf | motorway_link | | 393 | yes | Great America Parkway;Bowers Avenue |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | exits | destinations |
|
||||||
|
| a,e | Bayshore Freeway,Bayshore Freeway | depart,arrive | , | , |
|
||||||
|
| a,f | Bayshore Freeway,, | depart,off ramp slight right,arrive | ,393,393 | ,Great America Parkway, Bowers Avenue,Great America Parkway, Bowers Avenue |
|
||||||
@@ -261,3 +261,23 @@ Feature: Motorway Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | On,Hwy,Off,Off | depart,merge slight right,off ramp right,arrive |
|
| a,d | On,Hwy,Off,Off | depart,merge slight right,off ramp right,arrive |
|
||||||
|
|
||||||
|
#http://0.0.0.0:9966/?z=18¢er=38.893323%2C-77.055117&loc=38.893551%2C-77.054833&loc=38.893112%2C-77.055536&hl=en&alt=0
|
||||||
|
Scenario: Merging with same name
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a - - -
|
||||||
|
> c - d
|
||||||
|
b
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway | oneway |
|
||||||
|
| ac | | US 50 | motorway | yes |
|
||||||
|
| bc | | I 66 | motorway | yes |
|
||||||
|
| cd | | US 50; I 66 | motorway | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | , | depart,arrive |
|
||||||
|
| b,d | , | depart,arrive |
|
||||||
|
|||||||
@@ -606,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 | lanes |
|
| waypoints | route | turns |
|
||||||
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive | ,, |
|
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive |
|
||||||
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive | ,, |
|
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive |
|
||||||
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive | ,, |
|
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive |
|
||||||
| a,p | ,, | depart,Europaplatz-exit-4,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
|
||||||
@@ -658,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 | lanes |
|
| 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,arrive | ,, |
|
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive |
|
||||||
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive | ,, |
|
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive |
|
||||||
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive | ,, |
|
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive |
|
||||||
| u,r | ,, | depart,roundabout-exit-5,arrive | ,, |
|
| u,r | ,, | depart,roundabout-exit-5,arrive |
|
||||||
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive | ,, |
|
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive |
|
||||||
| n,m | , | depart,arrive | , |
|
| 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
|
||||||
|
|||||||
@@ -206,8 +206,8 @@ Feature: Simple Turns
|
|||||||
| c,a | road,road | depart,arrive | c,a |
|
| c,a | road,road | depart,arrive | c,a |
|
||||||
| g,a | turn,road,road | depart,turn left,arrive | g,b,a |
|
| g,a | turn,road,road | depart,turn left,arrive | g,b,a |
|
||||||
| g,c | turn,road,road | depart,turn right,arrive | g,b,c |
|
| g,c | turn,road,road | depart,turn right,arrive | g,b,c |
|
||||||
| g,f | turn,road,road | depart,turn left,arrive | g,e,f |
|
| g,f | turn,road,road | depart,end of road left,arrive | g,e,f |
|
||||||
| c,f | road,road,road | depart,continue right,arrive | c,b,f |
|
| c,f | road,road,road | depart,turn right,arrive | c,b,f |
|
||||||
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f |
|
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f |
|
||||||
|
|
||||||
# http://www.openstreetmap.org/#map=19/52.48753/13.52838
|
# http://www.openstreetmap.org/#map=19/52.48753/13.52838
|
||||||
@@ -1313,7 +1313,7 @@ Feature: Simple Turns
|
|||||||
# we don't care for turn instructions, this is a coordinate extraction bug check
|
# we don't care for turn instructions, this is a coordinate extraction bug check
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | intersections |
|
| waypoints | route | intersections |
|
||||||
| a,g | ab,bcdefgh | true:90,true:45 false:180 false:270;true:180 |
|
| a,g | ab,bcdefgh,bcdefgh | true:90;true:45 false:180 false:270;true:180 |
|
||||||
|
|
||||||
#https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580
|
#https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580
|
||||||
Scenario: Oszillating Lower Priority Road
|
Scenario: Oszillating Lower Priority Road
|
||||||
@@ -1371,3 +1371,76 @@ Feature: Simple Turns
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route |
|
| waypoints | route |
|
||||||
| g,e | abcde,abcde |
|
| g,e | abcde,abcde |
|
||||||
|
|
||||||
|
# 4205
|
||||||
|
# https://www.openstreetmap.org/node/36153635#map=19/51.97548/7.61795
|
||||||
|
Scenario: merging onto a through street
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
e
|
||||||
|
`
|
||||||
|
`
|
||||||
|
`
|
||||||
|
`
|
||||||
|
d
|
||||||
|
c
|
||||||
|
a - - - - - - - b``
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
`
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
|
||||||
|
f
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway | name |
|
||||||
|
| abc | yes | fww |
|
||||||
|
| fcde | no | jahn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,f | fww,jahn,jahn | depart,turn right,arrive |
|
||||||
|
| a,e | fww,jahn,jahn | depart,turn left,arrive |
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
||||||
| a,c | road,road | depart,arrive | , |
|
| a,c | road,road | depart,arrive | ;straight:true right:false, |
|
||||||
|
|
||||||
Scenario: Turn with Bus-Lane Left
|
Scenario: Turn with Bus-Lane Left
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -178,7 +178,7 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,d | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
|
| a,d | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
|
||||||
| a,c | road,road | depart,arrive | , |
|
| a,c | road,road | depart,arrive | ;left:false straight:true, |
|
||||||
|
|
||||||
# This tests whether empty/invalid PSV tags cause osrm-extract to crash
|
# This tests whether empty/invalid PSV tags cause osrm-extract to crash
|
||||||
Scenario: Turn with Bus-Lane
|
Scenario: Turn with Bus-Lane
|
||||||
@@ -248,23 +248,23 @@ Feature: Turn Lane Guidance
|
|||||||
| fl | cross | | yes |
|
| fl | cross | | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes | intersection_lanes |
|
||||||
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true |
|
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true | ,left:false straight:false right:true |
|
||||||
| a,d | road,road,road | depart,use lane straight,arrive | ,left:false straight:true right:false, |
|
| a,d | road,road | depart,arrive | , | left:false straight:true right:false, |
|
||||||
| a,l | road,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
| a,l | road,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, | ,left:true straight:false right:false, |
|
||||||
| a,h | road,road,road | depart,continue uturn,arrive | ,left:true straight:false right:false, |
|
| a,h | road,road,road | depart,continue uturn,arrive | ,left:true straight:false right:false, | ,left:true straight:false right:false |
|
||||||
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, |
|
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, | ,left:false straight;right:true, |
|
||||||
| k,l | cross,cross,cross | depart,use lane straight,arrive | ,left:false straight;right:true, |
|
| k,l | cross,cross | depart,arrive | , | left:false straight;right:true, |
|
||||||
| k,h | cross,road,road | depart,turn left,arrive | ,left:true straight;right:false, |
|
| k,h | cross,road,road | depart,turn left,arrive | ,left:true straight;right:false, | ,left:true straight;right:false, |
|
||||||
| k,j | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight;right:false, |
|
| k,j | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight;right:false, | ,left:true straight;right:false, |
|
||||||
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, |
|
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, | ,none:false straight:false straight;right:true, |
|
||||||
| e,h | road,road | depart,arrive | ,none:false straight:true straight;right:true |
|
| e,h | road,road | depart,arrive | , | none:false straight:true straight;right:true, |
|
||||||
| e,j | road,cross,cross | depart,turn left,arrive | ,none:true straight:false straight;right:false, |
|
| e,j | road,cross,cross | depart,turn left,arrive | ,none:true straight:false straight;right:false, | ,none:true straight:false straight;right:false, |
|
||||||
| e,d | road,road,road | depart,continue uturn,arrive | ,none:true straight:false straight;right:false, |
|
| e,d | road,road,road | depart,continue uturn,arrive | ,none:true straight:false straight;right:false, | ,none:true straight:false straight;right:false, |
|
||||||
| i,h | cross,road,road | depart,turn right,arrive | ,, |
|
| i,h | cross,road,road | depart,turn right,arrive | ,, | |
|
||||||
| i,j | cross,cross,cross | depart,use lane straight,arrive | ,left:false straight:true, |
|
| i,j | cross,cross | depart,arrive | | left:false straight:true, |
|
||||||
| i,d | cross,road,road | depart,turn left,arrive | ,left:true straight:false, |
|
| i,d | cross,road,road | depart,turn left,arrive | ,left:true straight:false, | ,left:true straight:false, |
|
||||||
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
|
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, | ,left:true straight:false, |
|
||||||
|
|
||||||
#copy of former case to prevent further regression
|
#copy of former case to prevent further regression
|
||||||
@collapse @partition-lanes
|
@collapse @partition-lanes
|
||||||
@@ -300,8 +300,8 @@ Feature: Turn Lane Guidance
|
|||||||
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, |
|
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, |
|
||||||
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, |
|
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, |
|
||||||
| i,h | cross,road,road | depart,turn right,arrive | ,, |
|
| i,h | cross,road,road | depart,turn right,arrive | ,, |
|
||||||
| i,j | cross,cross | depart,arrive | , |
|
| i,j | cross,cross | depart,arrive | ;;left:false straight:true, |
|
||||||
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
|
| i,l | cross,cross,cross | depart,continue uturn,arrive | ;,left:true straight:false;left:true straight:false;left:false straight:true, |
|
||||||
|
|
||||||
@partition-lanes
|
@partition-lanes
|
||||||
Scenario: Turn Lanes at Segregated Road
|
Scenario: Turn Lanes at Segregated Road
|
||||||
@@ -347,7 +347,7 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,e | road,turn,turn | depart,turn right,arrive | ,none:false right:true, |
|
| a,e | road,turn,turn | depart,turn right,arrive | ,none:false right:true, |
|
||||||
| a,d | road,road | depart,arrive | , |
|
| a,d | road,road | depart,arrive | ;none:true right:false, |
|
||||||
|
|
||||||
@2654 @previous-lanes
|
@2654 @previous-lanes
|
||||||
Scenario: Turn Lanes Given earlier than actual turn
|
Scenario: Turn Lanes Given earlier than actual turn
|
||||||
@@ -369,10 +369,10 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,k | road,second-turn,second-turn | depart,turn right,arrive | ,none:false right:true, |
|
| a,k | road,second-turn,second-turn | depart,turn right,arrive | ;,none:false right:true, |
|
||||||
| a,i | road,road | depart,arrive | , |
|
| a,i | road,road | depart,arrive | ;;none:true right:false, |
|
||||||
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ,left:true none:false, |
|
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ;,left:true none:false, |
|
||||||
| i,a | road,road | depart,arrive | , |
|
| i,a | road,road | depart,arrive | ;;left:false none:true, |
|
||||||
|
|
||||||
@previous-lanes
|
@previous-lanes
|
||||||
Scenario: Passing a one-way street
|
Scenario: Passing a one-way street
|
||||||
@@ -391,7 +391,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
|
| a,f | road,turn,turn | depart,turn left,arrive | ;left:true straight:false,left:true straight:false, |
|
||||||
|
|
||||||
@partition-lanes
|
@partition-lanes
|
||||||
Scenario: Passing a one-way street, partly pulled back lanes
|
Scenario: Passing a one-way street, partly pulled back lanes
|
||||||
@@ -412,8 +412,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight;right:false, |
|
| a,f | road,turn,turn | depart,turn left,arrive | ;left:true straight;right:false,left:true straight;right:false, |
|
||||||
| a,d | road,road | depart,arrive | , |
|
| a,d | road,road | depart,arrive | ;left:false straight;right:true;left:false straight;right:true, |
|
||||||
| a,g | road,right,right | depart,turn right,arrive | ,left:false straight;right:true, |
|
| a,g | road,right,right | depart,turn right,arrive | ,left:false straight;right:true, |
|
||||||
|
|
||||||
@partition-lanes @previous-lanes
|
@partition-lanes @previous-lanes
|
||||||
@@ -435,7 +435,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true right:false, |
|
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true right:false;left:true right:false, |
|
||||||
| a,g | road,right,right | depart,turn right,arrive | ,left:false right:true, |
|
| a,g | road,right,right | depart,turn right,arrive | ,left:false right:true, |
|
||||||
|
|
||||||
@todo @partition-lanes @previous-lanes
|
@todo @partition-lanes @previous-lanes
|
||||||
@@ -484,7 +484,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,d | road,road | depart,arrive | , |
|
| a,d | road,road | depart,arrive | ;straight:true right:false, |
|
||||||
| a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
| a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
||||||
|
|
||||||
@todo @roundabout
|
@todo @roundabout
|
||||||
@@ -555,8 +555,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,g | road,cross,cross | depart,turn left,arrive | ,left:true left:true straight:false straight:false right:false, |
|
| a,g | road,cross,cross | depart,turn left,arrive | ,left:true left:true straight:false straight:false right:false;left:true left:true straight:false straight:false right:false, |
|
||||||
| a,e | road,road | depart,arrive | , |
|
| a,e | road,road | depart,arrive | ;left:false left:false straight:true straight:true right:false;left:false left:false straight:true straight:true right:false, |
|
||||||
|
|
||||||
#NEEDS TO BE INVESTIGATED. Turn restriction shouldn't be here. See #2867
|
#NEEDS TO BE INVESTIGATED. Turn restriction shouldn't be here. See #2867
|
||||||
@reverse @previous-lanes
|
@reverse @previous-lanes
|
||||||
@@ -590,10 +590,10 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | turns | lanes |
|
| from | to | bearings | route | turns | lanes |
|
||||||
| a | g | 180,180 180,180 | road,cross,cross | depart,turn right,arrive | ,none:false straight:false right:true, |
|
| a | g | 180,180 180,180 | road,cross,cross | depart,turn right,arrive | ;none:false straight:false right:true,none:false straight:false right:true, |
|
||||||
| a | h | 180,180 180,180 | road,cross,cross | depart,turn left,arrive | ,none:true straight:false right:false, |
|
| a | h | 180,180 180,180 | road,cross,cross | depart,turn left,arrive | ;none:true straight:false right:false,none:true straight:false right:false;, |
|
||||||
| a | i | 180,180 180,180 | road,road | depart,arrive | , |
|
| a | i | 180,180 180,180 | road,road | depart,arrive | ;none:true straight:true right:false;none:true straight:true right:false, |
|
||||||
| b | a | 90,2 270,2 | road,road,road | depart,continue uturn,arrive | ,none:true straight:false right:false, |
|
| b | a | 90,2 270,2 | road,road,road | depart,continue uturn,arrive | ,none:true straight:false right:false;, |
|
||||||
|
|
||||||
@reverse
|
@reverse
|
||||||
Scenario: Segregated Intersection Merges With Lanes
|
Scenario: Segregated Intersection Merges With Lanes
|
||||||
@@ -681,7 +681,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,d | road,road | depart,arrive | , |
|
| a,d | road,road | depart,arrive | ;straight:true straight:true straight;slight right:true slight right:false, |
|
||||||
| a,e | road,cross,cross | depart,turn slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
| a,e | road,cross,cross | depart,turn slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
||||||
|
|
||||||
@ramp
|
@ramp
|
||||||
@@ -700,7 +700,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,d | hwy,hwy | depart,arrive | , |
|
| a,d | hwy,hwy | depart,arrive | ;straight:true straight:true straight;slight right:true slight right:false, |
|
||||||
| a,e | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
| a,e | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
@@ -745,7 +745,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,c | hwy,hwy | depart,arrive | , |
|
| a,c | hwy,hwy | depart,arrive | ;straight:true straight:true slight right:false, |
|
||||||
| a,d | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false slight right:true, |
|
| a,d | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false slight right:true, |
|
||||||
|
|
||||||
@reverse
|
@reverse
|
||||||
@@ -767,7 +767,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false,|
|
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false;,|
|
||||||
|
|
||||||
@reverse
|
@reverse
|
||||||
Scenario: Reverse Lane in Segregated Road with none
|
Scenario: Reverse Lane in Segregated Road with none
|
||||||
@@ -788,7 +788,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
|
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false;, |
|
||||||
|
|
||||||
@reverse
|
@reverse
|
||||||
Scenario: Reverse Lane in Segregated Road with none, Service Turn Prior
|
Scenario: Reverse Lane in Segregated Road with none, Service Turn Prior
|
||||||
@@ -811,7 +811,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
|
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false;, |
|
||||||
|
|
||||||
@simple
|
@simple
|
||||||
Scenario: Don't collapse everything to u-turn / too wide
|
Scenario: Don't collapse everything to u-turn / too wide
|
||||||
@@ -874,8 +874,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,j | on,xbcj | depart,arrive | , |
|
| a,j | on,xbcj | depart,arrive | ;;none:true slight right:false, |
|
||||||
| a,i | on,off,off | depart,turn right,arrive | ,none:false slight right:true, |
|
| a,i | on,off,off | depart,turn right,arrive | ;,none:false slight right:true, |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=17/52.47414/13.35712
|
#http://www.openstreetmap.org/#map=17/52.47414/13.35712
|
||||||
@todo @ramp @2645
|
@todo @ramp @2645
|
||||||
@@ -930,7 +930,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| x,d | road,road | depart,arrive | , |
|
| x,d | road,road | depart,arrive | ;straight;right:true;straight;right:true, |
|
||||||
|
|
||||||
@partition-lanes
|
@partition-lanes
|
||||||
Scenario: Partitioned turn, Slight Curve - maxspeed
|
Scenario: Partitioned turn, Slight Curve - maxspeed
|
||||||
@@ -954,7 +954,7 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes | locations |
|
| waypoints | route | turns | lanes | locations |
|
||||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||||
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e |
|
| a,e | road,cross,cross | depart,end of road left,arrive | ;left:true right:false,left:true right:false, | a,c,e |
|
||||||
|
|
||||||
Scenario: Partitioned turn, Slight Curve
|
Scenario: Partitioned turn, Slight Curve
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -977,7 +977,7 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes | locations |
|
| waypoints | route | turns | lanes | locations |
|
||||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||||
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e |
|
| a,e | road,cross,cross | depart,end of road left,arrive | ;left:true right:false,left:true right:false, | a,c,e |
|
||||||
|
|
||||||
Scenario: Lane Parsing Issue #2694
|
Scenario: Lane Parsing Issue #2694
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -1193,7 +1193,7 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
|
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
|
||||||
| a,c | road,road | depart,arrive | , |
|
| a,c | road,road | depart,arrive | ;left:false none:true none:true, |
|
||||||
|
|
||||||
@3379
|
@3379
|
||||||
Scenario: Don't Turn through potential through lanes
|
Scenario: Don't Turn through potential through lanes
|
||||||
@@ -1214,4 +1214,33 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
|
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
|
||||||
| a,c | road,road | depart,arrive | , |
|
| a,c | road,road | depart,arrive | ;none:true none:true right:false, |
|
||||||
|
|
||||||
|
@4189
|
||||||
|
Scenario: U-turn after a traffic light
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
j k
|
||||||
|
: :
|
||||||
|
f---g-h-i
|
||||||
|
: :
|
||||||
|
a-b-c-d-e
|
||||||
|
: :
|
||||||
|
l m
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| b | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | lanes | turn:lanes | oneway |
|
||||||
|
| ab | road1 | 3 | left\|through\|through;right | yes |
|
||||||
|
| bcde | road1 | 2 | | yes |
|
||||||
|
| ihgf | road1 | 2 | | yes |
|
||||||
|
| jgcl | road2 | 2 | | yes |
|
||||||
|
| mdhk | road2 | 2 | | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes | locations |
|
||||||
|
| a,f | road1,road1,road1 | depart,continue uturn,arrive | ;left:false straight:true straight;right:false,left:true straight:false straight;right:false;;, | a,d,f |
|
||||||
|
|||||||
@@ -1319,3 +1319,33 @@ Feature: Simple Turns
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | ref | turns |
|
| waypoints | route | ref | turns |
|
||||||
| a,h | Road,,, | C 42,,C 42,C 42 | depart,on ramp right,merge slight left,arrive |
|
| a,h | Road,,, | C 42,,C 42,C 42 | depart,on ramp right,merge slight left,arrive |
|
||||||
|
|
||||||
|
Scenario: End of road, T-intersection, no obvious turn, only one road allowed
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
d
|
||||||
|
.
|
||||||
|
a . b . . c
|
||||||
|
' .
|
||||||
|
'e
|
||||||
|
.
|
||||||
|
f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway | ref |
|
||||||
|
| ab | primary | | B 191 |
|
||||||
|
| bc | primary | | B 191 |
|
||||||
|
| be | primary_link | yes | |
|
||||||
|
| dc | primary | | B 4;B 191 |
|
||||||
|
| ce | primary | | B 4 |
|
||||||
|
| ef | primary | | B 4 |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | bc | ce | c | no_right_turn |
|
||||||
|
| restriction | be | ef | e | only_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | ab,dc,dc | depart,turn left,arrive |
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
# Broken see issue #4065
|
@contract @options @edge-weight-updates-over-factor
|
||||||
@contract @options @edge-weight-updates-over-factor @todo
|
|
||||||
Feature: osrm-contract command line option: edge-weight-updates-over-factor
|
Feature: osrm-contract command line option: edge-weight-updates-over-factor
|
||||||
|
|
||||||
Background: Log edge weight updates over given factor
|
Background: Log edge weight updates over given factor
|
||||||
@@ -22,6 +21,7 @@ Feature: osrm-contract command line option: edge-weight-updates-over-factor
|
|||||||
|
|
||||||
Scenario: Logging weight with updates over factor of 2, long segment
|
Scenario: Logging weight with updates over factor of 2, long segment
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||||
|
And the data has been partitioned
|
||||||
When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}"
|
When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}"
|
||||||
Then stderr should not contain "Speed values were used to update 2 segment(s)"
|
Then stderr should not contain "Speed values were used to update 2 segment(s)"
|
||||||
And stderr should contain "Segment: 1,2"
|
And stderr should contain "Segment: 1,2"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ module.exports = function () {
|
|||||||
outputRow[rate] = result[direction].status ?
|
outputRow[rate] = result[direction].status ?
|
||||||
result[direction].status.toString() : '';
|
result[direction].status.toString() : '';
|
||||||
break;
|
break;
|
||||||
case /^\d+$/.test(want):
|
case /^\d+(\.\d+){0,1}$/.test(want):
|
||||||
if (result[direction].rate !== undefined && !isNaN(result[direction].rate)) {
|
if (result[direction].rate !== undefined && !isNaN(result[direction].rate)) {
|
||||||
outputRow[rate] = result[direction].rate.toString();
|
outputRow[rate] = result[direction].rate.toString();
|
||||||
} else {
|
} else {
|
||||||
@@ -135,7 +135,7 @@ module.exports = function () {
|
|||||||
if (r.route.split(',')[0] === util.format('w%d', i)) {
|
if (r.route.split(',')[0] === util.format('w%d', i)) {
|
||||||
r.time = r.json.routes[0].duration;
|
r.time = r.json.routes[0].duration;
|
||||||
r.distance = r.json.routes[0].distance;
|
r.distance = r.json.routes[0].distance;
|
||||||
r.rate = Math.round(r.distance / r.json.routes[0].weight);
|
r.rate = Math.round(r.distance / r.json.routes[0].weight * 10) / 10.;
|
||||||
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
||||||
|
|
||||||
// use the mode of the first step of the route
|
// use the mode of the first step of the route
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ok = true,
|
var ok = true,
|
||||||
encodedResult = '',
|
encodedResult = '';
|
||||||
extendedTarget = '';
|
|
||||||
|
|
||||||
if (json.trips) row.trips.split(',').forEach((sub, si) => {
|
if (json.trips) row.trips.split(',').forEach((sub, si) => {
|
||||||
if (si >= subTrips.length) {
|
if (si >= subTrips.length) {
|
||||||
@@ -98,11 +97,9 @@ module.exports = function () {
|
|||||||
outNode = subTrips[si][ni];
|
outNode = subTrips[si][ni];
|
||||||
if (this.FuzzyMatch.matchLocation(outNode, node)) {
|
if (this.FuzzyMatch.matchLocation(outNode, node)) {
|
||||||
encodedResult += sub[ni];
|
encodedResult += sub[ni];
|
||||||
extendedTarget += sub[ni];
|
|
||||||
} else {
|
} else {
|
||||||
ok = false;
|
ok = false;
|
||||||
encodedResult += util.format('? [%s,%s]', outNode[0], outNode[1]);
|
encodedResult += util.format('? [%s,%s]', outNode[0], outNode[1]);
|
||||||
extendedTarget += util.format('%s [%d,%d]', sub[ni], node.lat, node.lon);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-11
@@ -155,6 +155,10 @@ module.exports = function () {
|
|||||||
return this.extractInstructionList(instructions, s => s.destinations || '');
|
return this.extractInstructionList(instructions, s => s.destinations || '');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.exitsList = (instructions) => {
|
||||||
|
return this.extractInstructionList(instructions, s => s.exits || '');
|
||||||
|
};
|
||||||
|
|
||||||
this.reverseBearing = (bearing) => {
|
this.reverseBearing = (bearing) => {
|
||||||
if (bearing >= 180)
|
if (bearing >= 180)
|
||||||
return bearing - 180.;
|
return bearing - 180.;
|
||||||
@@ -167,6 +171,24 @@ module.exports = function () {
|
|||||||
('out' in s.intersections[0] ? s.intersections[0].bearings[s.intersections[0].out] : 0));
|
('out' in s.intersections[0] ? s.intersections[0].bearings[s.intersections[0].out] : 0));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.lanesList = (instructions) => {
|
||||||
|
return this.extractInstructionList(instructions, s => {
|
||||||
|
return s.intersections.map( i => {
|
||||||
|
if(i.lanes)
|
||||||
|
{
|
||||||
|
return i.lanes.map( l => {
|
||||||
|
let indications = l.indications.join(';');
|
||||||
|
return indications + ':' + (l.valid ? 'true' : 'false');
|
||||||
|
}).join(' ');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}).join(';');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
this.approachList = (instructions) => {
|
this.approachList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, s => s.approaches || '');
|
return this.extractInstructionList(instructions, s => s.approaches || '');
|
||||||
};
|
};
|
||||||
@@ -193,17 +215,6 @@ module.exports = function () {
|
|||||||
return instructions.tracepoints.map(t => t.alternatives_count.toString()).join(',');
|
return instructions.tracepoints.map(t => t.alternatives_count.toString()).join(',');
|
||||||
};
|
};
|
||||||
|
|
||||||
this.lanesList = (instructions) => {
|
|
||||||
return this.extractInstructionList(instructions, instruction => {
|
|
||||||
if( 'lanes' in instruction.intersections[0] )
|
|
||||||
{
|
|
||||||
return instruction.intersections[0].lanes.map( p => { return (p.indications).join(';') + ':' + p.valid; } ).join(' ');
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.turnList = (instructions) => {
|
this.turnList = (instructions) => {
|
||||||
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
|
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
|
||||||
.map(v => {
|
.map(v => {
|
||||||
@@ -256,6 +267,10 @@ module.exports = function () {
|
|||||||
return this.extractInstructionList(instructions, s => s.mode);
|
return this.extractInstructionList(instructions, s => s.mode);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.classesList = (instructions) => {
|
||||||
|
return this.extractInstructionList(instructions, s => '[' + s.intersections.map(i => '(' + (i.classes ? i.classes.join(',') : '') + ')').join(',') + ']');
|
||||||
|
};
|
||||||
|
|
||||||
this.timeList = (instructions) => {
|
this.timeList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, s => s.duration + 's');
|
return this.extractInstructionList(instructions, s => s.duration + 's');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ module.exports = function () {
|
|||||||
var afterRequest = (err, res, body) => {
|
var afterRequest = (err, res, body) => {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
if (body && body.length) {
|
if (body && body.length) {
|
||||||
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
let destinations, exits, pronunciations, instructions, refs, bearings, turns, modes, times, classes,
|
||||||
distances, summary, intersections, lanes, locations, annotation, weight_name, weights, approaches;
|
distances, summary, intersections, lanes, locations, annotation, weight_name, weights, approaches;
|
||||||
|
|
||||||
let json = JSON.parse(body);
|
let json = JSON.parse(body);
|
||||||
@@ -48,10 +48,12 @@ module.exports = function () {
|
|||||||
pronunciations = this.pronunciationList(json.routes[0]);
|
pronunciations = this.pronunciationList(json.routes[0]);
|
||||||
refs = this.refList(json.routes[0]);
|
refs = this.refList(json.routes[0]);
|
||||||
destinations = this.destinationsList(json.routes[0]);
|
destinations = this.destinationsList(json.routes[0]);
|
||||||
|
exits = this.exitsList(json.routes[0]);
|
||||||
bearings = this.bearingList(json.routes[0]);
|
bearings = this.bearingList(json.routes[0]);
|
||||||
turns = this.turnList(json.routes[0]);
|
turns = this.turnList(json.routes[0]);
|
||||||
intersections = this.intersectionList(json.routes[0]);
|
intersections = this.intersectionList(json.routes[0]);
|
||||||
modes = this.modeList(json.routes[0]);
|
modes = this.modeList(json.routes[0]);
|
||||||
|
classes = this.classesList(json.routes[0]);
|
||||||
times = this.timeList(json.routes[0]);
|
times = this.timeList(json.routes[0]);
|
||||||
distances = this.distanceList(json.routes[0]);
|
distances = this.distanceList(json.routes[0]);
|
||||||
lanes = this.lanesList(json.routes[0]);
|
lanes = this.lanesList(json.routes[0]);
|
||||||
@@ -173,10 +175,12 @@ module.exports = function () {
|
|||||||
putValue('bearing', bearings);
|
putValue('bearing', bearings);
|
||||||
putValue('turns', turns);
|
putValue('turns', turns);
|
||||||
putValue('modes', modes);
|
putValue('modes', modes);
|
||||||
|
putValue('classes', classes);
|
||||||
putValue('times', times);
|
putValue('times', times);
|
||||||
putValue('distances', distances);
|
putValue('distances', distances);
|
||||||
putValue('pronunciations', pronunciations);
|
putValue('pronunciations', pronunciations);
|
||||||
putValue('destinations', destinations);
|
putValue('destinations', destinations);
|
||||||
|
putValue('exits', exits);
|
||||||
putValue('weight_name', weight_name);
|
putValue('weight_name', weight_name);
|
||||||
putValue('weights', weights);
|
putValue('weights', weights);
|
||||||
putValue('weight', weight);
|
putValue('weight', weight);
|
||||||
@@ -243,7 +247,7 @@ module.exports = function () {
|
|||||||
} else if (row.waypoints) {
|
} else if (row.waypoints) {
|
||||||
row.waypoints.split(',').forEach((n) => {
|
row.waypoints.split(',').forEach((n) => {
|
||||||
var node = this.findNodeByName(n.trim());
|
var node = this.findNodeByName(n.trim());
|
||||||
if (!node) return cb(new Error('*** unknown waypoint node "%s"', n.trim()));
|
if (!node) return cb(new Error(util.format('*** unknown waypoint node "%s"', n.trim())));
|
||||||
waypoints.push(node);
|
waypoints.push(node);
|
||||||
});
|
});
|
||||||
got.waypoints = row.waypoints;
|
got.waypoints = row.waypoints;
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
@routing @speed @annotations @turn_penalty
|
||||||
|
Feature: Annotations
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "turnbot"
|
||||||
|
Given a grid size of 100 meters
|
||||||
|
|
||||||
|
Scenario: Ensure that turn penalties aren't included in annotations
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
h i
|
||||||
|
j k l m
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the query options
|
||||||
|
| annotations | duration,speed,weight |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| hk | residential |
|
||||||
|
| il | residential |
|
||||||
|
| jk | residential |
|
||||||
|
| lk | residential |
|
||||||
|
| lm | residential |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | a:speed | a:weight |
|
||||||
|
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 |
|
||||||
|
| i | m | il,lm,lm | 6.7:6.7 | 15:15 |
|
||||||
|
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 |
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
@routing @approach
|
@routing @approach @testbot
|
||||||
Feature: Approach parameter
|
Feature: Approach parameter
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "testbot"
|
||||||
And a grid size of 10 meters
|
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
|
||||||
@@ -358,8 +358,8 @@ Feature: Basic Map Matching
|
|||||||
| trace | matchings | alternatives |
|
| trace | matchings | alternatives |
|
||||||
| abcdef | abcde | 0,0,0,0,1,1 |
|
| abcdef | abcde | 0,0,0,0,1,1 |
|
||||||
|
|
||||||
Scenario: Testbot - Speed greater than speed threshhold
|
Scenario: Testbot - Speed greater than speed threshold
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 100 meters
|
||||||
Given the query options
|
Given the query options
|
||||||
| geometries | geojson |
|
| geometries | geojson |
|
||||||
|
|
||||||
@@ -379,8 +379,8 @@ Feature: Basic Map Matching
|
|||||||
| trace | timestamps | matchings |
|
| trace | timestamps | matchings |
|
||||||
| abcd | 0 1 2 3 | ab,cd |
|
| abcd | 0 1 2 3 | ab,cd |
|
||||||
|
|
||||||
Scenario: Testbot - Speed less than speed threshhold
|
Scenario: Testbot - Speed less than speed threshold
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 100 meters
|
||||||
Given the query options
|
Given the query options
|
||||||
| geometries | geojson |
|
| geometries | geojson |
|
||||||
|
|
||||||
@@ -397,6 +397,28 @@ Feature: Basic Map Matching
|
|||||||
| trace | timestamps | matchings |
|
| trace | timestamps | matchings |
|
||||||
| abcd | 0 1 2 3 | abcd |
|
| abcd | 0 1 2 3 | abcd |
|
||||||
|
|
||||||
|
Scenario: Testbot - Huge gap in the coordinates
|
||||||
|
Given a grid size of 100 meters
|
||||||
|
Given the query options
|
||||||
|
| geometries | geojson |
|
||||||
|
| gaps | ignore |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c d ---- x
|
||||||
|
|
|
||||||
|
|
|
||||||
|
y ---- z ---- efjk
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abcdxyzefjk | no |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | timestamps | matchings |
|
||||||
|
| abcdefjk | 0 1 2 3 50 51 52 53 | abcdefjk |
|
||||||
|
|
||||||
# Regression test 1 for issue 3176
|
# Regression test 1 for issue 3176
|
||||||
Scenario: Testbot - multiple segments: properly expose OSM IDs
|
Scenario: Testbot - multiple segments: properly expose OSM IDs
|
||||||
Given the query options
|
Given the query options
|
||||||
|
|||||||
@@ -48,12 +48,18 @@ Feature: Multi level routing
|
|||||||
│ │ │ │
|
│ │ │ │
|
||||||
l───k───p───o
|
l───k───p───o
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| i | traffic_signals |
|
||||||
|
| n | traffic_signals |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway |
|
| nodes | highway |
|
||||||
| abcda | primary |
|
| abcda | primary |
|
||||||
| efghe | primary |
|
| efghe | primary |
|
||||||
| ijkli | primary |
|
| ijkli | primary |
|
||||||
| nmop | primary |
|
| mnopm | primary |
|
||||||
| cm | primary |
|
| cm | primary |
|
||||||
| hj | primary |
|
| hj | primary |
|
||||||
| kp | primary |
|
| kp | primary |
|
||||||
@@ -61,9 +67,22 @@ Feature: Multi level routing
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | b | abcda,abcda | 20s |
|
| a | b | abcda,abcda | 20s |
|
||||||
| a | f | abcda,cm,nmop,kp,ijkli,hj,efghe,efghe | 257.7s |
|
| a | f | abcda,cm,mnopm,kp,ijkli,hj,efghe,efghe | 229.4s |
|
||||||
|
| a | l | abcda,cm,mnopm,kp,ijkli,ijkli | 144.7s |
|
||||||
|
| a | o | abcda,cm,mnopm,mnopm,mnopm | 124.7s |
|
||||||
|
| f | l | efghe,hj,ijkli,ijkli,ijkli | 124.7s |
|
||||||
|
| f | o | efghe,hj,ijkli,kp,mnopm,mnopm | 144.7s |
|
||||||
|
| l | o | ijkli,kp,mnopm,mnopm | 60s |
|
||||||
| c | m | cm,cm | 44.7s |
|
| c | m | cm,cm | 44.7s |
|
||||||
|
|
||||||
|
When I request a travel time matrix I should get
|
||||||
|
| | a | f | l | o |
|
||||||
|
| a | 0 | 229.4 | 144.7 | 124.7 |
|
||||||
|
| f | 229.4 | 0 | 124.7 | 144.7 |
|
||||||
|
| l | 144.7 | 124.7 | 0 | 60 |
|
||||||
|
| o | 124.7 | 144.7 | 60 | 0 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Testbot - Multi level routing: horizontal road
|
Scenario: Testbot - Multi level routing: horizontal road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -127,3 +146,44 @@ Feature: Multi level routing
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | k | abcda,ch,hf,fi,ijkli,ijkli | 724.3s |
|
| a | k | abcda,ch,hf,fi,ijkli,ijkli | 724.3s |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Testbot - Edge case for matrix plugin with
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a───b
|
||||||
|
│ ╳ │
|
||||||
|
d───c
|
||||||
|
│ │
|
||||||
|
e f
|
||||||
|
│ ╱ │
|
||||||
|
h g───i
|
||||||
|
"""
|
||||||
|
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 5,16,64"
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| e | traffic_signals |
|
||||||
|
| g | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | maxspeed |
|
||||||
|
| abcda | primary | |
|
||||||
|
| ac | primary | |
|
||||||
|
| db | primary | |
|
||||||
|
| deh | primary | |
|
||||||
|
| cfg | primary | |
|
||||||
|
| ef | primary | 1 |
|
||||||
|
| eg | primary | 1 |
|
||||||
|
| hf | primary | 1 |
|
||||||
|
| hg | primary | 1 |
|
||||||
|
| gi | primary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | time |
|
||||||
|
| h | i | deh,abcda,cfg,gi,gi | 134s |
|
||||||
|
|
||||||
|
When I request a travel time matrix I should get
|
||||||
|
| | h | i |
|
||||||
|
| h | 0 | 134 |
|
||||||
|
| i | 134 | 0 |
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Feature: Testbot - Check assigning nil values
|
|||||||
result.name = nil
|
result.name = nil
|
||||||
result.ref = nil
|
result.ref = nil
|
||||||
result.destinations = nil
|
result.destinations = nil
|
||||||
|
result.exits = nil
|
||||||
result.pronunciation = nil
|
result.pronunciation = nil
|
||||||
result.turn_lanes_forward = nil
|
result.turn_lanes_forward = nil
|
||||||
result.turn_lanes_backward = nil
|
result.turn_lanes_backward = nil
|
||||||
|
|||||||
@@ -65,16 +65,9 @@ class Contractor
|
|||||||
std::vector<EdgeWeight> &&node_weights,
|
std::vector<EdgeWeight> &&node_weights,
|
||||||
std::vector<bool> &is_core_node,
|
std::vector<bool> &is_core_node,
|
||||||
std::vector<float> &inout_node_levels) const;
|
std::vector<float> &inout_node_levels) const;
|
||||||
void WriteCoreNodeMarker(std::vector<bool> &&is_core_node) const;
|
|
||||||
void WriteContractedGraph(unsigned number_of_edge_based_nodes,
|
|
||||||
util::DeallocatingVector<QueryEdge> contracted_edge_list);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ContractorConfig config;
|
ContractorConfig config;
|
||||||
|
|
||||||
EdgeID LoadEdgeExpandedGraph(const ContractorConfig &config,
|
|
||||||
std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
|
||||||
std::vector<EdgeWeight> &node_weights);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,27 @@ 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>
|
template <typename QueryGraphT>
|
||||||
|
|||||||
@@ -14,8 +14,6 @@
|
|||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
#include <stxxl/vector>
|
|
||||||
|
|
||||||
#include <tbb/enumerable_thread_specific.h>
|
#include <tbb/enumerable_thread_specific.h>
|
||||||
#include <tbb/parallel_for.h>
|
#include <tbb/parallel_for.h>
|
||||||
#include <tbb/parallel_sort.h>
|
#include <tbb/parallel_sort.h>
|
||||||
@@ -25,6 +23,10 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#if USE_STXXL_LIBRARY
|
||||||
|
#include <stxxl/vector>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace contractor
|
namespace contractor
|
||||||
@@ -33,6 +35,12 @@ namespace contractor
|
|||||||
class GraphContractor
|
class GraphContractor
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
#if USE_STXXL_LIBRARY
|
||||||
|
template <typename T> using ExternalVector = stxxl::vector<T>;
|
||||||
|
#else
|
||||||
|
template <typename T> using ExternalVector = std::vector<T>;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ContractorThreadData
|
struct ContractorThreadData
|
||||||
{
|
{
|
||||||
ContractorDijkstra dijkstra;
|
ContractorDijkstra dijkstra;
|
||||||
@@ -91,8 +99,8 @@ class GraphContractor
|
|||||||
|
|
||||||
GraphContractor(int nodes,
|
GraphContractor(int nodes,
|
||||||
std::vector<ContractorEdge> edges,
|
std::vector<ContractorEdge> edges,
|
||||||
std::vector<float> &&node_levels_,
|
std::vector<float> node_levels_,
|
||||||
std::vector<EdgeWeight> &&node_weights_);
|
std::vector<EdgeWeight> node_weights_);
|
||||||
|
|
||||||
/* Flush all data from the contraction to disc and reorder stuff for better locality */
|
/* Flush all data from the contraction to disc and reorder stuff for better locality */
|
||||||
void FlushDataAndRebuildContractorGraph(ThreadDataContainer &thread_data_list,
|
void FlushDataAndRebuildContractorGraph(ThreadDataContainer &thread_data_list,
|
||||||
@@ -101,12 +109,14 @@ class GraphContractor
|
|||||||
|
|
||||||
void Run(double core_factor = 1.0);
|
void Run(double core_factor = 1.0);
|
||||||
|
|
||||||
void GetCoreMarker(std::vector<bool> &out_is_core_node);
|
std::vector<bool> GetCoreMarker();
|
||||||
|
|
||||||
void GetNodeLevels(std::vector<float> &out_node_levels);
|
std::vector<float> GetNodeLevels();
|
||||||
|
|
||||||
template <class Edge> inline void GetEdges(util::DeallocatingVector<Edge> &edges)
|
template <class Edge> inline util::DeallocatingVector<Edge> GetEdges()
|
||||||
{
|
{
|
||||||
|
util::DeallocatingVector<Edge> edges;
|
||||||
|
|
||||||
util::UnbufferedLog log;
|
util::UnbufferedLog log;
|
||||||
log << "Getting edges of minimized graph ";
|
log << "Getting edges of minimized graph ";
|
||||||
util::Percent p(log, contractor_graph->GetNumberOfNodes());
|
util::Percent p(log, contractor_graph->GetNumberOfNodes());
|
||||||
@@ -161,6 +171,13 @@ class GraphContractor
|
|||||||
|
|
||||||
edges.append(external_edge_list.begin(), external_edge_list.end());
|
edges.append(external_edge_list.begin(), external_edge_list.end());
|
||||||
external_edge_list.clear();
|
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:
|
private:
|
||||||
@@ -392,7 +409,7 @@ class GraphContractor
|
|||||||
bool Bias(const NodeID a, const NodeID b) const;
|
bool Bias(const NodeID a, const NodeID b) const;
|
||||||
|
|
||||||
std::shared_ptr<ContractorGraph> contractor_graph;
|
std::shared_ptr<ContractorGraph> contractor_graph;
|
||||||
stxxl::vector<QueryEdge> external_edge_list;
|
ExternalVector<QueryEdge> external_edge_list;
|
||||||
std::vector<NodeID> orig_node_id_from_new_node_id_map;
|
std::vector<NodeID> orig_node_id_from_new_node_id_map;
|
||||||
std::vector<float> node_levels;
|
std::vector<float> node_levels;
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class CellCustomizer
|
|||||||
struct HeapData
|
struct HeapData
|
||||||
{
|
{
|
||||||
bool from_clique;
|
bool from_clique;
|
||||||
|
EdgeDuration duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -41,31 +42,41 @@ class CellCustomizer
|
|||||||
{
|
{
|
||||||
std::unordered_set<NodeID> destinations_set(destinations.begin(), destinations.end());
|
std::unordered_set<NodeID> destinations_set(destinations.begin(), destinations.end());
|
||||||
heap.Clear();
|
heap.Clear();
|
||||||
heap.Insert(source, 0, {false});
|
heap.Insert(source, 0, {false, 0});
|
||||||
|
|
||||||
// explore search space
|
// explore search space
|
||||||
while (!heap.Empty() && !destinations_set.empty())
|
while (!heap.Empty() && !destinations_set.empty())
|
||||||
{
|
{
|
||||||
const NodeID node = heap.DeleteMin();
|
const NodeID node = heap.DeleteMin();
|
||||||
const EdgeWeight weight = heap.GetKey(node);
|
const EdgeWeight weight = heap.GetKey(node);
|
||||||
|
const EdgeDuration duration = heap.GetData(node).duration;
|
||||||
|
|
||||||
if (level == 1)
|
if (level == 1)
|
||||||
RelaxNode<true>(graph, cells, heap, level, node, weight);
|
RelaxNode<true>(graph, cells, heap, level, node, weight, duration);
|
||||||
else
|
else
|
||||||
RelaxNode<false>(graph, cells, heap, level, node, weight);
|
RelaxNode<false>(graph, cells, heap, level, node, weight, duration);
|
||||||
|
|
||||||
destinations_set.erase(node);
|
destinations_set.erase(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill a map of destination nodes to placeholder pointers
|
// fill a map of destination nodes to placeholder pointers
|
||||||
auto destination_iter = destinations.begin();
|
auto weights = cell.GetOutWeight(source);
|
||||||
for (auto &weight : cell.GetOutWeight(source))
|
auto durations = cell.GetOutDuration(source);
|
||||||
|
for (auto &destination : destinations)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(destination_iter != destinations.end());
|
BOOST_ASSERT(!weights.empty());
|
||||||
const auto destination = *destination_iter++;
|
BOOST_ASSERT(!durations.empty());
|
||||||
weight =
|
|
||||||
heap.WasInserted(destination) ? heap.GetKey(destination) : INVALID_EDGE_WEIGHT;
|
const bool inserted = heap.WasInserted(destination);
|
||||||
|
weights.front() = inserted ? heap.GetKey(destination) : INVALID_EDGE_WEIGHT;
|
||||||
|
durations.front() =
|
||||||
|
inserted ? heap.GetData(destination).duration : MAXIMAL_EDGE_DURATION;
|
||||||
|
|
||||||
|
weights.advance_begin(1);
|
||||||
|
durations.advance_begin(1);
|
||||||
}
|
}
|
||||||
|
BOOST_ASSERT(weights.empty());
|
||||||
|
BOOST_ASSERT(durations.empty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +105,8 @@ class CellCustomizer
|
|||||||
Heap &heap,
|
Heap &heap,
|
||||||
LevelID level,
|
LevelID level,
|
||||||
NodeID node,
|
NodeID node,
|
||||||
EdgeWeight weight) const
|
EdgeWeight weight,
|
||||||
|
EdgeDuration duration) const
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(heap.WasInserted(node));
|
BOOST_ASSERT(heap.WasInserted(node));
|
||||||
|
|
||||||
@@ -113,24 +125,26 @@ class CellCustomizer
|
|||||||
auto subcell_id = partition.GetCell(level - 1, node);
|
auto subcell_id = partition.GetCell(level - 1, node);
|
||||||
auto subcell = cells.GetCell(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();
|
||||||
for (auto subcell_weight : subcell.GetOutWeight(node))
|
for (auto subcell_weight : subcell.GetOutWeight(node))
|
||||||
{
|
{
|
||||||
if (subcell_weight != INVALID_EDGE_WEIGHT)
|
if (subcell_weight != INVALID_EDGE_WEIGHT)
|
||||||
{
|
{
|
||||||
const NodeID to = *subcell_destination;
|
const NodeID to = *subcell_destination;
|
||||||
const EdgeWeight to_weight = subcell_weight + weight;
|
const EdgeWeight to_weight = weight + subcell_weight;
|
||||||
if (!heap.WasInserted(to))
|
if (!heap.WasInserted(to))
|
||||||
{
|
{
|
||||||
heap.Insert(to, to_weight, {true});
|
heap.Insert(to, to_weight, {true, duration + *subcell_duration});
|
||||||
}
|
}
|
||||||
else if (to_weight < heap.GetKey(to))
|
else if (to_weight < heap.GetKey(to))
|
||||||
{
|
{
|
||||||
heap.DecreaseKey(to, to_weight);
|
heap.DecreaseKey(to, to_weight);
|
||||||
heap.GetData(to).from_clique = true;
|
heap.GetData(to) = {true, duration + *subcell_duration};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
++subcell_destination;
|
++subcell_destination;
|
||||||
|
++subcell_duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,15 +158,15 @@ class CellCustomizer
|
|||||||
(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 = data.weight + weight;
|
const EdgeWeight to_weight = weight + data.weight;
|
||||||
if (!heap.WasInserted(to))
|
if (!heap.WasInserted(to))
|
||||||
{
|
{
|
||||||
heap.Insert(to, to_weight, {false});
|
heap.Insert(to, to_weight, {false, duration + data.duration});
|
||||||
}
|
}
|
||||||
else if (to_weight < heap.GetKey(to))
|
else if (to_weight < heap.GetKey(to))
|
||||||
{
|
{
|
||||||
heap.DecreaseKey(to, to_weight);
|
heap.DecreaseKey(to, to_weight);
|
||||||
heap.GetData(to).from_clique = false;
|
heap.GetData(to) = {false, duration + data.duration};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ template <> struct HasGetTileTurns<corech::Algorithm> final : std::true_type
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Algorithms supported by Multi-Level Dijkstra
|
// Algorithms supported by Multi-Level Dijkstra
|
||||||
|
template <> struct HasAlternativePathSearch<mld::Algorithm> final : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
template <> struct HasDirectShortestPathSearch<mld::Algorithm> final : std::true_type
|
template <> struct HasDirectShortestPathSearch<mld::Algorithm> final : std::true_type
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
@@ -102,6 +105,9 @@ template <> struct HasShortestPathSearch<mld::Algorithm> final : std::true_type
|
|||||||
template <> struct HasMapMatching<mld::Algorithm> final : std::true_type
|
template <> struct HasMapMatching<mld::Algorithm> final : std::true_type
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
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
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -174,14 +174,13 @@ class RouteAPI : public BaseAPI
|
|||||||
guidance::trimShortSegments(steps, leg_geometry);
|
guidance::trimShortSegments(steps, leg_geometry);
|
||||||
leg.steps = guidance::postProcess(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::buildIntersections(std::move(leg.steps));
|
leg.steps = guidance::buildIntersections(std::move(leg.steps));
|
||||||
leg.steps = guidance::suppressShortNameSegments(std::move(leg.steps));
|
leg.steps = guidance::suppressShortNameSegments(std::move(leg.steps));
|
||||||
leg.steps = guidance::assignRelativeLocations(std::move(leg.steps),
|
leg.steps = guidance::assignRelativeLocations(std::move(leg.steps),
|
||||||
leg_geometry,
|
leg_geometry,
|
||||||
phantoms.source_phantom,
|
phantoms.source_phantom,
|
||||||
phantoms.target_phantom);
|
phantoms.target_phantom);
|
||||||
leg.steps = guidance::anticipateLaneChange(std::move(leg.steps));
|
|
||||||
leg.steps = guidance::collapseUseLane(std::move(leg.steps));
|
|
||||||
leg_geometry = guidance::resyncGeometry(std::move(leg_geometry), leg.steps);
|
leg_geometry = guidance::resyncGeometry(std::move(leg_geometry), leg.steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,9 @@ struct RouteParameters : public BaseParameters
|
|||||||
const boost::optional<bool> continue_straight_,
|
const boost::optional<bool> continue_straight_,
|
||||||
Args... args_)
|
Args... args_)
|
||||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||||
annotations{false}, annotations_type{AnnotationsType::None}, geometries{geometries_},
|
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{false},
|
||||||
overview{overview_}, continue_straight{continue_straight_}
|
annotations_type{AnnotationsType::None}, geometries{geometries_}, overview{overview_},
|
||||||
|
continue_straight{continue_straight_}
|
||||||
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one below.
|
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one below.
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -105,7 +106,7 @@ struct RouteParameters : public BaseParameters
|
|||||||
const boost::optional<bool> continue_straight_,
|
const boost::optional<bool> continue_straight_,
|
||||||
Args... args_)
|
Args... args_)
|
||||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||||
annotations{annotations_},
|
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_},
|
||||||
annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None},
|
annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None},
|
||||||
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_}
|
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_}
|
||||||
{
|
{
|
||||||
@@ -121,6 +122,7 @@ struct RouteParameters : public BaseParameters
|
|||||||
const boost::optional<bool> continue_straight_,
|
const boost::optional<bool> continue_straight_,
|
||||||
Args... args_)
|
Args... args_)
|
||||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||||
|
number_of_alternatives{alternatives_ ? 1u : 0u},
|
||||||
annotations{annotations_ == AnnotationsType::None ? false : true},
|
annotations{annotations_ == AnnotationsType::None ? false : true},
|
||||||
annotations_type{annotations_}, geometries{geometries_}, overview{overview_},
|
annotations_type{annotations_}, geometries{geometries_}, overview{overview_},
|
||||||
continue_straight{continue_straight_}
|
continue_straight{continue_straight_}
|
||||||
@@ -128,14 +130,21 @@ struct RouteParameters : public BaseParameters
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool steps = false;
|
bool steps = false;
|
||||||
|
// TODO: in v6 we should remove the boolean and only keep the number parameter; for compat.
|
||||||
bool alternatives = false;
|
bool alternatives = false;
|
||||||
|
unsigned number_of_alternatives = 0;
|
||||||
bool annotations = false;
|
bool annotations = false;
|
||||||
AnnotationsType annotations_type = AnnotationsType::None;
|
AnnotationsType annotations_type = AnnotationsType::None;
|
||||||
GeometriesType geometries = GeometriesType::Polyline;
|
GeometriesType geometries = GeometriesType::Polyline;
|
||||||
OverviewType overview = OverviewType::Simplified;
|
OverviewType overview = OverviewType::Simplified;
|
||||||
boost::optional<bool> continue_straight;
|
boost::optional<bool> continue_straight;
|
||||||
|
|
||||||
bool IsValid() const { return coordinates.size() >= 2 && BaseParameters::IsValid(); }
|
bool IsValid() const
|
||||||
|
{
|
||||||
|
const auto coordinates_ok = coordinates.size() >= 2;
|
||||||
|
const auto base_params_ok = BaseParameters::IsValid();
|
||||||
|
return coordinates_ok && base_params_ok;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool operator&(RouteParameters::AnnotationsType lhs, RouteParameters::AnnotationsType rhs)
|
inline bool operator&(RouteParameters::AnnotationsType lhs, RouteParameters::AnnotationsType rhs)
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ class TableAPI final : public BaseAPI
|
|||||||
{
|
{
|
||||||
auto number_of_sources = parameters.sources.size();
|
auto number_of_sources = parameters.sources.size();
|
||||||
auto number_of_destinations = parameters.destinations.size();
|
auto number_of_destinations = parameters.destinations.size();
|
||||||
;
|
|
||||||
|
|
||||||
// symmetric case
|
// symmetric case
|
||||||
if (parameters.sources.empty())
|
if (parameters.sources.empty())
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "extractor/datasources.hpp"
|
#include "extractor/datasources.hpp"
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
|
#include "extractor/intersection_bearings_container.hpp"
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
#include "extractor/packed_osm_ids.hpp"
|
#include "extractor/packed_osm_ids.hpp"
|
||||||
#include "extractor/profile_properties.hpp"
|
#include "extractor/profile_properties.hpp"
|
||||||
@@ -218,7 +219,6 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
unsigned m_check_sum;
|
unsigned m_check_sum;
|
||||||
util::vector_view<util::Coordinate> m_coordinate_list;
|
util::vector_view<util::Coordinate> m_coordinate_list;
|
||||||
extractor::PackedOSMIDsView m_osmnodeid_list;
|
extractor::PackedOSMIDsView m_osmnodeid_list;
|
||||||
util::NameTable m_names_table;
|
|
||||||
util::vector_view<std::uint32_t> m_lane_description_offsets;
|
util::vector_view<std::uint32_t> m_lane_description_offsets;
|
||||||
util::vector_view<extractor::guidance::TurnLaneType::Mask> m_lane_description_masks;
|
util::vector_view<extractor::guidance::TurnLaneType::Mask> m_lane_description_masks;
|
||||||
util::vector_view<TurnPenalty> m_turn_weight_penalties;
|
util::vector_view<TurnPenalty> m_turn_weight_penalties;
|
||||||
@@ -236,19 +236,12 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
std::unique_ptr<SharedGeospatialQuery> m_geospatial_query;
|
std::unique_ptr<SharedGeospatialQuery> m_geospatial_query;
|
||||||
boost::filesystem::path file_index_path;
|
boost::filesystem::path file_index_path;
|
||||||
|
|
||||||
util::NameTable m_name_table;
|
extractor::IntersectionBearingsView intersection_bearings_view;
|
||||||
// bearing classes by node based node
|
|
||||||
util::vector_view<BearingClassID> m_bearing_class_id_table;
|
|
||||||
// entry class IDs
|
|
||||||
util::vector_view<EntryClassID> m_entry_class_id_list;
|
|
||||||
|
|
||||||
|
util::NameTable m_name_table;
|
||||||
// the look-up table for entry classes. An entry class lists the possibility of entry for all
|
// the look-up table for entry classes. An entry class lists the possibility of entry for all
|
||||||
// available turns. Such a class id is stored with every edge.
|
// available turns. Such a class id is stored with every edge.
|
||||||
util::vector_view<util::guidance::EntryClass> m_entry_class_table;
|
util::vector_view<util::guidance::EntryClass> m_entry_class_table;
|
||||||
// the look-up table for distinct bearing classes. A bearing class lists the available bearings
|
|
||||||
// at an intersection
|
|
||||||
std::shared_ptr<util::RangeTable<16, storage::Ownership::View>> m_bearing_ranges_table;
|
|
||||||
util::vector_view<DiscreteBearing> m_bearing_values_table;
|
|
||||||
|
|
||||||
// allocator that keeps the allocation data
|
// allocator that keeps the allocation data
|
||||||
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
||||||
@@ -325,7 +318,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
void InitializeEdgeBasedNodeDataInformationPointers(storage::DataLayout &layout,
|
void InitializeEdgeBasedNodeDataInformationPointers(storage::DataLayout &layout,
|
||||||
char *memory_ptr)
|
char *memory_ptr)
|
||||||
{
|
{
|
||||||
auto via_geometry_list_ptr =
|
const auto via_geometry_list_ptr =
|
||||||
layout.GetBlockPtr<GeometryID>(memory_ptr, storage::DataLayout::GEOMETRY_ID_LIST);
|
layout.GetBlockPtr<GeometryID>(memory_ptr, storage::DataLayout::GEOMETRY_ID_LIST);
|
||||||
util::vector_view<GeometryID> geometry_ids(
|
util::vector_view<GeometryID> geometry_ids(
|
||||||
via_geometry_list_ptr, layout.num_entries[storage::DataLayout::GEOMETRY_ID_LIST]);
|
via_geometry_list_ptr, layout.num_entries[storage::DataLayout::GEOMETRY_ID_LIST]);
|
||||||
@@ -345,10 +338,16 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
util::vector_view<extractor::TravelMode> travel_modes(
|
util::vector_view<extractor::TravelMode> travel_modes(
|
||||||
travel_mode_list_ptr, layout.num_entries[storage::DataLayout::TRAVEL_MODE_LIST]);
|
travel_mode_list_ptr, layout.num_entries[storage::DataLayout::TRAVEL_MODE_LIST]);
|
||||||
|
|
||||||
|
const auto classes_list_ptr =
|
||||||
|
layout.GetBlockPtr<extractor::ClassData>(memory_ptr, storage::DataLayout::CLASSES_LIST);
|
||||||
|
util::vector_view<extractor::ClassData> classes(
|
||||||
|
classes_list_ptr, layout.num_entries[storage::DataLayout::CLASSES_LIST]);
|
||||||
|
|
||||||
edge_based_node_data = extractor::EdgeBasedNodeDataView(std::move(geometry_ids),
|
edge_based_node_data = extractor::EdgeBasedNodeDataView(std::move(geometry_ids),
|
||||||
std::move(name_ids),
|
std::move(name_ids),
|
||||||
std::move(component_ids),
|
std::move(component_ids),
|
||||||
std::move(travel_modes));
|
std::move(travel_modes),
|
||||||
|
std::move(classes));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeEdgeInformationPointers(storage::DataLayout &layout, char *memory_ptr)
|
void InitializeEdgeInformationPointers(storage::DataLayout &layout, char *memory_ptr)
|
||||||
@@ -502,15 +501,13 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
{
|
{
|
||||||
auto bearing_class_id_ptr = data_layout.GetBlockPtr<BearingClassID>(
|
auto bearing_class_id_ptr = data_layout.GetBlockPtr<BearingClassID>(
|
||||||
memory_block, storage::DataLayout::BEARING_CLASSID);
|
memory_block, storage::DataLayout::BEARING_CLASSID);
|
||||||
typename util::vector_view<BearingClassID> bearing_class_id_table(
|
util::vector_view<BearingClassID> bearing_class_id(
|
||||||
bearing_class_id_ptr, data_layout.num_entries[storage::DataLayout::BEARING_CLASSID]);
|
bearing_class_id_ptr, data_layout.num_entries[storage::DataLayout::BEARING_CLASSID]);
|
||||||
m_bearing_class_id_table = std::move(bearing_class_id_table);
|
|
||||||
|
|
||||||
auto bearing_class_ptr = data_layout.GetBlockPtr<DiscreteBearing>(
|
auto bearing_values_ptr = data_layout.GetBlockPtr<DiscreteBearing>(
|
||||||
memory_block, storage::DataLayout::BEARING_VALUES);
|
memory_block, storage::DataLayout::BEARING_VALUES);
|
||||||
typename util::vector_view<DiscreteBearing> bearing_class_table(
|
util::vector_view<DiscreteBearing> bearing_values(
|
||||||
bearing_class_ptr, data_layout.num_entries[storage::DataLayout::BEARING_VALUES]);
|
bearing_values_ptr, data_layout.num_entries[storage::DataLayout::BEARING_VALUES]);
|
||||||
m_bearing_values_table = std::move(bearing_class_table);
|
|
||||||
|
|
||||||
auto offsets_ptr =
|
auto offsets_ptr =
|
||||||
data_layout.GetBlockPtr<unsigned>(memory_block, storage::DataLayout::BEARING_OFFSETS);
|
data_layout.GetBlockPtr<unsigned>(memory_block, storage::DataLayout::BEARING_OFFSETS);
|
||||||
@@ -521,12 +518,15 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
util::vector_view<IndexBlock> bearing_blocks(
|
util::vector_view<IndexBlock> bearing_blocks(
|
||||||
blocks_ptr, data_layout.num_entries[storage::DataLayout::BEARING_BLOCKS]);
|
blocks_ptr, data_layout.num_entries[storage::DataLayout::BEARING_BLOCKS]);
|
||||||
|
|
||||||
m_bearing_ranges_table = std::make_unique<util::RangeTable<16, storage::Ownership::View>>(
|
util::RangeTable<16, storage::Ownership::View> bearing_range_table(
|
||||||
bearing_offsets, bearing_blocks, static_cast<unsigned>(m_bearing_values_table.size()));
|
bearing_offsets, bearing_blocks, static_cast<unsigned>(bearing_values.size()));
|
||||||
|
|
||||||
|
intersection_bearings_view = extractor::IntersectionBearingsView{
|
||||||
|
std::move(bearing_values), std::move(bearing_class_id), std::move(bearing_range_table)};
|
||||||
|
|
||||||
auto entry_class_ptr = data_layout.GetBlockPtr<util::guidance::EntryClass>(
|
auto entry_class_ptr = data_layout.GetBlockPtr<util::guidance::EntryClass>(
|
||||||
memory_block, storage::DataLayout::ENTRY_CLASS);
|
memory_block, storage::DataLayout::ENTRY_CLASS);
|
||||||
typename util::vector_view<util::guidance::EntryClass> entry_class_table(
|
util::vector_view<util::guidance::EntryClass> entry_class_table(
|
||||||
entry_class_ptr, data_layout.num_entries[storage::DataLayout::ENTRY_CLASS]);
|
entry_class_ptr, data_layout.num_entries[storage::DataLayout::ENTRY_CLASS]);
|
||||||
m_entry_class_table = std::move(entry_class_table);
|
m_entry_class_table = std::move(entry_class_table);
|
||||||
}
|
}
|
||||||
@@ -789,6 +789,22 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return edge_based_node_data.GetTravelMode(id);
|
return edge_based_node_data.GetTravelMode(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extractor::ClassData GetClassData(const NodeID id) const override final
|
||||||
|
{
|
||||||
|
return edge_based_node_data.GetClassData(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> GetClasses(const extractor::ClassData class_data) const override final
|
||||||
|
{
|
||||||
|
auto indexes = extractor::getClassIndexes(class_data);
|
||||||
|
std::vector<std::string> classes(indexes.size());
|
||||||
|
std::transform(indexes.begin(), indexes.end(), classes.begin(), [this](const auto index) {
|
||||||
|
return m_profile_properties->GetClassName(index);
|
||||||
|
});
|
||||||
|
|
||||||
|
return classes;
|
||||||
|
}
|
||||||
|
|
||||||
NameID GetNameIndex(const NodeID id) const override final
|
NameID GetNameIndex(const NodeID id) const override final
|
||||||
{
|
{
|
||||||
return edge_based_node_data.GetNameID(id);
|
return edge_based_node_data.GetNameID(id);
|
||||||
@@ -814,6 +830,11 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return m_name_table.GetDestinationsForID(id);
|
return m_name_table.GetDestinationsForID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringView GetExitsForID(const NameID id) const override final
|
||||||
|
{
|
||||||
|
return m_name_table.GetExitsForID(id);
|
||||||
|
}
|
||||||
|
|
||||||
StringView GetDatasourceName(const DatasourceID id) const override final
|
StringView GetDatasourceName(const DatasourceID id) const override final
|
||||||
{
|
{
|
||||||
return m_datasources->GetSourceName(id);
|
return m_datasources->GetSourceName(id);
|
||||||
@@ -843,27 +864,9 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return m_profile_properties->GetWeightMultiplier();
|
return m_profile_properties->GetWeightMultiplier();
|
||||||
}
|
}
|
||||||
|
|
||||||
BearingClassID GetBearingClassID(const NodeID id) const override final
|
util::guidance::BearingClass GetBearingClass(const NodeID node) const override final
|
||||||
{
|
{
|
||||||
return m_bearing_class_id_table.at(id);
|
return intersection_bearings_view.GetBearingClass(node);
|
||||||
}
|
|
||||||
|
|
||||||
util::guidance::BearingClass
|
|
||||||
GetBearingClass(const BearingClassID bearing_class_id) const override final
|
|
||||||
{
|
|
||||||
BOOST_ASSERT(bearing_class_id != INVALID_BEARING_CLASSID);
|
|
||||||
auto range = m_bearing_ranges_table->GetRange(bearing_class_id);
|
|
||||||
util::guidance::BearingClass result;
|
|
||||||
for (auto itr = m_bearing_values_table.begin() + range.front();
|
|
||||||
itr != m_bearing_values_table.begin() + range.back() + 1;
|
|
||||||
++itr)
|
|
||||||
result.add(*itr);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntryClassID GetEntryClassID(const EdgeID eid) const override final
|
|
||||||
{
|
|
||||||
return turn_data.GetEntryClassID(eid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const override final
|
util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const override final
|
||||||
@@ -875,8 +878,9 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return turn_data.GetPostTurnBearing(eid);
|
return turn_data.GetPostTurnBearing(eid);
|
||||||
}
|
}
|
||||||
|
|
||||||
util::guidance::EntryClass GetEntryClass(const EntryClassID entry_class_id) const override final
|
util::guidance::EntryClass GetEntryClass(const EdgeID turn_id) const override final
|
||||||
{
|
{
|
||||||
|
auto entry_class_id = turn_data.GetEntryClassID(turn_id);
|
||||||
return m_entry_class_table.at(entry_class_id);
|
return m_entry_class_table.at(entry_class_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -987,6 +991,8 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
|
|
||||||
auto mld_cell_weights_ptr = data_layout.GetBlockPtr<EdgeWeight>(
|
auto mld_cell_weights_ptr = data_layout.GetBlockPtr<EdgeWeight>(
|
||||||
memory_block, storage::DataLayout::MLD_CELL_WEIGHTS);
|
memory_block, storage::DataLayout::MLD_CELL_WEIGHTS);
|
||||||
|
auto mld_cell_durations_ptr = data_layout.GetBlockPtr<EdgeDuration>(
|
||||||
|
memory_block, storage::DataLayout::MLD_CELL_DURATIONS);
|
||||||
auto mld_source_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
auto mld_source_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
memory_block, storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
memory_block, storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
||||||
auto mld_destination_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
auto mld_destination_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
@@ -998,6 +1004,8 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
|
|
||||||
auto weight_entries_count =
|
auto weight_entries_count =
|
||||||
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_WEIGHTS);
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_WEIGHTS);
|
||||||
|
auto duration_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_DURATIONS);
|
||||||
auto source_boundary_entries_count =
|
auto source_boundary_entries_count =
|
||||||
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
||||||
auto destination_boundary_entries_count =
|
auto destination_boundary_entries_count =
|
||||||
@@ -1006,7 +1014,11 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
auto cell_level_offsets_entries_count =
|
auto cell_level_offsets_entries_count =
|
||||||
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
|
||||||
|
|
||||||
|
BOOST_ASSERT(weight_entries_count == duration_entries_count);
|
||||||
|
|
||||||
util::vector_view<EdgeWeight> weights(mld_cell_weights_ptr, weight_entries_count);
|
util::vector_view<EdgeWeight> weights(mld_cell_weights_ptr, weight_entries_count);
|
||||||
|
util::vector_view<EdgeDuration> durations(mld_cell_durations_ptr,
|
||||||
|
duration_entries_count);
|
||||||
util::vector_view<NodeID> source_boundary(mld_source_boundary_ptr,
|
util::vector_view<NodeID> source_boundary(mld_source_boundary_ptr,
|
||||||
source_boundary_entries_count);
|
source_boundary_entries_count);
|
||||||
util::vector_view<NodeID> destination_boundary(mld_destination_boundary_ptr,
|
util::vector_view<NodeID> destination_boundary(mld_destination_boundary_ptr,
|
||||||
@@ -1017,6 +1029,7 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
cell_level_offsets_entries_count);
|
cell_level_offsets_entries_count);
|
||||||
|
|
||||||
mld_cell_storage = partition::CellStorageView{std::move(weights),
|
mld_cell_storage = partition::CellStorageView{std::move(weights),
|
||||||
|
std::move(durations),
|
||||||
std::move(source_boundary),
|
std::move(source_boundary),
|
||||||
std::move(destination_boundary),
|
std::move(destination_boundary),
|
||||||
std::move(cells),
|
std::move(cells),
|
||||||
|
|||||||
@@ -3,14 +3,19 @@
|
|||||||
|
|
||||||
// Exposes all data access interfaces to the algorithms via base class ptr
|
// Exposes all data access interfaces to the algorithms via base class ptr
|
||||||
|
|
||||||
|
#include "engine/approach.hpp"
|
||||||
|
#include "engine/phantom_node.hpp"
|
||||||
|
|
||||||
#include "contractor/query_edge.hpp"
|
#include "contractor/query_edge.hpp"
|
||||||
|
|
||||||
|
#include "extractor/class_data.hpp"
|
||||||
#include "extractor/edge_based_node_segment.hpp"
|
#include "extractor/edge_based_node_segment.hpp"
|
||||||
#include "extractor/external_memory_node.hpp"
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
#include "extractor/original_edge_data.hpp"
|
#include "extractor/original_edge_data.hpp"
|
||||||
#include "engine/approach.hpp"
|
#include "extractor/query_node.hpp"
|
||||||
#include "engine/phantom_node.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
|
|
||||||
#include "util/exception.hpp"
|
#include "util/exception.hpp"
|
||||||
#include "util/guidance/bearing_class.hpp"
|
#include "util/guidance/bearing_class.hpp"
|
||||||
#include "util/guidance/entry_class.hpp"
|
#include "util/guidance/entry_class.hpp"
|
||||||
@@ -87,6 +92,10 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual extractor::TravelMode GetTravelMode(const NodeID id) const = 0;
|
virtual extractor::TravelMode GetTravelMode(const NodeID id) const = 0;
|
||||||
|
|
||||||
|
virtual extractor::ClassData GetClassData(const NodeID id) const = 0;
|
||||||
|
|
||||||
|
virtual std::vector<std::string> GetClasses(const extractor::ClassData class_data) const = 0;
|
||||||
|
|
||||||
virtual std::vector<RTreeLeaf> GetEdgesInBox(const util::Coordinate south_west,
|
virtual std::vector<RTreeLeaf> GetEdgesInBox(const util::Coordinate south_west,
|
||||||
const util::Coordinate north_east) const = 0;
|
const util::Coordinate north_east) const = 0;
|
||||||
|
|
||||||
@@ -158,6 +167,8 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual StringView GetDestinationsForID(const NameID id) const = 0;
|
virtual StringView GetDestinationsForID(const NameID id) const = 0;
|
||||||
|
|
||||||
|
virtual StringView GetExitsForID(const NameID id) const = 0;
|
||||||
|
|
||||||
virtual std::string GetTimestamp() const = 0;
|
virtual std::string GetTimestamp() const = 0;
|
||||||
|
|
||||||
virtual bool GetContinueStraightDefault() const = 0;
|
virtual bool GetContinueStraightDefault() const = 0;
|
||||||
@@ -170,17 +181,12 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual double GetWeightMultiplier() const = 0;
|
virtual double GetWeightMultiplier() const = 0;
|
||||||
|
|
||||||
virtual BearingClassID GetBearingClassID(const NodeID id) const = 0;
|
|
||||||
|
|
||||||
virtual util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const = 0;
|
virtual util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const = 0;
|
||||||
virtual util::guidance::TurnBearing PostTurnBearing(const EdgeID eid) const = 0;
|
virtual util::guidance::TurnBearing PostTurnBearing(const EdgeID eid) const = 0;
|
||||||
|
|
||||||
virtual util::guidance::BearingClass
|
virtual util::guidance::BearingClass GetBearingClass(const NodeID node) const = 0;
|
||||||
GetBearingClass(const BearingClassID bearing_class_id) const = 0;
|
|
||||||
|
|
||||||
virtual EntryClassID GetEntryClassID(const EdgeID eid) const = 0;
|
virtual util::guidance::EntryClass GetEntryClass(const EdgeID turn_id) const = 0;
|
||||||
|
|
||||||
virtual util::guidance::EntryClass GetEntryClass(const EntryClassID entry_class_id) const = 0;
|
|
||||||
|
|
||||||
virtual bool IsLeftHandDriving() const = 0;
|
virtual bool IsLeftHandDriving() const = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "engine/datafacade/contiguous_block_allocator.hpp"
|
#include "engine/datafacade/contiguous_block_allocator.hpp"
|
||||||
#include "engine/datafacade_provider.hpp"
|
#include "engine/datafacade_provider.hpp"
|
||||||
#include "engine/engine_config.hpp"
|
#include "engine/engine_config.hpp"
|
||||||
#include "engine/engine_config.hpp"
|
|
||||||
#include "engine/plugins/match.hpp"
|
#include "engine/plugins/match.hpp"
|
||||||
#include "engine/plugins/nearest.hpp"
|
#include "engine/plugins/nearest.hpp"
|
||||||
#include "engine/plugins/table.hpp"
|
#include "engine/plugins/table.hpp"
|
||||||
@@ -54,7 +53,7 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit Engine(const EngineConfig &config)
|
explicit Engine(const EngineConfig &config)
|
||||||
: route_plugin(config.max_locations_viaroute), //
|
: route_plugin(config.max_locations_viaroute, config.max_alternatives), //
|
||||||
table_plugin(config.max_locations_distance_table), //
|
table_plugin(config.max_locations_distance_table), //
|
||||||
nearest_plugin(config.max_results_nearest), //
|
nearest_plugin(config.max_results_nearest), //
|
||||||
trip_plugin(config.max_locations_trip), //
|
trip_plugin(config.max_locations_trip), //
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ struct EngineConfig final
|
|||||||
int max_locations_distance_table = -1;
|
int max_locations_distance_table = -1;
|
||||||
int max_locations_map_matching = -1;
|
int max_locations_map_matching = -1;
|
||||||
int max_results_nearest = -1;
|
int max_results_nearest = -1;
|
||||||
|
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
|
||||||
bool use_shared_memory = true;
|
bool use_shared_memory = true;
|
||||||
Algorithm algorithm = Algorithm::CH;
|
Algorithm algorithm = Algorithm::CH;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -78,10 +78,18 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
|
|||||||
}
|
}
|
||||||
|
|
||||||
prev_coordinate = coordinate;
|
prev_coordinate = coordinate;
|
||||||
geometry.annotations.emplace_back(
|
geometry.annotations.emplace_back(LegGeometry::Annotation{
|
||||||
LegGeometry::Annotation{current_distance,
|
current_distance,
|
||||||
path_point.duration_until_turn / 10.,
|
// NOTE: we want annotations to include only the duration/weight
|
||||||
path_point.weight_until_turn / facade.GetWeightMultiplier(),
|
// of the segment itself. For segments immediately before
|
||||||
|
// a turn, the duration_until_turn/weight_until_turn values
|
||||||
|
// include the turn cost. To counter this, we subtract
|
||||||
|
// the duration_of_turn/weight_of_turn value, which is 0 for
|
||||||
|
// non-preceeding-turn segments, but contains the turn value
|
||||||
|
// for segments before a turn.
|
||||||
|
(path_point.duration_until_turn - path_point.duration_of_turn) / 10.,
|
||||||
|
(path_point.weight_until_turn - path_point.weight_of_turn) /
|
||||||
|
facade.GetWeightMultiplier(),
|
||||||
path_point.datasource_id});
|
path_point.datasource_id});
|
||||||
geometry.locations.push_back(std::move(coordinate));
|
geometry.locations.push_back(std::move(coordinate));
|
||||||
geometry.osm_node_ids.push_back(facade.GetOSMNodeIDOfNode(path_point.turn_via_node));
|
geometry.osm_node_ids.push_back(facade.GetOSMNodeIDOfNode(path_point.turn_via_node));
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
: source_node.forward_segment_id.id;
|
: source_node.forward_segment_id.id;
|
||||||
const auto source_name_id = facade.GetNameIndex(source_node_id);
|
const auto source_name_id = facade.GetNameIndex(source_node_id);
|
||||||
const auto source_mode = facade.GetTravelMode(source_node_id);
|
const auto source_mode = facade.GetTravelMode(source_node_id);
|
||||||
|
auto source_classes = facade.GetClasses(facade.GetClassData(source_node_id));
|
||||||
|
|
||||||
const EdgeWeight target_duration =
|
const EdgeWeight target_duration =
|
||||||
target_traversed_in_reverse ? target_node.reverse_duration : target_node.forward_duration;
|
target_traversed_in_reverse ? target_node.reverse_duration : target_node.forward_duration;
|
||||||
@@ -86,7 +87,8 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
IntermediateIntersection::NO_INDEX,
|
IntermediateIntersection::NO_INDEX,
|
||||||
0,
|
0,
|
||||||
util::guidance::LaneTuple(),
|
util::guidance::LaneTuple(),
|
||||||
{}};
|
{},
|
||||||
|
source_classes};
|
||||||
|
|
||||||
if (leg_data.size() > 0)
|
if (leg_data.size() > 0)
|
||||||
{
|
{
|
||||||
@@ -114,13 +116,17 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
const auto ref = facade.GetRefForID(step_name_id);
|
const auto ref = facade.GetRefForID(step_name_id);
|
||||||
const auto pronunciation = facade.GetPronunciationForID(step_name_id);
|
const auto pronunciation = facade.GetPronunciationForID(step_name_id);
|
||||||
const auto destinations = facade.GetDestinationsForID(step_name_id);
|
const auto destinations = facade.GetDestinationsForID(step_name_id);
|
||||||
|
const auto exits = facade.GetExitsForID(step_name_id);
|
||||||
const auto distance = leg_geometry.segment_distances[segment_index];
|
const auto distance = leg_geometry.segment_distances[segment_index];
|
||||||
|
// intersections contain the classes of exiting road
|
||||||
|
intersection.classes = facade.GetClasses(path_point.classes);
|
||||||
|
|
||||||
steps.push_back(RouteStep{step_name_id,
|
steps.push_back(RouteStep{step_name_id,
|
||||||
name.to_string(),
|
name.to_string(),
|
||||||
ref.to_string(),
|
ref.to_string(),
|
||||||
pronunciation.to_string(),
|
pronunciation.to_string(),
|
||||||
destinations.to_string(),
|
destinations.to_string(),
|
||||||
|
exits.to_string(),
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
segment_duration / 10.,
|
segment_duration / 10.,
|
||||||
@@ -144,9 +150,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
// extract bearings
|
// extract bearings
|
||||||
bearings = std::make_pair<std::uint16_t, std::uint16_t>(
|
bearings = std::make_pair<std::uint16_t, std::uint16_t>(
|
||||||
path_point.pre_turn_bearing.Get(), path_point.post_turn_bearing.Get());
|
path_point.pre_turn_bearing.Get(), path_point.post_turn_bearing.Get());
|
||||||
const auto entry_class = facade.GetEntryClass(path_point.entry_classid);
|
const auto bearing_class = facade.GetBearingClass(path_point.turn_via_node);
|
||||||
const auto bearing_class =
|
|
||||||
facade.GetBearingClass(facade.GetBearingClassID(path_point.turn_via_node));
|
|
||||||
auto bearing_data = bearing_class.getAvailableBearings();
|
auto bearing_data = bearing_class.getAvailableBearings();
|
||||||
intersection.in = bearing_class.findMatchingBearing(bearings.first);
|
intersection.in = bearing_class.findMatchingBearing(bearings.first);
|
||||||
intersection.out = bearing_class.findMatchingBearing(bearings.second);
|
intersection.out = bearing_class.findMatchingBearing(bearings.second);
|
||||||
@@ -174,7 +178,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
intersection.entry.clear();
|
intersection.entry.clear();
|
||||||
for (auto idx : util::irange<std::size_t>(0, intersection.bearings.size()))
|
for (auto idx : util::irange<std::size_t>(0, intersection.bearings.size()))
|
||||||
{
|
{
|
||||||
intersection.entry.push_back(entry_class.allowsEntry(idx));
|
intersection.entry.push_back(path_point.entry_class.allowsEntry(idx));
|
||||||
}
|
}
|
||||||
std::int16_t bearing_in_driving_direction =
|
std::int16_t bearing_in_driving_direction =
|
||||||
util::bearing::reverse(std::round(bearings.first));
|
util::bearing::reverse(std::round(bearings.first));
|
||||||
@@ -192,12 +196,15 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
const auto distance = leg_geometry.segment_distances[segment_index];
|
const auto distance = leg_geometry.segment_distances[segment_index];
|
||||||
const EdgeWeight duration = segment_duration + target_duration;
|
const EdgeWeight duration = segment_duration + target_duration;
|
||||||
const EdgeWeight weight = segment_weight + target_weight;
|
const EdgeWeight weight = segment_weight + target_weight;
|
||||||
|
// intersections contain the classes of exiting road
|
||||||
|
intersection.classes = facade.GetClasses(facade.GetClassData(target_node_id));
|
||||||
BOOST_ASSERT(duration >= 0);
|
BOOST_ASSERT(duration >= 0);
|
||||||
steps.push_back(RouteStep{step_name_id,
|
steps.push_back(RouteStep{step_name_id,
|
||||||
facade.GetNameForID(step_name_id).to_string(),
|
facade.GetNameForID(step_name_id).to_string(),
|
||||||
facade.GetRefForID(step_name_id).to_string(),
|
facade.GetRefForID(step_name_id).to_string(),
|
||||||
facade.GetPronunciationForID(step_name_id).to_string(),
|
facade.GetPronunciationForID(step_name_id).to_string(),
|
||||||
facade.GetDestinationsForID(step_name_id).to_string(),
|
facade.GetDestinationsForID(step_name_id).to_string(),
|
||||||
|
facade.GetExitsForID(step_name_id).to_string(),
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
duration / 10.,
|
duration / 10.,
|
||||||
@@ -239,6 +246,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
facade.GetRefForID(source_name_id).to_string(),
|
facade.GetRefForID(source_name_id).to_string(),
|
||||||
facade.GetPronunciationForID(source_name_id).to_string(),
|
facade.GetPronunciationForID(source_name_id).to_string(),
|
||||||
facade.GetDestinationsForID(source_name_id).to_string(),
|
facade.GetDestinationsForID(source_name_id).to_string(),
|
||||||
|
facade.GetExitsForID(source_name_id).to_string(),
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
duration / 10.,
|
duration / 10.,
|
||||||
@@ -261,6 +269,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
0,
|
0,
|
||||||
IntermediateIntersection::NO_INDEX,
|
IntermediateIntersection::NO_INDEX,
|
||||||
util::guidance::LaneTuple(),
|
util::guidance::LaneTuple(),
|
||||||
|
{},
|
||||||
{}};
|
{}};
|
||||||
|
|
||||||
// This step has length zero, the only reason we need it is the target location
|
// This step has length zero, the only reason we need it is the target location
|
||||||
@@ -277,6 +286,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
facade.GetRefForID(target_name_id).to_string(),
|
facade.GetRefForID(target_name_id).to_string(),
|
||||||
facade.GetPronunciationForID(target_name_id).to_string(),
|
facade.GetPronunciationForID(target_name_id).to_string(),
|
||||||
facade.GetDestinationsForID(target_name_id).to_string(),
|
facade.GetDestinationsForID(target_name_id).to_string(),
|
||||||
|
facade.GetExitsForID(target_name_id).to_string(),
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
NO_ROTARY_NAME,
|
NO_ROTARY_NAME,
|
||||||
ZERO_DURATION,
|
ZERO_DURATION,
|
||||||
|
|||||||
@@ -130,8 +130,14 @@ inline bool haveSameName(const RouteStep &lhs, const RouteStep &rhs)
|
|||||||
|
|
||||||
// ok, bite the sour grape and check the strings already
|
// ok, bite the sour grape and check the strings already
|
||||||
else
|
else
|
||||||
return !util::guidance::requiresNameAnnounced(
|
return !util::guidance::requiresNameAnnounced(lhs.name,
|
||||||
lhs.name, lhs.ref, lhs.pronunciation, rhs.name, rhs.ref, rhs.pronunciation);
|
lhs.ref,
|
||||||
|
lhs.pronunciation,
|
||||||
|
lhs.exits,
|
||||||
|
rhs.name,
|
||||||
|
rhs.ref,
|
||||||
|
rhs.pronunciation,
|
||||||
|
rhs.exits);
|
||||||
}
|
}
|
||||||
|
|
||||||
// alias for readability, both turn right | left
|
// alias for readability, both turn right | left
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace guidance
|
|||||||
// as separate maneuvers.
|
// as separate maneuvers.
|
||||||
OSRM_ATTR_WARN_UNUSED
|
OSRM_ATTR_WARN_UNUSED
|
||||||
std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
||||||
const double min_duration_needed_for_lane_change = 10);
|
const double min_distance_needed_for_lane_change = 200);
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
|
|||||||
@@ -38,8 +38,12 @@ struct LegGeometry
|
|||||||
struct Annotation
|
struct Annotation
|
||||||
{
|
{
|
||||||
double distance; // distance in meters
|
double distance; // distance in meters
|
||||||
double duration; // duration in seconds
|
|
||||||
double weight; // weight value
|
// Total duration of a segment, in seconds, NOT including
|
||||||
|
// the turn penalty if the segment preceeds a turn
|
||||||
|
double duration;
|
||||||
|
double weight; // weight value, NOT including the turn weight
|
||||||
|
|
||||||
DatasourceID datasource;
|
DatasourceID datasource;
|
||||||
};
|
};
|
||||||
std::vector<Annotation> annotations;
|
std::vector<Annotation> annotations;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ struct IntermediateIntersection
|
|||||||
// turn lane information
|
// turn lane information
|
||||||
util::guidance::LaneTuple lanes;
|
util::guidance::LaneTuple lanes;
|
||||||
extractor::guidance::TurnLaneDescription lane_description;
|
extractor::guidance::TurnLaneDescription lane_description;
|
||||||
|
std::vector<std::string> classes;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline IntermediateIntersection getInvalidIntersection()
|
inline IntermediateIntersection getInvalidIntersection()
|
||||||
@@ -52,6 +53,7 @@ inline IntermediateIntersection getInvalidIntersection()
|
|||||||
IntermediateIntersection::NO_INDEX,
|
IntermediateIntersection::NO_INDEX,
|
||||||
IntermediateIntersection::NO_INDEX,
|
IntermediateIntersection::NO_INDEX,
|
||||||
util::guidance::LaneTuple(),
|
util::guidance::LaneTuple(),
|
||||||
|
{},
|
||||||
{}};
|
{}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +64,7 @@ struct RouteStep
|
|||||||
std::string ref;
|
std::string ref;
|
||||||
std::string pronunciation;
|
std::string pronunciation;
|
||||||
std::string destinations;
|
std::string destinations;
|
||||||
|
std::string exits;
|
||||||
std::string rotary_name;
|
std::string rotary_name;
|
||||||
std::string rotary_pronunciation;
|
std::string rotary_pronunciation;
|
||||||
double duration; // duration in seconds
|
double duration; // duration in seconds
|
||||||
@@ -114,6 +117,7 @@ inline void RouteStep::Invalidate()
|
|||||||
ref.clear();
|
ref.clear();
|
||||||
pronunciation.clear();
|
pronunciation.clear();
|
||||||
destinations.clear();
|
destinations.clear();
|
||||||
|
exits.clear();
|
||||||
rotary_name.clear();
|
rotary_name.clear();
|
||||||
rotary_pronunciation.clear();
|
rotary_pronunciation.clear();
|
||||||
duration = 0;
|
duration = 0;
|
||||||
@@ -178,6 +182,7 @@ inline RouteStep &RouteStep::AdaptStepSignage(const RouteStep &origin)
|
|||||||
name = origin.name;
|
name = origin.name;
|
||||||
pronunciation = origin.pronunciation;
|
pronunciation = origin.pronunciation;
|
||||||
destinations = origin.destinations;
|
destinations = origin.destinations;
|
||||||
|
exits = origin.exits;
|
||||||
ref = origin.ref;
|
ref = origin.ref;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@@ -20,16 +20,6 @@ namespace guidance
|
|||||||
OSRM_ATTR_WARN_UNUSED
|
OSRM_ATTR_WARN_UNUSED
|
||||||
std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps);
|
std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps);
|
||||||
|
|
||||||
// remove use lane information that is not actually a turn. For post-processing, we need to
|
|
||||||
// associate lanes with every turn. Some of these use-lane instructions are not required after lane
|
|
||||||
// anticipation anymore. This function removes all use lane instructions that are not actually used
|
|
||||||
// anymore since all lanes going straight are used anyhow.
|
|
||||||
// FIXME this is currently only a heuristic. We need knowledge on which lanes actually might become
|
|
||||||
// turn lanes. If a straight lane becomes a turn lane, this might be something to consider. Right
|
|
||||||
// now we bet on lane-anticipation to catch this.
|
|
||||||
OSRM_ATTR_WARN_UNUSED
|
|
||||||
std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps);
|
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "engine/phantom_node.hpp"
|
#include "engine/phantom_node.hpp"
|
||||||
#include "osrm/coordinate.hpp"
|
#include "osrm/coordinate.hpp"
|
||||||
|
#include "util/guidance/entry_class.hpp"
|
||||||
#include "util/guidance/turn_bearing.hpp"
|
#include "util/guidance/turn_bearing.hpp"
|
||||||
#include "util/guidance/turn_lanes.hpp"
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
@@ -23,17 +24,27 @@ struct PathData
|
|||||||
// name of the street that leads to the turn
|
// name of the street that leads to the turn
|
||||||
unsigned name_id;
|
unsigned name_id;
|
||||||
// weight that is traveled on the segment until the turn is reached
|
// weight that is traveled on the segment until the turn is reached
|
||||||
|
// including the turn weight, if one exists
|
||||||
EdgeWeight weight_until_turn;
|
EdgeWeight weight_until_turn;
|
||||||
// duration that is traveled on the segment until the turn is reached
|
// If this segment immediately preceeds a turn, then duration_of_turn
|
||||||
|
// will contain the weight of the turn. Otherwise it will be 0.
|
||||||
|
EdgeWeight weight_of_turn;
|
||||||
|
// duration that is traveled on the segment until the turn is reached,
|
||||||
|
// including a turn if the segment preceeds one.
|
||||||
EdgeWeight duration_until_turn;
|
EdgeWeight duration_until_turn;
|
||||||
|
// If this segment immediately preceeds a turn, then duration_of_turn
|
||||||
|
// will contain the duration of the turn. Otherwise it will be 0.
|
||||||
|
EdgeWeight duration_of_turn;
|
||||||
// instruction to execute at the turn
|
// instruction to execute at the turn
|
||||||
extractor::guidance::TurnInstruction turn_instruction;
|
extractor::guidance::TurnInstruction turn_instruction;
|
||||||
// turn lane data
|
// turn lane data
|
||||||
util::guidance::LaneTupleIdPair lane_data;
|
util::guidance::LaneTupleIdPair lane_data;
|
||||||
// travel mode of the street that leads to the turn
|
// travel mode of the street that leads to the turn
|
||||||
extractor::TravelMode travel_mode : 4;
|
extractor::TravelMode travel_mode : 4;
|
||||||
|
// user defined classed of the street that leads to the turn
|
||||||
|
extractor::ClassData classes;
|
||||||
// entry class of the turn, indicating possibility of turns
|
// entry class of the turn, indicating possibility of turns
|
||||||
EntryClassID entry_classid;
|
util::guidance::EntryClass entry_class;
|
||||||
|
|
||||||
// Source of the speed value on this road segment
|
// Source of the speed value on this road segment
|
||||||
DatasourceID datasource_id;
|
DatasourceID datasource_id;
|
||||||
@@ -58,6 +69,18 @@ struct InternalRouteResult
|
|||||||
{
|
{
|
||||||
return (leg != unpacked_path_segments.size() - 1);
|
return (leg != unpacked_path_segments.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: includes duration for turns, except for at start and end node.
|
||||||
|
EdgeWeight duration() const
|
||||||
|
{
|
||||||
|
EdgeWeight ret{0};
|
||||||
|
|
||||||
|
for (const auto &leg : unpacked_path_segments)
|
||||||
|
for (const auto &segment : leg)
|
||||||
|
ret += segment.duration_until_turn;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InternalManyRoutesResult
|
struct InternalManyRoutesResult
|
||||||
|
|||||||
@@ -27,9 +27,10 @@ class ViaRoutePlugin final : public BasePlugin
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const int max_locations_viaroute;
|
const int max_locations_viaroute;
|
||||||
|
const int max_alternatives;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ViaRoutePlugin(int max_locations_viaroute);
|
explicit ViaRoutePlugin(int max_locations_viaroute, int max_alternatives);
|
||||||
|
|
||||||
Status HandleRequest(const datafacade::ContiguousInternalMemoryDataFacadeBase &facade,
|
Status HandleRequest(const datafacade::ContiguousInternalMemoryDataFacadeBase &facade,
|
||||||
const RoutingAlgorithmsInterface &algorithms,
|
const RoutingAlgorithmsInterface &algorithms,
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ class RoutingAlgorithmsInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual InternalManyRoutesResult
|
virtual InternalManyRoutesResult
|
||||||
AlternativePathSearch(const PhantomNodes &phantom_node_pair) const = 0;
|
AlternativePathSearch(const PhantomNodes &phantom_node_pair,
|
||||||
|
unsigned number_of_alternatives) const = 0;
|
||||||
|
|
||||||
virtual InternalRouteResult
|
virtual InternalRouteResult
|
||||||
ShortestPathSearch(const std::vector<PhantomNodes> &phantom_node_pair,
|
ShortestPathSearch(const std::vector<PhantomNodes> &phantom_node_pair,
|
||||||
@@ -66,7 +67,8 @@ template <typename Algorithm> class RoutingAlgorithms final : public RoutingAlgo
|
|||||||
virtual ~RoutingAlgorithms() = default;
|
virtual ~RoutingAlgorithms() = default;
|
||||||
|
|
||||||
InternalManyRoutesResult
|
InternalManyRoutesResult
|
||||||
AlternativePathSearch(const PhantomNodes &phantom_node_pair) const final override;
|
AlternativePathSearch(const PhantomNodes &phantom_node_pair,
|
||||||
|
unsigned number_of_alternatives) const final override;
|
||||||
|
|
||||||
InternalRouteResult ShortestPathSearch(
|
InternalRouteResult ShortestPathSearch(
|
||||||
const std::vector<PhantomNodes> &phantom_node_pair,
|
const std::vector<PhantomNodes> &phantom_node_pair,
|
||||||
@@ -130,9 +132,11 @@ template <typename Algorithm> class RoutingAlgorithms final : public RoutingAlgo
|
|||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
InternalManyRoutesResult
|
InternalManyRoutesResult
|
||||||
RoutingAlgorithms<Algorithm>::AlternativePathSearch(const PhantomNodes &phantom_node_pair) const
|
RoutingAlgorithms<Algorithm>::AlternativePathSearch(const PhantomNodes &phantom_node_pair,
|
||||||
|
unsigned number_of_alternatives) const
|
||||||
{
|
{
|
||||||
return routing_algorithms::ch::alternativePathSearch(heaps, facade, phantom_node_pair);
|
return routing_algorithms::alternativePathSearch(
|
||||||
|
heaps, facade, phantom_node_pair, number_of_alternatives);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
@@ -157,7 +161,7 @@ RoutingAlgorithms<Algorithm>::ManyToManySearch(const std::vector<PhantomNode> &p
|
|||||||
const std::vector<std::size_t> &source_indices,
|
const std::vector<std::size_t> &source_indices,
|
||||||
const std::vector<std::size_t> &target_indices) const
|
const std::vector<std::size_t> &target_indices) const
|
||||||
{
|
{
|
||||||
return routing_algorithms::ch::manyToManySearch(
|
return routing_algorithms::manyToManySearch(
|
||||||
heaps, facade, phantom_nodes, source_indices, target_indices);
|
heaps, facade, phantom_nodes, source_indices, target_indices);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +193,8 @@ inline std::vector<routing_algorithms::TurnData> RoutingAlgorithms<Algorithm>::G
|
|||||||
// CoreCH overrides
|
// CoreCH overrides
|
||||||
template <>
|
template <>
|
||||||
InternalManyRoutesResult inline RoutingAlgorithms<
|
InternalManyRoutesResult inline RoutingAlgorithms<
|
||||||
routing_algorithms::corech::Algorithm>::AlternativePathSearch(const PhantomNodes &) const
|
routing_algorithms::corech::Algorithm>::AlternativePathSearch(const PhantomNodes &,
|
||||||
|
unsigned) const
|
||||||
{
|
{
|
||||||
throw util::exception("AlternativePathSearch is disabled due to performance reasons");
|
throw util::exception("AlternativePathSearch is disabled due to performance reasons");
|
||||||
}
|
}
|
||||||
@@ -203,25 +208,7 @@ RoutingAlgorithms<routing_algorithms::corech::Algorithm>::ManyToManySearch(
|
|||||||
{
|
{
|
||||||
throw util::exception("ManyToManySearch is disabled due to performance reasons");
|
throw util::exception("ManyToManySearch is disabled due to performance reasons");
|
||||||
}
|
}
|
||||||
|
} // ns engine
|
||||||
// MLD overrides for not implemented
|
} // ns osrm
|
||||||
template <>
|
|
||||||
InternalManyRoutesResult inline RoutingAlgorithms<
|
|
||||||
routing_algorithms::mld::Algorithm>::AlternativePathSearch(const PhantomNodes &) const
|
|
||||||
{
|
|
||||||
throw util::exception("AlternativePathSearch is not implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
inline std::vector<EdgeWeight>
|
|
||||||
RoutingAlgorithms<routing_algorithms::mld::Algorithm>::ManyToManySearch(
|
|
||||||
const std::vector<PhantomNode> &,
|
|
||||||
const std::vector<std::size_t> &,
|
|
||||||
const std::vector<std::size_t> &) const
|
|
||||||
{
|
|
||||||
throw util::exception("ManyToManySearch is not implemented");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -15,13 +15,19 @@ namespace engine
|
|||||||
{
|
{
|
||||||
namespace routing_algorithms
|
namespace routing_algorithms
|
||||||
{
|
{
|
||||||
namespace ch
|
|
||||||
{
|
|
||||||
InternalManyRoutesResult
|
InternalManyRoutesResult
|
||||||
alternativePathSearch(SearchEngineData<Algorithm> &search_engine_data,
|
alternativePathSearch(SearchEngineData<ch::Algorithm> &search_engine_data,
|
||||||
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
const datafacade::ContiguousInternalMemoryDataFacade<ch::Algorithm> &facade,
|
||||||
const PhantomNodes &phantom_node_pair);
|
const PhantomNodes &phantom_node_pair,
|
||||||
} // namespace ch
|
unsigned number_of_alternatives);
|
||||||
|
|
||||||
|
InternalManyRoutesResult
|
||||||
|
alternativePathSearch(SearchEngineData<mld::Algorithm> &search_engine_data,
|
||||||
|
const datafacade::ContiguousInternalMemoryDataFacade<mld::Algorithm> &facade,
|
||||||
|
const PhantomNodes &phantom_node_pair,
|
||||||
|
unsigned number_of_alternatives);
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|||||||
@@ -21,19 +21,10 @@ namespace routing_algorithms
|
|||||||
/// by the previous route.
|
/// by the previous route.
|
||||||
/// This variation is only an optimazation for graphs with slow queries, for example
|
/// This variation is only an optimazation for graphs with slow queries, for example
|
||||||
/// not fully contracted graphs.
|
/// not fully contracted graphs.
|
||||||
InternalRouteResult directShortestPathSearch(
|
template <typename Algorithm>
|
||||||
SearchEngineData<ch::Algorithm> &engine_working_data,
|
InternalRouteResult
|
||||||
const datafacade::ContiguousInternalMemoryDataFacade<ch::Algorithm> &facade,
|
directShortestPathSearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
const PhantomNodes &phantom_nodes);
|
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
||||||
|
|
||||||
InternalRouteResult directShortestPathSearch(
|
|
||||||
SearchEngineData<corech::Algorithm> &engine_working_data,
|
|
||||||
const datafacade::ContiguousInternalMemoryDataFacade<corech::Algorithm> &facade,
|
|
||||||
const PhantomNodes &phantom_nodes);
|
|
||||||
|
|
||||||
InternalRouteResult directShortestPathSearch(
|
|
||||||
SearchEngineData<mld::Algorithm> &engine_working_data,
|
|
||||||
const datafacade::ContiguousInternalMemoryDataFacade<mld::Algorithm> &facade,
|
|
||||||
const PhantomNodes &phantom_nodes);
|
const PhantomNodes &phantom_nodes);
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
|
|||||||
@@ -16,15 +16,13 @@ namespace engine
|
|||||||
namespace routing_algorithms
|
namespace routing_algorithms
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace ch
|
template <typename Algorithm>
|
||||||
{
|
|
||||||
std::vector<EdgeWeight>
|
std::vector<EdgeWeight>
|
||||||
manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
||||||
const std::vector<PhantomNode> &phantom_nodes,
|
const std::vector<PhantomNode> &phantom_nodes,
|
||||||
const std::vector<std::size_t> &source_indices,
|
const std::vector<std::size_t> &source_indices,
|
||||||
const std::vector<std::size_t> &target_indices);
|
const std::vector<std::size_t> &target_indices);
|
||||||
} // namespace ch
|
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "engine/algorithm.hpp"
|
#include "engine/algorithm.hpp"
|
||||||
#include "engine/datafacade/contiguous_internalmem_datafacade.hpp"
|
#include "engine/datafacade/contiguous_internalmem_datafacade.hpp"
|
||||||
#include "engine/internal_route_result.hpp"
|
#include "engine/internal_route_result.hpp"
|
||||||
|
#include "engine/phantom_node.hpp"
|
||||||
#include "engine/search_engine_data.hpp"
|
#include "engine/search_engine_data.hpp"
|
||||||
|
|
||||||
#include "util/coordinate_calculation.hpp"
|
#include "util/coordinate_calculation.hpp"
|
||||||
@@ -38,14 +39,10 @@ static constexpr bool REVERSE_DIRECTION = false;
|
|||||||
static constexpr bool DO_NOT_FORCE_LOOPS = false;
|
static constexpr bool DO_NOT_FORCE_LOOPS = false;
|
||||||
|
|
||||||
bool needsLoopForward(const PhantomNode &source_phantom, const PhantomNode &target_phantom);
|
bool needsLoopForward(const PhantomNode &source_phantom, const PhantomNode &target_phantom);
|
||||||
|
|
||||||
bool needsLoopBackwards(const PhantomNode &source_phantom, const PhantomNode &target_phantom);
|
bool needsLoopBackwards(const PhantomNode &source_phantom, const PhantomNode &target_phantom);
|
||||||
|
|
||||||
void insertSourceInHeap(SearchEngineData<ch::Algorithm>::ManyToManyQueryHeap &heap,
|
bool needsLoopForward(const PhantomNodes &phantoms);
|
||||||
const PhantomNode &phantom_node);
|
bool needsLoopBackwards(const PhantomNodes &phantoms);
|
||||||
|
|
||||||
void insertTargetInHeap(SearchEngineData<ch::Algorithm>::ManyToManyQueryHeap &heap,
|
|
||||||
const PhantomNode &phantom_node);
|
|
||||||
|
|
||||||
template <typename Heap>
|
template <typename Heap>
|
||||||
void insertNodesInHeaps(Heap &forward_heap, Heap &reverse_heap, const PhantomNodes &nodes)
|
void insertNodesInHeaps(Heap &forward_heap, Heap &reverse_heap, const PhantomNodes &nodes)
|
||||||
@@ -81,6 +78,40 @@ void insertNodesInHeaps(Heap &forward_heap, Heap &reverse_heap, const PhantomNod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename ManyToManyQueryHeap>
|
||||||
|
void insertSourceInHeap(ManyToManyQueryHeap &heap, const PhantomNode &phantom_node)
|
||||||
|
{
|
||||||
|
if (phantom_node.IsValidForwardSource())
|
||||||
|
{
|
||||||
|
heap.Insert(phantom_node.forward_segment_id.id,
|
||||||
|
-phantom_node.GetForwardWeightPlusOffset(),
|
||||||
|
{phantom_node.forward_segment_id.id, -phantom_node.GetForwardDuration()});
|
||||||
|
}
|
||||||
|
if (phantom_node.IsValidReverseSource())
|
||||||
|
{
|
||||||
|
heap.Insert(phantom_node.reverse_segment_id.id,
|
||||||
|
-phantom_node.GetReverseWeightPlusOffset(),
|
||||||
|
{phantom_node.reverse_segment_id.id, -phantom_node.GetReverseDuration()});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename ManyToManyQueryHeap>
|
||||||
|
void insertTargetInHeap(ManyToManyQueryHeap &heap, const PhantomNode &phantom_node)
|
||||||
|
{
|
||||||
|
if (phantom_node.IsValidForwardTarget())
|
||||||
|
{
|
||||||
|
heap.Insert(phantom_node.forward_segment_id.id,
|
||||||
|
phantom_node.GetForwardWeightPlusOffset(),
|
||||||
|
{phantom_node.forward_segment_id.id, phantom_node.GetForwardDuration()});
|
||||||
|
}
|
||||||
|
if (phantom_node.IsValidReverseTarget())
|
||||||
|
{
|
||||||
|
heap.Insert(phantom_node.reverse_segment_id.id,
|
||||||
|
phantom_node.GetReverseWeightPlusOffset(),
|
||||||
|
{phantom_node.reverse_segment_id.id, phantom_node.GetReverseDuration()});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <typename FacadeT>
|
template <typename FacadeT>
|
||||||
void annotatePath(const FacadeT &facade,
|
void annotatePath(const FacadeT &facade,
|
||||||
const PhantomNodes &phantom_node_pair,
|
const PhantomNodes &phantom_node_pair,
|
||||||
@@ -112,6 +143,7 @@ void annotatePath(const FacadeT &facade,
|
|||||||
const auto name_index = facade.GetNameIndex(node_id);
|
const auto name_index = facade.GetNameIndex(node_id);
|
||||||
const auto turn_instruction = facade.GetTurnInstructionForEdgeID(turn_id);
|
const auto turn_instruction = facade.GetTurnInstructionForEdgeID(turn_id);
|
||||||
const extractor::TravelMode travel_mode = facade.GetTravelMode(node_id);
|
const extractor::TravelMode travel_mode = facade.GetTravelMode(node_id);
|
||||||
|
const auto classes = facade.GetClassData(node_id);
|
||||||
|
|
||||||
const auto geometry_index = facade.GetGeometryIndex(node_id);
|
const auto geometry_index = facade.GetGeometryIndex(node_id);
|
||||||
std::vector<NodeID> id_vector;
|
std::vector<NodeID> id_vector;
|
||||||
@@ -154,11 +186,14 @@ void annotatePath(const FacadeT &facade,
|
|||||||
unpacked_path.push_back(PathData{id_vector[segment_idx + 1],
|
unpacked_path.push_back(PathData{id_vector[segment_idx + 1],
|
||||||
name_index,
|
name_index,
|
||||||
weight_vector[segment_idx],
|
weight_vector[segment_idx],
|
||||||
|
0,
|
||||||
duration_vector[segment_idx],
|
duration_vector[segment_idx],
|
||||||
|
0,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
extractor::guidance::TurnInstruction::NO_TURN(),
|
||||||
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
||||||
travel_mode,
|
travel_mode,
|
||||||
INVALID_ENTRY_CLASSID,
|
classes,
|
||||||
|
EMPTY_ENTRY_CLASS,
|
||||||
datasource_vector[segment_idx],
|
datasource_vector[segment_idx],
|
||||||
util::guidance::TurnBearing(0),
|
util::guidance::TurnBearing(0),
|
||||||
util::guidance::TurnBearing(0)});
|
util::guidance::TurnBearing(0)});
|
||||||
@@ -167,10 +202,15 @@ void annotatePath(const FacadeT &facade,
|
|||||||
if (facade.HasLaneData(turn_id))
|
if (facade.HasLaneData(turn_id))
|
||||||
unpacked_path.back().lane_data = facade.GetLaneData(turn_id);
|
unpacked_path.back().lane_data = facade.GetLaneData(turn_id);
|
||||||
|
|
||||||
unpacked_path.back().entry_classid = facade.GetEntryClassID(turn_id);
|
const auto turn_duration = facade.GetDurationPenaltyForEdgeID(turn_id);
|
||||||
|
const auto turn_weight = facade.GetWeightPenaltyForEdgeID(turn_id);
|
||||||
|
|
||||||
|
unpacked_path.back().entry_class = facade.GetEntryClass(turn_id);
|
||||||
unpacked_path.back().turn_instruction = turn_instruction;
|
unpacked_path.back().turn_instruction = turn_instruction;
|
||||||
unpacked_path.back().duration_until_turn += facade.GetDurationPenaltyForEdgeID(turn_id);
|
unpacked_path.back().duration_until_turn += turn_duration;
|
||||||
unpacked_path.back().weight_until_turn += facade.GetWeightPenaltyForEdgeID(turn_id);
|
unpacked_path.back().duration_of_turn = turn_duration;
|
||||||
|
unpacked_path.back().weight_until_turn += turn_weight;
|
||||||
|
unpacked_path.back().weight_of_turn = turn_weight;
|
||||||
unpacked_path.back().pre_turn_bearing = facade.PreTurnBearing(turn_id);
|
unpacked_path.back().pre_turn_bearing = facade.PreTurnBearing(turn_id);
|
||||||
unpacked_path.back().post_turn_bearing = facade.PostTurnBearing(turn_id);
|
unpacked_path.back().post_turn_bearing = facade.PostTurnBearing(turn_id);
|
||||||
}
|
}
|
||||||
@@ -229,11 +269,14 @@ void annotatePath(const FacadeT &facade,
|
|||||||
PathData{id_vector[start_index < end_index ? segment_idx + 1 : segment_idx - 1],
|
PathData{id_vector[start_index < end_index ? segment_idx + 1 : segment_idx - 1],
|
||||||
facade.GetNameIndex(target_node_id),
|
facade.GetNameIndex(target_node_id),
|
||||||
weight_vector[segment_idx],
|
weight_vector[segment_idx],
|
||||||
|
0,
|
||||||
duration_vector[segment_idx],
|
duration_vector[segment_idx],
|
||||||
|
0,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
extractor::guidance::TurnInstruction::NO_TURN(),
|
||||||
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
||||||
facade.GetTravelMode(target_node_id),
|
facade.GetTravelMode(target_node_id),
|
||||||
INVALID_ENTRY_CLASSID,
|
facade.GetClassData(target_node_id),
|
||||||
|
EMPTY_ENTRY_CLASS,
|
||||||
datasource_vector[segment_idx],
|
datasource_vector[segment_idx],
|
||||||
util::guidance::TurnBearing(0),
|
util::guidance::TurnBearing(0),
|
||||||
util::guidance::TurnBearing(0)});
|
util::guidance::TurnBearing(0)});
|
||||||
@@ -338,6 +381,39 @@ double getPathDistance(const datafacade::ContiguousInternalMemoryDataFacade<Algo
|
|||||||
return distance;
|
return distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename AlgorithmT>
|
||||||
|
InternalRouteResult
|
||||||
|
extractRoute(const datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT> &facade,
|
||||||
|
const EdgeWeight weight,
|
||||||
|
const PhantomNodes &phantom_nodes,
|
||||||
|
const std::vector<NodeID> &unpacked_nodes,
|
||||||
|
const std::vector<EdgeID> &unpacked_edges)
|
||||||
|
{
|
||||||
|
InternalRouteResult raw_route_data;
|
||||||
|
raw_route_data.segment_end_coordinates = {phantom_nodes};
|
||||||
|
|
||||||
|
// No path found for both target nodes?
|
||||||
|
if (INVALID_EDGE_WEIGHT == weight)
|
||||||
|
{
|
||||||
|
return raw_route_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
raw_route_data.shortest_path_weight = weight;
|
||||||
|
raw_route_data.unpacked_path_segments.resize(1);
|
||||||
|
raw_route_data.source_traversed_in_reverse.push_back(
|
||||||
|
(unpacked_nodes.front() != phantom_nodes.source_phantom.forward_segment_id.id));
|
||||||
|
raw_route_data.target_traversed_in_reverse.push_back(
|
||||||
|
(unpacked_nodes.back() != phantom_nodes.target_phantom.forward_segment_id.id));
|
||||||
|
|
||||||
|
annotatePath(facade,
|
||||||
|
phantom_nodes,
|
||||||
|
unpacked_nodes,
|
||||||
|
unpacked_edges,
|
||||||
|
raw_route_data.unpacked_path_segments.front());
|
||||||
|
|
||||||
|
return raw_route_data;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iterator>
|
||||||
|
#include <limits>
|
||||||
|
#include <tuple>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace engine
|
namespace engine
|
||||||
@@ -24,7 +30,7 @@ namespace
|
|||||||
// Unrestricted search (Args is const PhantomNodes &):
|
// Unrestricted search (Args is const PhantomNodes &):
|
||||||
// * use partition.GetQueryLevel to find the node query level based on source and target phantoms
|
// * use partition.GetQueryLevel to find the node query level based on source and target phantoms
|
||||||
// * allow to traverse all cells
|
// * allow to traverse all cells
|
||||||
inline LevelID getNodeQureyLevel(const partition::MultiLevelPartitionView &partition,
|
inline LevelID getNodeQueryLevel(const partition::MultiLevelPartitionView &partition,
|
||||||
NodeID node,
|
NodeID node,
|
||||||
const PhantomNodes &phantom_nodes)
|
const PhantomNodes &phantom_nodes)
|
||||||
{
|
{
|
||||||
@@ -49,7 +55,7 @@ inline bool checkParentCellRestriction(CellID, const PhantomNodes &) { return tr
|
|||||||
// * use the fixed level for queries
|
// * use the fixed level for queries
|
||||||
// * check if the node cell is the same as the specified parent onr
|
// * check if the node cell is the same as the specified parent onr
|
||||||
inline LevelID
|
inline LevelID
|
||||||
getNodeQureyLevel(const partition::MultiLevelPartitionView &, NodeID, LevelID level, CellID)
|
getNodeQueryLevel(const partition::MultiLevelPartitionView &, NodeID, LevelID level, CellID)
|
||||||
{
|
{
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
@@ -60,6 +66,70 @@ inline bool checkParentCellRestriction(CellID cell, LevelID, CellID parent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Heaps only record for each node its predecessor ("parent") on the shortest path.
|
||||||
|
// For re-constructing the actual path we need to trace back all parent "pointers".
|
||||||
|
// In contrast to the CH code MLD needs to know the edges (with clique arc property).
|
||||||
|
|
||||||
|
using PackedEdge = std::tuple</*from*/ NodeID, /*to*/ NodeID, /*from_clique_arc*/ bool>;
|
||||||
|
using PackedPath = std::vector<PackedEdge>;
|
||||||
|
|
||||||
|
template <bool DIRECTION, typename OutIter>
|
||||||
|
inline void retrievePackedPathFromSingleHeap(const SearchEngineData<Algorithm>::QueryHeap &heap,
|
||||||
|
const NodeID middle,
|
||||||
|
OutIter out)
|
||||||
|
{
|
||||||
|
NodeID current = middle;
|
||||||
|
NodeID parent = heap.GetData(current).parent;
|
||||||
|
|
||||||
|
while (current != parent)
|
||||||
|
{
|
||||||
|
const auto &data = heap.GetData(current);
|
||||||
|
|
||||||
|
if (DIRECTION == FORWARD_DIRECTION)
|
||||||
|
{
|
||||||
|
*out = std::make_tuple(parent, current, data.from_clique_arc);
|
||||||
|
++out;
|
||||||
|
}
|
||||||
|
else if (DIRECTION == REVERSE_DIRECTION)
|
||||||
|
{
|
||||||
|
*out = std::make_tuple(current, parent, data.from_clique_arc);
|
||||||
|
++out;
|
||||||
|
}
|
||||||
|
|
||||||
|
current = parent;
|
||||||
|
parent = heap.GetData(parent).parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <bool DIRECTION>
|
||||||
|
inline PackedPath
|
||||||
|
retrievePackedPathFromSingleHeap(const SearchEngineData<Algorithm>::QueryHeap &heap,
|
||||||
|
const NodeID middle)
|
||||||
|
{
|
||||||
|
PackedPath packed_path;
|
||||||
|
retrievePackedPathFromSingleHeap<DIRECTION>(heap, middle, std::back_inserter(packed_path));
|
||||||
|
return packed_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trace path from middle to start in the forward search space (in reverse)
|
||||||
|
// and from middle to end in the reverse search space. Middle connects paths.
|
||||||
|
|
||||||
|
inline PackedPath
|
||||||
|
retrievePackedPathFromHeap(const SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
||||||
|
const SearchEngineData<Algorithm>::QueryHeap &reverse_heap,
|
||||||
|
const NodeID middle)
|
||||||
|
{
|
||||||
|
// Retrieve start -> middle. Is in reverse order since tracing back starts from middle.
|
||||||
|
auto packed_path = retrievePackedPathFromSingleHeap<FORWARD_DIRECTION>(forward_heap, middle);
|
||||||
|
std::reverse(begin(packed_path), end(packed_path));
|
||||||
|
|
||||||
|
// Retrieve middle -> end. Is already in correct order, tracing starts from middle.
|
||||||
|
auto into = std::back_inserter(packed_path);
|
||||||
|
retrievePackedPathFromSingleHeap<REVERSE_DIRECTION>(reverse_heap, middle, into);
|
||||||
|
|
||||||
|
return packed_path;
|
||||||
|
}
|
||||||
|
|
||||||
template <bool DIRECTION, typename... Args>
|
template <bool DIRECTION, typename... Args>
|
||||||
void routingStep(const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
void routingStep(const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
||||||
SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
||||||
@@ -96,7 +166,7 @@ void routingStep(const datafacade::ContiguousInternalMemoryDataFacade<Algorithm>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto level = getNodeQureyLevel(partition, node, args...);
|
const auto level = getNodeQueryLevel(partition, node, args...);
|
||||||
|
|
||||||
if (level >= 1 && !forward_heap.GetData(node).from_clique_arc)
|
if (level >= 1 && !forward_heap.GetData(node).from_clique_arc)
|
||||||
{
|
{
|
||||||
@@ -112,6 +182,7 @@ void routingStep(const datafacade::ContiguousInternalMemoryDataFacade<Algorithm>
|
|||||||
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
||||||
{
|
{
|
||||||
const EdgeWeight to_weight = weight + shortcut_weight;
|
const EdgeWeight to_weight = weight + shortcut_weight;
|
||||||
|
BOOST_ASSERT(to_weight >= weight);
|
||||||
if (!forward_heap.WasInserted(to))
|
if (!forward_heap.WasInserted(to))
|
||||||
{
|
{
|
||||||
forward_heap.Insert(to, to_weight, {node, true});
|
forward_heap.Insert(to, to_weight, {node, true});
|
||||||
@@ -137,6 +208,7 @@ void routingStep(const datafacade::ContiguousInternalMemoryDataFacade<Algorithm>
|
|||||||
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
||||||
{
|
{
|
||||||
const EdgeWeight to_weight = weight + shortcut_weight;
|
const EdgeWeight to_weight = weight + shortcut_weight;
|
||||||
|
BOOST_ASSERT(to_weight >= weight);
|
||||||
if (!forward_heap.WasInserted(to))
|
if (!forward_heap.WasInserted(to))
|
||||||
{
|
{
|
||||||
forward_heap.Insert(to, to_weight, {node, true});
|
forward_heap.Insert(to, to_weight, {node, true});
|
||||||
@@ -179,9 +251,17 @@ void routingStep(const datafacade::ContiguousInternalMemoryDataFacade<Algorithm>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// With (s, middle, t) we trace back the paths middle -> s and middle -> t.
|
||||||
|
// This gives us a packed path (node ids) from the base graph around s and t,
|
||||||
|
// and overlay node ids otherwise. We then have to unpack the overlay clique
|
||||||
|
// edges by recursively descending unpacking the path down to the base graph.
|
||||||
|
|
||||||
|
using UnpackedNodes = std::vector<NodeID>;
|
||||||
|
using UnpackedEdges = std::vector<EdgeID>;
|
||||||
|
using UnpackedPath = std::tuple<EdgeWeight, UnpackedNodes, UnpackedEdges>;
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
std::tuple<EdgeWeight, std::vector<NodeID>, std::vector<EdgeID>>
|
UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
search(SearchEngineData<Algorithm> &engine_working_data,
|
|
||||||
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
||||||
SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
||||||
SearchEngineData<Algorithm>::QueryHeap &reverse_heap,
|
SearchEngineData<Algorithm>::QueryHeap &reverse_heap,
|
||||||
@@ -242,27 +322,12 @@ search(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
return std::make_tuple(INVALID_EDGE_WEIGHT, std::vector<NodeID>(), std::vector<EdgeID>());
|
return std::make_tuple(INVALID_EDGE_WEIGHT, std::vector<NodeID>(), std::vector<EdgeID>());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get packed path as edges {from node ID, to node ID, edge ID}
|
// Get packed path as edges {from node ID, to node ID, from_clique_arc}
|
||||||
std::vector<std::tuple<NodeID, NodeID, bool>> packed_path;
|
auto packed_path = retrievePackedPathFromHeap(forward_heap, reverse_heap, middle);
|
||||||
NodeID current_node = middle, parent_node = forward_heap.GetData(middle).parent;
|
|
||||||
while (parent_node != current_node)
|
|
||||||
{
|
|
||||||
const auto &data = forward_heap.GetData(current_node);
|
|
||||||
packed_path.push_back(std::make_tuple(parent_node, current_node, data.from_clique_arc));
|
|
||||||
current_node = parent_node;
|
|
||||||
parent_node = forward_heap.GetData(parent_node).parent;
|
|
||||||
}
|
|
||||||
std::reverse(std::begin(packed_path), std::end(packed_path));
|
|
||||||
const NodeID source_node = current_node;
|
|
||||||
|
|
||||||
current_node = middle, parent_node = reverse_heap.GetData(middle).parent;
|
// Beware the edge case when start, middle, end are all the same.
|
||||||
while (parent_node != current_node)
|
// In this case we return a single node, no edges. We also don't unpack.
|
||||||
{
|
const NodeID source_node = !packed_path.empty() ? std::get<0>(packed_path.front()) : middle;
|
||||||
const auto &data = reverse_heap.GetData(current_node);
|
|
||||||
packed_path.push_back(std::make_tuple(current_node, parent_node, data.from_clique_arc));
|
|
||||||
current_node = parent_node;
|
|
||||||
parent_node = reverse_heap.GetData(parent_node).parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unpack path
|
// Unpack path
|
||||||
std::vector<NodeID> unpacked_nodes;
|
std::vector<NodeID> unpacked_nodes;
|
||||||
@@ -271,6 +336,7 @@ search(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
unpacked_edges.reserve(packed_path.size());
|
unpacked_edges.reserve(packed_path.size());
|
||||||
|
|
||||||
unpacked_nodes.push_back(source_node);
|
unpacked_nodes.push_back(source_node);
|
||||||
|
|
||||||
for (auto const &packed_edge : packed_path)
|
for (auto const &packed_edge : packed_path)
|
||||||
{
|
{
|
||||||
NodeID source, target;
|
NodeID source, target;
|
||||||
@@ -283,7 +349,7 @@ search(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // an overlay graph edge
|
{ // an overlay graph edge
|
||||||
LevelID level = getNodeQureyLevel(partition, source, args...);
|
LevelID level = getNodeQueryLevel(partition, source, args...);
|
||||||
CellID parent_cell_id = partition.GetCell(level, source);
|
CellID parent_cell_id = partition.GetCell(level, source);
|
||||||
BOOST_ASSERT(parent_cell_id == partition.GetCell(level, target));
|
BOOST_ASSERT(parent_cell_id == partition.GetCell(level, target));
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,19 @@ struct MultiLayerDijkstraHeapData
|
|||||||
MultiLayerDijkstraHeapData(NodeID p, bool from) : parent(p), from_clique_arc(from) {}
|
MultiLayerDijkstraHeapData(NodeID p, bool from) : parent(p), from_clique_arc(from) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ManyToManyMultiLayerDijkstraHeapData : MultiLayerDijkstraHeapData
|
||||||
|
{
|
||||||
|
EdgeWeight duration;
|
||||||
|
ManyToManyMultiLayerDijkstraHeapData(NodeID p, EdgeWeight duration)
|
||||||
|
: MultiLayerDijkstraHeapData(p), duration(duration)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
ManyToManyMultiLayerDijkstraHeapData(NodeID p, bool from, EdgeWeight duration)
|
||||||
|
: MultiLayerDijkstraHeapData(p, from), duration(duration)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
|
template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
|
||||||
{
|
{
|
||||||
using QueryHeap = util::QueryHeap<NodeID,
|
using QueryHeap = util::QueryHeap<NodeID,
|
||||||
@@ -86,12 +99,23 @@ template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
|
|||||||
MultiLayerDijkstraHeapData,
|
MultiLayerDijkstraHeapData,
|
||||||
util::UnorderedMapStorage<NodeID, int>>;
|
util::UnorderedMapStorage<NodeID, int>>;
|
||||||
|
|
||||||
|
using ManyToManyQueryHeap = util::QueryHeap<NodeID,
|
||||||
|
NodeID,
|
||||||
|
EdgeWeight,
|
||||||
|
ManyToManyMultiLayerDijkstraHeapData,
|
||||||
|
util::UnorderedMapStorage<NodeID, int>>;
|
||||||
|
|
||||||
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
|
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
|
||||||
|
|
||||||
|
using ManyToManyHeapPtr = boost::thread_specific_ptr<ManyToManyQueryHeap>;
|
||||||
|
|
||||||
static SearchEngineHeapPtr forward_heap_1;
|
static SearchEngineHeapPtr forward_heap_1;
|
||||||
static SearchEngineHeapPtr reverse_heap_1;
|
static SearchEngineHeapPtr reverse_heap_1;
|
||||||
|
static ManyToManyHeapPtr many_to_many_heap;
|
||||||
|
|
||||||
void InitializeOrClearFirstThreadLocalStorage(unsigned number_of_nodes);
|
void InitializeOrClearFirstThreadLocalStorage(unsigned number_of_nodes);
|
||||||
|
|
||||||
|
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef OSRM_EXTRACTOR_CLASSES_DATA_HPP
|
||||||
|
#define OSRM_EXTRACTOR_CLASSES_DATA_HPP
|
||||||
|
|
||||||
|
#include "util/bit_range.hpp"
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace extractor
|
||||||
|
{
|
||||||
|
|
||||||
|
using ClassData = std::uint8_t;
|
||||||
|
static const std::uint8_t MAX_CLASS_INDEX = 8 - 1;
|
||||||
|
|
||||||
|
inline bool isSubset(const ClassData lhs, const ClassData rhs) { return (lhs & rhs) == lhs; }
|
||||||
|
|
||||||
|
inline auto getClassIndexes(const ClassData data) { return util::makeBitRange<ClassData>(data); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -83,8 +83,6 @@ class EdgeBasedGraphFactory
|
|||||||
const extractor::PackedOSMIDs &osm_node_ids,
|
const extractor::PackedOSMIDs &osm_node_ids,
|
||||||
ProfileProperties profile_properties,
|
ProfileProperties profile_properties,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
std::vector<std::uint32_t> &turn_lane_offsets,
|
|
||||||
std::vector<guidance::TurnLaneType::Mask> &turn_lane_masks,
|
|
||||||
guidance::LaneDescriptionMap &lane_description_map);
|
guidance::LaneDescriptionMap &lane_description_map);
|
||||||
|
|
||||||
void Run(ScriptingEnvironment &scripting_environment,
|
void Run(ScriptingEnvironment &scripting_environment,
|
||||||
@@ -150,8 +148,6 @@ class EdgeBasedGraphFactory
|
|||||||
ProfileProperties profile_properties;
|
ProfileProperties profile_properties;
|
||||||
|
|
||||||
const util::NameTable &name_table;
|
const util::NameTable &name_table;
|
||||||
std::vector<std::uint32_t> &turn_lane_offsets;
|
|
||||||
std::vector<guidance::TurnLaneType::Mask> &turn_lane_masks;
|
|
||||||
guidance::LaneDescriptionMap &lane_description_map;
|
guidance::LaneDescriptionMap &lane_description_map;
|
||||||
|
|
||||||
unsigned RenumberEdges();
|
unsigned RenumberEdges();
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
#ifndef EXTERNAL_MEMORY_NODE_HPP_
|
|
||||||
#define EXTERNAL_MEMORY_NODE_HPP_
|
|
||||||
|
|
||||||
#include "extractor/query_node.hpp"
|
|
||||||
|
|
||||||
#include "util/typedefs.hpp"
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
|
|
||||||
struct ExternalMemoryNode : QueryNode
|
|
||||||
{
|
|
||||||
ExternalMemoryNode(const util::FixedLongitude lon_,
|
|
||||||
const util::FixedLatitude lat_,
|
|
||||||
OSMNodeID node_id_,
|
|
||||||
bool barrier_,
|
|
||||||
bool traffic_lights_)
|
|
||||||
: QueryNode(lon_, lat_, node_id_), barrier(barrier_), traffic_lights(traffic_lights_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ExternalMemoryNode() : barrier(false), traffic_lights(false) {}
|
|
||||||
|
|
||||||
static ExternalMemoryNode min_value()
|
|
||||||
{
|
|
||||||
return ExternalMemoryNode(
|
|
||||||
util::FixedLongitude{0}, util::FixedLatitude{0}, MIN_OSM_NODEID, false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ExternalMemoryNode max_value()
|
|
||||||
{
|
|
||||||
return ExternalMemoryNode(util::FixedLongitude{std::numeric_limits<std::int32_t>::max()},
|
|
||||||
util::FixedLatitude{std::numeric_limits<std::int32_t>::max()},
|
|
||||||
MAX_OSM_NODEID,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool barrier;
|
|
||||||
bool traffic_lights;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ExternalMemoryNodeSTXXLCompare
|
|
||||||
{
|
|
||||||
using value_type = ExternalMemoryNode;
|
|
||||||
value_type max_value() { return value_type::max_value(); }
|
|
||||||
value_type min_value() { return value_type::min_value(); }
|
|
||||||
bool operator()(const value_type &left, const value_type &right) const
|
|
||||||
{
|
|
||||||
return left.node_id < right.node_id;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* EXTERNAL_MEMORY_NODE_HPP_ */
|
|
||||||
@@ -1,40 +1,28 @@
|
|||||||
#ifndef EXTRACTION_CONTAINERS_HPP
|
#ifndef EXTRACTION_CONTAINERS_HPP
|
||||||
#define EXTRACTION_CONTAINERS_HPP
|
#define EXTRACTION_CONTAINERS_HPP
|
||||||
|
|
||||||
#include "extractor/external_memory_node.hpp"
|
|
||||||
#include "extractor/first_and_last_segment_of_way.hpp"
|
#include "extractor/first_and_last_segment_of_way.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
#include "extractor/internal_extractor_edge.hpp"
|
#include "extractor/internal_extractor_edge.hpp"
|
||||||
|
#include "extractor/query_node.hpp"
|
||||||
#include "extractor/restriction.hpp"
|
#include "extractor/restriction.hpp"
|
||||||
#include "extractor/scripting_environment.hpp"
|
#include "extractor/scripting_environment.hpp"
|
||||||
|
|
||||||
#include "storage/io.hpp"
|
#include "storage/io.hpp"
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <stxxl/vector>
|
|
||||||
#include <unordered_map>
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses external memory containers from stxxl to store all the data that
|
* Uses memory containers to store all the data that
|
||||||
* is collected by the extractor callbacks.
|
* is collected by the extractor callbacks.
|
||||||
*
|
*
|
||||||
* The data is the filtered, aggregated and finally written to disk.
|
* The data is the filtered, aggregated and finally written to disk.
|
||||||
*/
|
*/
|
||||||
class ExtractionContainers
|
class ExtractionContainers
|
||||||
{
|
{
|
||||||
#ifndef _MSC_VER
|
|
||||||
constexpr static unsigned stxxl_memory =
|
|
||||||
((sizeof(std::size_t) == 4) ? std::numeric_limits<int>::max()
|
|
||||||
: std::numeric_limits<unsigned>::max());
|
|
||||||
#else
|
|
||||||
const static unsigned stxxl_memory = ((sizeof(std::size_t) == 4) ? INT_MAX : UINT_MAX);
|
|
||||||
#endif
|
|
||||||
void FlushVectors();
|
|
||||||
void PrepareNodes();
|
void PrepareNodes();
|
||||||
void PrepareRestrictions();
|
void PrepareRestrictions();
|
||||||
void PrepareEdges(ScriptingEnvironment &scripting_environment);
|
void PrepareEdges(ScriptingEnvironment &scripting_environment);
|
||||||
@@ -45,23 +33,24 @@ class ExtractionContainers
|
|||||||
void WriteCharData(const std::string &file_name);
|
void WriteCharData(const std::string &file_name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using STXXLNodeIDVector = stxxl::vector<OSMNodeID>;
|
using NodeIDVector = std::vector<OSMNodeID>;
|
||||||
using STXXLNodeVector = stxxl::vector<ExternalMemoryNode>;
|
using NodeVector = std::vector<QueryNode>;
|
||||||
using STXXLEdgeVector = stxxl::vector<InternalExtractorEdge>;
|
using EdgeVector = std::vector<InternalExtractorEdge>;
|
||||||
using RestrictionsVector = std::vector<InputRestrictionContainer>;
|
using RestrictionsVector = std::vector<InputRestrictionContainer>;
|
||||||
using STXXLWayIDStartEndVector = stxxl::vector<FirstAndLastSegmentOfWay>;
|
using WayIDStartEndVector = std::vector<FirstAndLastSegmentOfWay>;
|
||||||
using STXXLNameCharData = stxxl::vector<unsigned char>;
|
using NameCharData = std::vector<unsigned char>;
|
||||||
using STXXLNameOffsets = stxxl::vector<unsigned>;
|
using NameOffsets = std::vector<unsigned>;
|
||||||
|
|
||||||
STXXLNodeIDVector used_node_id_list;
|
std::vector<OSMNodeID> barrier_nodes;
|
||||||
STXXLNodeVector all_nodes_list;
|
std::vector<OSMNodeID> traffic_lights;
|
||||||
STXXLEdgeVector all_edges_list;
|
NodeIDVector used_node_id_list;
|
||||||
STXXLNameCharData name_char_data;
|
NodeVector all_nodes_list;
|
||||||
STXXLNameOffsets name_offsets;
|
EdgeVector all_edges_list;
|
||||||
|
NameCharData name_char_data;
|
||||||
|
NameOffsets name_offsets;
|
||||||
// an adjacency array containing all turn lane masks
|
// an adjacency array containing all turn lane masks
|
||||||
RestrictionsVector restrictions_list;
|
RestrictionsVector restrictions_list;
|
||||||
STXXLWayIDStartEndVector way_start_end_id_list;
|
WayIDStartEndVector way_start_end_id_list;
|
||||||
std::unordered_map<OSMNodeID, NodeID> external_to_internal_node_id_map;
|
|
||||||
unsigned max_internal_node_id;
|
unsigned max_internal_node_id;
|
||||||
std::vector<TurnRestriction> unconditional_turn_restrictions;
|
std::vector<TurnRestriction> unconditional_turn_restrictions;
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ struct ExtractionWay
|
|||||||
ref.clear();
|
ref.clear();
|
||||||
pronunciation.clear();
|
pronunciation.clear();
|
||||||
destinations.clear();
|
destinations.clear();
|
||||||
|
exits.clear();
|
||||||
forward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
forward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
||||||
backward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
backward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
||||||
turn_lanes_forward.clear();
|
turn_lanes_forward.clear();
|
||||||
@@ -69,6 +70,8 @@ struct ExtractionWay
|
|||||||
const char *GetRef() const { return ref.c_str(); }
|
const char *GetRef() const { return ref.c_str(); }
|
||||||
void SetDestinations(const char *value) { detail::maybeSetString(destinations, value); }
|
void SetDestinations(const char *value) { detail::maybeSetString(destinations, value); }
|
||||||
const char *GetDestinations() const { return destinations.c_str(); }
|
const char *GetDestinations() const { return destinations.c_str(); }
|
||||||
|
void SetExits(const char *value) { detail::maybeSetString(exits, value); }
|
||||||
|
const char *GetExits() const { return exits.c_str(); }
|
||||||
void SetPronunciation(const char *value) { detail::maybeSetString(pronunciation, value); }
|
void SetPronunciation(const char *value) { detail::maybeSetString(pronunciation, value); }
|
||||||
const char *GetPronunciation() const { return pronunciation.c_str(); }
|
const char *GetPronunciation() const { return pronunciation.c_str(); }
|
||||||
void SetTurnLanesForward(const char *value)
|
void SetTurnLanesForward(const char *value)
|
||||||
@@ -82,6 +85,10 @@ struct ExtractionWay
|
|||||||
}
|
}
|
||||||
const char *GetTurnLanesBackward() const { return turn_lanes_backward.c_str(); }
|
const char *GetTurnLanesBackward() const { return turn_lanes_backward.c_str(); }
|
||||||
|
|
||||||
|
// markers for determining user-defined classes for each way
|
||||||
|
std::unordered_map<std::string, bool> forward_classes;
|
||||||
|
std::unordered_map<std::string, bool> backward_classes;
|
||||||
|
|
||||||
// speed in km/h
|
// speed in km/h
|
||||||
double forward_speed;
|
double forward_speed;
|
||||||
double backward_speed;
|
double backward_speed;
|
||||||
@@ -96,6 +103,7 @@ struct ExtractionWay
|
|||||||
std::string ref;
|
std::string ref;
|
||||||
std::string pronunciation;
|
std::string pronunciation;
|
||||||
std::string destinations;
|
std::string destinations;
|
||||||
|
std::string exits;
|
||||||
std::string turn_lanes_forward;
|
std::string turn_lanes_forward;
|
||||||
std::string turn_lanes_backward;
|
std::string turn_lanes_backward;
|
||||||
guidance::RoadClassification road_classification;
|
guidance::RoadClassification road_classification;
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ class Extractor
|
|||||||
private:
|
private:
|
||||||
ExtractorConfig config;
|
ExtractorConfig config;
|
||||||
|
|
||||||
std::vector<TurnRestriction> ParseOSMData(ScriptingEnvironment &scripting_environment,
|
std::tuple<guidance::LaneDescriptionMap, std::vector<TurnRestriction>>
|
||||||
const unsigned number_of_threads);
|
ParseOSMData(ScriptingEnvironment &scripting_environment, const unsigned number_of_threads);
|
||||||
|
|
||||||
std::pair<std::size_t, EdgeID>
|
std::pair<std::size_t, EdgeID>
|
||||||
BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment,
|
BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment,
|
||||||
@@ -69,9 +69,8 @@ class Extractor
|
|||||||
std::vector<EdgeWeight> &edge_based_node_weights,
|
std::vector<EdgeWeight> &edge_based_node_weights,
|
||||||
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
||||||
const std::string &intersection_class_output_file,
|
const std::string &intersection_class_output_file,
|
||||||
std::vector<TurnRestriction> &turn_restrictions);
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
void WriteProfileProperties(const std::string &output_path,
|
guidance::LaneDescriptionMap &turn_lane_map);
|
||||||
const ProfileProperties &properties) const;
|
|
||||||
void FindComponents(unsigned max_edge_id,
|
void FindComponents(unsigned max_edge_id,
|
||||||
const util::DeallocatingVector<EdgeBasedEdge> &input_edge_list,
|
const util::DeallocatingVector<EdgeBasedEdge> &input_edge_list,
|
||||||
const std::vector<EdgeBasedNodeSegment> &input_node_segments,
|
const std::vector<EdgeBasedNodeSegment> &input_node_segments,
|
||||||
@@ -92,20 +91,10 @@ class Extractor
|
|||||||
const std::vector<util::guidance::BearingClass> &bearing_classes,
|
const std::vector<util::guidance::BearingClass> &bearing_classes,
|
||||||
const std::vector<util::guidance::EntryClass> &entry_classes) const;
|
const std::vector<util::guidance::EntryClass> &entry_classes) const;
|
||||||
|
|
||||||
void WriteTurnLaneData(const std::string &turn_lane_file) const;
|
|
||||||
|
|
||||||
// Writes compressed node based graph and its embedding into a file for osrm-partition to use.
|
// Writes compressed node based graph and its embedding into a file for osrm-partition to use.
|
||||||
static void WriteCompressedNodeBasedGraph(const std::string &path,
|
static void WriteCompressedNodeBasedGraph(const std::string &path,
|
||||||
const util::NodeBasedDynamicGraph &graph,
|
const util::NodeBasedDynamicGraph &graph,
|
||||||
const std::vector<util::Coordinate> &coordiantes);
|
const std::vector<util::Coordinate> &coordiantes);
|
||||||
|
|
||||||
// globals persisting during the extraction process and the graph generation process
|
|
||||||
|
|
||||||
// during turn lane analysis, we might have to combine lanes for roads that are modelled as two
|
|
||||||
// but are more or less experienced as one. This can be due to solid lines in between lanes, for
|
|
||||||
// example, that genereate a small separation between them. As a result, we might have to
|
|
||||||
// augment the turn lane map during processing, further adding more types.
|
|
||||||
guidance::LaneDescriptionMap turn_lane_map;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef EXTRACTOR_CALLBACKS_HPP
|
#ifndef EXTRACTOR_CALLBACKS_HPP
|
||||||
#define EXTRACTOR_CALLBACKS_HPP
|
#define EXTRACTOR_CALLBACKS_HPP
|
||||||
|
|
||||||
|
#include "extractor/class_data.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
@@ -18,10 +19,10 @@ class Way;
|
|||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
template <> struct hash<std::tuple<std::string, std::string, std::string, std::string>>
|
template <> struct hash<std::tuple<std::string, std::string, std::string, std::string, std::string>>
|
||||||
{
|
{
|
||||||
std::size_t
|
std::size_t operator()(
|
||||||
operator()(const std::tuple<std::string, std::string, std::string, std::string> &mk) const
|
const std::tuple<std::string, std::string, std::string, std::string, std::string> &mk) const
|
||||||
noexcept
|
noexcept
|
||||||
{
|
{
|
||||||
std::size_t seed = 0;
|
std::size_t seed = 0;
|
||||||
@@ -29,6 +30,7 @@ template <> struct hash<std::tuple<std::string, std::string, std::string, std::s
|
|||||||
boost::hash_combine(seed, std::get<1>(mk));
|
boost::hash_combine(seed, std::get<1>(mk));
|
||||||
boost::hash_combine(seed, std::get<2>(mk));
|
boost::hash_combine(seed, std::get<2>(mk));
|
||||||
boost::hash_combine(seed, std::get<3>(mk));
|
boost::hash_combine(seed, std::get<3>(mk));
|
||||||
|
boost::hash_combine(seed, std::get<4>(mk));
|
||||||
return seed;
|
return seed;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -55,18 +57,23 @@ struct ProfileProperties;
|
|||||||
class ExtractorCallbacks
|
class ExtractorCallbacks
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
// used to deduplicate street names, refs, destinations, pronunciation: actually maps to name
|
// used to deduplicate street names, refs, destinations, pronunciation, exits:
|
||||||
// ids
|
// actually maps to name ids
|
||||||
using MapKey = std::tuple<std::string, std::string, std::string, std::string>;
|
using MapKey = std::tuple<std::string, std::string, std::string, std::string, std::string>;
|
||||||
using MapVal = unsigned;
|
using MapVal = unsigned;
|
||||||
std::unordered_map<MapKey, MapVal> string_map;
|
std::unordered_map<MapKey, MapVal> string_map;
|
||||||
guidance::LaneDescriptionMap lane_description_map;
|
|
||||||
ExtractionContainers &external_memory;
|
ExtractionContainers &external_memory;
|
||||||
|
std::unordered_map<std::string, ClassData> &classes_map;
|
||||||
|
guidance::LaneDescriptionMap &lane_description_map;
|
||||||
bool fallback_to_duration;
|
bool fallback_to_duration;
|
||||||
bool force_split_edges;
|
bool force_split_edges;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
using ClassesMap = std::unordered_map<std::string, ClassData>;
|
||||||
|
|
||||||
explicit ExtractorCallbacks(ExtractionContainers &extraction_containers,
|
explicit ExtractorCallbacks(ExtractionContainers &extraction_containers,
|
||||||
|
std::unordered_map<std::string, ClassData> &classes_map,
|
||||||
|
guidance::LaneDescriptionMap &lane_description_map,
|
||||||
const ProfileProperties &properties);
|
const ProfileProperties &properties);
|
||||||
|
|
||||||
ExtractorCallbacks(const ExtractorCallbacks &) = delete;
|
ExtractorCallbacks(const ExtractorCallbacks &) = delete;
|
||||||
@@ -80,9 +87,6 @@ class ExtractorCallbacks
|
|||||||
|
|
||||||
// warning: caller needs to take care of synchronization!
|
// warning: caller needs to take care of synchronization!
|
||||||
void ProcessWay(const osmium::Way ¤t_way, const ExtractionWay &result_way);
|
void ProcessWay(const osmium::Way ¤t_way, const ExtractionWay &result_way);
|
||||||
|
|
||||||
// destroys the internal laneDescriptionMap
|
|
||||||
guidance::LaneDescriptionMap &&moveOutLaneDescriptionMap();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,15 @@
|
|||||||
#include "extractor/edge_based_edge.hpp"
|
#include "extractor/edge_based_edge.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/serialization.hpp"
|
#include "extractor/serialization.hpp"
|
||||||
#include "extractor/turn_data_container.hpp"
|
#include "extractor/turn_data_container.hpp"
|
||||||
|
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
|
#include "util/guidance/bearing_class.hpp"
|
||||||
|
#include "util/guidance/entry_class.hpp"
|
||||||
#include "util/packed_vector.hpp"
|
#include "util/packed_vector.hpp"
|
||||||
|
#include "util/range_table.hpp"
|
||||||
#include "util/serialization.hpp"
|
#include "util/serialization.hpp"
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
@@ -20,6 +24,58 @@ namespace extractor
|
|||||||
namespace files
|
namespace files
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// writes the .osrm.icd file
|
||||||
|
template <typename IntersectionBearingsT, typename EntryClassVectorT>
|
||||||
|
inline void writeIntersections(const boost::filesystem::path &path,
|
||||||
|
const IntersectionBearingsT &intersection_bearings,
|
||||||
|
const EntryClassVectorT &entry_classes)
|
||||||
|
{
|
||||||
|
static_assert(std::is_same<IntersectionBearingsContainer, IntersectionBearingsT>::value ||
|
||||||
|
std::is_same<IntersectionBearingsView, IntersectionBearingsT>::value,
|
||||||
|
"");
|
||||||
|
|
||||||
|
storage::io::FileWriter writer(path, storage::io::FileWriter::GenerateFingerprint);
|
||||||
|
|
||||||
|
serialization::write(writer, intersection_bearings);
|
||||||
|
storage::serialization::write(writer, entry_classes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// read the .osrm.icd file
|
||||||
|
template <typename IntersectionBearingsT, typename EntryClassVectorT>
|
||||||
|
inline void readIntersections(const boost::filesystem::path &path,
|
||||||
|
IntersectionBearingsT &intersection_bearings,
|
||||||
|
EntryClassVectorT &entry_classes)
|
||||||
|
{
|
||||||
|
static_assert(std::is_same<IntersectionBearingsContainer, IntersectionBearingsT>::value ||
|
||||||
|
std::is_same<IntersectionBearingsView, IntersectionBearingsT>::value,
|
||||||
|
"");
|
||||||
|
|
||||||
|
storage::io::FileReader reader(path, storage::io::FileReader::VerifyFingerprint);
|
||||||
|
|
||||||
|
serialization::read(reader, intersection_bearings);
|
||||||
|
storage::serialization::read(reader, entry_classes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// reads .osrm.properties
|
||||||
|
inline void readProfileProperties(const boost::filesystem::path &path,
|
||||||
|
ProfileProperties &properties)
|
||||||
|
{
|
||||||
|
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||||
|
storage::io::FileReader reader{path, fingerprint};
|
||||||
|
|
||||||
|
serialization::read(reader, properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
// writes .osrm.properties
|
||||||
|
inline void writeProfileProperties(const boost::filesystem::path &path,
|
||||||
|
const ProfileProperties &properties)
|
||||||
|
{
|
||||||
|
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||||
|
storage::io::FileWriter writer{path, fingerprint};
|
||||||
|
|
||||||
|
serialization::write(writer, properties);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename EdgeBasedEdgeVector>
|
template <typename EdgeBasedEdgeVector>
|
||||||
void writeEdgeBasedGraph(const boost::filesystem::path &path,
|
void writeEdgeBasedGraph(const boost::filesystem::path &path,
|
||||||
EdgeID const max_edge_id,
|
EdgeID const max_edge_id,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef FIRST_AND_LAST_SEGMENT_OF_WAY_HPP
|
#ifndef FIRST_AND_LAST_SEGMENT_OF_WAY_HPP
|
||||||
#define FIRST_AND_LAST_SEGMENT_OF_WAY_HPP
|
#define FIRST_AND_LAST_SEGMENT_OF_WAY_HPP
|
||||||
|
|
||||||
#include "extractor/external_memory_node.hpp"
|
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@@ -44,7 +43,7 @@ struct FirstAndLastSegmentOfWay
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FirstAndLastSegmentOfWayStxxlCompare
|
struct FirstAndLastSegmentOfWayCompare
|
||||||
{
|
{
|
||||||
using value_type = FirstAndLastSegmentOfWay;
|
using value_type = FirstAndLastSegmentOfWay;
|
||||||
bool operator()(const FirstAndLastSegmentOfWay &a, const FirstAndLastSegmentOfWay &b) const
|
bool operator()(const FirstAndLastSegmentOfWay &a, const FirstAndLastSegmentOfWay &b) const
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#ifndef OSRM_EXTRACTOR_GUIDANCE_DRIVEWAY_HANDLER_HPP
|
||||||
|
#define OSRM_EXTRACTOR_GUIDANCE_DRIVEWAY_HANDLER_HPP
|
||||||
|
|
||||||
|
#include "extractor/guidance/intersection_handler.hpp"
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace extractor
|
||||||
|
{
|
||||||
|
namespace guidance
|
||||||
|
{
|
||||||
|
|
||||||
|
// Intersection handlers deal with all issues related to intersections.
|
||||||
|
class DrivewayHandler final : public IntersectionHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DrivewayHandler(const IntersectionGenerator &intersection_generator,
|
||||||
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
|
const util::NameTable &name_table,
|
||||||
|
const SuffixTable &street_name_suffix_table);
|
||||||
|
|
||||||
|
~DrivewayHandler() override final = default;
|
||||||
|
|
||||||
|
// check whether the handler can actually handle the intersection
|
||||||
|
bool canProcess(const NodeID nid,
|
||||||
|
const EdgeID via_eid,
|
||||||
|
const Intersection &intersection) const override final;
|
||||||
|
|
||||||
|
// process the intersection
|
||||||
|
Intersection operator()(const NodeID nid,
|
||||||
|
const EdgeID via_eid,
|
||||||
|
Intersection intersection) const override final;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace guidance
|
||||||
|
} // namespace extractor
|
||||||
|
} // namespace osrm
|
||||||
|
|
||||||
|
#endif /* OSRM_EXTRACTOR_GUIDANCE_DRIVEWAY_HANDLER_HPP */
|
||||||
@@ -27,7 +27,6 @@ namespace guidance
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Intersection handlers deal with all issues related to intersections.
|
// Intersection handlers deal with all issues related to intersections.
|
||||||
// They assign appropriate turn operations to the TurnOperations.
|
|
||||||
// This base class provides both the interface and implementations for
|
// This base class provides both the interface and implementations for
|
||||||
// common functions.
|
// common functions.
|
||||||
class IntersectionHandler
|
class IntersectionHandler
|
||||||
@@ -114,6 +113,8 @@ class IntersectionHandler
|
|||||||
// For this scenario returns intersection at `b` and `b`.
|
// For this scenario returns intersection at `b` and `b`.
|
||||||
boost::optional<IntersectionHandler::IntersectionViewAndNode>
|
boost::optional<IntersectionHandler::IntersectionViewAndNode>
|
||||||
getNextIntersection(const NodeID at, const EdgeID via) const;
|
getNextIntersection(const NodeID at, const EdgeID via) const;
|
||||||
|
|
||||||
|
bool isSameName(const EdgeID source_edge_id, const EdgeID target_edge_id) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Impl.
|
// Impl.
|
||||||
@@ -410,11 +411,8 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
const auto &best_option_data =
|
const auto &best_option_data =
|
||||||
node_based_graph.GetEdgeData(intersection[best_option].eid);
|
node_based_graph.GetEdgeData(intersection[best_option].eid);
|
||||||
const auto adjusted_distinction_ratio = [&]() {
|
const auto adjusted_distinction_ratio = [&]() {
|
||||||
// not allowed competitors are easily distinct
|
// obviousness by road classes
|
||||||
if (!intersection[index].entry_allowed)
|
if (in_way_data.road_classification == best_option_data.road_classification &&
|
||||||
return 0.7 * DISTINCTION_RATIO;
|
|
||||||
// a bit less obvious are road classes
|
|
||||||
else if (in_way_data.road_classification == best_option_data.road_classification &&
|
|
||||||
best_option_data.road_classification.GetPriority() <
|
best_option_data.road_classification.GetPriority() <
|
||||||
node_based_graph.GetEdgeData(intersection[index].eid)
|
node_based_graph.GetEdgeData(intersection[index].eid)
|
||||||
.road_classification.GetPriority())
|
.road_classification.GetPriority())
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ namespace guidance
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Intersection handlers deal with all issues related to intersections.
|
// Intersection handlers deal with all issues related to intersections.
|
||||||
// They assign appropriate turn operations to the TurnOperations.
|
|
||||||
class MotorwayHandler : public IntersectionHandler
|
class MotorwayHandler : public IntersectionHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ namespace guidance
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Intersection handlers deal with all issues related to intersections.
|
// Intersection handlers deal with all issues related to intersections.
|
||||||
// They assign appropriate turn operations to the TurnOperations.
|
|
||||||
class SliproadHandler final : public IntersectionHandler
|
class SliproadHandler final : public IntersectionHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define OSRM_EXTRACTOR_TURN_ANALYSIS
|
#define OSRM_EXTRACTOR_TURN_ANALYSIS
|
||||||
|
|
||||||
#include "extractor/compressed_edge_container.hpp"
|
#include "extractor/compressed_edge_container.hpp"
|
||||||
|
#include "extractor/guidance/driveway_handler.hpp"
|
||||||
#include "extractor/guidance/intersection.hpp"
|
#include "extractor/guidance/intersection.hpp"
|
||||||
#include "extractor/guidance/intersection_generator.hpp"
|
#include "extractor/guidance/intersection_generator.hpp"
|
||||||
#include "extractor/guidance/intersection_normalization_operation.hpp"
|
#include "extractor/guidance/intersection_normalization_operation.hpp"
|
||||||
@@ -87,6 +88,7 @@ class TurnAnalysis
|
|||||||
const TurnHandler turn_handler;
|
const TurnHandler turn_handler;
|
||||||
const SliproadHandler sliproad_handler;
|
const SliproadHandler sliproad_handler;
|
||||||
const SuppressModeHandler suppress_mode_handler;
|
const SuppressModeHandler suppress_mode_handler;
|
||||||
|
const DrivewayHandler driveway_handler;
|
||||||
|
|
||||||
// Utility function, setting basic turn types. Prepares for normal turn handling.
|
// Utility function, setting basic turn types. Prepares for normal turn handling.
|
||||||
Intersection
|
Intersection
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ namespace guidance
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Intersection handlers deal with all issues related to intersections.
|
// Intersection handlers deal with all issues related to intersections.
|
||||||
// They assign appropriate turn operations to the TurnOperations.
|
|
||||||
class TurnHandler : public IntersectionHandler
|
class TurnHandler : public IntersectionHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const constexpr Enum EnterRotary = 12; // Enter a rotary
|
|||||||
const constexpr Enum EnterAndExitRotary = 13; // Touching a rotary
|
const constexpr Enum EnterAndExitRotary = 13; // Touching a rotary
|
||||||
const constexpr Enum EnterRoundaboutIntersection = 14; // Entering a small Roundabout
|
const constexpr Enum EnterRoundaboutIntersection = 14; // Entering a small Roundabout
|
||||||
const constexpr Enum EnterAndExitRoundaboutIntersection = 15; // Touching a roundabout
|
const constexpr Enum EnterAndExitRoundaboutIntersection = 15; // Touching a roundabout
|
||||||
const constexpr Enum UseLane = 16; // No Turn, but you need to stay on a given lane!
|
// depreacted: const constexpr Enum UseLane = 16; // No Turn, but you need to stay on a given lane!
|
||||||
|
|
||||||
// Values below here are silent instructions
|
// Values below here are silent instructions
|
||||||
const constexpr Enum NoTurn = 17; // end of segment without turn/middle of a segment
|
const constexpr Enum NoTurn = 17; // end of segment without turn/middle of a segment
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ struct TurnLaneData
|
|||||||
// a temporary data entry that does not need to be assigned to an entry.
|
// a temporary data entry that does not need to be assigned to an entry.
|
||||||
// This is the case in situations that use partition and require the entry to perform the
|
// This is the case in situations that use partition and require the entry to perform the
|
||||||
// one-to-one mapping.
|
// one-to-one mapping.
|
||||||
bool suppress_assignment;
|
|
||||||
bool operator<(const TurnLaneData &other) const;
|
bool operator<(const TurnLaneData &other) const;
|
||||||
};
|
};
|
||||||
typedef std::vector<TurnLaneData> LaneDataVector;
|
typedef std::vector<TurnLaneData> LaneDataVector;
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ class TurnLaneHandler
|
|||||||
typedef std::vector<TurnLaneData> LaneDataVector;
|
typedef std::vector<TurnLaneData> LaneDataVector;
|
||||||
|
|
||||||
TurnLaneHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
TurnLaneHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const std::vector<std::uint32_t> &turn_lane_offsets,
|
|
||||||
const std::vector<TurnLaneType::Mask> &turn_lane_masks,
|
|
||||||
LaneDescriptionMap &lane_description_map,
|
LaneDescriptionMap &lane_description_map,
|
||||||
const TurnAnalysis &turn_analysis,
|
const TurnAnalysis &turn_analysis,
|
||||||
util::guidance::LaneDataIdMap &id_map);
|
util::guidance::LaneDataIdMap &id_map);
|
||||||
@@ -90,8 +88,8 @@ class TurnLaneHandler
|
|||||||
// we need to be able to look at previous intersections to, in some cases, find the correct turn
|
// we need to be able to look at previous intersections to, in some cases, find the correct turn
|
||||||
// lanes for a turn
|
// lanes for a turn
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||||
const std::vector<std::uint32_t> &turn_lane_offsets;
|
std::vector<std::uint32_t> turn_lane_offsets;
|
||||||
const std::vector<TurnLaneType::Mask> &turn_lane_masks;
|
std::vector<TurnLaneType::Mask> turn_lane_masks;
|
||||||
LaneDescriptionMap &lane_description_map;
|
LaneDescriptionMap &lane_description_map;
|
||||||
const TurnAnalysis &turn_analysis;
|
const TurnAnalysis &turn_analysis;
|
||||||
util::guidance::LaneDataIdMap &id_map;
|
util::guidance::LaneDataIdMap &id_map;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <numeric> //partial_sum
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -99,6 +100,34 @@ typedef util::ConcurrentIDMap<guidance::TurnLaneDescription,
|
|||||||
guidance::TurnLaneDescription_hash>
|
guidance::TurnLaneDescription_hash>
|
||||||
LaneDescriptionMap;
|
LaneDescriptionMap;
|
||||||
|
|
||||||
|
inline std::tuple<std::vector<std::uint32_t>, std::vector<TurnLaneType::Mask>>
|
||||||
|
transformTurnLaneMapIntoArrays(const LaneDescriptionMap &turn_lane_map)
|
||||||
|
{
|
||||||
|
// could use some additional capacity? To avoid a copy during processing, though small data so
|
||||||
|
// probably not that important.
|
||||||
|
//
|
||||||
|
// From the map, we construct an adjacency array that allows access from all IDs to the list of
|
||||||
|
// associated Turn Lane Masks.
|
||||||
|
//
|
||||||
|
// turn lane offsets points into the locations of the turn_lane_masks array. We use a standard
|
||||||
|
// adjacency array like structure to store the turn lane masks.
|
||||||
|
std::vector<std::uint32_t> turn_lane_offsets(turn_lane_map.data.size() +
|
||||||
|
2); // empty ID + sentinel
|
||||||
|
for (auto entry = turn_lane_map.data.begin(); entry != turn_lane_map.data.end(); ++entry)
|
||||||
|
turn_lane_offsets[entry->second + 1] = entry->first.size();
|
||||||
|
|
||||||
|
// inplace prefix sum
|
||||||
|
std::partial_sum(turn_lane_offsets.begin(), turn_lane_offsets.end(), turn_lane_offsets.begin());
|
||||||
|
|
||||||
|
// allocate the current masks
|
||||||
|
std::vector<guidance::TurnLaneType::Mask> turn_lane_masks(turn_lane_offsets.back());
|
||||||
|
for (auto entry = turn_lane_map.data.begin(); entry != turn_lane_map.data.end(); ++entry)
|
||||||
|
std::copy(entry->first.begin(),
|
||||||
|
entry->first.end(),
|
||||||
|
turn_lane_masks.begin() + turn_lane_offsets[entry->second]);
|
||||||
|
return std::make_tuple(std::move(turn_lane_offsets), std::move(turn_lane_masks));
|
||||||
|
}
|
||||||
|
|
||||||
} // guidance
|
} // guidance
|
||||||
} // extractor
|
} // extractor
|
||||||
} // osrm
|
} // osrm
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ struct InternalExtractorEdge
|
|||||||
false, // local access only
|
false, // local access only
|
||||||
false, // split edge
|
false, // split edge
|
||||||
TRAVEL_MODE_INACCESSIBLE,
|
TRAVEL_MODE_INACCESSIBLE,
|
||||||
|
0,
|
||||||
guidance::TurnLaneType::empty,
|
guidance::TurnLaneType::empty,
|
||||||
guidance::RoadClassification()),
|
guidance::RoadClassification()),
|
||||||
weight_data(), duration_data()
|
weight_data(), duration_data()
|
||||||
@@ -91,6 +92,7 @@ struct InternalExtractorEdge
|
|||||||
bool restricted,
|
bool restricted,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
|
ClassData classes,
|
||||||
LaneDescriptionID lane_description,
|
LaneDescriptionID lane_description,
|
||||||
guidance::RoadClassification road_classification,
|
guidance::RoadClassification road_classification,
|
||||||
util::Coordinate source_coordinate)
|
util::Coordinate source_coordinate)
|
||||||
@@ -107,6 +109,7 @@ struct InternalExtractorEdge
|
|||||||
restricted,
|
restricted,
|
||||||
is_split,
|
is_split,
|
||||||
travel_mode,
|
travel_mode,
|
||||||
|
classes,
|
||||||
lane_description,
|
lane_description,
|
||||||
std::move(road_classification)),
|
std::move(road_classification)),
|
||||||
weight_data(std::move(weight_data)), duration_data(std::move(duration_data)),
|
weight_data(std::move(weight_data)), duration_data(std::move(duration_data)),
|
||||||
@@ -139,6 +142,7 @@ struct InternalExtractorEdge
|
|||||||
false, // local access only
|
false, // local access only
|
||||||
false, // split edge
|
false, // split edge
|
||||||
TRAVEL_MODE_INACCESSIBLE,
|
TRAVEL_MODE_INACCESSIBLE,
|
||||||
|
0,
|
||||||
INVALID_LANE_DESCRIPTIONID,
|
INVALID_LANE_DESCRIPTIONID,
|
||||||
guidance::RoadClassification(),
|
guidance::RoadClassification(),
|
||||||
util::Coordinate());
|
util::Coordinate());
|
||||||
@@ -158,6 +162,7 @@ struct InternalExtractorEdge
|
|||||||
false, // local access only
|
false, // local access only
|
||||||
false, // split edge
|
false, // split edge
|
||||||
TRAVEL_MODE_INACCESSIBLE,
|
TRAVEL_MODE_INACCESSIBLE,
|
||||||
|
0,
|
||||||
INVALID_LANE_DESCRIPTIONID,
|
INVALID_LANE_DESCRIPTIONID,
|
||||||
guidance::RoadClassification(),
|
guidance::RoadClassification(),
|
||||||
util::Coordinate());
|
util::Coordinate());
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
#ifndef OSRM_EXTRACTOR_BEARING_CONTAINER_HPP
|
||||||
|
#define OSRM_EXTRACTOR_BEARING_CONTAINER_HPP
|
||||||
|
|
||||||
|
#include "storage/shared_memory_ownership.hpp"
|
||||||
|
|
||||||
|
#include "util/guidance/bearing_class.hpp"
|
||||||
|
#include "util/range_table.hpp"
|
||||||
|
#include "util/vector_view.hpp"
|
||||||
|
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace extractor
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
template <storage::Ownership Ownership> class IntersectionBearingsContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace serialization
|
||||||
|
{
|
||||||
|
template <storage::Ownership Ownership>
|
||||||
|
void read(storage::io::FileReader &reader,
|
||||||
|
detail::IntersectionBearingsContainer<Ownership> &turn_data);
|
||||||
|
|
||||||
|
template <storage::Ownership Ownership>
|
||||||
|
void write(storage::io::FileWriter &writer,
|
||||||
|
const detail::IntersectionBearingsContainer<Ownership> &turn_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
template <storage::Ownership Ownership> class IntersectionBearingsContainer
|
||||||
|
{
|
||||||
|
template <typename T> using Vector = util::ViewOrVector<T, Ownership>;
|
||||||
|
template <unsigned size> using RangeTable = util::RangeTable<size, Ownership>;
|
||||||
|
|
||||||
|
public:
|
||||||
|
IntersectionBearingsContainer() = default;
|
||||||
|
IntersectionBearingsContainer(IntersectionBearingsContainer &&) = default;
|
||||||
|
IntersectionBearingsContainer(const IntersectionBearingsContainer &) = default;
|
||||||
|
IntersectionBearingsContainer &operator=(IntersectionBearingsContainer &&) = default;
|
||||||
|
IntersectionBearingsContainer &operator=(const IntersectionBearingsContainer &) = default;
|
||||||
|
|
||||||
|
IntersectionBearingsContainer(std::vector<BearingClassID> node_to_class_id_,
|
||||||
|
const std::vector<util::guidance::BearingClass> &bearing_classes)
|
||||||
|
: node_to_class_id(std::move(node_to_class_id_))
|
||||||
|
{
|
||||||
|
std::vector<unsigned> bearing_counts(bearing_classes.size());
|
||||||
|
std::transform(bearing_classes.begin(),
|
||||||
|
bearing_classes.end(),
|
||||||
|
bearing_counts.begin(),
|
||||||
|
[](const auto &bearings) { return bearings.getAvailableBearings().size(); });
|
||||||
|
auto total_bearings = std::accumulate(bearing_counts.begin(), bearing_counts.end(), 0);
|
||||||
|
class_id_to_ranges_table = RangeTable<16>{bearing_counts};
|
||||||
|
|
||||||
|
values.reserve(total_bearings);
|
||||||
|
for (const auto &bearing_class : bearing_classes)
|
||||||
|
{
|
||||||
|
const auto &bearings = bearing_class.getAvailableBearings();
|
||||||
|
values.insert(values.end(), bearings.begin(), bearings.end());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IntersectionBearingsContainer(Vector<DiscreteBearing> values_,
|
||||||
|
Vector<BearingClassID> node_to_class_id_,
|
||||||
|
RangeTable<16> class_id_to_ranges_table_)
|
||||||
|
: values(std::move(values_)), node_to_class_id(std::move(node_to_class_id_)),
|
||||||
|
class_id_to_ranges_table(std::move(class_id_to_ranges_table_))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns the bearing class for an intersection node
|
||||||
|
util::guidance::BearingClass GetBearingClass(const NodeID node) const
|
||||||
|
{
|
||||||
|
auto class_id = node_to_class_id[node];
|
||||||
|
auto range = class_id_to_ranges_table.GetRange(class_id);
|
||||||
|
util::guidance::BearingClass result;
|
||||||
|
std::for_each(values.begin() + range.front(),
|
||||||
|
values.begin() + range.back() + 1,
|
||||||
|
[&](const DiscreteBearing &bearing) { result.add(bearing); });
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void serialization::read<Ownership>(storage::io::FileReader &reader,
|
||||||
|
IntersectionBearingsContainer &turn_data_container);
|
||||||
|
friend void
|
||||||
|
serialization::write<Ownership>(storage::io::FileWriter &writer,
|
||||||
|
const IntersectionBearingsContainer &turn_data_container);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<DiscreteBearing> values;
|
||||||
|
Vector<BearingClassID> node_to_class_id;
|
||||||
|
RangeTable<16> class_id_to_ranges_table;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
using IntersectionBearingsContainer =
|
||||||
|
detail::IntersectionBearingsContainer<storage::Ownership::Container>;
|
||||||
|
using IntersectionBearingsView = detail::IntersectionBearingsContainer<storage::Ownership::View>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef NODE_BASED_EDGE_HPP
|
#ifndef NODE_BASED_EDGE_HPP
|
||||||
#define NODE_BASED_EDGE_HPP
|
#define NODE_BASED_EDGE_HPP
|
||||||
|
|
||||||
|
#include "extractor/class_data.hpp"
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
@@ -28,6 +29,7 @@ struct NodeBasedEdge
|
|||||||
bool restricted,
|
bool restricted,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
|
ClassData classes,
|
||||||
const LaneDescriptionID lane_description_id,
|
const LaneDescriptionID lane_description_id,
|
||||||
guidance::RoadClassification road_classification);
|
guidance::RoadClassification road_classification);
|
||||||
|
|
||||||
@@ -46,6 +48,7 @@ struct NodeBasedEdge
|
|||||||
std::uint8_t restricted : 1; // 1
|
std::uint8_t restricted : 1; // 1
|
||||||
std::uint8_t is_split : 1; // 1
|
std::uint8_t is_split : 1; // 1
|
||||||
TravelMode travel_mode : 4; // 4
|
TravelMode travel_mode : 4; // 4
|
||||||
|
ClassData classes; // 8 1
|
||||||
LaneDescriptionID lane_description_id; // 16 2
|
LaneDescriptionID lane_description_id; // 16 2
|
||||||
guidance::RoadClassification road_classification; // 16 2
|
guidance::RoadClassification road_classification; // 16 2
|
||||||
};
|
};
|
||||||
@@ -65,6 +68,7 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
|
|||||||
bool restricted,
|
bool restricted,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
|
ClassData classes,
|
||||||
const LaneDescriptionID lane_description_id,
|
const LaneDescriptionID lane_description_id,
|
||||||
guidance::RoadClassification road_classification);
|
guidance::RoadClassification road_classification);
|
||||||
|
|
||||||
@@ -95,12 +99,14 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
|
|||||||
bool restricted,
|
bool restricted,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
|
ClassData classes,
|
||||||
const LaneDescriptionID lane_description_id,
|
const LaneDescriptionID lane_description_id,
|
||||||
guidance::RoadClassification road_classification)
|
guidance::RoadClassification road_classification)
|
||||||
: source(source), target(target), name_id(name_id), weight(weight), duration(duration),
|
: source(source), target(target), name_id(name_id), weight(weight), duration(duration),
|
||||||
forward(forward), backward(backward), roundabout(roundabout), circular(circular),
|
forward(forward), backward(backward), roundabout(roundabout), circular(circular),
|
||||||
startpoint(startpoint), restricted(restricted), is_split(is_split), travel_mode(travel_mode),
|
startpoint(startpoint), restricted(restricted), is_split(is_split), travel_mode(travel_mode),
|
||||||
lane_description_id(lane_description_id), road_classification(std::move(road_classification))
|
classes(classes), lane_description_id(lane_description_id),
|
||||||
|
road_classification(std::move(road_classification))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,6 +140,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
|
|||||||
bool restricted,
|
bool restricted,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
|
ClassData classes,
|
||||||
const LaneDescriptionID lane_description_id,
|
const LaneDescriptionID lane_description_id,
|
||||||
guidance::RoadClassification road_classification)
|
guidance::RoadClassification road_classification)
|
||||||
: NodeBasedEdge(SPECIAL_NODEID,
|
: NodeBasedEdge(SPECIAL_NODEID,
|
||||||
@@ -149,6 +156,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
|
|||||||
restricted,
|
restricted,
|
||||||
is_split,
|
is_split,
|
||||||
travel_mode,
|
travel_mode,
|
||||||
|
classes,
|
||||||
lane_description_id,
|
lane_description_id,
|
||||||
std::move(road_classification)),
|
std::move(road_classification)),
|
||||||
osm_source_id(std::move(source)), osm_target_id(std::move(target))
|
osm_source_id(std::move(source)), osm_target_id(std::move(target))
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_NODE_DATA_CONTAINER_HPP
|
#ifndef OSRM_EXTRACTOR_NODE_DATA_CONTAINER_HPP
|
||||||
#define OSRM_EXTRACTOR_NODE_DATA_CONTAINER_HPP
|
#define OSRM_EXTRACTOR_NODE_DATA_CONTAINER_HPP
|
||||||
|
|
||||||
|
#include "extractor/class_data.hpp"
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
|
|
||||||
#include "storage/io_fwd.hpp"
|
#include "storage/io_fwd.hpp"
|
||||||
@@ -41,16 +42,18 @@ template <storage::Ownership Ownership> class EdgeBasedNodeDataContainerImpl
|
|||||||
EdgeBasedNodeDataContainerImpl() = default;
|
EdgeBasedNodeDataContainerImpl() = default;
|
||||||
|
|
||||||
EdgeBasedNodeDataContainerImpl(std::size_t size)
|
EdgeBasedNodeDataContainerImpl(std::size_t size)
|
||||||
: geometry_ids(size), name_ids(size), component_ids(size), travel_modes(size)
|
: geometry_ids(size), name_ids(size), component_ids(size), travel_modes(size), classes(size)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EdgeBasedNodeDataContainerImpl(Vector<GeometryID> geometry_ids,
|
EdgeBasedNodeDataContainerImpl(Vector<GeometryID> geometry_ids,
|
||||||
Vector<NameID> name_ids,
|
Vector<NameID> name_ids,
|
||||||
Vector<ComponentID> component_ids,
|
Vector<ComponentID> component_ids,
|
||||||
Vector<TravelMode> travel_modes)
|
Vector<TravelMode> travel_modes,
|
||||||
|
Vector<ClassData> classes)
|
||||||
: geometry_ids(std::move(geometry_ids)), name_ids(std::move(name_ids)),
|
: geometry_ids(std::move(geometry_ids)), name_ids(std::move(name_ids)),
|
||||||
component_ids(std::move(component_ids)), travel_modes(std::move(travel_modes))
|
component_ids(std::move(component_ids)), travel_modes(std::move(travel_modes)),
|
||||||
|
classes(std::move(classes))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,13 +65,20 @@ template <storage::Ownership Ownership> class EdgeBasedNodeDataContainerImpl
|
|||||||
|
|
||||||
ComponentID GetComponentID(const NodeID node_id) const { return component_ids[node_id]; }
|
ComponentID GetComponentID(const NodeID node_id) const { return component_ids[node_id]; }
|
||||||
|
|
||||||
|
ClassData GetClassData(const NodeID node_id) const { return classes[node_id]; }
|
||||||
|
|
||||||
// Used by EdgeBasedGraphFactory to fill data structure
|
// Used by EdgeBasedGraphFactory to fill data structure
|
||||||
template <typename = std::enable_if<Ownership == storage::Ownership::Container>>
|
template <typename = std::enable_if<Ownership == storage::Ownership::Container>>
|
||||||
void SetData(NodeID node_id, GeometryID geometry_id, NameID name_id, TravelMode travel_mode)
|
void SetData(NodeID node_id,
|
||||||
|
GeometryID geometry_id,
|
||||||
|
NameID name_id,
|
||||||
|
TravelMode travel_mode,
|
||||||
|
ClassData class_data)
|
||||||
{
|
{
|
||||||
geometry_ids[node_id] = geometry_id;
|
geometry_ids[node_id] = geometry_id;
|
||||||
name_ids[node_id] = name_id;
|
name_ids[node_id] = name_id;
|
||||||
travel_modes[node_id] = travel_mode;
|
travel_modes[node_id] = travel_mode;
|
||||||
|
classes[node_id] = class_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used by EdgeBasedGraphFactory to fill data structure
|
// Used by EdgeBasedGraphFactory to fill data structure
|
||||||
@@ -91,6 +101,7 @@ template <storage::Ownership Ownership> class EdgeBasedNodeDataContainerImpl
|
|||||||
util::inplacePermutation(name_ids.begin(), name_ids.end(), permutation);
|
util::inplacePermutation(name_ids.begin(), name_ids.end(), permutation);
|
||||||
util::inplacePermutation(component_ids.begin(), component_ids.end(), permutation);
|
util::inplacePermutation(component_ids.begin(), component_ids.end(), permutation);
|
||||||
util::inplacePermutation(travel_modes.begin(), travel_modes.end(), permutation);
|
util::inplacePermutation(travel_modes.begin(), travel_modes.end(), permutation);
|
||||||
|
util::inplacePermutation(classes.begin(), classes.end(), permutation);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -98,6 +109,7 @@ template <storage::Ownership Ownership> class EdgeBasedNodeDataContainerImpl
|
|||||||
Vector<NameID> name_ids;
|
Vector<NameID> name_ids;
|
||||||
Vector<ComponentID> component_ids;
|
Vector<ComponentID> component_ids;
|
||||||
Vector<TravelMode> travel_modes;
|
Vector<TravelMode> travel_modes;
|
||||||
|
Vector<ClassData> classes;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
#ifndef PROFILE_PROPERTIES_HPP
|
#ifndef PROFILE_PROPERTIES_HPP
|
||||||
#define PROFILE_PROPERTIES_HPP
|
#define PROFILE_PROPERTIES_HPP
|
||||||
|
|
||||||
|
#include "extractor/class_data.hpp"
|
||||||
|
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/numeric/conversion/cast.hpp>
|
#include <boost/numeric/conversion/cast.hpp>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -17,6 +20,7 @@ const constexpr auto DEFAULT_MAX_SPEED = 180 / 3.6; // 180kmph -> m/s
|
|||||||
struct ProfileProperties
|
struct ProfileProperties
|
||||||
{
|
{
|
||||||
static constexpr int MAX_WEIGHT_NAME_LENGTH = 255;
|
static constexpr int MAX_WEIGHT_NAME_LENGTH = 255;
|
||||||
|
static constexpr int MAX_CLASS_NAME_LENGTH = 255;
|
||||||
|
|
||||||
ProfileProperties()
|
ProfileProperties()
|
||||||
: traffic_signal_penalty(0), u_turn_penalty(0),
|
: traffic_signal_penalty(0), u_turn_penalty(0),
|
||||||
@@ -66,6 +70,22 @@ struct ProfileProperties
|
|||||||
return std::string(weight_name);
|
return std::string(weight_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetClassName(std::size_t index, const std::string &name)
|
||||||
|
{
|
||||||
|
char *name_ptr = class_names[index];
|
||||||
|
auto count = std::min<std::size_t>(name.length(), MAX_CLASS_NAME_LENGTH) + 1;
|
||||||
|
std::copy_n(name.c_str(), count, name_ptr);
|
||||||
|
// Make sure this is always zero terminated
|
||||||
|
BOOST_ASSERT(class_names[index][count - 1] == '\0');
|
||||||
|
BOOST_ASSERT(class_names[index][MAX_CLASS_NAME_LENGTH] == '\0');
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetClassName(std::size_t index) const
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(index <= MAX_CLASS_INDEX);
|
||||||
|
return std::string(class_names[index]);
|
||||||
|
}
|
||||||
|
|
||||||
double GetWeightMultiplier() const { return std::pow(10., weight_precision); }
|
double GetWeightMultiplier() const { return std::pow(10., weight_precision); }
|
||||||
|
|
||||||
double GetMaxTurnWeight() const
|
double GetMaxTurnWeight() const
|
||||||
@@ -86,9 +106,10 @@ struct ProfileProperties
|
|||||||
bool fallback_to_duration;
|
bool fallback_to_duration;
|
||||||
//! stores the name of the weight (e.g. 'duration', 'distance', 'safety')
|
//! stores the name of the weight (e.g. 'duration', 'distance', 'safety')
|
||||||
char weight_name[MAX_WEIGHT_NAME_LENGTH + 1];
|
char weight_name[MAX_WEIGHT_NAME_LENGTH + 1];
|
||||||
|
//! stores the names of each class
|
||||||
|
std::array<char[MAX_CLASS_NAME_LENGTH + 1], MAX_CLASS_INDEX + 1> class_names;
|
||||||
unsigned weight_precision = 1;
|
unsigned weight_precision = 1;
|
||||||
bool force_split_edges = false;
|
bool force_split_edges = false;
|
||||||
|
|
||||||
bool call_tagless_node_function = true;
|
bool call_tagless_node_function = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
#define OSRM_EXTRACTOR_IO_HPP
|
#define OSRM_EXTRACTOR_IO_HPP
|
||||||
|
|
||||||
#include "extractor/datasources.hpp"
|
#include "extractor/datasources.hpp"
|
||||||
|
#include "extractor/intersection_bearings_container.hpp"
|
||||||
#include "extractor/nbg_to_ebg.hpp"
|
#include "extractor/nbg_to_ebg.hpp"
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/restriction.hpp"
|
#include "extractor/restriction.hpp"
|
||||||
#include "extractor/segment_data_container.hpp"
|
#include "extractor/segment_data_container.hpp"
|
||||||
#include "extractor/turn_data_container.hpp"
|
#include "extractor/turn_data_container.hpp"
|
||||||
@@ -20,6 +22,36 @@ namespace extractor
|
|||||||
namespace serialization
|
namespace serialization
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// read/write for bearing data
|
||||||
|
template <storage::Ownership Ownership>
|
||||||
|
inline void read(storage::io::FileReader &reader,
|
||||||
|
detail::IntersectionBearingsContainer<Ownership> &intersection_bearings)
|
||||||
|
{
|
||||||
|
storage::serialization::read(reader, intersection_bearings.values);
|
||||||
|
storage::serialization::read(reader, intersection_bearings.node_to_class_id);
|
||||||
|
util::serialization::read(reader, intersection_bearings.class_id_to_ranges_table);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <storage::Ownership Ownership>
|
||||||
|
inline void write(storage::io::FileWriter &writer,
|
||||||
|
const detail::IntersectionBearingsContainer<Ownership> &intersection_bearings)
|
||||||
|
{
|
||||||
|
storage::serialization::write(writer, intersection_bearings.values);
|
||||||
|
storage::serialization::write(writer, intersection_bearings.node_to_class_id);
|
||||||
|
util::serialization::write(writer, intersection_bearings.class_id_to_ranges_table);
|
||||||
|
}
|
||||||
|
|
||||||
|
// read/write for properties file
|
||||||
|
inline void read(storage::io::FileReader &reader, ProfileProperties &properties)
|
||||||
|
{
|
||||||
|
reader.ReadInto(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void write(storage::io::FileWriter &writer, const ProfileProperties &properties)
|
||||||
|
{
|
||||||
|
writer.WriteFrom(properties);
|
||||||
|
}
|
||||||
|
|
||||||
// read/write for datasources file
|
// read/write for datasources file
|
||||||
inline void read(storage::io::FileReader &reader, Datasources &sources)
|
inline void read(storage::io::FileReader &reader, Datasources &sources)
|
||||||
{
|
{
|
||||||
@@ -89,6 +121,7 @@ inline void read(storage::io::FileReader &reader,
|
|||||||
storage::serialization::read(reader, node_data_container.name_ids);
|
storage::serialization::read(reader, node_data_container.name_ids);
|
||||||
storage::serialization::read(reader, node_data_container.component_ids);
|
storage::serialization::read(reader, node_data_container.component_ids);
|
||||||
storage::serialization::read(reader, node_data_container.travel_modes);
|
storage::serialization::read(reader, node_data_container.travel_modes);
|
||||||
|
storage::serialization::read(reader, node_data_container.classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <storage::Ownership Ownership>
|
template <storage::Ownership Ownership>
|
||||||
@@ -99,6 +132,7 @@ inline void write(storage::io::FileWriter &writer,
|
|||||||
storage::serialization::write(writer, node_data_container.name_ids);
|
storage::serialization::write(writer, node_data_container.name_ids);
|
||||||
storage::serialization::write(writer, node_data_container.component_ids);
|
storage::serialization::write(writer, node_data_container.component_ids);
|
||||||
storage::serialization::write(writer, node_data_container.travel_modes);
|
storage::serialization::write(writer, node_data_container.travel_modes);
|
||||||
|
storage::serialization::write(writer, node_data_container.classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// read/write for conditional turn restrictions file
|
// read/write for conditional turn restrictions file
|
||||||
|
|||||||
@@ -176,6 +176,64 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
|
|||||||
return engine_config_ptr();
|
return engine_config_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set EngineConfig system-wide limits on construction, if requested
|
||||||
|
|
||||||
|
auto max_locations_trip = params->Get(Nan::New("max_locations_trip").ToLocalChecked());
|
||||||
|
auto max_locations_viaroute = params->Get(Nan::New("max_locations_viaroute").ToLocalChecked());
|
||||||
|
auto max_locations_distance_table =
|
||||||
|
params->Get(Nan::New("max_locations_distance_table").ToLocalChecked());
|
||||||
|
auto max_locations_map_matching =
|
||||||
|
params->Get(Nan::New("max_locations_map_matching").ToLocalChecked());
|
||||||
|
auto max_results_nearest = params->Get(Nan::New("max_results_nearest").ToLocalChecked());
|
||||||
|
auto max_alternatives = params->Get(Nan::New("max_alternatives").ToLocalChecked());
|
||||||
|
|
||||||
|
if (!max_locations_trip->IsUndefined() && !max_locations_trip->IsNumber())
|
||||||
|
{
|
||||||
|
Nan::ThrowError("max_locations_trip must be an integral number");
|
||||||
|
return engine_config_ptr();
|
||||||
|
}
|
||||||
|
if (!max_locations_viaroute->IsUndefined() && !max_locations_viaroute->IsNumber())
|
||||||
|
{
|
||||||
|
Nan::ThrowError("max_locations_viaroute must be an integral number");
|
||||||
|
return engine_config_ptr();
|
||||||
|
}
|
||||||
|
if (!max_locations_distance_table->IsUndefined() && !max_locations_distance_table->IsNumber())
|
||||||
|
{
|
||||||
|
Nan::ThrowError("max_locations_distance_table must be an integral number");
|
||||||
|
return engine_config_ptr();
|
||||||
|
}
|
||||||
|
if (!max_locations_map_matching->IsUndefined() && !max_locations_map_matching->IsNumber())
|
||||||
|
{
|
||||||
|
Nan::ThrowError("max_locations_map_matching must be an integral number");
|
||||||
|
return engine_config_ptr();
|
||||||
|
}
|
||||||
|
if (!max_results_nearest->IsUndefined() && !max_results_nearest->IsNumber())
|
||||||
|
{
|
||||||
|
Nan::ThrowError("max_results_nearest must be an integral number");
|
||||||
|
return engine_config_ptr();
|
||||||
|
}
|
||||||
|
if (!max_alternatives->IsUndefined() && !max_alternatives->IsNumber())
|
||||||
|
{
|
||||||
|
Nan::ThrowError("max_alternatives must be an integral number");
|
||||||
|
return engine_config_ptr();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (max_locations_trip->IsNumber())
|
||||||
|
engine_config->max_locations_trip = static_cast<int>(max_locations_trip->NumberValue());
|
||||||
|
if (max_locations_viaroute->IsNumber())
|
||||||
|
engine_config->max_locations_viaroute =
|
||||||
|
static_cast<int>(max_locations_viaroute->NumberValue());
|
||||||
|
if (max_locations_distance_table->IsNumber())
|
||||||
|
engine_config->max_locations_distance_table =
|
||||||
|
static_cast<int>(max_locations_distance_table->NumberValue());
|
||||||
|
if (max_locations_map_matching->IsNumber())
|
||||||
|
engine_config->max_locations_map_matching =
|
||||||
|
static_cast<int>(max_locations_map_matching->NumberValue());
|
||||||
|
if (max_results_nearest->IsNumber())
|
||||||
|
engine_config->max_results_nearest = static_cast<int>(max_results_nearest->NumberValue());
|
||||||
|
if (max_alternatives->IsNumber())
|
||||||
|
engine_config->max_alternatives = static_cast<int>(max_alternatives->NumberValue());
|
||||||
|
|
||||||
return engine_config;
|
return engine_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -703,7 +761,7 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
|
|
||||||
if (!value->IsBoolean() && !value->IsNull())
|
if (!value->IsBoolean() && !value->IsNull())
|
||||||
{
|
{
|
||||||
Nan::ThrowError("'continue_straight' parama must be boolean or null");
|
Nan::ThrowError("'continue_straight' param must be boolean or null");
|
||||||
return route_parameters_ptr();
|
return route_parameters_ptr();
|
||||||
}
|
}
|
||||||
if (value->IsBoolean())
|
if (value->IsBoolean())
|
||||||
@@ -718,12 +776,21 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
if (value.IsEmpty())
|
if (value.IsEmpty())
|
||||||
return route_parameters_ptr();
|
return route_parameters_ptr();
|
||||||
|
|
||||||
if (!value->IsBoolean())
|
if (value->IsBoolean())
|
||||||
{
|
{
|
||||||
Nan::ThrowError("'alternatives' parama must be boolean");
|
params->alternatives = value->BooleanValue();
|
||||||
|
params->number_of_alternatives = value->BooleanValue() ? 1u : 0u;
|
||||||
|
}
|
||||||
|
else if (value->IsNumber())
|
||||||
|
{
|
||||||
|
params->alternatives = value->BooleanValue();
|
||||||
|
params->number_of_alternatives = static_cast<unsigned>(value->NumberValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Nan::ThrowError("'alternatives' param must be boolean or number");
|
||||||
return route_parameters_ptr();
|
return route_parameters_ptr();
|
||||||
}
|
}
|
||||||
params->alternatives = value->BooleanValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool parsedSuccessfully = parseCommonParameters(obj, params);
|
bool parsedSuccessfully = parseCommonParameters(obj, params);
|
||||||
|
|||||||
@@ -46,18 +46,18 @@ namespace detail
|
|||||||
template <storage::Ownership Ownership> class CellStorageImpl
|
template <storage::Ownership Ownership> class CellStorageImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using WeightOffset = std::uint32_t;
|
using ValueOffset = std::uint32_t;
|
||||||
using BoundaryOffset = std::uint32_t;
|
using BoundaryOffset = std::uint32_t;
|
||||||
using BoundarySize = std::uint32_t;
|
using BoundarySize = std::uint32_t;
|
||||||
using SourceIndex = std::uint32_t;
|
using SourceIndex = std::uint32_t;
|
||||||
using DestinationIndex = std::uint32_t;
|
using DestinationIndex = std::uint32_t;
|
||||||
|
|
||||||
static constexpr auto INVALID_WEIGHT_OFFSET = std::numeric_limits<WeightOffset>::max();
|
static constexpr auto INVALID_VALUE_OFFSET = std::numeric_limits<ValueOffset>::max();
|
||||||
static constexpr auto INVALID_BOUNDARY_OFFSET = std::numeric_limits<BoundaryOffset>::max();
|
static constexpr auto INVALID_BOUNDARY_OFFSET = std::numeric_limits<BoundaryOffset>::max();
|
||||||
|
|
||||||
struct CellData
|
struct CellData
|
||||||
{
|
{
|
||||||
WeightOffset weight_offset = INVALID_WEIGHT_OFFSET;
|
ValueOffset value_offset = INVALID_VALUE_OFFSET;
|
||||||
BoundaryOffset source_boundary_offset = INVALID_BOUNDARY_OFFSET;
|
BoundaryOffset source_boundary_offset = INVALID_BOUNDARY_OFFSET;
|
||||||
BoundaryOffset destination_boundary_offset = INVALID_BOUNDARY_OFFSET;
|
BoundaryOffset destination_boundary_offset = INVALID_BOUNDARY_OFFSET;
|
||||||
BoundarySize num_source_nodes = 0;
|
BoundarySize num_source_nodes = 0;
|
||||||
@@ -69,15 +69,16 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
|
|
||||||
// Implementation of the cell view. We need a template parameter here
|
// Implementation of the cell view. We need a template parameter here
|
||||||
// because we need to derive a read-only and read-write view from this.
|
// because we need to derive a read-only and read-write view from this.
|
||||||
template <typename WeightValueT> class CellImpl
|
template <typename WeightValueT, typename DurationValueT> class CellImpl
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
using WeightPtrT = WeightValueT *;
|
using WeightPtrT = WeightValueT *;
|
||||||
using WeightRefT = WeightValueT &;
|
using DurationPtrT = DurationValueT *;
|
||||||
BoundarySize num_source_nodes;
|
BoundarySize num_source_nodes;
|
||||||
BoundarySize num_destination_nodes;
|
BoundarySize num_destination_nodes;
|
||||||
|
|
||||||
WeightPtrT const weights;
|
WeightPtrT const weights;
|
||||||
|
DurationPtrT const durations;
|
||||||
const NodeID *const source_boundary;
|
const NodeID *const source_boundary;
|
||||||
const NodeID *const destination_boundary;
|
const NodeID *const destination_boundary;
|
||||||
|
|
||||||
@@ -123,20 +124,19 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
const std::size_t stride;
|
const std::size_t stride;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
template <typename ValuePtr> auto GetOutRange(const ValuePtr ptr, const NodeID node) const
|
||||||
auto GetOutWeight(NodeID node) const
|
|
||||||
{
|
{
|
||||||
auto iter = std::find(source_boundary, source_boundary + num_source_nodes, node);
|
auto iter = std::find(source_boundary, source_boundary + num_source_nodes, node);
|
||||||
if (iter == source_boundary + num_source_nodes)
|
if (iter == source_boundary + num_source_nodes)
|
||||||
return boost::make_iterator_range(weights, weights);
|
return boost::make_iterator_range(ptr, ptr);
|
||||||
|
|
||||||
auto row = std::distance(source_boundary, iter);
|
auto row = std::distance(source_boundary, iter);
|
||||||
auto begin = weights + num_destination_nodes * row;
|
auto begin = ptr + num_destination_nodes * row;
|
||||||
auto end = begin + num_destination_nodes;
|
auto end = begin + num_destination_nodes;
|
||||||
return boost::make_iterator_range(begin, end);
|
return boost::make_iterator_range(begin, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto GetInWeight(NodeID node) const
|
template <typename ValuePtr> auto GetInRange(const ValuePtr ptr, const NodeID node) const
|
||||||
{
|
{
|
||||||
auto iter =
|
auto iter =
|
||||||
std::find(destination_boundary, destination_boundary + num_destination_nodes, node);
|
std::find(destination_boundary, destination_boundary + num_destination_nodes, node);
|
||||||
@@ -144,12 +144,21 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
return boost::make_iterator_range(ColumnIterator{}, ColumnIterator{});
|
return boost::make_iterator_range(ColumnIterator{}, ColumnIterator{});
|
||||||
|
|
||||||
auto column = std::distance(destination_boundary, iter);
|
auto column = std::distance(destination_boundary, iter);
|
||||||
auto begin = ColumnIterator{weights + column, num_destination_nodes};
|
auto begin = ColumnIterator{ptr + column, num_destination_nodes};
|
||||||
auto end = ColumnIterator{weights + column + num_source_nodes * num_destination_nodes,
|
auto end = ColumnIterator{ptr + column + num_source_nodes * num_destination_nodes,
|
||||||
num_destination_nodes};
|
num_destination_nodes};
|
||||||
return boost::make_iterator_range(begin, end);
|
return boost::make_iterator_range(begin, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
auto GetOutWeight(NodeID node) const { return GetOutRange(weights, node); }
|
||||||
|
|
||||||
|
auto GetInWeight(NodeID node) const { return GetInRange(weights, node); }
|
||||||
|
|
||||||
|
auto GetOutDuration(NodeID node) const { return GetOutRange(durations, node); }
|
||||||
|
|
||||||
|
auto GetInDuration(NodeID node) const { return GetInRange(durations, node); }
|
||||||
|
|
||||||
auto GetSourceNodes() const
|
auto GetSourceNodes() const
|
||||||
{
|
{
|
||||||
return boost::make_iterator_range(source_boundary, source_boundary + num_source_nodes);
|
return boost::make_iterator_range(source_boundary, source_boundary + num_source_nodes);
|
||||||
@@ -162,16 +171,19 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
}
|
}
|
||||||
|
|
||||||
CellImpl(const CellData &data,
|
CellImpl(const CellData &data,
|
||||||
WeightPtrT const all_weight,
|
WeightPtrT const all_weights,
|
||||||
|
DurationPtrT const all_durations,
|
||||||
const NodeID *const all_sources,
|
const NodeID *const all_sources,
|
||||||
const NodeID *const all_destinations)
|
const NodeID *const all_destinations)
|
||||||
: num_source_nodes{data.num_source_nodes},
|
: num_source_nodes{data.num_source_nodes},
|
||||||
num_destination_nodes{data.num_destination_nodes},
|
num_destination_nodes{data.num_destination_nodes},
|
||||||
weights{all_weight + data.weight_offset},
|
weights{all_weights + data.value_offset},
|
||||||
|
durations{all_durations + data.value_offset},
|
||||||
source_boundary{all_sources + data.source_boundary_offset},
|
source_boundary{all_sources + data.source_boundary_offset},
|
||||||
destination_boundary{all_destinations + data.destination_boundary_offset}
|
destination_boundary{all_destinations + data.destination_boundary_offset}
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(all_weight != nullptr);
|
BOOST_ASSERT(all_weights != nullptr);
|
||||||
|
BOOST_ASSERT(all_durations != nullptr);
|
||||||
BOOST_ASSERT(num_source_nodes == 0 || all_sources != nullptr);
|
BOOST_ASSERT(num_source_nodes == 0 || all_sources != nullptr);
|
||||||
BOOST_ASSERT(num_destination_nodes == 0 || all_destinations != nullptr);
|
BOOST_ASSERT(num_destination_nodes == 0 || all_destinations != nullptr);
|
||||||
}
|
}
|
||||||
@@ -180,8 +192,8 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
std::size_t LevelIDToIndex(LevelID level) const { return level - 1; }
|
std::size_t LevelIDToIndex(LevelID level) const { return level - 1; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Cell = CellImpl<EdgeWeight>;
|
using Cell = CellImpl<EdgeWeight, EdgeDuration>;
|
||||||
using ConstCell = CellImpl<const EdgeWeight>;
|
using ConstCell = CellImpl<const EdgeWeight, const EdgeDuration>;
|
||||||
|
|
||||||
CellStorageImpl() {}
|
CellStorageImpl() {}
|
||||||
|
|
||||||
@@ -304,24 +316,27 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
<< " Number of unconnected nodes is " << number_of_unconneced;
|
<< " Number of unconnected nodes is " << number_of_unconneced;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set weight offsets and calculate total storage size
|
// Set cell values offsets and calculate total storage size
|
||||||
WeightOffset weight_offset = 0;
|
ValueOffset value_offset = 0;
|
||||||
for (auto &cell : cells)
|
for (auto &cell : cells)
|
||||||
{
|
{
|
||||||
cell.weight_offset = weight_offset;
|
cell.value_offset = value_offset;
|
||||||
weight_offset += cell.num_source_nodes * cell.num_destination_nodes;
|
value_offset += cell.num_source_nodes * cell.num_destination_nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
weights.resize(weight_offset + 1, INVALID_EDGE_WEIGHT);
|
weights.resize(value_offset + 1, INVALID_EDGE_WEIGHT);
|
||||||
|
durations.resize(value_offset + 1, MAXIMAL_EDGE_DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename = std::enable_if<Ownership == storage::Ownership::View>>
|
template <typename = std::enable_if<Ownership == storage::Ownership::View>>
|
||||||
CellStorageImpl(Vector<EdgeWeight> weights_,
|
CellStorageImpl(Vector<EdgeWeight> weights_,
|
||||||
|
Vector<EdgeDuration> durations_,
|
||||||
Vector<NodeID> source_boundary_,
|
Vector<NodeID> source_boundary_,
|
||||||
Vector<NodeID> destination_boundary_,
|
Vector<NodeID> destination_boundary_,
|
||||||
Vector<CellData> cells_,
|
Vector<CellData> cells_,
|
||||||
Vector<std::uint64_t> level_to_cell_offset_)
|
Vector<std::uint64_t> level_to_cell_offset_)
|
||||||
: weights(std::move(weights_)), source_boundary(std::move(source_boundary_)),
|
: weights(std::move(weights_)), durations(std::move(durations_)),
|
||||||
|
source_boundary(std::move(source_boundary_)),
|
||||||
destination_boundary(std::move(destination_boundary_)), cells(std::move(cells_)),
|
destination_boundary(std::move(destination_boundary_)), cells(std::move(cells_)),
|
||||||
level_to_cell_offset(std::move(level_to_cell_offset_))
|
level_to_cell_offset(std::move(level_to_cell_offset_))
|
||||||
{
|
{
|
||||||
@@ -336,6 +351,7 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
BOOST_ASSERT(cell_index < cells.size());
|
BOOST_ASSERT(cell_index < cells.size());
|
||||||
return ConstCell{cells[cell_index],
|
return ConstCell{cells[cell_index],
|
||||||
weights.data(),
|
weights.data(),
|
||||||
|
durations.data(),
|
||||||
source_boundary.empty() ? nullptr : source_boundary.data(),
|
source_boundary.empty() ? nullptr : source_boundary.data(),
|
||||||
destination_boundary.empty() ? nullptr : destination_boundary.data()};
|
destination_boundary.empty() ? nullptr : destination_boundary.data()};
|
||||||
}
|
}
|
||||||
@@ -348,8 +364,11 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
const auto offset = level_to_cell_offset[level_index];
|
const auto offset = level_to_cell_offset[level_index];
|
||||||
const auto cell_index = offset + id;
|
const auto cell_index = offset + id;
|
||||||
BOOST_ASSERT(cell_index < cells.size());
|
BOOST_ASSERT(cell_index < cells.size());
|
||||||
return Cell{
|
return Cell{cells[cell_index],
|
||||||
cells[cell_index], weights.data(), source_boundary.data(), destination_boundary.data()};
|
weights.data(),
|
||||||
|
durations.data(),
|
||||||
|
source_boundary.data(),
|
||||||
|
destination_boundary.data()};
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void serialization::read<Ownership>(storage::io::FileReader &reader,
|
friend void serialization::read<Ownership>(storage::io::FileReader &reader,
|
||||||
@@ -359,6 +378,7 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Vector<EdgeWeight> weights;
|
Vector<EdgeWeight> weights;
|
||||||
|
Vector<EdgeDuration> durations;
|
||||||
Vector<NodeID> source_boundary;
|
Vector<NodeID> source_boundary;
|
||||||
Vector<NodeID> destination_boundary;
|
Vector<NodeID> destination_boundary;
|
||||||
Vector<CellData> cells;
|
Vector<CellData> cells;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ template <storage::Ownership Ownership>
|
|||||||
inline void read(storage::io::FileReader &reader, detail::CellStorageImpl<Ownership> &storage)
|
inline void read(storage::io::FileReader &reader, detail::CellStorageImpl<Ownership> &storage)
|
||||||
{
|
{
|
||||||
storage::serialization::read(reader, storage.weights);
|
storage::serialization::read(reader, storage.weights);
|
||||||
|
storage::serialization::read(reader, storage.durations);
|
||||||
storage::serialization::read(reader, storage.source_boundary);
|
storage::serialization::read(reader, storage.source_boundary);
|
||||||
storage::serialization::read(reader, storage.destination_boundary);
|
storage::serialization::read(reader, storage.destination_boundary);
|
||||||
storage::serialization::read(reader, storage.cells);
|
storage::serialization::read(reader, storage.cells);
|
||||||
@@ -66,6 +67,7 @@ inline void write(storage::io::FileWriter &writer,
|
|||||||
const detail::CellStorageImpl<Ownership> &storage)
|
const detail::CellStorageImpl<Ownership> &storage)
|
||||||
{
|
{
|
||||||
storage::serialization::write(writer, storage.weights);
|
storage::serialization::write(writer, storage.weights);
|
||||||
|
storage::serialization::write(writer, storage.durations);
|
||||||
storage::serialization::write(writer, storage.source_boundary);
|
storage::serialization::write(writer, storage.source_boundary);
|
||||||
storage::serialization::write(writer, storage.destination_boundary);
|
storage::serialization::write(writer, storage.destination_boundary);
|
||||||
storage::serialization::write(writer, storage.cells);
|
storage::serialization::write(writer, storage.cells);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user