Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba095c8566 | |||
| c1fd02bb8d | |||
| 54d02fac15 | |||
| 0a1418c766 | |||
| 1d367ccc0d | |||
| 860c452b83 | |||
| 3b096963a0 | |||
| 7154ed9d59 | |||
| 8f633e61bf | |||
| 86dd319d29 | |||
| 89d32eca94 | |||
| f5120d1cec | |||
| d30d28cf4a | |||
| 87de37168b | |||
| 658b8ef738 | |||
| a2c7f82ec8 | |||
| be49ed3e91 | |||
| 6763d4c097 | |||
| 6d2860e909 | |||
| d2764bc405 | |||
| 005a146223 | |||
| 02754647f4 | |||
| 82cebfa1f8 | |||
| 986bb6f93d | |||
| 0c0ab78f13 | |||
| 99cda66b58 | |||
| 27fa2fc1d0 | |||
| 7434f18d04 | |||
| 7d1a12a12d | |||
| 6d7420e4e5 | |||
| 8a44660102 | |||
| 0da2029d2d | |||
| e82b51d0cb | |||
| 5531cace7f | |||
| 1aed13500d | |||
| f6db8ff3b0 | |||
| 26e5c4eae2 | |||
| bee3bdb576 | |||
| b96d36f482 | |||
| d13d6566f8 | |||
| aa1048154c | |||
| 6c2d26f9bd | |||
| 84845ffaa6 | |||
| f65958fc14 | |||
| 3d6b667997 | |||
| 97d027a173 | |||
| f48dd665ad | |||
| eb1e83858a | |||
| 371dc57dfc | |||
| 425a46fe78 | |||
| fa553659de | |||
| 03cffd0f56 | |||
| a06d1782c0 | |||
| 05f6b55036 | |||
| fa8d788bb6 | |||
| 92b7d581ce | |||
| 19651c3d91 | |||
| b4cfc8d6e0 | |||
| 71cfb03738 | |||
| e7bb612050 | |||
| 83d7a57b73 | |||
| cac310123b | |||
| bb71d9b28a | |||
| ea4d0fa1dd | |||
| 91561992a7 | |||
| a3ea825a11 | |||
| 7ebbd5cebe | |||
| 9e93f198ae | |||
| 10de243556 | |||
| 988b6e3311 | |||
| 36877e4de5 | |||
| 1794185d43 | |||
| de938df560 | |||
| e02c5c3c6d | |||
| 90ff725125 | |||
| 1cbfbd34cf | |||
| c6d12e064c | |||
| 30ed1fae99 | |||
| 2987292cc0 | |||
| 8114104a43 | |||
| 03f598b93d | |||
| 5a844f4b7d | |||
| 91e6d68604 | |||
| 1119a542d6 | |||
| d706696179 | |||
| c154875272 | |||
| 77f8a4f741 | |||
| 61e06fcaba | |||
| 13bb997525 | |||
| 350bc6f756 | |||
| 02712cd513 | |||
| a9d94d35a2 | |||
| 155772f01f | |||
| 341a5345da | |||
| 72de59ac91 | |||
| a7f1cd36fb | |||
| 26f0b4dc77 | |||
| 181eff29c7 | |||
| cdad265d49 | |||
| 6eb4247484 | |||
| 72a23645a8 | |||
| c3e06356d6 | |||
| 7a8390e68e |
@@ -2,13 +2,18 @@
|
|||||||
|
|
||||||
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))
|
- [ ] 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 regression / cucumber cases (see docs/testing.md)
|
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/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?
|
||||||
|
|||||||
+58
-115
@@ -12,7 +12,8 @@ notifications:
|
|||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- 5.15
|
- master
|
||||||
|
- "5.16"
|
||||||
# enable building tags
|
# enable building tags
|
||||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||||
|
|
||||||
@@ -64,12 +65,12 @@ matrix:
|
|||||||
after_success:
|
after_success:
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-debug-cov"
|
compiler: "gcc-7-debug-cov"
|
||||||
addons: &gcc6
|
addons: &gcc7
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'lcov']
|
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'lcov']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' 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
|
||||||
@@ -83,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-6-debug-asan"
|
compiler: "gcc-7-debug-asan"
|
||||||
addons: &gcc6
|
addons: &gcc7
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
env: CCOMPILER='gcc-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"
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "clang-4.0-debug"
|
compiler: "clang-5.0-debug"
|
||||||
addons: &clang40
|
addons: &clang50
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "mason-linux-debug-asan"
|
compiler: "mason-linux-debug-asan"
|
||||||
@@ -104,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='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
env: CLANG_VERSION='5.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
|
||||||
@@ -113,80 +114,70 @@ 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='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-release"
|
compiler: "gcc-7-release"
|
||||||
addons: &gcc6
|
addons: &gcc7
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-release-i686"
|
compiler: "gcc-7-release-i686"
|
||||||
env: >
|
env: >
|
||||||
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-stxxl"
|
compiler: "gcc-7-stxxl"
|
||||||
addons: &gcc6
|
addons: &gcc7
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-7', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' ENABLE_STXXL=On
|
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' ENABLE_STXXL=On
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-4.9-release"
|
compiler: "gcc-5-release"
|
||||||
addons: &gcc49
|
addons: &gcc49
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'ccache']
|
packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||||
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: "gcc-6-release"
|
||||||
|
addons: &gcc49
|
||||||
|
apt:
|
||||||
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||||
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode8.2
|
osx_image: xcode9.2
|
||||||
compiler: "mason-osx-release"
|
compiler: "mason-osx-release-node-8"
|
||||||
|
# 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-6-release-shared"
|
compiler: "gcc-7-release-shared"
|
||||||
addons: &gcc6
|
addons: &gcc7
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' 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
|
||||||
@@ -196,7 +187,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='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
- |
|
- |
|
||||||
@@ -215,60 +206,12 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: false
|
sudo: false
|
||||||
compiler: "node-4-mason-linux-release"
|
compiler: "node-4-mason-linux-debug"
|
||||||
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='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
|
||||||
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}
|
||||||
- |
|
- |
|
||||||
@@ -292,7 +235,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='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
env: CLANG_VERSION='5.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}
|
||||||
- |
|
- |
|
||||||
@@ -311,12 +254,12 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: false
|
sudo: false
|
||||||
compiler: "node-6-mason-linux-release"
|
compiler: "node-8-mason-linux-debug"
|
||||||
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='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
env: CLANG_VERSION='5.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}
|
||||||
- |
|
- |
|
||||||
@@ -431,7 +374,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/partition-tests
|
- ./unit_tests/partitioner-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
|
||||||
|
|||||||
+48
-5
@@ -1,20 +1,63 @@
|
|||||||
# 5.15.3
|
# 5.16.6
|
||||||
|
- Changes from 5.16.5:
|
||||||
|
- Bugfixes:
|
||||||
|
- FIXED: integer overflow in `DynamicGraph::Renumber` [#5021](https://github.com/Project-OSRM/osrm-backend/pull/5021)
|
||||||
|
|
||||||
|
# 5.16.5
|
||||||
|
- Changes from 5.16.4:
|
||||||
|
- Debug:
|
||||||
|
- ADDED: Made toEdges allocation more robust and add better memory usage debugging.
|
||||||
|
|
||||||
|
# 5.16.4
|
||||||
|
- Changes from 5.16.3:
|
||||||
|
- Bugfixes:
|
||||||
|
- 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)
|
||||||
|
|
||||||
|
# 5.16.3
|
||||||
|
- Changes from 5.16.2:
|
||||||
|
- FIXED: Remove the last short annotation segment in `trimShortSegments` [#4946](https://github.com/Project-OSRM/osrm-backend/pull/4946)
|
||||||
|
- 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)
|
||||||
|
|
||||||
|
# 5.16.2
|
||||||
|
- Changes from 5.16.1:
|
||||||
|
- Bugfixes:
|
||||||
|
- FIXED #4920: Use smaller range for U-turn angles in map-matching [#4920](https://github.com/Project-OSRM/osrm-backend/pull/4920)
|
||||||
|
|
||||||
|
# 5.16.1
|
||||||
|
- Changes from 5.16.0:
|
||||||
|
- Bugfixes
|
||||||
|
- FIXED #4909: deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909)
|
||||||
|
|
||||||
|
# 5.16.0
|
||||||
- Changes from 5.15.2:
|
- Changes from 5.15.2:
|
||||||
- Bugfixes: fix deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909)
|
- 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
|
# 5.15.2
|
||||||
- Changes from 5.15.1:
|
- Changes from 5.15.1:
|
||||||
- Features:
|
- Features:
|
||||||
- Exposed the waypoints parameter in the node bindings interface
|
- ADDED: Exposed the waypoints parameter in the node bindings interface
|
||||||
- Bugfixes:
|
- Bugfixes:
|
||||||
- Segfault causing bug in leg collapsing map matching when traversing edges in reverse
|
- FIXED: Segfault causing bug in leg collapsing map matching when traversing edges in reverse
|
||||||
|
|
||||||
# 5.15.1
|
# 5.15.1
|
||||||
- Changes from 5.15.0:
|
- Changes from 5.15.0:
|
||||||
- Bugfixes:
|
- Bugfixes:
|
||||||
- FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches
|
- FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches
|
||||||
- Guidance:
|
- Guidance:
|
||||||
- Set type of trivial intersections where classes change to Suppressed instead of NoTurn
|
- Set type of trivial intersections where classes change to Suppressed instead of NoTurn
|
||||||
|
|
||||||
# 5.15.0
|
# 5.15.0
|
||||||
- Changes from 5.14.3:
|
- Changes from 5.14.3:
|
||||||
|
|||||||
+27
-32
@@ -43,7 +43,6 @@ 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")
|
||||||
|
|
||||||
@@ -61,8 +60,8 @@ if (POLICY CMP0048)
|
|||||||
endif()
|
endif()
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
set(OSRM_VERSION_MINOR 15)
|
set(OSRM_VERSION_MINOR 16)
|
||||||
set(OSRM_VERSION_PATCH 3)
|
set(OSRM_VERSION_PATCH 6)
|
||||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||||
|
|
||||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
@@ -102,10 +101,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>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
# Strictly require GCC>=5.0 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 4.9)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||||
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
message(FATAL_ERROR "GCC>=5.0 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)
|
||||||
@@ -126,7 +125,8 @@ 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 PartitionerGlob src/partition/*.cpp)
|
file(GLOB GuidanceGlob src/guidance/*.cpp src/extractor/intersection/*.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)
|
||||||
@@ -137,6 +137,7 @@ 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})
|
||||||
@@ -156,8 +157,9 @@ add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
|
|||||||
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
|
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:UTIL>)
|
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_partition $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_guidance $<TARGET_OBJECTS:GUIDANCE> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_customize $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_partition src/osrm/partitioner.cpp $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
|
||||||
|
add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
|
||||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
||||||
|
|
||||||
@@ -256,8 +258,7 @@ 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
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW)
|
||||||
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")
|
||||||
@@ -285,12 +286,6 @@ 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()
|
||||||
|
|
||||||
@@ -317,8 +312,9 @@ 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} -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")
|
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")
|
||||||
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)
|
||||||
@@ -326,7 +322,8 @@ 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} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
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")
|
||||||
|
|
||||||
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)
|
||||||
@@ -624,6 +621,12 @@ 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}
|
||||||
@@ -670,13 +673,14 @@ 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 ${EXTRACTOR_LIBRARIES})
|
target_link_libraries(osrm_extract osrm_guidance ${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})
|
||||||
@@ -692,15 +696,6 @@ 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)
|
||||||
@@ -723,14 +718,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/partition/partitioner.hpp include/partition/partition_config.hpp)
|
set(PartitionerHeader include/partitioner/partitioner.hpp include/partitioner/partitioner_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/partition)
|
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partitioner)
|
||||||
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,9 +59,14 @@ 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
|
||||||
|
|||||||
@@ -161,29 +161,6 @@ 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,24 +29,7 @@ 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
|
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
# - 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)
|
|
||||||
+416
-180
@@ -10,43 +10,6 @@
|
|||||||
"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
|
||||||
@@ -359,10 +322,6 @@
|
|||||||
92.56116628646856,
|
92.56116628646856,
|
||||||
15.147674168282906
|
15.147674168282906
|
||||||
],
|
],
|
||||||
[
|
|
||||||
88.78186941146853,
|
|
||||||
12.158807474538182
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
90.71546316146853,
|
90.71546316146853,
|
||||||
0.759386240320313
|
0.759386240320313
|
||||||
@@ -392,8 +351,8 @@
|
|||||||
-33.73235247373941
|
-33.73235247373941
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
164.3678069114686,
|
159.78515624999997,
|
||||||
-30.759557257019974
|
-21.943045533438166
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -409,12 +368,8 @@
|
|||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
147.381591796875,
|
147.15087890625003,
|
||||||
43.26920624914964
|
44.13885576756881
|
||||||
],
|
|
||||||
[
|
|
||||||
147.06298828125,
|
|
||||||
44.22158376545796
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
145.52490234375,
|
145.52490234375,
|
||||||
@@ -432,37 +387,13 @@
|
|||||||
141.48193359375,
|
141.48193359375,
|
||||||
45.836454050187726
|
45.836454050187726
|
||||||
],
|
],
|
||||||
[
|
|
||||||
140.38330078125,
|
|
||||||
45.47554027158593
|
|
||||||
],
|
|
||||||
[
|
|
||||||
138.021240234375,
|
|
||||||
41.08763212467916
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
135.0439453125,
|
135.0439453125,
|
||||||
37.71859032558816
|
37.71859032558816
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
132.462158203125,
|
127.88085937500001,
|
||||||
36.37706783983682
|
32.565333160841035
|
||||||
],
|
|
||||||
[
|
|
||||||
130.53955078125,
|
|
||||||
34.71452466170392
|
|
||||||
],
|
|
||||||
[
|
|
||||||
129.00146484375,
|
|
||||||
33.568861182555565
|
|
||||||
],
|
|
||||||
[
|
|
||||||
127.891845703125,
|
|
||||||
32.54681317351514
|
|
||||||
],
|
|
||||||
[
|
|
||||||
127.606201171875,
|
|
||||||
30.240086360983426
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
125.61767578124999,
|
125.61767578124999,
|
||||||
@@ -481,28 +412,12 @@
|
|||||||
25.284437746983055
|
25.284437746983055
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
136.3623046875,
|
141.36108398437503,
|
||||||
30.41078179084589
|
33.394759218577995
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
143.67919921874997,
|
147.15087890625003,
|
||||||
33.925129700072
|
44.13885576756881
|
||||||
],
|
|
||||||
[
|
|
||||||
144.25048828125,
|
|
||||||
39.605688178320804
|
|
||||||
],
|
|
||||||
[
|
|
||||||
147.45849609375,
|
|
||||||
42.48830197960227
|
|
||||||
],
|
|
||||||
[
|
|
||||||
147.94189453125,
|
|
||||||
43.13306116240612
|
|
||||||
],
|
|
||||||
[
|
|
||||||
147.381591796875,
|
|
||||||
43.26920624914964
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -517,18 +432,6 @@
|
|||||||
"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
|
||||||
@@ -538,24 +441,12 @@
|
|||||||
61.990587736204105
|
61.990587736204105
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-7.6025390625,
|
-12.54638671875,
|
||||||
59.678835236960765
|
55.94919982336746
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-12.28271484375,
|
-12.260742187500002,
|
||||||
55.51619215717891
|
50.62507306341437
|
||||||
],
|
|
||||||
[
|
|
||||||
-12.19482421875,
|
|
||||||
51.2206474303833
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-6.591796875,
|
|
||||||
49.403824657885124
|
|
||||||
],
|
|
||||||
[
|
|
||||||
-3.251953125,
|
|
||||||
49.25346477497736
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-1.9445800781249998,
|
-1.9445800781249998,
|
||||||
@@ -577,17 +468,13 @@
|
|||||||
-0.3515625,
|
-0.3515625,
|
||||||
49.69606181911566
|
49.69606181911566
|
||||||
],
|
],
|
||||||
[
|
|
||||||
0.87890625,
|
|
||||||
50.736455137010665
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
2.5048828125,
|
2.5048828125,
|
||||||
51.6180165487737
|
51.6180165487737
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
2.63671875,
|
1.9116210937499998,
|
||||||
52.119998657638156
|
61.19621314083867
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -602,10 +489,6 @@
|
|||||||
"type": "Polygon",
|
"type": "Polygon",
|
||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
|
||||||
91.77978515625,
|
|
||||||
20.899871347076424
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
92.39501953125,
|
92.39501953125,
|
||||||
21.514406720030294
|
21.514406720030294
|
||||||
@@ -950,10 +833,6 @@
|
|||||||
61.58935546875,
|
61.58935546875,
|
||||||
25.224820176765036
|
25.224820176765036
|
||||||
],
|
],
|
||||||
[
|
|
||||||
67.8076171875,
|
|
||||||
16.678293098288513
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
74.970703125,
|
74.970703125,
|
||||||
7.580327791330129
|
7.580327791330129
|
||||||
@@ -967,16 +846,12 @@
|
|||||||
-2.986927393334863
|
-2.986927393334863
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
84.8583984375,
|
85.86914062500001,
|
||||||
0.4833927027896987
|
5.5941182188847876
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
88.3740234375,
|
92.39501953125,
|
||||||
14.774882506516272
|
21.514406720030294
|
||||||
],
|
|
||||||
[
|
|
||||||
91.77978515625,
|
|
||||||
20.899871347076424
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -985,23 +860,15 @@
|
|||||||
{
|
{
|
||||||
"type": "Feature",
|
"type": "Feature",
|
||||||
"properties": {
|
"properties": {
|
||||||
"stroke": "#555555",
|
"driving_side": "left"
|
||||||
"stroke-width": 2,
|
|
||||||
"stroke-opacity": 1,
|
|
||||||
"fill": "#555555",
|
|
||||||
"fill-opacity": 0.5
|
|
||||||
},
|
},
|
||||||
"geometry": {
|
"geometry": {
|
||||||
"type": "Polygon",
|
"type": "Polygon",
|
||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
43.41796875,
|
43.57177734375001,
|
||||||
-3.1405161039832357
|
-4.390228926463384
|
||||||
],
|
|
||||||
[
|
|
||||||
41.6162109375,
|
|
||||||
-1.7355743631421197
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
41.0009765625,
|
41.0009765625,
|
||||||
@@ -1264,20 +1131,8 @@
|
|||||||
-34.74161249883172
|
-34.74161249883172
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
40.95703125,
|
43.57177734375001,
|
||||||
-18.646245142670598
|
-4.390228926463384
|
||||||
],
|
|
||||||
[
|
|
||||||
42.2314453125,
|
|
||||||
-13.581920900545844
|
|
||||||
],
|
|
||||||
[
|
|
||||||
41.3525390625,
|
|
||||||
-8.754794702435618
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43.41796875,
|
|
||||||
-3.1405161039832357
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -1718,24 +1573,24 @@
|
|||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
-82.012939453125,
|
-81.67236328125001,
|
||||||
18.90108960836388
|
19.03875247795316
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-80.48583984375,
|
-79.76898193359376,
|
||||||
18.90108960836388
|
19.48989674307901
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-80.48583984375,
|
-79.48333740234375,
|
||||||
19.735683578629445
|
19.888140273126222
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-82.012939453125,
|
-81.45263671875001,
|
||||||
19.735683578629445
|
19.46400263520258
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
-82.012939453125,
|
-81.67236328125001,
|
||||||
18.90108960836388
|
19.03875247795316
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -1979,6 +1834,387 @@
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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
+4
-4
@@ -515,10 +515,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 |
|
| true | An `Annotation` object containing node ids, durations, distances and weights. |
|
||||||
| false | weights `undefined` |
|
| false | `undefined` |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
|
|||||||
+97
-13
@@ -208,19 +208,103 @@ 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 (`0-360`: `0`=u-turn, `180`=straight on)
|
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)
|
||||||
number_of_roads | Read | Integer | Number of ways at the intersection of the turn
|
number_of_roads | Read | Integer | Number of ways at the intersection of the turn
|
||||||
is_u_turn | Read | Boolean | Is the turn a u-turn?
|
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`)
|
||||||
is_left_hand_driving | Read | Boolean | Is left-hand traffic?
|
source_mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||||
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
source_is_motorway | Read | Boolean | Is the source road a motorway?
|
||||||
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
|
source_is_link | Read | Boolean | Is the source road a link?
|
||||||
source_mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
source_number_of_lanes | Read | Integer | How many lanes does the source road have? (default when not tagged: 0)
|
||||||
target_mode | Read | Enum | Travel mode after the turn. Defined in `include/extractor/travel_mode.hpp`
|
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.
|
||||||
|
|||||||
@@ -45,3 +45,11 @@ 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 |
|
||||||
|
|||||||
@@ -131,3 +131,57 @@ 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 |
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
@@ -39,7 +39,12 @@ Feature: Car - Handle physical limitation
|
|||||||
Scenario: Car - Limited by height
|
Scenario: Car - Limited by height
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxheight:physical | maxheight | bothw |
|
| highway | maxheight:physical | maxheight | bothw |
|
||||||
|
| primary | | | x |
|
||||||
| primary | 1 | | |
|
| primary | 1 | | |
|
||||||
| primary | 3 | | x |
|
| primary | 3 | | x |
|
||||||
| primary | | 1 | |
|
| primary | | 1 | |
|
||||||
| primary | | 3 | x |
|
| primary | | 3 | x |
|
||||||
|
| primary | | default | x |
|
||||||
|
| primary | | none | x |
|
||||||
|
| primary | | no-sign | x |
|
||||||
|
| primary | | unsigned | x |
|
||||||
|
|||||||
@@ -1061,3 +1061,28 @@ 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
|
||||||
|
|||||||
@@ -0,0 +1,223 @@
|
|||||||
|
# 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 |
|
||||||
|
|
||||||
|
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 |
|
||||||
|
|
||||||
|
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 |
|
||||||
@@ -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
|
||||||
@@ -281,3 +281,67 @@ 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,6 +382,21 @@ 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
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -129,8 +129,12 @@ 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 ('answer ' .. tostring(way:get_location_tag('answer')))
|
print ('way ' .. 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
|
||||||
@@ -148,4 +152,5 @@ 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 "answer 42"
|
And stdout should contain "node 42"
|
||||||
|
And stdout should contain "way 42"
|
||||||
|
|||||||
@@ -0,0 +1,186 @@
|
|||||||
|
@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 11"
|
||||||
|
# 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,31 +185,34 @@ module.exports = function () {
|
|||||||
|
|
||||||
let q = d3.queue();
|
let q = d3.queue();
|
||||||
|
|
||||||
let addRelation = (row, cb) => {
|
let addRelation = (headers, 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 key in row) {
|
for (let index 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) {
|
||||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
value.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) {
|
||||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((wayName) => {
|
value.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) {
|
||||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((relName) => {
|
value.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]);
|
||||||
@@ -217,8 +220,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, row[key]);
|
relation.addTag(key, value);
|
||||||
if (key.match(/name/)) name = row[key];
|
if (key.match(/name/)) name = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
relation.uid = this.OSM_UID;
|
relation.uid = this.OSM_UID;
|
||||||
@@ -233,7 +236,8 @@ module.exports = function () {
|
|||||||
cb();
|
cb();
|
||||||
};
|
};
|
||||||
|
|
||||||
table.hashes().forEach((row) => q.defer(addRelation, row));
|
var headers = table.raw()[0];
|
||||||
|
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].instructions);
|
turns = this.turnList(json.matchings[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('route')) {
|
if (headers.has('route')) {
|
||||||
|
|||||||
@@ -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,6 +115,7 @@ 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
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ module.exports = function () {
|
|||||||
|
|
||||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||||
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
||||||
|
|
||||||
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
|
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
|
||||||
|
|
||||||
if (this.PLATFORM_WINDOWS) {
|
if (this.PLATFORM_WINDOWS) {
|
||||||
@@ -72,6 +72,7 @@ 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');
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ 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) => {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Feature: Annotations
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
And the query options
|
And the query options
|
||||||
| annotations | duration,speed,weight |
|
| annotations | duration,speed,weight,nodes |
|
||||||
|
|
||||||
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 |
|
| from | to | route | a:speed | a:weight | a:nodes |
|
||||||
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 |
|
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 | 1:4:3 |
|
||||||
| i | m | il,lm,lm | 6.7:6.7 | 15:15 |
|
| i | m | il,lm,lm | 6.7:6.7 | 15:15 | 2:5:6 |
|
||||||
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 |
|
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 | 3:4:5:6 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: There should be different forward/reverse datasources
|
Scenario: There should be different forward/reverse datasources
|
||||||
@@ -81,5 +81,5 @@ Feature: Annotations
|
|||||||
| bearings | 90,5;180,5 |
|
| bearings | 90,5;180,5 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
|
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
|
||||||
| a | c | abc,abc | 10:10:10 | 249.998641:299.931643:0 | 25:30:0 | 1:2:3 |
|
| a | c | abc,abc | 10:10 | 249.998641:299.931643 | 25:30 | 1:2:3 |
|
||||||
|
|||||||
@@ -684,3 +684,112 @@ Feature: Basic Map Matching
|
|||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | geometry | code |
|
| trace | geometry | code |
|
||||||
| bgkj | 1.000135,1,1.000135,0.99964,1.000387,0.999137 | Ok |
|
| 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:0 |
|
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1: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:0 |
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
||||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
||||||
| 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:0 |
|
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1: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:0 |
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
||||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
||||||
| 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:0 |
|
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1 |
|
||||||
| 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:0 |
|
| a | b | ab,ab | 1 km/h | 20020.73,0 | 1 |
|
||||||
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1:0 |
|
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1 |
|
||||||
| b | c | bc,bc | 27 km/h | 741.51,0 | 1:0 |
|
| b | c | bc,bc | 27 km/h | 741.51,0 | 1 |
|
||||||
| 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:0 |
|
| g | b | ab,ab | 1 km/h | 10010.37,0 | 1 |
|
||||||
| 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:1 |
|
| g | a | ab,ab | 1 km/h | 10010.36,0 | 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 |
|
| from | to | route | speed | weights | a:datasources | a:speed | a:nodes|
|
||||||
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 |
|
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 | 10 | 6:2 |
|
||||||
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1:0 |
|
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1 | 10:7.5 | 6:2:3 |
|
||||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 | 7.5 | 2:3 |
|
||||||
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0:0 |
|
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0 | 10:10 | 2:6:4 |
|
||||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 | 10 | 4:3 |
|
||||||
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
|
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
||||||
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 |
|
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -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 | 3 | 3 | 6.7 |
|
| s,t | 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 |
|
| t,s | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 2.1 | 2.1 | 9.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 |
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ template <typename QueryGraphT, typename EdgeFilterT>
|
|||||||
inline void readGraph(const boost::filesystem::path &path,
|
inline void readGraph(const boost::filesystem::path &path,
|
||||||
unsigned &checksum,
|
unsigned &checksum,
|
||||||
QueryGraphT &graph,
|
QueryGraphT &graph,
|
||||||
std::vector<EdgeFilterT> &edge_filter)
|
std::vector<EdgeFilterT> &edge_filter,
|
||||||
|
std::uint32_t &connectivity_checksum)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
||||||
std::is_same<QueryGraph, QueryGraphT>::value,
|
std::is_same<QueryGraph, QueryGraphT>::value,
|
||||||
@@ -39,6 +40,7 @@ inline void readGraph(const boost::filesystem::path &path,
|
|||||||
{
|
{
|
||||||
storage::serialization::read(reader, edge_filter[index]);
|
storage::serialization::read(reader, edge_filter[index]);
|
||||||
}
|
}
|
||||||
|
reader.ReadInto(connectivity_checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
// writes .osrm.hsgr file
|
// writes .osrm.hsgr file
|
||||||
@@ -46,7 +48,8 @@ template <typename QueryGraphT, typename EdgeFilterT>
|
|||||||
inline void writeGraph(const boost::filesystem::path &path,
|
inline void writeGraph(const boost::filesystem::path &path,
|
||||||
unsigned checksum,
|
unsigned checksum,
|
||||||
const QueryGraphT &graph,
|
const QueryGraphT &graph,
|
||||||
const std::vector<EdgeFilterT> &edge_filter)
|
const std::vector<EdgeFilterT> &edge_filter,
|
||||||
|
const std::uint32_t connectivity_checksum)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
||||||
std::is_same<QueryGraph, QueryGraphT>::value,
|
std::is_same<QueryGraph, QueryGraphT>::value,
|
||||||
@@ -64,6 +67,7 @@ inline void writeGraph(const boost::filesystem::path &path,
|
|||||||
{
|
{
|
||||||
storage::serialization::write(writer, filter);
|
storage::serialization::write(writer, filter);
|
||||||
}
|
}
|
||||||
|
writer.WriteOne(connectivity_checksum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,23 +128,24 @@ 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)
|
||||||
{
|
{
|
||||||
std::vector<Edge> edges;
|
util::Log() << "Converting contracted graph with " << graph.GetNumberOfEdges()
|
||||||
edges.reserve(graph.GetNumberOfEdges());
|
<< " to edge list (" << (graph.GetNumberOfEdges() * sizeof(Edge)) << " bytes)";
|
||||||
|
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())
|
|
||||||
{
|
{
|
||||||
Edge new_edge;
|
util::UnbufferedLog log;
|
||||||
|
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 ContractorGraph::EdgeData &data = graph.GetEdgeData(edge);
|
const auto &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");
|
||||||
@@ -156,16 +157,12 @@ 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,8 +1,8 @@
|
|||||||
#ifndef OSRM_CELLS_CUSTOMIZER_HPP
|
#ifndef OSRM_CELLS_CUSTOMIZER_HPP
|
||||||
#define OSRM_CELLS_CUSTOMIZER_HPP
|
#define OSRM_CELLS_CUSTOMIZER_HPP
|
||||||
|
|
||||||
#include "partition/cell_storage.hpp"
|
#include "partitioner/cell_storage.hpp"
|
||||||
#include "partition/multi_level_partition.hpp"
|
#include "partitioner/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>
|
||||||
@@ -29,12 +29,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 partition::MultiLevelPartition &partition) : partition(partition) {}
|
CellCustomizer(const partitioner::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 partition::CellStorage &cells,
|
const partitioner::CellStorage &cells,
|
||||||
const std::vector<bool> &allowed_nodes,
|
const std::vector<bool> &allowed_nodes,
|
||||||
CellMetric &metric,
|
CellMetric &metric,
|
||||||
LevelID level,
|
LevelID level,
|
||||||
@@ -97,7 +97,7 @@ class CellCustomizer
|
|||||||
|
|
||||||
template <typename GraphT>
|
template <typename GraphT>
|
||||||
void Customize(const GraphT &graph,
|
void Customize(const GraphT &graph,
|
||||||
const partition::CellStorage &cells,
|
const partitioner::CellStorage &cells,
|
||||||
const std::vector<bool> &allowed_nodes,
|
const std::vector<bool> &allowed_nodes,
|
||||||
CellMetric &metric) const
|
CellMetric &metric) const
|
||||||
{
|
{
|
||||||
@@ -121,7 +121,7 @@ class CellCustomizer
|
|||||||
private:
|
private:
|
||||||
template <typename GraphT>
|
template <typename GraphT>
|
||||||
void RelaxNode(const GraphT &graph,
|
void RelaxNode(const GraphT &graph,
|
||||||
const partition::CellStorage &cells,
|
const partitioner::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 +209,7 @@ class CellCustomizer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const partition::MultiLevelPartition &partition;
|
const partitioner::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 "partition/edge_based_graph.hpp"
|
#include "partitioner/edge_based_graph.hpp"
|
||||||
#include "partition/multi_level_graph.hpp"
|
#include "partitioner/multi_level_graph.hpp"
|
||||||
#include "util/static_graph.hpp"
|
#include "util/static_graph.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
@@ -16,19 +16,20 @@ namespace osrm
|
|||||||
namespace customizer
|
namespace customizer
|
||||||
{
|
{
|
||||||
|
|
||||||
using EdgeBasedGraphEdgeData = partition::EdgeBasedGraphEdgeData;
|
using EdgeBasedGraphEdgeData = partitioner::EdgeBasedGraphEdgeData;
|
||||||
|
|
||||||
struct MultiLevelEdgeBasedGraph
|
struct MultiLevelEdgeBasedGraph
|
||||||
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>
|
: public partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>
|
||||||
{
|
{
|
||||||
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
using Base =
|
||||||
|
partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
||||||
using Base::Base;
|
using Base::Base;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MultiLevelEdgeBasedGraphView
|
struct MultiLevelEdgeBasedGraphView
|
||||||
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>
|
: public partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>
|
||||||
{
|
{
|
||||||
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
using Base = partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
||||||
using Base::Base;
|
using Base::Base;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
#ifndef OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
||||||
#define OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
#define OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
||||||
|
|
||||||
#include "partition/cell_storage.hpp"
|
#include "partitioner/cell_storage.hpp"
|
||||||
|
|
||||||
#include "storage/io.hpp"
|
#include "storage/io.hpp"
|
||||||
#include "storage/serialization.hpp"
|
#include "storage/serialization.hpp"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#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"
|
||||||
@@ -19,6 +20,8 @@
|
|||||||
|
|
||||||
#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"
|
||||||
@@ -130,6 +133,7 @@ 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,
|
||||||
@@ -140,6 +144,10 @@ 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);
|
||||||
|
|
||||||
/* 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
|
||||||
@@ -203,12 +211,16 @@ 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(),
|
||||||
|
|||||||
@@ -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 "partition/cell_storage.hpp"
|
#include "partitioner/cell_storage.hpp"
|
||||||
#include "partition/multi_level_partition.hpp"
|
#include "partitioner/multi_level_partition.hpp"
|
||||||
|
|
||||||
#include "util/filtered_graph.hpp"
|
#include "util/filtered_graph.hpp"
|
||||||
#include "util/integer_range.hpp"
|
#include "util/integer_range.hpp"
|
||||||
@@ -75,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 partition::MultiLevelPartitionView &GetMultiLevelPartition() const = 0;
|
virtual const partitioner::MultiLevelPartitionView &GetMultiLevelPartition() const = 0;
|
||||||
|
|
||||||
virtual const partition::CellStorageView &GetCellStorage() const = 0;
|
virtual const partitioner::CellStorageView &GetCellStorage() const = 0;
|
||||||
|
|
||||||
virtual const customizer::CellMetricView &GetCellMetric() const = 0;
|
virtual const customizer::CellMetricView &GetCellMetric() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -13,19 +13,22 @@
|
|||||||
|
|
||||||
#include "extractor/datasources.hpp"
|
#include "extractor/datasources.hpp"
|
||||||
#include "extractor/edge_based_node.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/intersection_bearings_container.hpp"
|
||||||
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
#include "extractor/packed_osm_ids.hpp"
|
#include "extractor/packed_osm_ids.hpp"
|
||||||
#include "extractor/profile_properties.hpp"
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/segment_data_container.hpp"
|
#include "extractor/segment_data_container.hpp"
|
||||||
#include "extractor/turn_data_container.hpp"
|
#include "extractor/turn_lane_types.hpp"
|
||||||
|
|
||||||
|
#include "guidance/turn_bearing.hpp"
|
||||||
|
#include "guidance/turn_data_container.hpp"
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
|
|
||||||
#include "contractor/query_graph.hpp"
|
#include "contractor/query_graph.hpp"
|
||||||
|
|
||||||
#include "partition/cell_storage.hpp"
|
#include "partitioner/cell_storage.hpp"
|
||||||
#include "partition/multi_level_partition.hpp"
|
#include "partitioner/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"
|
||||||
@@ -35,7 +38,6 @@
|
|||||||
#include "util/filtered_graph.hpp"
|
#include "util/filtered_graph.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/log.hpp"
|
#include "util/log.hpp"
|
||||||
#include "util/name_table.hpp"
|
#include "util/name_table.hpp"
|
||||||
@@ -192,18 +194,21 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
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::guidance::TurnLaneType::Mask> m_lane_description_masks;
|
util::vector_view<extractor::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;
|
||||||
|
util::vector_view<NodeID> m_maneuver_override_node_sequences;
|
||||||
|
|
||||||
std::unique_ptr<SharedRTree> m_static_rtree;
|
std::unique_ptr<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;
|
||||||
@@ -318,10 +323,9 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
util::vector_view<LaneDataID> lane_data_ids(
|
util::vector_view<LaneDataID> lane_data_ids(
|
||||||
lane_data_id_ptr, layout.num_entries[storage::DataLayout::LANE_DATA_ID]);
|
lane_data_id_ptr, layout.num_entries[storage::DataLayout::LANE_DATA_ID]);
|
||||||
|
|
||||||
const auto turn_instruction_list_ptr =
|
const auto turn_instruction_list_ptr = layout.GetBlockPtr<guidance::TurnInstruction>(
|
||||||
layout.GetBlockPtr<extractor::guidance::TurnInstruction>(
|
memory_ptr, storage::DataLayout::TURN_INSTRUCTION);
|
||||||
memory_ptr, storage::DataLayout::TURN_INSTRUCTION);
|
util::vector_view<guidance::TurnInstruction> turn_instructions(
|
||||||
util::vector_view<extractor::guidance::TurnInstruction> turn_instructions(
|
|
||||||
turn_instruction_list_ptr, layout.num_entries[storage::DataLayout::TURN_INSTRUCTION]);
|
turn_instruction_list_ptr, layout.num_entries[storage::DataLayout::TURN_INSTRUCTION]);
|
||||||
|
|
||||||
const auto entry_class_id_list_ptr =
|
const auto entry_class_id_list_ptr =
|
||||||
@@ -329,21 +333,21 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
util::vector_view<EntryClassID> entry_class_ids(
|
util::vector_view<EntryClassID> entry_class_ids(
|
||||||
entry_class_id_list_ptr, layout.num_entries[storage::DataLayout::ENTRY_CLASSID]);
|
entry_class_id_list_ptr, layout.num_entries[storage::DataLayout::ENTRY_CLASSID]);
|
||||||
|
|
||||||
const auto pre_turn_bearing_ptr = layout.GetBlockPtr<util::guidance::TurnBearing>(
|
const auto pre_turn_bearing_ptr = layout.GetBlockPtr<guidance::TurnBearing>(
|
||||||
memory_ptr, storage::DataLayout::PRE_TURN_BEARING);
|
memory_ptr, storage::DataLayout::PRE_TURN_BEARING);
|
||||||
util::vector_view<util::guidance::TurnBearing> pre_turn_bearings(
|
util::vector_view<guidance::TurnBearing> pre_turn_bearings(
|
||||||
pre_turn_bearing_ptr, layout.num_entries[storage::DataLayout::PRE_TURN_BEARING]);
|
pre_turn_bearing_ptr, layout.num_entries[storage::DataLayout::PRE_TURN_BEARING]);
|
||||||
|
|
||||||
const auto post_turn_bearing_ptr = layout.GetBlockPtr<util::guidance::TurnBearing>(
|
const auto post_turn_bearing_ptr = layout.GetBlockPtr<guidance::TurnBearing>(
|
||||||
memory_ptr, storage::DataLayout::POST_TURN_BEARING);
|
memory_ptr, storage::DataLayout::POST_TURN_BEARING);
|
||||||
util::vector_view<util::guidance::TurnBearing> post_turn_bearings(
|
util::vector_view<guidance::TurnBearing> post_turn_bearings(
|
||||||
post_turn_bearing_ptr, layout.num_entries[storage::DataLayout::POST_TURN_BEARING]);
|
post_turn_bearing_ptr, layout.num_entries[storage::DataLayout::POST_TURN_BEARING]);
|
||||||
|
|
||||||
turn_data = extractor::TurnDataView(std::move(turn_instructions),
|
turn_data = guidance::TurnDataView(std::move(turn_instructions),
|
||||||
std::move(lane_data_ids),
|
std::move(lane_data_ids),
|
||||||
std::move(entry_class_ids),
|
std::move(entry_class_ids),
|
||||||
std::move(pre_turn_bearings),
|
std::move(pre_turn_bearings),
|
||||||
std::move(post_turn_bearings));
|
std::move(post_turn_bearings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeNamePointers(storage::DataLayout &data_layout, char *memory_block)
|
void InitializeNamePointers(storage::DataLayout &data_layout, char *memory_block)
|
||||||
@@ -363,10 +367,10 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
offsets_ptr, data_layout.num_entries[storage::DataLayout::LANE_DESCRIPTION_OFFSETS]);
|
offsets_ptr, data_layout.num_entries[storage::DataLayout::LANE_DESCRIPTION_OFFSETS]);
|
||||||
m_lane_description_offsets = std::move(offsets);
|
m_lane_description_offsets = std::move(offsets);
|
||||||
|
|
||||||
auto masks_ptr = data_layout.GetBlockPtr<extractor::guidance::TurnLaneType::Mask>(
|
auto masks_ptr = data_layout.GetBlockPtr<extractor::TurnLaneType::Mask>(
|
||||||
memory_block, storage::DataLayout::LANE_DESCRIPTION_MASKS);
|
memory_block, storage::DataLayout::LANE_DESCRIPTION_MASKS);
|
||||||
|
|
||||||
util::vector_view<extractor::guidance::TurnLaneType::Mask> masks(
|
util::vector_view<extractor::TurnLaneType::Mask> masks(
|
||||||
masks_ptr, data_layout.num_entries[storage::DataLayout::LANE_DESCRIPTION_MASKS]);
|
masks_ptr, data_layout.num_entries[storage::DataLayout::LANE_DESCRIPTION_MASKS]);
|
||||||
m_lane_description_masks = std::move(masks);
|
m_lane_description_masks = std::move(masks);
|
||||||
|
|
||||||
@@ -499,6 +503,21 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
m_entry_class_table = std::move(entry_class_table);
|
m_entry_class_table = std::move(entry_class_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InitializeManeuverOverridePointers(storage::DataLayout &data_layout, char *memory_block)
|
||||||
|
{
|
||||||
|
auto maneuver_overrides_ptr = data_layout.GetBlockPtr<extractor::StorageManeuverOverride>(
|
||||||
|
memory_block, storage::DataLayout::MANEUVER_OVERRIDES);
|
||||||
|
m_maneuver_overrides = util::vector_view<extractor::StorageManeuverOverride>(
|
||||||
|
maneuver_overrides_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::MANEUVER_OVERRIDES]);
|
||||||
|
|
||||||
|
auto maneuver_override_node_sequences_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
|
memory_block, storage::DataLayout::MANEUVER_OVERRIDE_NODE_SEQUENCES);
|
||||||
|
m_maneuver_override_node_sequences = util::vector_view<NodeID>(
|
||||||
|
maneuver_override_node_sequences_ptr,
|
||||||
|
data_layout.num_entries[storage::DataLayout::MANEUVER_OVERRIDE_NODE_SEQUENCES]);
|
||||||
|
}
|
||||||
|
|
||||||
void InitializeInternalPointers(storage::DataLayout &data_layout,
|
void InitializeInternalPointers(storage::DataLayout &data_layout,
|
||||||
char *memory_block,
|
char *memory_block,
|
||||||
const std::size_t exclude_index)
|
const std::size_t exclude_index)
|
||||||
@@ -515,6 +534,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
InitializeProfilePropertiesPointer(data_layout, memory_block, exclude_index);
|
InitializeProfilePropertiesPointer(data_layout, memory_block, exclude_index);
|
||||||
InitializeRTreePointers(data_layout, memory_block);
|
InitializeRTreePointers(data_layout, memory_block);
|
||||||
InitializeIntersectionClassPointers(data_layout, memory_block);
|
InitializeIntersectionClassPointers(data_layout, memory_block);
|
||||||
|
InitializeManeuverOverridePointers(data_layout, memory_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -609,7 +629,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return m_turn_duration_penalties[id];
|
return m_turn_duration_penalties[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
extractor::guidance::TurnInstruction
|
osrm::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);
|
||||||
@@ -845,11 +865,11 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
return intersection_bearings_view.GetBearingClass(node);
|
return intersection_bearings_view.GetBearingClass(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const override final
|
guidance::TurnBearing PreTurnBearing(const EdgeID eid) const override final
|
||||||
{
|
{
|
||||||
return turn_data.GetPreTurnBearing(eid);
|
return turn_data.GetPreTurnBearing(eid);
|
||||||
}
|
}
|
||||||
util::guidance::TurnBearing PostTurnBearing(const EdgeID eid) const override final
|
guidance::TurnBearing PostTurnBearing(const EdgeID eid) const override final
|
||||||
{
|
{
|
||||||
return turn_data.GetPostTurnBearing(eid);
|
return turn_data.GetPostTurnBearing(eid);
|
||||||
}
|
}
|
||||||
@@ -868,13 +888,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::guidance::TurnLaneDescription
|
extractor::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::guidance::TurnLaneDescription(
|
return extractor::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]);
|
||||||
@@ -890,6 +910,39 @@ 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;
|
||||||
@@ -912,8 +965,8 @@ class ContiguousInternalMemoryDataFacade<CH>
|
|||||||
template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
|
template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
|
||||||
{
|
{
|
||||||
// MLD data
|
// MLD data
|
||||||
partition::MultiLevelPartitionView mld_partition;
|
partitioner::MultiLevelPartitionView mld_partition;
|
||||||
partition::CellStorageView mld_cell_storage;
|
partitioner::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;
|
||||||
@@ -939,7 +992,7 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_TO_CHILDREN) > 0);
|
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_TO_CHILDREN) > 0);
|
||||||
|
|
||||||
auto level_data =
|
auto level_data =
|
||||||
data_layout.GetBlockPtr<partition::MultiLevelPartitionView::LevelData>(
|
data_layout.GetBlockPtr<partitioner::MultiLevelPartitionView::LevelData>(
|
||||||
memory_block, storage::DataLayout::MLD_LEVEL_DATA);
|
memory_block, storage::DataLayout::MLD_LEVEL_DATA);
|
||||||
|
|
||||||
auto mld_partition_ptr = data_layout.GetBlockPtr<PartitionID>(
|
auto mld_partition_ptr = data_layout.GetBlockPtr<PartitionID>(
|
||||||
@@ -955,7 +1008,7 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
util::vector_view<CellID> cell_to_children(mld_chilren_ptr, children_entries_count);
|
util::vector_view<CellID> cell_to_children(mld_chilren_ptr, children_entries_count);
|
||||||
|
|
||||||
mld_partition =
|
mld_partition =
|
||||||
partition::MultiLevelPartitionView{level_data, partition, cell_to_children};
|
partitioner::MultiLevelPartitionView{level_data, partition, cell_to_children};
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto weights_block_id = static_cast<storage::DataLayout::BlockID>(
|
const auto weights_block_id = static_cast<storage::DataLayout::BlockID>(
|
||||||
@@ -988,7 +1041,7 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
memory_block, storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
memory_block, storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
|
||||||
auto mld_destination_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
auto mld_destination_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
memory_block, storage::DataLayout::MLD_CELL_DESTINATION_BOUNDARY);
|
memory_block, storage::DataLayout::MLD_CELL_DESTINATION_BOUNDARY);
|
||||||
auto mld_cells_ptr = data_layout.GetBlockPtr<partition::CellStorageView::CellData>(
|
auto mld_cells_ptr = data_layout.GetBlockPtr<partitioner::CellStorageView::CellData>(
|
||||||
memory_block, storage::DataLayout::MLD_CELLS);
|
memory_block, storage::DataLayout::MLD_CELLS);
|
||||||
auto mld_cell_level_offsets_ptr = data_layout.GetBlockPtr<std::uint64_t>(
|
auto mld_cell_level_offsets_ptr = data_layout.GetBlockPtr<std::uint64_t>(
|
||||||
memory_block, storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
|
memory_block, storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
|
||||||
@@ -1005,15 +1058,15 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
source_boundary_entries_count);
|
source_boundary_entries_count);
|
||||||
util::vector_view<NodeID> destination_boundary(mld_destination_boundary_ptr,
|
util::vector_view<NodeID> destination_boundary(mld_destination_boundary_ptr,
|
||||||
destination_boundary_entries_count);
|
destination_boundary_entries_count);
|
||||||
util::vector_view<partition::CellStorageView::CellData> cells(mld_cells_ptr,
|
util::vector_view<partitioner::CellStorageView::CellData> cells(mld_cells_ptr,
|
||||||
cells_entries_counts);
|
cells_entries_counts);
|
||||||
util::vector_view<std::uint64_t> level_offsets(mld_cell_level_offsets_ptr,
|
util::vector_view<std::uint64_t> level_offsets(mld_cell_level_offsets_ptr,
|
||||||
cell_level_offsets_entries_count);
|
cell_level_offsets_entries_count);
|
||||||
|
|
||||||
mld_cell_storage = partition::CellStorageView{std::move(source_boundary),
|
mld_cell_storage = partitioner::CellStorageView{std::move(source_boundary),
|
||||||
std::move(destination_boundary),
|
std::move(destination_boundary),
|
||||||
std::move(cells),
|
std::move(cells),
|
||||||
std::move(level_offsets)};
|
std::move(level_offsets)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void InitializeGraphPointer(storage::DataLayout &data_layout, char *memory_block)
|
void InitializeGraphPointer(storage::DataLayout &data_layout, char *memory_block)
|
||||||
@@ -1050,12 +1103,12 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory(), exclude_index);
|
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory(), exclude_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
const partition::MultiLevelPartitionView &GetMultiLevelPartition() const override
|
const partitioner::MultiLevelPartitionView &GetMultiLevelPartition() const override
|
||||||
{
|
{
|
||||||
return mld_partition;
|
return mld_partition;
|
||||||
}
|
}
|
||||||
|
|
||||||
const partition::CellStorageView &GetCellStorage() const override { return mld_cell_storage; }
|
const partitioner::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; }
|
||||||
|
|
||||||
|
|||||||
@@ -10,16 +10,19 @@
|
|||||||
|
|
||||||
#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/guidance/turn_instruction.hpp"
|
//#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/original_edge_data.hpp"
|
//#include "extractor/original_edge_data.hpp"
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/query_node.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/string_util.hpp"
|
#include "util/string_util.hpp"
|
||||||
@@ -87,8 +90,7 @@ class BaseDataFacade
|
|||||||
// 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 extractor::guidance::TurnInstruction
|
virtual osrm::guidance::TurnInstruction GetTurnInstructionForEdgeID(const EdgeID id) const = 0;
|
||||||
GetTurnInstructionForEdgeID(const EdgeID id) const = 0;
|
|
||||||
|
|
||||||
virtual extractor::TravelMode GetTravelMode(const NodeID id) const = 0;
|
virtual extractor::TravelMode GetTravelMode(const NodeID id) const = 0;
|
||||||
|
|
||||||
@@ -156,7 +158,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::guidance::TurnLaneDescription
|
virtual extractor::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;
|
||||||
@@ -183,8 +185,8 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual double GetWeightMultiplier() const = 0;
|
virtual double GetWeightMultiplier() const = 0;
|
||||||
|
|
||||||
virtual util::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const = 0;
|
virtual osrm::guidance::TurnBearing PreTurnBearing(const EdgeID eid) const = 0;
|
||||||
virtual util::guidance::TurnBearing PostTurnBearing(const EdgeID eid) const = 0;
|
virtual osrm::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;
|
||||||
|
|
||||||
@@ -193,6 +195,9 @@ 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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ 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:
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
|||||||
{
|
{
|
||||||
auto results = rtree.Nearest(
|
auto results = rtree.Nearest(
|
||||||
input_coordinate,
|
input_coordinate,
|
||||||
[this, approach, &input_coordinate, bearing, bearing_range, max_distance](
|
[this, approach, &input_coordinate, bearing, bearing_range](
|
||||||
const CandidateSegment &segment) {
|
const CandidateSegment &segment) {
|
||||||
auto use_direction =
|
auto use_direction =
|
||||||
boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
|
boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#ifndef ENGINE_GUIDANCE_ASSEMBLE_GEOMETRY_HPP
|
#ifndef ENGINE_GUIDANCE_ASSEMBLE_GEOMETRY_HPP
|
||||||
#define ENGINE_GUIDANCE_ASSEMBLE_GEOMETRY_HPP
|
#define ENGINE_GUIDANCE_ASSEMBLE_GEOMETRY_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
#include "engine/datafacade/datafacade_base.hpp"
|
#include "engine/datafacade/datafacade_base.hpp"
|
||||||
#include "engine/guidance/leg_geometry.hpp"
|
#include "engine/guidance/leg_geometry.hpp"
|
||||||
#include "engine/guidance/route_step.hpp"
|
#include "engine/guidance/route_step.hpp"
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "util/coordinate_calculation.hpp"
|
#include "util/coordinate_calculation.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cmath>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
|
|||||||
cumulative_distance += current_distance;
|
cumulative_distance += current_distance;
|
||||||
|
|
||||||
// all changes to this check have to be matched with assemble_steps
|
// all changes to this check have to be matched with assemble_steps
|
||||||
if (path_point.turn_instruction.type != extractor::guidance::TurnType::NoTurn)
|
if (path_point.turn_instruction.type != osrm::guidance::TurnType::NoTurn)
|
||||||
{
|
{
|
||||||
geometry.segment_distances.push_back(cumulative_distance);
|
geometry.segment_distances.push_back(cumulative_distance);
|
||||||
geometry.segment_offsets.push_back(geometry.locations.size());
|
geometry.segment_offsets.push_back(geometry.locations.size());
|
||||||
@@ -80,7 +81,9 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
|
|||||||
prev_coordinate = coordinate;
|
prev_coordinate = coordinate;
|
||||||
|
|
||||||
const auto osm_node_id = facade.GetOSMNodeIDOfNode(path_point.turn_via_node);
|
const auto osm_node_id = facade.GetOSMNodeIDOfNode(path_point.turn_via_node);
|
||||||
if (osm_node_id != geometry.osm_node_ids.back())
|
|
||||||
|
if (osm_node_id != geometry.osm_node_ids.back() ||
|
||||||
|
path_point.turn_instruction.type != osrm::guidance::TurnType::NoTurn)
|
||||||
{
|
{
|
||||||
geometry.annotations.emplace_back(LegGeometry::Annotation{
|
geometry.annotations.emplace_back(LegGeometry::Annotation{
|
||||||
current_distance,
|
current_distance,
|
||||||
@@ -111,15 +114,39 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
|
|||||||
const std::vector<DatasourceID> forward_datasources =
|
const std::vector<DatasourceID> forward_datasources =
|
||||||
facade.GetUncompressedForwardDatasources(target_geometry_id);
|
facade.GetUncompressedForwardDatasources(target_geometry_id);
|
||||||
|
|
||||||
// FIXME if source and target phantoms are on the same segment then duration and weight
|
// This happens when the source/target are on the same edge-based-node
|
||||||
// will be from one projected point till end of segment
|
// There will be no entries in the unpacked path, thus no annotations.
|
||||||
// testbot/weight.feature:Start and target on the same and adjacent edge
|
// We will need to calculate the lone annotation by looking at the position
|
||||||
geometry.annotations.emplace_back(LegGeometry::Annotation{
|
// of the source/target nodes, and calculating their differences.
|
||||||
current_distance,
|
if (geometry.annotations.empty())
|
||||||
(reversed_target ? target_node.reverse_duration : target_node.forward_duration) / 10.,
|
{
|
||||||
(reversed_target ? target_node.reverse_weight : target_node.forward_weight) /
|
auto duration =
|
||||||
facade.GetWeightMultiplier(),
|
std::abs(
|
||||||
forward_datasources[target_node.fwd_segment_position]});
|
(reversed_target ? target_node.reverse_duration : target_node.forward_duration) -
|
||||||
|
(reversed_source ? source_node.reverse_duration : source_node.forward_duration)) /
|
||||||
|
10.;
|
||||||
|
BOOST_ASSERT(duration >= 0);
|
||||||
|
auto weight =
|
||||||
|
std::abs((reversed_target ? target_node.reverse_weight : target_node.forward_weight) -
|
||||||
|
(reversed_source ? source_node.reverse_weight : source_node.forward_weight)) /
|
||||||
|
facade.GetWeightMultiplier();
|
||||||
|
BOOST_ASSERT(weight >= 0);
|
||||||
|
|
||||||
|
geometry.annotations.emplace_back(
|
||||||
|
LegGeometry::Annotation{current_distance,
|
||||||
|
duration,
|
||||||
|
weight,
|
||||||
|
forward_datasources[target_node.fwd_segment_position]});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
geometry.annotations.emplace_back(LegGeometry::Annotation{
|
||||||
|
current_distance,
|
||||||
|
(reversed_target ? target_node.reverse_duration : target_node.forward_duration) / 10.,
|
||||||
|
(reversed_target ? target_node.reverse_weight : target_node.forward_weight) /
|
||||||
|
facade.GetWeightMultiplier(),
|
||||||
|
forward_datasources[target_node.fwd_segment_position]});
|
||||||
|
}
|
||||||
|
|
||||||
geometry.segment_offsets.push_back(geometry.locations.size());
|
geometry.segment_offsets.push_back(geometry.locations.size());
|
||||||
geometry.locations.push_back(target_node.location);
|
geometry.locations.push_back(target_node.location);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#ifndef ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
#ifndef ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
||||||
#define ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
#define ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
|
#include "extractor/turn_lane_types.hpp"
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
#include "engine/datafacade/datafacade_base.hpp"
|
#include "engine/datafacade/datafacade_base.hpp"
|
||||||
#include "engine/guidance/leg_geometry.hpp"
|
#include "engine/guidance/leg_geometry.hpp"
|
||||||
#include "engine/guidance/route_step.hpp"
|
#include "engine/guidance/route_step.hpp"
|
||||||
@@ -83,7 +83,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
StepManeuver maneuver{source_node.location,
|
StepManeuver maneuver{source_node.location,
|
||||||
bearings.first,
|
bearings.first,
|
||||||
bearings.second,
|
bearings.second,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
osrm::guidance::TurnInstruction::NO_TURN(),
|
||||||
WaypointType::Depart,
|
WaypointType::Depart,
|
||||||
0};
|
0};
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
segment_weight += path_point.weight_until_turn;
|
segment_weight += path_point.weight_until_turn;
|
||||||
|
|
||||||
// all changes to this check have to be matched with assemble_geometry
|
// all changes to this check have to be matched with assemble_geometry
|
||||||
if (path_point.turn_instruction.type != extractor::guidance::TurnType::NoTurn)
|
if (path_point.turn_instruction.type != osrm::guidance::TurnType::NoTurn)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(segment_weight >= 0);
|
BOOST_ASSERT(segment_weight >= 0);
|
||||||
const auto name = facade.GetNameForID(step_name_id);
|
const auto name = facade.GetNameForID(step_name_id);
|
||||||
@@ -127,7 +127,8 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
// intersections contain the classes of exiting road
|
// intersections contain the classes of exiting road
|
||||||
intersection.classes = facade.GetClasses(path_point.classes);
|
intersection.classes = facade.GetClasses(path_point.classes);
|
||||||
|
|
||||||
steps.push_back(RouteStep{step_name_id,
|
steps.push_back(RouteStep{path_point.from_edge_based_node,
|
||||||
|
step_name_id,
|
||||||
is_segregated,
|
is_segregated,
|
||||||
name.to_string(),
|
name.to_string(),
|
||||||
ref.to_string(),
|
ref.to_string(),
|
||||||
@@ -171,7 +172,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
intersection.lane_description =
|
intersection.lane_description =
|
||||||
path_point.lane_data.second != INVALID_LANE_DESCRIPTIONID
|
path_point.lane_data.second != INVALID_LANE_DESCRIPTIONID
|
||||||
? facade.GetTurnDescription(path_point.lane_data.second)
|
? facade.GetTurnDescription(path_point.lane_data.second)
|
||||||
: extractor::guidance::TurnLaneDescription();
|
: extractor::TurnLaneDescription();
|
||||||
|
|
||||||
// Lanes in turn are bound by total number of lanes at the location
|
// Lanes in turn are bound by total number of lanes at the location
|
||||||
BOOST_ASSERT(intersection.lanes.lanes_in_turn <=
|
BOOST_ASSERT(intersection.lanes.lanes_in_turn <=
|
||||||
@@ -209,7 +210,8 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
// intersections contain the classes of exiting road
|
// intersections contain the classes of exiting road
|
||||||
intersection.classes = facade.GetClasses(facade.GetClassData(target_node_id));
|
intersection.classes = facade.GetClasses(facade.GetClassData(target_node_id));
|
||||||
BOOST_ASSERT(duration >= 0);
|
BOOST_ASSERT(duration >= 0);
|
||||||
steps.push_back(RouteStep{step_name_id,
|
steps.push_back(RouteStep{leg_data[leg_data.size() - 1].from_edge_based_node,
|
||||||
|
step_name_id,
|
||||||
is_segregated,
|
is_segregated,
|
||||||
facade.GetNameForID(step_name_id).to_string(),
|
facade.GetNameForID(step_name_id).to_string(),
|
||||||
facade.GetRefForID(step_name_id).to_string(),
|
facade.GetRefForID(step_name_id).to_string(),
|
||||||
@@ -253,7 +255,8 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
BOOST_ASSERT(target_duration >= source_duration || weight == 0);
|
BOOST_ASSERT(target_duration >= source_duration || weight == 0);
|
||||||
const EdgeWeight duration = std::max(0, target_duration - source_duration);
|
const EdgeWeight duration = std::max(0, target_duration - source_duration);
|
||||||
|
|
||||||
steps.push_back(RouteStep{source_name_id,
|
steps.push_back(RouteStep{source_node_id,
|
||||||
|
source_name_id,
|
||||||
is_segregated,
|
is_segregated,
|
||||||
facade.GetNameForID(source_name_id).to_string(),
|
facade.GetNameForID(source_name_id).to_string(),
|
||||||
facade.GetRefForID(source_name_id).to_string(),
|
facade.GetRefForID(source_name_id).to_string(),
|
||||||
@@ -290,12 +293,13 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
maneuver = {intersection.location,
|
maneuver = {intersection.location,
|
||||||
bearings.first,
|
bearings.first,
|
||||||
bearings.second,
|
bearings.second,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
osrm::guidance::TurnInstruction::NO_TURN(),
|
||||||
WaypointType::Arrive,
|
WaypointType::Arrive,
|
||||||
0};
|
0};
|
||||||
|
|
||||||
BOOST_ASSERT(!leg_geometry.locations.empty());
|
BOOST_ASSERT(!leg_geometry.locations.empty());
|
||||||
steps.push_back(RouteStep{target_name_id,
|
steps.push_back(RouteStep{target_node_id,
|
||||||
|
target_name_id,
|
||||||
facade.IsSegregated(target_node_id),
|
facade.IsSegregated(target_node_id),
|
||||||
facade.GetNameForID(target_name_id).to_string(),
|
facade.GetNameForID(target_name_id).to_string(),
|
||||||
facade.GetRefForID(target_name_id).to_string(),
|
facade.GetRefForID(target_name_id).to_string(),
|
||||||
|
|||||||
@@ -77,10 +77,10 @@ struct AdjustToCombinedTurnStrategy : CombineStrategy
|
|||||||
// Set a fixed instruction type
|
// Set a fixed instruction type
|
||||||
struct SetFixedInstructionStrategy : CombineStrategy
|
struct SetFixedInstructionStrategy : CombineStrategy
|
||||||
{
|
{
|
||||||
SetFixedInstructionStrategy(const extractor::guidance::TurnInstruction instruction);
|
SetFixedInstructionStrategy(const osrm::guidance::TurnInstruction instruction);
|
||||||
void operator()(RouteStep &step_at_turn_location, const RouteStep &transfer_from_step) const;
|
void operator()(RouteStep &step_at_turn_location, const RouteStep &transfer_from_step) const;
|
||||||
|
|
||||||
const extractor::guidance::TurnInstruction instruction;
|
const osrm::guidance::TurnInstruction instruction;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handling of staggered intersections
|
// Handling of staggered intersections
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef OSRM_ENGINE_GUIDANCE_COLLAPSING_UTILITY_HPP_
|
#ifndef OSRM_ENGINE_GUIDANCE_COLLAPSING_UTILITY_HPP_
|
||||||
#define OSRM_ENGINE_GUIDANCE_COLLAPSING_UTILITY_HPP_
|
#define OSRM_ENGINE_GUIDANCE_COLLAPSING_UTILITY_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "guidance/turn_instruction.hpp"
|
||||||
#include "engine/guidance/route_step.hpp"
|
#include "engine/guidance/route_step.hpp"
|
||||||
#include "util/attributes.hpp"
|
#include "util/attributes.hpp"
|
||||||
#include "util/bearing.hpp"
|
#include "util/bearing.hpp"
|
||||||
@@ -10,9 +10,6 @@
|
|||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
#include <boost/range/algorithm_ext/erase.hpp>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
using osrm::extractor::guidance::TurnInstruction;
|
|
||||||
using namespace osrm::extractor::guidance;
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace engine
|
namespace engine
|
||||||
@@ -30,7 +27,7 @@ const constexpr double NAME_SEGMENT_CUTOFF_LENGTH = 105.0;
|
|||||||
// check if a step is completely without turn type
|
// check if a step is completely without turn type
|
||||||
inline bool hasTurnType(const RouteStep &step)
|
inline bool hasTurnType(const RouteStep &step)
|
||||||
{
|
{
|
||||||
return step.maneuver.instruction.type != TurnType::NoTurn;
|
return step.maneuver.instruction.type != osrm::guidance::TurnType::NoTurn;
|
||||||
}
|
}
|
||||||
inline bool hasWaypointType(const RouteStep &step)
|
inline bool hasWaypointType(const RouteStep &step)
|
||||||
{
|
{
|
||||||
@@ -67,12 +64,13 @@ inline RouteStepIterator findNextTurn(RouteStepIterator current_step)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// alias for comparisons
|
// alias for comparisons
|
||||||
inline bool hasTurnType(const RouteStep &step, const TurnType::Enum type)
|
inline bool hasTurnType(const RouteStep &step, const osrm::guidance::TurnType::Enum type)
|
||||||
{
|
{
|
||||||
return type == step.maneuver.instruction.type;
|
return type == step.maneuver.instruction.type;
|
||||||
}
|
}
|
||||||
// alias for comparisons
|
// alias for comparisons
|
||||||
inline bool hasModifier(const RouteStep &step, const DirectionModifier::Enum modifier)
|
inline bool hasModifier(const RouteStep &step,
|
||||||
|
const osrm::guidance::DirectionModifier::Enum modifier)
|
||||||
{
|
{
|
||||||
return modifier == step.maneuver.instruction.direction_modifier;
|
return modifier == step.maneuver.instruction.direction_modifier;
|
||||||
}
|
}
|
||||||
@@ -96,12 +94,12 @@ inline std::size_t numberOfAllowedTurns(const RouteStep &step)
|
|||||||
// fulfill:
|
// fulfill:
|
||||||
inline bool isTrafficLightStep(const RouteStep &step)
|
inline bool isTrafficLightStep(const RouteStep &step)
|
||||||
{
|
{
|
||||||
return hasTurnType(step, TurnType::Suppressed) && numberOfAvailableTurns(step) == 2 &&
|
return hasTurnType(step, osrm::guidance::TurnType::Suppressed) &&
|
||||||
numberOfAllowedTurns(step) == 1;
|
numberOfAvailableTurns(step) == 2 && numberOfAllowedTurns(step) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// alias for readability
|
// alias for readability
|
||||||
inline void setInstructionType(RouteStep &step, const TurnType::Enum type)
|
inline void setInstructionType(RouteStep &step, const osrm::guidance::TurnType::Enum type)
|
||||||
{
|
{
|
||||||
step.maneuver.instruction.type = type;
|
step.maneuver.instruction.type = type;
|
||||||
}
|
}
|
||||||
@@ -151,12 +149,12 @@ inline bool haveSameName(const RouteStep &lhs, const RouteStep &rhs)
|
|||||||
inline bool areSameSide(const RouteStep &lhs, const RouteStep &rhs)
|
inline bool areSameSide(const RouteStep &lhs, const RouteStep &rhs)
|
||||||
{
|
{
|
||||||
const auto is_left = [](const RouteStep &step) {
|
const auto is_left = [](const RouteStep &step) {
|
||||||
return hasModifier(step, DirectionModifier::Straight) ||
|
return hasModifier(step, osrm::guidance::DirectionModifier::Straight) ||
|
||||||
hasLeftModifier(step.maneuver.instruction);
|
hasLeftModifier(step.maneuver.instruction);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto is_right = [](const RouteStep &step) {
|
const auto is_right = [](const RouteStep &step) {
|
||||||
return hasModifier(step, DirectionModifier::Straight) ||
|
return hasModifier(step, osrm::guidance::DirectionModifier::Straight) ||
|
||||||
hasRightModifier(step.maneuver.instruction);
|
hasRightModifier(step.maneuver.instruction);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -174,7 +172,7 @@ inline std::vector<RouteStep> removeNoTurnInstructions(std::vector<RouteStep> st
|
|||||||
|
|
||||||
// keep valid instructions
|
// keep valid instructions
|
||||||
const auto not_is_valid = [](const RouteStep &step) {
|
const auto not_is_valid = [](const RouteStep &step) {
|
||||||
return step.maneuver.instruction == TurnInstruction::NO_TURN() &&
|
return step.maneuver.instruction == osrm::guidance::TurnInstruction::NO_TURN() &&
|
||||||
step.maneuver.waypoint_type == WaypointType::None;
|
step.maneuver.waypoint_type == WaypointType::None;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef ENGINE_GUIDANCE_POST_PROCESSING_HPP
|
#ifndef ENGINE_GUIDANCE_POST_PROCESSING_HPP
|
||||||
#define ENGINE_GUIDANCE_POST_PROCESSING_HPP
|
#define ENGINE_GUIDANCE_POST_PROCESSING_HPP
|
||||||
|
|
||||||
|
#include "engine/datafacade/datafacade_base.hpp"
|
||||||
#include "engine/guidance/leg_geometry.hpp"
|
#include "engine/guidance/leg_geometry.hpp"
|
||||||
#include "engine/guidance/route_step.hpp"
|
#include "engine/guidance/route_step.hpp"
|
||||||
#include "engine/phantom_node.hpp"
|
#include "engine/phantom_node.hpp"
|
||||||
@@ -45,6 +46,18 @@ std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps);
|
|||||||
OSRM_ATTR_WARN_UNUSED
|
OSRM_ATTR_WARN_UNUSED
|
||||||
LegGeometry resyncGeometry(LegGeometry leg_geometry, const std::vector<RouteStep> &steps);
|
LegGeometry resyncGeometry(LegGeometry leg_geometry, const std::vector<RouteStep> &steps);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply maneuver override relations to the selected route.
|
||||||
|
* Should be called before any other post-processing is performed
|
||||||
|
* to ensure that all sequences of edge-based-nodes are still in the
|
||||||
|
* steps list.
|
||||||
|
*
|
||||||
|
* @param steps the steps of the route
|
||||||
|
*/
|
||||||
|
void applyOverrides(const datafacade::BaseDataFacade &facade,
|
||||||
|
std::vector<RouteStep> &steps,
|
||||||
|
const LegGeometry &geometry);
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef OSRM_ENGINE_GUIDANCE_POSTPROCESSING_TOOLKIT_HPP_
|
#ifndef OSRM_ENGINE_GUIDANCE_POSTPROCESSING_TOOLKIT_HPP_
|
||||||
#define OSRM_ENGINE_GUIDANCE_POSTPROCESSING_TOOLKIT_HPP_
|
#define OSRM_ENGINE_GUIDANCE_POSTPROCESSING_TOOLKIT_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "guidance/turn_instruction.hpp"
|
||||||
#include "engine/guidance/route_step.hpp"
|
#include "engine/guidance/route_step.hpp"
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#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 "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/turn_lane_types.hpp"
|
||||||
#include "util/guidance/turn_lanes.hpp"
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
@@ -41,7 +41,7 @@ struct IntermediateIntersection
|
|||||||
|
|
||||||
// turn lane information
|
// turn lane information
|
||||||
util::guidance::LaneTuple lanes;
|
util::guidance::LaneTuple lanes;
|
||||||
extractor::guidance::TurnLaneDescription lane_description;
|
extractor::TurnLaneDescription lane_description;
|
||||||
std::vector<std::string> classes;
|
std::vector<std::string> classes;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -59,6 +59,7 @@ inline IntermediateIntersection getInvalidIntersection()
|
|||||||
|
|
||||||
struct RouteStep
|
struct RouteStep
|
||||||
{
|
{
|
||||||
|
NodeID from_id;
|
||||||
unsigned name_id;
|
unsigned name_id;
|
||||||
bool is_segregated;
|
bool is_segregated;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef ENGINE_GUIDANCE_STEP_MANEUVER_HPP
|
#ifndef ENGINE_GUIDANCE_STEP_MANEUVER_HPP
|
||||||
#define ENGINE_GUIDANCE_STEP_MANEUVER_HPP
|
#define ENGINE_GUIDANCE_STEP_MANEUVER_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "guidance/turn_instruction.hpp"
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -28,7 +28,7 @@ struct StepManeuver
|
|||||||
util::Coordinate location;
|
util::Coordinate location;
|
||||||
short bearing_before;
|
short bearing_before;
|
||||||
short bearing_after;
|
short bearing_after;
|
||||||
extractor::guidance::TurnInstruction instruction;
|
osrm::guidance::TurnInstruction instruction;
|
||||||
|
|
||||||
WaypointType waypoint_type;
|
WaypointType waypoint_type;
|
||||||
unsigned exit;
|
unsigned exit;
|
||||||
@@ -39,7 +39,7 @@ inline StepManeuver getInvalidStepManeuver()
|
|||||||
return {util::Coordinate{util::FloatLongitude{0.0}, util::FloatLatitude{0.0}},
|
return {util::Coordinate{util::FloatLongitude{0.0}, util::FloatLatitude{0.0}},
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
osrm::guidance::TurnInstruction::NO_TURN(),
|
||||||
WaypointType::None,
|
WaypointType::None,
|
||||||
0};
|
0};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
#define RAW_ROUTE_DATA_H
|
#define RAW_ROUTE_DATA_H
|
||||||
|
|
||||||
#include "extractor/class_data.hpp"
|
#include "extractor/class_data.hpp"
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
|
|
||||||
|
#include "guidance/turn_bearing.hpp"
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
|
|
||||||
#include "engine/phantom_node.hpp"
|
#include "engine/phantom_node.hpp"
|
||||||
|
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.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/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
@@ -23,7 +24,9 @@ namespace engine
|
|||||||
|
|
||||||
struct PathData
|
struct PathData
|
||||||
{
|
{
|
||||||
// id of via node of the turn
|
// from edge-based-node id
|
||||||
|
NodeID from_edge_based_node;
|
||||||
|
// the internal OSRM id of the OSM node id that is the via node of the turn
|
||||||
NodeID turn_via_node;
|
NodeID turn_via_node;
|
||||||
// name of the street that leads to the turn
|
// name of the street that leads to the turn
|
||||||
unsigned name_id;
|
unsigned name_id;
|
||||||
@@ -42,7 +45,7 @@ struct PathData
|
|||||||
// will contain the duration of the turn. Otherwise it will be 0.
|
// will contain the duration of the turn. Otherwise it will be 0.
|
||||||
EdgeWeight duration_of_turn;
|
EdgeWeight duration_of_turn;
|
||||||
// instruction to execute at the turn
|
// instruction to execute at the turn
|
||||||
extractor::guidance::TurnInstruction turn_instruction;
|
osrm::guidance::TurnInstruction turn_instruction;
|
||||||
// turn lane data
|
// turn lane data
|
||||||
util::guidance::LaneTupleIdPair lane_data;
|
util::guidance::LaneTupleIdPair lane_data;
|
||||||
// travel mode of the street that leads to the turn
|
// travel mode of the street that leads to the turn
|
||||||
@@ -56,9 +59,9 @@ struct PathData
|
|||||||
DatasourceID datasource_id;
|
DatasourceID datasource_id;
|
||||||
|
|
||||||
// bearing (as seen from the intersection) pre-turn
|
// bearing (as seen from the intersection) pre-turn
|
||||||
util::guidance::TurnBearing pre_turn_bearing;
|
osrm::guidance::TurnBearing pre_turn_bearing;
|
||||||
// bearing (as seen from the intersection) post-turn
|
// bearing (as seen from the intersection) post-turn
|
||||||
util::guidance::TurnBearing post_turn_bearing;
|
osrm::guidance::TurnBearing post_turn_bearing;
|
||||||
|
|
||||||
// Driving side of the turn
|
// Driving side of the turn
|
||||||
bool is_left_hand_driving;
|
bool is_left_hand_driving;
|
||||||
@@ -142,11 +145,32 @@ inline InternalRouteResult CollapseInternalRouteResult(const InternalRouteResult
|
|||||||
collapsed.target_traversed_in_reverse.back() =
|
collapsed.target_traversed_in_reverse.back() =
|
||||||
leggy_result.target_traversed_in_reverse[i];
|
leggy_result.target_traversed_in_reverse[i];
|
||||||
// copy path segments into current leg
|
// copy path segments into current leg
|
||||||
last_segment.insert(last_segment.end(),
|
if (!leggy_result.unpacked_path_segments[i].empty())
|
||||||
leggy_result.unpacked_path_segments[i].begin(),
|
{
|
||||||
leggy_result.unpacked_path_segments[i].end());
|
auto old_size = last_segment.size();
|
||||||
|
last_segment.insert(last_segment.end(),
|
||||||
|
leggy_result.unpacked_path_segments[i].begin(),
|
||||||
|
leggy_result.unpacked_path_segments[i].end());
|
||||||
|
|
||||||
|
// The first segment of the unpacked path is missing the weight of the
|
||||||
|
// source phantom. We need to add those values back so that the total
|
||||||
|
// edge weight is correct
|
||||||
|
last_segment[old_size].weight_until_turn +=
|
||||||
|
|
||||||
|
leggy_result.source_traversed_in_reverse[i]
|
||||||
|
? leggy_result.segment_end_coordinates[i].source_phantom.reverse_weight
|
||||||
|
: leggy_result.segment_end_coordinates[i].source_phantom.forward_weight;
|
||||||
|
|
||||||
|
last_segment[old_size].duration_until_turn +=
|
||||||
|
leggy_result.source_traversed_in_reverse[i]
|
||||||
|
? leggy_result.segment_end_coordinates[i].source_phantom.reverse_duration
|
||||||
|
: leggy_result.segment_end_coordinates[i].source_phantom.forward_duration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_ASSERT(collapsed.segment_end_coordinates.size() ==
|
||||||
|
collapsed.unpacked_path_segments.size());
|
||||||
return collapsed;
|
return collapsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,21 +25,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PHANTOM_NODES_H
|
#ifndef OSRM_ENGINE_PHANTOM_NODES_H
|
||||||
#define PHANTOM_NODES_H
|
#define OSRM_ENGINE_PHANTOM_NODES_H
|
||||||
|
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "util/typedefs.hpp"
|
|
||||||
|
|
||||||
#include "util/bearing.hpp"
|
#include "util/bearing.hpp"
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <utility>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace engine
|
namespace engine
|
||||||
@@ -199,31 +195,6 @@ struct PhantomNodes
|
|||||||
PhantomNode source_phantom;
|
PhantomNode source_phantom;
|
||||||
PhantomNode target_phantom;
|
PhantomNode target_phantom;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::ostream &operator<<(std::ostream &out, const PhantomNodes &pn)
|
|
||||||
{
|
|
||||||
out << "source_coord: " << pn.source_phantom.location << "\n";
|
|
||||||
out << "target_coord: " << pn.target_phantom.location << std::endl;
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::ostream &operator<<(std::ostream &out, const PhantomNode &pn)
|
|
||||||
{
|
|
||||||
out << "node1: " << pn.forward_segment_id.id << ", "
|
|
||||||
<< "node2: " << pn.reverse_segment_id.id << ", "
|
|
||||||
<< "fwd-w: " << pn.forward_weight << ", "
|
|
||||||
<< "rev-w: " << pn.reverse_weight << ", "
|
|
||||||
<< "fwd-o: " << pn.forward_weight_offset << ", "
|
|
||||||
<< "rev-o: " << pn.reverse_weight_offset << ", "
|
|
||||||
<< "fwd-d: " << pn.forward_duration << ", "
|
|
||||||
<< "rev-d: " << pn.reverse_duration << ", "
|
|
||||||
<< "fwd-do: " << pn.forward_duration_offset << ", "
|
|
||||||
<< "rev-do: " << pn.reverse_duration_offset << ", "
|
|
||||||
<< "comp: " << pn.component.is_tiny << " / " << pn.component.id << ", "
|
|
||||||
<< "pos: " << pn.fwd_segment_position << ", "
|
|
||||||
<< "loc: " << pn.location;
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#ifndef OSRM_ENGINE_ROUTING_BASE_HPP
|
#ifndef OSRM_ENGINE_ROUTING_BASE_HPP
|
||||||
#define OSRM_ENGINE_ROUTING_BASE_HPP
|
#define OSRM_ENGINE_ROUTING_BASE_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "guidance/turn_bearing.hpp"
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
|
|
||||||
#include "engine/algorithm.hpp"
|
#include "engine/algorithm.hpp"
|
||||||
#include "engine/datafacade.hpp"
|
#include "engine/datafacade.hpp"
|
||||||
@@ -10,7 +11,6 @@
|
|||||||
#include "engine/search_engine_data.hpp"
|
#include "engine/search_engine_data.hpp"
|
||||||
|
|
||||||
#include "util/coordinate_calculation.hpp"
|
#include "util/coordinate_calculation.hpp"
|
||||||
#include "util/guidance/turn_bearing.hpp"
|
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
@@ -192,21 +192,22 @@ void annotatePath(const FacadeT &facade,
|
|||||||
BOOST_ASSERT(start_index < end_index);
|
BOOST_ASSERT(start_index < end_index);
|
||||||
for (std::size_t segment_idx = start_index; segment_idx < end_index; ++segment_idx)
|
for (std::size_t segment_idx = start_index; segment_idx < end_index; ++segment_idx)
|
||||||
{
|
{
|
||||||
unpacked_path.push_back(PathData{id_vector[segment_idx + 1],
|
unpacked_path.push_back(PathData{*node_from,
|
||||||
|
id_vector[segment_idx + 1],
|
||||||
name_index,
|
name_index,
|
||||||
is_segregated,
|
is_segregated,
|
||||||
weight_vector[segment_idx],
|
weight_vector[segment_idx],
|
||||||
0,
|
0,
|
||||||
duration_vector[segment_idx],
|
duration_vector[segment_idx],
|
||||||
0,
|
0,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
guidance::TurnInstruction::NO_TURN(),
|
||||||
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
||||||
travel_mode,
|
travel_mode,
|
||||||
classes,
|
classes,
|
||||||
EMPTY_ENTRY_CLASS,
|
EMPTY_ENTRY_CLASS,
|
||||||
datasource_vector[segment_idx],
|
datasource_vector[segment_idx],
|
||||||
util::guidance::TurnBearing(0),
|
osrm::guidance::TurnBearing(0),
|
||||||
util::guidance::TurnBearing(0),
|
osrm::guidance::TurnBearing(0),
|
||||||
is_left_hand_driving});
|
is_left_hand_driving});
|
||||||
}
|
}
|
||||||
BOOST_ASSERT(unpacked_path.size() > 0);
|
BOOST_ASSERT(unpacked_path.size() > 0);
|
||||||
@@ -266,21 +267,22 @@ void annotatePath(const FacadeT &facade,
|
|||||||
BOOST_ASSERT(segment_idx < id_vector.size() - 1);
|
BOOST_ASSERT(segment_idx < id_vector.size() - 1);
|
||||||
BOOST_ASSERT(facade.GetTravelMode(target_node_id) > 0);
|
BOOST_ASSERT(facade.GetTravelMode(target_node_id) > 0);
|
||||||
unpacked_path.push_back(
|
unpacked_path.push_back(
|
||||||
PathData{id_vector[start_index < end_index ? segment_idx + 1 : segment_idx - 1],
|
PathData{target_node_id,
|
||||||
|
id_vector[start_index < end_index ? segment_idx + 1 : segment_idx - 1],
|
||||||
facade.GetNameIndex(target_node_id),
|
facade.GetNameIndex(target_node_id),
|
||||||
facade.IsSegregated(target_node_id),
|
facade.IsSegregated(target_node_id),
|
||||||
weight_vector[segment_idx],
|
weight_vector[segment_idx],
|
||||||
0,
|
0,
|
||||||
duration_vector[segment_idx],
|
duration_vector[segment_idx],
|
||||||
0,
|
0,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
guidance::TurnInstruction::NO_TURN(),
|
||||||
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
|
||||||
facade.GetTravelMode(target_node_id),
|
facade.GetTravelMode(target_node_id),
|
||||||
facade.GetClassData(target_node_id),
|
facade.GetClassData(target_node_id),
|
||||||
EMPTY_ENTRY_CLASS,
|
EMPTY_ENTRY_CLASS,
|
||||||
datasource_vector[segment_idx],
|
datasource_vector[segment_idx],
|
||||||
util::guidance::TurnBearing(0),
|
guidance::TurnBearing(0),
|
||||||
util::guidance::TurnBearing(0),
|
guidance::TurnBearing(0),
|
||||||
is_target_left_hand_driving});
|
is_target_left_hand_driving});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ struct TurnData final
|
|||||||
const int turn_angle;
|
const int turn_angle;
|
||||||
const EdgeWeight weight;
|
const EdgeWeight weight;
|
||||||
const EdgeWeight duration;
|
const EdgeWeight duration;
|
||||||
const extractor::guidance::TurnInstruction turn_instruction;
|
const guidance::TurnInstruction turn_instruction;
|
||||||
};
|
};
|
||||||
|
|
||||||
using RTreeLeaf = datafacade::BaseDataFacade::RTreeLeaf;
|
using RTreeLeaf = datafacade::BaseDataFacade::RTreeLeaf;
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
@@ -41,8 +39,8 @@ class CompressedEdgeContainer
|
|||||||
const EdgeDuration duration2,
|
const EdgeDuration duration2,
|
||||||
// node-penalties can be added before/or after the traversal of an edge which
|
// node-penalties can be added before/or after the traversal of an edge which
|
||||||
// depends on whether we traverse the link forwards or backwards.
|
// depends on whether we traverse the link forwards or backwards.
|
||||||
const boost::optional<EdgeWeight> node_weight_penalty = boost::none,
|
const EdgeWeight node_weight_penalty = INVALID_EDGE_WEIGHT,
|
||||||
const boost::optional<EdgeDuration> node_duration_penalty = boost::none);
|
const EdgeDuration node_duration_penalty = MAXIMAL_EDGE_DURATION);
|
||||||
|
|
||||||
void AddUncompressedEdge(const EdgeID edge_id,
|
void AddUncompressedEdge(const EdgeID edge_id,
|
||||||
const NodeID target_node,
|
const NodeID target_node,
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
#include "extractor/edge_based_edge.hpp"
|
#include "extractor/edge_based_edge.hpp"
|
||||||
#include "extractor/edge_based_node_segment.hpp"
|
#include "extractor/edge_based_node_segment.hpp"
|
||||||
#include "extractor/extraction_turn.hpp"
|
#include "extractor/extraction_turn.hpp"
|
||||||
#include "extractor/guidance/turn_analysis.hpp"
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "extractor/nbg_to_ebg.hpp"
|
#include "extractor/nbg_to_ebg.hpp"
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
#include "extractor/original_edge_data.hpp"
|
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/query_node.hpp"
|
||||||
#include "extractor/restriction_index.hpp"
|
#include "extractor/restriction_index.hpp"
|
||||||
|
#include "extractor/turn_lane_types.hpp"
|
||||||
#include "extractor/way_restriction_map.hpp"
|
#include "extractor/way_restriction_map.hpp"
|
||||||
|
#include "guidance/turn_analysis.hpp"
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
|
|
||||||
#include "util/concurrent_id_map.hpp"
|
#include "util/concurrent_id_map.hpp"
|
||||||
#include "util/deallocating_vector.hpp"
|
#include "util/deallocating_vector.hpp"
|
||||||
@@ -76,31 +76,26 @@ class EdgeBasedGraphFactory
|
|||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const std::unordered_set<EdgeID> &segregated_edges,
|
const std::unordered_set<EdgeID> &segregated_edges,
|
||||||
guidance::LaneDescriptionMap &lane_description_map);
|
const LaneDescriptionMap &lane_description_map);
|
||||||
|
|
||||||
void Run(ScriptingEnvironment &scripting_environment,
|
void Run(ScriptingEnvironment &scripting_environment,
|
||||||
const std::string &turn_data_filename,
|
|
||||||
const std::string &turn_lane_data_filename,
|
|
||||||
const std::string &turn_weight_penalties_filename,
|
const std::string &turn_weight_penalties_filename,
|
||||||
const std::string &turn_duration_penalties_filename,
|
const std::string &turn_duration_penalties_filename,
|
||||||
const std::string &turn_penalties_index_filename,
|
const std::string &turn_penalties_index_filename,
|
||||||
const std::string &cnbg_ebg_mapping_path,
|
const std::string &cnbg_ebg_mapping_path,
|
||||||
const std::string &conditional_penalties_filename,
|
const std::string &conditional_penalties_filename,
|
||||||
|
const std::string &maneuver_overrides_filename,
|
||||||
const RestrictionMap &node_restriction_map,
|
const RestrictionMap &node_restriction_map,
|
||||||
const ConditionalRestrictionMap &conditional_restriction_map,
|
const ConditionalRestrictionMap &conditional_restriction_map,
|
||||||
const WayRestrictionMap &way_restriction_map);
|
const WayRestrictionMap &way_restriction_map,
|
||||||
|
const std::vector<UnresolvedManeuverOverride> &maneuver_overrides);
|
||||||
|
|
||||||
// The following get access functions destroy the content in the factory
|
// The following get access functions destroy the content in the factory
|
||||||
void GetEdgeBasedEdges(util::DeallocatingVector<EdgeBasedEdge> &edges);
|
void GetEdgeBasedEdges(util::DeallocatingVector<EdgeBasedEdge> &edges);
|
||||||
void GetEdgeBasedNodeSegments(std::vector<EdgeBasedNodeSegment> &nodes);
|
void GetEdgeBasedNodeSegments(std::vector<EdgeBasedNodeSegment> &nodes);
|
||||||
void GetStartPointMarkers(std::vector<bool> &node_is_startpoint);
|
void GetStartPointMarkers(std::vector<bool> &node_is_startpoint);
|
||||||
void GetEdgeBasedNodeWeights(std::vector<EdgeWeight> &output_node_weights);
|
void GetEdgeBasedNodeWeights(std::vector<EdgeWeight> &output_node_weights);
|
||||||
|
std::uint32_t GetConnectivityChecksum() const;
|
||||||
// These access functions don't destroy the content
|
|
||||||
const std::vector<BearingClassID> &GetBearingClassIds() const;
|
|
||||||
std::vector<BearingClassID> &GetBearingClassIds();
|
|
||||||
std::vector<util::guidance::BearingClass> GetBearingClasses() const;
|
|
||||||
std::vector<util::guidance::EntryClass> GetEntryClasses() const;
|
|
||||||
|
|
||||||
std::uint64_t GetNumberOfEdgeBasedNodes() const;
|
std::uint64_t GetNumberOfEdgeBasedNodes() const;
|
||||||
|
|
||||||
@@ -142,6 +137,7 @@ class EdgeBasedGraphFactory
|
|||||||
std::vector<EdgeBasedNodeSegment> m_edge_based_node_segments;
|
std::vector<EdgeBasedNodeSegment> m_edge_based_node_segments;
|
||||||
EdgeBasedNodeDataContainer &m_edge_based_node_container;
|
EdgeBasedNodeDataContainer &m_edge_based_node_container;
|
||||||
util::DeallocatingVector<EdgeBasedEdge> m_edge_based_edge_list;
|
util::DeallocatingVector<EdgeBasedEdge> m_edge_based_edge_list;
|
||||||
|
std::uint32_t m_connectivity_checksum;
|
||||||
|
|
||||||
// The number of edge-based nodes is mostly made up out of the edges in the node-based graph.
|
// The number of edge-based nodes is mostly made up out of the edges in the node-based graph.
|
||||||
// Any edge in the node-based graph represents a node in the edge-based graph. In addition, we
|
// Any edge in the node-based graph represents a node in the edge-based graph. In addition, we
|
||||||
@@ -159,7 +155,7 @@ class EdgeBasedGraphFactory
|
|||||||
|
|
||||||
const util::NameTable &name_table;
|
const util::NameTable &name_table;
|
||||||
const std::unordered_set<EdgeID> &segregated_edges;
|
const std::unordered_set<EdgeID> &segregated_edges;
|
||||||
guidance::LaneDescriptionMap &lane_description_map;
|
const LaneDescriptionMap &lane_description_map;
|
||||||
|
|
||||||
// In the edge based graph, any traversable (non reversed) edge of the node-based graph forms a
|
// In the edge based graph, any traversable (non reversed) edge of the node-based graph forms a
|
||||||
// node of the edge-based graph. To be able to name these nodes, we loop over the node-based
|
// node of the edge-based graph. To be able to name these nodes, we loop over the node-based
|
||||||
@@ -175,28 +171,22 @@ class EdgeBasedGraphFactory
|
|||||||
|
|
||||||
// Edge-expanded edges are generate for all valid turns. The validity can be checked via the
|
// Edge-expanded edges are generate for all valid turns. The validity can be checked via the
|
||||||
// restriction maps
|
// restriction maps
|
||||||
void GenerateEdgeExpandedEdges(ScriptingEnvironment &scripting_environment,
|
void
|
||||||
const std::string &original_edge_data_filename,
|
GenerateEdgeExpandedEdges(ScriptingEnvironment &scripting_environment,
|
||||||
const std::string &turn_lane_data_filename,
|
const std::string &turn_weight_penalties_filename,
|
||||||
const std::string &turn_weight_penalties_filename,
|
const std::string &turn_duration_penalties_filename,
|
||||||
const std::string &turn_duration_penalties_filename,
|
const std::string &turn_penalties_index_filename,
|
||||||
const std::string &turn_penalties_index_filename,
|
const std::string &conditional_turn_penalties_filename,
|
||||||
const std::string &conditional_turn_penalties_filename,
|
const std::string &maneuver_overrides_filename,
|
||||||
const RestrictionMap &node_restriction_map,
|
const RestrictionMap &node_restriction_map,
|
||||||
const ConditionalRestrictionMap &conditional_restriction_map,
|
const ConditionalRestrictionMap &conditional_restriction_map,
|
||||||
const WayRestrictionMap &way_restriction_map);
|
const WayRestrictionMap &way_restriction_map,
|
||||||
|
const std::vector<UnresolvedManeuverOverride> &maneuver_overrides);
|
||||||
|
|
||||||
NBGToEBG InsertEdgeBasedNode(const NodeID u, const NodeID v);
|
NBGToEBG InsertEdgeBasedNode(const NodeID u, const NodeID v);
|
||||||
|
|
||||||
std::size_t restricted_turns_counter;
|
|
||||||
std::size_t skipped_uturns_counter;
|
|
||||||
std::size_t skipped_barrier_turns_counter;
|
|
||||||
|
|
||||||
// mapping of node-based edges to edge-based nodes
|
// mapping of node-based edges to edge-based nodes
|
||||||
std::vector<NodeID> nbe_to_ebn_mapping;
|
std::vector<NodeID> nbe_to_ebn_mapping;
|
||||||
util::ConcurrentIDMap<util::guidance::BearingClass, BearingClassID> bearing_class_hash;
|
|
||||||
std::vector<BearingClassID> bearing_class_by_node_based_node;
|
|
||||||
util::ConcurrentIDMap<util::guidance::EntryClass, EntryClassID> entry_class_hash;
|
|
||||||
};
|
};
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace extractor
|
|||||||
class ExtractionContainers
|
class ExtractionContainers
|
||||||
{
|
{
|
||||||
void PrepareNodes();
|
void PrepareNodes();
|
||||||
|
void PrepareManeuverOverrides();
|
||||||
void PrepareRestrictions();
|
void PrepareRestrictions();
|
||||||
void PrepareEdges(ScriptingEnvironment &scripting_environment);
|
void PrepareEdges(ScriptingEnvironment &scripting_environment);
|
||||||
|
|
||||||
@@ -63,6 +64,9 @@ class ExtractionContainers
|
|||||||
std::vector<ConditionalTurnRestriction> conditional_turn_restrictions;
|
std::vector<ConditionalTurnRestriction> conditional_turn_restrictions;
|
||||||
std::vector<TurnRestriction> unconditional_turn_restrictions;
|
std::vector<TurnRestriction> unconditional_turn_restrictions;
|
||||||
|
|
||||||
|
std::vector<InputManeuverOverride> external_maneuver_overrides_list;
|
||||||
|
std::vector<UnresolvedManeuverOverride> internal_maneuver_overrides;
|
||||||
|
|
||||||
ExtractionContainers();
|
ExtractionContainers();
|
||||||
|
|
||||||
void PrepareData(ScriptingEnvironment &scripting_environment,
|
void PrepareData(ScriptingEnvironment &scripting_environment,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "extractor/guidance/parsing_toolkit.hpp"
|
#include "guidance/parsing_toolkit.hpp"
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -35,10 +35,10 @@ template <typename Iterator> struct iso_8601_grammar : qi::grammar<Iterator, uns
|
|||||||
using qi::_c;
|
using qi::_c;
|
||||||
using qi::_pass;
|
using qi::_pass;
|
||||||
using qi::_val;
|
using qi::_val;
|
||||||
|
using qi::char_;
|
||||||
using qi::eoi;
|
using qi::eoi;
|
||||||
using qi::eps;
|
using qi::eps;
|
||||||
using qi::uint_;
|
using qi::uint_;
|
||||||
using qi::char_;
|
|
||||||
|
|
||||||
hh = uint2_p[_pass = bind([](unsigned x) { return x < 24; }, _1), _val = _1];
|
hh = uint2_p[_pass = bind([](unsigned x) { return x < 24; }, _1), _val = _1];
|
||||||
mm = uint2_p[_pass = bind([](unsigned x) { return x < 60; }, _1), _val = _1];
|
mm = uint2_p[_pass = bind([](unsigned x) { return x < 60; }, _1), _val = _1];
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#ifndef OSRM_EXTRACTION_TURN_HPP
|
#ifndef OSRM_EXTRACTION_TURN_HPP
|
||||||
#define OSRM_EXTRACTION_TURN_HPP
|
#define OSRM_EXTRACTION_TURN_HPP
|
||||||
|
|
||||||
#include <boost/numeric/conversion/cast.hpp>
|
#include "extractor/road_classification.hpp"
|
||||||
|
#include "extractor/travel_mode.hpp"
|
||||||
|
|
||||||
#include <extractor/guidance/intersection.hpp>
|
#include <boost/numeric/conversion/cast.hpp>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@@ -12,35 +13,122 @@ namespace osrm
|
|||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
|
|
||||||
|
struct ExtractionTurnLeg
|
||||||
|
{
|
||||||
|
ExtractionTurnLeg(bool is_restricted,
|
||||||
|
bool is_motorway,
|
||||||
|
bool is_link,
|
||||||
|
int number_of_lanes,
|
||||||
|
int highway_turn_classification,
|
||||||
|
int access_turn_classification,
|
||||||
|
int speed,
|
||||||
|
RoadPriorityClass::Enum priority_class,
|
||||||
|
bool is_incoming,
|
||||||
|
bool is_outgoing)
|
||||||
|
: is_restricted(is_restricted), is_motorway(is_motorway), is_link(is_link),
|
||||||
|
number_of_lanes(number_of_lanes),
|
||||||
|
highway_turn_classification(highway_turn_classification),
|
||||||
|
access_turn_classification(access_turn_classification), speed(speed),
|
||||||
|
priority_class(priority_class), is_incoming(is_incoming), is_outgoing(is_outgoing)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool is_restricted;
|
||||||
|
const bool is_motorway;
|
||||||
|
const bool is_link;
|
||||||
|
const int number_of_lanes;
|
||||||
|
const int highway_turn_classification;
|
||||||
|
const int access_turn_classification;
|
||||||
|
const int speed;
|
||||||
|
const RoadPriorityClass::Enum priority_class;
|
||||||
|
const bool is_incoming;
|
||||||
|
const bool is_outgoing;
|
||||||
|
};
|
||||||
|
|
||||||
struct ExtractionTurn
|
struct ExtractionTurn
|
||||||
{
|
{
|
||||||
ExtractionTurn(double angle,
|
ExtractionTurn(double angle,
|
||||||
int number_of_roads,
|
int number_of_roads,
|
||||||
bool is_u_turn,
|
bool is_u_turn,
|
||||||
bool has_traffic_light,
|
bool has_traffic_light,
|
||||||
bool source_restricted,
|
|
||||||
bool target_restricted,
|
|
||||||
bool is_left_hand_driving,
|
bool is_left_hand_driving,
|
||||||
|
bool source_restricted,
|
||||||
TravelMode source_mode,
|
TravelMode source_mode,
|
||||||
TravelMode target_mode)
|
bool source_is_motorway,
|
||||||
|
bool source_is_link,
|
||||||
|
int source_number_of_lanes,
|
||||||
|
int source_highway_turn_classification,
|
||||||
|
int source_access_turn_classification,
|
||||||
|
int source_speed,
|
||||||
|
RoadPriorityClass::Enum source_priority_class,
|
||||||
|
|
||||||
|
bool target_restricted,
|
||||||
|
TravelMode target_mode,
|
||||||
|
bool target_is_motorway,
|
||||||
|
bool target_is_link,
|
||||||
|
int target_number_of_lanes,
|
||||||
|
int target_highway_turn_classification,
|
||||||
|
int target_access_turn_classification,
|
||||||
|
int target_speed,
|
||||||
|
RoadPriorityClass::Enum target_priority_class,
|
||||||
|
|
||||||
|
const std::vector<ExtractionTurnLeg> &roads_on_the_right,
|
||||||
|
const std::vector<ExtractionTurnLeg> &roads_on_the_left)
|
||||||
: angle(180. - angle), number_of_roads(number_of_roads), is_u_turn(is_u_turn),
|
: angle(180. - angle), number_of_roads(number_of_roads), is_u_turn(is_u_turn),
|
||||||
has_traffic_light(has_traffic_light), source_restricted(source_restricted),
|
has_traffic_light(has_traffic_light), is_left_hand_driving(is_left_hand_driving),
|
||||||
target_restricted(target_restricted), is_left_hand_driving(is_left_hand_driving),
|
|
||||||
weight(0.), duration(0.), source_mode(source_mode), target_mode(target_mode)
|
source_restricted(source_restricted), source_mode(source_mode),
|
||||||
|
source_is_motorway(source_is_motorway), source_is_link(source_is_link),
|
||||||
|
source_number_of_lanes(source_number_of_lanes),
|
||||||
|
source_highway_turn_classification(source_highway_turn_classification),
|
||||||
|
source_access_turn_classification(source_access_turn_classification),
|
||||||
|
source_speed(source_speed), source_priority_class(source_priority_class),
|
||||||
|
|
||||||
|
target_restricted(target_restricted), target_mode(target_mode),
|
||||||
|
target_is_motorway(target_is_motorway), target_is_link(target_is_link),
|
||||||
|
target_number_of_lanes(target_number_of_lanes),
|
||||||
|
target_highway_turn_classification(target_highway_turn_classification),
|
||||||
|
target_access_turn_classification(target_access_turn_classification),
|
||||||
|
target_speed(target_speed), target_priority_class(target_priority_class),
|
||||||
|
|
||||||
|
roads_on_the_right(roads_on_the_right), roads_on_the_left(roads_on_the_left), weight(0.),
|
||||||
|
duration(0.)
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const double angle;
|
const double angle;
|
||||||
const int number_of_roads;
|
const int number_of_roads;
|
||||||
const bool is_u_turn;
|
const bool is_u_turn;
|
||||||
const bool has_traffic_light;
|
const bool has_traffic_light;
|
||||||
const bool source_restricted;
|
|
||||||
const bool target_restricted;
|
|
||||||
const bool is_left_hand_driving;
|
const bool is_left_hand_driving;
|
||||||
|
|
||||||
|
// source info
|
||||||
|
const bool source_restricted;
|
||||||
|
const TravelMode source_mode;
|
||||||
|
const bool source_is_motorway;
|
||||||
|
const bool source_is_link;
|
||||||
|
const int source_number_of_lanes;
|
||||||
|
const int source_highway_turn_classification;
|
||||||
|
const int source_access_turn_classification;
|
||||||
|
const int source_speed;
|
||||||
|
const RoadPriorityClass::Enum source_priority_class;
|
||||||
|
|
||||||
|
// target info
|
||||||
|
const bool target_restricted;
|
||||||
|
const TravelMode target_mode;
|
||||||
|
const bool target_is_motorway;
|
||||||
|
const bool target_is_link;
|
||||||
|
const int target_number_of_lanes;
|
||||||
|
const int target_highway_turn_classification;
|
||||||
|
const int target_access_turn_classification;
|
||||||
|
const int target_speed;
|
||||||
|
const RoadPriorityClass::Enum target_priority_class;
|
||||||
|
|
||||||
|
const std::vector<ExtractionTurnLeg> roads_on_the_right;
|
||||||
|
const std::vector<ExtractionTurnLeg> roads_on_the_left;
|
||||||
|
|
||||||
double weight;
|
double weight;
|
||||||
double duration;
|
double duration;
|
||||||
const TravelMode source_mode;
|
|
||||||
const TravelMode target_mode;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef EXTRACTION_WAY_HPP
|
#ifndef EXTRACTION_WAY_HPP
|
||||||
#define EXTRACTION_WAY_HPP
|
#define EXTRACTION_WAY_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/road_classification.hpp"
|
#include "extractor/road_classification.hpp"
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "util/guidance/turn_lanes.hpp"
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
@@ -54,15 +54,17 @@ struct ExtractionWay
|
|||||||
exits.clear();
|
exits.clear();
|
||||||
turn_lanes_forward.clear();
|
turn_lanes_forward.clear();
|
||||||
turn_lanes_backward.clear();
|
turn_lanes_backward.clear();
|
||||||
road_classification = guidance::RoadClassification();
|
road_classification = RoadClassification();
|
||||||
forward_travel_mode = extractor::TRAVEL_MODE_INACCESSIBLE;
|
forward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
||||||
backward_travel_mode = extractor::TRAVEL_MODE_INACCESSIBLE;
|
backward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
||||||
roundabout = false;
|
roundabout = false;
|
||||||
circular = false;
|
circular = false;
|
||||||
is_startpoint = true;
|
is_startpoint = true;
|
||||||
forward_restricted = false;
|
forward_restricted = false;
|
||||||
backward_restricted = false;
|
backward_restricted = false;
|
||||||
is_left_hand_driving = false;
|
is_left_hand_driving = false;
|
||||||
|
highway_turn_classification = 0;
|
||||||
|
access_turn_classification = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrappers to allow assigning nil (nullptr) to string values
|
// wrappers to allow assigning nil (nullptr) to string values
|
||||||
@@ -111,9 +113,9 @@ struct ExtractionWay
|
|||||||
std::string exits;
|
std::string exits;
|
||||||
std::string turn_lanes_forward;
|
std::string turn_lanes_forward;
|
||||||
std::string turn_lanes_backward;
|
std::string turn_lanes_backward;
|
||||||
guidance::RoadClassification road_classification;
|
RoadClassification road_classification;
|
||||||
extractor::TravelMode forward_travel_mode : 4;
|
TravelMode forward_travel_mode : 4;
|
||||||
extractor::TravelMode backward_travel_mode : 4;
|
TravelMode backward_travel_mode : 4;
|
||||||
|
|
||||||
// Boolean flags
|
// Boolean flags
|
||||||
bool roundabout : 1;
|
bool roundabout : 1;
|
||||||
@@ -123,6 +125,10 @@ struct ExtractionWay
|
|||||||
bool backward_restricted : 1;
|
bool backward_restricted : 1;
|
||||||
bool is_left_hand_driving : 1;
|
bool is_left_hand_driving : 1;
|
||||||
bool : 2;
|
bool : 2;
|
||||||
|
|
||||||
|
// user classifications for turn penalties
|
||||||
|
std::uint8_t highway_turn_classification : 4;
|
||||||
|
std::uint8_t access_turn_classification : 4;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "extractor/edge_based_graph_factory.hpp"
|
#include "extractor/edge_based_graph_factory.hpp"
|
||||||
#include "extractor/extractor_config.hpp"
|
#include "extractor/extractor_config.hpp"
|
||||||
#include "extractor/graph_compressor.hpp"
|
#include "extractor/graph_compressor.hpp"
|
||||||
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/packed_osm_ids.hpp"
|
#include "extractor/packed_osm_ids.hpp"
|
||||||
|
|
||||||
|
#include "guidance/guidance_processing.hpp"
|
||||||
|
#include "guidance/turn_data_container.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_lanes.hpp"
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
@@ -57,9 +61,10 @@ class Extractor
|
|||||||
private:
|
private:
|
||||||
ExtractorConfig config;
|
ExtractorConfig config;
|
||||||
|
|
||||||
std::tuple<guidance::LaneDescriptionMap,
|
std::tuple<LaneDescriptionMap,
|
||||||
std::vector<TurnRestriction>,
|
std::vector<TurnRestriction>,
|
||||||
std::vector<ConditionalTurnRestriction>>
|
std::vector<ConditionalTurnRestriction>,
|
||||||
|
std::vector<UnresolvedManeuverOverride>>
|
||||||
ParseOSMData(ScriptingEnvironment &scripting_environment, const unsigned number_of_threads);
|
ParseOSMData(ScriptingEnvironment &scripting_environment, const unsigned number_of_threads);
|
||||||
|
|
||||||
EdgeID BuildEdgeExpandedGraph(
|
EdgeID BuildEdgeExpandedGraph(
|
||||||
@@ -72,8 +77,9 @@ class Extractor
|
|||||||
const std::vector<TurnRestriction> &turn_restrictions,
|
const std::vector<TurnRestriction> &turn_restrictions,
|
||||||
const std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
const std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
const std::unordered_set<EdgeID> &segregated_edges,
|
const std::unordered_set<EdgeID> &segregated_edges,
|
||||||
// might have to be updated to add new lane combinations
|
const util::NameTable &name_table,
|
||||||
guidance::LaneDescriptionMap &turn_lane_map,
|
const std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
|
const LaneDescriptionMap &turn_lane_map,
|
||||||
// for calculating turn penalties
|
// for calculating turn penalties
|
||||||
ScriptingEnvironment &scripting_environment,
|
ScriptingEnvironment &scripting_environment,
|
||||||
// output data
|
// output data
|
||||||
@@ -82,7 +88,7 @@ class Extractor
|
|||||||
std::vector<bool> &node_is_startpoint,
|
std::vector<bool> &node_is_startpoint,
|
||||||
std::vector<EdgeWeight> &edge_based_node_weights,
|
std::vector<EdgeWeight> &edge_based_node_weights,
|
||||||
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
||||||
const std::string &intersection_class_output_file);
|
std::uint32_t &connectivity_checksum);
|
||||||
|
|
||||||
void FindComponents(unsigned max_edge_id,
|
void FindComponents(unsigned max_edge_id,
|
||||||
const util::DeallocatingVector<EdgeBasedEdge> &input_edge_list,
|
const util::DeallocatingVector<EdgeBasedEdge> &input_edge_list,
|
||||||
@@ -101,6 +107,18 @@ class Extractor
|
|||||||
void WriteConditionalRestrictions(
|
void WriteConditionalRestrictions(
|
||||||
const std::string &path,
|
const std::string &path,
|
||||||
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions);
|
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions);
|
||||||
|
|
||||||
|
void ProcessGuidanceTurns(
|
||||||
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
|
const EdgeBasedNodeDataContainer &edge_based_node_container,
|
||||||
|
const std::vector<util::Coordinate> &node_coordinates,
|
||||||
|
const CompressedEdgeContainer &compressed_edge_container,
|
||||||
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
|
const std::vector<TurnRestriction> &turn_restrictions,
|
||||||
|
const std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
|
const util::NameTable &name_table,
|
||||||
|
LaneDescriptionMap lane_description_map,
|
||||||
|
ScriptingEnvironment &scripting_environment);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define EXTRACTOR_CALLBACKS_HPP
|
#define EXTRACTOR_CALLBACKS_HPP
|
||||||
|
|
||||||
#include "extractor/class_data.hpp"
|
#include "extractor/class_data.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/turn_lane_types.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/functional/hash.hpp>
|
||||||
@@ -48,6 +48,7 @@ struct ExtractionWay;
|
|||||||
struct ExtractionRelation;
|
struct ExtractionRelation;
|
||||||
struct ProfileProperties;
|
struct ProfileProperties;
|
||||||
struct InputConditionalTurnRestriction;
|
struct InputConditionalTurnRestriction;
|
||||||
|
struct InputManeuverOverride;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used by the extractor with the results of the
|
* This class is used by the extractor with the results of the
|
||||||
@@ -67,7 +68,7 @@ class ExtractorCallbacks
|
|||||||
StringMap string_map;
|
StringMap string_map;
|
||||||
ExtractionContainers &external_memory;
|
ExtractionContainers &external_memory;
|
||||||
std::unordered_map<std::string, ClassData> &classes_map;
|
std::unordered_map<std::string, ClassData> &classes_map;
|
||||||
guidance::LaneDescriptionMap &lane_description_map;
|
LaneDescriptionMap &lane_description_map;
|
||||||
bool fallback_to_duration;
|
bool fallback_to_duration;
|
||||||
bool force_split_edges;
|
bool force_split_edges;
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ class ExtractorCallbacks
|
|||||||
|
|
||||||
explicit ExtractorCallbacks(ExtractionContainers &extraction_containers,
|
explicit ExtractorCallbacks(ExtractionContainers &extraction_containers,
|
||||||
std::unordered_map<std::string, ClassData> &classes_map,
|
std::unordered_map<std::string, ClassData> &classes_map,
|
||||||
guidance::LaneDescriptionMap &lane_description_map,
|
LaneDescriptionMap &lane_description_map,
|
||||||
const ProfileProperties &properties);
|
const ProfileProperties &properties);
|
||||||
|
|
||||||
ExtractorCallbacks(const ExtractorCallbacks &) = delete;
|
ExtractorCallbacks(const ExtractorCallbacks &) = delete;
|
||||||
@@ -90,6 +91,9 @@ class ExtractorCallbacks
|
|||||||
|
|
||||||
// warning: caller needs to take care of synchronization!
|
// warning: caller needs to take care of synchronization!
|
||||||
void ProcessWay(const osmium::Way ¤t_way, const ExtractionWay &result_way);
|
void ProcessWay(const osmium::Way ¤t_way, const ExtractionWay &result_way);
|
||||||
|
|
||||||
|
// warning: caller needs to take care of synchronization!
|
||||||
|
void ProcessManeuverOverride(const InputManeuverOverride & override);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ struct ExtractorConfig final : storage::IOConfig
|
|||||||
".osrm.properties",
|
".osrm.properties",
|
||||||
".osrm.icd",
|
".osrm.icd",
|
||||||
".osrm.cnbg",
|
".osrm.cnbg",
|
||||||
".osrm.cnbg_to_ebg"}),
|
".osrm.cnbg_to_ebg",
|
||||||
|
".osrm.maneuver_overrides"}),
|
||||||
requested_num_threads(0),
|
requested_num_threads(0),
|
||||||
parse_conditionals(false),
|
parse_conditionals(false),
|
||||||
use_locations_cache(true)
|
use_locations_cache(true)
|
||||||
|
|||||||
+34
-38
@@ -2,11 +2,10 @@
|
|||||||
#define OSRM_EXTRACTOR_FILES_HPP
|
#define OSRM_EXTRACTOR_FILES_HPP
|
||||||
|
|
||||||
#include "extractor/edge_based_edge.hpp"
|
#include "extractor/edge_based_edge.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
#include "extractor/profile_properties.hpp"
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/serialization.hpp"
|
#include "extractor/serialization.hpp"
|
||||||
#include "extractor/turn_data_container.hpp"
|
#include "extractor/turn_lane_types.hpp"
|
||||||
|
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/guidance/bearing_class.hpp"
|
#include "util/guidance/bearing_class.hpp"
|
||||||
@@ -79,7 +78,8 @@ inline void writeProfileProperties(const boost::filesystem::path &path,
|
|||||||
template <typename EdgeBasedEdgeVector>
|
template <typename EdgeBasedEdgeVector>
|
||||||
void writeEdgeBasedGraph(const boost::filesystem::path &path,
|
void writeEdgeBasedGraph(const boost::filesystem::path &path,
|
||||||
EdgeID const number_of_edge_based_nodes,
|
EdgeID const number_of_edge_based_nodes,
|
||||||
const EdgeBasedEdgeVector &edge_based_edge_list)
|
const EdgeBasedEdgeVector &edge_based_edge_list,
|
||||||
|
const std::uint32_t connectivity_checksum)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
||||||
|
|
||||||
@@ -87,12 +87,14 @@ void writeEdgeBasedGraph(const boost::filesystem::path &path,
|
|||||||
|
|
||||||
writer.WriteElementCount64(number_of_edge_based_nodes);
|
writer.WriteElementCount64(number_of_edge_based_nodes);
|
||||||
storage::serialization::write(writer, edge_based_edge_list);
|
storage::serialization::write(writer, edge_based_edge_list);
|
||||||
|
writer.WriteOne(connectivity_checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename EdgeBasedEdgeVector>
|
template <typename EdgeBasedEdgeVector>
|
||||||
void readEdgeBasedGraph(const boost::filesystem::path &path,
|
void readEdgeBasedGraph(const boost::filesystem::path &path,
|
||||||
EdgeID &number_of_edge_based_nodes,
|
EdgeID &number_of_edge_based_nodes,
|
||||||
EdgeBasedEdgeVector &edge_based_edge_list)
|
EdgeBasedEdgeVector &edge_based_edge_list,
|
||||||
|
std::uint32_t &connectivity_checksum)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
||||||
|
|
||||||
@@ -100,6 +102,7 @@ void readEdgeBasedGraph(const boost::filesystem::path &path,
|
|||||||
|
|
||||||
number_of_edge_based_nodes = reader.ReadElementCount64();
|
number_of_edge_based_nodes = reader.ReadElementCount64();
|
||||||
storage::serialization::read(reader, edge_based_edge_list);
|
storage::serialization::read(reader, edge_based_edge_list);
|
||||||
|
reader.ReadInto(connectivity_checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reads .osrm.nodes
|
// reads .osrm.nodes
|
||||||
@@ -197,34 +200,6 @@ inline void writeSegmentData(const boost::filesystem::path &path, const SegmentD
|
|||||||
serialization::write(writer, segment_data);
|
serialization::write(writer, segment_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reads .osrm.edges
|
|
||||||
template <typename TurnDataT>
|
|
||||||
inline void readTurnData(const boost::filesystem::path &path, TurnDataT &turn_data)
|
|
||||||
{
|
|
||||||
static_assert(std::is_same<TurnDataContainer, TurnDataT>::value ||
|
|
||||||
std::is_same<TurnDataView, TurnDataT>::value ||
|
|
||||||
std::is_same<TurnDataExternalContainer, TurnDataT>::value,
|
|
||||||
"");
|
|
||||||
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
|
||||||
storage::io::FileReader reader{path, fingerprint};
|
|
||||||
|
|
||||||
serialization::read(reader, turn_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// writes .osrm.edges
|
|
||||||
template <typename TurnDataT>
|
|
||||||
inline void writeTurnData(const boost::filesystem::path &path, const TurnDataT &turn_data)
|
|
||||||
{
|
|
||||||
static_assert(std::is_same<TurnDataContainer, TurnDataT>::value ||
|
|
||||||
std::is_same<TurnDataView, TurnDataT>::value ||
|
|
||||||
std::is_same<TurnDataExternalContainer, TurnDataT>::value,
|
|
||||||
"");
|
|
||||||
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
|
||||||
storage::io::FileWriter writer{path, fingerprint};
|
|
||||||
|
|
||||||
serialization::write(writer, turn_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// reads .osrm.ebg_nodes
|
// reads .osrm.ebg_nodes
|
||||||
template <typename NodeDataT>
|
template <typename NodeDataT>
|
||||||
inline void readNodeData(const boost::filesystem::path &path, NodeDataT &node_data)
|
inline void readNodeData(const boost::filesystem::path &path, NodeDataT &node_data)
|
||||||
@@ -259,9 +234,8 @@ inline void readTurnLaneDescriptions(const boost::filesystem::path &path,
|
|||||||
OffsetsT &turn_offsets,
|
OffsetsT &turn_offsets,
|
||||||
MaskT &turn_masks)
|
MaskT &turn_masks)
|
||||||
{
|
{
|
||||||
static_assert(
|
static_assert(std::is_same<typename MaskT::value_type, extractor::TurnLaneType::Mask>::value,
|
||||||
std::is_same<typename MaskT::value_type, extractor::guidance::TurnLaneType::Mask>::value,
|
"");
|
||||||
"");
|
|
||||||
static_assert(std::is_same<typename OffsetsT::value_type, std::uint32_t>::value, "");
|
static_assert(std::is_same<typename OffsetsT::value_type, std::uint32_t>::value, "");
|
||||||
|
|
||||||
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||||
@@ -277,9 +251,8 @@ inline void writeTurnLaneDescriptions(const boost::filesystem::path &path,
|
|||||||
const OffsetsT &turn_offsets,
|
const OffsetsT &turn_offsets,
|
||||||
const MaskT &turn_masks)
|
const MaskT &turn_masks)
|
||||||
{
|
{
|
||||||
static_assert(
|
static_assert(std::is_same<typename MaskT::value_type, extractor::TurnLaneType::Mask>::value,
|
||||||
std::is_same<typename MaskT::value_type, extractor::guidance::TurnLaneType::Mask>::value,
|
"");
|
||||||
"");
|
|
||||||
static_assert(std::is_same<typename OffsetsT::value_type, std::uint32_t>::value, "");
|
static_assert(std::is_same<typename OffsetsT::value_type, std::uint32_t>::value, "");
|
||||||
|
|
||||||
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||||
@@ -288,6 +261,29 @@ inline void writeTurnLaneDescriptions(const boost::filesystem::path &path,
|
|||||||
storage::serialization::write(writer, turn_offsets);
|
storage::serialization::write(writer, turn_offsets);
|
||||||
storage::serialization::write(writer, turn_masks);
|
storage::serialization::write(writer, turn_masks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reads .osrm.maneuver_overrides
|
||||||
|
template <typename StorageManeuverOverrideT, typename NodeSequencesT>
|
||||||
|
inline void readManeuverOverrides(const boost::filesystem::path &path,
|
||||||
|
StorageManeuverOverrideT &maneuver_overrides,
|
||||||
|
NodeSequencesT &node_sequences)
|
||||||
|
{
|
||||||
|
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||||
|
storage::io::FileReader reader{path, fingerprint};
|
||||||
|
|
||||||
|
serialization::read(reader, maneuver_overrides, node_sequences);
|
||||||
|
}
|
||||||
|
|
||||||
|
// writes .osrm.maneuver_overrides
|
||||||
|
inline void writeManeuverOverrides(const boost::filesystem::path &path,
|
||||||
|
const std::vector<StorageManeuverOverride> &maneuver_overrides,
|
||||||
|
const std::vector<NodeID> &node_sequences)
|
||||||
|
{
|
||||||
|
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||||
|
storage::io::FileWriter writer{path, fingerprint};
|
||||||
|
|
||||||
|
serialization::write(writer, maneuver_overrides, node_sequences);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include "extractor/guidance/coordinate_extractor.hpp"
|
#include "guidance/coordinate_extractor.hpp"
|
||||||
#include "extractor/guidance/intersection.hpp"
|
#include "guidance/intersection.hpp"
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/geojson_debug_policy_toolkit.hpp"
|
#include "util/geojson_debug_policy_toolkit.hpp"
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "extractor/scripting_environment.hpp"
|
#include "extractor/scripting_environment.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -28,6 +29,7 @@ class GraphCompressor
|
|||||||
ScriptingEnvironment &scripting_environment,
|
ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
util::NodeBasedDynamicGraph &graph,
|
util::NodeBasedDynamicGraph &graph,
|
||||||
const std::vector<NodeBasedEdgeAnnotation> &node_data_container,
|
const std::vector<NodeBasedEdgeAnnotation> &node_data_container,
|
||||||
CompressedEdgeContainer &geometry_compressor);
|
CompressedEdgeContainer &geometry_compressor);
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_TURN_LANE_AUGMENTATION_HPP_
|
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_TURN_LANE_AUGMENTATION_HPP_
|
|
||||||
|
|
||||||
#include "extractor/guidance/intersection.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_data.hpp"
|
|
||||||
#include "util/attributes.hpp"
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
namespace guidance
|
|
||||||
{
|
|
||||||
namespace lanes
|
|
||||||
{
|
|
||||||
|
|
||||||
OSRM_ATTR_WARN_UNUSED
|
|
||||||
LaneDataVector handleNoneValueAtSimpleTurn(LaneDataVector lane_data,
|
|
||||||
const Intersection &intersection);
|
|
||||||
|
|
||||||
} // namespace lanes
|
|
||||||
} // namespace guidance
|
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
|
||||||
|
|
||||||
#endif /* OSRM_EXTRACTOR_GUIDANCE_TURN_LANE_AUGMENTATION_HPP_ */
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
#ifndef INTERNAL_EXTRACTOR_EDGE_HPP
|
#ifndef INTERNAL_EXTRACTOR_EDGE_HPP
|
||||||
#define INTERNAL_EXTRACTOR_EDGE_HPP
|
#define INTERNAL_EXTRACTOR_EDGE_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/road_classification.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "extractor/node_based_edge.hpp"
|
#include "extractor/node_based_edge.hpp"
|
||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "osrm/coordinate.hpp"
|
#include "osrm/coordinate.hpp"
|
||||||
|
|||||||
+5
-18
@@ -1,15 +1,13 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
|
#ifndef OSRM_EXTRACTOR_INTERSECTION_CONSTANTS_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
|
#define OSRM_EXTRACTOR_INTERSECTION_CONSTANTS_HPP_
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
namespace guidance
|
namespace intersection
|
||||||
{
|
{
|
||||||
|
|
||||||
const bool constexpr INVERT = true;
|
|
||||||
|
|
||||||
// what angle is interpreted as going straight
|
// what angle is interpreted as going straight
|
||||||
const double constexpr STRAIGHT_ANGLE = 180.;
|
const double constexpr STRAIGHT_ANGLE = 180.;
|
||||||
const double constexpr ORTHOGONAL_ANGLE = 90.;
|
const double constexpr ORTHOGONAL_ANGLE = 90.;
|
||||||
@@ -20,17 +18,6 @@ const double constexpr NARROW_TURN_ANGLE = 40.;
|
|||||||
const double constexpr GROUP_ANGLE = 60;
|
const double constexpr GROUP_ANGLE = 60;
|
||||||
// angle difference that can be classified as straight, if its the only narrow turn
|
// angle difference that can be classified as straight, if its the only narrow turn
|
||||||
const double constexpr FUZZY_ANGLE_DIFFERENCE = 25.;
|
const double constexpr FUZZY_ANGLE_DIFFERENCE = 25.;
|
||||||
const double constexpr DISTINCTION_RATIO = 2;
|
|
||||||
|
|
||||||
// Named roundabouts with radii larger then than this are seen as rotary
|
|
||||||
const double constexpr MAX_ROUNDABOUT_RADIUS = 15;
|
|
||||||
// Unnamed small roundabouts that look like intersections are announced as turns,
|
|
||||||
// guard against data issues or such roundabout intersections getting too large.
|
|
||||||
const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 15;
|
|
||||||
|
|
||||||
const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
|
|
||||||
|
|
||||||
const int constexpr MAX_SLIPROAD_THRESHOLD = 250;
|
|
||||||
|
|
||||||
// Road priorities give an idea of how obvious a turn is. If two priorities differ greatly (e.g.
|
// Road priorities give an idea of how obvious a turn is. If two priorities differ greatly (e.g.
|
||||||
// service road over a primary road, the better priority can be seen as obvious due to its road
|
// service road over a primary road, the better priority can be seen as obvious due to its road
|
||||||
@@ -43,8 +30,8 @@ const auto constexpr ASSUMED_LANE_WIDTH = 3.25;
|
|||||||
// how far apart can roads be at the most, when thinking about merging them?
|
// how far apart can roads be at the most, when thinking about merging them?
|
||||||
const auto constexpr MERGABLE_ANGLE_DIFFERENCE = 95.0;
|
const auto constexpr MERGABLE_ANGLE_DIFFERENCE = 95.0;
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace intersection
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif // OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
|
#endif // OSRM_EXTRACTOR_INTERSECTION_CONSTANTS_HPP_
|
||||||
+5
-5
@@ -1,5 +1,5 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_COORDINATE_EXTRACTOR_HPP_
|
#ifndef OSRM_EXTRACTOR_INTERSECTION_COORDINATE_EXTRACTOR_HPP_
|
||||||
#define OSRM_EXTRACTOR_COORDINATE_EXTRACTOR_HPP_
|
#define OSRM_EXTRACTOR_INTERSECTION_COORDINATE_EXTRACTOR_HPP_
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -15,7 +15,7 @@ namespace osrm
|
|||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
namespace guidance
|
namespace intersection
|
||||||
{
|
{
|
||||||
|
|
||||||
class CoordinateExtractor
|
class CoordinateExtractor
|
||||||
@@ -251,8 +251,8 @@ class CoordinateExtractor
|
|||||||
const std::uint8_t considered_lanes) const;
|
const std::uint8_t considered_lanes) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace intersection
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif // OSRM_EXTRACTOR_COORDINATE_EXTRACTOR_HPP_
|
#endif // OSRM_EXTRACTOR_INTERSECTION_COORDINATE_EXTRACTOR_HPP_
|
||||||
+6
-6
@@ -1,15 +1,15 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_HAVE_IDENTICAL_NAMES_HPP_
|
#ifndef OSRM_EXTRACTOR_INTERSECTION_HAVE_IDENTICAL_NAMES_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_HAVE_IDENTICAL_NAMES_HPP_
|
#define OSRM_EXTRACTOR_INTERSECTION_HAVE_IDENTICAL_NAMES_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/constants.hpp"
|
|
||||||
#include "extractor/suffix_table.hpp"
|
#include "extractor/suffix_table.hpp"
|
||||||
|
#include "guidance/constants.hpp"
|
||||||
#include "util/name_table.hpp"
|
#include "util/name_table.hpp"
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
namespace guidance
|
namespace intersection
|
||||||
{
|
{
|
||||||
|
|
||||||
// check if two name ids can be seen as identical (in presence of refs/others)
|
// check if two name ids can be seen as identical (in presence of refs/others)
|
||||||
@@ -20,8 +20,8 @@ bool HaveIdenticalNames(const NameID lhs,
|
|||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const SuffixTable &street_name_suffix_table);
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace intersection
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_HAVE_IDENTICAL_NAMES_HPP_*/
|
#endif /*OSRM_EXTRACTOR_INTERSECTION_HAVE_IDENTICAL_NAMES_HPP_*/
|
||||||
@@ -2,10 +2,11 @@
|
|||||||
#define OSRM_EXTRACTOR_INTERSECTION_INTERSECTION_ANALYSIS_HPP
|
#define OSRM_EXTRACTOR_INTERSECTION_INTERSECTION_ANALYSIS_HPP
|
||||||
|
|
||||||
#include "extractor/compressed_edge_container.hpp"
|
#include "extractor/compressed_edge_container.hpp"
|
||||||
#include "extractor/guidance/mergable_road_detector.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "extractor/intersection/intersection_edge.hpp"
|
#include "extractor/intersection/intersection_edge.hpp"
|
||||||
|
#include "extractor/intersection/intersection_view.hpp"
|
||||||
|
#include "extractor/intersection/mergable_road_detector.hpp"
|
||||||
#include "extractor/restriction_index.hpp"
|
#include "extractor/restriction_index.hpp"
|
||||||
|
#include "extractor/turn_lane_types.hpp"
|
||||||
|
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
@@ -31,7 +32,7 @@ bool isTurnAllowed(const util::NodeBasedDynamicGraph &graph,
|
|||||||
const RestrictionMap &restriction_map,
|
const RestrictionMap &restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const IntersectionEdgeGeometries &geometries,
|
const IntersectionEdgeGeometries &geometries,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const IntersectionEdge &from,
|
const IntersectionEdge &from,
|
||||||
const IntersectionEdge &to);
|
const IntersectionEdge &to);
|
||||||
|
|
||||||
@@ -43,33 +44,31 @@ std::pair<IntersectionEdgeGeometries, std::unordered_set<EdgeID>>
|
|||||||
getIntersectionGeometries(const util::NodeBasedDynamicGraph &graph,
|
getIntersectionGeometries(const util::NodeBasedDynamicGraph &graph,
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const std::vector<util::Coordinate> &node_coordinates,
|
const std::vector<util::Coordinate> &node_coordinates,
|
||||||
const guidance::MergableRoadDetector &detector,
|
const MergableRoadDetector &detector,
|
||||||
const NodeID intersection);
|
const NodeID intersection);
|
||||||
|
|
||||||
guidance::IntersectionView
|
IntersectionView convertToIntersectionView(const util::NodeBasedDynamicGraph &graph,
|
||||||
convertToIntersectionView(const util::NodeBasedDynamicGraph &graph,
|
const EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
const RestrictionMap &restriction_map,
|
||||||
const RestrictionMap &restriction_map,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const IntersectionEdgeGeometries &edge_geometries,
|
||||||
const IntersectionEdgeGeometries &edge_geometries,
|
const TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const IntersectionEdge &incoming_edge,
|
||||||
const IntersectionEdge &incoming_edge,
|
const IntersectionEdges &outgoing_edges,
|
||||||
const IntersectionEdges &outgoing_edges,
|
const std::unordered_set<EdgeID> &merged_edges);
|
||||||
const std::unordered_set<EdgeID> &merged_edges);
|
|
||||||
|
|
||||||
// Check for restrictions/barriers and generate a list of valid and invalid turns present at
|
// Check for restrictions/barriers and generate a list of valid and invalid turns present at
|
||||||
// the node reached from `incoming_edge`. The resulting candidates have to be analyzed
|
// the node reached from `incoming_edge`. The resulting candidates have to be analyzed
|
||||||
// for their actual instructions later on.
|
// for their actual instructions later on.
|
||||||
template <bool USE_CLOSE_COORDINATE>
|
template <bool USE_CLOSE_COORDINATE>
|
||||||
guidance::IntersectionView
|
IntersectionView getConnectedRoads(const util::NodeBasedDynamicGraph &graph,
|
||||||
getConnectedRoads(const util::NodeBasedDynamicGraph &graph,
|
const EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
const std::vector<util::Coordinate> &node_coordinates,
|
||||||
const std::vector<util::Coordinate> &node_coordinates,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const RestrictionMap &node_restriction_map,
|
||||||
const RestrictionMap &node_restriction_map,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const IntersectionEdge &incoming_edge);
|
||||||
const IntersectionEdge &incoming_edge);
|
|
||||||
|
|
||||||
// Graph Compression cannot compress every setting. For example any barrier/traffic light cannot
|
// Graph Compression cannot compress every setting. For example any barrier/traffic light cannot
|
||||||
// be compressed. As a result, a simple road of the form `a ----- b` might end up as having an
|
// be compressed. As a result, a simple road of the form `a ----- b` might end up as having an
|
||||||
|
|||||||
+6
-85
@@ -1,5 +1,5 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_
|
#ifndef OSRM_EXTRACTOR_INTERSECTION_INTERSECTION_VIEW_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_
|
#define OSRM_EXTRACTOR_INTERSECTION_INTERSECTION_VIEW_HPP_
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
#include "util/typedefs.hpp" // EdgeID
|
#include "util/typedefs.hpp" // EdgeID
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "guidance/turn_instruction.hpp"
|
||||||
|
|
||||||
#include <boost/range/algorithm/count_if.hpp>
|
#include <boost/range/algorithm/count_if.hpp>
|
||||||
#include <boost/range/algorithm/find_if.hpp>
|
#include <boost/range/algorithm/find_if.hpp>
|
||||||
@@ -23,7 +23,7 @@ namespace osrm
|
|||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
namespace guidance
|
namespace intersection
|
||||||
{
|
{
|
||||||
|
|
||||||
// the shape of an intersection only knows about edge IDs and bearings
|
// the shape of an intersection only knows about edge IDs and bearings
|
||||||
@@ -75,53 +75,6 @@ struct IntersectionViewData : IntersectionShapeData
|
|||||||
bool CompareByAngle(const IntersectionViewData &other) const;
|
bool CompareByAngle(const IntersectionViewData &other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// A Connected Road is the internal representation of a potential turn. Internally, we require
|
|
||||||
// full list of all connected roads to determine the outcome.
|
|
||||||
// The reasoning behind is that even invalid turns can influence the perceived angles, or even
|
|
||||||
// instructions themselves. An possible example can be described like this:
|
|
||||||
//
|
|
||||||
// aaa(2)aa
|
|
||||||
// a - bbbbb
|
|
||||||
// aaa(1)aa
|
|
||||||
//
|
|
||||||
// will not be perceived as a turn from (1) -> b, and as a U-turn from (1) -> (2).
|
|
||||||
// In addition, they can influence whether a turn is obvious or not. b->(2) would also be no
|
|
||||||
// turn-operation, but rather a name change.
|
|
||||||
//
|
|
||||||
// If this were a normal intersection with
|
|
||||||
//
|
|
||||||
// cccccccc
|
|
||||||
// o bbbbb
|
|
||||||
// aaaaaaaa
|
|
||||||
//
|
|
||||||
// We would perceive a->c as a sharp turn, a->b as a slight turn, and b->c as a slight turn.
|
|
||||||
struct ConnectedRoad final : IntersectionViewData
|
|
||||||
{
|
|
||||||
ConnectedRoad(const IntersectionViewData &view,
|
|
||||||
const TurnInstruction instruction,
|
|
||||||
const LaneDataID lane_data_id)
|
|
||||||
: IntersectionViewData(view), instruction(instruction), lane_data_id(lane_data_id)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
TurnInstruction instruction;
|
|
||||||
LaneDataID lane_data_id;
|
|
||||||
|
|
||||||
// used to sort the set of connected roads (we require sorting throughout turn handling)
|
|
||||||
bool compareByAngle(const ConnectedRoad &other) const;
|
|
||||||
|
|
||||||
// make a left turn into an equivalent right turn and vice versa
|
|
||||||
void mirror();
|
|
||||||
|
|
||||||
OSRM_ATTR_WARN_UNUSED
|
|
||||||
ConnectedRoad getMirroredCopy() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
// small helper function to print the content of a connected road
|
|
||||||
std::string toString(const IntersectionShapeData &shape);
|
|
||||||
std::string toString(const IntersectionViewData &view);
|
|
||||||
std::string toString(const ConnectedRoad &road);
|
|
||||||
|
|
||||||
// Intersections are sorted roads: [0] being the UTurn road, then from sharp right to sharp left.
|
// Intersections are sorted roads: [0] being the UTurn road, then from sharp right to sharp left.
|
||||||
// common operations shared amongst all intersection types
|
// common operations shared amongst all intersection types
|
||||||
template <typename Self> struct EnableShapeOps
|
template <typename Self> struct EnableShapeOps
|
||||||
@@ -292,40 +245,8 @@ struct IntersectionView final : std::vector<IntersectionViewData>, //
|
|||||||
using Base = std::vector<IntersectionViewData>;
|
using Base = std::vector<IntersectionViewData>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// `Intersection` is a relative view of an intersection by an incoming edge.
|
} // namespace intersection
|
||||||
// `Intersection` are streets at an intersection stored as an ordered list of connected roads
|
|
||||||
// ordered from sharp right counter-clockwise to
|
|
||||||
// sharp left where `intersection[0]` is _always_ a u-turn
|
|
||||||
|
|
||||||
// An intersection is an ordered list of connected roads ordered from sharp right
|
|
||||||
// counter-clockwise to sharp left where `intersection[0]` is always a u-turn
|
|
||||||
//
|
|
||||||
// |
|
|
||||||
// |
|
|
||||||
// (intersec[3])
|
|
||||||
// |
|
|
||||||
// |
|
|
||||||
// |
|
|
||||||
// nid ---(via_eid/intersec[0])--- nbg.GetTarget(via) ---(intersec[2])---
|
|
||||||
// |
|
|
||||||
// |
|
|
||||||
// |
|
|
||||||
// (intersec[1])
|
|
||||||
// |
|
|
||||||
// |
|
|
||||||
//
|
|
||||||
// intersec := intersection
|
|
||||||
// nbh := node_based_graph
|
|
||||||
//
|
|
||||||
struct Intersection final : std::vector<ConnectedRoad>, //
|
|
||||||
EnableShapeOps<Intersection>, //
|
|
||||||
EnableIntersectionOps<Intersection> //
|
|
||||||
{
|
|
||||||
using Base = std::vector<ConnectedRoad>;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace guidance
|
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_*/
|
#endif /* OSRM_EXTRACTOR_INTERSECTION_INTERSECTION_VIEW_HPP_*/
|
||||||
+8
-8
@@ -2,11 +2,11 @@
|
|||||||
#define OSRM_EXTRACTOR_GUIDANCE_MERGEABLE_ROADS
|
#define OSRM_EXTRACTOR_GUIDANCE_MERGEABLE_ROADS
|
||||||
|
|
||||||
#include "extractor/compressed_edge_container.hpp"
|
#include "extractor/compressed_edge_container.hpp"
|
||||||
#include "extractor/guidance/coordinate_extractor.hpp"
|
#include "extractor/intersection/coordinate_extractor.hpp"
|
||||||
#include "extractor/guidance/have_identical_names.hpp"
|
#include "extractor/intersection/have_identical_names.hpp"
|
||||||
#include "extractor/guidance/intersection.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "extractor/restriction_index.hpp"
|
#include "extractor/restriction_index.hpp"
|
||||||
|
#include "extractor/turn_lane_types.hpp"
|
||||||
|
#include "guidance/intersection.hpp"
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
@@ -31,7 +31,7 @@ namespace extractor
|
|||||||
|
|
||||||
class SuffixTable;
|
class SuffixTable;
|
||||||
|
|
||||||
namespace guidance
|
namespace intersection
|
||||||
{
|
{
|
||||||
class IntersectionGenerator;
|
class IntersectionGenerator;
|
||||||
class CoordinateExtractor;
|
class CoordinateExtractor;
|
||||||
@@ -48,7 +48,7 @@ class MergableRoadDetector
|
|||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const RestrictionMap &node_restriction_map,
|
const RestrictionMap &node_restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const SuffixTable &street_name_suffix_table);
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ class MergableRoadDetector
|
|||||||
const extractor::CompressedEdgeContainer &compressed_geometries;
|
const extractor::CompressedEdgeContainer &compressed_geometries;
|
||||||
const RestrictionMap &node_restriction_map;
|
const RestrictionMap &node_restriction_map;
|
||||||
const std::unordered_set<NodeID> &barrier_nodes;
|
const std::unordered_set<NodeID> &barrier_nodes;
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data;
|
const TurnLanesIndexedArray &turn_lanes_data;
|
||||||
|
|
||||||
// name detection
|
// name detection
|
||||||
const util::NameTable &name_table;
|
const util::NameTable &name_table;
|
||||||
@@ -177,7 +177,7 @@ class MergableRoadDetector
|
|||||||
const static double constexpr distance_to_extract = 120;
|
const static double constexpr distance_to_extract = 120;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace intersection
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
+16
-16
@@ -1,10 +1,10 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_NODE_BASED_GRAPH_WALKER
|
#ifndef OSRM_EXTRACTOR_INTERSECTION_NODE_BASED_GRAPH_WALKER
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_NODE_BASED_GRAPH_WALKER
|
#define OSRM_EXTRACTOR_INTERSECTION_NODE_BASED_GRAPH_WALKER
|
||||||
|
|
||||||
#include "extractor/guidance/constants.hpp"
|
#include "extractor/intersection/coordinate_extractor.hpp"
|
||||||
#include "extractor/guidance/coordinate_extractor.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_data.hpp"
|
|
||||||
#include "extractor/intersection/intersection_analysis.hpp"
|
#include "extractor/intersection/intersection_analysis.hpp"
|
||||||
|
#include "extractor/intersection/intersection_view.hpp"
|
||||||
|
#include "guidance/turn_lane_data.hpp"
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/coordinate_calculation.hpp"
|
#include "util/coordinate_calculation.hpp"
|
||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
@@ -19,7 +19,7 @@ namespace osrm
|
|||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
namespace guidance
|
namespace intersection
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -35,7 +35,7 @@ class NodeBasedGraphWalker
|
|||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const RestrictionMap &node_restriction_map,
|
const RestrictionMap &node_restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data);
|
const TurnLanesIndexedArray &turn_lanes_data);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the returned node-id, edge-id are either the last ones used, just prior accumulator
|
* the returned node-id, edge-id are either the last ones used, just prior accumulator
|
||||||
@@ -58,7 +58,7 @@ class NodeBasedGraphWalker
|
|||||||
const extractor::CompressedEdgeContainer &compressed_geometries;
|
const extractor::CompressedEdgeContainer &compressed_geometries;
|
||||||
const RestrictionMap &node_restriction_map;
|
const RestrictionMap &node_restriction_map;
|
||||||
const std::unordered_set<NodeID> &barrier_nodes;
|
const std::unordered_set<NodeID> &barrier_nodes;
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data;
|
const TurnLanesIndexedArray &turn_lanes_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -68,7 +68,7 @@ class NodeBasedGraphWalker
|
|||||||
struct LengthLimitedCoordinateAccumulator
|
struct LengthLimitedCoordinateAccumulator
|
||||||
{
|
{
|
||||||
LengthLimitedCoordinateAccumulator(
|
LengthLimitedCoordinateAccumulator(
|
||||||
const extractor::guidance::CoordinateExtractor &coordinate_extractor,
|
const extractor::intersection::CoordinateExtractor &coordinate_extractor,
|
||||||
const double max_length);
|
const double max_length);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -93,7 +93,7 @@ struct LengthLimitedCoordinateAccumulator
|
|||||||
std::vector<util::Coordinate> coordinates;
|
std::vector<util::Coordinate> coordinates;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const extractor::guidance::CoordinateExtractor &coordinate_extractor;
|
const extractor::intersection::CoordinateExtractor &coordinate_extractor;
|
||||||
const double max_length;
|
const double max_length;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ struct IntersectionFinderAccumulator
|
|||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const RestrictionMap &node_restriction_map,
|
const RestrictionMap &node_restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data);
|
const TurnLanesIndexedArray &turn_lanes_data);
|
||||||
// true if the path has traversed enough distance
|
// true if the path has traversed enough distance
|
||||||
bool terminate();
|
bool terminate();
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ struct IntersectionFinderAccumulator
|
|||||||
const extractor::CompressedEdgeContainer &compressed_geometries;
|
const extractor::CompressedEdgeContainer &compressed_geometries;
|
||||||
const RestrictionMap &node_restriction_map;
|
const RestrictionMap &node_restriction_map;
|
||||||
const std::unordered_set<NodeID> &barrier_nodes;
|
const std::unordered_set<NodeID> &barrier_nodes;
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data;
|
const TurnLanesIndexedArray &turn_lanes_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class accumulator_type, class selector_type>
|
template <class accumulator_type, class selector_type>
|
||||||
@@ -278,7 +278,7 @@ struct SkipTrafficSignalBarrierRoadSelector
|
|||||||
struct DistanceToNextIntersectionAccumulator
|
struct DistanceToNextIntersectionAccumulator
|
||||||
{
|
{
|
||||||
DistanceToNextIntersectionAccumulator(
|
DistanceToNextIntersectionAccumulator(
|
||||||
const extractor::guidance::CoordinateExtractor &extractor_,
|
const extractor::intersection::CoordinateExtractor &extractor_,
|
||||||
const util::NodeBasedDynamicGraph &graph_,
|
const util::NodeBasedDynamicGraph &graph_,
|
||||||
const double threshold)
|
const double threshold)
|
||||||
: extractor{extractor_}, graph{graph_}, threshold{threshold}
|
: extractor{extractor_}, graph{graph_}, threshold{threshold}
|
||||||
@@ -304,15 +304,15 @@ struct DistanceToNextIntersectionAccumulator
|
|||||||
distance += getLength(coords.begin(), coords.end(), &haversineDistance);
|
distance += getLength(coords.begin(), coords.end(), &haversineDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
const extractor::guidance::CoordinateExtractor &extractor;
|
const extractor::intersection::CoordinateExtractor &extractor;
|
||||||
const util::NodeBasedDynamicGraph &graph;
|
const util::NodeBasedDynamicGraph &graph;
|
||||||
const double threshold;
|
const double threshold;
|
||||||
bool too_far_away = false;
|
bool too_far_away = false;
|
||||||
double distance = 0.;
|
double distance = 0.;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace intersection
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /* OSRM_EXTRACTOR_GUIDANCE_NODE_BASED_GRAPH_WALKER */
|
#endif
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
#ifndef MANUEVER_OVERRIDE_HPP
|
||||||
|
#define MANUEVER_OVERRIDE_HPP
|
||||||
|
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
|
#include "storage/shared_memory_ownership.hpp"
|
||||||
|
#include "util/vector_view.hpp"
|
||||||
|
#include <algorithm>
|
||||||
|
#include <boost/functional/hash.hpp>
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace extractor
|
||||||
|
{
|
||||||
|
|
||||||
|
// Data that is loaded from the OSM datafile directly
|
||||||
|
struct InputManeuverOverride
|
||||||
|
{
|
||||||
|
std::vector<OSMWayID> via_ways;
|
||||||
|
OSMNodeID via_node;
|
||||||
|
std::string maneuver;
|
||||||
|
std::string direction;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Object returned by the datafacade
|
||||||
|
struct ManeuverOverride
|
||||||
|
{
|
||||||
|
// util::ViewOrVector<NodeID, storage::Ownership::View> node_sequence;
|
||||||
|
std::vector<NodeID> node_sequence;
|
||||||
|
// before the turn, then later, the edge_based_node_id of the turn
|
||||||
|
NodeID instruction_node; // node-based node ID
|
||||||
|
guidance::TurnType::Enum override_type;
|
||||||
|
guidance::DirectionModifier::Enum direction;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Object returned by the datafacade
|
||||||
|
struct StorageManeuverOverride
|
||||||
|
{
|
||||||
|
std::uint32_t node_sequence_offset_begin;
|
||||||
|
std::uint32_t node_sequence_offset_end;
|
||||||
|
NodeID start_node;
|
||||||
|
// before the turn, then later, the edge_based_node_id of the turn
|
||||||
|
NodeID instruction_node; // node-based node ID
|
||||||
|
guidance::TurnType::Enum override_type;
|
||||||
|
guidance::DirectionModifier::Enum direction;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct NodeBasedTurn
|
||||||
|
{
|
||||||
|
NodeID from;
|
||||||
|
NodeID via;
|
||||||
|
NodeID to;
|
||||||
|
|
||||||
|
bool operator==(const NodeBasedTurn &other) const
|
||||||
|
{
|
||||||
|
return other.from == from && other.via == via && other.to == to;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct UnresolvedManeuverOverride
|
||||||
|
{
|
||||||
|
|
||||||
|
std::vector<NodeBasedTurn>
|
||||||
|
turn_sequence; // initially the internal node-based-node ID of the node
|
||||||
|
// before the turn, then later, the edge_based_node_id of the turn
|
||||||
|
NodeID instruction_node; // node-based node ID
|
||||||
|
guidance::TurnType::Enum override_type;
|
||||||
|
guidance::DirectionModifier::Enum direction;
|
||||||
|
|
||||||
|
// check if all parts of the restriction reference an actual node
|
||||||
|
bool Valid() const
|
||||||
|
{
|
||||||
|
return !turn_sequence.empty() && std::none_of(turn_sequence.begin(),
|
||||||
|
turn_sequence.end(),
|
||||||
|
[](const auto &n) {
|
||||||
|
return n.from == SPECIAL_NODEID ||
|
||||||
|
n.via == SPECIAL_NODEID ||
|
||||||
|
n.to == SPECIAL_NODEID;
|
||||||
|
}) &&
|
||||||
|
(direction != guidance::DirectionModifier::MaxDirectionModifier ||
|
||||||
|
override_type != guidance::TurnType::Invalid);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// custom specialization of std::hash can be injected in namespace std
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <> struct hash<osrm::extractor::NodeBasedTurn>
|
||||||
|
|
||||||
|
{
|
||||||
|
typedef osrm::extractor::NodeBasedTurn argument_type;
|
||||||
|
typedef std::size_t result_type;
|
||||||
|
result_type operator()(argument_type const &s) const noexcept
|
||||||
|
{
|
||||||
|
|
||||||
|
std::size_t seed = 0;
|
||||||
|
boost::hash_combine(seed, s.from);
|
||||||
|
boost::hash_combine(seed, s.via);
|
||||||
|
boost::hash_combine(seed, s.to);
|
||||||
|
|
||||||
|
return seed;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
from=1
|
||||||
|
to=3
|
||||||
|
via=b
|
||||||
|
|
||||||
|
101 a 102 b 103
|
||||||
|
---------------+---------------+-------------- (way 1)
|
||||||
|
99 \ 98 \ 97
|
||||||
|
51 \ 2 50 \ 3
|
||||||
|
\ \
|
||||||
|
*/
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
#ifndef MANEUVER_OVERRIDE_RELATION_PARSER_HPP
|
||||||
|
#define MANEUVER_OVERRIDE_RELATION_PARSER_HPP
|
||||||
|
|
||||||
|
#include "maneuver_override.hpp"
|
||||||
|
|
||||||
|
#include <boost/optional.hpp>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace osmium
|
||||||
|
{
|
||||||
|
class Relation;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace extractor
|
||||||
|
{
|
||||||
|
|
||||||
|
class ScriptingEnvironment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the relations that represents maneuver overrides.
|
||||||
|
* These are structured similarly to turn restrictions, with some slightly
|
||||||
|
* different fields.
|
||||||
|
*
|
||||||
|
* Simple, via-node overrides (the maneuver at the "via" point is overridden)
|
||||||
|
* <relation>
|
||||||
|
* <tag k="type" v="maneuver"/>
|
||||||
|
* <member type="way" ref="1234" role="from"/>
|
||||||
|
* <member type="way" ref="5678" role="to"/>
|
||||||
|
* <member type="node" ref="9999" role="via"/>
|
||||||
|
* <tag k="maneuver" v="turn"/>
|
||||||
|
* <tag k="direction" v="slight_right"/>
|
||||||
|
* </relation>
|
||||||
|
*
|
||||||
|
* Via-way descriptions are also supported - this is helpful if
|
||||||
|
* you only want to update an instruction if a certain sequence of
|
||||||
|
* road transitions are taken.
|
||||||
|
*
|
||||||
|
* <relation>
|
||||||
|
* <tag k="type" v="maneuver"/>
|
||||||
|
* <member type="way" ref="1234" role="from"/>
|
||||||
|
* <member type="way" ref="5678" role="to"/>
|
||||||
|
* <member type="way" ref="9012" role="via"/> <!-- note via way here -->
|
||||||
|
* <member type="node" ref="9999" role="via"/>
|
||||||
|
* <tag k="maneuver" v="turn"/>
|
||||||
|
* <tag k="direction" v="slight_right"/>
|
||||||
|
* </relation>
|
||||||
|
*
|
||||||
|
* For via-way restrictions, ways must be connected end-to-end, i.e.
|
||||||
|
* referenced ways must be split if the turn points are partway
|
||||||
|
* along the original way.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class ManeuverOverrideRelationParser
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ManeuverOverrideRelationParser();
|
||||||
|
boost::optional<InputManeuverOverride> TryParse(const osmium::Relation &relation) const;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* RESTRICTION_PARSER_HPP */
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
#include "extractor/travel_mode.hpp"
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include "extractor/guidance/road_classification.hpp"
|
#include "extractor/road_classification.hpp"
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -19,14 +19,16 @@ namespace extractor
|
|||||||
// generation but is not available in annotation/navigation
|
// generation but is not available in annotation/navigation
|
||||||
struct NodeBasedEdgeClassification
|
struct NodeBasedEdgeClassification
|
||||||
{
|
{
|
||||||
std::uint8_t forward : 1; // 1
|
std::uint8_t forward : 1; // 1
|
||||||
std::uint8_t backward : 1; // 1
|
std::uint8_t backward : 1; // 1
|
||||||
std::uint8_t is_split : 1; // 1
|
std::uint8_t is_split : 1; // 1
|
||||||
std::uint8_t roundabout : 1; // 1
|
std::uint8_t roundabout : 1; // 1
|
||||||
std::uint8_t circular : 1; // 1
|
std::uint8_t circular : 1; // 1
|
||||||
std::uint8_t startpoint : 1; // 1
|
std::uint8_t startpoint : 1; // 1
|
||||||
std::uint8_t restricted : 1; // 1
|
std::uint8_t restricted : 1; // 1
|
||||||
guidance::RoadClassification road_classification; // 16 2
|
RoadClassification road_classification; // 16 2
|
||||||
|
std::uint8_t highway_turn_classification : 4; // 4
|
||||||
|
std::uint8_t access_turn_classification : 4; // 4
|
||||||
|
|
||||||
NodeBasedEdgeClassification();
|
NodeBasedEdgeClassification();
|
||||||
|
|
||||||
@@ -37,10 +39,14 @@ struct NodeBasedEdgeClassification
|
|||||||
const bool circular,
|
const bool circular,
|
||||||
const bool startpoint,
|
const bool startpoint,
|
||||||
const bool restricted,
|
const bool restricted,
|
||||||
guidance::RoadClassification road_classification)
|
RoadClassification road_classification,
|
||||||
|
const std::uint8_t highway_turn_classification,
|
||||||
|
const std::uint8_t access_turn_classification)
|
||||||
: forward(forward), backward(backward), is_split(is_split), roundabout(roundabout),
|
: forward(forward), backward(backward), is_split(is_split), roundabout(roundabout),
|
||||||
circular(circular), startpoint(startpoint), restricted(restricted),
|
circular(circular), startpoint(startpoint), restricted(restricted),
|
||||||
road_classification(road_classification)
|
road_classification(road_classification),
|
||||||
|
highway_turn_classification(highway_turn_classification),
|
||||||
|
access_turn_classification(access_turn_classification)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define OSRM_EXTRACTOR_NODE_BASED_GRAPH_FACTORY_HPP_
|
#define OSRM_EXTRACTOR_NODE_BASED_GRAPH_FACTORY_HPP_
|
||||||
|
|
||||||
#include "extractor/compressed_edge_container.hpp"
|
#include "extractor/compressed_edge_container.hpp"
|
||||||
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/node_based_edge.hpp"
|
#include "extractor/node_based_edge.hpp"
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
#include "extractor/packed_osm_ids.hpp"
|
#include "extractor/packed_osm_ids.hpp"
|
||||||
@@ -39,7 +40,8 @@ class NodeBasedGraphFactory
|
|||||||
NodeBasedGraphFactory(const boost::filesystem::path &input_file,
|
NodeBasedGraphFactory(const boost::filesystem::path &input_file,
|
||||||
ScriptingEnvironment &scripting_environment,
|
ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions);
|
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides);
|
||||||
|
|
||||||
auto const &GetGraph() const { return compressed_output_graph; }
|
auto const &GetGraph() const { return compressed_output_graph; }
|
||||||
auto const &GetBarriers() const { return barriers; }
|
auto const &GetBarriers() const { return barriers; }
|
||||||
@@ -67,7 +69,8 @@ class NodeBasedGraphFactory
|
|||||||
// edges into a single representative form
|
// edges into a single representative form
|
||||||
void Compress(ScriptingEnvironment &scripting_environment,
|
void Compress(ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions);
|
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides);
|
||||||
|
|
||||||
// Most ways are bidirectional, making the geometry in forward and backward direction the same,
|
// Most ways are bidirectional, making the geometry in forward and backward direction the same,
|
||||||
// except for reversal. We make use of this fact by keeping only one representation of the
|
// except for reversal. We make use of this fact by keeping only one representation of the
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
#ifndef ORIGINAL_EDGE_DATA_HPP
|
|
||||||
#define ORIGINAL_EDGE_DATA_HPP
|
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
|
||||||
#include "extractor/travel_mode.hpp"
|
|
||||||
#include "util/guidance/turn_bearing.hpp"
|
|
||||||
#include "util/typedefs.hpp"
|
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
|
|
||||||
struct OriginalEdgeData
|
|
||||||
{
|
|
||||||
explicit OriginalEdgeData(GeometryID via_geometry,
|
|
||||||
NameID name_id,
|
|
||||||
LaneDataID lane_data_id,
|
|
||||||
guidance::TurnInstruction turn_instruction,
|
|
||||||
EntryClassID entry_classid,
|
|
||||||
extractor::TravelMode travel_mode,
|
|
||||||
util::guidance::TurnBearing pre_turn_bearing,
|
|
||||||
util::guidance::TurnBearing post_turn_bearing)
|
|
||||||
: via_geometry(via_geometry), name_id(name_id), entry_classid(entry_classid),
|
|
||||||
lane_data_id(lane_data_id), turn_instruction(turn_instruction), travel_mode(travel_mode),
|
|
||||||
pre_turn_bearing(pre_turn_bearing), post_turn_bearing(post_turn_bearing)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
OriginalEdgeData()
|
|
||||||
: via_geometry{std::numeric_limits<unsigned>::max() >> 1, false},
|
|
||||||
name_id(std::numeric_limits<unsigned>::max()), entry_classid(INVALID_ENTRY_CLASSID),
|
|
||||||
lane_data_id(INVALID_LANE_DATAID), turn_instruction(guidance::TurnInstruction::INVALID()),
|
|
||||||
travel_mode(extractor::TRAVEL_MODE_INACCESSIBLE), pre_turn_bearing(0.0),
|
|
||||||
post_turn_bearing(0.0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
GeometryID via_geometry;
|
|
||||||
NameID name_id;
|
|
||||||
EntryClassID entry_classid;
|
|
||||||
LaneDataID lane_data_id;
|
|
||||||
guidance::TurnInstruction turn_instruction;
|
|
||||||
extractor::TravelMode travel_mode;
|
|
||||||
util::guidance::TurnBearing pre_turn_bearing;
|
|
||||||
util::guidance::TurnBearing post_turn_bearing;
|
|
||||||
};
|
|
||||||
|
|
||||||
static_assert(sizeof(OriginalEdgeData) == 16,
|
|
||||||
"Increasing the size of OriginalEdgeData increases memory consumption");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // ORIGINAL_EDGE_DATA_HPP
|
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
@@ -28,7 +29,8 @@ struct ProfileProperties
|
|||||||
: traffic_signal_penalty(0), u_turn_penalty(0),
|
: traffic_signal_penalty(0), u_turn_penalty(0),
|
||||||
max_speed_for_map_matching(DEFAULT_MAX_SPEED), continue_straight_at_waypoint(true),
|
max_speed_for_map_matching(DEFAULT_MAX_SPEED), continue_straight_at_waypoint(true),
|
||||||
use_turn_restrictions(false), left_hand_driving(false), fallback_to_duration(true),
|
use_turn_restrictions(false), left_hand_driving(false), fallback_to_duration(true),
|
||||||
weight_name{"duration"}, class_names{}, call_tagless_node_function(true)
|
weight_name{"duration"}, class_names{{}}, excludable_classes{{}},
|
||||||
|
call_tagless_node_function(true)
|
||||||
{
|
{
|
||||||
std::fill(excludable_classes.begin(), excludable_classes.end(), INAVLID_CLASS_DATA);
|
std::fill(excludable_classes.begin(), excludable_classes.end(), INAVLID_CLASS_DATA);
|
||||||
BOOST_ASSERT(weight_name[MAX_WEIGHT_NAME_LENGTH] == '\0');
|
BOOST_ASSERT(weight_name[MAX_WEIGHT_NAME_LENGTH] == '\0');
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_RESTRICTION_COMPRESSOR_HPP_
|
#ifndef OSRM_EXTRACTOR_RESTRICTION_COMPRESSOR_HPP_
|
||||||
#define OSRM_EXTRACTOR_RESTRICTION_COMPRESSOR_HPP_
|
#define OSRM_EXTRACTOR_RESTRICTION_COMPRESSOR_HPP_
|
||||||
|
|
||||||
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/restriction.hpp"
|
#include "extractor/restriction.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
@@ -28,7 +29,8 @@ class RestrictionCompressor
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RestrictionCompressor(std::vector<TurnRestriction> &restrictions,
|
RestrictionCompressor(std::vector<TurnRestriction> &restrictions,
|
||||||
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions);
|
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides);
|
||||||
|
|
||||||
// account for the compression of `from-via-to` into `from-to`
|
// account for the compression of `from-via-to` into `from-to`
|
||||||
void Compress(const NodeID from, const NodeID via, const NodeID to);
|
void Compress(const NodeID from, const NodeID via, const NodeID to);
|
||||||
@@ -40,6 +42,9 @@ class RestrictionCompressor
|
|||||||
// node-restrictions, so we can focus on them alone
|
// node-restrictions, so we can focus on them alone
|
||||||
boost::unordered_multimap<NodeID, NodeRestriction *> starts;
|
boost::unordered_multimap<NodeID, NodeRestriction *> starts;
|
||||||
boost::unordered_multimap<NodeID, NodeRestriction *> ends;
|
boost::unordered_multimap<NodeID, NodeRestriction *> ends;
|
||||||
|
|
||||||
|
boost::unordered_multimap<NodeID, NodeBasedTurn *> maneuver_starts;
|
||||||
|
boost::unordered_multimap<NodeID, NodeBasedTurn *> maneuver_ends;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
|
|||||||
+4
-6
@@ -6,14 +6,12 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "extractor/guidance/constants.hpp"
|
#include "extractor/intersection/constants.hpp"
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
namespace guidance
|
|
||||||
{
|
|
||||||
|
|
||||||
// Priorities are used to distinguish between how likely a turn is in comparison to a different
|
// Priorities are used to distinguish between how likely a turn is in comparison to a different
|
||||||
// road. The priorities here are used to distinguish between obvious turns (e.g. following a primary
|
// road. The priorities here are used to distinguish between obvious turns (e.g. following a primary
|
||||||
@@ -132,8 +130,9 @@ inline bool obviousByRoadClass(const RoadClassification in_classification,
|
|||||||
const RoadClassification compare_candidate)
|
const RoadClassification compare_candidate)
|
||||||
{
|
{
|
||||||
// lower numbers are of higher priority
|
// lower numbers are of higher priority
|
||||||
const bool has_high_priority = PRIORITY_DISTINCTION_FACTOR * obvious_candidate.GetPriority() <
|
const bool has_high_priority =
|
||||||
compare_candidate.GetPriority();
|
intersection::PRIORITY_DISTINCTION_FACTOR * obvious_candidate.GetPriority() <
|
||||||
|
compare_candidate.GetPriority();
|
||||||
|
|
||||||
const bool continues_on_same_class = in_classification == obvious_candidate;
|
const bool continues_on_same_class = in_classification == obvious_candidate;
|
||||||
return (has_high_priority && continues_on_same_class) ||
|
return (has_high_priority && continues_on_same_class) ||
|
||||||
@@ -142,7 +141,6 @@ inline bool obviousByRoadClass(const RoadClassification in_classification,
|
|||||||
compare_candidate.IsLowPriorityRoadClass());
|
compare_candidate.IsLowPriorityRoadClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace guidance
|
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#ifndef SCRIPTING_ENVIRONMENT_HPP
|
#ifndef SCRIPTING_ENVIRONMENT_HPP
|
||||||
#define SCRIPTING_ENVIRONMENT_HPP
|
#define SCRIPTING_ENVIRONMENT_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "extractor/internal_extractor_edge.hpp"
|
#include "extractor/internal_extractor_edge.hpp"
|
||||||
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/profile_properties.hpp"
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/restriction.hpp"
|
#include "extractor/restriction.hpp"
|
||||||
|
|
||||||
@@ -32,6 +32,7 @@ namespace extractor
|
|||||||
{
|
{
|
||||||
|
|
||||||
class RestrictionParser;
|
class RestrictionParser;
|
||||||
|
class ManeuverOverrideRelationParser;
|
||||||
class ExtractionRelationContainer;
|
class ExtractionRelationContainer;
|
||||||
struct ExtractionNode;
|
struct ExtractionNode;
|
||||||
struct ExtractionWay;
|
struct ExtractionWay;
|
||||||
@@ -63,10 +64,12 @@ class ScriptingEnvironment
|
|||||||
virtual void
|
virtual void
|
||||||
ProcessElements(const osmium::memory::Buffer &buffer,
|
ProcessElements(const osmium::memory::Buffer &buffer,
|
||||||
const RestrictionParser &restriction_parser,
|
const RestrictionParser &restriction_parser,
|
||||||
|
const ManeuverOverrideRelationParser &maneuver_override_parser,
|
||||||
const ExtractionRelationContainer &relations,
|
const ExtractionRelationContainer &relations,
|
||||||
std::vector<std::pair<const osmium::Node &, ExtractionNode>> &resulting_nodes,
|
std::vector<std::pair<const osmium::Node &, ExtractionNode>> &resulting_nodes,
|
||||||
std::vector<std::pair<const osmium::Way &, ExtractionWay>> &resulting_ways,
|
std::vector<std::pair<const osmium::Way &, ExtractionWay>> &resulting_ways,
|
||||||
std::vector<InputConditionalTurnRestriction> &resulting_restrictions) = 0;
|
std::vector<InputConditionalTurnRestriction> &resulting_restrictions,
|
||||||
|
std::vector<InputManeuverOverride> &resulting_maneuver_overrides) = 0;
|
||||||
|
|
||||||
virtual bool HasLocationDependentData() const = 0;
|
virtual bool HasLocationDependentData() const = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -88,10 +88,12 @@ class Sol2ScriptingEnvironment final : public ScriptingEnvironment
|
|||||||
void
|
void
|
||||||
ProcessElements(const osmium::memory::Buffer &buffer,
|
ProcessElements(const osmium::memory::Buffer &buffer,
|
||||||
const RestrictionParser &restriction_parser,
|
const RestrictionParser &restriction_parser,
|
||||||
|
const ManeuverOverrideRelationParser &maneuver_override_parser,
|
||||||
const ExtractionRelationContainer &relations,
|
const ExtractionRelationContainer &relations,
|
||||||
std::vector<std::pair<const osmium::Node &, ExtractionNode>> &resulting_nodes,
|
std::vector<std::pair<const osmium::Node &, ExtractionNode>> &resulting_nodes,
|
||||||
std::vector<std::pair<const osmium::Way &, ExtractionWay>> &resulting_ways,
|
std::vector<std::pair<const osmium::Way &, ExtractionWay>> &resulting_ways,
|
||||||
std::vector<InputConditionalTurnRestriction> &resulting_restrictions) override;
|
std::vector<InputConditionalTurnRestriction> &resulting_restrictions,
|
||||||
|
std::vector<InputManeuverOverride> &resulting_maneuver_overrides) override;
|
||||||
|
|
||||||
bool HasLocationDependentData() const override { return !location_dependent_data.empty(); }
|
bool HasLocationDependentData() const override { return !location_dependent_data.empty(); }
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
#include "conditional_turn_penalty.hpp"
|
#include "conditional_turn_penalty.hpp"
|
||||||
#include "extractor/datasources.hpp"
|
#include "extractor/datasources.hpp"
|
||||||
#include "extractor/intersection_bearings_container.hpp"
|
#include "extractor/intersection_bearings_container.hpp"
|
||||||
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "extractor/nbg_to_ebg.hpp"
|
#include "extractor/nbg_to_ebg.hpp"
|
||||||
#include "extractor/node_data_container.hpp"
|
#include "extractor/node_data_container.hpp"
|
||||||
#include "extractor/profile_properties.hpp"
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/restriction.hpp"
|
#include "extractor/restriction.hpp"
|
||||||
#include "extractor/segment_data_container.hpp"
|
#include "extractor/segment_data_container.hpp"
|
||||||
#include "extractor/turn_data_container.hpp"
|
|
||||||
|
|
||||||
#include "storage/io.hpp"
|
#include "storage/io.hpp"
|
||||||
#include "storage/serialization.hpp"
|
#include "storage/serialization.hpp"
|
||||||
@@ -93,29 +93,6 @@ inline void write(storage::io::FileWriter &writer,
|
|||||||
storage::serialization::write(writer, segment_data.rev_datasources);
|
storage::serialization::write(writer, segment_data.rev_datasources);
|
||||||
}
|
}
|
||||||
|
|
||||||
// read/write for turn data file
|
|
||||||
template <storage::Ownership Ownership>
|
|
||||||
inline void read(storage::io::FileReader &reader,
|
|
||||||
detail::TurnDataContainerImpl<Ownership> &turn_data_container)
|
|
||||||
{
|
|
||||||
storage::serialization::read(reader, turn_data_container.turn_instructions);
|
|
||||||
storage::serialization::read(reader, turn_data_container.lane_data_ids);
|
|
||||||
storage::serialization::read(reader, turn_data_container.entry_class_ids);
|
|
||||||
storage::serialization::read(reader, turn_data_container.pre_turn_bearings);
|
|
||||||
storage::serialization::read(reader, turn_data_container.post_turn_bearings);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <storage::Ownership Ownership>
|
|
||||||
inline void write(storage::io::FileWriter &writer,
|
|
||||||
const detail::TurnDataContainerImpl<Ownership> &turn_data_container)
|
|
||||||
{
|
|
||||||
storage::serialization::write(writer, turn_data_container.turn_instructions);
|
|
||||||
storage::serialization::write(writer, turn_data_container.lane_data_ids);
|
|
||||||
storage::serialization::write(writer, turn_data_container.entry_class_ids);
|
|
||||||
storage::serialization::write(writer, turn_data_container.pre_turn_bearings);
|
|
||||||
storage::serialization::write(writer, turn_data_container.post_turn_bearings);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <storage::Ownership Ownership>
|
template <storage::Ownership Ownership>
|
||||||
inline void read(storage::io::FileReader &reader,
|
inline void read(storage::io::FileReader &reader,
|
||||||
detail::EdgeBasedNodeDataContainerImpl<Ownership> &node_data_container)
|
detail::EdgeBasedNodeDataContainerImpl<Ownership> &node_data_container)
|
||||||
@@ -322,6 +299,23 @@ inline void read(storage::io::FileReader &reader,
|
|||||||
for (auto &penalty : conditional_penalties)
|
for (auto &penalty : conditional_penalties)
|
||||||
read(reader, penalty);
|
read(reader, penalty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void write(storage::io::FileWriter &writer,
|
||||||
|
const std::vector<StorageManeuverOverride> &maneuver_overrides,
|
||||||
|
const std::vector<NodeID> &node_sequences)
|
||||||
|
{
|
||||||
|
storage::serialization::write(writer, maneuver_overrides);
|
||||||
|
storage::serialization::write(writer, node_sequences);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename ManeuverOverridesT, typename NodeSequenceT>
|
||||||
|
inline void read(storage::io::FileReader &reader,
|
||||||
|
ManeuverOverridesT &maneuver_overrides,
|
||||||
|
NodeSequenceT &node_sequences)
|
||||||
|
{
|
||||||
|
storage::serialization::read(reader, maneuver_overrides);
|
||||||
|
storage::serialization::read(reader, node_sequences);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-56
@@ -1,46 +1,42 @@
|
|||||||
#ifndef OSRM_GUIDANCE_TURN_LANE_TYPES_HPP_
|
#ifndef OSRM_GUIDANCE_TURN_LANE_TYPES_HPP_
|
||||||
#define OSRM_GUIDANCE_TURN_LANE_TYPES_HPP_
|
#define OSRM_GUIDANCE_TURN_LANE_TYPES_HPP_
|
||||||
|
|
||||||
|
#include "util/concurrent_id_map.hpp"
|
||||||
|
#include "util/integer_range.hpp"
|
||||||
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
|
#include <boost/functional/hash.hpp>
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <numeric> //partial_sum
|
#include <numeric> //partial_sum
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/functional/hash.hpp>
|
|
||||||
|
|
||||||
#include "util/concurrent_id_map.hpp"
|
|
||||||
#include "util/json_container.hpp"
|
|
||||||
#include "util/typedefs.hpp"
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
namespace guidance
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace TurnLaneType
|
namespace TurnLaneType
|
||||||
{
|
{
|
||||||
namespace detail
|
const constexpr std::size_t NUM_TYPES = 11;
|
||||||
|
|
||||||
|
inline auto laneTypeToName(const std::size_t type_id)
|
||||||
{
|
{
|
||||||
const constexpr std::size_t num_supported_lane_types = 11;
|
const static char *name[NUM_TYPES] = {"none",
|
||||||
|
"straight",
|
||||||
const constexpr char *translations[detail::num_supported_lane_types] = {"none",
|
"sharp left",
|
||||||
"straight",
|
"left",
|
||||||
"sharp left",
|
"slight left",
|
||||||
"left",
|
"slight right",
|
||||||
"slight left",
|
"right",
|
||||||
"slight right",
|
"sharp right",
|
||||||
"right",
|
"uturn",
|
||||||
"sharp right",
|
"merge to left",
|
||||||
"uturn",
|
"merge to right"};
|
||||||
"merge to left",
|
return name[type_id];
|
||||||
"merge to right"};
|
}
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
typedef std::uint16_t Mask;
|
typedef std::uint16_t Mask;
|
||||||
const constexpr Mask empty = 0u;
|
const constexpr Mask empty = 0u;
|
||||||
@@ -56,30 +52,6 @@ const constexpr Mask uturn = 1u << 8u;
|
|||||||
const constexpr Mask merge_to_left = 1u << 9u;
|
const constexpr Mask merge_to_left = 1u << 9u;
|
||||||
const constexpr Mask merge_to_right = 1u << 10u;
|
const constexpr Mask merge_to_right = 1u << 10u;
|
||||||
|
|
||||||
inline std::string toString(const Mask lane_type)
|
|
||||||
{
|
|
||||||
if (lane_type == 0)
|
|
||||||
return "none";
|
|
||||||
|
|
||||||
std::bitset<8 * sizeof(Mask)> mask(lane_type);
|
|
||||||
std::string result = "";
|
|
||||||
for (std::size_t lane_id_nr = 0; lane_id_nr < detail::num_supported_lane_types; ++lane_id_nr)
|
|
||||||
if (mask[lane_id_nr])
|
|
||||||
result += (result.empty() ? detail::translations[lane_id_nr]
|
|
||||||
: (std::string(";") + detail::translations[lane_id_nr]));
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline util::json::Array toJsonArray(const Mask lane_type)
|
|
||||||
{
|
|
||||||
util::json::Array result;
|
|
||||||
std::bitset<8 * sizeof(Mask)> mask(lane_type);
|
|
||||||
for (std::size_t lane_id_nr = 0; lane_id_nr < detail::num_supported_lane_types; ++lane_id_nr)
|
|
||||||
if (mask[lane_id_nr])
|
|
||||||
result.values.push_back(detail::translations[lane_id_nr]);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
} // TurnLaneType
|
} // TurnLaneType
|
||||||
|
|
||||||
typedef std::vector<TurnLaneType::Mask> TurnLaneDescription;
|
typedef std::vector<TurnLaneType::Mask> TurnLaneDescription;
|
||||||
@@ -95,10 +67,8 @@ struct TurnLaneDescription_hash
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef util::ConcurrentIDMap<guidance::TurnLaneDescription,
|
using LaneDescriptionMap =
|
||||||
LaneDescriptionID,
|
util::ConcurrentIDMap<TurnLaneDescription, LaneDescriptionID, TurnLaneDescription_hash>;
|
||||||
guidance::TurnLaneDescription_hash>
|
|
||||||
LaneDescriptionMap;
|
|
||||||
|
|
||||||
using TurnLanesIndexedArray =
|
using TurnLanesIndexedArray =
|
||||||
std::tuple<std::vector<std::uint32_t>, std::vector<TurnLaneType::Mask>>;
|
std::tuple<std::vector<std::uint32_t>, std::vector<TurnLaneType::Mask>>;
|
||||||
@@ -121,7 +91,7 @@ inline TurnLanesIndexedArray transformTurnLaneMapIntoArrays(const LaneDescriptio
|
|||||||
std::partial_sum(turn_lane_offsets.begin(), turn_lane_offsets.end(), turn_lane_offsets.begin());
|
std::partial_sum(turn_lane_offsets.begin(), turn_lane_offsets.end(), turn_lane_offsets.begin());
|
||||||
|
|
||||||
// allocate the current masks
|
// allocate the current masks
|
||||||
std::vector<guidance::TurnLaneType::Mask> turn_lane_masks(turn_lane_offsets.back());
|
std::vector<TurnLaneType::Mask> turn_lane_masks(turn_lane_offsets.back());
|
||||||
for (auto entry = turn_lane_map.data.begin(); entry != turn_lane_map.data.end(); ++entry)
|
for (auto entry = turn_lane_map.data.begin(); entry != turn_lane_map.data.end(); ++entry)
|
||||||
std::copy(entry->first.begin(),
|
std::copy(entry->first.begin(),
|
||||||
entry->first.end(),
|
entry->first.end(),
|
||||||
@@ -130,7 +100,6 @@ inline TurnLanesIndexedArray transformTurnLaneMapIntoArrays(const LaneDescriptio
|
|||||||
return std::make_tuple(std::move(turn_lane_offsets), std::move(turn_lane_masks));
|
return std::make_tuple(std::move(turn_lane_offsets), std::move(turn_lane_masks));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // guidance
|
|
||||||
} // extractor
|
} // extractor
|
||||||
} // osrm
|
} // osrm
|
||||||
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef OSRM_GUIDANCE_CONSTANTS_HPP_
|
||||||
|
#define OSRM_GUIDANCE_CONSTANTS_HPP_
|
||||||
|
|
||||||
|
#include "extractor/intersection/constants.hpp"
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace guidance
|
||||||
|
{
|
||||||
|
|
||||||
|
// what angle is interpreted as going straight
|
||||||
|
using extractor::intersection::STRAIGHT_ANGLE;
|
||||||
|
// if a turn deviates this much from going straight, it will be kept straight
|
||||||
|
using extractor::intersection::MAXIMAL_ALLOWED_NO_TURN_DEVIATION;
|
||||||
|
// angle that lies between two nearly indistinguishable roads
|
||||||
|
using extractor::intersection::GROUP_ANGLE;
|
||||||
|
using extractor::intersection::NARROW_TURN_ANGLE;
|
||||||
|
// angle difference that can be classified as straight, if its the only narrow turn
|
||||||
|
using extractor::intersection::FUZZY_ANGLE_DIFFERENCE;
|
||||||
|
|
||||||
|
const double constexpr DISTINCTION_RATIO = 2;
|
||||||
|
|
||||||
|
// Named roundabouts with radii larger then than this are seen as rotary
|
||||||
|
const double constexpr MAX_ROUNDABOUT_RADIUS = 15;
|
||||||
|
// Unnamed small roundabouts that look like intersections are announced as turns,
|
||||||
|
// guard against data issues or such roundabout intersections getting too large.
|
||||||
|
const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 15;
|
||||||
|
|
||||||
|
const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
|
||||||
|
|
||||||
|
const int constexpr MAX_SLIPROAD_THRESHOLD = 250;
|
||||||
|
|
||||||
|
} // namespace guidance
|
||||||
|
} // namespace osrm
|
||||||
|
|
||||||
|
#endif // OSRM_GUIDANCE_CONSTANTS_HPP_
|
||||||
+8
-11
@@ -1,12 +1,10 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_DRIVEWAY_HANDLER_HPP
|
#ifndef OSRM_GUIDANCE_DRIVEWAY_HANDLER_HPP
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_DRIVEWAY_HANDLER_HPP
|
#define OSRM_GUIDANCE_DRIVEWAY_HANDLER_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/intersection_handler.hpp"
|
#include "guidance/intersection_handler.hpp"
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
namespace guidance
|
namespace guidance
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -15,14 +13,14 @@ class DrivewayHandler final : public IntersectionHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DrivewayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
DrivewayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
const extractor::EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const RestrictionMap &node_restriction_map,
|
const extractor::RestrictionMap &node_restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const extractor::TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const extractor::SuffixTable &street_name_suffix_table);
|
||||||
|
|
||||||
~DrivewayHandler() override final = default;
|
~DrivewayHandler() override final = default;
|
||||||
|
|
||||||
@@ -38,7 +36,6 @@ class DrivewayHandler final : public IntersectionHandler
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /* OSRM_EXTRACTOR_GUIDANCE_DRIVEWAY_HANDLER_HPP */
|
#endif /* OSRM_GUIDANCE_DRIVEWAY_HANDLER_HPP */
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#ifndef OSRM_GUIDANCE_FILES_HPP
|
||||||
|
#define OSRM_GUIDANCE_FILES_HPP
|
||||||
|
|
||||||
|
#include "guidance/serialization.hpp"
|
||||||
|
#include "guidance/turn_data_container.hpp"
|
||||||
|
|
||||||
|
#include "util/packed_vector.hpp"
|
||||||
|
#include "util/range_table.hpp"
|
||||||
|
#include "util/serialization.hpp"
|
||||||
|
|
||||||
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace guidance
|
||||||
|
{
|
||||||
|
namespace files
|
||||||
|
{
|
||||||
|
|
||||||
|
// reads .osrm.edges
|
||||||
|
template <typename TurnDataT>
|
||||||
|
inline void readTurnData(const boost::filesystem::path &path,
|
||||||
|
TurnDataT &turn_data,
|
||||||
|
std::uint32_t &connectivity_checksum)
|
||||||
|
{
|
||||||
|
static_assert(std::is_same<guidance::TurnDataContainer, TurnDataT>::value ||
|
||||||
|
std::is_same<guidance::TurnDataView, TurnDataT>::value ||
|
||||||
|
std::is_same<guidance::TurnDataExternalContainer, TurnDataT>::value,
|
||||||
|
"");
|
||||||
|
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||||
|
storage::io::FileReader reader{path, fingerprint};
|
||||||
|
|
||||||
|
serialization::read(reader, turn_data, connectivity_checksum);
|
||||||
|
}
|
||||||
|
|
||||||
|
// writes .osrm.edges
|
||||||
|
template <typename TurnDataT>
|
||||||
|
inline void writeTurnData(const boost::filesystem::path &path,
|
||||||
|
const TurnDataT &turn_data,
|
||||||
|
const std::uint32_t connectivity_checksum)
|
||||||
|
{
|
||||||
|
static_assert(std::is_same<guidance::TurnDataContainer, TurnDataT>::value ||
|
||||||
|
std::is_same<guidance::TurnDataView, TurnDataT>::value ||
|
||||||
|
std::is_same<guidance::TurnDataExternalContainer, TurnDataT>::value,
|
||||||
|
"");
|
||||||
|
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||||
|
storage::io::FileWriter writer{path, fingerprint};
|
||||||
|
|
||||||
|
serialization::write(writer, turn_data, connectivity_checksum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef OSRM_GUIDANCE_GUIDANCE_RUNNER_HPP
|
||||||
|
#define OSRM_GUIDANCE_GUIDANCE_RUNNER_HPP
|
||||||
|
|
||||||
|
#include "guidance/turn_data_container.hpp"
|
||||||
|
|
||||||
|
#include "extractor/compressed_edge_container.hpp"
|
||||||
|
#include "extractor/node_data_container.hpp"
|
||||||
|
#include "extractor/suffix_table.hpp"
|
||||||
|
#include "extractor/turn_lane_types.hpp"
|
||||||
|
#include "extractor/way_restriction_map.hpp"
|
||||||
|
|
||||||
|
#include "util/coordinate.hpp"
|
||||||
|
#include "util/guidance/bearing_class.hpp"
|
||||||
|
#include "util/guidance/entry_class.hpp"
|
||||||
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
|
#include "util/name_table.hpp"
|
||||||
|
#include "util/node_based_graph.hpp"
|
||||||
|
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace guidance
|
||||||
|
{
|
||||||
|
using BearingClassesVector = std::vector<BearingClassID>;
|
||||||
|
using BearingClassesMap = util::ConcurrentIDMap<util::guidance::BearingClass, BearingClassID>;
|
||||||
|
using EntryClassesMap = util::ConcurrentIDMap<util::guidance::EntryClass, EntryClassID>;
|
||||||
|
|
||||||
|
void annotateTurns(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
|
const extractor::EdgeBasedNodeDataContainer &edge_based_node_container,
|
||||||
|
const std::vector<util::Coordinate> &node_coordinates,
|
||||||
|
const extractor::CompressedEdgeContainer &compressed_edge_container,
|
||||||
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
|
const extractor::RestrictionMap &node_restriction_map,
|
||||||
|
const extractor::WayRestrictionMap &way_restriction_map,
|
||||||
|
const util::NameTable &name_table,
|
||||||
|
const extractor::SuffixTable &suffix_table,
|
||||||
|
const extractor::TurnLanesIndexedArray &turn_lanes_data,
|
||||||
|
extractor::LaneDescriptionMap &lane_description_map,
|
||||||
|
util::guidance::LaneDataIdMap &lane_data_map,
|
||||||
|
guidance::TurnDataExternalContainer &turn_data_container,
|
||||||
|
BearingClassesVector &bearing_class_by_node_based_node,
|
||||||
|
BearingClassesMap &bearing_class_hash,
|
||||||
|
EntryClassesMap &entry_class_hash,
|
||||||
|
std::uint32_t &connectivity_checksum);
|
||||||
|
|
||||||
|
} // namespace customizer
|
||||||
|
} // namespace osrm
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
#ifndef OSRM_GUIDANCE_INTERSECTION_HPP_
|
||||||
|
#define OSRM_GUIDANCE_INTERSECTION_HPP_
|
||||||
|
|
||||||
|
#include "extractor/intersection/intersection_view.hpp"
|
||||||
|
#include "guidance/turn_instruction.hpp"
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace guidance
|
||||||
|
{
|
||||||
|
|
||||||
|
// A Connected Road is the internal representation of a potential turn. Internally, we require
|
||||||
|
// full list of all connected roads to determine the outcome.
|
||||||
|
// The reasoning behind is that even invalid turns can influence the perceived angles, or even
|
||||||
|
// instructions themselves. An possible example can be described like this:
|
||||||
|
//
|
||||||
|
// aaa(2)aa
|
||||||
|
// a - bbbbb
|
||||||
|
// aaa(1)aa
|
||||||
|
//
|
||||||
|
// will not be perceived as a turn from (1) -> b, and as a U-turn from (1) -> (2).
|
||||||
|
// In addition, they can influence whether a turn is obvious or not. b->(2) would also be no
|
||||||
|
// turn-operation, but rather a name change.
|
||||||
|
//
|
||||||
|
// If this were a normal intersection with
|
||||||
|
//
|
||||||
|
// cccccccc
|
||||||
|
// o bbbbb
|
||||||
|
// aaaaaaaa
|
||||||
|
//
|
||||||
|
// We would perceive a->c as a sharp turn, a->b as a slight turn, and b->c as a slight turn.
|
||||||
|
struct ConnectedRoad final : extractor::intersection::IntersectionViewData
|
||||||
|
{
|
||||||
|
ConnectedRoad(const extractor::intersection::IntersectionViewData &view,
|
||||||
|
const TurnInstruction instruction,
|
||||||
|
const LaneDataID lane_data_id)
|
||||||
|
: IntersectionViewData(view), instruction(instruction), lane_data_id(lane_data_id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
TurnInstruction instruction;
|
||||||
|
LaneDataID lane_data_id;
|
||||||
|
|
||||||
|
// used to sort the set of connected roads (we require sorting throughout turn handling)
|
||||||
|
bool compareByAngle(const ConnectedRoad &other) const;
|
||||||
|
|
||||||
|
// make a left turn into an equivalent right turn and vice versa
|
||||||
|
void mirror()
|
||||||
|
{
|
||||||
|
const constexpr DirectionModifier::Enum mirrored_modifiers[] = {
|
||||||
|
DirectionModifier::UTurn,
|
||||||
|
DirectionModifier::SharpLeft,
|
||||||
|
DirectionModifier::Left,
|
||||||
|
DirectionModifier::SlightLeft,
|
||||||
|
DirectionModifier::Straight,
|
||||||
|
DirectionModifier::SlightRight,
|
||||||
|
DirectionModifier::Right,
|
||||||
|
DirectionModifier::SharpRight};
|
||||||
|
|
||||||
|
static_assert(
|
||||||
|
sizeof(mirrored_modifiers) / sizeof(DirectionModifier::Enum) ==
|
||||||
|
DirectionModifier::MaxDirectionModifier,
|
||||||
|
"The list of mirrored modifiers needs to match the available modifiers in size.");
|
||||||
|
|
||||||
|
if (util::angularDeviation(angle, 0) > std::numeric_limits<double>::epsilon())
|
||||||
|
{
|
||||||
|
angle = 360 - angle;
|
||||||
|
instruction.direction_modifier = mirrored_modifiers[instruction.direction_modifier];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// small helper function to print the content of a connected road
|
||||||
|
std::string toString(const ConnectedRoad &road);
|
||||||
|
|
||||||
|
// `Intersection` is a relative view of an intersection by an incoming edge.
|
||||||
|
// `Intersection` are streets at an intersection stored as an ordered list of connected roads
|
||||||
|
// ordered from sharp right counter-clockwise to
|
||||||
|
// sharp left where `intersection[0]` is _always_ a u-turn
|
||||||
|
|
||||||
|
// An intersection is an ordered list of connected roads ordered from sharp right
|
||||||
|
// counter-clockwise to sharp left where `intersection[0]` is always a u-turn
|
||||||
|
//
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// (intersec[3])
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// nid ---(via_eid/intersec[0])--- nbg.GetTarget(via) ---(intersec[2])---
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// (intersec[1])
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
//
|
||||||
|
// intersec := intersection
|
||||||
|
// nbh := node_based_graph
|
||||||
|
//
|
||||||
|
struct Intersection final : std::vector<ConnectedRoad>, //
|
||||||
|
extractor::intersection::EnableShapeOps<Intersection>, //
|
||||||
|
extractor::intersection::EnableIntersectionOps<Intersection> //
|
||||||
|
{
|
||||||
|
using Base = std::vector<ConnectedRoad>;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline std::string toString(const ConnectedRoad &road)
|
||||||
|
{
|
||||||
|
std::string result = "[connection] ";
|
||||||
|
result += std::to_string(road.eid);
|
||||||
|
result += " allows entry: ";
|
||||||
|
result += std::to_string(road.entry_allowed);
|
||||||
|
result += " angle: ";
|
||||||
|
result += std::to_string(road.angle);
|
||||||
|
result += " bearing: ";
|
||||||
|
result += std::to_string(road.bearing);
|
||||||
|
result += " instruction: ";
|
||||||
|
result += std::to_string(static_cast<std::int32_t>(road.instruction.type)) + " " +
|
||||||
|
std::to_string(static_cast<std::int32_t>(road.instruction.direction_modifier)) + " " +
|
||||||
|
std::to_string(static_cast<std::int32_t>(road.lane_data_id));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace guidance
|
||||||
|
} // namespace osrm
|
||||||
|
|
||||||
|
#endif /* OSRM_GUIDANCE_INTERSECTION_HPP_*/
|
||||||
+29
-31
@@ -1,11 +1,11 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_
|
#ifndef OSRM_GUIDANCE_INTERSECTION_HANDLER_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_
|
#define OSRM_GUIDANCE_INTERSECTION_HANDLER_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/intersection.hpp"
|
|
||||||
#include "extractor/guidance/node_based_graph_walker.hpp"
|
|
||||||
#include "extractor/intersection/intersection_analysis.hpp"
|
#include "extractor/intersection/intersection_analysis.hpp"
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/intersection/node_based_graph_walker.hpp"
|
||||||
#include "extractor/suffix_table.hpp"
|
#include "extractor/suffix_table.hpp"
|
||||||
|
#include "guidance/constants.hpp"
|
||||||
|
#include "guidance/intersection.hpp"
|
||||||
|
|
||||||
#include "util/coordinate_calculation.hpp"
|
#include "util/coordinate_calculation.hpp"
|
||||||
#include "util/guidance/name_announcements.hpp"
|
#include "util/guidance/name_announcements.hpp"
|
||||||
@@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
namespace guidance
|
namespace guidance
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -33,14 +31,14 @@ class IntersectionHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
const extractor::EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const std::vector<util::Coordinate> &node_coordinates,
|
const std::vector<util::Coordinate> &node_coordinates,
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const RestrictionMap &node_restriction_map,
|
const extractor::RestrictionMap &node_restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const extractor::TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const extractor::SuffixTable &street_name_suffix_table);
|
||||||
|
|
||||||
virtual ~IntersectionHandler() = default;
|
virtual ~IntersectionHandler() = default;
|
||||||
|
|
||||||
@@ -54,15 +52,16 @@ class IntersectionHandler
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||||
const EdgeBasedNodeDataContainer &node_data_container;
|
const extractor::EdgeBasedNodeDataContainer &node_data_container;
|
||||||
const std::vector<util::Coordinate> &node_coordinates;
|
const std::vector<util::Coordinate> &node_coordinates;
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries;
|
const extractor::CompressedEdgeContainer &compressed_geometries;
|
||||||
const RestrictionMap &node_restriction_map;
|
const extractor::RestrictionMap &node_restriction_map;
|
||||||
const std::unordered_set<NodeID> &barrier_nodes;
|
const std::unordered_set<NodeID> &barrier_nodes;
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data;
|
const extractor::TurnLanesIndexedArray &turn_lanes_data;
|
||||||
const util::NameTable &name_table;
|
const util::NameTable &name_table;
|
||||||
const SuffixTable &street_name_suffix_table;
|
const extractor::SuffixTable &street_name_suffix_table;
|
||||||
const NodeBasedGraphWalker graph_walker; // for skipping traffic signal, distances etc.
|
const extractor::intersection::NodeBasedGraphWalker
|
||||||
|
graph_walker; // for skipping traffic signal, distances etc.
|
||||||
|
|
||||||
// Decide on a basic turn types
|
// Decide on a basic turn types
|
||||||
TurnType::Enum findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
|
TurnType::Enum findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
|
||||||
@@ -101,8 +100,8 @@ class IntersectionHandler
|
|||||||
// See `getNextIntersection`
|
// See `getNextIntersection`
|
||||||
struct IntersectionViewAndNode final
|
struct IntersectionViewAndNode final
|
||||||
{
|
{
|
||||||
IntersectionView intersection; // < actual intersection
|
extractor::intersection::IntersectionView intersection; // < actual intersection
|
||||||
NodeID node; // < node at this intersection
|
NodeID node; // < node at this intersection
|
||||||
};
|
};
|
||||||
|
|
||||||
// Skips over artificial intersections i.e. traffic lights, barriers etc.
|
// Skips over artificial intersections i.e. traffic lights, barriers etc.
|
||||||
@@ -153,7 +152,7 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
double best_continue_deviation = 180;
|
double best_continue_deviation = 180;
|
||||||
|
|
||||||
/* helper functions */
|
/* helper functions */
|
||||||
const auto IsContinueRoad = [&](const NodeBasedEdgeAnnotation &way_data) {
|
const auto IsContinueRoad = [&](const extractor::NodeBasedEdgeAnnotation &way_data) {
|
||||||
return !util::guidance::requiresNameAnnounced(
|
return !util::guidance::requiresNameAnnounced(
|
||||||
in_way_data.name_id, way_data.name_id, name_table, street_name_suffix_table);
|
in_way_data.name_id, way_data.name_id, name_table, street_name_suffix_table);
|
||||||
};
|
};
|
||||||
@@ -571,20 +570,20 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
// even reverse the direction. Since we don't want to compute actual turns but simply
|
// even reverse the direction. Since we don't want to compute actual turns but simply
|
||||||
// try to find whether there is a turn going to the opposite direction of our obvious
|
// try to find whether there is a turn going to the opposite direction of our obvious
|
||||||
// turn, this should be alright.
|
// turn, this should be alright.
|
||||||
const auto previous_intersection = [&]() -> IntersectionView {
|
const auto previous_intersection = [&]() -> extractor::intersection::IntersectionView {
|
||||||
const auto parameters = intersection::skipDegreeTwoNodes(
|
const auto parameters = extractor::intersection::skipDegreeTwoNodes(
|
||||||
node_based_graph, {node_at_intersection, intersection[0].eid});
|
node_based_graph, {node_at_intersection, intersection[0].eid});
|
||||||
if (node_based_graph.GetTarget(parameters.edge) == node_at_intersection)
|
if (node_based_graph.GetTarget(parameters.edge) == node_at_intersection)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return intersection::getConnectedRoads<false>(node_based_graph,
|
return extractor::intersection::getConnectedRoads<false>(node_based_graph,
|
||||||
node_data_container,
|
node_data_container,
|
||||||
node_coordinates,
|
node_coordinates,
|
||||||
compressed_geometries,
|
compressed_geometries,
|
||||||
node_restriction_map,
|
node_restriction_map,
|
||||||
barrier_nodes,
|
barrier_nodes,
|
||||||
turn_lanes_data,
|
turn_lanes_data,
|
||||||
parameters);
|
parameters);
|
||||||
}();
|
}();
|
||||||
|
|
||||||
if (!previous_intersection.empty())
|
if (!previous_intersection.empty())
|
||||||
@@ -615,7 +614,6 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_*/
|
#endif /*OSRM_GUIDANCE_INTERSECTION_HANDLER_HPP_*/
|
||||||
+12
-12
@@ -1,16 +1,16 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_IS_THROUGH_STREET_HPP_
|
#ifndef OSRM_GUIDANCE_IS_THROUGH_STREET_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_IS_THROUGH_STREET_HPP_
|
#define OSRM_GUIDANCE_IS_THROUGH_STREET_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/constants.hpp"
|
#include "guidance/constants.hpp"
|
||||||
|
|
||||||
|
#include "extractor/intersection/have_identical_names.hpp"
|
||||||
|
#include "extractor/node_data_container.hpp"
|
||||||
#include "extractor/suffix_table.hpp"
|
#include "extractor/suffix_table.hpp"
|
||||||
|
|
||||||
#include "util/guidance/name_announcements.hpp"
|
#include "util/guidance/name_announcements.hpp"
|
||||||
|
|
||||||
using osrm::util::angularDeviation;
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
namespace guidance
|
namespace guidance
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -18,10 +18,11 @@ template <typename IntersectionType>
|
|||||||
inline bool isThroughStreet(const std::size_t index,
|
inline bool isThroughStreet(const std::size_t index,
|
||||||
const IntersectionType &intersection,
|
const IntersectionType &intersection,
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
const extractor::EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table)
|
const extractor::SuffixTable &street_name_suffix_table)
|
||||||
{
|
{
|
||||||
|
using osrm::util::angularDeviation;
|
||||||
|
|
||||||
const auto &data_at_index = node_data_container.GetAnnotation(
|
const auto &data_at_index = node_data_container.GetAnnotation(
|
||||||
node_based_graph.GetEdgeData(intersection[index].eid).annotation_data);
|
node_based_graph.GetEdgeData(intersection[index].eid).annotation_data);
|
||||||
@@ -43,7 +44,7 @@ inline bool isThroughStreet(const std::size_t index,
|
|||||||
const bool is_nearly_straight = angularDeviation(road.angle, intersection[index].angle) >
|
const bool is_nearly_straight = angularDeviation(road.angle, intersection[index].angle) >
|
||||||
(STRAIGHT_ANGLE - FUZZY_ANGLE_DIFFERENCE);
|
(STRAIGHT_ANGLE - FUZZY_ANGLE_DIFFERENCE);
|
||||||
|
|
||||||
const bool have_same_name = HaveIdenticalNames(
|
const bool have_same_name = extractor::intersection::HaveIdenticalNames(
|
||||||
data_at_index.name_id, road_data.name_id, name_table, street_name_suffix_table);
|
data_at_index.name_id, road_data.name_id, name_table, street_name_suffix_table);
|
||||||
|
|
||||||
const bool have_same_category =
|
const bool have_same_category =
|
||||||
@@ -57,7 +58,6 @@ inline bool isThroughStreet(const std::size_t index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_IS_THROUGH_STREET_HPP_*/
|
#endif /*OSRM_GUIDANCE_IS_THROUGH_STREET_HPP_*/
|
||||||
+10
-14
@@ -1,10 +1,9 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_
|
#ifndef OSRM_GUIDANCE_MOTORWAY_HANDLER_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_
|
#define OSRM_GUIDANCE_MOTORWAY_HANDLER_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/intersection.hpp"
|
#include "guidance/intersection.hpp"
|
||||||
#include "extractor/guidance/intersection_handler.hpp"
|
#include "guidance/intersection_handler.hpp"
|
||||||
#include "extractor/guidance/is_through_street.hpp"
|
#include "guidance/is_through_street.hpp"
|
||||||
#include "extractor/query_node.hpp"
|
|
||||||
|
|
||||||
#include "util/attributes.hpp"
|
#include "util/attributes.hpp"
|
||||||
#include "util/name_table.hpp"
|
#include "util/name_table.hpp"
|
||||||
@@ -14,8 +13,6 @@
|
|||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
namespace guidance
|
namespace guidance
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -24,14 +21,14 @@ class MotorwayHandler : public IntersectionHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MotorwayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
MotorwayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
const extractor::EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const RestrictionMap &node_restriction_map,
|
const extractor::RestrictionMap &node_restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const extractor::TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const extractor::SuffixTable &street_name_suffix_table);
|
||||||
|
|
||||||
~MotorwayHandler() override final = default;
|
~MotorwayHandler() override final = default;
|
||||||
|
|
||||||
@@ -61,7 +58,6 @@ class MotorwayHandler : public IntersectionHandler
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_*/
|
#endif /*OSRM_GUIDANCE_MOTORWAY_HANDLER_HPP_*/
|
||||||
+13
-16
@@ -1,13 +1,13 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
|
#ifndef OSRM_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
|
#define OSRM_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
|
||||||
|
|
||||||
#include "extractor/compressed_edge_container.hpp"
|
#include "extractor/compressed_edge_container.hpp"
|
||||||
#include "extractor/guidance/coordinate_extractor.hpp"
|
#include "extractor/intersection/coordinate_extractor.hpp"
|
||||||
#include "extractor/guidance/intersection.hpp"
|
|
||||||
#include "extractor/guidance/intersection_handler.hpp"
|
|
||||||
#include "extractor/guidance/is_through_street.hpp"
|
|
||||||
#include "extractor/guidance/roundabout_type.hpp"
|
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/query_node.hpp"
|
||||||
|
#include "guidance/intersection.hpp"
|
||||||
|
#include "guidance/intersection_handler.hpp"
|
||||||
|
#include "guidance/is_through_street.hpp"
|
||||||
|
#include "guidance/roundabout_type.hpp"
|
||||||
|
|
||||||
#include "util/name_table.hpp"
|
#include "util/name_table.hpp"
|
||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
@@ -18,8 +18,6 @@
|
|||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
namespace guidance
|
namespace guidance
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -40,14 +38,14 @@ class RoundaboutHandler : public IntersectionHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RoundaboutHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
RoundaboutHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
const extractor::EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries,
|
const extractor::CompressedEdgeContainer &compressed_geometries,
|
||||||
const RestrictionMap &node_restriction_map,
|
const extractor::RestrictionMap &node_restriction_map,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const guidance::TurnLanesIndexedArray &turn_lanes_data,
|
const extractor::TurnLanesIndexedArray &turn_lanes_data,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const extractor::SuffixTable &street_name_suffix_table);
|
||||||
|
|
||||||
~RoundaboutHandler() override final = default;
|
~RoundaboutHandler() override final = default;
|
||||||
|
|
||||||
@@ -82,11 +80,10 @@ class RoundaboutHandler : public IntersectionHandler
|
|||||||
bool
|
bool
|
||||||
qualifiesAsRoundaboutIntersection(const std::unordered_set<NodeID> &roundabout_nodes) const;
|
qualifiesAsRoundaboutIntersection(const std::unordered_set<NodeID> &roundabout_nodes) const;
|
||||||
|
|
||||||
const CoordinateExtractor coordinate_extractor;
|
const extractor::intersection::CoordinateExtractor coordinate_extractor;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
#endif /*OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_*/
|
#endif /*OSRM_GUIDANCE_ROUNDABOUT_HANDLER_HPP_*/
|
||||||
+2
-5
@@ -1,10 +1,8 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_TYPES_HPP_
|
#ifndef OSRM_GUIDANCE_ROUNDABOUT_TYPES_HPP_
|
||||||
#define OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_TYPES_HPP_
|
#define OSRM_GUIDANCE_ROUNDABOUT_TYPES_HPP_
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
namespace guidance
|
namespace guidance
|
||||||
{
|
{
|
||||||
enum class RoundaboutType
|
enum class RoundaboutType
|
||||||
@@ -15,7 +13,6 @@ enum class RoundaboutType
|
|||||||
RoundaboutIntersection // small roundabout with distinct turns, handled as intersection
|
RoundaboutIntersection // small roundabout with distinct turns, handled as intersection
|
||||||
};
|
};
|
||||||
} /* namespace guidance */
|
} /* namespace guidance */
|
||||||
} /* namespace extractor */
|
|
||||||
} /* namespace osrm */
|
} /* namespace osrm */
|
||||||
|
|
||||||
#endif /* OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_TYPES_HPP_ */
|
#endif /* OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_TYPES_HPP_ */
|
||||||
+2
-2
@@ -12,6 +12,7 @@ class NameTable;
|
|||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
class NodeBasedGraphFactory;
|
class NodeBasedGraphFactory;
|
||||||
|
}
|
||||||
|
|
||||||
namespace guidance
|
namespace guidance
|
||||||
{
|
{
|
||||||
@@ -20,8 +21,7 @@ namespace guidance
|
|||||||
// - middle edges between two osm ways in one logic road (U-turn)
|
// - middle edges between two osm ways in one logic road (U-turn)
|
||||||
// - staggered intersections (X-cross)
|
// - staggered intersections (X-cross)
|
||||||
// - square/circle intersections
|
// - square/circle intersections
|
||||||
std::unordered_set<EdgeID> findSegregatedNodes(const NodeBasedGraphFactory &factory,
|
std::unordered_set<EdgeID> findSegregatedNodes(const extractor::NodeBasedGraphFactory &factory,
|
||||||
const util::NameTable &names);
|
const util::NameTable &names);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user