Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9912b26b32 | |||
| 838b2a750e |
+24
-38
@@ -13,9 +13,9 @@ notifications:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- "5.13"
|
|
||||||
# enable building tags
|
# enable building tags
|
||||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||||
|
- 5.12
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
yarn: true
|
yarn: true
|
||||||
@@ -69,34 +69,25 @@ matrix:
|
|||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'lcov']
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
||||||
before_script:
|
|
||||||
- cd ${TRAVIS_BUILD_DIR}
|
|
||||||
- lcov --directory . --zerocounters # clean cached da files
|
|
||||||
after_success:
|
after_success:
|
||||||
# Creating report
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
- cd ${TRAVIS_BUILD_DIR}
|
|
||||||
- lcov --directory . --capture --output-file coverage.info # capture coverage info
|
|
||||||
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
|
|
||||||
- lcov --list coverage.info #debug info
|
|
||||||
# Uploading report to CodeCov
|
|
||||||
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-debug-asan"
|
compiler: "gcc-6-debug-asan"
|
||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "clang-4.0-debug"
|
compiler: "clang-4.0-debug"
|
||||||
addons: &clang40
|
addons: &clang40
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -104,8 +95,8 @@ matrix:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-5-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON
|
||||||
|
|
||||||
# Release Builds
|
# Release Builds
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -113,7 +104,7 @@ matrix:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-5-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -121,7 +112,7 @@ matrix:
|
|||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -135,7 +126,7 @@ matrix:
|
|||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' ENABLE_STXXL=On
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' ENABLE_STXXL=On
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -143,7 +134,7 @@ matrix:
|
|||||||
addons: &gcc49
|
addons: &gcc49
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'ccache']
|
packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||||
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
@@ -168,7 +159,7 @@ matrix:
|
|||||||
#- addons: &clang40
|
#- addons: &clang40
|
||||||
#- apt:
|
#- apt:
|
||||||
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||||
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release'
|
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release'
|
||||||
|
|
||||||
# Shared Library
|
# Shared Library
|
||||||
@@ -177,7 +168,7 @@ matrix:
|
|||||||
addons: &gcc6
|
addons: &gcc6
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||||
|
|
||||||
# Disabled because CI slowness
|
# Disabled because CI slowness
|
||||||
@@ -186,7 +177,7 @@ matrix:
|
|||||||
#- addons: &clang40
|
#- addons: &clang40
|
||||||
#- apt:
|
#- apt:
|
||||||
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||||
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||||
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||||
|
|
||||||
# Node build jobs. These skip running the tests.
|
# Node build jobs. These skip running the tests.
|
||||||
@@ -196,7 +187,7 @@ matrix:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-5-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
@@ -205,8 +196,7 @@ matrix:
|
|||||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
-DENABLE_CCACHE=ON \
|
-DENABLE_CCACHE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||||
-DENABLE_GLIBC_WORKAROUND=ON
|
|
||||||
- make --jobs=${JOBS}
|
- make --jobs=${JOBS}
|
||||||
- popd
|
- popd
|
||||||
script:
|
script:
|
||||||
@@ -220,7 +210,7 @@ matrix:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-5-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
@@ -229,8 +219,7 @@ matrix:
|
|||||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
-DENABLE_CCACHE=ON \
|
-DENABLE_CCACHE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||||
-DENABLE_GLIBC_WORKAROUND=ON
|
|
||||||
- make --jobs=${JOBS}
|
- make --jobs=${JOBS}
|
||||||
- popd
|
- popd
|
||||||
script:
|
script:
|
||||||
@@ -244,7 +233,7 @@ matrix:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-5-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
@@ -253,8 +242,7 @@ matrix:
|
|||||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
-DENABLE_CCACHE=ON \
|
-DENABLE_CCACHE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||||
-DENABLE_GLIBC_WORKAROUND=ON
|
|
||||||
- make --jobs=${JOBS}
|
- make --jobs=${JOBS}
|
||||||
- popd
|
- popd
|
||||||
script:
|
script:
|
||||||
@@ -268,7 +256,7 @@ matrix:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-4.9-dev']
|
packages: ['libstdc++-5-dev']
|
||||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||||
install:
|
install:
|
||||||
- pushd ${OSRM_BUILD_DIR}
|
- pushd ${OSRM_BUILD_DIR}
|
||||||
@@ -277,8 +265,7 @@ matrix:
|
|||||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
-DENABLE_CCACHE=ON \
|
-DENABLE_CCACHE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||||
-DENABLE_GLIBC_WORKAROUND=ON
|
|
||||||
- make --jobs=${JOBS}
|
- make --jobs=${JOBS}
|
||||||
- popd
|
- popd
|
||||||
script:
|
script:
|
||||||
@@ -352,8 +339,7 @@ install:
|
|||||||
-DENABLE_STXXL=${ENABLE_STXXL:-OFF} \
|
-DENABLE_STXXL=${ENABLE_STXXL:-OFF} \
|
||||||
-DBUILD_TOOLS=ON \
|
-DBUILD_TOOLS=ON \
|
||||||
-DENABLE_CCACHE=ON \
|
-DENABLE_CCACHE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||||
-DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF}
|
|
||||||
- echo "travis_fold:start:MAKE"
|
- echo "travis_fold:start:MAKE"
|
||||||
- make --jobs=${JOBS}
|
- make --jobs=${JOBS}
|
||||||
- make tests --jobs=${JOBS}
|
- make tests --jobs=${JOBS}
|
||||||
|
|||||||
+2
-32
@@ -1,35 +1,5 @@
|
|||||||
# 5.13.0
|
|
||||||
- Changes from 5.12:
|
|
||||||
- Profile:
|
|
||||||
- Append cardinal directions from route relations to ref fields to improve instructions; off by default see `profile.cardinal_directions`
|
|
||||||
- Support of `distance` weight in foot and bicycle profiles
|
|
||||||
- Support of relations processing
|
|
||||||
- Added `way:get_location_tag(key)` method to get location-dependent tags https://github.com/Project-OSRM/osrm-backend/wiki/Using-location-dependent-data-in-profiles
|
|
||||||
- Added `forward_ref` and `backward_ref` support
|
|
||||||
- Left-side driving mode is specified by a local Boolean flag `is_left_hand_driving` in `ExtractionWay` and `ExtractionTurn`
|
|
||||||
- Support literal values for maxspeeds in NO, PL and ZA
|
|
||||||
- Infrastructure:
|
|
||||||
- Lua 5.1 support is removed due to lack of support in sol2 https://github.com/ThePhD/sol2/issues/302
|
|
||||||
- Fixed pkg-config version of OSRM
|
|
||||||
- Removed `.osrm.core` file since CoreCH is deprecated now.
|
|
||||||
- Tools:
|
|
||||||
- Because of boost/program_options#32 with boost 1.65+ we needed to change the behavior of the following flags to not accept `={true|false}` anymore:
|
|
||||||
- `--use-locations-cache=false` becomes `--disable-location-cache`
|
|
||||||
- `--parse-conditional-restrictions=true` becomes `--parse-conditional-restrictions`
|
|
||||||
- The deprecated options `--use-level-cache` and `--generate-edge-lookup`
|
|
||||||
- Bugfixes:
|
|
||||||
- Fixed #4348: Some cases of sliproads pre-processing were broken
|
|
||||||
- Fixed #4331: Correctly compute left/right modifiers of forks in case the fork is curved.
|
|
||||||
- Fixed #4472: Correctly count the number of lanes using the delimter in `turn:lanes` tag.
|
|
||||||
- Fixed #4214: Multiple runs of `osrm-partition` lead to crash.
|
|
||||||
- Fixed #4348: Fix assorted problems around slip roads.
|
|
||||||
- Fixed #4420: A bug that would result in unnecessary instructions, due to problems in suffix/prefix detection
|
|
||||||
- Algorithm
|
|
||||||
- Deprecate CoreCH functionality. Usage of CoreCH specific options will fall back to using CH with core_factor of 1.0
|
|
||||||
- MLD uses a unidirectional Dijkstra for 1-to-N and N-to-1 matrices which yields speedup.
|
|
||||||
|
|
||||||
# 5.12.0
|
# 5.12.0
|
||||||
- Changes from 5.11:
|
- Changes from 5.11.0
|
||||||
- Guidance
|
- Guidance
|
||||||
- now announcing turning onto oneways at the end of a road (e.g. onto dual carriageways)
|
- now announcing turning onto oneways at the end of a road (e.g. onto dual carriageways)
|
||||||
- Adds new instruction types at the exit of roundabouts and rotaries `exit roundabout` and `exit rotary`.
|
- Adds new instruction types at the exit of roundabouts and rotaries `exit roundabout` and `exit rotary`.
|
||||||
@@ -92,7 +62,7 @@
|
|||||||
- Bugfixes
|
- Bugfixes
|
||||||
- Properly save/retrieve datasource annotations for road segments ([#4346](https://github.com/Project-OSRM/osrm-backend/issues/4346)
|
- Properly save/retrieve datasource annotations for road segments ([#4346](https://github.com/Project-OSRM/osrm-backend/issues/4346)
|
||||||
- Fix conditional restriction grammer parsing so it works for single-day-of-week restrictions ([#4357](https://github.com/Project-OSRM/osrm-backend/pull/4357))
|
- Fix conditional restriction grammer parsing so it works for single-day-of-week restrictions ([#4357](https://github.com/Project-OSRM/osrm-backend/pull/4357))
|
||||||
- Algorithm
|
- Algorithm)
|
||||||
- BREAKING: the file format requires re-processing due to the changes on via-ways
|
- BREAKING: the file format requires re-processing due to the changes on via-ways
|
||||||
- Added support for via-way restrictions
|
- Added support for via-way restrictions
|
||||||
|
|
||||||
|
|||||||
+40
-27
@@ -31,13 +31,12 @@ option(ENABLE_LTO "Use LTO if available" OFF)
|
|||||||
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||||
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
|
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
|
||||||
option(ENABLE_GLIBC_WORKAROUND "Workaround GLIBC symbol exports" OFF)
|
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
if(ENABLE_MASON)
|
if(ENABLE_MASON)
|
||||||
# versions in use
|
# versions in use
|
||||||
set(MASON_BOOST_VERSION "1.65.1")
|
set(MASON_BOOST_VERSION "1.63.0")
|
||||||
set(MASON_STXXL_VERSION "1.4.1-1")
|
set(MASON_STXXL_VERSION "1.4.1-1")
|
||||||
set(MASON_EXPAT_VERSION "2.2.0")
|
set(MASON_EXPAT_VERSION "2.2.0")
|
||||||
set(MASON_LUA_VERSION "5.2.4")
|
set(MASON_LUA_VERSION "5.2.4")
|
||||||
@@ -61,7 +60,7 @@ if (POLICY CMP0048)
|
|||||||
endif()
|
endif()
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
set(OSRM_VERSION_MINOR 13)
|
set(OSRM_VERSION_MINOR 12)
|
||||||
set(OSRM_VERSION_PATCH 0)
|
set(OSRM_VERSION_PATCH 0)
|
||||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||||
|
|
||||||
@@ -212,19 +211,19 @@ endif()
|
|||||||
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
||||||
message(STATUS "Configuring debug mode flags")
|
message(STATUS "Configuring debug mode flags")
|
||||||
set(ENABLE_ASSERTIONS ON)
|
set(ENABLE_ASSERTIONS ON)
|
||||||
|
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline -fno-omit-frame-pointer")
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
if (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ggdb")
|
||||||
|
else()
|
||||||
|
# Don't override the -O parameter for RelWithDebInfo, we want an optimized build
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fno-inline -fno-omit-frame-pointer")
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -fno-omit-frame-pointer")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb")
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -ggdb")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
||||||
message(STATUS "Configuring release mode optimizations")
|
message(STATUS "Configuring release mode optimizations")
|
||||||
# Check if LTO is available
|
# Check if LTO is available
|
||||||
@@ -304,11 +303,10 @@ if (ENABLE_COVERAGE)
|
|||||||
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build")
|
message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "Enabling coverage")
|
message(INFO "Enabling coverage")
|
||||||
set(MAYBE_COVERAGE_LIBRARIES "-lgcov")
|
set(MAYBE_COVERAGE_LIBRARIES "-lgcov")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ftest-coverage -fprofile-arcs")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_SANITIZER)
|
if (ENABLE_SANITIZER)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
|
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
|
||||||
@@ -381,8 +379,8 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|||||||
|
|
||||||
# Activate C++1y
|
# Activate C++1y
|
||||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
||||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++14")
|
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++1y")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configuring other platform dependencies
|
# Configuring other platform dependencies
|
||||||
@@ -519,10 +517,29 @@ else()
|
|||||||
find_package(BZip2 REQUIRED)
|
find_package(BZip2 REQUIRED)
|
||||||
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
||||||
|
|
||||||
find_package(Lua 5.2 REQUIRED)
|
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||||
if (LUA_FOUND)
|
IF (LUA_FOUND)
|
||||||
message(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
endif()
|
ELSE()
|
||||||
|
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||||
|
IF (LUA_FOUND)
|
||||||
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
ELSE()
|
||||||
|
# Now fall back to a lua verison without exact
|
||||||
|
# in case this cmake version also forces patch versions
|
||||||
|
FIND_PACKAGE(Lua 5.2)
|
||||||
|
IF (LUA_FOUND)
|
||||||
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
ELSE()
|
||||||
|
FIND_PACKAGE(Lua 5.1)
|
||||||
|
IF (LUA_FOUND)
|
||||||
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
|
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
|
||||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||||
@@ -812,10 +829,6 @@ add_custom_target(uninstall
|
|||||||
add_subdirectory(unit_tests)
|
add_subdirectory(unit_tests)
|
||||||
add_subdirectory(src/benchmarks)
|
add_subdirectory(src/benchmarks)
|
||||||
|
|
||||||
if (ENABLE_GLIBC_WORKAROUND)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLIBC_WORKAROUND")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ENABLE_NODE_BINDINGS)
|
if (ENABLE_NODE_BINDINGS)
|
||||||
add_subdirectory(src/nodejs)
|
add_subdirectory(src/nodejs)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -41,14 +41,6 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
|||||||
|
|
||||||
The easiest and quickest way to setup your own routing engine is to use Docker images we provide.
|
The easiest and quickest way to setup your own routing engine is to use Docker images we provide.
|
||||||
|
|
||||||
There are two pre-processing pipelines available:
|
|
||||||
- Contraction Hierarchies (CH)
|
|
||||||
- Multi-Level Dijkstra (MLD)
|
|
||||||
|
|
||||||
we recommend using MLD by default except for special use-cases such as very large distance matrices where CH is still a better fit for the time being.
|
|
||||||
In the following we explain the MLD pipeline.
|
|
||||||
If you want to use the CH pipeline instead replace `osrm-partition` and `osrm-customize` with a single `osrm-contract` and change the algorithm option for `osrm-routed` to `--algorithm ch`.
|
|
||||||
|
|
||||||
### Using Docker
|
### Using Docker
|
||||||
|
|
||||||
We base our Docker images ([backend](https://hub.docker.com/r/osrm/osrm-backend/), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Alpine Linux and make sure they are as lightweight as possible.
|
We base our Docker images ([backend](https://hub.docker.com/r/osrm/osrm-backend/), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Alpine Linux and make sure they are as lightweight as possible.
|
||||||
@@ -60,10 +52,9 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
|
|||||||
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
||||||
|
|
||||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-contract /data/berlin-latest.osrm
|
||||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
|
||||||
|
|
||||||
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
|
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed /data/berlin-latest.osrm
|
||||||
|
|
||||||
Make requests against the HTTP server
|
Make requests against the HTTP server
|
||||||
|
|
||||||
@@ -99,8 +90,8 @@ Install dependencies
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt install build-essential git cmake pkg-config \
|
sudo apt install build-essential git cmake pkg-config \
|
||||||
libbz2-dev libxml2-dev libzip-dev libboost-all-dev \
|
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
|
||||||
lua5.2 liblua5.2-dev libtbb-dev
|
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Compile and install OSRM binaries
|
Compile and install OSRM binaries
|
||||||
@@ -113,6 +104,26 @@ cmake --build .
|
|||||||
sudo cmake --build . --target install
|
sudo cmake --build . --target install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
||||||
|
```
|
||||||
|
|
||||||
|
Pre-process the extract and start the HTTP server
|
||||||
|
|
||||||
|
```
|
||||||
|
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
|
||||||
|
osrm-contract berlin-latest.osrm
|
||||||
|
osrm-routed berlin-latest.osrm
|
||||||
|
```
|
||||||
|
|
||||||
|
Running Queries
|
||||||
|
|
||||||
|
```
|
||||||
|
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
|
||||||
|
```
|
||||||
|
|
||||||
### Request Against the Demo Server
|
### Request Against the Demo Server
|
||||||
|
|
||||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||||
@@ -146,9 +157,7 @@ which will check and use pre-built binaries if they're available for this releas
|
|||||||
|
|
||||||
to always force building the Node.js bindings from source.
|
to always force building the Node.js bindings from source.
|
||||||
|
|
||||||
For usage details have a look [these API docs](docs/nodejs/api.md).
|
For usage details have a look [these API docs](docs/nodejs/api.md).
|
||||||
|
|
||||||
An exemplary implementation by a 3rd party with Docker and Node.js can be found [here](https://github.com/door2door-io/osrm-express-server-demo).
|
|
||||||
|
|
||||||
|
|
||||||
## References in publications
|
## References in publications
|
||||||
|
|||||||
+5
-8
@@ -7,22 +7,19 @@ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|||||||
SET PROJECT_DIR=%CD%
|
SET PROJECT_DIR=%CD%
|
||||||
ECHO PROJECT_DIR^: %PROJECT_DIR%
|
ECHO PROJECT_DIR^: %PROJECT_DIR%
|
||||||
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
||||||
|
|
||||||
|
|
||||||
:: Check CMake version
|
|
||||||
SET CMAKE_VERSION=3.9.2
|
|
||||||
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
|
|
||||||
ECHO cmake^: && cmake --version
|
ECHO cmake^: && cmake --version
|
||||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
||||||
|
|
||||||
cmake --version | findstr /C:%CMAKE_VERSION% && GOTO CMAKE_OK
|
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
|
||||||
|
|
||||||
:CMAKE_NOT_OK
|
:CMAKE_NOT_OK
|
||||||
|
SET CMAKE_VERSION=3.7.1
|
||||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||||
powershell Invoke-WebRequest https://cmake.org/files/v3.9/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
|
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
|
||||||
|
|
||||||
:CMAKE_OK
|
:CMAKE_OK
|
||||||
ECHO CMAKE_OK
|
ECHO CMAKE_OK
|
||||||
@@ -40,7 +37,7 @@ ECHO msbuild version
|
|||||||
msbuild /version
|
msbuild /version
|
||||||
|
|
||||||
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
||||||
SET DEPSPKG=osrm-deps-win-x64-14.0-2017.09.7z
|
SET DEPSPKG=osrm-deps-win-x64-14.0.7z
|
||||||
|
|
||||||
:: local development
|
:: local development
|
||||||
ECHO.
|
ECHO.
|
||||||
|
|||||||
@@ -36,8 +36,6 @@
|
|||||||
# This is because, the lua location is not standardized and may exist in
|
# This is because, the lua location is not standardized and may exist in
|
||||||
# locations other than lua/
|
# locations other than lua/
|
||||||
|
|
||||||
include(FindPkgConfig)
|
|
||||||
|
|
||||||
unset(_lua_include_subdirs)
|
unset(_lua_include_subdirs)
|
||||||
unset(_lua_library_names)
|
unset(_lua_library_names)
|
||||||
unset(_lua_append_versions)
|
unset(_lua_append_versions)
|
||||||
@@ -83,7 +81,6 @@ function(_lua_set_version_vars)
|
|||||||
lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||||
lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||||
)
|
)
|
||||||
pkg_check_modules(LUA QUIET "lua${ver}")
|
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
|
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ libdir=@PKGCONFIG_LIBRARY_DIR@
|
|||||||
|
|
||||||
Name: libOSRM
|
Name: libOSRM
|
||||||
Description: Project OSRM library
|
Description: Project OSRM library
|
||||||
Version: @OSRM_VERSION@
|
Version: v@OSRM_VERSION@
|
||||||
Requires:
|
Requires:
|
||||||
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
|
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
|
||||||
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
|
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions',
|
default: '--strict --tags ~@stress --tags ~@mld --tags ~@todo --require features/support --require features/step_definitions',
|
||||||
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
|
verify: '--strict --tags ~@stress --tags ~@mld --tags ~@todo -f progress --require features/support --require features/step_definitions',
|
||||||
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
||||||
all: '--strict --require features/support --require features/step_definitions',
|
all: '--strict --require features/support --require features/step_definitions',
|
||||||
mld: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions -f progress'
|
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@alternative --tags ~@ch --require features/support --require features/step_definitions -f progress'
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-3
@@ -7,7 +7,7 @@ RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
|
|||||||
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
||||||
apk update && \
|
apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.2-dev libtbb@testing libtbb-dev@testing && \
|
apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.1-dev libtbb@testing libtbb-dev@testing && \
|
||||||
\
|
\
|
||||||
echo "Building libstxxl" && \
|
echo "Building libstxxl" && \
|
||||||
cd /opt && \
|
cd /opt && \
|
||||||
@@ -46,8 +46,8 @@ RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
|
|||||||
rm /usr/local/lib/libstxxl* && \
|
rm /usr/local/lib/libstxxl* && \
|
||||||
cd /opt && \
|
cd /opt && \
|
||||||
apk del boost-dev && \
|
apk del boost-dev && \
|
||||||
apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.2-dev git make gcc && \
|
apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.1-dev git make gcc && \
|
||||||
apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.2 expat && \
|
apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.1 expat && \
|
||||||
rm -rf /src /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm*
|
rm -rf /src /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm*
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|||||||
+8
-14
@@ -47,7 +47,7 @@ Profiles can also define a `process_segment` function to handle differences in s
|
|||||||
|
|
||||||
At the end of the file, a table if returned with references to the setup and processing functions the profile has defined.
|
At the end of the file, a table if returned with references to the setup and processing functions the profile has defined.
|
||||||
|
|
||||||
## Understanding speed, weight and rate
|
## Understanding speed, weight and rate
|
||||||
When computing a route from A to B there can be different measure of what is the best route. That's why there's a need for different profiles.
|
When computing a route from A to B there can be different measure of what is the best route. That's why there's a need for different profiles.
|
||||||
|
|
||||||
Because speeds very on different types of roads, the shortest and the fastest route are typically different. But there are many other possible preferences. For example a user might prefer a bicycle route that follow parks or other green areas, even though both duration and distance are a bit longer.
|
Because speeds very on different types of roads, the shortest and the fastest route are typically different. But there are many other possible preferences. For example a user might prefer a bicycle route that follow parks or other green areas, even though both duration and distance are a bit longer.
|
||||||
@@ -91,7 +91,7 @@ The `setup` function is called once when the profile is loaded and must return a
|
|||||||
|
|
||||||
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA iinterpreter will have it's own set of globals.
|
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA iinterpreter will have it's own set of globals.
|
||||||
|
|
||||||
The following global properties can be set under `properties` in the hash you return in the `setup` function:
|
The following global properties can be set under `properties` in the hash you return in the `setup` function:
|
||||||
|
|
||||||
Attribute | Type | Notes
|
Attribute | Type | Notes
|
||||||
-------------------------------------|----------|----------------------------------------------------------------------------
|
-------------------------------------|----------|----------------------------------------------------------------------------
|
||||||
@@ -104,7 +104,6 @@ max_speed_for_map_matching | Float | Maximum vehicle speed to be as
|
|||||||
max_turn_weight | Float | Maximum turn penalty weight
|
max_turn_weight | Float | Maximum turn penalty weight
|
||||||
force_split_edges | Boolean | True value forces a split of forward and backward edges of extracted ways and guarantees that `process_segment` will be called for all segments (default `false`)
|
force_split_edges | Boolean | True value forces a split of forward and backward edges of extracted ways and guarantees that `process_segment` will be called for all segments (default `false`)
|
||||||
|
|
||||||
|
|
||||||
The following additional global properties can be set in the hash you return in the `setup` function:
|
The following additional global properties can be set in the hash you return in the `setup` function:
|
||||||
|
|
||||||
Attribute | Type | Notes
|
Attribute | Type | Notes
|
||||||
@@ -114,9 +113,8 @@ excludable | Sequence of Sets | Determines which class
|
|||||||
classes | Sequence | Determines the allowed classes that can be referenced using `{forward,backward}_classes` on the way in the `process_way` function.
|
classes | Sequence | Determines the allowed classes that can be referenced using `{forward,backward}_classes` on the way in the `process_way` function.
|
||||||
restrictions | Sequence | Determines which turn restrictions will be used for this profile.
|
restrictions | Sequence | Determines which turn restrictions will be used for this profile.
|
||||||
suffix_list | Set | List of name suffixes needed for determining if "Highway 101 NW" the same road as "Highway 101 ES".
|
suffix_list | Set | List of name suffixes needed for determining if "Highway 101 NW" the same road as "Highway 101 ES".
|
||||||
relation_types | Sequence | Determines wich relations should be cached for processing in this profile. It contains relations types
|
|
||||||
|
|
||||||
### process_node(profile, node, result, relations)
|
### process_node(profile, node, result)
|
||||||
Process an OSM node to determine whether this node is a barrier or can be passed and whether passing it incurs a delay.
|
Process an OSM node to determine whether this node is a barrier or can be passed and whether passing it incurs a delay.
|
||||||
|
|
||||||
Argument | Description
|
Argument | Description
|
||||||
@@ -124,7 +122,6 @@ Argument | Description
|
|||||||
profile | The configuration table you returned in `setup`.
|
profile | The configuration table you returned in `setup`.
|
||||||
node | The input node to process (read-only).
|
node | The input node to process (read-only).
|
||||||
result | The output that you will modify.
|
result | The output that you will modify.
|
||||||
relations| Storage of relations to access relations, where `node` is a member.
|
|
||||||
|
|
||||||
The following attributes can be set on `result`:
|
The following attributes can be set on `result`:
|
||||||
|
|
||||||
@@ -133,7 +130,7 @@ Attribute | Type | Notes
|
|||||||
barrier | Boolean | Is it an impassable barrier?
|
barrier | Boolean | Is it an impassable barrier?
|
||||||
traffic_lights | Boolean | Is it a traffic light (incurs delay in `process_turn`)?
|
traffic_lights | Boolean | Is it a traffic light (incurs delay in `process_turn`)?
|
||||||
|
|
||||||
### process_way(profile, way, result, relations)
|
## process_way(profile, way, result)
|
||||||
Given an OpenStreetMap way, the `process_way` function will either return nothing (meaning we are not going to route over this way at all), or it will set up a result hash.
|
Given an OpenStreetMap way, the `process_way` function will either return nothing (meaning we are not going to route over this way at all), or it will set up a result hash.
|
||||||
|
|
||||||
Argument | Description
|
Argument | Description
|
||||||
@@ -141,7 +138,6 @@ Argument | Description
|
|||||||
profile | The configuration table you returned in `setup`.
|
profile | The configuration table you returned in `setup`.
|
||||||
node | The input way to process (read-only).
|
node | The input way to process (read-only).
|
||||||
result | The output that you will modify.
|
result | The output that you will modify.
|
||||||
relations| Storage of relations to access relations, where `way` is a member.
|
|
||||||
|
|
||||||
Importantly it will set `result.forward_mode` and `result.backward_mode` to indicate the travel mode in each direction, as well as set `result.forward_speed` and `result.backward_speed` to integer values representing the speed for traversing the way.
|
Importantly it will set `result.forward_mode` and `result.backward_mode` to indicate the travel mode in each direction, as well as set `result.forward_speed` and `result.backward_speed` to integer values representing the speed for traversing the way.
|
||||||
|
|
||||||
@@ -171,9 +167,7 @@ is_startpoint | Boolean | Can a journey start on this
|
|||||||
roundabout | Boolean | Is this part of a roundabout?
|
roundabout | Boolean | Is this part of a roundabout?
|
||||||
circular | Boolean | Is this part of a non-roundabout circular junction?
|
circular | Boolean | Is this part of a non-roundabout circular junction?
|
||||||
name | String | Name of the way
|
name | String | Name of the way
|
||||||
ref | String | Road number (equal to set `forward_ref` and `backward_ref` with one value)
|
ref | String | Road number
|
||||||
forward_ref | String | Road number in forward way direction
|
|
||||||
backward_ref | String | Road number in backward way direction
|
|
||||||
destinations | String | The road's destinations
|
destinations | String | The road's destinations
|
||||||
exits | String | The ramp's exit numbers or names
|
exits | String | The ramp's exit numbers or names
|
||||||
pronunciation | String | Name pronunciation
|
pronunciation | String | Name pronunciation
|
||||||
@@ -184,9 +178,9 @@ road_classification.may_be_ignored | Boolean | Guidance: way is non-highwa
|
|||||||
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
|
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
|
||||||
|
|
||||||
### process_segment(profile, segment)
|
### process_segment(profile, segment)
|
||||||
The `process_segment` function is called for every segment of OSM ways. A segment is a straight line between two OSM nodes.
|
The `process_segment` function is called for every segment of OSM ways. A segment is a straight line between two OSM nodes.
|
||||||
|
|
||||||
On OpenStreetMap way cannot have different tags on different parts of a way. Instead you would split the way into several smaller ways. However many ways are long. For example, many ways pass hills without any change in tags.
|
On OpenStreetMap way cannot have different tags on different parts of a way. Instead you would split the way into several smaller ways. However many ways are long. For example, many ways pass hills without any change in tags.
|
||||||
|
|
||||||
Processing each segment of an OSM way makes it possible to have different speeds on different parts of a way based on external data like data about elevation, pollution, noise or scenic value and adjust weight and duration of the segment.
|
Processing each segment of an OSM way makes it possible to have different speeds on different parts of a way based on external data like data about elevation, pollution, noise or scenic value and adjust weight and duration of the segment.
|
||||||
|
|
||||||
@@ -271,7 +265,7 @@ Example:
|
|||||||
function process_segment (profile, segment)
|
function process_segment (profile, segment)
|
||||||
local sourceData = raster:query(profile.raster_source, segment.source.lon, segment.source.lat)
|
local sourceData = raster:query(profile.raster_source, segment.source.lon, segment.source.lat)
|
||||||
local targetData = raster:query(profile.raster_source, segment.target.lon, segment.target.lat)
|
local targetData = raster:query(profile.raster_source, segment.target.lon, segment.target.lat)
|
||||||
|
|
||||||
local invalid = sourceData.invalid_data()
|
local invalid = sourceData.invalid_data()
|
||||||
if sourceData.datum ~= invalid and targetData.datum ~= invalid then
|
if sourceData.datum ~= invalid and targetData.datum ~= invalid then
|
||||||
-- use values to adjust weight and duration
|
-- use values to adjust weight and duration
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
@routing @bicycle
|
|
||||||
Feature: Bike - Use distance weight
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given a grid size of 200 meters
|
|
||||||
|
|
||||||
Scenario: Bike - Check distance weight
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
local functions = require('bicycle')
|
|
||||||
functions.setup_testbot = functions.setup
|
|
||||||
|
|
||||||
functions.setup = function()
|
|
||||||
local profile = functions.setup_testbot()
|
|
||||||
profile.properties.weight_name = 'distance'
|
|
||||||
return profile
|
|
||||||
end
|
|
||||||
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a-b-c
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | residential |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | weight | time | distance |
|
|
||||||
| a | b | abc,abc | 200 | 48s | 200m +-1 |
|
|
||||||
| a | c | abc,abc | 400 | 96s | 400m +-1 |
|
|
||||||
@@ -157,16 +157,15 @@ Feature: Car - Restricted access
|
|||||||
|
|
||||||
Scenario: Car - Access combinations
|
Scenario: Car - Access combinations
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
|
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
|
||||||
| runway | private | | | permissive | x | x | |
|
| runway | private | | | permissive | x | x | |
|
||||||
| primary | forestry | | yes | | x | x | |
|
| primary | forestry | | yes | | x | x | |
|
||||||
| cycleway | | | designated | | x | x | |
|
| cycleway | | | designated | | x | x | |
|
||||||
| unclassified | | | destination | destination | x | x | |
|
| residential | | yes | no | | | | |
|
||||||
| residential | | yes | no | | | | |
|
| motorway | yes | permissive | | private | x | | implied oneway |
|
||||||
| motorway | yes | permissive | | private | x | | implied oneway |
|
| trunk | agricultural | designated | permissive | no | | | |
|
||||||
| trunk | agricultural | designated | permissive | no | | | |
|
| pedestrian | | | | | | | |
|
||||||
| pedestrian | | | | | | | |
|
| pedestrian | | | | destination | | | temporary disabled #3773 |
|
||||||
| pedestrian | | | | destination | | | temporary disabled #3773 |
|
|
||||||
|
|
||||||
Scenario: Car - Ignore access tags for other modes
|
Scenario: Car - Ignore access tags for other modes
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -17,27 +17,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | only_right_turn @ (has_pygmies > 10 p) |
|
| restriction | ej | nj | j | only_right_turn @ (has_pygmies > 10 p) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,jc,jc |
|
| e | s | ej,js,js |
|
||||||
| b | a | bj,aj,aj |
|
| e | n | ej,nj,nj |
|
||||||
| b | d | bj,jd,jd |
|
| e | p | ej,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Restriction would be on, but the restriction was badly tagged
|
Scenario: Car - Restriction would be on, but the restriction was badly tagged
|
||||||
@@ -48,29 +48,29 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
p |
|
p |
|
||||||
\ |
|
\ |
|
||||||
j
|
j
|
||||||
| \
|
| \
|
||||||
c m
|
s m
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes |
|
| nodes |
|
||||||
| aj |
|
| nj |
|
||||||
| jc |
|
| js |
|
||||||
| pjm |
|
| pjm |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | aj | pjm | j | no_left_turn @ (Mo-Fr 07:00-10:30) |
|
| restriction | nj | pjm | j | no_left_turn @ (Mo-Fr 07:00-10:30) |
|
||||||
| restriction | jc | pjm | j | no_right_turn @ (Mo-Fr 07:00-10:30) |
|
| restriction | js | pjm | j | no_right_turn @ (Mo-Fr 07:00-10:30) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | m | aj,pjm,pjm |
|
| n | m | nj,pjm,pjm |
|
||||||
| c | m | jc,pjm,pjm |
|
| s | m | js,pjm,pjm |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Restriction With Compressed Geometry
|
Scenario: Car - Restriction With Compressed Geometry
|
||||||
@@ -149,29 +149,29 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | no |
|
| ej | no |
|
||||||
| jd | no |
|
| jp | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional | except |
|
| type | way:from | way:to | node:via | restriction:conditional | except |
|
||||||
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 08:00-12:00) | motorcar |
|
| restriction | ej | nj | j | only_right_turn @ (Mo-Su 08:00-12:00) | motorcar |
|
||||||
| restriction | jd | aj | j | only_left_turn @ (Mo-Su 08:00-12:00) | bus |
|
| restriction | jp | nj | j | only_left_turn @ (Mo-Su 08:00-12:00) | bus |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | # |
|
| from | to | route | # |
|
||||||
| b | c | bj,jc,jc | |
|
| e | s | ej,js,js | |
|
||||||
| b | a | bj,aj,aj | restriction does not apply to cars |
|
| e | n | ej,nj,nj | restriction does not apply to cars |
|
||||||
| b | d | bj,jd,jd | |
|
| e | p | ej,jp,jp | |
|
||||||
| d | c | jd,aj,aj,jc,jc | restriction excepting busses still applies to cars |
|
| p | s | jp,nj,nj,js,js | restriction excepting busses still applies to cars |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - only_right_turn
|
Scenario: Car - only_right_turn
|
||||||
@@ -181,27 +181,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
| restriction | ej | nj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,aj,aj,jc,jc |
|
| e | s | ej,nj,nj,js,js |
|
||||||
| b | a | bj,aj,aj |
|
| e | n | ej,nj,nj |
|
||||||
| b | d | bj,aj,aj,jd,jd |
|
| e | p | ej,nj,nj,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No right turn
|
Scenario: Car - No right turn
|
||||||
@@ -211,27 +211,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | # |
|
| from | to | route | # |
|
||||||
| b | c | bj,jc,jc | normal turn |
|
| e | s | ej,js,js | normal turn |
|
||||||
| b | a | bj,jc,jc,aj,aj | avoids right turn |
|
| e | n | ej,js,js,nj,nj | avoids right turn |
|
||||||
| b | d | bj,jd,jd | normal maneuver |
|
| e | p | ej,jp,jp | normal maneuver |
|
||||||
|
|
||||||
@only_turning @conditionals
|
@only_turning @conditionals
|
||||||
Scenario: Car - only_left_turn
|
Scenario: Car - only_left_turn
|
||||||
@@ -241,27 +241,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
| restriction | ej | js | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,jc,jc |
|
| e | s | ej,js,js |
|
||||||
| b | a | bj,jc,jc,aj,aj |
|
| e | n | ej,js,js,nj,nj |
|
||||||
| b | d | bj,jc,jc,jd,jd |
|
| e | p | ej,js,js,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No left turn
|
Scenario: Car - No left turn
|
||||||
@@ -271,27 +271,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
| restriction | ej | js | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,aj,aj,jc,jc |
|
| e | s | ej,nj,nj,js,js |
|
||||||
| b | a | bj,aj,aj |
|
| e | n | ej,nj,nj |
|
||||||
| b | d | bj,jd,jd |
|
| e | p | ej,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is off
|
Scenario: Car - Conditional restriction is off
|
||||||
@@ -301,27 +301,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
| restriction | ej | nj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,jc,jc |
|
| e | s | ej,js,js |
|
||||||
| b | a | bj,aj,aj |
|
| e | n | ej,nj,nj |
|
||||||
| b | d | bj,jd,jd |
|
| e | p | ej,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is on
|
Scenario: Car - Conditional restriction is on
|
||||||
@@ -331,27 +331,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,jc,jc |
|
| e | s | ej,js,js |
|
||||||
| b | a | bj,jc,jc,aj,aj |
|
| e | n | ej,js,js,nj,nj |
|
||||||
| b | d | bj,jd,jd |
|
| e | p | ej,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction with multiple time windows
|
Scenario: Car - Conditional restriction with multiple time windows
|
||||||
@@ -362,28 +362,28 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
p |
|
p |
|
||||||
\ |
|
\ |
|
||||||
j
|
j
|
||||||
| \
|
| \
|
||||||
c m
|
s m
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| jp | yes |
|
| jp | yes |
|
||||||
| mj | yes |
|
| mj | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
| restriction | nj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | p | aj,jc,jc,jp,jp |
|
| n | p | nj,js,js,jp,jp |
|
||||||
| m | p | mj,jp,jp |
|
| m | p | mj,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
@@ -394,27 +394,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
| restriction | ej | nj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,aj,aj,jc,jc |
|
| e | s | ej,nj,nj,js,js |
|
||||||
| b | a | bj,aj,aj |
|
| e | n | ej,nj,nj |
|
||||||
| b | d | bj,aj,aj,jd,jd |
|
| e | p | ej,nj,nj,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No right turn
|
Scenario: Car - No right turn
|
||||||
@@ -424,27 +424,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | # |
|
| from | to | route | # |
|
||||||
| b | c | bj,jc,jc | normal turn |
|
| e | s | ej,js,js | normal turn |
|
||||||
| b | a | bj,jc,jc,aj,aj | avoids right turn |
|
| e | n | ej,js,js,nj,nj | avoids right turn |
|
||||||
| b | d | bj,jd,jd | normal maneuver |
|
| e | p | ej,jp,jp | normal maneuver |
|
||||||
|
|
||||||
@only_turning @conditionals
|
@only_turning @conditionals
|
||||||
Scenario: Car - only_left_turn
|
Scenario: Car - only_left_turn
|
||||||
@@ -454,27 +454,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
| restriction | ej | js | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,jc,jc |
|
| e | s | ej,js,js |
|
||||||
| b | a | bj,jc,jc,aj,aj |
|
| e | n | ej,js,js,nj,nj |
|
||||||
| b | d | bj,jc,jc,jd,jd |
|
| e | p | ej,js,js,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No left turn
|
Scenario: Car - No left turn
|
||||||
@@ -484,27 +484,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
| restriction | ej | js | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,aj,aj,jc,jc |
|
| e | s | ej,nj,nj,js,js |
|
||||||
| b | a | bj,aj,aj |
|
| e | n | ej,nj,nj |
|
||||||
| b | d | bj,jd,jd |
|
| e | p | ej,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is off
|
Scenario: Car - Conditional restriction is off
|
||||||
@@ -514,27 +514,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
| restriction | ej | nj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,jc,jc |
|
| e | s | ej,js,js |
|
||||||
| b | a | bj,aj,aj |
|
| e | n | ej,nj,nj |
|
||||||
| b | d | bj,jd,jd |
|
| e | p | ej,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is on
|
Scenario: Car - Conditional restriction is on
|
||||||
@@ -544,27 +544,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
p j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| bj | yes |
|
| ej | yes |
|
||||||
| jd | yes |
|
| jp | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | jb | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| b | c | bj,jc,jc |
|
| e | s | ej,js,js |
|
||||||
| b | a | bj,jc,jc,aj,aj |
|
| e | n | ej,js,js,nj,nj |
|
||||||
| b | d | bj,jd,jd |
|
| e | p | ej,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction with multiple time windows
|
Scenario: Car - Conditional restriction with multiple time windows
|
||||||
@@ -575,28 +575,28 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
p |
|
p |
|
||||||
\ |
|
\ |
|
||||||
j
|
j
|
||||||
| \
|
| \
|
||||||
c m
|
s m
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| aj | no |
|
| nj | no |
|
||||||
| jc | no |
|
| js | no |
|
||||||
| jp | yes |
|
| jp | yes |
|
||||||
| mj | yes |
|
| mj | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
| restriction | nj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | p | aj,jc,jc,jp,jp |
|
| n | p | nj,js,js,jp,jp |
|
||||||
| m | p | mj,jp,jp |
|
| m | p | mj,jp,jp |
|
||||||
|
|
||||||
@restriction-way
|
@restriction-way
|
||||||
@@ -677,7 +677,7 @@ Feature: Car - Turn restrictions
|
|||||||
# https://www.openstreetmap.org/#map=18/38.91099/-77.00888
|
# https://www.openstreetmap.org/#map=18/38.91099/-77.00888
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - DC North capitol situation, two on one off
|
Scenario: Car - DC North capitol situation, two on one off
|
||||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
Given the extract extra arguments "--parse-conditional-restrictions=1"
|
||||||
# 9pm Wed 02 May, 2017 UTC, 5pm EDT
|
# 9pm Wed 02 May, 2017 UTC, 5pm EDT
|
||||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200"
|
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200"
|
||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200"
|
||||||
@@ -724,7 +724,7 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - DC North capitol situation, one on two off
|
Scenario: Car - DC North capitol situation, one on two off
|
||||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
Given the extract extra arguments "--parse-conditional-restrictions=1"
|
||||||
# 10:30am utc, wed, 6:30am est
|
# 10:30am utc, wed, 6:30am est
|
||||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400"
|
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400"
|
||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400"
|
||||||
@@ -848,7 +848,7 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
@only_turning @conditionals
|
@only_turning @conditionals
|
||||||
Scenario: Car - Somewhere in London, the UK, GMT timezone
|
Scenario: Car - Somewhere in London, the UK, GMT timezone
|
||||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
Given the extract extra arguments "--parse-conditional-restrictions=1"
|
||||||
# 9am UTC, 10am BST
|
# 9am UTC, 10am BST
|
||||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000"
|
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000"
|
||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000"
|
||||||
|
|||||||
+128
-134
@@ -11,27 +11,27 @@ Feature: Car - Turn restrictions
|
|||||||
Scenario: Car - No left turn
|
Scenario: Car - No left turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | dj | j | no_left_turn |
|
| restriction | sj | wj | j | no_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | |
|
| s | w | |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | cj,bj,bj |
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - No straight on
|
Scenario: Car - No straight on
|
||||||
@@ -67,259 +67,253 @@ Feature: Car - Turn restrictions
|
|||||||
Scenario: Car - No right turn
|
Scenario: Car - No right turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | bj | j | no_right_turn |
|
| restriction | sj | ej | j | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | cj,dj,dj |
|
| s | w | sj,wj,wj |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | |
|
| s | e | |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - No u-turn
|
Scenario: Car - No u-turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | dj | j | no_u_turn |
|
| restriction | sj | wj | j | no_u_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | |
|
| s | w | |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | cj,bj,bj |
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - Handle any no_* relation
|
Scenario: Car - Handle any no_* relation
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | dj | j | no_weird_zigzags |
|
| restriction | sj | wj | j | no_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | |
|
| s | w | |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | cj,bj,bj |
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only left turn
|
Scenario: Car - Only left turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | dj | j | only_left_turn |
|
| restriction | sj | wj | j | only_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route |
|
|
||||||
| c | a | |
|
|
||||||
| c | b | |
|
|
||||||
| c | d | cj,dj,dj |
|
|
||||||
|
|
||||||
Scenario: Car - Only right turn, invalid
|
Scenario: Car - Only right turn, invalid
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b r
|
w j e r
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
| rb | -1 |
|
| re | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | br | j | only_right_on |
|
| restriction | sj | er | j | only_right_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | r | cj,bj,rb,rb |
|
| s | r | sj,ej,re,re |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only right turn
|
Scenario: Car - Only right turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | bj | j | only_right_turn |
|
| restriction | sj | ej | j | only_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | |
|
| s | w | |
|
||||||
| c | a | |
|
| s | n | |
|
||||||
| c | b | cj,bj,bj |
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only straight on
|
Scenario: Car - Only straight on
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | aj | j | only_straight_on |
|
| restriction | sj | nj | j | only_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | |
|
| s | w | |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | |
|
| s | e | |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - Handle any only_* restriction
|
Scenario: Car - Handle any only_* restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | aj | j | only_weird_zigzags |
|
| restriction | sj | nj | j | only_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | |
|
| s | w | |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | |
|
| s | e | |
|
||||||
|
|
||||||
@specific
|
@specific
|
||||||
Scenario: Car - :hgv-qualified on a standard turn restriction
|
Scenario: Car - :hgv-qualified on a standard turn restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:hgv |
|
| type | way:from | way:to | node:via | restriction:hgv |
|
||||||
| restriction | cj | aj | j | no_straight_on |
|
| restriction | sj | nj | j | no_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | cj,dj,dj |
|
| s | w | sj,wj,wj |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | cj,bj,bj |
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
@specific
|
@specific
|
||||||
Scenario: Car - :motorcar-qualified on a standard turn restriction
|
Scenario: Car - :motorcar-qualified on a standard turn restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:motorcar |
|
| type | way:from | way:to | node:via | restriction:motorcar |
|
||||||
| restriction | cj | aj | j | no_straight_on |
|
| restriction | sj | nj | j | no_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | cj,dj,dj |
|
| s | w | sj,wj,wj |
|
||||||
| c | a | |
|
| s | n | |
|
||||||
| c | b | cj,bj,bj |
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Car - Except tag and on no_ restrictions
|
Scenario: Car - Except tag and on no_ restrictions
|
||||||
@@ -490,27 +484,27 @@ Feature: Car - Turn restrictions
|
|||||||
Scenario: Car - Ignore unrecognized restriction
|
Scenario: Car - Ignore unrecognized restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
n
|
||||||
d j b
|
w j e
|
||||||
c
|
s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| cj | yes |
|
| sj | yes |
|
||||||
| aj | -1 |
|
| nj | -1 |
|
||||||
| dj | -1 |
|
| wj | -1 |
|
||||||
| bj | -1 |
|
| ej | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | cj | dj | j | yield |
|
| restriction | sj | wj | j | yield |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| c | d | cj,dj,dj |
|
| s | w | sj,wj,wj |
|
||||||
| c | a | cj,aj,aj |
|
| s | n | sj,nj,nj |
|
||||||
| c | b | cj,bj,bj |
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
@restriction @compression
|
@restriction @compression
|
||||||
Scenario: Restriction On Compressed Geometry
|
Scenario: Restriction On Compressed Geometry
|
||||||
|
|||||||
@@ -1,329 +0,0 @@
|
|||||||
@routing @car @relations
|
|
||||||
Feature: Car - route relations
|
|
||||||
Background:
|
|
||||||
Given the profile "car"
|
|
||||||
|
|
||||||
Scenario: Assignment using relation membership roles
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
c----------------d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ba | westbound | motorway | I 80 |
|
|
||||||
| cd | eastbound | motorway | I 80;CO 93 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:east | way:west | route | ref | network |
|
|
||||||
| route | cd | ba | road | 80 | US:I |
|
|
||||||
| route | cd | ba | road | 93 | US:CO |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| b,a | westbound,westbound | I 80 $west,I 80 $west |
|
|
||||||
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
|
|
||||||
|
|
||||||
Scenario: No cardinal directions by default
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = false
|
|
||||||
"""
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
c----------------d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ba | westbound | motorway | I 80 |
|
|
||||||
| cd | eastbound | motorway | I 80;CO 93 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:east | way:west | route | ref | network |
|
|
||||||
| route | cd | ba | road | 80 | US:I |
|
|
||||||
| route | cd | ba | road | 93 | US:CO |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| b,a | westbound,westbound | I 80,I 80 |
|
|
||||||
| c,d | eastbound,eastbound | I 80; CO 93,I 80; CO 93 |
|
|
||||||
|
|
||||||
Scenario: No cardinal directions by default
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
c----------------d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ba | westbound | motorway | I 80 |
|
|
||||||
| cd | eastbound | motorway | I 80;CO 93 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:east | way:west | route | ref | network |
|
|
||||||
| route | cd | ba | road | 80 | US:I |
|
|
||||||
| route | cd | ba | road | 93 | US:CO |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| b,a | westbound,westbound | I 80,I 80 |
|
|
||||||
| c,d | eastbound,eastbound | I 80; CO 93,I 80; CO 93 |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Assignment using relation direction property (no role on members)
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
c----------------d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ba | westbound | motorway | I 80 |
|
|
||||||
| cd | eastbound | motorway | I 80;CO 93 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | direction | way | route | ref | network |
|
|
||||||
| route | west | ba | road | 80 | US:I |
|
|
||||||
| route | east | cd | road | 80 | US:I |
|
|
||||||
| route | east | cd | road | 93 | US:CO |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| b,a | westbound,westbound | I 80 $west,I 80 $west |
|
|
||||||
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Forward assignment on one-way roads using relation direction property
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
c----------------d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ba | westbound | motorway | I 80 |
|
|
||||||
| cd | eastbound | motorway | I 80;CO 93 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | direction | way:forward | route | ref | network |
|
|
||||||
| route | west | ba | road | 80 | US:I |
|
|
||||||
| route | east | cd | road | 80 | US:I |
|
|
||||||
| route | east | cd | road | 93 | US:CO |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| b,a | westbound,westbound | I 80 $west,I 80 $west |
|
|
||||||
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Forward/backward assignment on non-divided roads with role direction tag
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref | oneway |
|
|
||||||
| ab | mainroad | motorway | I 80 | no |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | direction | way:forward | route | ref | network |
|
|
||||||
| route | west | ab | road | 80 | US:I |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | direction | way:backward | route | ref | network |
|
|
||||||
| route | east | ab | road | 80 | US:I |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| a,b | mainroad,mainroad | I 80 $west,I 80 $west |
|
|
||||||
| b,a | mainroad,mainroad | I 80 $east,I 80 $east |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Conflict between role and direction
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ab | eastbound | motorway | I 80 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | direction | way:east | route | ref | network |
|
|
||||||
| route | west | ab | road | 80 | US:I |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| a,b | eastbound,eastbound | I 80,I 80 |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Conflict between role and superrelation direction
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ab | eastbound | motorway | I 80 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:east | route | ref | network | name |
|
|
||||||
| route | ab | road | 80 | US:I | baserelation |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | direction | relation | route | ref | network | name |
|
|
||||||
| route | west | baserelation | road | 80 | US:I | superrelation |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| a,b | eastbound,eastbound | I 80,I 80 |
|
|
||||||
|
|
||||||
Scenario: Conflict between role and superrelation role
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ab | eastbound | motorway | I 80 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:east | route | ref | network | name |
|
|
||||||
| route | ab | road | 80 | US:I | baserelation |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | relation:west | route | ref | network | name |
|
|
||||||
| route | baserelation | road | 80 | US:I | superrelation |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| a,b | eastbound,eastbound | I 80,I 80 |
|
|
||||||
|
|
||||||
Scenario: Direction only available via superrelation role
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ab | eastbound | motorway | I 80 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:forward | route | ref | network | name |
|
|
||||||
| route | ab | road | 80 | US:I | baserelation |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | relation:east | route | ref | network | name |
|
|
||||||
| route | baserelation | road | 80 | US:I | superrelation |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| a,b | eastbound,eastbound | I 80 $east,I 80 $east |
|
|
||||||
|
|
||||||
Scenario: Direction only available via superrelation direction
|
|
||||||
Given the profile file "car" initialized with
|
|
||||||
"""
|
|
||||||
profile.cardinal_directions = true
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a----------------b
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | ref |
|
|
||||||
| ab | eastbound | motorway | I 80 |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:forward | route | ref | network | name |
|
|
||||||
| route | ab | road | 80 | US:I | baserelation |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | direction | relation | route | ref | network | name |
|
|
||||||
| route | east | baserelation | road | 80 | US:I | superrelation |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | ref |
|
|
||||||
| a,b | eastbound,eastbound | I 80 $east,I 80 $east |
|
|
||||||
|
|
||||||
|
|
||||||
# Scenario: Three levels of indirection
|
|
||||||
# Given the node map
|
|
||||||
# """
|
|
||||||
# a----------------b
|
|
||||||
# """
|
|
||||||
#
|
|
||||||
# And the ways
|
|
||||||
# | nodes | name | highway | ref |
|
|
||||||
# | ab | eastbound | motorway | I 80 |
|
|
||||||
#
|
|
||||||
# And the relations
|
|
||||||
# | type | way:forward | route | ref | network | name |
|
|
||||||
# | route | ab | road | 80 | US:I | baserelation |
|
|
||||||
#
|
|
||||||
# And the relations
|
|
||||||
# | type | relation | route | ref | network | name |
|
|
||||||
# | route | baserelation | road | 80 | US:I | superrelation1 |
|
|
||||||
#
|
|
||||||
# And the relations
|
|
||||||
# | type | direction | relation | route | ref | network | name |
|
|
||||||
# | route | east | superrelation1 | road | 80 | US:I | superrelation2 |
|
|
||||||
#
|
|
||||||
# When I route I should get
|
|
||||||
# | waypoints | route | ref |
|
|
||||||
# | a,b | eastbound,eastbound | I 80 $east,I 80 $east |
|
|
||||||
@@ -5,9 +5,9 @@ Feature: Testbot - side bias
|
|||||||
Given the profile file "car" initialized with
|
Given the profile file "car" initialized with
|
||||||
"""
|
"""
|
||||||
profile.left_hand_driving = true
|
profile.left_hand_driving = true
|
||||||
profile.turn_bias = 1.075
|
profile.turn_bias = 1/1.075
|
||||||
"""
|
"""
|
||||||
And the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c
|
a b c
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Feature: Testbot - side bias
|
|||||||
Given the profile file "car" initialized with
|
Given the profile file "car" initialized with
|
||||||
"""
|
"""
|
||||||
profile.left_hand_driving = true
|
profile.left_hand_driving = true
|
||||||
profile.turn_bias = 1 / 1.075
|
profile.turn_bias = 1.075
|
||||||
"""
|
"""
|
||||||
And the node map
|
And the node map
|
||||||
"""
|
"""
|
||||||
@@ -42,77 +42,8 @@ Feature: Testbot - side bias
|
|||||||
| bc |
|
| bc |
|
||||||
| bd |
|
| bd |
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | time | # |
|
|
||||||
| d | a | bd,ab,ab | 27s +-1 | should be inverse of left hand bias |
|
|
||||||
| d | c | bd,bc,bc | 24s +-1 | |
|
|
||||||
|
|
||||||
Scenario: Roundabout exit counting for left sided driving
|
|
||||||
Given the profile file "testbot" initialized with
|
|
||||||
"""
|
|
||||||
profile.left_hand_driving = true
|
|
||||||
"""
|
|
||||||
And a grid size of 10 meters
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
b
|
|
||||||
h g c d
|
|
||||||
e
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bcegb | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Left-hand bias via location-dependent tags
|
|
||||||
Given the profile "car"
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b c
|
|
||||||
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
And the ways with locations
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
| bd |
|
|
||||||
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | time |
|
|
||||||
| d | a | bd,ab,ab | 24s +-1 |
|
|
||||||
| d | c | bd,bc,bc | 27s +-1 |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Left-hand bias via OSM tags
|
|
||||||
Given the profile "car"
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b c
|
|
||||||
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
And the ways with locations
|
|
||||||
| nodes | driving_side |
|
|
||||||
| ab | right |
|
|
||||||
| bc | right |
|
|
||||||
| bd | right |
|
|
||||||
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| d | a | bd,ab,ab | 27s +-1 |
|
| d | a | bd,ab,ab | 27s +-1 |
|
||||||
|
# should be inverse of left hand bias
|
||||||
| d | c | bd,bc,bc | 24s +-1 |
|
| d | c | bd,bc,bc | 24s +-1 |
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
@routing @foot
|
|
||||||
Feature: Foot - Use distance weight
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given a grid size of 200 meters
|
|
||||||
|
|
||||||
Scenario: Foot - Check distance weight
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
local functions = require('foot')
|
|
||||||
functions.setup_testbot = functions.setup
|
|
||||||
|
|
||||||
functions.setup = function()
|
|
||||||
local profile = functions.setup_testbot()
|
|
||||||
profile.properties.weight_name = 'distance'
|
|
||||||
return profile
|
|
||||||
end
|
|
||||||
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a-b-c
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| abc | residential |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | weight | time | distance |
|
|
||||||
| a | b | abc,abc | 200 | 144s | 200m +-1 |
|
|
||||||
| a | c | abc,abc | 400 | 288s | 400m +-1 |
|
|
||||||
@@ -147,32 +147,3 @@ Feature: Collapse
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | road,left,left | depart,turn left,arrive |
|
| a,d | road,left,left | depart,turn left,arrive |
|
||||||
| a,e | road,right,right | depart,turn right,arrive |
|
| a,e | road,right,right | depart,turn right,arrive |
|
||||||
|
|
||||||
# https://www.openstreetmap.org/#map=18/53.89755/27.54306
|
|
||||||
Scenario: Wide turn into invalid u-turn
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
g
|
|
||||||
|
|
|
||||||
|
|
|
||||||
f - - - - e
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
h - - d
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
a - - - - b - - - - c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| abc | secondary | road |
|
|
||||||
| bdfg | service | |
|
|
||||||
| hd | service | |
|
|
||||||
| fe | service | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| c,e | road,,, | depart,turn right,turn right,arrive |
|
|
||||||
|
|||||||
@@ -22,40 +22,6 @@ Feature: Continue Instructions
|
|||||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
| a,c | abc,abc,abc | depart,continue left,arrive |
|
||||||
| a,d | abc,bd,bd | depart,turn straight,arrive |
|
| a,d | abc,bd,bd | depart,turn straight,arrive |
|
||||||
|
|
||||||
Scenario: Road turning left, Suffix changes
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
a - b-d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | primary | North Capitol Northeast |
|
|
||||||
| bc | primary | North Capitol Northwest |
|
|
||||||
| bd | primary | some random street |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | North Capitol Northeast,North Capitol Northwest,North Capitol Northwest | depart,continue left,arrive |
|
|
||||||
|
|
||||||
Scenario: Road turning left, Suffix changes, no-spaces
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
c
|
|
||||||
a - b-d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name |
|
|
||||||
| ab | primary | North CapitolNortheast |
|
|
||||||
| bc | primary | North CapitolNorthwest |
|
|
||||||
| bd | primary | some random street |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,c | North CapitolNortheast,North CapitolNorthwest,North CapitolNorthwest | depart,continue left,arrive |
|
|
||||||
|
|
||||||
Scenario: Road turning left and straight
|
Scenario: Road turning left and straight
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -995,59 +995,4 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
|
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Sliproad from link via link to primary
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . b
|
|
||||||
` .
|
|
||||||
` .
|
|
||||||
'.
|
|
||||||
c
|
|
||||||
.
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sab | primary_link | sab | |
|
|
||||||
| dbcf | primary | dbcf | |
|
|
||||||
| ac | primary_link | ae | yes |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations |
|
|
||||||
| s,f | sab,dbcf,dbcf | depart,turn right,arrive | s,a,f |
|
|
||||||
|
|
||||||
|
|
||||||
@sliproads
|
|
||||||
Scenario: Sliproad with a single intersection in a cross-road
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
d
|
|
||||||
.
|
|
||||||
s . a . b
|
|
||||||
` .
|
|
||||||
' c . g
|
|
||||||
..
|
|
||||||
e
|
|
||||||
.
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | oneway |
|
|
||||||
| sab | primary | sab | |
|
|
||||||
| dbcef | primary | dbcef | |
|
|
||||||
| ae | primary_link | sab | yes |
|
|
||||||
| cg | primary | cg | |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | locations |
|
|
||||||
| s,f | sab,dbcef,dbcef | depart,turn right,arrive | s,a,f |
|
|
||||||
@@ -523,42 +523,3 @@ Feature: Merge Segregated Roads
|
|||||||
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
|
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
|
||||||
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,false:60 false:120 false:240 true:300,false:0 false:90 false:120 true:180 true:270;true:90 |
|
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,false:60 false:120 false:240 true:300,false:0 false:90 false:120 true:180 true:270;true:90 |
|
||||||
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
|
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Square Area - Don't merge almost circular roads
|
|
||||||
Given a grid size of 2 meters
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
i
|
|
||||||
/
|
|
||||||
/
|
|
||||||
/
|
|
||||||
b---- g .
|
|
||||||
/ p .
|
|
||||||
a / \ f
|
|
||||||
\ / o /
|
|
||||||
\ / \ /
|
|
||||||
c n /
|
|
||||||
/ \ \/
|
|
||||||
/ k e
|
|
||||||
/ \ /
|
|
||||||
h l /
|
|
||||||
\ /
|
|
||||||
m . d
|
|
||||||
/
|
|
||||||
j
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ac | Halenseestraße | yes |
|
|
||||||
| gb | Halenseestraße | yes |
|
|
||||||
| cklmdenopgc | Rathenauplatz | yes |
|
|
||||||
| ig | Kurfürstendamm | yes |
|
|
||||||
| ef | Kurfürstendamm | yes |
|
|
||||||
| ch | Hubertusallee | yes |
|
|
||||||
| jd | Hubertusallee | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| i,h | Kurfürstendamm,Hubertusallee,Hubertusallee | depart,turn straight,arrive |
|
|
||||||
|
|||||||
@@ -274,8 +274,8 @@ Feature: New-Name Instructions
|
|||||||
| bc | Central Expressway | US 75 | motorway |
|
| bc | Central Expressway | US 75 | motorway |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,c | North Central Expressway,Central Expressway | depart,arrive |
|
| a,c | North Central Expressway,Central Expressway,Central Expressway | depart,new name straight,arrive |
|
||||||
|
|
||||||
Scenario: Prefix Change
|
Scenario: Prefix Change
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -289,8 +289,8 @@ Feature: New-Name Instructions
|
|||||||
| cb | Central Expressway | US 75 | motorway |
|
| cb | Central Expressway | US 75 | motorway |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| c,a | Central Expressway,North Central Expressway | depart,arrive |
|
| c,a | Central Expressway,North Central Expressway,North Central Expressway | depart,new name straight,arrive |
|
||||||
|
|
||||||
Scenario: No Name, Same Reference
|
Scenario: No Name, Same Reference
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Feature: Basic Roundabout
|
|||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
Given the profile file "car" initialized with
|
Given the profile file "car" initialized with
|
||||||
"""
|
"""
|
||||||
profile.left_hand_driving = true
|
profile.properties.left_hand_driving = true
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Scenario: Roundabout exit counting for left sided driving
|
Scenario: Roundabout exit counting for left sided driving
|
||||||
|
|||||||
@@ -829,16 +829,16 @@ Feature: Basic Roundabout
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | junction | oneway | # |
|
| nodes | highway | junction | oneway | # |
|
||||||
| abcda | tertiary | roundabout | | circle |
|
| abcda | tertiary | roundabout | | circle |
|
||||||
| ebds | tertiary | | | road |
|
| ebds | tertiary | | | road |
|
||||||
| cm | tertiary | | | |
|
| cm | tertiary | | | |
|
||||||
| ds | tertiary | | | road |
|
| ds | tertiary | | | road |
|
||||||
| rstur | tertiary | roundabout | | circle2 |
|
| rstur | tertiary | roundabout | | circle2 |
|
||||||
| ufghl | tertiary | | | road |
|
| ufghl | tertiary | | | road |
|
||||||
| tv | tertiary | | | |
|
| tv | tertiary | | | |
|
||||||
| gi | tertiary_link | | yes | sliproad |
|
| gi | tertiary | | yes | sliproad |
|
||||||
| jhik | tertiary | | | crossroad |
|
| jhik | tertiary | | | crossroad |
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
|
|||||||
@@ -280,35 +280,6 @@ Feature: Simple Turns
|
|||||||
| a,d | road,road | depart,arrive |
|
| a,d | road,road | depart,arrive |
|
||||||
| e,a | road,road | depart,arrive |
|
| e,a | road,road | depart,arrive |
|
||||||
|
|
||||||
Scenario: Splitting Road with many lanes; same as above makes sure len(turn:lanes) work as expected
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f - - - - - - - - - - - - - - - - - - - - e
|
|
||||||
'
|
|
||||||
'
|
|
||||||
'
|
|
||||||
'
|
|
||||||
'
|
|
||||||
a - - - - - b
|
|
||||||
'
|
|
||||||
'
|
|
||||||
'
|
|
||||||
'
|
|
||||||
'
|
|
||||||
c - - - - - - - - - - - - - - - - - - - - d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | name | turn:lanes | oneway |
|
|
||||||
| ab | primary | road | left\|left\|right\|right | no |
|
|
||||||
| bcd | primary | road | through\|through | yes |
|
|
||||||
| efb | primary | road | through\|through | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | road,road | depart,arrive |
|
|
||||||
| e,a | road,road | depart,arrive |
|
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
# currently the intersections don't match up do to the `merging` process.
|
# currently the intersections don't match up do to the `merging` process.
|
||||||
# The intermediate intersection is technically no-turn at all, since the road continues.
|
# The intermediate intersection is technically no-turn at all, since the road continues.
|
||||||
|
|||||||
@@ -1349,24 +1349,3 @@ Feature: Simple Turns
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | ab,dc,dc | depart,turn left,arrive |
|
| a,d | ab,dc,dc | depart,turn left,arrive |
|
||||||
|
|
||||||
|
|
||||||
# https://www.openstreetmap.org/node/1332083066
|
|
||||||
Scenario: Turns ordering must respect initial bearings
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a . be .
|
|
||||||
\ c.
|
|
||||||
d/ .f . g
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway |
|
|
||||||
| ab | primary | yes |
|
|
||||||
| bcd | primary | yes |
|
|
||||||
| befg | primary | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,bcd,bcd | depart,fork slight right,arrive |
|
|
||||||
| a,g | ab,befg,befg | depart,fork slight left,arrive |
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
hashOfFile: (path, additional_content, cb) => {
|
hashOfFile: (path, cb) => {
|
||||||
fs.readFile(path, (err, result) => {
|
fs.readFile(path, (err, result) => {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
let checksum = crypto.createHash('md5');
|
let checksum = crypto.createHash('md5');
|
||||||
checksum.update(result + (additional_content || "") );
|
checksum.update(result);
|
||||||
cb(null, checksum.digest('hex'));
|
cb(null, checksum.digest('hex'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-13
@@ -61,13 +61,8 @@ class DB {
|
|||||||
});
|
});
|
||||||
|
|
||||||
w.nodes.forEach((k) => {
|
w.nodes.forEach((k) => {
|
||||||
|
way.ele('nd')
|
||||||
let nd = way.ele('nd')
|
|
||||||
.att('ref', k.id);
|
.att('ref', k.id);
|
||||||
if (w.add_locations) {
|
|
||||||
nd.att('lon', k.lon);
|
|
||||||
nd.att('lat', k.lat);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var k in w.tags) {
|
for (var k in w.tags) {
|
||||||
@@ -86,12 +81,11 @@ class DB {
|
|||||||
});
|
});
|
||||||
|
|
||||||
r.members.forEach((m) => {
|
r.members.forEach((m) => {
|
||||||
var d = {
|
relation.ele('member', {
|
||||||
type: m.type,
|
type: m.type,
|
||||||
ref: m.id
|
ref: m.id,
|
||||||
};
|
role: m.role
|
||||||
if (m.role) d.role = m.role;
|
});
|
||||||
relation.ele('member', d);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var k in r.tags) {
|
for (var k in r.tags) {
|
||||||
@@ -126,14 +120,13 @@ class Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Way {
|
class Way {
|
||||||
constructor (id, OSM_USER, OSM_TIMESTAMP, OSM_UID, add_locations) {
|
constructor (id, OSM_USER, OSM_TIMESTAMP, OSM_UID) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.OSM_USER = OSM_USER;
|
this.OSM_USER = OSM_USER;
|
||||||
this.OSM_TIMESTAMP = OSM_TIMESTAMP;
|
this.OSM_TIMESTAMP = OSM_TIMESTAMP;
|
||||||
this.OSM_UID = OSM_UID;
|
this.OSM_UID = OSM_UID;
|
||||||
this.tags = {};
|
this.tags = {};
|
||||||
this.nodes = [];
|
this.nodes = [];
|
||||||
this.add_locations = add_locations;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addNode (node) {
|
addNode (node) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Feature: osrm-contract command line options: help
|
|||||||
And stdout should contain "Configuration:"
|
And stdout should contain "Configuration:"
|
||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
And stdout should contain "--core"
|
And stdout should contain "--core"
|
||||||
|
And stdout should contain "--level-cache"
|
||||||
And stdout should contain "--segment-speed-file"
|
And stdout should contain "--segment-speed-file"
|
||||||
And it should exit with an error
|
And it should exit with an error
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ Feature: osrm-contract command line options: help
|
|||||||
And stdout should contain "Configuration:"
|
And stdout should contain "Configuration:"
|
||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
And stdout should contain "--core"
|
And stdout should contain "--core"
|
||||||
|
And stdout should contain "--level-cache"
|
||||||
And stdout should contain "--segment-speed-file"
|
And stdout should contain "--segment-speed-file"
|
||||||
And it should exit successfully
|
And it should exit successfully
|
||||||
|
|
||||||
@@ -40,5 +42,6 @@ Feature: osrm-contract command line options: help
|
|||||||
And stdout should contain "Configuration:"
|
And stdout should contain "Configuration:"
|
||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
And stdout should contain "--core"
|
And stdout should contain "--core"
|
||||||
|
And stdout should contain "--level-cache"
|
||||||
And stdout should contain "--segment-speed-file"
|
And stdout should contain "--segment-speed-file"
|
||||||
And it should exit successfully
|
And it should exit successfully
|
||||||
|
|||||||
@@ -1,12 +1,22 @@
|
|||||||
@extract
|
@extract
|
||||||
Feature: osrm-extract lua ways:get_nodes()
|
Feature: osrm-extract lua ways:get_nodes()
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
And the data has been saved to disk
|
||||||
|
|
||||||
Scenario: osrm-extract - Passing base file
|
Scenario: osrm-extract - Passing base file
|
||||||
Given the profile file
|
Given the profile file
|
||||||
"""
|
"""
|
||||||
functions = require('testbot')
|
functions = require('testbot')
|
||||||
|
|
||||||
functions.process_way = function(profile, way, result)
|
function way_function(profile, way, result)
|
||||||
for _, node in ipairs(way:get_nodes()) do
|
for _, node in ipairs(way:get_nodes()) do
|
||||||
print('node id ' .. node:id())
|
print('node id ' .. node:id())
|
||||||
end
|
end
|
||||||
@@ -14,138 +24,10 @@ Feature: osrm-extract lua ways:get_nodes()
|
|||||||
result.forward_speed = 1
|
result.forward_speed = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
functions.process_way = way_function
|
||||||
return functions
|
return functions
|
||||||
"""
|
"""
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||||
Then it should exit successfully
|
Then it should exit successfully
|
||||||
And stdout should contain "node id 1"
|
And stdout should contain "node id 1"
|
||||||
And stdout should contain "node id 2"
|
And stdout should contain "node id 2"
|
||||||
|
|
||||||
|
|
||||||
Scenario: osrm-extract location-dependent data without add-locations-to-ways preprocessing and node locations cache
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
functions = require('testbot')
|
|
||||||
|
|
||||||
functions.process_way = function(profile, way, result, relations)
|
|
||||||
print(way:get_location_tag('driving_side'))
|
|
||||||
end
|
|
||||||
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I try to run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson --disable-location-cache"
|
|
||||||
Then it should exit with an error
|
|
||||||
And stderr should contain "invalid location"
|
|
||||||
|
|
||||||
Scenario: osrm-extract location-dependent data
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
functions = require('testbot')
|
|
||||||
|
|
||||||
functions.process_way = function(profile, way, result, relations)
|
|
||||||
for _, key in ipairs({'answer', 'boolean', 'object', 'array'}) do
|
|
||||||
print (key .. ' ' .. tostring(way:get_location_tag(key)))
|
|
||||||
end
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.forward_speed = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways with locations
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson --disable-location-cache"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "answer 42"
|
|
||||||
And stdout should contain "boolean true"
|
|
||||||
And stdout should contain "array nil"
|
|
||||||
And stdout should contain "object nil"
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: osrm-extract location-dependent data with multi-polygons
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
functions = require('testbot')
|
|
||||||
|
|
||||||
functions.process_way = function(profile, way, result, relations)
|
|
||||||
print('ISO3166-1 ' .. (way:get_location_tag('ISO3166-1') or 'none'))
|
|
||||||
print('answer ' .. (way:get_location_tag('answer') or 'none'))
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.forward_speed = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
And the node locations
|
|
||||||
| node | lat | lon | id |
|
|
||||||
| a | 22.4903670 | 113.9455227 | 1 |
|
|
||||||
| b | 22.4901701 | 113.9455899 | 2 |
|
|
||||||
| c | 22.4901852 | 113.9458608 | 3 |
|
|
||||||
| d | 22.4904033 | 113.9456999 | 4 |
|
|
||||||
| e | 1.1 | 1 | 5 |
|
|
||||||
| f | 1.2 | 1 | 6 |
|
|
||||||
And the ways with locations
|
|
||||||
| nodes | # |
|
|
||||||
| ab | Hong Kong |
|
|
||||||
| cd | China Mainland |
|
|
||||||
| ef | Null Island |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson --location-dependent-data test/data/regions/hong-kong.geojson --disable-location-cache"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should not contain "1 GeoJSON polygon"
|
|
||||||
And stdout should contain "2 GeoJSON polygons"
|
|
||||||
And stdout should contain "ISO3166-1 HK"
|
|
||||||
And stdout should contain "ISO3166-1 none"
|
|
||||||
And stdout should contain "answer 42"
|
|
||||||
|
|
||||||
Scenario: osrm-extract location-dependent data via locations cache
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
functions = require('testbot')
|
|
||||||
|
|
||||||
functions.process_way = function(profile, way, result, relations)
|
|
||||||
print ('answer ' .. tostring(way:get_location_tag('answer')))
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.forward_speed = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "answer 42"
|
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
@extract
|
|
||||||
Feature: osrm-extract must be silent with NONE
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
Scenario: osrm-extract - Passing base file with verbosity NONE
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
functions = require('testbot')
|
|
||||||
|
|
||||||
function way_function(profile, way, result)
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.forward_speed = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
functions.process_way = way_function
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file} --verbosity NONE"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should not contain "[info]"
|
|
||||||
And stdout should not contain "[error]"
|
|
||||||
And stdout should not contain "10%"
|
|
||||||
And stderr should be empty
|
|
||||||
@@ -24,7 +24,7 @@ Feature: Invalid profile API versions
|
|||||||
Scenario: Profile API version too high
|
Scenario: Profile API version too high
|
||||||
Given the profile file
|
Given the profile file
|
||||||
"""
|
"""
|
||||||
api_version = 4
|
api_version = 3
|
||||||
"""
|
"""
|
||||||
And the node map
|
And the node map
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
Feature: Profile API version 3
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given a grid size of 100 meters
|
|
||||||
|
|
||||||
Scenario: Basic profile function calls and property values
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
api_version = 3
|
|
||||||
|
|
||||||
Set = require('lib/set')
|
|
||||||
Sequence = require('lib/sequence')
|
|
||||||
Handlers = require("lib/way_handlers")
|
|
||||||
find_access_tag = require("lib/access").find_access_tag
|
|
||||||
limit = require("lib/maxspeed").limit
|
|
||||||
|
|
||||||
function setup()
|
|
||||||
return {
|
|
||||||
properties = {
|
|
||||||
max_speed_for_map_matching = 180/3.6,
|
|
||||||
use_turn_restrictions = true,
|
|
||||||
continue_straight_at_waypoint = true,
|
|
||||||
weight_name = 'test_version2',
|
|
||||||
weight_precision = 2
|
|
||||||
},
|
|
||||||
relation_types = Sequence { "route" }
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
function process_node(profile, node, result, relations)
|
|
||||||
print ('process_node ' .. node:id())
|
|
||||||
end
|
|
||||||
|
|
||||||
function process_way(profile, way, result, relations)
|
|
||||||
result.name = way:get_value_by_key('name')
|
|
||||||
result.weight = 10
|
|
||||||
result.forward_mode = mode.driving
|
|
||||||
result.backward_mode = mode.driving
|
|
||||||
result.forward_speed = 36
|
|
||||||
result.backward_speed = 36
|
|
||||||
|
|
||||||
local rel_id_list = relations:get_relations(way)
|
|
||||||
for i, rel_id in ipairs(rel_id_list) do
|
|
||||||
local rel = relations:relation(rel_id)
|
|
||||||
local role = rel:get_role(way)
|
|
||||||
print('role_' .. role)
|
|
||||||
end
|
|
||||||
print ('process_way ' .. way:id() .. ' ' .. result.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
function process_turn (profile, turn)
|
|
||||||
print('process_turn', turn.angle, turn.turn_type, turn.direction_modifier, turn.has_traffic_light)
|
|
||||||
turn.weight = turn.angle == 0 and 0 or 4.2
|
|
||||||
turn.duration = turn.weight
|
|
||||||
end
|
|
||||||
|
|
||||||
function process_segment (profile, segment)
|
|
||||||
print ('process_segment ' .. segment.source.lon .. ' ' .. segment.source.lat)
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
setup = setup,
|
|
||||||
process_node = process_node,
|
|
||||||
process_way = process_way,
|
|
||||||
process_relation = process_relation,
|
|
||||||
process_segment = process_segment,
|
|
||||||
process_turn = process_turn
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
bcd
|
|
||||||
e
|
|
||||||
"""
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ac |
|
|
||||||
| cb |
|
|
||||||
| cd |
|
|
||||||
| ce |
|
|
||||||
|
|
||||||
And the relations
|
|
||||||
| type | way:north | route |
|
|
||||||
| route | ac | road |
|
|
||||||
|
|
||||||
And the data has been saved to disk
|
|
||||||
|
|
||||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
|
||||||
Then it should exit successfully
|
|
||||||
And stdout should contain "process_node"
|
|
||||||
And stdout should contain "process_way"
|
|
||||||
And stdout should contain "process_turn"
|
|
||||||
And stdout should contain "process_segment"
|
|
||||||
And stdout should contain "role_north"
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | time |
|
|
||||||
| a | b | ac,cb,cb | 19.2s |
|
|
||||||
| a | d | ac,cd,cd | 19.2s |
|
|
||||||
| a | e | ac,ce | 20s |
|
|
||||||
@@ -8,7 +8,7 @@ var OSM = require('../lib/osm');
|
|||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.Given(/^the profile "([^"]*)"$/, (profile, callback) => {
|
this.Given(/^the profile "([^"]*)"$/, (profile, callback) => {
|
||||||
this.profile = this.OSRM_PROFILE || profile;
|
this.profile = profile;
|
||||||
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
|
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
@@ -129,13 +129,13 @@ module.exports = function () {
|
|||||||
q.awaitAll(callback);
|
q.awaitAll(callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the ways( with locations)?$/, (add_locations, table, callback) => {
|
this.Given(/^the ways$/, (table, callback) => {
|
||||||
if (this.osm_str) throw new Error('*** Map data already defined - did you pass an input file in this scenario?');
|
if (this.osm_str) throw new Error('*** Map data already defined - did you pass an input file in this scenario?');
|
||||||
|
|
||||||
let q = d3.queue();
|
let q = d3.queue();
|
||||||
|
|
||||||
let addWay = (row, cb) => {
|
let addWay = (row, cb) => {
|
||||||
let way = new OSM.Way(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID, !!add_locations);
|
let way = new OSM.Way(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
||||||
|
|
||||||
let nodes = row.nodes;
|
let nodes = row.nodes;
|
||||||
if (this.nameWayHash.nodes) throw new Error(util.format('*** duplicate way %s', nodes));
|
if (this.nameWayHash.nodes) throw new Error(util.format('*** duplicate way %s', nodes));
|
||||||
@@ -188,12 +188,9 @@ module.exports = function () {
|
|||||||
let addRelation = (row, cb) => {
|
let addRelation = (row, cb) => {
|
||||||
let relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
let relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
||||||
|
|
||||||
|
|
||||||
var name = null;
|
|
||||||
for (let key in row) {
|
for (let key in row) {
|
||||||
let isNode = key.match(/^node:?(.*)/),
|
let isNode = key.match(/^node:(.*)/),
|
||||||
isWay = key.match(/^way:?(.*)/),
|
isWay = key.match(/^way:(.*)/),
|
||||||
isRelation = key.match(/^relation:?(.*)/),
|
|
||||||
isColonSeparated = key.match(/^(.*):(.*)/);
|
isColonSeparated = key.match(/^(.*):(.*)/);
|
||||||
if (isNode) {
|
if (isNode) {
|
||||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
||||||
@@ -208,26 +205,14 @@ module.exports = function () {
|
|||||||
if (!way) throw new Error(util.format('*** unknown relation way member "%s"', wayName));
|
if (!way) throw new Error(util.format('*** unknown relation way member "%s"', wayName));
|
||||||
relation.addMember('way', way.id, isWay[1]);
|
relation.addMember('way', way.id, isWay[1]);
|
||||||
});
|
});
|
||||||
} else if (isRelation) {
|
|
||||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((relName) => {
|
|
||||||
let otherrelation = this.findRelationByName(relName);
|
|
||||||
if (!otherrelation) throw new Error(util.format('*** unknown relation relation member "%s"', relName));
|
|
||||||
relation.addMember('relation', otherrelation.id, isRelation[1]);
|
|
||||||
});
|
|
||||||
} else if (isColonSeparated && isColonSeparated[1] !== 'restriction') {
|
} else if (isColonSeparated && isColonSeparated[1] !== 'restriction') {
|
||||||
throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"', isColonSeparated[1], isColonSeparated[2]));
|
throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"', isColonSeparated[1], isColonSeparated[2]));
|
||||||
} else {
|
} else {
|
||||||
relation.addTag(key, row[key]);
|
relation.addTag(key, row[key]);
|
||||||
if (key.match(/name/)) name = row[key];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
relation.uid = this.OSM_UID;
|
relation.uid = this.OSM_UID;
|
||||||
|
|
||||||
|
|
||||||
if (name) {
|
|
||||||
this.nameRelationHash[name] = relation;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.OSMDB.addRelation(relation);
|
this.OSMDB.addRelation(relation);
|
||||||
|
|
||||||
cb();
|
cb();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = function () {
|
|||||||
var waypoints = [],
|
var waypoints = [],
|
||||||
columnHeaders = tableRows[0].slice(1),
|
columnHeaders = tableRows[0].slice(1),
|
||||||
rowHeaders = tableRows.map((h) => h[0]).slice(1),
|
rowHeaders = tableRows.map((h) => h[0]).slice(1),
|
||||||
symmetric = columnHeaders.length == rowHeaders.length && columnHeaders.every((ele, i) => ele === rowHeaders[i]);
|
symmetric = columnHeaders.every((ele, i) => ele === rowHeaders[i]);
|
||||||
|
|
||||||
if (symmetric) {
|
if (symmetric) {
|
||||||
columnHeaders.forEach((nodeName) => {
|
columnHeaders.forEach((nodeName) => {
|
||||||
|
|||||||
@@ -54,14 +54,12 @@ module.exports = function () {
|
|||||||
|
|
||||||
this.Then(/^stdout should( not)? contain "(.*?)"$/, (not, str) => {
|
this.Then(/^stdout should( not)? contain "(.*?)"$/, (not, str) => {
|
||||||
const contains = this.stdout.indexOf(str) > -1;
|
const contains = this.stdout.indexOf(str) > -1;
|
||||||
assert.ok(typeof not === 'undefined' ? contains : !contains,
|
assert.ok(typeof not === 'undefined' ? contains : !contains);
|
||||||
'stdout ' + (typeof not === 'undefined' ? 'does not contain' : 'contains') + ' "' + str + '"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
|
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
|
||||||
const contains = this.stderr.indexOf(str) > -1;
|
const contains = this.stderr.indexOf(str) > -1;
|
||||||
assert.ok(typeof not === 'undefined' ? contains : !contains,
|
assert.ok(typeof not === 'undefined' ? contains : !contains);
|
||||||
'stderr ' + (typeof not === 'undefined' ? 'does not contain' : 'contains') + ' "' + str + '"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
||||||
|
|||||||
@@ -28,16 +28,13 @@ module.exports = function() {
|
|||||||
let uri = feature.getUri();
|
let uri = feature.getUri();
|
||||||
|
|
||||||
// setup cache for feature data
|
// setup cache for feature data
|
||||||
// if OSRM_PROFILE is set to force a specific profile, then
|
hash.hashOfFile(uri, (err, hash) => {
|
||||||
// include the profile name in the hash of the profile file
|
|
||||||
hash.hashOfFile(uri, this.OSRM_PROFILE, (err, hash) => {
|
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
|
|
||||||
// shorten uri to be realtive to 'features/'
|
// shorten uri to be realtive to 'features/'
|
||||||
let featurePath = path.relative(path.resolve('./features'), uri);
|
let featurePath = path.relative(path.resolve('./features'), uri);
|
||||||
// bicycle/bollards/{HASH}/
|
// bicycle/bollards/{HASH}/
|
||||||
let featureID = path.join(featurePath, hash);
|
let featureID = path.join(featurePath, hash);
|
||||||
|
|
||||||
let featureCacheDirectory = this.getFeatureCacheDirectory(featureID);
|
let featureCacheDirectory = this.getFeatureCacheDirectory(featureID);
|
||||||
let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash);
|
let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash);
|
||||||
this.featureIDs[uri] = featureID;
|
this.featureIDs[uri] = featureID;
|
||||||
|
|||||||
@@ -144,10 +144,6 @@ module.exports = function () {
|
|||||||
return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')];
|
return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')];
|
||||||
};
|
};
|
||||||
|
|
||||||
this.findRelationByName = (s) => {
|
|
||||||
return this.nameRelationHash[s.toString()] || this.nameRelationHash[s.toString().split('').reverse().join('')];
|
|
||||||
};
|
|
||||||
|
|
||||||
this.makeOSMId = () => {
|
this.makeOSMId = () => {
|
||||||
this.osmID = this.osmID + 1;
|
this.osmID = this.osmID + 1;
|
||||||
return this.osmID;
|
return this.osmID;
|
||||||
@@ -159,7 +155,6 @@ module.exports = function () {
|
|||||||
this.locationHash = {};
|
this.locationHash = {};
|
||||||
this.shortcutsHash = {};
|
this.shortcutsHash = {};
|
||||||
this.nameWayHash = {};
|
this.nameWayHash = {};
|
||||||
this.nameRelationHash = {};
|
|
||||||
this.osmID = 0;
|
this.osmID = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ module.exports = function () {
|
|||||||
|
|
||||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||||
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
||||||
|
|
||||||
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
|
|
||||||
|
|
||||||
if (this.PLATFORM_WINDOWS) {
|
if (this.PLATFORM_WINDOWS) {
|
||||||
this.TERMSIGNAL = 9;
|
this.TERMSIGNAL = 9;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.BeforeFeature((feature, callback) => {
|
this.BeforeFeature((feature, callback) => {
|
||||||
this.profile = this.OSRM_PROFILE || this.DEFAULT_PROFILE;
|
this.profile = this.DEFAULT_PROFILE;
|
||||||
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
|
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
|
||||||
this.setupFeatureCache(feature);
|
this.setupFeatureCache(feature);
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ Feature: Alternative route
|
|||||||
g h i j
|
g h i j
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# enforce multiple cells for filterUnpackedPathsBySharing check
|
|
||||||
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16"
|
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes |
|
| nodes |
|
||||||
| ab |
|
| ab |
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
Feature: Approach parameter
|
Feature: Approach parameter
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a grid size of 10 meters
|
Given the profile "testbot"
|
||||||
|
And a grid size of 10 meters
|
||||||
|
|
||||||
Scenario: Start End same approach, option unrestricted for Start and End
|
Scenario: Start End same approach, option unrestricted for Start and End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s e
|
s e
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -22,8 +22,7 @@ Feature: Approach parameter
|
|||||||
| s | e | unrestricted unrestricted | ab,bc |
|
| s | e | unrestricted unrestricted | ab,bc |
|
||||||
|
|
||||||
Scenario: Start End same approach, option unrestricted for Start and curb for End
|
Scenario: Start End same approach, option unrestricted for Start and curb for End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s e
|
s e
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -39,8 +38,7 @@ Feature: Approach parameter
|
|||||||
| s | e | unrestricted curb | ab,bc,bc |
|
| s | e | unrestricted curb | ab,bc,bc |
|
||||||
|
|
||||||
Scenario: Start End opposite approach, option unrestricted for Start and End
|
Scenario: Start End opposite approach, option unrestricted for Start and End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s
|
s
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -57,8 +55,7 @@ Feature: Approach parameter
|
|||||||
| s | e | unrestricted unrestricted | ab,bc |
|
| s | e | unrestricted unrestricted | ab,bc |
|
||||||
|
|
||||||
Scenario: Start End opposite approach, option unrestricted for Start and curb for End
|
Scenario: Start End opposite approach, option unrestricted for Start and curb for End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s
|
s
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -80,8 +77,7 @@ Feature: Approach parameter
|
|||||||
|
|
||||||
|
|
||||||
Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and End
|
Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s e
|
s e
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -97,8 +93,7 @@ Feature: Approach parameter
|
|||||||
| s | e | unrestricted unrestricted | ab,bc |
|
| s | e | unrestricted unrestricted | ab,bc |
|
||||||
|
|
||||||
Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and curb for End
|
Scenario: Test on oneway segment, Start End same approach, option unrestricted for Start and curb for End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s e
|
s e
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -114,8 +109,7 @@ Feature: Approach parameter
|
|||||||
| s | e | unrestricted curb | ab,bc |
|
| s | e | unrestricted curb | ab,bc |
|
||||||
|
|
||||||
Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and End
|
Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s
|
s
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -132,8 +126,7 @@ Feature: Approach parameter
|
|||||||
| s | e | unrestricted unrestricted | ab,bc |
|
| s | e | unrestricted unrestricted | ab,bc |
|
||||||
|
|
||||||
Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and curb for End
|
Scenario: Test on oneway segment, Start End opposite approach, option unrestricted for Start and curb for End
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s
|
s
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -154,8 +147,7 @@ Feature: Approach parameter
|
|||||||
##############
|
##############
|
||||||
|
|
||||||
Scenario: UTurn test, router can't found a route because uturn unauthorized on the segment selected
|
Scenario: UTurn test, router can't found a route because uturn unauthorized on the segment selected
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
s e
|
s e
|
||||||
a------b------c
|
a------b------c
|
||||||
@@ -176,8 +168,7 @@ Feature: Approach parameter
|
|||||||
|
|
||||||
|
|
||||||
Scenario: UTurn test, router can find a route because he can use the roundabout
|
Scenario: UTurn test, router can find a route because he can use the roundabout
|
||||||
Given the profile "testbot"
|
Given the node map
|
||||||
And the node map
|
|
||||||
"""
|
"""
|
||||||
h
|
h
|
||||||
s e / \
|
s e / \
|
||||||
@@ -199,30 +190,3 @@ Feature: Approach parameter
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | approaches | route |
|
| from | to | approaches | route |
|
||||||
| s | e | unrestricted curb | ab,bc,bc |
|
| s | e | unrestricted curb | ab,bc,bc |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Start End same approach, option unrestricted for Start and curb for End, left-hand driving
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
local functions = require('testbot')
|
|
||||||
local testbot_process_way = functions.process_way
|
|
||||||
functions.process_way = function(profile, way, result)
|
|
||||||
testbot_process_way(profile, way, result)
|
|
||||||
result.is_left_hand_driving = true
|
|
||||||
end
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
s e
|
|
||||||
a------b------c
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| bc |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | approaches | route |
|
|
||||||
| s | e | unrestricted curb | ab,bc |
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ Feature: Basic Distance Matrix
|
|||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16"
|
|
||||||
|
|
||||||
Scenario: Testbot - Travel time matrix of minimal network
|
Scenario: Testbot - Travel time matrix of minimal network
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -42,17 +41,6 @@ Feature: Basic Distance Matrix
|
|||||||
| c | 30 | 20 | 0 | 30 |
|
| c | 30 | 20 | 0 | 30 |
|
||||||
| d | 60 | 50 | 30 | 0 |
|
| d | 60 | 50 | 30 | 0 |
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | b | c | d |
|
|
||||||
| a | 0 | 10 | 30 | 60 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a |
|
|
||||||
| a | 0 |
|
|
||||||
| b | 10 |
|
|
||||||
| c | 30 |
|
|
||||||
| d | 60 |
|
|
||||||
|
|
||||||
Scenario: Testbot - Travel time matrix with fuzzy match
|
Scenario: Testbot - Travel time matrix with fuzzy match
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -125,7 +113,7 @@ Feature: Basic Distance Matrix
|
|||||||
| d | 20 | 30 | 0 | 30 |
|
| d | 20 | 30 | 0 | 30 |
|
||||||
| e | 30 | 40 | 10 | 0 |
|
| e | 30 | 40 | 10 | 0 |
|
||||||
|
|
||||||
Scenario: Testbot - Rectangular travel time matrix
|
Scenario: Testbot - Travel time matrix and with only one source
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c
|
a b c
|
||||||
@@ -144,46 +132,6 @@ Feature: Basic Distance Matrix
|
|||||||
| | a | b | e | f |
|
| | a | b | e | f |
|
||||||
| a | 0 | 10 | 20 | 30 |
|
| a | 0 | 10 | 20 | 30 |
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a |
|
|
||||||
| a | 0 |
|
|
||||||
| b | 10 |
|
|
||||||
| e | 20 |
|
|
||||||
| f | 30 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | b | e | f |
|
|
||||||
| a | 0 | 10 | 20 | 30 |
|
|
||||||
| b | 10 | 0 | 10 | 20 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | b |
|
|
||||||
| a | 0 | 10 |
|
|
||||||
| b | 10 | 0 |
|
|
||||||
| e | 20 | 10 |
|
|
||||||
| f | 30 | 20 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | b | e | f |
|
|
||||||
| a | 0 | 10 | 20 | 30 |
|
|
||||||
| b | 10 | 0 | 10 | 20 |
|
|
||||||
| e | 20 | 10 | 0 | 10 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | b | e |
|
|
||||||
| a | 0 | 10 | 20 |
|
|
||||||
| b | 10 | 0 | 10 |
|
|
||||||
| e | 20 | 10 | 0 |
|
|
||||||
| f | 30 | 20 | 10 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | b | e | f |
|
|
||||||
| a | 0 | 10 | 20 | 30 |
|
|
||||||
| b | 10 | 0 | 10 | 20 |
|
|
||||||
| e | 20 | 10 | 0 | 10 |
|
|
||||||
| f | 30 | 20 | 10 | 0 |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Testbot - Travel time 3x2 matrix
|
Scenario: Testbot - Travel time 3x2 matrix
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -360,52 +308,3 @@ Feature: Basic Distance Matrix
|
|||||||
| 6 | 7 | 6 | 10 | 9 | 1 | 0 | 3.9 | 2.9 |
|
| 6 | 7 | 6 | 10 | 9 | 1 | 0 | 3.9 | 2.9 |
|
||||||
| 7 | 3.1 | 2.1 | 6.1 | 5.1 | 9.1 | 8.1 | 0 | 11 |
|
| 7 | 3.1 | 2.1 | 6.1 | 5.1 | 9.1 | 8.1 | 0 | 11 |
|
||||||
| 8 | 4.1 | 3.1 | 7.1 | 6.1 | 10.1 | 9.1 | 1 | 0 |
|
| 8 | 4.1 | 3.1 | 7.1 | 6.1 | 10.1 | 9.1 | 1 | 0 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Testbot - Travel time matrix with ties
|
|
||||||
Given the profile file
|
|
||||||
"""
|
|
||||||
local functions = require('testbot')
|
|
||||||
functions.process_segment = function(profile, segment)
|
|
||||||
segment.weight = 1
|
|
||||||
segment.duration = 1
|
|
||||||
end
|
|
||||||
functions.process_turn = function(profile, turn)
|
|
||||||
if turn.angle >= 0 then
|
|
||||||
turn.duration = 16
|
|
||||||
else
|
|
||||||
turn.duration = 4
|
|
||||||
end
|
|
||||||
turn.weight = 0
|
|
||||||
end
|
|
||||||
return functions
|
|
||||||
"""
|
|
||||||
And the node map
|
|
||||||
"""
|
|
||||||
a b
|
|
||||||
|
|
||||||
c d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes |
|
|
||||||
| ab |
|
|
||||||
| ac |
|
|
||||||
| bd |
|
|
||||||
| dc |
|
|
||||||
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| from | to | route | distance | time | weight |
|
|
||||||
| a | c | ac,ac | 200m | 5s | 5 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | b | c | d |
|
|
||||||
| a | 0 | 1 | 5 | 10 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a |
|
|
||||||
| a | 0 |
|
|
||||||
| b | 1 |
|
|
||||||
| c | 15 |
|
|
||||||
| d | 10 |
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ Feature: Multi level routing
|
|||||||
| cm | primary |
|
| cm | primary |
|
||||||
| hj | primary |
|
| hj | primary |
|
||||||
| kp | primary |
|
| kp | primary |
|
||||||
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 4,16"
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
@@ -83,28 +82,6 @@ Feature: Multi level routing
|
|||||||
| l | 144.7 | 124.7 | 0 | 60 |
|
| l | 144.7 | 124.7 | 0 | 60 |
|
||||||
| o | 124.7 | 144.7 | 60 | 0 |
|
| o | 124.7 | 144.7 | 60 | 0 |
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | f | l | o |
|
|
||||||
| a | 0 | 229.4 | 144.7 | 124.7 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a |
|
|
||||||
| a | 0 |
|
|
||||||
| f | 229.4 |
|
|
||||||
| l | 144.7 |
|
|
||||||
| o | 124.7 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | f | l | o |
|
|
||||||
| a | 0 | 229.4 | 144.7 | 124.7 |
|
|
||||||
| o | 124.7 | 144.7 | 60 | 0 |
|
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
|
||||||
| | a | o |
|
|
||||||
| a | 0 | 124.7 |
|
|
||||||
| f | 229.4 | 144.7 |
|
|
||||||
| l | 144.7 | 60 |
|
|
||||||
| o | 124.7 | 0 |
|
|
||||||
|
|
||||||
Scenario: Testbot - Multi level routing: horizontal road
|
Scenario: Testbot - Multi level routing: horizontal road
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -12,32 +12,14 @@ namespace osrm
|
|||||||
namespace contractor
|
namespace contractor
|
||||||
{
|
{
|
||||||
|
|
||||||
using GraphAndFilter = std::tuple<QueryGraph, std::vector<std::vector<bool>>>;
|
using GraphFilterAndCore =
|
||||||
|
std::tuple<QueryGraph, std::vector<std::vector<bool>>, std::vector<std::vector<bool>>>;
|
||||||
inline auto contractFullGraph(ContractorGraph contractor_graph,
|
|
||||||
std::vector<EdgeWeight> node_weights)
|
|
||||||
{
|
|
||||||
auto num_nodes = contractor_graph.GetNumberOfNodes();
|
|
||||||
contractGraph(contractor_graph, node_weights);
|
|
||||||
|
|
||||||
auto edges = toEdges<QueryEdge>(std::move(contractor_graph));
|
|
||||||
std::vector<bool> edge_filter(edges.size(), true);
|
|
||||||
|
|
||||||
return GraphAndFilter{QueryGraph{num_nodes, std::move(edges)}, {std::move(edge_filter)}};
|
|
||||||
}
|
|
||||||
|
|
||||||
inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
||||||
std::vector<EdgeWeight> node_weights,
|
std::vector<EdgeWeight> node_weights,
|
||||||
const std::vector<std::vector<bool>> &filters)
|
const std::vector<std::vector<bool>> &filters,
|
||||||
|
const float core_factor = 1.0)
|
||||||
{
|
{
|
||||||
if (filters.size() == 1)
|
|
||||||
{
|
|
||||||
if (std::all_of(filters.front().begin(), filters.front().end(), [](auto v) { return v; }))
|
|
||||||
{
|
|
||||||
return contractFullGraph(std::move(contractor_graph_), std::move(node_weights));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto num_nodes = contractor_graph_.GetNumberOfNodes();
|
auto num_nodes = contractor_graph_.GetNumberOfNodes();
|
||||||
ContractedEdgeContainer edge_container;
|
ContractedEdgeContainer edge_container;
|
||||||
ContractorGraph shared_core_graph;
|
ContractorGraph shared_core_graph;
|
||||||
@@ -57,8 +39,10 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
|||||||
// a very dense core. This increases the overall graph sizes a little bit
|
// a very dense core. This increases the overall graph sizes a little bit
|
||||||
// but increases the final CH quality and contraction speed.
|
// but increases the final CH quality and contraction speed.
|
||||||
constexpr float BASE_CORE = 0.9;
|
constexpr float BASE_CORE = 0.9;
|
||||||
is_shared_core =
|
is_shared_core = contractGraph(contractor_graph,
|
||||||
contractGraph(contractor_graph, std::move(always_allowed), node_weights, BASE_CORE);
|
std::move(always_allowed),
|
||||||
|
node_weights,
|
||||||
|
std::min<float>(BASE_CORE, core_factor));
|
||||||
|
|
||||||
// Add all non-core edges to container
|
// Add all non-core edges to container
|
||||||
{
|
{
|
||||||
@@ -76,18 +60,26 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
|||||||
[&is_shared_core](const NodeID node) { return is_shared_core[node]; });
|
[&is_shared_core](const NodeID node) { return is_shared_core[node]; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::vector<bool>> cores;
|
||||||
for (const auto &filter : filters)
|
for (const auto &filter : filters)
|
||||||
{
|
{
|
||||||
auto filtered_core_graph =
|
auto filtered_core_graph =
|
||||||
shared_core_graph.Filter([&filter](const NodeID node) { return filter[node]; });
|
shared_core_graph.Filter([&filter](const NodeID node) { return filter[node]; });
|
||||||
|
|
||||||
contractGraph(filtered_core_graph, is_shared_core, is_shared_core, node_weights);
|
auto core = contractGraph(
|
||||||
|
filtered_core_graph, is_shared_core, is_shared_core, node_weights, core_factor);
|
||||||
|
if (core_factor == 1.0)
|
||||||
|
{
|
||||||
|
core.clear();
|
||||||
|
}
|
||||||
|
cores.push_back(std::move(core));
|
||||||
|
|
||||||
edge_container.Merge(toEdges<QueryEdge>(std::move(filtered_core_graph)));
|
edge_container.Merge(toEdges<QueryEdge>(std::move(filtered_core_graph)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return GraphAndFilter{QueryGraph{num_nodes, std::move(edge_container.edges)},
|
return GraphFilterAndCore{QueryGraph{num_nodes, std::move(edge_container.edges)},
|
||||||
edge_container.MakeEdgeFilters()};
|
edge_container.MakeEdgeFilters(),
|
||||||
|
std::move(cores)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,9 @@
|
|||||||
#define OSRM_CONTRACTOR_CONTRACTED_EDGE_CONTAINER_HPP
|
#define OSRM_CONTRACTOR_CONTRACTED_EDGE_CONTAINER_HPP
|
||||||
|
|
||||||
#include "contractor/query_edge.hpp"
|
#include "contractor/query_edge.hpp"
|
||||||
|
#include "util/deallocating_vector.hpp"
|
||||||
|
|
||||||
#include "util/integer_range.hpp"
|
|
||||||
#include "util/permutation.hpp"
|
|
||||||
|
|
||||||
#include <tbb/parallel_sort.h>
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <cstdint>
|
|
||||||
#include <numeric>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -51,7 +43,7 @@ struct ContractedEdgeContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Insert(std::vector<QueryEdge> new_edges)
|
void Insert(util::DeallocatingVector<QueryEdge> new_edges)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(edges.size() == 0);
|
BOOST_ASSERT(edges.size() == 0);
|
||||||
BOOST_ASSERT(flags.empty());
|
BOOST_ASSERT(flags.empty());
|
||||||
@@ -60,70 +52,80 @@ struct ContractedEdgeContainer
|
|||||||
flags.resize(edges.size(), ALL_FLAGS);
|
flags.resize(edges.size(), ALL_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Merge(std::vector<QueryEdge> new_edges)
|
void Merge(util::DeallocatingVector<QueryEdge> new_edges)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
|
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
|
||||||
|
|
||||||
const MergedFlags flag = 1 << index++;
|
const MergedFlags flag = 1 << index++;
|
||||||
|
|
||||||
auto edge_iter = edges.cbegin();
|
std::vector<MergedFlags> merged_flags;
|
||||||
auto edge_end = edges.cend();
|
merged_flags.reserve(flags.size() * 1.1);
|
||||||
|
util::DeallocatingVector<QueryEdge> merged_edges;
|
||||||
|
merged_edges.reserve(edges.size() * 1.1);
|
||||||
|
|
||||||
auto flags_iter = flags.begin();
|
auto flags_iter = flags.begin();
|
||||||
|
// destructive iterators, this is single-pass only
|
||||||
|
// FIXME using dbegin() dend() will result in segfaults.
|
||||||
|
auto edges_iter = edges.dbegin();
|
||||||
|
auto edges_end = edges.dend();
|
||||||
|
auto new_edges_iter = new_edges.dbegin();
|
||||||
|
auto new_edges_end = new_edges.dend();
|
||||||
|
|
||||||
// Remove all edges that are contained in the old set of edges and set the appropriate flag.
|
while (edges_iter != edges_end && new_edges_iter != new_edges_end)
|
||||||
auto new_end =
|
{
|
||||||
std::remove_if(new_edges.begin(), new_edges.end(), [&](const QueryEdge &edge) {
|
while (edges_iter != edges_end && mergeCompare(*edges_iter, *new_edges_iter))
|
||||||
// check if the new edge would be sorted before the currend old edge
|
{
|
||||||
// if so it is not contained yet in the set of old edges
|
merged_edges.push_back(*edges_iter);
|
||||||
if (edge_iter == edge_end || mergeCompare(edge, *edge_iter))
|
merged_flags.push_back(*flags_iter);
|
||||||
{
|
edges_iter++;
|
||||||
return false;
|
flags_iter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find the first old edge that is equal or greater then the new edge
|
if (edges_iter == edges_end)
|
||||||
while (edge_iter != edge_end && mergeCompare(*edge_iter, edge))
|
{
|
||||||
{
|
break;
|
||||||
BOOST_ASSERT(flags_iter != flags.end());
|
}
|
||||||
edge_iter++;
|
|
||||||
flags_iter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// all new edges will be sorted after the old edges
|
while (new_edges_iter != new_edges_end && mergeCompare(*new_edges_iter, *edges_iter))
|
||||||
if (edge_iter == edge_end)
|
{
|
||||||
{
|
merged_edges.push_back(*new_edges_iter);
|
||||||
return false;
|
merged_flags.push_back(flag);
|
||||||
}
|
new_edges_iter++;
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_ASSERT(edge_iter != edge_end);
|
if (new_edges_iter == new_edges_end)
|
||||||
if (mergable(edge, *edge_iter))
|
{
|
||||||
{
|
break;
|
||||||
*flags_iter = *flags_iter | flag;
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BOOST_ASSERT(mergeCompare(edge, *edge_iter));
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// append new edges
|
while (edges_iter != edges_end && new_edges_iter != new_edges_end &&
|
||||||
edges.insert(edges.end(), new_edges.begin(), new_end);
|
mergable(*edges_iter, *new_edges_iter))
|
||||||
auto edges_size = edges.size();
|
{
|
||||||
auto new_edges_size = std::distance(new_edges.begin(), new_end);
|
merged_edges.push_back(*edges_iter);
|
||||||
BOOST_ASSERT(edges_size >= new_edges_size);
|
merged_flags.push_back(*flags_iter | flag);
|
||||||
flags.resize(edges_size);
|
|
||||||
std::fill(flags.begin() + edges_size - new_edges_size, flags.end(), flag);
|
|
||||||
|
|
||||||
// enforce sorting for next merge step
|
edges_iter++;
|
||||||
std::vector<unsigned> ordering(edges_size);
|
flags_iter++;
|
||||||
std::iota(ordering.begin(), ordering.end(), 0);
|
new_edges_iter++;
|
||||||
tbb::parallel_sort(
|
}
|
||||||
ordering.begin(), ordering.end(), [&](const auto lhs_idx, const auto rhs_idx) {
|
}
|
||||||
return mergeCompare(edges[lhs_idx], edges[rhs_idx]);
|
|
||||||
});
|
|
||||||
auto permutation = util::orderingToPermutation(ordering);
|
|
||||||
|
|
||||||
util::inplacePermutation(edges.begin(), edges.end(), permutation);
|
while (edges_iter != edges_end)
|
||||||
util::inplacePermutation(flags.begin(), flags.end(), permutation);
|
{
|
||||||
BOOST_ASSERT(std::is_sorted(edges.begin(), edges.end(), mergeCompare));
|
BOOST_ASSERT(new_edges_iter == new_edges_end);
|
||||||
|
merged_edges.push_back(*edges_iter++);
|
||||||
|
merged_flags.push_back(*flags_iter++);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (new_edges_iter != new_edges_end)
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(edges_iter == edges_end);
|
||||||
|
merged_edges.push_back(*new_edges_iter++);
|
||||||
|
merged_flags.push_back(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
flags = std::move(merged_flags);
|
||||||
|
edges = std::move(merged_edges);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto MakeEdgeFilters() const
|
auto MakeEdgeFilters() const
|
||||||
@@ -143,7 +145,7 @@ struct ContractedEdgeContainer
|
|||||||
|
|
||||||
std::size_t index = 0;
|
std::size_t index = 0;
|
||||||
std::vector<MergedFlags> flags;
|
std::vector<MergedFlags> flags;
|
||||||
std::vector<QueryEdge> edges;
|
util::DeallocatingVector<QueryEdge> edges;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -29,6 +29,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#define CONTRACTOR_CONTRACTOR_HPP
|
#define CONTRACTOR_CONTRACTOR_HPP
|
||||||
|
|
||||||
#include "contractor/contractor_config.hpp"
|
#include "contractor/contractor_config.hpp"
|
||||||
|
#include "contractor/query_edge.hpp"
|
||||||
|
#include "extractor/edge_based_edge.hpp"
|
||||||
|
#include "extractor/edge_based_node_segment.hpp"
|
||||||
|
#include "util/deallocating_vector.hpp"
|
||||||
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@@ -39,6 +49,8 @@ namespace contractor
|
|||||||
class Contractor
|
class Contractor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
using EdgeData = QueryEdge::EdgeData;
|
||||||
|
|
||||||
explicit Contractor(const ContractorConfig &config_) : config{config_} {}
|
explicit Contractor(const ContractorConfig &config_) : config{config_} {}
|
||||||
|
|
||||||
Contractor(const Contractor &) = delete;
|
Contractor(const Contractor &) = delete;
|
||||||
@@ -46,6 +58,14 @@ class Contractor
|
|||||||
|
|
||||||
int Run();
|
int Run();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ContractGraph(const unsigned max_edge_id,
|
||||||
|
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
|
util::DeallocatingVector<QueryEdge> &contracted_edge_list,
|
||||||
|
std::vector<EdgeWeight> &&node_weights,
|
||||||
|
std::vector<bool> &is_core_node,
|
||||||
|
std::vector<float> &inout_node_levels) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ContractorConfig config;
|
ContractorConfig config;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -45,7 +45,7 @@ struct ContractorConfig final : storage::IOConfig
|
|||||||
ContractorConfig()
|
ContractorConfig()
|
||||||
: IOConfig({".osrm.ebg", ".osrm.ebg_nodes", ".osrm.properties"},
|
: IOConfig({".osrm.ebg", ".osrm.ebg_nodes", ".osrm.properties"},
|
||||||
{},
|
{},
|
||||||
{".osrm.hsgr", ".osrm.enw"}),
|
{".osrm.level", ".osrm.core", ".osrm.hsgr", ".osrm.enw"}),
|
||||||
requested_num_threads(0)
|
requested_num_threads(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -61,12 +61,10 @@ struct ContractorConfig final : storage::IOConfig
|
|||||||
|
|
||||||
updater::UpdaterConfig updater_config;
|
updater::UpdaterConfig updater_config;
|
||||||
|
|
||||||
// DEPRECATED to be removed in v6.0
|
|
||||||
bool use_cached_priority;
|
bool use_cached_priority;
|
||||||
|
|
||||||
unsigned requested_num_threads;
|
unsigned requested_num_threads;
|
||||||
|
|
||||||
// DEPRECATED to be removed in v6.0
|
|
||||||
// A percentage of vertices that will be contracted for the hierarchy.
|
// A percentage of vertices that will be contracted for the hierarchy.
|
||||||
// Offers a trade-off between preprocessing and query time.
|
// Offers a trade-off between preprocessing and query time.
|
||||||
// The remaining vertices form the core of the hierarchy
|
// The remaining vertices form the core of the hierarchy
|
||||||
|
|||||||
@@ -14,6 +14,37 @@ namespace contractor
|
|||||||
{
|
{
|
||||||
namespace files
|
namespace files
|
||||||
{
|
{
|
||||||
|
// reads .osrm.core
|
||||||
|
template <typename CoreVectorT>
|
||||||
|
void readCoreMarker(const boost::filesystem::path &path, std::vector<CoreVectorT> &cores)
|
||||||
|
{
|
||||||
|
static_assert(util::is_view_or_vector<bool, CoreVectorT>::value,
|
||||||
|
"cores must be a vector of boolean vectors");
|
||||||
|
storage::io::FileReader reader(path, storage::io::FileReader::VerifyFingerprint);
|
||||||
|
|
||||||
|
auto num_cores = reader.ReadElementCount64();
|
||||||
|
cores.resize(num_cores);
|
||||||
|
for (const auto index : util::irange<std::size_t>(0, num_cores))
|
||||||
|
{
|
||||||
|
storage::serialization::read(reader, cores[index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// writes .osrm.core
|
||||||
|
template <typename CoreVectorT>
|
||||||
|
void writeCoreMarker(const boost::filesystem::path &path, const std::vector<CoreVectorT> &cores)
|
||||||
|
{
|
||||||
|
static_assert(util::is_view_or_vector<bool, CoreVectorT>::value,
|
||||||
|
"cores must be a vector of boolean vectors");
|
||||||
|
storage::io::FileWriter writer(path, storage::io::FileWriter::GenerateFingerprint);
|
||||||
|
|
||||||
|
writer.WriteElementCount64(cores.size());
|
||||||
|
for (const auto &core : cores)
|
||||||
|
{
|
||||||
|
storage::serialization::write(writer, core);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// reads .osrm.hsgr file
|
// reads .osrm.hsgr file
|
||||||
template <typename QueryGraphT, typename EdgeFilterT>
|
template <typename QueryGraphT, typename EdgeFilterT>
|
||||||
inline void readGraph(const boost::filesystem::path &path,
|
inline void readGraph(const boost::filesystem::path &path,
|
||||||
@@ -65,6 +96,24 @@ inline void writeGraph(const boost::filesystem::path &path,
|
|||||||
storage::serialization::write(writer, filter);
|
storage::serialization::write(writer, filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reads .levels file
|
||||||
|
inline void readLevels(const boost::filesystem::path &path, std::vector<float> &node_levels)
|
||||||
|
{
|
||||||
|
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||||
|
storage::io::FileReader reader{path, fingerprint};
|
||||||
|
|
||||||
|
storage::serialization::read(reader, node_levels);
|
||||||
|
}
|
||||||
|
|
||||||
|
// writes .levels file
|
||||||
|
inline void writeLevels(const boost::filesystem::path &path, const std::vector<float> &node_levels)
|
||||||
|
{
|
||||||
|
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||||
|
storage::io::FileWriter writer{path, fingerprint};
|
||||||
|
|
||||||
|
storage::serialization::write(writer, node_levels);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#define OSRM_CONTRACTOR_GRAPH_CONTRACTION_ADAPTORS_HPP_
|
#define OSRM_CONTRACTOR_GRAPH_CONTRACTION_ADAPTORS_HPP_
|
||||||
|
|
||||||
#include "contractor/contractor_graph.hpp"
|
#include "contractor/contractor_graph.hpp"
|
||||||
|
|
||||||
#include "util/log.hpp"
|
#include "util/log.hpp"
|
||||||
#include "util/percent.hpp"
|
#include "util/percent.hpp"
|
||||||
|
|
||||||
@@ -126,10 +125,9 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
|
|||||||
return ContractorGraph{number_of_nodes, edges};
|
return ContractorGraph{number_of_nodes, edges};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT graph)
|
template <class Edge, typename GraphT> inline util::DeallocatingVector<Edge> toEdges(GraphT graph)
|
||||||
{
|
{
|
||||||
std::vector<Edge> edges;
|
util::DeallocatingVector<Edge> edges;
|
||||||
edges.reserve(graph.GetNumberOfEdges());
|
|
||||||
|
|
||||||
util::UnbufferedLog log;
|
util::UnbufferedLog log;
|
||||||
log << "Getting edges of minimized graph ";
|
log << "Getting edges of minimized graph ";
|
||||||
@@ -165,7 +163,6 @@ template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT g
|
|||||||
tbb::parallel_sort(edges.begin(), edges.end());
|
tbb::parallel_sort(edges.begin(), edges.end());
|
||||||
auto new_end = std::unique(edges.begin(), edges.end());
|
auto new_end = std::unique(edges.begin(), edges.end());
|
||||||
edges.resize(new_end - edges.begin());
|
edges.resize(new_end - edges.begin());
|
||||||
edges.shrink_to_fit();
|
|
||||||
|
|
||||||
return edges;
|
return edges;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,16 +159,14 @@ class CellCustomizer
|
|||||||
}
|
}
|
||||||
|
|
||||||
const EdgeWeight to_weight = weight + subcell_weight;
|
const EdgeWeight to_weight = weight + subcell_weight;
|
||||||
const EdgeDuration to_duration = duration + *subcell_duration;
|
|
||||||
if (!heap.WasInserted(to))
|
if (!heap.WasInserted(to))
|
||||||
{
|
{
|
||||||
heap.Insert(to, to_weight, {true, to_duration});
|
heap.Insert(to, to_weight, {true, duration + *subcell_duration});
|
||||||
}
|
}
|
||||||
else if (std::tie(to_weight, to_duration) <
|
else if (to_weight < heap.GetKey(to))
|
||||||
std::tie(heap.GetKey(to), heap.GetData(to).duration))
|
|
||||||
{
|
{
|
||||||
heap.DecreaseKey(to, to_weight);
|
heap.DecreaseKey(to, to_weight);
|
||||||
heap.GetData(to) = {true, to_duration};
|
heap.GetData(to) = {true, duration + *subcell_duration};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,16 +191,14 @@ class CellCustomizer
|
|||||||
partition.GetCell(level - 1, node) != partition.GetCell(level - 1, to)))
|
partition.GetCell(level - 1, node) != partition.GetCell(level - 1, to)))
|
||||||
{
|
{
|
||||||
const EdgeWeight to_weight = weight + data.weight;
|
const EdgeWeight to_weight = weight + data.weight;
|
||||||
const EdgeDuration to_duration = duration + data.duration;
|
|
||||||
if (!heap.WasInserted(to))
|
if (!heap.WasInserted(to))
|
||||||
{
|
{
|
||||||
heap.Insert(to, to_weight, {false, duration + data.duration});
|
heap.Insert(to, to_weight, {false, duration + data.duration});
|
||||||
}
|
}
|
||||||
else if (std::tie(to_weight, to_duration) <
|
else if (to_weight < heap.GetKey(to))
|
||||||
std::tie(heap.GetKey(to), heap.GetData(to).duration))
|
|
||||||
{
|
{
|
||||||
heap.DecreaseKey(to, to_weight);
|
heap.DecreaseKey(to, to_weight);
|
||||||
heap.GetData(to) = {false, to_duration};
|
heap.GetData(to) = {false, duration + data.duration};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ struct Algorithm final
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// Contraction Hiearchy with core
|
||||||
|
namespace corech
|
||||||
|
{
|
||||||
|
struct Algorithm final
|
||||||
|
{
|
||||||
|
};
|
||||||
|
}
|
||||||
// Multi-Level Dijkstra
|
// Multi-Level Dijkstra
|
||||||
namespace mld
|
namespace mld
|
||||||
{
|
{
|
||||||
@@ -28,6 +35,7 @@ struct Algorithm final
|
|||||||
// Algorithm names
|
// Algorithm names
|
||||||
template <typename AlgorithmT> const char *name();
|
template <typename AlgorithmT> const char *name();
|
||||||
template <> inline const char *name<ch::Algorithm>() { return "CH"; }
|
template <> inline const char *name<ch::Algorithm>() { return "CH"; }
|
||||||
|
template <> inline const char *name<corech::Algorithm>() { return "CoreCH"; }
|
||||||
template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
|
template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
|
||||||
|
|
||||||
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
|
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
|
||||||
@@ -75,6 +83,24 @@ template <> struct HasExcludeFlags<ch::Algorithm> final : std::true_type
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Algorithms supported by Contraction Hierarchies with core
|
||||||
|
// the rest is disabled because of performance reasons
|
||||||
|
template <> struct HasShortestPathSearch<corech::Algorithm> final : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
template <> struct HasDirectShortestPathSearch<corech::Algorithm> final : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
template <> struct HasMapMatching<corech::Algorithm> final : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
template <> struct HasGetTileTurns<corech::Algorithm> final : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
template <> struct HasExcludeFlags<corech::Algorithm> final : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
// Algorithms supported by Multi-Level Dijkstra
|
// Algorithms supported by Multi-Level Dijkstra
|
||||||
template <> struct HasAlternativePathSearch<mld::Algorithm> final : std::true_type
|
template <> struct HasAlternativePathSearch<mld::Algorithm> final : std::true_type
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ namespace datafacade
|
|||||||
|
|
||||||
// Namespace local aliases for algorithms
|
// Namespace local aliases for algorithms
|
||||||
using CH = routing_algorithms::ch::Algorithm;
|
using CH = routing_algorithms::ch::Algorithm;
|
||||||
|
using CoreCH = routing_algorithms::corech::Algorithm;
|
||||||
using MLD = routing_algorithms::mld::Algorithm;
|
using MLD = routing_algorithms::mld::Algorithm;
|
||||||
|
|
||||||
template <typename AlgorithmT> class AlgorithmDataFacade;
|
template <typename AlgorithmT> class AlgorithmDataFacade;
|
||||||
@@ -56,6 +57,14 @@ template <> class AlgorithmDataFacade<CH>
|
|||||||
const std::function<bool(EdgeData)> filter) const = 0;
|
const std::function<bool(EdgeData)> filter) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <> class AlgorithmDataFacade<CoreCH>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using EdgeData = contractor::QueryEdge::EdgeData;
|
||||||
|
|
||||||
|
virtual bool IsCoreNode(const NodeID id) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
template <> class AlgorithmDataFacade<MLD>
|
template <> class AlgorithmDataFacade<MLD>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "customizer/edge_based_graph.hpp"
|
#include "customizer/edge_based_graph.hpp"
|
||||||
|
|
||||||
#include "extractor/datasources.hpp"
|
#include "extractor/datasources.hpp"
|
||||||
#include "extractor/edge_based_node.hpp"
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
#include "extractor/intersection_bearings_container.hpp"
|
#include "extractor/intersection_bearings_container.hpp"
|
||||||
@@ -166,6 +165,50 @@ class ContiguousInternalMemoryAlgorithmDataFacade<CH> : public datafacade::Algor
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class ContiguousInternalMemoryAlgorithmDataFacade<CoreCH>
|
||||||
|
: public datafacade::AlgorithmDataFacade<CoreCH>
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
util::vector_view<bool> m_is_core_node;
|
||||||
|
|
||||||
|
// allocator that keeps the allocation data
|
||||||
|
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
||||||
|
|
||||||
|
void InitializeCoreInformationPointer(storage::DataLayout &data_layout,
|
||||||
|
char *memory_block,
|
||||||
|
const std::size_t exclude_index)
|
||||||
|
{
|
||||||
|
auto core_block_id = static_cast<storage::DataLayout::BlockID>(
|
||||||
|
storage::DataLayout::CH_CORE_MARKER_0 + exclude_index);
|
||||||
|
auto core_marker_ptr = data_layout.GetBlockPtr<unsigned>(memory_block, core_block_id);
|
||||||
|
util::vector_view<bool> is_core_node(core_marker_ptr,
|
||||||
|
data_layout.num_entries[core_block_id]);
|
||||||
|
m_is_core_node = std::move(is_core_node);
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
ContiguousInternalMemoryAlgorithmDataFacade(
|
||||||
|
std::shared_ptr<ContiguousBlockAllocator> allocator_, const std::size_t exclude_index)
|
||||||
|
: allocator(std::move(allocator_))
|
||||||
|
{
|
||||||
|
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory(), exclude_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeInternalPointers(storage::DataLayout &data_layout,
|
||||||
|
char *memory_block,
|
||||||
|
const std::size_t exclude_index)
|
||||||
|
{
|
||||||
|
InitializeCoreInformationPointer(data_layout, memory_block, exclude_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsCoreNode(const NodeID id) const override final
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(m_is_core_node.empty() || id < m_is_core_node.size());
|
||||||
|
return !m_is_core_node.empty() || m_is_core_node[id];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This base class implements the Datafacade interface for accessing
|
* This base class implements the Datafacade interface for accessing
|
||||||
* data that's stored in a single large block of memory (RAM).
|
* data that's stored in a single large block of memory (RAM).
|
||||||
@@ -294,21 +337,36 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
void InitializeEdgeBasedNodeDataInformationPointers(storage::DataLayout &layout,
|
void InitializeEdgeBasedNodeDataInformationPointers(storage::DataLayout &layout,
|
||||||
char *memory_ptr)
|
char *memory_ptr)
|
||||||
{
|
{
|
||||||
const auto edge_based_node_list_ptr = layout.GetBlockPtr<extractor::EdgeBasedNode>(
|
const auto via_geometry_list_ptr =
|
||||||
memory_ptr, storage::DataLayout::EDGE_BASED_NODE_DATA_LIST);
|
layout.GetBlockPtr<GeometryID>(memory_ptr, storage::DataLayout::GEOMETRY_ID_LIST);
|
||||||
util::vector_view<extractor::EdgeBasedNode> edge_based_node_data_list(
|
util::vector_view<GeometryID> geometry_ids(
|
||||||
edge_based_node_list_ptr,
|
via_geometry_list_ptr, layout.num_entries[storage::DataLayout::GEOMETRY_ID_LIST]);
|
||||||
layout.num_entries[storage::DataLayout::EDGE_BASED_NODE_DATA_LIST]);
|
|
||||||
|
|
||||||
const auto annotation_data_list_ptr =
|
const auto name_id_list_ptr =
|
||||||
layout.GetBlockPtr<extractor::NodeBasedEdgeAnnotation>(
|
layout.GetBlockPtr<NameID>(memory_ptr, storage::DataLayout::NAME_ID_LIST);
|
||||||
memory_ptr, storage::DataLayout::ANNOTATION_DATA_LIST);
|
util::vector_view<NameID> name_ids(name_id_list_ptr,
|
||||||
util::vector_view<extractor::NodeBasedEdgeAnnotation> annotation_data(
|
layout.num_entries[storage::DataLayout::NAME_ID_LIST]);
|
||||||
annotation_data_list_ptr,
|
|
||||||
layout.num_entries[storage::DataLayout::ANNOTATION_DATA_LIST]);
|
|
||||||
|
|
||||||
edge_based_node_data = extractor::EdgeBasedNodeDataView(
|
const auto component_id_list_ptr =
|
||||||
std::move(edge_based_node_data_list), std::move(annotation_data));
|
layout.GetBlockPtr<ComponentID>(memory_ptr, storage::DataLayout::COMPONENT_ID_LIST);
|
||||||
|
util::vector_view<ComponentID> component_ids(
|
||||||
|
component_id_list_ptr, layout.num_entries[storage::DataLayout::COMPONENT_ID_LIST]);
|
||||||
|
|
||||||
|
const auto travel_mode_list_ptr = layout.GetBlockPtr<extractor::TravelMode>(
|
||||||
|
memory_ptr, storage::DataLayout::TRAVEL_MODE_LIST);
|
||||||
|
util::vector_view<extractor::TravelMode> travel_modes(
|
||||||
|
travel_mode_list_ptr, layout.num_entries[storage::DataLayout::TRAVEL_MODE_LIST]);
|
||||||
|
|
||||||
|
const auto classes_list_ptr =
|
||||||
|
layout.GetBlockPtr<extractor::ClassData>(memory_ptr, storage::DataLayout::CLASSES_LIST);
|
||||||
|
util::vector_view<extractor::ClassData> classes(
|
||||||
|
classes_list_ptr, layout.num_entries[storage::DataLayout::CLASSES_LIST]);
|
||||||
|
|
||||||
|
edge_based_node_data = extractor::EdgeBasedNodeDataView(std::move(geometry_ids),
|
||||||
|
std::move(name_ids),
|
||||||
|
std::move(component_ids),
|
||||||
|
std::move(travel_modes),
|
||||||
|
std::move(classes));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeEdgeInformationPointers(storage::DataLayout &layout, char *memory_ptr)
|
void InitializeEdgeInformationPointers(storage::DataLayout &layout, char *memory_ptr)
|
||||||
@@ -400,6 +458,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
geometries_index_ptr, data_layout.num_entries[storage::DataLayout::GEOMETRIES_INDEX]);
|
geometries_index_ptr, data_layout.num_entries[storage::DataLayout::GEOMETRIES_INDEX]);
|
||||||
|
|
||||||
auto num_entries = data_layout.num_entries[storage::DataLayout::GEOMETRIES_NODE_LIST];
|
auto num_entries = data_layout.num_entries[storage::DataLayout::GEOMETRIES_NODE_LIST];
|
||||||
|
|
||||||
auto geometries_node_list_ptr = data_layout.GetBlockPtr<NodeID>(
|
auto geometries_node_list_ptr = data_layout.GetBlockPtr<NodeID>(
|
||||||
memory_block, storage::DataLayout::GEOMETRIES_NODE_LIST);
|
memory_block, storage::DataLayout::GEOMETRIES_NODE_LIST);
|
||||||
util::vector_view<NodeID> geometry_node_list(geometries_node_list_ptr, num_entries);
|
util::vector_view<NodeID> geometry_node_list(geometries_node_list_ptr, num_entries);
|
||||||
@@ -880,10 +939,9 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
m_lane_description_offsets[lane_description_id + 1]);
|
m_lane_description_offsets[lane_description_id + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsLeftHandDriving(const NodeID id) const override final
|
bool IsLeftHandDriving() const override final
|
||||||
{
|
{
|
||||||
// TODO: can be moved to a data block indexed by GeometryID
|
return m_profile_properties->left_hand_driving;
|
||||||
return edge_based_node_data.IsLeftHandDriving(id);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -904,6 +962,21 @@ class ContiguousInternalMemoryDataFacade<CH>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class ContiguousInternalMemoryDataFacade<CoreCH> final
|
||||||
|
: public ContiguousInternalMemoryDataFacade<CH>,
|
||||||
|
public ContiguousInternalMemoryAlgorithmDataFacade<CoreCH>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ContiguousInternalMemoryDataFacade(std::shared_ptr<ContiguousBlockAllocator> allocator,
|
||||||
|
const std::size_t exclude_index)
|
||||||
|
: ContiguousInternalMemoryDataFacade<CH>(allocator, exclude_index),
|
||||||
|
ContiguousInternalMemoryAlgorithmDataFacade<CoreCH>(allocator, exclude_index)
|
||||||
|
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
|
template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
|
||||||
{
|
{
|
||||||
// MLD data
|
// MLD data
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ class BaseDataFacade
|
|||||||
|
|
||||||
virtual util::guidance::EntryClass GetEntryClass(const EdgeID turn_id) const = 0;
|
virtual util::guidance::EntryClass GetEntryClass(const EdgeID turn_id) const = 0;
|
||||||
|
|
||||||
virtual bool IsLeftHandDriving(const NodeID id) const = 0;
|
virtual bool IsLeftHandDriving() const = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+37
-22
@@ -116,7 +116,7 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
|||||||
return tile_plugin.HandleRequest(GetAlgorithms(params), params, result);
|
return tile_plugin.HandleRequest(GetAlgorithms(params), params, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CheckCompatibility(const EngineConfig &config);
|
static bool CheckCompability(const EngineConfig &config);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename ParametersT> auto GetAlgorithms(const ParametersT ¶ms) const
|
template <typename ParametersT> auto GetAlgorithms(const ParametersT ¶ms) const
|
||||||
@@ -135,7 +135,7 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool Engine<routing_algorithms::ch::Algorithm>::CheckCompatibility(const EngineConfig &config)
|
bool Engine<routing_algorithms::ch::Algorithm>::CheckCompability(const EngineConfig &config)
|
||||||
{
|
{
|
||||||
if (config.use_shared_memory)
|
if (config.use_shared_memory)
|
||||||
{
|
{
|
||||||
@@ -161,7 +161,39 @@ bool Engine<routing_algorithms::ch::Algorithm>::CheckCompatibility(const EngineC
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool Engine<routing_algorithms::mld::Algorithm>::CheckCompatibility(const EngineConfig &config)
|
bool Engine<routing_algorithms::corech::Algorithm>::CheckCompability(const EngineConfig &config)
|
||||||
|
{
|
||||||
|
if (!Engine<routing_algorithms::ch::Algorithm>::CheckCompability(config))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.use_shared_memory)
|
||||||
|
{
|
||||||
|
storage::SharedMonitor<storage::SharedDataTimestamp> barrier;
|
||||||
|
using mutex_type = typename decltype(barrier)::mutex_type;
|
||||||
|
boost::interprocess::scoped_lock<mutex_type> current_region_lock(barrier.get_mutex());
|
||||||
|
|
||||||
|
auto mem = storage::makeSharedMemory(barrier.data().region);
|
||||||
|
auto layout = reinterpret_cast<storage::DataLayout *>(mem->Ptr());
|
||||||
|
return layout->GetBlockSize(storage::DataLayout::CH_CORE_MARKER_0) >
|
||||||
|
sizeof(std::uint64_t) + sizeof(util::FingerPrint);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!boost::filesystem::exists(config.storage_config.GetPath(".osrm.core")))
|
||||||
|
return false;
|
||||||
|
storage::io::FileReader in(config.storage_config.GetPath(".osrm.core"),
|
||||||
|
storage::io::FileReader::VerifyFingerprint);
|
||||||
|
in.ReadElementCount64(); // number of core markers
|
||||||
|
const auto number_of_core_markers = in.ReadElementCount64();
|
||||||
|
|
||||||
|
return number_of_core_markers > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool Engine<routing_algorithms::mld::Algorithm>::CheckCompability(const EngineConfig &config)
|
||||||
{
|
{
|
||||||
if (config.use_shared_memory)
|
if (config.use_shared_memory)
|
||||||
{
|
{
|
||||||
@@ -171,28 +203,11 @@ bool Engine<routing_algorithms::mld::Algorithm>::CheckCompatibility(const Engine
|
|||||||
|
|
||||||
auto mem = storage::makeSharedMemory(barrier.data().region);
|
auto mem = storage::makeSharedMemory(barrier.data().region);
|
||||||
auto layout = reinterpret_cast<storage::DataLayout *>(mem->Ptr());
|
auto layout = reinterpret_cast<storage::DataLayout *>(mem->Ptr());
|
||||||
// checks that all the needed memory blocks are populated
|
return layout->GetBlockSize(storage::DataLayout::MLD_PARTITION) > 0;
|
||||||
// DataLayout::MLD_CELL_SOURCE_BOUNDARY and DataLayout::MLD_CELL_DESTINATION_BOUNDARY
|
|
||||||
// are not checked, because in situations where there are so few nodes in the graph that
|
|
||||||
// they all fit into one cell, they can be empty.
|
|
||||||
bool empty_data = layout->GetBlockSize(storage::DataLayout::MLD_LEVEL_DATA) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_PARTITION) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_CELL_TO_CHILDREN) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_CELLS) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_CELL_LEVEL_OFFSETS) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_GRAPH_NODE_LIST) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_GRAPH_EDGE_LIST) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_CELL_WEIGHTS_0) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_CELL_DURATIONS_0) > 0 &&
|
|
||||||
layout->GetBlockSize(storage::DataLayout::MLD_GRAPH_NODE_TO_OFFSET) > 0;
|
|
||||||
return empty_data;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!boost::filesystem::exists(config.storage_config.GetPath(".osrm.partition")) ||
|
if (!boost::filesystem::exists(config.storage_config.GetPath(".osrm.partition")))
|
||||||
!boost::filesystem::exists(config.storage_config.GetPath(".osrm.cells")) ||
|
|
||||||
!boost::filesystem::exists(config.storage_config.GetPath(".osrm.mldgr")) ||
|
|
||||||
!boost::filesystem::exists(config.storage_config.GetPath(".osrm.cell_metrics")))
|
|
||||||
return false;
|
return false;
|
||||||
storage::io::FileReader in(config.storage_config.GetPath(".osrm.partition"),
|
storage::io::FileReader in(config.storage_config.GetPath(".osrm.partition"),
|
||||||
storage::io::FileReader::VerifyFingerprint);
|
storage::io::FileReader::VerifyFingerprint);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -57,14 +57,16 @@ namespace engine
|
|||||||
*
|
*
|
||||||
* You can chose between three algorithms:
|
* You can chose between three algorithms:
|
||||||
* - Algorithm::CH
|
* - Algorithm::CH
|
||||||
* Contraction Hierarchies, extremely fast queries but slow pre-processing. The default right
|
* Contraction Hierarchies, extremely fast queries but slow pre-processing. The default right
|
||||||
* now.
|
* now.
|
||||||
* - Algorithm::CoreCH
|
* - Algorithm::CoreCH
|
||||||
* Deprecated, to be removed in v6.0
|
* Contractoin Hierachies with partial contraction for faster pre-processing but slower queries.
|
||||||
* Contraction Hierachies with partial contraction for faster pre-processing but slower
|
|
||||||
* queries.
|
|
||||||
* - Algorithm::MLD
|
* - Algorithm::MLD
|
||||||
* Multi Level Dijkstra, moderately fast in both pre-processing and query.
|
* Multi Level Dijkstra which is experimental and moderately fast in both pre-processing and
|
||||||
|
* query.
|
||||||
|
*
|
||||||
|
* Algorithm::CH is specified we will automatically upgrade to CoreCH if we find the data for it.
|
||||||
|
* If Algorithm::CoreCH is specified and we don't find the speedup data, we fail hard.
|
||||||
*
|
*
|
||||||
* \see OSRM, StorageConfig
|
* \see OSRM, StorageConfig
|
||||||
*/
|
*/
|
||||||
@@ -74,8 +76,8 @@ struct EngineConfig final
|
|||||||
|
|
||||||
enum class Algorithm
|
enum class Algorithm
|
||||||
{
|
{
|
||||||
CH,
|
CH, // will upgrade to CoreCH if it finds core data
|
||||||
CoreCH, // Deprecated, will be removed in v6.0
|
CoreCH, // will fail hard if there is no core data
|
||||||
MLD
|
MLD
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -88,7 +90,6 @@ struct EngineConfig final
|
|||||||
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
|
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
|
||||||
bool use_shared_memory = true;
|
bool use_shared_memory = true;
|
||||||
Algorithm algorithm = Algorithm::CH;
|
Algorithm algorithm = Algorithm::CH;
|
||||||
std::string verbosity;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
|||||||
bool input_coordinate_is_at_right = !util::coordinate_calculation::isCCW(
|
bool input_coordinate_is_at_right = !util::coordinate_calculation::isCCW(
|
||||||
coordinates[segment.data.u], coordinates[segment.data.v], input_coordinate);
|
coordinates[segment.data.u], coordinates[segment.data.v], input_coordinate);
|
||||||
|
|
||||||
if (datafacade.IsLeftHandDriving(segment.data.forward_segment_id.id))
|
if (datafacade.IsLeftHandDriving())
|
||||||
input_coordinate_is_at_right = !input_coordinate_is_at_right;
|
input_coordinate_is_at_right = !input_coordinate_is_at_right;
|
||||||
|
|
||||||
return std::make_pair(input_coordinate_is_at_right, (!input_coordinate_is_at_right));
|
return std::make_pair(input_coordinate_is_at_right, (!input_coordinate_is_at_right));
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/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/guidance/name_announcements.hpp"
|
#include "util/guidance/name_announcements.hpp"
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
#include <boost/range/algorithm_ext/erase.hpp>
|
||||||
@@ -190,27 +189,6 @@ inline std::vector<RouteStep> removeNoTurnInstructions(std::vector<RouteStep> st
|
|||||||
return steps;
|
return steps;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double totalTurnAngle(const RouteStep &entry_step, const RouteStep &exit_step)
|
|
||||||
{
|
|
||||||
if (entry_step.geometry_begin > exit_step.geometry_begin)
|
|
||||||
return totalTurnAngle(exit_step, entry_step);
|
|
||||||
|
|
||||||
const auto exit_intersection = exit_step.intersections.front();
|
|
||||||
const auto entry_intersection = entry_step.intersections.front();
|
|
||||||
if ((exit_intersection.out >= exit_intersection.bearings.size()) ||
|
|
||||||
(entry_intersection.in >= entry_intersection.bearings.size()))
|
|
||||||
return entry_intersection.bearings[entry_intersection.out];
|
|
||||||
|
|
||||||
const auto exit_step_exit_bearing = exit_intersection.bearings[exit_intersection.out];
|
|
||||||
const auto entry_step_entry_bearing =
|
|
||||||
util::bearing::reverse(entry_intersection.bearings[entry_intersection.in]);
|
|
||||||
|
|
||||||
const double total_angle =
|
|
||||||
util::bearing::angleBetween(entry_step_entry_bearing, exit_step_exit_bearing);
|
|
||||||
|
|
||||||
return total_angle;
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* namespace guidance */
|
} /* namespace guidance */
|
||||||
} /* namespace engine */
|
} /* namespace engine */
|
||||||
} /* namespace osrm */
|
} /* namespace osrm */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -181,7 +181,8 @@ struct PhantomNode
|
|||||||
unsigned short is_valid_forward_target : 1;
|
unsigned short is_valid_forward_target : 1;
|
||||||
unsigned short is_valid_reverse_source : 1;
|
unsigned short is_valid_reverse_source : 1;
|
||||||
unsigned short is_valid_reverse_target : 1;
|
unsigned short is_valid_reverse_target : 1;
|
||||||
unsigned short bearing : 12;
|
unsigned short bearing : 9;
|
||||||
|
unsigned short : 3; // Unused padding out to 16 bits (2 bytes)
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(sizeof(PhantomNode) == 64, "PhantomNode has more padding then expected");
|
static_assert(sizeof(PhantomNode) == 64, "PhantomNode has more padding then expected");
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class RoutingAlgorithmsInterface
|
|||||||
virtual InternalRouteResult
|
virtual InternalRouteResult
|
||||||
DirectShortestPathSearch(const PhantomNodes &phantom_node_pair) const = 0;
|
DirectShortestPathSearch(const PhantomNodes &phantom_node_pair) const = 0;
|
||||||
|
|
||||||
virtual std::vector<EdgeDuration>
|
virtual std::vector<EdgeWeight>
|
||||||
ManyToManySearch(const std::vector<PhantomNode> &phantom_nodes,
|
ManyToManySearch(const std::vector<PhantomNode> &phantom_nodes,
|
||||||
const std::vector<std::size_t> &source_indices,
|
const std::vector<std::size_t> &source_indices,
|
||||||
const std::vector<std::size_t> &target_indices) const = 0;
|
const std::vector<std::size_t> &target_indices) const = 0;
|
||||||
@@ -81,7 +81,7 @@ template <typename Algorithm> class RoutingAlgorithms final : public RoutingAlgo
|
|||||||
InternalRouteResult
|
InternalRouteResult
|
||||||
DirectShortestPathSearch(const PhantomNodes &phantom_nodes) const final override;
|
DirectShortestPathSearch(const PhantomNodes &phantom_nodes) const final override;
|
||||||
|
|
||||||
std::vector<EdgeDuration>
|
std::vector<EdgeWeight>
|
||||||
ManyToManySearch(const std::vector<PhantomNode> &phantom_nodes,
|
ManyToManySearch(const std::vector<PhantomNode> &phantom_nodes,
|
||||||
const std::vector<std::size_t> &source_indices,
|
const std::vector<std::size_t> &source_indices,
|
||||||
const std::vector<std::size_t> &target_indices) const final override;
|
const std::vector<std::size_t> &target_indices) const final override;
|
||||||
@@ -166,6 +166,16 @@ RoutingAlgorithms<Algorithm>::DirectShortestPathSearch(const PhantomNodes &phant
|
|||||||
return routing_algorithms::directShortestPathSearch(heaps, *facade, phantom_nodes);
|
return routing_algorithms::directShortestPathSearch(heaps, *facade, phantom_nodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename Algorithm>
|
||||||
|
std::vector<EdgeWeight>
|
||||||
|
RoutingAlgorithms<Algorithm>::ManyToManySearch(const std::vector<PhantomNode> &phantom_nodes,
|
||||||
|
const std::vector<std::size_t> &source_indices,
|
||||||
|
const std::vector<std::size_t> &target_indices) const
|
||||||
|
{
|
||||||
|
return routing_algorithms::manyToManySearch(
|
||||||
|
heaps, *facade, phantom_nodes, source_indices, target_indices);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
inline routing_algorithms::SubMatchingList RoutingAlgorithms<Algorithm>::MapMatching(
|
inline routing_algorithms::SubMatchingList RoutingAlgorithms<Algorithm>::MapMatching(
|
||||||
const routing_algorithms::CandidateLists &candidates_list,
|
const routing_algorithms::CandidateLists &candidates_list,
|
||||||
@@ -183,32 +193,6 @@ inline routing_algorithms::SubMatchingList RoutingAlgorithms<Algorithm>::MapMatc
|
|||||||
allow_splitting);
|
allow_splitting);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Algorithm>
|
|
||||||
std::vector<EdgeDuration> RoutingAlgorithms<Algorithm>::ManyToManySearch(
|
|
||||||
const std::vector<PhantomNode> &phantom_nodes,
|
|
||||||
const std::vector<std::size_t> &_source_indices,
|
|
||||||
const std::vector<std::size_t> &_target_indices) const
|
|
||||||
{
|
|
||||||
BOOST_ASSERT(!phantom_nodes.empty());
|
|
||||||
|
|
||||||
auto source_indices = _source_indices;
|
|
||||||
auto target_indices = _target_indices;
|
|
||||||
|
|
||||||
if (source_indices.empty())
|
|
||||||
{
|
|
||||||
source_indices.resize(phantom_nodes.size());
|
|
||||||
std::iota(source_indices.begin(), source_indices.end(), 0);
|
|
||||||
}
|
|
||||||
if (target_indices.empty())
|
|
||||||
{
|
|
||||||
target_indices.resize(phantom_nodes.size());
|
|
||||||
std::iota(target_indices.begin(), target_indices.end(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return routing_algorithms::manyToManySearch(
|
|
||||||
heaps, *facade, phantom_nodes, std::move(source_indices), std::move(target_indices));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
inline std::vector<routing_algorithms::TurnData> RoutingAlgorithms<Algorithm>::GetTileTurns(
|
inline std::vector<routing_algorithms::TurnData> RoutingAlgorithms<Algorithm>::GetTileTurns(
|
||||||
const std::vector<datafacade::BaseDataFacade::RTreeLeaf> &edges,
|
const std::vector<datafacade::BaseDataFacade::RTreeLeaf> &edges,
|
||||||
@@ -217,6 +201,24 @@ inline std::vector<routing_algorithms::TurnData> RoutingAlgorithms<Algorithm>::G
|
|||||||
return routing_algorithms::getTileTurns(*facade, edges, sorted_edge_indexes);
|
return routing_algorithms::getTileTurns(*facade, edges, sorted_edge_indexes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CoreCH overrides
|
||||||
|
template <>
|
||||||
|
InternalManyRoutesResult inline RoutingAlgorithms<
|
||||||
|
routing_algorithms::corech::Algorithm>::AlternativePathSearch(const PhantomNodes &,
|
||||||
|
unsigned) const
|
||||||
|
{
|
||||||
|
throw util::exception("AlternativePathSearch is disabled due to performance reasons");
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
inline std::vector<EdgeWeight>
|
||||||
|
RoutingAlgorithms<routing_algorithms::corech::Algorithm>::ManyToManySearch(
|
||||||
|
const std::vector<PhantomNode> &,
|
||||||
|
const std::vector<std::size_t> &,
|
||||||
|
const std::vector<std::size_t> &) const
|
||||||
|
{
|
||||||
|
throw util::exception("ManyToManySearch is disabled due to performance reasons");
|
||||||
|
}
|
||||||
} // ns engine
|
} // ns engine
|
||||||
} // ns osrm
|
} // ns osrm
|
||||||
|
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ namespace engine
|
|||||||
namespace routing_algorithms
|
namespace routing_algorithms
|
||||||
{
|
{
|
||||||
|
|
||||||
/// This is a stripped down version of the general shortest path algorithm.
|
/// This is a striped down version of the general shortest path algorithm.
|
||||||
/// The general algorithm always computes two queries for each leg. This is only
|
/// The general algorithm always computes two queries for each leg. This is only
|
||||||
/// necessary in case of vias, where the directions of the start node is constrained
|
/// necessary in case of vias, where the directions of the start node is constrainted
|
||||||
/// by the previous route.
|
/// by the previous route.
|
||||||
/// This variation is only an optimization for graphs with slow queries, for example
|
/// This variation is only an optimazation for graphs with slow queries, for example
|
||||||
/// not fully contracted graphs.
|
/// not fully contracted graphs.
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
InternalRouteResult directShortestPathSearch(SearchEngineData<Algorithm> &engine_working_data,
|
InternalRouteResult directShortestPathSearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
|
|||||||
@@ -16,45 +16,12 @@ namespace engine
|
|||||||
namespace routing_algorithms
|
namespace routing_algorithms
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
struct NodeBucket
|
|
||||||
{
|
|
||||||
NodeID middle_node;
|
|
||||||
unsigned column_index; // a column in the weight/duration matrix
|
|
||||||
EdgeWeight weight;
|
|
||||||
EdgeDuration duration;
|
|
||||||
|
|
||||||
NodeBucket(NodeID middle_node, unsigned column_index, EdgeWeight weight, EdgeDuration duration)
|
|
||||||
: middle_node(middle_node), column_index(column_index), weight(weight), duration(duration)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// partial order comparison
|
|
||||||
bool operator<(const NodeBucket &rhs) const { return middle_node < rhs.middle_node; }
|
|
||||||
|
|
||||||
// functor for equal_range
|
|
||||||
struct Compare
|
|
||||||
{
|
|
||||||
bool operator()(const NodeBucket &lhs, const NodeID &rhs) const
|
|
||||||
{
|
|
||||||
return lhs.middle_node < rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator()(const NodeID &lhs, const NodeBucket &rhs) const
|
|
||||||
{
|
|
||||||
return lhs < rhs.middle_node;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
std::vector<EdgeDuration> manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
std::vector<EdgeWeight> manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
const DataFacade<Algorithm> &facade,
|
const DataFacade<Algorithm> &facade,
|
||||||
const std::vector<PhantomNode> &phantom_nodes,
|
const std::vector<PhantomNode> &phantom_nodes,
|
||||||
const std::vector<std::size_t> &source_indices,
|
const std::vector<std::size_t> &source_indices,
|
||||||
const std::vector<std::size_t> &target_indices);
|
const std::vector<std::size_t> &target_indices);
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
|
|||||||
@@ -375,6 +375,52 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
int duration_upper_bound = INVALID_EDGE_WEIGHT);
|
int duration_upper_bound = INVALID_EDGE_WEIGHT);
|
||||||
|
|
||||||
} // namespace ch
|
} // namespace ch
|
||||||
|
|
||||||
|
namespace corech
|
||||||
|
{
|
||||||
|
// assumes that heaps are already setup correctly.
|
||||||
|
// A forced loop might be necessary, if source and target are on the same segment.
|
||||||
|
// If this is the case and the offsets of the respective direction are larger for the source
|
||||||
|
// than the target
|
||||||
|
// then a force loop is required (e.g. source_phantom.forward_segment_id ==
|
||||||
|
// target_phantom.forward_segment_id
|
||||||
|
// && source_phantom.GetForwardWeightPlusOffset() > target_phantom.GetForwardWeightPlusOffset())
|
||||||
|
// requires
|
||||||
|
// a force loop, if the heaps have been initialized with positive offsets.
|
||||||
|
void search(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
|
const DataFacade<corech::Algorithm> &facade,
|
||||||
|
SearchEngineData<ch::Algorithm>::QueryHeap &forward_heap,
|
||||||
|
SearchEngineData<ch::Algorithm>::QueryHeap &reverse_heap,
|
||||||
|
int &weight,
|
||||||
|
std::vector<NodeID> &packed_leg,
|
||||||
|
const bool force_loop_forward,
|
||||||
|
const bool force_loop_reverse,
|
||||||
|
const PhantomNodes &phantom_nodes,
|
||||||
|
int duration_upper_bound = INVALID_EDGE_WEIGHT);
|
||||||
|
|
||||||
|
// Requires the heaps for be empty
|
||||||
|
// If heaps should be adjusted to be initialized outside of this function,
|
||||||
|
// the addition of force_loop parameters might be required
|
||||||
|
double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
|
const DataFacade<corech::Algorithm> &facade,
|
||||||
|
SearchEngineData<ch::Algorithm>::QueryHeap &forward_heap,
|
||||||
|
SearchEngineData<ch::Algorithm>::QueryHeap &reverse_heap,
|
||||||
|
const PhantomNode &source_phantom,
|
||||||
|
const PhantomNode &target_phantom,
|
||||||
|
int duration_upper_bound = INVALID_EDGE_WEIGHT);
|
||||||
|
|
||||||
|
template <typename RandomIter, typename FacadeT>
|
||||||
|
void unpackPath(const FacadeT &facade,
|
||||||
|
RandomIter packed_path_begin,
|
||||||
|
RandomIter packed_path_end,
|
||||||
|
const PhantomNodes &phantom_nodes,
|
||||||
|
std::vector<PathData> &unpacked_path)
|
||||||
|
{
|
||||||
|
return ch::unpackPath(facade, packed_path_begin, packed_path_end, phantom_nodes, unpacked_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace corech
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|||||||
@@ -132,16 +132,44 @@ retrievePackedPathFromHeap(const SearchEngineData<Algorithm>::QueryHeap &forward
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <bool DIRECTION, typename Algorithm, typename... Args>
|
template <bool DIRECTION, typename Algorithm, typename... Args>
|
||||||
void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
|
void routingStep(const DataFacade<Algorithm> &facade,
|
||||||
typename SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
typename SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
||||||
const NodeID node,
|
typename SearchEngineData<Algorithm>::QueryHeap &reverse_heap,
|
||||||
const EdgeWeight weight,
|
NodeID &middle_node,
|
||||||
Args... args)
|
EdgeWeight &path_upper_bound,
|
||||||
|
const bool force_loop_forward,
|
||||||
|
const bool force_loop_reverse,
|
||||||
|
Args... args)
|
||||||
{
|
{
|
||||||
const auto &partition = facade.GetMultiLevelPartition();
|
const auto &partition = facade.GetMultiLevelPartition();
|
||||||
const auto &cells = facade.GetCellStorage();
|
const auto &cells = facade.GetCellStorage();
|
||||||
const auto &metric = facade.GetCellMetric();
|
const auto &metric = facade.GetCellMetric();
|
||||||
|
|
||||||
|
const auto node = forward_heap.DeleteMin();
|
||||||
|
const auto weight = forward_heap.GetKey(node);
|
||||||
|
|
||||||
|
BOOST_ASSERT(!facade.ExcludeNode(node));
|
||||||
|
|
||||||
|
// Upper bound for the path source -> target with
|
||||||
|
// weight(source -> node) = weight weight(to -> target) ≤ reverse_weight
|
||||||
|
// is weight + reverse_weight
|
||||||
|
// More tighter upper bound requires additional condition reverse_heap.WasRemoved(to)
|
||||||
|
// with weight(to -> target) = reverse_weight and all weights ≥ 0
|
||||||
|
if (reverse_heap.WasInserted(node))
|
||||||
|
{
|
||||||
|
auto reverse_weight = reverse_heap.GetKey(node);
|
||||||
|
auto path_weight = weight + reverse_weight;
|
||||||
|
|
||||||
|
// if loops are forced, they are so at the source
|
||||||
|
if (!(force_loop_forward && forward_heap.GetData(node).parent == node) &&
|
||||||
|
!(force_loop_reverse && reverse_heap.GetData(node).parent == node) &&
|
||||||
|
(path_weight >= 0) && (path_weight < path_upper_bound))
|
||||||
|
{
|
||||||
|
middle_node = node;
|
||||||
|
path_upper_bound = path_weight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const auto level = getNodeQueryLevel(partition, node, args...);
|
const auto level = getNodeQueryLevel(partition, node, args...);
|
||||||
|
|
||||||
if (level >= 1 && !forward_heap.GetData(node).from_clique_arc)
|
if (level >= 1 && !forward_heap.GetData(node).from_clique_arc)
|
||||||
@@ -230,46 +258,6 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool DIRECTION, typename Algorithm, typename... Args>
|
|
||||||
void routingStep(const DataFacade<Algorithm> &facade,
|
|
||||||
typename SearchEngineData<Algorithm>::QueryHeap &forward_heap,
|
|
||||||
typename SearchEngineData<Algorithm>::QueryHeap &reverse_heap,
|
|
||||||
NodeID &middle_node,
|
|
||||||
EdgeWeight &path_upper_bound,
|
|
||||||
const bool force_loop_forward,
|
|
||||||
const bool force_loop_reverse,
|
|
||||||
Args... args)
|
|
||||||
{
|
|
||||||
const auto node = forward_heap.DeleteMin();
|
|
||||||
const auto weight = forward_heap.GetKey(node);
|
|
||||||
|
|
||||||
BOOST_ASSERT(!facade.ExcludeNode(node));
|
|
||||||
|
|
||||||
// Upper bound for the path source -> target with
|
|
||||||
// weight(source -> node) = weight weight(to -> target) ≤ reverse_weight
|
|
||||||
// is weight + reverse_weight
|
|
||||||
// More tighter upper bound requires additional condition reverse_heap.WasRemoved(to)
|
|
||||||
// with weight(to -> target) = reverse_weight and all weights ≥ 0
|
|
||||||
if (reverse_heap.WasInserted(node))
|
|
||||||
{
|
|
||||||
auto reverse_weight = reverse_heap.GetKey(node);
|
|
||||||
auto path_weight = weight + reverse_weight;
|
|
||||||
|
|
||||||
// MLD uses loops forcing only to prune single node paths in forward and/or
|
|
||||||
// backward direction (there is no need to force loops in MLD but in CH)
|
|
||||||
if (!(force_loop_forward && forward_heap.GetData(node).parent == node) &&
|
|
||||||
!(force_loop_reverse && reverse_heap.GetData(node).parent == node) &&
|
|
||||||
(path_weight >= 0) && (path_weight < path_upper_bound))
|
|
||||||
{
|
|
||||||
middle_node = node;
|
|
||||||
path_upper_bound = path_weight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Relax outgoing edges from node
|
|
||||||
relaxOutgoingEdges<DIRECTION>(facade, forward_heap, node, weight, args...);
|
|
||||||
}
|
|
||||||
|
|
||||||
// With (s, middle, t) we trace back the paths middle -> s and middle -> t.
|
// With (s, middle, t) we trace back the paths middle -> s and middle -> t.
|
||||||
// This gives us a packed path (node ids) from the base graph around s and t,
|
// This gives us a packed path (node ids) from the base graph around s and t,
|
||||||
// and overlay node ids otherwise. We then have to unpack the overlay clique
|
// and overlay node ids otherwise. We then have to unpack the overlay clique
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ template <> struct SearchEngineData<routing_algorithms::ch::Algorithm>
|
|||||||
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes);
|
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct SearchEngineData<routing_algorithms::corech::Algorithm>
|
||||||
|
: public SearchEngineData<routing_algorithms::ch::Algorithm>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
struct MultiLayerDijkstraHeapData
|
struct MultiLayerDijkstraHeapData
|
||||||
{
|
{
|
||||||
NodeID parent;
|
NodeID parent;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
#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/original_edge_data.hpp"
|
||||||
|
#include "extractor/packed_osm_ids.hpp"
|
||||||
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/query_node.hpp"
|
||||||
#include "extractor/restriction_index.hpp"
|
#include "extractor/restriction_index.hpp"
|
||||||
#include "extractor/way_restriction_map.hpp"
|
#include "extractor/way_restriction_map.hpp"
|
||||||
@@ -24,6 +26,7 @@
|
|||||||
#include "util/guidance/entry_class.hpp"
|
#include "util/guidance/entry_class.hpp"
|
||||||
#include "util/name_table.hpp"
|
#include "util/name_table.hpp"
|
||||||
#include "util/node_based_graph.hpp"
|
#include "util/node_based_graph.hpp"
|
||||||
|
#include "util/packed_vector.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
#include "storage/io.hpp"
|
#include "storage/io.hpp"
|
||||||
@@ -68,12 +71,13 @@ class EdgeBasedGraphFactory
|
|||||||
EdgeBasedGraphFactory(const EdgeBasedGraphFactory &) = delete;
|
EdgeBasedGraphFactory(const EdgeBasedGraphFactory &) = delete;
|
||||||
EdgeBasedGraphFactory &operator=(const EdgeBasedGraphFactory &) = delete;
|
EdgeBasedGraphFactory &operator=(const EdgeBasedGraphFactory &) = delete;
|
||||||
|
|
||||||
explicit EdgeBasedGraphFactory(const util::NodeBasedDynamicGraph &node_based_graph,
|
explicit EdgeBasedGraphFactory(std::shared_ptr<util::NodeBasedDynamicGraph> node_based_graph,
|
||||||
EdgeBasedNodeDataContainer &node_data_container,
|
CompressedEdgeContainer &compressed_edge_container,
|
||||||
const CompressedEdgeContainer &compressed_edge_container,
|
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const std::unordered_set<NodeID> &traffic_lights,
|
const std::unordered_set<NodeID> &traffic_lights,
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
|
const extractor::PackedOSMIDs &osm_node_ids,
|
||||||
|
ProfileProperties profile_properties,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
guidance::LaneDescriptionMap &lane_description_map);
|
guidance::LaneDescriptionMap &lane_description_map);
|
||||||
|
|
||||||
@@ -91,6 +95,7 @@ class EdgeBasedGraphFactory
|
|||||||
|
|
||||||
// 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 GetEdgeBasedNodes(EdgeBasedNodeDataContainer &data_container);
|
||||||
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);
|
||||||
@@ -139,7 +144,7 @@ class EdgeBasedGraphFactory
|
|||||||
|
|
||||||
//! list of edge based nodes (compressed segments)
|
//! list of edge based nodes (compressed segments)
|
||||||
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;
|
||||||
|
|
||||||
// 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.
|
||||||
@@ -150,20 +155,19 @@ class EdgeBasedGraphFactory
|
|||||||
std::uint64_t m_number_of_edge_based_nodes;
|
std::uint64_t m_number_of_edge_based_nodes;
|
||||||
|
|
||||||
const std::vector<util::Coordinate> &m_coordinates;
|
const std::vector<util::Coordinate> &m_coordinates;
|
||||||
const util::NodeBasedDynamicGraph &m_node_based_graph;
|
const extractor::PackedOSMIDs &m_osm_node_ids;
|
||||||
|
std::shared_ptr<util::NodeBasedDynamicGraph> m_node_based_graph;
|
||||||
|
|
||||||
const std::unordered_set<NodeID> &m_barrier_nodes;
|
const std::unordered_set<NodeID> &m_barrier_nodes;
|
||||||
const std::unordered_set<NodeID> &m_traffic_lights;
|
const std::unordered_set<NodeID> &m_traffic_lights;
|
||||||
const CompressedEdgeContainer &m_compressed_edge_container;
|
CompressedEdgeContainer &m_compressed_edge_container;
|
||||||
|
|
||||||
|
ProfileProperties profile_properties;
|
||||||
|
|
||||||
const util::NameTable &name_table;
|
const util::NameTable &name_table;
|
||||||
guidance::LaneDescriptionMap &lane_description_map;
|
guidance::LaneDescriptionMap &lane_description_map;
|
||||||
|
|
||||||
// In the edge based graph, any traversable (non reversed) edge of the node-based graph forms a
|
unsigned RenumberEdges();
|
||||||
// node of the edge-based graph. To be able to name these nodes, we loop over the node-based
|
|
||||||
// graph and create a mapping from edges (node-based) to nodes (edge-based). The mapping is
|
|
||||||
// essentially a prefix-sum over all previous non-reversed edges of the node-based graph.
|
|
||||||
unsigned LabelEdgeBasedNodes();
|
|
||||||
|
|
||||||
// During the generation of the edge-expanded nodes, we need to also generate duplicates that
|
// During the generation of the edge-expanded nodes, we need to also generate duplicates that
|
||||||
// represent state during via-way restrictions (see
|
// represent state during via-way restrictions (see
|
||||||
@@ -190,8 +194,6 @@ class EdgeBasedGraphFactory
|
|||||||
std::size_t skipped_uturns_counter;
|
std::size_t skipped_uturns_counter;
|
||||||
std::size_t skipped_barrier_turns_counter;
|
std::size_t skipped_barrier_turns_counter;
|
||||||
|
|
||||||
// mapping of node-based edges to edge-based nodes
|
|
||||||
std::vector<NodeID> nbe_to_ebn_mapping;
|
|
||||||
util::ConcurrentIDMap<util::guidance::BearingClass, BearingClassID> bearing_class_hash;
|
util::ConcurrentIDMap<util::guidance::BearingClass, BearingClassID> bearing_class_hash;
|
||||||
std::vector<BearingClassID> bearing_class_by_node_based_node;
|
std::vector<BearingClassID> bearing_class_by_node_based_node;
|
||||||
util::ConcurrentIDMap<util::guidance::EntryClass, EntryClassID> entry_class_hash;
|
util::ConcurrentIDMap<util::guidance::EntryClass, EntryClassID> entry_class_hash;
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_EDGE_BASED_NODE_HPP_
|
|
||||||
#define OSRM_EXTRACTOR_EDGE_BASED_NODE_HPP_
|
|
||||||
|
|
||||||
#include "util/typedefs.hpp"
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
|
|
||||||
struct EdgeBasedNode
|
|
||||||
{
|
|
||||||
GeometryID geometry_id;
|
|
||||||
ComponentID component_id;
|
|
||||||
AnnotationID annotation_id;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
|
||||||
|
|
||||||
#endif // OSRM_EXTRACTOR_EDGE_BASED_NODE_HPP_
|
|
||||||
@@ -28,14 +28,12 @@ class ExtractionContainers
|
|||||||
|
|
||||||
void WriteNodes(storage::io::FileWriter &file_out) const;
|
void WriteNodes(storage::io::FileWriter &file_out) const;
|
||||||
void WriteEdges(storage::io::FileWriter &file_out) const;
|
void WriteEdges(storage::io::FileWriter &file_out) const;
|
||||||
void WriteMetadata(storage::io::FileWriter &file_out) const;
|
|
||||||
void WriteCharData(const std::string &file_name);
|
void WriteCharData(const std::string &file_name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using NodeIDVector = std::vector<OSMNodeID>;
|
using NodeIDVector = std::vector<OSMNodeID>;
|
||||||
using NodeVector = std::vector<QueryNode>;
|
using NodeVector = std::vector<QueryNode>;
|
||||||
using EdgeVector = std::vector<InternalExtractorEdge>;
|
using EdgeVector = std::vector<InternalExtractorEdge>;
|
||||||
using AnnotationDataVector = std::vector<NodeBasedEdgeAnnotation>;
|
|
||||||
using WayIDStartEndVector = std::vector<FirstAndLastSegmentOfWay>;
|
using WayIDStartEndVector = std::vector<FirstAndLastSegmentOfWay>;
|
||||||
using NameCharData = std::vector<unsigned char>;
|
using NameCharData = std::vector<unsigned char>;
|
||||||
using NameOffsets = std::vector<unsigned>;
|
using NameOffsets = std::vector<unsigned>;
|
||||||
@@ -45,7 +43,6 @@ class ExtractionContainers
|
|||||||
NodeIDVector used_node_id_list;
|
NodeIDVector used_node_id_list;
|
||||||
NodeVector all_nodes_list;
|
NodeVector all_nodes_list;
|
||||||
EdgeVector all_edges_list;
|
EdgeVector all_edges_list;
|
||||||
AnnotationDataVector all_edges_annotation_data_list;
|
|
||||||
NameCharData name_char_data;
|
NameCharData name_char_data;
|
||||||
NameOffsets name_offsets;
|
NameOffsets name_offsets;
|
||||||
// an adjacency array containing all turn lane masks
|
// an adjacency array containing all turn lane masks
|
||||||
|
|||||||
@@ -1,201 +0,0 @@
|
|||||||
#ifndef EXTRACTION_RELATION_HPP
|
|
||||||
#define EXTRACTION_RELATION_HPP
|
|
||||||
|
|
||||||
#include "util/exception.hpp"
|
|
||||||
|
|
||||||
#include <osmium/osm/relation.hpp>
|
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
|
|
||||||
struct ExtractionRelation
|
|
||||||
{
|
|
||||||
class OsmIDTyped
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
OsmIDTyped(osmium::object_id_type _id, osmium::item_type _type) : id(_id), type(_type) {}
|
|
||||||
|
|
||||||
std::uint64_t GetID() const { return std::uint64_t(id); }
|
|
||||||
osmium::item_type GetType() const { return type; }
|
|
||||||
|
|
||||||
std::uint64_t Hash() const { return id ^ (static_cast<std::uint64_t>(type) << 56); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
osmium::object_id_type id;
|
|
||||||
osmium::item_type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
using AttributesList = std::vector<std::pair<std::string, std::string>>;
|
|
||||||
using MembersRolesList = std::vector<std::pair<std::uint64_t, std::string>>;
|
|
||||||
|
|
||||||
explicit ExtractionRelation(const OsmIDTyped &_id) : id(_id) {}
|
|
||||||
|
|
||||||
void Clear()
|
|
||||||
{
|
|
||||||
attributes.clear();
|
|
||||||
members_role.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *GetAttr(const std::string &attr) const
|
|
||||||
{
|
|
||||||
auto it = std::lower_bound(
|
|
||||||
attributes.begin(), attributes.end(), std::make_pair(attr, std::string()));
|
|
||||||
|
|
||||||
if (it != attributes.end() && (*it).first == attr)
|
|
||||||
return (*it).second.c_str();
|
|
||||||
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Prepare()
|
|
||||||
{
|
|
||||||
std::sort(attributes.begin(), attributes.end());
|
|
||||||
std::sort(members_role.begin(), members_role.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddMember(const OsmIDTyped &member_id, const char *role)
|
|
||||||
{
|
|
||||||
members_role.emplace_back(std::make_pair(member_id.Hash(), std::string(role)));
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *GetRole(const OsmIDTyped &member_id) const
|
|
||||||
{
|
|
||||||
const auto hash = member_id.Hash();
|
|
||||||
auto it = std::lower_bound(
|
|
||||||
members_role.begin(), members_role.end(), std::make_pair(hash, std::string()));
|
|
||||||
|
|
||||||
if (it != members_role.end() && (*it).first == hash)
|
|
||||||
return (*it).second.c_str();
|
|
||||||
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
OsmIDTyped id;
|
|
||||||
AttributesList attributes;
|
|
||||||
MembersRolesList members_role;
|
|
||||||
};
|
|
||||||
|
|
||||||
// It contains data of all parsed relations for each node/way element
|
|
||||||
class ExtractionRelationContainer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
using AttributesMap = ExtractionRelation::AttributesList;
|
|
||||||
using OsmIDTyped = ExtractionRelation::OsmIDTyped;
|
|
||||||
using RelationList = std::vector<AttributesMap>;
|
|
||||||
using RelationIDList = std::vector<ExtractionRelation::OsmIDTyped>;
|
|
||||||
using RelationRefMap = std::unordered_map<std::uint64_t, RelationIDList>;
|
|
||||||
|
|
||||||
void AddRelation(ExtractionRelation &&rel)
|
|
||||||
{
|
|
||||||
rel.Prepare();
|
|
||||||
|
|
||||||
BOOST_ASSERT(relations_data.find(rel.id.GetID()) == relations_data.end());
|
|
||||||
relations_data.insert(std::make_pair(rel.id.GetID(), std::move(rel)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddRelationMember(const OsmIDTyped &relation_id, const OsmIDTyped &member_id)
|
|
||||||
{
|
|
||||||
switch (member_id.GetType())
|
|
||||||
{
|
|
||||||
case osmium::item_type::node:
|
|
||||||
node_refs[member_id.GetID()].push_back(relation_id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case osmium::item_type::way:
|
|
||||||
way_refs[member_id.GetID()].push_back(relation_id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case osmium::item_type::relation:
|
|
||||||
rel_refs[member_id.GetID()].push_back(relation_id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void Merge(ExtractionRelationContainer &&other)
|
|
||||||
{
|
|
||||||
for (auto it : other.relations_data)
|
|
||||||
{
|
|
||||||
const auto res = relations_data.insert(std::make_pair(it.first, std::move(it.second)));
|
|
||||||
BOOST_ASSERT(res.second);
|
|
||||||
(void)res; // prevent unused warning in release
|
|
||||||
}
|
|
||||||
|
|
||||||
auto MergeRefMap = [&](RelationRefMap &source, RelationRefMap &target) {
|
|
||||||
for (auto it : source)
|
|
||||||
{
|
|
||||||
auto &v = target[it.first];
|
|
||||||
v.insert(v.end(), it.second.begin(), it.second.end());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
MergeRefMap(other.way_refs, way_refs);
|
|
||||||
MergeRefMap(other.node_refs, node_refs);
|
|
||||||
MergeRefMap(other.rel_refs, rel_refs);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t GetRelationsNum() const { return relations_data.size(); }
|
|
||||||
|
|
||||||
const RelationIDList &GetRelations(const OsmIDTyped &member_id) const
|
|
||||||
{
|
|
||||||
auto getFromMap = [this](std::uint64_t id,
|
|
||||||
const RelationRefMap &map) -> const RelationIDList & {
|
|
||||||
auto it = map.find(id);
|
|
||||||
if (it != map.end())
|
|
||||||
return it->second;
|
|
||||||
|
|
||||||
return empty_rel_list;
|
|
||||||
};
|
|
||||||
|
|
||||||
switch (member_id.GetType())
|
|
||||||
{
|
|
||||||
case osmium::item_type::node:
|
|
||||||
return getFromMap(member_id.GetID(), node_refs);
|
|
||||||
|
|
||||||
case osmium::item_type::way:
|
|
||||||
return getFromMap(member_id.GetID(), way_refs);
|
|
||||||
|
|
||||||
case osmium::item_type::relation:
|
|
||||||
return getFromMap(member_id.GetID(), rel_refs);
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return empty_rel_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ExtractionRelation &GetRelationData(const ExtractionRelation::OsmIDTyped &rel_id) const
|
|
||||||
{
|
|
||||||
auto it = relations_data.find(rel_id.GetID());
|
|
||||||
if (it == relations_data.end())
|
|
||||||
throw osrm::util::exception("Can't find relation data for " +
|
|
||||||
std::to_string(rel_id.GetID()));
|
|
||||||
|
|
||||||
return it->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
RelationIDList empty_rel_list;
|
|
||||||
std::unordered_map<std::uint64_t, ExtractionRelation> relations_data;
|
|
||||||
|
|
||||||
// each map contains list of relation id's, that has keyed id as a member
|
|
||||||
RelationRefMap way_refs;
|
|
||||||
RelationRefMap node_refs;
|
|
||||||
RelationRefMap rel_refs;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
|
||||||
|
|
||||||
#endif // EXTRACTION_RELATION_HPP
|
|
||||||
@@ -14,28 +14,19 @@ namespace extractor
|
|||||||
|
|
||||||
struct ExtractionTurn
|
struct ExtractionTurn
|
||||||
{
|
{
|
||||||
ExtractionTurn(const guidance::ConnectedRoad &turn,
|
ExtractionTurn(const guidance::ConnectedRoad &turn, bool has_traffic_light)
|
||||||
bool has_traffic_light,
|
|
||||||
bool source_restricted,
|
|
||||||
bool target_restricted,
|
|
||||||
bool is_left_hand_driving)
|
|
||||||
: angle(180. - turn.angle), turn_type(turn.instruction.type),
|
: angle(180. - turn.angle), turn_type(turn.instruction.type),
|
||||||
direction_modifier(turn.instruction.direction_modifier),
|
direction_modifier(turn.instruction.direction_modifier),
|
||||||
has_traffic_light(has_traffic_light), source_restricted(source_restricted),
|
has_traffic_light(has_traffic_light), weight(0.), duration(0.), source_restricted(false),
|
||||||
target_restricted(target_restricted), is_left_hand_driving(is_left_hand_driving),
|
target_restricted(false)
|
||||||
weight(0.), duration(0.)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ExtractionTurn(bool has_traffic_light,
|
ExtractionTurn(const bool has_traffic_light = false)
|
||||||
bool source_restricted,
|
|
||||||
bool target_restricted,
|
|
||||||
bool is_left_hand_driving)
|
|
||||||
: angle(0), turn_type(guidance::TurnType::NoTurn),
|
: angle(0), turn_type(guidance::TurnType::NoTurn),
|
||||||
direction_modifier(guidance::DirectionModifier::Straight),
|
direction_modifier(guidance::DirectionModifier::Straight),
|
||||||
has_traffic_light(has_traffic_light), source_restricted(source_restricted),
|
has_traffic_light(has_traffic_light), weight(0.), duration(0.), source_restricted(false),
|
||||||
target_restricted(target_restricted), is_left_hand_driving(is_left_hand_driving),
|
target_restricted(false)
|
||||||
weight(0.), duration(0.)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,12 +34,10 @@ struct ExtractionTurn
|
|||||||
const guidance::TurnType::Enum turn_type;
|
const guidance::TurnType::Enum turn_type;
|
||||||
const guidance::DirectionModifier::Enum direction_modifier;
|
const guidance::DirectionModifier::Enum direction_modifier;
|
||||||
const bool has_traffic_light;
|
const bool has_traffic_light;
|
||||||
const bool source_restricted;
|
|
||||||
const bool target_restricted;
|
|
||||||
const bool is_left_hand_driving;
|
|
||||||
|
|
||||||
double weight;
|
double weight;
|
||||||
double duration;
|
double duration;
|
||||||
|
bool source_restricted;
|
||||||
|
bool target_restricted;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,32 +46,28 @@ struct ExtractionWay
|
|||||||
backward_rate = -1;
|
backward_rate = -1;
|
||||||
duration = -1;
|
duration = -1;
|
||||||
weight = -1;
|
weight = -1;
|
||||||
name.clear();
|
|
||||||
forward_ref.clear();
|
|
||||||
backward_ref.clear();
|
|
||||||
pronunciation.clear();
|
|
||||||
destinations.clear();
|
|
||||||
exits.clear();
|
|
||||||
turn_lanes_forward.clear();
|
|
||||||
turn_lanes_backward.clear();
|
|
||||||
road_classification = guidance::RoadClassification();
|
|
||||||
forward_travel_mode = 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;
|
name.clear();
|
||||||
|
ref.clear();
|
||||||
|
pronunciation.clear();
|
||||||
|
destinations.clear();
|
||||||
|
exits.clear();
|
||||||
|
forward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
||||||
|
backward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
|
||||||
|
turn_lanes_forward.clear();
|
||||||
|
turn_lanes_backward.clear();
|
||||||
|
road_classification = guidance::RoadClassification();
|
||||||
backward_restricted = false;
|
backward_restricted = false;
|
||||||
is_left_hand_driving = false;
|
forward_restricted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrappers to allow assigning nil (nullptr) to string values
|
// wrappers to allow assigning nil (nullptr) to string values
|
||||||
void SetName(const char *value) { detail::maybeSetString(name, value); }
|
void SetName(const char *value) { detail::maybeSetString(name, value); }
|
||||||
const char *GetName() const { return name.c_str(); }
|
const char *GetName() const { return name.c_str(); }
|
||||||
void SetForwardRef(const char *value) { detail::maybeSetString(forward_ref, value); }
|
void SetRef(const char *value) { detail::maybeSetString(ref, value); }
|
||||||
const char *GetForwardRef() const { return forward_ref.c_str(); }
|
const char *GetRef() const { return ref.c_str(); }
|
||||||
void SetBackwardRef(const char *value) { detail::maybeSetString(backward_ref, value); }
|
|
||||||
const char *GetBackwardRef() const { return backward_ref.c_str(); }
|
|
||||||
void SetDestinations(const char *value) { detail::maybeSetString(destinations, value); }
|
void SetDestinations(const char *value) { detail::maybeSetString(destinations, value); }
|
||||||
const char *GetDestinations() const { return destinations.c_str(); }
|
const char *GetDestinations() const { return destinations.c_str(); }
|
||||||
void SetExits(const char *value) { detail::maybeSetString(exits, value); }
|
void SetExits(const char *value) { detail::maybeSetString(exits, value); }
|
||||||
@@ -104,8 +100,7 @@ struct ExtractionWay
|
|||||||
// weight of the whole way in both directions
|
// weight of the whole way in both directions
|
||||||
double weight;
|
double weight;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string forward_ref;
|
std::string ref;
|
||||||
std::string backward_ref;
|
|
||||||
std::string pronunciation;
|
std::string pronunciation;
|
||||||
std::string destinations;
|
std::string destinations;
|
||||||
std::string exits;
|
std::string exits;
|
||||||
@@ -114,15 +109,11 @@ struct ExtractionWay
|
|||||||
guidance::RoadClassification road_classification;
|
guidance::RoadClassification road_classification;
|
||||||
TravelMode forward_travel_mode : 4;
|
TravelMode forward_travel_mode : 4;
|
||||||
TravelMode backward_travel_mode : 4;
|
TravelMode backward_travel_mode : 4;
|
||||||
|
|
||||||
// Boolean flags
|
|
||||||
bool roundabout : 1;
|
bool roundabout : 1;
|
||||||
bool circular : 1;
|
bool circular : 1;
|
||||||
bool is_startpoint : 1;
|
bool is_startpoint : 1;
|
||||||
bool forward_restricted : 1;
|
bool forward_restricted : 1;
|
||||||
bool backward_restricted : 1;
|
bool backward_restricted : 1;
|
||||||
bool is_left_hand_driving : 1;
|
|
||||||
bool : 2;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -32,7 +32,6 @@ 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/packed_osm_ids.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"
|
||||||
@@ -62,27 +61,19 @@ class Extractor
|
|||||||
std::vector<ConditionalTurnRestriction>>
|
std::vector<ConditionalTurnRestriction>>
|
||||||
ParseOSMData(ScriptingEnvironment &scripting_environment, const unsigned number_of_threads);
|
ParseOSMData(ScriptingEnvironment &scripting_environment, const unsigned number_of_threads);
|
||||||
|
|
||||||
EdgeID BuildEdgeExpandedGraph(
|
std::pair<std::size_t, EdgeID>
|
||||||
// input data
|
BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment,
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
std::vector<util::Coordinate> &coordinates,
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
extractor::PackedOSMIDs &osm_node_ids,
|
||||||
const CompressedEdgeContainer &compressed_edge_container,
|
EdgeBasedNodeDataContainer &edge_based_nodes_container,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
std::vector<EdgeBasedNodeSegment> &edge_based_node_segments,
|
||||||
const std::unordered_set<NodeID> &traffic_lights,
|
std::vector<bool> &node_is_startpoint,
|
||||||
const std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<EdgeWeight> &edge_based_node_weights,
|
||||||
const std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
||||||
// might have to be updated to add new lane combinations
|
const std::string &intersection_class_output_file,
|
||||||
guidance::LaneDescriptionMap &turn_lane_map,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
// for calculating turn penalties
|
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
ScriptingEnvironment &scripting_environment,
|
guidance::LaneDescriptionMap &turn_lane_map);
|
||||||
// output data
|
|
||||||
EdgeBasedNodeDataContainer &edge_based_nodes_container,
|
|
||||||
std::vector<EdgeBasedNodeSegment> &edge_based_node_segments,
|
|
||||||
std::vector<bool> &node_is_startpoint,
|
|
||||||
std::vector<EdgeWeight> &edge_based_node_weights,
|
|
||||||
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
|
||||||
const std::string &intersection_class_output_file);
|
|
||||||
|
|
||||||
void FindComponents(unsigned max_edge_id,
|
void FindComponents(unsigned max_edge_id,
|
||||||
const util::DeallocatingVector<EdgeBasedEdge> &input_edge_list,
|
const util::DeallocatingVector<EdgeBasedEdge> &input_edge_list,
|
||||||
const std::vector<EdgeBasedNodeSegment> &input_node_segments,
|
const std::vector<EdgeBasedNodeSegment> &input_node_segments,
|
||||||
@@ -91,6 +82,11 @@ class Extractor
|
|||||||
std::vector<bool> node_is_startpoint,
|
std::vector<bool> node_is_startpoint,
|
||||||
const std::vector<util::Coordinate> &coordinates);
|
const std::vector<util::Coordinate> &coordinates);
|
||||||
std::shared_ptr<RestrictionMap> LoadRestrictionMap();
|
std::shared_ptr<RestrictionMap> LoadRestrictionMap();
|
||||||
|
std::shared_ptr<util::NodeBasedDynamicGraph>
|
||||||
|
LoadNodeBasedGraph(std::unordered_set<NodeID> &barrier_nodes,
|
||||||
|
std::unordered_set<NodeID> &traffic_lights,
|
||||||
|
std::vector<util::Coordinate> &coordinates,
|
||||||
|
extractor::PackedOSMIDs &osm_node_ids);
|
||||||
|
|
||||||
// Writes compressed node based graph and its embedding into a file for osrm-partition to use.
|
// Writes compressed node based graph and its embedding into a file for osrm-partition to use.
|
||||||
static void WriteCompressedNodeBasedGraph(const std::string &path,
|
static void WriteCompressedNodeBasedGraph(const std::string &path,
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ namespace osmium
|
|||||||
{
|
{
|
||||||
class Node;
|
class Node;
|
||||||
class Way;
|
class Way;
|
||||||
class Relation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
@@ -45,7 +44,6 @@ namespace extractor
|
|||||||
class ExtractionContainers;
|
class ExtractionContainers;
|
||||||
struct ExtractionNode;
|
struct ExtractionNode;
|
||||||
struct ExtractionWay;
|
struct ExtractionWay;
|
||||||
struct ExtractionRelation;
|
|
||||||
struct ProfileProperties;
|
struct ProfileProperties;
|
||||||
struct InputConditionalTurnRestriction;
|
struct InputConditionalTurnRestriction;
|
||||||
|
|
||||||
@@ -63,8 +61,7 @@ class ExtractorCallbacks
|
|||||||
// actually maps to name ids
|
// actually maps to name ids
|
||||||
using MapKey = std::tuple<std::string, std::string, std::string, std::string, std::string>;
|
using MapKey = std::tuple<std::string, std::string, std::string, std::string, std::string>;
|
||||||
using MapVal = unsigned;
|
using MapVal = unsigned;
|
||||||
using StringMap = std::unordered_map<MapKey, MapVal>;
|
std::unordered_map<MapKey, MapVal> 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;
|
guidance::LaneDescriptionMap &lane_description_map;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2017, Project OSRM contributors
|
Copyright (c) 2016, Project OSRM contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -68,8 +68,7 @@ struct ExtractorConfig final : storage::IOConfig
|
|||||||
".osrm.icd",
|
".osrm.icd",
|
||||||
".osrm.cnbg",
|
".osrm.cnbg",
|
||||||
".osrm.cnbg_to_ebg"}),
|
".osrm.cnbg_to_ebg"}),
|
||||||
requested_num_threads(0),
|
requested_num_threads(0)
|
||||||
use_locations_cache(true)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +79,6 @@ struct ExtractorConfig final : storage::IOConfig
|
|||||||
|
|
||||||
boost::filesystem::path input_path;
|
boost::filesystem::path input_path;
|
||||||
boost::filesystem::path profile_path;
|
boost::filesystem::path profile_path;
|
||||||
std::vector<boost::filesystem::path> location_dependent_data_paths;
|
|
||||||
|
|
||||||
unsigned requested_num_threads;
|
unsigned requested_num_threads;
|
||||||
unsigned small_component_size;
|
unsigned small_component_size;
|
||||||
@@ -89,7 +87,6 @@ struct ExtractorConfig final : storage::IOConfig
|
|||||||
|
|
||||||
bool use_metadata;
|
bool use_metadata;
|
||||||
bool parse_conditionals;
|
bool parse_conditionals;
|
||||||
bool use_locations_cache;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,27 +78,27 @@ 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 max_edge_id,
|
||||||
const EdgeBasedEdgeVector &edge_based_edge_list)
|
const EdgeBasedEdgeVector &edge_based_edge_list)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
||||||
|
|
||||||
storage::io::FileWriter writer(path, storage::io::FileWriter::GenerateFingerprint);
|
storage::io::FileWriter writer(path, storage::io::FileWriter::GenerateFingerprint);
|
||||||
|
|
||||||
writer.WriteElementCount64(number_of_edge_based_nodes);
|
writer.WriteElementCount64(max_edge_id);
|
||||||
storage::serialization::write(writer, edge_based_edge_list);
|
storage::serialization::write(writer, edge_based_edge_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 &max_edge_id,
|
||||||
EdgeBasedEdgeVector &edge_based_edge_list)
|
EdgeBasedEdgeVector &edge_based_edge_list)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
|
||||||
|
|
||||||
storage::io::FileReader reader(path, storage::io::FileReader::VerifyFingerprint);
|
storage::io::FileReader reader(path, storage::io::FileReader::VerifyFingerprint);
|
||||||
|
|
||||||
number_of_edge_based_nodes = reader.ReadElementCount64();
|
max_edge_id = reader.ReadElementCount64();
|
||||||
storage::serialization::read(reader, edge_based_edge_list);
|
storage::serialization::read(reader, edge_based_edge_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ class GraphCompressor
|
|||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
|
||||||
util::NodeBasedDynamicGraph &graph,
|
util::NodeBasedDynamicGraph &graph,
|
||||||
const std::vector<NodeBasedEdgeAnnotation> &node_data_container,
|
|
||||||
CompressedEdgeContainer &geometry_compressor);
|
CompressedEdgeContainer &geometry_compressor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -153,14 +153,6 @@ class CoordinateExtractor
|
|||||||
const double length,
|
const double length,
|
||||||
const double rate) const;
|
const double rate) const;
|
||||||
|
|
||||||
// find the coordinate at a specific distance in the vector
|
|
||||||
util::Coordinate
|
|
||||||
ExtractCoordinateAtLength(const double distance,
|
|
||||||
const std::vector<util::Coordinate> &coordinates) const;
|
|
||||||
util::Coordinate ExtractCoordinateAtLength(const double distance,
|
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
|
||||||
const std::vector<double> &length_cache) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||||
const extractor::CompressedEdgeContainer &compressed_geometries;
|
const extractor::CompressedEdgeContainer &compressed_geometries;
|
||||||
@@ -225,7 +217,7 @@ class CoordinateExtractor
|
|||||||
const std::vector<double> &segment_distances,
|
const std::vector<double> &segment_distances,
|
||||||
const double segment_length,
|
const double segment_length,
|
||||||
const double considered_lane_width,
|
const double considered_lane_width,
|
||||||
const extractor::NodeBasedEdgeClassification &edge_data) const;
|
const util::NodeBasedEdgeData &edge_data) const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the very first coordinate is within lane offsets and the rest offers a near straight line,
|
* If the very first coordinate is within lane offsets and the rest offers a near straight line,
|
||||||
@@ -249,6 +241,14 @@ class CoordinateExtractor
|
|||||||
const double segment_length,
|
const double segment_length,
|
||||||
const std::vector<double> &segment_distances,
|
const std::vector<double> &segment_distances,
|
||||||
const std::uint8_t considered_lanes) const;
|
const std::uint8_t considered_lanes) const;
|
||||||
|
|
||||||
|
// find the coordinate at a specific location in the vector
|
||||||
|
util::Coordinate ExtractCoordinateAtLength(const double distance,
|
||||||
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
|
const std::vector<double> &length_cache) const;
|
||||||
|
util::Coordinate
|
||||||
|
ExtractCoordinateAtLength(const double distance,
|
||||||
|
const std::vector<util::Coordinate> &coordinates) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class DrivewayHandler final : public IntersectionHandler
|
|||||||
public:
|
public:
|
||||||
DrivewayHandler(const IntersectionGenerator &intersection_generator,
|
DrivewayHandler(const IntersectionGenerator &intersection_generator,
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const SuffixTable &street_name_suffix_table);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ class IntersectionGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IntersectionGenerator(const util::NodeBasedDynamicGraph &node_based_graph,
|
IntersectionGenerator(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
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 std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
@@ -111,7 +110,6 @@ class IntersectionGenerator
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||||
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 std::vector<util::Coordinate> &coordinates;
|
const std::vector<util::Coordinate> &coordinates;
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class IntersectionHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table,
|
const SuffixTable &street_name_suffix_table,
|
||||||
@@ -51,7 +50,6 @@ class IntersectionHandler
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||||
const EdgeBasedNodeDataContainer &node_data_container;
|
|
||||||
const std::vector<util::Coordinate> &coordinates;
|
const std::vector<util::Coordinate> &coordinates;
|
||||||
const util::NameTable &name_table;
|
const util::NameTable &name_table;
|
||||||
const SuffixTable &street_name_suffix_table;
|
const SuffixTable &street_name_suffix_table;
|
||||||
@@ -126,6 +124,7 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
const IntersectionType &intersection) const
|
const IntersectionType &intersection) const
|
||||||
{
|
{
|
||||||
using Road = typename IntersectionType::value_type;
|
using Road = typename IntersectionType::value_type;
|
||||||
|
using EdgeData = osrm::util::NodeBasedDynamicGraph::EdgeData;
|
||||||
using osrm::util::angularDeviation;
|
using osrm::util::angularDeviation;
|
||||||
|
|
||||||
// no obvious road
|
// no obvious road
|
||||||
@@ -136,8 +135,7 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
if (intersection.size() == 2)
|
if (intersection.size() == 2)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
const auto &in_way_edge = node_based_graph.GetEdgeData(via_edge);
|
const EdgeData &in_way_data = node_based_graph.GetEdgeData(via_edge);
|
||||||
const auto &in_way_data = node_data_container.GetAnnotation(in_way_edge.annotation_data);
|
|
||||||
|
|
||||||
// the strategy for picking the most obvious turn involves deciding between
|
// the strategy for picking the most obvious turn involves deciding between
|
||||||
// an overall best candidate and a best candidate that shares the same name
|
// an overall best candidate and a best candidate that shares the same name
|
||||||
@@ -148,35 +146,35 @@ 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 EdgeData &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);
|
||||||
};
|
};
|
||||||
auto sameOrHigherPriority = [&](const auto &way_data) {
|
auto sameOrHigherPriority = [&in_way_data](const auto &way_data) {
|
||||||
return way_data.flags.road_classification.GetPriority() <=
|
return way_data.road_classification.GetPriority() <=
|
||||||
in_way_edge.flags.road_classification.GetPriority();
|
in_way_data.road_classification.GetPriority();
|
||||||
};
|
};
|
||||||
auto IsLowPriority = [](const auto &way_data) {
|
auto IsLowPriority = [](const auto &way_data) {
|
||||||
return way_data.flags.road_classification.IsLowPriorityRoadClass();
|
return way_data.road_classification.IsLowPriorityRoadClass();
|
||||||
};
|
};
|
||||||
// These two Compare functions are used for sifting out best option and continue
|
// These two Compare functions are used for sifting out best option and continue
|
||||||
// candidates by evaluating all the ways in an intersection by what they share
|
// candidates by evaluating all the ways in an intersection by what they share
|
||||||
// with the in way. Ideal candidates are of similar road class with the in way
|
// with the in way. Ideal candidates are of similar road class with the in way
|
||||||
// and are require relatively straight turns.
|
// and are require relatively straight turns.
|
||||||
const auto RoadCompare = [&](const auto &lhs, const auto &rhs) {
|
const auto RoadCompare = [&](const auto &lhs, const auto &rhs) {
|
||||||
const auto &lhs_edge = node_based_graph.GetEdgeData(lhs.eid);
|
const EdgeData &lhs_data = node_based_graph.GetEdgeData(lhs.eid);
|
||||||
const auto &rhs_edge = node_based_graph.GetEdgeData(rhs.eid);
|
const EdgeData &rhs_data = node_based_graph.GetEdgeData(rhs.eid);
|
||||||
const auto lhs_deviation = angularDeviation(lhs.angle, STRAIGHT_ANGLE);
|
const auto lhs_deviation = angularDeviation(lhs.angle, STRAIGHT_ANGLE);
|
||||||
const auto rhs_deviation = angularDeviation(rhs.angle, STRAIGHT_ANGLE);
|
const auto rhs_deviation = angularDeviation(rhs.angle, STRAIGHT_ANGLE);
|
||||||
|
|
||||||
const bool rhs_same_classification =
|
const bool rhs_same_classification =
|
||||||
rhs_edge.flags.road_classification == in_way_edge.flags.road_classification;
|
rhs_data.road_classification == in_way_data.road_classification;
|
||||||
const bool lhs_same_classification =
|
const bool lhs_same_classification =
|
||||||
lhs_edge.flags.road_classification == in_way_edge.flags.road_classification;
|
lhs_data.road_classification == in_way_data.road_classification;
|
||||||
const bool rhs_same_or_higher_priority = sameOrHigherPriority(rhs_edge);
|
const bool rhs_same_or_higher_priority = sameOrHigherPriority(rhs_data);
|
||||||
const bool rhs_low_priority = IsLowPriority(rhs_edge);
|
const bool rhs_low_priority = IsLowPriority(rhs_data);
|
||||||
const bool lhs_same_or_higher_priority = sameOrHigherPriority(lhs_edge);
|
const bool lhs_same_or_higher_priority = sameOrHigherPriority(lhs_data);
|
||||||
const bool lhs_low_priority = IsLowPriority(lhs_edge);
|
const bool lhs_low_priority = IsLowPriority(lhs_data);
|
||||||
auto left_tie = std::tie(lhs.entry_allowed,
|
auto left_tie = std::tie(lhs.entry_allowed,
|
||||||
lhs_same_or_higher_priority,
|
lhs_same_or_higher_priority,
|
||||||
rhs_low_priority,
|
rhs_low_priority,
|
||||||
@@ -190,10 +188,8 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
return left_tie > right_tie;
|
return left_tie > right_tie;
|
||||||
};
|
};
|
||||||
const auto RoadCompareSameName = [&](const auto &lhs, const auto &rhs) {
|
const auto RoadCompareSameName = [&](const auto &lhs, const auto &rhs) {
|
||||||
const auto &lhs_data = node_data_container.GetAnnotation(
|
const EdgeData &lhs_data = node_based_graph.GetEdgeData(lhs.eid);
|
||||||
node_based_graph.GetEdgeData(lhs.eid).annotation_data);
|
const EdgeData &rhs_data = node_based_graph.GetEdgeData(rhs.eid);
|
||||||
const auto &rhs_data = node_data_container.GetAnnotation(
|
|
||||||
node_based_graph.GetEdgeData(rhs.eid).annotation_data);
|
|
||||||
const auto lhs_continues = IsContinueRoad(lhs_data);
|
const auto lhs_continues = IsContinueRoad(lhs_data);
|
||||||
const auto rhs_continues = IsContinueRoad(rhs_data);
|
const auto rhs_continues = IsContinueRoad(rhs_data);
|
||||||
const auto left_tie = std::tie(lhs.entry_allowed, lhs_continues);
|
const auto left_tie = std::tie(lhs.entry_allowed, lhs_continues);
|
||||||
@@ -208,14 +204,12 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
|
|
||||||
best_option = std::distance(begin(intersection), best_option_it);
|
best_option = std::distance(begin(intersection), best_option_it);
|
||||||
best_option_deviation = angularDeviation(intersection[best_option].angle, STRAIGHT_ANGLE);
|
best_option_deviation = angularDeviation(intersection[best_option].angle, STRAIGHT_ANGLE);
|
||||||
const auto &best_option_edge = node_based_graph.GetEdgeData(intersection[best_option].eid);
|
const auto &best_option_data = node_based_graph.GetEdgeData(intersection[best_option].eid);
|
||||||
const auto &best_option_data =
|
|
||||||
node_data_container.GetAnnotation(best_option_edge.annotation_data);
|
|
||||||
|
|
||||||
// Unless the in way is also low priority, it is generally undesirable to
|
// Unless the in way is also low priority, it is generally undesirable to
|
||||||
// indicate that a low priority road is obvious
|
// indicate that a low priority road is obvious
|
||||||
if (IsLowPriority(best_option_edge) &&
|
if (IsLowPriority(best_option_data) &&
|
||||||
best_option_edge.flags.road_classification != in_way_edge.flags.road_classification)
|
best_option_data.road_classification != in_way_data.road_classification)
|
||||||
{
|
{
|
||||||
best_option = 0;
|
best_option = 0;
|
||||||
best_option_deviation = 180;
|
best_option_deviation = 180;
|
||||||
@@ -225,13 +219,13 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
const auto straightest = intersection.findClosestTurn(STRAIGHT_ANGLE);
|
const auto straightest = intersection.findClosestTurn(STRAIGHT_ANGLE);
|
||||||
if (straightest != best_option_it)
|
if (straightest != best_option_it)
|
||||||
{
|
{
|
||||||
const auto &straightest_edge = node_based_graph.GetEdgeData(straightest->eid);
|
const EdgeData &straightest_data = node_based_graph.GetEdgeData(straightest->eid);
|
||||||
double straightest_data_deviation = angularDeviation(straightest->angle, STRAIGHT_ANGLE);
|
double straightest_data_deviation = angularDeviation(straightest->angle, STRAIGHT_ANGLE);
|
||||||
const auto deviation_diff =
|
const auto deviation_diff =
|
||||||
std::abs(best_option_deviation - straightest_data_deviation) > FUZZY_ANGLE_DIFFERENCE;
|
std::abs(best_option_deviation - straightest_data_deviation) > FUZZY_ANGLE_DIFFERENCE;
|
||||||
const auto not_ramp_class = !straightest_edge.flags.road_classification.IsRampClass();
|
const auto not_ramp_class = !straightest_data.road_classification.IsRampClass();
|
||||||
const auto not_link_class = !straightest_edge.flags.road_classification.IsLinkClass();
|
const auto not_link_class = !straightest_data.road_classification.IsLinkClass();
|
||||||
if (deviation_diff && !IsLowPriority(straightest_edge) && not_ramp_class &&
|
if (deviation_diff && !IsLowPriority(straightest_data) && not_ramp_class &&
|
||||||
not_link_class && !IsContinueRoad(best_option_data))
|
not_link_class && !IsContinueRoad(best_option_data))
|
||||||
{
|
{
|
||||||
best_option = std::distance(begin(intersection), straightest);
|
best_option = std::distance(begin(intersection), straightest);
|
||||||
@@ -246,9 +240,7 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
|
|
||||||
auto best_continue_it =
|
auto best_continue_it =
|
||||||
std::min_element(begin(intersection), end(intersection), RoadCompareSameName);
|
std::min_element(begin(intersection), end(intersection), RoadCompareSameName);
|
||||||
const auto best_continue_edge = node_based_graph.GetEdgeData(best_continue_it->eid);
|
const auto best_continue_data = node_based_graph.GetEdgeData(best_continue_it->eid);
|
||||||
const auto best_continue_data =
|
|
||||||
node_data_container.GetAnnotation(best_continue_edge.annotation_data);
|
|
||||||
if (IsContinueRoad(best_continue_data) ||
|
if (IsContinueRoad(best_continue_data) ||
|
||||||
(in_way_data.name_id == EMPTY_NAMEID && best_continue_data.name_id == EMPTY_NAMEID))
|
(in_way_data.name_id == EMPTY_NAMEID && best_continue_data.name_id == EMPTY_NAMEID))
|
||||||
{
|
{
|
||||||
@@ -260,7 +252,8 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
// if the best angle is going straight but the road is turning, declare no obvious turn
|
// if the best angle is going straight but the road is turning, declare no obvious turn
|
||||||
if (0 != best_continue && best_option != best_continue &&
|
if (0 != best_continue && best_option != best_continue &&
|
||||||
best_option_deviation < MAXIMAL_ALLOWED_NO_TURN_DEVIATION &&
|
best_option_deviation < MAXIMAL_ALLOWED_NO_TURN_DEVIATION &&
|
||||||
best_continue_edge.flags.road_classification == best_option_edge.flags.road_classification)
|
node_based_graph.GetEdgeData(intersection[best_continue].eid).road_classification ==
|
||||||
|
best_option_data.road_classification)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -269,21 +262,17 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
// continue instruction because they share a name with the approaching way
|
// continue instruction because they share a name with the approaching way
|
||||||
const std::int64_t continue_count =
|
const std::int64_t continue_count =
|
||||||
count_if(++begin(intersection), end(intersection), [&](const auto &way) {
|
count_if(++begin(intersection), end(intersection), [&](const auto &way) {
|
||||||
return IsContinueRoad(node_data_container.GetAnnotation(
|
return IsContinueRoad(node_based_graph.GetEdgeData(way.eid));
|
||||||
node_based_graph.GetEdgeData(way.eid).annotation_data));
|
|
||||||
});
|
});
|
||||||
const std::int64_t continue_count_valid =
|
const std::int64_t continue_count_valid =
|
||||||
count_if(++begin(intersection), end(intersection), [&](const auto &way) {
|
count_if(++begin(intersection), end(intersection), [&](const auto &way) {
|
||||||
return IsContinueRoad(node_data_container.GetAnnotation(
|
return IsContinueRoad(node_based_graph.GetEdgeData(way.eid)) && way.entry_allowed;
|
||||||
node_based_graph.GetEdgeData(way.eid).annotation_data)) &&
|
|
||||||
way.entry_allowed;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// checks if continue candidates are sharp turns
|
// checks if continue candidates are sharp turns
|
||||||
const bool all_continues_are_narrow = [&]() {
|
const bool all_continues_are_narrow = [&]() {
|
||||||
return std::count_if(begin(intersection), end(intersection), [&](const Road &road) {
|
return std::count_if(begin(intersection), end(intersection), [&](const Road &road) {
|
||||||
const auto &road_data = node_data_container.GetAnnotation(
|
const EdgeData &road_data = node_based_graph.GetEdgeData(road.eid);
|
||||||
node_based_graph.GetEdgeData(road.eid).annotation_data);
|
|
||||||
const double &road_angle = angularDeviation(road.angle, STRAIGHT_ANGLE);
|
const double &road_angle = angularDeviation(road.angle, STRAIGHT_ANGLE);
|
||||||
return IsContinueRoad(road_data) && (road_angle < NARROW_TURN_ANGLE);
|
return IsContinueRoad(road_data) && (road_angle < NARROW_TURN_ANGLE);
|
||||||
}) == continue_count;
|
}) == continue_count;
|
||||||
@@ -307,32 +296,32 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// continue data now most certainly exists
|
// continue data now most certainly exists
|
||||||
const auto &continue_edge = node_based_graph.GetEdgeData(intersection[best_continue].eid);
|
const auto &continue_data = node_based_graph.GetEdgeData(intersection[best_continue].eid);
|
||||||
|
|
||||||
// best_continue is obvious by road class
|
// best_continue is obvious by road class
|
||||||
if (obviousByRoadClass(in_way_edge.flags.road_classification,
|
if (obviousByRoadClass(in_way_data.road_classification,
|
||||||
continue_edge.flags.road_classification,
|
continue_data.road_classification,
|
||||||
best_option_edge.flags.road_classification))
|
best_option_data.road_classification))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// best_option is obvious by road class
|
// best_option is obvious by road class
|
||||||
if (obviousByRoadClass(in_way_edge.flags.road_classification,
|
if (obviousByRoadClass(in_way_data.road_classification,
|
||||||
best_option_edge.flags.road_classification,
|
best_option_data.road_classification,
|
||||||
continue_edge.flags.road_classification))
|
continue_data.road_classification))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// the best_option deviation is very straight and not a ramp
|
// the best_option deviation is very straight and not a ramp
|
||||||
if (best_option_deviation < best_continue_deviation &&
|
if (best_option_deviation < best_continue_deviation &&
|
||||||
best_option_deviation < FUZZY_ANGLE_DIFFERENCE &&
|
best_option_deviation < FUZZY_ANGLE_DIFFERENCE &&
|
||||||
!best_option_edge.flags.road_classification.IsRampClass())
|
!best_option_data.road_classification.IsRampClass())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// the continue road is of a lower priority, while the road continues on the same priority
|
// the continue road is of a lower priority, while the road continues on the same priority
|
||||||
// with a better angle
|
// with a better angle
|
||||||
if (best_option_deviation < best_continue_deviation &&
|
if (best_option_deviation < best_continue_deviation &&
|
||||||
in_way_edge.flags.road_classification == best_option_edge.flags.road_classification &&
|
in_way_data.road_classification == best_option_data.road_classification &&
|
||||||
continue_edge.flags.road_classification.GetPriority() >
|
continue_data.road_classification.GetPriority() >
|
||||||
best_option_edge.flags.road_classification.GetPriority())
|
best_option_data.road_classification.GetPriority())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -346,25 +335,24 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
const auto in_through_candidate =
|
const auto in_through_candidate =
|
||||||
intersection.FindClosestBearing(util::bearing::reverse(road.bearing));
|
intersection.FindClosestBearing(util::bearing::reverse(road.bearing));
|
||||||
|
|
||||||
const auto &in_edge = node_based_graph.GetEdgeData(in_through_candidate->eid);
|
const auto &in_data = node_based_graph.GetEdgeData(in_through_candidate->eid);
|
||||||
const auto &out_edge = node_based_graph.GetEdgeData(road.eid);
|
const auto &out_data = node_based_graph.GetEdgeData(road.eid);
|
||||||
|
|
||||||
// by asking for the same class, we ensure that we do not overrule obvious by road-class
|
// by asking for the same class, we ensure that we do not overrule obvious by road-class
|
||||||
// decisions
|
// decisions
|
||||||
const auto same_class =
|
const auto same_class = in_data.road_classification == out_data.road_classification;
|
||||||
in_edge.flags.road_classification == out_edge.flags.road_classification;
|
|
||||||
|
|
||||||
// only if the entry is allowed for one of the two, but not the other, we need to check.
|
// only if the entry is allowed for one of the two, but not the other, we need to check.
|
||||||
// Otherwise other handlers do it better
|
// Otherwise other handlers do it better
|
||||||
const bool is_oneway = !in_through_candidate->entry_allowed && road.entry_allowed;
|
const bool is_oneway = !in_through_candidate->entry_allowed && road.entry_allowed;
|
||||||
|
|
||||||
const bool not_roundabout = !(in_edge.flags.roundabout || in_edge.flags.circular ||
|
const bool not_roundabout =
|
||||||
out_edge.flags.roundabout || out_edge.flags.circular);
|
!(in_data.roundabout || in_data.circular || out_data.roundabout || out_data.circular);
|
||||||
|
|
||||||
// for the purpose of this check, we do not care about low-priority roads (parking lots,
|
// for the purpose of this check, we do not care about low-priority roads (parking lots,
|
||||||
// mostly). Since we postulate both classes to be the same, checking one of the two is
|
// mostly). Since we postulate both classes to be the same, checking one of the two is
|
||||||
// enough
|
// enough
|
||||||
const bool not_low_priority = !in_edge.flags.road_classification.IsLowPriorityRoadClass();
|
const bool not_low_priority = !in_data.road_classification.IsLowPriorityRoadClass();
|
||||||
|
|
||||||
const auto in_deviation = angularDeviation(in_through_candidate->angle, STRAIGHT_ANGLE);
|
const auto in_deviation = angularDeviation(in_through_candidate->angle, STRAIGHT_ANGLE);
|
||||||
const auto out_deviaiton = angularDeviation(road.angle, STRAIGHT_ANGLE);
|
const auto out_deviaiton = angularDeviation(road.angle, STRAIGHT_ANGLE);
|
||||||
@@ -383,11 +371,11 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
const auto index_candidate = (best_option + 1) % intersection.size();
|
const auto index_candidate = (best_option + 1) % intersection.size();
|
||||||
if (index_candidate == 0)
|
if (index_candidate == 0)
|
||||||
return index_candidate;
|
return index_candidate;
|
||||||
const auto &candidate_edge =
|
const auto &candidate_data =
|
||||||
node_based_graph.GetEdgeData(intersection[index_candidate].eid);
|
node_based_graph.GetEdgeData(intersection[index_candidate].eid);
|
||||||
if (obviousByRoadClass(in_way_edge.flags.road_classification,
|
if (obviousByRoadClass(in_way_data.road_classification,
|
||||||
best_option_edge.flags.road_classification,
|
best_option_data.road_classification,
|
||||||
candidate_edge.flags.road_classification))
|
candidate_data.road_classification))
|
||||||
return (index_candidate + 1) % intersection.size();
|
return (index_candidate + 1) % intersection.size();
|
||||||
else
|
else
|
||||||
return index_candidate;
|
return index_candidate;
|
||||||
@@ -398,11 +386,11 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
const auto index_candidate = best_option - 1;
|
const auto index_candidate = best_option - 1;
|
||||||
if (index_candidate == 0)
|
if (index_candidate == 0)
|
||||||
return index_candidate;
|
return index_candidate;
|
||||||
const auto &candidate_edge =
|
const auto candidate_data =
|
||||||
node_based_graph.GetEdgeData(intersection[index_candidate].eid);
|
node_based_graph.GetEdgeData(intersection[index_candidate].eid);
|
||||||
if (obviousByRoadClass(in_way_edge.flags.road_classification,
|
if (obviousByRoadClass(in_way_data.road_classification,
|
||||||
best_option_edge.flags.road_classification,
|
best_option_data.road_classification,
|
||||||
candidate_edge.flags.road_classification))
|
candidate_data.road_classification))
|
||||||
return index_candidate - 1;
|
return index_candidate - 1;
|
||||||
else
|
else
|
||||||
return index_candidate;
|
return index_candidate;
|
||||||
@@ -419,17 +407,17 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
std::min(left_deviation, right_deviation) > FUZZY_ANGLE_DIFFERENCE)
|
std::min(left_deviation, right_deviation) > FUZZY_ANGLE_DIFFERENCE)
|
||||||
return best_option;
|
return best_option;
|
||||||
|
|
||||||
const auto &left_edge = node_based_graph.GetEdgeData(intersection[left_index].eid);
|
const auto &left_data = node_based_graph.GetEdgeData(intersection[left_index].eid);
|
||||||
const auto &right_edge = node_based_graph.GetEdgeData(intersection[right_index].eid);
|
const auto &right_data = node_based_graph.GetEdgeData(intersection[right_index].eid);
|
||||||
|
|
||||||
const bool obvious_to_left =
|
const bool obvious_to_left =
|
||||||
left_index == 0 || obviousByRoadClass(in_way_edge.flags.road_classification,
|
left_index == 0 || obviousByRoadClass(in_way_data.road_classification,
|
||||||
best_option_edge.flags.road_classification,
|
best_option_data.road_classification,
|
||||||
left_edge.flags.road_classification);
|
left_data.road_classification);
|
||||||
const bool obvious_to_right =
|
const bool obvious_to_right =
|
||||||
right_index == 0 || obviousByRoadClass(in_way_edge.flags.road_classification,
|
right_index == 0 || obviousByRoadClass(in_way_data.road_classification,
|
||||||
best_option_edge.flags.road_classification,
|
best_option_data.road_classification,
|
||||||
right_edge.flags.road_classification);
|
right_data.road_classification);
|
||||||
|
|
||||||
// if the best_option turn isn't narrow, but there is a nearly straight turn, we don't
|
// if the best_option turn isn't narrow, but there is a nearly straight turn, we don't
|
||||||
// consider the turn obvious
|
// consider the turn obvious
|
||||||
@@ -459,15 +447,14 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
distinction rate. If the road category is smaller, its also adjusted. Only
|
distinction rate. If the road category is smaller, its also adjusted. Only
|
||||||
roads of the same priority require the full distinction ratio.
|
roads of the same priority require the full distinction ratio.
|
||||||
*/
|
*/
|
||||||
const auto &best_option_edge =
|
const auto &best_option_data =
|
||||||
node_based_graph.GetEdgeData(intersection[best_option].eid);
|
node_based_graph.GetEdgeData(intersection[best_option].eid);
|
||||||
const auto adjusted_distinction_ratio = [&]() {
|
const auto adjusted_distinction_ratio = [&]() {
|
||||||
// obviousness by road classes
|
// obviousness by road classes
|
||||||
if (in_way_edge.flags.road_classification ==
|
if (in_way_data.road_classification == best_option_data.road_classification &&
|
||||||
best_option_edge.flags.road_classification &&
|
best_option_data.road_classification.GetPriority() <
|
||||||
best_option_edge.flags.road_classification.GetPriority() <
|
|
||||||
node_based_graph.GetEdgeData(intersection[index].eid)
|
node_based_graph.GetEdgeData(intersection[index].eid)
|
||||||
.flags.road_classification.GetPriority())
|
.road_classification.GetPriority())
|
||||||
return 0.8 * DISTINCTION_RATIO;
|
return 0.8 * DISTINCTION_RATIO;
|
||||||
// if road classes are the same, we use the full ratio
|
// if road classes are the same, we use the full ratio
|
||||||
else
|
else
|
||||||
@@ -485,9 +472,7 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto &continue_edge = node_based_graph.GetEdgeData(intersection[best_continue].eid);
|
const auto &continue_data = node_based_graph.GetEdgeData(intersection[best_continue].eid);
|
||||||
const auto &continue_data =
|
|
||||||
node_data_container.GetAnnotation(continue_edge.annotation_data);
|
|
||||||
if (std::abs(best_continue_deviation) < 1)
|
if (std::abs(best_continue_deviation) < 1)
|
||||||
return best_continue;
|
return best_continue;
|
||||||
|
|
||||||
@@ -503,12 +488,11 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
if (i == best_continue || !intersection[i].entry_allowed)
|
if (i == best_continue || !intersection[i].entry_allowed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const auto &turn_edge = node_based_graph.GetEdgeData(intersection[i].eid);
|
const auto &turn_data = node_based_graph.GetEdgeData(intersection[i].eid);
|
||||||
const auto &turn_data = node_data_container.GetAnnotation(turn_edge.annotation_data);
|
|
||||||
const bool is_obvious_by_road_class =
|
const bool is_obvious_by_road_class =
|
||||||
obviousByRoadClass(in_way_edge.flags.road_classification,
|
obviousByRoadClass(in_way_data.road_classification,
|
||||||
continue_edge.flags.road_classification,
|
continue_data.road_classification,
|
||||||
turn_edge.flags.road_classification);
|
turn_data.road_classification);
|
||||||
|
|
||||||
// if the main road is obvious by class, we ignore the current road as a potential
|
// if the main road is obvious by class, we ignore the current road as a potential
|
||||||
// prevention of obviousness
|
// prevention of obviousness
|
||||||
@@ -516,9 +500,9 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// continuation could be grouped with a straight turn and the turning road is a ramp
|
// continuation could be grouped with a straight turn and the turning road is a ramp
|
||||||
if (turn_edge.flags.road_classification.IsRampClass() &&
|
if (turn_data.road_classification.IsRampClass() &&
|
||||||
best_continue_deviation < GROUP_ANGLE &&
|
best_continue_deviation < GROUP_ANGLE &&
|
||||||
!continue_edge.flags.road_classification.IsRampClass())
|
!continue_data.road_classification.IsRampClass())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// perfectly straight turns prevent obviousness
|
// perfectly straight turns prevent obviousness
|
||||||
@@ -583,13 +567,11 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
|
|||||||
// actually represents a near 180 degree different in bearings between the two
|
// actually represents a near 180 degree different in bearings between the two
|
||||||
// roads. So if there is a road that is enterable in the opposite direction just
|
// roads. So if there is a road that is enterable in the opposite direction just
|
||||||
// prior, a turn is not obvious
|
// prior, a turn is not obvious
|
||||||
const auto &turn_edge_data = node_based_graph.GetEdgeData(comparison_road.eid);
|
const auto &turn_data = node_based_graph.GetEdgeData(comparison_road.eid);
|
||||||
const auto &turn_data =
|
|
||||||
node_data_container.GetAnnotation(turn_edge_data.annotation_data);
|
|
||||||
if (angularDeviation(comparison_road.angle, STRAIGHT_ANGLE) > GROUP_ANGLE &&
|
if (angularDeviation(comparison_road.angle, STRAIGHT_ANGLE) > GROUP_ANGLE &&
|
||||||
angularDeviation(comparison_road.angle, continue_road.angle) <
|
angularDeviation(comparison_road.angle, continue_road.angle) <
|
||||||
FUZZY_ANGLE_DIFFERENCE &&
|
FUZZY_ANGLE_DIFFERENCE &&
|
||||||
!turn_edge_data.reversed && continue_data.CanCombineWith(turn_data))
|
!turn_data.reversed && continue_data.CanCombineWith(turn_data))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ class IntersectionNormalizer
|
|||||||
std::vector<IntersectionNormalizationOperation> performed_merges;
|
std::vector<IntersectionNormalizationOperation> performed_merges;
|
||||||
};
|
};
|
||||||
IntersectionNormalizer(const util::NodeBasedDynamicGraph &node_based_graph,
|
IntersectionNormalizer(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
|
||||||
const std::vector<util::Coordinate> &node_coordinates,
|
const std::vector<util::Coordinate> &node_coordinates,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table,
|
const SuffixTable &street_name_suffix_table,
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class MergableRoadDetector
|
|||||||
using MergableRoadData = IntersectionShapeData;
|
using MergableRoadData = IntersectionShapeData;
|
||||||
|
|
||||||
MergableRoadDetector(const util::NodeBasedDynamicGraph &node_based_graph,
|
MergableRoadDetector(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
|
||||||
const std::vector<util::Coordinate> &node_coordinates,
|
const std::vector<util::Coordinate> &node_coordinates,
|
||||||
const IntersectionGenerator &intersection_generator,
|
const IntersectionGenerator &intersection_generator,
|
||||||
const CoordinateExtractor &coordinate_extractor,
|
const CoordinateExtractor &coordinate_extractor,
|
||||||
@@ -78,10 +77,8 @@ class MergableRoadDetector
|
|||||||
|
|
||||||
// When it comes to merging roads, we need to find out if two ways actually represent the
|
// When it comes to merging roads, we need to find out if two ways actually represent the
|
||||||
// same road. This check tries to identify roads which are the same road in opposite directions
|
// same road. This check tries to identify roads which are the same road in opposite directions
|
||||||
bool EdgeDataSupportsMerge(const NodeBasedEdgeClassification &lhs_flags,
|
bool EdgeDataSupportsMerge(const util::NodeBasedEdgeData &lhs_edge_data,
|
||||||
const NodeBasedEdgeClassification &rhs_flags,
|
const util::NodeBasedEdgeData &rhs_edge_data) const;
|
||||||
const NodeBasedEdgeAnnotation &lhs_edge_annotation,
|
|
||||||
const NodeBasedEdgeAnnotation &rhs_edge_annotation) const;
|
|
||||||
|
|
||||||
// Detect traffic loops.
|
// Detect traffic loops.
|
||||||
// Since OSRM cannot handle loop edges, we cannot directly see a connection between a node and
|
// Since OSRM cannot handle loop edges, we cannot directly see a connection between a node and
|
||||||
@@ -141,7 +138,6 @@ class MergableRoadDetector
|
|||||||
bool IsLinkRoad(const NodeID intersection_node, const MergableRoadData &road) const;
|
bool IsLinkRoad(const NodeID intersection_node, const MergableRoadData &road) const;
|
||||||
|
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||||
const EdgeBasedNodeDataContainer &node_data_container;
|
|
||||||
const std::vector<util::Coordinate> &node_coordinates;
|
const std::vector<util::Coordinate> &node_coordinates;
|
||||||
const IntersectionGenerator &intersection_generator;
|
const IntersectionGenerator &intersection_generator;
|
||||||
const CoordinateExtractor &coordinate_extractor;
|
const CoordinateExtractor &coordinate_extractor;
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ 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 std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table,
|
const SuffixTable &street_name_suffix_table,
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ class NodeBasedGraphWalker
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NodeBasedGraphWalker(const util::NodeBasedDynamicGraph &node_based_graph,
|
NodeBasedGraphWalker(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
|
||||||
const IntersectionGenerator &intersection_generator);
|
const IntersectionGenerator &intersection_generator);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -47,7 +46,6 @@ class NodeBasedGraphWalker
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph;
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
||||||
const EdgeBasedNodeDataContainer &node_data_container;
|
|
||||||
const IntersectionGenerator &intersection_generator;
|
const IntersectionGenerator &intersection_generator;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -108,8 +106,7 @@ struct SelectRoadByNameOnlyChoiceAndStraightness
|
|||||||
boost::optional<EdgeID> operator()(const NodeID nid,
|
boost::optional<EdgeID> operator()(const NodeID nid,
|
||||||
const EdgeID via_edge_id,
|
const EdgeID via_edge_id,
|
||||||
const IntersectionView &intersection,
|
const IntersectionView &intersection,
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
const util::NodeBasedDynamicGraph &node_based_graph) const;
|
||||||
const EdgeBasedNodeDataContainer &node_data_container) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const NameID desired_name_id;
|
const NameID desired_name_id;
|
||||||
@@ -134,8 +131,7 @@ struct SelectStraightmostRoadByNameAndOnlyChoice
|
|||||||
boost::optional<EdgeID> operator()(const NodeID nid,
|
boost::optional<EdgeID> operator()(const NodeID nid,
|
||||||
const EdgeID via_edge_id,
|
const EdgeID via_edge_id,
|
||||||
const IntersectionView &intersection,
|
const IntersectionView &intersection,
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
const util::NodeBasedDynamicGraph &node_based_graph) const;
|
||||||
const EdgeBasedNodeDataContainer &node_data_container) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const NameID desired_name_id;
|
const NameID desired_name_id;
|
||||||
@@ -205,11 +201,8 @@ NodeBasedGraphWalker::TraverseRoad(NodeID current_node_id,
|
|||||||
if (next_intersection.size() <= 1)
|
if (next_intersection.size() <= 1)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
auto next_edge_id = selector(current_node_id,
|
auto next_edge_id =
|
||||||
current_edge_id,
|
selector(current_node_id, current_edge_id, next_intersection, node_based_graph);
|
||||||
next_intersection,
|
|
||||||
node_based_graph,
|
|
||||||
node_data_container);
|
|
||||||
|
|
||||||
if (!next_edge_id)
|
if (!next_edge_id)
|
||||||
return {};
|
return {};
|
||||||
@@ -231,8 +224,7 @@ struct SkipTrafficSignalBarrierRoadSelector
|
|||||||
boost::optional<EdgeID> operator()(const NodeID,
|
boost::optional<EdgeID> operator()(const NodeID,
|
||||||
const EdgeID,
|
const EdgeID,
|
||||||
const IntersectionView &intersection,
|
const IntersectionView &intersection,
|
||||||
const util::NodeBasedDynamicGraph &,
|
const util::NodeBasedDynamicGraph &) const
|
||||||
const EdgeBasedNodeDataContainer &) const
|
|
||||||
{
|
{
|
||||||
if (intersection.isTrafficSignalOrBarrier())
|
if (intersection.isTrafficSignalOrBarrier())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "extractor/guidance/intersection_generator.hpp"
|
#include "extractor/guidance/intersection_generator.hpp"
|
||||||
#include "extractor/guidance/intersection_handler.hpp"
|
#include "extractor/guidance/intersection_handler.hpp"
|
||||||
#include "extractor/guidance/roundabout_type.hpp"
|
#include "extractor/guidance/roundabout_type.hpp"
|
||||||
|
#include "extractor/profile_properties.hpp"
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/query_node.hpp"
|
||||||
|
|
||||||
#include "util/name_table.hpp"
|
#include "util/name_table.hpp"
|
||||||
@@ -40,11 +41,11 @@ 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 std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const CompressedEdgeContainer &compressed_edge_container,
|
const CompressedEdgeContainer &compressed_edge_container,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table,
|
const SuffixTable &street_name_suffix_table,
|
||||||
|
const ProfileProperties &profile_properties,
|
||||||
const IntersectionGenerator &intersection_generator);
|
const IntersectionGenerator &intersection_generator);
|
||||||
|
|
||||||
~RoundaboutHandler() override final = default;
|
~RoundaboutHandler() override final = default;
|
||||||
@@ -85,6 +86,8 @@ class RoundaboutHandler : public IntersectionHandler
|
|||||||
qualifiesAsRoundaboutIntersection(const std::unordered_set<NodeID> &roundabout_nodes) const;
|
qualifiesAsRoundaboutIntersection(const std::unordered_set<NodeID> &roundabout_nodes) const;
|
||||||
|
|
||||||
const CompressedEdgeContainer &compressed_edge_container;
|
const CompressedEdgeContainer &compressed_edge_container;
|
||||||
|
const ProfileProperties &profile_properties;
|
||||||
|
|
||||||
const CoordinateExtractor coordinate_extractor;
|
const CoordinateExtractor coordinate_extractor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ class SliproadHandler final : public IntersectionHandler
|
|||||||
public:
|
public:
|
||||||
SliproadHandler(const IntersectionGenerator &intersection_generator,
|
SliproadHandler(const IntersectionGenerator &intersection_generator,
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const SuffixTable &street_name_suffix_table);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ class SuppressModeHandler final : public IntersectionHandler
|
|||||||
public:
|
public:
|
||||||
SuppressModeHandler(const IntersectionGenerator &intersection_generator,
|
SuppressModeHandler(const IntersectionGenerator &intersection_generator,
|
||||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||||
const EdgeBasedNodeDataContainer &node_data_container,
|
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const util::NameTable &name_table,
|
const util::NameTable &name_table,
|
||||||
const SuffixTable &street_name_suffix_table);
|
const SuffixTable &street_name_suffix_table);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user