Compare commits
419 Commits
v5.14.1
...
v5.20.0-rc.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 38b2e8ac57 | |||
| fa1a55f564 | |||
| e0a784505a | |||
| 71bdfd2c6e | |||
| cb1db646f2 | |||
| a67c4bf84d | |||
| 498259b220 | |||
| 5327f8da4e | |||
| 802ccfb497 | |||
| ec369d560a | |||
| 535647e439 | |||
| 954121634f | |||
| 594a45e7e0 | |||
| 96c7b47afe | |||
| b7e7d32361 | |||
| 2f9cb44368 | |||
| d80318f8ea | |||
| b1791d1ab3 | |||
| a53da9095a | |||
| 72e03f9af9 | |||
| 5597415f28 | |||
| 5476f6ab27 | |||
| 0971f06193 | |||
| 85515f063a | |||
| 69d7825542 | |||
| 9b779c704f | |||
| 5bd7d04fe3 | |||
| 0f78f7b2cc | |||
| 8473be69d2 | |||
| c0124f7d77 | |||
| b630b4e32a | |||
| 89fabc1b9c | |||
| a649a8a5cf | |||
| f928956584 | |||
| 7ff68792d7 | |||
| 3088dd0342 | |||
| d2590989f5 | |||
| 3a7b377586 | |||
| 82b5648c97 | |||
| 1628a3c4d5 | |||
| e5d8319c43 | |||
| 06699132eb | |||
| 918e794d6a | |||
| 8dd8ee1fc2 | |||
| c3d0efda93 | |||
| 3b4e2e83ef | |||
| c459530cb6 | |||
| 2a15e6dec8 | |||
| 1a1293608d | |||
| 318df9deaa | |||
| cacb162520 | |||
| 105709cb43 | |||
| 9695fa7941 | |||
| fd9bebbfa7 | |||
| db18e8669f | |||
| 9b4a4fdd82 | |||
| cdc7e5f021 | |||
| adc87149e2 | |||
| 8adbfe06ed | |||
| ae805f9ec8 | |||
| be24689b0f | |||
| 41c31a2388 | |||
| 8b866502d1 | |||
| 7837cd61df | |||
| b573485c31 | |||
| 4e68f3a7e1 | |||
| 5ba26d3d6d | |||
| a6cf2eee7e | |||
| 6843eb1479 | |||
| b331885d3c | |||
| 73716bd651 | |||
| 9edd161da3 | |||
| 1bc3ff6491 | |||
| b0f2ef287e | |||
| 16f53ff81a | |||
| 7a260dc2ba | |||
| 1c0d951f5e | |||
| 77a740c0fb | |||
| 61101db8cf | |||
| b51632a2fb | |||
| 9d10503a9c | |||
| 7d50e5afe0 | |||
| 549216c792 | |||
| 1990de7dcc | |||
| 89f6e2d55b | |||
| c628ecbf24 | |||
| b6f19cd544 | |||
| 14860b62e9 | |||
| 9970b7d580 | |||
| 7feb79ef91 | |||
| 6f84812903 | |||
| 8085e86170 | |||
| 35973576d9 | |||
| 7740d5d7c0 | |||
| c4eff6cd65 | |||
| 5c4353b46e | |||
| 05a5918909 | |||
| 80ad38bbc6 | |||
| 6bee8866de | |||
| ba92674c6e | |||
| 68019a1fb2 | |||
| 3a9acde2c3 | |||
| a3a7a822e1 | |||
| c7d22c2b92 | |||
| b2aeb47630 | |||
| 0a1d1901cc | |||
| 29db0c80d9 | |||
| 4654751872 | |||
| b5b18d8afc | |||
| 15139c934f | |||
| 7b8619e37c | |||
| f52b5c31b6 | |||
| e98859e4c0 | |||
| c5cc4c5a74 | |||
| e3b831364f | |||
| 730d2b5ef2 | |||
| 16abee1022 | |||
| 69fa52a010 | |||
| e1efa4c6ab | |||
| 17cd1575f6 | |||
| 3cd8e0fef8 | |||
| 397bb694fd | |||
| 473ebfcbf6 | |||
| a06171438e | |||
| ea0881553e | |||
| c4bf450fc6 | |||
| bf2b45120a | |||
| 7edf0f218c | |||
| 600ca06166 | |||
| 8d8042ebae | |||
| be123cd72f | |||
| 282415bbc1 | |||
| b08191b2c4 | |||
| 39dd484f45 | |||
| 5450574d63 | |||
| 29d1b34140 | |||
| a915542916 | |||
| fea07f343b | |||
| c7daa521ad | |||
| c2532b1589 | |||
| 4610fd9ff1 | |||
| c4b90f52c0 | |||
| 0e8b8b4901 | |||
| 2c80f76004 | |||
| 666ce46d36 | |||
| bc120776f0 | |||
| 5693ffd2cf | |||
| 51fe0dd5a0 | |||
| 14d2199cd8 | |||
| 9889a454ce | |||
| cb4586ebee | |||
| 44924b4bb4 | |||
| 3af3e06e75 | |||
| 39effb8f7e | |||
| 5a68f4c214 | |||
| f558b16147 | |||
| 4c2d578561 | |||
| 81a4747acb | |||
| 9fc2c32408 | |||
| 24e0028afb | |||
| c334d11e95 | |||
| aec9b6a178 | |||
| 81929c984b | |||
| 5395290fd5 | |||
| b3ef2a0383 | |||
| 9e97748700 | |||
| 4a9fdca7b2 | |||
| f3b7ab92ff | |||
| eae9e7fab6 | |||
| 649d4ee512 | |||
| b5a4ffed96 | |||
| 8a63ad9b4b | |||
| 0d9f18fe1f | |||
| 2690dd0621 | |||
| 4ef331db1f | |||
| e572d6c340 | |||
| 0c48f5fe2f | |||
| 3ee8a963cb | |||
| c322d93435 | |||
| c0dd5d7c76 | |||
| 993f5badf1 | |||
| a542da3678 | |||
| f1a392c4df | |||
| f2bace6c1f | |||
| 921235b2dc | |||
| bde51a9ef5 | |||
| a52213c885 | |||
| 8e800c48bc | |||
| e25654c210 | |||
| ee447afd72 | |||
| c410c200bd | |||
| 8152dcfb4c | |||
| 86ffce3a50 | |||
| bed53f5fd5 | |||
| 2b010fc6f3 | |||
| b8260e44fa | |||
| a594008e57 | |||
| f407afa694 | |||
| 06f28ffd34 | |||
| 4f454a3761 | |||
| d4300e73f3 | |||
| 990e411361 | |||
| 73b3d37837 | |||
| 5d7d5fceba | |||
| b1dfbce675 | |||
| da5aebaef3 | |||
| bced9a5a6d | |||
| 2c5e4e6c02 | |||
| 6ea296fb5c | |||
| cf5f6be472 | |||
| c61198b26b | |||
| 5d1b4ce71d | |||
| c664d0392a | |||
| aaf39162a8 | |||
| cb31f9ec29 | |||
| fed77c4066 | |||
| 6a09d2aa9b | |||
| 15b53de056 | |||
| 6d96a9a2e3 | |||
| 653f647fee | |||
| f7b7335d75 | |||
| 495131efd7 | |||
| 2eb633bc41 | |||
| 86bfe1ede1 | |||
| c04e1b2ded | |||
| 098d77c658 | |||
| 385bba4949 | |||
| bc980e72bf | |||
| 535bb49893 | |||
| b56a7579a8 | |||
| 8b52c6c7ac | |||
| d166fc6a75 | |||
| bdb116afe5 | |||
| 873e766d2e | |||
| a84277f246 | |||
| b80764b6b8 | |||
| 14082d0e00 | |||
| f7775f5e0b | |||
| b7af6eb2a4 | |||
| a4ee2ccb13 | |||
| c61acaf8be | |||
| 0fc8b6289c | |||
| 0f93a7dd05 | |||
| 4d0fb89489 | |||
| 6f4af330ed | |||
| 7c8c25f7bc | |||
| cf56b5ddbf | |||
| ac23e3b223 | |||
| 7922a6172a | |||
| e34f2db4db | |||
| 5df33e5b90 | |||
| db608559f6 | |||
| c048a36a4c | |||
| 33021d37a1 | |||
| 31d6d74f90 | |||
| bec57258a4 | |||
| 43f0723b73 | |||
| 9b74a47c91 | |||
| 993a36ea20 | |||
| 8b5af24eb8 | |||
| 5c9a7a0152 | |||
| 83588fd00f | |||
| 5acf660f37 | |||
| de13834c12 | |||
| 49811e1f46 | |||
| 8788b0fae8 | |||
| 1cafafc4cd | |||
| e2c1956aa5 | |||
| a8bc2cf8a7 | |||
| 975ede4bec | |||
| faff2c774d | |||
| d8e3b03ec1 | |||
| ae41066fbe | |||
| 342da81591 | |||
| df9195b939 | |||
| 519eae63c6 | |||
| 5f598da76d | |||
| 0da2029d2d | |||
| e82b51d0cb | |||
| 5531cace7f | |||
| 1aed13500d | |||
| f6db8ff3b0 | |||
| 26e5c4eae2 | |||
| bee3bdb576 | |||
| b96d36f482 | |||
| d13d6566f8 | |||
| aa1048154c | |||
| 6c2d26f9bd | |||
| 84845ffaa6 | |||
| f65958fc14 | |||
| 3d6b667997 | |||
| 97d027a173 | |||
| f48dd665ad | |||
| eb1e83858a | |||
| 371dc57dfc | |||
| 425a46fe78 | |||
| fa553659de | |||
| 03cffd0f56 | |||
| a06d1782c0 | |||
| 05f6b55036 | |||
| fa8d788bb6 | |||
| 92b7d581ce | |||
| 19651c3d91 | |||
| b4cfc8d6e0 | |||
| 71cfb03738 | |||
| e7bb612050 | |||
| 83d7a57b73 | |||
| cac310123b | |||
| bb71d9b28a | |||
| ea4d0fa1dd | |||
| 91561992a7 | |||
| a3ea825a11 | |||
| 7ebbd5cebe | |||
| 9e93f198ae | |||
| 10de243556 | |||
| 988b6e3311 | |||
| 36877e4de5 | |||
| 1794185d43 | |||
| de938df560 | |||
| e02c5c3c6d | |||
| 90ff725125 | |||
| 1cbfbd34cf | |||
| c6d12e064c | |||
| 30ed1fae99 | |||
| 2987292cc0 | |||
| 8114104a43 | |||
| 03f598b93d | |||
| 5a844f4b7d | |||
| 91e6d68604 | |||
| 1119a542d6 | |||
| d706696179 | |||
| c154875272 | |||
| 77f8a4f741 | |||
| 61e06fcaba | |||
| 13bb997525 | |||
| 350bc6f756 | |||
| 02712cd513 | |||
| a9d94d35a2 | |||
| 155772f01f | |||
| 341a5345da | |||
| 72de59ac91 | |||
| a7f1cd36fb | |||
| 26f0b4dc77 | |||
| 181eff29c7 | |||
| cdad265d49 | |||
| 6eb4247484 | |||
| 72a23645a8 | |||
| c3e06356d6 | |||
| 7a8390e68e | |||
| 168e313f73 | |||
| 30f910e861 | |||
| e998c1193d | |||
| a8f3474996 | |||
| 55cc06fd8b | |||
| 8883d8cc56 | |||
| 5b2af6ef09 | |||
| 6d801e7086 | |||
| 17eb7052ba | |||
| 330f25eddb | |||
| 08b88bad63 | |||
| 153f9b02a5 | |||
| 0568dca4a3 | |||
| 60ef179d18 | |||
| c64904f5ea | |||
| 4b9e3a8068 | |||
| db7c76d04d | |||
| cc1a5ea78d | |||
| 9c033ff461 | |||
| 3c3322173c | |||
| e805f85407 | |||
| 4d54456f66 | |||
| 7359d0542f | |||
| da4fb13aa3 | |||
| 3649ab4d31 | |||
| 9e9e3fb1e4 | |||
| e73aa01725 | |||
| a5353c7179 | |||
| a5e0d7011b | |||
| 742c32d936 | |||
| 3dec680058 | |||
| 9237430be2 | |||
| 12d1d84b11 | |||
| 6dd029e6ea | |||
| e45d44cb8e | |||
| 84b6ef4340 | |||
| 5af776d963 | |||
| ddf11cc2cc | |||
| c7b1d0c131 | |||
| 423a4ef326 | |||
| ccfbce5300 | |||
| b99d3a0a69 | |||
| 659b470320 | |||
| 9a8ed30e95 | |||
| 4166b1ebbf | |||
| 89080fb2b0 | |||
| 56459d37d1 | |||
| d5232d5f5c | |||
| 3f7b5da683 | |||
| 24562acd30 | |||
| 8bce061691 | |||
| 701c5f853d | |||
| d1e4ba373a | |||
| 8cf8f0d7d6 | |||
| 978350c388 | |||
| 2e97c78181 | |||
| 979ec7fa78 | |||
| 1d7f179374 | |||
| 994fae0ef6 | |||
| 88ee51ba2e | |||
| 25ee26de3b | |||
| 353829a4cc | |||
| 6fd0b56e32 | |||
| c1efefae27 | |||
| 0c96f093ff | |||
| 6f835d57b4 | |||
| e1e53d274b | |||
| d9a03f8365 | |||
| ce5f284ec6 | |||
| 02a2d25a3f |
@@ -0,0 +1,30 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
#
|
||||
# NOTE: Keep settings in sync with the master .clang-format file
|
||||
#
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# CMake configuration files
|
||||
[{CMakeLists.txt,CMakeSettings.json,*.cmake}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# CI configuration files
|
||||
[{.travis.yml,appveyor.yml}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Unix shell scripts
|
||||
[*.sh]
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Windows shell scripts
|
||||
[*.bat]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
@@ -2,12 +2,18 @@
|
||||
|
||||
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
|
||||
|
||||
Please read our [documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/releasing.md) on release and version management.
|
||||
If your PR is still work in progress please attach the relevant label.
|
||||
|
||||
## Tasklist
|
||||
- [ ] ADD OWN TASKS HERE
|
||||
|
||||
- [ ] CHANGELOG.md entry ([How to write a changelog entry](http://keepachangelog.com/en/1.0.0/#how))
|
||||
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
|
||||
- [ ] add regression / cucumber cases (see docs/testing.md)
|
||||
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/testing.md)
|
||||
- [ ] review
|
||||
- [ ] adjust for comments
|
||||
- [ ] cherry pick to release branch
|
||||
|
||||
## Requirements / Relations
|
||||
|
||||
Link any requirements here. Other pull requests this PR is based on?
|
||||
|
||||
@@ -66,6 +66,7 @@ Thumbs.db
|
||||
######################################
|
||||
/.vs*
|
||||
/*.local.bat
|
||||
/CMakeSettings.json
|
||||
|
||||
# stxxl related files #
|
||||
#######################
|
||||
|
||||
+60
-116
@@ -13,6 +13,7 @@ notifications:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- danpat_table_noroute_estimate
|
||||
# enable building tags
|
||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||
|
||||
@@ -59,17 +60,18 @@ matrix:
|
||||
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
- ${MASON} install clang-format 3.8.1
|
||||
- PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
|
||||
- node ./scripts/validate_changelog.js
|
||||
# See issue 4043
|
||||
#- npm run docs && ./scripts/error_on_dirty.sh
|
||||
after_success:
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-debug-cov"
|
||||
addons: &gcc6
|
||||
compiler: "gcc-7-debug-cov"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'lcov']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'lcov']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
||||
before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- lcov --directory . --zerocounters # clean cached da files
|
||||
@@ -83,20 +85,20 @@ matrix:
|
||||
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-debug-asan"
|
||||
addons: &gcc6
|
||||
compiler: "gcc-7-debug-asan"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
|
||||
- os: linux
|
||||
compiler: "clang-4.0-debug"
|
||||
addons: &clang40
|
||||
compiler: "clang-5.0-debug"
|
||||
addons: &clang50
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||
|
||||
- os: linux
|
||||
compiler: "mason-linux-debug-asan"
|
||||
@@ -104,7 +106,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
|
||||
# Release Builds
|
||||
- os: linux
|
||||
@@ -113,80 +115,70 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release"
|
||||
addons: &gcc6
|
||||
compiler: "gcc-7-release"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release-i686"
|
||||
compiler: "gcc-7-release-i686"
|
||||
env: >
|
||||
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-stxxl"
|
||||
addons: &gcc6
|
||||
compiler: "gcc-7-stxxl"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' ENABLE_STXXL=On
|
||||
packages: ['g++-7', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' ENABLE_STXXL=On
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-4.9-release"
|
||||
compiler: "gcc-5-release"
|
||||
addons: &gcc49
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
||||
packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release"
|
||||
addons: &gcc49
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
compiler: "mason-osx-release"
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-8"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="8"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-4"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="4"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
compiler: "mason-osx-release"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="6"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
# Disabled because of CI slowness
|
||||
#- os: linux
|
||||
#- compiler: clang
|
||||
#- addons: &clang40
|
||||
#- apt:
|
||||
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release'
|
||||
|
||||
# Shared Library
|
||||
- os: linux
|
||||
compiler: "gcc-6-release-shared"
|
||||
addons: &gcc6
|
||||
compiler: "gcc-7-release-shared"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
# Disabled because CI slowness
|
||||
#- os: linux
|
||||
#- compiler: clang
|
||||
#- addons: &clang40
|
||||
#- apt:
|
||||
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||
#- packages: ['clang-4.0', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libgdal-dev', 'libboost-all-dev']
|
||||
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
# Node build jobs. These skip running the tests.
|
||||
- os: linux
|
||||
@@ -196,7 +188,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
@@ -215,60 +207,12 @@ matrix:
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-4-mason-linux-release"
|
||||
compiler: "node-4-mason-linux-debug"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-6-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-6-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="4"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
@@ -292,7 +236,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
@@ -311,12 +255,12 @@ matrix:
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-6-mason-linux-release"
|
||||
compiler: "node-8-mason-linux-debug"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
@@ -353,7 +297,7 @@ before_install:
|
||||
fi
|
||||
- |
|
||||
if [[ ! -f $(which yarn) ]]; then
|
||||
npm install -g yarn
|
||||
npm install -g yarn@1.11.1
|
||||
fi
|
||||
- export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
|
||||
- export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off")
|
||||
@@ -422,7 +366,7 @@ install:
|
||||
script:
|
||||
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
||||
- make -C test/data benchmark
|
||||
- ./example/build/osrm-example test/data/ch/monaco.osrm
|
||||
- ./example/build/osrm-example test/data/mld/monaco.osrm
|
||||
# All tests assume to be run from the build directory
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- ./unit_tests/library-tests
|
||||
@@ -431,7 +375,7 @@ script:
|
||||
- ./unit_tests/engine-tests
|
||||
- ./unit_tests/util-tests
|
||||
- ./unit_tests/server-tests
|
||||
- ./unit_tests/partition-tests
|
||||
- ./unit_tests/partitioner-tests
|
||||
- |
|
||||
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
|
||||
npm run nodejs-tests
|
||||
|
||||
+154
@@ -1,4 +1,158 @@
|
||||
# UNRELEASED
|
||||
- Changes from 5.19.0:
|
||||
- Table:
|
||||
- CHANGED: switch to pre-calculated distances for table responses for large speedup and 10% memory increase. [#5251](https://github.com/Project-OSRM/osrm-backend/pull/5251)
|
||||
- Features:
|
||||
- ADDED: direct mmapping of datafiles is now supported via the `--mmap` switch. [#5242](https://github.com/Project-OSRM/osrm-backend/pull/5242)
|
||||
- REMOVED: the previous `--memory_file` switch is now deprecated and will fallback to `--mmap` [#5242](https://github.com/Project-OSRM/osrm-backend/pull/5242)
|
||||
- Windows:
|
||||
- FIXED: Windows builds again. [#5249](https://github.com/Project-OSRM/osrm-backend/pull/5249)
|
||||
|
||||
# 5.19.0
|
||||
- Changes from 5.18.0:
|
||||
- Optimizations:
|
||||
- CHANGED: Use Grisu2 for serializing floating point numbers. [#5188](https://github.com/Project-OSRM/osrm-backend/pull/5188)
|
||||
- ADDED: Node bindings can return pre-rendered JSON buffer. [#5189](https://github.com/Project-OSRM/osrm-backend/pull/5189)
|
||||
- Profiles:
|
||||
- CHANGED: Bicycle profile now blacklists barriers instead of whitelisting them [#5076
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5076/)
|
||||
- CHANGED: Foot profile now blacklists barriers instead of whitelisting them [#5077
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5077/)
|
||||
- CHANGED: Support maxlength and maxweight in car profile [#5101](https://github.com/Project-OSRM/osrm-backend/pull/5101]
|
||||
- Bugfixes:
|
||||
- FIXED: collapsing of ExitRoundabout instructions [#5114](https://github.com/Project-OSRM/osrm-backend/issues/5114)
|
||||
- Misc:
|
||||
- CHANGED: Support up to 512 named shared memory regions [#5185](https://github.com/Project-OSRM/osrm-backend/pull/5185)
|
||||
|
||||
# 5.18.0
|
||||
- Changes from 5.17.0:
|
||||
- Features:
|
||||
- ADDED: `table` plugin now optionally returns `distance` matrix as part of response [#4990](https://github.com/Project-OSRM/osrm-backend/pull/4990)
|
||||
- ADDED: New optional parameter `annotations` for `table` that accepts `distance`, `duration`, or both `distance,duration` as values [#4990](https://github.com/Project-OSRM/osrm-backend/pull/4990)
|
||||
- Infrastructure:
|
||||
- ADDED: Updated libosmium and added protozero and vtzero libraries [#5037](https://github.com/Project-OSRM/osrm-backend/pull/5037)
|
||||
- CHANGED: Use vtzero library in tile plugin [#4686](https://github.com/Project-OSRM/osrm-backend/pull/4686)
|
||||
- Profile:
|
||||
- ADDED: Bicycle profile now returns classes for ferry and tunnel routes. [#5054](https://github.com/Project-OSRM/osrm-backend/pull/5054)
|
||||
- ADDED: Bicycle profile allows to exclude ferry routes (default to not enabled) [#5054](https://github.com/Project-OSRM/osrm-backend/pull/5054)
|
||||
|
||||
# 5.17.1
|
||||
- Changes from 5.17.0:
|
||||
- Bugfixes:
|
||||
- FIXED: Do not combine a segregated edge with a roundabout [#5039](https://github.com/Project-OSRM/osrm-backend/issues/5039)
|
||||
|
||||
# 5.17.0
|
||||
- Changes from 5.16.0:
|
||||
- Bugfixes:
|
||||
- FIXED: deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909)
|
||||
- FIXED: Use smaller range for U-turn angles in map-matching [#4920](https://github.com/Project-OSRM/osrm-backend/pull/4920)
|
||||
- FIXED: Remove the last short annotation segment in `trimShortSegments` [#4946](https://github.com/Project-OSRM/osrm-backend/pull/4946)
|
||||
- FIXED: Properly calculate annotations for speeds, durations and distances when waypoints are used with mapmatching [#4949](https://github.com/Project-OSRM/osrm-backend/pull/4949)
|
||||
- FIXED: Don't apply unimplemented SH and PH conditions in OpeningHours and add inversed date ranges [#4992](https://github.com/Project-OSRM/osrm-backend/issues/4992)
|
||||
- FIXED: integer overflow in `DynamicGraph::Renumber` [#5021](https://github.com/Project-OSRM/osrm-backend/pull/5021)
|
||||
- Profile:
|
||||
- CHANGED: Handle oneways in get_forward_backward_by_key [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
||||
- FIXED: Do not route against oneway road if there is a cycleway in the wrong direction; also review bike profile [#4943](https://github.com/Project-OSRM/osrm-backend/issues/4943)
|
||||
- CHANGED: Make cyclability weighting of the bike profile prefer safer routes more strongly [#5015](https://github.com/Project-OSRM/osrm-backend/issues/5015)
|
||||
- Guidance:
|
||||
- CHANGED: Don't use obviousness for links bifurcations [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
||||
- FIXED: Adjust Straight direction modifiers of side roads in driveway handler [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
||||
- CHANGED: Added post process logic to collapse segregated turn instructions [#4925](https://github.com/Project-OSRM/osrm-backend/pull/4925)
|
||||
- ADDED: Maneuver relation now supports `straight` as a direction [#4995](https://github.com/Project-OSRM/osrm-backend/pull/4995)
|
||||
- FIXED: Support spelling maneuver relation with British spelling [#4950](https://github.com/Project-OSRM/osrm-backend/issues/4950)
|
||||
- Tools:
|
||||
- ADDED: `osrm-routed` accepts a new property `--memory_file` to store memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881)
|
||||
- ADDED: `osrm-datastore` accepts a new parameter `--dataset-name` to select the name of the dataset. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- ADDED: `osrm-datastore` accepts a new parameter `--list` to list all datasets loaded into memory. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- ADDED: `osrm-datastore` accepts a new parameter `--only-metric` to only reload the data that can be updated by a weight update (reduces memory for traffic updates). [#5002](https://github.com/Project-OSRM/osrm-backend/pull/5002)
|
||||
- ADDED: `osrm-routed` accepts a new parameter `--dataset-name` to select the shared-memory dataset to use. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- NodeJS:
|
||||
- ADDED: `OSRM` object accepts a new option `memory_file` that stores the memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881)
|
||||
- ADDED: `OSRM` object accepts a new option `dataset_name` to select the shared-memory dataset. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- Internals
|
||||
- CHANGED: Updated segregated intersection identification [#4845](https://github.com/Project-OSRM/osrm-backend/pull/4845) [#4968](https://github.com/Project-OSRM/osrm-backend/pull/4968)
|
||||
- REMOVED: Remove `.timestamp` file since it was unused [#4960](https://github.com/Project-OSRM/osrm-backend/pull/4960)
|
||||
- Documentation:
|
||||
- ADDED: Add documentation about OSM node ids in nearest service response [#4436](https://github.com/Project-OSRM/osrm-backend/pull/4436)
|
||||
- Performance
|
||||
- FIXED: Speed up response time when lots of legs exist and geojson is used with `steps=true` [#4936](https://github.com/Project-OSRM/osrm-backend/pull/4936)
|
||||
- FIXED: Return iterators instead of vectors in datafacade_base functions [#4969](https://github.com/Project-OSRM/osrm-backend/issues/4969)
|
||||
- Misc:
|
||||
- ADDED: expose name for datasource annotations as metadata [#4973](https://github.com/Project-OSRM/osrm-backend/pull/4973)
|
||||
|
||||
# 5.16.0
|
||||
- Changes from 5.15.2:
|
||||
- Guidance
|
||||
- ADDED #4676: Support for maneuver override relation, allowing data-driven overrides for turn-by-turn instructions [#4676](https://github.com/Project-OSRM/osrm-backend/pull/4676)
|
||||
- CHANGED #4830: Announce reference change if names are empty
|
||||
- CHANGED #4835: MAXIMAL_ALLOWED_SEPARATION_WIDTH increased to 12 meters
|
||||
- CHANGED #4842: Lower priority links from a motorway now are used as motorway links [#4842](https://github.com/Project-OSRM/osrm-backend/pull/4842)
|
||||
- CHANGED #4895: Use ramp bifurcations as fork intersections [#4895](https://github.com/Project-OSRM/osrm-backend/issues/4895)
|
||||
- CHANGED #4893: Handle motorway forks with links as normal motorway intersections[#4893](https://github.com/Project-OSRM/osrm-backend/issues/4893)
|
||||
- FIXED #4905: Check required tags of `maneuver` relations [#4905](https://github.com/Project-OSRM/osrm-backend/pull/4905)
|
||||
- Profile:
|
||||
- FIXED: `highway=service` will now be used for restricted access, `access=private` is still disabled for snapping.
|
||||
- ADDED #4775: Exposes more information to the turn function, now being able to set turn weights with highway and access information of the turn as well as other roads at the intersection [#4775](https://github.com/Project-OSRM/osrm-backend/issues/4775)
|
||||
- FIXED #4763: Add support for non-numerical units in car profile for maxheight [#4763](https://github.com/Project-OSRM/osrm-backend/issues/4763)
|
||||
- ADDED #4872: Handling of `barrier=height_restrictor` nodes [#4872](https://github.com/Project-OSRM/osrm-backend/pull/4872)
|
||||
|
||||
# 5.15.2
|
||||
- Changes from 5.15.1:
|
||||
- Features:
|
||||
- ADDED: Exposed the waypoints parameter in the node bindings interface
|
||||
- Bugfixes:
|
||||
- FIXED: Segfault causing bug in leg collapsing map matching when traversing edges in reverse
|
||||
|
||||
# 5.15.1
|
||||
- Changes from 5.15.0:
|
||||
- Bugfixes:
|
||||
- FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches
|
||||
- Guidance:
|
||||
- Set type of trivial intersections where classes change to Suppressed instead of NoTurn
|
||||
|
||||
# 5.15.0
|
||||
- Changes from 5.14.3:
|
||||
- Bugfixes:
|
||||
- FIXED #4704: Fixed regression in bearings reordering introduced in 5.13 [#4704](https://github.com/Project-OSRM/osrm-backend/issues/4704)
|
||||
- FIXED #4781: Fixed overflow exceptions in percent-encoding parsing
|
||||
- FIXED #4770: Fixed exclude flags for single toll road scenario
|
||||
- FIXED #4283: Fix overflow on zero duration segments
|
||||
- FIXED #4804: Ignore no_*_on_red turn restrictions
|
||||
- Guidance:
|
||||
- CHANGED #4706: Guidance refactoring step to decouple intersection connectivity analysis and turn instructions generation [#4706](https://github.com/Project-OSRM/osrm-backend/pull/4706)
|
||||
- CHANGED #3491: Refactor `isThroughStreet`/Intersection options
|
||||
- Profile:
|
||||
- ADDED: `tunnel` as a new class in car profile so that sections of the route with tunnel tags will be marked as such
|
||||
|
||||
# 5.14.3
|
||||
- Changes from 5.14.2:
|
||||
- Features:
|
||||
- Added a `waypoints` parameter to the match service plugin that accepts indices to input coordinates and treats only those points as waypoints in the response format.
|
||||
- Bugfixes:
|
||||
- FIXED #4754: U-Turn penalties are applied to straight turns.
|
||||
- FIXED #4756: Removed too restrictive road name check in the sliproad handler
|
||||
- FIXED #4731: Use correct weights for edge-based graph duplicated via nodes.
|
||||
- Profile:
|
||||
- CHANGED: added Belarus speed limits
|
||||
- CHANGED: set default urban speed in Ukraine to 50kmh
|
||||
|
||||
# 5.14.2
|
||||
- Changes from 5.14.1:
|
||||
- Bugfixes:
|
||||
- FIXED #4727: Erroring when a old .core file is present.
|
||||
- FIXED #4642: Update checks for EMPTY_NAMEID to check for empty name strings
|
||||
- FIXED #4738: Fix potential segmentation fault
|
||||
- Node.js Bindings:
|
||||
- ADDED: Exposed new `max_radiuses_map_matching` option from `EngingConfig` options
|
||||
- Tools:
|
||||
- ADDED: New osrm-routed `max_radiuses_map_matching` command line flag to optionally set a maximum radius for map matching
|
||||
|
||||
# 5.14.1
|
||||
- Changes from 5.14.0
|
||||
- Bugfixes:
|
||||
- FIXED: don't use removed alternative candidates in `filterPackedPathsByCellSharing`
|
||||
|
||||
# 5.14.0
|
||||
- Changes from 5.13
|
||||
- API:
|
||||
- ADDED: new RouteStep property `driving_side` that has either "left" or "right" for that step
|
||||
|
||||
+74
-54
@@ -1,5 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
# we depend on 2.8.11 introducing target_include_directories
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
|
||||
message(FATAL_ERROR "In-source builds are not allowed.
|
||||
@@ -43,7 +42,6 @@ if(ENABLE_MASON)
|
||||
set(MASON_LUA_VERSION "5.2.4")
|
||||
set(MASON_BZIP2_VERSION "1.0.6")
|
||||
set(MASON_TBB_VERSION "2017_U7")
|
||||
set(MASON_LIBSHP_VERSION "1.3.0")
|
||||
|
||||
message(STATUS "Enabling mason")
|
||||
|
||||
@@ -60,12 +58,26 @@ if (POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
endif()
|
||||
project(OSRM C CXX)
|
||||
set(OSRM_VERSION_MAJOR 5)
|
||||
set(OSRM_VERSION_MINOR 14)
|
||||
set(OSRM_VERSION_PATCH 0)
|
||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
|
||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
include(JSONParser)
|
||||
file(READ "package.json" packagejsonraw)
|
||||
sbeParseJson(packagejson packagejsonraw)
|
||||
|
||||
if (packagejson.version MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)")
|
||||
set(OSRM_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(OSRM_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(OSRM_VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
|
||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
else()
|
||||
message(FATAL_ERROR "Version from package.json cannot be parsed, expected semver compatible X.Y.Z, but found ${packagejson.version}")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_definitions("-DOSRM_PROJECT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"")
|
||||
else()
|
||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
endif()
|
||||
|
||||
# these two functions build up custom variables:
|
||||
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
|
||||
@@ -102,10 +114,10 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||
endif()
|
||||
|
||||
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
||||
# Strictly require GCC>=5.0 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if(CMAKE_CXX_COMPILER_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")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||
message(FATAL_ERROR "GCC>=5.0 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
@@ -126,7 +138,8 @@ configure_file(
|
||||
)
|
||||
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
|
||||
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
|
||||
file(GLOB PartitionerGlob src/partition/*.cpp)
|
||||
file(GLOB GuidanceGlob src/guidance/*.cpp src/extractor/intersection/*.cpp)
|
||||
file(GLOB PartitionerGlob src/partitioner/*.cpp)
|
||||
file(GLOB CustomizerGlob src/customize/*.cpp)
|
||||
file(GLOB ContractorGlob src/contractor/*.cpp)
|
||||
file(GLOB UpdaterGlob src/updater/*.cpp)
|
||||
@@ -137,6 +150,7 @@ file(GLOB ErrorcodesGlob src/osrm/errorcodes.cpp)
|
||||
|
||||
add_library(UTIL OBJECT ${UtilGlob})
|
||||
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
|
||||
add_library(GUIDANCE OBJECT ${GuidanceGlob})
|
||||
add_library(PARTITIONER OBJECT ${PartitionerGlob})
|
||||
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
|
||||
add_library(CONTRACTOR OBJECT ${ContractorGlob})
|
||||
@@ -152,14 +166,15 @@ add_executable(osrm-partition src/tools/partition.cpp)
|
||||
add_executable(osrm-customize src/tools/customize.cpp)
|
||||
add_executable(osrm-contract src/tools/contract.cpp)
|
||||
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
|
||||
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_partition $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_customize $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_guidance $<TARGET_OBJECTS:GUIDANCE> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_partition src/osrm/partitioner.cpp $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
|
||||
if(ENABLE_GOLD_LINKER)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
@@ -256,8 +271,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
||||
endif()
|
||||
|
||||
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
|
||||
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW)
|
||||
find_program(GCC_AR gcc-ar)
|
||||
find_program(GCC_RANLIB gcc-ranlib)
|
||||
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
||||
@@ -285,12 +299,6 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
||||
set(CMAKE_RANLIB ${LLVM_RANLIB})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
|
||||
message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038")
|
||||
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
||||
set(ENABLE_LTO Off)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -317,8 +325,9 @@ if (ENABLE_SANITIZER)
|
||||
endif()
|
||||
|
||||
# Configuring compilers
|
||||
set(OSRM_WARNING_FLAGS "-Werror=all -Werror=extra -Werror=uninitialized -Werror=unreachable-code -Werror=unused-variable -Werror=unreachable-code -Wno-error=cpp -Wpedantic")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=2 -Wno-error=unused-local-typedef -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
||||
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
||||
@@ -326,7 +335,8 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(COLOR_FLAG "")
|
||||
endif()
|
||||
# using GCC
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=1 -Wno-error=maybe-uninitialized -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
||||
|
||||
if(WIN32) # using mingw
|
||||
add_dependency_defines(-DWIN32)
|
||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||
@@ -406,11 +416,30 @@ if(UNIX AND NOT APPLE)
|
||||
set(MAYBE_RT_LIBRARY -lrt)
|
||||
endif()
|
||||
|
||||
# Disallow deprecated protozero APIs
|
||||
add_definitions(-DPROTOZERO_STRICT_API)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# Third-party libraries
|
||||
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
|
||||
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
|
||||
|
||||
set(MICROTAR_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src")
|
||||
include_directories(SYSTEM ${MICROTAR_INCLUDE_DIR})
|
||||
|
||||
set(MBXGEOM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/geometry.hpp-0.9.2/include")
|
||||
include_directories(SYSTEM ${MBXGEOM_INCLUDE_DIR})
|
||||
set(CHEAPRULER_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cheap-ruler-cpp-2.5.4/include")
|
||||
include_directories(SYSTEM ${CHEAPRULER_INCLUDE_DIR})
|
||||
|
||||
add_library(MICROTAR OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src/microtar.c")
|
||||
set_property(TARGET MICROTAR PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(PROTOZERO_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/protozero/include")
|
||||
include_directories(SYSTEM ${PROTOZERO_INCLUDE_DIR})
|
||||
|
||||
set(VTZERO_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/vtzero/include")
|
||||
include_directories(SYSTEM ${VTZERO_INCLUDE_DIR})
|
||||
|
||||
|
||||
# if mason is enabled no find_package calls are made
|
||||
# to ensure that we are only compiling and linking against
|
||||
# fully portable mason packages
|
||||
@@ -485,9 +514,6 @@ if(ENABLE_MASON)
|
||||
# note: we avoid calling find_package(Osmium ...) here to ensure that the
|
||||
# expat and bzip2 are used from mason rather than the system
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
|
||||
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include)
|
||||
|
||||
else()
|
||||
|
||||
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
@@ -545,10 +571,6 @@ else()
|
||||
endif()
|
||||
find_package(Osmium REQUIRED COMPONENTS io)
|
||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
||||
|
||||
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
|
||||
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
|
||||
|
||||
endif()
|
||||
|
||||
# prefix compilation with ccache by default if available and on clang or gcc
|
||||
@@ -624,6 +646,12 @@ set(EXTRACTOR_LIBRARIES
|
||||
${TBB_LIBRARIES}
|
||||
${ZLIB_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(GUIDANCE_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(PARTITIONER_LIBRARIES
|
||||
${BOOST_ENGINE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
@@ -670,19 +698,20 @@ set(UTIL_LIBRARIES
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${MAYBE_STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
${MAYBE_COVERAGE_LIBRARIES}
|
||||
${ZLIB_LIBRARY})
|
||||
|
||||
# Libraries
|
||||
target_link_libraries(osrm ${ENGINE_LIBRARIES})
|
||||
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
|
||||
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store)
|
||||
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_extract osrm_guidance ${EXTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
|
||||
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store)
|
||||
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
||||
|
||||
# BUILD_COMPONENTS
|
||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_LIBRARIES})
|
||||
install(TARGETS osrm-components DESTINATION bin)
|
||||
|
||||
@@ -692,15 +721,6 @@ if(BUILD_TOOLS)
|
||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
||||
|
||||
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
||||
|
||||
find_package(Shapefile)
|
||||
if(SHAPEFILE_FOUND AND (Boost_VERSION VERSION_GREATER 106000 OR ENABLE_MASON))
|
||||
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
|
||||
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${UTIL_LIBRARIES} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARY} ${EXPAT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
install(TARGETS osrm-extract-conditionals DESTINATION bin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_ASSERTIONS)
|
||||
@@ -723,14 +743,14 @@ file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
||||
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
|
||||
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp)
|
||||
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
||||
set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp)
|
||||
set(PartitionerHeader include/partitioner/partitioner.hpp include/partitioner/partitioner_config.hpp)
|
||||
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
||||
set(StorageHeader include/storage/storage.hpp include/storage/io_config.hpp include/storage/storage_config.hpp)
|
||||
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
|
||||
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
|
||||
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
|
||||
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
|
||||
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partition)
|
||||
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partitioner)
|
||||
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
|
||||
install(FILES ${LibraryGlob} DESTINATION include/osrm)
|
||||
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
||||
@@ -853,4 +873,4 @@ if (ENABLE_NODE_BINDINGS)
|
||||
endforeach()
|
||||
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
|
||||
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
|
||||
endif()
|
||||
endif()
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Everyone
|
||||
|
||||
Please take some time to review our [code of conduct](CODE_OF_CONDUCT.md) to help guide your interactions with others on this project.
|
||||
Please take some time to review our [code of conduct](CODE-OF-CONDUCT.md) to help guide your interactions with others on this project.
|
||||
|
||||
# User
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ High performance routing engine written in C++14 designed to run on OpenStreetMa
|
||||
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
|
||||
- Route - Finds the fastest route between coordinates
|
||||
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
|
||||
- Table - Computes the duration or distances of the fastest route between all pairs of supplied coordinates
|
||||
- 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
|
||||
@@ -59,9 +59,14 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
|
||||
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
||||
|
||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||
|
||||
The flag `-v $(pwd):/data` creates the directory `/data` inside the docker container and makes the current working directory `$(pwd)` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `$(pwd)/berlin-latest.osm.pbf` on the host.
|
||||
|
||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
||||
|
||||
Note that `berlin-latest.osrm` has a different file extension.
|
||||
|
||||
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
|
||||
|
||||
Make requests against the HTTP server
|
||||
@@ -114,7 +119,8 @@ sudo cmake --build . --target install
|
||||
|
||||
### Request Against the Demo Server
|
||||
|
||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Demo-server).
|
||||
|
||||
Simple query with instructions and alternatives on Berlin:
|
||||
|
||||
```
|
||||
|
||||
@@ -161,29 +161,6 @@ XCOPY /Y corech\*.* ..\test\data\corech\
|
||||
XCOPY /Y mld\*.* ..\test\data\mld\
|
||||
unit_tests\%Configuration%\library-tests.exe
|
||||
|
||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
||||
ECHO ========= CREATING PACKAGES ==========
|
||||
|
||||
CD %PROJECT_DIR%\build\%Configuration%
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
SET P=%PROJECT_DIR%
|
||||
SET ZIP= %P%\osrm_%Configuration%.zip
|
||||
IF EXIST %ZIP% ECHO deleting %ZIP% && DEL /F /Q %ZIP%
|
||||
IF %ERRORLEVEL% NEQ 0 ECHO deleting %ZIP% FAILED && GOTO ERROR
|
||||
|
||||
7z a %ZIP% *.lib *.exe *.pdb %P%/osrm-deps/libs/bin/*.dll -tzip -mx9 | %windir%\system32\FIND "ing archive"
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
CD ..\..\profiles
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO disk=c:\temp\stxxl,10000,wincall > .stxxl.txt
|
||||
7z a %ZIP% * -tzip -mx9 | %windir%\system32\FIND "ing archive"
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
GOTO DONE
|
||||
|
||||
:ERROR
|
||||
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
ECHO ERRORLEVEL^: %ERRORLEVEL%
|
||||
|
||||
@@ -29,24 +29,7 @@ before_test:
|
||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||
- npm test
|
||||
|
||||
artifacts:
|
||||
- path: osrm_Release.zip
|
||||
name: osrm_Release.zip
|
||||
# - path: osrm_Debug.zip
|
||||
# name: osrm_Debug.zip
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
deploy:
|
||||
provider: FTP
|
||||
server:
|
||||
secure: ef7oiQTTXFGt8NdNiOHm/uRFVrUttzyFbIlnaeHhQvw=
|
||||
username:
|
||||
secure: Bw+Se2GTJxA6+GtRkEc//tQSBHOuFIuJHBjFwR9cD+8=
|
||||
password:
|
||||
secure: eqwESZqxMXC/j5mOCpaXuw==
|
||||
folder: /
|
||||
enable_ssl: true
|
||||
active_mode: false
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# - Try to find Shapefile C Library
|
||||
# http://shapelib.maptools.org/
|
||||
#
|
||||
# Exports:
|
||||
# Shapefile_FOUND
|
||||
# LIBSHAPEFILE_INCLUDE_DIR
|
||||
# LIBSHAPEFILE_LIBRARY
|
||||
# Hints:
|
||||
# LIBSHAPEFILE_LIBRARY_DIR
|
||||
|
||||
find_path(LIBSHAPEFILE_INCLUDE_DIR
|
||||
shapefil.h)
|
||||
|
||||
find_library(LIBSHAPEFILE_LIBRARY
|
||||
NAMES shp
|
||||
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Shapefile DEFAULT_MSG
|
||||
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
|
||||
@@ -0,0 +1,290 @@
|
||||
# https://github.com/sbellus/json-cmake/blob/9913da8800b95322d393894d3525d634568f305e/JSONParser.cmake
|
||||
# MIT Licensed - https://github.com/sbellus/json-cmake/blob/master/LICENSE
|
||||
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
if (DEFINED JSonParserGuard)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(JSonParserGuard yes)
|
||||
|
||||
macro(sbeParseJson prefix jsonString)
|
||||
cmake_policy(PUSH)
|
||||
|
||||
set(json_string "${${jsonString}}")
|
||||
string(LENGTH "${json_string}" json_jsonLen)
|
||||
set(json_index 0)
|
||||
set(json_AllVariables ${prefix})
|
||||
set(json_ArrayNestingLevel 0)
|
||||
set(json_MaxArrayNestingLevel 0)
|
||||
|
||||
_sbeParse(${prefix})
|
||||
|
||||
unset(json_index)
|
||||
unset(json_AllVariables)
|
||||
unset(json_jsonLen)
|
||||
unset(json_string)
|
||||
unset(json_value)
|
||||
unset(json_inValue)
|
||||
unset(json_name)
|
||||
unset(json_inName)
|
||||
unset(json_newPrefix)
|
||||
unset(json_reservedWord)
|
||||
unset(json_arrayIndex)
|
||||
unset(json_char)
|
||||
unset(json_end)
|
||||
unset(json_ArrayNestingLevel)
|
||||
foreach(json_nestingLevel RANGE ${json_MaxArrayNestingLevel})
|
||||
unset(json_${json_nestingLevel}_arrayIndex)
|
||||
endforeach()
|
||||
unset(json_nestingLevel)
|
||||
unset(json_MaxArrayNestingLevel)
|
||||
|
||||
cmake_policy(POP)
|
||||
endmacro()
|
||||
|
||||
macro(sbeClearJson prefix)
|
||||
foreach(json_var ${${prefix}})
|
||||
unset(${json_var})
|
||||
endforeach()
|
||||
|
||||
unset(${prefix})
|
||||
unset(json_var)
|
||||
endmacro()
|
||||
|
||||
macro(sbePrintJson prefix)
|
||||
foreach(json_var ${${prefix}})
|
||||
message("${json_var} = ${${json_var}}")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParse prefix)
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("\"" STREQUAL "${json_char}")
|
||||
_sbeParseNameValue(${prefix})
|
||||
elseif("{" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseObject(${prefix})
|
||||
elseif("[" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseArray(${prefix})
|
||||
endif()
|
||||
|
||||
if(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
else()
|
||||
break()
|
||||
endif()
|
||||
|
||||
if ("}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
|
||||
break()
|
||||
endif()
|
||||
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endwhile()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseNameValue prefix)
|
||||
set(json_name "")
|
||||
set(json_inName no)
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
# check if name ends
|
||||
if("\"" STREQUAL "${json_char}" AND json_inName)
|
||||
set(json_inName no)
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
set(json_newPrefix ${prefix}.${json_name})
|
||||
set(json_name "")
|
||||
|
||||
if(":" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("\"" STREQUAL "${json_char}")
|
||||
_sbeParseValue(${json_newPrefix})
|
||||
break()
|
||||
elseif("{" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseObject(${json_newPrefix})
|
||||
break()
|
||||
elseif("[" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseArray(${json_newPrefix})
|
||||
break()
|
||||
else()
|
||||
# reserved word starts
|
||||
_sbeParseReservedWord(${json_newPrefix})
|
||||
break()
|
||||
endif()
|
||||
else()
|
||||
# name without value
|
||||
list(APPEND ${json_AllVariables} ${json_newPrefix})
|
||||
set(${json_newPrefix} "")
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(json_inName)
|
||||
# remove escapes
|
||||
if("\\" STREQUAL "${json_char}")
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
endif()
|
||||
|
||||
set(json_name "${json_name}${json_char}")
|
||||
endif()
|
||||
|
||||
# check if name starts
|
||||
if("\"" STREQUAL "${json_char}" AND NOT json_inName)
|
||||
set(json_inName yes)
|
||||
endif()
|
||||
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endwhile()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseReservedWord prefix)
|
||||
set(json_reservedWord "")
|
||||
set(json_end no)
|
||||
while(${json_index} LESS ${json_jsonLen} AND NOT json_end)
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("," STREQUAL "${json_char}" OR "}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
|
||||
set(json_end yes)
|
||||
else()
|
||||
set(json_reservedWord "${json_reservedWord}${json_char}")
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
endif()
|
||||
endwhile()
|
||||
|
||||
list(APPEND ${json_AllVariables} ${prefix})
|
||||
string(STRIP "${json_reservedWord}" json_reservedWord)
|
||||
set(${prefix} ${json_reservedWord})
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseValue prefix)
|
||||
cmake_policy(SET CMP0054 NEW) # turn off implicit expansions in if statement
|
||||
|
||||
set(json_value "")
|
||||
set(json_inValue no)
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
# check if json_value ends, it is ended by "
|
||||
if("\"" STREQUAL "${json_char}" AND json_inValue)
|
||||
set(json_inValue no)
|
||||
|
||||
set(${prefix} ${json_value})
|
||||
list(APPEND ${json_AllVariables} ${prefix})
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
break()
|
||||
endif()
|
||||
|
||||
if(json_inValue)
|
||||
# if " is escaped consume
|
||||
if("\\" STREQUAL "${json_char}")
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
if(NOT "\"" STREQUAL "${json_char}")
|
||||
# if it is not " then copy also escape character
|
||||
set(json_char "\\${json_char}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
_sbeAddEscapedCharacter("${json_char}")
|
||||
endif()
|
||||
|
||||
# check if value starts
|
||||
if("\"" STREQUAL "${json_char}" AND NOT json_inValue)
|
||||
set(json_inValue yes)
|
||||
endif()
|
||||
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
endwhile()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeAddEscapedCharacter char)
|
||||
string(CONCAT json_value "${json_value}" "${char}")
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseObject prefix)
|
||||
_sbeParse(${prefix})
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseArray prefix)
|
||||
math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} + 1")
|
||||
set(json_${json_ArrayNestingLevel}_arrayIndex 0)
|
||||
|
||||
set(${prefix} "")
|
||||
list(APPEND ${json_AllVariables} ${prefix})
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("\"" STREQUAL "${json_char}")
|
||||
# simple value
|
||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
_sbeParseValue(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
elseif("{" STREQUAL "${json_char}")
|
||||
# object
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
_sbeParseObject(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
else()
|
||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
_sbeParseReservedWord(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
endif()
|
||||
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("]" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
break()
|
||||
elseif("," STREQUAL "${json_char}")
|
||||
math(EXPR json_${json_ArrayNestingLevel}_arrayIndex "${json_${json_ArrayNestingLevel}_arrayIndex} + 1")
|
||||
endif()
|
||||
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endwhile()
|
||||
|
||||
if(${json_MaxArrayNestingLevel} LESS ${json_ArrayNestingLevel})
|
||||
set(json_MaxArrayNestingLevel ${json_ArrayNestingLevel})
|
||||
endif()
|
||||
math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} - 1")
|
||||
endmacro()
|
||||
|
||||
macro(_sbeMoveToNextNonEmptyCharacter)
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
if(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
while(${json_char} MATCHES "[ \t\n\r]" AND ${json_index} LESS ${json_jsonLen})
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
endwhile()
|
||||
endif()
|
||||
endmacro()
|
||||
+1
-1
@@ -3,5 +3,5 @@ module.exports = {
|
||||
verify: '--strict --tags ~@stress --tags ~@todo --tags ~@mld-only -f progress --require features/support --require features/step_definitions',
|
||||
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
||||
all: '--strict --require features/support --require features/step_definitions',
|
||||
mld: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions -f progress'
|
||||
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions -f progress'
|
||||
};
|
||||
|
||||
+664
-192
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+141
-14
@@ -120,6 +120,7 @@ In addition to the [general options](#general-options) the following options are
|
||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
|
||||
- `distance`: Distance in meters to the supplied input coordinate.
|
||||
- `nodes`: Array of OpenStreetMap node ids.
|
||||
|
||||
#### Example Requests
|
||||
|
||||
@@ -134,6 +135,10 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
|
||||
{
|
||||
"waypoints" : [
|
||||
{
|
||||
"nodes": [
|
||||
2264199819,
|
||||
0
|
||||
],
|
||||
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
|
||||
"distance" : 4.152629,
|
||||
"name" : "Friedrichstraße",
|
||||
@@ -143,6 +148,10 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodes": [
|
||||
2045820592,
|
||||
0
|
||||
],
|
||||
"hint" : "KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g",
|
||||
"distance" : 11.811961,
|
||||
"name" : "Friedrichstraße",
|
||||
@@ -152,6 +161,10 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodes": [
|
||||
0,
|
||||
21487242
|
||||
],
|
||||
"hint" : "KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g",
|
||||
"distance" : 15.872438,
|
||||
"name" : "Friedrichstraße",
|
||||
@@ -209,13 +222,13 @@ curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397
|
||||
|
||||
### Table service
|
||||
|
||||
Computes the duration of the fastest route between all pairs of supplied coordinates.
|
||||
Computes the duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes. Duration is in seconds and distances is in meters.
|
||||
|
||||
```endpoint
|
||||
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&destinations=[{elem}...]
|
||||
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&{destinations}=[{elem}...]&annotations={duration|distance|duration,distance}
|
||||
```
|
||||
|
||||
**Coordinates**
|
||||
**Options**
|
||||
|
||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||
|
||||
@@ -223,6 +236,8 @@ In addition to the [general options](#general-options) the following options are
|
||||
|------------|--------------------------------------------------|---------------------------------------------|
|
||||
|sources |`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as source. |
|
||||
|destinations|`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as destination.|
|
||||
|annotations |`duration` (default), `distance`, or `duration,distance`|Return the requested table or tables in response. Note that computing the `distances` table is currently only implemented for CH. If `annotations=distance` or `annotations=duration,distance` is requested when running a MLD router, a `NotImplemented` error will be returned.
|
||||
|
|
||||
|
||||
Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
|
||||
to number of input locations;
|
||||
@@ -240,14 +255,23 @@ sources=0;5;7&destinations=5;1;4;2;3;6
|
||||
#### Example Request
|
||||
|
||||
```curl
|
||||
# Returns a 3x3 matrix:
|
||||
# Returns a 3x3 duration matrix:
|
||||
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
|
||||
|
||||
# Returns a 1x3 matrix
|
||||
# Returns a 1x3 duration matrix
|
||||
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?sources=0'
|
||||
|
||||
# Returns a asymmetric 3x2 matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:
|
||||
# Returns a asymmetric 3x2 duration matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:
|
||||
curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHulFzeMe`EuvKpnCglA)?sources=0;1;3&destinations=2;4'
|
||||
|
||||
# Returns a 3x3 duration matrix:
|
||||
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?annotations=duration'
|
||||
|
||||
# Returns a 3x3 distance matrix for CH:
|
||||
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?annotations=distance'
|
||||
|
||||
# Returns a 3x3 duration matrix and a 3x3 distance matrix for CH:
|
||||
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?annotations=distance,duration'
|
||||
```
|
||||
|
||||
**Response**
|
||||
@@ -255,17 +279,115 @@ curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHu
|
||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
|
||||
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
|
||||
- `distances` array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel distance from
|
||||
the i-th waypoint to the j-th waypoint. Values are given in meters. Can be `null` if no route between `i` and `j` can be found. Note that computing the `distances` table is currently only implemented for CH. If `annotations=distance` or `annotations=duration,distance` is requested when running a MLD router, a `NotImplemented` error will be returned.
|
||||
- `sources` array of `Waypoint` objects describing all sources in order
|
||||
- `destinations` array of `Waypoint` objects describing all destinations in order
|
||||
|
||||
In case of error the following `code`s are supported in addition to the general ones:
|
||||
|
||||
| Type | Description |
|
||||
|-------------------|-----------------|
|
||||
| Type | Description |
|
||||
|------------------|-----------------|
|
||||
| `NoTable` | No route found. |
|
||||
| `NotImplemented` | This request is not supported |
|
||||
|
||||
All other properties might be undefined.
|
||||
|
||||
#### Example Response
|
||||
|
||||
```json
|
||||
{
|
||||
"sources": [
|
||||
{
|
||||
"location": [
|
||||
13.3888,
|
||||
52.517033
|
||||
],
|
||||
"hint": "PAMAgEVJAoAUAAAAIAAAAAcAAAAAAAAArss0Qa7LNEHiVIRA4lSEQAoAAAAQAAAABAAAAAAAAADMAAAAAEzMAKlYIQM8TMwArVghAwEA3wps52D3",
|
||||
"name": "Friedrichstraße"
|
||||
},
|
||||
{
|
||||
"location": [
|
||||
13.397631,
|
||||
52.529432
|
||||
],
|
||||
"hint": "WIQBgL6mAoAEAAAABgAAAAAAAAA7AAAAhU6PQHvHj0IAAAAAQbyYQgQAAAAGAAAAAAAAADsAAADMAAAAf27MABiJIQOCbswA_4ghAwAAXwVs52D3",
|
||||
"name": "Torstraße"
|
||||
},
|
||||
{
|
||||
"location": [
|
||||
13.428554,
|
||||
52.523239
|
||||
],
|
||||
"hint": "7UcAgP___38fAAAAUQAAACYAAABTAAAAhSQKQrXq5kKRbiZCWJo_Qx8AAABRAAAAJgAAAFMAAADMAAAASufMAOdwIQNL58wA03AhAwMAvxBs52D3",
|
||||
"name": "Platz der Vereinten Nationen"
|
||||
}
|
||||
],
|
||||
"durations": [
|
||||
[
|
||||
0,
|
||||
192.6,
|
||||
382.8
|
||||
],
|
||||
[
|
||||
199,
|
||||
0,
|
||||
283.9
|
||||
],
|
||||
[
|
||||
344.7,
|
||||
222.3,
|
||||
0
|
||||
]
|
||||
],
|
||||
"destinations": [
|
||||
{
|
||||
"location": [
|
||||
13.3888,
|
||||
52.517033
|
||||
],
|
||||
"hint": "PAMAgEVJAoAUAAAAIAAAAAcAAAAAAAAArss0Qa7LNEHiVIRA4lSEQAoAAAAQAAAABAAAAAAAAADMAAAAAEzMAKlYIQM8TMwArVghAwEA3wps52D3",
|
||||
"name": "Friedrichstraße"
|
||||
},
|
||||
{
|
||||
"location": [
|
||||
13.397631,
|
||||
52.529432
|
||||
],
|
||||
"hint": "WIQBgL6mAoAEAAAABgAAAAAAAAA7AAAAhU6PQHvHj0IAAAAAQbyYQgQAAAAGAAAAAAAAADsAAADMAAAAf27MABiJIQOCbswA_4ghAwAAXwVs52D3",
|
||||
"name": "Torstraße"
|
||||
},
|
||||
{
|
||||
"location": [
|
||||
13.428554,
|
||||
52.523239
|
||||
],
|
||||
"hint": "7UcAgP___38fAAAAUQAAACYAAABTAAAAhSQKQrXq5kKRbiZCWJo_Qx8AAABRAAAAJgAAAFMAAADMAAAASufMAOdwIQNL58wA03AhAwMAvxBs52D3",
|
||||
"name": "Platz der Vereinten Nationen"
|
||||
}
|
||||
],
|
||||
"code": "Ok",
|
||||
"distances": [
|
||||
[
|
||||
0,
|
||||
1886.89,
|
||||
3791.3
|
||||
],
|
||||
[
|
||||
1824,
|
||||
0,
|
||||
2838.09
|
||||
],
|
||||
[
|
||||
3275.36,
|
||||
2361.73,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Match service
|
||||
|
||||
Map matching matches/snaps given GPS points to the road network in the most plausible way.
|
||||
@@ -288,6 +410,7 @@ In addition to the [general options](#general-options) the following options are
|
||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
||||
|gaps |`split` (default), `ignore` |Allows the input track splitting based on huge timestamp gaps between points. |
|
||||
|tidy |`true`, `false` (default) |Allows the input track modification to obtain better matching quality for noisy tracks. |
|
||||
|waypoints | `{index};{index};{index}...` |Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. |
|
||||
|
||||
|Parameter |Values |
|
||||
|------------|-----------------------------------|
|
||||
@@ -514,10 +637,10 @@ Represents a route between two waypoints.
|
||||
|
||||
- `annotation`: Additional details about each coordinate along the route geometry:
|
||||
|
||||
| annotations | |
|
||||
|--------------|-----------------------------------------------------------------------|
|
||||
| true | An `Annotation` object containing node ids, durations distances and |
|
||||
| false | weights `undefined` |
|
||||
| annotations | |
|
||||
|--------------|-------------------------------------------------------------------------------|
|
||||
| true | An `Annotation` object containing node ids, durations, distances and weights. |
|
||||
| false | `undefined` |
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -533,6 +656,7 @@ With `steps=false` and `annotations=true`:
|
||||
"distance": [5,5,10,5,5],
|
||||
"duration": [15,15,40,15,15],
|
||||
"datasources": [1,0,0,0,1],
|
||||
"metadata": { "datasource_names": ["traffic","lua profile","lua profile","lua profile","traffic"] },
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
|
||||
}
|
||||
@@ -547,10 +671,12 @@ Annotation of the whole route leg with fine-grained information about each segme
|
||||
|
||||
- `distance`: The distance, in metres, between each pair of coordinates
|
||||
- `duration`: The duration between each pair of coordinates, in seconds. Does not include the duration of any turns.
|
||||
- `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` or `osrm-customize`. String-like names are in the `metadata.datasource_names` array.
|
||||
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
||||
- `weight`: The weights between each pair of coordinates. Does not include any turn costs.
|
||||
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
|
||||
- `metadata`: Metadata related to other annotations
|
||||
- `datasource_names`: The names of the datasources used for the speed between each pair of coordinates. `lua profile` is the default profile, other values arethe filenames supplied via `--segment-speed-file` to `osrm-contract` or `osrm-customize`
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -559,6 +685,7 @@ Annotation of the whole route leg with fine-grained information about each segme
|
||||
"distance": [5,5,10,5,5],
|
||||
"duration": [15,15,40,15,15],
|
||||
"datasources": [1,0,0,0,1],
|
||||
"metadata": { "datasource_names": ["traffic","lua profile","lua profile","lua profile","traffic"] },
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||
"weight": [15,15,40,15,15]
|
||||
}
|
||||
@@ -586,7 +713,7 @@ step.
|
||||
|
||||
- `name`: The name of the way along which travel proceeds.
|
||||
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
||||
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
|
||||
- `pronunciation`: A string containing an [IPA](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) phonetic transcription indicating how to pronounce the name in the `name` property. This property is omitted if pronunciation data is unavailable for the step.
|
||||
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
|
||||
- `exits`: The exit numbers or names of the way. Will be `undefined` if there are no exit numbers or names.
|
||||
- `mode`: A string signifying the mode of transportation.
|
||||
|
||||
+45
-21
@@ -25,6 +25,9 @@ var osrm = new OSRM('network.osrm');
|
||||
Make sure you prepared the dataset with the correct toolchain.
|
||||
- `options.shared_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Connects to the persistent shared memory datastore.
|
||||
This requires you to run `osrm-datastore` prior to creating an `OSRM` object.
|
||||
- `options.memory_file` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** *DEPRECATED*
|
||||
Old behaviour: Path to a file on disk to store the memory using mmap. Current behaviour: setting this value is the same as setting `mmap_memory: true`.
|
||||
- `options.mmap_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Map on-disk files to virtual memory addresses (mmap), rather than loading into RAM.
|
||||
- `options.path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The path to the `.osrm` files. This is mutually exclusive with setting {options.shared_memory} to true.
|
||||
- `options.max_locations_trip` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in trip query (default: unlimited).
|
||||
- `options.max_locations_viaroute` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in viaroute query (default: unlimited).
|
||||
@@ -55,13 +58,13 @@ Returns the fastest route between two or more coordinates while visiting the way
|
||||
- `options.continue_straight` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
`null`/`true`/`false`
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM("berlin-latest.osrm");
|
||||
osrm.route({coordinates: [[52.519930,13.438640], [52.513191,13.415852]]}, function(err, result) {
|
||||
osrm.route({coordinates: [[13.438640,52.519930], [13.415852,52.513191]]}, function(err, result) {
|
||||
if(err) throw err;
|
||||
console.log(result.waypoints); // array of Waypoint objects representing all waypoints in order
|
||||
console.log(result.routes); // array of Route objects ordered by descending recommendation rank
|
||||
@@ -87,7 +90,7 @@ Note: `coordinates` in the general options only supports a single `{longitude},{
|
||||
- `options.number` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of nearest segments that should be returned.
|
||||
Must be an integer greater than or equal to `1`. (optional, default `1`)
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@@ -109,8 +112,8 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
|
||||
|
||||
### table
|
||||
|
||||
Computes duration tables for the given locations. Allows for both symmetric and asymmetric
|
||||
tables.
|
||||
Computes duration table for the given locations. Allows for both symmetric and asymmetric
|
||||
tables. Optionally returns distance table.
|
||||
|
||||
**Parameters**
|
||||
|
||||
@@ -126,7 +129,7 @@ tables.
|
||||
- `options.destinations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer <
|
||||
#coordinates`) to use location with given index as destination. Default is to use all.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@@ -166,7 +169,7 @@ and what weights they have applied.
|
||||
- `ZXY` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** an array consisting of `x`, `y`, and `z` values representing tile coordinates like
|
||||
[wiki.openstreetmap.org/wiki/Slippy_map_tilenames](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames)
|
||||
and are supported by vector tile viewers like [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/).
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@@ -203,7 +206,7 @@ if they can not be matched successfully.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy. Can be `null` for default value `5` meters or `double >= 0`.
|
||||
- `options.gaps` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Allows the input track splitting based on huge timestamp gaps between points. Either `split` or `ignore` (optional, default `split`).
|
||||
- `options.tidy` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Allows the input track modification to obtain better matching quality for noisy tracks (optional, default `false`).
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@@ -267,7 +270,7 @@ Right now, the following combinations are possible:
|
||||
- `options.source` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route starts at `any` or `first` coordinate. (optional, default `any`)
|
||||
- `options.destination` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route ends at `any` or `last` coordinate. (optional, default `any`)
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@@ -296,9 +299,30 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
|
||||
2) `waypoint_index`: index of the point in the trip.
|
||||
**`trips`**: an array of [`Route`](#route) objects that assemble the trace.
|
||||
|
||||
## Responses
|
||||
## Plugin behaviour
|
||||
|
||||
Responses
|
||||
All plugins support a second additional object that is available to configure some NodeJS specific behaviours.
|
||||
|
||||
- `plugin_config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||
- `plugin_config.format` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The format of the result object to various API calls. Valid options are `object` (default), which returns a standard Javascript object, as described above, and `json_buffer`, which will return a NodeJS **[Buffer](https://nodejs.org/api/buffer.html)** object, containing a JSON string. The latter has the advantage that it can be immediately serialized to disk/sent over the network, and the generation of the string is performed outside the main NodeJS event loop. This option is ignored by the `tile` plugin.
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [
|
||||
[13.36761474609375, 52.51663871100423],
|
||||
[13.374481201171875, 52.506191342034576]
|
||||
]
|
||||
};
|
||||
osrm.route(options, { format: "json_buffer" }, function(err, response) {
|
||||
if (err) throw err;
|
||||
console.log(response.toString("utf-8"));
|
||||
});
|
||||
```
|
||||
|
||||
## Responses
|
||||
|
||||
### Route
|
||||
|
||||
@@ -306,8 +330,8 @@ Represents a route through (potentially multiple) waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in
|
||||
[`osrm-backend`](../http.md#route)
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#route-object)
|
||||
|
||||
### RouteLeg
|
||||
|
||||
@@ -315,8 +339,8 @@ Represents a route between two waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in
|
||||
[`osrm-backend`](../http.md#routeleg)
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#routeleg-object)
|
||||
|
||||
### RouteStep
|
||||
|
||||
@@ -325,15 +349,15 @@ single way to the subsequent step.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in
|
||||
[`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#routestep)
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#routestep-object)
|
||||
|
||||
### StepManeuver
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in
|
||||
[`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#stepmaneuver)
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#stepmaneuver-object)
|
||||
|
||||
### Waypoint
|
||||
|
||||
@@ -341,5 +365,5 @@ Object used to describe waypoint on a route.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in
|
||||
[`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#waypoint)
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#waypoint-object)
|
||||
|
||||
+136
-50
@@ -6,7 +6,7 @@ OSRM supports "profiles". Profiles representing routing behavior for different t
|
||||
## Available profiles
|
||||
Out-of-the-box OSRM comes with profiles for car, bicycle and foot. You can easily modify these or create new ones if you like.
|
||||
|
||||
Profiles have a 'lua' extension, and are places in 'profiles' directory.
|
||||
Profiles have a 'lua' extension, and are placed in 'profiles' directory.
|
||||
|
||||
When running OSRM preprocessing commands you specify the profile with the --profile (or the shorthand -p) option, for example:
|
||||
|
||||
@@ -17,8 +17,8 @@ It's important to understand that profiles are used when preprocessing the OSM d
|
||||
|
||||
This means that after modifying a profile **you will need to extract, contract and reload the data again** and to see changes in the routing results. See [Processing Flow](https://github.com/Project-OSRM/osrm-backend/wiki/Processing-Flow) for more.
|
||||
|
||||
## Profiles are written in LUA
|
||||
Profiles are not just configuration files. They are scripts written in the [LUA scripting language](http://www.lua.org). The reason for this is that OpenStreetMap data is complex, and it's not possible to simply define tag mappings. LUA scripting offers a powerful way to handle all the possible tag combinations found in OpenStreetMap nodes and ways.
|
||||
## Profiles are written in Lua
|
||||
Profiles are not just configuration files. They are scripts written in the [Lua scripting language](http://www.lua.org). The reason for this is that OpenStreetMap data is complex, and it's not possible to simply define tag mappings. Lua scripting offers a powerful way to handle all the possible tag combinations found in OpenStreetMap nodes and ways.
|
||||
|
||||
## Basic structure of profiles
|
||||
A profile will process every node and way in the OSM input data to determine what ways are routable in which direction, at what speed, etc.
|
||||
@@ -35,40 +35,40 @@ A profile can also define various local functions it needs.
|
||||
|
||||
Looking at [car.lua](../profiles/car.lua) as an example, at the top of the file the api version is defined and then required library files are included.
|
||||
|
||||
Then follows the `setup` functions, which is called once when the profile is loaded. It returns a big hash table of configurations, specifying things like what speed to use for different way types. The configurations are used later in the various processing functions. Many adjustments can be done just be modifying this configuration table.
|
||||
Then follows the `setup` function, which is called once when the profile is loaded. It returns a big hash table of configurations, specifying things like what speed to use for different way types. The configurations are used later in the various processing functions. Many adjustments can be done just by modifying this configuration table.
|
||||
|
||||
The setup function is also where you can do other setup, like loading elevation data source if you want to consider that when processing ways.
|
||||
The setup function is also where you can do other setup, like loading an elevation data source if you want to consider that when processing ways.
|
||||
|
||||
Then comes the `process_node` and `process_way` functions, which are called for each OSM node and way when extracting OpenStreetMap data with `osrm-extract`.
|
||||
Then come the `process_node` and `process_way` functions, which are called for each OSM node and way when extracting OpenStreetMap data with `osrm-extract`.
|
||||
|
||||
The `process_turn` function processes every possible turn in the network, and sets a penalty depending on the angle and turn of the movement.
|
||||
|
||||
Profiles can also define a `process_segment` function to handle differences in speed along an OSM way, for example to handle elevation. As you can see, this is not currently used in the car profile.
|
||||
|
||||
At the end of the file, a table if returned with references to the setup and processing functions the profile has defined.
|
||||
At the end of the file, a table is returned with references to the setup and processing functions the profile has defined.
|
||||
|
||||
## Understanding speed, weight and rate
|
||||
When computing a route from A to B there can be different measure of what is the best route. That's why there's a need for different profiles.
|
||||
When computing a route from A to B there can be different measures of what is the best route. That's why there's a need for different profiles.
|
||||
|
||||
Because speeds very on different types of roads, the shortest and the fastest route are typically different. But there are many other possible preferences. For example a user might prefer a bicycle route that follow parks or other green areas, even though both duration and distance are a bit longer.
|
||||
Because speeds vary on different types of roads, the shortest and the fastest route are typically different. But there are many other possible preferences. For example a user might prefer a bicycle route that follow parks or other green areas, even though both duration and distance are a bit longer.
|
||||
|
||||
To handle this, OSRM doesn't simply choose the ways with the highest speed. Instead it uses the concept of `weight` and `rate`. The rate is an abstract measure that you can assign to ways as you like to make some ways preferable to others. Routing will prefer ways with high rate.
|
||||
To handle this, OSRM doesn't simply choose the ways with the highest speed. Instead it uses the concepts of `weight` and `rate`. The rate is an abstract measure that you can assign to ways as you like to make some ways preferable to others. Routing will prefer ways with high rate.
|
||||
|
||||
The weight of a way normally computed as length / rate. The weight can be thought of as the resistance or cost when passing the way. Routing will prefer ways with low weight.
|
||||
The weight of a way is normally computed as length / rate. The weight can be thought of as the resistance or cost when passing the way. Routing will prefer ways with low weight.
|
||||
|
||||
You can also set the weight of a way to a fixed value, In this case it's not calculated based on the length or rate, and the rate is ignored.
|
||||
You can also set the weight of a way to a fixed value. In this case it's not calculated based on the length or rate, and the rate is ignored.
|
||||
|
||||
You should set the speed to you best estimate of the actual speed that will be used on a particular way. This will result in the best estimated travel times.
|
||||
You should set the speed to your best estimate of the actual speed that will be used on a particular way. This will result in the best estimated travel times.
|
||||
|
||||
If you want to prefer certain ways due to other factors than the speed, adjust the rate accordingly. If you adjust the speed, the time time estimation will be skewed.
|
||||
If you want to prefer certain ways due to other factors than the speed, adjust the rate accordingly. If you adjust the speed, the time estimation will be skewed.
|
||||
|
||||
If you set the same rate on all ways, the result will be shortest path routing.
|
||||
If you set rate = speed on all ways, the result will be fastest path routing.
|
||||
If you want to prioritize certain street, increase the rate on these.
|
||||
If you want to prioritize certain streets, increase the rate on these.
|
||||
|
||||
## Elements
|
||||
### api_version
|
||||
A profile should set api_version at the top of your profile. This is done to ensure that older profiles are still supported when the api changes. If api_version is not defined, 0 will be assumed. The current api version is 2.
|
||||
A profile should set `api_version` at the top of your profile. This is done to ensure that older profiles are still supported when the api changes. If `api_version` is not defined, 0 will be assumed. The current api version is 4.
|
||||
|
||||
### Library files
|
||||
The folder [profiles/lib/](../profiles/lib/) contains LUA library files for handling many common processing tasks.
|
||||
@@ -81,15 +81,15 @@ set.lua | Defines the Set helper for handling sets of values
|
||||
sequence.lua | Defines the Sequence helper for handling sequences of values
|
||||
access.lua | Function for finding relevant access tags
|
||||
destination.lua | Function for finding relevant destination tags
|
||||
destination.lua | Function for determining maximum speed
|
||||
maxspeed.lua | Function for determining maximum speed
|
||||
guidance.lua | Function for processing guidance attributes
|
||||
|
||||
They all return a table of functions when you use `require` to load them. You can either store this table and reference it's functions later, of if you need only a single you can store that directly.
|
||||
They all return a table of functions when you use `require` to load them. You can either store this table and reference its functions later, or if you need only a single function you can store that directly.
|
||||
|
||||
### setup()
|
||||
The `setup` function is called once when the profile is loaded and must return a table of configurations. It's also where you can do other global setup, like loading data sources that are used during processing.
|
||||
|
||||
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA iinterpreter will have it's own set of globals.
|
||||
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA iinterpreter will have its own set of globals.
|
||||
|
||||
The following global properties can be set under `properties` in the hash you return in the `setup` function:
|
||||
|
||||
@@ -109,8 +109,7 @@ The following additional global properties can be set in the hash you return in
|
||||
|
||||
Attribute | Type | Notes
|
||||
-------------------------------------|------------------|----------------------------------------------------------------------------
|
||||
excludable | Sequence of Sets | Determines which class-combinations are supported by the `exclude` option at query time.
|
||||
| | E.g. `Sequence{Set{"ferry", "motorway"}, Set{"motorway"}}` will allow you to exclude ferries and motorways, or only motorways.
|
||||
excludable | Sequence of Sets | Determines which class-combinations are supported by the `exclude` option at query time. E.g. `Sequence{Set{"ferry", "motorway"}, Set{"motorway"}}` will allow you to exclude ferries and motorways, or only motorways.
|
||||
classes | Sequence | Determines the allowed classes that can be referenced using `{forward,backward}_classes` on the way in the `process_way` function.
|
||||
restrictions | Sequence | Determines which turn restrictions will be used for this profile.
|
||||
suffix_list | Set | List of name suffixes needed for determining if "Highway 101 NW" the same road as "Highway 101 ES".
|
||||
@@ -139,7 +138,7 @@ Given an OpenStreetMap way, the `process_way` function will either return nothin
|
||||
Argument | Description
|
||||
---------|-------------------------------------------------------
|
||||
profile | The configuration table you returned in `setup`.
|
||||
node | The input way to process (read-only).
|
||||
way | The input way to process (read-only).
|
||||
result | The output that you will modify.
|
||||
relations| Storage of relations to access relations, where `way` is a member.
|
||||
|
||||
@@ -147,26 +146,26 @@ Importantly it will set `result.forward_mode` and `result.backward_mode` to indi
|
||||
|
||||
It will also set a number of other attributes on `result`.
|
||||
|
||||
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the `process_way` function. Instead `process_way` will examine the tag set on the way, process this information in various ways, calling other local functions and referencing the configuration in `profile`, etc, before arriving at the result.
|
||||
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the `process_way` function. Instead `process_way` will examine the tag set on the way, process this information in various ways, calling other local functions and referencing the configuration in `profile`, etc., before arriving at the result.
|
||||
|
||||
The following attributes can be set on the result in `process_way`:
|
||||
|
||||
Attribute | Type | Notes
|
||||
----------------------------------------|----------|--------------------------------------------------------------------------
|
||||
forward_speed | Float | Speed on this way in km/h. Mandatory.
|
||||
backward_speed | Float | " "
|
||||
backward_speed | Float | ""
|
||||
forward_rate | Float | Routing weight, expressed as meters/*weight* (e.g. for a fastest-route weighting, you would want this to be meters/second, so set it to forward_speed/3.6)
|
||||
backward_rate | Float | " "
|
||||
backward_rate | Float | ""
|
||||
forward_mode | Enum | Mode of travel (e.g. `car`, `ferry`). Mandatory. Defined in `include/extractor/travel_mode.hpp`.
|
||||
backward_mode | Enum | " "
|
||||
backward_mode | Enum | ""
|
||||
forward_classes | Table | Mark this way as being of a specific class, e.g. `result.classes["toll"] = true`. This will be exposed in the API as `classes` on each `RouteStep`.
|
||||
backward_classes | Table | " "
|
||||
backward_classes | Table | ""
|
||||
duration | Float | Alternative setter for duration of the whole way in both directions
|
||||
weight | Float | Alternative setter for weight of the whole way in both directions
|
||||
turn_lanes_forward | String | Directions for individual lanes (normalized OSM `turn:lanes` value)
|
||||
turn_lanes_backward | String | " "
|
||||
turn_lanes_backward | String | ""
|
||||
forward_restricted | Boolean | Is this a restricted access road? (e.g. private, or deliveries only; used to enable high turn penalty, so that way is only chosen for start/end of route)
|
||||
backward_restricted | Boolean | " "
|
||||
backward_restricted | Boolean | ""
|
||||
is_startpoint | Boolean | Can a journey start on this way? (e.g. ferry; if `false`, prevents snapping the start point to this way)
|
||||
roundabout | Boolean | Is this part of a roundabout?
|
||||
circular | Boolean | Is this part of a non-roundabout circular junction?
|
||||
@@ -188,19 +187,19 @@ The `process_segment` function is called for every segment of OSM ways. A segmen
|
||||
|
||||
On OpenStreetMap way cannot have different tags on different parts of a way. Instead you would split the way into several smaller ways. However many ways are long. For example, many ways pass hills without any change in tags.
|
||||
|
||||
Processing each segment of an OSM way makes it possible to have different speeds on different parts of a way based on external data like data about elevation, pollution, noise or scenic value and adjust weight and duration of the segment.
|
||||
Processing each segment of an OSM way makes it possible to have different speeds on different parts of a way based on external data like data about elevation, pollution, noise or scenic value and adjust weight and duration of the segment accordingly.
|
||||
|
||||
In the `process_segment` you don't have access to OSM tags. Instead you use the geographical location of the start and end point of the way to lookup other data source, like elevation data. See [rasterbot.lua](../profiles/rasterbot.lua) for an example.
|
||||
In the `process_segment` function you don't have access to OSM tags. Instead you use the geographical location of the start and end point of the way to look up information from another data source, like elevation data. See [rasterbot.lua](../profiles/rasterbot.lua) for an example.
|
||||
|
||||
The following attributes can be read and set on the result in `process_segment`:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
-------------------|-------------|---------|----------------------------------------
|
||||
source.lon | Read | Float | Co-ordinates of segment start
|
||||
source.lat | Read | Float | " "
|
||||
source.lat | Read | Float | ""
|
||||
target.lon | Read | Float | Co-ordinates of segment end
|
||||
target.lat | Read | Float | " "
|
||||
target.distance | Read | Float | Length of segment
|
||||
target.lat | Read | Float | ""
|
||||
distance | Read | Float | Length of segment
|
||||
weight | Read/write | Float | Routing weight for this segment
|
||||
duration | Read/write | Float | Duration for this segment
|
||||
|
||||
@@ -209,16 +208,103 @@ The `process_turn` function is called for every possible turn in the network. Ba
|
||||
|
||||
The following attributes can be read and set on the result in `process_turn`:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
-------------------|-------------|---------|------------------------------------------------------
|
||||
direction_modifier | Read | Enum | Geometry of turn. Defined in `include/extractor/guidance/turn_instruction.hpp`
|
||||
turn_type | Read | Enum | Priority of turn. Defined in `include/extractor/guidance/turn_instruction.hpp`
|
||||
has_traffic_light | Read | Boolean | Is a traffic light present at this turn?
|
||||
source_restricted | Read | Boolean | Is it from a restricted access road? (See definition in `process_way`)
|
||||
target_restricted | Read | Boolean | Is it to a restricted access road? (See definition in `process_way`)
|
||||
angle | Read | Float | Angle of turn in degrees (`0-360`: `0`=u-turn, `180`=straight on)
|
||||
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
|
||||
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
||||
Attribute | Read/write? | Type | Notes
|
||||
--------------------- | ------------- | --------- | ------------------------------------------------------
|
||||
angle | Read | Float | Angle of turn in degrees (`[-179, 180]`: `0`=straight, `180`=u turn, `+x`=x degrees to the right, `-x`= x degrees to the left)
|
||||
number_of_roads | Read | Integer | Number of ways at the intersection of the turn
|
||||
is_u_turn | Read | Boolean | Is the turn a u-turn?
|
||||
has_traffic_light | Read | Boolean | Is a traffic light present at this turn?
|
||||
is_left_hand_driving | Read | Boolean | Is left-hand traffic?
|
||||
source_restricted | Read | Boolean | Is it from a restricted access road? (See definition in `process_way`)
|
||||
source_mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||
source_is_motorway | Read | Boolean | Is the source road a motorway?
|
||||
source_is_link | Read | Boolean | Is the source road a link?
|
||||
source_number_of_lanes | Read | Integer | How many lanes does the source road have? (default when not tagged: 0)
|
||||
source_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
source_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
source_speed | Read | Integer | Speed on this source road in km/h
|
||||
source_priority_class | Read | Enum | The type of road priority class of the source. Defined in `include/extractor/guidance/road_classification.hpp`
|
||||
target_restricted | Read | Boolean | Is the target a restricted access road? (See definition in `process_way`)
|
||||
target_mode | Read | Enum | Travel mode after the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||
target_is_motorway | Read | Boolean | Is the target road a motorway?
|
||||
target_is_link | Read | Boolean | Is the target road a link?
|
||||
target_number_of_lanes | Read | Integer | How many lanes does the target road have? (default when not tagged: 0)
|
||||
target_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
target_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
target_speed | Read | Integer | Speed on this target road in km/h
|
||||
target_priority_class | Read | Enum | The type of road priority class of the target. Defined in `include/extractor/guidance/road_classification.hpp`
|
||||
roads_on_the_right | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the right of the turn that are also connected at the intersection
|
||||
roads_on_the_left | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the left of the turn that are also connected at the intersection. If turn is a u turn, this is empty.
|
||||
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
||||
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
|
||||
|
||||
#### `roads_on_the_right` and `roads_on_the_left`
|
||||
|
||||
The information of `roads_on_the_right` and `roads_on_the_left` that can be read are as follows:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
--------------------- | ------------- | --------- | ------------------------------------------------------
|
||||
is_restricted | Read | Boolean | Is it a restricted access road? (See definition in `process_way`)
|
||||
mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||
is_motorway | Read | Boolean | Is the road a motorway?
|
||||
is_link | Read | Boolean | Is the road a link?
|
||||
number_of_lanes | Read | Integer | How many lanes does the road have? (default when not tagged: 0)
|
||||
highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
||||
access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
||||
speed | Read | Integer | Speed on this road in km/h
|
||||
priority_class | Read | Enum | The type of road priority class of the leg. Defined in `include/extractor/guidance/road_classification.hpp`
|
||||
is_incoming | Read | Boolean | Is the road an incoming road of the intersection
|
||||
is_outgoing | Read | Boolean | Is the road an outgoing road of the intersection
|
||||
|
||||
The order of the roads in `roads_on_the_right` and `roads_on_the_left` are *counter clockwise*. If the turn is a u turn, all other connected roads will be in `roads_on_the_right`.
|
||||
|
||||
**Example**
|
||||
|
||||
```
|
||||
c e
|
||||
| /
|
||||
| /
|
||||
a ---- x ---- b
|
||||
/|
|
||||
/ |
|
||||
f d
|
||||
|
||||
|
||||
```
|
||||
When turning from `a` to `b` via `x`,
|
||||
* `roads_on_the_right[1]` is the road `xf`
|
||||
* `roads_on_the_right[2]` is the road `xd`
|
||||
* `roads_on_the_left[1]` is the road `xe`
|
||||
* `roads_on_the_left[2]` is the road `xc`
|
||||
|
||||
Note that indices of arrays in lua are 1-based.
|
||||
|
||||
#### `highway_turn_classification` and `access_turn_classification`
|
||||
When setting appropriate turn weights and duration, information about the highway and access tags of roads that are involved in the turn are necessary. The lua turn function `process_turn` does not have access to the original osrm tags anymore. However, `highway_turn_classification` and `access_turn_classification` can be set during setup. The classification set during setup can be later used in `process_turn`.
|
||||
|
||||
**Example**
|
||||
|
||||
In the following example we use `highway_turn_classification` to set the turn weight to `10` if the turn is on a highway and to `5` if the turn is on a primary.
|
||||
|
||||
```
|
||||
function setup()
|
||||
return {
|
||||
highway_turn_classification = {
|
||||
['motorway'] = 2,
|
||||
['primary'] = 1
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function process_turn(profile, turn) {
|
||||
if turn.source_highway_turn_classification == 2 and turn.target_highway_turn_classification == 2 then
|
||||
turn.weight = 10
|
||||
end
|
||||
if turn.source_highway_turn_classification == 1 and turn.target_highway_turn_classification == 1 then
|
||||
turn.weight = 5
|
||||
end
|
||||
}
|
||||
```
|
||||
|
||||
## Guidance
|
||||
The guidance parameters in profiles are currently a work in progress. They can and will change.
|
||||
@@ -231,7 +317,7 @@ The priority-category influences the decision which road is considered the obvio
|
||||
Forks can be emitted between roads of similar priority category only. Obvious choices follow a major priority road, if the priority difference is large.
|
||||
|
||||
### Using raster data
|
||||
OSRM has build-in support for loading an interpolating raster data in ASCII format. This can be used e.g. for factoring in elevation when computing routes.
|
||||
OSRM has built-in support for loading an interpolating raster data in ASCII format. This can be used e.g. for factoring in elevation when computing routes.
|
||||
|
||||
Use `raster:load()` in your `setup` function to load data and store the source in your configuration hash:
|
||||
|
||||
@@ -284,8 +370,8 @@ See [rasterbot.lua](../profiles/rasterbot.lua) and [rasterbotinterp.lua](../prof
|
||||
### Helper functions
|
||||
There are a few helper functions defined in the global scope that profiles can use:
|
||||
|
||||
durationIsValid
|
||||
parseDuration
|
||||
trimLaneString
|
||||
applyAccessTokens
|
||||
canonicalizeStringList
|
||||
- `durationIsValid`
|
||||
- `parseDuration`
|
||||
- `trimLaneString`
|
||||
- `applyAccessTokens`
|
||||
- `canonicalizeStringList`
|
||||
|
||||
+8
-6
@@ -43,12 +43,14 @@ We may introduce forward-compatible changes: query parameters and response prope
|
||||
|
||||
1. Check out the appropriate release branch `x.y`
|
||||
2. Make sure `CHANGELOG.md` is up to date.
|
||||
3. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||
4. Make sure the `package.json` is up to date.
|
||||
5. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||
6. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||
7. Use `npm run docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
||||
8. Push tags and commits: `git push; git push --tags`
|
||||
3. Make sure the `package.json` on branch `x.y` has been committed.
|
||||
4. Make sure all tests are passing (e.g. Travis CI gives you a :green_apple:)
|
||||
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries. Commit should be one in which the `package.json` version matches the version you want to release.
|
||||
6. Use `npm run docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
||||
7. Push tags and commits: `git push; git push --tags`
|
||||
8. On https://github.com/Project-OSRM/osrm-backend/releases press `Draft a new release`,
|
||||
write the release tag `vx.y.z` in the `Tag version` field, write the changelog entries in the `Describe this release` field
|
||||
and press `Publish release`.
|
||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
|
||||
`rm -rf node_modules && npm install` locally.
|
||||
|
||||
@@ -30,9 +30,17 @@ int main(int argc, const char *argv[])
|
||||
|
||||
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
|
||||
EngineConfig config;
|
||||
|
||||
config.storage_config = {argv[1]};
|
||||
config.use_shared_memory = false;
|
||||
|
||||
// We support two routing speed up techniques:
|
||||
// - Contraction Hierarchies (CH): requires extract+contract pre-processing
|
||||
// - Multi-Level Dijkstra (MLD): requires extract+partition+customize pre-processing
|
||||
//
|
||||
// config.algorithm = EngineConfig::Algorithm::CH;
|
||||
config.algorithm = EngineConfig::Algorithm::MLD;
|
||||
|
||||
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
||||
const OSRM osrm{config};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Feature: Barriers
|
||||
| entrance | x |
|
||||
| wall | |
|
||||
| fence | |
|
||||
| some_tag | |
|
||||
| some_tag | x |
|
||||
| block | x |
|
||||
|
||||
Scenario: Bike - Access tag trumphs barriers
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
@routing @bicycle @mode
|
||||
Feature: Bicycle - Mode flag
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bicycle - We tag ferries with a class
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route |
|
||||
| ab | primary | |
|
||||
| bc | | ferry |
|
||||
| cd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | ab,bc,cd,cd | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] |
|
||||
| d | a | cd,bc,ab,ab | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] |
|
||||
| c | a | bc,ab,ab | depart,notification left,arrive | [(ferry)],[()],[()] |
|
||||
| d | b | cd,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] |
|
||||
| a | c | ab,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] |
|
||||
| b | d | bc,cd,cd | depart,notification left,arrive | [(ferry)],[()],[()] |
|
||||
|
||||
Scenario: Bicycle - We tag tunnel with a class
|
||||
Background:
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | tunnel |
|
||||
| ab | no |
|
||||
| bc | yes |
|
||||
| cd | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] |
|
||||
|
||||
Scenario: Bicycle - We tag classes without intersections
|
||||
Background:
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | tunnel |
|
||||
| ab | road | |
|
||||
| bc | road | yes |
|
||||
| cd | road | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | road,road | depart,arrive | [(),(tunnel),()],[()] |
|
||||
|
||||
Scenario: Bicycle - From roundabout on ferry
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
/ \
|
||||
a---b d---f--h
|
||||
\ /
|
||||
e
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | highway | junction | route |
|
||||
| ab | yes | service | | |
|
||||
| cb | yes | service | roundabout | |
|
||||
| dc | yes | service | roundabout | |
|
||||
| be | yes | service | roundabout | |
|
||||
| ed | yes | service | roundabout | |
|
||||
| eg | yes | service | | |
|
||||
| df | | | | ferry |
|
||||
| fh | yes | service | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | h | ab,df,df,fh,fh | depart,roundabout-exit-2,exit roundabout slight right,notification straight,arrive | [()],[(),()],[(ferry)],[()],[()] |
|
||||
@@ -46,12 +46,14 @@ Feature: Bike - Cycle tracks/lanes
|
||||
| primary | | | | x | x |
|
||||
| motorway | | | | | |
|
||||
| motorway | track | | | x | |
|
||||
| motorway | opposite | | | | x |
|
||||
| motorway | | track | | | x |
|
||||
| motorway | | opposite | | | x |
|
||||
| motorway | opposite | | | x | x |
|
||||
| motorway | | track | | x | |
|
||||
| motorway | | opposite | | x | x |
|
||||
| motorway | | | track | x | |
|
||||
| motorway | | | opposite | x | |
|
||||
| motorway | | track | track | x | x |
|
||||
| motorway | | | opposite | x | x |
|
||||
# motorways are implicit oneways and cycleway tracks next to oneways always
|
||||
# follow the oneway direction (unless tagged as opposite)
|
||||
| motorway | | track | track | x | |
|
||||
| motorway | | opposite | opposite | x | x |
|
||||
| motorway | | track | opposite | x | x |
|
||||
| motorway | | opposite | track | x | x |
|
||||
@@ -92,6 +94,6 @@ Feature: Bike - Cycle tracks/lanes
|
||||
Then routability should be
|
||||
| highway | cycleway | oneway | forw | backw |
|
||||
| motorway | track | yes | 15 km/h | |
|
||||
| residential | track | yes | 15 km/h | 6 km/h +-1 |
|
||||
| cycleway | track | yes | 15 km/h | 6 km/h +-1 |
|
||||
| footway | track | yes | 15 km/h | 6 km/h +-1 |
|
||||
| residential | track | yes | 15 km/h | 4 km/h +-1 |
|
||||
| cycleway | track | yes | 15 km/h | 4 km/h +-1 |
|
||||
| footway | track | yes | 15 km/h | 4 km/h +-1 |
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
@routing @bicycle @exclude
|
||||
Feature: Bicycle - Exclude flags
|
||||
Background:
|
||||
Given the profile file "bicycle" initialized with
|
||||
"""
|
||||
profile.excludable = Sequence { Set { 'ferry' } }
|
||||
"""
|
||||
Given the node map
|
||||
"""
|
||||
a....b~~~~~c...f
|
||||
: :
|
||||
d.....e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | duration | # |
|
||||
| ab | service | | | always drivable |
|
||||
| bc | | ferry | 00:00:01 | not drivable for exclude=ferry, but fast. |
|
||||
| bd | service | | | always drivable |
|
||||
| de | service | | | always drivable |
|
||||
| ec | service | | | always drivable |
|
||||
| cf | service | | | always drivable |
|
||||
|
||||
Scenario: Bicycle - exclude nothing
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | f | ab,bc,cf,cf |
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | duration |
|
||||
| abcf | abcf | 109 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f |
|
||||
| a | 0 | 109 |
|
||||
| f | 109 | 0 |
|
||||
|
||||
Scenario: Bicycle - exclude ferry
|
||||
Given the query options
|
||||
| exclude | ferry |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | f | ab,bd,de,ec,cf,cf |
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | duration |
|
||||
| abcf | abcf | 301.2 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f |
|
||||
| a | 0 | 301 +- 1 |
|
||||
| f | 301.2 +- 1 | 0 |
|
||||
|
||||
|
||||
@@ -141,5 +141,12 @@ Feature: Bike - Oneway streets
|
||||
| highway | oneway | cycleway:left | cycleway:right | forw | backw |
|
||||
| primary | yes | | | cycling | pushing bike |
|
||||
| primary | yes | | track | cycling | pushing bike |
|
||||
| primary | yes | track | | cycling | cycling |
|
||||
| primary | yes | track | track | cycling | cycling |
|
||||
| primary | yes | track | | cycling | pushing bike |
|
||||
| primary | yes | track | track | cycling | pushing bike |
|
||||
|
||||
Scenario: Bike - Left/right cycleways on any oneways
|
||||
Then routability should be
|
||||
| foot | oneway | cycleway:left | cycleway:right | forw | backw |
|
||||
| no | yes | track | | cycling | |
|
||||
| yes | yes | track | | cycling | pushing bike |
|
||||
| yes | -1 | track | | pushing bike | cycling |
|
||||
@@ -11,15 +11,15 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
Then routability should be
|
||||
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||
| motorway | | | | | |
|
||||
| primary | | 15 km/h | 15 km/h | 2.9 | 2.9 |
|
||||
| secondary | | 15 km/h | 15 km/h | 3.1 | 3.1 |
|
||||
| primary | | 15 km/h | 15 km/h | 2.1 | 2.1 |
|
||||
| secondary | | 15 km/h | 15 km/h | 2.7 | 2.7 |
|
||||
| tertiary | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||
| primary_link | | 15 km/h | 15 km/h | 2.9 | 2.9 |
|
||||
| secondary_link | | 15 km/h | 15 km/h | 3.1 | 3.1 |
|
||||
| primary_link | | 15 km/h | 15 km/h | 2.1 | 2.1 |
|
||||
| secondary_link | | 15 km/h | 15 km/h | 2.7 | 2.7 |
|
||||
| tertiary_link | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||
| residential | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | | 6 km/h +-1 | 6 km/h +-1 | 1.7 | 1.7 |
|
||||
| footway | | 4 km/h +-1 | 4 km/h +-1 | 1.1 | 1.1 |
|
||||
|
||||
Scenario: Bike - Apply no penalties to ways with cycleways
|
||||
Then routability should be
|
||||
@@ -51,49 +51,49 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
Then routability should be
|
||||
| highway | cycleway:right | cycleway:left | forw | backw | forw_rate | backw_rate |
|
||||
| motorway | track | | 15 km/h | | 4.2 | |
|
||||
| primary | track | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||
| secondary | track | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||
| primary | track | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary | track | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| primary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||
| secondary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||
| primary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| residential | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | track | | 15 km/h | 6 km/h +-1 | 4.2 | 1.7 |
|
||||
| motorway | | track | | 15 km/h | | 4.2 |
|
||||
| primary | | track | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||
| secondary | | track | 15 km/h | 15 km/h | 3.1 | 4.2 |
|
||||
| footway | track | | 15 km/h | 4 km/h +-1 | 4.2 | 1.1 |
|
||||
| motorway | | track | 15 km/h | | 4.2 | |
|
||||
| primary | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary | | track | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| primary_link | | track | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||
| secondary_link | | track | 15 km/h | 15 km/h | 3.1 | 4.2 |
|
||||
| primary_link | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary_link | | track | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary_link | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| residential | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | | track | 6 km/h +-1 | 15 km/h | 1.7 | 4.2 |
|
||||
| footway | | track | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
||||
| motorway | lane | | 15 km/h | | 4.2 | |
|
||||
| primary | lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||
| primary | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||
| secondary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.1 |
|
||||
| primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| residential | lane | | 15 km/h +-1 | 15 km/h +-1 | 4.2 | 4.2 |
|
||||
| cycleway | lane | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | lane | | 15 km/h | 6 km/h +-1 | 4.2 | 1.7 |
|
||||
| motorway | | lane | | 15 km/h | | 4.2 |
|
||||
| primary | | lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||
| secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 3.1 | 4.2 |
|
||||
| footway | lane | | 15 km/h | 4 km/h +-1 | 4.2 | 1.1 |
|
||||
| motorway | | lane | 15 km/h | | 4.2 | |
|
||||
| primary | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 2.7 | 4.2 |
|
||||
| tertiary | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| primary_link | | lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||
| secondary_link | | lane | 15 km/h | 15 km/h | 3.1 | 4.2 |
|
||||
| primary_link | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary_link | | lane | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary_link | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| residential | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | | lane | 6 km/h +-1 | 15 km/h | 1.7 | 4.2 |
|
||||
| footway | | lane | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
||||
| motorway | shared_lane | | 15 km/h | | 4.2 | |
|
||||
| primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.9 |
|
||||
| motorway | | shared_lane | | 15 km/h | | 4.2 |
|
||||
| primary | | shared_lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
|
||||
| primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| motorway | | shared_lane | 15 km/h | | 4.2 | |
|
||||
| primary | | shared_lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
|
||||
|
||||
Scenario: Bike - Don't apply penalties for all kind of cycleways
|
||||
@@ -101,4 +101,4 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||
| tertiary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||
|
||||
@@ -54,6 +54,6 @@ Feature: Bike - Surfaces
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | b | ab,ab | cycling,cycling | 15 km/h |
|
||||
| b | a | ab,ab | pushing bike,pushing bike | 6 km/h |
|
||||
| c | d | cd,cd | pushing bike,pushing bike | 6 km/h |
|
||||
| d | c | cd,cd | pushing bike,pushing bike | 6 km/h |
|
||||
| b | a | ab,ab | pushing bike,pushing bike | 4 km/h |
|
||||
| c | d | cd,cd | pushing bike,pushing bike | 4 km/h |
|
||||
| d | c | cd,cd | pushing bike,pushing bike | 4 km/h |
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
@routing @car @way
|
||||
Feature: Car - Avoid defined areas
|
||||
|
||||
Background:
|
||||
Given the profile file "car" initialized with
|
||||
"""
|
||||
profile.avoid = Set { 'motorway', 'motorway_link' }
|
||||
profile.speeds = Sequence {
|
||||
highway = {
|
||||
motorway = 90,
|
||||
motorway_link = 45,
|
||||
primary = 50
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
Scenario: Car - Avoid motorways
|
||||
Then routability should be
|
||||
| highway | bothw |
|
||||
| motorway | |
|
||||
| motorway_link | |
|
||||
| primary | x |
|
||||
|
||||
@@ -45,3 +45,11 @@ Feature: Car - Barriers
|
||||
| bollard | | |
|
||||
| bollard | rising | x |
|
||||
| bollard | removable | |
|
||||
|
||||
Scenario: Car - Height restrictions
|
||||
Then routability should be
|
||||
| node/barrier | node/maxheight | bothw |
|
||||
| height_restrictor | | x |
|
||||
| height_restrictor | 1 | |
|
||||
| height_restrictor | 3 | x |
|
||||
| height_restrictor | default | x |
|
||||
|
||||
@@ -82,7 +82,7 @@ Feature: Car - Mode flag
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | ab,cd | depart,arrive| [(restricted),(motorway,restricted),()],[()] |
|
||||
|
||||
Scenario: Car - We toll restricted with a class
|
||||
Scenario: Car - We tag toll with a class
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
@@ -99,6 +99,45 @@ Feature: Car - Mode flag
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | ab,cd | depart,arrive | [(toll),(motorway,toll),()],[()] |
|
||||
|
||||
Scenario: Car - We tag tunnel with a class
|
||||
Background:
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | tunnel |
|
||||
| ab | no |
|
||||
| bc | yes |
|
||||
| cd | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] |
|
||||
|
||||
Scenario: Car - We tag classes without intersections
|
||||
Background:
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | tunnel |
|
||||
| ab | road | |
|
||||
| bc | road | yes |
|
||||
| cd | road | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | road,road | depart,arrive | [(),(tunnel),()],[()] |
|
||||
|
||||
Scenario: Car - From roundabout on toll road
|
||||
Given the node map
|
||||
"""
|
||||
@@ -124,4 +163,3 @@ Feature: Car - Mode flag
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | f | ab,df,df,df | depart,roundabout-exit-2,exit roundabout slight right,arrive | [()],[(),(motorway)],[(toll,motorway)],[()] |
|
||||
|
||||
|
||||
@@ -691,14 +691,14 @@ Feature: Car - Turn restrictions
|
||||
# """
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 38.9113 | -77.0091 |
|
||||
| b | 38.9108 | -77.0091 |
|
||||
| c | 38.9104 | -77.0091 |
|
||||
| d | 38.9110 | -77.0096 |
|
||||
| e | 38.9106 | -77.0086 |
|
||||
| f | 38.9105 | -77.0090 |
|
||||
| g | 38.9108 | -77.0090 |
|
||||
| h | 38.9113 | -77.0090 |
|
||||
| a | 38.91124 | -77.00909 |
|
||||
| b | 38.91080 | -77.00909 |
|
||||
| c | 38.91038 | -77.00909 |
|
||||
| d | 38.91105 | -77.00967 |
|
||||
| e | 38.91037 | -77.00807 |
|
||||
| f | 38.91036 | -77.00899 |
|
||||
| g | 38.91076 | -77.00901 |
|
||||
| h | 38.91124 | -77.00900 |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | name |
|
||||
@@ -719,7 +719,7 @@ Feature: Car - Turn restrictions
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,continue uturn,arrive |
|
||||
| f | d | cap north,florida,florida nw | depart,turn left,arrive |
|
||||
| f | d | cap north,florida nw,florida nw | depart,turn left,arrive |
|
||||
| e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive |
|
||||
|
||||
@no_turning @conditionals
|
||||
@@ -738,14 +738,14 @@ Feature: Car - Turn restrictions
|
||||
# """
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 38.9113 | -77.0091 |
|
||||
| b | 38.9108 | -77.0091 |
|
||||
| c | 38.9104 | -77.0091 |
|
||||
| d | 38.9110 | -77.0096 |
|
||||
| e | 38.9106 | -77.0086 |
|
||||
| f | 38.9105 | -77.0090 |
|
||||
| g | 38.9108 | -77.0090 |
|
||||
| h | 38.9113 | -77.0090 |
|
||||
| a | 38.91124 | -77.00909 |
|
||||
| b | 38.91080 | -77.00909 |
|
||||
| c | 38.91038 | -77.00909 |
|
||||
| d | 38.91105 | -77.00967 |
|
||||
| e | 38.91037 | -77.00807 |
|
||||
| f | 38.91036 | -77.00899 |
|
||||
| g | 38.91076 | -77.00901 |
|
||||
| h | 38.91124 | -77.00900 |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | name |
|
||||
@@ -765,7 +765,7 @@ Feature: Car - Turn restrictions
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | e | cap south,florida,florida ne | depart,turn left,arrive |
|
||||
| a | e | cap south,florida ne,florida ne | depart,turn left,arrive |
|
||||
| f | d | cap north,florida ne,florida ne,florida nw | depart,turn sharp right,continue uturn,arrive |
|
||||
| e | c | florida ne,cap south,cap south | depart,turn left,arrive |
|
||||
|
||||
@@ -884,7 +884,7 @@ Feature: Car - Turn restrictions
|
||||
| a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive |
|
||||
| a | e | albic,dobe,dobe | depart,turn left,arrive |
|
||||
|
||||
@no_turning @conditionals
|
||||
@no_turning @conditionals @restriction-way
|
||||
Scenario: Car - Conditional restriction with multiple time windows
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# 5pm Wed 02 May, 2017 GMT
|
||||
@@ -1054,4 +1054,3 @@ Feature: Car - Turn restrictions
|
||||
| a | f | ab,be,ef,ef | depart,turn right,turn left,arrive | a,b,e,f |
|
||||
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||
|
||||
|
||||
@@ -131,3 +131,58 @@ Feature: Car - Destination only, no passing through
|
||||
| e | a | acbe,acbe |
|
||||
| d | a | de,acbe,acbe |
|
||||
| c | d | cd,cd |
|
||||
|
||||
Scenario: Car - Routing through a parking lot tagged access=destination,service
|
||||
Given the node map
|
||||
"""
|
||||
a----c++++b+++g------h---i
|
||||
| + + + /
|
||||
| + + + /
|
||||
| + + + /
|
||||
| d++++e+f /
|
||||
z--------------y
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | access | highway |
|
||||
| ac | | secondary |
|
||||
| ghi | | secondary |
|
||||
| azyhi | | secondary |
|
||||
| cd | destination | service |
|
||||
| def | destination | service |
|
||||
| cbg | destination | service |
|
||||
| be | destination | service |
|
||||
| gf | destination | service |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | i | azyhi,azyhi |
|
||||
| b | f | be,def,def |
|
||||
| b | i | cbg,ghi,azyhi,azyhi |
|
||||
|
||||
Scenario: Car - Disallow snapping to access=private,highway=service
|
||||
Given a grid size of 20 meters
|
||||
Given the node map
|
||||
"""
|
||||
a---c---b
|
||||
:
|
||||
x
|
||||
:
|
||||
d
|
||||
\__e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | access | highway |
|
||||
| acb | | primary |
|
||||
| cx | private | service |
|
||||
| xd | private | service |
|
||||
| de | | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | x | acb,xd,xd |
|
||||
| a | d | acb,xd,xd |
|
||||
| a | e | acb,xd,de |
|
||||
| x | e | de,de |
|
||||
# do not snap to access=private,highway=service roads when routing over them is not necessary
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
@routing @car
|
||||
Feature: Car - Handle physical limitation
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Use a narrow way
|
||||
Then routability should be
|
||||
| highway | width | narrow | bothw |
|
||||
| primary | | | x |
|
||||
| primary | narrow | | x |
|
||||
| primary | | yes | x |
|
||||
| primary | 1.8 | | |
|
||||
| primary | 1.9 | | |
|
||||
| primary | 2.0 | | x |
|
||||
| primary | 2.1 | | x |
|
||||
| primary | 1m | | |
|
||||
| primary | 1 m | | |
|
||||
| primary | 3 m | | x |
|
||||
| primary | 6' | | |
|
||||
| primary | 6'0" | | |
|
||||
| primary | 6'2" | | |
|
||||
| primary | 6'3" | | x |
|
||||
| primary | 7' | | x |
|
||||
| primary | 7'0" | | x |
|
||||
|
||||
Scenario: Car - Limited by width
|
||||
Then routability should be
|
||||
| highway | maxwidth:physical | maxwidth | width | est_width | bothw |
|
||||
| primary | 1 | | | | |
|
||||
| primary | 3 | | | | x |
|
||||
| primary | | 1 | | | |
|
||||
| primary | | 3 | | | x |
|
||||
| primary | | | 1 | | |
|
||||
| primary | | | 3 | | x |
|
||||
| primary | | | | 1 | |
|
||||
| primary | | | | 3 | x |
|
||||
|
||||
Scenario: Car - Limited by height
|
||||
Then routability should be
|
||||
| highway | maxheight:physical | maxheight | bothw |
|
||||
| primary | | | x |
|
||||
| primary | 1 | | |
|
||||
| primary | 3 | | x |
|
||||
| primary | | 1 | |
|
||||
| primary | | 3 | x |
|
||||
| primary | | default | x |
|
||||
| primary | | none | x |
|
||||
| primary | | no-sign | x |
|
||||
| primary | | unsigned | x |
|
||||
|
||||
Scenario: Car - Limited by length
|
||||
Then routability should be
|
||||
| highway | maxlength | bothw |
|
||||
| primary | | x |
|
||||
| primary | 1 | |
|
||||
| primary | 5 | x |
|
||||
| primary | unsigned | x |
|
||||
|
||||
Scenario: Car - Limited by weight
|
||||
Then routability should be
|
||||
| highway | maxweight | bothw |
|
||||
| primary | | x |
|
||||
| primary | 1 | |
|
||||
| primary | 3.5 | x |
|
||||
| primary | 35000 kg | x |
|
||||
| primary | 8.9t | x |
|
||||
| primary | 0.1 lbs | |
|
||||
| primary | unsigned | x |
|
||||
@@ -141,6 +141,33 @@ Feature: Car - Turn restrictions
|
||||
| c | a | cj,aj,aj |
|
||||
| c | b | cj,bj,bj |
|
||||
|
||||
@no_turning
|
||||
Scenario: Car - Ignore no_*_on_red relations
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d j b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| cj | yes |
|
||||
| aj | -1 |
|
||||
| dj | -1 |
|
||||
| bj | -1 |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | cj | dj | j | no_turn_on_red |
|
||||
| restriction | cj | bj | j | no_right_turn_on_red |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| c | d | cj,dj,dj |
|
||||
| c | a | cj,aj,aj |
|
||||
| c | b | cj,bj,bj |
|
||||
|
||||
@only_turning
|
||||
Scenario: Car - Only left turn
|
||||
Given the node map
|
||||
@@ -575,7 +602,7 @@ Feature: Car - Turn restrictions
|
||||
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||
|
||||
@restriction @overlap
|
||||
@restriction-way @overlap
|
||||
Scenario: Car - prohibit turn
|
||||
Given the node map
|
||||
"""
|
||||
@@ -710,7 +737,7 @@ Feature: Car - Turn restrictions
|
||||
| a | j | left,first,right,right |
|
||||
| f | e | right,third,left,left |
|
||||
|
||||
@restriction
|
||||
@restriction-way
|
||||
Scenario: Car - allow only turn
|
||||
Given the node map
|
||||
"""
|
||||
@@ -742,7 +769,7 @@ Feature: Car - Turn restrictions
|
||||
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||
|
||||
@restriction
|
||||
@restriction-way
|
||||
Scenario: Car - allow only turn
|
||||
Given the node map
|
||||
"""
|
||||
@@ -771,7 +798,7 @@ Feature: Car - Turn restrictions
|
||||
| from | to | route |
|
||||
| a | d | ab,be,de,de |
|
||||
|
||||
@restriction
|
||||
@restriction-way
|
||||
Scenario: Multi Way restriction
|
||||
Given the node map
|
||||
"""
|
||||
@@ -808,7 +835,7 @@ Feature: Car - Turn restrictions
|
||||
| from | to | route |
|
||||
| a | h | horiz,vert,horiz,horiz |
|
||||
|
||||
@restriction
|
||||
@restriction-way
|
||||
Scenario: Multi-Way overlapping single-way
|
||||
Given the node map
|
||||
"""
|
||||
@@ -847,7 +874,7 @@ Feature: Car - Turn restrictions
|
||||
| h | d | hfb,abcd,abcd | depart,end of road right,arrive | h,b,d |
|
||||
|
||||
|
||||
@restriction
|
||||
@restriction-way
|
||||
Scenario: Car - prohibit turn, traffic lights
|
||||
Given the node map
|
||||
"""
|
||||
@@ -890,7 +917,7 @@ Feature: Car - Turn restrictions
|
||||
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
||||
|
||||
|
||||
@restriction @overlap @geometry
|
||||
@restriction-way @overlap @geometry
|
||||
Scenario: Geometry
|
||||
Given the node map
|
||||
"""
|
||||
@@ -925,7 +952,7 @@ Feature: Car - Turn restrictions
|
||||
| c | d | bc,bge,de,de |
|
||||
| c | f | bc,bge,de,de,ef,ef |
|
||||
|
||||
@restriction @overlap @geometry @traffic-signals
|
||||
@restriction-way @overlap @geometry @traffic-signals
|
||||
Scenario: Geometry
|
||||
Given the node map
|
||||
"""
|
||||
@@ -967,7 +994,7 @@ Feature: Car - Turn restrictions
|
||||
| c | f | bc,bge,de,de,ef,ef |
|
||||
|
||||
# don't crash hard on invalid restrictions
|
||||
@restriction @invalid
|
||||
@restriction-way @invalid
|
||||
Scenario: Geometry
|
||||
Given the node map
|
||||
"""
|
||||
@@ -999,7 +1026,7 @@ Feature: Car - Turn restrictions
|
||||
| a | f | ab,be,ef,ef |
|
||||
|
||||
|
||||
@restriction @overlap @geometry
|
||||
@restriction @restriction-way @overlap @geometry
|
||||
Scenario: Duplicated restriction
|
||||
Given the node map
|
||||
"""
|
||||
@@ -1034,3 +1061,28 @@ Feature: Car - Turn restrictions
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | ab,bc,bc,bge,de,de |
|
||||
|
||||
|
||||
Scenario: Ambiguous ways
|
||||
Given the node map
|
||||
"""
|
||||
x---a----b-----c---z
|
||||
|
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| bd |
|
||||
| xa |
|
||||
| cz |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | abc | b | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| d | x | bd,abc,xa,xa |
|
||||
| d | z | bd,abc,cz,cz |
|
||||
|
||||
@@ -116,3 +116,28 @@ Feature: Testbot - side bias
|
||||
| from | to | route | driving_side | time |
|
||||
| d | a | bd,ab,ab | right,right,right | 27s +-1 |
|
||||
| d | c | bd,bc,bc | right,right,right | 24s +-1 |
|
||||
|
||||
Scenario: changing sides
|
||||
Given the profile "car"
|
||||
|
||||
# Note - the boundary in null-island.geojson is at lon = 2.0,
|
||||
# and we use the "last node of the way" as the heuristic to detect
|
||||
# whether the way is in our out of the driving_side polygon
|
||||
And the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0 | 0.5 |
|
||||
| b | 0 | 1.5 |
|
||||
| c | 0 | 2.5 |
|
||||
| d | 0 | 3.5 |
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| cd |
|
||||
|
||||
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
|
||||
When I route I should get
|
||||
| from | to | route | driving_side |
|
||||
| d | a | cd,bc,ab,ab | right,right,left,left |
|
||||
| a | d | ab,bc,cd,cd | left,right,right,right |
|
||||
|
||||
@@ -76,7 +76,7 @@ Feature: Basic Routing
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | summary |
|
||||
| a,c | , | 100, 101 |
|
||||
| a,c | ,, | 100, 101 |
|
||||
|
||||
Scenario: Single Ref
|
||||
Given the node map
|
||||
|
||||
@@ -19,7 +19,7 @@ Feature: Barriers
|
||||
| entrance | x |
|
||||
| wall | |
|
||||
| fence | |
|
||||
| some_tag | |
|
||||
| some_tag | x |
|
||||
| block | x |
|
||||
|
||||
Scenario: Foot - Access tag trumphs barriers
|
||||
|
||||
@@ -22,11 +22,11 @@ Feature: Bike - Mode flag
|
||||
| c | traffic_signals |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway:bicycle |
|
||||
| abcd | cycleway | street | |
|
||||
| eb | path | | yes |
|
||||
| icef | tertiary | road | |
|
||||
| geh | secondary | street | |
|
||||
| nodes | highway | name | oneway:bicycle | maxspeed:forward |
|
||||
| abcd | cycleway | street | | 4 km/h |
|
||||
| eb | path | | yes | |
|
||||
| icef | tertiary | road | | 4 km/h |
|
||||
| geh | secondary | street | | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
|
||||
@@ -98,11 +98,11 @@ Feature: Car - Guidance - Bridges and Tunnels
|
||||
| dce | primary | | Nebenstraße |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,arrive |
|
||||
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,arrive |
|
||||
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
|
||||
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
|
||||
| from | to | route | turns |
|
||||
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road left,arrive |
|
||||
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road right,arrive |
|
||||
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
|
||||
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
|
||||
|
||||
Scenario: Tunnel with Immediate Turn Front and Back
|
||||
Given the node map
|
||||
@@ -129,4 +129,3 @@ Feature: Car - Guidance - Bridges and Tunnels
|
||||
| e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn left,arrive |
|
||||
| d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn right,arrive |
|
||||
| d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn left,arrive |
|
||||
|
||||
|
||||
@@ -35,20 +35,20 @@ Feature: Collapse
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Single Street
|
||||
Given the node map
|
||||
@@ -74,7 +74,7 @@ Feature: Collapse
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,i | first,second,third,third | depart,turn left,turn slight left,arrive | a,b,e,i |
|
||||
| a,i | first,third,third | depart,turn sharp left,arrive | a,b,i |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Correct Street
|
||||
Given the node map
|
||||
@@ -106,20 +106,20 @@ Feature: Collapse
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets
|
||||
Given the node map
|
||||
@@ -151,20 +151,20 @@ Feature: Collapse
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
||||
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||
Given the node map
|
||||
@@ -209,11 +209,11 @@ Feature: Collapse
|
||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
||||
| g,j | second,second | depart,arrive | g,j |
|
||||
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
|
||||
| g,f | second,first,first | depart,turn left,arrive | g,b,f |
|
||||
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
||||
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
||||
| i,h | second,second | depart,arrive | i,h |
|
||||
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
|
||||
| i,c | second,first,first | depart,turn left,arrive | i,e,c |
|
||||
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
||||
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||
@@ -263,11 +263,11 @@ Feature: Collapse
|
||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
||||
| g,j | second,second | depart,arrive | g,j |
|
||||
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
|
||||
| g,f | second,first,first | depart,turn left,arrive | g,b,f |
|
||||
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
||||
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
||||
| i,h | second,second | depart,arrive | i,h |
|
||||
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
|
||||
| i,c | second,first,first | depart,turn left,arrive | i,e,c |
|
||||
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles
|
||||
@@ -300,20 +300,20 @@ Feature: Collapse
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2)
|
||||
Given the node map
|
||||
@@ -345,28 +345,29 @@ Feature: Collapse
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
|
||||
|
||||
Scenario: Entering a segregated road
|
||||
Given the node map
|
||||
"""
|
||||
a f g
|
||||
| | . '
|
||||
b-e '
|
||||
/ /
|
||||
h
|
||||
a f | g
|
||||
| | i '
|
||||
b-e ' |
|
||||
/ / j
|
||||
/ /
|
||||
c d
|
||||
"""
|
||||
@@ -376,7 +377,8 @@ Feature: Collapse
|
||||
| abc | primary | first | yes |
|
||||
| def | primary | first | yes |
|
||||
| be | primary | first | no |
|
||||
| ge | primary | second | no |
|
||||
| gie | primary | second | no |
|
||||
| hij | primary | maple | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
@@ -385,7 +387,7 @@ Feature: Collapse
|
||||
| a,g | first,second,second | depart,turn left,arrive | a,b,g |
|
||||
| d,g | first,second,second | depart,turn right,arrive | d,e,g |
|
||||
| g,f | second,first,first | depart,turn right,arrive | g,e,f |
|
||||
| g,c | second,first,first | depart,turn left,arrive | g,e,c |
|
||||
| g,c | second,first,first | depart,end of road left,arrive | g,e,c |
|
||||
|
||||
Scenario: Do not collapse turning roads
|
||||
Given the node map
|
||||
@@ -603,7 +605,7 @@ Feature: Collapse
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| i,h | in,road,road | depart,turn left,arrive | i,f,h |
|
||||
| i,h | in,road,road | depart,turn slight left,arrive | i,c,h |
|
||||
| a,d | road,road | depart,arrive | a,d |
|
||||
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j |
|
||||
|
||||
@@ -1010,7 +1012,7 @@ Feature: Collapse
|
||||
| f,j | hohe,hohe | depart,arrive | f,j |
|
||||
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
|
||||
| f,e | | | |
|
||||
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j |
|
||||
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,i,j |
|
||||
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
|
||||
|
||||
Scenario: Forking before a turn (forky)
|
||||
|
||||
@@ -687,7 +687,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive | s,a,e,f |
|
||||
| s,f | sabc,ae,dbef,dbef | depart,fork slight right,turn right,arrive | s,a,e,f |
|
||||
|
||||
@sliproads
|
||||
Scenario: Traffic Signal on Sliproad
|
||||
@@ -992,7 +992,6 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| dbef | primary | dbef | |
|
||||
| ae | primary_link | ae | yes |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
|
||||
@@ -1019,7 +1018,6 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| dbcf | primary | dbcf | |
|
||||
| ac | primary_link | ae | yes |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sab,dbcf,dbcf | depart,turn right,arrive | s,a,f |
|
||||
@@ -1047,7 +1045,55 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| ae | primary_link | sab | yes |
|
||||
| cg | primary | cg | |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sab,dbcef,dbcef | depart,turn right,arrive | s,a,f |
|
||||
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad converted from a fork
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
b
|
||||
s . a '.
|
||||
`c
|
||||
.
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | ref | oneway |
|
||||
| sa | tertiary | | D 60A | yes |
|
||||
| ab | tertiary | ab | D 60A | yes |
|
||||
| ac | tertiary | | D 60A | yes |
|
||||
| dbcf | tertiary | dbcf | D 543 | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | ,dbcf,dbcf | depart,turn right,arrive | s,a,f |
|
||||
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad to a road with a reference only
|
||||
Given the node map
|
||||
"""
|
||||
s . a . b . d
|
||||
` .
|
||||
' .
|
||||
..
|
||||
c
|
||||
.
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | ref | oneway |
|
||||
| sabd | primary | road | | |
|
||||
| bcf | primary | | K108 | |
|
||||
| ac | primary_link | | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | road,, | depart,turn right,arrive | s,a,f |
|
||||
|
||||
@@ -13,19 +13,23 @@ Feature: Divided road entry
|
||||
d-------e-----f
|
||||
|
|
||||
|
|
||||
g
|
||||
i---g---j
|
||||
|
|
||||
|
|
||||
h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| abc | main st | residential | -1 |
|
||||
| def | main st | residential | yes |
|
||||
| be | main st | residential | |
|
||||
| eg | side st | residential | |
|
||||
| nodes | name | highway | oneway |
|
||||
| abc | main st | residential | -1 |
|
||||
| def | main st | residential | yes |
|
||||
| be | main st | residential | |
|
||||
| egh | side st | residential | |
|
||||
| igj | maple st | residential | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,a | side st,main st,main st| depart,end of road left,arrive |
|
||||
| h,a | side st,main st,main st| depart,end of road left,arrive |
|
||||
|
||||
|
||||
# Similar to previous one, but the joining way is tagged with the side-street name
|
||||
@@ -37,18 +41,22 @@ Feature: Divided road entry
|
||||
d-------e-----f
|
||||
|
|
||||
|
|
||||
g
|
||||
i---g---j
|
||||
|
|
||||
|
|
||||
h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| abc | main st | residential | -1 |
|
||||
| def | main st | residential | yes |
|
||||
| beg | side st | residential | |
|
||||
| nodes | name | highway | oneway |
|
||||
| abc | main st | residential | -1 |
|
||||
| def | main st | residential | yes |
|
||||
| begh | side st | residential | |
|
||||
| igj | maple st | residential | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,a | side st,main st,main st| depart,end of road left,arrive |
|
||||
| h,a | side st,main st,main st| depart,end of road left,arrive |
|
||||
|
||||
|
||||
# Center join named after crossroad
|
||||
@@ -100,3 +108,32 @@ Feature: Divided road entry
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,a | side st,main st,main st| depart,turn left,arrive |
|
||||
|
||||
# Verify end of road left turn across divided roads
|
||||
Scenario: Join on a divided road, named after the side street
|
||||
Given the node map
|
||||
"""
|
||||
a-----h--b-----c
|
||||
| |
|
||||
d-----i--e-----f
|
||||
| |
|
||||
| |
|
||||
m---j--g---n
|
||||
| |
|
||||
| |
|
||||
k l
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ahbc | main st | residential | -1 |
|
||||
| dief | main st | residential | yes |
|
||||
| begl | side st | residential | -1 |
|
||||
| hijk | side st | residential | yes |
|
||||
| mjgn | maple st| residential | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| l,a | side st,main st,main st| depart,end of road left,arrive |
|
||||
|
||||
|
||||
|
||||
@@ -46,3 +46,23 @@ Feature: Driveways intersections
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,d | ,second | depart,arrive | a,d |
|
||||
|
||||
|
||||
Scenario: Road with a turn to service road
|
||||
Given the node map
|
||||
"""
|
||||
/-----------------e
|
||||
a---b------------------c
|
||||
`-----------------d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | trunk | road | yes |
|
||||
| bd | service | serv | yes |
|
||||
| be | service | serv | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,d | road,serv,serv | depart,turn slight right,arrive | a,b,d |
|
||||
| a,e | road,serv,serv | depart,turn slight left,arrive | a,b,e |
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
@guidance
|
||||
Feature: Internal Intersection Model
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Dual-carriage way intersection
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
| |
|
||||
c--d--e--f
|
||||
| |
|
||||
g--h--i--j
|
||||
| |
|
||||
k l
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | name |
|
||||
| adhk | yes | Broken Land Parkway |
|
||||
| lieb | yes | Broken Land Parkway |
|
||||
| fed | yes | Snowden River Parkway |
|
||||
| dc | yes | Patuxent Woods Drive |
|
||||
| gh | yes | Patuxent Woods Drive |
|
||||
| hij | yes | Snowden River Parkway |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | # |
|
||||
| a,k | Broken Land Parkway,Broken Land Parkway | depart,arrive ||
|
||||
| l,b | Broken Land Parkway,Broken Land Parkway | depart,arrive ||
|
||||
# | g,j | Patuxent Woods Drive,Snowden River Parkway,Snowden River Parkway | depart,continue,arrive | did not work as expected - might be another issue to handle in post process? |
|
||||
# | f,c | Snowden River Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,continue,arrive | did not work as expected - might be another issue to handle in post process? |
|
||||
| a,c | Broken Land Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,turn right,arrive ||
|
||||
| g,k | Patuxent Woods Drive,Broken Land Parkway,Broken Land Parkway | depart,turn right,arrive ||
|
||||
| l,j | Broken Land Parkway,Snowden River Parkway,Snowden River Parkway | depart,turn right,arrive ||
|
||||
| f,b | Snowden River Parkway,Broken Land Parkway,Broken Land Parkway | depart,turn right,arrive ||
|
||||
| a,j | Broken Land Parkway,Snowden River Parkway,Snowden River Parkway | depart,turn left,arrive ||
|
||||
| g,b | Patuxent Woods Drive,Broken Land Parkway,Broken Land Parkway | depart,turn left,arrive ||
|
||||
| l,c | Broken Land Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,turn left,arrive ||
|
||||
| f,k | Snowden River Parkway,Broken Land Parkway,Broken Land Parkway | depart,turn left,arrive ||
|
||||
| a,b | Broken Land Parkway,Broken Land Parkway,Broken Land Parkway | depart,continue uturn,arrive ||
|
||||
| g,c | Patuxent Woods Drive,Patuxent Woods Drive,Patuxent Woods Drive | depart,continue uturn,arrive ||
|
||||
| l,k | Broken Land Parkway,Broken Land Parkway,Broken Land Parkway | depart,continue uturn,arrive ||
|
||||
| f,j | Snowden River Parkway,Snowden River Parkway,Snowden River Parkway | depart,continue uturn,arrive ||
|
||||
@@ -64,9 +64,9 @@ Feature: Exceptions for routing onto low-priority roads
|
||||
| bc | service | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| e,c | service, | depart,arrive |
|
||||
| c,e | ,service,service | depart,turn straight,arrive |
|
||||
| waypoints | route | turns |
|
||||
| e,c | service, | depart,arrive |
|
||||
| c,e | ,service | depart,arrive |
|
||||
|
||||
Scenario: Straight onto low-priority
|
||||
Given the node map
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
# The route results with #original are what the result should be if the maneuver tag is removed
|
||||
@routing @guidance @maneuver
|
||||
Feature: Maneuver tag support
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 5 meters
|
||||
|
||||
Scenario: simple override #1
|
||||
Given the node map
|
||||
"""
|
||||
a--b---c----d---e
|
||||
|
|
||||
g
|
||||
|
|
||||
h------i--------j
|
||||
"""
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| abc | A Street | no |
|
||||
| cde | B Street | no |
|
||||
| cgi | C Street | no |
|
||||
| hij | J Street | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | node:via | way:to | maneuver | direction |
|
||||
| maneuver | abc | c | cgi | turn | sharp_right |
|
||||
| maneuver | hij | i | cde | turn | sharp_left |
|
||||
| maneuver | abc | c | cde | turn | slight_left |
|
||||
| maneuver | cde | c | cgi | turn | straight |
|
||||
| manoeuvre| cgi | c | abc | turn | right |
|
||||
|
||||
And the relations
|
||||
| type | way:from | node:via | way:to | manoeuvre | maneuver | direction |
|
||||
| maneuver | cgi | c | cde | fork | turn | slight_right |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
# Testing directly connected from/to
|
||||
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,turn left,arrive |
|
||||
| b,g | A Street,C Street,C Street | depart,turn sharp right,arrive |
|
||||
# Testing re-awakening suppressed turns
|
||||
| a,e | A Street,B Street,B Street | depart,turn slight left,arrive |
|
||||
| e,i | B Street,C Street,C Street | depart,turn straight,arrive |
|
||||
| i,e | C Street,B Street,B Street | depart,fork slight right,arrive |
|
||||
| i,a | C Street,A Street,A Street | depart,turn right,arrive |
|
||||
|
||||
Scenario: single via-way
|
||||
Given the node map
|
||||
""""
|
||||
a--b---c----d---e
|
||||
|
|
||||
g
|
||||
|
|
||||
h------i--------j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| abc | A Street | no |
|
||||
| cde | B Street | no |
|
||||
| cgi | C Street | no |
|
||||
| hi | J Street | no |
|
||||
| ij | J Street | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:via | way:to | node:via | maneuver | direction |
|
||||
| maneuver | abc | cgi | ij | c | turn | sharp_right |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,turn left,arrive |
|
||||
|
||||
|
||||
Scenario: multiple via-way
|
||||
Given the node map
|
||||
""""
|
||||
a--b---c----d---e
|
||||
|
|
||||
g-----k
|
||||
|
|
||||
h------i--------j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| abc | A Street | no |
|
||||
| cde | B Street | no |
|
||||
| cg | C Street | no |
|
||||
| gi | C Street | no |
|
||||
| hi | J Street | no |
|
||||
| ij | J Street | no |
|
||||
| gk | G Street | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:via | way:via | way:to | node:via | maneuver | direction |
|
||||
| maneuver | abc | cg | gi | ij | c | turn | sharp_right |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,end of road left,arrive |
|
||||
|
||||
|
||||
Scenario: Use maneuver tag to announce a particular turn type
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
t. .. * h
|
||||
.. ....m** *
|
||||
/ * *
|
||||
/ * * *
|
||||
/
|
||||
/
|
||||
|
|
||||
|
|
||||
\
|
||||
\
|
||||
o
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
| fm | CA-120 | no | secondary |
|
||||
| mh | CA-120 | no | secondary |
|
||||
| mt | Priest Rd | no | unclassified |
|
||||
| mo | | no | service |
|
||||
|
||||
And the relations
|
||||
| type | way:from | node:via | way:to | maneuver | direction |
|
||||
| maneuver | mh | m | mt | turn | left |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| h,t | CA-120,Priest Rd,Priest Rd | depart,turn left,arrive |
|
||||
#original | h,t | CA-120,Priest Rd,Priest Rd | depart,turn straight,arrive |
|
||||
|
||||
Scenario: Use maneuver tag to announce lane guidance
|
||||
Given a grid size of 10 meters
|
||||
Given the node map
|
||||
"""
|
||||
ad
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
b-----c------e
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
r w
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
| ab | Marsh Rd | yes | secondary |
|
||||
| br | Marsh Rd | yes | secondary |
|
||||
| cd | Marsh Rd | yes | secondary |
|
||||
| cw | Marsh Rd | yes | secondary |
|
||||
| bc | service | no | service |
|
||||
| ce | service | no | service |
|
||||
|
||||
And the relations
|
||||
| type | way:from | node:via | way:via | way:to | maneuver |
|
||||
| maneuver | ab | c | bc | cd | uturn |
|
||||
| maneuver | ab | b | bc | cd | suppress |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | Marsh Rd,Marsh Rd,Marsh Rd | depart,turn uturn,arrive |
|
||||
#original | a,d | Marsh Rd,service,Marsh Rd,Marsh Rd | depart,turn left,turn left,arrive |
|
||||
|
||||
Scenario: Use maneuver tag to suppress a turn
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
|
|
||||
|
|
||||
v---y----------z
|
||||
|
|
||||
n---p----------k
|
||||
|\
|
||||
| \
|
||||
b t
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
| zy | NY Ave | yes | primary |
|
||||
| yv | NY Ave | yes | primary |
|
||||
| np | NY Ave | yes | primary |
|
||||
| pk | NY Ave | yes | primary |
|
||||
| cp | 4th St | no | tertiary |
|
||||
| yp | | no | motorway_link |
|
||||
| pb | 4th St | no | primary |
|
||||
| pt | 395 | no | primary |
|
||||
|
||||
And the relations
|
||||
| type | way:from | node:via | way:via | way:to | maneuver | # |
|
||||
| maneuver | zy | p | yp | pt | suppress | original: depart,on ramp left,fork slight left,arrive |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:via | way:to | maneuver | # |
|
||||
| maneuver | zy | yp | pb | suppress | invalid relation: missing node:via |
|
||||
|
||||
And the relations
|
||||
| type | node:via | way:via | way:to | maneuver | # |
|
||||
| maneuver | p | yp | pb | suppress | invalid relation: missing way:from |
|
||||
|
||||
And the relations
|
||||
| type | way:from | node:via | way:via | maneuver | # |
|
||||
| maneuver | zy | p | yp | suppress | invalid relation: missing way:to |
|
||||
|
||||
And the relations
|
||||
| type | way:from | node:via | way:via | way:to | maneuver | # |
|
||||
| maneuver | zy | y, p | yp | pb | suppress | invalid relation: multiple node:via |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| z,t | NY Ave,395,395 | depart,on ramp left,arrive |
|
||||
| z,b | NY Ave,,4th St,4th St | depart,on ramp left,fork slight right,arrive |
|
||||
@@ -384,40 +384,53 @@ Feature: Merge Segregated Roads
|
||||
| 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 |
|
||||
| waypoints | route | intersections |
|
||||
| a,d | left,circle,right,right | true:90,false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
|
||||
| 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
|
||||
b-----z
|
||||
/ \
|
||||
c h
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
d g
|
||||
\ /
|
||||
e
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bcde | road | yes |
|
||||
| eghb | road | yes |
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bcde | road | yes |
|
||||
| eghb | road | yes |
|
||||
| bz | cross | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bz | bcde | b | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| 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 |
|
||||
| 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 |
|
||||
| z,a | depart,turn right,arrive | cross,road,road |
|
||||
|
||||
Scenario: Traffic Island
|
||||
Given the node map
|
||||
@@ -588,10 +601,10 @@ Feature: Merge Segregated Roads
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | germ,ober | depart,arrive |
|
||||
| a,g | germ,germ,germ | depart,continue right,arrive |
|
||||
| a,1 | germ,germ,germ | depart,continue left,arrive |
|
||||
| d,g | ober,germ,germ | depart,turn left,arrive |
|
||||
| a,c | germ,ober | depart,arrive |
|
||||
| a,g | germ,germ,germ | depart,continue right,arrive |
|
||||
| a,1 | germ,germ,germ | depart,continue left,arrive |
|
||||
| d,g | ober,germ,germ | depart,turn left,arrive |
|
||||
|
||||
# https://www.openstreetmap.org/#map=19/51.32888/6.57059
|
||||
Scenario: Places in presence of oneways
|
||||
@@ -623,16 +636,16 @@ Feature: Merge Segregated Roads
|
||||
| cf | albrecht | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,l | schwert,albrecht,marianne,marianne | depart,new name straight,turn left,arrive |
|
||||
| a,j | schwert,luise,luise | depart,turn right,arrive |
|
||||
| a,1 | schwert,albrecht,albrecht,albrecht | depart,new name straight,continue uturn,arrive |
|
||||
| k,l | marianne,marianne | depart,arrive |
|
||||
| k,j | marianne,albrecht,luise,luise | depart,turn left,turn left,arrive |
|
||||
| k,d | marianne,schwert,schwert | depart,turn right,arrive |
|
||||
| i,j | luise,luise | depart,arrive |
|
||||
| i,d | luise,albrecht,schwert,schwert | depart,turn left,turn straight,arrive |
|
||||
| i,l | luise,albrecht,marianne,marianne | depart,turn left,turn left,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,l | schwert,albrecht,marianne,marianne | depart,new name straight,turn left,arrive |
|
||||
| a,j | schwert,luise,luise | depart,turn right,arrive |
|
||||
| a,1 | schwert,albrecht,albrecht,albrecht | depart,new name straight,continue uturn,arrive |
|
||||
| k,l | marianne,marianne | depart,arrive |
|
||||
| k,j | marianne,albrecht,luise,luise | depart,turn left,turn left,arrive |
|
||||
| k,d | marianne,schwert,schwert | depart,turn right,arrive |
|
||||
| i,j | luise,luise | depart,arrive |
|
||||
| i,d | luise,albrecht,schwert | depart,turn left,arrive |
|
||||
| i,l | luise,albrecht,marianne,marianne | depart,turn left,turn left,arrive |
|
||||
|
||||
# https://www.openstreetmap.org/#map=19/52.46339/13.40272
|
||||
Scenario: Do not merge links between segregated roads
|
||||
|
||||
@@ -81,7 +81,7 @@ Feature: Motorway Guidance
|
||||
"""
|
||||
,g,e
|
||||
,f,d
|
||||
a-b-c
|
||||
a-b-c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -201,7 +201,7 @@ Feature: Motorway Guidance
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| f,e | fgc,abcde,abcde | depart,merge slight left,arrive |
|
||||
| a,i | abcde,chi,chi | depart,off ramp slight right,arrive |
|
||||
| f,i | fgc,chi,chi | depart,off ramp right,arrive |
|
||||
| f,i | fgc,chi,chi | depart,off ramp slight right,arrive |
|
||||
|
||||
Scenario: On And Off Ramp Left
|
||||
Given the node map
|
||||
@@ -221,7 +221,7 @@ Feature: Motorway Guidance
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| f,e | fgc,abcde,abcde | depart,merge slight right,arrive |
|
||||
| a,i | abcde,chi,chi | depart,off ramp slight left,arrive |
|
||||
| f,i | fgc,chi,chi | depart,off ramp left,arrive |
|
||||
| f,i | fgc,chi,chi | depart,off ramp slight left,arrive |
|
||||
|
||||
Scenario: Merging Motorways
|
||||
Given the node map
|
||||
@@ -281,3 +281,67 @@ Feature: Motorway Guidance
|
||||
| waypoints | route | turns |
|
||||
| a,d | , | depart,arrive |
|
||||
| b,d | , | depart,arrive |
|
||||
|
||||
|
||||
Scenario: Ramp Exit with Lower Priority
|
||||
Given the node map
|
||||
"""
|
||||
a-b-c-d-e
|
||||
`--f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abcde | trunk | |
|
||||
| bfg | primary_link | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abcde,abcde | depart,arrive |
|
||||
| a,g | abcde,bfg,bfg | depart,off ramp slight right,arrive |
|
||||
|
||||
|
||||
# https://www.openstreetmap.org/node/67366428#map=18/33.64613/-84.44425
|
||||
Scenario: Ramp Bifurcations should not be suppressed
|
||||
Given the node map
|
||||
"""
|
||||
/-----------c /-----------e
|
||||
a---b------------------d------------f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | destination |
|
||||
| ab | motorway | | |
|
||||
| bc | motorway_link | | City 17 |
|
||||
| bd | motorway_link | | |
|
||||
| de | motorway_link | | Domestic Terminal;Camp Creek Parkway;Riverdale Road |
|
||||
| df | motorway_link | | Montgomery |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ,, | depart,fork slight left,arrive |
|
||||
| a,e | ,,, | depart,fork slight right,fork slight left,arrive |
|
||||
| a,f | ,,, | depart,fork slight right,fork slight right,arrive |
|
||||
|
||||
|
||||
# https://www.openstreetmap.org/#map=19/53.46186/-2.24509
|
||||
Scenario: Highway Fork with a Link
|
||||
Given the node map
|
||||
"""
|
||||
/-----------d
|
||||
a-b-c------------e
|
||||
\-----------f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abce | motorway |
|
||||
| cf | motorway |
|
||||
| cd | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | abce,cd,cd | depart,off ramp slight left,arrive |
|
||||
| a,e | abce,abce | depart,arrive |
|
||||
| a,f | abce,cf,cf | depart,turn slight right,arrive |
|
||||
|
||||
@@ -382,6 +382,21 @@ Feature: New-Name Instructions
|
||||
| waypoints | route | turns |
|
||||
| a,c | , | depart,arrive |
|
||||
|
||||
Scenario: No Name, Reference changed
|
||||
Given the node map
|
||||
"""
|
||||
a ----- b ----- c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | ref | highway |
|
||||
| ab | | US 322 | motorway |
|
||||
| bc | | US 422 | motorway |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ,, | depart,new name straight,arrive |
|
||||
|
||||
Scenario: Spaces in refs for containment check, #3086
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -745,12 +745,15 @@ Feature: Basic Roundabout
|
||||
|
||||
|
||||
Scenario: Drive through roundabout
|
||||
Given a grid size of 5 meters
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b e d f
|
||||
c
|
||||
g h
|
||||
. a .
|
||||
. .
|
||||
b e --- d ---- f
|
||||
. .
|
||||
.c.
|
||||
g h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -760,12 +763,12 @@ Feature: Basic Roundabout
|
||||
| gch | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | turns |
|
||||
| e,f | 90 90 | edf,edf | depart,arrive |
|
||||
| e,h | 90 135 | edf,gch,gch,gch | depart,roundabout-exit-2,exit roundabout straight,arrive |
|
||||
| g,f | 45 90 | gch,edf,edf,edf | depart,roundabout-exit-2,exit roundabout right,arrive |
|
||||
| g,h | 45 135 | gch,gch,gch | depart,exit roundabout right,arrive |
|
||||
| e,e | 90 270 | edf,edf,edf | depart,continue uturn,arrive |
|
||||
| waypoints | bearings | route | turns |
|
||||
| e,f | 90 90 | edf,edf | depart,arrive |
|
||||
| e,h | 90 130 | edf,gch,gch,gch | depart,roundabout-exit-2,exit roundabout straight,arrive |
|
||||
| g,f | 50 90 | gch,edf,edf,edf | depart,roundabout-exit-2,exit roundabout slight right,arrive |
|
||||
| g,h | 50 130 | gch,gch,gch | depart,exit roundabout right,arrive |
|
||||
| e,e | 90 270 | edf,edf,edf,edf | depart,roundabout-exit-3,exit roundabout sharp left,arrive |
|
||||
|
||||
Scenario: CCW and CW roundabouts with overlaps
|
||||
Given the node map
|
||||
|
||||
@@ -848,6 +848,7 @@ Feature: Simple Turns
|
||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:195 true:270 true:345;true:90 |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
||||
# adjusted ways to reflect the case geometry for 2/3/2018
|
||||
Scenario: Curved Exit from Curved Road
|
||||
Given the node map
|
||||
"""
|
||||
@@ -874,16 +875,16 @@ Feature: Simple Turns
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | lanes | highway |
|
||||
| abcd | Siemens | no | 5 | secondary |
|
||||
| defg | Erna | no | 3 | secondary |
|
||||
| ab | Siemens | no | 5 | secondary |
|
||||
| bcdefg | Erna | no | 3 | secondary |
|
||||
| dhij | Siemens | no | | residential |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
|
||||
| a,g | Siemens,Erna | depart,arrive |
|
||||
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
|
||||
| g,a | Erna,Siemens | depart,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,j | Siemens,Siemens,Siemens | depart,turn slight right,arrive |
|
||||
| a,g | Siemens,Erna | depart,arrive |
|
||||
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
|
||||
| g,a | Erna,Siemens | depart,arrive |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.51303/13.32170
|
||||
Scenario: Ernst Reuter Platz
|
||||
@@ -961,12 +962,12 @@ Feature: Simple Turns
|
||||
g
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
f
|
||||
h .
|
||||
. .
|
||||
. j
|
||||
.
|
||||
.
|
||||
h f
|
||||
.
|
||||
. .
|
||||
. j
|
||||
. .
|
||||
c
|
||||
. . .
|
||||
|
||||
@@ -301,7 +301,7 @@ Feature: Turn Lane Guidance
|
||||
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, |
|
||||
| i,h | cross,road,road | depart,turn right,arrive | ,, |
|
||||
| i,j | cross,cross | depart,arrive | ;;left:false straight:true, |
|
||||
| i,l | cross,cross,cross | depart,continue uturn,arrive | ;,left:true straight:false;left:true straight:false;left:false straight:true, |
|
||||
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false;left:true straight:false;left:true straight:false;left:false straight:true, |
|
||||
|
||||
@partition-lanes
|
||||
Scenario: Turn Lanes at Segregated Road
|
||||
@@ -614,8 +614,9 @@ Feature: Turn Lane Guidance
|
||||
| |
|
||||
| |
|
||||
b d
|
||||
h c
|
||||
' -- g - - f
|
||||
h-----c
|
||||
| `-f
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -936,48 +937,52 @@ Feature: Turn Lane Guidance
|
||||
Scenario: Partitioned turn, Slight Curve - maxspeed
|
||||
Given the node map
|
||||
"""
|
||||
f e
|
||||
| |
|
||||
| |
|
||||
| c
|
||||
a - b ' |
|
||||
g d
|
||||
f e
|
||||
| |
|
||||
i | |
|
||||
| | c
|
||||
h - a - b ' |
|
||||
j g d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | turn:lanes:forward | maxspeed |
|
||||
| ha | road | primary | yes | | 1 |
|
||||
| ab | road | primary | yes | left\|right | 1 |
|
||||
| bc | cross | primary | yes | | 1 |
|
||||
| fbg | cross | primary | yes | | 1 |
|
||||
| dce | cross | primary | yes | | 1 |
|
||||
| iaj | kross | primary | no | | 1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes | locations |
|
||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||
| a,e | road,cross,cross | depart,end of road left,arrive | ;left:true right:false,left:true right:false, | a,c,e |
|
||||
| h,g | road,cross,cross | depart,turn right,arrive | ;,left:false right:true, | h,b,g |
|
||||
| h,e | road,cross,cross | depart,end of road left,arrive | ;,left:true right:false;left:true right:false, | h,b,e |
|
||||
|
||||
Scenario: Partitioned turn, Slight Curve
|
||||
Given the node map
|
||||
"""
|
||||
f e
|
||||
| |
|
||||
| |
|
||||
| c
|
||||
a - b ' |
|
||||
g d
|
||||
f e
|
||||
| |
|
||||
i | |
|
||||
| | c
|
||||
h - a - b ' |
|
||||
j g d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | turn:lanes:forward |
|
||||
| ha | road | primary | yes | |
|
||||
| ab | road | primary | yes | left\|right |
|
||||
| bc | cross | primary | yes | |
|
||||
| fbg | cross | primary | yes | |
|
||||
| dce | cross | primary | yes | |
|
||||
| iaj | kross | primary | no | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes | locations |
|
||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||
| a,e | road,cross,cross | depart,end of road left,arrive | ;left:true right:false,left:true right:false, | a,c,e |
|
||||
| waypoints | route | turns | lanes | locations |
|
||||
| h,g | road,cross,cross | depart,turn right,arrive | ;,left:false right:true, | h,b,g |
|
||||
| h,e | road,cross,cross | depart,end of road left,arrive | ;,left:true right:false;left:true right:false, | h,b,e |
|
||||
|
||||
Scenario: Lane Parsing Issue #2694
|
||||
Given the node map
|
||||
@@ -1243,4 +1248,4 @@ Feature: Turn Lane Guidance
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes | locations |
|
||||
| a,f | road1,road1,road1 | depart,continue uturn,arrive | ;left:false straight:true straight;right:false,left:true straight:false straight;right:false;;, | a,d,f |
|
||||
| a,f | road1,road1,road1 | depart,continue uturn,arrive | ,;left:true straight:false straight;right:false;;, | a,c,f |
|
||||
|
||||
+102
-11
@@ -899,9 +899,9 @@ Feature: Simple Turns
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | primary | road |
|
||||
| bd | residential | in |
|
||||
| nodes | highway | name | lanes |
|
||||
| abc | primary | road | 3 |
|
||||
| bd | residential | in | 1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
@@ -964,15 +964,15 @@ Feature: Simple Turns
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
|
||||
f y
|
||||
i
|
||||
j k a b x
|
||||
e c
|
||||
d
|
||||
|
||||
|
|
||||
_--f-----y
|
||||
i-' |
|
||||
j-k-a]|[b---x
|
||||
e 'c
|
||||
|'d'
|
||||
|
|
||||
h
|
||||
|
||||
|
|
||||
q
|
||||
"""
|
||||
|
||||
@@ -1372,3 +1372,94 @@ Feature: Simple Turns
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bcd,bcd | depart,fork slight right,arrive |
|
||||
| a,g | ab,befg,befg | depart,fork slight left,arrive |
|
||||
|
||||
@routing @car
|
||||
Scenario: No turn instruction when turning from unnamed onto unnamed
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
b----------------c
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | ref |
|
||||
| ab | trunk_link | | |
|
||||
| db | secondary | | L 460 |
|
||||
| bc | secondary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | ref | turns |
|
||||
| d | c | ,, | L 460,, | depart,turn right,arrive |
|
||||
| c | d | ,, | ,L 460,L 460 | depart,turn left,arrive |
|
||||
|
||||
# https://www.openstreetmap.org/#map=18/52.25130/10.42545
|
||||
Scenario: Turn for roads with no name, ref changes
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
.
|
||||
.
|
||||
e c . . f
|
||||
.
|
||||
.
|
||||
b
|
||||
.
|
||||
.
|
||||
a
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | ref | name |
|
||||
| abc | tertiary | K 57 | |
|
||||
| cd | tertiary | K 56 | |
|
||||
| cf | tertiary | K 56 | |
|
||||
| ce | residential | | Heinrichshöhe |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,f | ,, | depart,turn right,arrive |
|
||||
|
||||
# https://www.openstreetmap.org/#map=18/52.24071/10.29066
|
||||
Scenario: Turn for roads with no name, ref changes
|
||||
Given the node map
|
||||
"""
|
||||
x
|
||||
.
|
||||
.
|
||||
d
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
e. . t . c . p. .f
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
b
|
||||
.
|
||||
.
|
||||
a
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | ref | name | oneway |
|
||||
| abp | tertiary | K 23 | | yes |
|
||||
| pdx | tertiary | K 23 | | yes |
|
||||
| xdt | tertiary | K 23 | | yes |
|
||||
| tba | tertiary | K 23 | | yes |
|
||||
| etcpf | primary | B 1 | | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| e,x | ,, | depart,turn left,arrive |
|
||||
| f,a | ,, | depart,turn left,arrive |
|
||||
|
||||
@@ -47,7 +47,7 @@ class OSRMBaseLoader{
|
||||
if (err) {
|
||||
if (retryCount < 10) {
|
||||
retryCount++;
|
||||
setTimeout(() => { tryConnect(this.scope.OSRM_PORT, retry); }, 10);
|
||||
setTimeout(() => { tryConnect(this.scope.OSRM_IP, this.scope.OSRM_PORT, retry); }, 10);
|
||||
} else {
|
||||
callback(new Error("Could not connect to osrm-routed after ten retries."));
|
||||
}
|
||||
@@ -58,7 +58,7 @@ class OSRMBaseLoader{
|
||||
}
|
||||
};
|
||||
|
||||
tryConnect(this.scope.OSRM_PORT, retry);
|
||||
tryConnect(this.scope.OSRM_IP, this.scope.OSRM_PORT, retry);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -77,14 +77,54 @@ class OSRMDirectLoader extends OSRMBaseLoader {
|
||||
osrmUp (callback) {
|
||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||
|
||||
const command_arguments = util.format('%s -p %d -a %s', this.inputFile, this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM);
|
||||
const command_arguments = util.format('%s -p %d -i %s -a %s', this.inputFile, this.scope.OSRM_PORT, this.scope.OSRM_IP, this.scope.ROUTING_ALGORITHM);
|
||||
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
||||
if (err && err.signal !== 'SIGINT') {
|
||||
this.child = null;
|
||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||
}
|
||||
});
|
||||
callback();
|
||||
|
||||
this.child.readyFunc = (data) => {
|
||||
if (/running and waiting for requests/.test(data)) {
|
||||
this.child.stdout.removeListener('data', this.child.readyFunc);
|
||||
callback();
|
||||
}
|
||||
};
|
||||
this.child.stdout.on('data',this.child.readyFunc);
|
||||
}
|
||||
};
|
||||
|
||||
class OSRMmmapLoader extends OSRMBaseLoader {
|
||||
constructor (scope) {
|
||||
super(scope);
|
||||
}
|
||||
|
||||
load (inputFile, callback) {
|
||||
this.inputFile = inputFile;
|
||||
this.shutdown(() => {
|
||||
this.launch(callback);
|
||||
});
|
||||
}
|
||||
|
||||
osrmUp (callback) {
|
||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||
|
||||
const command_arguments = util.format('%s -p %d -i %s -a %s --mmap', this.inputFile, this.scope.OSRM_PORT, this.scope.OSRM_IP, this.scope.ROUTING_ALGORITHM);
|
||||
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
||||
if (err && err.signal !== 'SIGINT') {
|
||||
this.child = null;
|
||||
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||
}
|
||||
});
|
||||
|
||||
this.child.readyFunc = (data) => {
|
||||
if (/running and waiting for requests/.test(data)) {
|
||||
this.child.stdout.removeListener('data', this.child.readyFunc);
|
||||
callback();
|
||||
}
|
||||
};
|
||||
this.child.stdout.on('data',this.child.readyFunc);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -107,7 +147,8 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
||||
}
|
||||
|
||||
loadData (callback) {
|
||||
this.scope.runBin('osrm-datastore', this.inputFile, this.scope.environment, (err) => {
|
||||
const command_arguments = util.format('--dataset-name=%s %s', this.scope.DATASET_NAME, this.inputFile);
|
||||
this.scope.runBin('osrm-datastore', command_arguments, this.scope.environment, (err) => {
|
||||
if (err) return callback(new Error('*** osrm-datastore exited with ' + err.code + ': ' + err));
|
||||
callback();
|
||||
});
|
||||
@@ -116,7 +157,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
||||
osrmUp (callback) {
|
||||
if (this.osrmIsRunning()) return callback();
|
||||
|
||||
const command_arguments = util.format('--shared-memory=1 -p %d -a %s', this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM);
|
||||
const command_arguments = util.format('--dataset-name=%s -s -i %s -p %d -a %s', this.scope.DATASET_NAME, this.scope.OSRM_IP, this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM);
|
||||
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
||||
if (err && err.signal !== 'SIGINT') {
|
||||
this.child = null;
|
||||
@@ -134,22 +175,32 @@ class OSRMLoader {
|
||||
this.scope = scope;
|
||||
this.sharedLoader = new OSRMDatastoreLoader(this.scope);
|
||||
this.directLoader = new OSRMDirectLoader(this.scope);
|
||||
this.mmapLoader = new OSRMmmapLoader(this.scope);
|
||||
this.method = scope.DEFAULT_LOAD_METHOD;
|
||||
}
|
||||
|
||||
load (inputFile, callback) {
|
||||
if (!this.loader) {
|
||||
this.loader = {shutdown: (cb) => cb() };
|
||||
}
|
||||
if (this.method === 'datastore') {
|
||||
this.directLoader.shutdown((err) => {
|
||||
this.loader.shutdown((err) => {
|
||||
if (err) return callback(err);
|
||||
this.loader = this.sharedLoader;
|
||||
this.sharedLoader.load(inputFile, callback);
|
||||
});
|
||||
} else if (this.method === 'directly') {
|
||||
this.sharedLoader.shutdown((err) => {
|
||||
this.loader.shutdown((err) => {
|
||||
if (err) return callback(err);
|
||||
this.loader = this.directLoader;
|
||||
this.directLoader.load(inputFile, callback);
|
||||
});
|
||||
} else if (this.method === 'mmap') {
|
||||
this.loader.shutdown((err) => {
|
||||
if (err) return callback(err);
|
||||
this.loader = this.mmapLoader;
|
||||
this.mmapLoader.load(inputFile, callback);
|
||||
});
|
||||
} else {
|
||||
callback(new Error('*** Unknown load method ' + method));
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
const net = require('net');
|
||||
const Timeout = require('node-timeout');
|
||||
|
||||
module.exports = function tryConnect(port, callback) {
|
||||
net.connect({ port: port, host: '127.0.0.1' })
|
||||
module.exports = function tryConnect(host, port, callback) {
|
||||
net.connect({ port: port, host: host })
|
||||
.on('connect', () => { callback(); })
|
||||
.on('error', () => {
|
||||
callback(new Error('Could not connect.'));
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
@datastore @options @help
|
||||
Feature: osrm-datastore command line options
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
And the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
And the data has been contracted
|
||||
|
||||
Scenario: osrm-datastore - Help should be shown when no options are passed
|
||||
When I try to run "osrm-datastore --dataset-name test_dataset_42 {processed_file}"
|
||||
Then it should exit successfully
|
||||
When I try to run "osrm-datastore --list"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "test_dataset_42/static"
|
||||
And stdout should contain "test_dataset_42/updatable"
|
||||
|
||||
Scenario: osrm-datastore - Only metric update should work
|
||||
Given the speed file
|
||||
"""
|
||||
0,1,50
|
||||
"""
|
||||
And the data has been extracted
|
||||
When I try to run "osrm-datastore {processed_file} --dataset-name cucumber/only_metric_test"
|
||||
Then it should exit successfully
|
||||
When I try to run "osrm-customize --segment-speed-file {speeds_file} {processed_file}"
|
||||
Then it should exit successfully
|
||||
When I try to run "osrm-datastore {processed_file} --dataset-name cucumber/only_metric_test --only-metric"
|
||||
Then it should exit successfully
|
||||
|
||||
Scenario: osrm-datastore - Displaying help should work
|
||||
When I try to run "osrm-datastore {processed_file} --help"
|
||||
Then it should exit successfully
|
||||
|
||||
Scenario: osrm-datastore - Errors on invalid path
|
||||
When I try to run "osrm-datastore invalid_path.osrm"
|
||||
Then stderr should contain "[error] Config contains invalid file paths."
|
||||
And stderr should contain "Missing/Broken"
|
||||
And it should exit with an error
|
||||
@@ -129,8 +129,12 @@ Feature: osrm-extract lua ways:get_nodes()
|
||||
"""
|
||||
functions = require('testbot')
|
||||
|
||||
functions.process_node = function(profile, node, result, relations)
|
||||
print ('node ' .. tostring(node:get_location_tag('answer')))
|
||||
end
|
||||
|
||||
functions.process_way = function(profile, way, result, relations)
|
||||
print ('answer ' .. tostring(way:get_location_tag('answer')))
|
||||
print ('way ' .. tostring(way:get_location_tag('answer')))
|
||||
result.forward_mode = mode.driving
|
||||
result.forward_speed = 1
|
||||
end
|
||||
@@ -148,4 +152,5 @@ Feature: osrm-extract lua ways:get_nodes()
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file} --location-dependent-data test/data/regions/null-island.geojson"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "answer 42"
|
||||
And stdout should contain "node 42"
|
||||
And stdout should contain "way 42"
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
@routing @testbot @turn_function
|
||||
Feature: Turn Function Information
|
||||
|
||||
|
||||
Background:
|
||||
Given the profile file
|
||||
"""
|
||||
functions = require('car')
|
||||
|
||||
function test_setup()
|
||||
profile = functions.setup()
|
||||
profile.highway_turn_classification = {
|
||||
['motorway'] = 4,
|
||||
['motorway_link'] = 4,
|
||||
['trunk'] = 4,
|
||||
['trunk_link'] = 4,
|
||||
['primary'] = 4,
|
||||
['primary_link'] = 4,
|
||||
['secondary'] = 3,
|
||||
['secondary_link'] = 3,
|
||||
['tertiary'] = 2,
|
||||
['tertiary_link'] = 2,
|
||||
['residential'] = 1,
|
||||
['living_street'] = 1,
|
||||
}
|
||||
|
||||
profile.access_turn_classification = {
|
||||
['discouraged'] = 1;
|
||||
['permissive'] = 1;
|
||||
['private'] = 1;
|
||||
['customers'] = 1;
|
||||
['dismount'] = 1;
|
||||
}
|
||||
return profile
|
||||
end
|
||||
|
||||
function turn_leg_string (leg)
|
||||
return 'speed: ' .. tostring(leg.speed)
|
||||
.. ', is_incoming: ' .. tostring(leg.is_incoming)
|
||||
.. ', is_outgoing: ' .. tostring(leg.is_outgoing)
|
||||
.. ', highway_turn_classification: ' .. tostring(leg.highway_turn_classification)
|
||||
.. ', access_turn_classification: ' .. tostring(leg.access_turn_classification)
|
||||
.. ', priority_class: ' .. tostring(leg.priority_class)
|
||||
end
|
||||
|
||||
function print_turn (profile, turn)
|
||||
print ('source_restricted ' .. string.format("%s", tostring(turn.source_restricted)))
|
||||
print ('source_is_motorway ' .. string.format("%s", tostring(turn.source_is_motorway)))
|
||||
print ('source_is_link ' .. string.format("%s", tostring(turn.source_is_link)))
|
||||
print ('source_number_of_lanes ' .. string.format("%s", tostring(turn.source_number_of_lanes)))
|
||||
print ('source_highway_turn_classification ' .. string.format("%s", tostring(turn.source_highway_turn_classification)))
|
||||
print ('source_access_turn_classification ' .. string.format("%s", tostring(turn.source_access_turn_classification)))
|
||||
print ('source_speed ' .. string.format("%s", tostring(turn.source_speed)))
|
||||
print ('source_priority_class ' .. string.format("%s", tostring(turn.source_priority_class)))
|
||||
print ('source_mode ' .. string.format("%s", tostring(turn.source_mode)))
|
||||
|
||||
print ('target_restricted ' .. string.format("%s", tostring(turn.target_restricted)))
|
||||
print ('target_is_motorway ' .. string.format("%s", tostring(turn.target_is_motorway)))
|
||||
print ('target_is_link ' .. string.format("%s", tostring(turn.target_is_link)))
|
||||
print ('target_number_of_lanes ' .. string.format("%s", tostring(turn.target_number_of_lanes)))
|
||||
print ('target_highway_turn_classification ' .. string.format("%s", tostring(turn.target_highway_turn_classification)))
|
||||
print ('target_access_turn_classification ' .. string.format("%s", tostring(turn.target_access_turn_classification)))
|
||||
print ('target_speed ' .. string.format("%s", tostring(turn.target_speed)))
|
||||
print ('target_priority_class ' .. string.format("%s", tostring(turn.target_priority_class)))
|
||||
print ('target_mode ' .. string.format("%s", tostring(turn.target_mode)))
|
||||
|
||||
print ('number_of_roads ' .. string.format("%s", tostring(turn.number_of_roads)))
|
||||
if not turn.is_u_turn then
|
||||
for roadCount, road in ipairs(turn.roads_on_the_right) do
|
||||
print('roads_on_the_right [' .. tostring(roadCount) .. '] ' .. turn_leg_string(road))
|
||||
end
|
||||
|
||||
for roadCount, road in ipairs(turn.roads_on_the_left) do
|
||||
print('roads_on_the_left [' .. tostring(roadCount) .. '] ' .. turn_leg_string(road))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
setup = test_setup,
|
||||
process_way = functions.process_way,
|
||||
process_node = functions.process_node,
|
||||
process_turn = print_turn
|
||||
}
|
||||
"""
|
||||
|
||||
Scenario: Turns should have correct information of source and target
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
a b c
|
||||
|
||||
"""
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | motorway |
|
||||
| bc | motorway |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "source_is_motorway true"
|
||||
And stdout should contain "target_is_motorway true"
|
||||
And stdout should contain "source_is_link false"
|
||||
And stdout should contain "source_priority_class 0"
|
||||
And stdout should contain "target_is_motorway true"
|
||||
And stdout should contain "target_is_link false"
|
||||
And stdout should contain "target_priority_class 0"
|
||||
|
||||
|
||||
Scenario: Turns should detect when turn is leaving highway
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
a b c
|
||||
|
||||
"""
|
||||
And the ways
|
||||
| nodes | highway | lanes |
|
||||
| ab | motorway | 3 |
|
||||
| bc | motorway_link | |
|
||||
|
||||
And the data has been saved to disk
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "source_is_motorway true"
|
||||
And stdout should contain "source_is_link false"
|
||||
And stdout should contain "source_number_of_lanes 3"
|
||||
And stdout should contain "target_is_motorway false"
|
||||
And stdout should contain "target_is_link true"
|
||||
And stdout should contain "target_number_of_lanes 0"
|
||||
And stdout should contain "number_of_roads 2"
|
||||
|
||||
Scenario: Turns should have correct information of other roads at intersection I
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
^
|
||||
|
|
||||
a->b->c
|
||||
"""
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | yes |
|
||||
| bc | motorway | yes |
|
||||
| bd | residential | yes |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "number_of_roads 3"
|
||||
And stdout should contain "source_priority_class 4"
|
||||
And stdout should contain "target_priority_class 0"
|
||||
And stdout should contain "target_priority_class 10"
|
||||
# turning abd, give information about bc
|
||||
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: false, is_outgoing: true, highway_turn_classification: 4, access_turn_classification: 0/
|
||||
# turning abc, give information about bd
|
||||
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: false, is_outgoing: true, highway_turn_classification: 1, access_turn_classification: 0/
|
||||
|
||||
Scenario: Turns should have correct information of other roads at intersection II
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
v
|
||||
a->b->c
|
||||
"""
|
||||
And the ways
|
||||
| nodes | highway | oneway | access |
|
||||
| ab | secondary | yes | |
|
||||
| bc | motorway | yes | |
|
||||
| db | unclassified | yes | discouraged |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
And stdout should contain "number_of_roads 3"
|
||||
# turning dbc, give information about about ab
|
||||
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 3, access_turn_classification: 0/
|
||||
# turning abc, give information about about db
|
||||
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 0, access_turn_classification: 1/
|
||||
@@ -185,31 +185,34 @@ module.exports = function () {
|
||||
|
||||
let q = d3.queue();
|
||||
|
||||
let addRelation = (row, cb) => {
|
||||
let addRelation = (headers, row, cb) => {
|
||||
let relation = new OSM.Relation(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP, this.OSM_UID);
|
||||
|
||||
|
||||
var name = null;
|
||||
for (let key in row) {
|
||||
for (let index in row) {
|
||||
|
||||
var key = headers[index];
|
||||
var value = row[index];
|
||||
let isNode = key.match(/^node:?(.*)/),
|
||||
isWay = key.match(/^way:?(.*)/),
|
||||
isRelation = key.match(/^relation:?(.*)/),
|
||||
isColonSeparated = key.match(/^(.*):(.*)/);
|
||||
if (isNode) {
|
||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
||||
value.split(',').map(function(v) { return v.trim(); }).forEach((nodeName) => {
|
||||
if (nodeName.length !== 1) throw new Error(util.format('*** invalid relation node member "%s"', nodeName));
|
||||
let node = this.findNodeByName(nodeName);
|
||||
if (!node) throw new Error(util.format('*** unknown relation node member "%s"', nodeName));
|
||||
relation.addMember('node', node.id, isNode[1]);
|
||||
});
|
||||
} else if (isWay) {
|
||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((wayName) => {
|
||||
value.split(',').map(function(v) { return v.trim(); }).forEach((wayName) => {
|
||||
let way = this.findWayByName(wayName);
|
||||
if (!way) throw new Error(util.format('*** unknown relation way member "%s"', wayName));
|
||||
relation.addMember('way', way.id, isWay[1]);
|
||||
});
|
||||
} else if (isRelation) {
|
||||
row[key].split(',').map(function(v) { return v.trim(); }).forEach((relName) => {
|
||||
value.split(',').map(function(v) { return v.trim(); }).forEach((relName) => {
|
||||
let otherrelation = this.findRelationByName(relName);
|
||||
if (!otherrelation) throw new Error(util.format('*** unknown relation relation member "%s"', relName));
|
||||
relation.addMember('relation', otherrelation.id, isRelation[1]);
|
||||
@@ -217,8 +220,8 @@ module.exports = function () {
|
||||
} else if (isColonSeparated && isColonSeparated[1] !== 'restriction') {
|
||||
throw new Error(util.format('*** unknown relation member type "%s:%s", must be either "node" or "way"', isColonSeparated[1], isColonSeparated[2]));
|
||||
} else {
|
||||
relation.addTag(key, row[key]);
|
||||
if (key.match(/name/)) name = row[key];
|
||||
relation.addTag(key, value);
|
||||
if (key.match(/name/)) name = value;
|
||||
}
|
||||
}
|
||||
relation.uid = this.OSM_UID;
|
||||
@@ -233,7 +236,8 @@ module.exports = function () {
|
||||
cb();
|
||||
};
|
||||
|
||||
table.hashes().forEach((row) => q.defer(addRelation, row));
|
||||
var headers = table.raw()[0];
|
||||
table.rows().forEach((row) => q.defer(addRelation, headers, row));
|
||||
|
||||
q.awaitAll(callback);
|
||||
});
|
||||
|
||||
@@ -1,74 +1,88 @@
|
||||
var util = require('util');
|
||||
|
||||
module.exports = function () {
|
||||
this.When(/^I request a travel time matrix I should get$/, (table, callback) => {
|
||||
var NO_ROUTE = 2147483647; // MAX_INT
|
||||
const durationsRegex = new RegExp(/^I request a travel time matrix I should get$/);
|
||||
const distancesRegex = new RegExp(/^I request a travel distance matrix I should get$/);
|
||||
|
||||
var tableRows = table.raw();
|
||||
const DURATIONS_NO_ROUTE = 2147483647; // MAX_INT
|
||||
const DISTANCES_NO_ROUTE = 3.40282e+38; // MAX_FLOAT
|
||||
|
||||
if (tableRows[0][0] !== '') throw new Error('*** Top-left cell of matrix table must be empty');
|
||||
this.When(durationsRegex, function(table, callback) {tableParse.call(this, table, DURATIONS_NO_ROUTE, 'durations', callback);}.bind(this));
|
||||
this.When(distancesRegex, function(table, callback) {tableParse.call(this, table, DISTANCES_NO_ROUTE, 'distances', callback);}.bind(this));
|
||||
};
|
||||
|
||||
var waypoints = [],
|
||||
columnHeaders = tableRows[0].slice(1),
|
||||
rowHeaders = tableRows.map((h) => h[0]).slice(1),
|
||||
symmetric = columnHeaders.length == rowHeaders.length && columnHeaders.every((ele, i) => ele === rowHeaders[i]);
|
||||
const durationsParse = function(v) { return isNaN(parseInt(v)); };
|
||||
const distancesParse = function(v) { return isNaN(parseFloat(v)); };
|
||||
|
||||
if (symmetric) {
|
||||
columnHeaders.forEach((nodeName) => {
|
||||
var node = this.findNodeByName(nodeName);
|
||||
if (!node) throw new Error(util.format('*** unknown node "%s"', nodeName));
|
||||
waypoints.push({ coord: node, type: 'loc' });
|
||||
function tableParse(table, noRoute, annotation, callback) {
|
||||
|
||||
const parse = annotation == 'distances' ? distancesParse : durationsParse;
|
||||
const params = this.queryParams;
|
||||
params.annotations = annotation == 'distances' ? 'distance' : 'duration';
|
||||
|
||||
var tableRows = table.raw();
|
||||
|
||||
if (tableRows[0][0] !== '') throw new Error('*** Top-left cell of matrix table must be empty');
|
||||
|
||||
var waypoints = [],
|
||||
columnHeaders = tableRows[0].slice(1),
|
||||
rowHeaders = tableRows.map((h) => h[0]).slice(1),
|
||||
symmetric = columnHeaders.length == rowHeaders.length && columnHeaders.every((ele, i) => ele === rowHeaders[i]);
|
||||
|
||||
if (symmetric) {
|
||||
columnHeaders.forEach((nodeName) => {
|
||||
var node = this.findNodeByName(nodeName);
|
||||
if (!node) throw new Error(util.format('*** unknown node "%s"', nodeName));
|
||||
waypoints.push({ coord: node, type: 'loc' });
|
||||
});
|
||||
} else {
|
||||
columnHeaders.forEach((nodeName) => {
|
||||
var node = this.findNodeByName(nodeName);
|
||||
if (!node) throw new Error(util.format('*** unknown node "%s"', nodeName));
|
||||
waypoints.push({ coord: node, type: 'dst' });
|
||||
});
|
||||
rowHeaders.forEach((nodeName) => {
|
||||
var node = this.findNodeByName(nodeName);
|
||||
if (!node) throw new Error(util.format('*** unknown node "%s"', nodeName));
|
||||
waypoints.push({ coord: node, type: 'src' });
|
||||
});
|
||||
}
|
||||
|
||||
var actual = [];
|
||||
actual.push(table.headers);
|
||||
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
// compute matrix
|
||||
|
||||
this.requestTable(waypoints, params, (err, response) => {
|
||||
if (err) return callback(err);
|
||||
if (!response.body.length) return callback(new Error('Invalid response body'));
|
||||
|
||||
var json = JSON.parse(response.body);
|
||||
|
||||
var result = json[annotation].map(row => {
|
||||
var hashes = {};
|
||||
row.forEach((v, i) => { hashes[tableRows[0][i+1]] = parse(v) ? '' : v; });
|
||||
return hashes;
|
||||
});
|
||||
} else {
|
||||
columnHeaders.forEach((nodeName) => {
|
||||
var node = this.findNodeByName(nodeName);
|
||||
if (!node) throw new Error(util.format('*** unknown node "%s"', nodeName));
|
||||
waypoints.push({ coord: node, type: 'dst' });
|
||||
});
|
||||
rowHeaders.forEach((nodeName) => {
|
||||
var node = this.findNodeByName(nodeName);
|
||||
if (!node) throw new Error(util.format('*** unknown node "%s"', nodeName));
|
||||
waypoints.push({ coord: node, type: 'src' });
|
||||
});
|
||||
}
|
||||
|
||||
var actual = [];
|
||||
actual.push(table.headers);
|
||||
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
// compute matrix
|
||||
var params = this.queryParams;
|
||||
|
||||
this.requestTable(waypoints, params, (err, response) => {
|
||||
if (err) return callback(err);
|
||||
if (!response.body.length) return callback(new Error('Invalid response body'));
|
||||
|
||||
var json = JSON.parse(response.body);
|
||||
|
||||
var result = json['durations'].map(row => {
|
||||
var hashes = {};
|
||||
row.forEach((v, i) => { hashes[tableRows[0][i+1]] = isNaN(parseInt(v)) ? '' : v; });
|
||||
return hashes;
|
||||
});
|
||||
|
||||
var testRow = (row, ri, cb) => {
|
||||
for (var k in result[ri]) {
|
||||
if (this.FuzzyMatch.match(result[ri][k], row[k])) {
|
||||
result[ri][k] = row[k];
|
||||
} else if (row[k] === '' && result[ri][k] === NO_ROUTE) {
|
||||
result[ri][k] = '';
|
||||
} else {
|
||||
result[ri][k] = result[ri][k].toString();
|
||||
}
|
||||
var testRow = (row, ri, cb) => {
|
||||
for (var k in result[ri]) {
|
||||
if (this.FuzzyMatch.match(result[ri][k], row[k])) {
|
||||
result[ri][k] = row[k];
|
||||
} else if (row[k] === '' && result[ri][k] === noRoute) {
|
||||
result[ri][k] = '';
|
||||
} else {
|
||||
result[ri][k] = result[ri][k].toString();
|
||||
}
|
||||
}
|
||||
|
||||
result[ri][''] = row[''];
|
||||
cb(null, result[ri]);
|
||||
};
|
||||
result[ri][''] = row[''];
|
||||
cb(null, result[ri]);
|
||||
};
|
||||
|
||||
this.processRowsAndDiff(table, testRow, callback);
|
||||
});
|
||||
this.processRowsAndDiff(table, testRow, callback);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ module.exports = function () {
|
||||
|
||||
if (headers.has('turns')) {
|
||||
if (json.matchings.length != 1) throw new Error('*** Checking turns only supported for matchings with one subtrace');
|
||||
turns = this.turnList(json.matchings[0].instructions);
|
||||
turns = this.turnList(json.matchings[0]);
|
||||
}
|
||||
|
||||
if (headers.has('route')) {
|
||||
@@ -150,7 +150,8 @@ module.exports = function () {
|
||||
}
|
||||
var ok = true;
|
||||
var encodedResult = '',
|
||||
extendedTarget = '';
|
||||
extendedTarget = '',
|
||||
resultWaypoints = [];
|
||||
|
||||
var testSubMatching = (sub, si) => {
|
||||
var testSubNode = (ni) => {
|
||||
@@ -186,6 +187,29 @@ module.exports = function () {
|
||||
});
|
||||
}
|
||||
|
||||
if (headers.has('waypoints')) {
|
||||
var got_loc = [];
|
||||
for (let i = 0; i < json.tracepoints.length; i++) {
|
||||
if (!json.tracepoints[i]) continue;
|
||||
if (json.tracepoints[i].waypoint_index != null)
|
||||
got_loc.push(json.tracepoints[i].location);
|
||||
}
|
||||
|
||||
if (row.waypoints.length != got_loc.length)
|
||||
return cb(new Error(`Expected ${row.waypoints.length} waypoints, got ${got_loc.length}`));
|
||||
|
||||
for (i = 0; i < row.waypoints.length; i++)
|
||||
{
|
||||
var want_node = this.findNodeByName(row.waypoints[i]);
|
||||
if (!this.FuzzyMatch.matchLocation(got_loc[i], want_node)) {
|
||||
resultWaypoints.push(util.format('? [%s,%s]', got_loc[i][0], got_loc[i][1]));
|
||||
ok = false;
|
||||
} else {
|
||||
resultWaypoints.push(row.waypoints[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
if (headers.has('matchings')) {
|
||||
got.matchings = row.matchings;
|
||||
@@ -194,7 +218,12 @@ module.exports = function () {
|
||||
if (headers.has('timestamps')) {
|
||||
got.timestamps = row.timestamps;
|
||||
}
|
||||
|
||||
if (headers.has('waypoints')) {
|
||||
got.waypoints = row.waypoints;
|
||||
}
|
||||
} else {
|
||||
got.waypoints = resultWaypoints.join(';');
|
||||
got.matchings = encodedResult;
|
||||
row.matchings = extendedTarget;
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ module.exports = function() {
|
||||
// shorten uri to be realtive to 'features/'
|
||||
let featurePath = path.relative(path.resolve('./features'), uri);
|
||||
// bicycle/bollards/{HASH}/
|
||||
let featureID = path.join(featurePath, hash);
|
||||
|
||||
let featureID = path.join(featurePath, hash);
|
||||
|
||||
let featureCacheDirectory = this.getFeatureCacheDirectory(featureID);
|
||||
let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash);
|
||||
this.featureIDs[uri] = featureID;
|
||||
@@ -115,6 +115,7 @@ module.exports = function() {
|
||||
this.OSRM_EXTRACT_PATH,
|
||||
this.OSRM_CONTRACT_PATH,
|
||||
this.LIB_OSRM_EXTRACT_PATH,
|
||||
this.LIB_OSRM_GUIDANCE_PATH,
|
||||
this.LIB_OSRM_CONTRACT_PATH
|
||||
];
|
||||
|
||||
|
||||
@@ -12,12 +12,17 @@ module.exports = {
|
||||
|
||||
FuzzyMatch: class {
|
||||
match (got, want) {
|
||||
// don't fail if bearings input and extected string is empty and actual result is undefined
|
||||
if (want === '' && (got === '' || got === undefined))
|
||||
return true;
|
||||
|
||||
var matchPercent = want.match(/(.*)\s+~(.+)%$/),
|
||||
matchAbs = want.match(/(.*)\s+\+\-(.+)$/),
|
||||
matchRe = want.match(/^\/(.*)\/$/),
|
||||
// we use this for matching before/after bearing
|
||||
matchBearingListAbs = want.match(/^((\d+)->(\d+))(,(\d+)->(\d+))*\s+\+\-(.+)$/),
|
||||
matchIntersectionListAbs = want.match(/^(((((true|false):\d+)\s{0,1})+,{0,1})+;{0,1})+\s+\+\-(.+)$/);
|
||||
matchIntersectionListAbs = want.match(/^(((((true|false):\d+)\s{0,1})+,{0,1})+;{0,1})+\s+\+\-(.+)$/),
|
||||
matchRangeNumbers = want.match(/\d+\+\-\d+/);
|
||||
|
||||
function inRange(margin, got, want) {
|
||||
var fromR = parseFloat(want) - margin,
|
||||
@@ -101,6 +106,11 @@ module.exports = {
|
||||
return inRange(margin, got, matchAbs[1]);
|
||||
} else if (matchRe) { // regex: /a,b,.*/
|
||||
return got.match(matchRe[1]);
|
||||
} else if (matchRangeNumbers) {
|
||||
let real_want_and_margin = want.split('+-'),
|
||||
margin = parseFloat(real_want_and_margin[1].trim()),
|
||||
real_want = parseFloat(real_want_and_margin[0].trim());
|
||||
return inRange(margin, got, real_want);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,11 +27,12 @@ module.exports = function () {
|
||||
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
||||
}
|
||||
|
||||
this.DATASET_NAME = 'cucumber';
|
||||
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
||||
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
||||
this.DEFAULT_PROFILE = 'bicycle';
|
||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||
this.DEFAULT_LOAD_METHOD = 'datastore';
|
||||
this.DEFAULT_LOAD_METHOD = process.argv[process.argv.indexOf('-m') +1].match('mmap') ? 'mmap' : 'datastore';
|
||||
this.DEFAULT_ORIGIN = [1,1];
|
||||
this.OSM_USER = 'osrm';
|
||||
this.OSM_UID = 1;
|
||||
@@ -43,8 +44,9 @@ module.exports = function () {
|
||||
this.TIMEZONE_NAMES = this.PLATFORM_WINDOWS ? 'win' : 'iana';
|
||||
|
||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
||||
|
||||
this.OSRM_IP = process.env.OSRM_IP || '127.0.0.1';
|
||||
this.HOST = `http://${this.OSRM_IP}:${this.OSRM_PORT}`;
|
||||
|
||||
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
|
||||
|
||||
if (this.PLATFORM_WINDOWS) {
|
||||
@@ -72,6 +74,7 @@ module.exports = function () {
|
||||
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.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
|
||||
this.LIB_OSRM_GUIDANCE_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_guidance'),
|
||||
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
|
||||
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
|
||||
|
||||
@@ -92,7 +95,7 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.verifyOSRMIsNotRunning = (callback) => {
|
||||
tryConnect(this.OSRM_PORT, (err) => {
|
||||
tryConnect(this.OSRM_IP, this.OSRM_PORT, (err) => {
|
||||
if (!err) return callback(new Error('*** osrm-routed is already running.'));
|
||||
else callback();
|
||||
});
|
||||
|
||||
@@ -50,6 +50,8 @@ module.exports = function () {
|
||||
.defer(mkdirp, logDir)
|
||||
.defer(rimraf, this.scenarioLogFile)
|
||||
.awaitAll(callback);
|
||||
// uncomment to get path to logfile
|
||||
// console.log(' Writing logging output to ' + this.scenarioLogFile);
|
||||
});
|
||||
|
||||
this.After((scenario, callback) => {
|
||||
|
||||
@@ -199,14 +199,26 @@ module.exports = function () {
|
||||
|
||||
var merged = {};
|
||||
instructions.legs.map(l => {
|
||||
Object.keys(l.annotation).forEach(a => {
|
||||
Object.keys(l.annotation).filter(a => !a.match(/metadata/)).forEach(a => {
|
||||
if (!merged[a]) merged[a] = [];
|
||||
merged[a].push(l.annotation[a].join(':'));
|
||||
});
|
||||
if (l.annotation.metadata) {
|
||||
merged.metadata = {};
|
||||
Object.keys(l.annotation.metadata).forEach(a => {
|
||||
if (!merged.metadata[a]) merged.metadata[a] = [];
|
||||
merged.metadata[a].push(l.annotation.metadata[a].join(':'));
|
||||
});
|
||||
}
|
||||
});
|
||||
Object.keys(merged).map(a => {
|
||||
Object.keys(merged).filter(k => !k.match(/metadata/)).map(a => {
|
||||
merged[a] = merged[a].join(',');
|
||||
});
|
||||
if (merged.metadata) {
|
||||
Object.keys(merged.metadata).map(a => {
|
||||
merged.metadata[a] = merged.metadata[a].join(',');
|
||||
});
|
||||
}
|
||||
return merged;
|
||||
};
|
||||
|
||||
|
||||
@@ -158,7 +158,8 @@ module.exports = function () {
|
||||
// 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'];
|
||||
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight', 'speed' ];
|
||||
let metadata_whitelist = [ 'datasource_names' ];
|
||||
if (k.match(/^a:/)) {
|
||||
let a_type = k.slice(2);
|
||||
if (whitelist.indexOf(a_type) == -1)
|
||||
@@ -166,6 +167,13 @@ module.exports = function () {
|
||||
if (annotation && !annotation[a_type])
|
||||
return cb(new Error('Annotation not found in response', a_type));
|
||||
got[k] = annotation && annotation[a_type] || '';
|
||||
} else if (k.match(/^am:/)) {
|
||||
let a_type = k.slice(3);
|
||||
if (metadata_whitelist.indexOf(a_type) == -1)
|
||||
return cb(new Error('Unrecognized annotation field', a_type));
|
||||
if (annotation && (!annotation.metadata || !annotation.metadata[a_type]))
|
||||
return cb(new Error('Annotation not found in response', a_type));
|
||||
got[k] = (annotation && annotation.metadata && annotation.metadata[a_type]) || '';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,14 @@ Feature: Alternative route
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
And a grid size of 200 meters
|
||||
# Force data preparation to single-threaded to ensure consistent
|
||||
# results for alternative generation during tests (alternative
|
||||
# finding is highly sensitive to graph shape, which is in turn
|
||||
# affected by parallelism during generation)
|
||||
And the contract extra arguments "--threads 1"
|
||||
And the extract extra arguments "--threads 1"
|
||||
And the customize extra arguments "--threads 1"
|
||||
And the partition extra arguments "--threads 1"
|
||||
|
||||
And the node map
|
||||
"""
|
||||
|
||||
@@ -4,6 +4,14 @@ Feature: Alternative route
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 200 meters
|
||||
# Force data preparation to single-threaded to ensure consistent
|
||||
# results for alternative generation during tests (alternative
|
||||
# finding is highly sensitive to graph shape, which is in turn
|
||||
# affected by parallelism during generation)
|
||||
And the contract extra arguments "--threads 1"
|
||||
And the extract extra arguments "--threads 1"
|
||||
And the customize extra arguments "--threads 1"
|
||||
And the partition extra arguments "--threads 1"
|
||||
|
||||
Scenario: Alternative Loop Paths
|
||||
Given the node map
|
||||
|
||||
@@ -11,7 +11,7 @@ Feature: Annotations
|
||||
"""
|
||||
|
||||
And the query options
|
||||
| annotations | duration,speed,weight |
|
||||
| annotations | duration,speed,weight,nodes |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
@@ -22,10 +22,10 @@ Feature: Annotations
|
||||
| lm | residential |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | a:speed | a:weight |
|
||||
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 |
|
||||
| i | m | il,lm,lm | 6.7:6.7 | 15:15 |
|
||||
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 |
|
||||
| from | to | route | a:speed | a:weight | a:nodes |
|
||||
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 | 1:4:3 |
|
||||
| i | m | il,lm,lm | 6.7:6.7 | 15:15 | 2:5:6 |
|
||||
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 | 3:4:5:6 |
|
||||
|
||||
|
||||
Scenario: There should be different forward/reverse datasources
|
||||
@@ -59,3 +59,60 @@ Feature: Annotations
|
||||
| from | to | route | a:datasources | a:speed |
|
||||
| a | i | abcdefghi,abcdefghi | 1:0:1:0:1:0:0:0 | 50:10:50:10:50:10:10:10 |
|
||||
| i | a | abcdefghi,abcdefghi | 0:1:0:0:0:0:0:1 | 10:50:10:10:10:10:10:50 |
|
||||
|
||||
Scenario: datasource name annotations
|
||||
Given the profile "testbot"
|
||||
|
||||
And the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
|
||||
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||
And the customize extra arguments "--segment-speed-file {speeds_file}"
|
||||
|
||||
And the speed file
|
||||
"""
|
||||
1,2,180,1
|
||||
2,1,180,1
|
||||
"""
|
||||
|
||||
And the query options
|
||||
| annotations | datasources |
|
||||
|
||||
# Note - the source names here are specific to how the tests are constructed,
|
||||
# so if this test is moved around (changes line number) or support code
|
||||
# changes how the filenames are generated, this test will need to be updated
|
||||
When I route I should get
|
||||
| from | to | route | am:datasource_names |
|
||||
| a | c | abc,abc | lua profile:63_datasource_name_annotations_speeds |
|
||||
| c | a | abc,abc | lua profile:63_datasource_name_annotations_speeds |
|
||||
|
||||
|
||||
Scenario: Speed annotations should handle zero segments
|
||||
Given the profile "testbot"
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a -- b --- c
|
||||
|
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| cd |
|
||||
|
||||
# This test relies on the snapping to the EBN cd to introduce a zero segment after the turn
|
||||
And the query options
|
||||
| annotations | speed,distance,duration,nodes |
|
||||
| bearings | 90,5;180,5 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
|
||||
| a | c | abc,abc | 10:10 | 249.998641:299.931643 | 25:30 | 1:2:3 |
|
||||
|
||||
@@ -74,6 +74,7 @@ Feature: Approach parameter
|
||||
| from | to | approaches | route |
|
||||
| s | e | unrestricted curb | ab,bc |
|
||||
|
||||
|
||||
###############
|
||||
# Oneway Test #
|
||||
###############
|
||||
@@ -226,3 +227,90 @@ Feature: Approach parameter
|
||||
When I route I should get
|
||||
| from | to | approaches | route |
|
||||
| s | e | unrestricted curb | ab,bc |
|
||||
|
||||
|
||||
#######################
|
||||
# Left-side countries #
|
||||
#######################
|
||||
|
||||
Scenario: [Left-hand-side] Start End same approach, option unrestricted for Start and End
|
||||
Given the profile file "car" initialized with
|
||||
"""
|
||||
profile.properties.left_hand_driving = true
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
s e
|
||||
a------b------c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | approaches | route |
|
||||
| s | e | unrestricted unrestricted | ab,bc |
|
||||
|
||||
Scenario: [Left-hand-side] Start End same approach, option unrestricted for Start and curb for End
|
||||
Given the profile file "car" initialized with
|
||||
"""
|
||||
profile.properties.left_hand_driving = true
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
s
|
||||
a------b------c
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | approaches | route |
|
||||
| s | e | unrestricted curb | ab,bc,bc |
|
||||
|
||||
Scenario: [Left-hand-side] Start End opposite approach, option unrestricted for Start and End
|
||||
Given the profile file "car" initialized with
|
||||
"""
|
||||
profile.properties.left_hand_driving = true
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
s
|
||||
a------b------c
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | approaches | route |
|
||||
| s | e | unrestricted unrestricted | ab,bc |
|
||||
|
||||
Scenario: [Left-hand-side] Start End opposite approach, option unrestricted for Start and curb for End
|
||||
Given the profile file "car" initialized with
|
||||
"""
|
||||
profile.properties.left_hand_driving = true
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
s e
|
||||
a------b------c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | approaches | route |
|
||||
| s | e | unrestricted curb | ab,bc |
|
||||
@@ -108,12 +108,12 @@ Feature: Bearing parameter
|
||||
| ha | yes | ring |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | q | 0 90 | ia,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,90->0 |
|
||||
| 0 | a | 45 90 | jb,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,90->0 |
|
||||
| 0 | q | 90 90 | kc,ring,ring,ring | 0->90,90->180,270->0,90->0 |
|
||||
| 0 | a | 135 90 | ld,ring,ring,ring | 0->135,135->270,270->0,90->0 |
|
||||
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,270->0,90->0 |
|
||||
| 0 | a | 225 90 | nf,ring,ring | 0->225,225->0,90->0 |
|
||||
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
|
||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | q | 0 90 | ia,ring,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | q | 90 90 | kc,ring,ring,ring,ring | 0->90,90->180,270->0,0->90,90->0 |
|
||||
| 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 180 90 | me,ring,ring,ring,ring | 0->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,90->0 |
|
||||
| 0 | a | 270 90 | og,ring,ring,ring | 0->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||
|
||||
@@ -226,3 +226,22 @@ Feature: Distance calculation
|
||||
| x | v | xv,xv | 424m +-1 |
|
||||
| x | w | xw,xw | 360m +-1 |
|
||||
| x | y | xy,xy | 316m +-1 |
|
||||
|
||||
|
||||
# Check rounding errors
|
||||
Scenario: Distances Long distances
|
||||
Given a grid size of 1000 meters
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abcd |
|
||||
|
||||
When I route I should get
|
||||
| from | to | distance |
|
||||
| a | b | 1000m +-3 |
|
||||
| a | c | 2000m +-3 |
|
||||
| a | d | 3000m +-3 |
|
||||
|
||||
@@ -1,74 +1,11 @@
|
||||
@matrix @testbot
|
||||
Feature: Basic Distance Matrix
|
||||
# note that results are travel time, specified in 1/10th of seconds
|
||||
# since testbot uses a default speed of 100m/10s, the result matches
|
||||
# the number of meters as long as the way type is the default 'primary'
|
||||
# note that results of travel distance are in metres
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16"
|
||||
|
||||
Scenario: Testbot - Travel time matrix of minimal network
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 10 |
|
||||
| b | 10 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel time matrix with different way speeds
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | secondary |
|
||||
| cd | tertiary |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 10 | 30 | 60 |
|
||||
| b | 10 | 0 | 20 | 50 |
|
||||
| c | 30 | 20 | 0 | 30 |
|
||||
| d | 60 | 50 | 30 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 10 | 30 | 60 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 10 |
|
||||
| c | 30 |
|
||||
| d | 60 |
|
||||
|
||||
Scenario: Testbot - Travel time matrix with fuzzy match
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 10 |
|
||||
| b | 10 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel time matrix of small grid
|
||||
Scenario: Testbot - Travel distance matrix of small grid
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
@@ -83,14 +20,175 @@ Feature: Basic Distance Matrix
|
||||
| be |
|
||||
| cf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
| e | 20 | 10 | 0 | 10 |
|
||||
| f | 30 | 20 | 10 | 0 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
| f | 299.5 | 199.5 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel time matrix of network with unroutable parts
|
||||
Scenario: Testbot - Travel distance matrix of minimal network exact distances
|
||||
Given the node map
|
||||
"""
|
||||
a z
|
||||
b
|
||||
c
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| az |
|
||||
| zbcd |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | z | b | c | d |
|
||||
| a | 0 | 100.1 | 199.5 | 298.9 | 398.3 |
|
||||
| z | 100.1 | 0 | 99.4 | 198.8 | 298.2 |
|
||||
| b | 199.5 | 99.4 | 0 | 99.4 | 198.8 |
|
||||
| c | 298.9 | 198.8 | 99.4 | 0 | 99.4 |
|
||||
| d | 398.3 | 298.2 | 198.8 | 99.4 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network with toll exclude
|
||||
Given the query options
|
||||
| exclude | toll |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | toll | # |
|
||||
| ab | motorway | | not drivable for exclude=motorway |
|
||||
| cd | primary | | always drivable |
|
||||
| ac | primary | yes | not drivable for exclude=toll and exclude=motorway,toll |
|
||||
| bd | motorway | yes | not drivable for exclude=toll and exclude=motorway,toll |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 100.1 | | |
|
||||
| b | 100.1 | 0 | | |
|
||||
| c | | | 0 | 100.1 |
|
||||
| d | | | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network with motorway exclude
|
||||
Given the query options
|
||||
| exclude | motorway |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | # |
|
||||
| ab | motorway | not drivable for exclude=motorway |
|
||||
| cd | residential | |
|
||||
| ac | residential | |
|
||||
| bd | residential | |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 298.9 | 99.4 | 199.5 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network disconnected motorway exclude
|
||||
Given the query options
|
||||
| exclude | motorway |
|
||||
And the extract extra arguments "--small-component-size 4"
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
ab efgh
|
||||
cd
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | # |
|
||||
| be | motorway | not drivable for exclude=motorway |
|
||||
| abcd | residential | |
|
||||
| efgh | residential | |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e |
|
||||
| a | 0 | 50.1 | |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network with motorway and toll excludes
|
||||
Given the query options
|
||||
| exclude | motorway,toll |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b e f
|
||||
c d g h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | toll | # |
|
||||
| be | motorway | | not drivable for exclude=motorway |
|
||||
| dg | primary | yes | not drivable for exclude=toll |
|
||||
| abcd | residential | | |
|
||||
| efgh | residential | | |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | g |
|
||||
| a | 0 | 100.1 | | |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix with different way speeds
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | secondary |
|
||||
| cd | tertiary |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 100.1 | 200.1 | 300.2 |
|
||||
| b | 100.1 | 0 | 100.1 | 200.1 |
|
||||
| c | 200.1 | 100.1 | 0 | 100.1 |
|
||||
| d | 300.2 | 200.1 | 100.1 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 100.1 | 200.1 | 300.2 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 100.1 |
|
||||
| c | 200.1 |
|
||||
| d | 300.2 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of small grid
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d e f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| def |
|
||||
| ad |
|
||||
| be |
|
||||
| cf |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
| f | 299.5 | 199.5 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of network with unroutable parts
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
@@ -100,12 +198,12 @@ Feature: Basic Distance Matrix
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 10 |
|
||||
| b | | 0 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 100.1 |
|
||||
| b | | 0 |
|
||||
|
||||
Scenario: Testbot - Travel time matrix of network with oneways
|
||||
Scenario: Testbot - Travel distance matrix of network with oneways
|
||||
Given the node map
|
||||
"""
|
||||
x a b y
|
||||
@@ -118,14 +216,14 @@ Feature: Basic Distance Matrix
|
||||
| xa | |
|
||||
| by | |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | x | y | d | e |
|
||||
| x | 0 | 30 | 40 | 30 |
|
||||
| y | 50 | 0 | 30 | 20 |
|
||||
| d | 20 | 30 | 0 | 30 |
|
||||
| e | 30 | 40 | 10 | 0 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | x | y | d | e |
|
||||
| x | 0 | 300.2 | 399.6 | 299.5 |
|
||||
| y | 499 | 0 | 299.5 | 199.5 |
|
||||
| d | 199.5 | 299.5 | 0 | 298.9 |
|
||||
| e | 299.5 | 399.6 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Rectangular travel time matrix
|
||||
Scenario: Testbot - Rectangular travel distance matrix
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
@@ -140,51 +238,57 @@ Feature: Basic Distance Matrix
|
||||
| be |
|
||||
| cf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
When I route I should get
|
||||
| from | to | distance |
|
||||
| e | a | 200m |
|
||||
| e | b | 100m |
|
||||
| f | a | 299.9m |
|
||||
| f | b | 200m |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 10 |
|
||||
| e | 20 |
|
||||
| f | 30 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 100.1 |
|
||||
| e | 199.5 |
|
||||
| f | 299.5 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 10 |
|
||||
| b | 10 | 0 |
|
||||
| e | 20 | 10 |
|
||||
| f | 30 | 20 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
| e | 20 | 10 | 0 | 10 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 100.1 |
|
||||
| b | 100.1 | 0 |
|
||||
| e | 199.5 | 99.4 |
|
||||
| f | 299.5 | 199.5 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e |
|
||||
| a | 0 | 10 | 20 |
|
||||
| b | 10 | 0 | 10 |
|
||||
| e | 20 | 10 | 0 |
|
||||
| f | 30 | 20 | 10 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
| e | 20 | 10 | 0 | 10 |
|
||||
| f | 30 | 20 | 10 | 0 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e |
|
||||
| a | 0 | 100.1 | 199.5 |
|
||||
| b | 100.1 | 0 | 99.4 |
|
||||
| e | 199.5 | 99.4 | 0 |
|
||||
| f | 299.5 | 199.5 | 100.1 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
| f | 299.5 | 199.5 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel time 3x2 matrix
|
||||
Scenario: Testbot - Travel distance 3x2 matrix
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
@@ -199,10 +303,11 @@ Feature: Basic Distance Matrix
|
||||
| be |
|
||||
| cf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | b | e | f |
|
||||
| a | 10 | 20 | 30 |
|
||||
| b | 0 | 10 | 20 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | b | e | f |
|
||||
| a | 100.1 | 199.5 | 299.5 |
|
||||
| b | 0 | 99.4 | 199.5 |
|
||||
|
||||
Scenario: Testbot - All coordinates are from same small component
|
||||
Given a grid size of 300 meters
|
||||
@@ -221,10 +326,10 @@ Feature: Basic Distance Matrix
|
||||
| da |
|
||||
| fg |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | f | g |
|
||||
| f | 0 | 30 |
|
||||
| g | 30 | 0 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | f | g |
|
||||
| f | 0 | 298.2 |
|
||||
| g | 298.2 | 0 |
|
||||
|
||||
Scenario: Testbot - Coordinates are from different small component and snap to big CC
|
||||
Given a grid size of 300 meters
|
||||
@@ -244,14 +349,25 @@ Feature: Basic Distance Matrix
|
||||
| fg |
|
||||
| hi |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | f | g | h | i |
|
||||
| f | 0 | 30 | 0 | 30 |
|
||||
| g | 30 | 0 | 30 | 0 |
|
||||
| h | 0 | 30 | 0 | 30 |
|
||||
| i | 30 | 0 | 30 | 0 |
|
||||
When I route I should get
|
||||
| from | to | distance |
|
||||
| f | g | 300m |
|
||||
| f | i | 300m |
|
||||
| g | f | 300m |
|
||||
| g | h | 300m |
|
||||
| h | g | 300m |
|
||||
| h | i | 300m |
|
||||
| i | f | 300m |
|
||||
| i | h | 300m |
|
||||
|
||||
Scenario: Testbot - Travel time matrix with loops
|
||||
When I request a travel distance matrix I should get
|
||||
| | f | g | h | i |
|
||||
| f | 0 | 298.2 | 0 | 298.2 |
|
||||
| g | 298.2 | 0 | 298.2 | 0 |
|
||||
| h | 0 | 298.2 | 0 | 298.2 |
|
||||
| i | 298.2 | 0 | 298.2 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix with loops
|
||||
Given the node map
|
||||
"""
|
||||
a 1 2 b
|
||||
@@ -265,14 +381,15 @@ Feature: Basic Distance Matrix
|
||||
| cd | yes |
|
||||
| da | yes |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | 1 | 2 | 3 | 4 |
|
||||
| 1 | 0 | 10 +-1 | 40 +-1 | 50 +-1 |
|
||||
| 2 | 70 +-1 | 0 | 30 +-1 | 40 +-1 |
|
||||
| 3 | 40 +-1 | 50 +-1 | 0 | 10 +-1 |
|
||||
| 4 | 30 +-1 | 40 +-1 | 70 +-1 | 0 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | 1 | 2 | 3 | 4 |
|
||||
| 1 | 0 | 100.1 | 399.6 | 499.7 |
|
||||
| 2 | 699.1 | 0 | 299.5 | 399.6 |
|
||||
| 3 | 399.6 | 499.7 | 0 | 100.1 |
|
||||
| 4 | 299.5 | 399.6 | 699.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel time matrix based on segment durations
|
||||
|
||||
Scenario: Testbot - Travel distance matrix based on segment durations
|
||||
Given the profile file
|
||||
"""
|
||||
local functions = require('testbot')
|
||||
@@ -301,20 +418,19 @@ Feature: Basic Distance Matrix
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abcd |
|
||||
| ce |
|
||||
| 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 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d | e |
|
||||
| a | 0 | 100.1 | 200.1 | 300.2 | 398.9 |
|
||||
| b | 100.1 | 0 | 100.1 | 200.1 | 298.9 |
|
||||
| c | 200.1 | 100.1 | 0 | 100.1 | 198.8 |
|
||||
| d | 300.2 | 200.1 | 100.1 | 0 | 298.9 |
|
||||
| e | 398.9 | 298.9 | 198.8 | 298.9 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix for alternative loop paths
|
||||
Scenario: Testbot - Travel distance matrix for alternative loop paths
|
||||
Given the profile file
|
||||
"""
|
||||
local functions = require('testbot')
|
||||
@@ -350,62 +466,156 @@ Feature: Basic Distance Matrix
|
||||
| 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 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
| 1 | 0 | 1096.7 | 298.9 | 199.5 | 598.4 | 498.3 | 897.3 | 797.9 |
|
||||
| 2 | 100.1 | 0 | 398.9 | 299.5 | 698.5 | 598.4 | 997.3 | 897.9 |
|
||||
| 3 | 897.9 | 797.9 | 0 | 1097.4 | 299.5 | 199.5 | 598.4 | 499 |
|
||||
| 4 | 997.3 | 897.3 | 99.4 | 0 | 398.9 | 298.9 | 697.8 | 598.4 |
|
||||
| 5 | 598.4 | 498.3 | 897.3 | 797.9 | 0 | 1096.7 | 298.9 | 199.5 |
|
||||
| 6 | 698.5 | 598.4 | 997.3 | 897.9 | 100.1 | 0 | 398.9 | 299.5 |
|
||||
| 7 | 299.5 | 199.5 | 598.4 | 499 | 897.9 | 797.9 | 0 | 1097.4 |
|
||||
| 8 | 398.9 | 298.9 | 697.8 | 598.4 | 997.3 | 897.3 | 99.4 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | 1 |
|
||||
| 1 | 0 |
|
||||
| 2 | 100.1 |
|
||||
| 3 | 897.9 |
|
||||
| 4 | 997.3 |
|
||||
| 5 | 598.4 |
|
||||
| 6 | 698.5 |
|
||||
| 7 | 299.5 |
|
||||
| 8 | 398.9 |
|
||||
|
||||
Scenario: Testbot - Travel time matrix with ties
|
||||
Given the profile file
|
||||
"""
|
||||
local functions = require('testbot')
|
||||
functions.process_segment = function(profile, segment)
|
||||
segment.weight = 1
|
||||
segment.duration = 1
|
||||
end
|
||||
functions.process_turn = function(profile, turn)
|
||||
if turn.angle >= 0 then
|
||||
turn.duration = 16
|
||||
else
|
||||
turn.duration = 4
|
||||
end
|
||||
turn.weight = 0
|
||||
end
|
||||
return functions
|
||||
"""
|
||||
And the node map
|
||||
Scenario: Testbot - Travel distance matrix with ties
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
a b
|
||||
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| ac |
|
||||
| bd |
|
||||
| dc |
|
||||
|
||||
| nodes |
|
||||
| ab |
|
||||
| ac |
|
||||
| bd |
|
||||
| dc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance | time | weight |
|
||||
| a | c | ac,ac | 200m | 5s | 5 |
|
||||
| from | to | route | distance | time | weight |
|
||||
| a | c | ac,ac | 200m | 20s | 20 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 1 | 5 | 10 |
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| a | b | ab,ab | 450m |
|
||||
| a | c | ac,ac | 200m |
|
||||
| a | d | ac,dc,dc | 499.9m |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 1 |
|
||||
| c | 15 |
|
||||
| d | 10 |
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 450.3 | 198.8 | 499 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 450.3 |
|
||||
| c | 198.8 |
|
||||
| d | 499 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | c |
|
||||
| a | 0 | 198.8 |
|
||||
| c | 198.8 | 0 |
|
||||
|
||||
|
||||
# Check rounding errors
|
||||
Scenario: Testbot - Long distances in tables
|
||||
Given a grid size of 1000 meters
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abcd |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 1000.7 | 2001.4 | 3002.1 |
|
||||
|
||||
|
||||
Scenario: Testbot - OneToMany vs ManyToOne
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| ac | |
|
||||
| bc | |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b |
|
||||
| b | 240.4 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 240.4 |
|
||||
|
||||
Scenario: Testbot - Varying distances between nodes
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
|
||||
e
|
||||
|
||||
|
||||
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| feabcd | yes |
|
||||
| ec | |
|
||||
| fd | |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d | e | f |
|
||||
| a | 0 | 100.1 | 300.2 | 650.5 | 1930.6 | 1533 |
|
||||
| b | 759 | 0 | 200.1 | 550.4 | 1830.5 | 1432.9 |
|
||||
| c | 558.8 | 658.9 | 0 | 350.3 | 1630.4 | 1232.8 |
|
||||
| d | 1478.9 | 1579 | 1779.1 | 0 | 1280.1 | 882.5 |
|
||||
| e | 198.8 | 298.9 | 499 | 710.3 | 0 | 1592.8 |
|
||||
| f | 596.4 | 696.5 | 896.6 | 1107.9 | 397.6 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Filling in noroutes with estimates
|
||||
Given a grid size of 300 meters
|
||||
Given the extract extra arguments "--small-component-size 4"
|
||||
Given the query options
|
||||
| noroute_estimate | 5 |
|
||||
Given the node map
|
||||
"""
|
||||
a b f h
|
||||
d e g i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abeda |
|
||||
| fhigf |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | f | h |
|
||||
| a | 0 | 300.2 | 900.7 | 1200.9 |
|
||||
| b | 300.2 | 0 | 600.5 | 900.7 |
|
||||
| f | 900.7 | 600.5 | 0 | 302.2 |
|
||||
| h | 1200.9 | 900.7 | 300.2 | 0 |
|
||||
@@ -0,0 +1,535 @@
|
||||
@matrix @testbot
|
||||
Feature: Basic Duration Matrix
|
||||
# note that results of travel time are in seconds
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16"
|
||||
|
||||
Scenario: Testbot - Travel time matrix of minimal network
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 10 |
|
||||
| b | 10 | 0 |
|
||||
|
||||
@ch
|
||||
Scenario: Testbot - Travel time matrix of minimal network with toll exclude
|
||||
Given the query options
|
||||
| exclude | toll |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | toll | # |
|
||||
| ab | motorway | | not drivable for exclude=motorway |
|
||||
| cd | primary | | always drivable |
|
||||
| ac | motorway | yes | not drivable for exclude=toll and exclude=motorway,toll |
|
||||
| bd | motorway | yes | not drivable for exclude=toll and exclude=motorway,toll |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 15 | | |
|
||||
| b | 15 | 0 | | |
|
||||
| c | | | 0 | 10 |
|
||||
| d | | | 10 | 0 |
|
||||
|
||||
@ch
|
||||
Scenario: Testbot - Travel time matrix of minimal network with motorway exclude
|
||||
Given the query options
|
||||
| exclude | motorway |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | # |
|
||||
| ab | motorway | not drivable for exclude=motorway |
|
||||
| cd | residential | |
|
||||
| ac | residential | |
|
||||
| bd | residential | |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 45 | 15 | 30 |
|
||||
|
||||
@ch
|
||||
Scenario: Testbot - Travel time matrix of minimal network disconnected motorway exclude
|
||||
Given the query options
|
||||
| exclude | motorway |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
ab efgh
|
||||
cd
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | # |
|
||||
| be | motorway | not drivable for exclude=motorway |
|
||||
| abcd | residential | |
|
||||
| efgh | residential | |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e |
|
||||
| a | 0 | 7.5 | |
|
||||
|
||||
@ch
|
||||
Scenario: Testbot - Travel time matrix of minimal network with motorway and toll excludes
|
||||
Given the query options
|
||||
| exclude | motorway,toll |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b e f
|
||||
c d g h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | toll | # |
|
||||
| be | motorway | | not drivable for exclude=motorway |
|
||||
| dg | primary | yes | not drivable for exclude=toll |
|
||||
| abcd | residential | | |
|
||||
| efgh | residential | | |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | g |
|
||||
| a | 0 | 15 | | |
|
||||
|
||||
Scenario: Testbot - Travel time matrix with different way speeds
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | secondary |
|
||||
| cd | tertiary |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 10 | 30 | 60 |
|
||||
| b | 10 | 0 | 20 | 50 |
|
||||
| c | 30 | 20 | 0 | 30 |
|
||||
| d | 60 | 50 | 30 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 10 | 30 | 60 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 10 |
|
||||
| c | 30 |
|
||||
| d | 60 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix of small grid
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d e f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| def |
|
||||
| ad |
|
||||
| be |
|
||||
| cf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
| e | 20 | 10 | 0 | 10 |
|
||||
| f | 30 | 20 | 10 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix of network with unroutable parts
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 10 |
|
||||
| b | | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix of network with oneways
|
||||
Given the node map
|
||||
"""
|
||||
x a b y
|
||||
d e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abeda | yes |
|
||||
| xa | |
|
||||
| by | |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | x | y | d | e |
|
||||
| x | 0 | 30 | 40 | 30 |
|
||||
| y | 50 | 0 | 30 | 20 |
|
||||
| d | 20 | 30 | 0 | 30 |
|
||||
| e | 30 | 40 | 10 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Rectangular travel time matrix
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d e f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| def |
|
||||
| ad |
|
||||
| be |
|
||||
| cf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 10 |
|
||||
| e | 20 |
|
||||
| f | 30 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 10 |
|
||||
| b | 10 | 0 |
|
||||
| e | 20 | 10 |
|
||||
| f | 30 | 20 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
| e | 20 | 10 | 0 | 10 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e |
|
||||
| a | 0 | 10 | 20 |
|
||||
| b | 10 | 0 | 10 |
|
||||
| e | 20 | 10 | 0 |
|
||||
| f | 30 | 20 | 10 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 10 | 20 | 30 |
|
||||
| b | 10 | 0 | 10 | 20 |
|
||||
| e | 20 | 10 | 0 | 10 |
|
||||
| f | 30 | 20 | 10 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel time 3x2 matrix
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d e f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| def |
|
||||
| ad |
|
||||
| be |
|
||||
| cf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | b | e | f |
|
||||
| a | 10 | 20 | 30 |
|
||||
| b | 0 | 10 | 20 |
|
||||
|
||||
|
||||
Scenario: Testbot - All coordinates are from same small component
|
||||
Given a grid size of 300 meters
|
||||
Given the extract extra arguments "--small-component-size 4"
|
||||
Given the node map
|
||||
"""
|
||||
a b f
|
||||
d e g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| be |
|
||||
| ed |
|
||||
| da |
|
||||
| fg |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | f | g |
|
||||
| f | 0 | 30 |
|
||||
| g | 30 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Coordinates are from different small component and snap to big CC
|
||||
Given a grid size of 300 meters
|
||||
Given the extract extra arguments "--small-component-size 4"
|
||||
Given the node map
|
||||
"""
|
||||
a b f h
|
||||
d e g i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| be |
|
||||
| ed |
|
||||
| da |
|
||||
| fg |
|
||||
| hi |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | f | g | h | i |
|
||||
| f | 0 | 30 | 0 | 30 |
|
||||
| g | 30 | 0 | 30 | 0 |
|
||||
| h | 0 | 30 | 0 | 30 |
|
||||
| i | 30 | 0 | 30 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix with loops
|
||||
Given the node map
|
||||
"""
|
||||
a 1 2 b
|
||||
d 4 3 c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| bc | yes |
|
||||
| cd | yes |
|
||||
| da | yes |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | 1 | 2 | 3 | 4 |
|
||||
| 1 | 0 | 10 +-1 | 40 +-1 | 50 +-1 |
|
||||
| 2 | 70 +-1 | 0 | 30 +-1 | 40 +-1 |
|
||||
| 3 | 40 +-1 | 50 +-1 | 0 | 10 +-1 |
|
||||
| 4 | 30 +-1 | 40 +-1 | 70 +-1 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix based on segment durations
|
||||
Given the profile file
|
||||
"""
|
||||
local functions = require('testbot')
|
||||
functions.setup_testbot = functions.setup
|
||||
|
||||
functions.setup = function()
|
||||
local profile = functions.setup_testbot()
|
||||
profile.traffic_signal_penalty = 0
|
||||
profile.u_turn_penalty = 0
|
||||
return profile
|
||||
end
|
||||
|
||||
functions.process_segment = function(profile, segment)
|
||||
segment.weight = 2
|
||||
segment.duration = 11
|
||||
end
|
||||
|
||||
return functions
|
||||
"""
|
||||
|
||||
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
|
||||
"""
|
||||
local functions = require('testbot')
|
||||
functions.setup_testbot = functions.setup
|
||||
|
||||
functions.setup = function()
|
||||
local profile = functions.setup_testbot()
|
||||
profile.traffic_signal_penalty = 0
|
||||
profile.u_turn_penalty = 0
|
||||
profile.weight_precision = 3
|
||||
return profile
|
||||
end
|
||||
|
||||
functions.process_segment = function(profile, segment)
|
||||
segment.weight = 777
|
||||
segment.duration = 3
|
||||
end
|
||||
|
||||
return functions
|
||||
"""
|
||||
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 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix with ties
|
||||
Given the profile file
|
||||
"""
|
||||
local functions = require('testbot')
|
||||
functions.process_segment = function(profile, segment)
|
||||
segment.weight = 1
|
||||
segment.duration = 1
|
||||
end
|
||||
functions.process_turn = function(profile, turn)
|
||||
if turn.angle >= 0 then
|
||||
turn.duration = 16
|
||||
else
|
||||
turn.duration = 4
|
||||
end
|
||||
turn.weight = 0
|
||||
end
|
||||
return functions
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
a b
|
||||
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| ac |
|
||||
| bd |
|
||||
| dc |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance | time | weight |
|
||||
| a | c | ac,ac | 200m | 5s | 5 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 1 | 5 | 10 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 1 |
|
||||
| c | 15 |
|
||||
| d | 10 |
|
||||
|
||||
Scenario: Testbot - OneToMany vs ManyToOne
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
| ac | |
|
||||
| bc | |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b |
|
||||
| b | 24.1 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 24.1 |
|
||||
|
||||
Scenario: Testbot - Filling in noroutes with estimates
|
||||
Given a grid size of 300 meters
|
||||
Given the extract extra arguments "--small-component-size 4"
|
||||
Given the query options
|
||||
| noroute_estimate | 5 |
|
||||
Given the node map
|
||||
"""
|
||||
a b f h
|
||||
d e g i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abeda |
|
||||
| fhigf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | h |
|
||||
| a | 0 | 30 | 18 | 24 |
|
||||
| b | 30 | 0 | 12 | 18 |
|
||||
| f | 18 | 12 | 0 | 30 |
|
||||
| h | 24 | 18 | 30 | 0 |
|
||||
@@ -0,0 +1,68 @@
|
||||
@routing @testbot @exclude
|
||||
Feature: Testbot - Exclude flags regression tests
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
Scenario: Testbot - Exclude toll regression 1
|
||||
Given the node map
|
||||
"""
|
||||
a g
|
||||
. .
|
||||
b....d-$-$-e....f
|
||||
. .
|
||||
c h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | toll | # |
|
||||
| ab | primary | | always drivable |
|
||||
| cb | primary | | always drivable |
|
||||
| bd | primary | | always drivable |
|
||||
| de | motorway | yes | not drivable for exclude=toll |
|
||||
| ef | primary | | always drivable |
|
||||
| fg | primary | | always drivable |
|
||||
| fh | primary | | always drivable |
|
||||
|
||||
Given the query options
|
||||
| exclude | toll |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | h | |
|
||||
| a | g | |
|
||||
| g | a | |
|
||||
| d | e | |
|
||||
|
||||
Scenario: Testbot - Exclude toll regression 2
|
||||
Given the profile "testbot"
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a g
|
||||
. .
|
||||
b....d-$-$-e....f
|
||||
. .
|
||||
c h..i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | toll | # |
|
||||
| ab | primary | | always drivable |
|
||||
| cb | primary | | always drivable |
|
||||
| bd | primary | | always drivable |
|
||||
| de | motorway | yes | not drivable for exclude=toll |
|
||||
| ef | primary | | always drivable |
|
||||
| fg | primary | | always drivable |
|
||||
| fh | primary | | always drivable |
|
||||
| hi | primary | | always drivable |
|
||||
|
||||
Given the query options
|
||||
| exclude | toll |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | h | |
|
||||
| a | g | |
|
||||
| g | a | |
|
||||
| d | e | |
|
||||
| d | i | |
|
||||
@@ -39,5 +39,64 @@ Feature: Fixed bugs, kept to check for regressions
|
||||
| de | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| 1 | 2 | bcd,bcd |
|
||||
| from | to | route |
|
||||
| 1 | 2 | bcd,bcd |
|
||||
|
||||
#############################
|
||||
# This test models the OSM map at the location for
|
||||
# https://github.com/Project-OSRM/osrm-backend/issues/5039
|
||||
#############################
|
||||
Scenario: Mixed Entry and Exit and segregated
|
||||
Given the profile file "car" initialized with
|
||||
"""
|
||||
profile.properties.left_hand_driving = true
|
||||
"""
|
||||
Given the node locations
|
||||
| node | lon | lat |
|
||||
| a | 171.12889297029 | -42.58425289548 |
|
||||
| b | 171.1299357 | -42.5849295 |
|
||||
| c | 171.1295427 | -42.5849385 |
|
||||
| d | 171.1297356 | -42.5852029 |
|
||||
| e | 171.1296909 | -42.5851986 |
|
||||
| f | 171.1295097 | -42.585007 |
|
||||
| g | 171.1298225 | -42.5851928 |
|
||||
| h | 171.1300262 | -42.5859122 |
|
||||
| i | 171.1292651 | -42.584698 |
|
||||
| j | 171.1297209 | -42.5848569 |
|
||||
| k | 171.1297188 | -42.5854056 |
|
||||
| l | 171.1298326 | -42.5857266 |
|
||||
| m | 171.1298871 | -42.5848922 |
|
||||
| n | 171.1296505 | -42.585189 |
|
||||
| o | 171.1295206 | -42.5850862 |
|
||||
| p | 171.1296106 | -42.5848862 |
|
||||
| q | 171.1299784 | -42.5850191 |
|
||||
| r | 171.1298867 | -42.5851671 |
|
||||
| s | 171.1306955 | -42.5845812 |
|
||||
| t | 171.129525 | -42.584807 |
|
||||
| u | 171.1299705 | -42.584984 |
|
||||
| v | 171.1299067 | -42.5849073 |
|
||||
| w | 171.1302061 | -42.5848173 |
|
||||
| x | 171.12975 | -42.5855753 |
|
||||
| y | 171.129969 | -42.585079 |
|
||||
| 1 | 171.131511926651| -42.584306746421966 |
|
||||
| 2 | 171.128743886947| -42.58414875714669 |
|
||||
And the ways
|
||||
| nodes | highway | maxspeed | name | ref | surface | junction | oneway |
|
||||
| ws | primary | 100 | Taramakau Highway | SH 6 | asphalt | | |
|
||||
| kxlh | trunk | | Otira Highway | SH 73 | | | |
|
||||
| ai | primary | 100 | Kumara Junction Highway | SH 6 | asphalt | | |
|
||||
| qyrgdenof | primary | 100 | Kumara Junction | | | roundabout | yes |
|
||||
| ke | trunk | | Otira Highway | SH 73 | | | yes |
|
||||
| itj | primary | 100 | Kumara Junction Highway | SH 6 | | | yes |
|
||||
| gk | trunk | | Otira Highway | SH 73 | | | yes |
|
||||
| fi | primary | 100 | Kumara Junction Highway | SH 6 | | | yes |
|
||||
| wq | primary | 100 | Taramakau Highway | SH 6 | | | yes |
|
||||
| vw | primary | 100 | Taramakau Highway | SH 6 | | | yes |
|
||||
| vbuq | primary | 100 | Kumara Junction | | | roundabout | yes |
|
||||
| jmv | primary | 100 | Kumara Junction | | | roundabout | yes |
|
||||
| fcpj | primary | 100 | Kumara Junction | | | roundabout | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| 1,2 | Taramakau Highway,Kumara Junction Highway,Kumara Junction Highway,Kumara Junction Highway | depart,Kumara Junction-exit-2,exit rotary slight left,arrive |
|
||||
|
||||
|
||||
@@ -480,3 +480,316 @@ Feature: Basic Map Matching
|
||||
| trace | a:nodes |
|
||||
| 12 | 1:2:3:4:5:6 |
|
||||
| 21 | 6:5:4:3:2:1 |
|
||||
|
||||
|
||||
Scenario: Matching with waypoints param for start/end
|
||||
Given the node map
|
||||
"""
|
||||
a-----b---c
|
||||
|
|
||||
|
|
||||
d
|
||||
|
|
||||
|
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abc | no |
|
||||
| bde | no |
|
||||
|
||||
Given the query options
|
||||
| waypoints | 0;3 |
|
||||
|
||||
When I match I should get
|
||||
| trace | code | matchings | waypoints |
|
||||
| abde | Ok | abde | ae |
|
||||
|
||||
Scenario: Matching with waypoints param that were tidied away
|
||||
Given the node map
|
||||
"""
|
||||
a - b - c - e
|
||||
|
|
||||
f
|
||||
|
|
||||
g
|
||||
"""
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abce | no |
|
||||
| cfg | no |
|
||||
|
||||
Given the query options
|
||||
| tidy | true |
|
||||
| waypoints | 0;2;5 |
|
||||
|
||||
When I match I should get
|
||||
| trace | code | matchings | waypoints |
|
||||
| abccfg | Ok | abcfg | acg |
|
||||
|
||||
Scenario: Testbot - Map matching refuses to use waypoints with trace splitting
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
e
|
||||
"""
|
||||
Given the query options
|
||||
| waypoints | 0;3 |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcd | no |
|
||||
|
||||
When I match I should get
|
||||
| trace | timestamps | code |
|
||||
| abcd | 0 1 62 63 | NoMatch |
|
||||
|
||||
Scenario: Testbot - Map matching invalid waypoints
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
e
|
||||
"""
|
||||
Given the query options
|
||||
| waypoints | 0;4 |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcd | no |
|
||||
|
||||
When I match I should get
|
||||
| trace | code |
|
||||
| abcd | InvalidOptions |
|
||||
|
||||
Scenario: Matching fail with waypoints param missing start/end
|
||||
Given the node map
|
||||
"""
|
||||
a-----b---c
|
||||
|
|
||||
|
|
||||
d
|
||||
|
|
||||
|
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abc | no |
|
||||
| bde | no |
|
||||
|
||||
Given the query options
|
||||
| waypoints | 1;3 |
|
||||
|
||||
When I match I should get
|
||||
| trace | code |
|
||||
| abde | InvalidValue |
|
||||
|
||||
Scenario: Testbot - Map matching with outlier that has no candidate and waypoint parameter
|
||||
Given a grid size of 100 meters
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
|
||||
1
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abcd | no |
|
||||
|
||||
Given the query options
|
||||
| waypoints | 0;2;3 |
|
||||
|
||||
When I match I should get
|
||||
| trace | timestamps | code |
|
||||
| ab1d | 0 1 2 3 | NoMatch |
|
||||
|
||||
Scenario: Regression test - avoid collapsing legs of a tidied split trace
|
||||
Given a grid size of 20 meters
|
||||
Given the node map
|
||||
"""
|
||||
a--b--f
|
||||
|
|
||||
|
|
||||
e--c---d--g
|
||||
"""
|
||||
Given the query options
|
||||
| tidy | true |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abf | no |
|
||||
| be | no |
|
||||
| ecdg | no |
|
||||
|
||||
When I match I should get
|
||||
| trace | timestamps | matchings | code |
|
||||
| abbecd | 10 11 27 1516914902 1516914913 1516914952 | ab,ecd | Ok |
|
||||
|
||||
Scenario: Regression test - waypoints trimming too much geometry
|
||||
# fixes bug in map matching collapsing that was dropping path geometries
|
||||
# after segments that had 0 distance in internal route results
|
||||
Given the node map
|
||||
"""
|
||||
ad
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|e g
|
||||
b--------------c
|
||||
f h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
Given the query options
|
||||
| waypoints | 0;4 |
|
||||
| overview | full |
|
||||
|
||||
When I match I should get
|
||||
| trace | geometry | code |
|
||||
| defgh | 1,1,1,0.999461,1.000674,0.999461 | Ok |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - waypoints trimming too much geometry
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
Given the query options
|
||||
| geometries | geojson |
|
||||
Given the node map
|
||||
"""
|
||||
bh
|
||||
|
|
||||
|
|
||||
|
|
||||
c
|
||||
g\
|
||||
\k
|
||||
\
|
||||
\
|
||||
\
|
||||
j f
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| hc |
|
||||
| cf |
|
||||
Given the query options
|
||||
| waypoints | 0;3 |
|
||||
| overview | full |
|
||||
When I match I should get
|
||||
| trace | geometry | code |
|
||||
| bgkj | 1.000135,1,1.000135,0.99964,1.000387,0.999137 | Ok |
|
||||
|
||||
|
||||
@match @testbot
|
||||
# Regression test for issue #4919
|
||||
Scenario: Regression test - non-uturn maneuver preferred over uturn
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
Given the query options
|
||||
| geometries | geojson |
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
;
|
||||
;
|
||||
a----hb-----c
|
||||
;
|
||||
;
|
||||
d
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| dbe |
|
||||
Given the query options
|
||||
| waypoints | 0;2 |
|
||||
| overview | full |
|
||||
| steps | true |
|
||||
When I match I should get
|
||||
| trace | geometry | turns | code |
|
||||
| abc | 1,0.99973,1.00027,0.99973,1.000539,0.99973 | depart,arrive | Ok |
|
||||
| abd | 1,0.99973,1.00027,0.99973,1.00027,0.999461 | depart,turn right,arrive | Ok |
|
||||
| abe | 1,0.99973,1.00027,0.99973,1.00027,1 | depart,turn left,arrive | Ok |
|
||||
| ahd | 1,0.99973,1.00027,0.99973,1.00027,0.999461 | depart,turn right,arrive | Ok |
|
||||
| ahe | 1,0.99973,1.00027,0.99973,1.00027,1 | depart,turn left,arrive | Ok |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - add source phantoms properly (one phantom on one edge)
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
Given the node map
|
||||
"""
|
||||
a--1-b2-cd3--e
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bcd |
|
||||
| de |
|
||||
Given the query options
|
||||
| geometries | geojson |
|
||||
| overview | full |
|
||||
| steps | true |
|
||||
| waypoints | 0;2 |
|
||||
| annotations | duration,weight |
|
||||
| generate_hints | false |
|
||||
When I match I should get
|
||||
| trace | geometry | a:duration | a:weight | duration |
|
||||
| 123 | 1.000135,1,1.000225,1,1.00036,1,1.000405,1,1.00045,1 | 1:1.5:0.5:0.5 | 1:1.5:0.5:0.5 | 3.5 |
|
||||
| 321 | 1.00045,1,1.000405,1,1.00036,1,1.000225,1,1.000135,1 | 0.5:0.5:1.5:1 | 0.5:0.5:1.5:1 | 3.5 |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
Given the node map
|
||||
"""
|
||||
a--1-b23-c4--d
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
| cd |
|
||||
Given the query options
|
||||
| geometries | geojson |
|
||||
| overview | full |
|
||||
| steps | true |
|
||||
| waypoints | 0;3 |
|
||||
| annotations | duration,weight |
|
||||
| generate_hints | false |
|
||||
When I match I should get
|
||||
| trace | geometry | a:duration | a:weight | duration |
|
||||
| 1234 | 1.000135,1,1.000225,1,1.000405,1,1.00045,1 | 1:2:0.5 | 1:2:0.5 | 3.5 |
|
||||
| 4321 | 1.00045,1,1.000405,1,1.000225,1,1.000135,1 | 0.5:2:1 | 0.5:2:1 | 3.5 |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
Given the node map
|
||||
"""
|
||||
a--12345-b
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
Given the query options
|
||||
| geometries | geojson |
|
||||
| overview | full |
|
||||
| steps | true |
|
||||
| waypoints | 0;3 |
|
||||
| annotations | duration,weight,distance |
|
||||
| generate_hints | false |
|
||||
|
||||
# These should have the same weights/duration in either direction
|
||||
When I match I should get
|
||||
| trace | geometry | a:distance | a:duration | a:weight | duration |
|
||||
| 2345 | 1.00018,1,1.000315,1 | 15.013264 | 1.5 | 1.5 | 1.5 |
|
||||
| 4321 | 1.00027,1,1.000135,1 | 15.013264 | 1.5 | 1.5 | 1.5 |
|
||||
@@ -38,15 +38,15 @@ Feature: Multi level routing
|
||||
Scenario: Testbot - Multi level routing
|
||||
Given the node map
|
||||
"""
|
||||
a───b e───f
|
||||
│ │ │ │
|
||||
a────b e─────f
|
||||
\ │ │ /
|
||||
d───c h───g
|
||||
╲ ╱
|
||||
╳
|
||||
╱ ╲
|
||||
i───j m───n
|
||||
│ │ │ │
|
||||
l───k───p───o
|
||||
/ │ │ \
|
||||
l─────k───p─────o
|
||||
"""
|
||||
|
||||
And the nodes
|
||||
@@ -67,44 +67,76 @@ Feature: Multi level routing
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | b | abcda,abcda | 20s |
|
||||
| a | f | abcda,cm,mnopm,kp,ijkli,hj,efghe,efghe | 229.4s |
|
||||
| a | l | abcda,cm,mnopm,kp,ijkli,ijkli | 144.7s |
|
||||
| a | o | abcda,cm,mnopm,mnopm,mnopm | 124.7s |
|
||||
| f | l | efghe,hj,ijkli,ijkli,ijkli | 124.7s |
|
||||
| f | o | efghe,hj,ijkli,kp,mnopm,mnopm | 144.7s |
|
||||
| l | o | ijkli,kp,mnopm,mnopm | 60s |
|
||||
| a | b | abcda,abcda | 25s |
|
||||
| a | f | abcda,cm,mnopm,kp,ijkli,hj,efghe,efghe | 239.2s |
|
||||
| a | l | abcda,cm,mnopm,kp,ijkli,ijkli | 157.1s |
|
||||
| a | o | abcda,cm,mnopm,mnopm,mnopm | 137.1s |
|
||||
| f | l | efghe,hj,ijkli,ijkli | 136.7s |
|
||||
| f | o | efghe,hj,ijkli,kp,mnopm,mnopm | 162.1s |
|
||||
| l | o | ijkli,kp,mnopm,mnopm | 80s |
|
||||
| c | m | cm,cm | 44.7s |
|
||||
| f | a | efghe,hj,ijkli,kp,mnopm,cm,abcda,abcda | 239.2s |
|
||||
| l | a | ijkli,kp,mnopm,cm,abcda,abcda | 157.1s |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 229.4 | 144.7 | 124.7 |
|
||||
| f | 229.4 | 0 | 124.7 | 144.7 |
|
||||
| l | 144.7 | 124.7 | 0 | 60 |
|
||||
| o | 124.7 | 144.7 | 60 | 0 |
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 239.2 | 157.1 | 137.1 |
|
||||
| f | 239.2 | 0 | 136.7 | 162.1 |
|
||||
| l | 157.1 | 136.7 | 0 | 80 |
|
||||
| o | 137.1 | 162.1 | 80 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 229.4 | 144.7 | 124.7 |
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 239.2 | 157.1 | 137.1 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| f | 229.4 |
|
||||
| l | 144.7 |
|
||||
| o | 124.7 |
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| f | 239.2 |
|
||||
| l | 157.1 |
|
||||
| o | 137.1 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 229.4 | 144.7 | 124.7 |
|
||||
| o | 124.7 | 144.7 | 60 | 0 |
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 239.2 | 157.1 | 137.1 |
|
||||
| o | 137.1 | 162.1 | 80 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | o |
|
||||
| a | 0 | 124.7 |
|
||||
| f | 229.4 | 144.7 |
|
||||
| l | 144.7 | 60 |
|
||||
| o | 124.7 | 0 |
|
||||
| a | 0 | 137.1 |
|
||||
| f | 239.2 | 162.1 |
|
||||
| l | 157.1 | 80 |
|
||||
| o | 137.1 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 2383.7 | 1566.9 | 1366.8 |
|
||||
| f | 2339.9 | 0 | 1198.1 | 1522.1 |
|
||||
| l | 1618.3 | 1293.3 | 0 | 800.5 |
|
||||
| o | 1418.2 | 1617.3 | 800.5 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 2383.7 | 1566.9 | 1366.8 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| f | 2339.9 |
|
||||
| l | 1618.3 |
|
||||
| o | 1418.2 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 2383.7 | 1566.9 | 1366.8 |
|
||||
| f | 2339.9 | 0 | 1198.1 | 1522.1 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | o |
|
||||
| a | 0 | 1366.8 |
|
||||
| f | 2339.9 | 1522.1 |
|
||||
| l | 1618.3 | 800.5 |
|
||||
| o | 1418.2 | 0 |
|
||||
|
||||
Scenario: Testbot - Multi level routing: horizontal road
|
||||
Given the node map
|
||||
|
||||
@@ -48,13 +48,13 @@ Feature: Traffic - speeds
|
||||
|
||||
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 | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0 |
|
||||
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
||||
| 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 |
|
||||
| a | g | ad,df,fb,fb | 30 km/h | 1295.7,487.5,304.7,0 | 1:0:0 |
|
||||
|
||||
|
||||
Scenario: Weighting based on speed file weights, ETA based on file durations
|
||||
@@ -74,12 +74,12 @@ Feature: Traffic - speeds
|
||||
|
||||
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 | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0 |
|
||||
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
|
||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1:0 |
|
||||
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1 |
|
||||
| a | g | ab,ab | 1 km/h | 10010.3,0 | 1 |
|
||||
|
||||
|
||||
@@ -106,14 +106,14 @@ Feature: Traffic - speeds
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed | weights | a:datasources |
|
||||
| a | b | ab,ab | 1 km/h | 20020.73,0 | 1:0 |
|
||||
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 741.51,0 | 1:0 |
|
||||
| a | b | ab,ab | 1 km/h | 20020.73,0 | 1 |
|
||||
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1 |
|
||||
| b | c | bc,bc | 27 km/h | 741.51,0 | 1 |
|
||||
| a | d | ab,eb,de,de | 2 km/h | 20020.73,378.17,400.41,0 | 1:0:0 |
|
||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||
| g | b | ab,ab | 1 km/h | 10010.37,0 | 1:0 |
|
||||
| g | b | ab,ab | 1 km/h | 10010.37,0 | 1 |
|
||||
| a | g | ab,ab | 1 km/h | 10010.36,0 | 1 |
|
||||
| g | a | ab,ab | 1 km/h | 10010.36,0 | 1:1 |
|
||||
| g | a | ab,ab | 1 km/h | 10010.36,0 | 1 |
|
||||
|
||||
|
||||
Scenario: Speeds that isolate a single node (a)
|
||||
@@ -135,14 +135,14 @@ Feature: Traffic - speeds
|
||||
| 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 |
|
||||
| from | to | route | speed | weights | a:datasources | a:speed | a:nodes|
|
||||
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 | 10 | 6:2 |
|
||||
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1 | 10:7.5 | 6:2:3 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 | 7.5 | 2:3 |
|
||||
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0 | 10:10 | 2:6:4 |
|
||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 | 10 | 4:3 |
|
||||
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
||||
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
||||
|
||||
|
||||
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||
|
||||
@@ -309,7 +309,7 @@ Feature: Via points
|
||||
| waypoints | route |
|
||||
| a,b,e | |
|
||||
|
||||
@todo @3359
|
||||
@3359
|
||||
Scenario: U-Turn In Bearings
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
@@ -53,8 +53,8 @@ Feature: Weight tests
|
||||
|
||||
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,t | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 2.1 | 2.1 | 9.5 |
|
||||
| t,s | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 2.1 | 2.1 | 9.5 |
|
||||
| s,e | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 30.026527:10.008842 | 3.1:1 | 3.1:1 | 9.7:10 |
|
||||
| e,s | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 10.008842:30.026527 | 1:3.1 | 1:3.1 | 10:9.7 |
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
||||
});
|
||||
non_core_edges.resize(new_end - non_core_edges.begin());
|
||||
edge_container.Insert(std::move(non_core_edges));
|
||||
|
||||
for (const auto filter_index : util::irange<std::size_t>(0, filters.size()))
|
||||
{
|
||||
edge_container.Filter(filters[filter_index], filter_index);
|
||||
}
|
||||
}
|
||||
|
||||
// Extract core graph for further contraction
|
||||
|
||||
@@ -60,6 +60,25 @@ struct ContractedEdgeContainer
|
||||
flags.resize(edges.size(), ALL_FLAGS);
|
||||
}
|
||||
|
||||
void Filter(const std::vector<bool> &filter, std::size_t index)
|
||||
{
|
||||
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
|
||||
const MergedFlags flag = 1 << index;
|
||||
|
||||
for (auto edge_index : util::irange<std::size_t>(0, edges.size()))
|
||||
{
|
||||
auto allowed = filter[edges[edge_index].source] && filter[edges[edge_index].target];
|
||||
if (allowed)
|
||||
{
|
||||
flags[edge_index] |= flag;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags[edge_index] &= ~flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Merge(std::vector<QueryEdge> new_edges)
|
||||
{
|
||||
BOOST_ASSERT(index < sizeof(MergedFlags) * CHAR_BIT);
|
||||
@@ -108,7 +127,7 @@ struct ContractedEdgeContainer
|
||||
edges.insert(edges.end(), new_edges.begin(), new_end);
|
||||
auto edges_size = edges.size();
|
||||
auto new_edges_size = std::distance(new_edges.begin(), new_end);
|
||||
BOOST_ASSERT(edges_size >= new_edges_size);
|
||||
BOOST_ASSERT(static_cast<int>(edges_size) >= new_edges_size);
|
||||
flags.resize(edges_size);
|
||||
std::fill(flags.begin() + edges_size - new_edges_size, flags.end(), flag);
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef OSMR_CONTRACTOR_CONTRACTED_METRIC_HPP
|
||||
#define OSMR_CONTRACTOR_CONTRACTED_METRIC_HPP
|
||||
|
||||
#include "contractor/query_graph.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <storage::Ownership Ownership> struct ContractedMetric
|
||||
{
|
||||
detail::QueryGraph<Ownership> graph;
|
||||
std::vector<util::ViewOrVector<bool, Ownership>> edge_filter;
|
||||
};
|
||||
}
|
||||
|
||||
using ContractedMetric = detail::ContractedMetric<storage::Ownership::Container>;
|
||||
using ContractedMetricView = detail::ContractedMetric<storage::Ownership::View>;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -12,23 +12,26 @@ namespace contractor
|
||||
struct ContractorEdgeData
|
||||
{
|
||||
ContractorEdgeData()
|
||||
: weight(0), duration(0), id(0), originalEdges(0), shortcut(0), forward(0), backward(0)
|
||||
: weight(0), duration(0), distance(0), id(0), originalEdges(0), shortcut(0), forward(0),
|
||||
backward(0)
|
||||
{
|
||||
}
|
||||
ContractorEdgeData(EdgeWeight weight,
|
||||
EdgeWeight duration,
|
||||
EdgeDistance distance,
|
||||
unsigned original_edges,
|
||||
unsigned id,
|
||||
bool shortcut,
|
||||
bool forward,
|
||||
bool backward)
|
||||
: weight(weight), duration(duration), id(id),
|
||||
: weight(weight), duration(duration), distance(distance), id(id),
|
||||
originalEdges(std::min((1u << 29) - 1u, original_edges)), shortcut(shortcut),
|
||||
forward(forward), backward(backward)
|
||||
{
|
||||
}
|
||||
EdgeWeight weight;
|
||||
EdgeWeight duration;
|
||||
EdgeDistance distance;
|
||||
unsigned id;
|
||||
unsigned originalEdges : 29;
|
||||
bool shortcut : 1;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
#ifndef OSRM_CONTRACTOR_FILES_HPP
|
||||
#define OSRM_CONTRACTOR_FILES_HPP
|
||||
|
||||
#include "contractor/query_graph.hpp"
|
||||
#include "contractor/serialization.hpp"
|
||||
|
||||
#include "util/serialization.hpp"
|
||||
|
||||
#include "storage/io.hpp"
|
||||
#include "storage/serialization.hpp"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -15,54 +12,44 @@ namespace contractor
|
||||
namespace files
|
||||
{
|
||||
// reads .osrm.hsgr file
|
||||
template <typename QueryGraphT, typename EdgeFilterT>
|
||||
template <typename ContractedMetricT>
|
||||
inline void readGraph(const boost::filesystem::path &path,
|
||||
unsigned &checksum,
|
||||
QueryGraphT &graph,
|
||||
std::vector<EdgeFilterT> &edge_filter)
|
||||
std::unordered_map<std::string, ContractedMetricT> &metrics,
|
||||
std::uint32_t &connectivity_checksum)
|
||||
{
|
||||
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
||||
std::is_same<QueryGraph, QueryGraphT>::value,
|
||||
"graph must be of type QueryGraph<>");
|
||||
static_assert(std::is_same<EdgeFilterT, std::vector<bool>>::value ||
|
||||
std::is_same<EdgeFilterT, util::vector_view<bool>>::value,
|
||||
"edge_filter must be a container of vector<bool> or vector_view<bool>");
|
||||
static_assert(std::is_same<ContractedMetric, ContractedMetricT>::value ||
|
||||
std::is_same<ContractedMetricView, ContractedMetricT>::value,
|
||||
"metric must be of type ContractedMetric<>");
|
||||
|
||||
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||
storage::io::FileReader reader{path, fingerprint};
|
||||
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
|
||||
storage::tar::FileReader reader{path, fingerprint};
|
||||
|
||||
reader.ReadInto(checksum);
|
||||
util::serialization::read(reader, graph);
|
||||
auto count = reader.ReadElementCount64();
|
||||
edge_filter.resize(count);
|
||||
for (const auto index : util::irange<std::size_t>(0, count))
|
||||
reader.ReadInto("/ch/connectivity_checksum", connectivity_checksum);
|
||||
|
||||
for (auto &pair : metrics)
|
||||
{
|
||||
storage::serialization::read(reader, edge_filter[index]);
|
||||
serialization::read(reader, "/ch/metrics/" + pair.first, pair.second);
|
||||
}
|
||||
}
|
||||
|
||||
// writes .osrm.hsgr file
|
||||
template <typename QueryGraphT, typename EdgeFilterT>
|
||||
template <typename ContractedMetricT>
|
||||
inline void writeGraph(const boost::filesystem::path &path,
|
||||
unsigned checksum,
|
||||
const QueryGraphT &graph,
|
||||
const std::vector<EdgeFilterT> &edge_filter)
|
||||
const std::unordered_map<std::string, ContractedMetricT> &metrics,
|
||||
const std::uint32_t connectivity_checksum)
|
||||
{
|
||||
static_assert(std::is_same<QueryGraphView, QueryGraphT>::value ||
|
||||
std::is_same<QueryGraph, QueryGraphT>::value,
|
||||
"graph must be of type QueryGraph<>");
|
||||
static_assert(std::is_same<EdgeFilterT, std::vector<bool>>::value ||
|
||||
std::is_same<EdgeFilterT, util::vector_view<bool>>::value,
|
||||
"edge_filter must be a container of vector<bool> or vector_view<bool>");
|
||||
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||
storage::io::FileWriter writer{path, fingerprint};
|
||||
static_assert(std::is_same<ContractedMetric, ContractedMetricT>::value ||
|
||||
std::is_same<ContractedMetricView, ContractedMetricT>::value,
|
||||
"metric must be of type ContractedMetric<>");
|
||||
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
|
||||
storage::tar::FileWriter writer{path, fingerprint};
|
||||
|
||||
writer.WriteOne(checksum);
|
||||
util::serialization::write(writer, graph);
|
||||
writer.WriteElementCount64(edge_filter.size());
|
||||
for (const auto &filter : edge_filter)
|
||||
writer.WriteElementCount64("/ch/connectivity_checksum", 1);
|
||||
writer.WriteFrom("/ch/connectivity_checksum", connectivity_checksum);
|
||||
|
||||
for (const auto &pair : metrics)
|
||||
{
|
||||
storage::serialization::write(writer, filter);
|
||||
serialization::write(writer, "/ch/metrics/" + pair.first, pair.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
|
||||
input_edge.target,
|
||||
std::max(input_edge.data.weight, 1),
|
||||
input_edge.data.duration,
|
||||
input_edge.data.distance,
|
||||
1,
|
||||
input_edge.data.turn_id,
|
||||
false,
|
||||
@@ -51,6 +52,7 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
|
||||
input_edge.source,
|
||||
std::max(input_edge.data.weight, 1),
|
||||
input_edge.data.duration,
|
||||
input_edge.data.distance,
|
||||
1,
|
||||
input_edge.data.turn_id,
|
||||
false,
|
||||
@@ -82,6 +84,7 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
|
||||
forward_edge.data.originalEdges = reverse_edge.data.originalEdges = 1;
|
||||
forward_edge.data.weight = reverse_edge.data.weight = INVALID_EDGE_WEIGHT;
|
||||
forward_edge.data.duration = reverse_edge.data.duration = MAXIMAL_EDGE_DURATION;
|
||||
forward_edge.data.distance = reverse_edge.data.distance = MAXIMAL_EDGE_DISTANCE;
|
||||
// remove parallel edges
|
||||
while (i < edges.size() && edges[i].source == source && edges[i].target == target)
|
||||
{
|
||||
@@ -90,12 +93,16 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
|
||||
forward_edge.data.weight = std::min(edges[i].data.weight, forward_edge.data.weight);
|
||||
forward_edge.data.duration =
|
||||
std::min(edges[i].data.duration, forward_edge.data.duration);
|
||||
forward_edge.data.distance =
|
||||
std::min(edges[i].data.distance, forward_edge.data.distance);
|
||||
}
|
||||
if (edges[i].data.backward)
|
||||
{
|
||||
reverse_edge.data.weight = std::min(edges[i].data.weight, reverse_edge.data.weight);
|
||||
reverse_edge.data.duration =
|
||||
std::min(edges[i].data.duration, reverse_edge.data.duration);
|
||||
reverse_edge.data.distance =
|
||||
std::min(edges[i].data.distance, reverse_edge.data.distance);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
@@ -128,44 +135,42 @@ ContractorGraph toContractorGraph(NodeID number_of_nodes, InputEdgeContainer inp
|
||||
|
||||
template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT graph)
|
||||
{
|
||||
std::vector<Edge> edges;
|
||||
edges.reserve(graph.GetNumberOfEdges());
|
||||
util::Log() << "Converting contracted graph with " << graph.GetNumberOfEdges()
|
||||
<< " to edge list (" << (graph.GetNumberOfEdges() * sizeof(Edge)) << " bytes)";
|
||||
std::vector<Edge> edges(graph.GetNumberOfEdges());
|
||||
|
||||
util::UnbufferedLog log;
|
||||
log << "Getting edges of minimized graph ";
|
||||
util::Percent p(log, graph.GetNumberOfNodes());
|
||||
const NodeID number_of_nodes = graph.GetNumberOfNodes();
|
||||
if (graph.GetNumberOfNodes())
|
||||
{
|
||||
Edge new_edge;
|
||||
util::UnbufferedLog log;
|
||||
log << "Getting edges of minimized graph ";
|
||||
util::Percent p(log, graph.GetNumberOfNodes());
|
||||
const NodeID number_of_nodes = graph.GetNumberOfNodes();
|
||||
std::size_t edge_index = 0;
|
||||
for (const auto node : util::irange(0u, number_of_nodes))
|
||||
{
|
||||
p.PrintStatus(node);
|
||||
for (auto edge : graph.GetAdjacentEdgeRange(node))
|
||||
{
|
||||
const NodeID target = graph.GetTarget(edge);
|
||||
const ContractorGraph::EdgeData &data = graph.GetEdgeData(edge);
|
||||
const auto &data = graph.GetEdgeData(edge);
|
||||
auto &new_edge = edges[edge_index++];
|
||||
new_edge.source = node;
|
||||
new_edge.target = target;
|
||||
BOOST_ASSERT_MSG(SPECIAL_NODEID != new_edge.target, "Target id invalid");
|
||||
new_edge.data.weight = data.weight;
|
||||
new_edge.data.duration = data.duration;
|
||||
new_edge.data.distance = data.distance;
|
||||
new_edge.data.shortcut = data.shortcut;
|
||||
new_edge.data.turn_id = data.id;
|
||||
BOOST_ASSERT_MSG(new_edge.data.turn_id != INT_MAX, // 2^31
|
||||
"edge id invalid");
|
||||
new_edge.data.forward = data.forward;
|
||||
new_edge.data.backward = data.backward;
|
||||
edges.push_back(new_edge);
|
||||
}
|
||||
}
|
||||
BOOST_ASSERT(edge_index == edges.size());
|
||||
}
|
||||
|
||||
// sort and remove duplicates
|
||||
tbb::parallel_sort(edges.begin(), edges.end());
|
||||
auto new_end = std::unique(edges.begin(), edges.end());
|
||||
edges.resize(new_end - edges.begin());
|
||||
edges.shrink_to_fit();
|
||||
|
||||
return edges;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ struct QueryEdge
|
||||
struct EdgeData
|
||||
{
|
||||
explicit EdgeData()
|
||||
: turn_id(0), shortcut(false), weight(0), duration(0), forward(false), backward(false)
|
||||
: turn_id(0), shortcut(false), weight(0), duration(0), forward(false), backward(false),
|
||||
distance(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,10 +26,11 @@ struct QueryEdge
|
||||
const bool shortcut,
|
||||
const EdgeWeight weight,
|
||||
const EdgeWeight duration,
|
||||
const EdgeDistance distance,
|
||||
const bool forward,
|
||||
const bool backward)
|
||||
: turn_id(turn_id), shortcut(shortcut), weight(weight), duration(duration),
|
||||
forward(forward), backward(backward)
|
||||
forward(forward), backward(backward), distance(distance)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,6 +42,7 @@ struct QueryEdge
|
||||
turn_id = other.id;
|
||||
forward = other.forward;
|
||||
backward = other.backward;
|
||||
distance = other.distance;
|
||||
}
|
||||
// this ID is either the middle node of the shortcut, or the ID of the edge based node (node
|
||||
// based edge) storing the appropriate data. If `shortcut` is set to true, we get the middle
|
||||
@@ -50,6 +53,7 @@ struct QueryEdge
|
||||
EdgeWeight duration : 30;
|
||||
std::uint32_t forward : 1;
|
||||
std::uint32_t backward : 1;
|
||||
EdgeDistance distance;
|
||||
} data;
|
||||
|
||||
QueryEdge() : source(SPECIAL_NODEID), target(SPECIAL_NODEID) {}
|
||||
@@ -69,7 +73,8 @@ struct QueryEdge
|
||||
return (source == right.source && target == right.target &&
|
||||
data.weight == right.data.weight && data.duration == right.data.duration &&
|
||||
data.shortcut == right.data.shortcut && data.forward == right.data.forward &&
|
||||
data.backward == right.data.backward && data.turn_id == right.data.turn_id);
|
||||
data.backward == right.data.backward && data.turn_id == right.data.turn_id &&
|
||||
data.distance == right.data.distance);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef OSRM_CONTRACTOR_SERIALIZATION_HPP
|
||||
#define OSRM_CONTRACTOR_SERIALIZATION_HPP
|
||||
|
||||
#include "contractor/contracted_metric.hpp"
|
||||
|
||||
#include "util/serialization.hpp"
|
||||
|
||||
#include "storage/serialization.hpp"
|
||||
#include "storage/tar.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
{
|
||||
namespace serialization
|
||||
{
|
||||
|
||||
template <storage::Ownership Ownership>
|
||||
void write(storage::tar::FileWriter &writer,
|
||||
const std::string &name,
|
||||
const detail::ContractedMetric<Ownership> &metric)
|
||||
{
|
||||
util::serialization::write(writer, name + "/contracted_graph", metric.graph);
|
||||
|
||||
writer.WriteElementCount64(name + "/exclude", metric.edge_filter.size());
|
||||
for (const auto index : util::irange<std::size_t>(0, metric.edge_filter.size()))
|
||||
{
|
||||
storage::serialization::write(writer,
|
||||
name + "/exclude/" + std::to_string(index) + "/edge_filter",
|
||||
metric.edge_filter[index]);
|
||||
}
|
||||
}
|
||||
|
||||
template <storage::Ownership Ownership>
|
||||
void read(storage::tar::FileReader &reader,
|
||||
const std::string &name,
|
||||
detail::ContractedMetric<Ownership> &metric)
|
||||
{
|
||||
util::serialization::read(reader, name + "/contracted_graph", metric.graph);
|
||||
|
||||
metric.edge_filter.resize(reader.ReadElementCount64(name + "/exclude"));
|
||||
for (const auto index : util::irange<std::size_t>(0, metric.edge_filter.size()))
|
||||
{
|
||||
storage::serialization::read(reader,
|
||||
name + "/exclude/" + std::to_string(index) + "/edge_filter",
|
||||
metric.edge_filter[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,11 +1,12 @@
|
||||
#ifndef OSRM_CELLS_CUSTOMIZER_HPP
|
||||
#define OSRM_CELLS_CUSTOMIZER_HPP
|
||||
|
||||
#include "partition/cell_storage.hpp"
|
||||
#include "partition/multi_level_partition.hpp"
|
||||
#include "partitioner/cell_storage.hpp"
|
||||
#include "partitioner/multi_level_partition.hpp"
|
||||
#include "util/query_heap.hpp"
|
||||
|
||||
#include <tbb/enumerable_thread_specific.h>
|
||||
#include <tbb/parallel_for.h>
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
@@ -21,6 +22,7 @@ class CellCustomizer
|
||||
{
|
||||
bool from_clique;
|
||||
EdgeDuration duration;
|
||||
EdgeDistance distance;
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -28,12 +30,12 @@ class CellCustomizer
|
||||
util::QueryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::ArrayStorage<NodeID, int>>;
|
||||
using HeapPtr = tbb::enumerable_thread_specific<Heap>;
|
||||
|
||||
CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {}
|
||||
CellCustomizer(const partitioner::MultiLevelPartition &partition) : partition(partition) {}
|
||||
|
||||
template <typename GraphT>
|
||||
void Customize(const GraphT &graph,
|
||||
Heap &heap,
|
||||
const partition::CellStorage &cells,
|
||||
const partitioner::CellStorage &cells,
|
||||
const std::vector<bool> &allowed_nodes,
|
||||
CellMetric &metric,
|
||||
LevelID level,
|
||||
@@ -59,7 +61,7 @@ class CellCustomizer
|
||||
}
|
||||
}
|
||||
heap.Clear();
|
||||
heap.Insert(source, 0, {false, 0});
|
||||
heap.Insert(source, 0, {false, 0, 0});
|
||||
|
||||
// explore search space
|
||||
while (!heap.Empty() && !destinations_set.empty())
|
||||
@@ -67,8 +69,18 @@ class CellCustomizer
|
||||
const NodeID node = heap.DeleteMin();
|
||||
const EdgeWeight weight = heap.GetKey(node);
|
||||
const EdgeDuration duration = heap.GetData(node).duration;
|
||||
const EdgeDistance distance = heap.GetData(node).distance;
|
||||
|
||||
RelaxNode(graph, cells, allowed_nodes, metric, heap, level, node, weight, duration);
|
||||
RelaxNode(graph,
|
||||
cells,
|
||||
allowed_nodes,
|
||||
metric,
|
||||
heap,
|
||||
level,
|
||||
node,
|
||||
weight,
|
||||
duration,
|
||||
distance);
|
||||
|
||||
destinations_set.erase(node);
|
||||
}
|
||||
@@ -76,27 +88,33 @@ class CellCustomizer
|
||||
// fill a map of destination nodes to placeholder pointers
|
||||
auto weights = cell.GetOutWeight(source);
|
||||
auto durations = cell.GetOutDuration(source);
|
||||
auto distances = cell.GetOutDistance(source);
|
||||
for (auto &destination : destinations)
|
||||
{
|
||||
BOOST_ASSERT(!weights.empty());
|
||||
BOOST_ASSERT(!durations.empty());
|
||||
BOOST_ASSERT(!distances.empty());
|
||||
|
||||
const bool inserted = heap.WasInserted(destination);
|
||||
weights.front() = inserted ? heap.GetKey(destination) : INVALID_EDGE_WEIGHT;
|
||||
durations.front() =
|
||||
inserted ? heap.GetData(destination).duration : MAXIMAL_EDGE_DURATION;
|
||||
distances.front() =
|
||||
inserted ? heap.GetData(destination).distance : INVALID_EDGE_DISTANCE;
|
||||
|
||||
weights.advance_begin(1);
|
||||
durations.advance_begin(1);
|
||||
distances.advance_begin(1);
|
||||
}
|
||||
BOOST_ASSERT(weights.empty());
|
||||
BOOST_ASSERT(durations.empty());
|
||||
BOOST_ASSERT(distances.empty());
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GraphT>
|
||||
void Customize(const GraphT &graph,
|
||||
const partition::CellStorage &cells,
|
||||
const partitioner::CellStorage &cells,
|
||||
const std::vector<bool> &allowed_nodes,
|
||||
CellMetric &metric) const
|
||||
{
|
||||
@@ -120,14 +138,15 @@ class CellCustomizer
|
||||
private:
|
||||
template <typename GraphT>
|
||||
void RelaxNode(const GraphT &graph,
|
||||
const partition::CellStorage &cells,
|
||||
const partitioner::CellStorage &cells,
|
||||
const std::vector<bool> &allowed_nodes,
|
||||
const CellMetric &metric,
|
||||
Heap &heap,
|
||||
LevelID level,
|
||||
NodeID node,
|
||||
EdgeWeight weight,
|
||||
EdgeDuration duration) const
|
||||
EdgeDuration duration,
|
||||
EdgeDistance distance) const
|
||||
{
|
||||
auto first_level = level == 1;
|
||||
BOOST_ASSERT(heap.WasInserted(node));
|
||||
@@ -148,6 +167,7 @@ class CellCustomizer
|
||||
auto subcell = cells.GetCell(metric, level - 1, subcell_id);
|
||||
auto subcell_destination = subcell.GetDestinationNodes().begin();
|
||||
auto subcell_duration = subcell.GetOutDuration(node).begin();
|
||||
auto subcell_distance = subcell.GetOutDistance(node).begin();
|
||||
for (auto subcell_weight : subcell.GetOutWeight(node))
|
||||
{
|
||||
if (subcell_weight != INVALID_EDGE_WEIGHT)
|
||||
@@ -160,20 +180,24 @@ class CellCustomizer
|
||||
|
||||
const EdgeWeight to_weight = weight + subcell_weight;
|
||||
const EdgeDuration to_duration = duration + *subcell_duration;
|
||||
const EdgeDistance to_distance = distance + *subcell_distance;
|
||||
if (!heap.WasInserted(to))
|
||||
{
|
||||
heap.Insert(to, to_weight, {true, to_duration});
|
||||
heap.Insert(to, to_weight, {true, to_duration, to_distance});
|
||||
}
|
||||
else if (std::tie(to_weight, to_duration) <
|
||||
std::tie(heap.GetKey(to), heap.GetData(to).duration))
|
||||
else if (std::tie(to_weight, to_duration, to_distance) <
|
||||
std::tie(heap.GetKey(to),
|
||||
heap.GetData(to).duration,
|
||||
heap.GetData(to).distance))
|
||||
{
|
||||
heap.DecreaseKey(to, to_weight);
|
||||
heap.GetData(to) = {true, to_duration};
|
||||
heap.GetData(to) = {true, to_duration, to_distance};
|
||||
}
|
||||
}
|
||||
|
||||
++subcell_destination;
|
||||
++subcell_duration;
|
||||
++subcell_distance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,21 +218,24 @@ class CellCustomizer
|
||||
{
|
||||
const EdgeWeight to_weight = weight + data.weight;
|
||||
const EdgeDuration to_duration = duration + data.duration;
|
||||
const EdgeDistance to_distance = distance + data.distance;
|
||||
if (!heap.WasInserted(to))
|
||||
{
|
||||
heap.Insert(to, to_weight, {false, duration + data.duration});
|
||||
heap.Insert(
|
||||
to, to_weight, {false, duration + data.duration, distance + data.distance});
|
||||
}
|
||||
else if (std::tie(to_weight, to_duration) <
|
||||
std::tie(heap.GetKey(to), heap.GetData(to).duration))
|
||||
else if (std::tie(to_weight, to_duration, to_distance) <
|
||||
std::tie(
|
||||
heap.GetKey(to), heap.GetData(to).duration, heap.GetData(to).distance))
|
||||
{
|
||||
heap.DecreaseKey(to, to_weight);
|
||||
heap.GetData(to) = {false, to_duration};
|
||||
heap.GetData(to) = {false, to_duration, to_distance};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const partition::MultiLevelPartition &partition;
|
||||
const partitioner::MultiLevelPartition &partition;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ template <storage::Ownership Ownership> struct CellMetricImpl
|
||||
|
||||
Vector<EdgeWeight> weights;
|
||||
Vector<EdgeDuration> durations;
|
||||
Vector<EdgeDistance> distances;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ struct CustomizationConfig final : storage::IOConfig
|
||||
".osrm.partition",
|
||||
".osrm.cells",
|
||||
".osrm.ebg_nodes",
|
||||
".osrm.properties"},
|
||||
".osrm.properties",
|
||||
".osrm.enw"},
|
||||
{},
|
||||
{".osrm.cell_metrics", ".osrm.mldgr"}),
|
||||
requested_num_threads(0)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define OSRM_CUSTOMIZE_EDGE_BASED_GRAPH_HPP
|
||||
|
||||
#include "extractor/edge_based_edge.hpp"
|
||||
#include "partition/edge_based_graph.hpp"
|
||||
#include "partition/multi_level_graph.hpp"
|
||||
#include "partitioner/edge_based_graph.hpp"
|
||||
#include "partitioner/multi_level_graph.hpp"
|
||||
#include "util/static_graph.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
@@ -16,27 +16,116 @@ namespace osrm
|
||||
namespace customizer
|
||||
{
|
||||
|
||||
using EdgeBasedGraphEdgeData = partition::EdgeBasedGraphEdgeData;
|
||||
|
||||
struct MultiLevelEdgeBasedGraph
|
||||
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>
|
||||
struct EdgeBasedGraphEdgeData
|
||||
{
|
||||
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
||||
using Base::Base;
|
||||
NodeID turn_id; // ID of the edge based node (node based edge)
|
||||
};
|
||||
|
||||
struct MultiLevelEdgeBasedGraphView
|
||||
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>
|
||||
template <typename EdgeDataT, storage::Ownership Ownership> class MultiLevelGraph;
|
||||
|
||||
namespace serialization
|
||||
{
|
||||
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
||||
using Base::Base;
|
||||
template <typename EdgeDataT, storage::Ownership Ownership>
|
||||
void read(storage::tar::FileReader &reader,
|
||||
const std::string &name,
|
||||
MultiLevelGraph<EdgeDataT, Ownership> &graph);
|
||||
|
||||
template <typename EdgeDataT, storage::Ownership Ownership>
|
||||
void write(storage::tar::FileWriter &writer,
|
||||
const std::string &name,
|
||||
const MultiLevelGraph<EdgeDataT, Ownership> &graph);
|
||||
}
|
||||
|
||||
template <typename EdgeDataT, storage::Ownership Ownership>
|
||||
class MultiLevelGraph : public partitioner::MultiLevelGraph<EdgeDataT, Ownership>
|
||||
{
|
||||
private:
|
||||
using SuperT = partitioner::MultiLevelGraph<EdgeDataT, Ownership>;
|
||||
using PartitionerGraphT = partitioner::MultiLevelGraph<partitioner::EdgeBasedGraphEdgeData,
|
||||
storage::Ownership::Container>;
|
||||
template <typename T> using Vector = util::ViewOrVector<T, Ownership>;
|
||||
|
||||
public:
|
||||
using NodeArrayEntry = typename SuperT::NodeArrayEntry;
|
||||
using EdgeArrayEntry = typename SuperT::EdgeArrayEntry;
|
||||
using EdgeOffset = typename SuperT::EdgeOffset;
|
||||
|
||||
MultiLevelGraph() = default;
|
||||
MultiLevelGraph(MultiLevelGraph &&) = default;
|
||||
MultiLevelGraph(const MultiLevelGraph &) = default;
|
||||
MultiLevelGraph &operator=(MultiLevelGraph &&) = default;
|
||||
MultiLevelGraph &operator=(const MultiLevelGraph &) = default;
|
||||
|
||||
MultiLevelGraph(PartitionerGraphT &&graph,
|
||||
Vector<EdgeWeight> node_weights_,
|
||||
Vector<EdgeDuration> node_durations_,
|
||||
Vector<EdgeDistance> node_distances_)
|
||||
: node_weights(std::move(node_weights_)), node_durations(std::move(node_durations_)),
|
||||
node_distances(std::move(node_distances_))
|
||||
{
|
||||
util::ViewOrVector<PartitionerGraphT::EdgeArrayEntry, storage::Ownership::Container>
|
||||
original_edge_array;
|
||||
|
||||
std::tie(SuperT::node_array,
|
||||
original_edge_array,
|
||||
SuperT::node_to_edge_offset,
|
||||
SuperT::connectivity_checksum) = std::move(graph).data();
|
||||
|
||||
SuperT::edge_array.reserve(original_edge_array.size());
|
||||
for (const auto &edge : original_edge_array)
|
||||
{
|
||||
SuperT::edge_array.push_back({edge.target, {edge.data.turn_id}});
|
||||
is_forward_edge.push_back(edge.data.forward);
|
||||
is_backward_edge.push_back(edge.data.backward);
|
||||
}
|
||||
}
|
||||
|
||||
MultiLevelGraph(Vector<NodeArrayEntry> node_array_,
|
||||
Vector<EdgeArrayEntry> edge_array_,
|
||||
Vector<EdgeOffset> node_to_edge_offset_,
|
||||
Vector<EdgeWeight> node_weights_,
|
||||
Vector<EdgeDuration> node_durations_,
|
||||
Vector<EdgeDistance> node_distances_,
|
||||
Vector<bool> is_forward_edge_,
|
||||
Vector<bool> is_backward_edge_)
|
||||
: SuperT(std::move(node_array_), std::move(edge_array_), std::move(node_to_edge_offset_)),
|
||||
node_weights(std::move(node_weights_)), node_durations(std::move(node_durations_)),
|
||||
node_distances(std::move(node_distances_)), is_forward_edge(is_forward_edge_),
|
||||
is_backward_edge(is_backward_edge_)
|
||||
{
|
||||
}
|
||||
|
||||
EdgeWeight GetNodeWeight(NodeID node) const { return node_weights[node]; }
|
||||
|
||||
EdgeWeight GetNodeDuration(NodeID node) const { return node_durations[node]; }
|
||||
|
||||
EdgeDistance GetNodeDistance(NodeID node) const { return node_distances[node]; }
|
||||
|
||||
bool IsForwardEdge(EdgeID edge) const { return is_forward_edge[edge]; }
|
||||
|
||||
bool IsBackwardEdge(EdgeID edge) const { return is_backward_edge[edge]; }
|
||||
|
||||
friend void
|
||||
serialization::read<EdgeDataT, Ownership>(storage::tar::FileReader &reader,
|
||||
const std::string &name,
|
||||
MultiLevelGraph<EdgeDataT, Ownership> &graph);
|
||||
friend void
|
||||
serialization::write<EdgeDataT, Ownership>(storage::tar::FileWriter &writer,
|
||||
const std::string &name,
|
||||
const MultiLevelGraph<EdgeDataT, Ownership> &graph);
|
||||
|
||||
protected:
|
||||
Vector<EdgeWeight> node_weights;
|
||||
Vector<EdgeDuration> node_durations;
|
||||
Vector<EdgeDistance> node_distances;
|
||||
Vector<bool> is_forward_edge;
|
||||
Vector<bool> is_backward_edge;
|
||||
};
|
||||
|
||||
struct StaticEdgeBasedGraphEdge : MultiLevelEdgeBasedGraph::InputEdge
|
||||
{
|
||||
using Base = MultiLevelEdgeBasedGraph::InputEdge;
|
||||
using Base::Base;
|
||||
};
|
||||
using MultiLevelEdgeBasedGraph =
|
||||
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
||||
using MultiLevelEdgeBasedGraphView =
|
||||
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
|
||||
#include "customizer/serialization.hpp"
|
||||
|
||||
#include "storage/io.hpp"
|
||||
#include "storage/tar.hpp"
|
||||
|
||||
#include "util/integer_range.hpp"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
@@ -16,42 +18,94 @@ namespace files
|
||||
|
||||
// reads .osrm.cell_metrics file
|
||||
template <typename CellMetricT>
|
||||
inline void readCellMetrics(const boost::filesystem::path &path, std::vector<CellMetricT> &metrics)
|
||||
inline void readCellMetrics(const boost::filesystem::path &path,
|
||||
std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
|
||||
{
|
||||
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
|
||||
std::is_same<CellMetric, CellMetricT>::value,
|
||||
"");
|
||||
|
||||
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
|
||||
storage::io::FileReader reader{path, fingerprint};
|
||||
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
|
||||
storage::tar::FileReader reader{path, fingerprint};
|
||||
|
||||
auto num_metrics = reader.ReadElementCount64();
|
||||
metrics.resize(num_metrics);
|
||||
|
||||
for (auto &metric : metrics)
|
||||
for (auto &pair : metrics)
|
||||
{
|
||||
serialization::read(reader, metric);
|
||||
const auto &metric_name = pair.first;
|
||||
auto &metric_exclude_classes = pair.second;
|
||||
|
||||
auto prefix = "/mld/metrics/" + metric_name + "/exclude";
|
||||
auto num_exclude_classes = reader.ReadElementCount64(prefix);
|
||||
metric_exclude_classes.resize(num_exclude_classes);
|
||||
|
||||
auto id = 0;
|
||||
for (auto &metric : metric_exclude_classes)
|
||||
{
|
||||
serialization::read(reader, prefix + "/" + std::to_string(id++), metric);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// writes .osrm.cell_metrics file
|
||||
template <typename CellMetricT>
|
||||
inline void writeCellMetrics(const boost::filesystem::path &path,
|
||||
const std::vector<CellMetricT> &metrics)
|
||||
inline void
|
||||
writeCellMetrics(const boost::filesystem::path &path,
|
||||
const std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
|
||||
{
|
||||
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
|
||||
std::is_same<CellMetric, CellMetricT>::value,
|
||||
"");
|
||||
|
||||
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
|
||||
storage::io::FileWriter writer{path, fingerprint};
|
||||
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
|
||||
storage::tar::FileWriter writer{path, fingerprint};
|
||||
|
||||
writer.WriteElementCount64(metrics.size());
|
||||
for (const auto &metric : metrics)
|
||||
for (const auto &pair : metrics)
|
||||
{
|
||||
serialization::write(writer, metric);
|
||||
const auto &metric_name = pair.first;
|
||||
const auto &metric_exclude_classes = pair.second;
|
||||
|
||||
auto prefix = "/mld/metrics/" + metric_name + "/exclude";
|
||||
writer.WriteElementCount64(prefix, metric_exclude_classes.size());
|
||||
|
||||
auto id = 0;
|
||||
for (auto &exclude_metric : metric_exclude_classes)
|
||||
{
|
||||
serialization::write(writer, prefix + "/" + std::to_string(id++), exclude_metric);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reads .osrm.mldgr file
|
||||
template <typename MultiLevelGraphT>
|
||||
inline void readGraph(const boost::filesystem::path &path,
|
||||
MultiLevelGraphT &graph,
|
||||
std::uint32_t &connectivity_checksum)
|
||||
{
|
||||
static_assert(std::is_same<customizer::MultiLevelEdgeBasedGraphView, MultiLevelGraphT>::value ||
|
||||
std::is_same<customizer::MultiLevelEdgeBasedGraph, MultiLevelGraphT>::value,
|
||||
"");
|
||||
|
||||
storage::tar::FileReader reader{path, storage::tar::FileReader::VerifyFingerprint};
|
||||
|
||||
reader.ReadInto("/mld/connectivity_checksum", connectivity_checksum);
|
||||
serialization::read(reader, "/mld/multilevelgraph", graph);
|
||||
}
|
||||
|
||||
// writes .osrm.mldgr file
|
||||
template <typename MultiLevelGraphT>
|
||||
inline void writeGraph(const boost::filesystem::path &path,
|
||||
const MultiLevelGraphT &graph,
|
||||
const std::uint32_t connectivity_checksum)
|
||||
{
|
||||
static_assert(std::is_same<customizer::MultiLevelEdgeBasedGraphView, MultiLevelGraphT>::value ||
|
||||
std::is_same<customizer::MultiLevelEdgeBasedGraph, MultiLevelGraphT>::value,
|
||||
"");
|
||||
|
||||
storage::tar::FileWriter writer{path, storage::tar::FileWriter::GenerateFingerprint};
|
||||
|
||||
writer.WriteElementCount64("/mld/connectivity_checksum", 1);
|
||||
writer.WriteFrom("/mld/connectivity_checksum", connectivity_checksum);
|
||||
serialization::write(writer, "/mld/multilevelgraph", graph);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#ifndef OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
||||
#define OSRM_CUSTOMIZER_SERIALIZATION_HPP
|
||||
|
||||
#include "partition/cell_storage.hpp"
|
||||
#include "customizer/edge_based_graph.hpp"
|
||||
|
||||
#include "partitioner/cell_storage.hpp"
|
||||
|
||||
#include "storage/io.hpp"
|
||||
#include "storage/serialization.hpp"
|
||||
#include "storage/shared_memory_ownership.hpp"
|
||||
#include "storage/tar.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -15,17 +17,53 @@ namespace serialization
|
||||
{
|
||||
|
||||
template <storage::Ownership Ownership>
|
||||
inline void read(storage::io::FileReader &reader, detail::CellMetricImpl<Ownership> &metric)
|
||||
inline void read(storage::tar::FileReader &reader,
|
||||
const std::string &name,
|
||||
detail::CellMetricImpl<Ownership> &metric)
|
||||
{
|
||||
storage::serialization::read(reader, metric.weights);
|
||||
storage::serialization::read(reader, metric.durations);
|
||||
storage::serialization::read(reader, name + "/weights", metric.weights);
|
||||
storage::serialization::read(reader, name + "/durations", metric.durations);
|
||||
storage::serialization::read(reader, name + "/distances", metric.distances);
|
||||
}
|
||||
|
||||
template <storage::Ownership Ownership>
|
||||
inline void write(storage::io::FileWriter &writer, const detail::CellMetricImpl<Ownership> &metric)
|
||||
inline void write(storage::tar::FileWriter &writer,
|
||||
const std::string &name,
|
||||
const detail::CellMetricImpl<Ownership> &metric)
|
||||
{
|
||||
storage::serialization::write(writer, metric.weights);
|
||||
storage::serialization::write(writer, metric.durations);
|
||||
storage::serialization::write(writer, name + "/weights", metric.weights);
|
||||
storage::serialization::write(writer, name + "/durations", metric.durations);
|
||||
storage::serialization::write(writer, name + "/distances", metric.distances);
|
||||
}
|
||||
|
||||
template <typename EdgeDataT, storage::Ownership Ownership>
|
||||
inline void read(storage::tar::FileReader &reader,
|
||||
const std::string &name,
|
||||
MultiLevelGraph<EdgeDataT, Ownership> &graph)
|
||||
{
|
||||
storage::serialization::read(reader, name + "/node_array", graph.node_array);
|
||||
storage::serialization::read(reader, name + "/node_weights", graph.node_weights);
|
||||
storage::serialization::read(reader, name + "/node_durations", graph.node_durations);
|
||||
storage::serialization::read(reader, name + "/node_distances", graph.node_distances);
|
||||
storage::serialization::read(reader, name + "/edge_array", graph.edge_array);
|
||||
storage::serialization::read(reader, name + "/is_forward_edge", graph.is_forward_edge);
|
||||
storage::serialization::read(reader, name + "/is_backward_edge", graph.is_backward_edge);
|
||||
storage::serialization::read(reader, name + "/node_to_edge_offset", graph.node_to_edge_offset);
|
||||
}
|
||||
|
||||
template <typename EdgeDataT, storage::Ownership Ownership>
|
||||
inline void write(storage::tar::FileWriter &writer,
|
||||
const std::string &name,
|
||||
const MultiLevelGraph<EdgeDataT, Ownership> &graph)
|
||||
{
|
||||
storage::serialization::write(writer, name + "/node_array", graph.node_array);
|
||||
storage::serialization::write(writer, name + "/node_weights", graph.node_weights);
|
||||
storage::serialization::write(writer, name + "/node_durations", graph.node_durations);
|
||||
storage::serialization::write(writer, name + "/node_distances", graph.node_distances);
|
||||
storage::serialization::write(writer, name + "/edge_array", graph.edge_array);
|
||||
storage::serialization::write(writer, name + "/is_forward_edge", graph.is_forward_edge);
|
||||
storage::serialization::write(writer, name + "/is_backward_edge", graph.is_backward_edge);
|
||||
storage::serialization::write(writer, name + "/node_to_edge_offset", graph.node_to_edge_offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,11 @@ template <typename AlgorithmT> const char *name();
|
||||
template <> inline const char *name<ch::Algorithm>() { return "CH"; }
|
||||
template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
|
||||
|
||||
// Algorithm identifier
|
||||
template <typename AlgorithmT> const char *identifier();
|
||||
template <> inline const char *identifier<ch::Algorithm>() { return "ch"; }
|
||||
template <> inline const char *identifier<mld::Algorithm>() { return "mld"; }
|
||||
|
||||
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
|
||||
{
|
||||
};
|
||||
@@ -45,6 +50,9 @@ template <typename AlgorithmT> struct HasMapMatching final : std::false_type
|
||||
template <typename AlgorithmT> struct HasManyToManySearch final : std::false_type
|
||||
{
|
||||
};
|
||||
template <typename AlgorithmT> struct SupportsDistanceAnnotationType final : std::false_type
|
||||
{
|
||||
};
|
||||
template <typename AlgorithmT> struct HasGetTileTurns final : std::false_type
|
||||
{
|
||||
};
|
||||
@@ -68,6 +76,9 @@ template <> struct HasMapMatching<ch::Algorithm> final : std::true_type
|
||||
template <> struct HasManyToManySearch<ch::Algorithm> final : std::true_type
|
||||
{
|
||||
};
|
||||
template <> struct SupportsDistanceAnnotationType<ch::Algorithm> final : std::true_type
|
||||
{
|
||||
};
|
||||
template <> struct HasGetTileTurns<ch::Algorithm> final : std::true_type
|
||||
{
|
||||
};
|
||||
@@ -91,6 +102,9 @@ template <> struct HasMapMatching<mld::Algorithm> final : std::true_type
|
||||
template <> struct HasManyToManySearch<mld::Algorithm> final : std::true_type
|
||||
{
|
||||
};
|
||||
template <> struct SupportsDistanceAnnotationType<mld::Algorithm> final : std::false_type
|
||||
{
|
||||
};
|
||||
template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef ENGINE_RESPONSE_OBJECTS_HPP_
|
||||
#define ENGINE_RESPONSE_OBJECTS_HPP_
|
||||
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "extractor/travel_mode.hpp"
|
||||
#include "guidance/turn_instruction.hpp"
|
||||
#include "engine/guidance/leg_geometry.hpp"
|
||||
#include "engine/guidance/route.hpp"
|
||||
#include "engine/guidance/route_leg.hpp"
|
||||
|
||||
@@ -86,6 +86,10 @@ class MatchAPI final : public RouteAPI
|
||||
for (auto point_index : util::irange(
|
||||
0u, static_cast<unsigned>(sub_matchings[sub_matching_index].indices.size())))
|
||||
{
|
||||
// tidied_to_original: index of the input coordinate that a tidied coordinate
|
||||
// corresponds to.
|
||||
// sub_matching indices: index of the coordinate passed to map matching plugin that
|
||||
// a matched node corresponds to.
|
||||
trace_idx_to_matching_idx[tidy_result
|
||||
.tidied_to_original[sub_matchings[sub_matching_index]
|
||||
.indices[point_index]]] =
|
||||
@@ -93,6 +97,9 @@ class MatchAPI final : public RouteAPI
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_ASSERT(parameters.waypoints.empty() || sub_matchings.size() == 1);
|
||||
|
||||
std::size_t was_waypoint_idx = 0;
|
||||
for (auto trace_index : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
|
||||
{
|
||||
if (tidy_result.can_be_removed[trace_index])
|
||||
@@ -114,6 +121,20 @@ class MatchAPI final : public RouteAPI
|
||||
waypoint.values["alternatives_count"] =
|
||||
sub_matchings[matching_index.sub_matching_index]
|
||||
.alternatives_count[matching_index.point_index];
|
||||
// waypoint indices need to be adjusted if route legs were collapsed
|
||||
// waypoint parameter assumes there is only one match object
|
||||
if (!parameters.waypoints.empty())
|
||||
{
|
||||
if (tidy_result.was_waypoint[trace_index])
|
||||
{
|
||||
waypoint.values["waypoint_index"] = was_waypoint_idx;
|
||||
was_waypoint_idx++;
|
||||
}
|
||||
else
|
||||
{
|
||||
waypoint.values["waypoint_index"] = util::json::Null();
|
||||
}
|
||||
}
|
||||
waypoints.values.push_back(std::move(waypoint));
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user