Compare commits
256 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7fbca3e5e | |||
| 9695eaa28a | |||
| 0d7546a510 | |||
| 9dc8136240 | |||
| a02a83f8bd | |||
| 9b18f55d29 | |||
| a3434e7ae9 | |||
| 64b15028e4 | |||
| d8e466fdaa | |||
| 43bbe8f2ae | |||
| b5c10b1fbf | |||
| 57d93fc5dc | |||
| 3aba2bc2d0 | |||
| c42478f0ee | |||
| ea583a77ff | |||
| dd999e112e | |||
| 69c54bef72 | |||
| cfee0f1109 | |||
| c7ce758e1c | |||
| 3ac4fb5933 | |||
| 2afe5e971b | |||
| 519b744502 | |||
| d3c2ac671f | |||
| 07a1a907f8 | |||
| 062cae82a0 | |||
| 316c7781a3 | |||
| e11bcfece5 | |||
| cb8dee3e60 | |||
| a1abe71d9f | |||
| d54c837e51 | |||
| 106d17541d | |||
| ad29b237e3 | |||
| febefb4684 | |||
| d28713b845 | |||
| 2e6428e917 | |||
| 1f3a8d4538 | |||
| 140f1ad923 | |||
| 1c25070572 | |||
| 24fe881d03 | |||
| 25ab51f4f0 | |||
| 46f96af360 | |||
| ce685da92c | |||
| 2218658969 | |||
| 3e2db47cc8 | |||
| 28a8154cee | |||
| 005124fe1c | |||
| 1e4c8eeeb6 | |||
| 72455a2733 | |||
| 112cf55aae | |||
| aa3f208032 | |||
| 919386bdaf | |||
| ae835cc04f | |||
| ef4d32a492 | |||
| 2a5ebf84bc | |||
| 768dc8d817 | |||
| 0c04c6cafb | |||
| bf690df97a | |||
| 880b982eeb | |||
| 53011755a2 | |||
| ddb60c34e6 | |||
| 543f0e5e44 | |||
| 1e9e420d91 | |||
| c885d03830 | |||
| ab91a05680 | |||
| 84261fd214 | |||
| 734df348cb | |||
| 41064e2d7b | |||
| 8d7aae8687 | |||
| 7256b6d0d4 | |||
| 3106b5dd9e | |||
| f1427a834d | |||
| 04954de9c6 | |||
| a6cd0863bc | |||
| 9f28873cb1 | |||
| 10c5d76909 | |||
| d81ef3f4db | |||
| 3abab16bf3 | |||
| 6e1c4bfecd | |||
| cedeb15ade | |||
| f2663acfc6 | |||
| c48fc58eb2 | |||
| 5f1c7efd41 | |||
| 9e5d45d86a | |||
| 5fd6355829 | |||
| 6da4d918d0 | |||
| 1628ebb871 | |||
| eaed5c7a8e | |||
| 9d2628b74f | |||
| 11ee632cfe | |||
| 97c0a74c04 | |||
| b3ef27d104 | |||
| c22ce3ae1f | |||
| 36c944ef53 | |||
| 5b24758742 | |||
| a572719484 | |||
| ad594cb2e4 | |||
| 6b143c5e1d | |||
| 25baf51a2c | |||
| c059d15cb9 | |||
| 279f8aabfb | |||
| e463733138 | |||
| 7deff5837c | |||
| 46ac9d05d9 | |||
| c7640903c3 | |||
| 445225bf6d | |||
| 47b1a56b12 | |||
| b5e289adc3 | |||
| e0a1a43449 | |||
| 337ecefa45 | |||
| 7961fa8863 | |||
| 88eb9e5499 | |||
| df449d3b5c | |||
| d8c54fb815 | |||
| 6f27aae022 | |||
| 5c93609142 | |||
| c277b95f03 | |||
| b1f1c26703 | |||
| a5d0707dd0 | |||
| d129b0ef24 | |||
| f2c3b9859e | |||
| bb1f4a025a | |||
| 8c36012653 | |||
| 66cb75f4a3 | |||
| 0c6dee4bef | |||
| 49d3467ec7 | |||
| a48cf58468 | |||
| fbc7189cf8 | |||
| e8167b2e4e | |||
| c03aa8a273 | |||
| a40abacfca | |||
| b8beac2d00 | |||
| 75e0b5a5c4 | |||
| c03b230e84 | |||
| 6b06c5bd32 | |||
| 226ee62981 | |||
| fce3bb180c | |||
| 1ae69fe40d | |||
| e4dc2aa45c | |||
| d0f1347ff1 | |||
| 70e899378d | |||
| dbd70d4884 | |||
| 71044e88f3 | |||
| b8f631f6f6 | |||
| 3837f9d015 | |||
| 763ad0d047 | |||
| b6f9ec2a33 | |||
| 5d3a348b76 | |||
| 104e23abf3 | |||
| a7bb26f2d6 | |||
| 710ba20acc | |||
| fce8d72895 | |||
| 774b8688ca | |||
| fe2beb6f68 | |||
| 71e7d6d6b8 | |||
| 29f736f1c8 | |||
| bb4f13a47c | |||
| bb0b03bbce | |||
| 59ad7dddb2 | |||
| f12fdeb23e | |||
| f896aaf881 | |||
| a2a2cf84d1 | |||
| 4e897aad50 | |||
| 5e8bdbfa0c | |||
| fd57c5b48b | |||
| 1d4d3b80b5 | |||
| f82740ed93 | |||
| c1f833c80f | |||
| 813e16b9b4 | |||
| 06ef3053de | |||
| 9fa7e6c74f | |||
| a7d63283ab | |||
| 78a443bfb2 | |||
| 84b8d3cfb9 | |||
| b3483f95a7 | |||
| 32f63e5e0c | |||
| 185e9dc7f3 | |||
| 6794f52cb2 | |||
| 06e6b9ea6f | |||
| 93d89ad686 | |||
| 7c8176b077 | |||
| 7ef95e9918 | |||
| f313cb9913 | |||
| 15c8fd326f | |||
| f7e8581a1b | |||
| c01ea2ea3e | |||
| 1153b78c06 | |||
| b5d5f309a3 | |||
| 5100f2cc7b | |||
| f6fef5c166 | |||
| 559c88b36d | |||
| 7dea7476f1 | |||
| dc81f581a0 | |||
| 300283d572 | |||
| aad2124faa | |||
| aced058c4a | |||
| 24ab71a346 | |||
| 2640a319c1 | |||
| e6ff17ab2a | |||
| f7ad2e1e26 | |||
| 2ed6b181c8 | |||
| f48bbb78de | |||
| bd2a5ebe10 | |||
| f8499957fa | |||
| 5db134bbba | |||
| 8645d8c7fc | |||
| b8e13d9b1b | |||
| 421caa1856 | |||
| ed9d10e96c | |||
| 0f3a463854 | |||
| b9b52cb857 | |||
| 9af67c5a9f | |||
| 8ffe915395 | |||
| b376c97db8 | |||
| 7b11cd3a11 | |||
| 76de3b6ace | |||
| bc081b7132 | |||
| 3cbac0f012 | |||
| f40b34af9d | |||
| cc14fb8bff | |||
| c5e3fa916f | |||
| dff7fe214b | |||
| 3b2ca720a8 | |||
| df4231341f | |||
| 0a2f934c87 | |||
| 3721f8c887 | |||
| 1ba5ff44cc | |||
| 5ecd2e4c67 | |||
| b1f6797aab | |||
| f04d146ca3 | |||
| 8c50a42ec4 | |||
| c4b3cdfd80 | |||
| 37051e1583 | |||
| d3ef993d5f | |||
| 9832825abd | |||
| d584bcad11 | |||
| e48ca65af4 | |||
| f429e08851 | |||
| de062d4ca3 | |||
| d83ab9d905 | |||
| 4618b502ac | |||
| 94854b5c90 | |||
| f8dd965435 | |||
| 6e29f9889b | |||
| 48d4e91d98 | |||
| 708ac04562 | |||
| 38b2ad298d | |||
| a51ef67db8 | |||
| 67ce19cb14 | |||
| 1b51163b1d | |||
| 84b618ed1a | |||
| dc8e6bd8d9 | |||
| 68e38880df | |||
| d5904d5756 | |||
| 0f59b78c02 | |||
| 6e7fe5feb0 | |||
| 3dfbf42e61 |
@@ -94,3 +94,6 @@ node_modules
|
|||||||
/server.ini
|
/server.ini
|
||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
|
# local lua debugging file
|
||||||
|
debug.lua
|
||||||
+15
-17
@@ -13,7 +13,7 @@ notifications:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- 5.5
|
- "5.6"
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
ccache: true
|
ccache: true
|
||||||
@@ -28,6 +28,7 @@ env:
|
|||||||
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
||||||
- CCACHE_VERSION=3.3.1
|
- CCACHE_VERSION=3.3.1
|
||||||
- CMAKE_VERSION=3.6.2
|
- CMAKE_VERSION=3.6.2
|
||||||
|
- MASON="$(pwd)/third_party/mason/mason"
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
@@ -45,12 +46,12 @@ matrix:
|
|||||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
|
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "clang-3.8-debug"
|
compiler: "clang-3.9-debug"
|
||||||
addons: &clang38
|
addons: &clang38
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||||
env: CLANG_VERSION='3.8.1' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
|
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Debug' BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode8.2
|
osx_image: xcode8.2
|
||||||
@@ -65,7 +66,7 @@ matrix:
|
|||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
sources: ['ubuntu-toolchain-r-test']
|
||||||
packages: ['libstdc++-5-dev']
|
packages: ['libstdc++-5-dev']
|
||||||
env: CLANG_VERSION='3.8.1' BUILD_TYPE='Release' ENABLE_MASON=ON
|
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-6-release"
|
compiler: "gcc-6-release"
|
||||||
@@ -79,7 +80,7 @@ matrix:
|
|||||||
compiler: "gcc-6-release-i686"
|
compiler: "gcc-6-release-i686"
|
||||||
env: >
|
env: >
|
||||||
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-4.9-release"
|
compiler: "gcc-4.9-release"
|
||||||
@@ -122,6 +123,10 @@ before_install:
|
|||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||||
export JOBS=$((`nproc` + 1))
|
export JOBS=$((`nproc` + 1))
|
||||||
fi
|
fi
|
||||||
|
- |
|
||||||
|
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
||||||
|
${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh
|
||||||
|
fi
|
||||||
- |
|
- |
|
||||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||||
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
||||||
@@ -131,22 +136,18 @@ before_install:
|
|||||||
- source ./scripts/install_node.sh 4
|
- source ./scripts/install_node.sh 4
|
||||||
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
|
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
|
||||||
- npm install
|
- npm install
|
||||||
- ./third_party/mason/mason install ccache ${CCACHE_VERSION}
|
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
|
||||||
- export PATH=$(./third_party/mason/mason prefix ccache ${CCACHE_VERSION})/bin:${PATH}
|
- ${MASON} install cmake ${CMAKE_VERSION} && export PATH=$(${MASON} prefix cmake ${CMAKE_VERSION})/bin:${PATH}
|
||||||
- ./third_party/mason/mason install cmake ${CMAKE_VERSION}
|
|
||||||
- export PATH=$(./third_party/mason/mason prefix cmake ${CMAKE_VERSION})/bin:${PATH}
|
|
||||||
- |
|
- |
|
||||||
if [[ ! -z ${CLANG_VERSION} ]]; then
|
if [[ ! -z ${CLANG_VERSION} ]]; then
|
||||||
export CCOMPILER='clang'
|
export CCOMPILER='clang'
|
||||||
export CXXCOMPILER='clang++'
|
export CXXCOMPILER='clang++'
|
||||||
./third_party/mason/mason install clang++ ${CLANG_VERSION}
|
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH}
|
||||||
export PATH=$(./third_party/mason/mason prefix clang++ ${CLANG_VERSION})/bin:${PATH}
|
|
||||||
# we only enable lto for release builds
|
# we only enable lto for release builds
|
||||||
# and therefore don't need to us ld.gold or llvm tools for linking
|
# and therefore don't need to us ld.gold or llvm tools for linking
|
||||||
# for debug builds
|
# for debug builds
|
||||||
if [[ ${BUILD_TYPE} == 'Release' ]]; then
|
if [[ ${BUILD_TYPE} == 'Release' ]]; then
|
||||||
./third_party/mason/mason install binutils 2.27
|
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH}
|
||||||
export PATH=$(./third_party/mason/mason prefix binutils 2.27)/bin:${PATH}
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
||||||
@@ -171,6 +172,7 @@ install:
|
|||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
fi
|
fi
|
||||||
|
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
|
||||||
- popd
|
- popd
|
||||||
- mkdir example/build && pushd example/build
|
- mkdir example/build && pushd example/build
|
||||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||||
@@ -195,10 +197,6 @@ script:
|
|||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- |
|
|
||||||
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
|
||||||
./scripts/format.sh # we don't want to fail just yet
|
|
||||||
fi
|
|
||||||
- |
|
- |
|
||||||
if [ -n "${ENABLE_COVERAGE}" ]; then
|
if [ -n "${ENABLE_COVERAGE}" ]; then
|
||||||
bash <(curl -s https://codecov.io/bash)
|
bash <(curl -s https://codecov.io/bash)
|
||||||
|
|||||||
+47
-20
@@ -1,30 +1,57 @@
|
|||||||
# 5.5.4
|
|
||||||
- Changes from 5.5.3
|
# 5.6.2
|
||||||
|
- Changes from 5.6.0
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
- PR #3561 - added missing backwards speeds for cycleways in bicycle profile
|
- Fix incorrect forward datasources getter in facade
|
||||||
- PR #3515 - adjusted number of `nodes` in `annotation`
|
- Fix include `access=private` non-car roads in the car profile
|
||||||
- Ticket #3430 - Fix possible division by zero by clamping latitude to +/- 85.05
|
|
||||||
- PR #3555 - Fix an error that occurs when a road forks immediately after exiting a ferry
|
|
||||||
- PR #3575 - Don't emit invalid turn types for obvious turns at sliproads and roundabouts.
|
|
||||||
|
|
||||||
# 5.5.3
|
# 5.6.1
|
||||||
- Changes from 5.5.2
|
- Changes from 5.6.0
|
||||||
- Bugfixes:
|
- Bugfixes
|
||||||
- PR #3504 - debug tiles were very slow to generate due to unnecessarily copying data in a hot loop.
|
- Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
|
||||||
- PR #3556 - fix an assertion in the walking profile triggered by tight spiral stairwells
|
|
||||||
- PR #3469 - don't assert when identical coordinates are supplied to some calculations - OSM data contains these, we shouldn't crash.
|
|
||||||
- Enhancements:
|
|
||||||
- backported 6ea9f9fdf19 - when anticipating upcoming lanes, consider how many lanes need to be crossed to get there.
|
|
||||||
- when using osrm-datastore, it will attempt to clean up locks if it crashes.
|
|
||||||
|
|
||||||
# 5.5.2
|
# 5.6.0
|
||||||
- Changes from 5.5.1
|
- Changes from 5.5
|
||||||
- Revert smarter map-matching search radius. The increased radius causes performance degredation when map-matching against non-car road networks with more edges.
|
- Bugfixes
|
||||||
|
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
|
||||||
|
- Fix #3515 adjusted number of `nodes` in `annotation`
|
||||||
|
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
|
||||||
|
- Fix #2844 handle up to 16777215 code units in OSM names
|
||||||
|
- Infrastructure
|
||||||
|
- Support building rpm packages.
|
||||||
|
- Guidance
|
||||||
|
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
|
||||||
|
- Profiles
|
||||||
|
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
|
||||||
|
- `properties` object has a new `weight_name` field, default value is "duration"
|
||||||
|
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
|
||||||
|
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
|
||||||
|
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
|
||||||
|
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
|
||||||
|
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
|
||||||
|
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
|
||||||
|
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
|
||||||
|
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
|
||||||
|
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
|
||||||
|
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
|
||||||
|
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
|
||||||
|
- Infrastructure
|
||||||
|
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
|
||||||
|
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
|
||||||
|
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
|
||||||
|
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
|
||||||
|
- Tools:
|
||||||
|
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
|
||||||
|
- Trip Plugin
|
||||||
|
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
|
||||||
|
|
||||||
# 5.5.1
|
# 5.5.1
|
||||||
- Changes from 5.5.0
|
- Changes from 5.5.0
|
||||||
|
- API:
|
||||||
|
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
- Fixes #3455 where a deadlock could occur if re-loading new data under heavy load with multiple consumers osrm-datastore
|
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
|
||||||
|
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
|
||||||
|
|
||||||
# 5.5.0
|
# 5.5.0
|
||||||
- Changes from 5.4.0
|
- Changes from 5.4.0
|
||||||
|
|||||||
+88
-59
@@ -17,23 +17,22 @@ endif()
|
|||||||
option(ENABLE_MASON "Use mason for dependencies" OFF)
|
option(ENABLE_MASON "Use mason for dependencies" OFF)
|
||||||
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
||||||
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
||||||
option(BUILD_COMPONENTS "Build osrm-components" OFF)
|
option(BUILD_PACKAGE "Build OSRM package" OFF)
|
||||||
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
||||||
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
||||||
option(ENABLE_LTO "Use LTO if available" ON)
|
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)
|
||||||
|
|
||||||
if(ENABLE_MASON)
|
if(ENABLE_MASON)
|
||||||
# versions in use
|
# versions in use
|
||||||
set(MASON_BOOST_VERSION "1.61.0")
|
set(MASON_BOOST_VERSION "1.63.0")
|
||||||
set(MASON_STXXL_VERSION "1.4.1")
|
set(MASON_STXXL_VERSION "1.4.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")
|
||||||
set(MASON_LUABIND_VERSION "e414c57bcb687bb3091b7c55bbff6947f052e46b")
|
|
||||||
set(MASON_BZIP2_VERSION "1.0.6")
|
set(MASON_BZIP2_VERSION "1.0.6")
|
||||||
set(MASON_TBB_VERSION "43_20150316")
|
set(MASON_TBB_VERSION "2017_20161128")
|
||||||
|
|
||||||
message(STATUS "Enabling mason")
|
message(STATUS "Enabling mason")
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ endif()
|
|||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
set(OSRM_VERSION_MINOR 5)
|
set(OSRM_VERSION_MINOR 5)
|
||||||
set(OSRM_VERSION_PATCH 4)
|
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}")
|
||||||
|
|
||||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
@@ -77,6 +76,7 @@ endfunction(add_dependency_defines)
|
|||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
@@ -92,17 +92,22 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
|
|||||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
||||||
|
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||||
|
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||||
|
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)
|
||||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
|
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
|
||||||
|
|
||||||
add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
|
|
||||||
"-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}"
|
|
||||||
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FingerPrint-Config.cmake"
|
|
||||||
COMMENT "Configuring revision fingerprint"
|
|
||||||
VERBATIM)
|
|
||||||
|
|
||||||
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
|
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
@@ -123,7 +128,6 @@ add_library(STORAGE OBJECT ${StorageGlob})
|
|||||||
add_library(ENGINE OBJECT ${EngineGlob})
|
add_library(ENGINE OBJECT ${EngineGlob})
|
||||||
add_library(SERVER OBJECT ${ServerGlob})
|
add_library(SERVER OBJECT ${ServerGlob})
|
||||||
|
|
||||||
add_dependencies(UTIL FingerPrintConfigure)
|
|
||||||
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
|
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
|
||||||
add_executable(osrm-extract src/tools/extract.cpp)
|
add_executable(osrm-extract src/tools/extract.cpp)
|
||||||
@@ -228,7 +232,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
|||||||
find_program(GCC_AR gcc-ar)
|
find_program(GCC_AR gcc-ar)
|
||||||
find_program(GCC_RANLIB gcc-ranlib)
|
find_program(GCC_RANLIB gcc-ranlib)
|
||||||
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
||||||
message(WARNING "GCC specific binutils not found.")
|
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using GCC specific binutils for LTO:")
|
message(STATUS "Using GCC specific binutils for LTO:")
|
||||||
message(STATUS " ${GCC_AR}")
|
message(STATUS " ${GCC_AR}")
|
||||||
@@ -282,7 +286,7 @@ endif()
|
|||||||
|
|
||||||
# Configuring compilers
|
# Configuring compilers
|
||||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
|
||||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||||
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
||||||
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
||||||
@@ -290,7 +294,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|||||||
set(COLOR_FLAG "")
|
set(COLOR_FLAG "")
|
||||||
endif()
|
endif()
|
||||||
# using GCC
|
# using GCC
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
||||||
if(WIN32) # using mingw
|
if(WIN32) # using mingw
|
||||||
add_dependency_defines(-DWIN32)
|
add_dependency_defines(-DWIN32)
|
||||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||||
@@ -403,10 +407,6 @@ if(ENABLE_MASON)
|
|||||||
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
|
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
|
||||||
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
|
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
|
||||||
|
|
||||||
mason_use(luabind_lua524 VERSION ${MASON_LUABIND_VERSION})
|
|
||||||
add_dependency_includes(${MASON_PACKAGE_luabind_lua524_INCLUDE_DIRS})
|
|
||||||
set(LUABIND_LIBRARY ${MASON_PACKAGE_luabind_lua524_STATIC_LIBS})
|
|
||||||
|
|
||||||
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
|
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
|
||||||
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
|
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
|
||||||
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
|
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
|
||||||
@@ -434,10 +434,6 @@ if(ENABLE_MASON)
|
|||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
|
|
||||||
if(BUILD_COMPONENTS)
|
|
||||||
message(FATAL_ERROR "BUILD_COMPONENTS is not supported with ENABLE_MASON")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
|
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
||||||
|
|
||||||
@@ -447,18 +443,17 @@ if(ENABLE_MASON)
|
|||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||||
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
||||||
|
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
|
||||||
|
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(TBB REQUIRED)
|
find_package(TBB REQUIRED)
|
||||||
add_dependency_includes(${TBB_INCLUDE_DIR})
|
add_dependency_includes(${TBB_INCLUDE_DIR})
|
||||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
find_package(Luabind REQUIRED)
|
|
||||||
add_dependency_includes(${LUABIND_INCLUDE_DIR})
|
|
||||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
|
|
||||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
|
||||||
|
|
||||||
find_package(EXPAT REQUIRED)
|
find_package(EXPAT REQUIRED)
|
||||||
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
||||||
@@ -469,9 +464,32 @@ else()
|
|||||||
find_package(BZip2 REQUIRED)
|
find_package(BZip2 REQUIRED)
|
||||||
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
||||||
|
|
||||||
if(BUILD_COMPONENTS)
|
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||||
find_package(GDAL)
|
IF (LUA_FOUND)
|
||||||
endif()
|
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||||
|
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})
|
||||||
|
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||||
|
|
||||||
# add a target to generate API documentation with Doxygen
|
# add a target to generate API documentation with Doxygen
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
@@ -512,7 +530,6 @@ if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
|||||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||||
endif()
|
endif()
|
||||||
@@ -556,7 +573,6 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${EXPAT_LIBRARIES}
|
${EXPAT_LIBRARIES}
|
||||||
${LUABIND_LIBRARY}
|
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${OSMIUM_LIBRARIES}
|
${OSMIUM_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
@@ -566,7 +582,6 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
set(CONTRACTOR_LIBRARIES
|
set(CONTRACTOR_LIBRARIES
|
||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${LUABIND_LIBRARY}
|
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${STXXL_LIBRARY}
|
${STXXL_LIBRARY}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
@@ -597,33 +612,25 @@ target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
|
|||||||
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
||||||
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
||||||
|
|
||||||
if(BUILD_COMPONENTS)
|
# BUILD_COMPONENTS
|
||||||
if(GDAL_FOUND)
|
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
||||||
target_link_libraries(osrm-components ${TBB_LIBRARIES})
|
install(TARGETS osrm-components DESTINATION bin)
|
||||||
include_directories(SYSTEM ${GDAL_INCLUDE_DIR})
|
|
||||||
target_link_libraries(osrm-components ${GDAL_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
|
||||||
install(TARGETS osrm-components DESTINATION bin)
|
|
||||||
else()
|
|
||||||
message(WARNING "libgdal and/or development headers not found")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILD_TOOLS)
|
if(BUILD_TOOLS)
|
||||||
message(STATUS "Activating OSRM internal tools")
|
message(STATUS "Activating OSRM internal tools")
|
||||||
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
|
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
||||||
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
|
|
||||||
target_link_libraries(osrm-unlock-all ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
if(UNIX AND NOT APPLE)
|
|
||||||
target_link_libraries(osrm-unlock-all rt)
|
|
||||||
endif()
|
|
||||||
add_executable(osrm-springclean src/tools/springclean.cpp $<TARGET_OBJECTS:UTIL>)
|
|
||||||
target_link_libraries(osrm-springclean ${BOOST_BASE_LIBRARIES})
|
|
||||||
|
|
||||||
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
||||||
install(TARGETS osrm-unlock-all DESTINATION bin)
|
|
||||||
install(TARGETS osrm-springclean DESTINATION bin)
|
find_package(Shapefile) # package libshp-dev
|
||||||
|
if(Shapefile_FOUND)
|
||||||
|
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
|
||||||
|
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
|
||||||
|
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LIBSHAPEFILE_LIBRARY})
|
||||||
|
install(TARGETS osrm-extract-conditionals DESTINATION bin)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_ASSERTIONS)
|
if (ENABLE_ASSERTIONS)
|
||||||
@@ -664,11 +671,16 @@ install(TARGETS osrm_extract DESTINATION lib)
|
|||||||
install(TARGETS osrm_contract DESTINATION lib)
|
install(TARGETS osrm_contract DESTINATION lib)
|
||||||
install(TARGETS osrm_store DESTINATION lib)
|
install(TARGETS osrm_store DESTINATION lib)
|
||||||
|
|
||||||
|
|
||||||
|
# Install profiles and support library to /usr/local/share/osrm/profiles by default
|
||||||
|
set(DefaultProfilesDir profiles)
|
||||||
|
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
|
||||||
|
|
||||||
# Setup exporting variables for pkgconfig and subproject
|
# Setup exporting variables for pkgconfig and subproject
|
||||||
#
|
#
|
||||||
|
|
||||||
if(BUILD_DEBIAN_PACKAGE)
|
if(BUILD_PACKAGE)
|
||||||
include(CPackDebianConfig)
|
include(CPackConfig)
|
||||||
include(CPack)
|
include(CPack)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -706,7 +718,7 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
|
|||||||
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
|
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
|
||||||
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)
|
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
|
|
||||||
# uninstall target
|
# uninstall target
|
||||||
configure_file(
|
configure_file(
|
||||||
@@ -735,3 +747,20 @@ if (ENABLE_FUZZING)
|
|||||||
|
|
||||||
add_subdirectory(fuzz)
|
add_subdirectory(fuzz)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
## add headers sanity check target that includes all headers independently
|
||||||
|
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
|
||||||
|
file(GLOB_RECURSE headers_to_check
|
||||||
|
${PROJECT_BINARY_DIR}/*.hpp
|
||||||
|
${PROJECT_SOURCE_DIR}/include/*.hpp)
|
||||||
|
foreach(header ${headers_to_check})
|
||||||
|
get_filename_component(filename ${header} NAME_WE)
|
||||||
|
set(filename "${check_headers_dir}/${filename}.cpp")
|
||||||
|
if (NOT EXISTS ${filename})
|
||||||
|
file(WRITE ${filename} "#include \"${header}\"\n")
|
||||||
|
endif()
|
||||||
|
list(APPEND sources ${filename})
|
||||||
|
endforeach()
|
||||||
|
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
|
||||||
|
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
|
||||||
|
|||||||
@@ -7,6 +7,28 @@ You can add a :+1: emoji to the issue if you want to express interest in this.
|
|||||||
# Developer
|
# Developer
|
||||||
|
|
||||||
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
||||||
|
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
|
||||||
|
To save development time a local hook `.git/hooks/pre-push`
|
||||||
|
```
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
remote="$1"
|
||||||
|
if [ x"$remote" = xorigin ] ; then
|
||||||
|
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
|
||||||
|
echo "Rejected push to $remote/master" ; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
./scripts/format.sh
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
echo "Unstaged format changes" ; exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
could check code format, modify a local repository and reject push due to unstaged formatting changes.
|
||||||
|
Also `pre-push` hook rejects direct pushes to `origin/master`.
|
||||||
|
|
||||||
|
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
|
||||||
|
|
||||||
|
|
||||||
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
||||||
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
||||||
|
|||||||
@@ -1,64 +1,87 @@
|
|||||||
## About
|
## Open Source Routing Machine
|
||||||
|
|
||||||
The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
|
| Linux / macOS | Windows | Code Coverage |
|
||||||
|
| ------------- | ------- | ------------- |
|
||||||
|
| [](https://travis-ci.org/Project-OSRM/osrm-backend) | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||||
|
|
||||||
## Current build status
|
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
|
||||||
|
|
||||||
| build config | status |
|
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
|
||||||
|:-------------|:-------|
|
- Nearest - Snaps coordinates to the street network and returns the nearest matches
|
||||||
| Linux | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
- Route - Finds the fastest route between coordinates
|
||||||
| Windows | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
|
||||||
| Coverage | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
- Match - Snaps noisy GPS traces to the road network in the most plausible way
|
||||||
|
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
|
||||||
|
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
|
||||||
|
|
||||||
|
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
|
||||||
|
|
||||||
|
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
||||||
|
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
|
||||||
|
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
|
||||||
|
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
|
||||||
- IRC: server `irc.oftc.net`, channel: `#osrm` (see: `https://www.oftc.net`, and for a webchat: `https://webchat.oftc.net`)
|
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
|
||||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||||
|
|
||||||
## Building
|
## Quick Start
|
||||||
|
|
||||||
For instructions on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
The following targets Ubuntu 16.04.
|
||||||
|
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||||
|
|
||||||
To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
|
#### Install dependencies
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install build-essential git cmake pkg-config \
|
||||||
|
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
|
||||||
|
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Compile and install OSRM binaries:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
### Full documentation
|
### Full documentation
|
||||||
|
|
||||||
|
- [Hosted documentation](http://project-osrm.org)
|
||||||
- [osrm-routed HTTP API documentation](docs/http.md)
|
- [osrm-routed HTTP API documentation](docs/http.md)
|
||||||
- [libosrm API documentation](docs/libosrm.md)
|
- [libosrm API documentation](docs/libosrm.md)
|
||||||
|
|
||||||
### Quick start
|
|
||||||
|
|
||||||
Building OSRM assuming all dependencies are installed:
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir -p build
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
|
||||||
cmake --build .
|
|
||||||
sudo cmake --build . --target install
|
|
||||||
```
|
|
||||||
|
|
||||||
Loading preparing a dataset and starting the server:
|
|
||||||
|
|
||||||
```
|
|
||||||
osrm-extract data.osm.pbf -p profiles/car.lua
|
|
||||||
osrm-contract data.osrm
|
|
||||||
osrm-routed data.osrm
|
|
||||||
```
|
|
||||||
|
|
||||||
Running a query on your local server:
|
|
||||||
|
|
||||||
```
|
|
||||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
|
||||||
```
|
|
||||||
|
|
||||||
### Running a request against the Demo Server
|
### Running a request against the Demo Server
|
||||||
|
|
||||||
First 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).
|
||||||
|
Simple query with instructions and alternatives on Berlin:
|
||||||
Then run simple query with instructions and alternatives on Berlin:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||||
@@ -86,4 +109,3 @@ When using the code in a (scientific) publication, please cite
|
|||||||
address = {New York, NY, USA},
|
address = {New York, NY, USA},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+13
-2
@@ -10,10 +10,10 @@ ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
|||||||
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:"3.7.0" && GOTO CMAKE_OK
|
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
|
||||||
|
|
||||||
:CMAKE_NOT_OK
|
:CMAKE_NOT_OK
|
||||||
SET CMAKE_VERSION=3.7.0-rc2
|
SET CMAKE_VERSION=3.7.1
|
||||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||||
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 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
|
||||||
@@ -119,16 +119,27 @@ SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
|||||||
ECHO running extractor-tests.exe ...
|
ECHO running extractor-tests.exe ...
|
||||||
unit_tests\%Configuration%\extractor-tests.exe
|
unit_tests\%Configuration%\extractor-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO running engine-tests.exe ...
|
ECHO running engine-tests.exe ...
|
||||||
unit_tests\%Configuration%\engine-tests.exe
|
unit_tests\%Configuration%\engine-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO running util-tests.exe ...
|
ECHO running util-tests.exe ...
|
||||||
unit_tests\%Configuration%\util-tests.exe
|
unit_tests\%Configuration%\util-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO running server-tests.exe ...
|
ECHO running server-tests.exe ...
|
||||||
unit_tests\%Configuration%\server-tests.exe
|
unit_tests\%Configuration%\server-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
|
ECHO running library-tests.exe ...
|
||||||
|
SET test_region=monaco
|
||||||
|
SET test_osm=%test_region%.osm.pbf
|
||||||
|
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
|
||||||
|
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
||||||
|
%Configuration%\osrm-contract.exe %test_region%.osrm
|
||||||
|
unit_tests\%Configuration%\library-tests.exe %test_region%.osrm
|
||||||
|
|
||||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
||||||
ECHO ========= CREATING PACKAGES ==========
|
ECHO ========= CREATING PACKAGES ==========
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -3,6 +3,9 @@ environment:
|
|||||||
- configuration: Release
|
- configuration: Release
|
||||||
# - configuration: Debug
|
# - configuration: Debug
|
||||||
|
|
||||||
|
install:
|
||||||
|
- ps: Install-Product node 6
|
||||||
|
|
||||||
# scripts that are called at very beginning, before repo cloning
|
# scripts that are called at very beginning, before repo cloning
|
||||||
init:
|
init:
|
||||||
- git config --global core.autocrlf input
|
- git config --global core.autocrlf input
|
||||||
@@ -17,7 +20,14 @@ platform: x64
|
|||||||
build_script:
|
build_script:
|
||||||
- CALL appveyor-build.bat
|
- CALL appveyor-build.bat
|
||||||
|
|
||||||
test: off
|
before_test:
|
||||||
|
- node --version
|
||||||
|
- npm --version
|
||||||
|
- npm install
|
||||||
|
- npm link
|
||||||
|
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
|
||||||
|
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||||
|
- npm test
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: osrm_Release.zip
|
- path: osrm_Release.zip
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
|
||||||
|
ENDIF()
|
||||||
|
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
|
||||||
|
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
|
||||||
|
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||||
|
|
||||||
|
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
|
||||||
|
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
|
||||||
|
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
||||||
|
|
||||||
|
SET(CPACK_STRIP_FILES "TRUE")
|
||||||
|
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||||
|
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
|
||||||
|
|
||||||
|
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
||||||
|
if(DPKG_PROGRAM)
|
||||||
|
SET(CPACK_GENERATOR "DEB")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${DPKG_PROGRAM} --print-architecture
|
||||||
|
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
|
||||||
|
else(DPKG_PROGRAM)
|
||||||
|
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||||
|
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||||
|
if(RPMBUILD_PROGRAM)
|
||||||
|
SET(CPACK_GENERATOR "RPM")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${RPM_PROGRAM} --eval %{_arch}
|
||||||
|
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
||||||
|
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
|
||||||
|
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||||
|
endif(RPMBUILD_PROGRAM)
|
||||||
|
endif(DPKG_PROGRAM)
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
||||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
INCLUDE(FindDebArch)
|
|
||||||
|
|
||||||
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
|
||||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
|
|
||||||
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
|
||||||
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
|
|
||||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
|
|
||||||
|
|
||||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
|
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
|
||||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
|
|
||||||
|
|
||||||
# To create a proper Debian/Ubuntu package, the following CMake
|
|
||||||
# options should be used:
|
|
||||||
|
|
||||||
SET(CPACK_STRIP_FILES "TRUE")
|
|
||||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
|
||||||
SET(CPACK_GENERATOR "DEB")
|
|
||||||
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
|
|
||||||
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
|
|
||||||
)
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
|
|
||||||
|
|
||||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
|
||||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
|
|
||||||
|
|
||||||
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
|
|
||||||
+7
-1
@@ -172,12 +172,18 @@ if (LUA_LIBRARY)
|
|||||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||||
find_library(LUA_MATH_LIBRARY m)
|
find_library(LUA_MATH_LIBRARY m)
|
||||||
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||||
|
|
||||||
|
# include dl library for statically-linked Lua library
|
||||||
|
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
||||||
|
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
||||||
|
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||||
|
endif()
|
||||||
|
|
||||||
# For Windows and Mac, don't need to explicitly include the math library
|
# For Windows and Mac, don't need to explicitly include the math library
|
||||||
else ()
|
else ()
|
||||||
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
# Locate Luabind library
|
|
||||||
# This module defines
|
|
||||||
# LUABIND_FOUND, if false, do not try to link to Luabind
|
|
||||||
# LUABIND_LIBRARIES
|
|
||||||
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
|
|
||||||
|
|
||||||
# First we try using EXACT but in some verison of
|
|
||||||
# cmake this would also match patch versions
|
|
||||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
|
||||||
IF (LUA_FOUND)
|
|
||||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
|
||||||
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()
|
|
||||||
|
|
||||||
|
|
||||||
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
|
|
||||||
HINTS
|
|
||||||
$ENV{LUABIND_DIR}
|
|
||||||
PATH_SUFFIXES luabind include/luabind include
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local
|
|
||||||
/usr
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(LUABIND_LIBRARY
|
|
||||||
NAMES luabind luabind09
|
|
||||||
HINTS
|
|
||||||
$ENV{LUABIND_DIR}
|
|
||||||
PATH_SUFFIXES lib64 lib
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local
|
|
||||||
/usr
|
|
||||||
/opt/local
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(LUABIND_LIBRARY_DBG
|
|
||||||
NAMES luabindd
|
|
||||||
HINTS
|
|
||||||
$ENV{LUABIND_DIR}
|
|
||||||
PATH_SUFFIXES lib64 lib
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local
|
|
||||||
/usr
|
|
||||||
/opt/local
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(LUABIND_LIBRARY)
|
|
||||||
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
|
|
||||||
ENDIF(LUABIND_LIBRARY)
|
|
||||||
|
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
|
|
||||||
# all listed variables are TRUE
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
|
|
||||||
|
|
||||||
IF( NOT LUABIND_FIND_QUIETLY )
|
|
||||||
IF( LUABIND_FOUND )
|
|
||||||
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
|
|
||||||
ENDIF()
|
|
||||||
IF( LUABIND_LIBRARY_DBG )
|
|
||||||
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# - Try to find Shapefile C Library
|
||||||
|
# http://shapelib.maptools.org/
|
||||||
|
#
|
||||||
|
# Exports:
|
||||||
|
# Shapefile_FOUND
|
||||||
|
# LIBSHAPEFILE_INCLUDE_DIR
|
||||||
|
# LIBSHAPEFILE_LIBRARY
|
||||||
|
# Hints:
|
||||||
|
# LIBSHAPEFILE_LIBRARY_DIR
|
||||||
|
|
||||||
|
find_path(LIBSHAPEFILE_INCLUDE_DIR
|
||||||
|
shapefil.h)
|
||||||
|
|
||||||
|
find_library(LIBSHAPEFILE_LIBRARY
|
||||||
|
NAMES shp
|
||||||
|
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Shapefile DEFAULT_MSG
|
||||||
|
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
|
|
||||||
set(NEWFILE ${OLDFILE}.tmp)
|
|
||||||
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
|
|
||||||
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
|
|
||||||
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
|
|
||||||
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
|
|
||||||
file(MD5 ${SOURCE_DIR}/src/storage/storage.cpp MD5OBJECTS)
|
|
||||||
|
|
||||||
CONFIGURE_FILE(${INFILE} ${NEWFILE})
|
|
||||||
|
|
||||||
file(MD5 ${NEWFILE} MD5NEW)
|
|
||||||
|
|
||||||
if (EXISTS ${OLDFILE})
|
|
||||||
file(MD5 ${OLDFILE} MD5OLD)
|
|
||||||
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
|
|
||||||
file(REMOVE_RECURSE ${OLDFILE})
|
|
||||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
|
||||||
else()
|
|
||||||
file(REMOVE_RECURSE ${NEWFILE})
|
|
||||||
message(STATUS "Fingerprint unchanged, not regenerating")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
|
||||||
endif()
|
|
||||||
+1
-1
@@ -2,7 +2,7 @@ FROM ubuntu:14.04
|
|||||||
|
|
||||||
RUN apt-get update -y && apt-get install -y software-properties-common
|
RUN apt-get update -y && apt-get install -y software-properties-common
|
||||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
|
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||||
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libluabind-dev libboost-all-dev ccache
|
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libboost-all-dev ccache
|
||||||
RUN apt-get -y install curl cmake cmake-curses-gui git
|
RUN apt-get -y install curl cmake cmake-curses-gui git
|
||||||
|
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we pro
|
|||||||
|
|
||||||
The initialisation to do so looks like this:
|
The initialisation to do so looks like this:
|
||||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
||||||
|
Make sure to give the guar a name, so it actually gets a lifetime.
|
||||||
|
|
||||||
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
|
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
|
||||||
|
|
||||||
|
|||||||
+90
-44
@@ -24,11 +24,12 @@ To pass parameters to each location some options support an array like encoding:
|
|||||||
|
|
||||||
**Request options**
|
**Request options**
|
||||||
|
|
||||||
| Option | Values | Description |
|
| Option | Values | Description |
|
||||||
|------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|
|----------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|
||||||
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|
||||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|
||||||
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
|
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|
||||||
|
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
|
||||||
|
|
||||||
Where the elements follow the following format:
|
Where the elements follow the following format:
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@t
|
|||||||
|
|
||||||
### Responses
|
### Responses
|
||||||
|
|
||||||
Every response object has a `code` field containing one of the strings below or a service dependent code:
|
Every response object has a `code` property containing one of the strings below or a service dependent code:
|
||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
|-------------------|----------------------------------------------------------------------------------|
|
|-------------------|----------------------------------------------------------------------------------|
|
||||||
@@ -171,10 +172,10 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
||||||
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|
||||||
|steps |`true`, `false` (default) |Return route steps for each route leg |
|
|steps |`true`, `false` (default) |Return route steps for each route leg |
|
||||||
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
||||||
|
|
||||||
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
|
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
|
||||||
|
|
||||||
@@ -190,7 +191,7 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|-------------------|-----------------|
|
|-------------------|-----------------|
|
||||||
| `NoRoute` | No route found. |
|
| `NoRoute` | No route found. |
|
||||||
|
|
||||||
All other fields might be undefined.
|
All other properties might be undefined.
|
||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
@@ -256,7 +257,7 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|-------------------|-----------------|
|
|-------------------|-----------------|
|
||||||
| `NoTable` | No route found. |
|
| `NoTable` | No route found. |
|
||||||
|
|
||||||
All other fields might be undefined.
|
All other properties might be undefined.
|
||||||
|
|
||||||
### Match service
|
### Match service
|
||||||
|
|
||||||
@@ -274,7 +275,7 @@ In addition to the [general options](#general-options) the following options are
|
|||||||
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
||||||
|steps |`true`, `false` (default) |Return route steps for each route |
|
|steps |`true`, `false` (default) |Return route steps for each route |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|
||||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
||||||
@@ -306,31 +307,66 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|-------------------|---------------------|
|
|-------------------|---------------------|
|
||||||
| `NoMatch` | No matchings found. |
|
| `NoMatch` | No matchings found. |
|
||||||
|
|
||||||
All other fields might be undefined.
|
All other properties might be undefined.
|
||||||
|
|
||||||
### Trip service
|
### Trip service
|
||||||
|
|
||||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
|
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints.
|
||||||
The returned path does not have to be the fastest path, as TSP is NP-hard it is only an approximation.
|
The returned path does not have to be the fastest path. As TSP is NP-hard it only returns an approximation.
|
||||||
Note that if the input coordinates can not be joined by a single trip (e.g. the coordinates are on several disconnected islands)
|
Note that all input coordinates have to be connected for the trip service to work.
|
||||||
multiple trips for each connected component are returned.
|
|
||||||
|
|
||||||
```endpoint
|
```endpoint
|
||||||
GET /trip/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
|
GET /trip/v1/{profile}/{coordinates}?roundtrip={true|false}&source{any|first}&destination{any|last}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||||
|
|
||||||
|Option |Values |Description |
|
|Option |Values |Description |
|
||||||
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|
||||||
|
|roundtrip |`true` (default), `false` |Return route is a roundtrip |
|
||||||
|
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|
||||||
|
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|
||||||
|steps |`true`, `false` (default) |Return route instructions for each trip |
|
|steps |`true`, `false` (default) |Return route instructions for each trip |
|
||||||
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||||
|
|
||||||
**Response**
|
**Fixing Start and End Points**
|
||||||
|
|
||||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
It is possible to explicitely set the start or end coordinate of the trip.
|
||||||
|
When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
|
||||||
|
|
||||||
|
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
|
||||||
|
|
||||||
|
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
|
||||||
|
Right now, the following combinations are possible:
|
||||||
|
|
||||||
|
| roundtrip | source | destination | supported |
|
||||||
|
| :-- | :-- | :-- | :-- |
|
||||||
|
| true | first | last | **yes** |
|
||||||
|
| true | first | any | **yes** |
|
||||||
|
| true | any | last | **yes** |
|
||||||
|
| true | any | any | **yes** |
|
||||||
|
| false | first | last | **yes** |
|
||||||
|
| false | first | any | no |
|
||||||
|
| false | any | last | no |
|
||||||
|
| false | any | any | no |
|
||||||
|
|
||||||
|
#### Example Requests
|
||||||
|
|
||||||
|
```curl
|
||||||
|
# Round trip in Berlin with three stops:
|
||||||
|
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
|
||||||
|
```
|
||||||
|
|
||||||
|
```curl
|
||||||
|
# Round trip in Berlin with four stops, starting at the first stop, ending at the last:
|
||||||
|
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=last'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Response
|
||||||
|
|
||||||
|
- `code`: if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||||
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
|
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
|
||||||
- `trips_index`: Index to `trips` of the sub-trip the point was matched to.
|
- `trips_index`: Index to `trips` of the sub-trip the point was matched to.
|
||||||
- `waypoint_index`: Index of the point in the trip.
|
- `waypoint_index`: Index of the point in the trip.
|
||||||
@@ -340,9 +376,10 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
|-------------------|---------------------|
|
|-------------------|---------------------|
|
||||||
| `NoTrips` | No trips found. |
|
| `NoTrips` | No trips found because input coordinates are not connected.|
|
||||||
|
| `NotImplemented` | This request is not supported |
|
||||||
|
|
||||||
All other fields might be undefined.
|
All other properties might be undefined.
|
||||||
|
|
||||||
### Tile service
|
### Tile service
|
||||||
|
|
||||||
@@ -372,7 +409,7 @@ Vector tiles contain two layers:
|
|||||||
|
|
||||||
`speeds` layer:
|
`speeds` layer:
|
||||||
|
|
||||||
| Field | Type | Description |
|
| Property | Type | Description |
|
||||||
| ------------ | --------- | ---------------------------------------- |
|
| ------------ | --------- | ---------------------------------------- |
|
||||||
| `speed` | `integer` | the speed on that road segment, in km/h |
|
| `speed` | `integer` | the speed on that road segment, in km/h |
|
||||||
| `is_small` | `boolean` | whether this segment belongs to a small (< 1000 node) [strongly connected component](https://en.wikipedia.org/wiki/Strongly_connected_component) |
|
| `is_small` | `boolean` | whether this segment belongs to a small (< 1000 node) [strongly connected component](https://en.wikipedia.org/wiki/Strongly_connected_component) |
|
||||||
@@ -382,7 +419,7 @@ Vector tiles contain two layers:
|
|||||||
|
|
||||||
`turns` layer:
|
`turns` layer:
|
||||||
|
|
||||||
| Field | Type | Description |
|
| Property | Type | Description |
|
||||||
| ------------ | --------- | ---------------------------------------- |
|
| ------------ | --------- | ---------------------------------------- |
|
||||||
| `bearing_in` | `integer` | the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East |
|
| `bearing_in` | `integer` | the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East |
|
||||||
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
|
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
|
||||||
@@ -399,7 +436,9 @@ Represents a route through (potentially multiple) waypoints.
|
|||||||
|
|
||||||
- `distance`: The distance traveled by the route, in `float` meters.
|
- `distance`: The distance traveled by the route, in `float` meters.
|
||||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||||
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` field for a parameter documentation.
|
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` property for a parameter documentation.
|
||||||
|
- `weight`: The calculated weight of the route.
|
||||||
|
- `weight_name`: The name of the weight profile used during extraction phase.
|
||||||
|
|
||||||
| overview | Description |
|
| overview | Description |
|
||||||
|------------|-----------------------------|
|
|------------|-----------------------------|
|
||||||
@@ -417,6 +456,8 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
|
|||||||
{
|
{
|
||||||
"distance": 90.0,
|
"distance": 90.0,
|
||||||
"duration": 300.0,
|
"duration": 300.0,
|
||||||
|
"weight": 300.0,
|
||||||
|
"weight_name": "duration",
|
||||||
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
|
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
|
||||||
"legs": [
|
"legs": [
|
||||||
{
|
{
|
||||||
@@ -441,6 +482,7 @@ Represents a route between two waypoints.
|
|||||||
|
|
||||||
- `distance`: The distance traveled by this route leg, in `float` meters.
|
- `distance`: The distance traveled by this route leg, in `float` meters.
|
||||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||||
|
- `weight`: The calculated weight of the route leg.
|
||||||
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
|
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
|
||||||
|
|
||||||
| steps | |
|
| steps | |
|
||||||
@@ -459,8 +501,8 @@ Represents a route between two waypoints.
|
|||||||
|
|
||||||
| annotations | |
|
| annotations | |
|
||||||
|--------------|-----------------------------------------------------------------------|
|
|--------------|-----------------------------------------------------------------------|
|
||||||
| true | An `Annotation` object containing node ids, durations and distances |
|
| true | An `Annotation` object containing node ids, durations distances and |
|
||||||
| false | `undefined` |
|
| false | weights `undefined` |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -470,12 +512,14 @@ With `steps=false` and `annotations=true`:
|
|||||||
{
|
{
|
||||||
"distance": 30.0,
|
"distance": 30.0,
|
||||||
"duration": 100.0,
|
"duration": 100.0,
|
||||||
|
"weight": 100.0,
|
||||||
"steps": [],
|
"steps": [],
|
||||||
"annotation": {
|
"annotation": {
|
||||||
"distance": [5,5,10,5,5],
|
"distance": [5,5,10,5,5],
|
||||||
"duration": [15,15,40,15,15],
|
"duration": [15,15,40,15,15],
|
||||||
"datasources": [1,0,0,0,1],
|
"datasources": [1,0,0,0,1],
|
||||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||||
|
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -490,6 +534,8 @@ Annotation of the whole route leg with fine-grained information about each segme
|
|||||||
- `duration`: The duration between each pair of coordinates, in seconds
|
- `duration`: The duration between each pair of coordinates, in seconds
|
||||||
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
||||||
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
||||||
|
- `weight`: The weights between each pair of coordinates
|
||||||
|
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -498,7 +544,8 @@ Annotation of the whole route leg with fine-grained information about each segme
|
|||||||
"distance": [5,5,10,5,5],
|
"distance": [5,5,10,5,5],
|
||||||
"duration": [15,15,40,15,15],
|
"duration": [15,15,40,15,15],
|
||||||
"datasources": [1,0,0,0,1],
|
"datasources": [1,0,0,0,1],
|
||||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||||
|
"weight": [15,15,40,15,15]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -514,6 +561,7 @@ step.
|
|||||||
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
|
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
|
||||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||||
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
|
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
|
||||||
|
- `weight`: The calculated weight of the step.
|
||||||
|
|
||||||
| `geometry` | |
|
| `geometry` | |
|
||||||
|------------|--------------------------------------------------------------------|
|
|------------|--------------------------------------------------------------------|
|
||||||
@@ -528,6 +576,8 @@ step.
|
|||||||
- `mode`: A string signifying the mode of transportation.
|
- `mode`: A string signifying the mode of transportation.
|
||||||
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
||||||
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
||||||
|
- `rotary_name`: The name for the rotary. Optionally included, if the step is a rotary and a rotary name is available.
|
||||||
|
- `rotary_pronunciation`: The pronunciation hint of the rotary name. Optionally included, if the step is a rotary and a rotary pronunciation is available.
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -536,6 +586,7 @@ step.
|
|||||||
"geometry" : "{lu_IypwpAVrAvAdI",
|
"geometry" : "{lu_IypwpAVrAvAdI",
|
||||||
"mode" : "driving",
|
"mode" : "driving",
|
||||||
"duration" : 15.6,
|
"duration" : 15.6,
|
||||||
|
"weight" : 15.6,
|
||||||
"intersections" : [
|
"intersections" : [
|
||||||
{ "bearings" : [ 10, 92, 184, 270 ],
|
{ "bearings" : [ 10, 92, 184, 270 ],
|
||||||
"lanes" : [
|
"lanes" : [
|
||||||
@@ -577,11 +628,11 @@ step.
|
|||||||
|
|
||||||
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
||||||
- `bearing_before`: The clockwise angle from true north to the
|
- `bearing_before`: The clockwise angle from true north to the
|
||||||
direction of travel immediately before the maneuver.
|
direction of travel immediately before the maneuver. Range 0-359.
|
||||||
- `bearing_after`: The clockwise angle from true north to the
|
- `bearing_after`: The clockwise angle from true north to the
|
||||||
direction of travel immediately after the maneuver.
|
direction of travel immediately after the maneuver. Range 0-359.
|
||||||
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
|
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
|
||||||
Types unknown to the client should be handled like the `turn` type, the existance of correct `modifier` values is guranteed.
|
Types unknown to the client should be handled like the `turn` type, the existence of correct `modifier` values is guranteed.
|
||||||
|
|
||||||
| `type` | Description |
|
| `type` | Description |
|
||||||
|------------------|--------------------------------------------------------------|
|
|------------------|--------------------------------------------------------------|
|
||||||
@@ -597,8 +648,8 @@ step.
|
|||||||
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
||||||
| `use lane` | going straight on a specific lane |
|
| `use lane` | going straight on a specific lane |
|
||||||
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
||||||
| `roundabout` | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
|
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
|
||||||
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name/rotary_pronunciation` in addition to the `exit` parameter. |
|
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |
|
||||||
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
|
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
|
||||||
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
|
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
|
||||||
|
|
||||||
@@ -620,19 +671,15 @@ step.
|
|||||||
|
|
||||||
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
|
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
|
||||||
|
|
||||||
The meaning depends on the `type` field.
|
The meaning depends on the `type` property.
|
||||||
|
|
||||||
| `type` | Description |
|
| `type` | Description |
|
||||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
|
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
|
||||||
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
|
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
|
||||||
|
|
||||||
- `exit` An optional `integer` indicating number of the exit to take. The field exists for the following `type` field:
|
- `exit` An optional `integer` indicating number of the exit to take. The property exists for the `roundabout` / `rotary` property:
|
||||||
|
Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout.
|
||||||
| `type` | Description |
|
|
||||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `roundabout`/`rotary` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
|
|
||||||
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
|
|
||||||
|
|
||||||
|
|
||||||
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
||||||
@@ -676,7 +723,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
**Properties**
|
**Properties**
|
||||||
|
|
||||||
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
||||||
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection.
|
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
|
||||||
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
|
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
|
||||||
`false` indicates that the turn onto the respective road would violate a restriction.
|
`false` indicates that the turn onto the respective road would violate a restriction.
|
||||||
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
|
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
|
||||||
@@ -694,7 +741,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
"in":0,
|
"in":0,
|
||||||
"out":2,
|
"out":2,
|
||||||
"bearings":[60,150,240,330],
|
"bearings":[60,150,240,330],
|
||||||
"entry":["false","true","true","true"]
|
"entry":["false","true","true","true"],
|
||||||
"lanes":{
|
"lanes":{
|
||||||
"indications": ["left", "straight"],
|
"indications": ["left", "straight"],
|
||||||
"valid": "false"
|
"valid": "false"
|
||||||
@@ -710,7 +757,6 @@ Object used to describe waypoint on a route.
|
|||||||
|
|
||||||
- `name` Name of the street the coordinate snapped to
|
- `name` Name of the street the coordinate snapped to
|
||||||
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
|
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
|
||||||
- `distance` The distance of the snapped point from the original
|
|
||||||
- `hint` Unique internal identifier of the segment (ephemeral, not constant over data updates)
|
- `hint` Unique internal identifier of the segment (ephemeral, not constant over data updates)
|
||||||
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
|
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
|
||||||
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
|
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
|
||||||
|
|||||||
+24
-1
@@ -1,6 +1,6 @@
|
|||||||
# Testsuite
|
# Testsuite
|
||||||
|
|
||||||
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucucmber.js for scenario driven testing.
|
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing.
|
||||||
|
|
||||||
## Unit Tests
|
## Unit Tests
|
||||||
|
|
||||||
@@ -28,6 +28,29 @@ This dataset is a small extract and may not even contain all tags or edge cases.
|
|||||||
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
|
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
|
||||||
See the library tests for how to add new dataset dependent tests.
|
See the library tests for how to add new dataset dependent tests.
|
||||||
|
|
||||||
|
To prepare the test data simply `cd test/data/` and then run `make`.
|
||||||
|
|
||||||
|
### Running Tests
|
||||||
|
|
||||||
|
To build the unit tests:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
make tests
|
||||||
|
```
|
||||||
|
|
||||||
|
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
|
||||||
|
|
||||||
|
```
|
||||||
|
./engine-tests
|
||||||
|
```
|
||||||
|
|
||||||
|
For `library-tests` you will need to provide a path to the test data:
|
||||||
|
|
||||||
|
```
|
||||||
|
./library-tests ../../test/data/monaco.osrm
|
||||||
|
```
|
||||||
|
|
||||||
## Cucumber
|
## Cucumber
|
||||||
|
|
||||||
|
|||||||
@@ -182,3 +182,18 @@ Feature: Bike - Access tags on ways
|
|||||||
| bridleway | | yes | | x |
|
| bridleway | | yes | | x |
|
||||||
| bridleway | designated | | | |
|
| bridleway | designated | | | |
|
||||||
| bridleway | | | | |
|
| bridleway | | | | |
|
||||||
|
|
||||||
|
Scenario: Bike - Tram with oneway when access is implicit
|
||||||
|
Then routability should be
|
||||||
|
| highway | railway | access | oneway | bothw |
|
||||||
|
| residential | tram | | yes | x |
|
||||||
|
| service | tram | psv | yes | x |
|
||||||
|
|
||||||
|
Scenario: Bike - Access combinations
|
||||||
|
Then routability should be
|
||||||
|
| highway | access | bothw |
|
||||||
|
| primary | permissive | x |
|
||||||
|
| steps | permissive | x |
|
||||||
|
| footway | permissive | x |
|
||||||
|
| garbagetag | permissive | x |
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ Feature: Bicycle - Handle cycling
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
||||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
||||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||||
|
|||||||
@@ -64,6 +64,6 @@ Feature: Bike - Handle ferry routes
|
|||||||
| abcd | | ferry | yes | 1:00 |
|
| abcd | | ferry | yes | 1:00 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | d | abcd,abcd | 3600s +-10 |
|
| a | d | abcd,abcd | 3600s |
|
||||||
| d | a | abcd,abcd | 3600s +-10 |
|
| d | a | abcd,abcd | 3600s |
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ Feature: Bike - Max speed restrictions
|
|||||||
|
|
||||||
Scenario: Bicycle - Respect maxspeeds when lower that way type speed
|
Scenario: Bicycle - Respect maxspeeds when lower that way type speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | bothw |
|
| highway | maxspeed | bothw |
|
||||||
| residential | | 15 km/h +- 1 |
|
| residential | | 15 km/h |
|
||||||
| residential | 10 | 10 km/h +- 1 |
|
| residential | 10 | 9 km/h |
|
||||||
|
|
||||||
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | bothw |
|
| highway | maxspeed | bothw |
|
||||||
| residential | | 15 km/h +- 1 |
|
| residential | | 15 km/h |
|
||||||
| residential | 80 | 15 km/h |
|
| residential | 80 | 15 km/h |
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
Scenario: Bicycle - Maxspeed formats
|
Scenario: Bicycle - Maxspeed formats
|
||||||
@@ -63,14 +63,14 @@ Feature: Bike - Max speed restrictions
|
|||||||
| snail | 720s ~10% |
|
| snail | 720s ~10% |
|
||||||
|
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||||
| | | | 15 km/h +- 1 | 15 km/h +- 1 |
|
| | | | 15 km/h | 15 km/h |
|
||||||
| 10 | | | 10 km/h +- 1 | 10 km/h +- 1 |
|
| 10 | | | 9 km/h | 9 km/h |
|
||||||
| | 10 | | 10 km/h +- 1 | 15 km/h +- 1 |
|
| | 10 | | 9 km/h | 15 km/h |
|
||||||
| | | 10 | 15 km/h | 10 km/h +- 1 |
|
| | | 10 | 14 km/h | 9 km/h |
|
||||||
| 2 | 10 | | 10 km/h +- 1 | 2 km/h |
|
| 2 | 10 | | 9 km/h | 2 km/h |
|
||||||
| 2 | | 10 | 2 km/h | 10 km/h +- 1 |
|
| 2 | | 10 | 2 km/h | 9 km/h |
|
||||||
| 2 | 5 | 10 | 5 km/h | 10 km/h +- 1 |
|
| 2 | 5 | 10 | 5 km/h | 9 km/h |
|
||||||
|
|
||||||
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -6,27 +6,28 @@ Feature: Bike - Surfaces
|
|||||||
|
|
||||||
Scenario: Bicycle - Slow surfaces
|
Scenario: Bicycle - Slow surfaces
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | surface | bothw |
|
| highway | surface | bothw |
|
||||||
| cycleway | | 48 s |
|
| cycleway | | 48 s |
|
||||||
| cycleway | asphalt | 47.9 s|
|
| cycleway | asphalt | 48 s |
|
||||||
| cycleway | cobblestone:flattened | 72 s |
|
| cycleway | cobblestone:flattened | 72 s |
|
||||||
| cycleway | paving_stones | 72 s |
|
| cycleway | paving_stones | 72 s |
|
||||||
| cycleway | compacted | 72 s |
|
| cycleway | compacted | 72 s |
|
||||||
| cycleway | cobblestone | 120 s |
|
| cycleway | cobblestone | 120 s |
|
||||||
| cycleway | fine_gravel | 120 s |
|
| cycleway | fine_gravel | 120 s |
|
||||||
| cycleway | gravel | 120 s |
|
| cycleway | gravel | 120 s |
|
||||||
| cycleway | pebblestone | 120 s |
|
| cycleway | pebblestone | 120.1 s |
|
||||||
| cycleway | dirt | 120 s |
|
| cycleway | dirt | 120 s |
|
||||||
| cycleway | earth | 120 s |
|
| cycleway | earth | 120 s |
|
||||||
| cycleway | grass | 120 s |
|
| cycleway | grass | 120 s |
|
||||||
| cycleway | mud | 240 s |
|
| cycleway | mud | 240 s |
|
||||||
| cycleway | sand | 240 s |
|
| cycleway | sand | 240.1 s |
|
||||||
|
| cycleway | sett | 72 s |
|
||||||
|
|
||||||
Scenario: Bicycle - Good surfaces on small paths
|
Scenario: Bicycle - Good surfaces on small paths
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | surface | bothw |
|
| highway | surface | bothw |
|
||||||
| cycleway | | 48 s |
|
| cycleway | | 48 s |
|
||||||
| path | | 59.9 s|
|
| path | | 60 s |
|
||||||
| track | | 60 s |
|
| track | | 60 s |
|
||||||
| track | asphalt | 60 s |
|
| track | asphalt | 60 s |
|
||||||
| path | asphalt | 60 s |
|
| path | asphalt | 60 s |
|
||||||
|
|||||||
+112
-41
@@ -119,12 +119,13 @@ Feature: Car - Restricted access
|
|||||||
| permissive | x |
|
| permissive | x |
|
||||||
| designated | x |
|
| designated | x |
|
||||||
| no | |
|
| no | |
|
||||||
| private | |
|
| private | x |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestry | |
|
||||||
| psv | |
|
| psv | |
|
||||||
| delivery | |
|
| delivery | x |
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
| destination | x |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Car - Access tags on nodes
|
Scenario: Car - Access tags on nodes
|
||||||
@@ -134,11 +135,11 @@ Feature: Car - Restricted access
|
|||||||
| permissive | x |
|
| permissive | x |
|
||||||
| designated | x |
|
| designated | x |
|
||||||
| no | |
|
| no | |
|
||||||
| private | |
|
| private | x |
|
||||||
| agricultural | |
|
| agricultural | |
|
||||||
| forestry | |
|
| forestry | |
|
||||||
| psv | |
|
| psv | |
|
||||||
| delivery | |
|
| delivery | x |
|
||||||
| some_tag | x |
|
| some_tag | x |
|
||||||
|
|
||||||
Scenario: Car - Access tags on both node and way
|
Scenario: Car - Access tags on both node and way
|
||||||
@@ -156,15 +157,15 @@ Feature: Car - Restricted access
|
|||||||
|
|
||||||
Scenario: Car - Access combinations
|
Scenario: Car - Access combinations
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
|
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
|
||||||
| runway | private | | | permissive | x |
|
| runway | private | | | permissive | x | x | |
|
||||||
| primary | forestry | | yes | | x |
|
| primary | forestry | | yes | | x | x | |
|
||||||
| cycleway | | | designated | | x |
|
| cycleway | | | designated | | x | x | |
|
||||||
| residential | | yes | no | | |
|
| residential | | yes | no | | | | |
|
||||||
| motorway | yes | permissive | | private | |
|
| motorway | yes | permissive | | private | x | | implied oneway |
|
||||||
| trunk | agricultural | designated | permissive | no | |
|
| trunk | agricultural | designated | permissive | no | | | |
|
||||||
| pedestrian | | | | | |
|
| pedestrian | | | | | | | |
|
||||||
| pedestrian | | | | destination | x |
|
| 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
|
||||||
@@ -179,34 +180,45 @@ Feature: Car - Restricted access
|
|||||||
| primary | | | | no | x |
|
| primary | | | | no | x |
|
||||||
|
|
||||||
@hov
|
@hov
|
||||||
Scenario: Car - only designated HOV ways are ignored by default
|
Scenario: Car - designated HOV ways are rated low
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | hov | bothw |
|
| highway | hov | bothw | forw_rate | backw_rate |
|
||||||
| primary | designated | |
|
| primary | designated | x | 18 | 18 |
|
||||||
| primary | yes | x |
|
| primary | yes | x | 18 | 18 |
|
||||||
| primary | no | x |
|
| primary | no | x | 18 | 18 |
|
||||||
|
|
||||||
|
# Models:
|
||||||
|
# https://www.openstreetmap.org/way/124891268
|
||||||
|
# https://www.openstreetmap.org/way/237173472
|
||||||
|
@hov
|
||||||
|
Scenario: Car - I-66 use HOV-only roads with heavy penalty
|
||||||
|
Then routability should be
|
||||||
|
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
|
||||||
|
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
|
||||||
|
| motorway | lane | | 3 | designated | yes | x | | 25 |
|
||||||
|
|
||||||
@hov
|
@hov
|
||||||
Scenario: Car - a way with all lanes HOV-designated is inaccessible by default (similar to hov=designated)
|
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw |
|
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | designated | designated | | | | |
|
| primary | designated | designated | | | x | x | 18 | 18 |
|
||||||
| primary | | designated | | | x | |
|
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
||||||
| primary | designated | | | | | x |
|
#| primary | | designated | | | x | x | 18 | 18 |
|
||||||
| primary | designated\|designated | designated\|designated | | | | |
|
#| primary | designated | | | | x | x | 18 | 18 |
|
||||||
| primary | designated\|no | designated\|no | | | x | x |
|
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
|
||||||
| primary | yes\|no | yes\|no | | | x | x |
|
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
|
||||||
| primary | | | | | x | x |
|
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
|
||||||
| primary | designated | | | -1 | | x |
|
| primary | | | | | x | x | 18 | 18 |
|
||||||
| primary | | designated | | -1 | | |
|
| primary | designated | | | -1 | | x | | 18 |
|
||||||
| primary | | | designated | yes | | |
|
| primary | | designated | | -1 | | x | | 18 |
|
||||||
| primary | | | designated | -1 | | |
|
| primary | | | designated | yes | x | | 18 | |
|
||||||
| primary | | | designated\| | yes | x | |
|
| primary | | | designated | -1 | | x | | 18 |
|
||||||
| primary | | | designated\| | -1 | | x |
|
| primary | | | designated\| | yes | x | | 18 | |
|
||||||
| primary | | | designated\|designated | yes | | |
|
| primary | | | designated\| | -1 | | x | | 18 |
|
||||||
| primary | | | designated\|designated | -1 | | |
|
| primary | | | designated\|designated | yes | x | | 18 | |
|
||||||
| primary | | | designated\|yes | yes | x | |
|
| primary | | | designated\|designated | -1 | | x | | 18 |
|
||||||
| primary | | | designated\|no | -1 | | x |
|
| primary | | | designated\|yes | yes | x | | 18 | |
|
||||||
|
| primary | | | designated\|no | -1 | | x | | 18 |
|
||||||
|
|
||||||
Scenario: Car - these toll roads always work
|
Scenario: Car - these toll roads always work
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -214,12 +226,10 @@ Feature: Car - Restricted access
|
|||||||
| primary | no | x |
|
| primary | no | x |
|
||||||
| primary | snowmobile | x |
|
| primary | snowmobile | x |
|
||||||
|
|
||||||
# To test this we need issue #2781
|
Scenario: Car - toll=yes ways are enabled by default
|
||||||
@todo
|
|
||||||
Scenario: Car - only toll=yes ways are ignored by default
|
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | toll | bothw |
|
| highway | toll | bothw |
|
||||||
| primary | yes | |
|
| primary | yes | x |
|
||||||
|
|
||||||
Scenario: Car - directional access tags
|
Scenario: Car - directional access tags
|
||||||
Then routability should be
|
Then routability should be
|
||||||
@@ -232,3 +242,64 @@ Feature: Car - Restricted access
|
|||||||
| primary | no | | yes | | x |
|
| primary | no | | yes | | x |
|
||||||
| primary | no | yes | | x | |
|
| primary | no | yes | | x | |
|
||||||
| primary | no | yes | yes | x | x |
|
| primary | no | yes | yes | x | x |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
|
||||||
|
Then routability should be
|
||||||
|
| node/barrier | access | bothw |
|
||||||
|
| gate | | x |
|
||||||
|
| gate | no | |
|
||||||
|
| gate | yes | x |
|
||||||
|
| gate | permissive | x |
|
||||||
|
| gate | designated | x |
|
||||||
|
| gate | private | x |
|
||||||
|
| gate | garbagetag | x |
|
||||||
|
|
||||||
|
Scenario: Car - a way with conditional access
|
||||||
|
Then routability should be
|
||||||
|
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
|
||||||
|
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
|
||||||
|
|
||||||
|
Scenario: Car - a way with a list of tags
|
||||||
|
Then routability should be
|
||||||
|
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw | # |
|
||||||
|
| primary | | no | destination | | x | |
|
||||||
|
| primary | destination;agricultural | destination | | x | x | |
|
||||||
|
| footway | | | destination | | | temporary #3373 |
|
||||||
|
| track | destination;agricultural | destination | | | x | temporary #3373 |
|
||||||
|
|
||||||
|
Scenario: Car - Don't route over steps even if marked as accessible
|
||||||
|
Then routability should be
|
||||||
|
| highway | access | forw | backw |
|
||||||
|
| steps | yes | | |
|
||||||
|
| steps | no | | |
|
||||||
|
| primary | | x | x |
|
||||||
|
|
||||||
|
Scenario: Car - Access combinations
|
||||||
|
Then routability should be
|
||||||
|
| highway | access | bothw |
|
||||||
|
| primary | permissive | x |
|
||||||
|
| steps | permissive | |
|
||||||
|
| footway | permissive | x |
|
||||||
|
| garbagetag | permissive | x |
|
||||||
|
|
||||||
|
Scenario: Car - Access private blacklist
|
||||||
|
Then routability should be
|
||||||
|
| highway | access | bothw |
|
||||||
|
| footway | yes | x |
|
||||||
|
| pedestrian | private | |
|
||||||
|
| footway | private | |
|
||||||
|
| service | private | |
|
||||||
|
| cycleway | private | |
|
||||||
|
| track | private | |
|
||||||
|
|
||||||
|
Scenario: Car - Access blacklist
|
||||||
|
Then routability should be
|
||||||
|
| highway | access | bothw |
|
||||||
|
| primary | | x |
|
||||||
|
| primary | customer | |
|
||||||
|
| primary | emergency | |
|
||||||
|
| primary | forestry | |
|
||||||
|
| primary | agricultural | |
|
||||||
|
| primary | psv | |
|
||||||
|
| primary | no | |
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ Feature: Car - Barriers
|
|||||||
| gate | permissive | x |
|
| gate | permissive | x |
|
||||||
| gate | designated | x |
|
| gate | designated | x |
|
||||||
| gate | no | |
|
| gate | no | |
|
||||||
| gate | private | |
|
| gate | private | x |
|
||||||
| gate | agricultural | |
|
| gate | agricultural | |
|
||||||
| wall | | |
|
| wall | | |
|
||||||
| wall | yes | x |
|
| wall | yes | x |
|
||||||
| wall | permissive | x |
|
| wall | permissive | x |
|
||||||
| wall | designated | x |
|
| wall | designated | x |
|
||||||
| wall | no | |
|
| wall | no | |
|
||||||
| wall | private | |
|
| wall | private | x |
|
||||||
| wall | agricultural | |
|
| wall | agricultural | |
|
||||||
|
|
||||||
Scenario: Car - Rising bollard exception for barriers
|
Scenario: Car - Rising bollard exception for barriers
|
||||||
|
|||||||
@@ -29,6 +29,27 @@ Feature: Car - Handle driving
|
|||||||
| c | f | cde,efg,efg | driving,driving,driving |
|
| c | f | cde,efg,efg | driving,driving,driving |
|
||||||
| c | g | cde,efg,efg | driving,driving,driving |
|
| c | g | cde,efg,efg | driving,driving,driving |
|
||||||
|
|
||||||
|
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c
|
||||||
|
d
|
||||||
|
e f g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | bridge |
|
||||||
|
| abc | primary | |
|
||||||
|
| cde | | movable |
|
||||||
|
| efg | primary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes | speed | time |
|
||||||
|
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
|
||||||
|
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
|
||||||
|
| c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
|
||||||
|
| e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
|
||||||
|
|
||||||
Scenario: Car - Properly handle durations
|
Scenario: Car - Properly handle durations
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -45,7 +66,7 @@ Feature: Car - Handle driving
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 6 km/h |
|
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 7 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 4 km/h |
|
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 5 km/h |
|
||||||
| c | e | cde,cde | driving,driving | 2 km/h |
|
| c | e | cde,cde | driving,driving | 2 km/h |
|
||||||
| e | c | cde,cde | driving,driving | 2 km/h |
|
| e | c | cde,cde | driving,driving | 2 km/h |
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@routing @car @destination @todo
|
@routing @car @destination
|
||||||
Feature: Car - Destination only, no passing through
|
Feature: Car - Destination only, no passing through
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
@@ -81,3 +81,53 @@ Feature: Car - Destination only, no passing through
|
|||||||
| e | a | de,cd,bc,ab,ab |
|
| e | a | de,cd,bc,ab,ab |
|
||||||
| b | d | bc,cd,cd |
|
| b | d | bc,cd,cd |
|
||||||
| d | b | cd,bc,bc |
|
| d | b | cd,bc,bc |
|
||||||
|
|
||||||
|
Scenario: Car - Routing around a way that becomes destination only
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
b
|
||||||
|
\
|
||||||
|
|
|
||||||
|
e++d++++++c--i
|
||||||
|
| \
|
||||||
|
\ h--a
|
||||||
|
\ |
|
||||||
|
\___________g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | access | oneway |
|
||||||
|
| ah | | no |
|
||||||
|
| ihg | | no |
|
||||||
|
| eg | | no |
|
||||||
|
| icde | | no |
|
||||||
|
| cde | destination | no |
|
||||||
|
| eb | | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | # |
|
||||||
|
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
|
||||||
|
| b | d | eb,cde,cde | # ends in restricted way correctly |
|
||||||
|
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
|
||||||
|
|
||||||
|
Scenario: Car - Routing around a way that becomes destination only
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a---c---b
|
||||||
|
+ \
|
||||||
|
+ |
|
||||||
|
d |
|
||||||
|
\___e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | access | oneway |
|
||||||
|
| acbe | | no |
|
||||||
|
| cd | destination | no |
|
||||||
|
| de | | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| e | a | acbe,acbe |
|
||||||
|
| d | a | de,acbe,acbe |
|
||||||
|
| c | d | cd,cd |
|
||||||
|
|||||||
+31
-10
@@ -29,6 +29,27 @@ Feature: Car - Handle ferry routes
|
|||||||
| c | f | cde,efg,efg | ferry,driving,driving |
|
| c | f | cde,efg,efg | ferry,driving,driving |
|
||||||
| c | g | cde,efg,efg | ferry,driving,driving |
|
| c | g | cde,efg,efg | ferry,driving,driving |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Car - Use default speeds to calculate duration if no duration given
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c
|
||||||
|
d
|
||||||
|
e f g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route |
|
||||||
|
| abc | primary | |
|
||||||
|
| cde | | ferry |
|
||||||
|
| efg | primary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes | speed | time |
|
||||||
|
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.4s |
|
||||||
|
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
|
||||||
|
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
||||||
|
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
||||||
Scenario: Car - Properly handle simple durations
|
Scenario: Car - Properly handle simple durations
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -44,11 +65,11 @@ Feature: Car - Handle ferry routes
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed | time |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
||||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||||
|
|
||||||
Scenario: Car - Properly handle ISO 8601 durations
|
Scenario: Car - Properly handle ISO 8601 durations
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -65,8 +86,8 @@ Feature: Car - Handle ferry routes
|
|||||||
| efg | primary | | |
|
| efg | primary | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed | time |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
||||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
@routing @car @hov
|
||||||
|
Feature: Car - Handle driving
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
And a grid size of 100 meters
|
||||||
|
|
||||||
|
Scenario: Car - Avoid hov when not on hov
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
b=========c========================e====j
|
||||||
|
~ ~ ~
|
||||||
|
a ~ f----m
|
||||||
|
| i |
|
||||||
|
| | ----------------l
|
||||||
|
| | /
|
||||||
|
g_______________h______k_____n
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | hov |
|
||||||
|
| ab | motorway_link | |
|
||||||
|
| bcej | motorway | designated |
|
||||||
|
| ag | primary | |
|
||||||
|
| ghkn | primary | |
|
||||||
|
| ih | primary | |
|
||||||
|
| kl | secondary | |
|
||||||
|
| lf | secondary | |
|
||||||
|
| ci | motorway_link | |
|
||||||
|
| ef | motorway_link | |
|
||||||
|
| fm | secondary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| a | m | ag,ghkn,kl,lf,fm,fm |
|
||||||
|
| c | m | bcej,ef,fm,fm |
|
||||||
@@ -6,7 +6,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
|
|
||||||
Scenario: Car - Respect maxspeeds when lower that way type speed
|
Scenario: Car - Respect maxspeeds when lower than way type speed
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d e f g
|
a b c d e f g
|
||||||
@@ -23,7 +23,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 68 km/h |
|
| a | b | ab,ab | 85 km/h |
|
||||||
| b | c | bc,bc | 48 km/h |
|
| b | c | bc,bc | 48 km/h |
|
||||||
| c | d | cd,cd | 40 km/h |
|
| c | d | cd,cd | 40 km/h |
|
||||||
| d | e | de,de | 64 km/h |
|
| d | e | de,de | 64 km/h |
|
||||||
@@ -37,26 +37,30 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | maxspeed |
|
| nodes | highway | maxspeed | # |
|
||||||
| ab | residential | |
|
| ab | residential | | default residential speed is 25 |
|
||||||
| bc | residential | 90 |
|
| bc | residential | 90 | |
|
||||||
| cd | living_street | FR:urban |
|
| cd | living_street | FR:urban | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 20 km/h |
|
| a | b | ab,ab | 25 km/h |
|
||||||
|
# default residential speed is 25, don't mess with this
|
||||||
| b | c | bc,bc | 72 km/h |
|
| b | c | bc,bc | 72 km/h |
|
||||||
|
# parsed maxspeeds are scaled by profile's speed_reduction value
|
||||||
| c | d | cd,cd | 40 km/h |
|
| c | d | cd,cd | 40 km/h |
|
||||||
|
# symbolic posted speeds without explicit exceptions are parsed
|
||||||
|
# from the profile's maxspeed_table_default table
|
||||||
|
|
||||||
Scenario: Car - Forward/backward maxspeed
|
Scenario: Car - Forward/backward maxspeed are scaled by profile's speed_reduction if explicitly set
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
|
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||||
| primary | | | | 52 km/h | 52 km/h |
|
| primary | | | | 65 km/h | 65 km/h |
|
||||||
| primary | 60 | | | 48 km/h | 48 km/h |
|
| primary | 60 | | | 48 km/h | 48 km/h |
|
||||||
| primary | | 60 | | 48 km/h | 48 km/h +- 5 |
|
| primary | | 60 | | 48 km/h | 65 km/h |
|
||||||
| primary | | | 60 | 52 km/h | 52 km/h +- 5 |
|
| primary | | | 60 | 65 km/h | 48 km/h |
|
||||||
| primary | 15 | 60 | | 48 km/h | 12 km/h |
|
| primary | 15 | 60 | | 48 km/h | 12 km/h |
|
||||||
| primary | 15 | | 60 | 12 km/h | 48 km/h |
|
| primary | 15 | | 60 | 12 km/h | 48 km/h |
|
||||||
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
|
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
|
||||||
@@ -81,56 +85,55 @@ OSRM will use 4/5 of the projected free-flow speed.
|
|||||||
Scenario: Car - Too narrow streets should be ignored or incur a penalty
|
Scenario: Car - Too narrow streets should be ignored or incur a penalty
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|
||||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw |
|
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | | | | | 52 km/h | 52 km/h |
|
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||||
| primary | | 3 | | | 32 km/h | 32 km/h |
|
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||||
| primary | 60 | | | | 47 km/h | 47 km/h |
|
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
||||||
| primary | 60 | 3 | | | 29 km/h | 29 km/h |
|
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 |
|
||||||
| primary | | | 60 | | 47 km/h | 52 km/h |
|
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
||||||
| primary | | 3 | 60 | | 29 km/h | 32 km/h |
|
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
||||||
| primary | | | | 60 | 52 km/h | 47 km/h |
|
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
||||||
| primary | | 3 | | 60 | 32 km/h | 29 km/h |
|
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
||||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h |
|
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
||||||
| primary | 15 | 3 | 60 | | 29 km/h | 7 km/h |
|
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
||||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
||||||
| primary | 15 | 3 | | 60 | 7 km/h | 29 km/h |
|
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
||||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
||||||
| primary | 15 | 3 | 30 | 60 | 14 km/h | 29 km/h |
|
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
||||||
|
|
||||||
Scenario: Car - Single lane streets be ignored or incur a penalty
|
Scenario: Car - Single lane streets be ignored or incur a penalty
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|
||||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw |
|
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | | | | | 52 km/h | 52 km/h |
|
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||||
| primary | | 1 | | | 32 km/h | 32 km/h |
|
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||||
| primary | 60 | | | | 47 km/h | 47 km/h |
|
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
||||||
| primary | 60 | 1 | | | 29 km/h | 29 km/h |
|
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 |
|
||||||
| primary | | | 60 | | 47 km/h | 52 km/h |
|
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
||||||
| primary | | 1 | 60 | | 29 km/h | 32 km/h |
|
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
||||||
| primary | | | | 60 | 52 km/h | 47 km/h |
|
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
||||||
| primary | | 1 | | 60 | 32 km/h | 29 km/h |
|
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
||||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h |
|
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
||||||
| primary | 15 | 1 | 60 | | 29 km/h | 7 km/h |
|
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
||||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
||||||
| primary | 15 | 1 | | 60 | 7 km/h | 29 km/h |
|
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
||||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
||||||
| primary | 15 | 1 | 30 | 60 | 14 km/h | 29 km/h |
|
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
||||||
|
|
||||||
Scenario: Car - Single lane streets only incure a penalty for two-way streets
|
Scenario: Car - Single lane streets only incur a penalty for two-way streets
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | lanes | oneway | forw | backw |
|
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | 30 | 1 | yes | 23 km/h | |
|
| primary | 30 | 1 | yes | 23 km/h | | 7 | |
|
||||||
| primary | 30 | 1 | -1 | | 23 km/h |
|
| primary | 30 | 1 | -1 | | 23 km/h | | 7 |
|
||||||
| primary | 30 | 1 | | 15 km/h | 15 km/h |
|
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 |
|
||||||
| primary | 30 | 2 | | 23 km/h | 23 km/h |
|
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 |
|
||||||
|
|
||||||
Scenario: Car - Forwward/backward maxspeed on reverse oneways
|
Scenario: Car - Forward/backward maxspeed on reverse oneways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw |
|
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | | | | -1 | | 52 km/h |
|
| primary | | | | -1 | | 64 km/h | | 18 |
|
||||||
| primary | 30 | | | -1 | | 23 km/h |
|
| primary | 30 | | | -1 | | 23 km/h | | 7 |
|
||||||
| primary | | 30 | | -1 | | 52 km/h |
|
| primary | | 30 | | -1 | | 64 km/h | | 18 |
|
||||||
| primary | | | 30 | -1 | | 23 km/h |
|
| primary | | | 30 | -1 | | 23 km/h | | 7 |
|
||||||
| primary | 20 | 30 | | -1 | | 16 km/h |
|
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
|
||||||
| primary | 20 | | 30 | -1 | | 23 km/h |
|
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,22 @@ Feature: Car - Oneway streets
|
|||||||
| highway | oneway | forw | backw |
|
| highway | oneway | forw | backw |
|
||||||
| primary | -1 | | x |
|
| primary | -1 | | x |
|
||||||
|
|
||||||
|
Scenario: Car - Mode specific oneway
|
||||||
|
Then routability should be
|
||||||
|
| highway | oneway:motorcar | oneway:motor_vehicle | oneway:vehicle | oneway | forw | backw |
|
||||||
|
| primary | | | | | x | x |
|
||||||
|
| primary | yes | | | | x | |
|
||||||
|
| primary | | yes | | | x | |
|
||||||
|
| primary | | | yes | | x | |
|
||||||
|
| primary | | | | yes | x | |
|
||||||
|
| primary | yes | no | | | x | |
|
||||||
|
| primary | | yes | no | | x | |
|
||||||
|
| primary | | | yes | no | x | |
|
||||||
|
| primary | | | | yes | x | |
|
||||||
|
| primary | no | yes | | | x | x |
|
||||||
|
| primary | | no | yes | | x | x |
|
||||||
|
| primary | | | no | yes | x | x |
|
||||||
|
|
||||||
Scenario: Car - Implied oneways
|
Scenario: Car - Implied oneways
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | junction | forw | backw | # |
|
| highway | junction | forw | backw | # |
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ Feature: Car - Surfaces
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
|
|
||||||
Scenario: Car - Surface should reduce speed
|
Scenario: Car - Ways tagged service should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | service | forw | backw |
|
| highway | service | forw | backw | forw_rate |
|
||||||
| service | alley | 5 km/h +-1 | 5 km/h +-1 |
|
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||||
| service | emergency_access | | |
|
| service | emergency_access | | | |
|
||||||
| service | driveway | 5 km/h +-1 | 5 km/h +-1 |
|
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||||
| service | drive-through | 5 km/h +-1 | 5 km/h +-1 |
|
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||||
| service | parking | 5 km/h +-1 | 5 km/h +-1 |
|
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||||
|
|||||||
@@ -9,13 +9,10 @@ Feature: Testbot - side bias
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
Scenario: Left hand bias
|
Scenario: Left hand bias
|
||||||
Given the profile file "testbot" extended with
|
Given the profile file "car" extended with
|
||||||
"""
|
"""
|
||||||
properties.left_hand_driving = true
|
properties.left_hand_driving = true
|
||||||
function turn_function (angle)
|
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
||||||
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
|
|
||||||
return (angle >= 0) and k * 1.2 or k / 1.2
|
|
||||||
end
|
|
||||||
"""
|
"""
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -31,17 +28,14 @@ Feature: Testbot - side bias
|
|||||||
|
|
||||||
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 | 82s +-1 |
|
| d | a | bd,ab,ab | 24s +-1 |
|
||||||
| d | c | bd,bc,bc | 100s +-1 |
|
| d | c | bd,bc,bc | 27s +-1 |
|
||||||
|
|
||||||
Scenario: Right hand bias
|
Scenario: Right hand bias
|
||||||
Given the profile file "testbot" extended with
|
Given the profile file "car" extended with
|
||||||
"""
|
"""
|
||||||
properties.left_hand_driving = false
|
properties.left_hand_driving = false
|
||||||
function turn_function (angle)
|
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
||||||
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
|
|
||||||
return (angle >= 0) and k / 1.2 or k * 1.2
|
|
||||||
end
|
|
||||||
"""
|
"""
|
||||||
And the node map
|
And the node map
|
||||||
"""
|
"""
|
||||||
@@ -57,8 +51,9 @@ Feature: Testbot - side bias
|
|||||||
|
|
||||||
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 | 100s +-1 |
|
| d | a | bd,ab,ab | 27s +-1 |
|
||||||
| d | c | bd,bc,bc | 82s +-1 |
|
# should be inverse of left hand bias
|
||||||
|
| d | c | bd,bc,bc | 24s +-1 |
|
||||||
|
|
||||||
Scenario: Roundabout exit counting for left sided driving
|
Scenario: Roundabout exit counting for left sided driving
|
||||||
And a grid size of 10 meters
|
And a grid size of 10 meters
|
||||||
+40
-24
@@ -5,33 +5,49 @@ Feature: Car - speeds
|
|||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
And a grid size of 1000 meters
|
And a grid size of 1000 meters
|
||||||
|
|
||||||
|
# should more or less match default speeds in car profile, but may be different due to rounding errors
|
||||||
Scenario: Car - speed of various way types
|
Scenario: Car - speed of various way types
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | bothw |
|
| highway | oneway | bothw |
|
||||||
| motorway | no | 71 km/h |
|
| motorway | no | 89 km/h |
|
||||||
| motorway_link | no | 36 km/h |
|
| motorway_link | no | 44 km/h |
|
||||||
| trunk | no | 68 km/h |
|
| trunk | no | 85 km/h |
|
||||||
| trunk_link | no | 31 km/h |
|
| trunk_link | no | 39 km/h |
|
||||||
| primary | no | 52 km/h |
|
| primary | no | 64 km/h |
|
||||||
| primary_link | no | 23 km/h |
|
| primary_link | no | 29 km/h |
|
||||||
| secondary | no | 44 km/h |
|
| secondary | no | 55 km/h |
|
||||||
| secondary_link | no | 19 km/h |
|
| secondary_link | no | 24 km/h |
|
||||||
| tertiary | no | 31 km/h |
|
| tertiary | no | 39 km/h |
|
||||||
| tertiary_link | no | 16 km/h |
|
| tertiary_link | no | 20 km/h |
|
||||||
| unclassified | no | 19 km/h |
|
| unclassified | no | 24 km/h |
|
||||||
| residential | no | 19 km/h |
|
| residential | no | 24 km/h |
|
||||||
| living_street | no | 8 km/h |
|
| living_street | no | 9 km/h |
|
||||||
| service | no | 11 km/h |
|
| service | no | 15 km/h |
|
||||||
|
|
||||||
# Alternating oneways have to take average waiting time into account.
|
# Alternating oneways scale rates but not speeds
|
||||||
Scenario: Car - scaled speeds for oneway=alternating
|
Scenario: Car - scaled speeds for oneway=alternating
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | junction | forw | backw | # |
|
| highway | oneway | junction | forw | backw | # |
|
||||||
| tertiary | | | 31 km/h | 31 km/h | |
|
| tertiary | | | 39 km/h | 39 km/h | |
|
||||||
| tertiary | alternating | | 12 km/h +- 1 | 12 km/h +- 1 | |
|
| tertiary | alternating | | 39 km/h | 39 km/h | |
|
||||||
| motorway | | | 71 km/h | | implied oneway |
|
| motorway | | | 89 km/h | | implied oneway |
|
||||||
| motorway | alternating | | 28 km/h +- 1 | | implied oneway |
|
| motorway | alternating | | 89 km/h | | implied oneway |
|
||||||
| motorway | reversible | | | | unroutable |
|
| motorway | reversible | | | | unroutable |
|
||||||
| primary | | roundabout | 52 km/h | | implied oneway |
|
| primary | | roundabout | 64 km/h | | implied oneway |
|
||||||
| primary | alternating | roundabout | 20 km/h +- 1 | | implied oneway |
|
| primary | alternating | roundabout | 64 km/h | | implied oneway |
|
||||||
| primary | reversible | roundabout | | | unroutable |
|
| primary | reversible | roundabout | | | unroutable |
|
||||||
|
|
||||||
|
Scenario: Car - Check roundoff errors
|
||||||
|
Then routability should be
|
||||||
|
|
||||||
|
| highway | maxspeed | forw | backw |
|
||||||
|
| primary | | 64 km/h | 64 km/h |
|
||||||
|
| primary | 60 | 47 km/h | 47 km/h |
|
||||||
|
| primary | 60 | 47 km/h | 47 km/h |
|
||||||
|
| primary | 60 | 47 km/h | 47 km/h |
|
||||||
|
|
||||||
|
Scenario: Car - Side road penalties
|
||||||
|
Then routability should be
|
||||||
|
|
||||||
|
| highway | side_road | forw | backw | forw_rate | backw_rate |
|
||||||
|
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ Feature: Car - Surfaces
|
|||||||
| highway | access | tracktype | smoothness | surface | forw | backw |
|
| highway | access | tracktype | smoothness | surface | forw | backw |
|
||||||
| motorway | | | | | x | |
|
| motorway | | | | | x | |
|
||||||
| motorway | no | grade1 | excellent | asphalt | | |
|
| motorway | no | grade1 | excellent | asphalt | | |
|
||||||
| motorway | private | grade1 | excellent | asphalt | | |
|
| motorway | private | grade1 | excellent | asphalt | x | |
|
||||||
| motorway | agricultural | grade1 | excellent | asphalt | | |
|
| motorway | agricultural | grade1 | excellent | asphalt | | |
|
||||||
| motorway | forestry | grade1 | excellent | asphalt | | |
|
| motorway | forestry | grade1 | excellent | asphalt | | |
|
||||||
| motorway | emergency | grade1 | excellent | asphalt | | |
|
| motorway | emergency | grade1 | excellent | asphalt | | |
|
||||||
| primary | | | | | x | x |
|
| primary | | | | | x | x |
|
||||||
|
| primary | private | grade1 | excellent | asphalt | x | x |
|
||||||
| primary | no | grade1 | excellent | asphalt | | |
|
| primary | no | grade1 | excellent | asphalt | | |
|
||||||
| primary | private | grade1 | excellent | asphalt | | |
|
|
||||||
| primary | agricultural | grade1 | excellent | asphalt | | |
|
| primary | agricultural | grade1 | excellent | asphalt | | |
|
||||||
| primary | forestry | grade1 | excellent | asphalt | | |
|
| primary | forestry | grade1 | excellent | asphalt | | |
|
||||||
| primary | emergency | grade1 | excellent | asphalt | | |
|
| primary | emergency | grade1 | excellent | asphalt | | |
|
||||||
@@ -64,64 +64,65 @@ Feature: Car - Surfaces
|
|||||||
Scenario: Car - Surface should reduce speed
|
Scenario: Car - Surface should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | surface | forw | backw |
|
| highway | oneway | surface | forw | backw |
|
||||||
| motorway | no | | 72 km/h | 72 km/h |
|
| motorway | no | | 90 km/h | 90 km/h |
|
||||||
| motorway | no | asphalt | 72 km/h | 72 km/h +-1 |
|
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 |
|
||||||
| motorway | no | concrete | 72 km/h +-1 | 72 km/h +-1 |
|
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 |
|
||||||
| motorway | no | concrete:plates | 72 km/h +-1 | 72 km/h +-1 |
|
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 |
|
||||||
| motorway | no | concrete:lanes | 72 km/h +-1 | 72 km/h +-1 |
|
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 |
|
||||||
| motorway | no | paved | 72 km/h +-1 | 72 km/h +-1 |
|
| motorway | no | paved | 90 km/h +-1 | 90 km/h +-1 |
|
||||||
| motorway | no | cement | 64 km/h +-1 | 64 km/h +-1 |
|
| motorway | no | cement | 80 km/h +-1 | 80 km/h +-1 |
|
||||||
| motorway | no | compacted | 64 km/h +-1 | 64 km/h +-1 |
|
| motorway | no | compacted | 80 km/h +-1 | 80 km/h +-1 |
|
||||||
| motorway | no | fine_gravel | 64 km/h +-1 | 64 km/h +-1 |
|
| motorway | no | fine_gravel | 80 km/h +-1 | 80 km/h +-1 |
|
||||||
| motorway | no | paving_stones | 48 km/h +-1 | 48 km/h +-1 |
|
| motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 |
|
||||||
| motorway | no | metal | 48 km/h +-1 | 48 km/h +-1 |
|
| motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 |
|
||||||
| motorway | no | bricks | 48 km/h +-1 | 48 km/h +-1 |
|
| motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 |
|
||||||
| motorway | no | grass | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | grass | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | wood | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | wood | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | sett | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | sett | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | grass_paver | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | grass_paver | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | gravel | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | gravel | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | unpaved | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | unpaved | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | ground | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | ground | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | dirt | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | dirt | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | pebblestone | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | pebblestone | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | tartan | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | tartan | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | cobblestone | 24 km/h +-1 | 24 km/h +-1 |
|
| motorway | no | cobblestone | 30 km/h +-1 | 30 km/h +-1 |
|
||||||
| motorway | no | clay | 24 km/h +-1 | 24 km/h +-1 |
|
| motorway | no | clay | 30 km/h +-1 | 30 km/h +-1 |
|
||||||
| motorway | no | earth | 16 km/h +-1 | 16 km/h +-1 |
|
| motorway | no | earth | 20 km/h +-1 | 20 km/h +-1 |
|
||||||
| motorway | no | stone | 16 km/h +-1 | 16 km/h +-1 |
|
| motorway | no | stone | 20 km/h +-1 | 20 km/h +-1 |
|
||||||
| motorway | no | rocky | 16 km/h +-1 | 16 km/h +-1 |
|
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 |
|
||||||
| motorway | no | sand | 16 km/h +-1 | 16 km/h +-1 |
|
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 |
|
||||||
|
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
|
||||||
|
|
||||||
Scenario: Car - Tracktypes should reduce speed
|
Scenario: Car - Tracktypes should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | tracktype | forw | backw |
|
| highway | oneway | tracktype | forw | backw |
|
||||||
| motorway | no | | 72 km/h | 72 km/h |
|
| motorway | no | | 90 km/h | 90 km/h |
|
||||||
| motorway | no | grade1 | 48 km/h +-1 | 48 km/h +-1 |
|
| motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 |
|
||||||
| motorway | no | grade2 | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | grade2 | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | grade3 | 24 km/h +-1 | 24 km/h +-1 |
|
| motorway | no | grade3 | 30 km/h +-1 | 30 km/h +-1 |
|
||||||
| motorway | no | grade4 | 20 km/h +-1 | 20 km/h +-1 |
|
| motorway | no | grade4 | 25 km/h +-1 | 25 km/h +-1 |
|
||||||
| motorway | no | grade5 | 16 km/h +-1 | 16 km/h +-1 |
|
| motorway | no | grade5 | 20 km/h +-1 | 20 km/h +-1 |
|
||||||
|
|
||||||
Scenario: Car - Smoothness should reduce speed
|
Scenario: Car - Smoothness should reduce speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | smoothness | forw | backw |
|
| highway | oneway | smoothness | forw | backw |
|
||||||
| motorway | no | | 72 km/h | 72 km/h |
|
| motorway | no | | 90 km/h | 90 km/h |
|
||||||
| motorway | no | intermediate | 64 km/h | 64 km/h |
|
| motorway | no | intermediate | 80 km/h | 80 km/h |
|
||||||
| motorway | no | bad | 32 km/h +-1 | 32 km/h +-1 |
|
| motorway | no | bad | 40 km/h +-1 | 40 km/h +-1 |
|
||||||
| motorway | no | very_bad | 16 km/h +-1 | 16 km/h +-1 |
|
| motorway | no | very_bad | 20 km/h +-1 | 20 km/h +-1 |
|
||||||
| motorway | no | horrible | 8 km/h +-1 | 8 km/h +-1 |
|
| motorway | no | horrible | 10 km/h +-1 | 10 km/h +-1 |
|
||||||
| motorway | no | very_horrible | 4 km/h +-1 | 4 km/h +-1 |
|
| motorway | no | very_horrible | 5 km/h +-1 | 5 km/h +-1 |
|
||||||
|
|
||||||
Scenario: Car - Combination of surface tags should use lowest speed
|
Scenario: Car - Combination of surface tags should use lowest speed
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | tracktype | surface | smoothness | backw | forw |
|
| highway | oneway | tracktype | surface | smoothness | bothw |
|
||||||
| motorway | no | | | | 72 km/h | 72 km/h |
|
| motorway | no | | | | 90 km/h |
|
||||||
| service | no | grade1 | asphalt | excellent | 12 km/h | 12 km/h |
|
| service | no | grade1 | asphalt | excellent | 15 km/h |
|
||||||
| motorway | no | grade5 | asphalt | excellent | 16 km/h | 16 km/h |
|
| motorway | no | grade5 | asphalt | excellent | 20 km/h |
|
||||||
| motorway | no | grade1 | mud | excellent | 8 km/h | 8 km/h |
|
| motorway | no | grade1 | mud | excellent | 10 km/h |
|
||||||
| motorway | no | grade1 | asphalt | very_horrible | 4 km/h | 4 km/h |
|
| motorway | no | grade1 | asphalt | very_horrible | 5 km/h |
|
||||||
| service | no | grade5 | mud | very_horrible | 4 km/h | 4 km/h |
|
| service | no | grade5 | mud | very_horrible | 5 km/h |
|
||||||
|
|
||||||
Scenario: Car - Surfaces should not affect oneway direction
|
Scenario: Car - Surfaces should not affect oneway direction
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@@ -1,127 +0,0 @@
|
|||||||
@routing @speed @traffic
|
|
||||||
Feature: Traffic - speeds
|
|
||||||
|
|
||||||
Background: Use specific speeds
|
|
||||||
|
|
||||||
Scenario: Weighting based on speed file
|
|
||||||
Given the node locations
|
|
||||||
| node | lat | lon |
|
|
||||||
| a | 0.1 | 0.1 |
|
|
||||||
| b | 0.05 | 0.1 |
|
|
||||||
| c | 0.0 | 0.1 |
|
|
||||||
| d | 0.05 | 0.03 |
|
|
||||||
| e | 0.05 | 0.066 |
|
|
||||||
| f | 0.075 | 0.066 |
|
|
||||||
| g | 0.075 | 0.1 |
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| ad | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| dc | primary |
|
|
||||||
| de | primary |
|
|
||||||
| eb | primary |
|
|
||||||
| df | primary |
|
|
||||||
| fb | primary |
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given the extract extra arguments "--generate-edge-lookup"
|
|
||||||
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
|
||||||
Given the speed file
|
|
||||||
"""
|
|
||||||
1,2,0
|
|
||||||
2,1,0
|
|
||||||
2,3,27
|
|
||||||
3,2,27
|
|
||||||
1,4,27
|
|
||||||
4,1,27
|
|
||||||
"""
|
|
||||||
And I route I should get
|
|
||||||
| from | to | route | speed |
|
|
||||||
| a | b | ad,de,eb,eb | 30 km/h |
|
|
||||||
| a | c | ad,dc,dc | 31 km/h |
|
|
||||||
| b | c | bc,bc | 27 km/h |
|
|
||||||
| a | d | ad,ad | 27 km/h |
|
|
||||||
| d | c | dc,dc | 36 km/h |
|
|
||||||
| g | b | fb,fb | 36 km/h |
|
|
||||||
| a | g | ad,df,fb,fb | 30 km/h |
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Speeds that isolate a single node (a)
|
|
||||||
Given the node locations
|
|
||||||
| node | lat | lon |
|
|
||||||
| a | 0.1 | 0.1 |
|
|
||||||
| b | 0.05 | 0.1 |
|
|
||||||
| c | 0.0 | 0.1 |
|
|
||||||
| d | 0.05 | 0.03 |
|
|
||||||
| e | 0.05 | 0.066 |
|
|
||||||
| f | 0.075 | 0.066 |
|
|
||||||
| g | 0.075 | 0.1 |
|
|
||||||
| h | 2.075 | 19.1 |
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| ad | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| dc | primary |
|
|
||||||
| de | primary |
|
|
||||||
| eb | primary |
|
|
||||||
| df | primary |
|
|
||||||
| fb | primary |
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given the extract extra arguments "--generate-edge-lookup"
|
|
||||||
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
|
||||||
Given the speed file
|
|
||||||
"""
|
|
||||||
1,2,0
|
|
||||||
2,1,0
|
|
||||||
2,3,27
|
|
||||||
3,2,27
|
|
||||||
1,4,0
|
|
||||||
4,1,0
|
|
||||||
"""
|
|
||||||
And I route I should get
|
|
||||||
| from | to | route | speed |
|
|
||||||
| a | b | fb,fb | 36 km/h |
|
|
||||||
| a | c | fb,bc,bc | 30 km/h |
|
|
||||||
| b | c | bc,bc | 27 km/h |
|
|
||||||
| a | d | fb,df,df | 36 km/h |
|
|
||||||
| d | c | dc,dc | 36 km/h |
|
|
||||||
| g | b | fb,fb | 36 km/h |
|
|
||||||
| a | g | fb,fb | 36 km/h |
|
|
||||||
|
|
||||||
Scenario: Verify that negative values cause an error, they're not valid at all
|
|
||||||
Given the node locations
|
|
||||||
| node | lat | lon |
|
|
||||||
| a | 0.1 | 0.1 |
|
|
||||||
| b | 0.05 | 0.1 |
|
|
||||||
| c | 0.0 | 0.1 |
|
|
||||||
| d | 0.05 | 0.03 |
|
|
||||||
| e | 0.05 | 0.066 |
|
|
||||||
| f | 0.075 | 0.066 |
|
|
||||||
| g | 0.075 | 0.1 |
|
|
||||||
| h | 1.075 | 10.1 |
|
|
||||||
And the ways
|
|
||||||
| nodes | highway |
|
|
||||||
| ab | primary |
|
|
||||||
| ad | primary |
|
|
||||||
| bc | primary |
|
|
||||||
| dc | primary |
|
|
||||||
| de | primary |
|
|
||||||
| eb | primary |
|
|
||||||
| df | primary |
|
|
||||||
| fb | primary |
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given the extract extra arguments "--generate-edge-lookup"
|
|
||||||
Given the speed file
|
|
||||||
"""
|
|
||||||
1,2,-10
|
|
||||||
2,1,-20
|
|
||||||
2,3,27
|
|
||||||
3,2,27
|
|
||||||
1,4,-3
|
|
||||||
4,1,-5
|
|
||||||
"""
|
|
||||||
And the data has been extracted
|
|
||||||
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
|
||||||
And stderr should contain "malformed"
|
|
||||||
And it should exit with an error
|
|
||||||
@@ -52,23 +52,23 @@ Feature: Traffic - turn penalties
|
|||||||
|
|
||||||
Scenario: Weighting not based on turn penalty file
|
Scenario: Weighting not based on turn penalty file
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | time |
|
| from | to | route | speed | weight | time |
|
||||||
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
| a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 |
|
||||||
# straight
|
# straight
|
||||||
| i | g | fim,fg,fg | 45 km/h | 16s +-1 |
|
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
|
||||||
# right
|
# right
|
||||||
| a | e | ad,def,def | 38 km/h | 19s +-1 |
|
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
|
||||||
# left
|
# left
|
||||||
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
| c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 |
|
||||||
# double straight
|
# double straight
|
||||||
| p | g | mp,fim,fg,fg | 48 km/h | 29s +-1 |
|
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
|
||||||
# straight-right
|
# straight-right
|
||||||
| a | l | ad,dhk,klm,klm | 44 km/h | 33s +-1 |
|
| a | l | ad,dhk,klm,klm | 53 km/h | 27s +-1 | 27s +-1 |
|
||||||
# straight-left
|
# straight-left
|
||||||
| l | e | klm,dhk,def,def | 45 km/h | 32s +-1 |
|
| l | e | klm,dhk,def,def | 55 km/h | 26s +-1 | 26s +-1 |
|
||||||
# double right
|
# double right
|
||||||
| g | n | fg,fim,mn,mn | 38 km/h | 38s +-1 |
|
| g | n | fg,fim,mn,mn | 44 km/h | 32s +-1 | 32s +-1 |
|
||||||
# double left
|
# double left
|
||||||
|
|
||||||
Scenario: Weighting based on turn penalty file
|
Scenario: Weighting based on turn penalty file
|
||||||
Given the turn penalty file
|
Given the turn penalty file
|
||||||
@@ -80,27 +80,33 @@ Feature: Traffic - turn penalties
|
|||||||
8,11,12,23
|
8,11,12,23
|
||||||
1,4,5,-0.2
|
1,4,5,-0.2
|
||||||
"""
|
"""
|
||||||
|
# ifg right turn
|
||||||
|
# imn left turn
|
||||||
|
# hdc left turn
|
||||||
|
# lkh right turn
|
||||||
|
# hkl left turn
|
||||||
|
# ade left turn
|
||||||
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | time |
|
| from | to | route | speed | weight | time |
|
||||||
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
| a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 |
|
||||||
# straight
|
# straight
|
||||||
| i | g | fim,fg,fg | 46 km/h | 15s +-1 |
|
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
|
||||||
# right - ifg penalty
|
# right - ifg penalty
|
||||||
| a | e | ad,def,def | 53 km/h | 14s +-1 |
|
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
|
||||||
# left - faster because of negative ade penalty
|
# left - faster because of negative ade penalty
|
||||||
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
| c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 |
|
||||||
# double straight
|
# double straight
|
||||||
| p | g | mp,fim,fg,fg | 49 km/h | 29s +-1 |
|
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
|
||||||
# straight-right - ifg penalty
|
# straight-right - ifg penalty
|
||||||
| a | l | ad,def,fim,klm,klm | 48 km/h | 45s +-1 |
|
| a | l | ad,def,fim,klm,klm | 58 km/h | 37 | 37s +-1 |
|
||||||
# was straight-left - forced around by hkl penalty
|
# was straight-left - forced around by hkl penalty
|
||||||
| l | e | klm,fim,def,def | 38 km/h | 38s +-1 |
|
| l | e | klm,fim,def,def | 44 km/h | 32.6 | 32s +-1 |
|
||||||
# double right - forced left by lkh penalty
|
# double right - forced left by lkh penalty
|
||||||
| g | n | fg,fim,mn,mn | 25 km/h | 57s +-1 |
|
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
|
||||||
# double left - imn penalty
|
# double left - imn penalty
|
||||||
| j | c | jk,klm,fim,def,cd,cd | 44 km/h | 65.8s +-1 |
|
| j | c | jk,klm,fim,def,cd,cd | 53 km/h | 54.6 | 54s +-1 |
|
||||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||||
|
|
||||||
Scenario: Too-negative penalty clamps, but does not fail
|
Scenario: Too-negative penalty clamps, but does not fail
|
||||||
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
|
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
@routing @car @weight
|
||||||
|
Feature: Car - weights
|
||||||
|
|
||||||
|
Background: Use specific speeds
|
||||||
|
Given the profile "car"
|
||||||
|
|
||||||
|
Scenario: Only routes down service road when that's the destination
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a--b--c
|
||||||
|
|
|
||||||
|
d
|
||||||
|
|
|
||||||
|
e--f--g
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| abc | residential |
|
||||||
|
| efg | residential |
|
||||||
|
| cg | tertiary |
|
||||||
|
| bdf | service |
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | speed | weight |
|
||||||
|
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
|
||||||
|
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
|
||||||
|
|
||||||
|
Scenario: Does not jump off the highway to go down service road
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
|
|
||||||
|
b
|
||||||
|
|\
|
||||||
|
| e
|
||||||
|
|/
|
||||||
|
c
|
||||||
|
|
|
||||||
|
d
|
||||||
|
"""
|
||||||
|
And the nodes
|
||||||
|
| node | id |
|
||||||
|
| a | 1 |
|
||||||
|
| b | 2 |
|
||||||
|
| c | 3 |
|
||||||
|
| d | 4 |
|
||||||
|
| e | 5 |
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway |
|
||||||
|
| ab | primary | yes |
|
||||||
|
| bc | primary | yes |
|
||||||
|
| cd | primary | yes |
|
||||||
|
| be | service | yes |
|
||||||
|
| ec | service | yes |
|
||||||
|
And the extract extra arguments "--generate-edge-lookup"
|
||||||
|
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
And the speed file
|
||||||
|
"""
|
||||||
|
2,5,8
|
||||||
|
"""
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | speed | weight |
|
||||||
|
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
|
||||||
|
| a | e | ab,be,be | 14 km/h | 112 |
|
||||||
@@ -103,3 +103,17 @@ Feature: Foot - Access tags on ways
|
|||||||
| bridleway | | yes | | |
|
| bridleway | | yes | | |
|
||||||
| bridleway | designated | | | |
|
| bridleway | designated | | | |
|
||||||
| bridleway | | | | |
|
| bridleway | | | | |
|
||||||
|
|
||||||
|
Scenario: Foot - a way with missing :forward tag
|
||||||
|
Then routability should be
|
||||||
|
| highway | bicycle:backward | foot:backward | forw | backw |
|
||||||
|
| cycleway | designated | designated | | x |
|
||||||
|
|
||||||
|
Scenario: Foot - Access combinations
|
||||||
|
Then routability should be
|
||||||
|
| highway | access | bothw |
|
||||||
|
| primary | permissive | x |
|
||||||
|
| steps | permissive | x |
|
||||||
|
| footway | permissive | x |
|
||||||
|
| garbagetag | permissive | x |
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,6 @@ Feature: Foot - Handle ferry routes
|
|||||||
| abcd | | ferry | yes | 1:00 |
|
| abcd | | ferry | yes | 1:00 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | d | abcd,abcd | 3600s +-10 |
|
| a | d | abcd,abcd | 3600s |
|
||||||
| d | a | abcd,abcd | 3600s +-10 |
|
| d | a | abcd,abcd | 3600s |
|
||||||
|
|||||||
@@ -124,10 +124,10 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g f
|
g f
|
||||||
|
| |
|
||||||
j h e
|
j --- h - e
|
||||||
|
| |
|
||||||
a b c
|
a --- b - c
|
||||||
i d
|
i d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -154,21 +154,21 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g j
|
g j
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
f
|
| |,f
|
||||||
e
|
|,e
|
||||||
d
|
,d |
|
||||||
a b c
|
a --------- b c |
|
||||||
|
/ | |
|
||||||
|
/ | |
|
||||||
|
/ | |
|
||||||
|
| | |
|
||||||
|
| | |
|
||||||
|
| | |
|
||||||
l h i
|
l h i
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -202,21 +202,21 @@ Feature: Turn Lane Guidance
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g j
|
g j
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
f
|
| |,f
|
||||||
e
|
|,e
|
||||||
d
|
,d |
|
||||||
a b c
|
a --------- b c |
|
||||||
|
/ | |
|
||||||
|
/ | |
|
||||||
|
/ | |
|
||||||
|
| | |
|
||||||
|
| | |
|
||||||
|
| | |
|
||||||
l h i
|
l h i
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -818,3 +818,37 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
|
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: Don't Overdo It
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
q r s t u v
|
||||||
|
| | | | | |
|
||||||
|
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
|
||||||
|
| | | | | | |
|
||||||
|
p o n m l k j
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | turn:lanes:forward | oneway |
|
||||||
|
| ab | road | left\|\|\| | yes |
|
||||||
|
| bc | road | left\|\|\| | yes |
|
||||||
|
| cd | road | left\|\|\| | yes |
|
||||||
|
| de | road | left\|\|\| | yes |
|
||||||
|
| ef | road | left\|\|\| | yes |
|
||||||
|
| fg | road | left\|\|\| | yes |
|
||||||
|
| gh | road | \|\|right | yes |
|
||||||
|
| hi | road | | yes |
|
||||||
|
| qbp | 1st | | no |
|
||||||
|
| rco | 2nd | | no |
|
||||||
|
| sdn | 3rd | | no |
|
||||||
|
| tem | 4th | | no |
|
||||||
|
| ufl | 5th | | no |
|
||||||
|
| vgk | 6th | | no |
|
||||||
|
| hj | 7th | | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | locations | lanes |
|
||||||
|
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
|
||||||
|
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
|
||||||
|
|||||||
@@ -50,3 +50,20 @@ Feature: Features related to bugs
|
|||||||
And the data has been saved to disk
|
And the data has been saved to disk
|
||||||
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
|
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
|
||||||
Then it should exit successfully
|
Then it should exit successfully
|
||||||
|
|
||||||
|
@3418
|
||||||
|
Scenario: Bearings should be between 0-359
|
||||||
|
Given the node locations
|
||||||
|
| node | lon | lat |
|
||||||
|
| a | -122.0232176 | 37.3282203 |
|
||||||
|
| b | -122.0232199 | 37.3302422 |
|
||||||
|
| c | -122.0232252 | 37.3312787 |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway |
|
||||||
|
| ab | Pear to Merrit | residential |
|
||||||
|
| bc | Merritt to Apricot | residential |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,c | Pear to Merrit,Merritt to Apricot,Merritt to Apricot | true:0;true:0 false:180;true:180 |
|
||||||
|
|||||||
@@ -0,0 +1,162 @@
|
|||||||
|
@routing @guidance @collapsing
|
||||||
|
Feature: Collapse
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 20 meters
|
||||||
|
|
||||||
|
Scenario: Collapse Steps While On Ferry
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
j----a---c---b----k
|
||||||
|
~ ~ ~
|
||||||
|
~ ~ ~
|
||||||
|
~~~
|
||||||
|
d
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
e --- f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name |
|
||||||
|
| jacbk | primary | | land |
|
||||||
|
| ad | | ferry | sea |
|
||||||
|
| bd | | ferry | sea |
|
||||||
|
| cd | | ferry | sea |
|
||||||
|
| de | | ferry | sea |
|
||||||
|
| ef | primary | | pennydog-island |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | modes | locations |
|
||||||
|
| f,j | pennydog-island,sea,land,land | depart,notification right,turn left,arrive | driving,ferry,driving,driving | f,e,b,j |
|
||||||
|
|
||||||
|
Scenario: Switching Ferry in a Harbour
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
d
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
e - a ~ ~ ~ ~ b
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
c
|
||||||
|
|
|
||||||
|
f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name |
|
||||||
|
| ea | primary | | melee-island |
|
||||||
|
| ab | | ferry | melee-island-ferry |
|
||||||
|
| cf | primary | | monkey-island |
|
||||||
|
| bd | primary | | scabb-island |
|
||||||
|
| bc | primary | ferry | monkey-island-ferry |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | modes |
|
||||||
|
| e,f | melee-island,melee-island-ferry,monkey-island-ferry,monkey-island,monkey-island | depart,notification straight,turn right,notification straight,arrive | driving,ferry,ferry,driving,driving |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: End of Road Ferries
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a - b ~ ~ ~ ~ c ~ ~ ~ ~ ~ d - e
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
f
|
||||||
|
|
|
||||||
|
g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name |
|
||||||
|
| ab | primary | | land-left |
|
||||||
|
| de | primary | | land-right |
|
||||||
|
| gf | primary | | land-bottom |
|
||||||
|
| bcd | | ferry | ferry |
|
||||||
|
| fc | | ferry | ferry |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification straight,arrive |
|
||||||
|
|
||||||
|
Scenario: Fork Ferries
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a - b d - e
|
||||||
|
~ ~
|
||||||
|
~ ~
|
||||||
|
~ ~
|
||||||
|
~ ~
|
||||||
|
c
|
||||||
|
~
|
||||||
|
~
|
||||||
|
~
|
||||||
|
f
|
||||||
|
|
|
||||||
|
g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name |
|
||||||
|
| ab | primary | | land-left |
|
||||||
|
| de | primary | | land-right |
|
||||||
|
| gf | primary | | land-bottom |
|
||||||
|
| cb | | ferry | ferry |
|
||||||
|
| cd | | ferry | ferry |
|
||||||
|
| fc | | ferry | ferry |
|
||||||
|
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification right,arrive |
|
||||||
|
|
||||||
|
@negative
|
||||||
|
Scenario: Don't Detect Suppressed/Obvious Forks on Ferries
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
. . . . . . . . .d
|
||||||
|
a - b ~ ~ ~ ~ ~ c <
|
||||||
|
' ' ' ' ' ' ' ' 'e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name |
|
||||||
|
| ab | primary | | cursed-island |
|
||||||
|
| bc | | ferry | beagle |
|
||||||
|
| cd | service | | forker |
|
||||||
|
| ce | primary | | screw-me-not |
|
||||||
|
|
||||||
|
#the turns here could be better, but intersection classification shows you if you go left or right. But we cannot fork here
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | cursed-island,beagle,forker,forker | depart,notification straight,turn straight,arrive |
|
||||||
|
| a,e | cursed-island,beagle,screw-me-not,screw-me-not | depart,notification straight,turn straight,arrive |
|
||||||
|
|
||||||
|
@uturn @dead-end @ferry @via
|
||||||
|
Scenario: U-Turn on a dead-end ferry
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a - 1 - b ~ ~ ~ ~ ~ ~ ~ c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name |
|
||||||
|
| ab | primary | | land |
|
||||||
|
| bc | | ferry | sea |
|
||||||
|
|
||||||
|
# we actually cannot check the route here, since two possible routes are equally valid:
|
||||||
|
# (ab)(bcb1) and (abcb)(b1) are exactly the same. Luckily, we only want to check for
|
||||||
|
# not asserting here.
|
||||||
|
When I route I should get
|
||||||
|
| waypoints |
|
||||||
|
| a,b,1 |
|
||||||
@@ -143,37 +143,33 @@ Feature: Collapse
|
|||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n m
|
n m
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
g h
|
g h
|
||||||
|
c - b - a
|
||||||
|
d - e - f
|
||||||
c b a
|
j i
|
||||||
d e f
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
j i
|
| |
|
||||||
|
| |
|
||||||
|
k l
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
k l
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name | oneway | lanes |
|
||||||
| ab | primary | first | yes |
|
| ab | primary | first | yes | |
|
||||||
| bc | primary | first | yes |
|
| bc | primary | first | yes | |
|
||||||
| de | primary | first | yes |
|
| de | primary | first | yes | |
|
||||||
| ef | primary | first | yes |
|
| ef | primary | first | yes | |
|
||||||
| be | primary | first | no |
|
| be | primary | first | no | |
|
||||||
| ngbhm | primary | second | yes |
|
| ngbhm | primary | second | yes | 5 |
|
||||||
| liejk | primary | second | yes |
|
| liejk | primary | second | yes | 5 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -197,33 +193,37 @@ Feature: Collapse
|
|||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n m
|
n m
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
g h
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
c b a
|
g h
|
||||||
d e f
|
\ /
|
||||||
|
c - b - a
|
||||||
|
d - e - f
|
||||||
j i
|
/ \
|
||||||
|
j i
|
||||||
|
| |
|
||||||
|
| |
|
||||||
k l
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
k l
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name | oneway | lanes |
|
||||||
| ab | primary | first | yes |
|
| ab | primary | first | yes | |
|
||||||
| bc | primary | first | yes |
|
| bc | primary | first | yes | |
|
||||||
| de | primary | first | yes |
|
| de | primary | first | yes | |
|
||||||
| ef | primary | first | yes |
|
| ef | primary | first | yes | |
|
||||||
| be | primary | second | no |
|
| be | primary | second | no | |
|
||||||
| ngbhm | primary | second | yes |
|
| ngbhm | primary | second | yes | 5 |
|
||||||
| liejk | primary | second | yes |
|
| liejk | primary | second | yes | 5 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -353,13 +353,13 @@ Feature: Collapse
|
|||||||
| ge | primary | second | no |
|
| ge | primary | second | no |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||||
| a,f | first,first,first | depart,continue uturn,arrive |
|
| a,f | first,first,first | depart,continue uturn,arrive |
|
||||||
| a,g | first,second,second | depart,turn left,arrive |
|
| a,g | first,second,second | depart,turn left,arrive |
|
||||||
| d,g | first,second,second | depart,turn right,arrive |
|
| d,g | first,second,second | depart,turn right,arrive |
|
||||||
| g,f | second,first,first | depart,turn right,arrive |
|
| g,f | second,first,first | depart,turn right,arrive |
|
||||||
| g,c | second,first,first | depart,turn left,arrive |
|
| g,c | second,first,first | depart,end of road left,arrive |
|
||||||
|
|
||||||
Scenario: Do not collapse turning roads
|
Scenario: Do not collapse turning roads
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -425,18 +425,28 @@ Feature: Collapse
|
|||||||
Scenario: Pankenbruecke
|
Scenario: Pankenbruecke
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
j h i
|
k j
|
||||||
b c d e f g
|
| |
|
||||||
k a
|
| |
|
||||||
|
| |
|
||||||
|
a h
|
||||||
|
b
|
||||||
|
c
|
||||||
|
d
|
||||||
|
e
|
||||||
|
f-i
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name | oneway | lanes |
|
||||||
| kabhj | primary | inroad | yes |
|
| kabhj | primary | inroad | yes | 4 |
|
||||||
| bc | primary | inroad | no |
|
| bc | primary | inroad | no | |
|
||||||
| cd | primary | bridge | no |
|
| cd | primary | bridge | no | |
|
||||||
| defg | primary | outroad | no |
|
| defg | primary | outroad | no | |
|
||||||
| fi | primary | cross | no |
|
| fi | primary | cross | no | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
a b d
|
a - b-d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -26,7 +26,7 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
a b d
|
a - b-d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -43,7 +43,7 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
a b d
|
a - b-d
|
||||||
e
|
e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ Feature: Continue Instructions
|
|||||||
Scenario: Road turning right
|
Scenario: Road turning right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b d
|
a - b-d
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -80,9 +80,9 @@ Feature: Continue Instructions
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c
|
c
|
||||||
|
/
|
||||||
a b
|
a - b
|
||||||
d
|
`d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -98,9 +98,9 @@ Feature: Continue Instructions
|
|||||||
Scenario: Road turning slight right
|
Scenario: Road turning slight right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
d
|
,d
|
||||||
a b
|
a - b
|
||||||
|
\
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -117,11 +117,11 @@ Feature: Continue Instructions
|
|||||||
Scenario: Road Loop
|
Scenario: Road Loop
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f e
|
f - e
|
||||||
|
| |
|
||||||
a b g
|
a - b-g |
|
||||||
|
| |
|
||||||
c d
|
c - d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
a b . . c d
|
a b-----c-d
|
||||||
`h .
|
`--h |
|
||||||
`
|
||
|
||||||
1 `
|
1||
|
||||||
.
|
||
|
||||||
f
|
`f
|
||||||
.
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -36,16 +36,81 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| a,g | first,second,second | depart,turn right,arrive |
|
| a,g | first,second,second | depart,turn right,arrive |
|
||||||
| a,1 | first,, | depart,turn right,arrive |
|
| a,1 | first,, | depart,turn right,arrive |
|
||||||
|
|
||||||
|
Scenario: Turn Instead of Ramp
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
e
|
||||||
|
a b-----c-d
|
||||||
|
`--h |
|
||||||
|
||
|
||||||
|
1||
|
||||||
|
||
|
||||||
|
`f
|
||||||
|
|
|
||||||
|
g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway | route |
|
||||||
|
| abc | trunk | first | yes | |
|
||||||
|
| cd | trunk | first | yes | |
|
||||||
|
| bhf | trunk_link | | yes | ferry |
|
||||||
|
| cfg | primary | second | yes | |
|
||||||
|
| ec | primary | second | yes | |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | abc | cfg | c | no_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,g | first,,second,second | depart,turn right,turn straight,arrive |
|
||||||
|
|
||||||
|
Scenario: Turning Sliproad onto a ferry
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
e
|
||||||
|
a b-----c-d
|
||||||
|
`--h |
|
||||||
|
||
|
||||||
|
1||
|
||||||
|
||
|
||||||
|
`f
|
||||||
|
|
|
||||||
|
g
|
||||||
|
|
|
||||||
|
i
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway | route |
|
||||||
|
| abc | trunk | first | | |
|
||||||
|
| cd | trunk | first | | |
|
||||||
|
| bhf | trunk_link | | yes | |
|
||||||
|
| cf | primary | second | yes | |
|
||||||
|
| fg | primary | second | yes | ferry |
|
||||||
|
| ec | primary | second | yes | |
|
||||||
|
| gi | primary | second | yes | |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | abc | cf | c | no_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,i | first,,second,second,second | depart,turn right,turn straight,notification straight,arrive |
|
||||||
|
| a,1 | first,, | depart,turn right,arrive |
|
||||||
|
|
||||||
Scenario: Turn Instead of Ramp - Max-Speed
|
Scenario: Turn Instead of Ramp - Max-Speed
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
a-b-----c-------------------------d
|
a-b-----c-------------------------d
|
||||||
`h |
|
`--h |
|
||||||
||
|
||
|
||||||
1||
|
1||
|
||||||
`|
|
||
|
||||||
f
|
`f
|
||||||
|
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
@@ -72,18 +137,20 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
a b c d
|
|
|
||||||
h
|
…
|
||||||
|
a-b-----c--d
|
||||||
|
`--h …
|
||||||
|
\|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
f
|
f
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -101,14 +168,16 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
a b c d
|
|
|
||||||
h
|
…
|
||||||
|
a-b-----c-d
|
||||||
|
`--h …
|
||||||
|
\|
|
||||||
|
|
|
||||||
|
|
|
||||||
f
|
f
|
||||||
|
|
|
||||||
|
|
|
||||||
g
|
g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -125,15 +194,15 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Scenario: Inner city expressway with on road
|
Scenario: Inner city expressway with on road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b . . . c g
|
a b-------c-g
|
||||||
`f .
|
`--f |
|
||||||
`
|
\|
|
||||||
.
|
|
|
||||||
.
|
|
|
||||||
d
|
d
|
||||||
.
|
|
|
||||||
.
|
|
|
||||||
.
|
|
|
||||||
e
|
e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -157,12 +226,12 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a f
|
a f
|
||||||
|
| |
|
||||||
b e
|
b e
|
||||||
|
|\ /|
|
||||||
|
| | |
|
||||||
g
|
| g |
|
||||||
|
| |
|
||||||
c d
|
c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -180,11 +249,11 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a f
|
a f
|
||||||
|
| |
|
||||||
b e
|
b e
|
||||||
g
|
|\g/|
|
||||||
|
| |
|
||||||
|
| |
|
||||||
c d
|
c d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -281,23 +350,23 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Scenario: Self-Loop
|
Scenario: Self-Loop
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
l k
|
/-l-----k---\
|
||||||
j
|
/ `j--
|
||||||
m
|
m \
|
||||||
i
|
/ i
|
||||||
|
/ \
|
||||||
|
| \
|
||||||
h
|
| h
|
||||||
|
| |
|
||||||
n
|
n |
|
||||||
|
| |
|
||||||
g
|
| g
|
||||||
o
|
o |
|
||||||
|
/ /
|
||||||
f
|
| f
|
||||||
p
|
/- p /
|
||||||
e
|
/ e
|
||||||
a b c d
|
a ------- b --------------- c ----------------- d ---/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -316,23 +385,23 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Scenario: Self-Loop - Bidirectional
|
Scenario: Self-Loop - Bidirectional
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
l k
|
/-l-----k---\
|
||||||
j
|
/ `j--
|
||||||
m
|
m \
|
||||||
i
|
/ i
|
||||||
|
/ \
|
||||||
|
| \
|
||||||
h
|
| h
|
||||||
|
| |
|
||||||
n
|
n |
|
||||||
|
| |
|
||||||
g
|
| g
|
||||||
o
|
o |
|
||||||
|
/ /
|
||||||
f
|
| f
|
||||||
p
|
/- p /
|
||||||
e
|
/ e
|
||||||
a b c d
|
a ------- b --------------- c ----------------- d ---/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -349,31 +418,30 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
j
|
j
|
||||||
a b c d
|
a-b ----------------------------------------- c ------------d
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
e
|
e |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
1
|
\ 1
|
||||||
|
`---------- f ------- g ----------\
|
||||||
f g
|
| \
|
||||||
|
|
||||||
i h
|
i h
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -398,20 +466,20 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
Scenario: Turn Instead of Ramp
|
Scenario: Turn Instead of Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f
|
/--------------------f
|
||||||
g h
|
g-----------h--\ |
|
||||||
d e
|
d-----e
|
||||||
i c j
|
i c-----------j--/
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
b
|
b
|
||||||
|
|
|
||||||
a
|
a
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -783,6 +851,48 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
|
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
|
||||||
|
|
||||||
|
@sliproads:
|
||||||
|
Scenario: Throughabout-Sliproad
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
t
|
||||||
|
|
|
||||||
|
- - e - -
|
||||||
|
/ \
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
z - s - a - - - - - - - b - - -x
|
||||||
|
' c y
|
||||||
|
| |
|
||||||
|
\ /
|
||||||
|
- -d - -
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | junction | # |
|
||||||
|
| zs | through | trunk | yes | | |
|
||||||
|
| sa | through | trunk | yes | | |
|
||||||
|
| ab | through | trunk | yes | | |
|
||||||
|
| bx | through | trunk | yes | | |
|
||||||
|
| ac | round | primary | yes | roundabout | |
|
||||||
|
| cdy | round | primary | yes | roundabout | |
|
||||||
|
| yb | round | primary | yes | roundabout | |
|
||||||
|
| be | round | primary | yes | roundabout | |
|
||||||
|
| ea | round | primary | yes | roundabout | |
|
||||||
|
| et | out | primary | yes | | the extraterrestrial |
|
||||||
|
| sc | | trunk_link | yes | | |
|
||||||
|
| yx | right | trunk_link | yes | | |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | sa | ab | a | only_straight |
|
||||||
|
| restriction | ab | bx | b | only_straight |
|
||||||
|
| restriction | yb | be | b | only_straight |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | locations |
|
||||||
|
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
|
||||||
|
|
||||||
Scenario: Sliproad before a roundabout
|
Scenario: Sliproad before a roundabout
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -812,7 +922,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| bfm | | yes | primary | |
|
| bfm | | yes | primary | |
|
||||||
| gld | | yes | primary | |
|
| gld | | yes | primary | |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | bc | cd | c | only_straight |
|
| restriction | bc | cd | c | only_straight |
|
||||||
|
|
||||||
|
|||||||
@@ -16,28 +16,34 @@ Feature: Destination Signs
|
|||||||
m n
|
m n
|
||||||
o p
|
o p
|
||||||
q r
|
q r
|
||||||
|
s t
|
||||||
|
u v
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | ref | destination | destination:ref | oneway | # |
|
| nodes | name | ref | destination | destination:ref | destination:street | oneway | # |
|
||||||
| ab | AB | E1 | | | yes | |
|
| ab | AB | E1 | | | | yes | |
|
||||||
| cd | CD | | Berlin | | yes | |
|
| cd | CD | | Berlin | | | yes | |
|
||||||
| ef | EF | | Berlin | A1 | yes | |
|
| ef | EF | | Berlin | A1 | | yes | |
|
||||||
| gh | | | Berlin | A1 | yes | |
|
| gh | | | Berlin | A1 | | yes | |
|
||||||
| ij | | | Berlin | | yes | |
|
| ij | | | Berlin | | | yes | |
|
||||||
| kl | KL | E1 | Berlin | A1 | yes | |
|
| kl | KL | E1 | Berlin | A1 | | yes | |
|
||||||
| mn | MN | | Berlin;Hamburg | A1;A2 | yes | |
|
| mn | MN | | Berlin;Hamburg | A1;A2 | | yes | |
|
||||||
| op | OP | | Berlin;Hamburg | A1;A2 | no | mis-tagged destination: not a oneway |
|
| op | OP | | Berlin;Hamburg | A1;A2 | | no | mis-tagged destination: not a oneway |
|
||||||
| qr | QR | | | A1;A2 | yes | |
|
| qr | QR | | | A1;A2 | | yes | |
|
||||||
|
| st | ST | | | | St Street | yes | |
|
||||||
|
| uv | UV | | Berlin | | St Street | yes | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | destinations | ref | # |
|
| from | to | route | destinations | ref | # |
|
||||||
| a | b | AB,AB | , | E1,E1 | |
|
| a | b | AB,AB | , | E1,E1 | |
|
||||||
| c | d | CD,CD | Berlin,Berlin | , | |
|
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||||
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||||
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||||
| i | j | , | Berlin,Berlin | , | |
|
| i | j | , | Berlin,Berlin | , | |
|
||||||
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||||
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||||
| o | p | OP,OP | , | , | guard against mis-tagging |
|
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||||
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||||
|
| s | t | ST,ST | St Street,St Street | , | |
|
||||||
|
| u | v | UV,UV | Berlin,Berlin | , | city preferred over street |
|
||||||
|
|||||||
@@ -24,6 +24,44 @@ Feature: End Of Road Instructions
|
|||||||
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
||||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||||
|
|
||||||
|
@3605
|
||||||
|
Scenario: End of Road with oneway through street
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
c
|
||||||
|
a e b
|
||||||
|
f d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway |
|
||||||
|
| aeb | primary | no |
|
||||||
|
| cbd | primary | yes |
|
||||||
|
| ef | primary | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||||
|
|
||||||
|
@3605
|
||||||
|
Scenario: End of Road fromnameless onto through street
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
c
|
||||||
|
a e b
|
||||||
|
f d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway | name |
|
||||||
|
| aeb | primary | no | |
|
||||||
|
| cbd | primary | yes | cbd |
|
||||||
|
| ef | primary | no | ef |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | ,cbd,cbd | depart,end of road right,arrive |
|
||||||
|
|
||||||
Scenario: End of Road with three streets
|
Scenario: End of Road with three streets
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -0,0 +1,525 @@
|
|||||||
|
@guidance @merge-segregated
|
||||||
|
Feature: Merge Segregated Roads
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 3 meters
|
||||||
|
|
||||||
|
#http://www.openstreetmap.org/#map=18/52.49950/13.33916
|
||||||
|
@negative
|
||||||
|
Scenario: oneway link road
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
f - - - - - - -_-_e - - - - d
|
||||||
|
...''
|
||||||
|
a - - - b'- - - - - - - - - c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| abc | road | yes |
|
||||||
|
| def | road | yes |
|
||||||
|
| be | road | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,c | road,road | true:90,true:75 true:90 false:270;true:270 |
|
||||||
|
| d,f | road,road | true:270,false:90 false:255 true:270;true:90 |
|
||||||
|
|
||||||
|
#http://www.openstreetmap.org/#map=18/52.48337/13.36184
|
||||||
|
@negative
|
||||||
|
Scenario: Square Area - Same Name as road for in/out
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
i
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
g
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
a - - - - c e - - - - f
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
d
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
j
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ac | road | no |
|
||||||
|
| ef | road | no |
|
||||||
|
| cdegc | road | yes |
|
||||||
|
| ig | top | no |
|
||||||
|
| jd | bot | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,f | road,road,road,road | true:90,false:45 true:135 false:270;true:45 true:180 false:315;true:90 false:225 true:315;true:270 |
|
||||||
|
|
||||||
|
#https://www.openstreetmap.org/#map=19/52.50003/13.33915
|
||||||
|
@negative
|
||||||
|
Scenario: Short Segment due to different roads
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
. d
|
||||||
|
. '
|
||||||
|
. '
|
||||||
|
. '
|
||||||
|
. '
|
||||||
|
a - - - - - - - b - - c - - - - - - e
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
.
|
||||||
|
f
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| abce | pass | no |
|
||||||
|
| db | pass | yes |
|
||||||
|
| fg | aug | no |
|
||||||
|
| bfc | aug | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,e | pass,pass | true:90,false:60 true:90 true:165 false:270,true:90 false:195 false:270;true:270 |
|
||||||
|
|
||||||
|
@negative
|
||||||
|
Scenario: Tripple Merge should not be possible
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
||||||
|
.
|
||||||
|
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
||||||
|
'
|
||||||
|
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | in | no |
|
||||||
|
| gfb | merge | yes |
|
||||||
|
| be | merge | yes |
|
||||||
|
| dcb | merge | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,e | in,merge,merge | true:90;false:60 true:90 false:120 false:270;true:270 |
|
||||||
|
|
||||||
|
Scenario: Tripple Merge should not be possible
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
||||||
|
.
|
||||||
|
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
||||||
|
'
|
||||||
|
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | in | no |
|
||||||
|
| gfb | merge | yes |
|
||||||
|
| eb | merge | yes |
|
||||||
|
| bcd | merge | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,d | in,merge,merge | true:90;false:60 false:90 true:120 false:270;true:270 |
|
||||||
|
|
||||||
|
@negative
|
||||||
|
Scenario: Don't accept turn-restrictions
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||||
|
/ \
|
||||||
|
a - - - b g - - h
|
||||||
|
\ /
|
||||||
|
e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | yes |
|
||||||
|
| befgh | road | yes |
|
||||||
|
| bcdg | road | yes |
|
||||||
|
|
||||||
|
# This is an artificial scenario - not reasonable. It is only to test the merging on turn-restrictions
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | ab | bcdg | b | no_left_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,h | road,road | true:90,false:60 true:120 false:270,true:90 false:240 false:300;true:270 |
|
||||||
|
|
||||||
|
@negative
|
||||||
|
Scenario: Actual Turn into segregated ways
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a - - - b - < - < - < - < - < - < - < - < - < - < - < c -
|
||||||
|
| \
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
d |
|
||||||
|
\ |
|
||||||
|
\ |
|
||||||
|
e > - > - > - > - > - > - > - > - > - > - > f - - - - - - g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | no |
|
||||||
|
| fcb | road | yes |
|
||||||
|
| bdef | road | yes |
|
||||||
|
| fg | road | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,g | road,road | true:90,false:90 true:150 false:270,true:90 false:270 true:345;true:270 |
|
||||||
|
|
||||||
|
Scenario: Merging parallel roads with intermediate bridges
|
||||||
|
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||||
|
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
f
|
||||||
|
|
|
||||||
|
.e.
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
g d
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
h c
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
b
|
||||||
|
|
|
||||||
|
a
|
||||||
|
|
|
||||||
|
|
|
||||||
|
r - x - s
|
||||||
|
|
|
||||||
|
|
|
||||||
|
y
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | lanes |
|
||||||
|
| ab | Hermannstr | secondary | | 2 |
|
||||||
|
| bc | Hermannstr | secondary | yes | 2 |
|
||||||
|
| cd | Hermannbruecke | secondary | yes | 2 |
|
||||||
|
| de | Hermannstr | secondary | yes | 2 |
|
||||||
|
| ef | Hermannstr | secondary | | 4 |
|
||||||
|
| eg | Hermannstr | secondary | yes | 2 |
|
||||||
|
| gh | Hermannbruecke | secondary | yes | 2 |
|
||||||
|
| hb | Hermannstr | secondary | yes | 2 |
|
||||||
|
| xa | Hermannstr | secondary | | 4 |
|
||||||
|
| yx | Hermannstr | secondary | | 4 |
|
||||||
|
| rxs | Silbersteinstr | tertiary | | 1 |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| x | traffic_signals |
|
||||||
|
|
||||||
|
#the intermediate intersections of degree two indicate short segments of new names. At some point, we probably want to get rid of these
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route | intersections |
|
||||||
|
| a,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 false:180,true:0 false:180;true:180 |
|
||||||
|
| f,a | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180;true:0 |
|
||||||
|
| y,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 true:90 false:180 true:270,true:0 false:180,true:0 false:180;true:180 |
|
||||||
|
| f,y | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180,false:0 true:90 true:180 true:270;true:0 |
|
||||||
|
|
||||||
|
Scenario: Four Way Intersection Double Through Street Segregated
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
q p
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
b c
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
j - - - - - - - - - - - - - - - - - i . \ / , d - - - - - - - - - - - - - - - - - o
|
||||||
|
. \/ .
|
||||||
|
> a <
|
||||||
|
. /\ '
|
||||||
|
. / \ '
|
||||||
|
k - - - - - - - - - - - - - - - - - h / \ e - - - - - - - - - - - - - - - - - n
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
g f
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
l m
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway | name | lanes |
|
||||||
|
| khaij | primary | yes | first | 4 |
|
||||||
|
| odaen | primary | yes | first | 4 |
|
||||||
|
| qbacp | primary | yes | second | 4 |
|
||||||
|
| mfagl | primary | yes | second | 4 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| f,e | second,first,first | depart,turn right,arrive |
|
||||||
|
| f,c | second,second | depart,arrive |
|
||||||
|
| f,i | second,first,first | depart,turn left,arrive |
|
||||||
|
| f,g | second,second,second | depart,continue uturn,arrive |
|
||||||
|
| d,c | first,second,second | depart,turn right,arrive |
|
||||||
|
| d,i | first,first | depart,arrive |
|
||||||
|
| d,g | first,second,second | depart,turn left,arrive |
|
||||||
|
| d,e | first,first,first | depart,continue uturn,arrive |
|
||||||
|
| b,i | second,first,first | depart,turn right,arrive |
|
||||||
|
| b,g | second,second | depart,arrive |
|
||||||
|
| b,e | second,first,first | depart,turn left,arrive |
|
||||||
|
| b,c | second,second,second | depart,continue uturn,arrive |
|
||||||
|
| h,g | first,second,second | depart,turn right,arrive |
|
||||||
|
| h,e | first,first | depart,arrive |
|
||||||
|
| h,c | first,second,second | depart,turn left,arrive |
|
||||||
|
| h,i | first,first,first | depart,continue uturn,arrive |
|
||||||
|
|
||||||
|
Scenario: Middle Island Over Bridge
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
|
|
||||||
|
.b.
|
||||||
|
c h
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
1 2
|
||||||
|
| |
|
||||||
|
d g
|
||||||
|
'e'
|
||||||
|
|
|
||||||
|
f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | no |
|
||||||
|
| ef | road | no |
|
||||||
|
| bc | road | yes |
|
||||||
|
| cd | bridge | yes |
|
||||||
|
| de | road | yes |
|
||||||
|
| eg | road | yes |
|
||||||
|
| gh | bridge | yes |
|
||||||
|
| hb | road | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route | intersections |
|
||||||
|
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
|
||||||
|
| c,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
|
||||||
|
| 1,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
|
||||||
|
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
|
||||||
|
| g,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
|
||||||
|
| 2,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
|
||||||
|
|
||||||
|
@negative
|
||||||
|
Scenario: Traffic Circle
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a - - - - b - - - e - - - c - - - - d
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
f
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | left | no |
|
||||||
|
| bfceb | circle | yes |
|
||||||
|
| fg | bottom | no |
|
||||||
|
| cd | right | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
|
||||||
|
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
|
||||||
|
|
||||||
|
Scenario: Middle Island
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
|
|
||||||
|
b
|
||||||
|
c h
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
d g
|
||||||
|
e
|
||||||
|
|
|
||||||
|
f
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | no |
|
||||||
|
| ef | road | no |
|
||||||
|
| bcde | road | yes |
|
||||||
|
| eghb | road | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,f | depart,arrive | road,road |
|
||||||
|
| c,f | depart,arrive | road,road |
|
||||||
|
| f,a | depart,arrive | road,road |
|
||||||
|
| g,a | depart,arrive | road,road |
|
||||||
|
|
||||||
|
Scenario: Traffic Island
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
f
|
||||||
|
a - - b < > d - - e
|
||||||
|
c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | no |
|
||||||
|
| de | road | no |
|
||||||
|
| bcdfb | road | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,e | road,road | true:90;true:270 |
|
||||||
|
|
||||||
|
@negative
|
||||||
|
Scenario: Turning Road, Don't remove sliproads
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
h - - - - - g - - - - - - f - - - - - e
|
||||||
|
_ '
|
||||||
|
.
|
||||||
|
a - - - - - b - - - - - - c - - - - - d
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
i
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | road | yes |
|
||||||
|
| bcd | road | yes |
|
||||||
|
| efgh | road | yes |
|
||||||
|
| fb | road | yes |
|
||||||
|
| bi | turn | yes |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | fb | bcd | b | no_left_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | intersections |
|
||||||
|
| a,d | road,road | depart,arrive | true:90,false:60 true:90 true:180 false:270;true:270 |
|
||||||
|
| e,h | road,road | depart,arrive | true:270,false:90 true:240 true:270;true:90 |
|
||||||
|
| e,i | road,turn,turn | depart,turn left,arrive | true:270;false:90 true:240 true:270,false:60 false:90 true:180 false:270;true:0 |
|
||||||
|
@negative
|
||||||
|
Scenario: Meeting Turn Roads
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
k l
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
h - - - - - g - - - - - - - f - - - - - e
|
||||||
|
| ' ' |
|
||||||
|
| x |
|
||||||
|
| . . |
|
||||||
|
a - - - - - b - - - - - - - c - - - - - d
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
i j
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| ab | horiz | yes |
|
||||||
|
| bc | horiz | yes |
|
||||||
|
| cd | horiz | yes |
|
||||||
|
| ef | horiz | yes |
|
||||||
|
| fg | horiz | yes |
|
||||||
|
| gh | horiz | yes |
|
||||||
|
| kg | vert | yes |
|
||||||
|
| gb | vert | yes |
|
||||||
|
| bi | vert | yes |
|
||||||
|
| jc | vert | yes |
|
||||||
|
| cf | vert | yes |
|
||||||
|
| fl | vert | yes |
|
||||||
|
| gx | horiz | no |
|
||||||
|
| xc | horiz | no |
|
||||||
|
| fx | horiz | no |
|
||||||
|
| xb | horiz | no |
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | bc | cf | c | no_left_turn |
|
||||||
|
| restriction | fg | gb | g | no_left_turn |
|
||||||
|
| restriction | cf | fg | f | no_left_turn |
|
||||||
|
| restriction | gb | bc | b | no_left_turn |
|
||||||
|
| restriction | xb | bc | b | no_left_turn |
|
||||||
|
| restriction | xc | cf | c | no_left_turn |
|
||||||
|
| restriction | xf | fg | f | no_left_turn |
|
||||||
|
| restriction | xg | gb | g | no_left_turn |
|
||||||
|
|
||||||
|
# the goal here should be not to mention the intersection in the middle at all and also suppress the segregated parts
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | intersections |
|
||||||
|
| a,l | horiz,vert,vert | true:90;false:0 true:60 true:90 true:180 false:270,true:60 true:120 false:240 true:300,true:0 false:90 false:180 false:240 false:270;true:180 |
|
||||||
|
| 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,true:60 false:120 true:240 true:300,false:0 false:90 false:120 false: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 |
|
||||||
@@ -8,8 +8,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Right
|
Scenario: Ramp Exit Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d e
|
a-b-c-d-e
|
||||||
f g
|
`--f-g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -25,9 +25,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Right Curved Right
|
Scenario: Ramp Exit Right Curved Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c
|
a-b-c
|
||||||
f d
|
`f`d
|
||||||
g e
|
`g`e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -43,12 +43,11 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Right Curved Left
|
Scenario: Ramp Exit Right Curved Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
,e
|
||||||
d g
|
,d,g
|
||||||
a b c f
|
a-b-c-f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | oneway |
|
| nodes | highway | oneway |
|
||||||
| abcde | motorway | |
|
| abcde | motorway | |
|
||||||
@@ -63,8 +62,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Left
|
Scenario: Ramp Exit Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f g
|
/--f-g
|
||||||
a b c d e
|
a-b-c-d-e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -80,9 +79,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Left Curved Left
|
Scenario: Ramp Exit Left Curved Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
g e
|
,g,e
|
||||||
f d
|
,f,d
|
||||||
a b c
|
a-b-c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -98,9 +97,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Ramp Exit Left Curved Right
|
Scenario: Ramp Exit Left Curved Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c f
|
a-b-c-f
|
||||||
d g
|
`d`g
|
||||||
e
|
`e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -116,8 +115,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On Ramp Right
|
Scenario: On Ramp Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d e
|
a-b-c-d-e
|
||||||
f g
|
f-g---'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -133,8 +132,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On Ramp Left
|
Scenario: On Ramp Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f g
|
f-g---,
|
||||||
a b c d e
|
a-b-c-d-e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -150,9 +149,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Highway Fork
|
Scenario: Highway Fork
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
d e
|
/--d-e
|
||||||
a b c
|
a-b-c
|
||||||
f g
|
\--f-g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -168,9 +167,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Fork After Ramp
|
Scenario: Fork After Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
d e
|
/--d-e
|
||||||
a b c
|
a-b-c
|
||||||
f g
|
\--f-g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -187,8 +186,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On And Off Ramp Right
|
Scenario: On And Off Ramp Right
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d e
|
a-b---c---d-e
|
||||||
f g h i
|
f-g--/ \--h i
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -207,8 +206,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: On And Off Ramp Left
|
Scenario: On And Off Ramp Left
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f g h i
|
f-g--\/---h-i
|
||||||
a b c d e
|
a-b---c---d-e
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -227,9 +226,9 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Merging Motorways
|
Scenario: Merging Motorways
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e\
|
||||||
a b c
|
a-b-c
|
||||||
d
|
d/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -246,8 +245,8 @@ Feature: Motorway Guidance
|
|||||||
Scenario: Handle 90 degree off ramps correctly
|
Scenario: Handle 90 degree off ramps correctly
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a
|
a\
|
||||||
x b c y
|
x-b---c-y
|
||||||
d
|
d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -13,23 +13,28 @@ Feature: Simple Turns
|
|||||||
^
|
^
|
||||||
/ \
|
/ \
|
||||||
c d
|
c d
|
||||||
|\
|
| |\
|
||||||
| e
|
| | e
|
||||||
|
|
| |
|
||||||
f
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
g f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway |
|
| nodes | name | highway | oneway |
|
||||||
| ab | road | primary | no |
|
| ab | road | primary | no |
|
||||||
| bc | road | primary | yes |
|
| bcg | road | primary | yes |
|
||||||
| fdb | road | primary | yes |
|
| fdb | road | primary | yes |
|
||||||
| de | turn | primary | no |
|
| ed | turn | primary | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route |
|
| waypoints | turns | route | intersections |
|
||||||
| f,a | depart,arrive | road,road |
|
| f,a | depart,arrive | road,road | true:0,true:0 false:150 false:180;true:180 |
|
||||||
| e,a | depart,turn slight right,arrive | turn,road,road |
|
| e,a | depart,turn slight right,arrive | turn,road,road | true:333;true:0 false:150 false:180;true:180 |
|
||||||
|
|
||||||
Scenario: Turning into splitting road
|
Scenario: Turning into splitting road
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -39,16 +44,22 @@ Feature: Simple Turns
|
|||||||
/\
|
/\
|
||||||
/ \
|
/ \
|
||||||
c d
|
c d
|
||||||
|\
|
| |\
|
||||||
| e
|
| | e
|
||||||
|
|
| |
|
||||||
f
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
h f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | oneway |
|
| nodes | name | highway | oneway |
|
||||||
| ab | road | primary | no |
|
| ab | road | primary | no |
|
||||||
| bc | road | primary | yes |
|
| bch | road | primary | yes |
|
||||||
| fdb | road | primary | yes |
|
| fdb | road | primary | yes |
|
||||||
| de | turn | primary | no |
|
| de | turn | primary | no |
|
||||||
| bg | left | primary | yes |
|
| bg | left | primary | yes |
|
||||||
@@ -61,108 +72,6 @@ Feature: Simple Turns
|
|||||||
| f,g | depart,turn left,arrive | road,left,left |
|
| f,g | depart,turn left,arrive | road,left,left |
|
||||||
| f,c | depart,continue uturn,arrive | road,road,road |
|
| f,c | depart,continue uturn,arrive | road,road,road |
|
||||||
|
|
||||||
Scenario: Middle Island
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
|
|
||||||
b
|
|
||||||
c h
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
d g
|
|
||||||
e
|
|
||||||
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | no |
|
|
||||||
| ef | road | no |
|
|
||||||
| bcde | road | yes |
|
|
||||||
| eghb | road | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route |
|
|
||||||
| a,f | depart,arrive | road,road |
|
|
||||||
| c,f | depart,arrive | road,road |
|
|
||||||
| f,a | depart,arrive | road,road |
|
|
||||||
| g,a | depart,arrive | road,road |
|
|
||||||
|
|
||||||
Scenario: Middle Island Over Bridge
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
a
|
|
||||||
|
|
|
||||||
.b.
|
|
||||||
c h
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
1 2
|
|
||||||
| |
|
|
||||||
d g
|
|
||||||
'e'
|
|
||||||
|
|
|
||||||
f
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | road | no |
|
|
||||||
| ef | road | no |
|
|
||||||
| bc | road | yes |
|
|
||||||
| cd | bridge | yes |
|
|
||||||
| de | road | yes |
|
|
||||||
| eg | road | yes |
|
|
||||||
| gh | bridge | yes |
|
|
||||||
| hb | road | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route |
|
|
||||||
| a,f | depart,arrive | road,road |
|
|
||||||
| c,f | depart,new name straight,arrive | bridge,road,road |
|
|
||||||
| 1,f | depart,new name straight,arrive | bridge,road,road |
|
|
||||||
| f,a | depart,arrive | road,road |
|
|
||||||
| g,a | depart,new name straight,arrive | bridge,road,road |
|
|
||||||
| 2,a | depart,new name straight,arrive | bridge,road,road |
|
|
||||||
|
|
||||||
@negative
|
|
||||||
Scenario: Don't Collapse Places:
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
h
|
|
||||||
g
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
a b e f
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
c
|
|
||||||
d
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | oneway |
|
|
||||||
| ab | place | no |
|
|
||||||
| cd | bottom | no |
|
|
||||||
| ef | place | no |
|
|
||||||
| gh | top | no |
|
|
||||||
| bcegb | place | yes |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route |
|
|
||||||
| a,d | depart,turn right,arrive | place,bottom,bottom |
|
|
||||||
| a,f | depart,continue left,continue right,arrive | place,place,place,place |
|
|
||||||
| d,f | depart,turn right,continue right,arrive | bottom,place,place,place |
|
|
||||||
| d,h | depart,turn right,continue left,turn right,arrive | bottom,place,place,top,top |
|
|
||||||
|
|
||||||
@bug @not-sorted @3179
|
@bug @not-sorted @3179
|
||||||
Scenario: Adjusting road angles to not be sorted
|
Scenario: Adjusting road angles to not be sorted
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -271,8 +271,8 @@ Feature: Ramp Guidance
|
|||||||
| bc | | ferry | boaty mc boatface | m2 |
|
| bc | | ferry | boaty mc boatface | m2 |
|
||||||
| cf | | ferry | boaty mc boatface | |
|
| cf | | ferry | boaty mc boatface | |
|
||||||
| cd | | ferry | boaty mc boatface's cousin | |
|
| cd | | ferry | boaty mc boatface's cousin | |
|
||||||
| de | motorway_link | | | |
|
| de | motorway_link | | | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route |
|
| waypoints | route |
|
||||||
| a,e | boarding,boaty mc boatface,boaty mc boatface's cousin,, |
|
| a,e | boarding,boaty mc boatface,, |
|
||||||
|
|||||||
@@ -535,3 +535,149 @@ Feature: Basic Roundabout
|
|||||||
| i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
|
| i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
|
||||||
| i,d | Petersburger Strasse,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,arrive |
|
| i,d | Petersburger Strasse,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,arrive |
|
||||||
| i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,arrive |
|
| i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,arrive |
|
||||||
|
|
||||||
|
@turboroundabout
|
||||||
|
# http://www.openstreetmap.org/?mlat=48.782118&mlon=8.194456&zoom=16#map=19/48.78216/8.19457
|
||||||
|
Scenario: Turboroundabout, Baden-Baden
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a p
|
||||||
|
b o
|
||||||
|
d c m n
|
||||||
|
f e k l
|
||||||
|
g i
|
||||||
|
h j
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway | junction | name | turn:lanes |
|
||||||
|
| ab | trunk_link | yes | | | |
|
||||||
|
| bc | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
||||||
|
| cd | trunk | yes | | Europastrasse | |
|
||||||
|
| ce | trunk | yes | roundabout | Europaplatz | |
|
||||||
|
| fe | trunk | yes | | Europastrasse | |
|
||||||
|
| eg | trunk | yes | roundabout | Europaplatz | |
|
||||||
|
| gh | residential | yes | | Allee Cite | |
|
||||||
|
| gi | trunk | yes | roundabout | Europaplatz | |
|
||||||
|
| ji | residential | yes | | Allee Cite | |
|
||||||
|
| ik | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
||||||
|
| kl | trunk | yes | | Europastrasse | |
|
||||||
|
| km | trunk | yes | roundabout | Europaplatz | |
|
||||||
|
| nm | trunk | yes | | Europastrasse | |
|
||||||
|
| mo | trunk | yes | roundabout | Europaplatz | |
|
||||||
|
| op | trunk_link | yes | | | |
|
||||||
|
| ob | trunk | yes | roundabout | Europaplatz | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive | ,, |
|
||||||
|
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive | ,, |
|
||||||
|
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive | ,, |
|
||||||
|
| a,p | ,, | depart,Europaplatz-exit-4,arrive | ,, |
|
||||||
|
|
||||||
|
@turboroundabout
|
||||||
|
# http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506
|
||||||
|
Scenario: Turboroundabout, Königstein im Taunus
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
b w t v
|
||||||
|
c s u
|
||||||
|
d r
|
||||||
|
f e q
|
||||||
|
g p
|
||||||
|
h i n
|
||||||
|
j k m
|
||||||
|
l o
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway | junction | name | turn:lanes |
|
||||||
|
| ab | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||||
|
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||||
|
| bc | primary | yes | roundabout | | through\|through;right |
|
||||||
|
| cd | primary | yes | roundabout | | through\|through\|right;through |
|
||||||
|
| df | tertiary | yes | | Frankfurter Strasse | |
|
||||||
|
| de | primary | yes | roundabout | | through\|through\|right;through |
|
||||||
|
| fe | tertiary | yes | | Frankfurter Strasse | |
|
||||||
|
| eg | primary | yes | roundabout | | through\|through\|right;through |
|
||||||
|
| gh | primary | yes | | Bischof-Kaller-Strasse | |
|
||||||
|
| gi | primary | yes | roundabout | | left\|through;slight_left\|through |
|
||||||
|
| ji | primary | yes | | Bischof-Kaller-Strasse | |
|
||||||
|
| ik | primary | yes | roundabout | | left\|through;slight_left\|through |
|
||||||
|
| km | primary | yes | roundabout | | |
|
||||||
|
| kl | primary | yes | | Sodener Strasse | |
|
||||||
|
| mn | primary | yes | roundabout | | through\|through;right |
|
||||||
|
| on | primary | yes | | Sodener Strasse | |
|
||||||
|
| np | primary | yes | roundabout | | through\|through;right |
|
||||||
|
| pq | primary | yes | roundabout | | through\|through\|right;through |
|
||||||
|
| qr | primary | yes | | | |
|
||||||
|
| qs | primary | yes | roundabout | | |
|
||||||
|
| us | primary_link | yes | | | |
|
||||||
|
| st | primary | yes | roundabout | | |
|
||||||
|
| vt | primary | yes | | | |
|
||||||
|
| tw | primary | yes | roundabout | | left\|left\|right\|right |
|
||||||
|
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||||
|
| wb | primary | yes | roundabout | | through\|through;right |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive | ,, |
|
||||||
|
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive | ,, |
|
||||||
|
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive | ,, |
|
||||||
|
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive | ,, |
|
||||||
|
| u,r | ,, | depart,roundabout-exit-5,arrive | ,, |
|
||||||
|
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive | ,, |
|
||||||
|
| n,m | , | depart,arrive | , |
|
||||||
|
|
||||||
|
@turboroundabout
|
||||||
|
# http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711
|
||||||
|
Scenario: Turboroundabout, Rheinfelden (Baden)
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
r w
|
||||||
|
a l k
|
||||||
|
b j
|
||||||
|
c
|
||||||
|
d i
|
||||||
|
s e f g h v
|
||||||
|
|
||||||
|
t u
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway | junction |
|
||||||
|
| ar | secondary | yes | |
|
||||||
|
| ab | primary | yes | roundabout |
|
||||||
|
| rb | secondary | yes | |
|
||||||
|
| bc | primary | yes | roundabout |
|
||||||
|
| cd | primary | yes | roundabout |
|
||||||
|
| ds | primary | yes | |
|
||||||
|
| se | primary | yes | |
|
||||||
|
| de | primary | yes | roundabout |
|
||||||
|
| ef | primary | yes | roundabout |
|
||||||
|
| ft | unclassified | yes | |
|
||||||
|
| fg | primary | yes | roundabout |
|
||||||
|
| ug | unclassified | yes | |
|
||||||
|
| gh | primary | yes | roundabout |
|
||||||
|
| hv | primary | yes | |
|
||||||
|
| hi | primary | yes | roundabout |
|
||||||
|
| vi | primary | yes | |
|
||||||
|
| ij | primary | yes | roundabout |
|
||||||
|
| jw | tertiary | yes | |
|
||||||
|
| jk | primary | yes | roundabout |
|
||||||
|
| wk | tertiary | yes | |
|
||||||
|
| kl | primary | yes | roundabout |
|
||||||
|
| la | primary | yes | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| w,r | wk,ar,ar | depart,roundabout-exit-1,arrive |
|
||||||
|
| w,s | wk,ds,ds | depart,roundabout-exit-2,arrive |
|
||||||
|
| w,t | wk,ft,ft | depart,roundabout-exit-3,arrive |
|
||||||
|
| w,v | wk,hv,hv | depart,roundabout-exit-4,arrive |
|
||||||
|
| u,v | ug,hv,hv | depart,roundabout-exit-1,arrive |
|
||||||
|
| u,w | ug,jw,jw | depart,roundabout-exit-2,arrive |
|
||||||
|
| u,r | ug,ar,ar | depart,roundabout-exit-3,arrive |
|
||||||
|
| u,s | ug,ds,ds | depart,roundabout-exit-4,arrive |
|
||||||
|
| u,t | ug,ft,ft | depart,roundabout-exit-5,arrive |
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ Feature: Staggered Intersections
|
|||||||
j
|
j
|
||||||
a b c
|
a b c
|
||||||
d
|
d
|
||||||
e f g
|
e f g
|
||||||
h
|
h
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Do not announce passing a exit ramp
|
Scenario: Do not announce passing a exit ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d e
|
a-b-c-d-e
|
||||||
f g
|
\---f-g
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -24,7 +24,7 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Do not announce reference changes
|
Scenario: Do not announce reference changes
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d e f
|
a-b-c-d-e-f
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -43,7 +43,7 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Don't Announce Turn on following major road class -- service
|
Scenario: Don't Announce Turn on following major road class -- service
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b d
|
a-b-d
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Feature: Suppressed Turns
|
|||||||
Scenario: Don't Announce Turn on following major road class -- residential
|
Scenario: Don't Announce Turn on following major road class -- residential
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b d
|
a-b-d
|
||||||
c
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -768,7 +768,31 @@ Feature: Simple Turns
|
|||||||
|
|
||||||
. .
|
. .
|
||||||
|
|
||||||
g h
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
. .
|
||||||
|
|
||||||
|
g h
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the nodes
|
And the nodes
|
||||||
@@ -784,15 +808,15 @@ Feature: Simple Turns
|
|||||||
| cjk | Friede | no | | tertiary |
|
| cjk | Friede | no | | tertiary |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns | intersections |
|
||||||
| a,g | Perle,Heide,Heide | depart,turn right,arrive |
|
| a,g | Perle,Heide,Heide | depart,turn right,arrive | true:90;true:90 true:180 false:270 true:345;true:18 |
|
||||||
| a,k | Perle,Friede,Friede | depart,turn left,arrive |
|
| a,k | Perle,Friede,Friede | depart,turn left,arrive | true:90;true:90 true:180 false:270 true:345;true:153 |
|
||||||
| a,e | Perle,Perle | depart,arrive |
|
| a,e | Perle,Perle | depart,arrive | true:90,true:90 true:180 false:270 true:345;true:270 |
|
||||||
| e,k | Perle,Friede,Friede | depart,turn right,arrive |
|
| e,k | Perle,Friede,Friede | depart,turn right,arrive | true:270;false:90 true:180 true:270 true:345;true:153 |
|
||||||
| e,g | Perle,Heide,Heide | depart,turn left,arrive |
|
| e,g | Perle,Heide,Heide | depart,turn left,arrive | true:270;false:90 true:180 true:270 true:345;true:18 |
|
||||||
| h,k | Heide,Friede,Friede | depart,new name slight left,arrive |
|
| h,k | Heide,Friede,Friede | depart,new name straight,arrive | true:16;true:90 true:180 true:270 true:345;true:153 |
|
||||||
| h,e | Heide,Perle,Perle | depart,turn right,arrive |
|
| h,e | Heide,Perle,Perle | depart,turn right,arrive | true:16;true:90 true:180 true:270 true:345;true:270 |
|
||||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive |
|
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:180 true:270 true:345;true:90 |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
||||||
Scenario: Curved Exit from Curved Road
|
Scenario: Curved Exit from Curved Road
|
||||||
@@ -930,6 +954,36 @@ Feature: Simple Turns
|
|||||||
. . .
|
. . .
|
||||||
. . .
|
. . .
|
||||||
i . .
|
i . .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
|
. .
|
||||||
e a
|
e a
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -1304,7 +1358,7 @@ Feature: Simple Turns
|
|||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
g a - - -b
|
ga - - -b
|
||||||
f /
|
f /
|
||||||
d -c
|
d -c
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -599,22 +599,21 @@ Feature: Turn Lane Guidance
|
|||||||
Scenario: Segregated Intersection Merges With Lanes
|
Scenario: Segregated Intersection Merges With Lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
f
|
a e
|
||||||
|
| |
|
||||||
e d
|
| |
|
||||||
c g
|
b d
|
||||||
a b
|
h c
|
||||||
|
' -- g - - f
|
||||||
h
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | turn:lanes:forward | oneway | highway |
|
| nodes | name | turn:lanes:forward | oneway | highway | lanes |
|
||||||
| abc | road | left\|left\|left\|through\|through | yes | primary |
|
| abc | road | left\|left\|left\|through\|through | yes | primary | 5 |
|
||||||
| cde | road | | yes | primary |
|
| cde | road | | yes | primary | 3 |
|
||||||
| hc | cross | | yes | secondary |
|
| hc | cross | | yes | secondary | |
|
||||||
| cg | straight | | no | tertiary |
|
| cg | straight | | no | tertiary | |
|
||||||
| cf | left | | yes | primary |
|
| cf | left | | yes | primary | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
@@ -1159,3 +1158,45 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | bearings | route | turns |
|
| waypoints | bearings | route | turns |
|
||||||
| 1,a | 90,2 180,180 | | |
|
| 1,a | 90,2 180,180 | | |
|
||||||
|
|
||||||
|
@3379
|
||||||
|
Scenario: Don't Turn through potential through lanes
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
d
|
||||||
|
|
|
||||||
|
a - - - - b - - - - - c
|
||||||
|
|
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway | turn:lanes:forward |
|
||||||
|
| ab | road | yes | left\|none\|none |
|
||||||
|
| bc | road | yes | |
|
||||||
|
| ebd | cross | no | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
|
||||||
|
| a,c | road,road | depart,arrive | , |
|
||||||
|
|
||||||
|
@3379
|
||||||
|
Scenario: Don't Turn through potential through lanes
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
d
|
||||||
|
|
|
||||||
|
a - - - - b - - - - - c
|
||||||
|
|
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway | turn:lanes:forward |
|
||||||
|
| ab | road | yes | none\|none\|right |
|
||||||
|
| bc | road | yes | |
|
||||||
|
| ebd | cross | no | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
|
||||||
|
| a,c | road,road | depart,arrive | , |
|
||||||
|
|||||||
+25
-140
@@ -278,52 +278,6 @@ Feature: Simple Turns
|
|||||||
| x | z | xy,yz,yz | depart,turn right,arrive |
|
| x | z | xy,yz,yz | depart,turn right,arrive |
|
||||||
| z | x | yz,xy,xy | depart,turn left,arrive |
|
| z | x | yz,xy,xy | depart,turn left,arrive |
|
||||||
|
|
||||||
Scenario: Four Way Intersection Double Through Street Segregated
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
q p
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
b c
|
|
||||||
j i d o
|
|
||||||
a
|
|
||||||
k h e n
|
|
||||||
g f
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
l m
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | highway | oneway | name |
|
|
||||||
| khaij | primary | yes | first |
|
|
||||||
| odaen | primary | yes | first |
|
|
||||||
| qbacp | primary | yes | second |
|
|
||||||
| mfagl | primary | yes | second |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| f,e | second,first,first | depart,turn right,arrive |
|
|
||||||
| f,c | second,second | depart,arrive |
|
|
||||||
| f,i | second,first,first | depart,turn left,arrive |
|
|
||||||
| f,g | second,second,second | depart,continue uturn,arrive |
|
|
||||||
| d,c | first,second,second | depart,turn right,arrive |
|
|
||||||
| d,i | first,first | depart,arrive |
|
|
||||||
| d,g | first,second,second | depart,turn left,arrive |
|
|
||||||
| d,e | first,first,first | depart,continue uturn,arrive |
|
|
||||||
| b,i | second,first,first | depart,turn right,arrive |
|
|
||||||
| b,g | second,second | depart,arrive |
|
|
||||||
| b,e | second,first,first | depart,turn left,arrive |
|
|
||||||
| b,c | second,second,second | depart,continue uturn,arrive |
|
|
||||||
| h,g | first,second,second | depart,turn right,arrive |
|
|
||||||
| h,e | first,first | depart,arrive |
|
|
||||||
| h,c | first,second,second | depart,turn left,arrive |
|
|
||||||
| h,i | first,first,first | depart,continue uturn,arrive |
|
|
||||||
|
|
||||||
Scenario: Three Way Similar Sharp Turns
|
Scenario: Three Way Similar Sharp Turns
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -1080,100 +1034,6 @@ Feature: Simple Turns
|
|||||||
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||||
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||||
|
|
||||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
|
||||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
|
||||||
Scenario: Collapse Turn Instruction, Issue #2725
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
e
|
|
||||||
|
|
||||||
|
|
||||||
g d
|
|
||||||
|
|
||||||
|
|
||||||
h c
|
|
||||||
|
|
||||||
|
|
||||||
b
|
|
||||||
a
|
|
||||||
|
|
||||||
|
|
||||||
r x s
|
|
||||||
y
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | oneway |
|
|
||||||
| ab | Hermannstr | secondary | |
|
|
||||||
| bc | Hermannstr | secondary | yes |
|
|
||||||
| cd | Hermannbruecke | secondary | yes |
|
|
||||||
| de | Hermannstr | secondary | yes |
|
|
||||||
| ef | Hermannstr | secondary | |
|
|
||||||
| eg | Hermannstr | secondary | yes |
|
|
||||||
| gh | Hermannbruecke | secondary | yes |
|
|
||||||
| hb | Hermannstr | secondary | yes |
|
|
||||||
| xa | Hermannstr | secondary | |
|
|
||||||
| yx | Hermannstr | secondary | |
|
|
||||||
| rxs | Silbersteinstr | tertiary | |
|
|
||||||
|
|
||||||
And the nodes
|
|
||||||
| node | highway |
|
|
||||||
| x | traffic_signals |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route |
|
|
||||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
|
|
||||||
Scenario: Collapse Turn Instruction, Issue #2725 - not trivially mergable at e
|
|
||||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
|
||||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
|
||||||
Given the node map
|
|
||||||
"""
|
|
||||||
f
|
|
||||||
e
|
|
||||||
g d
|
|
||||||
|
|
||||||
|
|
||||||
h c
|
|
||||||
|
|
||||||
|
|
||||||
b
|
|
||||||
a
|
|
||||||
|
|
||||||
|
|
||||||
r x s
|
|
||||||
y
|
|
||||||
"""
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | name | highway | oneway |
|
|
||||||
| ab | Hermannstr | secondary | |
|
|
||||||
| bc | Hermannstr | secondary | yes |
|
|
||||||
| cd | Hermannbruecke | secondary | yes |
|
|
||||||
| de | Hermannstr | secondary | yes |
|
|
||||||
| ef | Hermannstr | secondary | |
|
|
||||||
| eg | Hermannstr | secondary | yes |
|
|
||||||
| gh | Hermannbruecke | secondary | yes |
|
|
||||||
| hb | Hermannstr | secondary | yes |
|
|
||||||
| xa | Hermannstr | secondary | |
|
|
||||||
| yx | Hermannstr | secondary | |
|
|
||||||
| rxs | Silbersteinstr | tertiary | |
|
|
||||||
|
|
||||||
And the nodes
|
|
||||||
| node | highway |
|
|
||||||
| x | traffic_signals |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | turns | route |
|
|
||||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
|
||||||
|
|
||||||
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291
|
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291
|
||||||
@3002
|
@3002
|
||||||
Scenario: Obvious Index wigh very narrow turn to the right
|
Scenario: Obvious Index wigh very narrow turn to the right
|
||||||
@@ -1375,3 +1235,28 @@ Feature: Simple Turns
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route |
|
| waypoints | turns | route |
|
||||||
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |
|
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |
|
||||||
|
|
||||||
|
#http://www.openstreetmap.org/#map=19/49.48761/8.47618
|
||||||
|
@todo @3365
|
||||||
|
Scenario: Turning Road - Segregated
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
f d
|
||||||
|
| |
|
||||||
|
a - - - b - c
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
g e
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | oneway |
|
||||||
|
| ab | Goethe | B 38 | yes |
|
||||||
|
| bc | | B 38 | yes |
|
||||||
|
| ec | Fried | | yes |
|
||||||
|
| cd | Fried | B 38 | yes |
|
||||||
|
| fbg | Fried | | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | Goethe,Fried,Fried | depart,continue left,arrive |
|
||||||
|
| a,g | Goethe,Fried,Fried | depart,turn right,arrive |
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ class OSRMBaseLoader{
|
|||||||
|
|
||||||
osrmDown (callback) {
|
osrmDown (callback) {
|
||||||
if (this.osrmIsRunning()) {
|
if (this.osrmIsRunning()) {
|
||||||
this.child.on('exit', (code, signal) => {callback();});
|
this.child.on('exit', (code, signal) => { callback();});
|
||||||
this.child.kill();
|
this.child.kill('SIGINT');
|
||||||
} else callback();
|
} else callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,9 +78,10 @@ class OSRMDirectLoader extends OSRMBaseLoader {
|
|||||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||||
|
|
||||||
this.child = this.scope.runBin('osrm-routed', util.format("%s -p %d", this.inputFile, this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
this.child = this.scope.runBin('osrm-routed', util.format("%s -p %d", this.inputFile, this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
||||||
if (err) {
|
if (err && err.signal !== 'SIGINT') {
|
||||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
this.child = null;
|
||||||
}
|
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
@@ -115,7 +116,8 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
|||||||
if (this.osrmIsRunning()) return callback();
|
if (this.osrmIsRunning()) return callback();
|
||||||
|
|
||||||
this.child = this.scope.runBin('osrm-routed', util.format('--shared-memory=1 -p %d', this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
this.child = this.scope.runBin('osrm-routed', util.format('--shared-memory=1 -p %d', this.scope.OSRM_PORT), this.scope.environment, (err) => {
|
||||||
if (err) {
|
if (err && err.signal !== 'SIGINT') {
|
||||||
|
this.child = null;
|
||||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+103
-34
@@ -7,48 +7,117 @@ var chalk = require('chalk');
|
|||||||
|
|
||||||
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
|
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
|
||||||
|
|
||||||
|
String.prototype.padLeft = function(char, length) {
|
||||||
|
return char.repeat(Math.max(0, length - this.length)) + this;
|
||||||
|
}
|
||||||
|
|
||||||
|
String.prototype.padRight = function(char, length) {
|
||||||
|
return this + char.repeat(Math.max(0, length - this.length));
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = function (expected, actual) {
|
module.exports = function (expected, actual) {
|
||||||
let headers = expected.raw()[0];
|
let headers = expected.raw()[0];
|
||||||
let expected_keys = expected.hashes();
|
let expectedRows = expected.hashes();
|
||||||
let diff = [];
|
let tableError = false;
|
||||||
let hasErrors = false;
|
let statusRows = [];
|
||||||
|
let columnStatus = {}
|
||||||
|
|
||||||
var good = 0, bad = 0;
|
expectedRows.forEach((expectedRow, i) => {
|
||||||
|
|
||||||
expected_keys.forEach((row, i) => {
|
|
||||||
var rowError = false;
|
var rowError = false;
|
||||||
|
statusRows[i] = {};
|
||||||
for (var j in row) {
|
var statusRow = statusRows[i];
|
||||||
if (unescapeStr(row[j]) != actual[i][j]) {
|
for (var key in expectedRow) {
|
||||||
rowError = true;
|
var actualRow = actual[i]
|
||||||
hasErrors = true;
|
var row
|
||||||
break;
|
if (unescapeStr(expectedRow[key]) != actualRow[key]) {
|
||||||
|
statusRow[key] = false;
|
||||||
|
tableError = true;
|
||||||
|
columnStatus[key] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!tableError) return null;
|
||||||
|
|
||||||
|
|
||||||
|
// determine column widths
|
||||||
|
var widths = {};
|
||||||
|
var wantStr = '(-) ';
|
||||||
|
var gotStr = '(+) ';
|
||||||
|
var okStr = ' ';
|
||||||
|
|
||||||
|
headers.forEach( (key) => {
|
||||||
|
widths[key] = key.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
expectedRows.forEach((row,i) => {
|
||||||
|
var cells = []
|
||||||
|
headers.forEach( (key) => {
|
||||||
|
var content = row[key]
|
||||||
|
var length = content.length;
|
||||||
|
if(widths[key]==null || length > widths[key])
|
||||||
|
widths[key] = length;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// format
|
||||||
|
var lines = [chalk.red('Tables were not identical:')];
|
||||||
|
var cells;
|
||||||
|
|
||||||
|
// header row
|
||||||
|
cells = []
|
||||||
|
headers.forEach( (key) => {
|
||||||
|
var content = key.padRight(' ', widths[key] );
|
||||||
|
if (columnStatus[key] == false )
|
||||||
|
content = okStr + content;
|
||||||
|
cells.push( chalk.white( content ) );
|
||||||
|
});
|
||||||
|
lines.push( '| ' + cells.join(' | ') + ' |');
|
||||||
|
|
||||||
|
// content rows
|
||||||
|
expectedRows.forEach((row,i) => {
|
||||||
|
var cells;
|
||||||
|
var rowError = Object.keys(statusRows[i]).length > 0;
|
||||||
|
|
||||||
|
// expected row
|
||||||
|
cells = []
|
||||||
|
headers.forEach( (key) => {
|
||||||
|
var content = row[key].padRight(' ', widths[key] );
|
||||||
|
if (statusRows[i][key] == false)
|
||||||
|
cells.push( chalk.yellow( wantStr + content) );
|
||||||
|
else {
|
||||||
|
if (rowError) {
|
||||||
|
if (columnStatus[key]==false)
|
||||||
|
content = okStr + content
|
||||||
|
cells.push( chalk.yellow( content) );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (columnStatus[key]==false)
|
||||||
|
content = okStr + content
|
||||||
|
cells.push( chalk.green( content) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
lines.push('| ' + cells.join(' | ') + ' |');
|
||||||
|
|
||||||
|
// if error in row, insert extra row showing actual result
|
||||||
if (rowError) {
|
if (rowError) {
|
||||||
bad++;
|
cells = []
|
||||||
diff.push(Object.assign({}, row, {c_status: 'undefined'}));
|
headers.forEach( (key) => {
|
||||||
diff.push(Object.assign({}, actual[i], {c_status: 'comment'}));
|
var content = actual[i][key].padRight(' ', widths[key] );
|
||||||
} else {
|
if (statusRows[i][key] == false)
|
||||||
good++;
|
cells.push( chalk.red( gotStr + content) );
|
||||||
diff.push(row);
|
else {
|
||||||
|
if (columnStatus[key]==false)
|
||||||
|
cells.push( chalk.red( okStr + content) );
|
||||||
|
else
|
||||||
|
cells.push( chalk.red( content) );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lines.push('| ' + cells.join(' | ') + ' |');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return lines.join('\n');
|
||||||
if (!hasErrors) return null;
|
|
||||||
|
|
||||||
var s = ['Tables were not identical:'];
|
|
||||||
s.push(headers.map(key => ' ' + key).join(' | '));
|
|
||||||
diff.forEach((row) => {
|
|
||||||
var rowString = '| ';
|
|
||||||
headers.forEach((header) => {
|
|
||||||
if (!row.c_status) rowString += chalk.green(' ' + row[header] + ' | ');
|
|
||||||
else if (row.c_status === 'undefined') rowString += chalk.yellow('(-) ' + row[header] + ' | ');
|
|
||||||
else rowString += chalk.red('(+) ' + row[header] + ' | ');
|
|
||||||
});
|
|
||||||
s.push(rowString);
|
|
||||||
});
|
|
||||||
|
|
||||||
return s.join('\n') + '\nTODO this is a temp workaround waiting for https://github.com/cucumber/cucumber-js/issues/534';
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = {
|
|||||||
|
|
||||||
errorReason: (err) => {
|
errorReason: (err) => {
|
||||||
return err.signal ?
|
return err.signal ?
|
||||||
util.format('killed by signal %s', err.signal) :
|
'killed by signal ' + err.signal :
|
||||||
util.format('exited with code %d', err.code);
|
'exited with code ' + err.code;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,3 +28,11 @@ Feature: osrm-contract command line options: datasources
|
|||||||
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||||
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
|
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
|
||||||
And it should exit successfully
|
And it should exit successfully
|
||||||
|
|
||||||
|
Scenario: osrm-contract - Passing base file
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
And the data has been extracted
|
||||||
|
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||||
|
Then it should exit successfully
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Feature: osrm-contract command line options: help
|
|||||||
Scenario: osrm-contract - Help should be shown when no options are passed
|
Scenario: osrm-contract - Help should be shown when no options are passed
|
||||||
When I try to run "osrm-contract"
|
When I try to run "osrm-contract"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -18,7 +18,7 @@ Feature: osrm-contract command line options: help
|
|||||||
Scenario: osrm-contract - Help, short
|
Scenario: osrm-contract - Help, short
|
||||||
When I run "osrm-contract -h"
|
When I run "osrm-contract -h"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -32,7 +32,7 @@ Feature: osrm-contract command line options: help
|
|||||||
Scenario: osrm-contract - Help, long
|
Scenario: osrm-contract - Help, long
|
||||||
When I run "osrm-contract --help"
|
When I run "osrm-contract --help"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ Feature: osrm-contract command line options: invalid options
|
|||||||
Scenario: osrm-contract - Someone forgot --generate-edge-lookup on osrm-extract
|
Scenario: osrm-contract - Someone forgot --generate-edge-lookup on osrm-extract
|
||||||
When I try to run "osrm-contract --segment-speed-file /dev/null {processed_file}"
|
When I try to run "osrm-contract --segment-speed-file /dev/null {processed_file}"
|
||||||
Then stderr should contain "Error while trying to mmap"
|
Then stderr should contain "Error while trying to mmap"
|
||||||
Then stderr should contain ".osrm.edge_penalties"
|
Then stderr should contain ".osrm.turn_penalties_index"
|
||||||
And it should exit with an error
|
And it should exit with an error
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Feature: osrm-extract command line options: help
|
|||||||
Scenario: osrm-extract - Help should be shown when no options are passed
|
Scenario: osrm-extract - Help should be shown when no options are passed
|
||||||
When I run "osrm-extract"
|
When I run "osrm-extract"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -21,7 +21,7 @@ Feature: osrm-extract command line options: help
|
|||||||
Scenario: osrm-extract - Help, short
|
Scenario: osrm-extract - Help, short
|
||||||
When I run "osrm-extract -h"
|
When I run "osrm-extract -h"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -35,7 +35,7 @@ Feature: osrm-extract command line options: help
|
|||||||
Scenario: osrm-extract - Help, long
|
Scenario: osrm-extract - Help, long
|
||||||
When I run "osrm-extract --help"
|
When I run "osrm-extract --help"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
|
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
@extract
|
||||||
|
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
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
function way_function(way, result)
|
||||||
|
for _, node in ipairs(way:get_nodes()) do
|
||||||
|
print('node id ' .. node:id())
|
||||||
|
end
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.forward_speed = 1
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||||
|
Then it should exit successfully
|
||||||
|
And stdout should contain "node id 1"
|
||||||
|
And stdout should contain "node id 2"
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
Feature: Profile API version 0
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given a grid size of 100 meters
|
||||||
|
|
||||||
|
Scenario: Not-defined API version
|
||||||
|
Given the profile file
|
||||||
|
"""
|
||||||
|
function way_function(way, result)
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.forward_speed = 1
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
ab
|
||||||
|
"""
|
||||||
|
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}"
|
||||||
|
Then it should exit successfully
|
||||||
|
And stderr should not contain "Invalid profile API version"
|
||||||
|
|
||||||
|
Scenario: Out-bound API version
|
||||||
|
Given the profile file
|
||||||
|
"""
|
||||||
|
api_version = 2
|
||||||
|
"""
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
ab
|
||||||
|
"""
|
||||||
|
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}"
|
||||||
|
Then it should exit with an error
|
||||||
|
And stderr should contain "Invalid profile API version"
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Basic profile function calls and property values
|
||||||
|
Given the profile file
|
||||||
|
"""
|
||||||
|
api_version = 0
|
||||||
|
|
||||||
|
-- set profile properties
|
||||||
|
properties.u_turn_penalty = 20
|
||||||
|
properties.traffic_signal_penalty = 2
|
||||||
|
properties.max_speed_for_map_matching = 180/3.6
|
||||||
|
properties.use_turn_restrictions = true
|
||||||
|
properties.continue_straight_at_waypoint = true
|
||||||
|
properties.left_hand_driving = false
|
||||||
|
properties.weight_name = 'duration'
|
||||||
|
|
||||||
|
function node_function (node, result)
|
||||||
|
print ('node_function ' .. node:id())
|
||||||
|
end
|
||||||
|
|
||||||
|
function way_function(way, result)
|
||||||
|
result.name = way:get_value_by_key('name')
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.backward_mode = mode.driving
|
||||||
|
result.forward_speed = 36
|
||||||
|
result.backward_speed = 36
|
||||||
|
print ('way_function ' .. way:id() .. ' ' .. result.name)
|
||||||
|
end
|
||||||
|
|
||||||
|
function turn_function (angle)
|
||||||
|
print('turn_function ' .. angle)
|
||||||
|
return angle == 0 and 0 or 42
|
||||||
|
end
|
||||||
|
|
||||||
|
function segment_function (source, target, distance, weight)
|
||||||
|
print ('segment_function ' .. source.lon .. ' ' .. source.lat)
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
b c d
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ac |
|
||||||
|
| cb |
|
||||||
|
| cd |
|
||||||
|
| ce |
|
||||||
|
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 "node_function"
|
||||||
|
And stdout should contain "way_function"
|
||||||
|
And stdout should contain "turn_function"
|
||||||
|
And stdout should contain "segment_function"
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | time |
|
||||||
|
| a | b | ac,cb,cb | 24.2s |
|
||||||
|
| a | d | ac,cd,cd | 24.2s |
|
||||||
|
| a | e | ac,ce,ce | 20s |
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
Feature: Profile API version 1
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given a grid size of 100 meters
|
||||||
|
|
||||||
|
Scenario: Basic profile function calls and property values
|
||||||
|
Given the profile file
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
|
||||||
|
-- set profile properties
|
||||||
|
properties.max_speed_for_map_matching = 180/3.6
|
||||||
|
properties.use_turn_restrictions = true
|
||||||
|
properties.continue_straight_at_waypoint = true
|
||||||
|
properties.weight_name = 'test_version1'
|
||||||
|
|
||||||
|
function node_function (node, result)
|
||||||
|
print ('node_function ' .. node:id())
|
||||||
|
end
|
||||||
|
|
||||||
|
function way_function(way, result)
|
||||||
|
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
|
||||||
|
print ('way_function ' .. way:id() .. ' ' .. result.name)
|
||||||
|
end
|
||||||
|
|
||||||
|
function turn_function (turn)
|
||||||
|
print('turn_function', 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 segment_function (segment)
|
||||||
|
print ('segment_function ' .. segment.source.lon .. ' ' .. segment.source.lat)
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
a
|
||||||
|
bcd
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ac |
|
||||||
|
| cb |
|
||||||
|
| cd |
|
||||||
|
| ce |
|
||||||
|
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 "node_function"
|
||||||
|
And stdout should contain "way_function"
|
||||||
|
And stdout should contain "turn_function"
|
||||||
|
And stdout should contain "segment_function"
|
||||||
|
|
||||||
|
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,ce | 20s |
|
||||||
@@ -7,7 +7,7 @@ Feature: osrm-routed command line options: help
|
|||||||
Scenario: osrm-routed - Help should be shown when no options are passed
|
Scenario: osrm-routed - Help should be shown when no options are passed
|
||||||
When I run "osrm-routed"
|
When I run "osrm-routed"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -26,7 +26,7 @@ Feature: osrm-routed command line options: help
|
|||||||
Scenario: osrm-routed - Help, short
|
Scenario: osrm-routed - Help, short
|
||||||
When I run "osrm-routed -h"
|
When I run "osrm-routed -h"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
@@ -45,7 +45,7 @@ Feature: osrm-routed command line options: help
|
|||||||
Scenario: osrm-routed - Help, long
|
Scenario: osrm-routed - Help, long
|
||||||
When I run "osrm-routed --help"
|
When I run "osrm-routed --help"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
|
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
And stdout should contain "--version"
|
And stdout should contain "--version"
|
||||||
And stdout should contain "--help"
|
And stdout should contain "--help"
|
||||||
|
|||||||
@@ -239,13 +239,15 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the profile file(?: "([^"]*)" extended with)?$/, (profile, data, callback) => {
|
this.Given(/^the profile file(?: "([^"]*)" extended with)?$/, (profile, data, callback) => {
|
||||||
let text = 'package.path = "' + this.PROFILES_PATH + '/?.lua;" .. package.path\n';
|
const lua_profiles_path = this.PROFILES_PATH.split(path.sep).join('/');
|
||||||
|
let text = 'package.path = "' + lua_profiles_path + '/?.lua;" .. package.path\n';
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
text += data + '\n';
|
text += data + '\n';
|
||||||
} else {
|
} else {
|
||||||
text += 'local f = assert(io.open("' + this.PROFILES_PATH + '/' + profile + '.lua", "r"))\n';
|
text += 'local f = assert(io.open("' + lua_profiles_path + '/' + profile + '.lua", "r"))\n';
|
||||||
text += 'local m = assert(loadstring(f:read("*all") .. [[\n' + data + '\n]]))\n';
|
text += 'local s = f:read("*all") .. [[\n' + data + '\n]]\n';
|
||||||
text += 'f:close()\n';
|
text += 'f:close()\n';
|
||||||
|
text += 'local m = assert(loadstring and loadstring(s) or load(s))\n';
|
||||||
text += 'm()\n';
|
text += 'm()\n';
|
||||||
}
|
}
|
||||||
this.profileFile = this.profileCacheFile;
|
this.profileFile = this.profileCacheFile;
|
||||||
|
|||||||
@@ -83,7 +83,10 @@ module.exports = function () {
|
|||||||
duration = json.matchings[0].duration;
|
duration = json.matchings[0].duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('annotation')) {
|
// annotation response values are requested by 'a:{type_name}'
|
||||||
|
var found = false;
|
||||||
|
headers.forEach((h) => { if (h.match(/^a:/)) found = true; });
|
||||||
|
if (found) {
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
||||||
annotation = this.annotationList(json.matchings[0]);
|
annotation = this.annotationList(json.matchings[0]);
|
||||||
}
|
}
|
||||||
@@ -92,11 +95,6 @@ module.exports = function () {
|
|||||||
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
||||||
geometry = json.matchings[0].geometry;
|
geometry = json.matchings[0].geometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('OSM IDs')) {
|
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
|
||||||
OSMIDs = this.OSMIDList(json.matchings[0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('turns')) {
|
if (headers.has('turns')) {
|
||||||
@@ -111,9 +109,19 @@ module.exports = function () {
|
|||||||
got.duration = duration.toString();
|
got.duration = duration.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('annotation')) {
|
// if header matches 'a:*', parse out the values for *
|
||||||
got.annotation = annotation.toString();
|
// and return in that header
|
||||||
}
|
headers.forEach((k) => {
|
||||||
|
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight'];
|
||||||
|
if (k.match(/^a:/)) {
|
||||||
|
let a_type = k.slice(2);
|
||||||
|
if (whitelist.indexOf(a_type) == -1)
|
||||||
|
return cb(new Error('Unrecognized annotation field:' + a_type));
|
||||||
|
if (!annotation[a_type])
|
||||||
|
return cb(new Error('Annotation not found in response: ' + a_type));
|
||||||
|
got[k] = annotation[a_type];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (headers.has('geometry')) {
|
if (headers.has('geometry')) {
|
||||||
if (this.queryParams['geometries'] === 'polyline') {
|
if (this.queryParams['geometries'] === 'polyline') {
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ module.exports = function () {
|
|||||||
assert.ok(this.stdout.indexOf(str) > -1);
|
assert.ok(this.stdout.indexOf(str) > -1);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^stderr should contain "(.*?)"$/, (str) => {
|
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
|
||||||
assert.ok(this.stderr.indexOf(str) > -1);
|
const contains = this.stderr.indexOf(str) > -1;
|
||||||
|
assert.ok(typeof not === 'undefined' ? contains : !contains);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
|
||||||
|
|||||||
@@ -6,19 +6,46 @@ module.exports = function () {
|
|||||||
this.Then(/^routability should be$/, (table, callback) => {
|
this.Then(/^routability should be$/, (table, callback) => {
|
||||||
this.buildWaysFromTable(table, () => {
|
this.buildWaysFromTable(table, () => {
|
||||||
var directions = ['forw','backw','bothw'],
|
var directions = ['forw','backw','bothw'],
|
||||||
|
testedHeaders = ['forw','backw','bothw','forw_rate','backw_rate','bothw_rate'],
|
||||||
headers = new Set(Object.keys(table.hashes()[0]));
|
headers = new Set(Object.keys(table.hashes()[0]));
|
||||||
|
|
||||||
if (!directions.some(k => !!headers.has(k))) {
|
if (!testedHeaders.some(k => !!headers.has(k))) {
|
||||||
throw new Error('*** routability table must contain either "forw", "backw" or "bothw" column');
|
throw new Error('*** routability table must contain either "forw", "backw", "bothw", "forw_rate" or "backw_rate" column');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.reprocessAndLoadData((e) => {
|
this.reprocessAndLoadData((e) => {
|
||||||
if (e) return callback(e);
|
if (e) return callback(e);
|
||||||
var testRow = (row, i, cb) => {
|
var testRow = (row, i, cb) => {
|
||||||
var outputRow = Object.assign({}, row);
|
var outputRow = Object.assign({}, row);
|
||||||
|
// clear the fields that are tested for in the copied response object
|
||||||
|
for (var field in outputRow) {
|
||||||
|
if (testedHeaders.indexOf(field) != -1)
|
||||||
|
outputRow[field] = '';
|
||||||
|
}
|
||||||
|
|
||||||
testRoutabilityRow(i, (err, result) => {
|
testRoutabilityRow(i, (err, result) => {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
directions.filter(d => headers.has(d + '_rate')).forEach((direction) => {
|
||||||
|
var rate = direction + '_rate';
|
||||||
|
var want = row[rate];
|
||||||
|
|
||||||
|
switch (true) {
|
||||||
|
case '' === want:
|
||||||
|
outputRow[rate] = result[direction].status ?
|
||||||
|
result[direction].status.toString() : '';
|
||||||
|
break;
|
||||||
|
case /^\d+$/.test(want):
|
||||||
|
if (result[direction].rate !== undefined && !isNaN(result[direction].rate)) {
|
||||||
|
outputRow[rate] = result[direction].rate.toString();
|
||||||
|
} else {
|
||||||
|
outputRow[rate] = '';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error(util.format('*** Unknown expectation format: %s for header %s', want, rate));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
directions.filter(d => headers.has(d)).forEach((direction) => {
|
directions.filter(d => headers.has(d)).forEach((direction) => {
|
||||||
var usingShortcut = false,
|
var usingShortcut = false,
|
||||||
want = row[direction];
|
want = row[direction];
|
||||||
@@ -31,6 +58,8 @@ module.exports = function () {
|
|||||||
usingShortcut = row[direction];
|
usingShortcut = row[direction];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO split out accessible/not accessible value from forw/backw headers
|
||||||
|
// rename forw/backw to forw/backw_speed
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case '' === want:
|
case '' === want:
|
||||||
case 'x' === want:
|
case 'x' === want:
|
||||||
@@ -63,7 +92,7 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.FuzzyMatch.match(outputRow[direction], want)) {
|
if (this.FuzzyMatch.match(outputRow[direction], want)) {
|
||||||
outputRow[direction] = [usingShortcut ? usingShortcut : row[direction]];
|
outputRow[direction] = usingShortcut ? usingShortcut : row[direction];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,6 +104,10 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// makes simple a-b request using the given cucumber test routability conditions
|
||||||
|
// result is an object containing the calculated values for 'rate', 'status',
|
||||||
|
// 'time', 'distance', and 'speed' for forwards and backwards routing, as well as
|
||||||
|
// a bothw object that diffs forwards/backwards
|
||||||
var testRoutabilityRow = (i, cb) => {
|
var testRoutabilityRow = (i, cb) => {
|
||||||
var result = {};
|
var result = {};
|
||||||
|
|
||||||
@@ -98,6 +131,7 @@ module.exports = function () {
|
|||||||
if (r.route.split(',')[0] === util.format('w%d', i)) {
|
if (r.route.split(',')[0] === util.format('w%d', i)) {
|
||||||
r.time = r.json.routes[0].duration;
|
r.time = r.json.routes[0].duration;
|
||||||
r.distance = r.json.routes[0].distance;
|
r.distance = r.json.routes[0].distance;
|
||||||
|
r.rate = Math.round(r.distance / r.json.routes[0].weight);
|
||||||
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
|
||||||
} else {
|
} else {
|
||||||
r.status = null;
|
r.status = null;
|
||||||
@@ -133,7 +167,7 @@ module.exports = function () {
|
|||||||
scb();
|
scb();
|
||||||
};
|
};
|
||||||
|
|
||||||
['status', 'time', 'distance', 'speed'].forEach((key) => {
|
['rate', 'status', 'time', 'distance', 'speed'].forEach((key) => {
|
||||||
sq.defer(parseRes, key);
|
sq.defer(parseRes, key);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ module.exports = function () {
|
|||||||
} else if (row[k]) {
|
} else if (row[k]) {
|
||||||
params[match[1]] = [row[k]];
|
params[match[1]] = [row[k]];
|
||||||
}
|
}
|
||||||
|
|
||||||
got[k] = row[k];
|
got[k] = row[k];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,11 +34,11 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('status')) {
|
if (headers.has('status')) {
|
||||||
got.status = json.status.toString();
|
got.status = json.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('message')) {
|
if (headers.has('message')) {
|
||||||
got.message = json.status_message;
|
got.message = json.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('geometry')) {
|
if (headers.has('geometry')) {
|
||||||
@@ -59,6 +58,7 @@ module.exports = function () {
|
|||||||
|
|
||||||
var subTrips;
|
var subTrips;
|
||||||
var trip_durations;
|
var trip_durations;
|
||||||
|
var trip_distance;
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
if (headers.has('trips')) {
|
if (headers.has('trips')) {
|
||||||
subTrips = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map((sl, i) => {
|
subTrips = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map((sl, i) => {
|
||||||
@@ -74,13 +74,19 @@ module.exports = function () {
|
|||||||
})));
|
})));
|
||||||
trip_durations = all_durations.map( a => a.reduce(add, 0));
|
trip_durations = all_durations.map( a => a.reduce(add, 0));
|
||||||
}
|
}
|
||||||
|
if(headers.has('distance')) {
|
||||||
|
var all_distance = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map(sl => {
|
||||||
|
return sl.distance;
|
||||||
|
})));
|
||||||
|
trip_distance = all_distance.map( a => a.reduce(add, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ok = true,
|
var ok = true,
|
||||||
encodedResult = '',
|
encodedResult = '',
|
||||||
extendedTarget = '';
|
extendedTarget = '';
|
||||||
|
|
||||||
row.trips.split(',').forEach((sub, si) => {
|
if (json.trips) row.trips.split(',').forEach((sub, si) => {
|
||||||
if (si >= subTrips.length) {
|
if (si >= subTrips.length) {
|
||||||
ok = false;
|
ok = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -105,10 +111,10 @@ module.exports = function () {
|
|||||||
got.via_points = row.via_points;
|
got.via_points = row.via_points;
|
||||||
} else {
|
} else {
|
||||||
got.trips = encodedResult;
|
got.trips = encodedResult;
|
||||||
got.trips = extendedTarget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
got.durations = trip_durations;
|
got.durations = trip_durations;
|
||||||
|
got.distance = trip_distance;
|
||||||
|
|
||||||
for (var key in row) {
|
for (var key in row) {
|
||||||
if (this.FuzzyMatch.match(got[key], row[key])) {
|
if (this.FuzzyMatch.match(got[key], row[key])) {
|
||||||
@@ -144,6 +150,19 @@ module.exports = function () {
|
|||||||
waypoints.push(node);
|
waypoints.push(node);
|
||||||
});
|
});
|
||||||
got = { waypoints: row.waypoints };
|
got = { waypoints: row.waypoints };
|
||||||
|
|
||||||
|
if (row.source) {
|
||||||
|
params.source = got.source = row.source;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (row.destination) {
|
||||||
|
params.destination = got.destination = row.destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (row.hasOwnProperty('roundtrip')) { //roundtrip is a boolean so row.roundtrip alone doesn't work as a check here
|
||||||
|
params.roundtrip = got.roundtrip = row.roundtrip;
|
||||||
|
}
|
||||||
|
|
||||||
this.requestTrip(waypoints, params, afterRequest);
|
this.requestTrip(waypoints, params, afterRequest);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('*** no waypoints');
|
throw new Error('*** no waypoints');
|
||||||
|
|||||||
@@ -141,7 +141,9 @@ module.exports = function() {
|
|||||||
|
|
||||||
// converts the scenario titles in file prefixes
|
// converts the scenario titles in file prefixes
|
||||||
this.getScenarioID = (scenario) => {
|
this.getScenarioID = (scenario) => {
|
||||||
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\)]/g, '').replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.');
|
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\):\*#]/g, '')
|
||||||
|
.replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.')
|
||||||
|
.substring(0, 64);
|
||||||
return util.format('%d_%s', scenario.getLine(), name);
|
return util.format('%d_%s', scenario.getLine(), name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ module.exports = function () {
|
|||||||
q.awaitAll((err, actual) => {
|
q.awaitAll((err, actual) => {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
let diff = tableDiff(table, actual);
|
let diff = tableDiff(table, actual);
|
||||||
if (diff) callback(new Error(diff));
|
if (diff) callback(diff);
|
||||||
else callback();
|
else callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
+17
-27
@@ -27,10 +27,11 @@ module.exports = function () {
|
|||||||
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
||||||
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
||||||
this.DEFAULT_PROFILE = 'bicycle';
|
this.DEFAULT_PROFILE = 'bicycle';
|
||||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||||
this.DEFAULT_LOAD_METHOD = 'datastore';
|
this.DEFAULT_LOAD_METHOD = this.PLATFORM_WINDOWS ? 'directly' : 'datastore';
|
||||||
this.DEFAULT_ORIGIN = [1,1];
|
this.DEFAULT_ORIGIN = [1,1];
|
||||||
this.OSM_USER = 'osrm';
|
this.OSM_USER = 'osrm';
|
||||||
this.OSM_GENERATOR = 'osrm-test';
|
this.OSM_GENERATOR = 'osrm-test';
|
||||||
@@ -42,44 +43,33 @@ 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;
|
||||||
|
|
||||||
// TODO make sure this works on win
|
if (this.PLATFORM_WINDOWS) {
|
||||||
if (process.platform.match(/indows.*/)) {
|
|
||||||
this.TERMSIGNAL = 9;
|
this.TERMSIGNAL = 9;
|
||||||
this.EXE = '.exe';
|
this.EXE = '.exe';
|
||||||
this.LIB = '.dll';
|
|
||||||
this.QQ = '"';
|
|
||||||
} else {
|
} else {
|
||||||
this.TERMSIGNAL = 'SIGTERM';
|
this.TERMSIGNAL = 'SIGTERM';
|
||||||
this.EXE = '';
|
this.EXE = '';
|
||||||
|
}
|
||||||
|
|
||||||
// heuristically detect .so/.a suffix
|
// heuristically detect .so/.a/.dll/.lib suffix
|
||||||
this.LIB = null;
|
this.LIB = ['lib%s.a', 'lib%s.so', '%s.dll', '%s.lib'].find((format) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const dot_a = util.format('%s/libosrm%s', this.BIN_PATH, '.a');
|
const lib = this.BIN_PATH + '/' + util.format(format, 'osrm');
|
||||||
fs.accessSync(dot_a, fs.F_OK);
|
fs.accessSync(lib, fs.F_OK);
|
||||||
this.LIB = '.a';
|
} catch(e) { return false; }
|
||||||
} catch(e) { /*nop*/ }
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
if (this.LIB === undefined) {
|
||||||
const dot_so = util.format('%s/libosrm%s', this.BIN_PATH, '.so');
|
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
|
||||||
fs.accessSync(dot_so, fs.F_OK);
|
|
||||||
this.LIB = '.so';
|
|
||||||
} catch(e) { /*nop*/ }
|
|
||||||
|
|
||||||
if (!this.LIB) {
|
|
||||||
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.QQ = '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.OSRM_EXTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-extract', this.EXE));
|
this.OSRM_EXTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-extract', this.EXE));
|
||||||
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
||||||
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
||||||
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/libosrm_extract%s', this.BIN_PATH, this.LIB),
|
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
|
||||||
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/libosrm_contract%s', this.BIN_PATH, this.LIB),
|
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
|
||||||
this.LIB_OSRM_PATH = util.format('%s/libosrm%s', this.BIN_PATH, this.LIB);
|
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.info(util.format('Node Version', process.version));
|
console.info(util.format('Node Version', process.version));
|
||||||
@@ -108,7 +98,7 @@ module.exports = function () {
|
|||||||
var verify = (binPath, cb) => {
|
var verify = (binPath, cb) => {
|
||||||
fs.exists(binPath, (exists) => {
|
fs.exists(binPath, (exists) => {
|
||||||
if (!exists) return cb(new Error(util.format('%s is missing. Build failed?', binPath)));
|
if (!exists) return cb(new Error(util.format('%s is missing. Build failed?', binPath)));
|
||||||
var helpPath = util.format('%s --help > /dev/null 2>&1', binPath);
|
var helpPath = util.format('%s --help', binPath);
|
||||||
child_process.exec(helpPath, (err) => {
|
child_process.exec(helpPath, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return cb(new Error(util.format('*** %s exited with code %d', helpPath, err.code)));
|
return cb(new Error(util.format('*** %s exited with code %d', helpPath, err.code)));
|
||||||
|
|||||||
+21
-13
@@ -164,20 +164,20 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.annotationList = (instructions) => {
|
this.annotationList = (instructions) => {
|
||||||
function zip(list_1, list_2, list_3)
|
if (!('annotation' in instructions.legs[0]))
|
||||||
{
|
return '';
|
||||||
let tuples = [];
|
|
||||||
for (let i = 0; i < list_1.length; ++i) {
|
|
||||||
tuples.push([list_1[i], list_2[i], list_3[i]]);
|
|
||||||
}
|
|
||||||
return tuples;
|
|
||||||
}
|
|
||||||
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
|
|
||||||
};
|
|
||||||
|
|
||||||
this.OSMIDList = (instructions) => {
|
var merged = {};
|
||||||
// OSM node IDs also come from the annotation list
|
instructions.legs.map(l => {
|
||||||
return instructions.legs.map(l => l.annotation.nodes.map(n => n.toString()).join(',')).join(',');
|
Object.keys(l.annotation).forEach(a => {
|
||||||
|
if (!merged[a]) merged[a] = [];
|
||||||
|
merged[a].push(l.annotation[a].join(':'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Object.keys(merged).map(a => {
|
||||||
|
merged[a] = merged[a].join(',');
|
||||||
|
});
|
||||||
|
return merged;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.lanesList = (instructions) => {
|
this.lanesList = (instructions) => {
|
||||||
@@ -250,4 +250,12 @@ module.exports = function () {
|
|||||||
this.distanceList = (instructions) => {
|
this.distanceList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, s => s.distance + 'm');
|
return this.extractInstructionList(instructions, s => s.distance + 'm');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.weightName = (instructions) => {
|
||||||
|
return instructions ? instructions.weight_name : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
this.weightList = (instructions) => {
|
||||||
|
return this.extractInstructionList(instructions, s => s.weight);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
@@ -36,7 +37,7 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.runBin = (bin, options, env, callback) => {
|
this.runBin = (bin, options, env, callback) => {
|
||||||
let cmd = util.format('%s%s/%s%s%s', this.QQ, this.BIN_PATH, bin, this.EXE, this.QQ);
|
let cmd = path.resolve(util.format('%s/%s%s', this.BIN_PATH, bin, this.EXE));
|
||||||
let opts = options.split(' ').filter((x) => { return x && x.length > 0; });
|
let opts = options.split(' ').filter((x) => { return x && x.length > 0; });
|
||||||
let log = fs.createWriteStream(this.scenarioLogFile, {'flags': 'a'});
|
let log = fs.createWriteStream(this.scenarioLogFile, {'flags': 'a'});
|
||||||
log.write(util.format('*** running %s %s\n', cmd, options));
|
log.write(util.format('*** running %s %s\n', cmd, options));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ module.exports = function () {
|
|||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
if (body && body.length) {
|
if (body && body.length) {
|
||||||
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
||||||
distances, summary, intersections, lanes, locations;
|
distances, summary, intersections, lanes, locations, annotation, weight_name, weights;
|
||||||
|
|
||||||
let json = JSON.parse(body);
|
let json = JSON.parse(body);
|
||||||
|
|
||||||
@@ -55,6 +55,9 @@ module.exports = function () {
|
|||||||
lanes = this.lanesList(json.routes[0]);
|
lanes = this.lanesList(json.routes[0]);
|
||||||
summary = this.summary(json.routes[0]);
|
summary = this.summary(json.routes[0]);
|
||||||
locations = this.locations(json.routes[0]);
|
locations = this.locations(json.routes[0]);
|
||||||
|
annotation = this.annotationList(json.routes[0]);
|
||||||
|
weight_name = this.weightName(json.routes[0]);
|
||||||
|
weights = this.weightList(json.routes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('status')) {
|
if (headers.has('status')) {
|
||||||
@@ -89,7 +92,8 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var distance = hasRoute && json.routes[0].distance,
|
var distance = hasRoute && json.routes[0].distance,
|
||||||
time = hasRoute && json.routes[0].duration;
|
time = hasRoute && json.routes[0].duration,
|
||||||
|
weight = hasRoute && json.routes[0].weight;
|
||||||
|
|
||||||
if (headers.has('distance')) {
|
if (headers.has('distance')) {
|
||||||
if (row.distance.length) {
|
if (row.distance.length) {
|
||||||
@@ -101,6 +105,16 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headers.has('weight')) {
|
||||||
|
if (row.weight.length) {
|
||||||
|
if (!row.weight.match(/[\d\.]+/))
|
||||||
|
return cb(new Error('*** Weight must be specified as a numeric value. (ex: 8)'));
|
||||||
|
got.weight = instructions ? util.format('%d', weight) : '';
|
||||||
|
} else {
|
||||||
|
got.weight = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (headers.has('time')) {
|
if (headers.has('time')) {
|
||||||
if (!row.time.match(/\d+s/))
|
if (!row.time.match(/\d+s/))
|
||||||
return cb(new Error('*** Time must be specied in seconds. (ex: 60s)'));
|
return cb(new Error('*** Time must be specied in seconds. (ex: 60s)'));
|
||||||
@@ -130,6 +144,20 @@ module.exports = function () {
|
|||||||
got.locations = (locations || '').trim();
|
got.locations = (locations || '').trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if header matches 'a:*', parse out the values for *
|
||||||
|
// and return in that header
|
||||||
|
headers.forEach((k) => {
|
||||||
|
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight', 'speed'];
|
||||||
|
if (k.match(/^a:/)) {
|
||||||
|
let a_type = k.slice(2);
|
||||||
|
if (whitelist.indexOf(a_type) == -1)
|
||||||
|
return cb(new Error('Unrecognized annotation field', a_type));
|
||||||
|
if (!annotation[a_type])
|
||||||
|
return cb(new Error('Annotation not found in response', a_type));
|
||||||
|
got[k] = annotation[a_type];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var putValue = (key, value) => {
|
var putValue = (key, value) => {
|
||||||
if (headers.has(key)) got[key] = instructions ? value : '';
|
if (headers.has(key)) got[key] = instructions ? value : '';
|
||||||
};
|
};
|
||||||
@@ -142,6 +170,9 @@ module.exports = function () {
|
|||||||
putValue('distances', distances);
|
putValue('distances', distances);
|
||||||
putValue('pronunciations', pronunciations);
|
putValue('pronunciations', pronunciations);
|
||||||
putValue('destinations', destinations);
|
putValue('destinations', destinations);
|
||||||
|
putValue('weight_name', weight_name);
|
||||||
|
putValue('weights', weights);
|
||||||
|
putValue('weight', weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var key in row) {
|
for (var key in row) {
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ Feature: Bearing parameter
|
|||||||
| bc |
|
| bc |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | bearing |
|
| from | to | bearings | route | bearing |
|
||||||
| 0 | c | 0 0 | | |
|
| 0 | c | 0 0 | | |
|
||||||
| 0 | c | 45 45 | bc,bc | 0->44,44->0 +- 1 |
|
| 0 | c | 45 45 | bc,bc | 0->45,45->0 |
|
||||||
| 0 | c | 85 85 | | |
|
| 0 | c | 85 85 | | |
|
||||||
| 0 | c | 95 95 | | |
|
| 0 | c | 95 95 | | |
|
||||||
| 0 | c | 135 135 | ac,ac | 0->135,135->0 +- 1|
|
| 0 | c | 135 135 | ac,ac | 0->135,135->0 |
|
||||||
| 0 | c | 180 180 | | |
|
| 0 | c | 180 180 | | |
|
||||||
|
|
||||||
Scenario: Testbot - Initial bearing on split way
|
Scenario: Testbot - Initial bearing on split way
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ Feature: Geometry Compression
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance | speed |
|
| from | to | route | distance | speed |
|
||||||
| b | e | abcdef,abcdef | 588.6m | 36 km/h |
|
| b | e | abcdef,abcdef | 588.5m | 36 km/h |
|
||||||
| e | b | abcdef,abcdef | 588.6m | 36 km/h |
|
| e | b | abcdef,abcdef | 588.5m | 36 km/h |
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ Feature: Distance calculation
|
|||||||
| ab |
|
| ab |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | ab,ab | 100m +- 2 |
|
| a | b | ab,ab | 100m |
|
||||||
|
|
||||||
Scenario: Distance should equal sum of segments, leftwinded
|
Scenario: Distance should equal sum of segments, leftwinded
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -33,7 +33,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | d | abcde,abcde | 300m +-2 |
|
| a | d | abcde,abcde | 300m +-1 |
|
||||||
|
|
||||||
Scenario: Distance should equal sum of segments, rightwinded
|
Scenario: Distance should equal sum of segments, rightwinded
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -49,7 +49,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | d | abcde,abcde | 300m +-2 |
|
| a | d | abcde,abcde | 300m +-1 |
|
||||||
|
|
||||||
Scenario: 10m distances
|
Scenario: 10m distances
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
@@ -65,12 +65,12 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abc,abc | 10m +-2 |
|
| a | b | abc,abc | 10m |
|
||||||
| b | a | abc,abc | 10m +-2 |
|
| b | a | abc,abc | 10m |
|
||||||
| b | c | abc,abc | 10m +-2 |
|
| b | c | abc,abc | 10m |
|
||||||
| c | b | abc,abc | 10m +-2 |
|
| c | b | abc,abc | 10m |
|
||||||
| a | c | abc,abc | 20m +-4 |
|
| a | c | abc,abc | 20m |
|
||||||
| c | a | abc,abc | 20m +-4 |
|
| c | a | abc,abc | 20m |
|
||||||
|
|
||||||
Scenario: 100m distances
|
Scenario: 100m distances
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
@@ -86,12 +86,12 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abc,abc | 100m +-2 |
|
| a | b | abc,abc | 100m |
|
||||||
| b | a | abc,abc | 100m +-2 |
|
| b | a | abc,abc | 100m |
|
||||||
| b | c | abc,abc | 100m +-2 |
|
| b | c | abc,abc | 100m |
|
||||||
| c | b | abc,abc | 100m +-2 |
|
| c | b | abc,abc | 100m |
|
||||||
| a | c | abc,abc | 200m +-4 |
|
| a | c | abc,abc | 200m |
|
||||||
| c | a | abc,abc | 200m +-4 |
|
| c | a | abc,abc | 200m |
|
||||||
|
|
||||||
Scenario: 1km distance
|
Scenario: 1km distance
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
@@ -107,12 +107,12 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abc,abc | 1000m +-2 |
|
| a | b | abc,abc | 1000m +-1 |
|
||||||
| b | a | abc,abc | 1000m +-2 |
|
| b | a | abc,abc | 1000m +-1 |
|
||||||
| b | c | abc,abc | 1000m +-2 |
|
| b | c | abc,abc | 1000m +-1 |
|
||||||
| c | b | abc,abc | 1000m +-2 |
|
| c | b | abc,abc | 1000m +-1 |
|
||||||
| a | c | abc,abc | 2000m +-4 |
|
| a | c | abc,abc | 2000m +-1 |
|
||||||
| c | a | abc,abc | 2000m +-4 |
|
| c | a | abc,abc | 2000m +-1 |
|
||||||
|
|
||||||
Scenario: Distance of a winding south-north path
|
Scenario: Distance of a winding south-north path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
@@ -130,13 +130,13 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abcdefgh,abcdefgh | 10m +-2 |
|
| a | b | abcdefgh,abcdefgh | 10m |
|
||||||
| a | c | abcdefgh,abcdefgh | 20m +-4 |
|
| a | c | abcdefgh,abcdefgh | 20m |
|
||||||
| a | d | abcdefgh,abcdefgh | 30m +-6 |
|
| a | d | abcdefgh,abcdefgh | 30m |
|
||||||
| a | e | abcdefgh,abcdefgh | 40m +-8 |
|
| a | e | abcdefgh,abcdefgh | 40m |
|
||||||
| a | f | abcdefgh,abcdefgh | 50m +-10 |
|
| a | f | abcdefgh,abcdefgh | 50m |
|
||||||
| a | g | abcdefgh,abcdefgh | 60m +-12 |
|
| a | g | abcdefgh,abcdefgh | 60m +-1 |
|
||||||
| a | h | abcdefgh,abcdefgh | 70m +-14 |
|
| a | h | abcdefgh,abcdefgh | 70m +-1 |
|
||||||
|
|
||||||
Scenario: Distance of a winding east-west path
|
Scenario: Distance of a winding east-west path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
@@ -152,13 +152,13 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | b | abcdefgh,abcdefgh | 10m +-2 |
|
| a | b | abcdefgh,abcdefgh | 10m |
|
||||||
| a | c | abcdefgh,abcdefgh | 20m +-4 |
|
| a | c | abcdefgh,abcdefgh | 20m |
|
||||||
| a | d | abcdefgh,abcdefgh | 30m +-6 |
|
| a | d | abcdefgh,abcdefgh | 30m |
|
||||||
| a | e | abcdefgh,abcdefgh | 40m +-8 |
|
| a | e | abcdefgh,abcdefgh | 40m |
|
||||||
| a | f | abcdefgh,abcdefgh | 50m +-10 |
|
| a | f | abcdefgh,abcdefgh | 50m |
|
||||||
| a | g | abcdefgh,abcdefgh | 60m +-12 |
|
| a | g | abcdefgh,abcdefgh | 60m +-1 |
|
||||||
| a | h | abcdefgh,abcdefgh | 70m +-14 |
|
| a | h | abcdefgh,abcdefgh | 70m +-1 |
|
||||||
|
|
||||||
Scenario: Geometric distances
|
Scenario: Geometric distances
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
@@ -201,31 +201,31 @@ Feature: Distance calculation
|
|||||||
| xy |
|
| xy |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| x | a | xa,xa | 300m +-2 |
|
| x | a | xa,xa | 300m +-1 |
|
||||||
| x | b | xb,xb | 316m +-2 |
|
| x | b | xb,xb | 316m +-1 |
|
||||||
| x | c | xc,xc | 360m +-2 |
|
| x | c | xc,xc | 360m +-1 |
|
||||||
| x | d | xd,xd | 424m +-2 |
|
| x | d | xd,xd | 424m +-1 |
|
||||||
| x | e | xe,xe | 360m +-2 |
|
| x | e | xe,xe | 360m +-1 |
|
||||||
| x | f | xf,xf | 316m +-2 |
|
| x | f | xf,xf | 316m +-1 |
|
||||||
| x | g | xg,xg | 300m +-2 |
|
| x | g | xg,xg | 300m +-1 |
|
||||||
| x | h | xh,xh | 316m +-2 |
|
| x | h | xh,xh | 316m +-1 |
|
||||||
| x | i | xi,xi | 360m +-2 |
|
| x | i | xi,xi | 360m +-1 |
|
||||||
| x | j | xj,xj | 424m +-2 |
|
| x | j | xj,xj | 424m +-1 |
|
||||||
| x | k | xk,xk | 360m +-2 |
|
| x | k | xk,xk | 360m +-1 |
|
||||||
| x | l | xl,xl | 316m +-2 |
|
| x | l | xl,xl | 316m +-1 |
|
||||||
| x | m | xm,xm | 300m +-2 |
|
| x | m | xm,xm | 300m +-1 |
|
||||||
| x | n | xn,xn | 316m +-2 |
|
| x | n | xn,xn | 316m +-1 |
|
||||||
| x | o | xo,xo | 360m +-2 |
|
| x | o | xo,xo | 360m +-1 |
|
||||||
| x | p | xp,xp | 424m +-2 |
|
| x | p | xp,xp | 424m +-1 |
|
||||||
| x | q | xq,xq | 360m +-2 |
|
| x | q | xq,xq | 360m +-1 |
|
||||||
| x | r | xr,xr | 316m +-2 |
|
| x | r | xr,xr | 316m +-1 |
|
||||||
| x | s | xs,xs | 300m +-2 |
|
| x | s | xs,xs | 300m +-1 |
|
||||||
| x | t | xt,xt | 316m +-2 |
|
| x | t | xt,xt | 316m +-1 |
|
||||||
| x | u | xu,xu | 360m +-2 |
|
| x | u | xu,xu | 360m +-1 |
|
||||||
| x | v | xv,xv | 424m +-2 |
|
| x | v | xv,xv | 424m +-1 |
|
||||||
| x | w | xw,xw | 360m +-2 |
|
| x | w | xw,xw | 360m +-1 |
|
||||||
| x | y | xy,xy | 316m +-2 |
|
| x | y | xy,xy | 316m +-1 |
|
||||||
|
|
||||||
@maze
|
@maze
|
||||||
Scenario: Distance of a maze of short segments
|
Scenario: Distance of a maze of short segments
|
||||||
@@ -245,4 +245,4 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| a | t | abcdefghijklmnopqrst,abcdefghijklmnopqrst | 133m +-2 |
|
| a | t | abcdefghijklmnopqrst,abcdefghijklmnopqrst | 133m +-1 |
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ Feature: Basic Distance Matrix
|
|||||||
| ab |
|
| ab |
|
||||||
|
|
||||||
When I request a travel time matrix I should get
|
When I request a travel time matrix I should get
|
||||||
| | a | b |
|
| | a | b |
|
||||||
| a | 0 | 9 +- 2 |
|
| a | 0 | 10 |
|
||||||
| b | 9 ~15% | 0 |
|
| b | 10 | 0 |
|
||||||
|
|
||||||
Scenario: Testbot - Travel time matrix of small grid
|
Scenario: Testbot - Travel time matrix of small grid
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -219,3 +219,74 @@ Feature: Basic Distance Matrix
|
|||||||
| 2 | 70 +-1 | 0 | 30 +-1 | 40 +-1 |
|
| 2 | 70 +-1 | 0 | 30 +-1 | 40 +-1 |
|
||||||
| 3 | 40 +-1 | 50 +-1 | 0 | 10 +-1 |
|
| 3 | 40 +-1 | 50 +-1 | 0 | 10 +-1 |
|
||||||
| 4 | 30 +-1 | 40 +-1 | 70 +-1 | 0 |
|
| 4 | 30 +-1 | 40 +-1 | 70 +-1 | 0 |
|
||||||
|
|
||||||
|
Scenario: Testbot - Travel time matrix based on segment durations
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
function segment_function (segment)
|
||||||
|
segment.weight = 2
|
||||||
|
segment.duration = 11
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
a-b-c-d
|
||||||
|
.
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcd |
|
||||||
|
| ce |
|
||||||
|
|
||||||
|
When I request a travel time matrix I should get
|
||||||
|
| | a | b | c | d | e |
|
||||||
|
| a | 0 | 11 | 22 | 33 | 33 |
|
||||||
|
| b | 11 | 0 | 11 | 22 | 22 |
|
||||||
|
| c | 22 | 11 | 0 | 11 | 11 |
|
||||||
|
| d | 33 | 22 | 11 | 0 | 22 |
|
||||||
|
| e | 33 | 22 | 11 | 22 | 0 |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Testbot - Travel time matrix for alternative loop paths
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_precision = 3
|
||||||
|
function segment_function (segment)
|
||||||
|
segment.weight = 777
|
||||||
|
segment.duration = 3
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
a 2 1 b
|
||||||
|
7 4
|
||||||
|
8 3
|
||||||
|
c 5 6 d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| ab | yes |
|
||||||
|
| bd | yes |
|
||||||
|
| dc | yes |
|
||||||
|
| ca | yes |
|
||||||
|
|
||||||
|
When I request a travel time matrix I should get
|
||||||
|
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||||
|
| 1 | 0 | 11 | 3 | 2 | 6 | 5 | 8.9 | 7.9 |
|
||||||
|
| 2 | 1 | 0 | 4 | 3 | 7 | 6 | 9.9 | 8.9 |
|
||||||
|
| 3 | 9 | 8 | 0 | 11 | 3 | 2 | 5.9 | 4.9 |
|
||||||
|
| 4 | 10 | 9 | 1 | 0 | 4 | 3 | 6.9 | 5.9 |
|
||||||
|
| 5 | 6 | 5 | 9 | 8 | 0 | 11 | 2.9 | 1.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 |
|
||||||
|
| 8 | 4.1 | 3.1 | 7.1 | 6.1 | 10.1 | 9.1 | 1 | 0 |
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ Feature: Testbot - Handle ferry routes
|
|||||||
| xa | primary | | |
|
| xa | primary | | |
|
||||||
| yg | primary | | |
|
| yg | primary | | |
|
||||||
| xy | primary | | |
|
| xy | primary | | |
|
||||||
| abcd | | ferry | 0:01 |
|
| abcd | | ferry | 0:02 |
|
||||||
| defg | | ferry | 0:01 |
|
| defg | | ferry | 0:02 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
@@ -187,8 +187,8 @@ Feature: Testbot - Handle ferry routes
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | time |
|
| from | to | route | time |
|
||||||
| a | g | abcdefg,abcdefg | 23400s +-2 |
|
| a | g | abcdefg,abcdefg | 23400s +-3 |
|
||||||
| g | a | abcdefg,abcdefg | 23400s +-2 |
|
| g | a | abcdefg,abcdefg | 23400s +-3 |
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
Scenario: Testbot - Ferry duration formats
|
Scenario: Testbot - Ferry duration formats
|
||||||
|
|||||||
@@ -118,9 +118,9 @@ Feature: Basic Map Matching
|
|||||||
| dcba | hgfe |
|
| dcba | hgfe |
|
||||||
| efgh | abcd |
|
| efgh | abcd |
|
||||||
|
|
||||||
Scenario: Testbot - Duration details
|
Scenario: Testbot - request duration annotations
|
||||||
Given the query options
|
Given the query options
|
||||||
| annotations | true |
|
| annotations | duration |
|
||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -141,15 +141,41 @@ Feature: Basic Map Matching
|
|||||||
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | annotation |
|
| trace | matchings | a:duration |
|
||||||
| abeh | abeh | 1:9.897633:1,0:0:0,1:10.008842:0,1:10.008842:0,1:10.008842:0,0:0:0,2:20.017685:0,1:10.008842:0 |
|
| ach | ach | 1:1,0:1:1:2:1 |
|
||||||
| abci | abci | 1:9.897633:1,0:0:0,1:10.008842:0,0:0.111209:0,1:10.010367:0 |
|
|
||||||
|
Scenario: Testbot - Duration details
|
||||||
|
Given the query options
|
||||||
|
| annotations | duration,nodes |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c d e g h
|
||||||
|
i
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abcdegh | no |
|
||||||
|
| ci | no |
|
||||||
|
|
||||||
|
And the speed file
|
||||||
|
"""
|
||||||
|
1,2,36
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | matchings | a:duration |
|
||||||
|
| abeh | abeh | 1:0,1:1:1,0:2:1 |
|
||||||
|
| abci | abci | 1:0,1,0:1 |
|
||||||
|
|
||||||
# The following is the same as the above, but separated for readability (line length)
|
# The following is the same as the above, but separated for readability (line length)
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | OSM IDs |
|
| trace | matchings | a:nodes |
|
||||||
| abeh | abeh | 1,2,3,2,3,4,5,4,5,6,7 |
|
| abeh | abeh | 1:2:3,2:3:4:5,4:5:6:7 |
|
||||||
| abci | abci | 1,2,3,2,3,8,3,8 |
|
| abci | abci | 1:2:3,2:3,2:3:8 |
|
||||||
|
|
||||||
Scenario: Testbot - Regression test for #3037
|
Scenario: Testbot - Regression test for #3037
|
||||||
Given the query options
|
Given the query options
|
||||||
@@ -174,8 +200,8 @@ Feature: Basic Map Matching
|
|||||||
| fb | yes |
|
| fb | yes |
|
||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | geometry |
|
| trace | matchings | geometry |
|
||||||
| efbc | efbc | 1,0.99964,1.000359,0.99964,1.000359,1,1.000718,1 |
|
| efbc | efbc | 1,0.99964,1.00036,0.99964,1.00036,1,1.000719,1 |
|
||||||
|
|
||||||
Scenario: Testbot - Geometry details using geojson
|
Scenario: Testbot - Geometry details using geojson
|
||||||
Given the query options
|
Given the query options
|
||||||
@@ -194,8 +220,8 @@ Feature: Basic Map Matching
|
|||||||
| bd | no |
|
| bd | no |
|
||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | geometry |
|
| trace | matchings | geometry |
|
||||||
| abd | abd | 1,1,1.000089,1,1.000089,1,1.000089,0.99991 |
|
| abd | abd | 1,1,1.00009,1,1.00009,1,1.00009,0.99991 |
|
||||||
|
|
||||||
Scenario: Testbot - Geometry details using polyline
|
Scenario: Testbot - Geometry details using polyline
|
||||||
Given the query options
|
Given the query options
|
||||||
@@ -234,8 +260,8 @@ Feature: Basic Map Matching
|
|||||||
| bd | no |
|
| bd | no |
|
||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | geometry |
|
| trace | matchings | geometry |
|
||||||
| abd | abd | 1,1,1,1.000089,1,1.000089,0.99991,1.000089 |
|
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
|
||||||
|
|
||||||
Scenario: Testbot - Speed greater than speed threshhold
|
Scenario: Testbot - Speed greater than speed threshhold
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
@@ -277,7 +303,7 @@ Feature: Basic Map Matching
|
|||||||
| abcd | 0 1 2 3 | abcd |
|
| abcd | 0 1 2 3 | abcd |
|
||||||
|
|
||||||
# Regression test 1 for issue 3176
|
# Regression test 1 for issue 3176
|
||||||
Scenario: Testbot - multiuple segments: properly expose OSM IDs
|
Scenario: Testbot - multiple segments: properly expose OSM IDs
|
||||||
Given the query options
|
Given the query options
|
||||||
| annotations | true |
|
| annotations | true |
|
||||||
|
|
||||||
@@ -306,9 +332,9 @@ Feature: Basic Map Matching
|
|||||||
| fg | no |
|
| fg | no |
|
||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | OSM IDs |
|
| trace | a:nodes |
|
||||||
| 12 | 1,2,3,4,5,6,7 |
|
| 12 | 1:2:3:4:5:6:7 |
|
||||||
| 21 | 7,6,5,4,3,2,1 |
|
| 21 | 7:6:5:4:3:2:1 |
|
||||||
|
|
||||||
# Regression test 2 for issue 3176
|
# Regression test 2 for issue 3176
|
||||||
Scenario: Testbot - same edge: properly expose OSM IDs
|
Scenario: Testbot - same edge: properly expose OSM IDs
|
||||||
@@ -334,7 +360,6 @@ Feature: Basic Map Matching
|
|||||||
| abcdef | no |
|
| abcdef | no |
|
||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | OSM IDs |
|
| trace | a:nodes |
|
||||||
| 12 | 1,2,3,4,5,6 |
|
| 12 | 1:2:3:4:5:6 |
|
||||||
| 21 | 6,5,4,3,2,1 |
|
| 21 | 6:5:4:3:2:1 |
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Feature: Routing close to the [0,0] origin
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| b | d | abcde,abcde | 200m +-2 |
|
| b | d | abcde,abcde | 200m |
|
||||||
| d | b | | |
|
| d | b | | |
|
||||||
|
|
||||||
Scenario: North-south oneways crossing the origin
|
Scenario: North-south oneways crossing the origin
|
||||||
@@ -71,5 +71,5 @@ Feature: Routing close to the [0,0] origin
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| b | d | abcde,abcde | 200m +-2 |
|
| b | d | abcde,abcde | 200m |
|
||||||
| d | b | | |
|
| d | b | | |
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ Feature: Projection to nearest point on road
|
|||||||
|
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
Given the node locations
|
Given the node locations
|
||||||
| node | lat | lon |
|
| node | lat | lon |
|
||||||
| a | 80.00000 | 0.00000 |
|
| a | 80.000000 | 0.0000000 |
|
||||||
| b | 80.00639 | 0.03667 |
|
| b | 80.006350 | 0.0366666 |
|
||||||
| c | 80.01278 | 0.07333 |
|
| c | 80.012730 | 0.0733333 |
|
||||||
| d | 80.00000 | 0.07333 |
|
| d | 80.000000 | 0.0733333 |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes |
|
| nodes |
|
||||||
@@ -23,16 +23,16 @@ Feature: Projection to nearest point on road
|
|||||||
|
|
||||||
Scenario: Projection onto way at high latitudes, 1km distance
|
Scenario: Projection onto way at high latitudes, 1km distance
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | bearing | distance |
|
| from | to | route | bearing | distance |
|
||||||
| b | a | abc,abc | 0->225,225->0 | 1000m +- 7 |
|
| b | a | abc,abc | 0->225,225->0 | 1000m |
|
||||||
| b | c | abc,abc | 0->45,45->0 | 1000m +- 7 |
|
| b | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
|
||||||
| a | d | abc,abc | 0->45,45->0 | 1000m +- 7 |
|
| a | d | abc,abc | 0->45,45->0 | 1000m |
|
||||||
| d | a | abc,abc | 0->225,225->0 | 1000m +- 7 |
|
| d | a | abc,abc | 0->225,225->0 | 1000m |
|
||||||
| c | d | abc,abc | 0->225,224->0 | 1000m +- 8 |
|
| c | d | abc,abc | 0->225,225->0 | 1000m +- 3 |
|
||||||
| d | c | abc,abc | 0->44,45->0 | 1000m +- 8 |
|
| d | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
|
||||||
|
|
||||||
Scenario: Projection onto way at high latitudes, no distance
|
Scenario: Projection onto way at high latitudes, no distance
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance |
|
| from | to | route | distance |
|
||||||
| d | b | abc,abc | 0m +-5 |
|
| d | b | abc,abc | 0m |
|
||||||
| b | d | abc,abc | 0m +-5 |
|
| b | d | abc,abc | 0m |
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
@routing @speed @traffic
|
||||||
|
Feature: Traffic - speeds
|
||||||
|
|
||||||
|
Background: Use specific speeds
|
||||||
|
Given the node locations
|
||||||
|
| node | lat | lon |
|
||||||
|
| a | 0.1 | 0.1 |
|
||||||
|
| b | 0.05 | 0.1 |
|
||||||
|
| c | 0.0 | 0.1 |
|
||||||
|
| d | 0.05 | 0.03 |
|
||||||
|
| e | 0.05 | 0.066 |
|
||||||
|
| f | 0.075 | 0.066 |
|
||||||
|
| g | 0.075 | 0.1 |
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| ad | primary |
|
||||||
|
| bc | primary |
|
||||||
|
| dc | primary |
|
||||||
|
| de | primary |
|
||||||
|
| eb | primary |
|
||||||
|
| df | primary |
|
||||||
|
| fb | primary |
|
||||||
|
And the profile "testbot"
|
||||||
|
And the extract extra arguments "--generate-edge-lookup"
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Weighting based on speed file
|
||||||
|
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,0
|
||||||
|
2,1,0
|
||||||
|
2,3,27
|
||||||
|
3,2,27
|
||||||
|
1,4,27
|
||||||
|
4,1,27
|
||||||
|
"""
|
||||||
|
And the query options
|
||||||
|
| annotations | datasources |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | speed | weights | a:datasources |
|
||||||
|
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0:0 |
|
||||||
|
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||||
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||||
|
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
||||||
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||||
|
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
|
||||||
|
| a | g | ad,df,fb,fb | 30 km/h | 1275.7,487.5,304.7,0 | 1:0:0 |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Weighting based on speed file weights, ETA based on file durations
|
||||||
|
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,1,20020.7
|
||||||
|
2,1,1,20020.7
|
||||||
|
2,3,27,741.5
|
||||||
|
3,2,27,741.5
|
||||||
|
1,4,27,1275.7
|
||||||
|
4,1,27,1275.7
|
||||||
|
"""
|
||||||
|
And the query options
|
||||||
|
| annotations | datasources |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | speed | weights | a:datasources |
|
||||||
|
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0:0 |
|
||||||
|
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||||
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||||
|
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
||||||
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||||
|
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1:0 |
|
||||||
|
| a | g | ab,ab | 1 km/h | 10010.3,0 | 1 |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Weighting based on speed file weights, ETA based on file durations
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_precision = 3
|
||||||
|
"""
|
||||||
|
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,1,20020.789
|
||||||
|
2,1,1,20020.123
|
||||||
|
2,3,27,741.56789
|
||||||
|
3,2,27,741.3
|
||||||
|
1,4,1,34445.12
|
||||||
|
4,1,1,34445.3
|
||||||
|
"""
|
||||||
|
And the query options
|
||||||
|
| annotations | datasources |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | speed | weights | a:datasources |
|
||||||
|
| a | b | ab,ab | 1 km/h | 20020.789,0 | 1:0 |
|
||||||
|
| a | c | ab,bc,bc | 2 km/h | 20020.789,741.568,0 | 1:1:0 |
|
||||||
|
| b | c | bc,bc | 27 km/h | 741.568,0 | 1:0 |
|
||||||
|
| a | d | ab,eb,de,de | 2 km/h | 20020.789,378.169,400.415,0 | 1:0:0 |
|
||||||
|
| d | c | dc,dc | 36 km/h | 956.805,0 | 0 |
|
||||||
|
| g | b | ab,ab | 1 km/h | 10010.392,0 | 1:0 |
|
||||||
|
| a | g | ab,ab | 1 km/h | 10010.397,0 | 1 |
|
||||||
|
| g | a | ab,ab | 1 km/h | 10010.064,0 | 1:1 |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Speeds that isolate a single node (a)
|
||||||
|
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||||
|
And the node locations
|
||||||
|
| node | lat | lon |
|
||||||
|
| h | 2.075 | 19.1 |
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,0
|
||||||
|
2,1,0
|
||||||
|
2,3,27
|
||||||
|
3,2,27
|
||||||
|
1,4,0
|
||||||
|
4,1,0
|
||||||
|
"""
|
||||||
|
And the query options
|
||||||
|
| annotations | true |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | speed | weights | a:datasources |
|
||||||
|
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 |
|
||||||
|
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1:0 |
|
||||||
|
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||||
|
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0:0 |
|
||||||
|
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||||
|
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
|
||||||
|
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||||
|
Given the speed file
|
||||||
|
"""
|
||||||
|
1,2,-10
|
||||||
|
2,1,-20
|
||||||
|
2,3,27
|
||||||
|
3,2,27
|
||||||
|
1,4,-3
|
||||||
|
4,1,-5
|
||||||
|
"""
|
||||||
|
And the data has been extracted
|
||||||
|
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||||
|
And stderr should contain "malformed"
|
||||||
|
And it should exit with an error
|
||||||
@@ -37,14 +37,30 @@ Feature: Traffic - turn penalties applied to turn onto which a phantom node snap
|
|||||||
Given the turn penalty file
|
Given the turn penalty file
|
||||||
"""
|
"""
|
||||||
1,2,5,0,comment
|
1,2,5,0,comment
|
||||||
3,4,7,-20
|
3,4,7,-30
|
||||||
"""
|
"""
|
||||||
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | time |
|
| from | to | route | speed | time |
|
||||||
| a | e | ab,be,be | 36 km/h | 40s +-1 |
|
| a | e | ab,be,be | 36 km/h | 40s +-1 |
|
||||||
| 1 | e | ab,be,be | 36 km/h | 30s +-1 |
|
| 1 | e | ab,be,be | 36 km/h | 30s +-1 |
|
||||||
| b | f | bc,cf,cf | 36 km/h | 40s +-1 |
|
| b | f | bc,cf,cf | 36 km/h | 40s +-1 |
|
||||||
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 |
|
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 |
|
||||||
| c | g | cd,dg,dg | 71 km/h | 20s +-1 |
|
| c | g | cd,dg,dg | 144 km/h | 10s +-1 |
|
||||||
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 |
|
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 |
|
||||||
|
|
||||||
|
Scenario: Weighting based on turn penalty file with weights
|
||||||
|
Given the turn penalty file
|
||||||
|
"""
|
||||||
|
1,2,5,0,-3.33,comment
|
||||||
|
3,4,7,-30,100.75
|
||||||
|
"""
|
||||||
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | speed | time | weights |
|
||||||
|
| a | e | ab,be,be | 36 km/h | 40s +-1 | 16.7,20,0 |
|
||||||
|
| 1 | e | ab,be,be | 36 km/h | 30s +-1 | 6.7,20,0 |
|
||||||
|
| b | f | bc,cf,cf | 36 km/h | 40s +-1 | 20,20,0 |
|
||||||
|
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 | 10,20,0 |
|
||||||
|
| c | g | cd,dg,dg | 144 km/h | 10s +-1 | 120.8,20,0 |
|
||||||
|
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 | 110.8,20,0 |
|
||||||
|
|||||||
+205
-22
@@ -5,7 +5,25 @@ Feature: Basic trip planning
|
|||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
|
|
||||||
Scenario: Testbot - Trip planning with less than 10 nodes
|
Scenario: Testbot - Trip: Roundtrip with one waypoint
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
c d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| bc |
|
||||||
|
| cb |
|
||||||
|
| da |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | trips |
|
||||||
|
| a | aa |
|
||||||
|
|
||||||
|
Scenario: Testbot - Trip: Roundtrip with waypoints (less than 10)
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b
|
a b
|
||||||
@@ -24,7 +42,7 @@ Feature: Basic trip planning
|
|||||||
| a,b,c,d | abcda | 7.6 |
|
| a,b,c,d | abcda | 7.6 |
|
||||||
| d,b,c,a | dbcad | 7.6 |
|
| d,b,c,a | dbcad | 7.6 |
|
||||||
|
|
||||||
Scenario: Testbot - Trip planning with more than 10 nodes
|
Scenario: Testbot - Trip: Roundtrip waypoints (more than 10)
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d
|
a b c d
|
||||||
@@ -37,7 +55,6 @@ Feature: Basic trip planning
|
|||||||
| nodes |
|
| nodes |
|
||||||
| ab |
|
| ab |
|
||||||
| bc |
|
| bc |
|
||||||
| cb |
|
|
||||||
| de |
|
| de |
|
||||||
| ef |
|
| ef |
|
||||||
| fg |
|
| fg |
|
||||||
@@ -48,12 +65,85 @@ Feature: Basic trip planning
|
|||||||
| kl |
|
| kl |
|
||||||
| la |
|
| la |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | trips |
|
||||||
|
| a,b,c,d,e,f,g,h,i,j,k,l | alkjihgfedcba |
|
||||||
|
|
||||||
|
Scenario: Testbot - Trip: Roundtrip FS waypoints (more than 10)
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c d
|
||||||
|
l e
|
||||||
|
k f
|
||||||
|
j i h g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| bc |
|
||||||
|
| de |
|
||||||
|
| ef |
|
||||||
|
| fg |
|
||||||
|
| gh |
|
||||||
|
| hi |
|
||||||
|
| ij |
|
||||||
|
| jk |
|
||||||
|
| kl |
|
||||||
|
| la |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | source | trips |
|
||||||
|
| a,b,c,d,e,f,g,h,i,j,k,l | first | alkjihgfedcba |
|
||||||
|
|
||||||
|
Scenario: Testbot - Trip: Roundtrip FE waypoints (more than 10)
|
||||||
|
Given the query options
|
||||||
|
| source | last |
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c d
|
||||||
|
l e
|
||||||
|
k f
|
||||||
|
j i h g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| bc |
|
||||||
|
| de |
|
||||||
|
| ef |
|
||||||
|
| fg |
|
||||||
|
| gh |
|
||||||
|
| hi |
|
||||||
|
| ij |
|
||||||
|
| jk |
|
||||||
|
| kl |
|
||||||
|
| la |
|
||||||
|
|
||||||
When I plan a trip I should get
|
When I plan a trip I should get
|
||||||
| waypoints | trips |
|
| waypoints | trips |
|
||||||
| a,b,c,d,e,f,g,h,i,j,k,l | cbalkjihgfedc |
|
| a,b,c,d,e,f,g,h,i,j,k,l | lkjihgfedcbal |
|
||||||
|
|
||||||
Scenario: Testbot - Trip planning with multiple scc
|
Scenario: Testbot - Trip: Unroutable roundtrip with waypoints (less than 10)
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
|
||||||
|
d c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| dc |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | status | message |
|
||||||
|
| a,b,c,d | NoTrips | No trip visiting all destinations possible. |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Testbot - Trip: Unroutable roundtrip with waypoints (more than 10)
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b c d
|
a b c d
|
||||||
@@ -62,7 +152,7 @@ Feature: Basic trip planning
|
|||||||
j i h g
|
j i h g
|
||||||
|
|
||||||
q m n
|
q m n
|
||||||
p o
|
p o
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@@ -85,13 +175,106 @@ Feature: Basic trip planning
|
|||||||
| pq |
|
| pq |
|
||||||
| qm |
|
| qm |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | status | message |
|
||||||
|
| a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p | NoTrips | No trip visiting all destinations possible. |
|
||||||
|
|
||||||
|
# Test TFSE
|
||||||
|
Scenario: Testbot - Trip: TFSE with errors
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
|
||||||
|
d c
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| dc |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | source | destination | roundtrip | status | message |
|
||||||
|
| a,b,c,d | first | last | false | NoTrips | No trip visiting all destinations possible. |
|
||||||
|
|
||||||
|
Scenario: Testbot - Trip: FSE with waypoints (less than 10)
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
|
||||||
|
c
|
||||||
|
e d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| ac |
|
||||||
|
| ad |
|
||||||
|
| ae |
|
||||||
|
| bc |
|
||||||
|
| bd |
|
||||||
|
| be |
|
||||||
|
| cd |
|
||||||
|
| ce |
|
||||||
|
| de |
|
||||||
|
|
||||||
When I plan a trip I should get
|
When I plan a trip I should get
|
||||||
| waypoints | trips |
|
| waypoints | source | destination |roundtrip | trips | durations | distance |
|
||||||
| a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p | defghijklabcd,mnopm |
|
| a,b,d,e,c | first | last | false | abedc | 8.200000000000001 | 81.6 |
|
||||||
|
|
||||||
# Test single node in each component #1850
|
|
||||||
Scenario: Testbot - Trip planning with less than 10 nodes
|
Scenario: Testbot - Trip: FSE with waypoints (more than 10)
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c d e f g h i j k
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| bc |
|
||||||
|
| cd |
|
||||||
|
| de |
|
||||||
|
| ef |
|
||||||
|
| fg |
|
||||||
|
| gh |
|
||||||
|
| hi |
|
||||||
|
| ij |
|
||||||
|
| jk |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | source | destination | roundtrip | trips | durations | distance |
|
||||||
|
| a,b,c,d,e,h,i,j,k,g,f | first | last | false | abcdeghijkf | 15 | 149.8 |
|
||||||
|
|
||||||
|
Scenario: Testbot - Trip: FSE roundtrip with waypoints (less than 10)
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b
|
||||||
|
|
||||||
|
c
|
||||||
|
e d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| ac |
|
||||||
|
| ad |
|
||||||
|
| ae |
|
||||||
|
| bc |
|
||||||
|
| bd |
|
||||||
|
| be |
|
||||||
|
| cd |
|
||||||
|
| ce |
|
||||||
|
| de |
|
||||||
|
|
||||||
|
When I plan a trip I should get
|
||||||
|
| waypoints | source | destination | roundtrip | trips |
|
||||||
|
| a,b,d,e,c | first | last | true | abedca |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Testbot - Trip: midway points in isoldated roads should return no trips
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a 1 b
|
a 1 b
|
||||||
@@ -105,10 +288,10 @@ Feature: Basic trip planning
|
|||||||
| cd |
|
| cd |
|
||||||
|
|
||||||
When I plan a trip I should get
|
When I plan a trip I should get
|
||||||
| waypoints | trips |
|
| waypoints | status | message |
|
||||||
| 1,2 | |
|
| 1,2 | NoTrips | No trip visiting all destinations possible. |
|
||||||
|
|
||||||
Scenario: Testbot - Repeated Coordinate
|
Scenario: Testbot - Trip: Repeated Coordinate
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
a b
|
a b
|
||||||
@@ -123,7 +306,7 @@ Feature: Basic trip planning
|
|||||||
| a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a | |
|
| a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a | |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Testbot - Trip with geometry details of geojson
|
Scenario: Testbot - Trip: geometry details of geojson
|
||||||
Given the query options
|
Given the query options
|
||||||
| geometries | geojson |
|
| geometries | geojson |
|
||||||
|
|
||||||
@@ -141,11 +324,11 @@ Feature: Basic trip planning
|
|||||||
| da |
|
| da |
|
||||||
|
|
||||||
When I plan a trip I should get
|
When I plan a trip I should get
|
||||||
| waypoints | trips | durations | geometry |
|
| waypoints | trips | durations | geometry |
|
||||||
| a,b,c,d | abcda | 7.6 | 1,1,1.000089,1,1,0.99991,1.000089,1,1,1,1.000089,0.99991,1,1 |
|
| a,b,c,d | abcda | 7.6 | 1,1,1.00009,1,1,0.99991,1.00009,1,1,1,1.00009,0.99991,1,1 |
|
||||||
| d,b,c,a | dbcad | 7.6 | 1.000089,0.99991,1,1,1.000089,1,1,0.99991,1.000089,1,1,1,1.000089,0.99991 |
|
| d,b,c,a | dbcad | 7.6 | 1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009,1,1,1,1.00009,0.99991 |
|
||||||
|
|
||||||
Scenario: Testbot - Trip with geometry details of polyline
|
Scenario: Testbot - Trip: geometry details of polyline
|
||||||
Given the query options
|
Given the query options
|
||||||
| geometries | polyline |
|
| geometries | polyline |
|
||||||
|
|
||||||
@@ -167,7 +350,7 @@ Feature: Basic trip planning
|
|||||||
| a,b,c,d | abcda | 7.6 | 1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009,1,1 |
|
| a,b,c,d | abcda | 7.6 | 1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009,1,1 |
|
||||||
| d,b,c,a | dbcad | 7.6 | 0.99991,1.00009,1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009 |
|
| d,b,c,a | dbcad | 7.6 | 0.99991,1.00009,1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009 |
|
||||||
|
|
||||||
Scenario: Testbot - Trip with geometry details of polyline6
|
Scenario: Testbot - Trip: geometry details of polyline6
|
||||||
Given the query options
|
Given the query options
|
||||||
| geometries | polyline6 |
|
| geometries | polyline6 |
|
||||||
|
|
||||||
@@ -185,6 +368,6 @@ Feature: Basic trip planning
|
|||||||
| da |
|
| da |
|
||||||
|
|
||||||
When I plan a trip I should get
|
When I plan a trip I should get
|
||||||
| waypoints | trips | durations | geometry |
|
| waypoints | trips | durations | geometry |
|
||||||
| a,b,c,d | abcda | 7.6 | 1,1,1,1.000089,0.99991,1,1,1.000089,1,1,0.99991,1.000089,1,1 |
|
| a,b,c,d | abcda | 7.6 | 1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009,1,1 |
|
||||||
| d,b,c,a | dbcad | 7.6 | 0.99991,1.000089,1,1,1,1.000089,0.99991,1,1,1.000089,1,1,0.99991,1.000089 |
|
| d,b,c,a | dbcad | 7.6 | 0.99991,1.00009,1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009 |
|
||||||
@@ -23,7 +23,6 @@ Feature: Handling of UTF characters
|
|||||||
| c | d | Cyrillic Москва,Cyrillic Москва |
|
| c | d | Cyrillic Москва,Cyrillic Москва |
|
||||||
|
|
||||||
|
|
||||||
@todo
|
|
||||||
Scenario: Up to 255 Unicode Code Points (255 x Panda Code Point)
|
Scenario: Up to 255 Unicode Code Points (255 x Panda Code Point)
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -35,6 +34,6 @@ Feature: Handling of UTF characters
|
|||||||
| ab | ab | primary |
|
| ab | ab | primary |
|
||||||
| bc | 🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 | primary |
|
| bc | 🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 | primary |
|
||||||
|
|
||||||
When I route 100 times I should get
|
When I route 2 times I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | ab,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 |
|
| a | c | ab,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 |
|
||||||
|
|||||||
@@ -327,3 +327,19 @@ Feature: Via points
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route |
|
| waypoints | route |
|
||||||
| a,b,e | |
|
| a,b,e | |
|
||||||
|
|
||||||
|
@todo @3359
|
||||||
|
Scenario: U-Turn In Bearings
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a 1 b
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | bearings | route | turns |
|
||||||
|
| 1,a | 90,2 270,2 | ab,ab,ab | depart,turn uturn,arrive |
|
||||||
|
| 1,b | 270,2 90,2 | ab,ab,ab | depart,turn uturn,arrive |
|
||||||
|
|||||||
@@ -0,0 +1,321 @@
|
|||||||
|
@testbot
|
||||||
|
Feature: Weight tests
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "testbot"
|
||||||
|
Given a grid size of 10 meters
|
||||||
|
Given the extract extra arguments "--generate-edge-lookup"
|
||||||
|
Given the query options
|
||||||
|
| geometries | geojson |
|
||||||
|
|
||||||
|
Scenario: Weight details
|
||||||
|
Given the query options
|
||||||
|
| annotations | weight |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
s
|
||||||
|
·
|
||||||
|
a---b---c
|
||||||
|
|
|
||||||
|
d
|
||||||
|
|··t
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abc |
|
||||||
|
| cde |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | a:weight |
|
||||||
|
| s,t | abc,cde,cde | 1.1:2:2:1 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | times | weight_name | weights |
|
||||||
|
| s,t | abc,cde,cde | 3.1s,3s,0s | duration | 3.1,3,0 |
|
||||||
|
|
||||||
|
# FIXME include/engine/guidance/assemble_geometry.hpp:95
|
||||||
|
Scenario: Start and target on the same and adjacent edge
|
||||||
|
Given the query options
|
||||||
|
| annotations | distance,duration,weight,nodes,speed |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a-------b-------c
|
||||||
|
· · ·
|
||||||
|
s t e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abc |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | distances | weights | times | a:distance | a:duration | a:weight | a:speed |
|
||||||
|
| s,t | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 3 | 3 | 6.7 |
|
||||||
|
| t,s | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 3.1 | 3.1 | 6.5 |
|
||||||
|
| s,e | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 30.026527:10.008842 | 3.1:1 | 3.1:1 | 9.7:10 |
|
||||||
|
| e,s | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 10.008842:30.026527 | 1:3.1 | 1:3.1 | 10:9.7 |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Step weights -- way_function: fail if no weight or weight_per_meter property
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_name = 'steps'
|
||||||
|
function way_function(way, result)
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.backward_mode = mode.driving
|
||||||
|
result.forward_speed = 42
|
||||||
|
result.backward_speed = 42
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
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 {osm_file} --profile {profile_file}"
|
||||||
|
Then stderr should contain "There are no edges"
|
||||||
|
And it should exit with an error
|
||||||
|
|
||||||
|
Scenario: Step weights -- way_function: second way wins
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_name = 'steps'
|
||||||
|
function way_function(way, result)
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.backward_mode = mode.driving
|
||||||
|
result.duration = 42
|
||||||
|
result.weight = 35
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a---b---c---d---e---f---g---h
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcdef |
|
||||||
|
| abcdefgh |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | distance | weights | times |
|
||||||
|
| a,f | , | 100m | 25,0 | 30s,0s |
|
||||||
|
| f,a | , | 100m | 25,0 | 30s,0s |
|
||||||
|
| a,h | , | 140m +-1 | 35,0 | 42s,0s |
|
||||||
|
| h,a | , | 140m +-1 | 35,0 | 42s,0s |
|
||||||
|
|
||||||
|
Scenario: Step weights -- way_function: higher weight_per_meter is preferred
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_name = 'steps'
|
||||||
|
function way_function(way, result)
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.backward_mode = mode.driving
|
||||||
|
result.duration = 42
|
||||||
|
result.forward_rate = 1
|
||||||
|
result.backward_rate = 0.5
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a---b---c---d---e---f---g---h
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcdefgh |
|
||||||
|
| abcdef |
|
||||||
|
| fgh |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | distance | weights | times |
|
||||||
|
| a,f | , | 100m | 99.9,0 | 30s,0s |
|
||||||
|
| f,a | , | 100m | 199.8,0 | 30s,0s |
|
||||||
|
| a,h | , | 140m | 139.9,0 | 42s,0s |
|
||||||
|
| h,a | , | 140m | 279.8,0 | 42s,0s |
|
||||||
|
| f,h | , | 40m | 40,0 | 12s,0s |
|
||||||
|
| h,f | , | 40m | 80,0 | 12s,0s |
|
||||||
|
|
||||||
|
Scenario: Step weights -- segment_function
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_name = 'steps'
|
||||||
|
function way_function(way, result)
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.backward_mode = mode.driving
|
||||||
|
result.weight = 42
|
||||||
|
result.duration = 3
|
||||||
|
end
|
||||||
|
function segment_function (segment)
|
||||||
|
segment.weight = 1
|
||||||
|
segment.duration = 11
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a---b---c---d---e---f---g---h
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcdefgh |
|
||||||
|
| abcdef |
|
||||||
|
| fgh |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | distance | weights | times |
|
||||||
|
| a,f | , | 100m | 5,0 | 55s,0s |
|
||||||
|
| f,a | , | 100m | 5,0 | 55s,0s |
|
||||||
|
| a,h | , | 140m +-1 | 7,0 | 77s,0s |
|
||||||
|
| h,a | , | 140m +-1 | 7,0 | 77s,0s |
|
||||||
|
| f,h | , | 40m +-1 | 2,0 | 22s,0s |
|
||||||
|
| h,f | , | 40m +-1 | 2,0 | 22s,0s |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Step weights -- segment_function and turn_function with weight precision
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_name = 'steps'
|
||||||
|
properties.weight_precision = 3
|
||||||
|
function way_function(way, result)
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.backward_mode = mode.driving
|
||||||
|
result.weight = 42
|
||||||
|
result.duration = 3
|
||||||
|
end
|
||||||
|
function segment_function (segment)
|
||||||
|
segment.weight = 1.11
|
||||||
|
segment.duration = 100
|
||||||
|
end
|
||||||
|
function turn_function (turn)
|
||||||
|
print (turn.angle)
|
||||||
|
turn.weight = 2 + turn.angle / 100
|
||||||
|
turn.duration = turn.angle
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a---b---c---d
|
||||||
|
⋮
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcd |
|
||||||
|
| ce |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | distance | weights | times |
|
||||||
|
| a,c | , | 40m +-.1 | 5.119,0 | 289.9s,0s |
|
||||||
|
| a,e | ,, | 60m +-.1 | 5.119,1.11,0 | 289.9s,100s,0s |
|
||||||
|
| e,a | ,, | 60m +-.1 | 2.21,2.22,0 | 10.1s,200s,0s |
|
||||||
|
| e,d | ,, | 40m +-.1 | 4.009,1.11,0 | 189.9s,100s,0s |
|
||||||
|
| d,e | ,, | 40m +-.1 | 2.21,1.11,0 | 10.1s,100s,0s |
|
||||||
|
|
||||||
|
Scenario: Step weights -- segment_function with speed and turn updates
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.traffic_signal_penalty = 0
|
||||||
|
properties.u_turn_penalty = 0
|
||||||
|
properties.weight_name = 'steps'
|
||||||
|
function way_function(way, result)
|
||||||
|
result.forward_mode = mode.driving
|
||||||
|
result.backward_mode = mode.driving
|
||||||
|
result.weight = 42
|
||||||
|
result.duration = 3
|
||||||
|
end
|
||||||
|
function segment_function (segment)
|
||||||
|
segment.weight = 10
|
||||||
|
segment.duration = 11
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
a---b---c---d
|
||||||
|
.
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcd |
|
||||||
|
| ce |
|
||||||
|
And the speed file
|
||||||
|
"""
|
||||||
|
1,2,36,42
|
||||||
|
2,1,36,42
|
||||||
|
"""
|
||||||
|
And the turn penalty file
|
||||||
|
"""
|
||||||
|
2,3,5,25.5,16.7
|
||||||
|
"""
|
||||||
|
And the contract extra arguments "--segment-speed-file {speeds_file} --turn-penalty-file {penalties_file}"
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | distance | weights | times |
|
||||||
|
| a,d | , | 59.9m | 62,0 | 24s,0s |
|
||||||
|
| a,e | ,, | 60.1m | 68.7,10,0 | 38.5s,11s,0s |
|
||||||
|
| d,e | ,, | 39.9m | 10,10,0 | 11s,11s,0s |
|
||||||
|
|
||||||
|
Scenario: Step weights -- segment_function with speed and turn updates with fallback to durations
|
||||||
|
Given the profile file "testbot" extended with
|
||||||
|
"""
|
||||||
|
api_version = 1
|
||||||
|
properties.weight_precision = 3
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the node map
|
||||||
|
"""
|
||||||
|
a---b---c---d
|
||||||
|
.
|
||||||
|
e
|
||||||
|
"""
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcd |
|
||||||
|
| ce |
|
||||||
|
And the speed file
|
||||||
|
"""
|
||||||
|
1,2,24
|
||||||
|
2,1,24
|
||||||
|
"""
|
||||||
|
And the turn penalty file
|
||||||
|
"""
|
||||||
|
2,3,5,1
|
||||||
|
"""
|
||||||
|
And the contract extra arguments "--segment-speed-file {speeds_file} --turn-penalty-file {penalties_file}"
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | distance | weights | times |
|
||||||
|
| a,d | abcd,abcd | 59.9m | 6.993,0 | 7s,0s |
|
||||||
|
| a,e | abcd,ce,ce | 60.1m | 6.002,2.002,0 | 6s,2s,0s |
|
||||||
|
| d,e | abcd,ce,ce | 39.9m | 1.991,2.002,0 | 2s,2s,0s |
|
||||||
@@ -78,20 +78,9 @@ class Contractor
|
|||||||
private:
|
private:
|
||||||
ContractorConfig config;
|
ContractorConfig config;
|
||||||
|
|
||||||
EdgeID
|
EdgeID LoadEdgeExpandedGraph(const ContractorConfig &config,
|
||||||
LoadEdgeExpandedGraph(const std::string &edge_based_graph_path,
|
std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
std::vector<EdgeWeight> &node_weights);
|
||||||
std::vector<EdgeWeight> &node_weights,
|
|
||||||
const std::string &edge_segment_lookup_path,
|
|
||||||
const std::string &edge_penalty_path,
|
|
||||||
const std::vector<std::string> &segment_speed_path,
|
|
||||||
const std::vector<std::string> &turn_penalty_path,
|
|
||||||
const std::string &nodes_filename,
|
|
||||||
const std::string &geometry_filename,
|
|
||||||
const std::string &datasource_names_filename,
|
|
||||||
const std::string &datasource_indexes_filename,
|
|
||||||
const std::string &rtree_leaf_filename,
|
|
||||||
const double log_edge_updates_factor);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace contractor
|
|||||||
|
|
||||||
struct ContractorConfig
|
struct ContractorConfig
|
||||||
{
|
{
|
||||||
ContractorConfig() : requested_num_threads(0) {}
|
ContractorConfig() : requested_num_threads(0), weight_multiplier(10.) {}
|
||||||
|
|
||||||
// Infer the output names from the path of the .osrm file
|
// Infer the output names from the path of the .osrm file
|
||||||
void UseDefaultOutputNames()
|
void UseDefaultOutputNames()
|
||||||
@@ -49,12 +49,15 @@ struct ContractorConfig
|
|||||||
graph_output_path = osrm_input_path.string() + ".hsgr";
|
graph_output_path = osrm_input_path.string() + ".hsgr";
|
||||||
edge_based_graph_path = osrm_input_path.string() + ".ebg";
|
edge_based_graph_path = osrm_input_path.string() + ".ebg";
|
||||||
edge_segment_lookup_path = osrm_input_path.string() + ".edge_segment_lookup";
|
edge_segment_lookup_path = osrm_input_path.string() + ".edge_segment_lookup";
|
||||||
edge_penalty_path = osrm_input_path.string() + ".edge_penalties";
|
turn_weight_penalties_path = osrm_input_path.string() + ".turn_weight_penalties";
|
||||||
|
turn_duration_penalties_path = osrm_input_path.string() + ".turn_duration_penalties";
|
||||||
|
turn_penalties_index_path = osrm_input_path.string() + ".turn_penalties_index";
|
||||||
node_based_graph_path = osrm_input_path.string() + ".nodes";
|
node_based_graph_path = osrm_input_path.string() + ".nodes";
|
||||||
geometry_path = osrm_input_path.string() + ".geometry";
|
geometry_path = osrm_input_path.string() + ".geometry";
|
||||||
rtree_leaf_path = osrm_input_path.string() + ".fileIndex";
|
rtree_leaf_path = osrm_input_path.string() + ".fileIndex";
|
||||||
datasource_names_path = osrm_input_path.string() + ".datasource_names";
|
datasource_names_path = osrm_input_path.string() + ".datasource_names";
|
||||||
datasource_indexes_path = osrm_input_path.string() + ".datasource_indexes";
|
datasource_indexes_path = osrm_input_path.string() + ".datasource_indexes";
|
||||||
|
profile_properties_path = osrm_input_path.string() + ".properties";
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::filesystem::path config_file_path;
|
boost::filesystem::path config_file_path;
|
||||||
@@ -66,7 +69,9 @@ struct ContractorConfig
|
|||||||
std::string edge_based_graph_path;
|
std::string edge_based_graph_path;
|
||||||
|
|
||||||
std::string edge_segment_lookup_path;
|
std::string edge_segment_lookup_path;
|
||||||
std::string edge_penalty_path;
|
std::string turn_weight_penalties_path;
|
||||||
|
std::string turn_duration_penalties_path;
|
||||||
|
std::string turn_penalties_index_path;
|
||||||
std::string node_based_graph_path;
|
std::string node_based_graph_path;
|
||||||
std::string geometry_path;
|
std::string geometry_path;
|
||||||
std::string rtree_leaf_path;
|
std::string rtree_leaf_path;
|
||||||
@@ -74,6 +79,7 @@ struct ContractorConfig
|
|||||||
|
|
||||||
unsigned requested_num_threads;
|
unsigned requested_num_threads;
|
||||||
double log_edge_updates_factor;
|
double log_edge_updates_factor;
|
||||||
|
double weight_multiplier;
|
||||||
|
|
||||||
// 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.
|
||||||
@@ -85,6 +91,7 @@ struct ContractorConfig
|
|||||||
std::vector<std::string> turn_penalty_lookup_paths;
|
std::vector<std::string> turn_penalty_lookup_paths;
|
||||||
std::string datasource_indexes_path;
|
std::string datasource_indexes_path;
|
||||||
std::string datasource_names_path;
|
std::string datasource_names_path;
|
||||||
|
std::string profile_properties_path;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef OSRM_CONTRACTOR_DIJKSTRA_HPP
|
||||||
|
#define OSRM_CONTRACTOR_DIJKSTRA_HPP
|
||||||
|
|
||||||
|
#include "contractor/contractor_graph.hpp"
|
||||||
|
#include "contractor/contractor_heap.hpp"
|
||||||
|
#include "util/typedefs.hpp"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace contractor
|
||||||
|
{
|
||||||
|
|
||||||
|
// allow access to the heap itself, add Dijkstra functionality on top
|
||||||
|
class ContractorDijkstra
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ContractorDijkstra(std::size_t heap_size);
|
||||||
|
|
||||||
|
// search the graph up
|
||||||
|
void Run(const unsigned number_of_targets,
|
||||||
|
const int node_limit,
|
||||||
|
const int weight_limit,
|
||||||
|
const NodeID forbidden_node,
|
||||||
|
const ContractorGraph &graph);
|
||||||
|
|
||||||
|
// adaption of the heap interface
|
||||||
|
void Clear();
|
||||||
|
bool WasInserted(const NodeID node) const;
|
||||||
|
void Insert(const NodeID node,
|
||||||
|
const ContractorHeap::WeightType weight,
|
||||||
|
const ContractorHeap::DataType &data);
|
||||||
|
|
||||||
|
// cannot be const due to node-hash access in the binary heap :(
|
||||||
|
ContractorHeap::WeightType GetKey(const NodeID node);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void RelaxNode(const NodeID node,
|
||||||
|
const int node_weight,
|
||||||
|
const NodeID forbidden_node,
|
||||||
|
const ContractorGraph &graph);
|
||||||
|
|
||||||
|
ContractorHeap heap;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace contractor
|
||||||
|
} // namespace osrm
|
||||||
|
|
||||||
|
#endif // OSRM_CONTRACTOR_DIJKSTRA_HPP
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
#ifndef OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_
|
||||||
|
#define OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_
|
||||||
|
|
||||||
|
#include "util/dynamic_graph.hpp"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace contractor
|
||||||
|
{
|
||||||
|
|
||||||
|
struct ContractorEdgeData
|
||||||
|
{
|
||||||
|
ContractorEdgeData()
|
||||||
|
: weight(0), duration(0), id(0), originalEdges(0), shortcut(0), forward(0), backward(0),
|
||||||
|
is_original_via_node_ID(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
ContractorEdgeData(EdgeWeight weight,
|
||||||
|
EdgeWeight duration,
|
||||||
|
unsigned original_edges,
|
||||||
|
unsigned id,
|
||||||
|
bool shortcut,
|
||||||
|
bool forward,
|
||||||
|
bool backward)
|
||||||
|
: weight(weight), duration(duration), id(id),
|
||||||
|
originalEdges(std::min((1u << 28) - 1u, original_edges)), shortcut(shortcut),
|
||||||
|
forward(forward), backward(backward), is_original_via_node_ID(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
EdgeWeight weight;
|
||||||
|
EdgeWeight duration;
|
||||||
|
unsigned id;
|
||||||
|
unsigned originalEdges : 28;
|
||||||
|
bool shortcut : 1;
|
||||||
|
bool forward : 1;
|
||||||
|
bool backward : 1;
|
||||||
|
bool is_original_via_node_ID : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
using ContractorGraph = util::DynamicGraph<ContractorEdgeData>;
|
||||||
|
using ContractorEdge = ContractorGraph::InputEdge;
|
||||||
|
|
||||||
|
} // namespace contractor
|
||||||
|
} // namespace osrm
|
||||||
|
|
||||||
|
#endif // OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#ifndef OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_
|
||||||
|
#define OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_
|
||||||
|
|
||||||
|
#include "util/binary_heap.hpp"
|
||||||
|
#include "util/typedefs.hpp"
|
||||||
|
#include "util/xor_fast_hash_storage.hpp"
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace contractor
|
||||||
|
{
|
||||||
|
struct ContractorHeapData
|
||||||
|
{
|
||||||
|
ContractorHeapData() {}
|
||||||
|
ContractorHeapData(short hop_, bool target_) : hop(hop_), target(target_) {}
|
||||||
|
|
||||||
|
short hop = 0;
|
||||||
|
bool target = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
using ContractorHeap = util::BinaryHeap<NodeID,
|
||||||
|
NodeID,
|
||||||
|
EdgeWeight,
|
||||||
|
ContractorHeapData,
|
||||||
|
util::XORFastHashStorage<NodeID, NodeID>>;
|
||||||
|
|
||||||
|
} // namespace contractor
|
||||||
|
} // namespace osrm
|
||||||
|
|
||||||
|
#endif // OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user