Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5484118d77 | |||
| 2116cc68ca | |||
| 531b281b73 | |||
| 7137459fb0 | |||
| f57fd4ffc3 | |||
| 275f71a7d7 | |||
| 2c7d1ed48c | |||
| d67cd34edd | |||
| c8c3a49fb5 | |||
| 3ae313d35d |
@@ -1,30 +0,0 @@
|
|||||||
# EditorConfig is awesome: http://EditorConfig.org
|
|
||||||
#
|
|
||||||
# NOTE: Keep settings in sync with the master .clang-format file
|
|
||||||
#
|
|
||||||
# top-most EditorConfig file
|
|
||||||
root = true
|
|
||||||
|
|
||||||
# CMake configuration files
|
|
||||||
[{CMakeLists.txt,CMakeSettings.json,*.cmake}]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
# CI configuration files
|
|
||||||
[{.travis.yml,appveyor.yml}]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
# Unix shell scripts
|
|
||||||
[*.sh]
|
|
||||||
end_of_line = lf
|
|
||||||
indent_style = space
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
# Windows shell scripts
|
|
||||||
[*.bat]
|
|
||||||
end_of_line = crlf
|
|
||||||
indent_style = space
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
@@ -2,18 +2,12 @@
|
|||||||
|
|
||||||
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
|
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
|
||||||
|
|
||||||
Please read our [documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/releasing.md) on release and version management.
|
|
||||||
If your PR is still work in progress please attach the relevant label.
|
|
||||||
|
|
||||||
## Tasklist
|
## Tasklist
|
||||||
|
- [ ] ADD OWN TASKS HERE
|
||||||
- [ ] CHANGELOG.md entry ([How to write a changelog entry](http://keepachangelog.com/en/1.0.0/#how))
|
|
||||||
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
|
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
|
||||||
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/testing.md)
|
- [ ] add regression / cucumber cases (see docs/testing.md)
|
||||||
- [ ] review
|
- [ ] review
|
||||||
- [ ] adjust for comments
|
- [ ] adjust for comments
|
||||||
- [ ] cherry pick to release branch
|
|
||||||
|
|
||||||
## Requirements / Relations
|
## Requirements / Relations
|
||||||
|
|
||||||
Link any requirements here. Other pull requests this PR is based on?
|
Link any requirements here. Other pull requests this PR is based on?
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ Thumbs.db
|
|||||||
######################################
|
######################################
|
||||||
/.vs*
|
/.vs*
|
||||||
/*.local.bat
|
/*.local.bat
|
||||||
/CMakeSettings.json
|
|
||||||
|
|
||||||
# stxxl related files #
|
# stxxl related files #
|
||||||
#######################
|
#######################
|
||||||
|
|||||||
+126
-69
@@ -15,7 +15,7 @@ branches:
|
|||||||
- master
|
- master
|
||||||
# enable building tags
|
# enable building tags
|
||||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||||
- "5.17"
|
- 5.14
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
yarn: true
|
yarn: true
|
||||||
@@ -60,18 +60,17 @@ matrix:
|
|||||||
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||||
- ${MASON} install clang-format 3.8.1
|
- ${MASON} install clang-format 3.8.1
|
||||||
- PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
|
- PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
|
||||||
- node ./scripts/validate_changelog.js
|
|
||||||
# See issue 4043
|
# See issue 4043
|
||||||
#- npm run docs && ./scripts/error_on_dirty.sh
|
#- npm run docs && ./scripts/error_on_dirty.sh
|
||||||
after_success:
|
after_success:
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-7-debug-cov"
|
compiler: "gcc-6-debug-cov"
|
||||||
addons: &gcc7
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'lcov']
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'lcov']
|
||||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
||||||
before_script:
|
before_script:
|
||||||
- cd ${TRAVIS_BUILD_DIR}
|
- cd ${TRAVIS_BUILD_DIR}
|
||||||
- lcov --directory . --zerocounters # clean cached da files
|
- lcov --directory . --zerocounters # clean cached da files
|
||||||
@@ -85,20 +84,20 @@ matrix:
|
|||||||
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-7-debug-asan"
|
compiler: "gcc-6-debug-asan"
|
||||||
addons: &gcc7
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "clang-5.0-debug"
|
compiler: "clang-4.0-debug"
|
||||||
addons: &clang50
|
addons: &clang40
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "mason-linux-debug-asan"
|
compiler: "mason-linux-debug-asan"
|
||||||
@@ -106,7 +105,7 @@ matrix:
|
|||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-4.9-dev']
|
||||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||||
|
|
||||||
# Release Builds
|
# Release Builds
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -115,70 +114,80 @@ matrix:
|
|||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-4.9-dev']
|
||||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-7-release"
|
|
||||||
addons: &gcc7
|
|
||||||
apt:
|
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
|
||||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
|
||||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-7-release-i686"
|
|
||||||
env: >
|
|
||||||
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
|
||||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-7-stxxl"
|
|
||||||
addons: &gcc7
|
|
||||||
apt:
|
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
|
||||||
packages: ['g++-7', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
|
||||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' ENABLE_STXXL=On
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-5-release"
|
|
||||||
addons: &gcc49
|
|
||||||
apt:
|
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
|
||||||
packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
|
||||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-release"
|
compiler: "gcc-6-release"
|
||||||
|
addons: &gcc6
|
||||||
|
apt:
|
||||||
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: "gcc-6-release-i686"
|
||||||
|
env: >
|
||||||
|
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||||
|
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', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' ENABLE_STXXL=On
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: "gcc-4.9-release"
|
||||||
addons: &gcc49
|
addons: &gcc49
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'ccache']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode9.2
|
osx_image: xcode8.2
|
||||||
compiler: "mason-osx-release-node-8"
|
compiler: "mason-osx-release"
|
||||||
# we use the xcode provides clang and don't install our own
|
|
||||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="8"
|
|
||||||
after_success:
|
|
||||||
- ./scripts/travis/publish.sh
|
|
||||||
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode9.2
|
|
||||||
compiler: "mason-osx-release-node-4"
|
|
||||||
# we use the xcode provides clang and don't install our own
|
# we use the xcode provides clang and don't install our own
|
||||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="4"
|
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="4"
|
||||||
after_success:
|
after_success:
|
||||||
- ./scripts/travis/publish.sh
|
- ./scripts/travis/publish.sh
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode8.2
|
||||||
|
compiler: "mason-osx-release"
|
||||||
|
# we use the xcode provides clang and don't install our own
|
||||||
|
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="6"
|
||||||
|
after_success:
|
||||||
|
- ./scripts/travis/publish.sh
|
||||||
|
|
||||||
|
# Disabled because of CI slowness
|
||||||
|
#- os: linux
|
||||||
|
#- compiler: clang
|
||||||
|
#- addons: &clang40
|
||||||
|
#- apt:
|
||||||
|
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||||
|
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
|
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release'
|
||||||
|
|
||||||
# Shared Library
|
# Shared Library
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-7-release-shared"
|
compiler: "gcc-6-release-shared"
|
||||||
addons: &gcc7
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' 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
|
||||||
|
#- os: linux
|
||||||
|
#- compiler: clang
|
||||||
|
#- addons: &clang40
|
||||||
|
#- apt:
|
||||||
|
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||||
|
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
|
#- 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.
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -188,7 +197,7 @@ matrix:
|
|||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-4.9-dev']
|
||||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
- |
|
- |
|
||||||
@@ -207,12 +216,60 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: false
|
sudo: false
|
||||||
compiler: "node-4-mason-linux-debug"
|
compiler: "node-4-mason-linux-release"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-4.9-dev']
|
||||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||||
|
install:
|
||||||
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
|
- |
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||||
|
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||||
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
|
-DENABLE_CCACHE=ON \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||||
|
-DENABLE_GLIBC_WORKAROUND=ON
|
||||||
|
- make --jobs=${JOBS}
|
||||||
|
- popd
|
||||||
|
script:
|
||||||
|
- npm run nodejs-tests
|
||||||
|
after_success:
|
||||||
|
- ./scripts/travis/publish.sh
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
sudo: false
|
||||||
|
compiler: "node-6-mason-linux-release"
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
|
packages: ['libstdc++-4.9-dev']
|
||||||
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||||
|
install:
|
||||||
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
|
- |
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||||
|
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||||
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
|
-DENABLE_CCACHE=ON \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||||
|
-DENABLE_GLIBC_WORKAROUND=ON
|
||||||
|
- make --jobs=${JOBS}
|
||||||
|
- popd
|
||||||
|
script:
|
||||||
|
- npm run nodejs-tests
|
||||||
|
after_success:
|
||||||
|
- ./scripts/travis/publish.sh
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
sudo: false
|
||||||
|
compiler: "node-6-mason-linux-release"
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
|
packages: ['libstdc++-4.9-dev']
|
||||||
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
- |
|
- |
|
||||||
@@ -236,7 +293,7 @@ matrix:
|
|||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-4.9-dev']
|
||||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
- |
|
- |
|
||||||
@@ -255,12 +312,12 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: false
|
sudo: false
|
||||||
compiler: "node-8-mason-linux-debug"
|
compiler: "node-6-mason-linux-release"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-4.9-dev']
|
||||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
- |
|
- |
|
||||||
@@ -375,7 +432,7 @@ script:
|
|||||||
- ./unit_tests/engine-tests
|
- ./unit_tests/engine-tests
|
||||||
- ./unit_tests/util-tests
|
- ./unit_tests/util-tests
|
||||||
- ./unit_tests/server-tests
|
- ./unit_tests/server-tests
|
||||||
- ./unit_tests/partitioner-tests
|
- ./unit_tests/partition-tests
|
||||||
- |
|
- |
|
||||||
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
|
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
|
||||||
npm run nodejs-tests
|
npm run nodejs-tests
|
||||||
|
|||||||
-111
@@ -1,114 +1,3 @@
|
|||||||
# 5.17.2
|
|
||||||
- Changes from 5.17.0:
|
|
||||||
- Bugfixes:
|
|
||||||
- FIXED: Do not combine a segregated edge with a roundabout [#5039](https://github.com/Project-OSRM/osrm-backend/issues/5039)
|
|
||||||
|
|
||||||
# 5.17.0
|
|
||||||
- Changes from 5.16.0:
|
|
||||||
- Bugfixes:
|
|
||||||
- FIXED: deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909)
|
|
||||||
- FIXED: Use smaller range for U-turn angles in map-matching [#4920](https://github.com/Project-OSRM/osrm-backend/pull/4920)
|
|
||||||
- FIXED: Remove the last short annotation segment in `trimShortSegments` [#4946](https://github.com/Project-OSRM/osrm-backend/pull/4946)
|
|
||||||
- FIXED: Properly calculate annotations for speeds, durations and distances when waypoints are used with mapmatching [#4949](https://github.com/Project-OSRM/osrm-backend/pull/4949)
|
|
||||||
- FIXED: Don't apply unimplemented SH and PH conditions in OpeningHours and add inversed date ranges [#4992](https://github.com/Project-OSRM/osrm-backend/issues/4992)
|
|
||||||
- FIXED: integer overflow in `DynamicGraph::Renumber` [#5021](https://github.com/Project-OSRM/osrm-backend/pull/5021)
|
|
||||||
- Profile:
|
|
||||||
- CHANGED: Handle oneways in get_forward_backward_by_key [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
|
||||||
- FIXED: Do not route against oneway road if there is a cycleway in the wrong direction; also review bike profile [#4943](https://github.com/Project-OSRM/osrm-backend/issues/4943)
|
|
||||||
- CHANGED: Make cyclability weighting of the bike profile prefer safer routes more strongly [#5015](https://github.com/Project-OSRM/osrm-backend/issues/5015)
|
|
||||||
- Guidance:
|
|
||||||
- CHANGED: Don't use obviousness for links bifurcations [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
|
||||||
- FIXED: Adjust Straight direction modifiers of side roads in driveway handler [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
|
||||||
- CHANGED: Added post process logic to collapse segregated turn instructions [#4925](https://github.com/Project-OSRM/osrm-backend/pull/4925)
|
|
||||||
- ADDED: Maneuver relation now supports `straight` as a direction [#4995](https://github.com/Project-OSRM/osrm-backend/pull/4995)
|
|
||||||
- FIXED: Support spelling maneuver relation with British spelling [#4950](https://github.com/Project-OSRM/osrm-backend/issues/4950)
|
|
||||||
- Tools:
|
|
||||||
- ADDED: `osrm-routed` accepts a new property `--memory_file` to store memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881)
|
|
||||||
- ADDED: `osrm-datastore` accepts a new parameter `--dataset-name` to select the name of the dataset. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
|
||||||
- ADDED: `osrm-datastore` accepts a new parameter `--list` to list all datasets loaded into memory. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
|
||||||
- ADDED: `osrm-datastore` accepts a new parameter `--only-metric` to only reload the data that can be updated by a weight update (reduces memory for traffic updates). [#5002](https://github.com/Project-OSRM/osrm-backend/pull/5002)
|
|
||||||
- ADDED: `osrm-routed` accepts a new parameter `--dataset-name` to select the shared-memory dataset to use. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
|
||||||
- NodeJS:
|
|
||||||
- ADDED: `OSRM` object accepts a new option `memory_file` that stores the memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881)
|
|
||||||
- ADDED: `OSRM` object accepts a new option `dataset_name` to select the shared-memory dataset. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
|
||||||
- Internals
|
|
||||||
- CHANGED: Updated segregated intersection identification [#4845](https://github.com/Project-OSRM/osrm-backend/pull/4845) [#4968](https://github.com/Project-OSRM/osrm-backend/pull/4968)
|
|
||||||
- REMOVED: Remove `.timestamp` file since it was unused [#4960](https://github.com/Project-OSRM/osrm-backend/pull/4960)
|
|
||||||
- Documentation:
|
|
||||||
- ADDED: Add documentation about OSM node ids in nearest service response [#4436](https://github.com/Project-OSRM/osrm-backend/pull/4436)
|
|
||||||
- Performance
|
|
||||||
- FIXED: Speed up response time when lots of legs exist and geojson is used with `steps=true` [#4936](https://github.com/Project-OSRM/osrm-backend/pull/4936)
|
|
||||||
- FIXED: Return iterators instead of vectors in datafacade_base functions [#4969](https://github.com/Project-OSRM/osrm-backend/issues/4969)
|
|
||||||
- Misc:
|
|
||||||
- ADDED: expose name for datasource annotations as metadata [#4973](https://github.com/Project-OSRM/osrm-backend/pull/4973)
|
|
||||||
|
|
||||||
# 5.16.0
|
|
||||||
- Changes from 5.15.2:
|
|
||||||
- Guidance
|
|
||||||
- ADDED #4676: Support for maneuver override relation, allowing data-driven overrides for turn-by-turn instructions [#4676](https://github.com/Project-OSRM/osrm-backend/pull/4676)
|
|
||||||
- CHANGED #4830: Announce reference change if names are empty
|
|
||||||
- CHANGED #4835: MAXIMAL_ALLOWED_SEPARATION_WIDTH increased to 12 meters
|
|
||||||
- CHANGED #4842: Lower priority links from a motorway now are used as motorway links [#4842](https://github.com/Project-OSRM/osrm-backend/pull/4842)
|
|
||||||
- CHANGED #4895: Use ramp bifurcations as fork intersections [#4895](https://github.com/Project-OSRM/osrm-backend/issues/4895)
|
|
||||||
- CHANGED #4893: Handle motorway forks with links as normal motorway intersections[#4893](https://github.com/Project-OSRM/osrm-backend/issues/4893)
|
|
||||||
- FIXED #4905: Check required tags of `maneuver` relations [#4905](https://github.com/Project-OSRM/osrm-backend/pull/4905)
|
|
||||||
- Profile:
|
|
||||||
- FIXED: `highway=service` will now be used for restricted access, `access=private` is still disabled for snapping.
|
|
||||||
- ADDED #4775: Exposes more information to the turn function, now being able to set turn weights with highway and access information of the turn as well as other roads at the intersection [#4775](https://github.com/Project-OSRM/osrm-backend/issues/4775)
|
|
||||||
- FIXED #4763: Add support for non-numerical units in car profile for maxheight [#4763](https://github.com/Project-OSRM/osrm-backend/issues/4763)
|
|
||||||
- ADDED #4872: Handling of `barrier=height_restrictor` nodes [#4872](https://github.com/Project-OSRM/osrm-backend/pull/4872)
|
|
||||||
|
|
||||||
# 5.15.2
|
|
||||||
- Changes from 5.15.1:
|
|
||||||
- Features:
|
|
||||||
- ADDED: Exposed the waypoints parameter in the node bindings interface
|
|
||||||
- Bugfixes:
|
|
||||||
- FIXED: Segfault causing bug in leg collapsing map matching when traversing edges in reverse
|
|
||||||
|
|
||||||
# 5.15.1
|
|
||||||
- Changes from 5.15.0:
|
|
||||||
- Bugfixes:
|
|
||||||
- FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches
|
|
||||||
- Guidance:
|
|
||||||
- Set type of trivial intersections where classes change to Suppressed instead of NoTurn
|
|
||||||
|
|
||||||
# 5.15.0
|
|
||||||
- Changes from 5.14.3:
|
|
||||||
- Bugfixes:
|
|
||||||
- FIXED #4704: Fixed regression in bearings reordering introduced in 5.13 [#4704](https://github.com/Project-OSRM/osrm-backend/issues/4704)
|
|
||||||
- FIXED #4781: Fixed overflow exceptions in percent-encoding parsing
|
|
||||||
- FIXED #4770: Fixed exclude flags for single toll road scenario
|
|
||||||
- FIXED #4283: Fix overflow on zero duration segments
|
|
||||||
- FIXED #4804: Ignore no_*_on_red turn restrictions
|
|
||||||
- Guidance:
|
|
||||||
- CHANGED #4706: Guidance refactoring step to decouple intersection connectivity analysis and turn instructions generation [#4706](https://github.com/Project-OSRM/osrm-backend/pull/4706)
|
|
||||||
- CHANGED #3491: Refactor `isThroughStreet`/Intersection options
|
|
||||||
- Profile:
|
|
||||||
- ADDED: `tunnel` as a new class in car profile so that sections of the route with tunnel tags will be marked as such
|
|
||||||
|
|
||||||
# 5.14.3
|
|
||||||
- Changes from 5.14.2:
|
|
||||||
- Features:
|
|
||||||
- Added a `waypoints` parameter to the match service plugin that accepts indices to input coordinates and treats only those points as waypoints in the response format.
|
|
||||||
- Bugfixes:
|
|
||||||
- FIXED #4754: U-Turn penalties are applied to straight turns.
|
|
||||||
- FIXED #4756: Removed too restrictive road name check in the sliproad handler
|
|
||||||
- FIXED #4731: Use correct weights for edge-based graph duplicated via nodes.
|
|
||||||
- Profile:
|
|
||||||
- CHANGED: added Belarus speed limits
|
|
||||||
- CHANGED: set default urban speed in Ukraine to 50kmh
|
|
||||||
|
|
||||||
# 5.14.2
|
|
||||||
- Changes from 5.14.1:
|
|
||||||
- Bugfixes:
|
|
||||||
- FIXED #4727: Erroring when a old .core file is present.
|
|
||||||
- FIXED #4642: Update checks for EMPTY_NAMEID to check for empty name strings
|
|
||||||
- FIXED #4738: Fix potential segmentation fault
|
|
||||||
- Node.js Bindings:
|
|
||||||
- ADDED: Exposed new `max_radiuses_map_matching` option from `EngingConfig` options
|
|
||||||
- Tools:
|
|
||||||
- ADDED: New osrm-routed `max_radiuses_map_matching` command line flag to optionally set a maximum radius for map matching
|
|
||||||
|
|
||||||
# 5.14.1
|
# 5.14.1
|
||||||
- Changes from 5.14.0
|
- Changes from 5.14.0
|
||||||
- Bugfixes:
|
- Bugfixes:
|
||||||
|
|||||||
+50
-59
@@ -1,4 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.1)
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
|
# we depend on 2.8.11 introducing target_include_directories
|
||||||
|
|
||||||
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
|
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
|
||||||
message(FATAL_ERROR "In-source builds are not allowed.
|
message(FATAL_ERROR "In-source builds are not allowed.
|
||||||
@@ -42,6 +43,7 @@ if(ENABLE_MASON)
|
|||||||
set(MASON_LUA_VERSION "5.2.4")
|
set(MASON_LUA_VERSION "5.2.4")
|
||||||
set(MASON_BZIP2_VERSION "1.0.6")
|
set(MASON_BZIP2_VERSION "1.0.6")
|
||||||
set(MASON_TBB_VERSION "2017_U7")
|
set(MASON_TBB_VERSION "2017_U7")
|
||||||
|
set(MASON_LIBSHP_VERSION "1.3.0")
|
||||||
|
|
||||||
message(STATUS "Enabling mason")
|
message(STATUS "Enabling mason")
|
||||||
|
|
||||||
@@ -58,26 +60,12 @@ if (POLICY CMP0048)
|
|||||||
cmake_policy(SET CMP0048 OLD)
|
cmake_policy(SET CMP0048 OLD)
|
||||||
endif()
|
endif()
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
|
set(OSRM_VERSION_MINOR 14)
|
||||||
|
set(OSRM_VERSION_PATCH 1)
|
||||||
|
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||||
|
|
||||||
include(JSONParser)
|
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
file(READ "package.json" packagejsonraw)
|
|
||||||
sbeParseJson(packagejson packagejsonraw)
|
|
||||||
|
|
||||||
if (packagejson.version MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)")
|
|
||||||
set(OSRM_VERSION_MAJOR ${CMAKE_MATCH_1})
|
|
||||||
set(OSRM_VERSION_MINOR ${CMAKE_MATCH_2})
|
|
||||||
set(OSRM_VERSION_PATCH ${CMAKE_MATCH_3})
|
|
||||||
|
|
||||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Version from package.json cannot be parsed, expected semver compatible X.Y.Z, but found ${packagejson.version}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_definitions("-DOSRM_PROJECT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"")
|
|
||||||
else()
|
|
||||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# these two functions build up custom variables:
|
# these two functions build up custom variables:
|
||||||
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
|
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
|
||||||
@@ -114,10 +102,10 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
|
|||||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Strictly require GCC>=5.0 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
||||||
message(FATAL_ERROR "GCC>=5.0 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||||
@@ -138,8 +126,7 @@ configure_file(
|
|||||||
)
|
)
|
||||||
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
|
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
|
||||||
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
|
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
|
||||||
file(GLOB GuidanceGlob src/guidance/*.cpp src/extractor/intersection/*.cpp)
|
file(GLOB PartitionerGlob src/partition/*.cpp)
|
||||||
file(GLOB PartitionerGlob src/partitioner/*.cpp)
|
|
||||||
file(GLOB CustomizerGlob src/customize/*.cpp)
|
file(GLOB CustomizerGlob src/customize/*.cpp)
|
||||||
file(GLOB ContractorGlob src/contractor/*.cpp)
|
file(GLOB ContractorGlob src/contractor/*.cpp)
|
||||||
file(GLOB UpdaterGlob src/updater/*.cpp)
|
file(GLOB UpdaterGlob src/updater/*.cpp)
|
||||||
@@ -150,7 +137,6 @@ file(GLOB ErrorcodesGlob src/osrm/errorcodes.cpp)
|
|||||||
|
|
||||||
add_library(UTIL OBJECT ${UtilGlob})
|
add_library(UTIL OBJECT ${UtilGlob})
|
||||||
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
|
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
|
||||||
add_library(GUIDANCE OBJECT ${GuidanceGlob})
|
|
||||||
add_library(PARTITIONER OBJECT ${PartitionerGlob})
|
add_library(PARTITIONER OBJECT ${PartitionerGlob})
|
||||||
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
|
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
|
||||||
add_library(CONTRACTOR OBJECT ${ContractorGlob})
|
add_library(CONTRACTOR OBJECT ${ContractorGlob})
|
||||||
@@ -166,15 +152,14 @@ add_executable(osrm-partition src/tools/partition.cpp)
|
|||||||
add_executable(osrm-customize src/tools/customize.cpp)
|
add_executable(osrm-customize src/tools/customize.cpp)
|
||||||
add_executable(osrm-contract src/tools/contract.cpp)
|
add_executable(osrm-contract src/tools/contract.cpp)
|
||||||
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL> )
|
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
|
||||||
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_guidance $<TARGET_OBJECTS:GUIDANCE> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_partition $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_partition src/osrm/partitioner.cpp $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_customize $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
|
||||||
|
|
||||||
if(ENABLE_GOLD_LINKER)
|
if(ENABLE_GOLD_LINKER)
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||||
@@ -271,7 +256,8 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
|
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW)
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
|
||||||
|
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
|
||||||
find_program(GCC_AR gcc-ar)
|
find_program(GCC_AR gcc-ar)
|
||||||
find_program(GCC_RANLIB gcc-ranlib)
|
find_program(GCC_RANLIB gcc-ranlib)
|
||||||
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
||||||
@@ -299,6 +285,12 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
|||||||
set(CMAKE_RANLIB ${LLVM_RANLIB})
|
set(CMAKE_RANLIB ${LLVM_RANLIB})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
|
||||||
|
message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038")
|
||||||
|
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
||||||
|
set(ENABLE_LTO Off)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -325,9 +317,8 @@ if (ENABLE_SANITIZER)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configuring compilers
|
# Configuring compilers
|
||||||
set(OSRM_WARNING_FLAGS "-Werror=all -Werror=extra -Werror=uninitialized -Werror=unreachable-code -Werror=unused-variable -Werror=unreachable-code -Wno-error=cpp -Wpedantic")
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=2 -Wno-error=unused-local-typedef -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
||||||
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
||||||
@@ -335,8 +326,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|||||||
set(COLOR_FLAG "")
|
set(COLOR_FLAG "")
|
||||||
endif()
|
endif()
|
||||||
# using GCC
|
# using GCC
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=1 -Wno-error=maybe-uninitialized -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
||||||
|
|
||||||
if(WIN32) # using mingw
|
if(WIN32) # using mingw
|
||||||
add_dependency_defines(-DWIN32)
|
add_dependency_defines(-DWIN32)
|
||||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||||
@@ -495,6 +485,9 @@ if(ENABLE_MASON)
|
|||||||
# note: we avoid calling find_package(Osmium ...) here to ensure that the
|
# note: we avoid calling find_package(Osmium ...) here to ensure that the
|
||||||
# expat and bzip2 are used from mason rather than the system
|
# expat and bzip2 are used from mason rather than the system
|
||||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
|
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
|
||||||
|
|
||||||
|
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||||
@@ -552,16 +545,12 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
find_package(Osmium REQUIRED COMPONENTS io)
|
find_package(Osmium REQUIRED COMPONENTS io)
|
||||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
||||||
|
|
||||||
|
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
|
||||||
|
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
|
|
||||||
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
|
|
||||||
|
|
||||||
set(MICROTAR_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src")
|
|
||||||
include_directories(SYSTEM ${MICROTAR_INCLUDE_DIR})
|
|
||||||
add_library(MICROTAR OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src/microtar.c")
|
|
||||||
set_property(TARGET MICROTAR PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
# prefix compilation with ccache by default if available and on clang or gcc
|
# prefix compilation with ccache by default if available and on clang or gcc
|
||||||
if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
|
if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
|
||||||
find_program(CCACHE_FOUND ccache)
|
find_program(CCACHE_FOUND ccache)
|
||||||
@@ -635,12 +624,6 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${ZLIB_LIBRARY}
|
${ZLIB_LIBRARY}
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
${MAYBE_COVERAGE_LIBRARIES})
|
||||||
set(GUIDANCE_LIBRARIES
|
|
||||||
${BOOST_BASE_LIBRARIES}
|
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
|
||||||
${USED_LUA_LIBRARIES}
|
|
||||||
${TBB_LIBRARIES}
|
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
|
||||||
set(PARTITIONER_LIBRARIES
|
set(PARTITIONER_LIBRARIES
|
||||||
${BOOST_ENGINE_LIBRARIES}
|
${BOOST_ENGINE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
@@ -687,20 +670,19 @@ set(UTIL_LIBRARIES
|
|||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${MAYBE_STXXL_LIBRARY}
|
${MAYBE_STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_COVERAGE_LIBRARIES}
|
${MAYBE_COVERAGE_LIBRARIES})
|
||||||
${ZLIB_LIBRARY})
|
|
||||||
|
|
||||||
# Libraries
|
# Libraries
|
||||||
target_link_libraries(osrm ${ENGINE_LIBRARIES})
|
target_link_libraries(osrm ${ENGINE_LIBRARIES})
|
||||||
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
|
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
|
||||||
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store)
|
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store)
|
||||||
target_link_libraries(osrm_extract osrm_guidance ${EXTRACTOR_LIBRARIES})
|
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
||||||
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
|
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
|
||||||
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store)
|
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store)
|
||||||
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
||||||
|
|
||||||
# BUILD_COMPONENTS
|
# BUILD_COMPONENTS
|
||||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_LIBRARIES})
|
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_LIBRARIES})
|
||||||
install(TARGETS osrm-components DESTINATION bin)
|
install(TARGETS osrm-components DESTINATION bin)
|
||||||
|
|
||||||
@@ -710,6 +692,15 @@ if(BUILD_TOOLS)
|
|||||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
||||||
|
|
||||||
|
find_package(Shapefile)
|
||||||
|
if(SHAPEFILE_FOUND AND (Boost_VERSION VERSION_GREATER 106000 OR ENABLE_MASON))
|
||||||
|
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
|
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
|
||||||
|
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||||
|
${UTIL_LIBRARIES} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARY} ${EXPAT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
install(TARGETS osrm-extract-conditionals DESTINATION bin)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_ASSERTIONS)
|
if (ENABLE_ASSERTIONS)
|
||||||
@@ -732,14 +723,14 @@ file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
|||||||
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
|
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
|
||||||
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp)
|
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp)
|
||||||
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
||||||
set(PartitionerHeader include/partitioner/partitioner.hpp include/partitioner/partitioner_config.hpp)
|
set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp)
|
||||||
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
||||||
set(StorageHeader include/storage/storage.hpp include/storage/io_config.hpp include/storage/storage_config.hpp)
|
set(StorageHeader include/storage/storage.hpp include/storage/io_config.hpp include/storage/storage_config.hpp)
|
||||||
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
|
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
|
||||||
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
|
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
|
||||||
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
|
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
|
||||||
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
|
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
|
||||||
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partitioner)
|
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partition)
|
||||||
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
|
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
|
||||||
install(FILES ${LibraryGlob} DESTINATION include/osrm)
|
install(FILES ${LibraryGlob} DESTINATION include/osrm)
|
||||||
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
||||||
|
|||||||
@@ -59,14 +59,9 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
|
|||||||
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
||||||
|
|
||||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||||
|
|
||||||
The flag `-v $(pwd):/data` creates the directory `/data` inside the docker container and makes the current working directory `$(pwd)` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `$(pwd)/berlin-latest.osm.pbf` on the host.
|
|
||||||
|
|
||||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
||||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
||||||
|
|
||||||
Note that `berlin-latest.osrm` has a different file extension.
|
|
||||||
|
|
||||||
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
|
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
|
||||||
|
|
||||||
Make requests against the HTTP server
|
Make requests against the HTTP server
|
||||||
@@ -119,8 +114,7 @@ sudo cmake --build . --target install
|
|||||||
|
|
||||||
### Request Against the Demo Server
|
### Request Against the Demo Server
|
||||||
|
|
||||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Demo-server).
|
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||||
|
|
||||||
Simple query with instructions and alternatives on Berlin:
|
Simple query with instructions and alternatives on Berlin:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -161,6 +161,29 @@ XCOPY /Y corech\*.* ..\test\data\corech\
|
|||||||
XCOPY /Y mld\*.* ..\test\data\mld\
|
XCOPY /Y mld\*.* ..\test\data\mld\
|
||||||
unit_tests\%Configuration%\library-tests.exe
|
unit_tests\%Configuration%\library-tests.exe
|
||||||
|
|
||||||
|
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
||||||
|
ECHO ========= CREATING PACKAGES ==========
|
||||||
|
|
||||||
|
CD %PROJECT_DIR%\build\%Configuration%
|
||||||
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
|
SET P=%PROJECT_DIR%
|
||||||
|
SET ZIP= %P%\osrm_%Configuration%.zip
|
||||||
|
IF EXIST %ZIP% ECHO deleting %ZIP% && DEL /F /Q %ZIP%
|
||||||
|
IF %ERRORLEVEL% NEQ 0 ECHO deleting %ZIP% FAILED && GOTO ERROR
|
||||||
|
|
||||||
|
7z a %ZIP% *.lib *.exe *.pdb %P%/osrm-deps/libs/bin/*.dll -tzip -mx9 | %windir%\system32\FIND "ing archive"
|
||||||
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
|
CD ..\..\profiles
|
||||||
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
|
ECHO disk=c:\temp\stxxl,10000,wincall > .stxxl.txt
|
||||||
|
7z a %ZIP% * -tzip -mx9 | %windir%\system32\FIND "ing archive"
|
||||||
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
|
GOTO DONE
|
||||||
|
|
||||||
:ERROR
|
:ERROR
|
||||||
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
ECHO ERRORLEVEL^: %ERRORLEVEL%
|
ECHO ERRORLEVEL^: %ERRORLEVEL%
|
||||||
|
|||||||
@@ -29,7 +29,24 @@ before_test:
|
|||||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
- path: osrm_Release.zip
|
||||||
|
name: osrm_Release.zip
|
||||||
|
# - path: osrm_Debug.zip
|
||||||
|
# name: osrm_Debug.zip
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: FTP
|
||||||
|
server:
|
||||||
|
secure: ef7oiQTTXFGt8NdNiOHm/uRFVrUttzyFbIlnaeHhQvw=
|
||||||
|
username:
|
||||||
|
secure: Bw+Se2GTJxA6+GtRkEc//tQSBHOuFIuJHBjFwR9cD+8=
|
||||||
|
password:
|
||||||
|
secure: eqwESZqxMXC/j5mOCpaXuw==
|
||||||
|
folder: /
|
||||||
|
enable_ssl: true
|
||||||
|
active_mode: false
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# - Try to find Shapefile C Library
|
||||||
|
# http://shapelib.maptools.org/
|
||||||
|
#
|
||||||
|
# Exports:
|
||||||
|
# Shapefile_FOUND
|
||||||
|
# LIBSHAPEFILE_INCLUDE_DIR
|
||||||
|
# LIBSHAPEFILE_LIBRARY
|
||||||
|
# Hints:
|
||||||
|
# LIBSHAPEFILE_LIBRARY_DIR
|
||||||
|
|
||||||
|
find_path(LIBSHAPEFILE_INCLUDE_DIR
|
||||||
|
shapefil.h)
|
||||||
|
|
||||||
|
find_library(LIBSHAPEFILE_LIBRARY
|
||||||
|
NAMES shp
|
||||||
|
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Shapefile DEFAULT_MSG
|
||||||
|
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
|
||||||
@@ -1,290 +0,0 @@
|
|||||||
# https://github.com/sbellus/json-cmake/blob/9913da8800b95322d393894d3525d634568f305e/JSONParser.cmake
|
|
||||||
# MIT Licensed - https://github.com/sbellus/json-cmake/blob/master/LICENSE
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1)
|
|
||||||
|
|
||||||
if (DEFINED JSonParserGuard)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(JSonParserGuard yes)
|
|
||||||
|
|
||||||
macro(sbeParseJson prefix jsonString)
|
|
||||||
cmake_policy(PUSH)
|
|
||||||
|
|
||||||
set(json_string "${${jsonString}}")
|
|
||||||
string(LENGTH "${json_string}" json_jsonLen)
|
|
||||||
set(json_index 0)
|
|
||||||
set(json_AllVariables ${prefix})
|
|
||||||
set(json_ArrayNestingLevel 0)
|
|
||||||
set(json_MaxArrayNestingLevel 0)
|
|
||||||
|
|
||||||
_sbeParse(${prefix})
|
|
||||||
|
|
||||||
unset(json_index)
|
|
||||||
unset(json_AllVariables)
|
|
||||||
unset(json_jsonLen)
|
|
||||||
unset(json_string)
|
|
||||||
unset(json_value)
|
|
||||||
unset(json_inValue)
|
|
||||||
unset(json_name)
|
|
||||||
unset(json_inName)
|
|
||||||
unset(json_newPrefix)
|
|
||||||
unset(json_reservedWord)
|
|
||||||
unset(json_arrayIndex)
|
|
||||||
unset(json_char)
|
|
||||||
unset(json_end)
|
|
||||||
unset(json_ArrayNestingLevel)
|
|
||||||
foreach(json_nestingLevel RANGE ${json_MaxArrayNestingLevel})
|
|
||||||
unset(json_${json_nestingLevel}_arrayIndex)
|
|
||||||
endforeach()
|
|
||||||
unset(json_nestingLevel)
|
|
||||||
unset(json_MaxArrayNestingLevel)
|
|
||||||
|
|
||||||
cmake_policy(POP)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(sbeClearJson prefix)
|
|
||||||
foreach(json_var ${${prefix}})
|
|
||||||
unset(${json_var})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
unset(${prefix})
|
|
||||||
unset(json_var)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(sbePrintJson prefix)
|
|
||||||
foreach(json_var ${${prefix}})
|
|
||||||
message("${json_var} = ${${json_var}}")
|
|
||||||
endforeach()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeParse prefix)
|
|
||||||
|
|
||||||
while(${json_index} LESS ${json_jsonLen})
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
|
|
||||||
if("\"" STREQUAL "${json_char}")
|
|
||||||
_sbeParseNameValue(${prefix})
|
|
||||||
elseif("{" STREQUAL "${json_char}")
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
_sbeParseObject(${prefix})
|
|
||||||
elseif("[" STREQUAL "${json_char}")
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
_sbeParseArray(${prefix})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${json_index} LESS ${json_jsonLen})
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
else()
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if ("}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
endwhile()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeParseNameValue prefix)
|
|
||||||
set(json_name "")
|
|
||||||
set(json_inName no)
|
|
||||||
|
|
||||||
while(${json_index} LESS ${json_jsonLen})
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
|
|
||||||
# check if name ends
|
|
||||||
if("\"" STREQUAL "${json_char}" AND json_inName)
|
|
||||||
set(json_inName no)
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
set(json_newPrefix ${prefix}.${json_name})
|
|
||||||
set(json_name "")
|
|
||||||
|
|
||||||
if(":" STREQUAL "${json_char}")
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
|
|
||||||
if("\"" STREQUAL "${json_char}")
|
|
||||||
_sbeParseValue(${json_newPrefix})
|
|
||||||
break()
|
|
||||||
elseif("{" STREQUAL "${json_char}")
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
_sbeParseObject(${json_newPrefix})
|
|
||||||
break()
|
|
||||||
elseif("[" STREQUAL "${json_char}")
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
_sbeParseArray(${json_newPrefix})
|
|
||||||
break()
|
|
||||||
else()
|
|
||||||
# reserved word starts
|
|
||||||
_sbeParseReservedWord(${json_newPrefix})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
# name without value
|
|
||||||
list(APPEND ${json_AllVariables} ${json_newPrefix})
|
|
||||||
set(${json_newPrefix} "")
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(json_inName)
|
|
||||||
# remove escapes
|
|
||||||
if("\\" STREQUAL "${json_char}")
|
|
||||||
math(EXPR json_index "${json_index} + 1")
|
|
||||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(json_name "${json_name}${json_char}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# check if name starts
|
|
||||||
if("\"" STREQUAL "${json_char}" AND NOT json_inName)
|
|
||||||
set(json_inName yes)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
endwhile()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeParseReservedWord prefix)
|
|
||||||
set(json_reservedWord "")
|
|
||||||
set(json_end no)
|
|
||||||
while(${json_index} LESS ${json_jsonLen} AND NOT json_end)
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
|
|
||||||
if("," STREQUAL "${json_char}" OR "}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
|
|
||||||
set(json_end yes)
|
|
||||||
else()
|
|
||||||
set(json_reservedWord "${json_reservedWord}${json_char}")
|
|
||||||
math(EXPR json_index "${json_index} + 1")
|
|
||||||
endif()
|
|
||||||
endwhile()
|
|
||||||
|
|
||||||
list(APPEND ${json_AllVariables} ${prefix})
|
|
||||||
string(STRIP "${json_reservedWord}" json_reservedWord)
|
|
||||||
set(${prefix} ${json_reservedWord})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeParseValue prefix)
|
|
||||||
cmake_policy(SET CMP0054 NEW) # turn off implicit expansions in if statement
|
|
||||||
|
|
||||||
set(json_value "")
|
|
||||||
set(json_inValue no)
|
|
||||||
|
|
||||||
while(${json_index} LESS ${json_jsonLen})
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
|
|
||||||
# check if json_value ends, it is ended by "
|
|
||||||
if("\"" STREQUAL "${json_char}" AND json_inValue)
|
|
||||||
set(json_inValue no)
|
|
||||||
|
|
||||||
set(${prefix} ${json_value})
|
|
||||||
list(APPEND ${json_AllVariables} ${prefix})
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(json_inValue)
|
|
||||||
# if " is escaped consume
|
|
||||||
if("\\" STREQUAL "${json_char}")
|
|
||||||
math(EXPR json_index "${json_index} + 1")
|
|
||||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
if(NOT "\"" STREQUAL "${json_char}")
|
|
||||||
# if it is not " then copy also escape character
|
|
||||||
set(json_char "\\${json_char}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
_sbeAddEscapedCharacter("${json_char}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# check if value starts
|
|
||||||
if("\"" STREQUAL "${json_char}" AND NOT json_inValue)
|
|
||||||
set(json_inValue yes)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
math(EXPR json_index "${json_index} + 1")
|
|
||||||
endwhile()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeAddEscapedCharacter char)
|
|
||||||
string(CONCAT json_value "${json_value}" "${char}")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeParseObject prefix)
|
|
||||||
_sbeParse(${prefix})
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeParseArray prefix)
|
|
||||||
math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} + 1")
|
|
||||||
set(json_${json_ArrayNestingLevel}_arrayIndex 0)
|
|
||||||
|
|
||||||
set(${prefix} "")
|
|
||||||
list(APPEND ${json_AllVariables} ${prefix})
|
|
||||||
|
|
||||||
while(${json_index} LESS ${json_jsonLen})
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
|
|
||||||
if("\"" STREQUAL "${json_char}")
|
|
||||||
# simple value
|
|
||||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
|
||||||
_sbeParseValue(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
|
||||||
elseif("{" STREQUAL "${json_char}")
|
|
||||||
# object
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
|
||||||
_sbeParseObject(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
|
||||||
else()
|
|
||||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
|
||||||
_sbeParseReservedWord(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
|
|
||||||
if("]" STREQUAL "${json_char}")
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
break()
|
|
||||||
elseif("," STREQUAL "${json_char}")
|
|
||||||
math(EXPR json_${json_ArrayNestingLevel}_arrayIndex "${json_${json_ArrayNestingLevel}_arrayIndex} + 1")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
_sbeMoveToNextNonEmptyCharacter()
|
|
||||||
endwhile()
|
|
||||||
|
|
||||||
if(${json_MaxArrayNestingLevel} LESS ${json_ArrayNestingLevel})
|
|
||||||
set(json_MaxArrayNestingLevel ${json_ArrayNestingLevel})
|
|
||||||
endif()
|
|
||||||
math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} - 1")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(_sbeMoveToNextNonEmptyCharacter)
|
|
||||||
math(EXPR json_index "${json_index} + 1")
|
|
||||||
if(${json_index} LESS ${json_jsonLen})
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
while(${json_char} MATCHES "[ \t\n\r]" AND ${json_index} LESS ${json_jsonLen})
|
|
||||||
math(EXPR json_index "${json_index} + 1")
|
|
||||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
|
||||||
endwhile()
|
|
||||||
endif()
|
|
||||||
endmacro()
|
|
||||||
+180
-416
@@ -10,6 +10,43 @@
|
|||||||
"type": "Polygon",
|
"type": "Polygon",
|
||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
|
[
|
||||||
|
-60.07324218749999,
|
||||||
|
12.71000912504629
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-59.0185546875,
|
||||||
|
12.71000912504629
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-59.0185546875,
|
||||||
|
13.694024844701644
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-60.07324218749999,
|
||||||
|
13.694024844701644
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-60.07324218749999,
|
||||||
|
12.71000912504629
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"properties": {
|
||||||
|
"driving_side": "left"
|
||||||
|
},
|
||||||
|
"geometry": {
|
||||||
|
"type": "Polygon",
|
||||||
|
"coordinates": [
|
||||||
|
[
|
||||||
|
[
|
||||||
|
164.3678069114686,
|
||||||
|
-30.759557257019974
|
||||||
|
],
|
||||||
[
|
[
|
||||||
159.78515624999997,
|
159.78515624999997,
|
||||||
-21.943045533438166
|
-21.943045533438166
|
||||||
@@ -322,6 +359,10 @@
|
|||||||
92.56116628646856,
|
92.56116628646856,
|
||||||
15.147674168282906
|
15.147674168282906
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
88.78186941146853,
|
||||||
|
12.158807474538182
|
||||||
|
],
|
||||||
[
|
[
|
||||||
90.71546316146853,
|
90.71546316146853,
|
||||||
0.759386240320313
|
0.759386240320313
|
||||||
@@ -351,8 +392,8 @@
|
|||||||
-33.73235247373941
|
-33.73235247373941
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
159.78515624999997,
|
164.3678069114686,
|
||||||
-21.943045533438166
|
-30.759557257019974
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -368,8 +409,12 @@
|
|||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
147.15087890625003,
|
147.381591796875,
|
||||||
44.13885576756881
|
43.26920624914964
|
||||||
|
],
|
||||||
|
[
|
||||||
|
147.06298828125,
|
||||||
|
44.22158376545796
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
145.52490234375,
|
145.52490234375,
|
||||||
@@ -387,13 +432,37 @@
|
|||||||
141.48193359375,
|
141.48193359375,
|
||||||
45.836454050187726
|
45.836454050187726
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
140.38330078125,
|
||||||
|
45.47554027158593
|
||||||
|
],
|
||||||
|
[
|
||||||
|
138.021240234375,
|
||||||
|
41.08763212467916
|
||||||
|
],
|
||||||
[
|
[
|
||||||
135.0439453125,
|
135.0439453125,
|
||||||
37.71859032558816
|
37.71859032558816
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
127.88085937500001,
|
132.462158203125,
|
||||||
32.565333160841035
|
36.37706783983682
|
||||||
|
],
|
||||||
|
[
|
||||||
|
130.53955078125,
|
||||||
|
34.71452466170392
|
||||||
|
],
|
||||||
|
[
|
||||||
|
129.00146484375,
|
||||||
|
33.568861182555565
|
||||||
|
],
|
||||||
|
[
|
||||||
|
127.891845703125,
|
||||||
|
32.54681317351514
|
||||||
|
],
|
||||||
|
[
|
||||||
|
127.606201171875,
|
||||||
|
30.240086360983426
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
125.61767578124999,
|
125.61767578124999,
|
||||||
@@ -412,12 +481,28 @@
|
|||||||
25.284437746983055
|
25.284437746983055
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
141.36108398437503,
|
136.3623046875,
|
||||||
33.394759218577995
|
30.41078179084589
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
147.15087890625003,
|
143.67919921874997,
|
||||||
44.13885576756881
|
33.925129700072
|
||||||
|
],
|
||||||
|
[
|
||||||
|
144.25048828125,
|
||||||
|
39.605688178320804
|
||||||
|
],
|
||||||
|
[
|
||||||
|
147.45849609375,
|
||||||
|
42.48830197960227
|
||||||
|
],
|
||||||
|
[
|
||||||
|
147.94189453125,
|
||||||
|
43.13306116240612
|
||||||
|
],
|
||||||
|
[
|
||||||
|
147.381591796875,
|
||||||
|
43.26920624914964
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -432,6 +517,18 @@
|
|||||||
"type": "Polygon",
|
"type": "Polygon",
|
||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
|
[
|
||||||
|
2.63671875,
|
||||||
|
52.119998657638156
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2.5048828125,
|
||||||
|
53.527247970102465
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-0.0439453125,
|
||||||
|
56.992882804633986
|
||||||
|
],
|
||||||
[
|
[
|
||||||
1.9116210937499998,
|
1.9116210937499998,
|
||||||
61.19621314083867
|
61.19621314083867
|
||||||
@@ -441,12 +538,24 @@
|
|||||||
61.990587736204105
|
61.990587736204105
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-12.54638671875,
|
-7.6025390625,
|
||||||
55.94919982336746
|
59.678835236960765
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-12.260742187500002,
|
-12.28271484375,
|
||||||
50.62507306341437
|
55.51619215717891
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-12.19482421875,
|
||||||
|
51.2206474303833
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-6.591796875,
|
||||||
|
49.403824657885124
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-3.251953125,
|
||||||
|
49.25346477497736
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-1.9445800781249998,
|
-1.9445800781249998,
|
||||||
@@ -468,13 +577,17 @@
|
|||||||
-0.3515625,
|
-0.3515625,
|
||||||
49.69606181911566
|
49.69606181911566
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
0.87890625,
|
||||||
|
50.736455137010665
|
||||||
|
],
|
||||||
[
|
[
|
||||||
2.5048828125,
|
2.5048828125,
|
||||||
51.6180165487737
|
51.6180165487737
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
1.9116210937499998,
|
2.63671875,
|
||||||
61.19621314083867
|
52.119998657638156
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -489,6 +602,10 @@
|
|||||||
"type": "Polygon",
|
"type": "Polygon",
|
||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
|
[
|
||||||
|
91.77978515625,
|
||||||
|
20.899871347076424
|
||||||
|
],
|
||||||
[
|
[
|
||||||
92.39501953125,
|
92.39501953125,
|
||||||
21.514406720030294
|
21.514406720030294
|
||||||
@@ -833,6 +950,10 @@
|
|||||||
61.58935546875,
|
61.58935546875,
|
||||||
25.224820176765036
|
25.224820176765036
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
67.8076171875,
|
||||||
|
16.678293098288513
|
||||||
|
],
|
||||||
[
|
[
|
||||||
74.970703125,
|
74.970703125,
|
||||||
7.580327791330129
|
7.580327791330129
|
||||||
@@ -846,12 +967,16 @@
|
|||||||
-2.986927393334863
|
-2.986927393334863
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
85.86914062500001,
|
84.8583984375,
|
||||||
5.5941182188847876
|
0.4833927027896987
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
92.39501953125,
|
88.3740234375,
|
||||||
21.514406720030294
|
14.774882506516272
|
||||||
|
],
|
||||||
|
[
|
||||||
|
91.77978515625,
|
||||||
|
20.899871347076424
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -860,15 +985,23 @@
|
|||||||
{
|
{
|
||||||
"type": "Feature",
|
"type": "Feature",
|
||||||
"properties": {
|
"properties": {
|
||||||
"driving_side": "left"
|
"stroke": "#555555",
|
||||||
|
"stroke-width": 2,
|
||||||
|
"stroke-opacity": 1,
|
||||||
|
"fill": "#555555",
|
||||||
|
"fill-opacity": 0.5
|
||||||
},
|
},
|
||||||
"geometry": {
|
"geometry": {
|
||||||
"type": "Polygon",
|
"type": "Polygon",
|
||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
43.57177734375001,
|
43.41796875,
|
||||||
-4.390228926463384
|
-3.1405161039832357
|
||||||
|
],
|
||||||
|
[
|
||||||
|
41.6162109375,
|
||||||
|
-1.7355743631421197
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
41.0009765625,
|
41.0009765625,
|
||||||
@@ -1131,8 +1264,20 @@
|
|||||||
-34.74161249883172
|
-34.74161249883172
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
43.57177734375001,
|
40.95703125,
|
||||||
-4.390228926463384
|
-18.646245142670598
|
||||||
|
],
|
||||||
|
[
|
||||||
|
42.2314453125,
|
||||||
|
-13.581920900545844
|
||||||
|
],
|
||||||
|
[
|
||||||
|
41.3525390625,
|
||||||
|
-8.754794702435618
|
||||||
|
],
|
||||||
|
[
|
||||||
|
43.41796875,
|
||||||
|
-3.1405161039832357
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -1573,24 +1718,24 @@
|
|||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
-81.67236328125001,
|
-82.012939453125,
|
||||||
19.03875247795316
|
18.90108960836388
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-79.76898193359376,
|
-80.48583984375,
|
||||||
19.48989674307901
|
18.90108960836388
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-79.48333740234375,
|
-80.48583984375,
|
||||||
19.888140273126222
|
19.735683578629445
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-81.45263671875001,
|
-82.012939453125,
|
||||||
19.46400263520258
|
19.735683578629445
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-81.67236328125001,
|
-82.012939453125,
|
||||||
19.03875247795316
|
18.90108960836388
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -1834,387 +1979,6 @@
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
-79.82666015625001,
|
|
||||||
25.035838555635017
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-73.55346679687501,
|
|
||||||
20.324023603422518
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-70.82336425781251,
|
|
||||||
21.307287323905406
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-78.38745117187501,
|
|
||||||
28.304380682962783
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-79.82666015625001,
|
|
||||||
25.035838555635017
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
-59.06250000000001,
|
|
||||||
13.378931658431565
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.02905273437501,
|
|
||||||
14.216463756160174
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.92443847656251,
|
|
||||||
12.350734120814016
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.71569824218751,
|
|
||||||
10.935798432254105
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-62.06176757812501,
|
|
||||||
10.028357677443571
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.13891601562501,
|
|
||||||
9.855216086088848
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-59.06250000000001,
|
|
||||||
13.378931658431565
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
-61.43829345703126,
|
|
||||||
17.17228278169308
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.80358886718751,
|
|
||||||
17.882045302279195
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-62.91870117187501,
|
|
||||||
17.403062993328938
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-62.149658203125,
|
|
||||||
16.52826534972986
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.43829345703126,
|
|
||||||
17.17228278169308
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
-61.33392333984376,
|
|
||||||
15.731457491108594
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.63604736328126,
|
|
||||||
15.570127852659427
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.36138916015626,
|
|
||||||
15.10394633500913
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.13342285156251,
|
|
||||||
15.257689080778713
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-61.33392333984376,
|
|
||||||
15.731457491108594
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
-63.46664428710938,
|
|
||||||
18.672267305093758
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-64.5604705810547,
|
|
||||||
18.78736737706614
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-64.8845672607422,
|
|
||||||
18.40665471391907
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-64.6593475341797,
|
|
||||||
18.365604299215338
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-64.61608886718751,
|
|
||||||
18.114529138838503
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-63.30596923828126,
|
|
||||||
18.108002884854656
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-62.79235839843751,
|
|
||||||
18.231960055191504
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-63.46664428710938,
|
|
||||||
18.672267305093758
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
31.898803710937504,
|
|
||||||
35.29943548054545
|
|
||||||
],
|
|
||||||
[
|
|
||||||
32.38220214843751,
|
|
||||||
34.43409789359469
|
|
||||||
],
|
|
||||||
[
|
|
||||||
34.69482421875001,
|
|
||||||
34.74161249883172
|
|
||||||
],
|
|
||||||
[
|
|
||||||
34.74975585937501,
|
|
||||||
35.79999392988527
|
|
||||||
],
|
|
||||||
[
|
|
||||||
31.898803710937504,
|
|
||||||
35.29943548054545
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
166.53076171875003,
|
|
||||||
-0.7140928403610857
|
|
||||||
],
|
|
||||||
[
|
|
||||||
172.81494140625009,
|
|
||||||
0.4751532449748611
|
|
||||||
],
|
|
||||||
[
|
|
||||||
176.50634765625003,
|
|
||||||
-17.245744208007117
|
|
||||||
],
|
|
||||||
[
|
|
||||||
177.82470703125009,
|
|
||||||
-19.36038488536514
|
|
||||||
],
|
|
||||||
[
|
|
||||||
180.0439453125002,
|
|
||||||
-19.67103928897615
|
|
||||||
],
|
|
||||||
[
|
|
||||||
180.1098632812502,
|
|
||||||
-13.333502655583224
|
|
||||||
],
|
|
||||||
[
|
|
||||||
189.00878906250003,
|
|
||||||
-9.760490714194388
|
|
||||||
],
|
|
||||||
[
|
|
||||||
189.931640625,
|
|
||||||
-4.726989319952657
|
|
||||||
],
|
|
||||||
[
|
|
||||||
199.62158203125003,
|
|
||||||
2.583657640731887
|
|
||||||
],
|
|
||||||
[
|
|
||||||
201.04980468750003,
|
|
||||||
-0.6014904163878395
|
|
||||||
],
|
|
||||||
[
|
|
||||||
193.31542968750003,
|
|
||||||
-9.543874794137526
|
|
||||||
],
|
|
||||||
[
|
|
||||||
193.42529296875003,
|
|
||||||
-14.95274576245613
|
|
||||||
],
|
|
||||||
[
|
|
||||||
183.7353515625,
|
|
||||||
-14.846576365691352
|
|
||||||
],
|
|
||||||
[
|
|
||||||
180.3295898437502,
|
|
||||||
-24.27450874986185
|
|
||||||
],
|
|
||||||
[
|
|
||||||
203.46679687500003,
|
|
||||||
-22.662175307872086
|
|
||||||
],
|
|
||||||
[
|
|
||||||
203.2470703125,
|
|
||||||
-13.247966096402816
|
|
||||||
],
|
|
||||||
[
|
|
||||||
211.33300781250003,
|
|
||||||
-11.35887518924762
|
|
||||||
],
|
|
||||||
[
|
|
||||||
200.65429687500003,
|
|
||||||
6.468151012664214
|
|
||||||
],
|
|
||||||
[
|
|
||||||
179.8461914062502,
|
|
||||||
-4.836470204221701
|
|
||||||
],
|
|
||||||
[
|
|
||||||
173.1445312500001,
|
|
||||||
4.162897490667403
|
|
||||||
],
|
|
||||||
[
|
|
||||||
166.53076171875003,
|
|
||||||
-0.7140928403610857
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
-127.33154296875001,
|
|
||||||
-24.166802085303225
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-131.17675781250003,
|
|
||||||
-23.60426184707018
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-130.34179687500003,
|
|
||||||
-25.324166525738384
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-123.49731445312501,
|
|
||||||
-24.716895455859337
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-127.33154296875001,
|
|
||||||
-24.166802085303225
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"driving_side": "left"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "Polygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
-5.976562500000001,
|
|
||||||
-15.728813770533979
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-5.949096679687501,
|
|
||||||
-16.13026201203474
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-5.482177734375001,
|
|
||||||
-16.156644815257152
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-5.465698242187501,
|
|
||||||
-15.760536148501288
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-5.976562500000001,
|
|
||||||
-15.728813770533979
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+6
-24
@@ -120,7 +120,6 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||||
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
|
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
|
||||||
- `distance`: Distance in meters to the supplied input coordinate.
|
- `distance`: Distance in meters to the supplied input coordinate.
|
||||||
- `nodes`: Array of OpenStreetMap node ids.
|
|
||||||
|
|
||||||
#### Example Requests
|
#### Example Requests
|
||||||
|
|
||||||
@@ -135,10 +134,6 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
|
|||||||
{
|
{
|
||||||
"waypoints" : [
|
"waypoints" : [
|
||||||
{
|
{
|
||||||
"nodes": [
|
|
||||||
2264199819,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
|
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
|
||||||
"distance" : 4.152629,
|
"distance" : 4.152629,
|
||||||
"name" : "Friedrichstraße",
|
"name" : "Friedrichstraße",
|
||||||
@@ -148,10 +143,6 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nodes": [
|
|
||||||
2045820592,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"hint" : "KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g",
|
"hint" : "KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g",
|
||||||
"distance" : 11.811961,
|
"distance" : 11.811961,
|
||||||
"name" : "Friedrichstraße",
|
"name" : "Friedrichstraße",
|
||||||
@@ -161,10 +152,6 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nodes": [
|
|
||||||
0,
|
|
||||||
21487242
|
|
||||||
],
|
|
||||||
"hint" : "KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g",
|
"hint" : "KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g",
|
||||||
"distance" : 15.872438,
|
"distance" : 15.872438,
|
||||||
"name" : "Friedrichstraße",
|
"name" : "Friedrichstraße",
|
||||||
@@ -301,7 +288,6 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
||||||
|gaps |`split` (default), `ignore` |Allows the input track splitting based on huge timestamp gaps between points. |
|
|gaps |`split` (default), `ignore` |Allows the input track splitting based on huge timestamp gaps between points. |
|
||||||
|tidy |`true`, `false` (default) |Allows the input track modification to obtain better matching quality for noisy tracks. |
|
|tidy |`true`, `false` (default) |Allows the input track modification to obtain better matching quality for noisy tracks. |
|
||||||
|waypoints | `{index};{index};{index}...` |Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. |
|
|
||||||
|
|
||||||
|Parameter |Values |
|
|Parameter |Values |
|
||||||
|------------|-----------------------------------|
|
|------------|-----------------------------------|
|
||||||
@@ -528,10 +514,10 @@ Represents a route between two waypoints.
|
|||||||
|
|
||||||
- `annotation`: Additional details about each coordinate along the route geometry:
|
- `annotation`: Additional details about each coordinate along the route geometry:
|
||||||
|
|
||||||
| annotations | |
|
| annotations | |
|
||||||
|--------------|-------------------------------------------------------------------------------|
|
|--------------|-----------------------------------------------------------------------|
|
||||||
| true | An `Annotation` object containing node ids, durations, distances and weights. |
|
| true | An `Annotation` object containing node ids, durations distances and |
|
||||||
| false | `undefined` |
|
| false | weights `undefined` |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -547,7 +533,6 @@ With `steps=false` and `annotations=true`:
|
|||||||
"distance": [5,5,10,5,5],
|
"distance": [5,5,10,5,5],
|
||||||
"duration": [15,15,40,15,15],
|
"duration": [15,15,40,15,15],
|
||||||
"datasources": [1,0,0,0,1],
|
"datasources": [1,0,0,0,1],
|
||||||
"metadata": { "datasource_names": ["traffic","lua profile","lua profile","lua profile","traffic"] },
|
|
||||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||||
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
|
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
|
||||||
}
|
}
|
||||||
@@ -562,12 +547,10 @@ Annotation of the whole route leg with fine-grained information about each segme
|
|||||||
|
|
||||||
- `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. Does not include the duration of any turns.
|
- `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` or `osrm-customize`. String-like names are in the `metadata.datasource_names` array.
|
- `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. Does not include any turn costs.
|
- `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
|
||||||
- `metadata`: Metadata related to other annotations
|
|
||||||
- `datasource_names`: The names of the datasources used for the speed between each pair of coordinates. `lua profile` is the default profile, other values arethe filenames supplied via `--segment-speed-file` to `osrm-contract` or `osrm-customize`
|
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -576,7 +559,6 @@ Annotation of the whole route leg with fine-grained information about each segme
|
|||||||
"distance": [5,5,10,5,5],
|
"distance": [5,5,10,5,5],
|
||||||
"duration": [15,15,40,15,15],
|
"duration": [15,15,40,15,15],
|
||||||
"datasources": [1,0,0,0,1],
|
"datasources": [1,0,0,0,1],
|
||||||
"metadata": { "datasource_names": ["traffic","lua profile","lua profile","lua profile","traffic"] },
|
|
||||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||||
"weight": [15,15,40,15,15]
|
"weight": [15,15,40,15,15]
|
||||||
}
|
}
|
||||||
@@ -604,7 +586,7 @@ step.
|
|||||||
|
|
||||||
- `name`: The name of the way along which travel proceeds.
|
- `name`: The name of the way along which travel proceeds.
|
||||||
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
||||||
- `pronunciation`: A string containing an [IPA](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) phonetic transcription indicating how to pronounce the name in the `name` property. This property is omitted if pronunciation data is unavailable for the step.
|
- `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.
|
- `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.
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@ var osrm = new OSRM('network.osrm');
|
|||||||
Make sure you prepared the dataset with the correct toolchain.
|
Make sure you prepared the dataset with the correct toolchain.
|
||||||
- `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.memory_file` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Path to a file on disk to store the memory using mmap.
|
|
||||||
- `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_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 (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 (default: unlimited).
|
||||||
@@ -62,7 +61,7 @@ Returns the fastest route between two or more coordinates while visiting the way
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var osrm = new OSRM("berlin-latest.osrm");
|
var osrm = new OSRM("berlin-latest.osrm");
|
||||||
osrm.route({coordinates: [[13.438640,52.519930], [13.415852,52.513191]]}, function(err, result) {
|
osrm.route({coordinates: [[52.519930,13.438640], [52.513191,13.415852]]}, function(err, result) {
|
||||||
if(err) throw err;
|
if(err) throw err;
|
||||||
console.log(result.waypoints); // array of Waypoint objects representing all waypoints in order
|
console.log(result.waypoints); // array of Waypoint objects representing all waypoints in order
|
||||||
console.log(result.routes); // array of Route objects ordered by descending recommendation rank
|
console.log(result.routes); // array of Route objects ordered by descending recommendation rank
|
||||||
|
|||||||
+10
-97
@@ -208,103 +208,16 @@ The `process_turn` function is called for every possible turn in the network. Ba
|
|||||||
|
|
||||||
The following attributes can be read and set on the result in `process_turn`:
|
The following attributes can be read and set on the result in `process_turn`:
|
||||||
|
|
||||||
Attribute | Read/write? | Type | Notes
|
Attribute | Read/write? | Type | Notes
|
||||||
--------------------- | ------------- | --------- | ------------------------------------------------------
|
-------------------|-------------|---------|------------------------------------------------------
|
||||||
angle | Read | Float | Angle of turn in degrees (`[-179, 180]`: `0`=straight, `180`=u turn, `+x`=x degrees to the right, `-x`= x degrees to the left)
|
direction_modifier | Read | Enum | Geometry of turn. Defined in `include/extractor/guidance/turn_instruction.hpp`
|
||||||
number_of_roads | Read | Integer | Number of ways at the intersection of the turn
|
turn_type | Read | Enum | Priority of turn. Defined in `include/extractor/guidance/turn_instruction.hpp`
|
||||||
is_u_turn | Read | Boolean | Is the turn a u-turn?
|
has_traffic_light | Read | Boolean | Is a traffic light present at this turn?
|
||||||
has_traffic_light | Read | Boolean | Is a traffic light present at this turn?
|
source_restricted | Read | Boolean | Is it from a restricted access road? (See definition in `process_way`)
|
||||||
is_left_hand_driving | Read | Boolean | Is left-hand traffic?
|
target_restricted | Read | Boolean | Is it to a restricted access road? (See definition in `process_way`)
|
||||||
source_restricted | Read | Boolean | Is it from a restricted access road? (See definition in `process_way`)
|
angle | Read | Float | Angle of turn in degrees (`0-360`: `0`=u-turn, `180`=straight on)
|
||||||
source_mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
|
||||||
source_is_motorway | Read | Boolean | Is the source road a motorway?
|
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
||||||
source_is_link | Read | Boolean | Is the source road a link?
|
|
||||||
source_number_of_lanes | Read | Integer | How many lanes does the source road have? (default when not tagged: 0)
|
|
||||||
source_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
|
||||||
source_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
|
||||||
source_speed | Read | Integer | Speed on this source road in km/h
|
|
||||||
source_priority_class | Read | Enum | The type of road priority class of the source. Defined in `include/extractor/guidance/road_classification.hpp`
|
|
||||||
target_restricted | Read | Boolean | Is it from a restricted access road? (See definition in `process_way`)
|
|
||||||
target_mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
|
||||||
target_is_motorway | Read | Boolean | Is the target road a motorway?
|
|
||||||
target_is_link | Read | Boolean | Is the target road a link?
|
|
||||||
target_number_of_lanes | Read | Integer | How many lanes does the target road have? (default when not tagged: 0)
|
|
||||||
target_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
|
||||||
target_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
|
||||||
target_speed | Read | Integer | Speed on this target road in km/h
|
|
||||||
target_priority_class | Read | Enum | The type of road priority class of the target. Defined in `include/extractor/guidance/road_classification.hpp`
|
|
||||||
roads_on_the_right | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the right of the turn that are also connected at the intersection
|
|
||||||
roads_on_the_left | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the left of the turn that are also connected at the intersection. If turn is a u turn, this is empty.
|
|
||||||
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
|
||||||
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
|
|
||||||
|
|
||||||
#### `roads_on_the_right` and `roads_on_the_left`
|
|
||||||
|
|
||||||
The information of `roads_on_the_right` and `roads_on_the_left` that can be read are as follows:
|
|
||||||
|
|
||||||
Attribute | Read/write? | Type | Notes
|
|
||||||
--------------------- | ------------- | --------- | ------------------------------------------------------
|
|
||||||
is_restricted | Read | Boolean | Is it a restricted access road? (See definition in `process_way`)
|
|
||||||
mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
|
||||||
is_motorway | Read | Boolean | Is the road a motorway?
|
|
||||||
is_link | Read | Boolean | Is the road a link?
|
|
||||||
number_of_lanes | Read | Integer | How many lanes does the road have? (default when not tagged: 0)
|
|
||||||
highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
|
||||||
access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
|
||||||
speed | Read | Integer | Speed on this road in km/h
|
|
||||||
priority_class | Read | Enum | The type of road priority class of the leg. Defined in `include/extractor/guidance/road_classification.hpp`
|
|
||||||
is_incoming | Read | Boolean | Is the road an incoming road of the intersection
|
|
||||||
is_outgoing | Read | Boolean | Is the road an outgoing road of the intersection
|
|
||||||
|
|
||||||
The order of the roads in `roads_on_the_right` and `roads_on_the_left` are *counter clockwise*. If the turn is a u turn, all other connected roads will be in `roads_on_the_right`.
|
|
||||||
|
|
||||||
**Example**
|
|
||||||
|
|
||||||
```
|
|
||||||
c e
|
|
||||||
| /
|
|
||||||
| /
|
|
||||||
a ---- x ---- b
|
|
||||||
/|
|
|
||||||
/ |
|
|
||||||
f d
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
When turning from `a` to `b` via `x`,
|
|
||||||
* `roads_on_the_right[1]` is the road `xf`
|
|
||||||
* `roads_on_the_right[2]` is the road `xd`
|
|
||||||
* `roads_on_the_left[1]` is the road `xe`
|
|
||||||
* `roads_on_the_left[2]` is the road `xc`
|
|
||||||
|
|
||||||
Note that indices of arrays in lua are 1-based.
|
|
||||||
|
|
||||||
#### `highway_turn_classification` and `access_turn_classification`
|
|
||||||
When setting appropriate turn weights and duration, information about the highway and access tags of roads that are involved in the turn are necessary. The lua turn function `process_turn` does not have access to the original osrm tags anymore. However, `highway_turn_classification` and `access_turn_classification` can be set during setup. The classification set during setup can be later used in `process_turn`.
|
|
||||||
|
|
||||||
**Example**
|
|
||||||
|
|
||||||
In the following example we use `highway_turn_classification` to set the turn weight to `10` if the turn is on a highway and to `5` if the turn is on a primary.
|
|
||||||
|
|
||||||
```
|
|
||||||
function setup()
|
|
||||||
return {
|
|
||||||
highway_turn_classification = {
|
|
||||||
['motorway'] = 2,
|
|
||||||
['primary'] = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
function process_turn(profile, turn) {
|
|
||||||
if turn.source_highway_turn_classification == 2 and turn.target_highway_turn_classification == 2 then
|
|
||||||
turn.weight = 10
|
|
||||||
end
|
|
||||||
if turn.source_highway_turn_classification == 1 and turn.target_highway_turn_classification == 1 then
|
|
||||||
turn.weight = 5
|
|
||||||
end
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Guidance
|
## Guidance
|
||||||
The guidance parameters in profiles are currently a work in progress. They can and will change.
|
The guidance parameters in profiles are currently a work in progress. They can and will change.
|
||||||
|
|||||||
+6
-8
@@ -43,14 +43,12 @@ We may introduce forward-compatible changes: query parameters and response prope
|
|||||||
|
|
||||||
1. Check out the appropriate release branch `x.y`
|
1. Check out the appropriate release branch `x.y`
|
||||||
2. Make sure `CHANGELOG.md` is up to date.
|
2. Make sure `CHANGELOG.md` is up to date.
|
||||||
3. Make sure the `package.json` is up to date.
|
3. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||||
4. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
4. Make sure the `package.json` is up to date.
|
||||||
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
5. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||||
6. Use `npm run docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
6. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||||
7. Push tags and commits: `git push; git push --tags`
|
7. Use `npm run docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
||||||
8. On https://github.com/Project-OSRM/osrm-backend/releases press `Draft a new release`,
|
8. Push tags and commits: `git push; git push --tags`
|
||||||
write the release tag `vx.y.z` in the `Tag version` field, write the changelog entries in the `Describe this release` field
|
|
||||||
and press `Publish release`.
|
|
||||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||||
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
|
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
|
||||||
`rm -rf node_modules && npm install` locally.
|
`rm -rf node_modules && npm install` locally.
|
||||||
|
|||||||
@@ -46,14 +46,12 @@ Feature: Bike - Cycle tracks/lanes
|
|||||||
| primary | | | | x | x |
|
| primary | | | | x | x |
|
||||||
| motorway | | | | | |
|
| motorway | | | | | |
|
||||||
| motorway | track | | | x | |
|
| motorway | track | | | x | |
|
||||||
| motorway | opposite | | | x | x |
|
| motorway | opposite | | | | x |
|
||||||
| motorway | | track | | x | |
|
| motorway | | track | | | x |
|
||||||
| motorway | | opposite | | x | x |
|
| motorway | | opposite | | | x |
|
||||||
| motorway | | | track | x | |
|
| motorway | | | track | x | |
|
||||||
| motorway | | | opposite | x | x |
|
| motorway | | | opposite | x | |
|
||||||
# motorways are implicit oneways and cycleway tracks next to oneways always
|
| motorway | | track | track | x | x |
|
||||||
# follow the oneway direction (unless tagged as opposite)
|
|
||||||
| motorway | | track | track | x | |
|
|
||||||
| motorway | | opposite | opposite | x | x |
|
| motorway | | opposite | opposite | x | x |
|
||||||
| motorway | | track | opposite | x | x |
|
| motorway | | track | opposite | x | x |
|
||||||
| motorway | | opposite | track | x | x |
|
| motorway | | opposite | track | x | x |
|
||||||
@@ -94,6 +92,6 @@ Feature: Bike - Cycle tracks/lanes
|
|||||||
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 | 4 km/h +-1 |
|
| residential | track | yes | 15 km/h | 6 km/h +-1 |
|
||||||
| cycleway | track | yes | 15 km/h | 4 km/h +-1 |
|
| cycleway | track | yes | 15 km/h | 6 km/h +-1 |
|
||||||
| footway | track | yes | 15 km/h | 4 km/h +-1 |
|
| footway | track | yes | 15 km/h | 6 km/h +-1 |
|
||||||
|
|||||||
@@ -141,12 +141,5 @@ Feature: Bike - Oneway streets
|
|||||||
| highway | oneway | cycleway:left | cycleway:right | forw | backw |
|
| highway | oneway | cycleway:left | cycleway:right | forw | backw |
|
||||||
| primary | yes | | | cycling | pushing bike |
|
| primary | yes | | | cycling | pushing bike |
|
||||||
| primary | yes | | track | cycling | pushing bike |
|
| primary | yes | | track | cycling | pushing bike |
|
||||||
| primary | yes | track | | cycling | pushing bike |
|
| primary | yes | track | | cycling | cycling |
|
||||||
| primary | yes | track | track | cycling | pushing bike |
|
| primary | yes | track | track | cycling | cycling |
|
||||||
|
|
||||||
Scenario: Bike - Left/right cycleways on any oneways
|
|
||||||
Then routability should be
|
|
||||||
| foot | oneway | cycleway:left | cycleway:right | forw | backw |
|
|
||||||
| no | yes | track | | cycling | |
|
|
||||||
| yes | yes | track | | cycling | pushing bike |
|
|
||||||
| yes | -1 | track | | pushing bike | cycling |
|
|
||||||
@@ -11,15 +11,15 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
|||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||||
| motorway | | | | | |
|
| motorway | | | | | |
|
||||||
| primary | | 15 km/h | 15 km/h | 2.1 | 2.1 |
|
| primary | | 15 km/h | 15 km/h | 2.9 | 2.9 |
|
||||||
| secondary | | 15 km/h | 15 km/h | 2.7 | 2.7 |
|
| secondary | | 15 km/h | 15 km/h | 3.1 | 3.1 |
|
||||||
| tertiary | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
| tertiary | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||||
| primary_link | | 15 km/h | 15 km/h | 2.1 | 2.1 |
|
| primary_link | | 15 km/h | 15 km/h | 2.9 | 2.9 |
|
||||||
| secondary_link | | 15 km/h | 15 km/h | 2.7 | 2.7 |
|
| secondary_link | | 15 km/h | 15 km/h | 3.1 | 3.1 |
|
||||||
| tertiary_link | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
| tertiary_link | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||||
| residential | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
| residential | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
| cycleway | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
| cycleway | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
| footway | | 4 km/h +-1 | 4 km/h +-1 | 1.1 | 1.1 |
|
| footway | | 6 km/h +-1 | 6 km/h +-1 | 1.7 | 1.7 |
|
||||||
|
|
||||||
Scenario: Bike - Apply no penalties to ways with cycleways
|
Scenario: Bike - Apply no penalties to ways with cycleways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -51,49 +51,49 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
|||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | cycleway:right | cycleway:left | forw | backw | forw_rate | backw_rate |
|
| highway | cycleway:right | cycleway:left | forw | backw | forw_rate | backw_rate |
|
||||||
| motorway | track | | 15 km/h | | 4.2 | |
|
| motorway | track | | 15 km/h | | 4.2 | |
|
||||||
| primary | track | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
| primary | track | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
| secondary | track | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
| secondary | track | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||||
| tertiary | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
| tertiary | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||||
| primary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
| primary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
| secondary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
| 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 |
|
| 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 |
|
| residential | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
| cycleway | 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 | 4 km/h +-1 | 4.2 | 1.1 |
|
| footway | track | | 15 km/h | 6 km/h +-1 | 4.2 | 1.7 |
|
||||||
| motorway | | track | 15 km/h | | 4.2 | |
|
| motorway | | track | | 15 km/h | | 4.2 |
|
||||||
| primary | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
| primary | | track | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
| secondary | | track | 15 km/h | 15 km/h | 2.7 | 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 |
|
| tertiary | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
| primary_link | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
| primary_link | | track | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
| secondary_link | | track | 15 km/h | 15 km/h | 2.7 | 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 |
|
| 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 |
|
| residential | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
| cycleway | | 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 | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
| footway | | track | 6 km/h +-1 | 15 km/h | 1.7 | 4.2 |
|
||||||
| motorway | lane | | 15 km/h | | 4.2 | |
|
| motorway | lane | | 15 km/h | | 4.2 | |
|
||||||
| primary | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
| primary | lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||||
| tertiary | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
| tertiary | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||||
| primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
| primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
| secondary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| cycleway | lane | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
| footway | lane | | 15 km/h | 4 km/h +-1 | 4.2 | 1.1 |
|
| footway | lane | | 15 km/h | 6 km/h +-1 | 4.2 | 1.7 |
|
||||||
| motorway | | lane | 15 km/h | | 4.2 | |
|
| motorway | | lane | | 15 km/h | | 4.2 |
|
||||||
| primary | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
| primary | | lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
| secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 2.7 | 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 |
|
| tertiary | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
| primary_link | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
| primary_link | | lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||||
| secondary_link | | lane | 15 km/h | 15 km/h | 2.7 | 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 |
|
| 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 |
|
| residential | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
| cycleway | | 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 | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
| footway | | lane | 6 km/h +-1 | 15 km/h | 1.7 | 4.2 |
|
||||||
| motorway | shared_lane | | 15 km/h | | 4.2 | |
|
| motorway | shared_lane | | 15 km/h | | 4.2 | |
|
||||||
| primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
| primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||||
| motorway | | shared_lane | 15 km/h | | 4.2 | |
|
| motorway | | shared_lane | | 15 km/h | | 4.2 |
|
||||||
| primary | | shared_lane | 15 km/h | 15 km/h | 2.1 | 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
|
Scenario: Bike - Don't apply penalties for all kind of cycleways
|
||||||
@@ -101,4 +101,4 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
|||||||
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||||
| tertiary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
| 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 | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||||
| tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
| tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||||
|
|||||||
@@ -54,6 +54,6 @@ Feature: Bike - Surfaces
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed |
|
||||||
| a | b | ab,ab | cycling,cycling | 15 km/h |
|
| a | b | ab,ab | cycling,cycling | 15 km/h |
|
||||||
| b | a | ab,ab | pushing bike,pushing bike | 4 km/h |
|
| b | a | ab,ab | pushing bike,pushing bike | 6 km/h |
|
||||||
| c | d | cd,cd | pushing bike,pushing bike | 4 km/h |
|
| c | d | cd,cd | pushing bike,pushing bike | 6 km/h |
|
||||||
| d | c | cd,cd | pushing bike,pushing bike | 4 km/h |
|
| d | c | cd,cd | pushing bike,pushing bike | 6 km/h |
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
@routing @car @way
|
|
||||||
Feature: Car - Avoid defined areas
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.avoid = Set { 'motorway', 'motorway_link' }
|
|
||||||
profile.speeds = Sequence {
|
|
||||||
highway = {
|
|
||||||
motorway = 90,
|
|
||||||
motorway_link = 45,
|
|
||||||
primary = 50
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Car - Avoid motorways
|
|
||||||
Then routability should be
|
|
||||||
| highway | bothw |
|
|
||||||
| motorway | |
|
|
||||||
| motorway_link | |
|
|
||||||
| primary | x |
|
|
||||||
|
|
||||||
@@ -45,11 +45,3 @@ Feature: Car - Barriers
|
|||||||
| bollard | | |
|
| bollard | | |
|
||||||
| bollard | rising | x |
|
| bollard | rising | x |
|
||||||
| bollard | removable | |
|
| bollard | removable | |
|
||||||
|
|
||||||
Scenario: Car - Height restrictions
|
|
||||||
Then routability should be
|
|
||||||
| node/barrier | node/maxheight | bothw |
|
|
||||||
| height_restrictor | | x |
|
|
||||||
| height_restrictor | 1 | |
|
|
||||||
| height_restrictor | 3 | x |
|
|
||||||
| height_restrictor | default | x |
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ Feature: Car - Mode flag
|
|||||||
| from | to | route | turns | classes |
|
| from | to | route | turns | classes |
|
||||||
| a | d | ab,cd | depart,arrive| [(restricted),(motorway,restricted),()],[()] |
|
| a | d | ab,cd | depart,arrive| [(restricted),(motorway,restricted),()],[()] |
|
||||||
|
|
||||||
Scenario: Car - We tag toll with a class
|
Scenario: Car - We toll restricted with a class
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b
|
a b
|
||||||
@@ -99,45 +99,6 @@ Feature: Car - Mode flag
|
|||||||
| from | to | route | turns | classes |
|
| from | to | route | turns | classes |
|
||||||
| a | d | ab,cd | depart,arrive | [(toll),(motorway,toll),()],[()] |
|
| a | d | ab,cd | depart,arrive | [(toll),(motorway,toll),()],[()] |
|
||||||
|
|
||||||
Scenario: Car - We tag tunnel with a class
|
|
||||||
Background:
|
|
||||||
Given a grid size of 200 meters
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
c d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | tunnel |
|
|
||||||
| ab | no |
|
|
||||||
| bc | yes |
|
|
||||||
| cd | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | turns | classes |
|
|
||||||
| a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] |
|
|
||||||
|
|
||||||
Scenario: Car - We tag classes without intersections
|
|
||||||
Background:
|
|
||||||
Given a grid size of 200 meters
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b c d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | tunnel |
|
|
||||||
| ab | road | |
|
|
||||||
| bc | road | yes |
|
|
||||||
| cd | road | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | turns | classes |
|
|
||||||
| a | d | road,road | depart,arrive | [(),(tunnel),()],[()] |
|
|
||||||
|
|
||||||
Scenario: Car - From roundabout on toll road
|
Scenario: Car - From roundabout on toll road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -163,3 +124,4 @@ Feature: Car - Mode flag
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | turns | classes |
|
| from | to | route | turns | classes |
|
||||||
| a | f | ab,df,df,df | depart,roundabout-exit-2,exit roundabout slight right,arrive | [()],[(),(motorway)],[(toll,motorway)],[()] |
|
| a | f | ab,df,df,df | depart,roundabout-exit-2,exit roundabout slight right,arrive | [()],[(),(motorway)],[(toll,motorway)],[()] |
|
||||||
|
|
||||||
|
|||||||
@@ -691,14 +691,14 @@ Feature: Car - Turn restrictions
|
|||||||
# """
|
# """
|
||||||
Given the node locations
|
Given the node locations
|
||||||
| node | lat | lon |
|
| node | lat | lon |
|
||||||
| a | 38.91124 | -77.00909 |
|
| a | 38.9113 | -77.0091 |
|
||||||
| b | 38.91080 | -77.00909 |
|
| b | 38.9108 | -77.0091 |
|
||||||
| c | 38.91038 | -77.00909 |
|
| c | 38.9104 | -77.0091 |
|
||||||
| d | 38.91105 | -77.00967 |
|
| d | 38.9110 | -77.0096 |
|
||||||
| e | 38.91037 | -77.00807 |
|
| e | 38.9106 | -77.0086 |
|
||||||
| f | 38.91036 | -77.00899 |
|
| f | 38.9105 | -77.0090 |
|
||||||
| g | 38.91076 | -77.00901 |
|
| g | 38.9108 | -77.0090 |
|
||||||
| h | 38.91124 | -77.00900 |
|
| h | 38.9113 | -77.0090 |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway | name |
|
| nodes | oneway | name |
|
||||||
@@ -719,7 +719,7 @@ Feature: Car - Turn restrictions
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | turns |
|
| from | to | route | turns |
|
||||||
| a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,continue uturn,arrive |
|
| a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,continue uturn,arrive |
|
||||||
| f | d | cap north,florida nw,florida nw | depart,turn left,arrive |
|
| f | d | cap north,florida,florida nw | depart,turn left,arrive |
|
||||||
| e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive |
|
| e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
@@ -738,14 +738,14 @@ Feature: Car - Turn restrictions
|
|||||||
# """
|
# """
|
||||||
Given the node locations
|
Given the node locations
|
||||||
| node | lat | lon |
|
| node | lat | lon |
|
||||||
| a | 38.91124 | -77.00909 |
|
| a | 38.9113 | -77.0091 |
|
||||||
| b | 38.91080 | -77.00909 |
|
| b | 38.9108 | -77.0091 |
|
||||||
| c | 38.91038 | -77.00909 |
|
| c | 38.9104 | -77.0091 |
|
||||||
| d | 38.91105 | -77.00967 |
|
| d | 38.9110 | -77.0096 |
|
||||||
| e | 38.91037 | -77.00807 |
|
| e | 38.9106 | -77.0086 |
|
||||||
| f | 38.91036 | -77.00899 |
|
| f | 38.9105 | -77.0090 |
|
||||||
| g | 38.91076 | -77.00901 |
|
| g | 38.9108 | -77.0090 |
|
||||||
| h | 38.91124 | -77.00900 |
|
| h | 38.9113 | -77.0090 |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway | name |
|
| nodes | oneway | name |
|
||||||
@@ -765,7 +765,7 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | turns |
|
| from | to | route | turns |
|
||||||
| a | e | cap south,florida ne,florida ne | depart,turn left,arrive |
|
| a | e | cap south,florida,florida ne | depart,turn left,arrive |
|
||||||
| f | d | cap north,florida ne,florida ne,florida nw | depart,turn sharp right,continue uturn,arrive |
|
| f | d | cap north,florida ne,florida ne,florida nw | depart,turn sharp right,continue uturn,arrive |
|
||||||
| e | c | florida ne,cap south,cap south | depart,turn left,arrive |
|
| e | c | florida ne,cap south,cap south | depart,turn left,arrive |
|
||||||
|
|
||||||
@@ -884,7 +884,7 @@ Feature: Car - Turn restrictions
|
|||||||
| a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive |
|
| a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive |
|
||||||
| a | e | albic,dobe,dobe | depart,turn left,arrive |
|
| a | e | albic,dobe,dobe | depart,turn left,arrive |
|
||||||
|
|
||||||
@no_turning @conditionals @restriction-way
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction with multiple time windows
|
Scenario: Car - Conditional restriction with multiple time windows
|
||||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||||
# 5pm Wed 02 May, 2017 GMT
|
# 5pm Wed 02 May, 2017 GMT
|
||||||
@@ -1054,3 +1054,4 @@ Feature: Car - Turn restrictions
|
|||||||
| a | f | ab,be,ef,ef | depart,turn right,turn left,arrive | a,b,e,f |
|
| a | f | ab,be,ef,ef | depart,turn right,turn left,arrive | a,b,e,f |
|
||||||
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
||||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||||
|
|
||||||
|
|||||||
@@ -131,58 +131,3 @@ Feature: Car - Destination only, no passing through
|
|||||||
| e | a | acbe,acbe |
|
| e | a | acbe,acbe |
|
||||||
| d | a | de,acbe,acbe |
|
| d | a | de,acbe,acbe |
|
||||||
| c | d | cd,cd |
|
| c | d | cd,cd |
|
||||||
|
|
||||||
Scenario: Car - Routing through a parking lot tagged access=destination,service
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----c++++b+++g------h---i
|
|
||||||
| + + + /
|
|
||||||
| + + + /
|
|
||||||
| + + + /
|
|
||||||
| d++++e+f /
|
|
||||||
z--------------y
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | access | highway |
|
|
||||||
| ac | | secondary |
|
|
||||||
| ghi | | secondary |
|
|
||||||
| azyhi | | secondary |
|
|
||||||
| cd | destination | service |
|
|
||||||
| def | destination | service |
|
|
||||||
| cbg | destination | service |
|
|
||||||
| be | destination | service |
|
|
||||||
| gf | destination | service |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| a | i | azyhi,azyhi |
|
|
||||||
| b | f | be,def,def |
|
|
||||||
| b | i | cbg,ghi,azyhi,azyhi |
|
|
||||||
|
|
||||||
Scenario: Car - Disallow snapping to access=private,highway=service
|
|
||||||
Given a grid size of 20 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a---c---b
|
|
||||||
:
|
|
||||||
x
|
|
||||||
:
|
|
||||||
d
|
|
||||||
\__e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | access | highway |
|
|
||||||
| acb | | primary |
|
|
||||||
| cx | private | service |
|
|
||||||
| xd | private | service |
|
|
||||||
| de | | primary |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| a | x | acb,xd,xd |
|
|
||||||
| a | d | acb,xd,xd |
|
|
||||||
| a | e | acb,xd,de |
|
|
||||||
| x | e | de,de |
|
|
||||||
# do not snap to access=private,highway=service roads when routing over them is not necessary
|
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
@routing @car
|
|
||||||
Feature: Car - Handle physical limitation
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
|
|
||||||
Scenario: Car - Use a narrow way
|
|
||||||
Then routability should be
|
|
||||||
| highway | width | narrow | bothw |
|
|
||||||
| primary | | | x |
|
|
||||||
| primary | narrow | | x |
|
|
||||||
| primary | | yes | x |
|
|
||||||
| primary | 1.8 | | |
|
|
||||||
| primary | 1.9 | | |
|
|
||||||
| primary | 2.0 | | x |
|
|
||||||
| primary | 2.1 | | x |
|
|
||||||
| primary | 1m | | |
|
|
||||||
| primary | 1 m | | |
|
|
||||||
| primary | 3 m | | x |
|
|
||||||
| primary | 6' | | |
|
|
||||||
| primary | 6'0" | | |
|
|
||||||
| primary | 6'2" | | |
|
|
||||||
| primary | 6'3" | | x |
|
|
||||||
| primary | 7' | | x |
|
|
||||||
| primary | 7'0" | | x |
|
|
||||||
|
|
||||||
Scenario: Car - Limited by width
|
|
||||||
Then routability should be
|
|
||||||
| highway | maxwidth:physical | maxwidth | width | est_width | bothw |
|
|
||||||
| primary | 1 | | | | |
|
|
||||||
| primary | 3 | | | | x |
|
|
||||||
| primary | | 1 | | | |
|
|
||||||
| primary | | 3 | | | x |
|
|
||||||
| primary | | | 1 | | |
|
|
||||||
| primary | | | 3 | | x |
|
|
||||||
| primary | | | | 1 | |
|
|
||||||
| primary | | | | 3 | x |
|
|
||||||
|
|
||||||
Scenario: Car - Limited by height
|
|
||||||
Then routability should be
|
|
||||||
| highway | maxheight:physical | maxheight | bothw |
|
|
||||||
| primary | | | x |
|
|
||||||
| primary | 1 | | |
|
|
||||||
| primary | 3 | | x |
|
|
||||||
| primary | | 1 | |
|
|
||||||
| primary | | 3 | x |
|
|
||||||
| primary | | default | x |
|
|
||||||
| primary | | none | x |
|
|
||||||
| primary | | no-sign | x |
|
|
||||||
| primary | | unsigned | x |
|
|
||||||
@@ -141,33 +141,6 @@ Feature: Car - Turn restrictions
|
|||||||
| c | a | cj,aj,aj |
|
| c | a | cj,aj,aj |
|
||||||
| c | b | cj,bj,bj |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@no_turning
|
|
||||||
Scenario: Car - Ignore no_*_on_red relations
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
d j b
|
|
||||||
c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| cj | yes |
|
|
||||||
| aj | -1 |
|
|
||||||
| dj | -1 |
|
|
||||||
| bj | -1 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | cj | dj | j | no_turn_on_red |
|
|
||||||
| restriction | cj | bj | j | no_right_turn_on_red |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| c | d | cj,dj,dj |
|
|
||||||
| c | a | cj,aj,aj |
|
|
||||||
| c | b | cj,bj,bj |
|
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only left turn
|
Scenario: Car - Only left turn
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -602,7 +575,7 @@ Feature: Car - Turn restrictions
|
|||||||
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
||||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||||
|
|
||||||
@restriction-way @overlap
|
@restriction @overlap
|
||||||
Scenario: Car - prohibit turn
|
Scenario: Car - prohibit turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -737,7 +710,7 @@ Feature: Car - Turn restrictions
|
|||||||
| a | j | left,first,right,right |
|
| a | j | left,first,right,right |
|
||||||
| f | e | right,third,left,left |
|
| f | e | right,third,left,left |
|
||||||
|
|
||||||
@restriction-way
|
@restriction
|
||||||
Scenario: Car - allow only turn
|
Scenario: Car - allow only turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -769,7 +742,7 @@ Feature: Car - Turn restrictions
|
|||||||
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
||||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||||
|
|
||||||
@restriction-way
|
@restriction
|
||||||
Scenario: Car - allow only turn
|
Scenario: Car - allow only turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -798,7 +771,7 @@ Feature: Car - Turn restrictions
|
|||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | d | ab,be,de,de |
|
| a | d | ab,be,de,de |
|
||||||
|
|
||||||
@restriction-way
|
@restriction
|
||||||
Scenario: Multi Way restriction
|
Scenario: Multi Way restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -835,7 +808,7 @@ Feature: Car - Turn restrictions
|
|||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | h | horiz,vert,horiz,horiz |
|
| a | h | horiz,vert,horiz,horiz |
|
||||||
|
|
||||||
@restriction-way
|
@restriction
|
||||||
Scenario: Multi-Way overlapping single-way
|
Scenario: Multi-Way overlapping single-way
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -874,7 +847,7 @@ Feature: Car - Turn restrictions
|
|||||||
| h | d | hfb,abcd,abcd | depart,end of road right,arrive | h,b,d |
|
| h | d | hfb,abcd,abcd | depart,end of road right,arrive | h,b,d |
|
||||||
|
|
||||||
|
|
||||||
@restriction-way
|
@restriction
|
||||||
Scenario: Car - prohibit turn, traffic lights
|
Scenario: Car - prohibit turn, traffic lights
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -917,7 +890,7 @@ Feature: Car - Turn restrictions
|
|||||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||||
|
|
||||||
|
|
||||||
@restriction-way @overlap @geometry
|
@restriction @overlap @geometry
|
||||||
Scenario: Geometry
|
Scenario: Geometry
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -952,7 +925,7 @@ Feature: Car - Turn restrictions
|
|||||||
| c | d | bc,bge,de,de |
|
| c | d | bc,bge,de,de |
|
||||||
| c | f | bc,bge,de,de,ef,ef |
|
| c | f | bc,bge,de,de,ef,ef |
|
||||||
|
|
||||||
@restriction-way @overlap @geometry @traffic-signals
|
@restriction @overlap @geometry @traffic-signals
|
||||||
Scenario: Geometry
|
Scenario: Geometry
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -994,7 +967,7 @@ Feature: Car - Turn restrictions
|
|||||||
| c | f | bc,bge,de,de,ef,ef |
|
| c | f | bc,bge,de,de,ef,ef |
|
||||||
|
|
||||||
# don't crash hard on invalid restrictions
|
# don't crash hard on invalid restrictions
|
||||||
@restriction-way @invalid
|
@restriction @invalid
|
||||||
Scenario: Geometry
|
Scenario: Geometry
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -1026,7 +999,7 @@ Feature: Car - Turn restrictions
|
|||||||
| a | f | ab,be,ef,ef |
|
| a | f | ab,be,ef,ef |
|
||||||
|
|
||||||
|
|
||||||
@restriction @restriction-way @overlap @geometry
|
@restriction @overlap @geometry
|
||||||
Scenario: Duplicated restriction
|
Scenario: Duplicated restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -1061,28 +1034,3 @@ Feature: Car - Turn restrictions
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | d | ab,bc,bc,bge,de,de |
|
| a | d | ab,bc,bc,bge,de,de |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Ambiguous ways
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
x---a----b-----c---z
|
|
||||||
|
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| abc |
|
|
||||||
| bd |
|
|
||||||
| xa |
|
|
||||||
| cz |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | bd | abc | b | no_left_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| d | x | bd,abc,xa,xa |
|
|
||||||
| d | z | bd,abc,cz,cz |
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ Feature: Basic Routing
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | summary |
|
| waypoints | route | summary |
|
||||||
| a,c | ,, | 100, 101 |
|
| a,c | , | 100, 101 |
|
||||||
|
|
||||||
Scenario: Single Ref
|
Scenario: Single Ref
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ Feature: Bike - Mode flag
|
|||||||
| c | traffic_signals |
|
| c | traffic_signals |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway:bicycle | maxspeed:forward |
|
| nodes | highway | name | oneway:bicycle |
|
||||||
| abcd | cycleway | street | | 4 km/h |
|
| abcd | cycleway | street | |
|
||||||
| eb | path | | yes | |
|
| eb | path | | yes |
|
||||||
| icef | tertiary | road | | 4 km/h |
|
| icef | tertiary | road | |
|
||||||
| geh | secondary | street | | |
|
| geh | secondary | street | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
|
|||||||
@@ -98,11 +98,11 @@ Feature: Car - Guidance - Bridges and Tunnels
|
|||||||
| dce | primary | | Nebenstraße |
|
| dce | primary | | Nebenstraße |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | turns |
|
| from | to | route | turns |
|
||||||
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road left,arrive |
|
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,arrive |
|
||||||
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road right,arrive |
|
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,arrive |
|
||||||
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
|
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
|
||||||
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
|
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
|
||||||
|
|
||||||
Scenario: Tunnel with Immediate Turn Front and Back
|
Scenario: Tunnel with Immediate Turn Front and Back
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -129,3 +129,4 @@ Feature: Car - Guidance - Bridges and Tunnels
|
|||||||
| e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn left,arrive |
|
| e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn left,arrive |
|
||||||
| d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn right,arrive |
|
| d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn right,arrive |
|
||||||
| d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn left,arrive |
|
| d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn left,arrive |
|
||||||
|
|
||||||
|
|||||||
@@ -35,20 +35,20 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||||
| a,d | first,first | depart,arrive | a,d |
|
| a,d | first,first | depart,arrive | a,d |
|
||||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||||
| e,h | first,first | depart,arrive | e,h |
|
| e,h | first,first | depart,arrive | e,h |
|
||||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||||
| k,l | second,second | depart,arrive | k,l |
|
| k,l | second,second | depart,arrive | k,l |
|
||||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||||
| i,j | second,second | depart,arrive | i,j |
|
| i,j | second,second | depart,arrive | i,j |
|
||||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||||
|
|
||||||
Scenario: Segregated Intersection, Cross Belonging to Single Street
|
Scenario: Segregated Intersection, Cross Belonging to Single Street
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -74,7 +74,7 @@ Feature: Collapse
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,i | first,third,third | depart,turn sharp left,arrive | a,b,i |
|
| a,i | first,second,third,third | depart,turn left,turn slight left,arrive | a,b,e,i |
|
||||||
|
|
||||||
Scenario: Segregated Intersection, Cross Belonging to Correct Street
|
Scenario: Segregated Intersection, Cross Belonging to Correct Street
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -106,20 +106,20 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||||
| a,d | first,first | depart,arrive | a,d |
|
| a,d | first,first | depart,arrive | a,d |
|
||||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||||
| e,h | first,first | depart,arrive | e,h |
|
| e,h | first,first | depart,arrive | e,h |
|
||||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||||
| k,l | second,second | depart,arrive | k,l |
|
| k,l | second,second | depart,arrive | k,l |
|
||||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||||
| i,j | second,second | depart,arrive | i,j |
|
| i,j | second,second | depart,arrive | i,j |
|
||||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||||
|
|
||||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets
|
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -151,20 +151,20 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||||
| a,d | first,first | depart,arrive | a,d |
|
| a,d | first,first | depart,arrive | a,d |
|
||||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||||
| e,h | first,first | depart,arrive | e,h |
|
| e,h | first,first | depart,arrive | e,h |
|
||||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||||
| k,l | second,second | depart,arrive | k,l |
|
| k,l | second,second | depart,arrive | k,l |
|
||||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||||
| i,j | second,second | depart,arrive | i,j |
|
| i,j | second,second | depart,arrive | i,j |
|
||||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||||
|
|
||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -209,11 +209,11 @@ Feature: Collapse
|
|||||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||||
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
||||||
| g,j | second,second | depart,arrive | g,j |
|
| g,j | second,second | depart,arrive | g,j |
|
||||||
| g,f | second,first,first | depart,turn left,arrive | g,b,f |
|
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
|
||||||
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
||||||
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
||||||
| i,h | second,second | depart,arrive | i,h |
|
| i,h | second,second | depart,arrive | i,h |
|
||||||
| i,c | second,first,first | depart,turn left,arrive | i,e,c |
|
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
|
||||||
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
||||||
|
|
||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||||
@@ -263,11 +263,11 @@ Feature: Collapse
|
|||||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||||
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
||||||
| g,j | second,second | depart,arrive | g,j |
|
| g,j | second,second | depart,arrive | g,j |
|
||||||
| g,f | second,first,first | depart,turn left,arrive | g,b,f |
|
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
|
||||||
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
||||||
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
||||||
| i,h | second,second | depart,arrive | i,h |
|
| i,h | second,second | depart,arrive | i,h |
|
||||||
| i,c | second,first,first | depart,turn left,arrive | i,e,c |
|
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
|
||||||
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
||||||
|
|
||||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles
|
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles
|
||||||
@@ -300,20 +300,20 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||||
| a,d | first,first | depart,arrive | a,d |
|
| a,d | first,first | depart,arrive | a,d |
|
||||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||||
| e,h | first,first | depart,arrive | e,h |
|
| e,h | first,first | depart,arrive | e,h |
|
||||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||||
| k,l | second,second | depart,arrive | k,l |
|
| k,l | second,second | depart,arrive | k,l |
|
||||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||||
| i,j | second,second | depart,arrive | i,j |
|
| i,j | second,second | depart,arrive | i,j |
|
||||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||||
|
|
||||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2)
|
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2)
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -345,29 +345,28 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||||
| a,d | first,first | depart,arrive | a,d |
|
| a,d | first,first | depart,arrive | a,d |
|
||||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||||
| e,h | first,first | depart,arrive | e,h |
|
| e,h | first,first | depart,arrive | e,h |
|
||||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||||
| k,l | second,second | depart,arrive | k,l |
|
| k,l | second,second | depart,arrive | k,l |
|
||||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||||
| i,j | second,second | depart,arrive | i,j |
|
| i,j | second,second | depart,arrive | i,j |
|
||||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||||
|
|
||||||
Scenario: Entering a segregated road
|
Scenario: Entering a segregated road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
h
|
a f g
|
||||||
a f | g
|
| | . '
|
||||||
| | i '
|
b-e '
|
||||||
b-e ' |
|
/ /
|
||||||
/ / j
|
|
||||||
/ /
|
/ /
|
||||||
c d
|
c d
|
||||||
"""
|
"""
|
||||||
@@ -377,8 +376,7 @@ Feature: Collapse
|
|||||||
| abc | primary | first | yes |
|
| abc | primary | first | yes |
|
||||||
| def | primary | first | yes |
|
| def | primary | first | yes |
|
||||||
| be | primary | first | no |
|
| be | primary | first | no |
|
||||||
| gie | primary | second | no |
|
| ge | primary | second | no |
|
||||||
| hij | primary | maple | no |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
@@ -387,7 +385,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,e,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
|
||||||
@@ -605,7 +603,7 @@ Feature: Collapse
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| i,h | in,road,road | depart,turn slight left,arrive | i,c,h |
|
| i,h | in,road,road | depart,turn left,arrive | i,f,h |
|
||||||
| a,d | road,road | depart,arrive | a,d |
|
| a,d | road,road | depart,arrive | a,d |
|
||||||
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j |
|
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j |
|
||||||
|
|
||||||
@@ -1012,7 +1010,7 @@ Feature: Collapse
|
|||||||
| f,j | hohe,hohe | depart,arrive | f,j |
|
| f,j | hohe,hohe | depart,arrive | f,j |
|
||||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
|
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
|
||||||
| f,e | | | |
|
| f,e | | | |
|
||||||
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,i,j |
|
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j |
|
||||||
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
|
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
|
||||||
|
|
||||||
Scenario: Forking before a turn (forky)
|
Scenario: Forking before a turn (forky)
|
||||||
|
|||||||
@@ -687,7 +687,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| s,f | sabc,ae,dbef,dbef | depart,fork slight right,turn right,arrive | s,a,e,f |
|
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive | s,a,e,f |
|
||||||
|
|
||||||
@sliproads
|
@sliproads
|
||||||
Scenario: Traffic Signal on Sliproad
|
Scenario: Traffic Signal on Sliproad
|
||||||
@@ -992,6 +992,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| dbef | primary | dbef | |
|
| dbef | primary | dbef | |
|
||||||
| ae | primary_link | ae | yes |
|
| ae | primary_link | ae | yes |
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
|
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
|
||||||
@@ -1018,6 +1019,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| dbcf | primary | dbcf | |
|
| dbcf | primary | dbcf | |
|
||||||
| ac | primary_link | ae | yes |
|
| ac | primary_link | ae | yes |
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| s,f | sab,dbcf,dbcf | depart,turn right,arrive | s,a,f |
|
| s,f | sab,dbcf,dbcf | depart,turn right,arrive | s,a,f |
|
||||||
@@ -1045,55 +1047,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| ae | primary_link | sab | yes |
|
| ae | primary_link | sab | yes |
|
||||||
| cg | primary | cg | |
|
| cg | primary | cg | |
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| s,f | sab,dbcef,dbcef | depart,turn right,arrive | s,a,f |
|
| s,f | sab,dbcef,dbcef | depart,turn right,arrive | s,a,f |
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Sliproad converted from a fork
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
b
|
|
||||||
s . a '.
|
|
||||||
`c
|
|
||||||
.
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | ref | oneway |
|
|
||||||
| sa | tertiary | | D 60A | yes |
|
|
||||||
| ab | tertiary | ab | D 60A | yes |
|
|
||||||
| ac | tertiary | | D 60A | yes |
|
|
||||||
| dbcf | tertiary | dbcf | D 543 | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations |
|
|
||||||
| s,f | ,dbcf,dbcf | depart,turn right,arrive | s,a,f |
|
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Sliproad to a road with a reference only
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
s . a . b . d
|
|
||||||
` .
|
|
||||||
' .
|
|
||||||
..
|
|
||||||
c
|
|
||||||
.
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | ref | oneway |
|
|
||||||
| sabd | primary | road | | |
|
|
||||||
| bcf | primary | | K108 | |
|
|
||||||
| ac | primary_link | | | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations |
|
|
||||||
| s,f | road,, | depart,turn right,arrive | s,a,f |
|
|
||||||
|
|||||||
@@ -13,23 +13,19 @@ Feature: Divided road entry
|
|||||||
d-------e-----f
|
d-------e-----f
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
i---g---j
|
g
|
||||||
|
|
|
||||||
|
|
|
||||||
h
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway |
|
| nodes | name | highway | oneway |
|
||||||
| abc | main st | residential | -1 |
|
| abc | main st | residential | -1 |
|
||||||
| def | main st | residential | yes |
|
| def | main st | residential | yes |
|
||||||
| be | main st | residential | |
|
| be | main st | residential | |
|
||||||
| egh | side st | residential | |
|
| eg | side st | residential | |
|
||||||
| igj | maple st | residential | |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| h,a | side st,main st,main st| depart,end of road left,arrive |
|
| g,a | side st,main st,main st| depart,end of road left,arrive |
|
||||||
|
|
||||||
|
|
||||||
# Similar to previous one, but the joining way is tagged with the side-street name
|
# Similar to previous one, but the joining way is tagged with the side-street name
|
||||||
@@ -41,22 +37,18 @@ Feature: Divided road entry
|
|||||||
d-------e-----f
|
d-------e-----f
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
i---g---j
|
g
|
||||||
|
|
|
||||||
|
|
|
||||||
h
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway |
|
| nodes | name | highway | oneway |
|
||||||
| abc | main st | residential | -1 |
|
| abc | main st | residential | -1 |
|
||||||
| def | main st | residential | yes |
|
| def | main st | residential | yes |
|
||||||
| begh | side st | residential | |
|
| beg | side st | residential | |
|
||||||
| igj | maple st | residential | |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| h,a | side st,main st,main st| depart,end of road left,arrive |
|
| g,a | side st,main st,main st| depart,end of road left,arrive |
|
||||||
|
|
||||||
|
|
||||||
# Center join named after crossroad
|
# Center join named after crossroad
|
||||||
@@ -108,32 +100,3 @@ Feature: Divided road entry
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| g,a | side st,main st,main st| depart,turn left,arrive |
|
| g,a | side st,main st,main st| depart,turn left,arrive |
|
||||||
|
|
||||||
# Verify end of road left turn across divided roads
|
|
||||||
Scenario: Join on a divided road, named after the side street
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a-----h--b-----c
|
|
||||||
| |
|
|
||||||
d-----i--e-----f
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
m---j--g---n
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
k l
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | oneway |
|
|
||||||
| ahbc | main st | residential | -1 |
|
|
||||||
| dief | main st | residential | yes |
|
|
||||||
| begl | side st | residential | -1 |
|
|
||||||
| hijk | side st | residential | yes |
|
|
||||||
| mjgn | maple st| residential | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| l,a | side st,main st,main st| depart,end of road left,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,23 +46,3 @@ Feature: Driveways intersections
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,d | ,second | depart,arrive | a,d |
|
| a,d | ,second | depart,arrive | a,d |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Road with a turn to service road
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
/-----------------e
|
|
||||||
a---b------------------c
|
|
||||||
`-----------------d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| abc | trunk | road | yes |
|
|
||||||
| bd | service | serv | yes |
|
|
||||||
| be | service | serv | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations |
|
|
||||||
| a,d | road,serv,serv | depart,turn slight right,arrive | a,b,d |
|
|
||||||
| a,e | road,serv,serv | depart,turn slight left,arrive | a,b,e |
|
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
@guidance
|
|
||||||
Feature: Internal Intersection Model
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
|
|
||||||
Scenario: Dual-carriage way intersection
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
| |
|
|
||||||
c--d--e--f
|
|
||||||
| |
|
|
||||||
g--h--i--j
|
|
||||||
| |
|
|
||||||
k l
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway | name |
|
|
||||||
| adhk | yes | Broken Land Parkway |
|
|
||||||
| lieb | yes | Broken Land Parkway |
|
|
||||||
| fed | yes | Snowden River Parkway |
|
|
||||||
| dc | yes | Patuxent Woods Drive |
|
|
||||||
| gh | yes | Patuxent Woods Drive |
|
|
||||||
| hij | yes | Snowden River Parkway |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | # |
|
|
||||||
| a,k | Broken Land Parkway,Broken Land Parkway | depart,arrive ||
|
|
||||||
| l,b | Broken Land Parkway,Broken Land Parkway | depart,arrive ||
|
|
||||||
# | g,j | Patuxent Woods Drive,Snowden River Parkway,Snowden River Parkway | depart,continue,arrive | did not work as expected - might be another issue to handle in post process? |
|
|
||||||
# | f,c | Snowden River Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,continue,arrive | did not work as expected - might be another issue to handle in post process? |
|
|
||||||
| a,c | Broken Land Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,turn right,arrive ||
|
|
||||||
| g,k | Patuxent Woods Drive,Broken Land Parkway,Broken Land Parkway | depart,turn right,arrive ||
|
|
||||||
| l,j | Broken Land Parkway,Snowden River Parkway,Snowden River Parkway | depart,turn right,arrive ||
|
|
||||||
| f,b | Snowden River Parkway,Broken Land Parkway,Broken Land Parkway | depart,turn right,arrive ||
|
|
||||||
| a,j | Broken Land Parkway,Snowden River Parkway,Snowden River Parkway | depart,turn left,arrive ||
|
|
||||||
| g,b | Patuxent Woods Drive,Broken Land Parkway,Broken Land Parkway | depart,turn left,arrive ||
|
|
||||||
| l,c | Broken Land Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,turn left,arrive ||
|
|
||||||
| f,k | Snowden River Parkway,Broken Land Parkway,Broken Land Parkway | depart,turn left,arrive ||
|
|
||||||
| a,b | Broken Land Parkway,Broken Land Parkway,Broken Land Parkway | depart,continue uturn,arrive ||
|
|
||||||
| g,c | Patuxent Woods Drive,Patuxent Woods Drive,Patuxent Woods Drive | depart,continue uturn,arrive ||
|
|
||||||
| l,k | Broken Land Parkway,Broken Land Parkway,Broken Land Parkway | depart,continue uturn,arrive ||
|
|
||||||
| f,j | Snowden River Parkway,Snowden River Parkway,Snowden River Parkway | depart,continue uturn,arrive ||
|
|
||||||
@@ -64,9 +64,9 @@ Feature: Exceptions for routing onto low-priority roads
|
|||||||
| bc | service | |
|
| bc | service | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| e,c | service, | depart,arrive |
|
| e,c | service, | depart,arrive |
|
||||||
| c,e | ,service | depart,arrive |
|
| c,e | ,service,service | depart,turn straight,arrive |
|
||||||
|
|
||||||
Scenario: Straight onto low-priority
|
Scenario: Straight onto low-priority
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -1,232 +0,0 @@
|
|||||||
# The route results with #original are what the result should be if the maneuver tag is removed
|
|
||||||
@routing @guidance @maneuver
|
|
||||||
Feature: Maneuver tag support
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
Given a grid size of 5 meters
|
|
||||||
|
|
||||||
Scenario: simple override #1
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a--b---c----d---e
|
|
||||||
|
|
|
||||||
g
|
|
||||||
|
|
|
||||||
h------i--------j
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| abc | A Street | no |
|
|
||||||
| cde | B Street | no |
|
|
||||||
| cgi | C Street | no |
|
|
||||||
| hij | J Street | no |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | node:via | way:to | maneuver | direction |
|
|
||||||
| maneuver | abc | c | cgi | turn | sharp_right |
|
|
||||||
| maneuver | hij | i | cde | turn | sharp_left |
|
|
||||||
| maneuver | abc | c | cde | turn | slight_left |
|
|
||||||
| maneuver | cde | c | cgi | turn | straight |
|
|
||||||
| manoeuvre| cgi | c | abc | turn | right |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | node:via | way:to | manoeuvre | maneuver | direction |
|
|
||||||
| maneuver | cgi | c | cde | fork | turn | slight_right |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
# Testing directly connected from/to
|
|
||||||
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,turn left,arrive |
|
|
||||||
| b,g | A Street,C Street,C Street | depart,turn sharp right,arrive |
|
|
||||||
# Testing re-awakening suppressed turns
|
|
||||||
| a,e | A Street,B Street,B Street | depart,turn slight left,arrive |
|
|
||||||
| e,i | B Street,C Street,C Street | depart,turn straight,arrive |
|
|
||||||
| i,e | C Street,B Street,B Street | depart,fork slight right,arrive |
|
|
||||||
| i,a | C Street,A Street,A Street | depart,turn right,arrive |
|
|
||||||
|
|
||||||
Scenario: single via-way
|
|
||||||
Given the node map
|
|
||||||
""""
|
|
||||||
a--b---c----d---e
|
|
||||||
|
|
|
||||||
g
|
|
||||||
|
|
|
||||||
h------i--------j
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| abc | A Street | no |
|
|
||||||
| cde | B Street | no |
|
|
||||||
| cgi | C Street | no |
|
|
||||||
| hi | J Street | no |
|
|
||||||
| ij | J Street | no |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:via | way:to | node:via | maneuver | direction |
|
|
||||||
| maneuver | abc | cgi | ij | c | turn | sharp_right |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,turn left,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: multiple via-way
|
|
||||||
Given the node map
|
|
||||||
""""
|
|
||||||
a--b---c----d---e
|
|
||||||
|
|
|
||||||
g-----k
|
|
||||||
|
|
|
||||||
h------i--------j
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| abc | A Street | no |
|
|
||||||
| cde | B Street | no |
|
|
||||||
| cg | C Street | no |
|
|
||||||
| gi | C Street | no |
|
|
||||||
| hi | J Street | no |
|
|
||||||
| ij | J Street | no |
|
|
||||||
| gk | G Street | no |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:via | way:via | way:to | node:via | maneuver | direction |
|
|
||||||
| maneuver | abc | cg | gi | ij | c | turn | sharp_right |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,end of road left,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Use maneuver tag to announce a particular turn type
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
t. .. * h
|
|
||||||
.. ....m** *
|
|
||||||
/ * *
|
|
||||||
/ * * *
|
|
||||||
/
|
|
||||||
/
|
|
||||||
|
|
|
||||||
|
|
|
||||||
\
|
|
||||||
\
|
|
||||||
o
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway | highway |
|
|
||||||
| fm | CA-120 | no | secondary |
|
|
||||||
| mh | CA-120 | no | secondary |
|
|
||||||
| mt | Priest Rd | no | unclassified |
|
|
||||||
| mo | | no | service |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | node:via | way:to | maneuver | direction |
|
|
||||||
| maneuver | mh | m | mt | turn | left |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| h,t | CA-120,Priest Rd,Priest Rd | depart,turn left,arrive |
|
|
||||||
#original | h,t | CA-120,Priest Rd,Priest Rd | depart,turn straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Use maneuver tag to announce lane guidance
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
ad
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
/ \
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
b-----c------e
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
r w
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway | highway |
|
|
||||||
| ab | Marsh Rd | yes | secondary |
|
|
||||||
| br | Marsh Rd | yes | secondary |
|
|
||||||
| cd | Marsh Rd | yes | secondary |
|
|
||||||
| cw | Marsh Rd | yes | secondary |
|
|
||||||
| bc | service | no | service |
|
|
||||||
| ce | service | no | service |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | node:via | way:via | way:to | maneuver |
|
|
||||||
| maneuver | ab | c | bc | cd | uturn |
|
|
||||||
| maneuver | ab | b | bc | cd | suppress |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | Marsh Rd,Marsh Rd,Marsh Rd | depart,turn uturn,arrive |
|
|
||||||
#original | a,d | Marsh Rd,service,Marsh Rd,Marsh Rd | depart,turn left,turn left,arrive |
|
|
||||||
|
|
||||||
Scenario: Use maneuver tag to suppress a turn
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
|
|
|
||||||
|
|
|
||||||
v---y----------z
|
|
||||||
|
|
|
||||||
n---p----------k
|
|
||||||
|\
|
|
||||||
| \
|
|
||||||
b t
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway | highway |
|
|
||||||
| zy | NY Ave | yes | primary |
|
|
||||||
| yv | NY Ave | yes | primary |
|
|
||||||
| np | NY Ave | yes | primary |
|
|
||||||
| pk | NY Ave | yes | primary |
|
|
||||||
| cp | 4th St | no | tertiary |
|
|
||||||
| yp | | no | motorway_link |
|
|
||||||
| pb | 4th St | no | primary |
|
|
||||||
| pt | 395 | no | primary |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | node:via | way:via | way:to | maneuver | # |
|
|
||||||
| maneuver | zy | p | yp | pt | suppress | original: depart,on ramp left,fork slight left,arrive |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:via | way:to | maneuver | # |
|
|
||||||
| maneuver | zy | yp | pb | suppress | invalid relation: missing node:via |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | node:via | way:via | way:to | maneuver | # |
|
|
||||||
| maneuver | p | yp | pb | suppress | invalid relation: missing way:from |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | node:via | way:via | maneuver | # |
|
|
||||||
| maneuver | zy | p | yp | suppress | invalid relation: missing way:to |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | node:via | way:via | way:to | maneuver | # |
|
|
||||||
| maneuver | zy | y, p | yp | pb | suppress | invalid relation: multiple node:via |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| z,t | NY Ave,395,395 | depart,on ramp left,arrive |
|
|
||||||
| z,b | NY Ave,,4th St,4th St | depart,on ramp left,fork slight right,arrive |
|
|
||||||
@@ -384,53 +384,40 @@ Feature: Merge Segregated Roads
|
|||||||
| cd | right | no |
|
| cd | right | no |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | intersections |
|
| waypoints | route | intersections |
|
||||||
| a,d | left,circle,right,right | true:90,false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
|
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
|
||||||
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
|
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
|
||||||
|
|
||||||
Scenario: Middle Island
|
Scenario: Middle Island
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
a
|
||||||
|
|
|
|
||||||
b-----z
|
b
|
||||||
/ \
|
|
||||||
c h
|
c h
|
||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
d g
|
d g
|
||||||
\ /
|
|
||||||
e
|
e
|
||||||
|
|
|
|
||||||
f
|
f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | oneway |
|
| nodes | name | oneway |
|
||||||
| ab | road | no |
|
| ab | road | no |
|
||||||
| ef | road | no |
|
| ef | road | no |
|
||||||
| bcde | road | yes |
|
| bcde | road | yes |
|
||||||
| eghb | road | yes |
|
| eghb | road | yes |
|
||||||
| bz | cross | no |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:from | way:to | node:via | restriction |
|
|
||||||
| restriction | bz | bcde | b | no_left_turn |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route |
|
| waypoints | turns | route |
|
||||||
| a,f | depart,arrive | road,road |
|
| a,f | depart,arrive | road,road |
|
||||||
| c,f | depart,arrive | road,road |
|
| c,f | depart,arrive | road,road |
|
||||||
| f,a | depart,arrive | road,road |
|
| f,a | depart,arrive | road,road |
|
||||||
| g,a | depart,arrive | road,road |
|
| g,a | depart,arrive | road,road |
|
||||||
| z,a | depart,turn right,arrive | cross,road,road |
|
|
||||||
|
|
||||||
Scenario: Traffic Island
|
Scenario: Traffic Island
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -601,10 +588,10 @@ Feature: Merge Segregated Roads
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,c | germ,ober | depart,arrive |
|
| a,c | germ,ober | depart,arrive |
|
||||||
| a,g | germ,germ,germ | depart,continue right,arrive |
|
| a,g | germ,germ,germ | depart,continue right,arrive |
|
||||||
| a,1 | germ,germ,germ | depart,continue left,arrive |
|
| a,1 | germ,germ,germ | depart,continue left,arrive |
|
||||||
| d,g | ober,germ,germ | depart,turn left,arrive |
|
| d,g | ober,germ,germ | depart,turn left,arrive |
|
||||||
|
|
||||||
# https://www.openstreetmap.org/#map=19/51.32888/6.57059
|
# https://www.openstreetmap.org/#map=19/51.32888/6.57059
|
||||||
Scenario: Places in presence of oneways
|
Scenario: Places in presence of oneways
|
||||||
@@ -636,16 +623,16 @@ Feature: Merge Segregated Roads
|
|||||||
| cf | albrecht | yes |
|
| cf | albrecht | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,l | schwert,albrecht,marianne,marianne | depart,new name straight,turn left,arrive |
|
| a,l | schwert,albrecht,marianne,marianne | depart,new name straight,turn left,arrive |
|
||||||
| a,j | schwert,luise,luise | depart,turn right,arrive |
|
| a,j | schwert,luise,luise | depart,turn right,arrive |
|
||||||
| a,1 | schwert,albrecht,albrecht,albrecht | depart,new name straight,continue uturn,arrive |
|
| a,1 | schwert,albrecht,albrecht,albrecht | depart,new name straight,continue uturn,arrive |
|
||||||
| k,l | marianne,marianne | depart,arrive |
|
| k,l | marianne,marianne | depart,arrive |
|
||||||
| k,j | marianne,albrecht,luise,luise | depart,turn left,turn left,arrive |
|
| k,j | marianne,albrecht,luise,luise | depart,turn left,turn left,arrive |
|
||||||
| k,d | marianne,schwert,schwert | depart,turn right,arrive |
|
| k,d | marianne,schwert,schwert | depart,turn right,arrive |
|
||||||
| i,j | luise,luise | depart,arrive |
|
| i,j | luise,luise | depart,arrive |
|
||||||
| i,d | luise,albrecht,schwert | depart,turn left,arrive |
|
| i,d | luise,albrecht,schwert,schwert | depart,turn left,turn straight,arrive |
|
||||||
| i,l | luise,albrecht,marianne,marianne | depart,turn left,turn left,arrive |
|
| i,l | luise,albrecht,marianne,marianne | depart,turn left,turn left,arrive |
|
||||||
|
|
||||||
# https://www.openstreetmap.org/#map=19/52.46339/13.40272
|
# https://www.openstreetmap.org/#map=19/52.46339/13.40272
|
||||||
Scenario: Do not merge links between segregated roads
|
Scenario: Do not merge links between segregated roads
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Feature: Motorway Guidance
|
|||||||
"""
|
"""
|
||||||
,g,e
|
,g,e
|
||||||
,f,d
|
,f,d
|
||||||
a-b-c
|
a-b-c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -201,7 +201,7 @@ Feature: Motorway Guidance
|
|||||||
| a,e | abcde,abcde | depart,arrive |
|
| a,e | abcde,abcde | depart,arrive |
|
||||||
| f,e | fgc,abcde,abcde | depart,merge slight left,arrive |
|
| f,e | fgc,abcde,abcde | depart,merge slight left,arrive |
|
||||||
| a,i | abcde,chi,chi | depart,off ramp slight right,arrive |
|
| a,i | abcde,chi,chi | depart,off ramp slight right,arrive |
|
||||||
| f,i | fgc,chi,chi | depart,off ramp slight right,arrive |
|
| f,i | fgc,chi,chi | depart,off ramp right,arrive |
|
||||||
|
|
||||||
Scenario: On And Off Ramp Left
|
Scenario: On And Off Ramp Left
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -221,7 +221,7 @@ Feature: Motorway Guidance
|
|||||||
| a,e | abcde,abcde | depart,arrive |
|
| a,e | abcde,abcde | depart,arrive |
|
||||||
| f,e | fgc,abcde,abcde | depart,merge slight right,arrive |
|
| f,e | fgc,abcde,abcde | depart,merge slight right,arrive |
|
||||||
| a,i | abcde,chi,chi | depart,off ramp slight left,arrive |
|
| a,i | abcde,chi,chi | depart,off ramp slight left,arrive |
|
||||||
| f,i | fgc,chi,chi | depart,off ramp slight left,arrive |
|
| f,i | fgc,chi,chi | depart,off ramp left,arrive |
|
||||||
|
|
||||||
Scenario: Merging Motorways
|
Scenario: Merging Motorways
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -281,67 +281,3 @@ Feature: Motorway Guidance
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | , | depart,arrive |
|
| a,d | , | depart,arrive |
|
||||||
| b,d | , | depart,arrive |
|
| b,d | , | depart,arrive |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Ramp Exit with Lower Priority
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a-b-c-d-e
|
|
||||||
`--f-g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| abcde | trunk | |
|
|
||||||
| bfg | primary_link | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | abcde,abcde | depart,arrive |
|
|
||||||
| a,g | abcde,bfg,bfg | depart,off ramp slight right,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
# https://www.openstreetmap.org/node/67366428#map=18/33.64613/-84.44425
|
|
||||||
Scenario: Ramp Bifurcations should not be suppressed
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
/-----------c /-----------e
|
|
||||||
a---b------------------d------------f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | destination |
|
|
||||||
| ab | motorway | | |
|
|
||||||
| bc | motorway_link | | City 17 |
|
|
||||||
| bd | motorway_link | | |
|
|
||||||
| de | motorway_link | | Domestic Terminal;Camp Creek Parkway;Riverdale Road |
|
|
||||||
| df | motorway_link | | Montgomery |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ,, | depart,fork slight left,arrive |
|
|
||||||
| a,e | ,,, | depart,fork slight right,fork slight left,arrive |
|
|
||||||
| a,f | ,,, | depart,fork slight right,fork slight right,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
# https://www.openstreetmap.org/#map=19/53.46186/-2.24509
|
|
||||||
Scenario: Highway Fork with a Link
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
/-----------d
|
|
||||||
a-b-c------------e
|
|
||||||
\-----------f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abce | motorway |
|
|
||||||
| cf | motorway |
|
|
||||||
| cd | motorway_link |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | abce,cd,cd | depart,off ramp slight left,arrive |
|
|
||||||
| a,e | abce,abce | depart,arrive |
|
|
||||||
| a,f | abce,cf,cf | depart,turn slight right,arrive |
|
|
||||||
|
|||||||
@@ -382,21 +382,6 @@ Feature: New-Name Instructions
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,c | , | depart,arrive |
|
| a,c | , | depart,arrive |
|
||||||
|
|
||||||
Scenario: No Name, Reference changed
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a ----- b ----- c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | ref | highway |
|
|
||||||
| ab | | US 322 | motorway |
|
|
||||||
| bc | | US 422 | motorway |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | ,, | depart,new name straight,arrive |
|
|
||||||
|
|
||||||
Scenario: Spaces in refs for containment check, #3086
|
Scenario: Spaces in refs for containment check, #3086
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -745,15 +745,12 @@ Feature: Basic Roundabout
|
|||||||
|
|
||||||
|
|
||||||
Scenario: Drive through roundabout
|
Scenario: Drive through roundabout
|
||||||
Given a grid size of 5 meters
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
. a .
|
a
|
||||||
. .
|
b e d f
|
||||||
b e --- d ---- f
|
c
|
||||||
. .
|
g h
|
||||||
.c.
|
|
||||||
g h
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -763,12 +760,12 @@ Feature: Basic Roundabout
|
|||||||
| gch | | yes |
|
| gch | | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | bearings | route | turns |
|
| waypoints | bearings | route | turns |
|
||||||
| e,f | 90 90 | edf,edf | depart,arrive |
|
| e,f | 90 90 | edf,edf | depart,arrive |
|
||||||
| e,h | 90 130 | edf,gch,gch,gch | depart,roundabout-exit-2,exit roundabout straight,arrive |
|
| e,h | 90 135 | edf,gch,gch,gch | depart,roundabout-exit-2,exit roundabout straight,arrive |
|
||||||
| g,f | 50 90 | gch,edf,edf,edf | depart,roundabout-exit-2,exit roundabout slight right,arrive |
|
| g,f | 45 90 | gch,edf,edf,edf | depart,roundabout-exit-2,exit roundabout right,arrive |
|
||||||
| g,h | 50 130 | gch,gch,gch | depart,exit roundabout right,arrive |
|
| g,h | 45 135 | gch,gch,gch | depart,exit roundabout right,arrive |
|
||||||
| e,e | 90 270 | edf,edf,edf,edf | depart,roundabout-exit-3,exit roundabout sharp left,arrive |
|
| e,e | 90 270 | edf,edf,edf | depart,continue uturn,arrive |
|
||||||
|
|
||||||
Scenario: CCW and CW roundabouts with overlaps
|
Scenario: CCW and CW roundabouts with overlaps
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -848,7 +848,6 @@ Feature: Simple Turns
|
|||||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:195 true:270 true:345;true:90 |
|
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:195 true:270 true:345;true:90 |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
||||||
# adjusted ways to reflect the case geometry for 2/3/2018
|
|
||||||
Scenario: Curved Exit from Curved Road
|
Scenario: Curved Exit from Curved Road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -875,16 +874,16 @@ Feature: Simple Turns
|
|||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | oneway | lanes | highway |
|
| nodes | name | oneway | lanes | highway |
|
||||||
| ab | Siemens | no | 5 | secondary |
|
| abcd | Siemens | no | 5 | secondary |
|
||||||
| bcdefg | Erna | no | 3 | secondary |
|
| defg | Erna | no | 3 | secondary |
|
||||||
| dhij | Siemens | no | | residential |
|
| dhij | Siemens | no | | residential |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,j | Siemens,Siemens,Siemens | depart,turn slight right,arrive |
|
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
|
||||||
| a,g | Siemens,Erna | depart,arrive |
|
| a,g | Siemens,Erna | depart,arrive |
|
||||||
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
|
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
|
||||||
| g,a | Erna,Siemens | depart,arrive |
|
| g,a | Erna,Siemens | depart,arrive |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/52.51303/13.32170
|
#http://www.openstreetmap.org/#map=19/52.51303/13.32170
|
||||||
Scenario: Ernst Reuter Platz
|
Scenario: Ernst Reuter Platz
|
||||||
@@ -962,12 +961,12 @@ Feature: Simple Turns
|
|||||||
g
|
g
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
h f
|
f
|
||||||
.
|
h .
|
||||||
. .
|
. .
|
||||||
. j
|
. j
|
||||||
. .
|
. .
|
||||||
c
|
c
|
||||||
. . .
|
. . .
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ Feature: Turn Lane Guidance
|
|||||||
| 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 | ;;left:false straight:true, |
|
| i,j | cross,cross | depart,arrive | ;;left:false straight:true, |
|
||||||
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false;left:true straight:false;left:true straight:false;left:false straight:true, |
|
| 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
|
||||||
@@ -614,9 +614,8 @@ Feature: Turn Lane Guidance
|
|||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
b d
|
b d
|
||||||
h-----c
|
h c
|
||||||
| `-f
|
' -- g - - f
|
||||||
g
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -937,52 +936,48 @@ Feature: Turn Lane Guidance
|
|||||||
Scenario: Partitioned turn, Slight Curve - maxspeed
|
Scenario: Partitioned turn, Slight Curve - maxspeed
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f e
|
f e
|
||||||
| |
|
| |
|
||||||
i | |
|
| |
|
||||||
| | c
|
| c
|
||||||
h - a - b ' |
|
a - b ' |
|
||||||
j g d
|
g d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway | turn:lanes:forward | maxspeed |
|
| nodes | name | highway | oneway | turn:lanes:forward | maxspeed |
|
||||||
| ha | road | primary | yes | | 1 |
|
|
||||||
| ab | road | primary | yes | left\|right | 1 |
|
| ab | road | primary | yes | left\|right | 1 |
|
||||||
| bc | cross | primary | yes | | 1 |
|
| bc | cross | primary | yes | | 1 |
|
||||||
| fbg | cross | primary | yes | | 1 |
|
| fbg | cross | primary | yes | | 1 |
|
||||||
| dce | cross | primary | yes | | 1 |
|
| dce | cross | primary | yes | | 1 |
|
||||||
| iaj | kross | primary | no | | 1 |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes | locations |
|
| waypoints | route | turns | lanes | locations |
|
||||||
| h,g | road,cross,cross | depart,turn right,arrive | ;,left:false right:true, | h,b,g |
|
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||||
| h,e | road,cross,cross | depart,end of road left,arrive | ;,left:true right:false;left:true right:false, | h,b,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
|
||||||
"""
|
"""
|
||||||
f e
|
f e
|
||||||
| |
|
| |
|
||||||
i | |
|
| |
|
||||||
| | c
|
| c
|
||||||
h - a - b ' |
|
a - b ' |
|
||||||
j g d
|
g d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway | turn:lanes:forward |
|
| nodes | name | highway | oneway | turn:lanes:forward |
|
||||||
| ha | road | primary | yes | |
|
|
||||||
| ab | road | primary | yes | left\|right |
|
| ab | road | primary | yes | left\|right |
|
||||||
| bc | cross | primary | yes | |
|
| bc | cross | primary | yes | |
|
||||||
| fbg | cross | primary | yes | |
|
| fbg | cross | primary | yes | |
|
||||||
| dce | cross | primary | yes | |
|
| dce | cross | primary | yes | |
|
||||||
| iaj | kross | primary | no | |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes | locations |
|
| waypoints | route | turns | lanes | locations |
|
||||||
| h,g | road,cross,cross | depart,turn right,arrive | ;,left:false right:true, | h,b,g |
|
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||||
| h,e | road,cross,cross | depart,end of road left,arrive | ;,left:true right:false;left:true right:false, | h,b,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
|
||||||
@@ -1248,4 +1243,4 @@ 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,f | road1,road1,road1 | depart,continue uturn,arrive | ,;left:true straight:false straight;right:false;;, | a,c,f |
|
| 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 |
|
||||||
|
|||||||
+11
-102
@@ -899,9 +899,9 @@ Feature: Simple Turns
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | lanes |
|
| nodes | highway | name |
|
||||||
| abc | primary | road | 3 |
|
| abc | primary | road |
|
||||||
| bd | residential | in | 1 |
|
| bd | residential | in |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route |
|
| waypoints | turns | route |
|
||||||
@@ -964,15 +964,15 @@ Feature: Simple Turns
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g
|
g
|
||||||
|
|
|
||||||
_--f-----y
|
f y
|
||||||
i-' |
|
i
|
||||||
j-k-a]|[b---x
|
j k a b x
|
||||||
e 'c
|
e c
|
||||||
|'d'
|
d
|
||||||
|
|
|
||||||
h
|
h
|
||||||
|
|
|
||||||
q
|
q
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -1372,94 +1372,3 @@ Feature: Simple Turns
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | ab,bcd,bcd | depart,fork slight right,arrive |
|
| a,d | ab,bcd,bcd | depart,fork slight right,arrive |
|
||||||
| a,g | ab,befg,befg | depart,fork slight left,arrive |
|
| a,g | ab,befg,befg | depart,fork slight left,arrive |
|
||||||
|
|
||||||
@routing @car
|
|
||||||
Scenario: No turn instruction when turning from unnamed onto unnamed
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
b----------------c
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | ref |
|
|
||||||
| ab | trunk_link | | |
|
|
||||||
| db | secondary | | L 460 |
|
|
||||||
| bc | secondary | | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | ref | turns |
|
|
||||||
| d | c | ,, | L 460,, | depart,turn right,arrive |
|
|
||||||
| c | d | ,, | ,L 460,L 460 | depart,turn left,arrive |
|
|
||||||
|
|
||||||
# https://www.openstreetmap.org/#map=18/52.25130/10.42545
|
|
||||||
Scenario: Turn for roads with no name, ref changes
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
.
|
|
||||||
e c . . f
|
|
||||||
.
|
|
||||||
.
|
|
||||||
b
|
|
||||||
.
|
|
||||||
.
|
|
||||||
a
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | ref | name |
|
|
||||||
| abc | tertiary | K 57 | |
|
|
||||||
| cd | tertiary | K 56 | |
|
|
||||||
| cf | tertiary | K 56 | |
|
|
||||||
| ce | residential | | Heinrichshöhe |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,f | ,, | depart,turn right,arrive |
|
|
||||||
|
|
||||||
# https://www.openstreetmap.org/#map=18/52.24071/10.29066
|
|
||||||
Scenario: Turn for roads with no name, ref changes
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
x
|
|
||||||
.
|
|
||||||
.
|
|
||||||
d
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
e. . t . c . p. .f
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
. .
|
|
||||||
b
|
|
||||||
.
|
|
||||||
.
|
|
||||||
a
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | ref | name | oneway |
|
|
||||||
| abp | tertiary | K 23 | | yes |
|
|
||||||
| pdx | tertiary | K 23 | | yes |
|
|
||||||
| xdt | tertiary | K 23 | | yes |
|
|
||||||
| tba | tertiary | K 23 | | yes |
|
|
||||||
| etcpf | primary | B 1 | | no |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| e,x | ,, | depart,turn left,arrive |
|
|
||||||
| f,a | ,, | depart,turn left,arrive |
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class OSRMBaseLoader{
|
|||||||
if (err) {
|
if (err) {
|
||||||
if (retryCount < 10) {
|
if (retryCount < 10) {
|
||||||
retryCount++;
|
retryCount++;
|
||||||
setTimeout(() => { tryConnect(this.scope.OSRM_IP, this.scope.OSRM_PORT, retry); }, 10);
|
setTimeout(() => { tryConnect(this.scope.OSRM_PORT, retry); }, 10);
|
||||||
} else {
|
} else {
|
||||||
callback(new Error("Could not connect to osrm-routed after ten retries."));
|
callback(new Error("Could not connect to osrm-routed after ten retries."));
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ class OSRMBaseLoader{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
tryConnect(this.scope.OSRM_IP, this.scope.OSRM_PORT, retry);
|
tryConnect(this.scope.OSRM_PORT, retry);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class OSRMDirectLoader extends OSRMBaseLoader {
|
|||||||
osrmUp (callback) {
|
osrmUp (callback) {
|
||||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||||
|
|
||||||
const command_arguments = util.format('%s -p %d -i %s -a %s', this.inputFile, this.scope.OSRM_PORT, this.scope.OSRM_IP, this.scope.ROUTING_ALGORITHM);
|
const command_arguments = util.format('%s -p %d -a %s', this.inputFile, this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM);
|
||||||
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
||||||
if (err && err.signal !== 'SIGINT') {
|
if (err && err.signal !== 'SIGINT') {
|
||||||
this.child = null;
|
this.child = null;
|
||||||
@@ -107,8 +107,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadData (callback) {
|
loadData (callback) {
|
||||||
const command_arguments = util.format('--dataset-name=%s %s', this.scope.DATASET_NAME, this.inputFile);
|
this.scope.runBin('osrm-datastore', this.inputFile, this.scope.environment, (err) => {
|
||||||
this.scope.runBin('osrm-datastore', command_arguments, this.scope.environment, (err) => {
|
|
||||||
if (err) return callback(new Error('*** osrm-datastore exited with ' + err.code + ': ' + err));
|
if (err) return callback(new Error('*** osrm-datastore exited with ' + err.code + ': ' + err));
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
@@ -117,7 +116,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
|||||||
osrmUp (callback) {
|
osrmUp (callback) {
|
||||||
if (this.osrmIsRunning()) return callback();
|
if (this.osrmIsRunning()) return callback();
|
||||||
|
|
||||||
const command_arguments = util.format('--dataset-name=%s -s -i %s -p %d -a %s', this.scope.DATASET_NAME, this.scope.OSRM_IP, this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM);
|
const command_arguments = util.format('--shared-memory=1 -p %d -a %s', this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM);
|
||||||
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
||||||
if (err && err.signal !== 'SIGINT') {
|
if (err && err.signal !== 'SIGINT') {
|
||||||
this.child = null;
|
this.child = null;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
const net = require('net');
|
const net = require('net');
|
||||||
const Timeout = require('node-timeout');
|
const Timeout = require('node-timeout');
|
||||||
|
|
||||||
module.exports = function tryConnect(host, port, callback) {
|
module.exports = function tryConnect(port, callback) {
|
||||||
net.connect({ port: port, host: host })
|
net.connect({ port: port, host: '127.0.0.1' })
|
||||||
.on('connect', () => { callback(); })
|
.on('connect', () => { callback(); })
|
||||||
.on('error', () => {
|
.on('error', () => {
|
||||||
callback(new Error('Could not connect.'));
|
callback(new Error('Could not connect.'));
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
@datastore @options @help
|
|
||||||
Feature: osrm-datastore command line options
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "testbot"
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been contracted
|
|
||||||
|
|
||||||
Scenario: osrm-datastore - Help should be shown when no options are passed
|
|
||||||
When I try to run "osrm-datastore --dataset-name test_dataset_42 {processed_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
When I try to run "osrm-datastore --list"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "test_dataset_42/static"
|
|
||||||
And stdout should contain "test_dataset_42/updatable"
|
|
||||||
|
|
||||||
Scenario: osrm-datastore - Only metric update should work
|
|
||||||
Given the speed file
|
|
||||||
"""
|
|
||||||
0,1,50
|
|
||||||
"""
|
|
||||||
And the data has been extracted
|
|
||||||
When I try to run "osrm-datastore {processed_file} --dataset-name cucumber/only_metric_test"
|
|
||||||
Then it should exit successfully
|
|
||||||
When I try to run "osrm-customize --segment-speed-file {speeds_file} {processed_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
When I try to run "osrm-datastore {processed_file} --dataset-name cucumber/only_metric_test --only-metric"
|
|
||||||
Then it should exit successfully
|
|
||||||
|
|
||||||
Scenario: osrm-datastore - Displaying help should work
|
|
||||||
When I try to run "osrm-datastore {processed_file} --help"
|
|
||||||
Then it should exit successfully
|
|
||||||
|
|
||||||
Scenario: osrm-datastore - Errors on invalid path
|
|
||||||
When I try to run "osrm-datastore invalid_path.osrm"
|
|
||||||
Then stderr should contain "[error] Config contains invalid file paths."
|
|
||||||
And stderr should contain "Missing/Broken"
|
|
||||||
And it should exit with an error
|
|
||||||
@@ -129,12 +129,8 @@ Feature: osrm-extract lua ways:get_nodes()
|
|||||||
"""
|
"""
|
||||||
functions = require('testbot')
|
functions = require('testbot')
|
||||||
|
|
||||||
functions.process_node = function(profile, node, result, relations)
|
|
||||||
print ('node ' .. tostring(node:get_location_tag('answer')))
|
|
||||||
end
|
|
||||||
|
|
||||||
functions.process_way = function(profile, way, result, relations)
|
functions.process_way = function(profile, way, result, relations)
|
||||||
print ('way ' .. tostring(way:get_location_tag('answer')))
|
print ('answer ' .. tostring(way:get_location_tag('answer')))
|
||||||
result.forward_mode = mode.driving
|
result.forward_mode = mode.driving
|
||||||
result.forward_speed = 1
|
result.forward_speed = 1
|
||||||
end
|
end
|
||||||
@@ -152,5 +148,4 @@ Feature: osrm-extract lua ways:get_nodes()
|
|||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson"
|
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson"
|
||||||
Then it should exit successfully
|
Then it should exit successfully
|
||||||
And stdout should contain "node 42"
|
And stdout should contain "answer 42"
|
||||||
And stdout should contain "way 42"
|
|
||||||
|
|||||||
@@ -1,182 +0,0 @@
|
|||||||
@routing @testbot @turn_function
|
|
||||||
Feature: Turn Function Information
|
|
||||||
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
functions = require('car')
|
|
||||||
|
|
||||||
function test_setup()
|
|
||||||
profile = functions.setup()
|
|
||||||
profile.highway_turn_classification = {
|
|
||||||
['motorway'] = 4,
|
|
||||||
['motorway_link'] = 4,
|
|
||||||
['trunk'] = 4,
|
|
||||||
['trunk_link'] = 4,
|
|
||||||
['primary'] = 4,
|
|
||||||
['primary_link'] = 4,
|
|
||||||
['secondary'] = 3,
|
|
||||||
['secondary_link'] = 3,
|
|
||||||
['tertiary'] = 2,
|
|
||||||
['tertiary_link'] = 2,
|
|
||||||
['residential'] = 1,
|
|
||||||
['living_street'] = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
profile.access_turn_classification = {
|
|
||||||
['discouraged'] = 1;
|
|
||||||
['permissive'] = 1;
|
|
||||||
['private'] = 1;
|
|
||||||
['customers'] = 1;
|
|
||||||
['dismount'] = 1;
|
|
||||||
}
|
|
||||||
return profile
|
|
||||||
end
|
|
||||||
|
|
||||||
function turn_leg_string (leg)
|
|
||||||
return 'speed: ' .. tostring(leg.speed)
|
|
||||||
.. ', is_incoming: ' .. tostring(leg.is_incoming)
|
|
||||||
.. ', is_outgoing: ' .. tostring(leg.is_outgoing)
|
|
||||||
.. ', highway_turn_classification: ' .. tostring(leg.highway_turn_classification)
|
|
||||||
.. ', access_turn_classification: ' .. tostring(leg.access_turn_classification)
|
|
||||||
.. ', priority_class: ' .. tostring(leg.priority_class)
|
|
||||||
end
|
|
||||||
|
|
||||||
function print_turn (profile, turn)
|
|
||||||
print ('source_restricted ' .. string.format("%s", tostring(turn.source_restricted)))
|
|
||||||
print ('source_is_motorway ' .. string.format("%s", tostring(turn.source_is_motorway)))
|
|
||||||
print ('source_is_link ' .. string.format("%s", tostring(turn.source_is_link)))
|
|
||||||
print ('source_number_of_lanes ' .. string.format("%s", tostring(turn.source_number_of_lanes)))
|
|
||||||
print ('source_highway_turn_classification ' .. string.format("%s", tostring(turn.source_highway_turn_classification)))
|
|
||||||
print ('source_access_turn_classification ' .. string.format("%s", tostring(turn.source_access_turn_classification)))
|
|
||||||
print ('source_speed ' .. string.format("%s", tostring(turn.source_speed)))
|
|
||||||
print ('source_priority_class ' .. string.format("%s", tostring(turn.source_priority_class)))
|
|
||||||
print ('source_mode ' .. string.format("%s", tostring(turn.source_mode)))
|
|
||||||
|
|
||||||
print ('target_restricted ' .. string.format("%s", tostring(turn.target_restricted)))
|
|
||||||
print ('target_is_motorway ' .. string.format("%s", tostring(turn.target_is_motorway)))
|
|
||||||
print ('target_is_link ' .. string.format("%s", tostring(turn.target_is_link)))
|
|
||||||
print ('target_number_of_lanes ' .. string.format("%s", tostring(turn.target_number_of_lanes)))
|
|
||||||
print ('target_highway_turn_classification ' .. string.format("%s", tostring(turn.target_highway_turn_classification)))
|
|
||||||
print ('target_access_turn_classification ' .. string.format("%s", tostring(turn.target_access_turn_classification)))
|
|
||||||
print ('target_speed ' .. string.format("%s", tostring(turn.target_speed)))
|
|
||||||
print ('target_priority_class ' .. string.format("%s", tostring(turn.target_priority_class)))
|
|
||||||
print ('target_mode ' .. string.format("%s", tostring(turn.target_mode)))
|
|
||||||
|
|
||||||
print ('number_of_roads ' .. string.format("%s", tostring(turn.number_of_roads)))
|
|
||||||
if not turn.is_u_turn then
|
|
||||||
for roadCount, road in ipairs(turn.roads_on_the_right) do
|
|
||||||
print('roads_on_the_right [' .. tostring(roadCount) .. '] ' .. turn_leg_string(road))
|
|
||||||
end
|
|
||||||
|
|
||||||
for roadCount, road in ipairs(turn.roads_on_the_left) do
|
|
||||||
print('roads_on_the_left [' .. tostring(roadCount) .. '] ' .. turn_leg_string(road))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
setup = test_setup,
|
|
||||||
process_way = functions.process_way,
|
|
||||||
process_node = functions.process_node,
|
|
||||||
process_turn = print_turn
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Turns should have correct information of source and target
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
|
|
||||||
a b c
|
|
||||||
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | motorway |
|
|
||||||
| bc | motorway |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "source_is_motorway true"
|
|
||||||
And stdout should contain "target_is_motorway true"
|
|
||||||
And stdout should contain "source_is_link false"
|
|
||||||
And stdout should contain "source_priority_class 0"
|
|
||||||
And stdout should contain "target_is_motorway true"
|
|
||||||
And stdout should contain "target_is_link false"
|
|
||||||
And stdout should contain "target_priority_class 0"
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Turns should detect when turn is leaving highway
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
|
|
||||||
a b c
|
|
||||||
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | lanes |
|
|
||||||
| ab | motorway | 3 |
|
|
||||||
| bc | motorway_link | |
|
|
||||||
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "source_is_motorway true"
|
|
||||||
And stdout should contain "source_is_link false"
|
|
||||||
And stdout should contain "source_number_of_lanes 3"
|
|
||||||
And stdout should contain "target_is_motorway false"
|
|
||||||
And stdout should contain "target_is_link true"
|
|
||||||
And stdout should contain "target_number_of_lanes 0"
|
|
||||||
And stdout should contain "number_of_roads 2"
|
|
||||||
|
|
||||||
Scenario: Turns should have correct information of other roads at intersection I
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
^
|
|
||||||
|
|
|
||||||
a->b->c
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| ab | primary | yes |
|
|
||||||
| bc | motorway | yes |
|
|
||||||
| bd | residential | yes |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "number_of_roads 3"
|
|
||||||
And stdout should contain "source_priority_class 4"
|
|
||||||
And stdout should contain "target_priority_class 0"
|
|
||||||
And stdout should contain "target_priority_class 10"
|
|
||||||
# turning abd, give information about bc
|
|
||||||
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: false, is_outgoing: true, highway_turn_classification: 4, access_turn_classification: 0/
|
|
||||||
# turning abc, give information about bd
|
|
||||||
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: false, is_outgoing: true, highway_turn_classification: 1, access_turn_classification: 0/
|
|
||||||
|
|
||||||
Scenario: Turns should have correct information of other roads at intersection II
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
|
|
|
||||||
v
|
|
||||||
a->b->c
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | access |
|
|
||||||
| ab | secondary | yes | |
|
|
||||||
| bc | motorway | yes | |
|
|
||||||
| db | unclassified | yes | discouraged |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "number_of_roads 3"
|
|
||||||
# turning dbc, give information about about ab
|
|
||||||
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 3, access_turn_classification: 0/
|
|
||||||
# turning abc, give information about about db
|
|
||||||
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 0, access_turn_classification: 1/
|
|
||||||
@@ -185,34 +185,31 @@ module.exports = function () {
|
|||||||
|
|
||||||
let q = d3.queue();
|
let q = d3.queue();
|
||||||
|
|
||||||
let addRelation = (headers, row, cb) => {
|
let addRelation = (row, cb) => {
|
||||||
let relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
let relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
||||||
|
|
||||||
|
|
||||||
var name = null;
|
var name = null;
|
||||||
for (let index in row) {
|
for (let key in row) {
|
||||||
|
|
||||||
var key = headers[index];
|
|
||||||
var value = row[index];
|
|
||||||
let isNode = key.match(/^node:?(.*)/),
|
let isNode = key.match(/^node:?(.*)/),
|
||||||
isWay = key.match(/^way:?(.*)/),
|
isWay = key.match(/^way:?(.*)/),
|
||||||
isRelation = key.match(/^relation:?(.*)/),
|
isRelation = key.match(/^relation:?(.*)/),
|
||||||
isColonSeparated = key.match(/^(.*):(.*)/);
|
isColonSeparated = key.match(/^(.*):(.*)/);
|
||||||
if (isNode) {
|
if (isNode) {
|
||||||
value.split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
||||||
if (nodeName.length !== 1) throw new Error(util.format('*** invalid relation node member "%s"', nodeName));
|
if (nodeName.length !== 1) throw new Error(util.format('*** invalid relation node member "%s"', nodeName));
|
||||||
let node = this.findNodeByName(nodeName);
|
let node = this.findNodeByName(nodeName);
|
||||||
if (!node) throw new Error(util.format('*** unknown relation node member "%s"', nodeName));
|
if (!node) throw new Error(util.format('*** unknown relation node member "%s"', nodeName));
|
||||||
relation.addMember('node', node.id, isNode[1]);
|
relation.addMember('node', node.id, isNode[1]);
|
||||||
});
|
});
|
||||||
} else if (isWay) {
|
} else if (isWay) {
|
||||||
value.split(',').map(function(v) { return v.trim(); }).forEach((wayName) => {
|
row[key].split(',').map(function(v) { return v.trim(); }).forEach((wayName) => {
|
||||||
let way = this.findWayByName(wayName);
|
let way = this.findWayByName(wayName);
|
||||||
if (!way) throw new Error(util.format('*** unknown relation way member "%s"', wayName));
|
if (!way) throw new Error(util.format('*** unknown relation way member "%s"', wayName));
|
||||||
relation.addMember('way', way.id, isWay[1]);
|
relation.addMember('way', way.id, isWay[1]);
|
||||||
});
|
});
|
||||||
} else if (isRelation) {
|
} else if (isRelation) {
|
||||||
value.split(',').map(function(v) { return v.trim(); }).forEach((relName) => {
|
row[key].split(',').map(function(v) { return v.trim(); }).forEach((relName) => {
|
||||||
let otherrelation = this.findRelationByName(relName);
|
let otherrelation = this.findRelationByName(relName);
|
||||||
if (!otherrelation) throw new Error(util.format('*** unknown relation relation member "%s"', relName));
|
if (!otherrelation) throw new Error(util.format('*** unknown relation relation member "%s"', relName));
|
||||||
relation.addMember('relation', otherrelation.id, isRelation[1]);
|
relation.addMember('relation', otherrelation.id, isRelation[1]);
|
||||||
@@ -220,8 +217,8 @@ module.exports = function () {
|
|||||||
} else if (isColonSeparated && isColonSeparated[1] !== 'restriction') {
|
} else if (isColonSeparated && isColonSeparated[1] !== 'restriction') {
|
||||||
throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"', isColonSeparated[1], isColonSeparated[2]));
|
throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"', isColonSeparated[1], isColonSeparated[2]));
|
||||||
} else {
|
} else {
|
||||||
relation.addTag(key, value);
|
relation.addTag(key, row[key]);
|
||||||
if (key.match(/name/)) name = value;
|
if (key.match(/name/)) name = row[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
relation.uid = this.OSM_UID;
|
relation.uid = this.OSM_UID;
|
||||||
@@ -236,8 +233,7 @@ module.exports = function () {
|
|||||||
cb();
|
cb();
|
||||||
};
|
};
|
||||||
|
|
||||||
var headers = table.raw()[0];
|
table.hashes().forEach((row) => q.defer(addRelation, row));
|
||||||
table.rows().forEach((row) => q.defer(addRelation, headers, row));
|
|
||||||
|
|
||||||
q.awaitAll(callback);
|
q.awaitAll(callback);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ module.exports = function () {
|
|||||||
|
|
||||||
if (headers.has('turns')) {
|
if (headers.has('turns')) {
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking turns only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking turns only supported for matchings with one subtrace');
|
||||||
turns = this.turnList(json.matchings[0]);
|
turns = this.turnList(json.matchings[0].instructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('route')) {
|
if (headers.has('route')) {
|
||||||
@@ -150,8 +150,7 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
var ok = true;
|
var ok = true;
|
||||||
var encodedResult = '',
|
var encodedResult = '',
|
||||||
extendedTarget = '',
|
extendedTarget = '';
|
||||||
resultWaypoints = [];
|
|
||||||
|
|
||||||
var testSubMatching = (sub, si) => {
|
var testSubMatching = (sub, si) => {
|
||||||
var testSubNode = (ni) => {
|
var testSubNode = (ni) => {
|
||||||
@@ -187,29 +186,6 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('waypoints')) {
|
|
||||||
var got_loc = [];
|
|
||||||
for (let i = 0; i < json.tracepoints.length; i++) {
|
|
||||||
if (!json.tracepoints[i]) continue;
|
|
||||||
if (json.tracepoints[i].waypoint_index != null)
|
|
||||||
got_loc.push(json.tracepoints[i].location);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (row.waypoints.length != got_loc.length)
|
|
||||||
return cb(new Error(`Expected ${row.waypoints.length} waypoints, got ${got_loc.length}`));
|
|
||||||
|
|
||||||
for (i = 0; i < row.waypoints.length; i++)
|
|
||||||
{
|
|
||||||
var want_node = this.findNodeByName(row.waypoints[i]);
|
|
||||||
if (!this.FuzzyMatch.matchLocation(got_loc[i], want_node)) {
|
|
||||||
resultWaypoints.push(util.format('? [%s,%s]', got_loc[i][0], got_loc[i][1]));
|
|
||||||
ok = false;
|
|
||||||
} else {
|
|
||||||
resultWaypoints.push(row.waypoints[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (headers.has('matchings')) {
|
if (headers.has('matchings')) {
|
||||||
got.matchings = row.matchings;
|
got.matchings = row.matchings;
|
||||||
@@ -218,12 +194,7 @@ module.exports = function () {
|
|||||||
if (headers.has('timestamps')) {
|
if (headers.has('timestamps')) {
|
||||||
got.timestamps = row.timestamps;
|
got.timestamps = row.timestamps;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('waypoints')) {
|
|
||||||
got.waypoints = row.waypoints;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
got.waypoints = resultWaypoints.join(';');
|
|
||||||
got.matchings = encodedResult;
|
got.matchings = encodedResult;
|
||||||
row.matchings = extendedTarget;
|
row.matchings = extendedTarget;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ module.exports = function() {
|
|||||||
// shorten uri to be realtive to 'features/'
|
// shorten uri to be realtive to 'features/'
|
||||||
let featurePath = path.relative(path.resolve('./features'), uri);
|
let featurePath = path.relative(path.resolve('./features'), uri);
|
||||||
// bicycle/bollards/{HASH}/
|
// bicycle/bollards/{HASH}/
|
||||||
let featureID = path.join(featurePath, hash);
|
let featureID = path.join(featurePath, hash);
|
||||||
|
|
||||||
let featureCacheDirectory = this.getFeatureCacheDirectory(featureID);
|
let featureCacheDirectory = this.getFeatureCacheDirectory(featureID);
|
||||||
let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash);
|
let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash);
|
||||||
this.featureIDs[uri] = featureID;
|
this.featureIDs[uri] = featureID;
|
||||||
@@ -115,7 +115,6 @@ module.exports = function() {
|
|||||||
this.OSRM_EXTRACT_PATH,
|
this.OSRM_EXTRACT_PATH,
|
||||||
this.OSRM_CONTRACT_PATH,
|
this.OSRM_CONTRACT_PATH,
|
||||||
this.LIB_OSRM_EXTRACT_PATH,
|
this.LIB_OSRM_EXTRACT_PATH,
|
||||||
this.LIB_OSRM_GUIDANCE_PATH,
|
|
||||||
this.LIB_OSRM_CONTRACT_PATH
|
this.LIB_OSRM_CONTRACT_PATH
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ module.exports = {
|
|||||||
|
|
||||||
FuzzyMatch: class {
|
FuzzyMatch: class {
|
||||||
match (got, want) {
|
match (got, want) {
|
||||||
// don't fail if bearings input and extected string is empty and actual result is undefined
|
|
||||||
if (want === '' && (got === '' || got === undefined))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
var matchPercent = want.match(/(.*)\s+~(.+)%$/),
|
var matchPercent = want.match(/(.*)\s+~(.+)%$/),
|
||||||
matchAbs = want.match(/(.*)\s+\+\-(.+)$/),
|
matchAbs = want.match(/(.*)\s+\+\-(.+)$/),
|
||||||
matchRe = want.match(/^\/(.*)\/$/),
|
matchRe = want.match(/^\/(.*)\/$/),
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ module.exports = function () {
|
|||||||
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.DATASET_NAME = 'cucumber';
|
|
||||||
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
||||||
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
||||||
this.DEFAULT_PROFILE = 'bicycle';
|
this.DEFAULT_PROFILE = 'bicycle';
|
||||||
@@ -44,9 +43,8 @@ module.exports = function () {
|
|||||||
this.TIMEZONE_NAMES = this.PLATFORM_WINDOWS ? 'win' : 'iana';
|
this.TIMEZONE_NAMES = this.PLATFORM_WINDOWS ? 'win' : 'iana';
|
||||||
|
|
||||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||||
this.OSRM_IP = process.env.OSRM_IP || '127.0.0.1';
|
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
||||||
this.HOST = `http://${this.OSRM_IP}:${this.OSRM_PORT}`;
|
|
||||||
|
|
||||||
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
|
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
|
||||||
|
|
||||||
if (this.PLATFORM_WINDOWS) {
|
if (this.PLATFORM_WINDOWS) {
|
||||||
@@ -74,7 +72,6 @@ module.exports = function () {
|
|||||||
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
||||||
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
||||||
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
|
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
|
||||||
this.LIB_OSRM_GUIDANCE_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_guidance'),
|
|
||||||
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
|
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
|
||||||
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
|
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
|
||||||
|
|
||||||
@@ -95,7 +92,7 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.verifyOSRMIsNotRunning = (callback) => {
|
this.verifyOSRMIsNotRunning = (callback) => {
|
||||||
tryConnect(this.OSRM_IP, this.OSRM_PORT, (err) => {
|
tryConnect(this.OSRM_PORT, (err) => {
|
||||||
if (!err) return callback(new Error('*** osrm-routed is already running.'));
|
if (!err) return callback(new Error('*** osrm-routed is already running.'));
|
||||||
else callback();
|
else callback();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ module.exports = function () {
|
|||||||
.defer(mkdirp, logDir)
|
.defer(mkdirp, logDir)
|
||||||
.defer(rimraf, this.scenarioLogFile)
|
.defer(rimraf, this.scenarioLogFile)
|
||||||
.awaitAll(callback);
|
.awaitAll(callback);
|
||||||
// uncomment to get path to logfile
|
|
||||||
// console.log(" Writing logging output to " + this.scenarioLogFile)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.After((scenario, callback) => {
|
this.After((scenario, callback) => {
|
||||||
|
|||||||
@@ -199,26 +199,14 @@ module.exports = function () {
|
|||||||
|
|
||||||
var merged = {};
|
var merged = {};
|
||||||
instructions.legs.map(l => {
|
instructions.legs.map(l => {
|
||||||
Object.keys(l.annotation).filter(a => !a.match(/metadata/)).forEach(a => {
|
Object.keys(l.annotation).forEach(a => {
|
||||||
if (!merged[a]) merged[a] = [];
|
if (!merged[a]) merged[a] = [];
|
||||||
merged[a].push(l.annotation[a].join(':'));
|
merged[a].push(l.annotation[a].join(':'));
|
||||||
});
|
});
|
||||||
if (l.annotation.metadata) {
|
|
||||||
merged.metadata = {};
|
|
||||||
Object.keys(l.annotation.metadata).forEach(a => {
|
|
||||||
if (!merged.metadata[a]) merged.metadata[a] = [];
|
|
||||||
merged.metadata[a].push(l.annotation.metadata[a].join(':'));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
Object.keys(merged).filter(k => !k.match(/metadata/)).map(a => {
|
Object.keys(merged).map(a => {
|
||||||
merged[a] = merged[a].join(',');
|
merged[a] = merged[a].join(',');
|
||||||
});
|
});
|
||||||
if (merged.metadata) {
|
|
||||||
Object.keys(merged.metadata).map(a => {
|
|
||||||
merged.metadata[a] = merged.metadata[a].join(',');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return merged;
|
return merged;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -158,8 +158,7 @@ module.exports = function () {
|
|||||||
// if header matches 'a:*', parse out the values for *
|
// if header matches 'a:*', parse out the values for *
|
||||||
// and return in that header
|
// and return in that header
|
||||||
headers.forEach((k) => {
|
headers.forEach((k) => {
|
||||||
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight', 'speed' ];
|
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight', 'speed'];
|
||||||
let metadata_whitelist = [ 'datasource_names' ];
|
|
||||||
if (k.match(/^a:/)) {
|
if (k.match(/^a:/)) {
|
||||||
let a_type = k.slice(2);
|
let a_type = k.slice(2);
|
||||||
if (whitelist.indexOf(a_type) == -1)
|
if (whitelist.indexOf(a_type) == -1)
|
||||||
@@ -167,13 +166,6 @@ module.exports = function () {
|
|||||||
if (annotation && !annotation[a_type])
|
if (annotation && !annotation[a_type])
|
||||||
return cb(new Error('Annotation not found in response', a_type));
|
return cb(new Error('Annotation not found in response', a_type));
|
||||||
got[k] = annotation && annotation[a_type] || '';
|
got[k] = annotation && annotation[a_type] || '';
|
||||||
} else if (k.match(/^am:/)) {
|
|
||||||
let a_type = k.slice(3);
|
|
||||||
if (metadata_whitelist.indexOf(a_type) == -1)
|
|
||||||
return cb(new Error('Unrecognized annotation field', a_type));
|
|
||||||
if (annotation && (!annotation.metadata || !annotation.metadata[a_type]))
|
|
||||||
return cb(new Error('Annotation not found in response', a_type));
|
|
||||||
got[k] = (annotation && annotation.metadata && annotation.metadata[a_type]) || '';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,6 @@ Feature: Alternative route
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
And a grid size of 200 meters
|
And a grid size of 200 meters
|
||||||
# Force data preparation to single-threaded to ensure consistent
|
|
||||||
# results for alternative generation during tests (alternative
|
|
||||||
# finding is highly sensitive to graph shape, which is in turn
|
|
||||||
# affected by parallelism during generation)
|
|
||||||
And the contract extra arguments "--threads 1"
|
|
||||||
And the extract extra arguments "--threads 1"
|
|
||||||
And the customize extra arguments "--threads 1"
|
|
||||||
And the partition extra arguments "--threads 1"
|
|
||||||
|
|
||||||
And the node map
|
And the node map
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -4,14 +4,6 @@ Feature: Alternative route
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
Given a grid size of 200 meters
|
Given a grid size of 200 meters
|
||||||
# Force data preparation to single-threaded to ensure consistent
|
|
||||||
# results for alternative generation during tests (alternative
|
|
||||||
# finding is highly sensitive to graph shape, which is in turn
|
|
||||||
# affected by parallelism during generation)
|
|
||||||
And the contract extra arguments "--threads 1"
|
|
||||||
And the extract extra arguments "--threads 1"
|
|
||||||
And the customize extra arguments "--threads 1"
|
|
||||||
And the partition extra arguments "--threads 1"
|
|
||||||
|
|
||||||
Scenario: Alternative Loop Paths
|
Scenario: Alternative Loop Paths
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Feature: Annotations
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
And the query options
|
And the query options
|
||||||
| annotations | duration,speed,weight,nodes |
|
| annotations | duration,speed,weight |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway |
|
| nodes | highway |
|
||||||
@@ -22,10 +22,10 @@ Feature: Annotations
|
|||||||
| lm | residential |
|
| lm | residential |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | a:speed | a:weight | a:nodes |
|
| from | to | route | a:speed | a:weight |
|
||||||
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 | 1:4:3 |
|
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 |
|
||||||
| i | m | il,lm,lm | 6.7:6.7 | 15:15 | 2:5:6 |
|
| i | m | il,lm,lm | 6.7:6.7 | 15:15 |
|
||||||
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 | 3:4:5:6 |
|
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: There should be different forward/reverse datasources
|
Scenario: There should be different forward/reverse datasources
|
||||||
@@ -59,60 +59,3 @@ Feature: Annotations
|
|||||||
| from | to | route | a:datasources | a:speed |
|
| from | to | route | a:datasources | a:speed |
|
||||||
| a | i | abcdefghi,abcdefghi | 1:0:1:0:1:0:0:0 | 50:10:50:10:50:10:10:10 |
|
| a | i | abcdefghi,abcdefghi | 1:0:1:0:1:0:0:0 | 50:10:50:10:50:10:10:10 |
|
||||||
| i | a | abcdefghi,abcdefghi | 0:1:0:0:0:0:0:1 | 10:50:10:10:10:10:10:50 |
|
| i | a | abcdefghi,abcdefghi | 0:1:0:0:0:0:0:1 | 10:50:10:10:10:10:10:50 |
|
||||||
|
|
||||||
Scenario: datasource name annotations
|
|
||||||
Given the profile "testbot"
|
|
||||||
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| abc |
|
|
||||||
|
|
||||||
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
|
||||||
And the customize extra arguments "--segment-speed-file {speeds_file}"
|
|
||||||
|
|
||||||
And the speed file
|
|
||||||
"""
|
|
||||||
1,2,180,1
|
|
||||||
2,1,180,1
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the query options
|
|
||||||
| annotations | datasources |
|
|
||||||
|
|
||||||
# Note - the source names here are specific to how the tests are constructed,
|
|
||||||
# so if this test is moved around (changes line number) or support code
|
|
||||||
# changes how the filenames are generated, this test will need to be updated
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | am:datasource_names |
|
|
||||||
| a | c | abc,abc | lua profile:63_datasource_name_annotations_speeds |
|
|
||||||
| c | a | abc,abc | lua profile:63_datasource_name_annotations_speeds |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Speed annotations should handle zero segments
|
|
||||||
Given the profile "testbot"
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a -- b --- c
|
|
||||||
|
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| abc |
|
|
||||||
| cd |
|
|
||||||
|
|
||||||
# This test relies on the snapping to the EBN cd to introduce a zero segment after the turn
|
|
||||||
And the query options
|
|
||||||
| annotations | speed,distance,duration,nodes |
|
|
||||||
| bearings | 90,5;180,5 |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
|
|
||||||
| a | c | abc,abc | 10:10 | 249.998641:299.931643 | 25:30 | 1:2:3 |
|
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ Feature: Approach parameter
|
|||||||
| from | to | approaches | route |
|
| from | to | approaches | route |
|
||||||
| s | e | unrestricted curb | ab,bc |
|
| s | e | unrestricted curb | ab,bc |
|
||||||
|
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# Oneway Test #
|
# Oneway Test #
|
||||||
###############
|
###############
|
||||||
@@ -227,90 +226,3 @@ Feature: Approach parameter
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | approaches | route |
|
| from | to | approaches | route |
|
||||||
| s | e | unrestricted curb | ab,bc |
|
| s | e | unrestricted curb | ab,bc |
|
||||||
|
|
||||||
|
|
||||||
#######################
|
|
||||||
# Left-side countries #
|
|
||||||
#######################
|
|
||||||
|
|
||||||
Scenario: [Left-hand-side] Start End same approach, option unrestricted for Start and End
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.properties.left_hand_driving = true
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
s e
|
|
||||||
a------b------c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | approaches | route |
|
|
||||||
| s | e | unrestricted unrestricted | ab,bc |
|
|
||||||
|
|
||||||
Scenario: [Left-hand-side] Start End same approach, option unrestricted for Start and curb for End
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.properties.left_hand_driving = true
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
s
|
|
||||||
a------b------c
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | approaches | route |
|
|
||||||
| s | e | unrestricted curb | ab,bc,bc |
|
|
||||||
|
|
||||||
Scenario: [Left-hand-side] Start End opposite approach, option unrestricted for Start and End
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.properties.left_hand_driving = true
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
s
|
|
||||||
a------b------c
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | approaches | route |
|
|
||||||
| s | e | unrestricted unrestricted | ab,bc |
|
|
||||||
|
|
||||||
Scenario: [Left-hand-side] Start End opposite approach, option unrestricted for Start and curb for End
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.properties.left_hand_driving = true
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
s e
|
|
||||||
a------b------c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | approaches | route |
|
|
||||||
| s | e | unrestricted curb | ab,bc |
|
|
||||||
@@ -108,12 +108,12 @@ Feature: Bearing parameter
|
|||||||
| ha | yes | ring |
|
| ha | yes | ring |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | bearing |
|
| from | to | bearings | route | bearing |
|
||||||
| 0 | q | 0 90 | ia,ring,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,0->90,90->0 |
|
| 0 | q | 0 90 | ia,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,90->0 |
|
||||||
| 0 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
|
| 0 | a | 45 90 | jb,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,90->0 |
|
||||||
| 0 | q | 90 90 | kc,ring,ring,ring,ring | 0->90,90->180,270->0,0->90,90->0 |
|
| 0 | q | 90 90 | kc,ring,ring,ring | 0->90,90->180,270->0,90->0 |
|
||||||
| 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
|
| 0 | a | 135 90 | ld,ring,ring,ring | 0->135,135->270,270->0,90->0 |
|
||||||
| 0 | a | 180 90 | me,ring,ring,ring,ring | 0->180,180->270,270->0,0->90,90->0 |
|
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,270->0,90->0 |
|
||||||
| 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,90->0 |
|
| 0 | a | 225 90 | nf,ring,ring | 0->225,225->0,90->0 |
|
||||||
| 0 | a | 270 90 | og,ring,ring,ring | 0->270,270->0,0->90,90->0 |
|
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
|
||||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
@routing @testbot @exclude
|
|
||||||
Feature: Testbot - Exclude flags regression tests
|
|
||||||
Background:
|
|
||||||
Given the profile "testbot"
|
|
||||||
|
|
||||||
Scenario: Testbot - Exclude toll regression 1
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a g
|
|
||||||
. .
|
|
||||||
b....d-$-$-e....f
|
|
||||||
. .
|
|
||||||
c h
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | toll | # |
|
|
||||||
| ab | primary | | always drivable |
|
|
||||||
| cb | primary | | always drivable |
|
|
||||||
| bd | primary | | always drivable |
|
|
||||||
| de | motorway | yes | not drivable for exclude=toll |
|
|
||||||
| ef | primary | | always drivable |
|
|
||||||
| fg | primary | | always drivable |
|
|
||||||
| fh | primary | | always drivable |
|
|
||||||
|
|
||||||
Given the query options
|
|
||||||
| exclude | toll |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| a | h | |
|
|
||||||
| a | g | |
|
|
||||||
| g | a | |
|
|
||||||
| d | e | |
|
|
||||||
|
|
||||||
Scenario: Testbot - Exclude toll regression 2
|
|
||||||
Given the profile "testbot"
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a g
|
|
||||||
. .
|
|
||||||
b....d-$-$-e....f
|
|
||||||
. .
|
|
||||||
c h..i
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | toll | # |
|
|
||||||
| ab | primary | | always drivable |
|
|
||||||
| cb | primary | | always drivable |
|
|
||||||
| bd | primary | | always drivable |
|
|
||||||
| de | motorway | yes | not drivable for exclude=toll |
|
|
||||||
| ef | primary | | always drivable |
|
|
||||||
| fg | primary | | always drivable |
|
|
||||||
| fh | primary | | always drivable |
|
|
||||||
| hi | primary | | always drivable |
|
|
||||||
|
|
||||||
Given the query options
|
|
||||||
| exclude | toll |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| a | h | |
|
|
||||||
| a | g | |
|
|
||||||
| g | a | |
|
|
||||||
| d | e | |
|
|
||||||
| d | i | |
|
|
||||||
@@ -39,64 +39,5 @@ Feature: Fixed bugs, kept to check for regressions
|
|||||||
| de | yes |
|
| de | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| 1 | 2 | bcd,bcd |
|
| 1 | 2 | bcd,bcd |
|
||||||
|
|
||||||
#############################
|
|
||||||
# This test models the OSM map at the location for
|
|
||||||
# https://github.com/Project-OSRM/osrm-backend/issues/5039
|
|
||||||
#############################
|
|
||||||
Scenario: Mixed Entry and Exit and segregated
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.properties.left_hand_driving = true
|
|
||||||
"""
|
|
||||||
Given the node locations
|
|
||||||
| node | lon | lat |
|
|
||||||
| a | 171.12889297029 | -42.58425289548 |
|
|
||||||
| b | 171.1299357 | -42.5849295 |
|
|
||||||
| c | 171.1295427 | -42.5849385 |
|
|
||||||
| d | 171.1297356 | -42.5852029 |
|
|
||||||
| e | 171.1296909 | -42.5851986 |
|
|
||||||
| f | 171.1295097 | -42.585007 |
|
|
||||||
| g | 171.1298225 | -42.5851928 |
|
|
||||||
| h | 171.1300262 | -42.5859122 |
|
|
||||||
| i | 171.1292651 | -42.584698 |
|
|
||||||
| j | 171.1297209 | -42.5848569 |
|
|
||||||
| k | 171.1297188 | -42.5854056 |
|
|
||||||
| l | 171.1298326 | -42.5857266 |
|
|
||||||
| m | 171.1298871 | -42.5848922 |
|
|
||||||
| n | 171.1296505 | -42.585189 |
|
|
||||||
| o | 171.1295206 | -42.5850862 |
|
|
||||||
| p | 171.1296106 | -42.5848862 |
|
|
||||||
| q | 171.1299784 | -42.5850191 |
|
|
||||||
| r | 171.1298867 | -42.5851671 |
|
|
||||||
| s | 171.1306955 | -42.5845812 |
|
|
||||||
| t | 171.129525 | -42.584807 |
|
|
||||||
| u | 171.1299705 | -42.584984 |
|
|
||||||
| v | 171.1299067 | -42.5849073 |
|
|
||||||
| w | 171.1302061 | -42.5848173 |
|
|
||||||
| x | 171.12975 | -42.5855753 |
|
|
||||||
| y | 171.129969 | -42.585079 |
|
|
||||||
| 1 | 171.131511926651| -42.584306746421966 |
|
|
||||||
| 2 | 171.128743886947| -42.58414875714669 |
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | maxspeed | name | ref | surface | junction | oneway |
|
|
||||||
| ws | primary | 100 | Taramakau Highway | SH 6 | asphalt | | |
|
|
||||||
| kxlh | trunk | | Otira Highway | SH 73 | | | |
|
|
||||||
| ai | primary | 100 | Kumara Junction Highway | SH 6 | asphalt | | |
|
|
||||||
| qyrgdenof | primary | 100 | Kumara Junction | | | roundabout | yes |
|
|
||||||
| ke | trunk | | Otira Highway | SH 73 | | | yes |
|
|
||||||
| itj | primary | 100 | Kumara Junction Highway | SH 6 | | | yes |
|
|
||||||
| gk | trunk | | Otira Highway | SH 73 | | | yes |
|
|
||||||
| fi | primary | 100 | Kumara Junction Highway | SH 6 | | | yes |
|
|
||||||
| wq | primary | 100 | Taramakau Highway | SH 6 | | | yes |
|
|
||||||
| vw | primary | 100 | Taramakau Highway | SH 6 | | | yes |
|
|
||||||
| vbuq | primary | 100 | Kumara Junction | | | roundabout | yes |
|
|
||||||
| jmv | primary | 100 | Kumara Junction | | | roundabout | yes |
|
|
||||||
| fcpj | primary | 100 | Kumara Junction | | | roundabout | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| 1,2 | Taramakau Highway,Kumara Junction Highway,Kumara Junction Highway,Kumara Junction Highway | depart,Kumara Junction-exit-2,exit rotary slight left,arrive |
|
|
||||||
|
|
||||||
|
|||||||
@@ -480,316 +480,3 @@ Feature: Basic Map Matching
|
|||||||
| trace | a:nodes |
|
| trace | a:nodes |
|
||||||
| 12 | 1:2:3:4:5:6 |
|
| 12 | 1:2:3:4:5:6 |
|
||||||
| 21 | 6:5:4:3:2:1 |
|
| 21 | 6:5:4:3:2:1 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Matching with waypoints param for start/end
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a-----b---c
|
|
||||||
|
|
|
||||||
|
|
|
||||||
d
|
|
||||||
|
|
|
||||||
|
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| abc | no |
|
|
||||||
| bde | no |
|
|
||||||
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 0;3 |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | code | matchings | waypoints |
|
|
||||||
| abde | Ok | abde | ae |
|
|
||||||
|
|
||||||
Scenario: Matching with waypoints param that were tidied away
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a - b - c - e
|
|
||||||
|
|
|
||||||
f
|
|
||||||
|
|
|
||||||
g
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| abce | no |
|
|
||||||
| cfg | no |
|
|
||||||
|
|
||||||
Given the query options
|
|
||||||
| tidy | true |
|
|
||||||
| waypoints | 0;2;5 |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | code | matchings | waypoints |
|
|
||||||
| abccfg | Ok | abcfg | acg |
|
|
||||||
|
|
||||||
Scenario: Testbot - Map matching refuses to use waypoints with trace splitting
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b c d
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 0;3 |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| abcd | no |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | timestamps | code |
|
|
||||||
| abcd | 0 1 62 63 | NoMatch |
|
|
||||||
|
|
||||||
Scenario: Testbot - Map matching invalid waypoints
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b c d
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 0;4 |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| abcd | no |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | code |
|
|
||||||
| abcd | InvalidOptions |
|
|
||||||
|
|
||||||
Scenario: Matching fail with waypoints param missing start/end
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a-----b---c
|
|
||||||
|
|
|
||||||
|
|
|
||||||
d
|
|
||||||
|
|
|
||||||
|
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| abc | no |
|
|
||||||
| bde | no |
|
|
||||||
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 1;3 |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | code |
|
|
||||||
| abde | InvalidValue |
|
|
||||||
|
|
||||||
Scenario: Testbot - Map matching with outlier that has no candidate and waypoint parameter
|
|
||||||
Given a grid size of 100 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b c d
|
|
||||||
|
|
||||||
1
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| abcd | no |
|
|
||||||
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 0;2;3 |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | timestamps | code |
|
|
||||||
| ab1d | 0 1 2 3 | NoMatch |
|
|
||||||
|
|
||||||
Scenario: Regression test - avoid collapsing legs of a tidied split trace
|
|
||||||
Given a grid size of 20 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a--b--f
|
|
||||||
|
|
|
||||||
|
|
|
||||||
e--c---d--g
|
|
||||||
"""
|
|
||||||
Given the query options
|
|
||||||
| tidy | true |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | oneway |
|
|
||||||
| abf | no |
|
|
||||||
| be | no |
|
|
||||||
| ecdg | no |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | timestamps | matchings | code |
|
|
||||||
| abbecd | 10 11 27 1516914902 1516914913 1516914952 | ab,ecd | Ok |
|
|
||||||
|
|
||||||
Scenario: Regression test - waypoints trimming too much geometry
|
|
||||||
# fixes bug in map matching collapsing that was dropping path geometries
|
|
||||||
# after segments that had 0 distance in internal route results
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
ad
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|e g
|
|
||||||
b--------------c
|
|
||||||
f h
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 0;4 |
|
|
||||||
| overview | full |
|
|
||||||
|
|
||||||
When I match I should get
|
|
||||||
| trace | geometry | code |
|
|
||||||
| defgh | 1,1,1,0.999461,1.000674,0.999461 | Ok |
|
|
||||||
|
|
||||||
@match @testbot
|
|
||||||
Scenario: Regression test - waypoints trimming too much geometry
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the query options
|
|
||||||
| geometries | geojson |
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
bh
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
c
|
|
||||||
g\
|
|
||||||
\k
|
|
||||||
\
|
|
||||||
\
|
|
||||||
\
|
|
||||||
j f
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| hc |
|
|
||||||
| cf |
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 0;3 |
|
|
||||||
| overview | full |
|
|
||||||
When I match I should get
|
|
||||||
| trace | geometry | code |
|
|
||||||
| bgkj | 1.000135,1,1.000135,0.99964,1.000387,0.999137 | Ok |
|
|
||||||
|
|
||||||
|
|
||||||
@match @testbot
|
|
||||||
# Regression test for issue #4919
|
|
||||||
Scenario: Regression test - non-uturn maneuver preferred over uturn
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the query options
|
|
||||||
| geometries | geojson |
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
e
|
|
||||||
;
|
|
||||||
;
|
|
||||||
a----hb-----c
|
|
||||||
;
|
|
||||||
;
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| abc |
|
|
||||||
| dbe |
|
|
||||||
Given the query options
|
|
||||||
| waypoints | 0;2 |
|
|
||||||
| overview | full |
|
|
||||||
| steps | true |
|
|
||||||
When I match I should get
|
|
||||||
| trace | geometry | turns | code |
|
|
||||||
| abc | 1,0.99973,1.00027,0.99973,1.000539,0.99973 | depart,arrive | Ok |
|
|
||||||
| abd | 1,0.99973,1.00027,0.99973,1.00027,0.999461 | depart,turn right,arrive | Ok |
|
|
||||||
| abe | 1,0.99973,1.00027,0.99973,1.00027,1 | depart,turn left,arrive | Ok |
|
|
||||||
| ahd | 1,0.99973,1.00027,0.99973,1.00027,0.999461 | depart,turn right,arrive | Ok |
|
|
||||||
| ahe | 1,0.99973,1.00027,0.99973,1.00027,1 | depart,turn left,arrive | Ok |
|
|
||||||
|
|
||||||
@match @testbot
|
|
||||||
Scenario: Regression test - add source phantoms properly (one phantom on one edge)
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a--1-b2-cd3--e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bcd |
|
|
||||||
| de |
|
|
||||||
Given the query options
|
|
||||||
| geometries | geojson |
|
|
||||||
| overview | full |
|
|
||||||
| steps | true |
|
|
||||||
| waypoints | 0;2 |
|
|
||||||
| annotations | duration,weight |
|
|
||||||
| generate_hints | false |
|
|
||||||
When I match I should get
|
|
||||||
| trace | geometry | a:duration | a:weight | duration |
|
|
||||||
| 123 | 1.000135,1,1.000225,1,1.00036,1,1.000405,1,1.00045,1 | 1:1.5:0.5:0.5 | 1:1.5:0.5:0.5 | 3.5 |
|
|
||||||
| 321 | 1.00045,1,1.000405,1,1.00036,1,1.000225,1,1.000135,1 | 0.5:0.5:1.5:1 | 0.5:0.5:1.5:1 | 3.5 |
|
|
||||||
|
|
||||||
@match @testbot
|
|
||||||
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a--1-b23-c4--d
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
| cd |
|
|
||||||
Given the query options
|
|
||||||
| geometries | geojson |
|
|
||||||
| overview | full |
|
|
||||||
| steps | true |
|
|
||||||
| waypoints | 0;3 |
|
|
||||||
| annotations | duration,weight |
|
|
||||||
| generate_hints | false |
|
|
||||||
When I match I should get
|
|
||||||
| trace | geometry | a:duration | a:weight | duration |
|
|
||||||
| 1234 | 1.000135,1,1.000225,1,1.000405,1,1.00045,1 | 1:2:0.5 | 1:2:0.5 | 3.5 |
|
|
||||||
| 4321 | 1.00045,1,1.000405,1,1.000225,1,1.000135,1 | 0.5:2:1 | 0.5:2:1 | 3.5 |
|
|
||||||
|
|
||||||
@match @testbot
|
|
||||||
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given a grid size of 10 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a--12345-b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
Given the query options
|
|
||||||
| geometries | geojson |
|
|
||||||
| overview | full |
|
|
||||||
| steps | true |
|
|
||||||
| waypoints | 0;3 |
|
|
||||||
| annotations | duration,weight,distance |
|
|
||||||
| generate_hints | false |
|
|
||||||
|
|
||||||
# These should have the same weights/duration in either direction
|
|
||||||
When I match I should get
|
|
||||||
| trace | geometry | a:distance | a:duration | a:weight | duration |
|
|
||||||
| 2345 | 1.00018,1,1.000315,1 | 15.013264 | 1.5 | 1.5 | 1.5 |
|
|
||||||
| 4321 | 1.00027,1,1.000135,1 | 15.013264 | 1.5 | 1.5 | 1.5 |
|
|
||||||
@@ -48,10 +48,10 @@ Feature: Traffic - speeds
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | weights | a:datasources |
|
| from | to | route | speed | weights | a:datasources |
|
||||||
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0 |
|
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0:0 |
|
||||||
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
||||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||||
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
|
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
|
||||||
| a | g | ad,df,fb,fb | 30 km/h | 1275.7,487.5,304.7,0 | 1:0:0 |
|
| a | g | ad,df,fb,fb | 30 km/h | 1275.7,487.5,304.7,0 | 1:0:0 |
|
||||||
@@ -74,12 +74,12 @@ Feature: Traffic - speeds
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | weights | a:datasources |
|
| from | to | route | speed | weights | a:datasources |
|
||||||
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0 |
|
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0:0 |
|
||||||
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
||||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||||
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1 |
|
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1:0 |
|
||||||
| a | g | ab,ab | 1 km/h | 10010.3,0 | 1 |
|
| a | g | ab,ab | 1 km/h | 10010.3,0 | 1 |
|
||||||
|
|
||||||
|
|
||||||
@@ -106,14 +106,14 @@ Feature: Traffic - speeds
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | weights | a:datasources |
|
| from | to | route | speed | weights | a:datasources |
|
||||||
| a | b | ab,ab | 1 km/h | 20020.73,0 | 1 |
|
| a | b | ab,ab | 1 km/h | 20020.73,0 | 1:0 |
|
||||||
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1 |
|
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1:0 |
|
||||||
| b | c | bc,bc | 27 km/h | 741.51,0 | 1 |
|
| b | c | bc,bc | 27 km/h | 741.51,0 | 1:0 |
|
||||||
| a | d | ab,eb,de,de | 2 km/h | 20020.73,378.17,400.41,0 | 1:0:0 |
|
| a | d | ab,eb,de,de | 2 km/h | 20020.73,378.17,400.41,0 | 1:0:0 |
|
||||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||||
| g | b | ab,ab | 1 km/h | 10010.37,0 | 1 |
|
| g | b | ab,ab | 1 km/h | 10010.37,0 | 1:0 |
|
||||||
| a | g | ab,ab | 1 km/h | 10010.36,0 | 1 |
|
| a | g | ab,ab | 1 km/h | 10010.36,0 | 1 |
|
||||||
| g | a | ab,ab | 1 km/h | 10010.36,0 | 1 |
|
| g | a | ab,ab | 1 km/h | 10010.36,0 | 1:1 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Speeds that isolate a single node (a)
|
Scenario: Speeds that isolate a single node (a)
|
||||||
@@ -135,14 +135,14 @@ Feature: Traffic - speeds
|
|||||||
| annotations | true |
|
| annotations | true |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | weights | a:datasources | a:speed | a:nodes|
|
| from | to | route | speed | weights | a:datasources |
|
||||||
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 | 10 | 6:2 |
|
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 |
|
||||||
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1 | 10:7.5 | 6:2:3 |
|
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1:0 |
|
||||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 | 7.5 | 2:3 |
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||||
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0 | 10:10 | 2:6:4 |
|
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0:0 |
|
||||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 | 10 | 4:3 |
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||||
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
|
||||||
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Verify that negative values cause an error, they're not valid at all
|
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ Feature: Via points
|
|||||||
| waypoints | route |
|
| waypoints | route |
|
||||||
| a,b,e | |
|
| a,b,e | |
|
||||||
|
|
||||||
@3359
|
@todo @3359
|
||||||
Scenario: U-Turn In Bearings
|
Scenario: U-Turn In Bearings
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ Feature: Weight tests
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | distances | weights | times | a:distance | a:duration | a:weight | a:speed |
|
| waypoints | route | distances | weights | times | a:distance | a:duration | a:weight | a:speed |
|
||||||
| s,t | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 2.1 | 2.1 | 9.5 |
|
| s,t | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 3 | 3 | 6.7 |
|
||||||
| t,s | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 2.1 | 2.1 | 9.5 |
|
| t,s | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 3.1 | 3.1 | 6.5 |
|
||||||
| s,e | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 30.026527:10.008842 | 3.1:1 | 3.1:1 | 9.7:10 |
|
| s,e | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 30.026527:10.008842 | 3.1:1 | 3.1:1 | 9.7:10 |
|
||||||
| e,s | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 10.008842:30.026527 | 1:3.1 | 1:3.1 | 10:9.7 |
|
| e,s | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 10.008842:30.026527 | 1:3.1 | 1:3.1 | 10:9.7 |
|
||||||
|
|
||||||
|
|||||||
@@ -69,11 +69,6 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
|||||||
});
|
});
|
||||||
non_core_edges.resize(new_end - non_core_edges.begin());
|
non_core_edges.resize(new_end - non_core_edges.begin());
|
||||||
edge_container.Insert(std::move(non_core_edges));
|
edge_container.Insert(std::move(non_core_edges));
|
||||||
|
|
||||||
for (const auto filter_index : util::irange<std::size_t>(0, filters.size()))
|
|
||||||
{
|
|
||||||
edge_container.Filter(filters[filter_index], filter_index);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract core graph for further contraction
|
// Extract core graph for further contraction
|
||||||
|
|||||||
@@ -60,25 +60,6 @@ struct ContractedEdgeContainer
|
|||||||
flags.resize(edges.size(), ALL_FLAGS);
|
flags.resize(edges.size(), ALL_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filter(const std::vector<bool> &filter, std::size_t index)
|
|
||||||
{
|
|
||||||
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
|
|
||||||
const MergedFlags flag = 1 << index;
|
|
||||||
|
|
||||||
for (auto edge_index : util::irange<std::size_t>(0, edges.size()))
|
|
||||||
{
|
|
||||||
auto allowed = filter[edges[edge_index].source] && filter[edges[edge_index].target];
|
|
||||||
if (allowed)
|
|
||||||
{
|
|
||||||
flags[edge_index] |= flag;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flags[edge_index] &= ~flag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Merge(std::vector<QueryEdge> new_edges)
|
void Merge(std::vector<QueryEdge> new_edges)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
|
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
|
||||||
@@ -127,7 +108,7 @@ struct ContractedEdgeContainer
|
|||||||
edges.insert(edges.end(), new_edges.begin(), new_end);
|
edges.insert(edges.end(), new_edges.begin(), new_end);
|
||||||
auto edges_size = edges.size();
|
auto edges_size = edges.size();
|
||||||
auto new_edges_size = std::distance(new_edges.begin(), new_end);
|
auto new_edges_size = std::distance(new_edges.begin(), new_end);
|
||||||
BOOST_ASSERT(static_cast<int>(edges_size) >= new_edges_size);
|
BOOST_ASSERT(edges_size >= new_edges_size);
|
||||||
flags.resize(edges_size);
|
flags.resize(edges_size);
|
||||||
std::fill(flags.begin() + edges_size - new_edges_size, flags.end(), flag);
|
std::fill(flags.begin() + edges_size - new_edges_size, flags.end(), flag);
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
#ifndef OSMR_CONTRACTOR_CONTRACTED_METRIC_HPP
|
|
||||||
#define OSMR_CONTRACTOR_CONTRACTED_METRIC_HPP
|
|
||||||
|
|
||||||
#include "contractor/query_graph.hpp"
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace contractor
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
template <storage::Ownership Ownership> struct ContractedMetric
|
|
||||||
{
|
|
||||||
detail::QueryGraph<Ownership> graph;
|
|
||||||
std::vector<util::ViewOrVector<bool, Ownership>> edge_filter;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
using ContractedMetric = detail::ContractedMetric<storage::Ownership::Container>;
|
|
||||||
using ContractedMetricView = detail::ContractedMetric<storage::Ownership::View>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
#ifndef OSRM_CONTRACTOR_FILES_HPP
|
#ifndef OSRM_CONTRACTOR_FILES_HPP
|
||||||
#define OSRM_CONTRACTOR_FILES_HPP
|
#define OSRM_CONTRACTOR_FILES_HPP
|
||||||
|
|
||||||
#include "contractor/serialization.hpp"
|
#include "contractor/query_graph.hpp"
|
||||||
|
|
||||||
#include <unordered_map>
|
#include "util/serialization.hpp"
|
||||||
|
|
||||||
|
#include "storage/io.hpp"
|
||||||
|
#include "storage/serialization.hpp"
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -12,44 +15,54 @@ namespace contractor
|
|||||||
namespace files
|
namespace files
|
||||||
{
|
{
|
||||||
// reads .osrm.hsgr file
|
// reads .osrm.hsgr file
|
||||||
template <typename ContractedMetricT>
|
template <typename QueryGraphT, typename EdgeFilterT>
|
||||||
inline void readGraph(const boost::filesystem::path &path,
|
inline void readGraph(const boost::filesystem::path &path,
|
||||||
std::unordered_map<std::string, ContractedMetricT> &metrics,
|
unsigned &checksum,
|
||||||
std::uint32_t &connectivity_checksum)
|
QueryGraphT &graph,
|
||||||
|
std::vector<EdgeFilterT> &edge_filter)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<ContractedMetric, ContractedMetricT>::value ||
|
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
||||||
std::is_same<ContractedMetricView, ContractedMetricT>::value,
|
std::is_same<QueryGraph, QueryGraphT>::value,
|
||||||
"metric must be of type ContractedMetric<>");
|
"graph must be of type QueryGraph<>");
|
||||||
|
static_assert(std::is_same<EdgeFilterT, std::vector<bool>>::value ||
|
||||||
|
std::is_same<EdgeFilterT, util::vector_view<bool>>::value,
|
||||||
|
"edge_filter must be a container of vector<bool> or vector_view<bool>");
|
||||||
|
|
||||||
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
|
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||||
storage::tar::FileReader reader{path, fingerprint};
|
storage::io::FileReader reader{path, fingerprint};
|
||||||
|
|
||||||
reader.ReadInto("/ch/connectivity_checksum", connectivity_checksum);
|
reader.ReadInto(checksum);
|
||||||
|
util::serialization::read(reader, graph);
|
||||||
for (auto &pair : metrics)
|
auto count = reader.ReadElementCount64();
|
||||||
|
edge_filter.resize(count);
|
||||||
|
for (const auto index : util::irange<std::size_t>(0, count))
|
||||||
{
|
{
|
||||||
serialization::read(reader, "/ch/metrics/" + pair.first, pair.second);
|
storage::serialization::read(reader, edge_filter[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// writes .osrm.hsgr file
|
// writes .osrm.hsgr file
|
||||||
template <typename ContractedMetricT>
|
template <typename QueryGraphT, typename EdgeFilterT>
|
||||||
inline void writeGraph(const boost::filesystem::path &path,
|
inline void writeGraph(const boost::filesystem::path &path,
|
||||||
const std::unordered_map<std::string, ContractedMetricT> &metrics,
|
unsigned checksum,
|
||||||
const std::uint32_t connectivity_checksum)
|
const QueryGraphT &graph,
|
||||||
|
const std::vector<EdgeFilterT> &edge_filter)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<ContractedMetric, ContractedMetricT>::value ||
|
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
||||||
std::is_same<ContractedMetricView, ContractedMetricT>::value,
|
std::is_same<QueryGraph, QueryGraphT>::value,
|
||||||
"metric must be of type ContractedMetric<>");
|
"graph must be of type QueryGraph<>");
|
||||||
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
|
static_assert(std::is_same<EdgeFilterT, std::vector<bool>>::value ||
|
||||||
storage::tar::FileWriter writer{path, fingerprint};
|
std::is_same<EdgeFilterT, util::vector_view<bool>>::value,
|
||||||
|
"edge_filter must be a container of vector<bool> or vector_view<bool>");
|
||||||
|
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||||
|
storage::io::FileWriter writer{path, fingerprint};
|
||||||
|
|
||||||
writer.WriteElementCount64("/ch/connectivity_checksum", 1);
|
writer.WriteOne(checksum);
|
||||||
writer.WriteFrom("/ch/connectivity_checksum", connectivity_checksum);
|
util::serialization::write(writer, graph);
|
||||||
|
writer.WriteElementCount64(edge_filter.size());
|
||||||
for (const auto &pair : metrics)
|
for (const auto &filter : edge_filter)
|
||||||
{
|
{
|
||||||
serialization::write(writer, "/ch/metrics/" + pair.first, pair.second);
|
storage::serialization::write(writer, filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,24 +128,23 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
|
|||||||
|
|
||||||
template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT graph)
|
template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT graph)
|
||||||
{
|
{
|
||||||
util::Log() << "Converting contracted graph with " << graph.GetNumberOfEdges()
|
std::vector<Edge> edges;
|
||||||
<< " to edge list (" << (graph.GetNumberOfEdges() * sizeof(Edge)) << " bytes)";
|
edges.reserve(graph.GetNumberOfEdges());
|
||||||
std::vector<Edge> edges(graph.GetNumberOfEdges());
|
|
||||||
|
|
||||||
|
util::UnbufferedLog log;
|
||||||
|
log << "Getting edges of minimized graph ";
|
||||||
|
util::Percent p(log, graph.GetNumberOfNodes());
|
||||||
|
const NodeID number_of_nodes = graph.GetNumberOfNodes();
|
||||||
|
if (graph.GetNumberOfNodes())
|
||||||
{
|
{
|
||||||
util::UnbufferedLog log;
|
Edge new_edge;
|
||||||
log << "Getting edges of minimized graph ";
|
|
||||||
util::Percent p(log, graph.GetNumberOfNodes());
|
|
||||||
const NodeID number_of_nodes = graph.GetNumberOfNodes();
|
|
||||||
std::size_t edge_index = 0;
|
|
||||||
for (const auto node : util::irange(0u, number_of_nodes))
|
for (const auto node : util::irange(0u, number_of_nodes))
|
||||||
{
|
{
|
||||||
p.PrintStatus(node);
|
p.PrintStatus(node);
|
||||||
for (auto edge : graph.GetAdjacentEdgeRange(node))
|
for (auto edge : graph.GetAdjacentEdgeRange(node))
|
||||||
{
|
{
|
||||||
const NodeID target = graph.GetTarget(edge);
|
const NodeID target = graph.GetTarget(edge);
|
||||||
const auto &data = graph.GetEdgeData(edge);
|
const ContractorGraph::EdgeData &data = graph.GetEdgeData(edge);
|
||||||
auto &new_edge = edges[edge_index++];
|
|
||||||
new_edge.source = node;
|
new_edge.source = node;
|
||||||
new_edge.target = target;
|
new_edge.target = target;
|
||||||
BOOST_ASSERT_MSG(SPECIAL_NODEID != new_edge.target, "Target id invalid");
|
BOOST_ASSERT_MSG(SPECIAL_NODEID != new_edge.target, "Target id invalid");
|
||||||
@@ -157,12 +156,16 @@ template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT g
|
|||||||
"edge id invalid");
|
"edge id invalid");
|
||||||
new_edge.data.forward = data.forward;
|
new_edge.data.forward = data.forward;
|
||||||
new_edge.data.backward = data.backward;
|
new_edge.data.backward = data.backward;
|
||||||
|
edges.push_back(new_edge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BOOST_ASSERT(edge_index == edges.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sort and remove duplicates
|
||||||
tbb::parallel_sort(edges.begin(), edges.end());
|
tbb::parallel_sort(edges.begin(), edges.end());
|
||||||
|
auto new_end = std::unique(edges.begin(), edges.end());
|
||||||
|
edges.resize(new_end - edges.begin());
|
||||||
|
edges.shrink_to_fit();
|
||||||
|
|
||||||
return edges;
|
return edges;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
#ifndef OSRM_CONTRACTOR_SERIALIZATION_HPP
|
|
||||||
#define OSRM_CONTRACTOR_SERIALIZATION_HPP
|
|
||||||
|
|
||||||
#include "contractor/contracted_metric.hpp"
|
|
||||||
|
|
||||||
#include "util/serialization.hpp"
|
|
||||||
|
|
||||||
#include "storage/serialization.hpp"
|
|
||||||
#include "storage/tar.hpp"
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace contractor
|
|
||||||
{
|
|
||||||
namespace serialization
|
|
||||||
{
|
|
||||||
|
|
||||||
template <storage::Ownership Ownership>
|
|
||||||
void write(storage::tar::FileWriter &writer,
|
|
||||||
const std::string &name,
|
|
||||||
const detail::ContractedMetric<Ownership> &metric)
|
|
||||||
{
|
|
||||||
util::serialization::write(writer, name + "/contracted_graph", metric.graph);
|
|
||||||
|
|
||||||
writer.WriteElementCount64(name + "/exclude", metric.edge_filter.size());
|
|
||||||
for (const auto index : util::irange<std::size_t>(0, metric.edge_filter.size()))
|
|
||||||
{
|
|
||||||
storage::serialization::write(writer,
|
|
||||||
name + "/exclude/" + std::to_string(index) + "/edge_filter",
|
|
||||||
metric.edge_filter[index]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <storage::Ownership Ownership>
|
|
||||||
void read(storage::tar::FileReader &reader,
|
|
||||||
const std::string &name,
|
|
||||||
detail::ContractedMetric<Ownership> &metric)
|
|
||||||
{
|
|
||||||
util::serialization::read(reader, name + "/contracted_graph", metric.graph);
|
|
||||||
|
|
||||||
metric.edge_filter.resize(reader.ReadElementCount64(name + "/exclude"));
|
|
||||||
for (const auto index : util::irange<std::size_t>(0, metric.edge_filter.size()))
|
|
||||||
{
|
|
||||||
storage::serialization::read(reader,
|
|
||||||
name + "/exclude/" + std::to_string(index) + "/edge_filter",
|
|
||||||
metric.edge_filter[index]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
#ifndef OSRM_CELLS_CUSTOMIZER_HPP
|
#ifndef OSRM_CELLS_CUSTOMIZER_HPP
|
||||||
#define OSRM_CELLS_CUSTOMIZER_HPP
|
#define OSRM_CELLS_CUSTOMIZER_HPP
|
||||||
|
|
||||||
#include "partitioner/cell_storage.hpp"
|
#include "partition/cell_storage.hpp"
|
||||||
#include "partitioner/multi_level_partition.hpp"
|
#include "partition/multi_level_partition.hpp"
|
||||||
#include "util/query_heap.hpp"
|
#include "util/query_heap.hpp"
|
||||||
|
|
||||||
#include <tbb/enumerable_thread_specific.h>
|
#include <tbb/enumerable_thread_specific.h>
|
||||||
#include <tbb/parallel_for.h>
|
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
@@ -29,12 +28,12 @@ class CellCustomizer
|
|||||||
util::QueryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::ArrayStorage<NodeID, int>>;
|
util::QueryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::ArrayStorage<NodeID, int>>;
|
||||||
using HeapPtr = tbb::enumerable_thread_specific<Heap>;
|
using HeapPtr = tbb::enumerable_thread_specific<Heap>;
|
||||||
|
|
||||||
CellCustomizer(const partitioner::MultiLevelPartition &partition) : partition(partition) {}
|
CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {}
|
||||||
|
|
||||||
template <typename GraphT>
|
template <typename GraphT>
|
||||||
void Customize(const GraphT &graph,
|
void Customize(const GraphT &graph,
|
||||||
Heap &heap,
|
Heap &heap,
|
||||||
const partitioner::CellStorage &cells,
|
const partition::CellStorage &cells,
|
||||||
const std::vector<bool> &allowed_nodes,
|
const std::vector<bool> &allowed_nodes,
|
||||||
CellMetric &metric,
|
CellMetric &metric,
|
||||||
LevelID level,
|
LevelID level,
|
||||||
@@ -97,7 +96,7 @@ class CellCustomizer
|
|||||||
|
|
||||||
template <typename GraphT>
|
template <typename GraphT>
|
||||||
void Customize(const GraphT &graph,
|
void Customize(const GraphT &graph,
|
||||||
const partitioner::CellStorage &cells,
|
const partition::CellStorage &cells,
|
||||||
const std::vector<bool> &allowed_nodes,
|
const std::vector<bool> &allowed_nodes,
|
||||||
CellMetric &metric) const
|
CellMetric &metric) const
|
||||||
{
|
{
|
||||||
@@ -121,7 +120,7 @@ class CellCustomizer
|
|||||||
private:
|
private:
|
||||||
template <typename GraphT>
|
template <typename GraphT>
|
||||||
void RelaxNode(const GraphT &graph,
|
void RelaxNode(const GraphT &graph,
|
||||||
const partitioner::CellStorage &cells,
|
const partition::CellStorage &cells,
|
||||||
const std::vector<bool> &allowed_nodes,
|
const std::vector<bool> &allowed_nodes,
|
||||||
const CellMetric &metric,
|
const CellMetric &metric,
|
||||||
Heap &heap,
|
Heap &heap,
|
||||||
@@ -209,7 +208,7 @@ class CellCustomizer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const partitioner::MultiLevelPartition &partition;
|
const partition::MultiLevelPartition &partition;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
#define OSRM_CUSTOMIZE_EDGE_BASED_GRAPH_HPP
|
#define OSRM_CUSTOMIZE_EDGE_BASED_GRAPH_HPP
|
||||||
|
|
||||||
#include "extractor/edge_based_edge.hpp"
|
#include "extractor/edge_based_edge.hpp"
|
||||||
#include "partitioner/edge_based_graph.hpp"
|
#include "partition/edge_based_graph.hpp"
|
||||||
#include "partitioner/multi_level_graph.hpp"
|
#include "partition/multi_level_graph.hpp"
|
||||||
#include "util/static_graph.hpp"
|
#include "util/static_graph.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
@@ -16,20 +16,19 @@ namespace osrm
|
|||||||
namespace customizer
|
namespace customizer
|
||||||
{
|
{
|
||||||
|
|
||||||
using EdgeBasedGraphEdgeData = partitioner::EdgeBasedGraphEdgeData;
|
using EdgeBasedGraphEdgeData = partition::EdgeBasedGraphEdgeData;
|
||||||
|
|
||||||
struct MultiLevelEdgeBasedGraph
|
struct MultiLevelEdgeBasedGraph
|
||||||
: public partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>
|
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>
|
||||||
{
|
{
|
||||||
using Base =
|
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
||||||
partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
|
||||||
using Base::Base;
|
using Base::Base;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MultiLevelEdgeBasedGraphView
|
struct MultiLevelEdgeBasedGraphView
|
||||||
: public partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>
|
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>
|
||||||
{
|
{
|
||||||
using Base = partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
||||||
using Base::Base;
|
using Base::Base;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,10 @@
|
|||||||
|
|
||||||
#include "customizer/serialization.hpp"
|
#include "customizer/serialization.hpp"
|
||||||
|
|
||||||
#include "storage/tar.hpp"
|
#include "storage/io.hpp"
|
||||||
|
|
||||||
#include "util/integer_range.hpp"
|
#include "util/integer_range.hpp"
|
||||||
|
|
||||||
#include <unordered_map>
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace customizer
|
namespace customizer
|
||||||
@@ -18,59 +16,40 @@ namespace files
|
|||||||
|
|
||||||
// reads .osrm.cell_metrics file
|
// reads .osrm.cell_metrics file
|
||||||
template <typename CellMetricT>
|
template <typename CellMetricT>
|
||||||
inline void readCellMetrics(const boost::filesystem::path &path,
|
inline void readCellMetrics(const boost::filesystem::path &path, std::vector<CellMetricT> &metrics)
|
||||||
std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
|
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
|
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
|
||||||
std::is_same<CellMetric, CellMetricT>::value,
|
std::is_same<CellMetric, CellMetricT>::value,
|
||||||
"");
|
"");
|
||||||
|
|
||||||
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
|
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||||
storage::tar::FileReader reader{path, fingerprint};
|
storage::io::FileReader reader{path, fingerprint};
|
||||||
|
|
||||||
for (auto &pair : metrics)
|
auto num_metrics = reader.ReadElementCount64();
|
||||||
|
metrics.resize(num_metrics);
|
||||||
|
|
||||||
|
for (auto &metric : metrics)
|
||||||
{
|
{
|
||||||
const auto &metric_name = pair.first;
|
serialization::read(reader, metric);
|
||||||
auto &metric_exclude_classes = pair.second;
|
|
||||||
|
|
||||||
auto prefix = "/mld/metrics/" + metric_name + "/exclude";
|
|
||||||
auto num_exclude_classes = reader.ReadElementCount64(prefix);
|
|
||||||
metric_exclude_classes.resize(num_exclude_classes);
|
|
||||||
|
|
||||||
auto id = 0;
|
|
||||||
for (auto &metric : metric_exclude_classes)
|
|
||||||
{
|
|
||||||
serialization::read(reader, prefix + "/" + std::to_string(id++), metric);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// writes .osrm.cell_metrics file
|
// writes .osrm.cell_metrics file
|
||||||
template <typename CellMetricT>
|
template <typename CellMetricT>
|
||||||
inline void
|
inline void writeCellMetrics(const boost::filesystem::path &path,
|
||||||
writeCellMetrics(const boost::filesystem::path &path,
|
const std::vector<CellMetricT> &metrics)
|
||||||
const std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
|
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
|
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
|
||||||
std::is_same<CellMetric, CellMetricT>::value,
|
std::is_same<CellMetric, CellMetricT>::value,
|
||||||
"");
|
"");
|
||||||
|
|
||||||
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
|
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||||
storage::tar::FileWriter writer{path, fingerprint};
|
storage::io::FileWriter writer{path, fingerprint};
|
||||||
|
|
||||||
for (const auto &pair : metrics)
|
writer.WriteElementCount64(metrics.size());
|
||||||
|
for (const auto &metric : metrics)
|
||||||
{
|
{
|
||||||
const auto &metric_name = pair.first;
|
serialization::write(writer, metric);
|
||||||
const auto &metric_exclude_classes = pair.second;
|
|
||||||
|
|
||||||
auto prefix = "/mld/metrics/" + metric_name + "/exclude";
|
|
||||||
writer.WriteElementCount64(prefix, metric_exclude_classes.size());
|
|
||||||
|
|
||||||
auto id = 0;
|
|
||||||
for (auto &exclude_metric : metric_exclude_classes)
|
|
||||||
{
|
|
||||||
serialization::write(writer, prefix + "/" + std::to_string(id++), exclude_metric);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#ifndef OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
#ifndef OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
||||||
#define OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
#define OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
||||||
|
|
||||||
#include "partitioner/cell_storage.hpp"
|
#include "partition/cell_storage.hpp"
|
||||||
|
|
||||||
|
#include "storage/io.hpp"
|
||||||
#include "storage/serialization.hpp"
|
#include "storage/serialization.hpp"
|
||||||
#include "storage/shared_memory_ownership.hpp"
|
#include "storage/shared_memory_ownership.hpp"
|
||||||
#include "storage/tar.hpp"
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -15,21 +15,17 @@ namespace serialization
|
|||||||
{
|
{
|
||||||
|
|
||||||
template <storage::Ownership Ownership>
|
template <storage::Ownership Ownership>
|
||||||
inline void read(storage::tar::FileReader &reader,
|
inline void read(storage::io::FileReader &reader, detail::CellMetricImpl<Ownership> &metric)
|
||||||
const std::string &name,
|
|
||||||
detail::CellMetricImpl<Ownership> &metric)
|
|
||||||
{
|
{
|
||||||
storage::serialization::read(reader, name + "/weights", metric.weights);
|
storage::serialization::read(reader, metric.weights);
|
||||||
storage::serialization::read(reader, name + "/durations", metric.durations);
|
storage::serialization::read(reader, metric.durations);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <storage::Ownership Ownership>
|
template <storage::Ownership Ownership>
|
||||||
inline void write(storage::tar::FileWriter &writer,
|
inline void write(storage::io::FileWriter &writer, const detail::CellMetricImpl<Ownership> &metric)
|
||||||
const std::string &name,
|
|
||||||
const detail::CellMetricImpl<Ownership> &metric)
|
|
||||||
{
|
{
|
||||||
storage::serialization::write(writer, name + "/weights", metric.weights);
|
storage::serialization::write(writer, metric.weights);
|
||||||
storage::serialization::write(writer, name + "/durations", metric.durations);
|
storage::serialization::write(writer, metric.durations);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ template <typename AlgorithmT> const char *name();
|
|||||||
template <> inline const char *name<ch::Algorithm>() { return "CH"; }
|
template <> inline const char *name<ch::Algorithm>() { return "CH"; }
|
||||||
template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
|
template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
|
||||||
|
|
||||||
// Algorithm identifier
|
|
||||||
template <typename AlgorithmT> const char *identifier();
|
|
||||||
template <> inline const char *identifier<ch::Algorithm>() { return "ch"; }
|
|
||||||
template <> inline const char *identifier<mld::Algorithm>() { return "mld"; }
|
|
||||||
|
|
||||||
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
|
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#ifndef ENGINE_RESPONSE_OBJECTS_HPP_
|
#ifndef ENGINE_RESPONSE_OBJECTS_HPP_
|
||||||
#define ENGINE_RESPONSE_OBJECTS_HPP_
|
#define ENGINE_RESPONSE_OBJECTS_HPP_
|
||||||
|
|
||||||
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "guidance/turn_instruction.hpp"
|
|
||||||
#include "engine/guidance/leg_geometry.hpp"
|
#include "engine/guidance/leg_geometry.hpp"
|
||||||
#include "engine/guidance/route.hpp"
|
#include "engine/guidance/route.hpp"
|
||||||
#include "engine/guidance/route_leg.hpp"
|
#include "engine/guidance/route_leg.hpp"
|
||||||
|
|||||||
@@ -86,10 +86,6 @@ class MatchAPI final : public RouteAPI
|
|||||||
for (auto point_index : util::irange(
|
for (auto point_index : util::irange(
|
||||||
0u, static_cast<unsigned>(sub_matchings[sub_matching_index].indices.size())))
|
0u, static_cast<unsigned>(sub_matchings[sub_matching_index].indices.size())))
|
||||||
{
|
{
|
||||||
// tidied_to_original: index of the input coordinate that a tidied coordinate
|
|
||||||
// corresponds to.
|
|
||||||
// sub_matching indices: index of the coordinate passed to map matching plugin that
|
|
||||||
// a matched node corresponds to.
|
|
||||||
trace_idx_to_matching_idx[tidy_result
|
trace_idx_to_matching_idx[tidy_result
|
||||||
.tidied_to_original[sub_matchings[sub_matching_index]
|
.tidied_to_original[sub_matchings[sub_matching_index]
|
||||||
.indices[point_index]]] =
|
.indices[point_index]]] =
|
||||||
@@ -97,9 +93,6 @@ class MatchAPI final : public RouteAPI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_ASSERT(parameters.waypoints.empty() || sub_matchings.size() == 1);
|
|
||||||
|
|
||||||
std::size_t was_waypoint_idx = 0;
|
|
||||||
for (auto trace_index : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
for (auto trace_index : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
||||||
{
|
{
|
||||||
if (tidy_result.can_be_removed[trace_index])
|
if (tidy_result.can_be_removed[trace_index])
|
||||||
@@ -121,20 +114,6 @@ class MatchAPI final : public RouteAPI
|
|||||||
waypoint.values["alternatives_count"] =
|
waypoint.values["alternatives_count"] =
|
||||||
sub_matchings[matching_index.sub_matching_index]
|
sub_matchings[matching_index.sub_matching_index]
|
||||||
.alternatives_count[matching_index.point_index];
|
.alternatives_count[matching_index.point_index];
|
||||||
// waypoint indices need to be adjusted if route legs were collapsed
|
|
||||||
// waypoint parameter assumes there is only one match object
|
|
||||||
if (!parameters.waypoints.empty())
|
|
||||||
{
|
|
||||||
if (tidy_result.was_waypoint[trace_index])
|
|
||||||
{
|
|
||||||
waypoint.values["waypoint_index"] = was_waypoint_idx;
|
|
||||||
was_waypoint_idx++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
waypoint.values["waypoint_index"] = util::json::Null();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
waypoints.values.push_back(std::move(waypoint));
|
waypoints.values.push_back(std::move(waypoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,40 +63,25 @@ struct MatchParameters : public RouteParameters
|
|||||||
RouteParameters::GeometriesType::Polyline,
|
RouteParameters::GeometriesType::Polyline,
|
||||||
RouteParameters::OverviewType::Simplified,
|
RouteParameters::OverviewType::Simplified,
|
||||||
{}),
|
{}),
|
||||||
gaps(GapsType::Split), tidy(false), waypoints()
|
gaps(GapsType::Split), tidy(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
MatchParameters(std::vector<unsigned> timestamps_, GapsType gaps_, bool tidy_, Args... args_)
|
MatchParameters(std::vector<unsigned> timestamps_, GapsType gaps_, bool tidy_, Args... args_)
|
||||||
: MatchParameters(std::move(timestamps_), gaps_, tidy_, {}, std::forward<Args>(args_)...)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename... Args>
|
|
||||||
MatchParameters(std::vector<unsigned> timestamps_,
|
|
||||||
GapsType gaps_,
|
|
||||||
bool tidy_,
|
|
||||||
std::vector<std::size_t> waypoints_,
|
|
||||||
Args... args_)
|
|
||||||
: RouteParameters{std::forward<Args>(args_)...}, timestamps{std::move(timestamps_)},
|
: RouteParameters{std::forward<Args>(args_)...}, timestamps{std::move(timestamps_)},
|
||||||
gaps(gaps_), tidy(tidy_), waypoints{std::move(waypoints_)}
|
gaps(gaps_), tidy(tidy_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<unsigned> timestamps;
|
std::vector<unsigned> timestamps;
|
||||||
GapsType gaps;
|
GapsType gaps;
|
||||||
bool tidy;
|
bool tidy;
|
||||||
std::vector<std::size_t> waypoints;
|
|
||||||
|
|
||||||
bool IsValid() const
|
bool IsValid() const
|
||||||
{
|
{
|
||||||
const auto valid_waypoints =
|
|
||||||
std::all_of(waypoints.begin(), waypoints.end(), [this](const auto &w) {
|
|
||||||
return w < coordinates.size();
|
|
||||||
});
|
|
||||||
return RouteParameters::IsValid() &&
|
return RouteParameters::IsValid() &&
|
||||||
(timestamps.empty() || timestamps.size() == coordinates.size()) && valid_waypoints;
|
(timestamps.empty() || timestamps.size() == coordinates.size());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,9 +37,6 @@ struct Result
|
|||||||
Mask can_be_removed;
|
Mask can_be_removed;
|
||||||
// Maps the MatchParameter's original items to items which should not be removed.
|
// Maps the MatchParameter's original items to items which should not be removed.
|
||||||
Mapping tidied_to_original;
|
Mapping tidied_to_original;
|
||||||
// Masking the MatchParameter coordinates for items whose indices were present in the
|
|
||||||
// `waypoints` parameter.
|
|
||||||
Mask was_waypoint;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline Result keep_all(const MatchParameters ¶ms)
|
inline Result keep_all(const MatchParameters ¶ms)
|
||||||
@@ -47,17 +44,6 @@ inline Result keep_all(const MatchParameters ¶ms)
|
|||||||
Result result;
|
Result result;
|
||||||
|
|
||||||
result.can_be_removed.resize(params.coordinates.size(), false);
|
result.can_be_removed.resize(params.coordinates.size(), false);
|
||||||
result.was_waypoint.resize(params.coordinates.size(), true);
|
|
||||||
// by default all input coordinates are treated as waypoints
|
|
||||||
if (!params.waypoints.empty())
|
|
||||||
{
|
|
||||||
for (const auto p : params.waypoints)
|
|
||||||
{
|
|
||||||
result.was_waypoint.set(p, false);
|
|
||||||
}
|
|
||||||
// logic is a little funny, uses inversion to set the bitfield
|
|
||||||
result.was_waypoint.flip();
|
|
||||||
}
|
|
||||||
result.tidied_to_original.reserve(params.coordinates.size());
|
result.tidied_to_original.reserve(params.coordinates.size());
|
||||||
for (std::size_t current = 0; current < params.coordinates.size(); ++current)
|
for (std::size_t current = 0; current < params.coordinates.size(); ++current)
|
||||||
{
|
{
|
||||||
@@ -75,8 +61,6 @@ inline Result keep_all(const MatchParameters ¶ms)
|
|||||||
{
|
{
|
||||||
result.parameters.coordinates.push_back(params.coordinates[i]);
|
result.parameters.coordinates.push_back(params.coordinates[i]);
|
||||||
|
|
||||||
if (result.was_waypoint[i])
|
|
||||||
result.parameters.waypoints.push_back(result.parameters.coordinates.size() - 1);
|
|
||||||
if (!params.hints.empty())
|
if (!params.hints.empty())
|
||||||
result.parameters.hints.push_back(params.hints[i]);
|
result.parameters.hints.push_back(params.hints[i]);
|
||||||
|
|
||||||
@@ -90,8 +74,6 @@ inline Result keep_all(const MatchParameters ¶ms)
|
|||||||
result.parameters.timestamps.push_back(params.timestamps[i]);
|
result.parameters.timestamps.push_back(params.timestamps[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (params.waypoints.empty())
|
|
||||||
result.parameters.waypoints.clear();
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -103,15 +85,6 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5})
|
|||||||
Result result;
|
Result result;
|
||||||
|
|
||||||
result.can_be_removed.resize(params.coordinates.size(), false);
|
result.can_be_removed.resize(params.coordinates.size(), false);
|
||||||
result.was_waypoint.resize(params.coordinates.size(), true);
|
|
||||||
if (!params.waypoints.empty())
|
|
||||||
{
|
|
||||||
for (const auto p : params.waypoints)
|
|
||||||
{
|
|
||||||
result.was_waypoint.set(p, false);
|
|
||||||
}
|
|
||||||
result.was_waypoint.flip();
|
|
||||||
}
|
|
||||||
|
|
||||||
result.tidied_to_original.push_back(0);
|
result.tidied_to_original.push_back(0);
|
||||||
|
|
||||||
@@ -165,14 +138,13 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5})
|
|||||||
|
|
||||||
// We have to filter parallel arrays that may be empty or the exact same size.
|
// We have to filter parallel arrays that may be empty or the exact same size.
|
||||||
// result.parameters contains an empty MatchParameters at this point: conditionally fill.
|
// result.parameters contains an empty MatchParameters at this point: conditionally fill.
|
||||||
|
|
||||||
for (std::size_t i = 0; i < result.can_be_removed.size(); ++i)
|
for (std::size_t i = 0; i < result.can_be_removed.size(); ++i)
|
||||||
{
|
{
|
||||||
if (!result.can_be_removed[i])
|
if (!result.can_be_removed[i])
|
||||||
{
|
{
|
||||||
result.parameters.coordinates.push_back(params.coordinates[i]);
|
result.parameters.coordinates.push_back(params.coordinates[i]);
|
||||||
|
|
||||||
if (result.was_waypoint[i])
|
|
||||||
result.parameters.waypoints.push_back(result.parameters.coordinates.size() - 1);
|
|
||||||
if (!params.hints.empty())
|
if (!params.hints.empty())
|
||||||
result.parameters.hints.push_back(params.hints[i]);
|
result.parameters.hints.push_back(params.hints[i]);
|
||||||
|
|
||||||
@@ -185,17 +157,8 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5})
|
|||||||
if (!params.timestamps.empty())
|
if (!params.timestamps.empty())
|
||||||
result.parameters.timestamps.push_back(params.timestamps[i]);
|
result.parameters.timestamps.push_back(params.timestamps[i]);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// one of the coordinates meant to be used as a waypoint was marked for removal
|
|
||||||
// update the original waypoint index to the new representative coordinate
|
|
||||||
const auto last_idx = result.parameters.coordinates.size() - 1;
|
|
||||||
if (result.was_waypoint[i] && (result.parameters.waypoints.back() != last_idx))
|
|
||||||
{
|
|
||||||
result.parameters.waypoints.push_back(last_idx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
BOOST_ASSERT(result.tidied_to_original.size() == result.parameters.coordinates.size());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,55 +34,56 @@ class NearestAPI final : public BaseAPI
|
|||||||
|
|
||||||
util::json::Array waypoints;
|
util::json::Array waypoints;
|
||||||
waypoints.values.resize(phantom_nodes.front().size());
|
waypoints.values.resize(phantom_nodes.front().size());
|
||||||
std::transform(
|
std::transform(phantom_nodes.front().begin(),
|
||||||
phantom_nodes.front().begin(),
|
phantom_nodes.front().end(),
|
||||||
phantom_nodes.front().end(),
|
waypoints.values.begin(),
|
||||||
waypoints.values.begin(),
|
[this](const PhantomNodeWithDistance &phantom_with_distance) {
|
||||||
[this](const PhantomNodeWithDistance &phantom_with_distance) {
|
auto &phantom_node = phantom_with_distance.phantom_node;
|
||||||
auto &phantom_node = phantom_with_distance.phantom_node;
|
auto waypoint = MakeWaypoint(phantom_node);
|
||||||
auto waypoint = MakeWaypoint(phantom_node);
|
waypoint.values["distance"] = phantom_with_distance.distance;
|
||||||
waypoint.values["distance"] = phantom_with_distance.distance;
|
|
||||||
|
|
||||||
util::json::Array nodes;
|
util::json::Array nodes;
|
||||||
|
|
||||||
std::uint64_t from_node = 0;
|
std::uint64_t from_node = 0;
|
||||||
std::uint64_t to_node = 0;
|
std::uint64_t to_node = 0;
|
||||||
|
|
||||||
datafacade::BaseDataFacade::NodeForwardRange forward_geometry;
|
std::vector<NodeID> forward_geometry;
|
||||||
if (phantom_node.forward_segment_id.enabled)
|
if (phantom_node.forward_segment_id.enabled)
|
||||||
{
|
{
|
||||||
auto segment_id = phantom_node.forward_segment_id.id;
|
auto segment_id = phantom_node.forward_segment_id.id;
|
||||||
const auto geometry_id = facade.GetGeometryIndex(segment_id).id;
|
const auto geometry_id = facade.GetGeometryIndex(segment_id).id;
|
||||||
forward_geometry = facade.GetUncompressedForwardGeometry(geometry_id);
|
forward_geometry =
|
||||||
|
facade.GetUncompressedForwardGeometry(geometry_id);
|
||||||
|
|
||||||
auto osm_node_id = facade.GetOSMNodeIDOfNode(
|
auto osm_node_id = facade.GetOSMNodeIDOfNode(
|
||||||
forward_geometry(phantom_node.fwd_segment_position));
|
forward_geometry[phantom_node.fwd_segment_position]);
|
||||||
to_node = static_cast<std::uint64_t>(osm_node_id);
|
to_node = static_cast<std::uint64_t>(osm_node_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phantom_node.reverse_segment_id.enabled)
|
if (phantom_node.reverse_segment_id.enabled)
|
||||||
{
|
{
|
||||||
auto segment_id = phantom_node.reverse_segment_id.id;
|
auto segment_id = phantom_node.reverse_segment_id.id;
|
||||||
const auto geometry_id = facade.GetGeometryIndex(segment_id).id;
|
const auto geometry_id = facade.GetGeometryIndex(segment_id).id;
|
||||||
const auto geometry = facade.GetUncompressedForwardGeometry(geometry_id);
|
std::vector<NodeID> geometry =
|
||||||
auto osm_node_id =
|
facade.GetUncompressedForwardGeometry(geometry_id);
|
||||||
facade.GetOSMNodeIDOfNode(geometry(phantom_node.fwd_segment_position + 1));
|
auto osm_node_id = facade.GetOSMNodeIDOfNode(
|
||||||
from_node = static_cast<std::uint64_t>(osm_node_id);
|
geometry[phantom_node.fwd_segment_position + 1]);
|
||||||
}
|
from_node = static_cast<std::uint64_t>(osm_node_id);
|
||||||
else if (phantom_node.forward_segment_id.enabled &&
|
}
|
||||||
phantom_node.fwd_segment_position > 0)
|
else if (phantom_node.forward_segment_id.enabled &&
|
||||||
{
|
phantom_node.fwd_segment_position > 0)
|
||||||
// In the case of one way, rely on forward segment only
|
{
|
||||||
auto osm_node_id = facade.GetOSMNodeIDOfNode(
|
// In the case of one way, rely on forward segment only
|
||||||
forward_geometry(phantom_node.fwd_segment_position - 1));
|
auto osm_node_id = facade.GetOSMNodeIDOfNode(
|
||||||
from_node = static_cast<std::uint64_t>(osm_node_id);
|
forward_geometry[phantom_node.fwd_segment_position - 1]);
|
||||||
}
|
from_node = static_cast<std::uint64_t>(osm_node_id);
|
||||||
nodes.values.push_back(from_node);
|
}
|
||||||
nodes.values.push_back(to_node);
|
nodes.values.push_back(from_node);
|
||||||
waypoint.values["nodes"] = std::move(nodes);
|
nodes.values.push_back(to_node);
|
||||||
|
waypoint.values["nodes"] = std::move(nodes);
|
||||||
|
|
||||||
return waypoint;
|
return waypoint;
|
||||||
});
|
});
|
||||||
|
|
||||||
response.values["code"] = "Ok";
|
response.values["code"] = "Ok";
|
||||||
response.values["waypoints"] = std::move(waypoints);
|
response.values["waypoints"] = std::move(waypoints);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef ENGINE_API_ROUTE_HPP
|
#ifndef ENGINE_API_ROUTE_HPP
|
||||||
#define ENGINE_API_ROUTE_HPP
|
#define ENGINE_API_ROUTE_HPP
|
||||||
|
|
||||||
#include "extractor/maneuver_override.hpp"
|
|
||||||
#include "engine/api/base_api.hpp"
|
#include "engine/api/base_api.hpp"
|
||||||
#include "engine/api/json_factory.hpp"
|
#include "engine/api/json_factory.hpp"
|
||||||
#include "engine/api/route_parameters.hpp"
|
#include "engine/api/route_parameters.hpp"
|
||||||
@@ -20,8 +19,6 @@
|
|||||||
|
|
||||||
#include "engine/internal_route_result.hpp"
|
#include "engine/internal_route_result.hpp"
|
||||||
|
|
||||||
#include "guidance/turn_instruction.hpp"
|
|
||||||
|
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/integer_range.hpp"
|
#include "util/integer_range.hpp"
|
||||||
#include "util/json_util.hpp"
|
#include "util/json_util.hpp"
|
||||||
@@ -91,12 +88,11 @@ class RouteAPI : public BaseAPI
|
|||||||
{
|
{
|
||||||
util::json::Array annotations_store;
|
util::json::Array annotations_store;
|
||||||
annotations_store.values.reserve(leg.annotations.size());
|
annotations_store.values.reserve(leg.annotations.size());
|
||||||
|
std::for_each(leg.annotations.begin(),
|
||||||
for (const auto &step : leg.annotations)
|
leg.annotations.end(),
|
||||||
{
|
[Get, &annotations_store](const auto &step) {
|
||||||
annotations_store.values.push_back(Get(step));
|
annotations_store.values.push_back(Get(step));
|
||||||
}
|
});
|
||||||
|
|
||||||
return annotations_store;
|
return annotations_store;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +129,6 @@ class RouteAPI : public BaseAPI
|
|||||||
reversed_target,
|
reversed_target,
|
||||||
parameters.steps);
|
parameters.steps);
|
||||||
|
|
||||||
util::Log(logDEBUG) << "Assembling steps " << std::endl;
|
|
||||||
if (parameters.steps)
|
if (parameters.steps)
|
||||||
{
|
{
|
||||||
auto steps = guidance::assembleSteps(BaseAPI::facade,
|
auto steps = guidance::assembleSteps(BaseAPI::facade,
|
||||||
@@ -144,13 +139,6 @@ class RouteAPI : public BaseAPI
|
|||||||
reversed_source,
|
reversed_source,
|
||||||
reversed_target);
|
reversed_target);
|
||||||
|
|
||||||
// Apply maneuver overrides before any other post
|
|
||||||
// processing is performed
|
|
||||||
guidance::applyOverrides(BaseAPI::facade, steps, leg_geometry);
|
|
||||||
|
|
||||||
// Collapse segregated steps before others
|
|
||||||
steps = guidance::collapseSegregatedTurnInstructions(std::move(steps));
|
|
||||||
|
|
||||||
/* Perform step-based post-processing.
|
/* Perform step-based post-processing.
|
||||||
*
|
*
|
||||||
* Using post-processing on basis of route-steps for a single leg at a time
|
* Using post-processing on basis of route-steps for a single leg at a time
|
||||||
@@ -214,16 +202,12 @@ class RouteAPI : public BaseAPI
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<util::json::Value> step_geometries;
|
std::vector<util::json::Value> step_geometries;
|
||||||
const auto total_step_count =
|
|
||||||
std::accumulate(legs.begin(), legs.end(), 0, [](const auto &v, const auto &leg) {
|
|
||||||
return v + leg.steps.size();
|
|
||||||
});
|
|
||||||
step_geometries.reserve(total_step_count);
|
|
||||||
|
|
||||||
for (const auto idx : util::irange<std::size_t>(0UL, legs.size()))
|
for (const auto idx : util::irange<std::size_t>(0UL, legs.size()))
|
||||||
{
|
{
|
||||||
auto &leg_geometry = leg_geometries[idx];
|
auto &leg_geometry = leg_geometries[idx];
|
||||||
|
|
||||||
|
step_geometries.reserve(step_geometries.size() + legs[idx].steps.size());
|
||||||
|
|
||||||
std::transform(
|
std::transform(
|
||||||
legs[idx].steps.begin(),
|
legs[idx].steps.begin(),
|
||||||
legs[idx].steps.end(),
|
legs[idx].steps.end(),
|
||||||
@@ -271,19 +255,10 @@ class RouteAPI : public BaseAPI
|
|||||||
// AnnotationsType uses bit flags, & operator checks if a property is set
|
// AnnotationsType uses bit flags, & operator checks if a property is set
|
||||||
if (parameters.annotations_type & RouteParameters::AnnotationsType::Speed)
|
if (parameters.annotations_type & RouteParameters::AnnotationsType::Speed)
|
||||||
{
|
{
|
||||||
double prev_speed = 0;
|
|
||||||
annotation.values["speed"] = GetAnnotations(
|
annotation.values["speed"] = GetAnnotations(
|
||||||
leg_geometry, [&prev_speed](const guidance::LegGeometry::Annotation &anno) {
|
leg_geometry, [](const guidance::LegGeometry::Annotation &anno) {
|
||||||
if (anno.duration < std::numeric_limits<double>::min())
|
auto val = std::round(anno.distance / anno.duration * 10.) / 10.;
|
||||||
{
|
return util::json::clamp_float(val);
|
||||||
return prev_speed;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto speed = std::round(anno.distance / anno.duration * 10.) / 10.;
|
|
||||||
prev_speed = speed;
|
|
||||||
return util::json::clamp_float(speed);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,29 +293,13 @@ class RouteAPI : public BaseAPI
|
|||||||
{
|
{
|
||||||
util::json::Array nodes;
|
util::json::Array nodes;
|
||||||
nodes.values.reserve(leg_geometry.osm_node_ids.size());
|
nodes.values.reserve(leg_geometry.osm_node_ids.size());
|
||||||
for (const auto node_id : leg_geometry.osm_node_ids)
|
std::for_each(leg_geometry.osm_node_ids.begin(),
|
||||||
{
|
leg_geometry.osm_node_ids.end(),
|
||||||
nodes.values.push_back(static_cast<std::uint64_t>(node_id));
|
[this, &nodes](const OSMNodeID &node_id) {
|
||||||
}
|
nodes.values.push_back(static_cast<std::uint64_t>(node_id));
|
||||||
|
});
|
||||||
annotation.values["nodes"] = std::move(nodes);
|
annotation.values["nodes"] = std::move(nodes);
|
||||||
}
|
}
|
||||||
// Add any supporting metadata, if needed
|
|
||||||
if (requested_annotations & RouteParameters::AnnotationsType::Datasources)
|
|
||||||
{
|
|
||||||
const auto MAX_DATASOURCE_ID = 255u;
|
|
||||||
util::json::Object metadata;
|
|
||||||
util::json::Array datasource_names;
|
|
||||||
for (auto i = 0u; i < MAX_DATASOURCE_ID; i++)
|
|
||||||
{
|
|
||||||
const auto name = facade.GetDatasourceName(i);
|
|
||||||
// Length of 0 indicates the first empty name, so we can stop here
|
|
||||||
if (name.size() == 0)
|
|
||||||
break;
|
|
||||||
datasource_names.values.push_back(std::string(facade.GetDatasourceName(i)));
|
|
||||||
}
|
|
||||||
metadata.values["datasource_names"] = datasource_names;
|
|
||||||
annotation.values["metadata"] = metadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
annotations.push_back(std::move(annotation));
|
annotations.push_back(std::move(annotation));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ inline std::string encodeBase64(const std::string &x) { return encodeBase64(x.da
|
|||||||
// Encode any sufficiently trivial object to Base64.
|
// Encode any sufficiently trivial object to Base64.
|
||||||
template <typename T> std::string encodeBase64Bytewise(const T &x)
|
template <typename T> std::string encodeBase64Bytewise(const T &x)
|
||||||
{
|
{
|
||||||
#if !defined(__GNUC__) || (__GNUC__ > 4)
|
#if not defined __GNUC__ or __GNUC__ > 4
|
||||||
static_assert(std::is_trivially_copyable<T>::value, "requires a trivially copyable type");
|
static_assert(std::is_trivially_copyable<T>::value, "requires a trivially copyable type");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ inline std::string decodeBase64(const std::string &encoded)
|
|||||||
// Decodes from Base 64 to any sufficiently trivial object.
|
// Decodes from Base 64 to any sufficiently trivial object.
|
||||||
template <typename T> T decodeBase64Bytewise(const std::string &encoded)
|
template <typename T> T decodeBase64Bytewise(const std::string &encoded)
|
||||||
{
|
{
|
||||||
#if !defined(__GNUC__) || (__GNUC__ > 4)
|
#if not defined __GNUC__ or __GNUC__ > 4
|
||||||
static_assert(std::is_trivially_copyable<T>::value, "requires a trivially copyable type");
|
static_assert(std::is_trivially_copyable<T>::value, "requires a trivially copyable type");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -32,35 +32,20 @@ template <typename AlgorithmT, typename FacadeT> class DataWatchdogImpl;
|
|||||||
template <typename AlgorithmT>
|
template <typename AlgorithmT>
|
||||||
class DataWatchdogImpl<AlgorithmT, datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>> final
|
class DataWatchdogImpl<AlgorithmT, datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>> final
|
||||||
{
|
{
|
||||||
using mutex_type = typename storage::SharedMonitor<storage::SharedRegionRegister>::mutex_type;
|
using mutex_type = typename storage::SharedMonitor<storage::SharedDataTimestamp>::mutex_type;
|
||||||
using Facade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
using Facade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DataWatchdogImpl(const std::string &dataset_name) : dataset_name(dataset_name), active(true)
|
DataWatchdogImpl() : active(true), timestamp(0)
|
||||||
{
|
{
|
||||||
// create the initial facade before launching the watchdog thread
|
// create the initial facade before launching the watchdog thread
|
||||||
{
|
{
|
||||||
boost::interprocess::scoped_lock<mutex_type> current_region_lock(barrier.get_mutex());
|
boost::interprocess::scoped_lock<mutex_type> current_region_lock(barrier.get_mutex());
|
||||||
|
|
||||||
auto &shared_register = barrier.data();
|
|
||||||
auto static_region_id = shared_register.Find(dataset_name + "/static");
|
|
||||||
auto updatable_region_id = shared_register.Find(dataset_name + "/updatable");
|
|
||||||
if (static_region_id == storage::SharedRegionRegister::INVALID_REGION_ID ||
|
|
||||||
updatable_region_id == storage::SharedRegionRegister::INVALID_REGION_ID)
|
|
||||||
{
|
|
||||||
throw util::exception("Could not find shared memory region for \"" + dataset_name +
|
|
||||||
"/data\". Did you run osrm-datastore?");
|
|
||||||
}
|
|
||||||
static_shared_region = &shared_register.GetRegion(static_region_id);
|
|
||||||
updatable_shared_region = &shared_register.GetRegion(updatable_region_id);
|
|
||||||
static_region = *static_shared_region;
|
|
||||||
updatable_region = *updatable_shared_region;
|
|
||||||
|
|
||||||
facade_factory =
|
facade_factory =
|
||||||
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT>(
|
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT>(
|
||||||
std::make_shared<datafacade::SharedMemoryAllocator>(
|
std::make_shared<datafacade::SharedMemoryAllocator>(barrier.data().region));
|
||||||
std::vector<storage::SharedRegionRegister::ShmKey>{
|
timestamp = barrier.data().timestamp;
|
||||||
static_region.shm_key, updatable_region.shm_key}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watcher = std::thread(&DataWatchdogImpl::Run, this);
|
watcher = std::thread(&DataWatchdogImpl::Run, this);
|
||||||
@@ -89,46 +74,30 @@ class DataWatchdogImpl<AlgorithmT, datafacade::ContiguousInternalMemoryDataFacad
|
|||||||
{
|
{
|
||||||
boost::interprocess::scoped_lock<mutex_type> current_region_lock(barrier.get_mutex());
|
boost::interprocess::scoped_lock<mutex_type> current_region_lock(barrier.get_mutex());
|
||||||
|
|
||||||
while (active && static_region.timestamp == static_shared_region->timestamp &&
|
while (active && timestamp == barrier.data().timestamp)
|
||||||
updatable_region.timestamp == updatable_shared_region->timestamp)
|
|
||||||
{
|
{
|
||||||
barrier.wait(current_region_lock);
|
barrier.wait(current_region_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!active)
|
if (timestamp != barrier.data().timestamp)
|
||||||
break;
|
|
||||||
|
|
||||||
if (static_region.timestamp != static_shared_region->timestamp)
|
|
||||||
{
|
{
|
||||||
static_region = *static_shared_region;
|
auto region = barrier.data().region;
|
||||||
|
facade_factory =
|
||||||
|
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT>(
|
||||||
|
std::make_shared<datafacade::SharedMemoryAllocator>(region));
|
||||||
|
timestamp = barrier.data().timestamp;
|
||||||
|
util::Log() << "updated facade to region " << region << " with timestamp "
|
||||||
|
<< timestamp;
|
||||||
}
|
}
|
||||||
if (updatable_region.timestamp != updatable_shared_region->timestamp)
|
|
||||||
{
|
|
||||||
updatable_region = *updatable_shared_region;
|
|
||||||
}
|
|
||||||
|
|
||||||
util::Log() << "updated facade to regions " << (int)static_region.shm_key << " and "
|
|
||||||
<< (int)updatable_region.shm_key << " with timestamps "
|
|
||||||
<< static_region.timestamp << " and " << updatable_region.timestamp;
|
|
||||||
|
|
||||||
facade_factory =
|
|
||||||
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT>(
|
|
||||||
std::make_shared<datafacade::SharedMemoryAllocator>(
|
|
||||||
std::vector<storage::SharedRegionRegister::ShmKey>{
|
|
||||||
static_region.shm_key, updatable_region.shm_key}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
util::Log() << "DataWatchdog thread stopped";
|
util::Log() << "DataWatchdog thread stopped";
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string dataset_name;
|
storage::SharedMonitor<storage::SharedDataTimestamp> barrier;
|
||||||
storage::SharedMonitor<storage::SharedRegionRegister> barrier;
|
|
||||||
std::thread watcher;
|
std::thread watcher;
|
||||||
bool active;
|
bool active;
|
||||||
storage::SharedRegion static_region;
|
unsigned timestamp;
|
||||||
storage::SharedRegion updatable_region;
|
|
||||||
storage::SharedRegion *static_shared_region;
|
|
||||||
storage::SharedRegion *updatable_shared_region;
|
|
||||||
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT> facade_factory;
|
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT> facade_factory;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
#include "extractor/edge_based_edge.hpp"
|
#include "extractor/edge_based_edge.hpp"
|
||||||
#include "engine/algorithm.hpp"
|
#include "engine/algorithm.hpp"
|
||||||
|
|
||||||
#include "partitioner/cell_storage.hpp"
|
#include "partition/cell_storage.hpp"
|
||||||
#include "partitioner/multi_level_partition.hpp"
|
#include "partition/multi_level_partition.hpp"
|
||||||
|
|
||||||
#include "util/filtered_graph.hpp"
|
#include "util/filtered_graph.hpp"
|
||||||
#include "util/integer_range.hpp"
|
#include "util/integer_range.hpp"
|
||||||
@@ -65,8 +65,6 @@ template <> class AlgorithmDataFacade<MLD>
|
|||||||
// search graph access
|
// search graph access
|
||||||
virtual unsigned GetNumberOfNodes() const = 0;
|
virtual unsigned GetNumberOfNodes() const = 0;
|
||||||
|
|
||||||
virtual unsigned GetMaxBorderNodeID() const = 0;
|
|
||||||
|
|
||||||
virtual unsigned GetNumberOfEdges() const = 0;
|
virtual unsigned GetNumberOfEdges() const = 0;
|
||||||
|
|
||||||
virtual unsigned GetOutDegree(const NodeID n) const = 0;
|
virtual unsigned GetOutDegree(const NodeID n) const = 0;
|
||||||
@@ -77,9 +75,9 @@ template <> class AlgorithmDataFacade<MLD>
|
|||||||
|
|
||||||
virtual EdgeRange GetAdjacentEdgeRange(const NodeID node) const = 0;
|
virtual EdgeRange GetAdjacentEdgeRange(const NodeID node) const = 0;
|
||||||
|
|
||||||
virtual const partitioner::MultiLevelPartitionView &GetMultiLevelPartition() const = 0;
|
virtual const partition::MultiLevelPartitionView &GetMultiLevelPartition() const = 0;
|
||||||
|
|
||||||
virtual const partitioner::CellStorageView &GetCellStorage() const = 0;
|
virtual const partition::CellStorageView &GetCellStorage() const = 0;
|
||||||
|
|
||||||
virtual const customizer::CellMetricView &GetCellMetric() const = 0;
|
virtual const customizer::CellMetricView &GetCellMetric() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef OSRM_ENGINE_DATAFACADE_CONTIGUOUS_BLOCK_ALLOCATOR_HPP_
|
#ifndef OSRM_ENGINE_DATAFACADE_CONTIGUOUS_BLOCK_ALLOCATOR_HPP_
|
||||||
#define OSRM_ENGINE_DATAFACADE_CONTIGUOUS_BLOCK_ALLOCATOR_HPP_
|
#define OSRM_ENGINE_DATAFACADE_CONTIGUOUS_BLOCK_ALLOCATOR_HPP_
|
||||||
|
|
||||||
#include "storage/shared_data_index.hpp"
|
#include "storage/shared_datatype.hpp"
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -16,7 +16,8 @@ class ContiguousBlockAllocator
|
|||||||
virtual ~ContiguousBlockAllocator() = default;
|
virtual ~ContiguousBlockAllocator() = default;
|
||||||
|
|
||||||
// interface to give access to the datafacades
|
// interface to give access to the datafacades
|
||||||
virtual const storage::SharedDataIndex &GetIndex() = 0;
|
virtual storage::DataLayout &GetLayout() = 0;
|
||||||
|
virtual char *GetMemory() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace datafacade
|
} // namespace datafacade
|
||||||
|
|||||||
@@ -9,13 +9,42 @@
|
|||||||
#include "engine/approach.hpp"
|
#include "engine/approach.hpp"
|
||||||
#include "engine/geospatial_query.hpp"
|
#include "engine/geospatial_query.hpp"
|
||||||
|
|
||||||
|
#include "customizer/edge_based_graph.hpp"
|
||||||
|
|
||||||
|
#include "extractor/datasources.hpp"
|
||||||
|
#include "extractor/edge_based_node.hpp"
|
||||||
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
|
#include "extractor/intersection_bearings_container.hpp"
|
||||||
|
#include "extractor/node_data_container.hpp"
|
||||||
|
#include "extractor/packed_osm_ids.hpp"
|
||||||
|
#include "extractor/profile_properties.hpp"
|
||||||
|
#include "extractor/segment_data_container.hpp"
|
||||||
|
#include "extractor/turn_data_container.hpp"
|
||||||
|
|
||||||
|
#include "contractor/query_graph.hpp"
|
||||||
|
|
||||||
|
#include "partition/cell_storage.hpp"
|
||||||
|
#include "partition/multi_level_partition.hpp"
|
||||||
|
|
||||||
#include "storage/shared_datatype.hpp"
|
#include "storage/shared_datatype.hpp"
|
||||||
#include "storage/shared_memory_ownership.hpp"
|
#include "storage/shared_memory_ownership.hpp"
|
||||||
#include "storage/view_factory.hpp"
|
|
||||||
|
|
||||||
#include "util/exception.hpp"
|
#include "util/exception.hpp"
|
||||||
#include "util/exception_utils.hpp"
|
#include "util/exception_utils.hpp"
|
||||||
|
#include "util/filtered_graph.hpp"
|
||||||
|
#include "util/guidance/bearing_class.hpp"
|
||||||
|
#include "util/guidance/entry_class.hpp"
|
||||||
|
#include "util/guidance/turn_bearing.hpp"
|
||||||
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
#include "util/log.hpp"
|
#include "util/log.hpp"
|
||||||
|
#include "util/name_table.hpp"
|
||||||
|
#include "util/packed_vector.hpp"
|
||||||
|
#include "util/range_table.hpp"
|
||||||
|
#include "util/rectangle.hpp"
|
||||||
|
#include "util/static_graph.hpp"
|
||||||
|
#include "util/static_rtree.hpp"
|
||||||
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
@@ -50,22 +79,44 @@ class ContiguousInternalMemoryAlgorithmDataFacade<CH> : public datafacade::Algor
|
|||||||
// allocator that keeps the allocation data
|
// allocator that keeps the allocation data
|
||||||
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
||||||
|
|
||||||
public:
|
void InitializeGraphPointer(storage::DataLayout &data_layout,
|
||||||
ContiguousInternalMemoryAlgorithmDataFacade(
|
char *memory_block,
|
||||||
std::shared_ptr<ContiguousBlockAllocator> allocator_,
|
const std::size_t exclude_index)
|
||||||
const std::string &metric_name,
|
|
||||||
std::size_t exclude_index)
|
|
||||||
: allocator(std::move(allocator_))
|
|
||||||
{
|
{
|
||||||
InitializeInternalPointers(allocator->GetIndex(), metric_name, exclude_index);
|
auto graph_nodes_ptr = data_layout.GetBlockPtr<GraphNode>(
|
||||||
|
memory_block, storage::DataLayout::CH_GRAPH_NODE_LIST);
|
||||||
|
|
||||||
|
auto graph_edges_ptr = data_layout.GetBlockPtr<GraphEdge>(
|
||||||
|
memory_block, storage::DataLayout::CH_GRAPH_EDGE_LIST);
|
||||||
|
|
||||||
|
auto filter_block_id = static_cast<storage::DataLayout::BlockID>(
|
||||||
|
storage::DataLayout::CH_EDGE_FILTER_0 + exclude_index);
|
||||||
|
|
||||||
|
auto edge_filter_ptr = data_layout.GetBlockPtr<unsigned>(memory_block, filter_block_id);
|
||||||
|
|
||||||
|
util::vector_view<GraphNode> node_list(
|
||||||
|
graph_nodes_ptr, data_layout.num_entries[storage::DataLayout::CH_GRAPH_NODE_LIST]);
|
||||||
|
util::vector_view<GraphEdge> edge_list(
|
||||||
|
graph_edges_ptr, data_layout.num_entries[storage::DataLayout::CH_GRAPH_EDGE_LIST]);
|
||||||
|
|
||||||
|
util::vector_view<bool> edge_filter(edge_filter_ptr,
|
||||||
|
data_layout.num_entries[filter_block_id]);
|
||||||
|
m_query_graph = QueryGraph({node_list, edge_list}, edge_filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeInternalPointers(const storage::SharedDataIndex &index,
|
public:
|
||||||
const std::string &metric_name,
|
ContiguousInternalMemoryAlgorithmDataFacade(
|
||||||
|
std::shared_ptr<ContiguousBlockAllocator> allocator_, std::size_t exclude_index)
|
||||||
|
: allocator(std::move(allocator_))
|
||||||
|
{
|
||||||
|
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory(), exclude_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeInternalPointers(storage::DataLayout &data_layout,
|
||||||
|
char *memory_block,
|
||||||
const std::size_t exclude_index)
|
const std::size_t exclude_index)
|
||||||
{
|
{
|
||||||
m_query_graph =
|
InitializeGraphPointer(data_layout, memory_block, exclude_index);
|
||||||
make_filtered_graph_view(index, "/ch/metrics/" + metric_name, exclude_index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// search graph access
|
// search graph access
|
||||||
@@ -137,32 +188,29 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
extractor::ProfileProperties *m_profile_properties;
|
extractor::ProfileProperties *m_profile_properties;
|
||||||
extractor::Datasources *m_datasources;
|
extractor::Datasources *m_datasources;
|
||||||
|
|
||||||
std::uint32_t 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::vector_view<std::uint32_t> m_lane_description_offsets;
|
util::vector_view<std::uint32_t> m_lane_description_offsets;
|
||||||
util::vector_view<extractor::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;
|
||||||
util::vector_view<TurnPenalty> m_turn_duration_penalties;
|
util::vector_view<TurnPenalty> m_turn_duration_penalties;
|
||||||
extractor::SegmentDataView segment_data;
|
extractor::SegmentDataView segment_data;
|
||||||
|
extractor::TurnDataView turn_data;
|
||||||
extractor::EdgeBasedNodeDataView edge_based_node_data;
|
extractor::EdgeBasedNodeDataView edge_based_node_data;
|
||||||
guidance::TurnDataView turn_data;
|
|
||||||
|
|
||||||
util::vector_view<char> m_datasource_name_data;
|
util::vector_view<char> m_datasource_name_data;
|
||||||
util::vector_view<std::size_t> m_datasource_name_offsets;
|
util::vector_view<std::size_t> m_datasource_name_offsets;
|
||||||
util::vector_view<std::size_t> m_datasource_name_lengths;
|
util::vector_view<std::size_t> m_datasource_name_lengths;
|
||||||
util::vector_view<util::guidance::LaneTupleIdPair> m_lane_tupel_id_pairs;
|
util::vector_view<util::guidance::LaneTupleIdPair> m_lane_tupel_id_pairs;
|
||||||
|
|
||||||
util::vector_view<extractor::StorageManeuverOverride> m_maneuver_overrides;
|
std::unique_ptr<SharedRTree> m_static_rtree;
|
||||||
util::vector_view<NodeID> m_maneuver_override_node_sequences;
|
|
||||||
|
|
||||||
SharedRTree m_static_rtree;
|
|
||||||
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;
|
||||||
|
|
||||||
extractor::IntersectionBearingsView intersection_bearings_view;
|
extractor::IntersectionBearingsView intersection_bearings_view;
|
||||||
|
|
||||||
extractor::NameTableView m_name_table;
|
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;
|
||||||
@@ -170,62 +218,313 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
// allocator that keeps the allocation data
|
// allocator that keeps the allocation data
|
||||||
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
||||||
|
|
||||||
void InitializeInternalPointers(const storage::SharedDataIndex &index,
|
void InitializeProfilePropertiesPointer(storage::DataLayout &data_layout,
|
||||||
const std::string &metric_name,
|
char *memory_block,
|
||||||
const std::size_t exclude_index)
|
const std::size_t exclude_index)
|
||||||
{
|
{
|
||||||
// TODO: For multi-metric support we need to have separate exclude classes per metric
|
m_profile_properties = data_layout.GetBlockPtr<extractor::ProfileProperties>(
|
||||||
(void)metric_name;
|
memory_block, storage::DataLayout::PROPERTIES);
|
||||||
|
|
||||||
m_profile_properties =
|
|
||||||
index.GetBlockPtr<extractor::ProfileProperties>("/common/properties");
|
|
||||||
|
|
||||||
exclude_mask = m_profile_properties->excludable_classes[exclude_index];
|
exclude_mask = m_profile_properties->excludable_classes[exclude_index];
|
||||||
|
}
|
||||||
|
|
||||||
m_check_sum = *index.GetBlockPtr<std::uint32_t>("/common/connectivity_checksum");
|
void InitializeTimestampPointer(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
auto timestamp_ptr =
|
||||||
|
data_layout.GetBlockPtr<char>(memory_block, storage::DataLayout::TIMESTAMP);
|
||||||
|
m_timestamp.resize(data_layout.GetBlockSize(storage::DataLayout::TIMESTAMP));
|
||||||
|
std::copy(timestamp_ptr,
|
||||||
|
timestamp_ptr + data_layout.GetBlockSize(storage::DataLayout::TIMESTAMP),
|
||||||
|
m_timestamp.begin());
|
||||||
|
}
|
||||||
|
|
||||||
std::tie(m_coordinate_list, m_osmnodeid_list) =
|
void InitializeChecksumPointer(storage::DataLayout &data_layout, char *memory_block)
|
||||||
make_nbn_data_view(index, "/common/nbn_data");
|
{
|
||||||
|
m_check_sum =
|
||||||
|
*data_layout.GetBlockPtr<unsigned>(memory_block, storage::DataLayout::HSGR_CHECKSUM);
|
||||||
|
util::Log() << "set checksum: " << m_check_sum;
|
||||||
|
}
|
||||||
|
|
||||||
m_static_rtree = make_search_tree_view(index, "/common/rtree");
|
void InitializeRTreePointers(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
BOOST_ASSERT_MSG(!m_coordinate_list.empty(), "coordinates must be loaded before r-tree");
|
||||||
|
|
||||||
|
const auto file_index_ptr =
|
||||||
|
data_layout.GetBlockPtr<char>(memory_block, storage::DataLayout::FILE_INDEX_PATH);
|
||||||
|
file_index_path = boost::filesystem::path(file_index_ptr);
|
||||||
|
if (!boost::filesystem::exists(file_index_path))
|
||||||
|
{
|
||||||
|
util::Log(logDEBUG) << "Leaf file name " << file_index_path.string();
|
||||||
|
throw util::exception("Could not load " + file_index_path.string() +
|
||||||
|
"Is any data loaded into shared memory?" + SOURCE_REF);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto tree_nodes_ptr =
|
||||||
|
data_layout.GetBlockPtr<RTreeNode>(memory_block, storage::DataLayout::R_SEARCH_TREE);
|
||||||
|
auto tree_level_sizes_ptr = data_layout.GetBlockPtr<std::uint64_t>(
|
||||||
|
memory_block, storage::DataLayout::R_SEARCH_TREE_LEVELS);
|
||||||
|
m_static_rtree.reset(
|
||||||
|
new SharedRTree(tree_nodes_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::R_SEARCH_TREE],
|
||||||
|
tree_level_sizes_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::R_SEARCH_TREE_LEVELS],
|
||||||
|
file_index_path,
|
||||||
|
m_coordinate_list));
|
||||||
m_geospatial_query.reset(
|
m_geospatial_query.reset(
|
||||||
new SharedGeospatialQuery(m_static_rtree, m_coordinate_list, *this));
|
new SharedGeospatialQuery(*m_static_rtree, m_coordinate_list, *this));
|
||||||
|
}
|
||||||
|
|
||||||
edge_based_node_data = make_ebn_data_view(index, "/common/ebg_node_data");
|
void InitializeNodeInformationPointers(storage::DataLayout &layout, char *memory_ptr)
|
||||||
|
{
|
||||||
|
const auto coordinate_list_ptr =
|
||||||
|
layout.GetBlockPtr<util::Coordinate>(memory_ptr, storage::DataLayout::COORDINATE_LIST);
|
||||||
|
m_coordinate_list.reset(coordinate_list_ptr,
|
||||||
|
layout.num_entries[storage::DataLayout::COORDINATE_LIST]);
|
||||||
|
|
||||||
turn_data = make_turn_data_view(index, "/common/turn_data");
|
const auto osmnodeid_ptr = layout.GetBlockPtr<extractor::PackedOSMIDsView::block_type>(
|
||||||
|
memory_ptr, storage::DataLayout::OSM_NODE_ID_LIST);
|
||||||
|
m_osmnodeid_list = extractor::PackedOSMIDsView(
|
||||||
|
util::vector_view<extractor::PackedOSMIDsView::block_type>(
|
||||||
|
osmnodeid_ptr, layout.num_entries[storage::DataLayout::OSM_NODE_ID_LIST]),
|
||||||
|
// We (ab)use the number of coordinates here because we know we have the same amount of
|
||||||
|
// ids
|
||||||
|
layout.num_entries[storage::DataLayout::COORDINATE_LIST]);
|
||||||
|
}
|
||||||
|
|
||||||
m_name_table = make_name_table_view(index, "/common/names");
|
void InitializeEdgeBasedNodeDataInformationPointers(storage::DataLayout &layout,
|
||||||
|
char *memory_ptr)
|
||||||
|
{
|
||||||
|
const auto edge_based_node_list_ptr = layout.GetBlockPtr<extractor::EdgeBasedNode>(
|
||||||
|
memory_ptr, storage::DataLayout::EDGE_BASED_NODE_DATA_LIST);
|
||||||
|
util::vector_view<extractor::EdgeBasedNode> edge_based_node_data_list(
|
||||||
|
edge_based_node_list_ptr,
|
||||||
|
layout.num_entries[storage::DataLayout::EDGE_BASED_NODE_DATA_LIST]);
|
||||||
|
|
||||||
std::tie(m_lane_description_offsets, m_lane_description_masks) =
|
const auto annotation_data_list_ptr =
|
||||||
make_turn_lane_description_views(index, "/common/turn_lanes");
|
layout.GetBlockPtr<extractor::NodeBasedEdgeAnnotation>(
|
||||||
m_lane_tupel_id_pairs = make_lane_data_view(index, "/common/turn_lanes");
|
memory_ptr, storage::DataLayout::ANNOTATION_DATA_LIST);
|
||||||
|
util::vector_view<extractor::NodeBasedEdgeAnnotation> annotation_data(
|
||||||
|
annotation_data_list_ptr,
|
||||||
|
layout.num_entries[storage::DataLayout::ANNOTATION_DATA_LIST]);
|
||||||
|
|
||||||
m_turn_weight_penalties = make_turn_weight_view(index, "/common/turn_penalty");
|
edge_based_node_data = extractor::EdgeBasedNodeDataView(
|
||||||
m_turn_duration_penalties = make_turn_duration_view(index, "/common/turn_penalty");
|
std::move(edge_based_node_data_list), std::move(annotation_data));
|
||||||
|
}
|
||||||
|
|
||||||
segment_data = make_segment_data_view(index, "/common/segment_data");
|
void InitializeEdgeInformationPointers(storage::DataLayout &layout, char *memory_ptr)
|
||||||
|
{
|
||||||
|
const auto lane_data_id_ptr =
|
||||||
|
layout.GetBlockPtr<LaneDataID>(memory_ptr, storage::DataLayout::LANE_DATA_ID);
|
||||||
|
util::vector_view<LaneDataID> lane_data_ids(
|
||||||
|
lane_data_id_ptr, layout.num_entries[storage::DataLayout::LANE_DATA_ID]);
|
||||||
|
|
||||||
m_datasources = index.GetBlockPtr<extractor::Datasources>("/common/data_sources_names");
|
const auto turn_instruction_list_ptr =
|
||||||
|
layout.GetBlockPtr<extractor::guidance::TurnInstruction>(
|
||||||
|
memory_ptr, storage::DataLayout::TURN_INSTRUCTION);
|
||||||
|
util::vector_view<extractor::guidance::TurnInstruction> turn_instructions(
|
||||||
|
turn_instruction_list_ptr, layout.num_entries[storage::DataLayout::TURN_INSTRUCTION]);
|
||||||
|
|
||||||
intersection_bearings_view =
|
const auto entry_class_id_list_ptr =
|
||||||
make_intersection_bearings_view(index, "/common/intersection_bearings");
|
layout.GetBlockPtr<EntryClassID>(memory_ptr, storage::DataLayout::ENTRY_CLASSID);
|
||||||
|
util::vector_view<EntryClassID> entry_class_ids(
|
||||||
|
entry_class_id_list_ptr, layout.num_entries[storage::DataLayout::ENTRY_CLASSID]);
|
||||||
|
|
||||||
m_entry_class_table = make_entry_classes_view(index, "/common/entry_classes");
|
const auto pre_turn_bearing_ptr = layout.GetBlockPtr<util::guidance::TurnBearing>(
|
||||||
|
memory_ptr, storage::DataLayout::PRE_TURN_BEARING);
|
||||||
|
util::vector_view<util::guidance::TurnBearing> pre_turn_bearings(
|
||||||
|
pre_turn_bearing_ptr, layout.num_entries[storage::DataLayout::PRE_TURN_BEARING]);
|
||||||
|
|
||||||
std::tie(m_maneuver_overrides, m_maneuver_override_node_sequences) =
|
const auto post_turn_bearing_ptr = layout.GetBlockPtr<util::guidance::TurnBearing>(
|
||||||
make_maneuver_overrides_views(index, "/common/maneuver_overrides");
|
memory_ptr, storage::DataLayout::POST_TURN_BEARING);
|
||||||
|
util::vector_view<util::guidance::TurnBearing> post_turn_bearings(
|
||||||
|
post_turn_bearing_ptr, layout.num_entries[storage::DataLayout::POST_TURN_BEARING]);
|
||||||
|
|
||||||
|
turn_data = extractor::TurnDataView(std::move(turn_instructions),
|
||||||
|
std::move(lane_data_ids),
|
||||||
|
std::move(entry_class_ids),
|
||||||
|
std::move(pre_turn_bearings),
|
||||||
|
std::move(post_turn_bearings));
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeNamePointers(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
auto name_data_ptr =
|
||||||
|
data_layout.GetBlockPtr<char>(memory_block, storage::DataLayout::NAME_CHAR_DATA);
|
||||||
|
const auto name_data_size = data_layout.num_entries[storage::DataLayout::NAME_CHAR_DATA];
|
||||||
|
m_name_table.reset(name_data_ptr, name_data_ptr + name_data_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeTurnLaneDescriptionsPointers(storage::DataLayout &data_layout,
|
||||||
|
char *memory_block)
|
||||||
|
{
|
||||||
|
auto offsets_ptr = data_layout.GetBlockPtr<std::uint32_t>(
|
||||||
|
memory_block, storage::DataLayout::LANE_DESCRIPTION_OFFSETS);
|
||||||
|
util::vector_view<std::uint32_t> offsets(
|
||||||
|
offsets_ptr, data_layout.num_entries[storage::DataLayout::LANE_DESCRIPTION_OFFSETS]);
|
||||||
|
m_lane_description_offsets = std::move(offsets);
|
||||||
|
|
||||||
|
auto masks_ptr = data_layout.GetBlockPtr<extractor::guidance::TurnLaneType::Mask>(
|
||||||
|
memory_block, storage::DataLayout::LANE_DESCRIPTION_MASKS);
|
||||||
|
|
||||||
|
util::vector_view<extractor::guidance::TurnLaneType::Mask> masks(
|
||||||
|
masks_ptr, data_layout.num_entries[storage::DataLayout::LANE_DESCRIPTION_MASKS]);
|
||||||
|
m_lane_description_masks = std::move(masks);
|
||||||
|
|
||||||
|
const auto lane_tupel_id_pair_ptr =
|
||||||
|
data_layout.GetBlockPtr<util::guidance::LaneTupleIdPair>(
|
||||||
|
memory_block, storage::DataLayout::TURN_LANE_DATA);
|
||||||
|
util::vector_view<util::guidance::LaneTupleIdPair> lane_tupel_id_pair(
|
||||||
|
lane_tupel_id_pair_ptr, data_layout.num_entries[storage::DataLayout::TURN_LANE_DATA]);
|
||||||
|
m_lane_tupel_id_pairs = std::move(lane_tupel_id_pair);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeTurnPenalties(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
auto turn_weight_penalties_ptr = data_layout.GetBlockPtr<TurnPenalty>(
|
||||||
|
memory_block, storage::DataLayout::TURN_WEIGHT_PENALTIES);
|
||||||
|
m_turn_weight_penalties = util::vector_view<TurnPenalty>(
|
||||||
|
turn_weight_penalties_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::TURN_WEIGHT_PENALTIES]);
|
||||||
|
auto turn_duration_penalties_ptr = data_layout.GetBlockPtr<TurnPenalty>(
|
||||||
|
memory_block, storage::DataLayout::TURN_DURATION_PENALTIES);
|
||||||
|
m_turn_duration_penalties = util::vector_view<TurnPenalty>(
|
||||||
|
turn_duration_penalties_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::TURN_DURATION_PENALTIES]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeGeometryPointers(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
auto geometries_index_ptr =
|
||||||
|
data_layout.GetBlockPtr<unsigned>(memory_block, storage::DataLayout::GEOMETRIES_INDEX);
|
||||||
|
util::vector_view<unsigned> geometry_begin_indices(
|
||||||
|
geometries_index_ptr, data_layout.num_entries[storage::DataLayout::GEOMETRIES_INDEX]);
|
||||||
|
|
||||||
|
auto num_entries = data_layout.num_entries[storage::DataLayout::GEOMETRIES_NODE_LIST];
|
||||||
|
auto geometries_node_list_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
|
memory_block, storage::DataLayout::GEOMETRIES_NODE_LIST);
|
||||||
|
util::vector_view<NodeID> geometry_node_list(geometries_node_list_ptr, num_entries);
|
||||||
|
|
||||||
|
auto geometries_fwd_weight_list_ptr =
|
||||||
|
data_layout.GetBlockPtr<extractor::SegmentDataView::SegmentWeightVector::block_type>(
|
||||||
|
memory_block, storage::DataLayout::GEOMETRIES_FWD_WEIGHT_LIST);
|
||||||
|
extractor::SegmentDataView::SegmentWeightVector geometry_fwd_weight_list(
|
||||||
|
util::vector_view<extractor::SegmentDataView::SegmentWeightVector::block_type>(
|
||||||
|
geometries_fwd_weight_list_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::GEOMETRIES_FWD_WEIGHT_LIST]),
|
||||||
|
num_entries);
|
||||||
|
|
||||||
|
auto geometries_rev_weight_list_ptr =
|
||||||
|
data_layout.GetBlockPtr<extractor::SegmentDataView::SegmentWeightVector::block_type>(
|
||||||
|
memory_block, storage::DataLayout::GEOMETRIES_REV_WEIGHT_LIST);
|
||||||
|
extractor::SegmentDataView::SegmentWeightVector geometry_rev_weight_list(
|
||||||
|
util::vector_view<extractor::SegmentDataView::SegmentWeightVector::block_type>(
|
||||||
|
geometries_rev_weight_list_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::GEOMETRIES_REV_WEIGHT_LIST]),
|
||||||
|
num_entries);
|
||||||
|
|
||||||
|
auto geometries_fwd_duration_list_ptr =
|
||||||
|
data_layout.GetBlockPtr<extractor::SegmentDataView::SegmentDurationVector::block_type>(
|
||||||
|
memory_block, storage::DataLayout::GEOMETRIES_FWD_DURATION_LIST);
|
||||||
|
extractor::SegmentDataView::SegmentDurationVector geometry_fwd_duration_list(
|
||||||
|
util::vector_view<extractor::SegmentDataView::SegmentDurationVector::block_type>(
|
||||||
|
geometries_fwd_duration_list_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::GEOMETRIES_FWD_DURATION_LIST]),
|
||||||
|
num_entries);
|
||||||
|
|
||||||
|
auto geometries_rev_duration_list_ptr =
|
||||||
|
data_layout.GetBlockPtr<extractor::SegmentDataView::SegmentDurationVector::block_type>(
|
||||||
|
memory_block, storage::DataLayout::GEOMETRIES_REV_DURATION_LIST);
|
||||||
|
extractor::SegmentDataView::SegmentDurationVector geometry_rev_duration_list(
|
||||||
|
util::vector_view<extractor::SegmentDataView::SegmentDurationVector::block_type>(
|
||||||
|
geometries_rev_duration_list_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::GEOMETRIES_REV_DURATION_LIST]),
|
||||||
|
num_entries);
|
||||||
|
|
||||||
|
auto geometries_fwd_datasources_list_ptr = data_layout.GetBlockPtr<DatasourceID>(
|
||||||
|
memory_block, storage::DataLayout::GEOMETRIES_FWD_DATASOURCES_LIST);
|
||||||
|
util::vector_view<DatasourceID> geometry_fwd_datasources_list(
|
||||||
|
geometries_fwd_datasources_list_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::GEOMETRIES_FWD_DATASOURCES_LIST]);
|
||||||
|
|
||||||
|
auto geometries_rev_datasources_list_ptr = data_layout.GetBlockPtr<DatasourceID>(
|
||||||
|
memory_block, storage::DataLayout::GEOMETRIES_REV_DATASOURCES_LIST);
|
||||||
|
util::vector_view<DatasourceID> geometry_rev_datasources_list(
|
||||||
|
geometries_rev_datasources_list_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::GEOMETRIES_REV_DATASOURCES_LIST]);
|
||||||
|
|
||||||
|
segment_data = extractor::SegmentDataView{std::move(geometry_begin_indices),
|
||||||
|
std::move(geometry_node_list),
|
||||||
|
std::move(geometry_fwd_weight_list),
|
||||||
|
std::move(geometry_rev_weight_list),
|
||||||
|
std::move(geometry_fwd_duration_list),
|
||||||
|
std::move(geometry_rev_duration_list),
|
||||||
|
std::move(geometry_fwd_datasources_list),
|
||||||
|
std::move(geometry_rev_datasources_list)};
|
||||||
|
|
||||||
|
m_datasources = data_layout.GetBlockPtr<extractor::Datasources>(
|
||||||
|
memory_block, storage::DataLayout::DATASOURCES_NAMES);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeIntersectionClassPointers(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
auto bearing_class_id_ptr = data_layout.GetBlockPtr<BearingClassID>(
|
||||||
|
memory_block, storage::DataLayout::BEARING_CLASSID);
|
||||||
|
util::vector_view<BearingClassID> bearing_class_id(
|
||||||
|
bearing_class_id_ptr, data_layout.num_entries[storage::DataLayout::BEARING_CLASSID]);
|
||||||
|
|
||||||
|
auto bearing_values_ptr = data_layout.GetBlockPtr<DiscreteBearing>(
|
||||||
|
memory_block, storage::DataLayout::BEARING_VALUES);
|
||||||
|
util::vector_view<DiscreteBearing> bearing_values(
|
||||||
|
bearing_values_ptr, data_layout.num_entries[storage::DataLayout::BEARING_VALUES]);
|
||||||
|
|
||||||
|
auto offsets_ptr =
|
||||||
|
data_layout.GetBlockPtr<unsigned>(memory_block, storage::DataLayout::BEARING_OFFSETS);
|
||||||
|
auto blocks_ptr =
|
||||||
|
data_layout.GetBlockPtr<IndexBlock>(memory_block, storage::DataLayout::BEARING_BLOCKS);
|
||||||
|
util::vector_view<unsigned> bearing_offsets(
|
||||||
|
offsets_ptr, data_layout.num_entries[storage::DataLayout::BEARING_OFFSETS]);
|
||||||
|
util::vector_view<IndexBlock> bearing_blocks(
|
||||||
|
blocks_ptr, data_layout.num_entries[storage::DataLayout::BEARING_BLOCKS]);
|
||||||
|
|
||||||
|
util::RangeTable<16, storage::Ownership::View> bearing_range_table(
|
||||||
|
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>(
|
||||||
|
memory_block, storage::DataLayout::ENTRY_CLASS);
|
||||||
|
util::vector_view<util::guidance::EntryClass> entry_class_table(
|
||||||
|
entry_class_ptr, data_layout.num_entries[storage::DataLayout::ENTRY_CLASS]);
|
||||||
|
m_entry_class_table = std::move(entry_class_table);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeInternalPointers(storage::DataLayout &data_layout,
|
||||||
|
char *memory_block,
|
||||||
|
const std::size_t exclude_index)
|
||||||
|
{
|
||||||
|
InitializeChecksumPointer(data_layout, memory_block);
|
||||||
|
InitializeNodeInformationPointers(data_layout, memory_block);
|
||||||
|
InitializeEdgeBasedNodeDataInformationPointers(data_layout, memory_block);
|
||||||
|
InitializeEdgeInformationPointers(data_layout, memory_block);
|
||||||
|
InitializeTurnPenalties(data_layout, memory_block);
|
||||||
|
InitializeGeometryPointers(data_layout, memory_block);
|
||||||
|
InitializeTimestampPointer(data_layout, memory_block);
|
||||||
|
InitializeNamePointers(data_layout, memory_block);
|
||||||
|
InitializeTurnLaneDescriptionsPointers(data_layout, memory_block);
|
||||||
|
InitializeProfilePropertiesPointer(data_layout, memory_block, exclude_index);
|
||||||
|
InitializeRTreePointers(data_layout, memory_block);
|
||||||
|
InitializeIntersectionClassPointers(data_layout, memory_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// allows switching between process_memory/shared_memory datafacade, based on the type of
|
// allows switching between process_memory/shared_memory datafacade, based on the type of
|
||||||
// allocator
|
// allocator
|
||||||
ContiguousInternalMemoryDataFacadeBase(std::shared_ptr<ContiguousBlockAllocator> allocator_,
|
ContiguousInternalMemoryDataFacadeBase(std::shared_ptr<ContiguousBlockAllocator> allocator_,
|
||||||
const std::string &metric_name,
|
|
||||||
const std::size_t exclude_index)
|
const std::size_t exclude_index)
|
||||||
: allocator(std::move(allocator_))
|
: allocator(std::move(allocator_))
|
||||||
{
|
{
|
||||||
InitializeInternalPointers(allocator->GetIndex(), metric_name, exclude_index);
|
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory(), exclude_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// node and edge information access
|
// node and edge information access
|
||||||
@@ -239,63 +538,78 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return m_osmnodeid_list[id];
|
return m_osmnodeid_list[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeForwardRange GetUncompressedForwardGeometry(const EdgeID id) const override final
|
std::vector<NodeID> GetUncompressedForwardGeometry(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetForwardGeometry(id);
|
|
||||||
|
auto range = segment_data.GetForwardGeometry(id);
|
||||||
|
return std::vector<NodeID>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeReverseRange GetUncompressedReverseGeometry(const EdgeID id) const override final
|
virtual std::vector<NodeID> GetUncompressedReverseGeometry(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetReverseGeometry(id);
|
auto range = segment_data.GetReverseGeometry(id);
|
||||||
|
return std::vector<NodeID>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
DurationForwardRange GetUncompressedForwardDurations(const EdgeID id) const override final
|
virtual std::vector<EdgeWeight>
|
||||||
|
GetUncompressedForwardDurations(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetForwardDurations(id);
|
auto range = segment_data.GetForwardDurations(id);
|
||||||
|
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
DurationReverseRange GetUncompressedReverseDurations(const EdgeID id) const override final
|
virtual std::vector<EdgeWeight>
|
||||||
|
GetUncompressedReverseDurations(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetReverseDurations(id);
|
auto range = segment_data.GetReverseDurations(id);
|
||||||
|
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
WeightForwardRange GetUncompressedForwardWeights(const EdgeID id) const override final
|
virtual std::vector<EdgeWeight>
|
||||||
|
GetUncompressedForwardWeights(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetForwardWeights(id);
|
auto range = segment_data.GetForwardWeights(id);
|
||||||
|
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
WeightReverseRange GetUncompressedReverseWeights(const EdgeID id) const override final
|
virtual std::vector<EdgeWeight>
|
||||||
|
GetUncompressedReverseWeights(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetReverseWeights(id);
|
auto range = segment_data.GetReverseWeights(id);
|
||||||
|
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the data source ids that were used to supply the edge
|
// Returns the data source ids that were used to supply the edge
|
||||||
// weights.
|
// weights.
|
||||||
DatasourceForwardRange GetUncompressedForwardDatasources(const EdgeID id) const override final
|
virtual std::vector<DatasourceID>
|
||||||
|
GetUncompressedForwardDatasources(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetForwardDatasources(id);
|
auto range = segment_data.GetForwardDatasources(id);
|
||||||
|
return std::vector<DatasourceID>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the data source ids that were used to supply the edge
|
// Returns the data source ids that were used to supply the edge
|
||||||
// weights.
|
// weights.
|
||||||
DatasourceReverseRange GetUncompressedReverseDatasources(const EdgeID id) const override final
|
virtual std::vector<DatasourceID>
|
||||||
|
GetUncompressedReverseDatasources(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return segment_data.GetReverseDatasources(id);
|
auto range = segment_data.GetReverseDatasources(id);
|
||||||
|
return std::vector<DatasourceID>{range.begin(), range.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
TurnPenalty GetWeightPenaltyForEdgeID(const unsigned id) const override final
|
virtual TurnPenalty GetWeightPenaltyForEdgeID(const unsigned id) const override final
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(m_turn_weight_penalties.size() > id);
|
BOOST_ASSERT(m_turn_weight_penalties.size() > id);
|
||||||
return m_turn_weight_penalties[id];
|
return m_turn_weight_penalties[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
TurnPenalty GetDurationPenaltyForEdgeID(const unsigned id) const override final
|
virtual TurnPenalty GetDurationPenaltyForEdgeID(const unsigned id) const override final
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(m_turn_duration_penalties.size() > id);
|
BOOST_ASSERT(m_turn_duration_penalties.size() > id);
|
||||||
return m_turn_duration_penalties[id];
|
return m_turn_duration_penalties[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
osrm::guidance::TurnInstruction
|
extractor::guidance::TurnInstruction
|
||||||
GetTurnInstructionForEdgeID(const EdgeID id) const override final
|
GetTurnInstructionForEdgeID(const EdgeID id) const override final
|
||||||
{
|
{
|
||||||
return turn_data.GetTurnInstruction(id);
|
return turn_data.GetTurnInstruction(id);
|
||||||
@@ -429,7 +743,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
input_coordinate, bearing, bearing_range, approach);
|
input_coordinate, bearing, bearing_range, approach);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::uint32_t GetCheckSum() const override final { return m_check_sum; }
|
unsigned GetCheckSum() const override final { return m_check_sum; }
|
||||||
|
|
||||||
GeometryID GetGeometryIndex(const NodeID id) const override final
|
GeometryID GetGeometryIndex(const NodeID id) const override final
|
||||||
{
|
{
|
||||||
@@ -502,6 +816,8 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return m_datasources->GetSourceName(id);
|
return m_datasources->GetSourceName(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetTimestamp() const override final { return m_timestamp; }
|
||||||
|
|
||||||
bool GetContinueStraightDefault() const override final
|
bool GetContinueStraightDefault() const override final
|
||||||
{
|
{
|
||||||
return m_profile_properties->continue_straight_at_waypoint;
|
return m_profile_properties->continue_straight_at_waypoint;
|
||||||
@@ -529,11 +845,11 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return intersection_bearings_view.GetBearingClass(node);
|
return intersection_bearings_view.GetBearingClass(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
guidance::TurnBearing PreTurnBearing(const EdgeID eid) const override final
|
util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const override final
|
||||||
{
|
{
|
||||||
return turn_data.GetPreTurnBearing(eid);
|
return turn_data.GetPreTurnBearing(eid);
|
||||||
}
|
}
|
||||||
guidance::TurnBearing PostTurnBearing(const EdgeID eid) const override final
|
util::guidance::TurnBearing PostTurnBearing(const EdgeID eid) const override final
|
||||||
{
|
{
|
||||||
return turn_data.GetPostTurnBearing(eid);
|
return turn_data.GetPostTurnBearing(eid);
|
||||||
}
|
}
|
||||||
@@ -552,13 +868,13 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return m_lane_tupel_id_pairs.at(turn_data.GetLaneDataID(id));
|
return m_lane_tupel_id_pairs.at(turn_data.GetLaneDataID(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
extractor::TurnLaneDescription
|
extractor::guidance::TurnLaneDescription
|
||||||
GetTurnDescription(const LaneDescriptionID lane_description_id) const override final
|
GetTurnDescription(const LaneDescriptionID lane_description_id) const override final
|
||||||
{
|
{
|
||||||
if (lane_description_id == INVALID_LANE_DESCRIPTIONID)
|
if (lane_description_id == INVALID_LANE_DESCRIPTIONID)
|
||||||
return {};
|
return {};
|
||||||
else
|
else
|
||||||
return extractor::TurnLaneDescription(
|
return extractor::guidance::TurnLaneDescription(
|
||||||
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id],
|
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id],
|
||||||
m_lane_description_masks.begin() +
|
m_lane_description_masks.begin() +
|
||||||
m_lane_description_offsets[lane_description_id + 1]);
|
m_lane_description_offsets[lane_description_id + 1]);
|
||||||
@@ -574,39 +890,6 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
{
|
{
|
||||||
return edge_based_node_data.IsSegregated(id);
|
return edge_based_node_data.IsSegregated(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<extractor::ManeuverOverride>
|
|
||||||
GetOverridesThatStartAt(const NodeID edge_based_node_id) const override final
|
|
||||||
{
|
|
||||||
std::vector<extractor::ManeuverOverride> results;
|
|
||||||
|
|
||||||
// heterogeneous comparison:
|
|
||||||
struct Comp
|
|
||||||
{
|
|
||||||
bool operator()(const extractor::StorageManeuverOverride &s, NodeID i) const
|
|
||||||
{
|
|
||||||
return s.start_node < i;
|
|
||||||
}
|
|
||||||
bool operator()(NodeID i, const extractor::StorageManeuverOverride &s) const
|
|
||||||
{
|
|
||||||
return i < s.start_node;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
auto found_range = std::equal_range(
|
|
||||||
m_maneuver_overrides.begin(), m_maneuver_overrides.end(), edge_based_node_id, Comp{});
|
|
||||||
|
|
||||||
std::for_each(found_range.first, found_range.second, [&](const auto & override) {
|
|
||||||
std::vector<NodeID> sequence(
|
|
||||||
m_maneuver_override_node_sequences.begin() + override.node_sequence_offset_begin,
|
|
||||||
m_maneuver_override_node_sequences.begin() + override.node_sequence_offset_end);
|
|
||||||
results.push_back(extractor::ManeuverOverride{std::move(sequence),
|
|
||||||
override.instruction_node,
|
|
||||||
override.override_type,
|
|
||||||
override.direction});
|
|
||||||
});
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename AlgorithmT> class ContiguousInternalMemoryDataFacade;
|
template <typename AlgorithmT> class ContiguousInternalMemoryDataFacade;
|
||||||
@@ -618,10 +901,9 @@ class ContiguousInternalMemoryDataFacade<CH>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ContiguousInternalMemoryDataFacade(std::shared_ptr<ContiguousBlockAllocator> allocator,
|
ContiguousInternalMemoryDataFacade(std::shared_ptr<ContiguousBlockAllocator> allocator,
|
||||||
const std::string &metric_name,
|
|
||||||
const std::size_t exclude_index)
|
const std::size_t exclude_index)
|
||||||
: ContiguousInternalMemoryDataFacadeBase(allocator, metric_name, exclude_index),
|
: ContiguousInternalMemoryDataFacadeBase(allocator, exclude_index),
|
||||||
ContiguousInternalMemoryAlgorithmDataFacade<CH>(allocator, metric_name, exclude_index)
|
ContiguousInternalMemoryAlgorithmDataFacade<CH>(allocator, exclude_index)
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -630,8 +912,8 @@ class ContiguousInternalMemoryDataFacade<CH>
|
|||||||
template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
|
template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
|
||||||
{
|
{
|
||||||
// MLD data
|
// MLD data
|
||||||
partitioner::MultiLevelPartitionView mld_partition;
|
partition::MultiLevelPartitionView mld_partition;
|
||||||
partitioner::CellStorageView mld_cell_storage;
|
partition::CellStorageView mld_cell_storage;
|
||||||
customizer::CellMetricView mld_cell_metric;
|
customizer::CellMetricView mld_cell_metric;
|
||||||
using QueryGraph = customizer::MultiLevelEdgeBasedGraphView;
|
using QueryGraph = customizer::MultiLevelEdgeBasedGraphView;
|
||||||
using GraphNode = QueryGraph::NodeArrayEntry;
|
using GraphNode = QueryGraph::NodeArrayEntry;
|
||||||
@@ -639,15 +921,122 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
|
|
||||||
QueryGraph query_graph;
|
QueryGraph query_graph;
|
||||||
|
|
||||||
void InitializeInternalPointers(const storage::SharedDataIndex &index,
|
void InitializeInternalPointers(storage::DataLayout &data_layout,
|
||||||
const std::string &metric_name,
|
char *memory_block,
|
||||||
const std::size_t exclude_index)
|
const std::size_t exclude_index)
|
||||||
{
|
{
|
||||||
mld_partition = make_partition_view(index, "/mld/multilevelpartition");
|
InitializeMLDDataPointers(data_layout, memory_block, exclude_index);
|
||||||
mld_cell_metric =
|
InitializeGraphPointer(data_layout, memory_block);
|
||||||
make_filtered_cell_metric_view(index, "/mld/metrics/" + metric_name, exclude_index);
|
}
|
||||||
mld_cell_storage = make_cell_storage_view(index, "/mld/cellstorage");
|
|
||||||
query_graph = make_multi_level_graph_view(index, "/mld/multilevelgraph");
|
void InitializeMLDDataPointers(storage::DataLayout &data_layout,
|
||||||
|
char *memory_block,
|
||||||
|
const std::size_t exclude_index)
|
||||||
|
{
|
||||||
|
if (data_layout.GetBlockSize(storage::DataLayout::MLD_PARTITION) > 0)
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_LEVEL_DATA) > 0);
|
||||||
|
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_TO_CHILDREN) > 0);
|
||||||
|
|
||||||
|
auto level_data =
|
||||||
|
data_layout.GetBlockPtr<partition::MultiLevelPartitionView::LevelData>(
|
||||||
|
memory_block, storage::DataLayout::MLD_LEVEL_DATA);
|
||||||
|
|
||||||
|
auto mld_partition_ptr = data_layout.GetBlockPtr<PartitionID>(
|
||||||
|
memory_block, storage::DataLayout::MLD_PARTITION);
|
||||||
|
auto partition_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_PARTITION);
|
||||||
|
util::vector_view<PartitionID> partition(mld_partition_ptr, partition_entries_count);
|
||||||
|
|
||||||
|
auto mld_chilren_ptr = data_layout.GetBlockPtr<CellID>(
|
||||||
|
memory_block, storage::DataLayout::MLD_CELL_TO_CHILDREN);
|
||||||
|
auto children_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_TO_CHILDREN);
|
||||||
|
util::vector_view<CellID> cell_to_children(mld_chilren_ptr, children_entries_count);
|
||||||
|
|
||||||
|
mld_partition =
|
||||||
|
partition::MultiLevelPartitionView{level_data, partition, cell_to_children};
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto weights_block_id = static_cast<storage::DataLayout::BlockID>(
|
||||||
|
storage::DataLayout::MLD_CELL_WEIGHTS_0 + exclude_index);
|
||||||
|
const auto durations_block_id = static_cast<storage::DataLayout::BlockID>(
|
||||||
|
storage::DataLayout::MLD_CELL_DURATIONS_0 + exclude_index);
|
||||||
|
|
||||||
|
if (data_layout.GetBlockSize(weights_block_id) > 0)
|
||||||
|
{
|
||||||
|
auto mld_cell_weights_ptr =
|
||||||
|
data_layout.GetBlockPtr<EdgeWeight>(memory_block, weights_block_id);
|
||||||
|
auto mld_cell_durations_ptr =
|
||||||
|
data_layout.GetBlockPtr<EdgeDuration>(memory_block, durations_block_id);
|
||||||
|
auto weight_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_WEIGHTS_0);
|
||||||
|
auto duration_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_DURATIONS_0);
|
||||||
|
BOOST_ASSERT(weight_entries_count == duration_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);
|
||||||
|
|
||||||
|
mld_cell_metric = customizer::CellMetricView{std::move(weights), std::move(durations)};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_layout.GetBlockSize(storage::DataLayout::MLD_CELLS) > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
auto mld_source_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
|
memory_block, storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
||||||
|
auto mld_destination_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
|
memory_block, storage::DataLayout::MLD_CELL_DESTINATION_BOUNDARY);
|
||||||
|
auto mld_cells_ptr = data_layout.GetBlockPtr<partition::CellStorageView::CellData>(
|
||||||
|
memory_block, storage::DataLayout::MLD_CELLS);
|
||||||
|
auto mld_cell_level_offsets_ptr = data_layout.GetBlockPtr<std::uint64_t>(
|
||||||
|
memory_block, storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
|
||||||
|
|
||||||
|
auto source_boundary_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
||||||
|
auto destination_boundary_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_DESTINATION_BOUNDARY);
|
||||||
|
auto cells_entries_counts = data_layout.GetBlockEntries(storage::DataLayout::MLD_CELLS);
|
||||||
|
auto cell_level_offsets_entries_count =
|
||||||
|
data_layout.GetBlockEntries(storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
|
||||||
|
|
||||||
|
util::vector_view<NodeID> source_boundary(mld_source_boundary_ptr,
|
||||||
|
source_boundary_entries_count);
|
||||||
|
util::vector_view<NodeID> destination_boundary(mld_destination_boundary_ptr,
|
||||||
|
destination_boundary_entries_count);
|
||||||
|
util::vector_view<partition::CellStorageView::CellData> cells(mld_cells_ptr,
|
||||||
|
cells_entries_counts);
|
||||||
|
util::vector_view<std::uint64_t> level_offsets(mld_cell_level_offsets_ptr,
|
||||||
|
cell_level_offsets_entries_count);
|
||||||
|
|
||||||
|
mld_cell_storage = partition::CellStorageView{std::move(source_boundary),
|
||||||
|
std::move(destination_boundary),
|
||||||
|
std::move(cells),
|
||||||
|
std::move(level_offsets)};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void InitializeGraphPointer(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
auto graph_nodes_ptr = data_layout.GetBlockPtr<GraphNode>(
|
||||||
|
memory_block, storage::DataLayout::MLD_GRAPH_NODE_LIST);
|
||||||
|
|
||||||
|
auto graph_edges_ptr = data_layout.GetBlockPtr<GraphEdge>(
|
||||||
|
memory_block, storage::DataLayout::MLD_GRAPH_EDGE_LIST);
|
||||||
|
|
||||||
|
auto graph_node_to_offset_ptr = data_layout.GetBlockPtr<QueryGraph::EdgeOffset>(
|
||||||
|
memory_block, storage::DataLayout::MLD_GRAPH_NODE_TO_OFFSET);
|
||||||
|
|
||||||
|
util::vector_view<GraphNode> node_list(
|
||||||
|
graph_nodes_ptr, data_layout.num_entries[storage::DataLayout::MLD_GRAPH_NODE_LIST]);
|
||||||
|
util::vector_view<GraphEdge> edge_list(
|
||||||
|
graph_edges_ptr, data_layout.num_entries[storage::DataLayout::MLD_GRAPH_EDGE_LIST]);
|
||||||
|
util::vector_view<QueryGraph::EdgeOffset> node_to_offset(
|
||||||
|
graph_node_to_offset_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::MLD_GRAPH_NODE_TO_OFFSET]);
|
||||||
|
|
||||||
|
query_graph =
|
||||||
|
QueryGraph(std::move(node_list), std::move(edge_list), std::move(node_to_offset));
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocator that keeps the allocation data
|
// allocator that keeps the allocation data
|
||||||
@@ -655,28 +1044,24 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ContiguousInternalMemoryAlgorithmDataFacade(
|
ContiguousInternalMemoryAlgorithmDataFacade(
|
||||||
std::shared_ptr<ContiguousBlockAllocator> allocator_,
|
std::shared_ptr<ContiguousBlockAllocator> allocator_, const std::size_t exclude_index)
|
||||||
const std::string &metric_name,
|
|
||||||
const std::size_t exclude_index)
|
|
||||||
: allocator(std::move(allocator_))
|
: allocator(std::move(allocator_))
|
||||||
{
|
{
|
||||||
InitializeInternalPointers(allocator->GetIndex(), metric_name, exclude_index);
|
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory(), exclude_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
const partitioner::MultiLevelPartitionView &GetMultiLevelPartition() const override
|
const partition::MultiLevelPartitionView &GetMultiLevelPartition() const override
|
||||||
{
|
{
|
||||||
return mld_partition;
|
return mld_partition;
|
||||||
}
|
}
|
||||||
|
|
||||||
const partitioner::CellStorageView &GetCellStorage() const override { return mld_cell_storage; }
|
const partition::CellStorageView &GetCellStorage() const override { return mld_cell_storage; }
|
||||||
|
|
||||||
const customizer::CellMetricView &GetCellMetric() const override { return mld_cell_metric; }
|
const customizer::CellMetricView &GetCellMetric() const override { return mld_cell_metric; }
|
||||||
|
|
||||||
// search graph access
|
// search graph access
|
||||||
unsigned GetNumberOfNodes() const override final { return query_graph.GetNumberOfNodes(); }
|
unsigned GetNumberOfNodes() const override final { return query_graph.GetNumberOfNodes(); }
|
||||||
|
|
||||||
unsigned GetMaxBorderNodeID() const override final { return query_graph.GetMaxBorderNodeID(); }
|
|
||||||
|
|
||||||
unsigned GetNumberOfEdges() const override final { return query_graph.GetNumberOfEdges(); }
|
unsigned GetNumberOfEdges() const override final { return query_graph.GetNumberOfEdges(); }
|
||||||
|
|
||||||
unsigned GetOutDegree(const NodeID n) const override final
|
unsigned GetOutDegree(const NodeID n) const override final
|
||||||
@@ -716,10 +1101,9 @@ class ContiguousInternalMemoryDataFacade<MLD> final
|
|||||||
private:
|
private:
|
||||||
public:
|
public:
|
||||||
ContiguousInternalMemoryDataFacade(std::shared_ptr<ContiguousBlockAllocator> allocator,
|
ContiguousInternalMemoryDataFacade(std::shared_ptr<ContiguousBlockAllocator> allocator,
|
||||||
const std::string &metric_name,
|
|
||||||
const std::size_t exclude_index)
|
const std::size_t exclude_index)
|
||||||
: ContiguousInternalMemoryDataFacadeBase(allocator, metric_name, exclude_index),
|
: ContiguousInternalMemoryDataFacadeBase(allocator, exclude_index),
|
||||||
ContiguousInternalMemoryAlgorithmDataFacade<MLD>(allocator, metric_name, exclude_index)
|
ContiguousInternalMemoryAlgorithmDataFacade<MLD>(allocator, exclude_index)
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,30 +10,24 @@
|
|||||||
|
|
||||||
#include "extractor/class_data.hpp"
|
#include "extractor/class_data.hpp"
|
||||||
#include "extractor/edge_based_node_segment.hpp"
|
#include "extractor/edge_based_node_segment.hpp"
|
||||||
#include "extractor/maneuver_override.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
|
#include "extractor/original_edge_data.hpp"
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/query_node.hpp"
|
||||||
#include "extractor/segment_data_container.hpp"
|
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "extractor/turn_lane_types.hpp"
|
|
||||||
|
|
||||||
#include "guidance/turn_bearing.hpp"
|
|
||||||
#include "guidance/turn_instruction.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"
|
||||||
|
#include "util/guidance/turn_bearing.hpp"
|
||||||
#include "util/guidance/turn_lanes.hpp"
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
#include "util/integer_range.hpp"
|
#include "util/integer_range.hpp"
|
||||||
#include "util/packed_vector.hpp"
|
|
||||||
#include "util/string_util.hpp"
|
#include "util/string_util.hpp"
|
||||||
#include "util/string_view.hpp"
|
#include "util/string_view.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include "osrm/coordinate.hpp"
|
#include "osrm/coordinate.hpp"
|
||||||
|
|
||||||
#include <boost/range/adaptor/reversed.hpp>
|
|
||||||
#include <boost/range/any_range.hpp>
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -53,27 +47,10 @@ class BaseDataFacade
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using RTreeLeaf = extractor::EdgeBasedNodeSegment;
|
using RTreeLeaf = extractor::EdgeBasedNodeSegment;
|
||||||
|
|
||||||
using NodeForwardRange =
|
|
||||||
boost::iterator_range<extractor::SegmentDataView::SegmentNodeVector::const_iterator>;
|
|
||||||
using NodeReverseRange = boost::reversed_range<const NodeForwardRange>;
|
|
||||||
|
|
||||||
using WeightForwardRange =
|
|
||||||
boost::iterator_range<extractor::SegmentDataView::SegmentWeightVector::const_iterator>;
|
|
||||||
using WeightReverseRange = boost::reversed_range<const WeightForwardRange>;
|
|
||||||
|
|
||||||
using DurationForwardRange =
|
|
||||||
boost::iterator_range<extractor::SegmentDataView::SegmentDurationVector::const_iterator>;
|
|
||||||
using DurationReverseRange = boost::reversed_range<const DurationForwardRange>;
|
|
||||||
|
|
||||||
using DatasourceForwardRange =
|
|
||||||
boost::iterator_range<extractor::SegmentDataView::SegmentDatasourceVector::const_iterator>;
|
|
||||||
using DatasourceReverseRange = boost::reversed_range<const DatasourceForwardRange>;
|
|
||||||
|
|
||||||
BaseDataFacade() {}
|
BaseDataFacade() {}
|
||||||
virtual ~BaseDataFacade() {}
|
virtual ~BaseDataFacade() {}
|
||||||
|
|
||||||
virtual std::uint32_t GetCheckSum() const = 0;
|
virtual unsigned GetCheckSum() const = 0;
|
||||||
|
|
||||||
// node and edge information access
|
// node and edge information access
|
||||||
virtual util::Coordinate GetCoordinateOfNode(const NodeID id) const = 0;
|
virtual util::Coordinate GetCoordinateOfNode(const NodeID id) const = 0;
|
||||||
@@ -84,8 +61,9 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual ComponentID GetComponentID(const NodeID id) const = 0;
|
virtual ComponentID GetComponentID(const NodeID id) const = 0;
|
||||||
|
|
||||||
virtual NodeForwardRange GetUncompressedForwardGeometry(const EdgeID id) const = 0;
|
virtual std::vector<NodeID> GetUncompressedForwardGeometry(const EdgeID id) const = 0;
|
||||||
virtual NodeReverseRange GetUncompressedReverseGeometry(const EdgeID id) const = 0;
|
|
||||||
|
virtual std::vector<NodeID> GetUncompressedReverseGeometry(const EdgeID id) const = 0;
|
||||||
|
|
||||||
virtual TurnPenalty GetWeightPenaltyForEdgeID(const unsigned id) const = 0;
|
virtual TurnPenalty GetWeightPenaltyForEdgeID(const unsigned id) const = 0;
|
||||||
|
|
||||||
@@ -93,23 +71,24 @@ class BaseDataFacade
|
|||||||
|
|
||||||
// Gets the weight values for each segment in an uncompressed geometry.
|
// Gets the weight values for each segment in an uncompressed geometry.
|
||||||
// Should always be 1 shorter than GetUncompressedGeometry
|
// Should always be 1 shorter than GetUncompressedGeometry
|
||||||
virtual WeightForwardRange GetUncompressedForwardWeights(const EdgeID id) const = 0;
|
virtual std::vector<EdgeWeight> GetUncompressedForwardWeights(const EdgeID id) const = 0;
|
||||||
virtual WeightReverseRange GetUncompressedReverseWeights(const EdgeID id) const = 0;
|
virtual std::vector<EdgeWeight> GetUncompressedReverseWeights(const EdgeID id) const = 0;
|
||||||
|
|
||||||
// Gets the duration values for each segment in an uncompressed geometry.
|
// Gets the duration values for each segment in an uncompressed geometry.
|
||||||
// Should always be 1 shorter than GetUncompressedGeometry
|
// Should always be 1 shorter than GetUncompressedGeometry
|
||||||
virtual DurationForwardRange GetUncompressedForwardDurations(const EdgeID id) const = 0;
|
virtual std::vector<EdgeWeight> GetUncompressedForwardDurations(const EdgeID id) const = 0;
|
||||||
virtual DurationReverseRange GetUncompressedReverseDurations(const EdgeID id) const = 0;
|
virtual std::vector<EdgeWeight> GetUncompressedReverseDurations(const EdgeID id) const = 0;
|
||||||
|
|
||||||
// Returns the data source ids that were used to supply the edge
|
// Returns the data source ids that were used to supply the edge
|
||||||
// weights. Will return an empty array when only the base profile is used.
|
// weights. Will return an empty array when only the base profile is used.
|
||||||
virtual DatasourceForwardRange GetUncompressedForwardDatasources(const EdgeID id) const = 0;
|
virtual std::vector<DatasourceID> GetUncompressedForwardDatasources(const EdgeID id) const = 0;
|
||||||
virtual DatasourceReverseRange GetUncompressedReverseDatasources(const EdgeID id) const = 0;
|
virtual std::vector<DatasourceID> GetUncompressedReverseDatasources(const EdgeID id) const = 0;
|
||||||
|
|
||||||
// Gets the name of a datasource
|
// Gets the name of a datasource
|
||||||
virtual StringView GetDatasourceName(const DatasourceID id) const = 0;
|
virtual StringView GetDatasourceName(const DatasourceID id) const = 0;
|
||||||
|
|
||||||
virtual osrm::guidance::TurnInstruction GetTurnInstructionForEdgeID(const EdgeID id) const = 0;
|
virtual extractor::guidance::TurnInstruction
|
||||||
|
GetTurnInstructionForEdgeID(const EdgeID id) const = 0;
|
||||||
|
|
||||||
virtual extractor::TravelMode GetTravelMode(const NodeID id) const = 0;
|
virtual extractor::TravelMode GetTravelMode(const NodeID id) const = 0;
|
||||||
|
|
||||||
@@ -177,7 +156,7 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual bool HasLaneData(const EdgeID id) const = 0;
|
virtual bool HasLaneData(const EdgeID id) const = 0;
|
||||||
virtual util::guidance::LaneTupleIdPair GetLaneData(const EdgeID id) const = 0;
|
virtual util::guidance::LaneTupleIdPair GetLaneData(const EdgeID id) const = 0;
|
||||||
virtual extractor::TurnLaneDescription
|
virtual extractor::guidance::TurnLaneDescription
|
||||||
GetTurnDescription(const LaneDescriptionID lane_description_id) const = 0;
|
GetTurnDescription(const LaneDescriptionID lane_description_id) const = 0;
|
||||||
|
|
||||||
virtual NameID GetNameIndex(const NodeID id) const = 0;
|
virtual NameID GetNameIndex(const NodeID id) const = 0;
|
||||||
@@ -192,6 +171,8 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual StringView GetExitsForID(const NameID id) const = 0;
|
virtual StringView GetExitsForID(const NameID id) const = 0;
|
||||||
|
|
||||||
|
virtual std::string GetTimestamp() const = 0;
|
||||||
|
|
||||||
virtual bool GetContinueStraightDefault() const = 0;
|
virtual bool GetContinueStraightDefault() const = 0;
|
||||||
|
|
||||||
virtual double GetMapMatchingMaxSpeed() const = 0;
|
virtual double GetMapMatchingMaxSpeed() const = 0;
|
||||||
@@ -202,8 +183,8 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual double GetWeightMultiplier() const = 0;
|
virtual double GetWeightMultiplier() const = 0;
|
||||||
|
|
||||||
virtual osrm::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const = 0;
|
virtual util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const = 0;
|
||||||
virtual osrm::guidance::TurnBearing PostTurnBearing(const EdgeID eid) const = 0;
|
virtual util::guidance::TurnBearing PostTurnBearing(const EdgeID eid) const = 0;
|
||||||
|
|
||||||
virtual util::guidance::BearingClass GetBearingClass(const NodeID node) const = 0;
|
virtual util::guidance::BearingClass GetBearingClass(const NodeID node) const = 0;
|
||||||
|
|
||||||
@@ -212,9 +193,6 @@ class BaseDataFacade
|
|||||||
virtual bool IsLeftHandDriving(const NodeID id) const = 0;
|
virtual bool IsLeftHandDriving(const NodeID id) const = 0;
|
||||||
|
|
||||||
virtual bool IsSegregated(const NodeID) const = 0;
|
virtual bool IsSegregated(const NodeID) const = 0;
|
||||||
|
|
||||||
virtual std::vector<extractor::ManeuverOverride>
|
|
||||||
GetOverridesThatStartAt(const NodeID edge_based_node_id) const = 0;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
#ifndef OSRM_ENGINE_DATAFACADE_MMAP_MEMORY_ALLOCATOR_HPP_
|
|
||||||
#define OSRM_ENGINE_DATAFACADE_MMAP_MEMORY_ALLOCATOR_HPP_
|
|
||||||
|
|
||||||
#include "engine/datafacade/contiguous_block_allocator.hpp"
|
|
||||||
|
|
||||||
#include "storage/storage_config.hpp"
|
|
||||||
|
|
||||||
#include "util/vector_view.hpp"
|
|
||||||
|
|
||||||
#include <boost/iostreams/device/mapped_file.hpp>
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace engine
|
|
||||||
{
|
|
||||||
namespace datafacade
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This allocator uses file backed mmap memory block as the data location.
|
|
||||||
*/
|
|
||||||
class MMapMemoryAllocator : public ContiguousBlockAllocator
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit MMapMemoryAllocator(const storage::StorageConfig &config,
|
|
||||||
const boost::filesystem::path &memory_file);
|
|
||||||
~MMapMemoryAllocator() override final;
|
|
||||||
|
|
||||||
// interface to give access to the datafacades
|
|
||||||
const storage::SharedDataIndex &GetIndex() override final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
storage::SharedDataIndex index;
|
|
||||||
util::vector_view<char> mapped_memory;
|
|
||||||
boost::iostreams::mapped_file mapped_memory_file;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace datafacade
|
|
||||||
} // namespace engine
|
|
||||||
} // namespace osrm
|
|
||||||
|
|
||||||
#endif // OSRM_ENGINE_DATAFACADE_SHARED_MEMORY_ALLOCATOR_HPP_
|
|
||||||
@@ -27,11 +27,12 @@ class ProcessMemoryAllocator : public ContiguousBlockAllocator
|
|||||||
~ProcessMemoryAllocator() override final;
|
~ProcessMemoryAllocator() override final;
|
||||||
|
|
||||||
// interface to give access to the datafacades
|
// interface to give access to the datafacades
|
||||||
const storage::SharedDataIndex &GetIndex() override final;
|
storage::DataLayout &GetLayout() override final;
|
||||||
|
char *GetMemory() override final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
storage::SharedDataIndex index;
|
|
||||||
std::unique_ptr<char[]> internal_memory;
|
std::unique_ptr<char[]> internal_memory;
|
||||||
|
std::unique_ptr<storage::DataLayout> internal_layout;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace datafacade
|
} // namespace datafacade
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "engine/datafacade/contiguous_block_allocator.hpp"
|
#include "engine/datafacade/contiguous_block_allocator.hpp"
|
||||||
|
|
||||||
#include "storage/shared_data_index.hpp"
|
#include "storage/shared_datatype.hpp"
|
||||||
#include "storage/shared_memory.hpp"
|
#include "storage/shared_memory.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -16,23 +16,22 @@ namespace datafacade
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This allocator uses an IPC shared memory block as the data location.
|
* This allocator uses an IPC shared memory block as the data location.
|
||||||
* Many SharedMemoryDataFacade objects can be created that point to the same shared
|
* Many SharedMemoryDataFacade objects can be created that point to the same shared
|
||||||
* memory block.
|
* memory block.
|
||||||
*/
|
*/
|
||||||
class SharedMemoryAllocator : public ContiguousBlockAllocator
|
class SharedMemoryAllocator : public ContiguousBlockAllocator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SharedMemoryAllocator(
|
explicit SharedMemoryAllocator(storage::SharedDataType data_region);
|
||||||
const std::vector<storage::SharedRegionRegister::ShmKey> &shm_keys);
|
|
||||||
~SharedMemoryAllocator() override final;
|
~SharedMemoryAllocator() override final;
|
||||||
|
|
||||||
// interface to give access to the datafacades
|
// interface to give access to the datafacades
|
||||||
const storage::SharedDataIndex &GetIndex() override final;
|
storage::DataLayout &GetLayout() override final;
|
||||||
|
char *GetMemory() override final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
storage::SharedDataIndex index;
|
std::unique_ptr<storage::SharedMemory> m_large_memory;
|
||||||
std::vector<std::unique_ptr<storage::SharedMemory>> memory_regions;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace datafacade
|
} // namespace datafacade
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
|
|||||||
DataFacadeFactory(std::shared_ptr<AllocatorT> allocator)
|
DataFacadeFactory(std::shared_ptr<AllocatorT> allocator)
|
||||||
: DataFacadeFactory(allocator, has_exclude_flags)
|
: DataFacadeFactory(allocator, has_exclude_flags)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT_MSG(facades.size() >= 1, "At least one datafacade is needed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ParameterT> std::shared_ptr<const Facade> Get(const ParameterT ¶ms) const
|
template <typename ParameterT> std::shared_ptr<const Facade> Get(const ParameterT ¶ms) const
|
||||||
@@ -46,33 +45,13 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
|
|||||||
template <typename AllocatorT>
|
template <typename AllocatorT>
|
||||||
DataFacadeFactory(std::shared_ptr<AllocatorT> allocator, std::true_type)
|
DataFacadeFactory(std::shared_ptr<AllocatorT> allocator, std::true_type)
|
||||||
{
|
{
|
||||||
const auto &index = allocator->GetIndex();
|
for (const auto index : util::irange<std::size_t>(0, facades.size()))
|
||||||
properties = index.template GetBlockPtr<extractor::ProfileProperties>("/common/properties");
|
|
||||||
const auto &metric_name = properties->GetWeightName();
|
|
||||||
|
|
||||||
std::vector<std::string> exclude_prefixes;
|
|
||||||
auto exclude_path = std::string("/") + routing_algorithms::identifier<AlgorithmT>() +
|
|
||||||
std::string("/metrics/") + metric_name + "/exclude/";
|
|
||||||
index.List(exclude_path, std::back_inserter(exclude_prefixes));
|
|
||||||
facades.resize(exclude_prefixes.size());
|
|
||||||
|
|
||||||
if (facades.empty())
|
|
||||||
{
|
{
|
||||||
throw util::exception(std::string("Could not find any metrics for ") +
|
facades[index] = std::make_shared<const Facade>(allocator, index);
|
||||||
routing_algorithms::name<AlgorithmT>() +
|
|
||||||
" in the data. Did you load the right dataset?");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &exclude_prefix : exclude_prefixes)
|
properties = allocator->GetLayout().template GetBlockPtr<extractor::ProfileProperties>(
|
||||||
{
|
allocator->GetMemory(), storage::DataLayout::PROPERTIES);
|
||||||
auto index_begin = exclude_prefix.find_last_of("/");
|
|
||||||
BOOST_ASSERT_MSG(index_begin != std::string::npos,
|
|
||||||
"The exclude prefix needs to be a valid data path.");
|
|
||||||
std::size_t index =
|
|
||||||
std::stoi(exclude_prefix.substr(index_begin + 1, exclude_prefix.size()));
|
|
||||||
BOOST_ASSERT(index >= 0 && index < facades.size());
|
|
||||||
facades[index] = std::make_shared<const Facade>(allocator, metric_name, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto index : util::irange<std::size_t>(0, properties->class_names.size()))
|
for (const auto index : util::irange<std::size_t>(0, properties->class_names.size()))
|
||||||
{
|
{
|
||||||
@@ -88,10 +67,7 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
|
|||||||
template <typename AllocatorT>
|
template <typename AllocatorT>
|
||||||
DataFacadeFactory(std::shared_ptr<AllocatorT> allocator, std::false_type)
|
DataFacadeFactory(std::shared_ptr<AllocatorT> allocator, std::false_type)
|
||||||
{
|
{
|
||||||
const auto &index = allocator->GetIndex();
|
facades[0] = std::make_shared<const Facade>(allocator, 0);
|
||||||
properties = index.template GetBlockPtr<extractor::ProfileProperties>("/common/properties");
|
|
||||||
const auto &metric_name = properties->GetWeightName();
|
|
||||||
facades.push_back(std::make_shared<const Facade>(allocator, metric_name, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<const Facade> Get(const api::TileParameters &, std::false_type) const
|
std::shared_ptr<const Facade> Get(const api::TileParameters &, std::false_type) const
|
||||||
@@ -148,7 +124,7 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::shared_ptr<const Facade>> facades;
|
std::array<std::shared_ptr<const Facade>, extractor::MAX_EXCLUDABLE_CLASSES> facades;
|
||||||
std::unordered_map<std::string, extractor::ClassData> name_to_class;
|
std::unordered_map<std::string, extractor::ClassData> name_to_class;
|
||||||
const extractor::ProfileProperties *properties = nullptr;
|
const extractor::ProfileProperties *properties = nullptr;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "engine/data_watchdog.hpp"
|
#include "engine/data_watchdog.hpp"
|
||||||
#include "engine/datafacade.hpp"
|
#include "engine/datafacade.hpp"
|
||||||
#include "engine/datafacade/contiguous_internalmem_datafacade.hpp"
|
#include "engine/datafacade/contiguous_internalmem_datafacade.hpp"
|
||||||
#include "engine/datafacade/mmap_memory_allocator.hpp"
|
|
||||||
#include "engine/datafacade/process_memory_allocator.hpp"
|
#include "engine/datafacade/process_memory_allocator.hpp"
|
||||||
#include "engine/datafacade_factory.hpp"
|
#include "engine/datafacade_factory.hpp"
|
||||||
|
|
||||||
@@ -26,31 +25,6 @@ template <typename AlgorithmT, template <typename A> class FacadeT> class DataFa
|
|||||||
virtual std::shared_ptr<const Facade> Get(const api::TileParameters &) const = 0;
|
virtual std::shared_ptr<const Facade> Get(const api::TileParameters &) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename AlgorithmT, template <typename A> class FacadeT>
|
|
||||||
class ExternalProvider final : public DataFacadeProvider<AlgorithmT, FacadeT>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
using Facade = typename DataFacadeProvider<AlgorithmT, FacadeT>::Facade;
|
|
||||||
|
|
||||||
ExternalProvider(const storage::StorageConfig &config,
|
|
||||||
const boost::filesystem::path &memory_file)
|
|
||||||
: facade_factory(std::make_shared<datafacade::MMapMemoryAllocator>(config, memory_file))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<const Facade> Get(const api::TileParameters ¶ms) const override final
|
|
||||||
{
|
|
||||||
return facade_factory.Get(params);
|
|
||||||
}
|
|
||||||
std::shared_ptr<const Facade> Get(const api::BaseParameters ¶ms) const override final
|
|
||||||
{
|
|
||||||
return facade_factory.Get(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
DataFacadeFactory<FacadeT, AlgorithmT> facade_factory;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename AlgorithmT, template <typename A> class FacadeT>
|
template <typename AlgorithmT, template <typename A> class FacadeT>
|
||||||
class ImmutableProvider final : public DataFacadeProvider<AlgorithmT, FacadeT>
|
class ImmutableProvider final : public DataFacadeProvider<AlgorithmT, FacadeT>
|
||||||
{
|
{
|
||||||
@@ -83,8 +57,6 @@ class WatchingProvider : public DataFacadeProvider<AlgorithmT, FacadeT>
|
|||||||
public:
|
public:
|
||||||
using Facade = typename DataFacadeProvider<AlgorithmT, FacadeT>::Facade;
|
using Facade = typename DataFacadeProvider<AlgorithmT, FacadeT>::Facade;
|
||||||
|
|
||||||
WatchingProvider(const std::string &dataset_name) : watchdog(dataset_name) {}
|
|
||||||
|
|
||||||
std::shared_ptr<const Facade> Get(const api::TileParameters ¶ms) const override final
|
std::shared_ptr<const Facade> Get(const api::TileParameters ¶ms) const override final
|
||||||
{
|
{
|
||||||
return watchdog.Get(params);
|
return watchdog.Get(params);
|
||||||
@@ -102,8 +74,6 @@ template <typename AlgorithmT>
|
|||||||
using WatchingProvider = detail::WatchingProvider<AlgorithmT, DataFacade>;
|
using WatchingProvider = detail::WatchingProvider<AlgorithmT, DataFacade>;
|
||||||
template <typename AlgorithmT>
|
template <typename AlgorithmT>
|
||||||
using ImmutableProvider = detail::ImmutableProvider<AlgorithmT, DataFacade>;
|
using ImmutableProvider = detail::ImmutableProvider<AlgorithmT, DataFacade>;
|
||||||
template <typename AlgorithmT>
|
|
||||||
using ExternalProvider = detail::ExternalProvider<AlgorithmT, DataFacade>;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+84
-17
@@ -7,6 +7,8 @@
|
|||||||
#include "engine/api/table_parameters.hpp"
|
#include "engine/api/table_parameters.hpp"
|
||||||
#include "engine/api/tile_parameters.hpp"
|
#include "engine/api/tile_parameters.hpp"
|
||||||
#include "engine/api/trip_parameters.hpp"
|
#include "engine/api/trip_parameters.hpp"
|
||||||
|
#include "engine/data_watchdog.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/plugins/match.hpp"
|
#include "engine/plugins/match.hpp"
|
||||||
@@ -17,7 +19,9 @@
|
|||||||
#include "engine/plugins/viaroute.hpp"
|
#include "engine/plugins/viaroute.hpp"
|
||||||
#include "engine/routing_algorithms.hpp"
|
#include "engine/routing_algorithms.hpp"
|
||||||
#include "engine/status.hpp"
|
#include "engine/status.hpp"
|
||||||
|
#include "util/exception.hpp"
|
||||||
|
#include "util/exception_utils.hpp"
|
||||||
|
#include "util/fingerprint.hpp"
|
||||||
#include "util/json_container.hpp"
|
#include "util/json_container.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -49,26 +53,19 @@ 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, config.max_alternatives), //
|
: 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), //
|
||||||
match_plugin(config.max_locations_map_matching, config.max_radius_map_matching), //
|
match_plugin(config.max_locations_map_matching), //
|
||||||
tile_plugin() //
|
tile_plugin() //
|
||||||
|
|
||||||
{
|
{
|
||||||
if (config.use_shared_memory)
|
if (config.use_shared_memory)
|
||||||
{
|
{
|
||||||
util::Log(logDEBUG) << "Using shared memory with name \"" << config.dataset_name
|
util::Log(logDEBUG) << "Using shared memory with algorithm "
|
||||||
<< "\" with algorithm " << routing_algorithms::name<Algorithm>();
|
<< routing_algorithms::name<Algorithm>();
|
||||||
facade_provider = std::make_unique<WatchingProvider<Algorithm>>(config.dataset_name);
|
facade_provider = std::make_unique<WatchingProvider<Algorithm>>();
|
||||||
}
|
|
||||||
else if (!config.memory_file.empty())
|
|
||||||
{
|
|
||||||
util::Log(logDEBUG) << "Using memory mapped filed at " << config.memory_file
|
|
||||||
<< " with algorithm " << routing_algorithms::name<Algorithm>();
|
|
||||||
facade_provider = std::make_unique<ExternalProvider<Algorithm>>(config.storage_config,
|
|
||||||
config.memory_file);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -119,6 +116,8 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
|||||||
return tile_plugin.HandleRequest(GetAlgorithms(params), params, result);
|
return tile_plugin.HandleRequest(GetAlgorithms(params), params, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool CheckCompatibility(const EngineConfig &config);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename ParametersT> auto GetAlgorithms(const ParametersT ¶ms) const
|
template <typename ParametersT> auto GetAlgorithms(const ParametersT ¶ms) const
|
||||||
{
|
{
|
||||||
@@ -134,6 +133,74 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
|||||||
const plugins::MatchPlugin match_plugin;
|
const plugins::MatchPlugin match_plugin;
|
||||||
const plugins::TilePlugin tile_plugin;
|
const plugins::TilePlugin tile_plugin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool Engine<routing_algorithms::ch::Algorithm>::CheckCompatibility(const EngineConfig &config)
|
||||||
|
{
|
||||||
|
if (config.use_shared_memory)
|
||||||
|
{
|
||||||
|
storage::SharedMonitor<storage::SharedDataTimestamp> barrier;
|
||||||
|
using mutex_type = typename decltype(barrier)::mutex_type;
|
||||||
|
boost::interprocess::scoped_lock<mutex_type> current_region_lock(barrier.get_mutex());
|
||||||
|
|
||||||
|
auto mem = storage::makeSharedMemory(barrier.data().region);
|
||||||
|
auto layout = reinterpret_cast<storage::DataLayout *>(mem->Ptr());
|
||||||
|
return layout->GetBlockSize(storage::DataLayout::CH_GRAPH_NODE_LIST) > 4 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::CH_GRAPH_EDGE_LIST) > 4;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!boost::filesystem::exists(config.storage_config.GetPath(".osrm.hsgr")))
|
||||||
|
return false;
|
||||||
|
storage::io::FileReader in(config.storage_config.GetPath(".osrm.hsgr"),
|
||||||
|
storage::io::FileReader::VerifyFingerprint);
|
||||||
|
|
||||||
|
auto size = in.GetSize();
|
||||||
|
return size > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool Engine<routing_algorithms::mld::Algorithm>::CheckCompatibility(const EngineConfig &config)
|
||||||
|
{
|
||||||
|
if (config.use_shared_memory)
|
||||||
|
{
|
||||||
|
storage::SharedMonitor<storage::SharedDataTimestamp> barrier;
|
||||||
|
using mutex_type = typename decltype(barrier)::mutex_type;
|
||||||
|
boost::interprocess::scoped_lock<mutex_type> current_region_lock(barrier.get_mutex());
|
||||||
|
|
||||||
|
auto mem = storage::makeSharedMemory(barrier.data().region);
|
||||||
|
auto layout = reinterpret_cast<storage::DataLayout *>(mem->Ptr());
|
||||||
|
// checks that all the needed memory blocks are populated
|
||||||
|
// DataLayout::MLD_CELL_SOURCE_BOUNDARY and DataLayout::MLD_CELL_DESTINATION_BOUNDARY
|
||||||
|
// are not checked, because in situations where there are so few nodes in the graph that
|
||||||
|
// they all fit into one cell, they can be empty.
|
||||||
|
bool empty_data = layout->GetBlockSize(storage::DataLayout::MLD_LEVEL_DATA) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_PARTITION) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_CELL_TO_CHILDREN) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_CELLS) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_CELL_LEVEL_OFFSETS) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_GRAPH_NODE_LIST) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_GRAPH_EDGE_LIST) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_CELL_WEIGHTS_0) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_CELL_DURATIONS_0) > 0 &&
|
||||||
|
layout->GetBlockSize(storage::DataLayout::MLD_GRAPH_NODE_TO_OFFSET) > 0;
|
||||||
|
return empty_data;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!boost::filesystem::exists(config.storage_config.GetPath(".osrm.partition")) ||
|
||||||
|
!boost::filesystem::exists(config.storage_config.GetPath(".osrm.cells")) ||
|
||||||
|
!boost::filesystem::exists(config.storage_config.GetPath(".osrm.mldgr")) ||
|
||||||
|
!boost::filesystem::exists(config.storage_config.GetPath(".osrm.cell_metrics")))
|
||||||
|
return false;
|
||||||
|
storage::io::FileReader in(config.storage_config.GetPath(".osrm.partition"),
|
||||||
|
storage::io::FileReader::VerifyFingerprint);
|
||||||
|
|
||||||
|
auto size = in.GetSize();
|
||||||
|
return size > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,14 +84,11 @@ struct EngineConfig final
|
|||||||
int max_locations_viaroute = -1;
|
int max_locations_viaroute = -1;
|
||||||
int max_locations_distance_table = -1;
|
int max_locations_distance_table = -1;
|
||||||
int max_locations_map_matching = -1;
|
int max_locations_map_matching = -1;
|
||||||
double max_radius_map_matching = -1.0;
|
|
||||||
int max_results_nearest = -1;
|
int max_results_nearest = -1;
|
||||||
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
|
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
|
||||||
bool use_shared_memory = true;
|
bool use_shared_memory = true;
|
||||||
boost::filesystem::path memory_file;
|
|
||||||
Algorithm algorithm = Algorithm::CH;
|
Algorithm algorithm = Algorithm::CH;
|
||||||
std::string verbosity;
|
std::string verbosity;
|
||||||
std::string dataset_name;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user