Compare commits

..

17 Commits

Author SHA1 Message Date
Patrick Niklaus 9f625d2446 Update changelog 2016-07-31 23:03:17 +02:00
Michael Krasnyk 0c6cca1ca4 Fix #2706 by using correct fallback u-turn
Regression is due to a combination of 08248e3853
and http://www.openstreetmap.org/changeset/40938983
where in ways http://www.openstreetmap.org/way/27292481
and http://www.openstreetmap.org/way/432488408
nodes
4315134884 (part of way 432488408)
4315134891 (part of way 432488408)
4315134886 (part of way 432488408)
form a u-turn that has index 0 after sorting and used as an allowed one
with a reversed edge.
A u-turn that corresponds to the condition uturn_could_be_valid == true has index 1
and ignored.
2016-07-31 12:05:40 +02:00
Patrick Niklaus 9224158835 Update changelog and bump to 5.2.7 2016-07-20 17:14:15 +02:00
Michael Krasnyk 3414519cb8 Fix ambiguity in edge weights by using minimal weight 2016-07-20 17:00:48 +02:00
Moritz Kobitzsch 16cee3a7d3 fix 2672 2016-07-20 16:59:39 +02:00
Patrick Niklaus 3ef936217f [skip ci] Fix OSRM version 2016-06-24 17:17:34 +02:00
Patrick Niklaus 5bcd00a778 Add changelog entry for current bug fix 2016-06-24 16:32:28 +02:00
Moritz Kobitzsch a6828010ec fix invalid circle centers 2016-06-24 16:31:21 +02:00
Daniel Patterson 17adeeecf5 Fix segfault when route includes very short segments. 2016-06-22 14:55:20 -07:00
Patrick Niklaus edafb0a83c [skip ci] Add breaking notice to changelog 2016-06-21 19:49:13 +02:00
Patrick Niklaus f7cc89400a Update the v5.2.4 changelog 2016-06-21 19:47:39 +02:00
Lauren Budorick 473e4e129c Update tests to catch 0-subtraction error 2016-06-21 19:41:01 +02:00
Patrick Niklaus 2ac497c6b8 Fix fromTop and fromLeft calculation 2016-06-21 19:40:50 +02:00
Michael Krasnyk defdc8cc4b Fix omitting the last point's coordinates in the geometry field 2016-06-21 18:23:29 +02:00
Moritz Kobitzsch 4c5314676a fix issues with roundabouts and intersections and sliproads 2016-06-21 18:23:06 +02:00
Moritz Kobitzsch 1da044f3e3 fix roundabout-handling when name changes 2016-06-17 11:19:27 -07:00
Patrick Niklaus 45516ef534 Enable travis builds for 5.2 branch 2016-06-14 14:36:41 +02:00
1780 changed files with 27576 additions and 116200 deletions
-7
View File
@@ -1,7 +0,0 @@
{
"presets": [
"stage-0",
"es2015",
"react"
]
}
-13
View File
@@ -1,13 +0,0 @@
# Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
## Tasklist
- [ ] ADD OWN TASKS HERE
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
- [ ] add regression / cucumber cases (see docs/testing.md)
- [ ] review
- [ ] adjust for comments
## Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?
-8
View File
@@ -1,8 +1,3 @@
# mason #
#########
/.mason
/mason_packages
# pre compiled dependencies # # pre compiled dependencies #
############################# #############################
osrm-deps osrm-deps
@@ -94,6 +89,3 @@ node_modules
/server.ini /server.ini
*.swp *.swp
# local lua debugging file
debug.lua
+66 -82
View File
@@ -13,7 +13,7 @@ notifications:
branches: branches:
only: only:
- master - master
- "5.6" - "5.2"
cache: cache:
ccache: true ccache: true
@@ -25,10 +25,7 @@ env:
global: global:
- CCACHE_TEMPDIR=/tmp/.ccache-temp - CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1 - CCACHE_COMPRESS=1
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742 - JOBS=4
- CCACHE_VERSION=3.3.1
- CMAKE_VERSION=3.6.2
- MASON="$(pwd)/third_party/mason/mason"
matrix: matrix:
fast_finish: true fast_finish: true
@@ -38,57 +35,51 @@ matrix:
# Debug Builds # Debug Builds
- os: linux - os: linux
compiler: "gcc-6-debug" compiler: "gcc-5-debug"
addons: &gcc6 addons: &gcc5
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
- os: linux - os: linux
compiler: "clang-3.9-debug" compiler: "gcc-4.8-debug"
addons: &gcc48
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Debug'
- os: linux
compiler: "clang-3.8-debug"
addons: &clang38 addons: &clang38
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Debug' BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000 env: CLANG_VERSION='3.8.0' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
- os: osx - os: osx
osx_image: xcode8.2 osx_image: xcode7.3
compiler: "mason-osx-release" compiler: clang
# we use the xcode provides clang and don't install our own env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Debug' JOBS=1 CUCUMBER_TIMEOUT=60000
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON
# Release Builds # Release Builds
- os: linux - os: linux
compiler: "mason-linux-release" compiler: "gcc-5-release"
addons: addons: &gcc5
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
- os: linux # Disabled because of CI slowness
compiler: "gcc-6-release" #- os: linux
addons: &gcc6 #- compiler: gcc
apt: #- addons: &gcc48
sources: ['ubuntu-toolchain-r-test'] #- apt:
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] #- sources: ['ubuntu-toolchain-r-test']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_COMPONENTS=ON #- packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
#- env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Release'
- os: linux
compiler: "gcc-6-release-i686"
env: >
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
- os: linux
compiler: "gcc-4.9-release"
addons: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
# Disabled because of CI slowness # Disabled because of CI slowness
#- os: linux #- os: linux
@@ -99,14 +90,20 @@ matrix:
#- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] #- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' #- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
# Disabled because of CI slowness
#- os: osx
#- osx_image: xcode7.3
#- compiler: clang
#- env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Release'
# Shared Library # Shared Library
- os: linux - os: linux
compiler: "gcc-6-release-shared" compiler: "gcc-5-release-shared"
addons: &gcc6 addons: &gcc5
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON BUILD_COMPONENTS=ON env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
# Disabled because CI slowness # Disabled because CI slowness
#- os: linux #- os: linux
@@ -118,50 +115,36 @@ matrix:
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON #- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
before_install: before_install:
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi - if [[ $(uname -s) == 'Darwin' ]]; then sudo mdutil -i off /; fi;
- source ./scripts/install_node.sh 4
- npm install
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- export PATH=${DEPS_DIR}/bin:${PATH} && mkdir -p ${DEPS_DIR}
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/3.5.2.tar.gz"
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}
- | - |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then if [[ ${CLANG_VERSION:-false} != false ]]; then
export JOBS=$((`nproc` + 1)) export CCOMPILER='clang'
fi export CXXCOMPILER='clang++'
- | CLANG_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/clang/${CLANG_VERSION}.tar.gz"
if [ -n "${RUN_CLANG_FORMAT}" ]; then travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}
${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh
fi fi
- | - |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export JOBS=$((`sysctl -n hw.ncpu` + 1)) # implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
sudo mdutil -i off / brew install libzip libstxxl lua51 luabind tbb md5sha1sum ccache
fi fi
- echo "Using ${JOBS} jobs"
- source ./scripts/install_node.sh 4
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
- npm install
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
- ${MASON} install cmake ${CMAKE_VERSION} && export PATH=$(${MASON} prefix cmake ${CMAKE_VERSION})/bin:${PATH}
- |
if [[ ! -z ${CLANG_VERSION} ]]; then
export CCOMPILER='clang'
export CXXCOMPILER='clang++'
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH}
# we only enable lto for release builds
# and therefore don't need to us ld.gold or llvm tools for linking
# for debug builds
if [[ ${BUILD_TYPE} == 'Release' ]]; then
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH}
fi
fi
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
install: install:
- | - |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
./scripts/check_taginfo.py taginfo.json profiles/car.lua ./scripts/check_taginfo.py taginfo.json profiles/car.lua
fi fi
- export OSRM_BUILD_DIR="$(pwd)/build-osrm" - mkdir build && pushd build
- mkdir ${OSRM_BUILD_DIR} && pushd ${OSRM_BUILD_DIR}
- export CC=${CCOMPILER} CXX=${CXXCOMPILER} - export CC=${CCOMPILER} CXX=${CXXCOMPILER}
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=ON
- echo "travis_fold:start:MAKE" - echo "travis_fold:start:MAKE"
- make osrm-extract --jobs=3
- make --jobs=${JOBS} - make --jobs=${JOBS}
- make tests --jobs=${JOBS} - make tests --jobs=${JOBS}
- make benchmarks --jobs=${JOBS} - make benchmarks --jobs=${JOBS}
@@ -172,22 +155,19 @@ install:
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo ldconfig sudo ldconfig
fi fi
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
- popd - popd
- mkdir example/build && pushd example/build - mkdir example/build && pushd example/build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make --jobs=${JOBS} - make
- popd - popd
- npm run build-api-docs
script: script:
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
- echo "travis_fold:start:BENCHMARK" - echo "travis_fold:start:BENCHMARK"
- make -C test/data benchmark - make -C test/data benchmark
- echo "travis_fold:end:BENCHMARK" - echo "travis_fold:end:BENCHMARK"
- ./example/build/osrm-example test/data/monaco.osrm - ./example/build/osrm-example test/data/monaco.osrm
# All tests assume to be run from the build directory # All tests assume to be run from the build directory
- pushd ${OSRM_BUILD_DIR} - pushd build
- ./unit_tests/library-tests ../test/data/monaco.osrm - ./unit_tests/library-tests ../test/data/monaco.osrm
- ./unit_tests/extractor-tests - ./unit_tests/extractor-tests
- ./unit_tests/engine-tests - ./unit_tests/engine-tests
@@ -198,6 +178,10 @@ script:
after_success: after_success:
- | - |
if [ -n "${ENABLE_COVERAGE}" ]; then if [ -n "${RUN_CLANG_FORMAT}" ]; then
./scripts/format.sh # we don't want to fail just yet
fi
- |
if [ -n "${COVERAGE}" ]; then
bash <(curl -s https://codecov.io/bash) bash <(curl -s https://codecov.io/bash)
fi fi
+15 -200
View File
@@ -1,215 +1,28 @@
# 5.2.8
# 5.6.3
- Changes from 5.6.0
- Bugfixes
- #3790 Fix incorrect speed values in tile plugin
# 5.6.2
- Changes from 5.6.0
- Bugfixes
- Fix incorrect forward datasources getter in facade
- Fix include `access=private` non-car roads in the car profile
# 5.6.1
- Changes from 5.6.0
- Bugfixes
- Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
# 5.6.0
- Changes from 5.5
- Bugfixes
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
- Fix #3515 adjusted number of `nodes` in `annotation`
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
- Fix #2844 handle up to 16777215 code units in OSM names
- Infrastructure
- Support building rpm packages.
- Guidance
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
- Profiles
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
- `properties` object has a new `weight_name` field, default value is "duration"
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
- Infrastructure
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
- Tools:
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
- Trip Plugin
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
# 5.5.1
- Changes from 5.5.0
- API:
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
- Bugfixes
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
# 5.5.0
- Changes from 5.4.0
- API:
- `osrm-datastore` now accepts the parameter `--max-wait` that specifies how long it waits before aquiring a shared memory lock by force
- Shared memory now allows for multiple clients (multiple instances of libosrm on the same segment)
- Polyline geometries can now be requested with precision 5 as well as with precision 6
- Profiles
- the car profile has been refactored into smaller functions
- get_value_by_key() is now guaranteed never to return empty strings, nil is returned instead.
- debug.lua was added to make it easier to test/develop profile code.
- `car.lua` now depends on lib/set.lua and lib/sequence.lua
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
- replaced lhs/rhs profiles by using test defined profiles
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
- Handle `destination:forward`, `destination:backward`, `destination:ref:forward`, `destination:ref:backward` tags
- Properly handle destinations on `oneway=-1` roads
- Guidance
- Notifications are now exposed more prominently, announcing turns onto a ferry/pushing your bike more prominently
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
- Corrected the bearings returned for intermediate steps - requires reprocessing
- Improved turn locations for collapsed turns
- Sliproad classification refinements: the situations we detect as Sliproads now resemble more closely the reality
- Trip Plugin
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
- Bugfixes
- fixed a bug where polyline decoding on a defective polyline could end up in out-of-bound access on a vector
- fixed compile errors in tile unit-test framework
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
- fixed a bug in the tile plugin that resulted in discovering invalid edges for connections
- improved error messages when missing files during traffic updates (#3114)
- For single coordinate geometries the GeoJSON `Point` encoding was broken. We now always emit `LineString`s even in the one-coordinate-case (backwards compatible) (#3425)
- Debug Tiles
- Added support for turn penalties
- Internals
- Internal/Shared memory datafacades now share common memory layout and data loading code
- File reading now has much better error handling
- Misc
- Progress indicators now print newlines when stdout is not a TTY
- Prettier API documentation now generated via `npm run build-api-docs` output `build/docs`
# 5.4.3
- Changes from 5.4.2
- Bugfixes
- #3254 Fixed a bug that could end up hiding roundabout instructions
- #3260 fixed a bug that provided the wrong location in the arrival instruction
# 5.4.2
- Changes from 5.4.1
- Bugfixes
- #3032 Fixed a bug that could result in emitting `invalid` as an instruction type on sliproads with mode changes
- #3085 Fixed an outdated assertion that could throw without a cause for concern
- #3179 Fixed a bug that could trigger an assertion in TurnInstruciton generation
# 5.4.1
- Changes from 5.4.0
- Bugfixes
- #3016: Fixes shared memory updates while queries are running
# 5.4.0
- Changes from 5.3.0
- Profiles
- includes library guidance.lua that offers preliminary configuration on guidance.
- added left_hand_driving flag in global profile properties
- modified turn penalty function for car profile - better fit to real data
- return `ref` and `name` as separate fields. Do no use ref or destination as fallback for name value
- the default profile for car now ignores HOV only roads
- Guidance
- Handle Access tags for lanes, only considering valid lanes in lane-guidance (think car | car | bike | car)
- Improved the detection of non-noticeable name-changes
- Summaries have been improved to consider references as well
- API:
- `annotations=true` now returns the data source id for each segment as `datasources`
- Reduced semantic of merge to refer only to merges from a lane onto a motorway-like road
- new `ref` field in the `RouteStep` object. It contains the reference code or name of a way. Previously merged into the `name` property like `name (ref)` and are now separate fields.
- Bugfixes
- Fixed an issue that would result in segfaults for viaroutes with an invalid intermediate segment when u-turns were allowed at the via-location
- Invalid only_* restrictions could result in loss of connectivity. As a fallback, we assume all turns allowed when the restriction is not valid
- Fixed a bug that could result in an infinite loop when finding information about an upcoming intersection
- Fixed a bug that led to not discovering if a road simply looses a considered prefix
- BREAKING: Fixed a bug that could crash postprocessing of instructions on invalid roundabout taggings. This change requires reprocessing datasets with osrm-extract and osrm-contract
- Fixed an issue that could emit `invalid` as instruction when ending on a sliproad after a traffic-light
- Fixed an issue that would detect turning circles as sliproads
- Fixed a bug where post-processing instructions (e.g. left + left -> uturn) could result in false pronunciations
- Fixes a bug where a bearing range of zero would cause exhaustive graph traversals
- Fixes a bug where certain looped geometries could cause an infinite loop during extraction
- Fixed a bug where some roads could be falsly identified as sliproads
- Fixed a bug where roundabout intersections could result in breaking assertions when immediately exited
- Infrastructure:
- Adds a feature to limit results in nearest service with a default of 100 in `osrm-routed`
# 5.3.0
- Changes from 5.3.0-rc.3
- Guidance
- Only announce `use lane` on required turns (not using all lanes to go straight)
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
- Bugfixes
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
- Changes form 5.2.7
- API
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
- Introduces `lanes` to the `Intersection` object. The lane data contains both the markings at the intersection and a flag indicating if they can be chosen for the next turn
- Removed unused `-s` from `osrm-datastore`
- Guidance
- Only announce `use lane` on required turns (not using all lanes to go straight)
- Improved detection of obvious turns
- Improved turn lane detection
- Reduce the number of end-of-road instructions in obvious cases
- Profile:
- bicycle.lua: Surface speeds never increase the actual speed
- Infrastructure
- Add 32bit support
- Add ARM NEON/VFP support
- Fix Windows builds
- Optimize speed file updates using mmap
- Add option to disable LTO for older compilers
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
- Bugfixes: - Bugfixes:
- Fix devide by zero on updating speed data using osrm-contract - Handle an edge case that cause the turn instruction code to segfault during osrm-extract on Egypt.
# 5.3.0 RC3 # 5.2.7
- Changes from 5.3.0-rc.2
- Guidance
- Improved detection of obvious turns
- Improved turn lane detection
- Bugfixes - Bugfixes
- Fix bug that didn't chose minimal weights on overlapping edges - BREAKING: Fix bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
- Fix deduplication of parallel edges. Now uses correct weight.
# 5.3.0 RC2 # 5.2.6
- Changes from 5.3.0-rc.1
- Bugfixes - Bugfixes
- Fixes invalid checks in the lane-extraction part of the car profile - Fix numeric overflow in roundabout center calculation which throws an exception
# 5.3.0 RC1
- API
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
- Introduces lanes to the route response. The lane data contains both the markings at the intersection and a flag indicating their involvement in the turn
- Infrastructure
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
# 5.2.5 # 5.2.5
- Bugfixes - Bugfixes
- Fixes a segfault caused by incorrect trimming logic for very short steps. - Fixes a segfault caused by incorrect trimming logic for very short steps.
# 5.2.4 # 5.2.4
Changes from 5.2.3:
- Bugfixes: - Bugfixes:
- Fixed in issue that arised on roundabouts in combination with intermediate intersections and sliproads - Fixed a crash that arised on roundabouts in combination with intermediate intersections and sliproads
- Fixed #2518: Invalid bilinear interpolation when using raster data
- Fixed #2546: The geometry returned by the match service was missing the last coordinate.
BREAKING: The data format changed between 5.2.3 and 5.2.4, you need to reprocess.
# 5.2.3 # 5.2.3
- Bugfixes: - Bugfixes:
@@ -437,3 +250,5 @@
- `properties.use_turn_restrictions` - `properties.use_turn_restrictions`
- `properties.u_turn_penalty` - `properties.u_turn_penalty`
- `properties.allow_u_turn_at_via` - `properties.allow_u_turn_at_via`
+168 -435
View File
@@ -7,65 +7,20 @@ Please create a directory and run cmake from there, passing the path to this sou
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.") This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
endif() endif()
# detect if this is included as subproject and if so expose
# some variables to its parent scope
get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY)
if(BUILD_AS_SUBPROJECT)
message(STATUS "Building libosrm as subproject.")
endif()
option(ENABLE_MASON "Use mason for dependencies" OFF)
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
option(BUILD_TOOLS "Build OSRM tools" OFF)
option(BUILD_PACKAGE "Build OSRM package" OFF)
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
option(ENABLE_LTO "Use LTO if available" OFF)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
if(ENABLE_MASON)
# versions in use
set(MASON_BOOST_VERSION "1.63.0")
set(MASON_STXXL_VERSION "1.4.1")
set(MASON_EXPAT_VERSION "2.2.0")
set(MASON_LUA_VERSION "5.2.4")
set(MASON_BZIP2_VERSION "1.0.6")
set(MASON_TBB_VERSION "2017_20161128")
message(STATUS "Enabling mason")
find_program(CURL_FOUND curl)
if(NOT CURL_FOUND)
message(FATAL_ERROR "curl command required with -DENABLE_MASON")
endif()
set(MASON_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason)
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason.cmake)
endif()
# be compatible with version handling before cmake 3.x
if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
project(OSRM C CXX) project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5) set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 5) set(OSRM_VERSION_MINOR 2)
set(OSRM_VERSION_PATCH 0) set(OSRM_VERSION_PATCH 7)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
# these two functions build up custom variables: # these two functions build up custom variables:
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES # OSRM_INCLUDE_PATHS and OSRM_DEFINES
# These variables we want to pass to # These variables we want to pass to
# include_directories and add_definitions for both # include_directories and add_definitions for both
# this build and for sharing externally via pkg-config # this build and for sharing externally via pkg-config
function(add_dependency_includes includes) function(add_dependency_includes includes)
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${includes}") list(APPEND OSRM_INCLUDE_PATHS "${includes}")
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE) set(OSRM_INCLUDE_PATHS "${OSRM_INCLUDE_PATHS}" PARENT_SCOPE)
endfunction(add_dependency_includes) endfunction(add_dependency_includes)
function(add_dependency_defines defines) function(add_dependency_defines defines)
@@ -76,7 +31,6 @@ endfunction(add_dependency_defines)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -85,30 +39,33 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bitness 64) set(bitness 64)
message(STATUS "Building on a 64 bit system") message(STATUS "Building on a 64 bit system")
else() else()
message(STATUS "Building on a 32 bit system") message(WARNING "Building on a 32 bit system is unsupported")
endif() endif()
if(WIN32 AND MSVC_VERSION LESS 1900) if(WIN32 AND MSVC_VERSION LESS 1900)
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)") message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
endif() endif()
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14. option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") option(ENABLE_JSON_LOGGING "Adds additional JSON debug logging to the response" OFF)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) option(BUILD_TOOLS "Build OSRM tools" OFF)
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test") option(BUILD_COMPONENTS "Build osrm-components" OFF)
endif() option(ENABLE_ASSERTIONS OFF)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") option(COVERAGE OFF)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) option(SANITIZER OFF)
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
endif()
endif()
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework) add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
"-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}"
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FingerPrint-Config.cmake"
COMMENT "Configuring revision fingerprint"
VERBATIM)
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread)
configure_file( configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
@@ -128,6 +85,7 @@ add_library(STORAGE OBJECT ${StorageGlob})
add_library(ENGINE OBJECT ${EngineGlob}) add_library(ENGINE OBJECT ${EngineGlob})
add_library(SERVER OBJECT ${ServerGlob}) add_library(SERVER OBJECT ${ServerGlob})
add_dependencies(UTIL FingerPrintConfigure)
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
add_executable(osrm-extract src/tools/extract.cpp) add_executable(osrm-extract src/tools/extract.cpp)
@@ -139,69 +97,28 @@ add_library(osrm_extract $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>) add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>) add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
if(ENABLE_GOLD_LINKER) # Check the release mode
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
if("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
message(STATUS "Using GNU gold as linker.")
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
string(REGEX REPLACE ".*\\(GNU Binutils[^\\)0-9]+([0-9]+\\.[0-9]+)[^\\)]*\\).*" "\\1" GOLD_BINUTILS_VERSION "${LD_VERSION}")
if ("${GOLD_BINUTILS_VERSION}" VERSION_LESS "2.26")
message(STATUS "Disabling gc-sections on gold binutils < 2.26, see: https://sourceware.org/bugzilla/show_bug.cgi?id=17639")
set(LD_AVOID_GC_SECTIONS TRUE)
endif()
else()
message(WARNING "GNU gold linker isn't available.")
set(ENABLE_GOLD_LINKER OFF)
endif()
endif()
# Explicitly set the build type to Release if no other type is specified
# on the command line. Without this, cmake defaults to an unoptimized,
# non-debug build, which almost nobody wants.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type specified, defaulting to Release")
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES Debug) if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Configuring OSRM in debug mode") message(STATUS "Configuring OSRM in debug mode")
elseif(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Configuring OSRM in release mode")
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring OSRM in release mode with debug flags")
elseif(CMAKE_BUILD_TYPE MATCHES MinRelSize)
message(STATUS "Configuring OSRM in release mode with minimized size")
else()
message(STATUS "Unrecognized build type - will use cmake defaults")
endif()
# Additional logic for the different build types
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring debug mode flags")
set(ENABLE_ASSERTIONS ON) set(ENABLE_ASSERTIONS ON)
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline -fno-omit-frame-pointer") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline -fno-omit-frame-pointer")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ggdb") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ggdb")
else()
# Don't override the -O parameter for RelWithDebInfo, we want an optimized build
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
endif()
endif()
endif()
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) endif()
message(STATUS "Configuring release mode optimizations") endif()
if(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Configuring OSRM in release mode")
# Check if LTO is available # Check if LTO is available
check_cxx_compiler_flag("-Wl,-flto" LTO_AVAILABLE) check_cxx_compiler_flag("-flto" LTO_AVAILABLE)
if(LTO_AVAILABLE)
if(ENABLE_LTO AND LTO_AVAILABLE)
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS}) set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# GCC in addition allows parallelizing LTO # GCC in addition allows parallelizing LTO
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -215,78 +132,45 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS) check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS)
if(LTO_WORKS) if(LTO_WORKS)
message(STATUS "LTO working") message(STATUS "LTO working")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -flto")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
else() else()
message(STATUS "LTO broken") message(STATUS "LTO broken")
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
set(ENABLE_LTO Off)
endif() endif()
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools # Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW) NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
find_program(GCC_AR gcc-ar) message(STATUS "Using gcc specific binutils for LTO.")
find_program(GCC_RANLIB gcc-ranlib) set(CMAKE_AR "/usr/bin/gcc-ar")
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND") set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
else()
message(STATUS "Using GCC specific binutils for LTO:")
message(STATUS " ${GCC_AR}")
message(STATUS " ${GCC_RANLIB}")
set(CMAKE_AR ${GCC_AR})
set(CMAKE_RANLIB ${GCC_RANLIB})
endif()
endif()
# Same for clang LTO requires their own toolchain
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
find_program(LLVM_AR llvm-ar)
find_program(LLVM_RANLIB llvm-ranlib)
if ("${LLVM_AR}" STREQUAL "LLVM_AR-NOTFOUND" OR "${LLVM_RANLIB}" STREQUAL "LLVM_RANLIB-NOTFOUND")
message(WARNING "LLVM specific binutils not found.")
else()
message(STATUS "Using LLVM specific binutils for LTO:")
message(STATUS " ${LLVM_AR}")
message(STATUS " ${LLVM_RANLIB}")
set(CMAKE_AR ${LLVM_AR})
set(CMAKE_RANLIB ${LLVM_RANLIB})
endif()
endif() endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "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") 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(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
set(ENABLE_LTO Off)
endif() endif()
endif() endif()
endif() endif()
if(UNIX AND NOT APPLE AND ENABLE_MASON AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
message(WARNING "ENABLE_MASON and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux systems currently")
message(WARNING "For more details see: https://github.com/Project-OSRM/osrm-backend/issues/3202")
endif()
set(MAYBE_COVERAGE_LIBRARIES "") set(MAYBE_COVERAGE_LIBRARIES "")
if (ENABLE_COVERAGE) if (COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug") if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build") message(ERROR "COVERAGE=ON only make sense with a Debug build")
endif() endif()
message(INFO "Enabling coverage") message(INFO "Enabling coverage")
set(MAYBE_COVERAGE_LIBRARIES "-lgcov") set(MAYBE_COVERAGE_LIBRARIES "gcov")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
endif() endif()
if (ENABLE_SANITIZER) if (SANITIZER)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "SANITIZER=ON only make sense with a Debug build")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
endif() endif()
# Configuring compilers # Configuring compilers
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(COLOR_FLAG "-fdiagnostics-color=auto") set(COLOR_FLAG "-fdiagnostics-color=auto")
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG) check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
@@ -294,7 +178,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(COLOR_FLAG "") set(COLOR_FLAG "")
endif() endif()
# using GCC # using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
if(WIN32) # using mingw if(WIN32) # using mingw
add_dependency_defines(-DWIN32) add_dependency_defines(-DWIN32)
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32) set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
@@ -304,7 +188,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
# using Visual Studio C++ # using Visual Studio C++
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib) set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib)
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC) add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS) add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS)
add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation
@@ -320,7 +204,7 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard # For ld.gold and ld.bfs (the GNU linkers) we optimize hard
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld") if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
message(STATUS "Setting linker optimizations") message(STATUS "Setting linker optimizations")
if(NOT (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" OR "${LD_AVOID_GC_SECTIONS}")) if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
# Tell compiler to put every function in separate section, linker can then match sections and functions # Tell compiler to put every function in separate section, linker can then match sections and functions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
# Tell linker to do dead code and data eminination during link time discarding sections # Tell linker to do dead code and data eminination during link time discarding sections
@@ -328,25 +212,20 @@ if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld
endif() endif()
# Default linker optimization flags # Default linker optimization flags
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common") set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common")
else() else()
message(STATUS "Using unknown linker, not setting linker optimizations") message(STATUS "Using unknown linker, not setting linker optimizations")
endif () endif ()
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} ${LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# Activate C++1y # Activate C++11
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++1y")
endif() endif()
# Configuring other platform dependencies # Configuring other platform dependencies
if(APPLE) if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_ARCHITECTURES "x86_64") set(CMAKE_OSX_ARCHITECTURES "x86_64")
message(STATUS "Set Architecture to x64 on OS X") message(STATUS "Set Architecture to x64 on OS X")
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION) exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
@@ -361,183 +240,61 @@ if(APPLE)
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
set(MAYBE_RT_LIBRARY -lrt) set(MAYBE_RT_LIBRARY rt)
endif() endif()
# Disallow deprecated protozero APIs list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
add_definitions(-DPROTOZERO_STRICT_API) set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
find_package(Osmium REQUIRED COMPONENTS io)
add_dependency_includes(${OSMIUM_INCLUDE_DIR})
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# collect a subset of the boost libraries needed
# by libosrm
foreach(lib ${Boost_LIBRARIES})
if(NOT WIN32)
if(lib MATCHES filesystem OR lib MATCHES thread OR lib MATCHES iostreams OR lib MATCHES system)
list(APPEND BOOST_ENGINE_LIBRARIES "${lib}")
endif()
else()
list(APPEND BOOST_ENGINE_LIBRARIES "${lib}")
endif()
endforeach(lib)
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
add_dependency_includes(${Boost_INCLUDE_DIRS})
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
# if mason is enabled no find_package calls are made
# to ensure that we are only compiling and linking against
# fully portable mason packages
if(ENABLE_MASON)
message(STATUS "Installing dependencies via mason")
set(Boost_USE_STATIC_LIBS ON)
mason_use(boost VERSION ${MASON_BOOST_VERSION} HEADER_ONLY)
add_dependency_includes(${MASON_PACKAGE_boost_INCLUDE_DIRS})
mason_use(boost_libfilesystem VERSION ${MASON_BOOST_VERSION})
set(Boost_FILESYSTEM_LIBRARY ${MASON_PACKAGE_boost_libfilesystem_STATIC_LIBS})
mason_use(boost_libiostreams VERSION ${MASON_BOOST_VERSION})
set(Boost_IOSTREAMS_LIBRARY ${MASON_PACKAGE_boost_libiostreams_STATIC_LIBS})
mason_use(boost_libprogram_options VERSION ${MASON_BOOST_VERSION})
set(Boost_PROGRAM_OPTIONS_LIBRARY ${MASON_PACKAGE_boost_libprogram_options_STATIC_LIBS})
mason_use(boost_libregex VERSION ${MASON_BOOST_VERSION})
set(Boost_REGEX_LIBRARY ${MASON_PACKAGE_boost_libregex_STATIC_LIBS})
mason_use(boost_libtest VERSION ${MASON_BOOST_VERSION})
set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY ${MASON_PACKAGE_boost_libtest_STATIC_LIBS})
mason_use(boost_libdate_time VERSION ${MASON_BOOST_VERSION})
set(Boost_DATE_TIME_LIBRARY ${MASON_PACKAGE_boost_libdate_time_STATIC_LIBS})
mason_use(boost_libthread VERSION ${MASON_BOOST_VERSION})
set(Boost_THREAD_LIBRARY ${MASON_PACKAGE_boost_libthread_STATIC_LIBS})
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
set(STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
set(EXPAT_LIBRARIES ${MASON_PACKAGE_expat_STATIC_LIBS})
mason_use(lua VERSION ${MASON_LUA_VERSION})
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
mason_use(tbb VERSION ${MASON_TBB_VERSION})
add_dependency_includes(${MASON_PACKAGE_tbb_INCLUDE_DIRS})
set(TBB_LIBRARIES ${MASON_PACKAGE_tbb_LDFLAGS})
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
endif()
set(TBB_LINKER_RPATHS "")
foreach(libpath ${MASON_PACKAGE_tbb_LIBRARY_DIRS})
set(TBB_LINKER_RPATHS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,${libpath}")
file(GLOB TBBGlob ${libpath}/*.*)
install(FILES ${TBBGlob} DESTINATION lib)
endforeach()
if(APPLE)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@executable_path")
elseif(UNIX)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
# 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)
else()
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
add_dependency_includes(${Boost_INCLUDE_DIRS})
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
endif()
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
add_dependency_includes(${TBB_INCLUDE_DIR}) add_dependency_includes(${TBB_INCLUDE_DIR})
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug) if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES}) set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
endif() endif()
find_package(Luabind REQUIRED)
include(check_luabind)
add_dependency_includes(${LUABIND_INCLUDE_DIR})
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
if(LUAJIT_FOUND)
set(USED_LUA_LIBRARIES, LUAJIT_LIBRARIES)
endif()
add_dependency_includes(${LUA_INCLUDE_DIR})
find_package(EXPAT REQUIRED) find_package(EXPAT REQUIRED)
add_dependency_includes(${EXPAT_INCLUDE_DIRS}) add_dependency_includes(${EXPAT_INCLUDE_DIRS})
find_package(STXXL REQUIRED) find_package(STXXL REQUIRED)
add_dependency_includes(${STXXL_INCLUDE_DIR}) add_dependency_includes(${STXXL_INCLUDE_DIR})
find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})
FIND_PACKAGE(Lua 5.2 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
# Now fall back to a lua verison without exact
# in case this cmake version also forces patch versions
FIND_PACKAGE(Lua 5.2)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
add_dependency_includes(${LUA_INCLUDE_DIR})
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()
# note libosmium depends on expat and bzip2
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
find_package(Osmium REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
endif()
# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Using ccache to speed up incremental builds")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
set(ENV{CCACHE_CPP2} "true")
endif()
endif()
# even with mason builds we want to link to system zlib
# to ensure that osrm binaries play well with other binaries like nodejs
find_package(ZLIB REQUIRED)
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
set(OpenMP_FIND_QUIETLY ON) set(OpenMP_FIND_QUIETLY ON)
find_package(OpenMP) find_package(OpenMP)
if(OPENMP_FOUND) if(OPENMP_FOUND)
@@ -545,34 +302,32 @@ if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif() endif()
find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})
find_package(ZLIB REQUIRED)
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
if (ENABLE_JSON_LOGGING)
message(STATUS "Enabling json logging")
add_dependency_defines(-DENABLE_JSON_LOGGING)
endif()
add_definitions(${OSRM_DEFINES}) add_definitions(${OSRM_DEFINES})
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS}) include_directories(SYSTEM ${OSRM_INCLUDE_PATHS})
set(BOOST_BASE_LIBRARIES
${Boost_DATE_TIME_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_SYSTEM_LIBRARY})
set(BOOST_ENGINE_LIBRARIES
${Boost_ZLIB_LIBRARY}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_LIBRARIES})
# Binaries # Binaries
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-datastore osrm_store ${Boost_LIBRARIES})
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-extract osrm_extract ${Boost_LIBRARIES})
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-contract osrm_contract ${Boost_LIBRARIES})
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY}) target_link_libraries(osrm-routed osrm ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
set(EXTRACTOR_LIBRARIES set(EXTRACTOR_LIBRARIES
${BZIP2_LIBRARIES} ${BZIP2_LIBRARIES}
${Boost_REGEX_LIBRARY} ${Boost_LIBRARIES}
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${EXPAT_LIBRARIES} ${EXPAT_LIBRARIES}
${LUABIND_LIBRARY}
${USED_LUA_LIBRARIES} ${USED_LUA_LIBRARIES}
${OSMIUM_LIBRARIES} ${OSMIUM_LIBRARIES}
${STXXL_LIBRARY} ${STXXL_LIBRARY}
@@ -580,8 +335,9 @@ set(EXTRACTOR_LIBRARIES
${ZLIB_LIBRARY} ${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}) ${MAYBE_COVERAGE_LIBRARIES})
set(CONTRACTOR_LIBRARIES set(CONTRACTOR_LIBRARIES
${BOOST_BASE_LIBRARIES} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${LUABIND_LIBRARY}
${USED_LUA_LIBRARIES} ${USED_LUA_LIBRARIES}
${STXXL_LIBRARY} ${STXXL_LIBRARY}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
@@ -595,13 +351,13 @@ set(ENGINE_LIBRARIES
${MAYBE_COVERAGE_LIBRARIES} ${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY}) ${ZLIB_LIBRARY})
set(STORAGE_LIBRARIES set(STORAGE_LIBRARIES
${BOOST_BASE_LIBRARIES} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY} ${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}) ${MAYBE_COVERAGE_LIBRARIES})
set(UTIL_LIBRARIES set(UTIL_LIBRARIES
${BOOST_BASE_LIBRARIES} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY} ${STXXL_LIBRARY}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
@@ -612,25 +368,34 @@ target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES}) target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_store ${STORAGE_LIBRARIES}) target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# BUILD_COMPONENTS if(BUILD_COMPONENTS)
find_package(GDAL)
if(GDAL_FOUND)
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>) add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES}) target_link_libraries(osrm-components ${TBB_LIBRARIES})
include_directories(SYSTEM ${GDAL_INCLUDE_DIR})
target_link_libraries(osrm-components ${GDAL_LIBRARIES} ${Boost_LIBRARIES})
install(TARGETS osrm-components DESTINATION bin) install(TARGETS osrm-components DESTINATION bin)
else()
message(WARNING "libgdal and/or development headers not found")
endif()
endif()
if(BUILD_TOOLS) if(BUILD_TOOLS)
message(STATUS "Activating OSRM internal tools") message(STATUS "Activating OSRM internal tools")
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>) add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES}) target_link_libraries(osrm-io-benchmark ${Boost_LIBRARIES})
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-unlock-all ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if(UNIX AND NOT APPLE)
target_link_libraries(osrm-unlock-all rt)
endif()
add_executable(osrm-springclean src/tools/springclean.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-springclean ${Boost_LIBRARIES})
install(TARGETS osrm-io-benchmark DESTINATION bin) install(TARGETS osrm-io-benchmark DESTINATION bin)
install(TARGETS osrm-unlock-all DESTINATION bin)
find_package(Shapefile) # package libshp-dev install(TARGETS osrm-springclean DESTINATION bin)
if(Shapefile_FOUND)
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LIBSHAPEFILE_LIBRARY})
install(TARGETS osrm-extract-conditionals DESTINATION bin)
endif()
endif() endif()
if (ENABLE_ASSERTIONS) if (ENABLE_ASSERTIONS)
@@ -646,11 +411,11 @@ set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp) file(GLOB VariantGlob third_party/variant/*.hpp)
file(GLOB LibraryGlob include/osrm/*.hpp) file(GLOB LibraryGlob include/osrm/*.hpp)
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp) 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/phantom_node.hpp) set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp) set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp) set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp) set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp) set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
@@ -661,7 +426,7 @@ install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor) install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
install(FILES ${LibraryGlob} DESTINATION include/osrm) install(FILES ${LibraryGlob} DESTINATION include/osrm)
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api) install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
install(FILES ${VariantGlob} DESTINATION include/mapbox) install(FILES ${VariantGlob} DESTINATION include/variant)
install(TARGETS osrm-extract DESTINATION bin) install(TARGETS osrm-extract DESTINATION bin)
install(TARGETS osrm-contract DESTINATION bin) install(TARGETS osrm-contract DESTINATION bin)
install(TARGETS osrm-datastore DESTINATION bin) install(TARGETS osrm-datastore DESTINATION bin)
@@ -671,16 +436,17 @@ install(TARGETS osrm_extract DESTINATION lib)
install(TARGETS osrm_contract DESTINATION lib) install(TARGETS osrm_contract DESTINATION lib)
install(TARGETS osrm_store DESTINATION lib) install(TARGETS osrm_store DESTINATION lib)
list(GET ENGINE_LIBRARIES 1 ENGINE_LIBRARY_FIRST)
foreach(lib ${ENGINE_LIBRARIES})
get_filename_component(ENGINE_LIBRARY_PATH "${ENGINE_LIBRARY_FIRST}" PATH)
get_filename_component(ENGINE_LIBRARY_NAME "${lib}" NAME_WE)
string(REPLACE "lib" "" ENGINE_LIBRARY_NAME ${ENGINE_LIBRARY_NAME})
string(REPLACE "-l" "" ENGINE_LIBRARY_NAME ${ENGINE_LIBRARY_NAME})
set(ENGINE_LIBRARY_LISTING "${ENGINE_LIBRARY_LISTING} -L${ENGINE_LIBRARY_PATH} -l${ENGINE_LIBRARY_NAME}")
endforeach()
# Install profiles and support library to /usr/local/share/osrm/profiles by default if(BUILD_DEBIAN_PACKAGE)
set(DefaultProfilesDir profiles) include(CPackDebianConfig)
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
# Setup exporting variables for pkgconfig and subproject
#
if(BUILD_PACKAGE)
include(CPackConfig)
include(CPack) include(CPack)
endif() endif()
@@ -689,36 +455,34 @@ function(JOIN VALUES GLUE OUTPUT)
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction() endfunction()
JOIN("${OSRM_DEFINES}" " " TMP_OSRM_DEFINES) # Set up variables, then write to pkgconfig file
set(LibOSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${TMP_OSRM_DEFINES}") JOIN("${OSRM_DEFINES}" " " OSRM_DEFINES_STRING)
set(LibOSRM_LDFLAGS "${OSRM_LDFLAGS}") JOIN("-I${OSRM_INCLUDE_PATHS}" " -I" OSRM_INCLUDE_PATHS_STRING)
if(BUILD_AS_SUBPROJECT)
set(LibOSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(LibOSRM_LIBRARIES "osrm" PARENT_SCOPE)
set(LibOSRM_DEPENDENT_LIBRARIES "${ENGINE_LIBRARIES}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/include/osrm"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party"
"${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIRS "${LibOSRM_LIBRARY_DIR}" PARENT_SCOPE)
endif()
# pkgconfig defines
set(PKGCONFIG_OSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}")
set(PKGCONFIG_OSRM_LDFLAGS "${LibOSRM_LDFLAGS}")
set(PKGCONFIG_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set(PKGCONFIG_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm")
JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()
# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Using ccache to speed up incremental builds")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
set(ENV{CCACHE_CPP2} "true")
endif()
endif()
# uninstall target # uninstall target
configure_file( configure_file(
@@ -733,34 +497,3 @@ add_custom_target(uninstall
# Modular build system: each directory registered here provides its own CMakeLists.txt # Modular build system: each directory registered here provides its own CMakeLists.txt
add_subdirectory(unit_tests) add_subdirectory(unit_tests)
add_subdirectory(src/benchmarks) add_subdirectory(src/benchmarks)
if (ENABLE_FUZZING)
# Requires libosrm being built with sanitizers; make configurable and default to ubsan
set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing")
set_property(CACHE FUZZ_SANITIZER PROPERTY STRINGS "undefined" "integer" "address" "memory" "thread" "leak")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fsanitize=address")
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
add_subdirectory(fuzz)
endif ()
## add headers sanity check target that includes all headers independently
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
file(GLOB_RECURSE headers_to_check
${PROJECT_BINARY_DIR}/*.hpp
${PROJECT_SOURCE_DIR}/include/*.hpp)
foreach(header ${headers_to_check})
get_filename_component(filename ${header} NAME_WE)
set(filename "${check_headers_dir}/${filename}.cpp")
if (NOT EXISTS ${filename})
file(WRITE ${filename} "#include \"${header}\"\n")
endif()
list(APPEND sources ${filename})
endforeach()
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
-77
View File
@@ -1,77 +0,0 @@
# User
Before you open a new issue, please search for older ones that cover the same issue.
In general "me too" comments/issues are frowned upon.
You can add a :+1: emoji to the issue if you want to express interest in this.
# Developer
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
To save development time a local hook `.git/hooks/pre-push`
```
#!/bin/sh
remote="$1"
if [ x"$remote" = xorigin ] ; then
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
echo "Rejected push to $remote/master" ; exit 1
fi
./scripts/format.sh
if [ $? -ne 0 ] ; then
echo "Unstaged format changes" ; exit 1
fi
fi
```
could check code format, modify a local repository and reject push due to unstaged formatting changes.
Also `pre-push` hook rejects direct pushes to `origin/master`.
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
## Pull Request
Every pull-request that changes the API needs to update the docs in `docs/http.md` and add an entry to `CHANGELOG.md`.
Breaking changes need to have a BREAKING prefix. See the [releasing documentation](docs/releasing.md) on how this affects the version.
Early feedback is also important.
You will see that a lot of the PR have tags like `[not ready]` or `[wip]`.
We like to open PRs as soon as we are starting to work on something to make it visible to the rest of the team.
If your work is going in entirely the wrong direction, there is a good chance someone will pick up on this before it is too late.
Everyone is encouraged to read PRs of other people and give feedback.
For every significant code change we require a pull request review before it is merged.
If your pull request modifies the API this need to be signed of by a team discussion.
This means you will need to find another member of the team with commit access and request a review of your pull request.
Once your pull request is reviewed you can merge it! If you don't have commit access, ping someone that has commit access.
If you do have commit access there are in general two accepted styles to merging:
1. Make sure the branch is up to date with `master`. Run `git rebase master` to find out.
2. Once that is ensured you can either:
- Click the nice green merge button (for a non-fast-forward merge)
- Merge by hand using a fast-forward merge
Which merge you prefer is up to personal preference. In general it is recommended to use fast-forward merges because it creates a history that is sequential and easier to understand.
# Maintainer
## Doing a release
There is an in-depth guide around how to push out a release once it is ready [here](docs/releasing.md).
## The API
Changes to the API need to be discussed and signed off by the team. Breaking changes even more so than additive changes.
## Milestones
If a pull request or an issue is applicable for the current or next milestone, depends on the target version number.
Since we use semantic versioning we restrict breaking changes to major releases.
After a Release Candidate is released we usually don't change the API anymore if it is not critical.
Bigger code changes after a RC was released should also be avoided.
+41 -68
View File
@@ -1,90 +1,62 @@
## Open Source Routing Machine ## About
| Linux / macOS | Windows | Code Coverage | The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
| ------------- | ------- | ------------- |
| [![Travis](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=master)](https://travis-ci.org/Project-OSRM/osrm-backend) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [![Codecov](https://codecov.io/gh/Project-OSRM/osrm-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/Project-OSRM/osrm-backend) |
High performance routing engine written in C++14 designed to run on OpenStreetMap data. ## Current build status
The following services are available via HTTP API, C++ library interface and NodeJs wrapper: | build config | status |
- Nearest - Snaps coordinates to the street network and returns the nearest matches |:-------------|:-------|
- Route - Finds the fastest route between coordinates | Linux | [![Build Status](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=master)](https://travis-ci.org/Project-OSRM/osrm-backend) |
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates | Windows | [![Build status](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
- Match - Snaps noisy GPS traces to the road network in the most plausible way | Coverage | [![codecov](https://codecov.io/gh/Project-OSRM/osrm-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/Project-OSRM/osrm-backend) |
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top. ## Building
Related [Project-OSRM](https://github.com/Project-OSRM) repositories: For instructions on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
## Contact To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
## Quick Start
The following targets Ubuntu 16.04.
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
#### Install dependencies
```bash
sudo apt install build-essential git cmake pkg-config \
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
```
#### Compile and install OSRM binaries:
```bash
mkdir -p build
cd build
cmake ..
cmake --build .
sudo cmake --build . --target install
```
#### Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
```bash
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
```
#### Pre-process the extract and start the HTTP server
```
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm
```
#### Running Queries
```
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
```
## Documentation ## Documentation
### Full documentation ### Full documentation
- [Hosted documentation](http://project-osrm.org)
- [osrm-routed HTTP API documentation](docs/http.md) - [osrm-routed HTTP API documentation](docs/http.md)
- [libosrm API documentation](docs/libosrm.md) - [libosrm API documentation](docs/libosrm.md)
### Quick start
Building OSRM assuming all dependencies are installed:
```
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
sudo cmake --build . --target install
```
Loading preparing a dataset and starting the server:
```
osrm-extract data.osm.pbf -p profiles/car.lua
osrm-contract data.osrm
osrm-routed data.osrm
```
Running a query on your local server:
```
curl http://127.0.0.1:5000/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
```
### Running a request against the Demo Server ### Running a request against the Demo Server
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy). First read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
Simple query with instructions and alternatives on Berlin:
Then run simple query with instructions and alternatives on Berlin:
``` ```
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true curl https://router.project-osrm.org/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
``` ```
## References in publications ## References in publications
@@ -109,3 +81,4 @@ When using the code in a (scientific) publication, please cite
address = {New York, NY, USA}, address = {New York, NY, USA},
} }
``` ```
+7 -18
View File
@@ -8,18 +8,18 @@ SET PROJECT_DIR=%CD%
ECHO PROJECT_DIR^: %PROJECT_DIR% ECHO PROJECT_DIR^: %PROJECT_DIR%
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS% ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
ECHO cmake^: && cmake --version ECHO cmake^: && cmake --version
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found GOTO ERROR
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK FOR /F %%G IN ("--version") DO cmake %%G 2>&1 | findstr /C:"3.5.0" > nul && goto CMAKE_NOT_OK
GOTO CMAKE_OK
:CMAKE_NOT_OK :CMAKE_NOT_OK
SET CMAKE_VERSION=3.7.1 ECHO CMAKE NOT OK - downloading new CMake
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION% IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.5/cmake-3.5.1-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive" IF NOT EXIST cmake-3.5.1-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH% SET PATH=%PROJECT_DIR%\cmake-3.5.1-win32-x86\bin;%PATH%
:CMAKE_OK :CMAKE_OK
ECHO CMAKE_OK ECHO CMAKE_OK
@@ -119,27 +119,16 @@ SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
ECHO running extractor-tests.exe ... ECHO running extractor-tests.exe ...
unit_tests\%Configuration%\extractor-tests.exe unit_tests\%Configuration%\extractor-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running engine-tests.exe ... ECHO running engine-tests.exe ...
unit_tests\%Configuration%\engine-tests.exe unit_tests\%Configuration%\engine-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running util-tests.exe ... ECHO running util-tests.exe ...
unit_tests\%Configuration%\util-tests.exe unit_tests\%Configuration%\util-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running server-tests.exe ... ECHO running server-tests.exe ...
unit_tests\%Configuration%\server-tests.exe unit_tests\%Configuration%\server-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running library-tests.exe ...
SET test_region=monaco
SET test_osm=%test_region%.osm.pbf
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
%Configuration%\osrm-contract.exe %test_region%.osrm
unit_tests\%Configuration%\library-tests.exe %test_region%.osrm
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
ECHO ========= CREATING PACKAGES ========== ECHO ========= CREATING PACKAGES ==========
+1 -11
View File
@@ -3,9 +3,6 @@ environment:
- configuration: Release - configuration: Release
# - configuration: Debug # - configuration: Debug
install:
- ps: Install-Product node 6
# scripts that are called at very beginning, before repo cloning # scripts that are called at very beginning, before repo cloning
init: init:
- git config --global core.autocrlf input - git config --global core.autocrlf input
@@ -20,14 +17,7 @@ platform: x64
build_script: build_script:
- CALL appveyor-build.bat - CALL appveyor-build.bat
before_test: test: off
- node --version
- npm --version
- npm install
- npm link
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
- SET OSRM_BUILD_DIR=build\%Configuration%
- npm test
artifacts: artifacts:
- path: osrm_Release.zip - path: osrm_Release.zip
+2 -1
View File
@@ -11,7 +11,8 @@ SET CONFIGURATION=Release
FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH% ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.7.0-rc2-win32-x86\bin;%PATH% ::SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.5.0-win32-x86\bin;%PATH%
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.5.1-win32-x86\bin;%PATH%
SET PATH=C:\Program Files\7-Zip;%PATH% SET PATH=C:\Program Files\7-Zip;%PATH%
powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
-44
View File
@@ -1,44 +0,0 @@
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
ENDIF()
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
SET(CPACK_STRIP_FILES "TRUE")
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
SET(CPACK_GENERATOR "DEB")
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
else(DPKG_PROGRAM)
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
if(RPMBUILD_PROGRAM)
SET(CPACK_GENERATOR "RPM")
execute_process(
COMMAND ${RPM_PROGRAM} --eval %{_arch}
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif(RPMBUILD_PROGRAM)
endif(DPKG_PROGRAM)
+41
View File
@@ -0,0 +1,41 @@
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
ENDIF()
INCLUDE(FindDebArch)
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
# To create a proper Debian/Ubuntu package, the following CMake
# options should be used:
SET(CPACK_STRIP_FILES "TRUE")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
-194
View File
@@ -1,194 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindLua
# -------
#
#
#
# Locate Lua library This module defines
#
# ::
#
# LUA_FOUND - if false, do not try to link to Lua
# LUA_LIBRARIES - both lua and lualib
# LUA_INCLUDE_DIR - where to find lua.h
# LUA_VERSION_STRING - the version of Lua found
# LUA_VERSION_MAJOR - the major version of Lua
# LUA_VERSION_MINOR - the minor version of Lua
# LUA_VERSION_PATCH - the patch version of Lua
#
#
#
# Note that the expected include convention is
#
# ::
#
# #include "lua.h"
#
# and not
#
# ::
#
# #include <lua/lua.h>
#
# This is because, the lua location is not standardized and may exist in
# locations other than lua/
unset(_lua_include_subdirs)
unset(_lua_library_names)
unset(_lua_append_versions)
# this is a function only to have all the variables inside go away automatically
function(_lua_set_version_vars)
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
if (Lua_FIND_VERSION_EXACT)
if (Lua_FIND_VERSION_COUNT GREATER 1)
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
endif ()
elseif (Lua_FIND_VERSION)
# once there is a different major version supported this should become a loop
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
if (Lua_FIND_VERSION_COUNT EQUAL 1)
set(_lua_append_versions ${LUA_VERSIONS5})
else ()
foreach (subver IN LISTS LUA_VERSIONS5)
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
list(APPEND _lua_append_versions ${subver})
endif ()
endforeach ()
endif ()
endif ()
else ()
# once there is a different major version supported this should become a loop
set(_lua_append_versions ${LUA_VERSIONS5})
endif ()
list(APPEND _lua_include_subdirs "include/lua" "include")
foreach (ver IN LISTS _lua_append_versions)
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
list(APPEND _lua_include_subdirs
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
)
list(APPEND _lua_library_names
lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
)
endforeach ()
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
endfunction(_lua_set_version_vars)
function(_lua_check_header_version _hdr_file)
# At least 5.[012] have different ways to express the version
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
file(STRINGS "${_hdr_file}" lua_version_strings
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
else ()
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
endif ()
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
endif ()
foreach (ver IN LISTS _lua_append_versions)
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
return()
endif ()
endforeach ()
endfunction(_lua_check_header_version)
_lua_set_version_vars()
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
endif ()
if (NOT LUA_VERSION_STRING)
foreach (subdir IN LISTS _lua_include_subdirs)
unset(LUA_INCLUDE_PREFIX CACHE)
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
HINTS
ENV LUA_DIR
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
if (LUA_INCLUDE_PREFIX)
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
if (LUA_VERSION_STRING)
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
break()
endif ()
endif ()
endforeach ()
endif ()
unset(_lua_include_subdirs)
unset(_lua_append_versions)
find_library(LUA_LIBRARY
NAMES ${_lua_library_names} lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
unset(_lua_library_names)
if (LUA_LIBRARY)
# include the math library for Unix
if (UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
# include dl library for statically-linked Lua library
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# For Windows and Mac, don't need to explicitly include the math library
else ()
set(LUA_LIBRARIES "${LUA_LIBRARY}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)
+82
View File
@@ -0,0 +1,82 @@
# Locate Lua library
# This module defines
# LUA52_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
# Copyright 2016 for Project-OSRM, Lua5.1 => Lua5.2
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua-5.2 include/lua include
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
find_library(LUA_LIBRARY
NAMES lua52 lua5.2 lua-5.2 lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
if(LUA_LIBRARY)
# include the math library for Unix
if(UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
else()
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
endif()
endif()
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
unset(lua_version_str)
endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
+93
View File
@@ -0,0 +1,93 @@
# Locate Lua library
# This module defines
# LUAJIT_FOUND, if false, do not try to link to Lua
# LUAJIT_LIBRARIES
# LUAJIT_INCLUDE_DIR, where to find lua.h
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
#
# ################
# 2010 - modified for cronkite to find luajit instead of lua, as it was before.
#
if ( NOT LuaJIT_FIND_VERSION )
MESSAGE(FATAL_ERROR "You need to specify a version of libluajit to use")
ENDIF()
IF( NOT LUAJIT_FIND_QUIETLY )
MESSAGE(STATUS "Looking for LuaJIT ${LuaJIT_FIND_VERSION}")
ENDIF()
FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
HINTS
$ENV{LUAJIT_DIR}
PATH_SUFFIXES include/luajit-2.0 include/luajit2.0 include/luajit include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
FIND_LIBRARY(LUAJIT_LIBRARY
NAMES luajit-${LuaJIT_FIND_VERSION_MAJOR}${LuaJIT_FIND_VERSION_MINOR} luajit-${LuaJIT_FIND_VERSION}
HINTS
$ENV{LUAJIT_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
IF(LUAJIT_LIBRARY)
# include the math library for Unix
IF(UNIX AND NOT APPLE)
FIND_LIBRARY(LUAJIT_MATH_LIBRARY m)
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
ELSE(UNIX AND NOT APPLE)
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
ENDIF(UNIX AND NOT APPLE)
ENDIF(LUAJIT_LIBRARY)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LUAJIT DEFAULT_MSG LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
IF( NOT LUAJIT_FIND_QUIETLY )
IF( LUAJIT_FOUND AND LUAJIT_LIBRARIES)
MESSAGE(STATUS "Found LuaJIT: ${LUAJIT_LIBRARY}" )
MARK_AS_ADVANCED(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
ELSE()
SET ( LUAJIT_FOUND FALSE )
ENDIF()
ENDIF()
+75
View File
@@ -0,0 +1,75 @@
# Locate Luabind library
# This module defines
# LUABIND_FOUND, if false, do not try to link to Luabind
# LUABIND_LIBRARIES
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
#
# Note that the expected include convention is
# #include <luabind/luabind.hpp>
# and not
# #include <luabind.hpp>
IF( NOT LUABIND_FIND_QUIETLY )
MESSAGE(STATUS "Looking for Luabind...")
ENDIF()
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES luabind include/luabind include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local # DarwinPorts
/opt
)
FIND_LIBRARY(LUABIND_LIBRARY
NAMES luabind luabind09
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local
/opt
)
FIND_LIBRARY(LUABIND_LIBRARY_DBG
NAMES luabindd
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local
/opt
)
IF(LUABIND_LIBRARY)
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
ENDIF(LUABIND_LIBRARY)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
IF( NOT LUABIND_FIND_QUIETLY )
IF( LUABIND_FOUND )
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
ENDIF()
IF( LUABIND_LIBRARY_DBG )
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
ENDIF()
ENDIF()
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
-21
View File
@@ -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)
+24
View File
@@ -0,0 +1,24 @@
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
set(NEWFILE ${OLDFILE}.tmp)
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
file(MD5 ${SOURCE_DIR}/include/engine/datafacade/internal_datafacade.hpp MD5OBJECTS)
CONFIGURE_FILE(${INFILE} ${NEWFILE})
file(MD5 ${NEWFILE} MD5NEW)
if (EXISTS ${OLDFILE})
file(MD5 ${OLDFILE} MD5OLD)
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
file(REMOVE_RECURSE ${OLDFILE})
file(RENAME ${NEWFILE} ${OLDFILE})
else()
file(REMOVE_RECURSE ${NEWFILE})
message(STATUS "Fingerprint unchanged, not regenerating")
endif()
else()
file(RENAME ${NEWFILE} ${OLDFILE})
endif()
+40
View File
@@ -0,0 +1,40 @@
INCLUDE (CheckCXXSourceCompiles)
unset(LUABIND_WORKS CACHE)
unset(LUABIND51_WORKS CACHE)
set (LUABIND_CHECK_SRC "extern \"C\" {\n#include \"lua.h\"\n#include \"lauxlib.h\"\n}\n#include <luabind/open.hpp>\nint main() { lua_State *x = luaL_newstate(); luabind::open(x); }")
set (CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
find_package(Lua52)
if(NOT APPLE)
find_package(LuaJIT 5.2)
endif()
if(LUA52_FOUND)
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
CHECK_CXX_SOURCE_COMPILES("${LUABIND_CHECK_SRC}" LUABIND_WORKS)
endif()
if(LUABIND_WORKS)
message(STATUS "Luabind/Lua5.2 combination working with ${LUA_LIBRARY}")
else()
message(STATUS "Luabind/Lua5.2 not feasible, falling back to Lua 5.1.")
unset(LUA_FOUND CACHE)
unset(LUA_INCLUDE_DIR CACHE)
unset(LUA_LIBRARY CACHE)
find_package(Lua51 REQUIRED)
if(NOT APPLE)
find_package(LuaJIT 5.1)
endif()
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
CHECK_CXX_SOURCE_COMPILES("${LUABIND_CHECK_SRC}" LUABIND51_WORKS)
if(LUABIND51_WORKS)
message(STATUS "Luabind works with Lua 5.1 at ${LUA_LIBRARY}")
else()
message(FATAL_ERROR "Luabind does not work with Lua 5.1 at ${LUA_LIBRARY}, no working Luabind found")
endif()
endif()
+6 -6
View File
@@ -1,11 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@ prefix=@CMAKE_INSTALL_PREFIX@
includedir=@PKGCONFIG_INCLUDE_DIR@ includedir=${prefix}/include
libdir=@PKGCONFIG_LIBRARY_DIR@ libdir=${prefix}/lib
Name: libOSRM Name: libOSRM
Description: Project OSRM library Description: Project OSRM library
Version: v@OSRM_VERSION@ Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
Requires: Requires:
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@ Libs: -L${libdir} -losrm
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@ Libs.private: @ENGINE_LIBRARY_LISTING@
Cflags: @PKGCONFIG_OSRM_INCLUDE_FLAGS@ @PKGCONFIG_OSRM_CXXFLAGS@ Cflags: -I${includedir} -I${includedir}/osrm @OSRM_INCLUDE_PATHS_STRING@ @OSRM_DEFINES_STRING@ @CMAKE_CXX_FLAGS@
+6 -4
View File
@@ -1,8 +1,10 @@
module.exports = { module.exports = {
default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions', default: '--require features --tags ~@stress --tags ~@todo',
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions', verify: '--require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress',
todo: '--strict --tags @todo --require features/support --require features/step_definitions', jenkins: '--require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress',
all: '--strict --require features/support --require features/step_definitions' bugs: '--require features --tags @bug',
todo: '--require features --tags @todo',
all: '--require features'
} }
+13 -4
View File
@@ -1,9 +1,18 @@
FROM ubuntu:14.04 FROM ubuntu:14.04
RUN apt-get update -y && apt-get install -y software-properties-common RUN apt-get update -y
RUN add-apt-repository ppa:ubuntu-toolchain-r/test RUN apt-get install -y build-essential git-core python-pip python-software-properties software-properties-common
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libboost-all-dev ccache
RUN apt-get -y install curl cmake cmake-curses-gui git RUN apt-get -y install gcc-4.8 g++-4.8 libboost1.55-all-dev llvm-3.4
RUN apt-get -y install libbz2-dev libstxxl-dev libstxxl1 libxml2-dev
RUN apt-get -y install libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev
RUN apt-get -y install curl cmake cmake-curses-gui
RUN pip install awscli
# luabind
RUN curl https://gist.githubusercontent.com/DennisOSRM/f2eb7b948e6fe1ae319e/raw/install-luabind.sh | sudo bash
WORKDIR /opt WORKDIR /opt
RUN git clone --depth 1 --branch v0.31.0 https://github.com/creationix/nvm.git RUN git clone --depth 1 --branch v0.31.0 https://github.com/creationix/nvm.git
+1 -2
View File
@@ -5,8 +5,7 @@ set -o pipefail
docker run \ docker run \
-i \ -i \
-e "CXX=g++-5" \ -e "CXX=g++" \
-e "CC=gcc-5" \
-v `pwd`:/home/mapbox/osrm-backend \ -v `pwd`:/home/mapbox/osrm-backend \
-t mapbox/osrm:linux \ -t mapbox/osrm:linux \
/bin/bash -lc "osrm-backend/docker/test.sh" /bin/bash -lc "osrm-backend/docker/test.sh"
-62
View File
@@ -1,62 +0,0 @@
# Developing / Debugging guidance code
When changing guidance code, it is easy to introduce problems somewhere in the network.
To get a better feeling of how your changes impact the OSRM experience, we offer ways of generating geojson output to inspect (e.g. with Mapbox Studio).
When you do changes, make sure to inspect a few areas for the impact of the changes.
## How to use GeoJson-Debugging
This is a short guide to describe usage of our GeoJson debug logging mechanism. It is synchronized to guarantee thread-safe logging.
## Outputting into a single file
To use it, the inclusion of `geojson_debug_logger.hpp` `geojson_debug_policies.hpp` from the `util` directory is required.
Geojson debugging requires a few simple steps to output data into a feature collection.
- Create a Scoped Guard that lives through the process and provide it with all required datastructures (it needs to span the lifetime of all your logging efforts)
- At the location of the output, simply call Write with your own parameters.
A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we provide a way of printing out node-ids as coordinates.
The initialisation to do so looks like this:
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
Make sure to give the guar a name, so it actually gets a lifetime.
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
The policy itself offers a `operator()` accepting a `vector` of `NodeID`.
For outputting data into our file (debug.geojson), we simply need to call the matching logging routine of the guard: `util::ScioedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);`
(or `guard.Write(list_of_node_ids)` if you created an instance).
### Possible Scopeguard Location
Think of the scopeguard as you would do of any reference. If you wan't to access to logging during a call, the guard object must be alive and valid.
As an example: a good location to create the a scopeguard to log decisions in the edge-based-graph-factory would be right before we run it ([here](https://github.com/Project-OSRM/osrm-backend/blob/a933b5d94943bf3edaf42c84a614a99650d23cba/src/extractor/extractor.cpp#L497)). If you put `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", node_coordinate_vector);` at that location, you can then print `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);` anywhere within the `edge-based-graph-factory`.
This location would enable call for all guidance related pre-processing which is called in the edge-based-graph-factory.
Logging any turn-handler decisions, for example, would now be possible.
## Limitations
GeoJson debugging requires a single GeoJsonGuard (ScopedGeojsonLoggerGuard) for each desired output file.
For each set of template parameters, only the most recent guard will actually produce output.
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug-2.geojson", data-for-conversion);`
Will not provide a way to write into two files, but only `debug-2` will actually contain features.
We cannot nest-these calls.
If we want to use the same policy for multiple files, we need to use different template parameters both for the logger and the guard.
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString,0> geojson_guard( "debug.geojson", data-for-conversion);`
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString,1> geojson_guard( "debug-2.geojson", data-for-conversion);`
as well as,
`util::ScopedGeojsonLoggerGuardr<util::NodeIdVectorToLineString,0>::Write(list_of_node_ids);`
`util::ScopedGeojsonLoggerGuardr<util::NodeIdVectorToLineString,1>::Write(list_of_node_ids);`
+246 -427
View File
@@ -1,44 +1,50 @@
## General options ## Environent Variables
All OSRM HTTP requests use a common structure. ### SIGNAL_PARENT_WHEN_READY
The following syntax applies to all services, except as noted. If the SIGNAL_PARENT_WHEN_READY environment variable is set osrm-routed will
send the USR1 signal to its parent when it will be running and waiting for
requests. This could be used to upgrade osrm-routed to a new binary on the fly
without any service downtime - no incoming requests will be lost.
### Requests ### DISABLE_ACCESS_LOGGING
```endpoint If the DISABLE_ACCESS_LOGGING environment variable is set osrm-routed will
GET /{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value **not** log any http requests to standard output. This can be useful in high
traffic setup.
## HTTP API
`osrm-routed` supports only `GET` requests of the form. If you your response size
exceeds the limits of a simple URL encoding, consider using our [NodeJS bindings](https://github.com/Project-OSRM/node-osrm)
or using the [C++ library directly](libosrm.md).
### Request
```
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
``` ```
| Parameter | Description | - `server`: location of the server. Example: `127.0.0.1:5000` (default)
| --- | --- | - `service`: Name of the service to be used. Support are the following services:
| `service` | One of the following values: [`route`](#route-service), [`nearest`](#nearest-service), [`table`](#table-service), [`match`](#match-service), [`trip`](#trip-service), [`tile`](#tile-service) |
| `version` | Version of the protocol implemented by the service. `v1` for all OSRM 5.x installations |
| `profile` | Mode of transportation, is determined statically by the Lua profile that is used to prepare the data using `osrm-extract`. Typically `car`, `bike` or `foot` if using one of the supplied profiles. |
| `coordinates`| String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`. |
| `format`| Only `json` is supported at the moment. This parameter is optional and defaults to `json`. |
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 by default and can be generated using [this package](https://www.npmjs.com/package/polyline). | Service | Description |
|-------------|-----------------------------------------------------------|
| [`route`](#service-route) | shortest path between given coordinates |
| [`nearest`](#service-nearest) | returns the nearest street segment for a given coordinate |
| [`table`](#service-table) | computes distance tables for given coordinates |
| [`match`](#service-match) | matches given coordinates to the road network |
| [`trip`](#service-trip) | Compute the shortest round trip between given coordinates |
| [`tile`](#service-tile) | Return vector tiles containing debugging info |
- `version`: Version of the protocol implemented by the service.
- `profile`: Mode of transportation, is determined by the profile that is used to prepare the data
- `coordinates`: String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`.
- `format`: Only `json` is supportest at the moment. This parameter is optional and defaults to `json`.
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 and can be generated using [this package](https://www.npmjs.com/package/polyline).
To pass parameters to each location some options support an array like encoding: To pass parameters to each location some options support an array like encoding:
**Request options**
| Option | Values | Description |
|----------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
Where the elements follow the following format:
| Element | Values |
|------------|--------------------------------------------------------|
|bearing |`{value},{range}` `integer 0 .. 360,integer 0 .. 180` |
|radius |`double >= 0` or `unlimited` (default) |
|hint |Base64 `string` |
``` ```
{option}={element};{element}[;{element} ... ] {option}={element};{element}[;{element} ... ]
``` ```
@@ -51,19 +57,48 @@ Example: 2nd location use the default value for `option`:
{option}={element};;{element} {option}={element};;{element}
``` ```
#### Example Requests ## General options
```curl | Option | Values | Description |
# Query on Berlin with three coordinates: |------------|--------------------------------------------------------|--------------------------------------------------|
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false' |bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|hints |`{hint};{hint}[;{hint} ...]` |Hint to derive position in street network. |
# Using polyline: Where the elements follow the following format:
curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'
| Element | Values |
|------------|--------------------------------------------------------|
|bearing |`{value},{range}` `integer 0 .. 360,integer 0 .. 180` |
|radius |`double >= 0` or `unlimited` (default) |
|hint |Base64 `string` |
#### Examples
Query on Berlin with three coordinates:
```
http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
``` ```
### Responses Using polyline:
Every response object has a `code` property containing one of the strings below or a service dependent code: ```
http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false
```
### Response
Every response object has a `code` field.
```json
{
"code": {code},
"message": {message}
}
```
Where `code` is on one of the strings below or service dependent:
| Type | Description | | Type | Description |
|-------------------|----------------------------------------------------------------------------------| |-------------------|----------------------------------------------------------------------------------|
@@ -72,32 +107,21 @@ Every response object has a `code` property containing one of the strings below
| `InvalidService` | Service name is invalid. | | `InvalidService` | Service name is invalid. |
| `InvalidVersion` | Version is not found. | | `InvalidVersion` | Version is not found. |
| `InvalidOptions` | Options are invalid. | | `InvalidOptions` | Options are invalid. |
| `InvalidQuery` | The query string is synctactically malformed. |
| `InvalidValue` | The successfully parsed query parameters are invalid. |
| `NoSegment` | One of the supplied input coordinates could not snap to street segment. | | `NoSegment` | One of the supplied input coordinates could not snap to street segment. |
| `TooBig` | The request size violates one of the service specific request size restrictions. | | `TooBig` | The request size violates one of the service specific request size restrictions. |
- `message` is a **optional** human-readable error message. All other status types are service dependent. `message` is a **optional** human-readable error message. All other status types are service dependent.
- In case of an error the HTTP status code will be `400`. Otherwise the HTTP status code will be `200` and `code` will be `Ok`.
#### Example response In case of an error the HTTP status code will be `400`. Otherwise the HTTP status code will be `200` and `code` will be `Ok`.
## Service `nearest`
Snaps a coordinate to the street network and returns the nearest n matches.
### Request
```json
{
"code": "Ok",
"message": "Everything worked"
}
``` ```
http://{server}/nearest/v1/{profile}/{coordinates}.json?number={number}
## Services
### Nearest service
Snaps a coordinate to the street network and returns the nearest `n` matches.
```endpoint
GET http://{server}/nearest/v1/{profile}/{coordinates}.json?number={number}
``` ```
Where `coordinates` only supports a single `{longitude},{latitude}` entry. Where `coordinates` only supports a single `{longitude},{latitude}` entry.
@@ -108,78 +132,42 @@ In addition to the [general options](#general-options) the following options are
|------------|------------------------------|----------------------------------------------------| |------------|------------------------------|----------------------------------------------------|
|number |`integer >= 1` (default `1`) |Number of nearest segments that should be returned. | |number |`integer >= 1` (default `1`) |Number of nearest segments that should be returned. |
**Response** ### Response
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes. - `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties: - `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
- `distance`: Distance in meters to the supplied input coordinate. - `distance`: Distance in meters to the supplied input coordinate.
#### Example Requests ### Examples
```curl Querying nearest three snapped locations of `13.388860,52.517037` with a bearing between `20° - 340°`.
# Querying nearest three snapped locations of `13.388860,52.517037` with a bearing between `20° - 340°`.
curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?number=3&bearings=0,20' ```
http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?number=3&bearings=0,20
``` ```
#### Example Response ## Service `route`
### Request
```json
{
"waypoints" : [
{
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
"distance" : 4.152629,
"name" : "Friedrichstraße",
"location" : [
13.388799,
52.517033
]
},
{
"hint" : "KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g",
"distance" : 11.811961,
"name" : "Friedrichstraße",
"location" : [
13.388782,
52.517132
]
},
{
"hint" : "KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g",
"distance" : 15.872438,
"name" : "Friedrichstraße",
"location" : [
13.388775,
52.51717
],
}
],
"code" : "Ok"
}
``` ```
http://{server}/route/v1/{profile}/{coordinates}?alternatives={true|false}&steps={true|false}&geometries={polyline|geojson}&overview={full|simplified|false}&annotations={true|false}
### Route service
Finds the fastest route between coordinates in the supplied order.
```endpoint
GET /route/v1/{profile}/{coordinates}?alternatives={true|false}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={full|simplified|false}&annotations={true|false}
``` ```
In addition to the [general options](#general-options) the following options are supported for this service: In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description | |Option |Values |Description |
|------------|---------------------------------------------|-------------------------------------------------------------------------------| |------------|------------------------------------------|-------------------------------------------------------------------------------|
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* | |alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|steps |`true`, `false` (default) |Return route steps for each route leg | |steps |`true`, `false` (default) |Return route steps for each route leg |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. | |annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) | |geometries |`polyline` (default), `geojson` |Returned route geometry format (influences overview and per step) |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.| |overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. | |continue_straight |`default` (default), `true`, `false`|Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile. |
\* Please note that even if an alternative route is requested, a result cannot be guaranteed. \* Please note that even if an alternative route is requested, a result cannot be guaranteed.
**Response** ### Response
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes. - `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints`: Array of `Waypoint` objects representing all waypoints in order: - `waypoints`: Array of `Waypoint` objects representing all waypoints in order:
@@ -191,24 +179,17 @@ In case of error the following `code`s are supported in addition to the general
|-------------------|-----------------| |-------------------|-----------------|
| `NoRoute` | No route found. | | `NoRoute` | No route found. |
All other properties might be undefined. All other fields might be undefined.
#### Example Request ## Service `table`
### Request
```curl ```
# Query on Berlin with three coordinates and no overview geometry returned: http://{server}/table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&destinations=[{elem}...]`
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
``` ```
### Table service This computes duration tables for the given locations. Allows for both symmetric and asymmetric tables.
Computes the duration of the fastest route between all pairs of supplied coordinates. ### Coordinates
```endpoint
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&destinations=[{elem}...]
```
**Coordinates**
In addition to the [general options](#general-options) the following options are supported for this service: In addition to the [general options](#general-options) the following options are supported for this service:
@@ -220,7 +201,7 @@ In addition to the [general options](#general-options) the following options are
Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal** Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
to number of input locations; to number of input locations;
**Example:** Example:
``` ```
sources=0;5;7&destinations=5;1;4;2;3;6 sources=0;5;7&destinations=5;1;4;2;3;6
@@ -230,20 +211,7 @@ sources=0;5;7&destinations=5;1;4;2;3;6
|------------|-----------------------------| |------------|-----------------------------|
|index |`0 <= integer < #locations` | |index |`0 <= integer < #locations` |
#### Example Request ### Response
```curl
# Returns a 3x3 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
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`:
curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHulFzeMe`EuvKpnCglA)?sources=0;1;3&destinations=2;4'
```
**Response**
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes. - `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from - `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
@@ -257,43 +225,57 @@ In case of error the following `code`s are supported in addition to the general
|-------------------|-----------------| |-------------------|-----------------|
| `NoTable` | No route found. | | `NoTable` | No route found. |
All other properties might be undefined. All other fields might be undefined.
### Match service #### Examples
Map matching matches/snaps given GPS points to the road network in the most plausible way. Returns a `3x3` matrix:
```
http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219
```
Returns a `1x3` matrix:
```
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`:
```
http://router.project-osrm.org/table/v1/driving/qikdcB}~dpXkkHz?sources=0;1;3&destinations=2;4
```
## Service `match`
Map matching matches given GPS points to the road network in the most plausible way.
Please note the request might result multiple sub-traces. Large jumps in the timestamps (>60s) or improbable transitions lead to trace splits if a complete matching could not be found. Please note the request might result multiple sub-traces. Large jumps in the timestamps (>60s) or improbable transitions lead to trace splits if a complete matching could not be found.
The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
```endpoint ### Request
GET /match/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}
```
http://{server}/match/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|geojson}&overview={simplified|full|false}&annotations={true|false}
``` ```
In addition to the [general options](#general-options) the following options are supported for this service: In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description | |Option |Values |Description |
|------------|------------------------------------------------|------------------------------------------------------------------------------------------| |------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|steps |`true`, `false` (default) |Return route steps for each route | |steps |`true`, `false` (default) |Return route steps for each route |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) | |geometries |`polyline` (default), `geojson` |Returned route geometry format (influences overview and per step) |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. | |annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.| |overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. | |timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamp of the input location. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.| |radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|Parameter |Values | |Parameter |Values |
|------------|-----------------------------------| |------------|------------------------------|
|timestamp |`integer` seconds since UNIX epoch | |timestamp |`integer` UNIX-like timestamp |
|radius |`double >= 0` (default 5m) | |radius |`double >= 0` (default 5m) |
The radius for each point should be the standard error of the location measured in meters from the true location. ### Response
Use `Location.getAccuracy()` on Android or `CLLocation.horizontalAccuracy` on iOS.
This value is used to determine which points should be considered as candidates (larger radius means more candidates) and how likely each candidate is (larger radius means far-away candidates are penalized less).
The area to search is chosen such that the correct candidate should be considered 99.9% of the time (for more details see [this ticket](https://github.com/Project-OSRM/osrm-backend/pull/3184)).
**Response**
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes. - `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `tracepoints`: Array of `Waypoint` objects representing all points of the trace in order. - `tracepoints`: Array of `aypoint` objects representing all points of the trace in order.
If the trace point was ommited by map matching because it is an outlier, the entry will be `null`. If the trace point was ommited by map matching because it is an outlier, the entry will be `null`.
Each `Waypoint` object has the following additional properties: Each `Waypoint` object has the following additional properties:
- `matchings_index`: Index to the `Route` object in `matchings` the sub-trace was matched to. - `matchings_index`: Index to the `Route` object in `matchings` the sub-trace was matched to.
@@ -307,66 +289,33 @@ In case of error the following `code`s are supported in addition to the general
|-------------------|---------------------| |-------------------|---------------------|
| `NoMatch` | No matchings found. | | `NoMatch` | No matchings found. |
All other properties might be undefined. All other fields might be undefined.
### Trip service ## Service `trip`
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints. The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
The returned path does not have to be the fastest path. As TSP is NP-hard it only returns an approximation. The returned path does not have to be the shortest path, as TSP is NP-hard it is only an approximation.
Note that all input coordinates have to be connected for the trip service to work. Note that if the input coordinates can not be joined by a single trip (e.g. the coordinates are on several disconnected islands)
multiple trips for each connected component are returned.
```endpoint ### Request
GET /trip/v1/{profile}/{coordinates}?roundtrip={true|false}&source{any|first}&destination{any|last}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
```
http://{server}/trip/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|geojson}&overview={simplified|full|false}&annotations={true|false}
``` ```
In addition to the [general options](#general-options) the following options are supported for this service: In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description | |Option |Values |Description |
|------------|------------------------------------------------|---------------------------------------------------------------------------| |------------|------------------------------------------------|---------------------------------------------------------------------------|
|roundtrip |`true` (default), `false` |Return route is a roundtrip |
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|steps |`true`, `false` (default) |Return route instructions for each trip | |steps |`true`, `false` (default) |Return route instructions for each trip |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. | |annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) | |geometries |`polyline` (default), `geojson` |Returned route geometry format (influences overview and per step) |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.| |overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
**Fixing Start and End Points** ### Response
It is possible to explicitely set the start or end coordinate of the trip. - `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
Right now, the following combinations are possible:
| roundtrip | source | destination | supported |
| :-- | :-- | :-- | :-- |
| true | first | last | **yes** |
| true | first | any | **yes** |
| true | any | last | **yes** |
| true | any | any | **yes** |
| false | first | last | **yes** |
| false | first | any | no |
| false | any | last | no |
| false | any | any | no |
#### Example Requests
```curl
# Round trip in Berlin with three stops:
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
```
```curl
# Round trip in Berlin with four stops, starting at the first stop, ending at the last:
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=last'
```
#### Response
- `code`: if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties: - `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
- `trips_index`: Index to `trips` of the sub-trip the point was matched to. - `trips_index`: Index to `trips` of the sub-trip the point was matched to.
- `waypoint_index`: Index of the point in the trip. - `waypoint_index`: Index of the point in the trip.
@@ -376,69 +325,21 @@ In case of error the following `code`s are supported in addition to the general
| Type | Description | | Type | Description |
|-------------------|---------------------| |-------------------|---------------------|
| `NoTrips` | No trips found because input coordinates are not connected.| | `NoTrips` | No trips found. |
| `NotImplemented` | This request is not supported |
All other properties might be undefined.
### Tile service
This service generates [Mapbox Vector Tiles](https://www.mapbox.com/developers/vector-tiles/) that can be viewed with a vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can be used to examine the routing graph. The tiles are generated directly from the data in-memory, so are in sync with actual routing results, and let you examine which roads are actually routable, and what weights they have applied.
```endpoint
GET /tile/v1/{profile}/tile({x},{y},{zoom}).mvt
```
The `x`, `y`, and `zoom` values are the same as described at 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/).
#### Example request
```curl
# This fetches a Z=13 tile for downtown San Francisco:
curl 'http://router.project-osrm.org/tile/v1/car/tile(1310,3166,13).mvt'
```
#### Example response
> ![example rendered tile](images/example-tile-response.png)
> http://map.project-osrm.org/debug/#14.33/52.5212/13.3919
The response object is either a binary encoded blob with a `Content-Type` of `application/x-protobuf`, or a `404` error. Note that OSRM is hard-coded to only return tiles from zoom level 12 and higher (to avoid accidentally returning extremely large vector tiles).
Vector tiles contain two layers:
`speeds` layer:
| Property | Type | Description |
| ------------ | --------- | ---------------------------------------- |
| `speed` | `integer` | the speed on that road segment, in km/h |
| `is_small` | `boolean` | whether this segment belongs to a small (< 1000 node) [strongly connected component](https://en.wikipedia.org/wiki/Strongly_connected_component) |
| `datasource` | `string` | the source for the speed value (normally `lua profile` unless you're using the [traffic update feature](https://github.com/Project-OSRM/osrm-backend/wiki/Traffic), in which case it contains the stem of the filename that supplied the speed value for this segment |
| `duration` | `float` | how long this segment takes to traverse, in seconds |
| `name` | `string` | the name of the road this segment belongs to |
`turns` layer:
| Property | Type | Description |
| ------------ | --------- | ---------------------------------------- |
| `bearing_in` | `integer` | the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East |
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
| `cost` | `float` | the time we think it takes to make that turn, in seconds. May be negative, depending on how the data model is constructed (some turns get a "bonus"). |
All other fields might be undefined.
## Result objects ## Result objects
### Route object ### Route
Represents a route through (potentially multiple) waypoints. Represents a route through (potentially multiple) waypoints.
**Properties** #### Properties
- `distance`: The distance traveled by the route, in `float` meters. - `distance`: The distance traveled by the route, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds. - `duration`: The estimated travel time, in `float` number of seconds.
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` property for a parameter documentation. - `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` field for a parameter documentation.
- `weight`: The calculated weight of the route.
- `weight_name`: The name of the weight profile used during extraction phase.
| overview | Description | | overview | Description |
|------------|-----------------------------| |------------|-----------------------------|
@@ -456,9 +357,7 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
{ {
"distance": 90.0, "distance": 90.0,
"duration": 300.0, "duration": 300.0,
"weight": 300.0, "geometry": {"type": "LineString", "coordinates": [[120., 10.], [120.1, 10.], [120.2, 10.], [120.3, 10.]]},
"weight_name": "duration",
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
"legs": [ "legs": [
{ {
"distance": 30.0, "distance": 30.0,
@@ -474,15 +373,14 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
} }
``` ```
### RouteLeg object ### RouteLeg
Represents a route between two waypoints. Represents a route between two waypoints.
**Properties** #### Properties
- `distance`: The distance traveled by this route leg, in `float` meters. - `distance`: The distance traveled by this route leg, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds. - `duration`: The estimated travel time, in `float` number of seconds.
- `weight`: The calculated weight of the route leg.
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter: - `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
| steps | | | steps | |
@@ -501,8 +399,8 @@ Represents a route between two waypoints.
| annotations | | | annotations | |
|--------------|-----------------------------------------------------------------------| |--------------|-----------------------------------------------------------------------|
| true | An `Annotation` object containing node ids, durations distances and | | true | returns distance and durations of each coordinate along the route |
| false | weights `undefined` | | false | will not exist |
#### Example #### Example
@@ -512,218 +410,142 @@ With `steps=false` and `annotations=true`:
{ {
"distance": 30.0, "distance": 30.0,
"duration": 100.0, "duration": 100.0,
"weight": 100.0, "steps": []
"steps": [],
"annotation": { "annotation": {
"distance": [5,5,10,5,5], "distance": [5,5,10,5,5],
"duration": [15,15,40,15,15], "duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1], "nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
} }
} }
``` ```
### Annotation object ### RouteStep
Annotation of the whole route leg with fine-grained information about each segment or node id.
**Properties**
- `distance`: The distance, in metres, between each pair of coordinates
- `duration`: The duration between each pair of coordinates, in seconds
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
- `weight`: The weights between each pair of coordinates
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
#### Example
```json
{
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"weight": [15,15,40,15,15]
}
```
### RouteStep object
A step consists of a maneuver such as a turn or merge, followed A step consists of a maneuver such as a turn or merge, followed
by a distance of travel along a single way to the subsequent by a distance of travel along a single way to the subsequent
step. step.
**Properties** #### Properties
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters. - `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds. - `duration`: The estimated travel time, in `float` number of seconds.
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter. - `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
- `weight`: The calculated weight of the step.
| `geometry` | | | geometries | |
|------------|--------------------------------------------------------------------| |------------|--------------------------------------------------------------------|
| polyline | [polyline](https://www.npmjs.com/package/polyline) with precision 5 in [latitude,longitude] encoding | | polyline | [polyline](https://www.npmjs.com/package/polyline) with precision 5 in [latitude,longitude] encoding |
| polyline6 | [polyline](https://www.npmjs.com/package/polyline) with precision 6 in [latitude,longitude] encoding | | geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) or [GeoJSON `Point`](http://geojson.org/geojson-spec.html#point) if it is only one coordinate (not wrapped by a GeoJSON feature)|
| geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) |
- `name`: The name of the way along which travel proceeds. - `name`: The name of the way along which travel proceeds.
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit. - `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations. - `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
- `mode`: A string signifying the mode of transportation. - `mode`: A string signifying the mode of transportation.
- `maneuver`: A `StepManeuver` object representing the maneuver. - `maneuver`: A `StepManeuver` object representing the maneuver.
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver - `intersections`: A list of `Intersections` that are passed along the segment, the very first belonging to the StepManeuver
- `rotary_name`: The name for the rotary. Optionally included, if the step is a rotary and a rotary name is available.
- `rotary_pronunciation`: The pronunciation hint of the rotary name. Optionally included, if the step is a rotary and a rotary pronunciation is available.
#### Example #### Example
```json ```
{ {
"distance":152.3,
"duration":15.6,
"name":"Lortzingstraße",
"maneuver":{
"type":"depart",
"modifier":"left"
},
"geometry":"{lu_IypwpAVrAvAdI", "geometry":"{lu_IypwpAVrAvAdI",
"mode":"driving", "mode":"driving",
"duration" : 15.6,
"weight" : 15.6,
"intersections":[ "intersections":[
{ "bearings" : [ 10, 92, 184, 270 ], {"location":[13.39677,52.54366],
"lanes" : [ "out":1,
{ "indications" : [ "left", "straight" ], "bearings":[66,246],
"valid" : "false" }, "entry":["true","true"]},
{ "valid" : "true", {"location":[13.394718,52.543096],
"indications" : [ "right" ] }
],
"out" : 2,
"in" : 3,
"entry" : [ "true", "true", "true", "false" ],
"location" : [ 13.39677, 52.54366 ]
},
{ "out" : 1,
"lanes" : [
{ "indications" : [ "straight" ],
"valid" : "true" },
{ "indications" : [ "right" ],
"valid" : "false" }
],
"bearings" : [ 60, 240, 330 ],
"in":0, "in":0,
"entry" : [ "false", "true", "true" ], "out":2,
"location" : [ 13.394718, 52.543096 ] "bearings":[60,150,240,330],
} "entry":["false","true","true","true"]
],
"name" : "Lortzingstraße",
"distance" : 152.3,
"maneuver" : {
"modifier" : "right",
"type" : "turn"
}
} }
]}
``` ```
### StepManeuver object ### StepManeuver
**Properties** #### Properties
- `location`: A `[longitude, latitude]` pair describing the location of the turn. - `location`: A `[longitude, latitude]` pair describing the location of the turn.
- `bearing_before`: The clockwise angle from true north to the - `bearing_before`: The clockwise angle from true north to the
direction of travel immediately before the maneuver. Range 0-359. direction of travel immediately before the maneuver.
- `bearing_after`: The clockwise angle from true north to the - `bearing_after`: The clockwise angle from true north to the
direction of travel immediately after the maneuver. Range 0-359. direction of travel immediately after the maneuver.
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change** - `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
Types unknown to the client should be handled like the `turn` type, the existence of correct `modifier` values is guranteed. Types unknown to the client should be handled like the `turn` type, the existance of correct `modifier` values is guranteed.
| `type` | Description | | `type` | Description |
|------------------|--------------------------------------------------------------| |-------------------|--------------------------------------------------------------|
| `turn` | a basic turn into direction of the `modifier` | | turn | a basic turn into direction of the `modifier` |
| `new name` | no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier`. | | new name | no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier`. |
| `depart` | indicates the departure of the leg | | depart | indicates the departure of the leg |
| `arrive` | indicates the destination of the leg | | arrive | indicates the destination of the leg |
| `merge` | merge onto a street (e.g. getting on the highway from a ramp, the `modifier specifies the direction of the merge`) | | merge | merge onto a street (e.g. getting on the highway from a ramp, the `modifier specifies the direction of the merge`) |
| `ramp` | **Deprecated**. Replaced by `on_ramp` and `off_ramp`. | | ramp | **Deprecated**. Replaced by `on_ramp` and `off_ramp`. |
| `on ramp` | take a ramp to enter a highway (direction given my `modifier`) | | on ramp | take a ramp to enter a highway (direction given my `modifier`) |
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) | | off ramp | take a ramp to exit a highway (direction given my `modifier`) |
| `fork` | take the left/right side at a fork depending on `modifier` | | fork | take the left/right side at a fork depending on `modifier` |
| `end of road` | road ends in a T intersection turn in direction of `modifier`| | end of road | road ends in a T intersection turn in direction of `modifier`|
| `use lane` | going straight on a specific lane | | continue | Turn in direction of `modifier` to stay on the same road |
| `continue` | Turn in direction of `modifier` to stay on the same road | | roundabout | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. | | rotary | a larger version of a roundabout, can offer `rotary_name` in addition to the `exit` parameter. |
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). | | roundabout turn | Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. | | notification | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change
between all instructions. They only offer a fallback in case nothing else is to report. between all instructions. They only offer a fallback in case nothing else is to report.
- `modifier` An optional `string` indicating the direction change of the maneuver. - `modifier` An optional `string` indicating the direction change of the maneuver.
| `modifier` | Description | | `modifier` | Description |
|-------------------|-------------------------------------------| |-------------------|-------------------------------------------|
| `uturn` | indicates reversal of direction | | uturn | indicates reversal of direction |
| `sharp right` | a sharp right turn | | sharp right | a sharp right turn |
| `right` | a normal turn to the right | | right | a normal turn to the right |
| `slight right` | a slight turn to the right | | slight right | a slight turn to the right |
| `straight` | no relevant change in direction | | straight | no relevant change in direction |
| `slight left` | a slight turn to the left | | slight left | a slight turn to the left |
| `left` | a normal turn to the left | | left | a normal turn to the left |
| `sharp left` | a sharp turn to the left | | sharp left | a sharp turn to the left |
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given. The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
The meaning depends on the `type` property. The meaning depends on the `type` field.
| `type` | Description | | `type` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------| |------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `turn` | `modifier` indicates the change in direction accomplished through the turn | | `turn` | `modifier` indicates the change in direction accomplished through the turn |
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel | | `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
- `exit` An optional `integer` indicating number of the exit to take. The property exists for the `roundabout` / `rotary` property:
Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. - `exit` An optional `integer` indicating number of the exit to take. The field exists for the following `type` field:
| `type` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `roundabout` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
New properties (potentially depending on `type`) may be introduced in the future without an API version change. New properties (potentially depending on `type`) may be introduced in the future without an API version change.
### Lane object ### Intersections
A `Lane` represents a turn lane at the corresponding turn location.
**Properties**
- `indications`: a indication (e.g. marking on the road) specifying the turn lane. A road can have multiple indications (e.g. an arrow pointing straight and left). The indications are given in an array, each containing one of the following types. Further indications might be added on without an API version change.
| `value` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `none` | No dedicated indication is shown. |
| `uturn` | An indication signaling the possibility to reverse (i.e. fully bend arrow). |
| `sharp right` | An indication indicating a sharp right turn (i.e. strongly bend arrow). |
| `right` | An indication indicating a right turn (i.e. bend arrow). |
| `slight right` | An indication indicating a slight right turn (i.e. slightly bend arrow). |
| `straight` | No dedicated indication is shown (i.e. straight arrow). |
| `slight left` | An indication indicating a slight left turn (i.e. slightly bend arrow). |
| `left` | An indication indicating a left turn (i.e. bend arrow). |
| `sharp left` | An indication indicating a sharp left turn (i.e. strongly bend arrow). |
- `valid`: a boolean flag indicating whether the lane is a valid choice in the current maneuver
#### Example
```json
{
"indications": ["left", "straight"],
"valid": "false"
}
```
### Intersection object
An intersection gives a full representation of any cross-way the path passes bay. For every step, the very first intersection (`intersections[0]`) corresponds to the An intersection gives a full representation of any cross-way the path passes bay. For every step, the very first intersection (`intersections[0]`) corresponds to the
location of the StepManeuver. Further intersections are listed for every cross-way until the next turn instruction. location of the StepManeuver. Further intersections are listed for every cross-way until the next turn instruction.
**Properties** #### Properties
- `location`: A `[longitude, latitude]` pair describing the location of the turn. - `location`: A `[longitude, latitude]` pair describing the location of the turn.
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north) - `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection.
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route. - `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
`false` indicates that the turn onto the respective road would violate a restriction. `false` indicates that the turn onto the respective road would violate a restriction.
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the - `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
@@ -731,29 +553,23 @@ location of the StepManeuver. Further intersections are listed for every cross-w
in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers. in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers.
- `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the - `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the
direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers. direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers.
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the intersection. If no lane information is available for an intersection, the `lanes` property will not be present.
#### Example #### Example
```
```json
{ {
"location":[13.394718,52.543096], "location":[13.394718,52.543096],
"in":0, "in":0,
"out":2, "out":2,
"bearings":[60,150,240,330], "bearings":[60,150,240,330],
"entry":["false","true","true","true"], "entry":["false","true","true","true"]
"lanes":{
"indications": ["left", "straight"],
"valid": "false"
}
} }
``` ```
### Waypoint object ### Waypoint
Object used to describe waypoint on a route. Object used to describe waypoint on a route.
**Properties** #### Properties
- `name` Name of the street the coordinate snapped to - `name` Name of the street the coordinate snapped to
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate - `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
@@ -761,16 +577,19 @@ Object used to describe waypoint on a route.
This can be used on subsequent request to significantly speed up the query and to connect multiple services. This can be used on subsequent request to significantly speed up the query and to connect multiple services.
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs. E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
#### Example ## Service `tile`
```json This generates [Mapbox Vector Tiles](https://www.mapbox.com/developers/vector-tiles/) that can be viewed with a vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can be used to examine the routing graph. The tiles are generated directly from the data in-memory, so are in sync with actual routing results, and let you examine which roads are actually routable, and what weights they have applied.
{
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g", ### Request
"distance" : 4.152629,
"name" : "Friedrichstraße",
"location" : [
13.388799,
52.517033
]
}
``` ```
http://{server}/tile/v1/{profile}/tile({x},{y},{zoom}).mvt
```
The `x`, `y`, and `zoom` values are the same as described at 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/).
### Response
The response object is either a binary encoded blob with a `Content-Type` of `application/x-protobuf`, or a `404` error. Note that OSRM is hard-coded to only return tiles from zoom level 12 and higher (to avoid accidentally returning extremely large vector tiles).
Vector tiles contain just a single layer named `speeds`. Within that layer, features can have `speed` (int) and `is_small` (boolean) attributes.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 KiB

+6 -13
View File
@@ -1,11 +1,7 @@
## Introduction
OSRM can be used as a library (libosrm) via C++ instead of using it through the HTTP interface and `osrm-routed`. This allows for fine-tuning OSRM and has much less overhead. Here is a quick introduction into how to use `libosrm` in the upcoming v5 release. OSRM can be used as a library (libosrm) via C++ instead of using it through the HTTP interface and `osrm-routed`. This allows for fine-tuning OSRM and has much less overhead. Here is a quick introduction into how to use `libosrm` in the upcoming v5 release.
Take a look at the example code that lives in the [example directory](https://github.com/Project-OSRM/osrm-backend/tree/master/example). Here is all you ever wanted to know about `libosrm`, that is a short description of what the types do and where to find documentation on it: Take a look at the example code that lives in the [example directory](https://github.com/Project-OSRM/osrm-backend/tree/master/example). Here is all you ever wanted to know about `libosrm`, that is a short description of what the types do and where to find documentation on it:
## Important interface objects
- [`EngineConfig`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/engine_config.hpp) - for initializing an OSRM instance we can configure certain properties and constraints. E.g. the storage config is the base path such as `france.osm.osrm` from which we derive and load `france.osm.osrm.*` auxiliary files. This also lets you set constraints such as the maximum number of locations allowed for specific services. - [`EngineConfig`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/engine_config.hpp) - for initializing an OSRM instance we can configure certain properties and constraints. E.g. the storage config is the base path such as `france.osm.osrm` from which we derive and load `france.osm.osrm.*` auxiliary files. This also lets you set constraints such as the maximum number of locations allowed for specific services.
- [`OSRM`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/osrm/osrm.hpp) - this is the main Routing Machine type with functions such as `Route` and `Table`. You initialize it with a `EngineConfig`. It does all the heavy lifting for you. Each function takes its own parameters, e.g. the `Route` function takes `RouteParameters`, and a out-reference to a JSON result that gets filled. The return value is a `Status`, indicating error or success. - [`OSRM`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/osrm/osrm.hpp) - this is the main Routing Machine type with functions such as `Route` and `Table`. You initialize it with a `EngineConfig`. It does all the heavy lifting for you. Each function takes its own parameters, e.g. the `Route` function takes `RouteParameters`, and a out-reference to a JSON result that gets filled. The return value is a `Status`, indicating error or success.
@@ -20,14 +16,11 @@ Take a look at the example code that lives in the [example directory](https://gi
- [Parameters for other services](https://github.com/Project-OSRM/osrm-backend/tree/master/include/engine/api) - here are all other `*Parameters` you need for other Routing Machine services. - [Parameters for other services](https://github.com/Project-OSRM/osrm-backend/tree/master/include/engine/api) - here are all other `*Parameters` you need for other Routing Machine services.
- [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [HTTP API](#http-api). - [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html) (Boost documentation is great). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [[v5 server API|Server-API-v5,-current]].
## Example ------------------------------------------------------------------------------------------------------------------
See [the example folder](https://github.com/Project-OSRM/osrm-backend/tree/master/example) in the OSRM repository. To summarize:
- create an `OSRM` instance initialized with a `EngineConfig`
## Workflow - call the service function on the `OSRM` object providing service specific `*Parameters`
- check the return code and use the JSON result
- Create an `OSRM` instance initialized with a `EngineConfig`
- Call the service function on the `OSRM` object providing service specific `*Parameters`
- Check the return code and use the JSON result
-13
View File
@@ -32,16 +32,3 @@ Given an OpenStreetMap way, the way_function will either return nothing (meaning
All other calculations stem from that, including the returned timings in driving directions, but also, less directly, it feeds into the actual routing decisions the engine will take (a way with a slow traversal speed, may be less favoured than a way with fast traversal speed, but it depends how long it is, and... what it connects to in the rest of the network graph) All other calculations stem from that, including the returned timings in driving directions, but also, less directly, it feeds into the actual routing decisions the engine will take (a way with a slow traversal speed, may be less favoured than a way with fast traversal speed, but it depends how long it is, and... what it connects to in the rest of the network graph)
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the way_function. Instead a way_function will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, 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 way_function. Instead a way_function will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, before arriving at the result.
## Guidance
The guidance parameters in profiles are currently a work in progress. They can and will change.
Please be aware of this when using guidance configuration possibilities.
### Road Classification
Guidance uses road classes to decide on when/if to emit specific instructions and to discover which road is obvious when following a route.
Classification uses three flags and a priority-category.
The flags indicate whether a road is a motorway (required for on/off ramps), a link type (the ramps itself, if also a motorway) and whether a road may be omittted in considerations (is considered purely for connectivity).
The priority-category influences the decision which road is considered the obvious choice and which roads can be seen as fork.
Forks can be emitted between roads of similar priority category only. Obvious choices follow a major priority road, if the priority difference is large.
+32 -34
View File
@@ -1,52 +1,50 @@
# Releasing a new OSRM version # Releasing a new OSRM version
We are using http://semver.org/ for versioning with major, minor and patch versions. Do decide if this is a major or minor version bump use: http://semver.org/
## Guarantees What we guarantee on major version changes:
We are giving the following guarantees between versions: - Breaking changes will be in the changelog
- If we break an HTTP API we bump the version
### Major version change What we guarantee on minor version changes:
- There are no guarantees about compatiblity of APIs or datasets - HTTP API does not include breaking changes
- Breaking changes will be noted as `BREAKING` in the changelog - C++ library API does not include breaking changes
- node-osrm API does not include breaking changes
### Minor version change What we DO NOT guarantee on minor version changes:
We may introduce forward-compatible changes: query parameters and response properties may be added in responses, but existing properties may not be changed or removed. One exception to this is the addition of new turn types, which we see as forward-compatible changes. - file format comp ability. Breakage will be listed in the changelog.
- new turn types and fields may be introduced. How to handle this see [the HTTP API docs](http.md).
- Forward-compatible HTTP API What we guarantee on patch version changes:
- Forward-compatible C++ library API
- Forward-compatible node-osrm API
- No compatiblity between OSRM datasets (needs new processing)
### Patch version change - HTTP API does not include breaking changes
- C++ library API does not include breaking changes
- node-osrm API does not include breaking changes
- full file format compatibility
- No change of query parameters or response formats ## Major or Minor release x.y
- Compatible HTTP API
- Compatible C++ library API
- Compatible node-osrm API
- Compatible OSRM datasets
## Release and branch management 1. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
2. Make sure `CHANGELOG.md` is up to date.
3. Make sure the OSRM version in `CMakeLists.txt` is up to date
4. Use an annotated tag to mark the release: `git tag vx.y.0 -a` Body of the tag description should be the changelog entries.
5. Push tags and commits: `git push; git push --tags`
6. Branch of the `vx.y.0` tag to create a release branch `x.y`:
`git branch x.y. vx.y.0; git push -u x.y:origin/x.y`
7. Modify `.travis.yml` to allow builds for the `x.y` branch.
8. Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
- The `master` branch is for the bleeding edge development ## Patch release x.y.z
- We create and maintain release branches `x.y` to control the release flow
- We create the release branch once we tagged the final version `x.y.0` version, RCs go on master
- No minor or major version will be released without a code-equal release candidates
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
- Patch versions may be released without a release candidate
- We may backport fixes to older versions and release them as patch versions
## Releasing a version 1. Check out the appropriate release branch x.y
2. Make sure all fixes are listed in the changelog and included in the branch
1. Check out the appropriate release branch `x.y` 3. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
2. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
3. Make sure `CHANGELOG.md` is up to date.
4. Make sure the OSRM version in `CMakeLists.txt` is up to date 4. Make sure the OSRM version in `CMakeLists.txt` is up to date
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries. 5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
6. Use `npm run build-api-docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
6. Push tags and commits: `git push; git push --tags` 6. Push tags and commits: `git push; git push --tags`
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md). 7. Proceede with the `node-osrm` release as outlined in the repository.
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release 8. Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
-14
View File
@@ -1,14 +0,0 @@
## Environment Variables
### SIGNAL_PARENT_WHEN_READY
If the SIGNAL_PARENT_WHEN_READY environment variable is set osrm-routed will
send the USR1 signal to its parent when it will be running and waiting for
requests. This could be used to upgrade osrm-routed to a new binary on the fly
without any service downtime - no incoming requests will be lost.
### DISABLE_ACCESS_LOGGING
If the DISABLE_ACCESS_LOGGING environment variable is set osrm-routed will
**not** log any http requests to standard output. This can be useful in high
traffic setup.
-16
View File
@@ -1,16 +0,0 @@
var fs = require('fs');
/**
* This file exports the content of your website, as a bunch of concatenated
* Markdown files. By doing this explicitly, you can control the order
* of content without any level of abstraction.
*
* Using the brfs module, fs.readFileSync calls in this file are translated
* into strings of those files' content before the file is delivered to a
* browser: the content is read ahead-of-time and included in bundle.js.
*/
module.exports =
'# HTTP API\n' +
fs.readFileSync('./content/http.md', 'utf8') + '\n'+
'# libosrm C++ API\n' +
fs.readFileSync('./content/libosrm.md', 'utf8') + '\n';
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=11' />
<title>OSRM API Documentation</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='css/base.css' rel='stylesheet' />
<link href='css/style.css' rel='stylesheet' />
<link href='css/railscasts.css' rel='stylesheet' />
</head>
<body>
<!--START--><div id='app'></div><!--STOP-->
<script src='bundle.js'></script>
</body>
</html>
-63
View File
@@ -1,63 +0,0 @@
'use strict';
/**
* Brand names, in order to decreasing length, for different
* media queries.
*/
module.exports.brandNames = {
desktop: 'OSRM API Documentation',
tablet: 'OSRM API Docs',
mobile: 'OSRM API'
};
/**
* Classes that define the top-left brand box.
*/
module.exports.brandClasses = 'fill-red';
/**
* Text for the link back to the linking website.
*/
module.exports.backLink = 'Back to project-osrm.org';
/**
* Runs after highlighting code samples. You can use this
* hook to, for instance, highlight a token and link it
* to some canonical part of documentation.
*/
module.exports.postHighlight = function(html) {
return html;
};
/**
* Highlight tokens in endpoint URLs, optionally linking to documentation
* or adding detail. This is the equivalent of postHighlight but it
* operates on endpoint URLs only.
*/
function highlightTokens(str) {
return str.replace(/{[\w_]+}/g,
(str) => '<span class="strong">' + str + '</span>');
}
/**
* Transform endpoints given as strings in a highlighted block like
*
* ```endpoint
* GET /foo/bar
* ```
*
* Into HTML nodes that format those endpoints in nice ways.
*/
module.exports.transformURL = function(value) {
let parts = value.split(/\s+/);
return {
type: 'html',
value: `<div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>${parts[0]}</div>
<div class='pad0 code small endpoint-url'>${highlightTokens(parts[1])}</div>
</div>`
};
};
module.exports.remarkPlugins = [];
+17 -190
View File
@@ -1,6 +1,6 @@
# Testsuite # Testsuite
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing. OSRM comes with a testsuite containing both unit-tests using the Boost library and cucucmber.js for scenario driven testing.
## Unit Tests ## Unit Tests
@@ -28,29 +28,6 @@ This dataset is a small extract and may not even contain all tags or edge cases.
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server. Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
See the library tests for how to add new dataset dependent tests. See the library tests for how to add new dataset dependent tests.
To prepare the test data simply `cd test/data/` and then run `make`.
### Running Tests
To build the unit tests:
```
cd build
cmake ..
make tests
```
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
```
./engine-tests
```
For `library-tests` you will need to provide a path to the test data:
```
./library-tests ../../test/data/monaco.osrm
```
## Cucumber ## Cucumber
@@ -78,9 +55,7 @@ Background:
Scenario: Testbot - Straight Road Scenario: Testbot - Straight Road
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -117,9 +92,7 @@ Background:
Scenario: Testbot - Straight Road Scenario: Testbot - Straight Road
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -144,10 +117,8 @@ Background:
Scenario: Testbot - Straight Road Scenario: Testbot - Straight Road
Given the node map Given the node map
""" | a | b |
a b | d | c |
d c
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -169,10 +140,8 @@ Background:
Scenario: Testbot - Straight Road Scenario: Testbot - Straight Road
Given the node map Given the node map
""" | a | b | e |
a b e | d | c | |
d c
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -196,10 +165,8 @@ Scenario: Enter and Exit mini roundabout with sharp angle # features/guidance/
Given the profile "car" # features/step_definitions/data.js:8 Given the profile "car" # features/step_definitions/data.js:8
Given a grid size of 10 meters # features/step_definitions/data.js:20 Given a grid size of 10 meters # features/step_definitions/data.js:20
Given the node map # features/step_definitions/data.js:45 Given the node map # features/step_definitions/data.js:45
""" | a | b | |
a b | | c | d |
c d
"""
And the ways # features/step_definitions/data.js:128 And the ways # features/step_definitions/data.js:128
| nodes | highway | name | | nodes | highway | name |
| ab | tertiary | MySt | | ab | tertiary | MySt |
@@ -228,11 +195,9 @@ OSRM converts the grid into a so called edge-based graph.
``` ```
Scenario: Testbot - Intersection Scenario: Testbot - Intersection
Given the node map Given the node map
""" | | e | |
e | b | a | d |
b a d | | c | |
c
"""
And the ways And the ways
| nodes | highway | oneway | | nodes | highway | oneway |
@@ -248,13 +213,11 @@ To guarantee discovery, use:
``` ```
Scenario: Testbot - Intersection Scenario: Testbot - Intersection
Given the node map Given the node map
""" | | | e | | |
e | | | 4 | | |
4 | b | 1 | a | 3 | d |
b 1 a 3 d | | | 2 | | |
2 | | | c | | |
c
"""
And the ways And the ways
| nodes | highway | oneway | | nodes | highway | oneway |
@@ -274,139 +237,3 @@ If you are testing for a duration metric, allow for a tiny offset to ensure a pa
#### Don't Rely on Alternatives #### Don't Rely on Alternatives
Alternative route discovery is a random feature in itself. The discovery of routes depends on the contraction order of roads and cannot be assumed successful, ever. Alternative route discovery is a random feature in itself. The discovery of routes depends on the contraction order of roads and cannot be assumed successful, ever.
### Understanding Turn Restrictions
Adding turn restrictions requires the restriction to follow a very specific format.
We specify them in a table with the header `| type | way:from | way:to | node:via | restriction |`.
It is important that turn restrictions require micro segmentation.
Consider the following scenario:
```
Given the node map:
"""
e
|
a - - b - - c
|
d
"""
And the ways
| nodes | oneway |
| abc | yes |
| ebd | yes |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | ebd | b | no_right_turn |
```
The setting looks perfectly fine at first glance. However, it is not well defined.
The forbidden right turn could be either a superfluous addition, forbidding the turn `cb` to `be`, or actually refer to the turn `ab` to `bd` to say that a turn is forbidden here.
To model turn-restrictions correctly and unique, we need to split segments that contribute to the restriction into the smallest possible parts.
E.g. the above scenario could correctly be expressed as:
```
Given the node map:
"""
e
|
a - - b - - c
|
d
"""
And the ways
| nodes | oneway | name |
| ab | yes | abc |
| bc | yes | abc |
| eb | yes | ebd |
| bd | yes | ebd |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | ab | bd | b | no_right_turn |
```
Unless this format is used, OSRM will omit the (then ambiguous) turn restrictions and ignore them.
## My Guidance Tests are Failing - Understanding what you can change
If you change some stuff in guidance, you will easily see tests change their result. E.g. if you change the angles for which we report `right`, then obviously some tests might not report a `direction modifier` named `right` anymore.
This small section will try to guide you in making the correct decisions for changing the behaviour of tests.
The difficulty in guidance tests is that not all items can be translated 1:1 from the ascii art into turn-angles.
The turn-angle calculation tries to find turn angles that would represent perceived turn angles, not the exact angle at the connection.
This is necessary, since connections in OSM are always bound by the paradigm that the way is supposed to be in the middle of the actual road.
For broad streets, you will see stronger angles than the actual turns.
### Don't change the test, change the expected behaviour
If we have a test that looks like this:
```
Given a grid size of 5 m
Given the node map
"""
a - b - - - - - - c
\
d - - - - - e
"""
When I route I should get
| waypoints | route | turns |
| a,e | abc,bde,bde | depart,turn slight right,arrive|
```
And the test reports `turn right` for the route `a->e`, where before it said `slight right`.
If you changed the turn angles, obviously you can expect changes in the distinction between `slight right` and `right`.
In such a case it is, of course, reasonable to change the expected route to report `right` instead of `slight right`. You should consider inspecting the actual turn angles at `b` to see if you feel that change is justified.
However, you should never adjust the test itself.
If you look at a failure, the other way around
```
Given a grid size of 5 m
Given the node map
"""
a - b - - - - - - c
\
d - - - - - e
"""
When I route I should get
| waypoints | route | turns |
| a,e | abc,bde,bde | depart,turn right,arrive|
```
where we see a `slight right`, over the expected `right`.
We could be tempted to adjust the grid size (e.g. from `10 m` to `20` meters).
Such a change would fundamentally alter the tests, though.
Since the part `b-d` is a short offset, when we are looking at a grid of size `5 m`, the angle calculation will try and compensate for this offset.
In this case we would see a very slight turn angle. If your change now reports different turn angles, you can of course change the expected result. But you should not adjust the grid size. The test would be testing turn angles of `180` and `100` degrees, instead of `180` and `160`.
### Consider Post-Processing Impacts
Some changes you might see could look completely unrelated. To understand the impact of your changes, you can make use of the debugging utilities you can finde in `util/debug.hpp` (and potentially other related headers).
If your test is inspecting a series of turns (remember, a turn not necessarily equals an instruction), you could see interaction with post-processing.
To see the unprocessed turns, you should print the steps at the end of step assembly (`assembleSteps` in `engine/guidance/assemble_steps.hpp`).
If you see unexpected changes, you can consider adding the `locations` field to your test to study what location a turn is reported at.
To study a test without post-processing impacts, you can create a copy of the case on a very large grid (like 2000 meters). In such a grid, `turn collapsing` would be essentially disable.
Sadly, there is no general guideline.
### Use Caution
If in doubt, ask another person. Inspect as much of the data as possible (e.g. print un-collapsed steps, turn angles and so on) and use your best judgement, if the new result seems justified.
+2 -2
View File
@@ -19,7 +19,7 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bitness 64) set(bitness 64)
message(STATUS "Building on a 64 bit system") message(STATUS "Building on a 64 bit system")
else() else()
message(STATUS "Building on a 32 bit system") message(WARNING "Building on a 32 bit system is unsupported")
endif() endif()
if(WIN32 AND MSVC_VERSION LESS 1900) if(WIN32 AND MSVC_VERSION LESS 1900)
@@ -33,4 +33,4 @@ find_package(LibOSRM REQUIRED)
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES}) target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS}) include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LibOSRM_CXXFLAGS}") set(CMAKE_CXX_FLAGS ${LibOSRM_CXXFLAGS})
+9 -5
View File
@@ -18,7 +18,7 @@
#include <cstdlib> #include <cstdlib>
int main(int argc, const char *argv[]) int main(int argc, const char *argv[]) try
{ {
if (argc < 2) if (argc < 2)
{ {
@@ -34,14 +34,14 @@ int main(int argc, const char *argv[])
config.use_shared_memory = false; config.use_shared_memory = false;
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match) // Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
const OSRM osrm{config}; OSRM osrm{config};
// The following shows how to use the Route service; configure this service // The following shows how to use the Route service; configure this service
RouteParameters params; RouteParameters params;
// Route in monaco // Route in monaco
params.coordinates.push_back({util::FloatLongitude{7.419758}, util::FloatLatitude{43.731142}}); params.coordinates.push_back({util::FloatLongitude(7.419758), util::FloatLatitude(43.731142)});
params.coordinates.push_back({util::FloatLongitude{7.419505}, util::FloatLatitude{43.736825}}); params.coordinates.push_back({util::FloatLongitude(7.419505), util::FloatLatitude(43.736825)});
// Response is in JSON format // Response is in JSON format
json::Object result; json::Object result;
@@ -67,7 +67,6 @@ int main(int argc, const char *argv[])
std::cout << "Distance: " << distance << " meter\n"; std::cout << "Distance: " << distance << " meter\n";
std::cout << "Duration: " << duration << " seconds\n"; std::cout << "Duration: " << duration << " seconds\n";
return EXIT_SUCCESS;
} }
else if (status == Status::Error) else if (status == Status::Error)
{ {
@@ -79,3 +78,8 @@ int main(int argc, const char *argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
catch (const std::exception &e)
{
std::cerr << "Error: " << e.what() << std::endl;
return EXIT_FAILURE;
}
-23
View File
@@ -174,26 +174,3 @@ Feature: Bike - Access tags on ways
| cycleway | | no | | x | | cycleway | | no | | x |
| runway | | | yes | | | runway | | | yes | |
| cycleway | | | no | x | | cycleway | | | no | x |
Scenario: Bike - Bridleways when access is explicit
Then routability should be
| highway | horse | foot | bicycle | bothw |
| bridleway | | | yes | x |
| bridleway | | yes | | x |
| bridleway | designated | | | |
| bridleway | | | | |
Scenario: Bike - Tram with oneway when access is implicit
Then routability should be
| highway | railway | access | oneway | bothw |
| residential | tram | | yes | x |
| service | tram | psv | yes | x |
Scenario: Bike - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | x |
| footway | permissive | x |
| garbagetag | permissive | x |
+11 -19
View File
@@ -7,11 +7,9 @@ Feature: Bike - Squares and other areas
@square @square
Scenario: Bike - Route along edge of a squares Scenario: Bike - Route along edge of a squares
Given the node map Given the node map
""" | x | |
x | a | b |
a b | d | c |
d c
"""
And the ways And the ways
| nodes | area | highway | | nodes | area | highway |
@@ -32,11 +30,9 @@ Feature: Bike - Squares and other areas
@building @building
Scenario: Bike - Don't route on buildings Scenario: Bike - Don't route on buildings
Given the node map Given the node map
""" | x | |
x | a | b |
a b | d | c |
d c
"""
And the ways And the ways
| nodes | highway | area | building | access | | nodes | highway | area | building | access |
@@ -57,11 +53,9 @@ Feature: Bike - Squares and other areas
@parking @parking
Scenario: Bike - parking areas Scenario: Bike - parking areas
Given the node map Given the node map
""" | e | | | f |
e f | x | a | b | y |
x a b y | | d | c | |
d c
"""
And the ways And the ways
| nodes | highway | amenity | | nodes | highway | amenity |
@@ -87,10 +81,8 @@ Feature: Bike - Squares and other areas
@train @platform @train @platform
Scenario: Bike - railway platforms Scenario: Bike - railway platforms
Given the node map Given the node map
""" | x | a | b | y |
x a b y | | d | c | |
d c
"""
And the ways And the ways
| nodes | highway | railway | | nodes | highway | railway |
+6 -10
View File
@@ -6,11 +6,9 @@ Feature: Bicycle - Handle cycling
Scenario: Bicycle - Use a ferry route Scenario: Bicycle - Use a ferry route
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | bridge | bicycle | | nodes | highway | bridge | bicycle |
@@ -31,11 +29,9 @@ Feature: Bicycle - Handle cycling
Scenario: Bicycle - Properly handle durations Scenario: Bicycle - Properly handle durations
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | bridge | duration | | nodes | highway | bridge | duration |
+11 -17
View File
@@ -6,12 +6,10 @@ Feature: Bike - Destination only, no passing through
Scenario: Bike - Destination only street Scenario: Bike - Destination only street
Given the node map Given the node map
""" | a | | | | e |
a e | | b | c | d | |
b c d | | | | | |
| x | | | | y |
x y
"""
And the ways And the ways
| nodes | access | | nodes | access |
@@ -33,12 +31,10 @@ Feature: Bike - Destination only, no passing through
Scenario: Bike - Destination only street Scenario: Bike - Destination only street
Given the node map Given the node map
""" | a | | | | e |
a e | | b | c | d | |
b c d | | | | | |
| x | | | | y |
x y
"""
And the ways And the ways
| nodes | access | | nodes | access |
@@ -61,11 +57,9 @@ Feature: Bike - Destination only, no passing through
Scenario: Bike - Routing inside a destination only area Scenario: Bike - Routing inside a destination only area
Given the node map Given the node map
""" | a | | c | | e |
a c e | | b | | d | |
b d | x | | | | y |
x y
"""
And the ways And the ways
| nodes | access | | nodes | access |
+11 -17
View File
@@ -6,11 +6,9 @@ Feature: Bike - Handle ferry routes
Scenario: Bike - Ferry route Scenario: Bike - Ferry route
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | route | bicycle | | nodes | highway | route | bicycle |
@@ -31,12 +29,10 @@ Feature: Bike - Handle ferry routes
Scenario: Bike - Ferry duration, single node Scenario: Bike - Ferry duration, single node
Given the node map Given the node map
""" | a | b | c | d |
a b c d | | | e | f |
e f | | | g | h |
g h | | | i | j |
i j
"""
And the ways And the ways
| nodes | highway | route | bicycle | duration | | nodes | highway | route | bicycle | duration |
@@ -52,10 +48,8 @@ Feature: Bike - Handle ferry routes
Scenario: Bike - Ferry duration, multiple nodes Scenario: Bike - Ferry duration, multiple nodes
Given the node map Given the node map
""" | x | | | | | y |
x y | | a | b | c | d | |
a b c d
"""
And the ways And the ways
| nodes | highway | route | bicycle | duration | | nodes | highway | route | bicycle | duration |
@@ -65,5 +59,5 @@ Feature: Bike - Handle ferry routes
When I route I should get When I route I should get
| from | to | route | time | | from | to | route | time |
| a | d | abcd,abcd | 3600s | | a | d | abcd,abcd | 3600s +-10 |
| d | a | abcd,abcd | 3600s | | d | a | abcd,abcd | 3600s +-10 |
+8 -10
View File
@@ -9,7 +9,7 @@ Feature: Bike - Max speed restrictions
Then routability should be Then routability should be
| highway | maxspeed | bothw | | highway | maxspeed | bothw |
| residential | | 15 km/h | | residential | | 15 km/h |
| residential | 10 | 9 km/h | | residential | 10 | 10 km/h |
Scenario: Bicycle - Ignore maxspeed when higher than way speed Scenario: Bicycle - Ignore maxspeed when higher than way speed
Then routability should be Then routability should be
@@ -40,9 +40,7 @@ Feature: Bike - Max speed restrictions
Scenario: Bike - Do not use maxspeed when higher that way type speed Scenario: Bike - Do not use maxspeed when higher that way type speed
Given the node map Given the node map
""" | a | b | c |
a b c
"""
And the ways And the ways
| nodes | highway | maxspeed | | nodes | highway | maxspeed |
@@ -65,12 +63,12 @@ Feature: Bike - Max speed restrictions
Then routability should be Then routability should be
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw | | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
| | | | 15 km/h | 15 km/h | | | | | 15 km/h | 15 km/h |
| 10 | | | 9 km/h | 9 km/h | | 10 | | | 10 km/h | 10 km/h |
| | 10 | | 9 km/h | 15 km/h | | | 10 | | 10 km/h | 15 km/h |
| | | 10 | 14 km/h | 9 km/h | | | | 10 | 15 km/h | 10 km/h |
| 2 | 10 | | 9 km/h | 2 km/h | | 2 | 10 | | 10 km/h | 2 km/h |
| 2 | | 10 | 2 km/h | 9 km/h | | 2 | | 10 | 2 km/h | 10 km/h |
| 2 | 5 | 10 | 5 km/h | 9 km/h | | 2 | 5 | 10 | 5 km/h | 10 km/h |
Scenario: Bike - Maxspeed should not allow routing on unroutable ways Scenario: Bike - Maxspeed should not allow routing on unroutable ways
Then routability should be Then routability should be
+16 -37
View File
@@ -6,10 +6,8 @@ Feature: Bike - Mode flag
Scenario: Bike - Mode when using a ferry Scenario: Bike - Mode when using a ferry
Given the node map Given the node map
""" | a | b | |
a b | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | route | duration | | nodes | highway | route | duration |
@@ -28,10 +26,8 @@ Feature: Bike - Mode flag
Scenario: Bike - Mode when using a train Scenario: Bike - Mode when using a train
Given the node map Given the node map
""" | a | b | |
a b | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | railway | bicycle | | nodes | highway | railway | bicycle |
@@ -50,19 +46,14 @@ Feature: Bike - Mode flag
Scenario: Bike - Mode when pushing bike against oneways Scenario: Bike - Mode when pushing bike against oneways
Given the node map Given the node map
""" | a | b | |
a b e | | c | d |
f c d
"""
And the ways And the ways
| nodes | highway | oneway | | nodes | highway | oneway |
| ab | primary | | | ab | primary | |
| bc | primary | yes | | bc | primary | yes |
| cd | primary | | | cd | primary | |
| be | primary | |
| cf | primary | |
When I route I should get When I route I should get
| from | to | route | modes | | from | to | route | modes |
@@ -75,10 +66,8 @@ Feature: Bike - Mode flag
Scenario: Bike - Mode when pushing on pedestrain streets Scenario: Bike - Mode when pushing on pedestrain streets
Given the node map Given the node map
""" | a | b | |
a b | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -97,10 +86,8 @@ Feature: Bike - Mode flag
Scenario: Bike - Mode when pushing on pedestrain areas Scenario: Bike - Mode when pushing on pedestrain areas
Given the node map Given the node map
""" | a | b | | |
a b | | c | d | f |
c d f
"""
And the ways And the ways
| nodes | highway | area | | nodes | highway | area |
@@ -119,10 +106,8 @@ Feature: Bike - Mode flag
Scenario: Bike - Mode when pushing on steps Scenario: Bike - Mode when pushing on steps
Given the node map Given the node map
""" | a | b | | |
a b | | c | d | f |
c d f
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -141,10 +126,8 @@ Feature: Bike - Mode flag
Scenario: Bike - Mode when bicycle=dismount Scenario: Bike - Mode when bicycle=dismount
Given the node map Given the node map
""" | a | b | | |
a b | | c | d | f |
c d f
"""
And the ways And the ways
| nodes | highway | bicycle | | nodes | highway | bicycle |
@@ -163,9 +146,7 @@ Feature: Bike - Mode flag
Scenario: Bicycle - Modes when starting on forward oneway Scenario: Bicycle - Modes when starting on forward oneway
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -178,9 +159,7 @@ Feature: Bike - Mode flag
Scenario: Bicycle - Modes when starting on reverse oneway Scenario: Bicycle - Modes when starting on reverse oneway
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
+7 -11
View File
@@ -6,10 +6,8 @@ Feature: Bike - Street names in instructions
Scenario: Bike - A named street Scenario: Bike - A named street
Given the node map Given the node map
""" | a | b |
a b | | c |
c
"""
And the ways And the ways
| nodes | name | ref | | nodes | name | ref |
@@ -17,15 +15,13 @@ Feature: Bike - Street names in instructions
| bc | Your Way | A7 | | bc | Your Way | A7 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route |
| a | c | My Way,Your Way,Your Way | A6,A7,A7 | | a | c | My Way (A6),Your Way (A7),Your Way (A7) |
@unnamed @unnamed
Scenario: Bike - No longer use way type to describe unnamed ways, see #3231 Scenario: Bike - Use way type to describe unnamed ways
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -34,4 +30,4 @@ Feature: Bike - Street names in instructions
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | d | , | | a | d | {highway:cycleway},{highway:track},{highway:track} |
+3 -9
View File
@@ -18,10 +18,8 @@ Feature: Bike - Oneway streets
Scenario: Bike - Around the Block Scenario: Bike - Around the Block
Given the node map Given the node map
""" | a | b |
a b | d | c |
f d c e
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -29,8 +27,6 @@ Feature: Bike - Oneway streets
| bc | | no | | bc | | no |
| cd | | no | | cd | | no |
| da | | no | | da | | no |
| df | | no |
| ce | | no |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
@@ -119,9 +115,7 @@ Feature: Bike - Oneway streets
Scenario: Bike - Two consecutive oneways Scenario: Bike - Two consecutive oneways
Given the node map Given the node map
""" | a | b | | c |
a b c
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
+7 -16
View File
@@ -35,11 +35,9 @@ Feature: Bike - Accessability of different way types
@square @square
Scenario: Bike - Push bikes on pedestrian areas Scenario: Bike - Push bikes on pedestrian areas
Given the node map Given the node map
""" | x | |
x | a | b |
a b | d | c |
d c
"""
And the ways And the ways
| nodes | area | highway | | nodes | area | highway |
@@ -65,7 +63,6 @@ Feature: Bike - Accessability of different way types
| runway | | | | | runway | | | |
| runway | yes | foot | foot | | runway | yes | foot | foot |
@todo
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
Then routability should be Then routability should be
| highway | foot:forward | foot:backward | forw | backw | | highway | foot:forward | foot:backward | forw | backw |
@@ -90,18 +87,14 @@ Feature: Bike - Accessability of different way types
Scenario: Bike - Instructions when pushing bike on oneways Scenario: Bike - Instructions when pushing bike on oneways
Given the node map Given the node map
""" | a | b | |
a b e | | c | d |
f c d
"""
And the ways And the ways
| nodes | highway | oneway | | nodes | highway | oneway |
| ab | primary | | | ab | primary | |
| bc | primary | yes | | bc | primary | yes |
| cd | primary | | | cd | primary | |
| be | primary | |
| cf | primary | |
When I route I should get When I route I should get
| from | to | route | modes | | from | to | route | modes |
@@ -112,10 +105,8 @@ Feature: Bike - Accessability of different way types
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc. Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
Given the node map Given the node map
""" | a | b | |
a b | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
+7 -13
View File
@@ -6,37 +6,31 @@ Feature: Bike - Way ref
Scenario: Bike - Way with both name and ref Scenario: Bike - Way with both name and ref
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | name | ref | | nodes | name | ref |
| ab | Utopia Drive | E7 | | ab | Utopia Drive | E7 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route |
| a | b | Utopia Drive,Utopia Drive | E7,E7 | | a | b | Utopia Drive (E7),Utopia Drive (E7) |
Scenario: Bike - Way with only ref Scenario: Bike - Way with only ref
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | name | ref | | nodes | name | ref |
| ab | | E7 | | ab | | E7 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route |
| a | b | , | E7,E7 | | a | b | E7,E7 |
Scenario: Bike - Way with only name Scenario: Bike - Way with only name
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | name | | nodes | name |
+36 -58
View File
@@ -9,11 +9,9 @@ Feature: Bike - Turn restrictions
@no_turning @no_turning
Scenario: Bike - No left turn Scenario: Bike - No left turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -35,11 +33,9 @@ Feature: Bike - Turn restrictions
@no_turning @no_turning
Scenario: Bike - No right turn Scenario: Bike - No right turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -61,11 +57,9 @@ Feature: Bike - Turn restrictions
@no_turning @no_turning
Scenario: Bike - No u-turn Scenario: Bike - No u-turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -87,11 +81,9 @@ Feature: Bike - Turn restrictions
@no_turning @no_turning
Scenario: Bike - Handle any no_* relation Scenario: Bike - Handle any no_* relation
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -113,11 +105,9 @@ Feature: Bike - Turn restrictions
@only_turning @only_turning
Scenario: Bike - Only left turn Scenario: Bike - Only left turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -139,11 +129,9 @@ Feature: Bike - Turn restrictions
@only_turning @only_turning
Scenario: Bike - Only right turn Scenario: Bike - Only right turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -165,11 +153,9 @@ Feature: Bike - Turn restrictions
@only_turning @only_turning
Scenario: Bike - Only straight on Scenario: Bike - Only straight on
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -191,11 +177,9 @@ Feature: Bike - Turn restrictions
@no_turning @no_turning
Scenario: Bike - Handle any only_* restriction Scenario: Bike - Handle any only_* restriction
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -217,11 +201,9 @@ Feature: Bike - Turn restrictions
@except @except
Scenario: Bike - Except tag and on no_ restrictions Scenario: Bike - Except tag and on no_ restrictions
Given the node map Given the node map
""" | b | x | c |
b x c | a | j | d |
a j d | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -249,11 +231,9 @@ Feature: Bike - Turn restrictions
@except @except
Scenario: Bike - Except tag and on only_ restrictions Scenario: Bike - Except tag and on only_ restrictions
Given the node map Given the node map
""" | a | | b |
a b | | j | |
j | | s | |
s
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
@@ -273,14 +253,12 @@ Feature: Bike - Turn restrictions
@except @except
Scenario: Bike - Multiple except tag values Scenario: Bike - Multiple except tag values
Given the node map Given the node map
""" | s | j | a |
s j a | | | b |
b | | | c |
c | | | d |
d | | | e |
e | | | f |
f
"""
And the ways And the ways
| nodes | oneway | foot | | nodes | oneway | foot |
+2 -4
View File
@@ -14,10 +14,8 @@ Feature: Bike - Stop areas for public transport
Scenario: Bike - railway platforms Scenario: Bike - railway platforms
Given the node map Given the node map
""" | a | b | c | d |
a b c d | | s | t | |
s t
"""
And the nodes And the nodes
| node | public_transport | | node | public_transport |
+5 -24
View File
@@ -13,15 +13,15 @@ Feature: Bike - Surfaces
| cycleway | paving_stones | 72s | | cycleway | paving_stones | 72s |
| cycleway | compacted | 72s | | cycleway | compacted | 72s |
| cycleway | cobblestone | 120s | | cycleway | cobblestone | 120s |
| cycleway | unpaved | 120s |
| cycleway | fine_gravel | 120s | | cycleway | fine_gravel | 120s |
| cycleway | gravel | 120s | | cycleway | gravel | 120s |
| cycleway | pebblestone | 120.1 s | | cycleway | pebblestone | 120s |
| cycleway | dirt | 120s | | cycleway | dirt | 120s |
| cycleway | earth | 120s | | cycleway | earth | 120s |
| cycleway | grass | 120s | | cycleway | grass | 120s |
| cycleway | mud | 240s | | cycleway | mud | 240s |
| cycleway | sand | 240.1 s | | cycleway | sand | 240s |
| cycleway | sett | 72 s |
Scenario: Bicycle - Good surfaces on small paths Scenario: Bicycle - Good surfaces on small paths
Then routability should be Then routability should be
@@ -29,8 +29,8 @@ Feature: Bike - Surfaces
| cycleway | | 48s | | cycleway | | 48s |
| path | | 60s | | path | | 60s |
| track | | 60s | | track | | 60s |
| track | asphalt | 60 s | | track | asphalt | 48s |
| path | asphalt | 60 s | | path | asphalt | 48s |
Scenario: Bicycle - Surfaces should not make unknown ways routable Scenario: Bicycle - Surfaces should not make unknown ways routable
Then routability should be Then routability should be
@@ -38,22 +38,3 @@ Feature: Bike - Surfaces
| cycleway | | 48s | | cycleway | | 48s |
| nosense | | | | nosense | | |
| nosense | asphalt | | | nosense | asphalt | |
Scenario: Bicycle - Surfaces should not increase speed when pushing bikes
Given the node map
"""
a b
c d
"""
And the ways
| nodes | highway | oneway | surface |
| ab | primary | yes | asphalt |
| cd | footway | | asphalt |
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 |
+3 -5
View File
@@ -7,11 +7,9 @@ Feature: Turn Penalties
Scenario: Bike - turns should incur a delay that depend on the angle Scenario: Bike - turns should incur a delay that depend on the angle
Given the node map Given the node map
""" | c | d | e |
c d e | b | j | f |
b j f | a | s | g |
a s g
"""
And the ways And the ways
| nodes | | nodes |
+13 -168
View File
@@ -30,35 +30,6 @@ Feature: Car - Restricted access
| | | no | yes | x | | | | no | yes | x |
| | | yes | no | | | | | yes | no | |
Scenario: Car - Access tag hierarchy and forward/backward
Then routability should be
| access | access:forward | access:backward | motorcar | motorcar:forward | motorcar:backward | forw | backw |
| | | | | | | x | x |
| yes | | | | | | x | x |
| yes | no | | | | | | x |
| yes | yes | | no | | | | |
| yes | yes | | yes | no | | | x |
| yes | | | | | | x | x |
| yes | | no | | | | x | |
| yes | | yes | no | | | | |
| yes | | yes | yes | | no | x | |
| no | | | | | | | |
| no | yes | | | | | x | |
| no | no | | yes | | | x | x |
| no | no | | no | yes | | x | |
| no | | | | | | | |
| no | | yes | | | | | x |
| no | | no | yes | | | x | x |
| no | | no | no | | yes | | x |
| | no | | | no | | | x |
| | | no | | | no | x | |
| | no | | | | no | | |
| | | no | no | | | | |
| | no | | | yes | | x | x |
| | | no | | | yes | x | x |
| | yes | | | no | | | x |
| | | yes | | | no | x | |
Scenario: Car - Access tag hierarchy on nodes Scenario: Car - Access tag hierarchy on nodes
Then routability should be Then routability should be
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw | | node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
@@ -119,13 +90,12 @@ Feature: Car - Restricted access
| permissive | x | | permissive | x |
| designated | x | | designated | x |
| no | | | no | |
| private | x | | private | |
| agricultural | | | agricultural | |
| forestry | | | forestry | |
| psv | | | psv | |
| delivery | x | | delivery | |
| some_tag | x | | some_tag | x |
| destination | x |
Scenario: Car - Access tags on nodes Scenario: Car - Access tags on nodes
@@ -135,11 +105,11 @@ Feature: Car - Restricted access
| permissive | x | | permissive | x |
| designated | x | | designated | x |
| no | | | no | |
| private | x | | private | |
| agricultural | | | agricultural | |
| forestry | | | forestry | |
| psv | | | psv | |
| delivery | x | | delivery | |
| some_tag | x | | some_tag | x |
Scenario: Car - Access tags on both node and way Scenario: Car - Access tags on both node and way
@@ -157,15 +127,15 @@ Feature: Car - Restricted access
Scenario: Car - Access combinations Scenario: Car - Access combinations
Then routability should be Then routability should be
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # | | highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
| runway | private | | | permissive | x | x | | | runway | private | | | permissive | x |
| primary | forestry | | yes | | x | x | | | primary | forestry | | yes | | x |
| cycleway | | | designated | | x | x | | | cycleway | | | designated | | x |
| residential | | yes | no | | | | | | residential | | yes | no | | |
| motorway | yes | permissive | | private | x | | implied oneway | | motorway | yes | permissive | | private | |
| trunk | agricultural | designated | permissive | no | | | | | trunk | agricultural | designated | permissive | no | |
| pedestrian | | | | | | | | | pedestrian | | | | | |
| pedestrian | | | | destination | | | temporary disabled #3773 | | pedestrian | | | | destination | x |
Scenario: Car - Ignore access tags for other modes Scenario: Car - Ignore access tags for other modes
Then routability should be Then routability should be
@@ -178,128 +148,3 @@ Feature: Car - Restricted access
| primary | | | no | | x | | primary | | | no | | x |
| runway | | | | yes | | | runway | | | | yes | |
| primary | | | | no | x | | primary | | | | no | x |
@hov
Scenario: Car - designated HOV ways are rated low
Then routability should be
| highway | hov | bothw | forw_rate | backw_rate |
| primary | designated | x | 18 | 18 |
| primary | yes | x | 18 | 18 |
| primary | no | x | 18 | 18 |
# Models:
# https://www.openstreetmap.org/way/124891268
# https://www.openstreetmap.org/way/237173472
@hov
Scenario: Car - I-66 use HOV-only roads with heavy penalty
Then routability should be
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
| motorway | lane | | 3 | designated | yes | x | | 25 |
@hov
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
Then routability should be
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
| primary | designated | designated | | | x | x | 18 | 18 |
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
#| primary | | designated | | | x | x | 18 | 18 |
#| primary | designated | | | | x | x | 18 | 18 |
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
| primary | | | | | x | x | 18 | 18 |
| primary | designated | | | -1 | | x | | 18 |
| primary | | designated | | -1 | | x | | 18 |
| primary | | | designated | yes | x | | 18 | |
| primary | | | designated | -1 | | x | | 18 |
| primary | | | designated\| | yes | x | | 18 | |
| primary | | | designated\| | -1 | | x | | 18 |
| primary | | | designated\|designated | yes | x | | 18 | |
| primary | | | designated\|designated | -1 | | x | | 18 |
| primary | | | designated\|yes | yes | x | | 18 | |
| primary | | | designated\|no | -1 | | x | | 18 |
Scenario: Car - these toll roads always work
Then routability should be
| highway | toll | bothw |
| primary | no | x |
| primary | snowmobile | x |
Scenario: Car - toll=yes ways are enabled by default
Then routability should be
| highway | toll | bothw |
| primary | yes | x |
Scenario: Car - directional access tags
Then routability should be
| highway | access | access:forward | access:backward | forw | backw |
| primary | yes | yes | yes | x | x |
| primary | yes | | no | x | |
| primary | yes | no | | | x |
| primary | yes | no | no | | |
| primary | no | no | no | | |
| primary | no | | yes | | x |
| primary | no | yes | | x | |
| primary | no | yes | yes | x | x |
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
Then routability should be
| node/barrier | access | bothw |
| gate | | x |
| gate | no | |
| gate | yes | x |
| gate | permissive | x |
| gate | designated | x |
| gate | private | x |
| gate | garbagetag | x |
Scenario: Car - a way with conditional access
Then routability should be
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
Scenario: Car - a way with a list of tags
Then routability should be
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw | # |
| primary | | no | destination | | x | |
| primary | destination;agricultural | destination | | x | x | |
| footway | | | destination | | | temporary #3373 |
| track | destination;agricultural | destination | | | x | temporary #3373 |
Scenario: Car - Don't route over steps even if marked as accessible
Then routability should be
| highway | access | forw | backw |
| steps | yes | | |
| steps | no | | |
| primary | | x | x |
Scenario: Car - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | |
| footway | permissive | x |
| garbagetag | permissive | x |
Scenario: Car - Access private blacklist
Then routability should be
| highway | access | bothw |
| footway | yes | x |
| pedestrian | private | |
| footway | private | |
| service | private | |
| cycleway | private | |
| track | private | |
Scenario: Car - Access blacklist
Then routability should be
| highway | access | bothw |
| primary | | x |
| primary | customer | |
| primary | emergency | |
| primary | forestry | |
| primary | agricultural | |
| primary | psv | |
| primary | no | |
+17 -27
View File
@@ -8,9 +8,7 @@ OSRM will use 4/5 of the projected free-flow speed.
Scenario: Car - Advisory speed overwrites maxspeed Scenario: Car - Advisory speed overwrites maxspeed
Given the node map Given the node map
""" | a | b | c |
a b c
"""
And the ways And the ways
| nodes | highway | maxspeed | maxspeed:advisory | | nodes | highway | maxspeed | maxspeed:advisory |
@@ -19,14 +17,12 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get When I route I should get
| from | to | route | speed | | from | to | route | speed |
| a | b | ab,ab | 36 km/h +- 1 | | a | b | ab,ab | 47 km/h +- 1 |
| b | c | bc,bc | 36 km/h +- 1 | | b | c | bc,bc | 47 km/h +- 1 |
Scenario: Car - Advisory speed overwrites forward maxspeed Scenario: Car - Advisory speed overwrites forward maxspeed
Given the node map Given the node map
""" | a | b | c |
a b c
"""
And the ways And the ways
| nodes | highway | maxspeed:forward | maxspeed:advisory:forward | | nodes | highway | maxspeed:forward | maxspeed:advisory:forward |
@@ -35,14 +31,12 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get When I route I should get
| from | to | route | speed | | from | to | route | speed |
| a | b | ab,ab | 36 km/h +- 1 | | a | b | ab,ab | 47 km/h +- 1 |
| b | c | bc,bc | 36 km/h +- 1 | | b | c | bc,bc | 47 km/h +- 1 |
Scenario: Car - Advisory speed overwrites backwards maxspeed Scenario: Car - Advisory speed overwrites backwards maxspeed
Given the node map Given the node map
""" | a | b | c |
a b c
"""
And the ways And the ways
| nodes | highway | maxspeed:backward | maxspeed:advisory:backward | | nodes | highway | maxspeed:backward | maxspeed:advisory:backward |
@@ -51,14 +45,12 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get When I route I should get
| from | to | route | speed | | from | to | route | speed |
| b | a | ab,ab | 36 km/h +- 1 | | b | a | ab,ab | 47 km/h +- 1 |
| c | b | bc,bc | 36 km/h +- 1 | | c | b | bc,bc | 47 km/h +- 1 |
Scenario: Car - Advisory speed overwrites backwards maxspeed Scenario: Car - Advisory speed overwrites backwards maxspeed
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | maxspeed:backward | maxspeed:advisory:backward | | nodes | highway | maxspeed:backward | maxspeed:advisory:backward |
@@ -68,14 +60,12 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get When I route I should get
| from | to | route | speed | | from | to | route | speed |
| c | b | bc,bc | 36 km/h +- 1 | | c | b | bc,bc | 47 km/h +- 1 |
| d | c | cd,cd | 36 km/h +- 1 | | d | c | cd,cd | 47 km/h +- 1 |
Scenario: Car - Directional advisory speeds play nice with eachother Scenario: Car - Directional advisory speeds play nice with eachother
Given the node map Given the node map
""" | a | b | c |
a b c
"""
And the ways And the ways
| nodes | highway | maxspeed:advisory | maxspeed:advisory:forward | maxspeed:advisory:backward | | nodes | highway | maxspeed:advisory | maxspeed:advisory:forward | maxspeed:advisory:backward |
@@ -84,9 +74,9 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get When I route I should get
| from | to | route | speed | | from | to | route | speed |
| a | b | ab,ab | 36 km/h +- 1 | | a | b | ab,ab | 47 km/h +- 1 |
| b | a | ab,ab | 48 km/h +- 1 | | b | a | ab,ab | 59 km/h +- 1 |
| b | c | bc,bc | 48 km/h +- 1 | | b | c | bc,bc | 59 km/h +- 1 |
| c | b | bc,bc | 36 km/h +- 1 | | c | b | bc,bc | 47 km/h +- 1 |
+2 -2
View File
@@ -29,14 +29,14 @@ Feature: Car - Barriers
| gate | permissive | x | | gate | permissive | x |
| gate | designated | x | | gate | designated | x |
| gate | no | | | gate | no | |
| gate | private | x | | gate | private | |
| gate | agricultural | | | gate | agricultural | |
| wall | | | | wall | | |
| wall | yes | x | | wall | yes | x |
| wall | permissive | x | | wall | permissive | x |
| wall | designated | x | | wall | designated | x |
| wall | no | | | wall | no | |
| wall | private | x | | wall | private | |
| wall | agricultural | | | wall | agricultural | |
Scenario: Car - Rising bollard exception for barriers Scenario: Car - Rising bollard exception for barriers
+6 -31
View File
@@ -6,11 +6,9 @@ Feature: Car - Handle driving
Scenario: Car - Use a ferry route Scenario: Car - Use a ferry route
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | bridge | bicycle | | nodes | highway | bridge | bicycle |
@@ -29,34 +27,11 @@ Feature: Car - Handle driving
| c | f | cde,efg,efg | driving,driving,driving | | c | f | cde,efg,efg | driving,driving,driving |
| c | g | cde,efg,efg | driving,driving,driving | | c | g | cde,efg,efg | driving,driving,driving |
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
Given the node map
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | bridge |
| abc | primary | |
| cde | | movable |
| efg | primary | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
| c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
| e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
Scenario: Car - Properly handle durations Scenario: Car - Properly handle durations
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | bridge | duration | | nodes | highway | bridge | duration |
+12 -68
View File
@@ -1,4 +1,4 @@
@routing @car @destination @routing @car @destination @todo
Feature: Car - Destination only, no passing through Feature: Car - Destination only, no passing through
Background: Background:
@@ -6,12 +6,10 @@ Feature: Car - Destination only, no passing through
Scenario: Car - Destination only street Scenario: Car - Destination only street
Given the node map Given the node map
""" | a | | | | e |
a e | | b | c | d | |
b c d | | | | | |
| x | | | | y |
x y
"""
And the ways And the ways
| nodes | access | | nodes | access |
@@ -33,12 +31,10 @@ Feature: Car - Destination only, no passing through
Scenario: Car - Destination only street Scenario: Car - Destination only street
Given the node map Given the node map
""" | a | | | | e |
a e | | b | c | d | |
b c d | | | | | |
| x | | | | y |
x y
"""
And the ways And the ways
| nodes | access | | nodes | access |
@@ -61,11 +57,9 @@ Feature: Car - Destination only, no passing through
Scenario: Car - Routing inside a destination only area Scenario: Car - Routing inside a destination only area
Given the node map Given the node map
""" | a | | c | | e |
a c e | | b | | d | |
b d | x | | | | y |
x y
"""
And the ways And the ways
| nodes | access | | nodes | access |
@@ -81,53 +75,3 @@ Feature: Car - Destination only, no passing through
| e | a | de,cd,bc,ab,ab | | e | a | de,cd,bc,ab,ab |
| b | d | bc,cd,cd | | b | d | bc,cd,cd |
| d | b | cd,bc,bc | | d | b | cd,bc,bc |
Scenario: Car - Routing around a way that becomes destination only
Given the node map
"""
b
\
|
e++d++++++c--i
| \
\ h--a
\ |
\___________g
"""
And the ways
| nodes | access | oneway |
| ah | | no |
| ihg | | no |
| eg | | no |
| icde | | no |
| cde | destination | no |
| eb | | no |
When I route I should get
| from | to | route | # |
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
| b | d | eb,cde,cde | # ends in restricted way correctly |
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
Scenario: Car - Routing around a way that becomes destination only
Given the node map
"""
a---c---b
+ \
+ |
d |
\___e
"""
And the ways
| nodes | access | oneway |
| acbe | | no |
| cd | destination | no |
| de | | no |
When I route I should get
| from | to | route |
| e | a | acbe,acbe |
| d | a | de,acbe,acbe |
| c | d | cd,cd |
+19 -46
View File
@@ -6,11 +6,9 @@ Feature: Car - Handle ferry routes
Scenario: Car - Use a ferry route Scenario: Car - Use a ferry route
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | route | bicycle | | nodes | highway | route | bicycle |
@@ -29,34 +27,11 @@ Feature: Car - Handle ferry routes
| c | f | cde,efg,efg | ferry,driving,driving | | c | f | cde,efg,efg | ferry,driving,driving |
| c | g | cde,efg,efg | ferry,driving,driving | | c | g | cde,efg,efg | ferry,driving,driving |
Scenario: Car - Use default speeds to calculate duration if no duration given
Given the node map
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route |
| abc | primary | |
| cde | | ferry |
| efg | primary | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.4s |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
Scenario: Car - Properly handle simple durations Scenario: Car - Properly handle simple durations
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | route | duration | | nodes | highway | route | duration |
@@ -65,19 +40,17 @@ Feature: Car - Handle ferry routes
| efg | primary | | | | efg | primary | | |
When I route I should get When I route I should get
| from | to | route | modes | speed | time | | from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s | | a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s | | b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s | | c | e | cde,cde | ferry,ferry | 12 km/h |
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s | | e | c | cde,cde | ferry,ferry | 12 km/h |
Scenario: Car - Properly handle ISO 8601 durations Scenario: Car - Properly handle ISO 8601 durations
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | route | duration | | nodes | highway | route | duration |
@@ -86,8 +59,8 @@ Feature: Car - Handle ferry routes
| efg | primary | | | | efg | primary | | |
When I route I should get When I route I should get
| from | to | route | modes | speed | time | | from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s | | a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s | | b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s | | c | e | cde,cde | ferry,ferry | 12 km/h |
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s | | e | c | cde,cde | ferry,ferry | 12 km/h |
-36
View File
@@ -1,36 +0,0 @@
@routing @car @hov
Feature: Car - Handle driving
Background:
Given the profile "car"
And a grid size of 100 meters
Scenario: Car - Avoid hov when not on hov
Given the node map
"""
b=========c========================e====j
~ ~ ~
a ~ f----m
| i |
| | ----------------l
| | /
g_______________h______k_____n
"""
And the ways
| nodes | highway | hov |
| ab | motorway_link | |
| bcej | motorway | designated |
| ag | primary | |
| ghkn | primary | |
| ih | primary | |
| kl | secondary | |
| lf | secondary | |
| ci | motorway_link | |
| ef | motorway_link | |
| fm | secondary | |
When I route I should get
| from | to | route |
| a | m | ag,ghkn,kl,lf,fm,fm |
| c | m | bcej,ef,fm,fm |
+10 -20
View File
@@ -9,10 +9,8 @@ Feature: Car - Speed on links
Scenario: Car - Use motorway_link when reasonable Scenario: Car - Use motorway_link when reasonable
Given the node map Given the node map
""" | | | e | | | | f | | |
e f | x | a | b | | | | c | d | y |
x a b c d y
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -32,10 +30,8 @@ Feature: Car - Speed on links
Scenario: Car - Use trunk_link when reasonable Scenario: Car - Use trunk_link when reasonable
Given the node map Given the node map
""" | | | e | | | | f | | |
e f | x | a | b | | | | c | d | y |
x a b c d y
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -54,10 +50,8 @@ Feature: Car - Speed on links
Scenario: Car - Use primary_link when reasonable Scenario: Car - Use primary_link when reasonable
Given the node map Given the node map
""" | | | e | | | | f | | |
e f | x | a | b | | | | c | d | y |
x a b c d y
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -76,10 +70,8 @@ Feature: Car - Speed on links
Scenario: Car - Use secondary_link when reasonable Scenario: Car - Use secondary_link when reasonable
Given the node map Given the node map
""" | | | e | | | | f | | |
e f | x | a | b | | | | c | d | y |
x a b c d y
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -99,10 +91,8 @@ Feature: Car - Speed on links
Scenario: Car - Use tertiary_link when reasonable Scenario: Car - Use tertiary_link when reasonable
Given the node map Given the node map
""" | | | e | | | | f | | |
e f | x | a | b | | | | c | d | y |
x a b c d y
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
+59 -77
View File
@@ -6,11 +6,9 @@ OSRM will use 4/5 of the projected free-flow speed.
Given the profile "car" Given the profile "car"
Given a grid size of 1000 meters Given a grid size of 1000 meters
Scenario: Car - Respect maxspeeds when lower than way type speed Scenario: Car - Respect maxspeeds when lower that way type speed
Given the node map Given the node map
""" | a | b | c | d | e | f | g |
a b c d e f g
"""
And the ways And the ways
| nodes | highway | maxspeed | | nodes | highway | maxspeed |
@@ -23,47 +21,41 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get When I route I should get
| from | to | route | speed | | from | to | route | speed |
| a | b | ab,ab | 85 km/h | | a | b | ab,ab | 79 km/h |
| b | c | bc,bc | 48 km/h | | b | c | bc,bc | 59 km/h +- 1 |
| c | d | cd,cd | 40 km/h | | c | d | cd,cd | 51 km/h |
| d | e | de,de | 64 km/h | | d | e | de,de | 75 km/h |
| e | f | ef,ef | 80 km/h | | e | f | ef,ef | 91 km/h |
| f | g | fg,fg | 96 km/h | | f | g | fg,fg | 107 km/h |
Scenario: Car - Do not ignore maxspeed when higher than way speed Scenario: Car - Do not ignore maxspeed when higher than way speed
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | maxspeed | # | | nodes | highway | maxspeed |
| ab | residential | | default residential speed is 25 | | ab | residential | |
| bc | residential | 90 | | | bc | residential | 90 |
| cd | living_street | FR:urban | | | cd | living_street | FR:urban |
When I route I should get When I route I should get
| from | to | route | speed | | from | to | route | speed |
| a | b | ab,ab | 25 km/h | | a | b | ab,ab | 31 km/h |
# default residential speed is 25, don't mess with this | b | c | bc,bc | 83 km/h +- 1 |
| b | c | bc,bc | 72 km/h | | c | d | cd,cd | 51 km/h |
# parsed maxspeeds are scaled by profile's speed_reduction value
| c | d | cd,cd | 40 km/h |
# symbolic posted speeds without explicit exceptions are parsed
# from the profile's maxspeed_table_default table
Scenario: Car - Forward/backward maxspeed are scaled by profile's speed_reduction if explicitly set Scenario: Car - Forward/backward maxspeed
Given a grid size of 100 meters Given a grid size of 100 meters
Then routability should be Then routability should be
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw | | highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | 65 km/h | 65 km/h | | primary | | | | 65 km/h | 65 km/h |
| primary | 60 | | | 48 km/h | 48 km/h | | primary | 60 | | | 60 km/h | 60 km/h |
| primary | | 60 | | 48 km/h | 65 km/h | | primary | | 60 | | 60 km/h | 65 km/h |
| primary | | | 60 | 65 km/h | 48 km/h | | primary | | | 60 | 65 km/h | 60 km/h |
| primary | 15 | 60 | | 48 km/h | 12 km/h | | primary | 15 | 60 | | 60 km/h | 23 km/h |
| primary | 15 | | 60 | 12 km/h | 48 km/h | | primary | 15 | | 60 | 23 km/h | 60 km/h |
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h | | primary | 15 | 30 | 60 | 34 km/h | 60 km/h |
Scenario: Car - Maxspeed should not allow routing on unroutable ways Scenario: Car - Maxspeed should not allow routing on unroutable ways
Then routability should be Then routability should be
@@ -85,55 +77,45 @@ OSRM will use 4/5 of the projected free-flow speed.
Scenario: Car - Too narrow streets should be ignored or incur a penalty Scenario: Car - Too narrow streets should be ignored or incur a penalty
Then routability should be Then routability should be
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate | | highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 | | primary | | | | | 63 km/h | 63 km/h |
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 | | primary | | 3 | | | 32 km/h | 32 km/h |
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 | | primary | 60 | | | | 59 km/h | 59 km/h |
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 | | primary | 60 | 3 | | | 30 km/h | 30 km/h |
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 | | primary | | | 60 | | 59 km/h | 63 km/h |
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 | | primary | | 3 | 60 | | 30 km/h | 32 km/h |
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 | | primary | | | | 60 | 63 km/h | 59 km/h |
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 | | primary | | 3 | | 60 | 32 km/h | 30 km/h |
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 | | primary | 15 | | 60 | | 59 km/h | 23 km/h |
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 | | primary | 15 | 3 | 60 | | 30 km/h | 7 km/h |
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 | | primary | 15 | | | 60 | 23 km/h | 59 km/h |
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 | | primary | 15 | 3 | | 60 | 7 km/h | 30 km/h |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 | | primary | 15 | | 30 | 60 | 34 km/h | 59 km/h |
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 | | primary | 15 | 3 | 30 | 60 | 15 km/h | 30 km/h |
Scenario: Car - Single lane streets be ignored or incur a penalty Scenario: Car - Single lane streets be ignored or incur a penalty
Then routability should be Then routability should be
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate | | highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 | | primary | | | | | 63 km/h | 63 km/h |
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 | | primary | | 1 | | | 32 km/h | 32 km/h |
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 | | primary | 60 | | | | 59 km/h | 59 km/h |
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 | | primary | 60 | 1 | | | 30 km/h | 30 km/h |
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 | | primary | | | 60 | | 59 km/h | 63 km/h |
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 | | primary | | 1 | 60 | | 30 km/h | 32 km/h |
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 | | primary | | | | 60 | 63 km/h | 59 km/h |
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 | | primary | | 1 | | 60 | 32 km/h | 30 km/h |
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 | | primary | 15 | | 60 | | 59 km/h | 23 km/h |
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 | | primary | 15 | 1 | 60 | | 30 km/h | 7 km/h |
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 | | primary | 15 | | | 60 | 23 km/h | 59 km/h |
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 | | primary | 15 | 1 | | 60 | 7 km/h | 30 km/h |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 | | primary | 15 | | 30 | 60 | 34 km/h | 59 km/h |
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 | | primary | 15 | 1 | 30 | 60 | 15 km/h | 30 km/h |
Scenario: Car - Single lane streets only incur a penalty for two-way streets Scenario: Car - Single lane streets only incure a penalty for two-way streets
Then routability should be Then routability should be
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate | | highway | maxspeed | lanes | oneway | forw | backw |
| primary | 30 | 1 | yes | 23 km/h | | 7 | | | primary | 30 | 1 | yes | 34 km/h | |
| primary | 30 | 1 | -1 | | 23 km/h | | 7 | | primary | 30 | 1 | -1 | | 34 km/h |
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 | | primary | 30 | 1 | | 15 km/h | 15 km/h |
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 | | primary | 30 | 2 | | 34 km/h | 34 km/h |
Scenario: Car - Forward/backward maxspeed on reverse oneways
Then routability should be
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
| primary | | | | -1 | | 64 km/h | | 18 |
| primary | 30 | | | -1 | | 23 km/h | | 7 |
| primary | | 30 | | -1 | | 64 km/h | | 18 |
| primary | | | 30 | -1 | | 23 km/h | | 7 |
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
+3 -7
View File
@@ -5,10 +5,8 @@ Feature: Car - Mode flag
Scenario: Car - Mode when using a ferry Scenario: Car - Mode when using a ferry
Given the node map Given the node map
""" | a | b | |
a b | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | route | duration | | nodes | highway | route | duration |
@@ -27,9 +25,7 @@ Feature: Car - Mode flag
Scenario: Car - Snapping when using a ferry Scenario: Car - Snapping when using a ferry
Given the node map Given the node map
""" | a | b | | c | d | | e | f |
a b c d e f
"""
And the ways And the ways
| nodes | highway | route | duration | | nodes | highway | route | duration |
+10 -66
View File
@@ -3,14 +3,11 @@ Feature: Car - Street names in instructions
Background: Background:
Given the profile "car" Given the profile "car"
Given a grid size of 5 meters
Scenario: Car - A named street Scenario: Car - A named street
Given the node map Given the node map
""" | a | b |
a b | | c |
c
"""
And the ways And the ways
| nodes | name | ref | | nodes | name | ref |
@@ -18,16 +15,14 @@ Feature: Car - Street names in instructions
| bc | Your Way | A1 | | bc | Your Way | A1 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route |
| a | c | My Way,Your Way,Your Way | ,A1,A1| | a | c | My Way,Your Way (A1),Your Way (A1) |
Scenario: Car - A named street with pronunciation Scenario: Car - A named street with pronunciation
Given the node map Given the node map
""" | a | b | d |
a b d | | 1 | |
1 | | c | |
c
"""
And the ways And the ways
| nodes | name |name:pronunciation | ref | | nodes | name |name:pronunciation | ref |
@@ -35,36 +30,15 @@ Feature: Car - Street names in instructions
| bd | My Way | meyeway | A1 | | bd | My Way | meyeway | A1 |
| cd | Your Way | yourewaye | | | cd | Your Way | yourewaye | |
When I route I should get
| from | to | route | pronunciations | ref |
| a | d | My Way,My Way,My Way | ,meyeway,meyeway | ,A1,A1 |
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
# See #2860
Scenario: Car - same street name but different pronunciation
Given the node map
"""
a b c
d
e
"""
And the ways
| nodes | name | name:pronunciation |
| abc | Houston St | hew-stun |
| bde | Houston St | how-stun |
When I route I should get When I route I should get
| from | to | route | pronunciations | | from | to | route | pronunciations |
| a | c | Houston St,Houston St | hew-stun,hew-stun | | a | d | My Way,My Way (A1) | ,meyeway |
| a | e | Houston St,Houston St,Houston St | hew-stun,how-stun,how-stun | | 1 | c | Your Way,Your Way | yourewaye,yourewaye |
@todo @todo
Scenario: Car - Use way type to describe unnamed ways Scenario: Car - Use way type to describe unnamed ways
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -74,33 +48,3 @@ Feature: Car - Street names in instructions
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | c | tertiary,residential,residential | | a | c | tertiary,residential,residential |
Scenario: Inner city expressway with on road
Given the node map
"""
a b . . . c g
`f .
`
.
.
d
.
.
.
e
"""
And the ways
| nodes | highway | name | name:pronunciation | oneway |
| abc | primary | road | roooaad | |
| cg | primary | road | roooaad | |
| bfd | trunk_link | sliproad | | yes |
| cde | trunk | trunk | truank | yes |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | cde | c | no_right_turn |
When I route I should get
| waypoints | route | turns | pronunciations |
| a,e | road,trunk,trunk | depart,turn right,arrive | roooaad,truank,truank |
+3 -34
View File
@@ -15,22 +15,6 @@ Feature: Car - Oneway streets
| highway | oneway | forw | backw | | highway | oneway | forw | backw |
| primary | -1 | | x | | primary | -1 | | x |
Scenario: Car - Mode specific oneway
Then routability should be
| highway | oneway:motorcar | oneway:motor_vehicle | oneway:vehicle | oneway | forw | backw |
| primary | | | | | x | x |
| primary | yes | | | | x | |
| primary | | yes | | | x | |
| primary | | | yes | | x | |
| primary | | | | yes | x | |
| primary | yes | no | | | x | |
| primary | | yes | no | | x | |
| primary | | | yes | no | x | |
| primary | | | | yes | x | |
| primary | no | yes | | | x | x |
| primary | | no | yes | | x | x |
| primary | | | no | yes | x | x |
Scenario: Car - Implied oneways Scenario: Car - Implied oneways
Then routability should be Then routability should be
| highway | junction | forw | backw | # | | highway | junction | forw | backw | # |
@@ -51,10 +35,8 @@ Feature: Car - Oneway streets
Scenario: Car - Around the Block Scenario: Car - Around the Block
Given the node map Given the node map
""" | a | b |
a b | d | c |
f d c e
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -62,8 +44,6 @@ Feature: Car - Oneway streets
| bc | | | bc | |
| cd | | | cd | |
| da | | | da | |
| ce | |
| df | |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
@@ -88,9 +68,7 @@ Feature: Car - Oneway streets
Scenario: Car - Two consecutive oneways Scenario: Car - Two consecutive oneways
Given the node map Given the node map
""" | a | b | | c |
a b c
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -101,12 +79,3 @@ Feature: Car - Oneway streets
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | c | ab,bc,bc | | a | c | ab,bc,bc |
# Reversible oneways (low frequency) vs alternating oneways (high frequency).
# See: https://github.com/Project-OSRM/osrm-backend/issues/2837
Scenario: Car - Route over alternating but not reversible oneways
Then routability should be
| highway | oneway | forw | backw |
| primary | reversible | | |
| primary | alternating | x | x |
+60 -136
View File
@@ -10,11 +10,9 @@ Feature: Car - Turn restrictions
@no_turning @no_turning
Scenario: Car - No left turn Scenario: Car - No left turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -36,11 +34,9 @@ Feature: Car - Turn restrictions
@no_turning @no_turning
Scenario: Car - No straight on Scenario: Car - No straight on
Given the node map Given the node map
""" | a | b | j | d | e |
a b j d e | v | | | | z |
v z | | w | x | y | |
w x y
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -66,11 +62,9 @@ Feature: Car - Turn restrictions
@no_turning @no_turning
Scenario: Car - No right turn Scenario: Car - No right turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -92,11 +86,9 @@ Feature: Car - Turn restrictions
@no_turning @no_turning
Scenario: Car - No u-turn Scenario: Car - No u-turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -118,11 +110,9 @@ Feature: Car - Turn restrictions
@no_turning @no_turning
Scenario: Car - Handle any no_* relation Scenario: Car - Handle any no_* relation
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -144,11 +134,9 @@ Feature: Car - Turn restrictions
@only_turning @only_turning
Scenario: Car - Only left turn Scenario: Car - Only left turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -161,38 +149,18 @@ Feature: Car - Turn restrictions
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | sj | wj | j | only_left_turn | | restriction | sj | wj | j | only_left_turn |
Scenario: Car - Only right turn, invalid
Given the node map
"""
n
w j e r
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
| re | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | er | j | only_right_on |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| s | r | sj,ej,re,re | | s | w | sj,wj,wj |
| s | n | |
| s | e | |
@only_turning @only_turning
Scenario: Car - Only right turn Scenario: Car - Only right turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -214,11 +182,9 @@ Feature: Car - Turn restrictions
@only_turning @only_turning
Scenario: Car - Only straight on Scenario: Car - Only straight on
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -240,11 +206,9 @@ Feature: Car - Turn restrictions
@no_turning @no_turning
Scenario: Car - Handle any only_* restriction Scenario: Car - Handle any only_* restriction
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -266,11 +230,9 @@ Feature: Car - Turn restrictions
@specific @specific
Scenario: Car - :hgv-qualified on a standard turn restriction Scenario: Car - :hgv-qualified on a standard turn restriction
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -292,11 +254,9 @@ Feature: Car - Turn restrictions
@specific @specific
Scenario: Car - :motorcar-qualified on a standard turn restriction Scenario: Car - :motorcar-qualified on a standard turn restriction
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -318,11 +278,9 @@ Feature: Car - Turn restrictions
@except @except
Scenario: Car - Except tag and on no_ restrictions Scenario: Car - Except tag and on no_ restrictions
Given the node map Given the node map
""" | b | x | c |
b x c | a | j | d |
a j d | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -350,11 +308,9 @@ Feature: Car - Turn restrictions
@except @except
Scenario: Car - Except tag and on only_ restrictions Scenario: Car - Except tag and on only_ restrictions
Given the node map Given the node map
""" | a | | b |
a b | | j | |
j | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -374,12 +330,10 @@ Feature: Car - Turn restrictions
@except @except
Scenario: Car - Several only_ restrictions at the same segment Scenario: Car - Several only_ restrictions at the same segment
Given the node map Given the node map
""" | | | | | y | | | | |
y | i | j | f | b | x | a | e | g | h |
i j f b x a e g h | | | | | | | | | |
| | | | c | | d | | | |
c d
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -411,15 +365,13 @@ Feature: Car - Turn restrictions
@except @except
Scenario: Car - two only_ restrictions share same to-way Scenario: Car - two only_ restrictions share same to-way
Given the node map Given the node map
""" | | | e | | | | f | | |
e f | | | | | a | | | | |
a | | | | | | | | | |
| | | c | | x | | d | | |
c x d | | | | | y | | | | |
y | | | | | | | | | |
| | | | | b | | | | |
b
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -447,15 +399,13 @@ Feature: Car - Turn restrictions
@except @except
Scenario: Car - two only_ restrictions share same from-way Scenario: Car - two only_ restrictions share same from-way
Given the node map Given the node map
""" | | | e | | | | f | | |
e f | | | | | a | | | | |
a | | | | | | | | | |
| | | c | | x | | d | | |
c x d | | | | | y | | | | |
y | | | | | | | | | |
| | | | | b | | | | |
b
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -480,29 +430,3 @@ Feature: Car - Turn restrictions
| a | b | ax,xy,yb,yb | | a | b | ax,xy,yb,yb |
| b | a | yb,xy,ax,ax | | b | a | yb,xy,ax,ax |
@specific
Scenario: Car - Ignore unrecognized restriction
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | wj | j | yield |
When I route I should get
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
-14
View File
@@ -1,14 +0,0 @@
@routing @car @surface
Feature: Car - Surfaces
Background:
Given the profile "car"
Scenario: Car - Ways tagged service should reduce speed
Then routability should be
| highway | service | forw | backw | forw_rate |
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | emergency_access | | | |
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
+3 -5
View File
@@ -6,11 +6,9 @@ Feature: Car - Handle ferryshuttle train routes
Scenario: Car - Use a ferry route Scenario: Car - Use a ferry route
Given the node map Given the node map
""" | a | b | c | | | |
a b c | | | d | | | |
d | | | e | f | g | h |
e f g h
"""
And the ways And the ways
| nodes | highway | route | bicycle | | nodes | highway | route | bicycle |
-80
View File
@@ -1,80 +0,0 @@
@routing @testbot @sidebias
Feature: Testbot - side bias
Background:
Given the profile file
"""
require 'testbot'
properties.left_hand_driving = true
"""
Scenario: Left hand bias
Given the profile file "car" extended with
"""
properties.left_hand_driving = true
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
"""
Given the node map
"""
a b c
d
"""
And the ways
| nodes |
| ab |
| bc |
| bd |
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 24s +-1 |
| d | c | bd,bc,bc | 27s +-1 |
Scenario: Right hand bias
Given the profile file "car" extended with
"""
properties.left_hand_driving = false
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
"""
And the node map
"""
a b c
d
"""
And the ways
| nodes |
| ab |
| bc |
| bd |
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 27s +-1 |
# should be inverse of left hand bias
| d | c | bd,bc,bc | 24s +-1 |
Scenario: Roundabout exit counting for left sided driving
And a grid size of 10 meters
And the node map
"""
a
b
h g c d
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
+14 -43
View File
@@ -5,49 +5,20 @@ Feature: Car - speeds
Given the profile "car" Given the profile "car"
And a grid size of 1000 meters And a grid size of 1000 meters
# should more or less match default speeds in car profile, but may be different due to rounding errors
Scenario: Car - speed of various way types Scenario: Car - speed of various way types
Then routability should be Then routability should be
| highway | oneway | bothw | | highway | oneway | bothw |
| motorway | no | 89 km/h | | motorway | no | 82 km/h |
| motorway_link | no | 44 km/h | | motorway_link | no | 47 km/h |
| trunk | no | 85 km/h | | trunk | no | 79 km/h +- 1 |
| trunk_link | no | 39 km/h | | trunk_link | no | 43 km/h +- 1 |
| primary | no | 64 km/h | | primary | no | 63 km/h +- 1 |
| primary_link | no | 29 km/h | | primary_link | no | 34 km/h |
| secondary | no | 55 km/h | | secondary | no | 54 km/h +- 1 |
| secondary_link | no | 24 km/h | | secondary_link | no | 31 km/h |
| tertiary | no | 39 km/h | | tertiary | no | 43 km/h |
| tertiary_link | no | 20 km/h | | tertiary_link | no | 26 km/h |
| unclassified | no | 24 km/h | | unclassified | no | 31 km/h |
| residential | no | 24 km/h | | residential | no | 31 km/h |
| living_street | no | 9 km/h | | living_street | no | 18 km/h |
| service | no | 15 km/h | | service | no | 23 km/h |
# Alternating oneways scale rates but not speeds
Scenario: Car - scaled speeds for oneway=alternating
Then routability should be
| highway | oneway | junction | forw | backw | # |
| tertiary | | | 39 km/h | 39 km/h | |
| tertiary | alternating | | 39 km/h | 39 km/h | |
| motorway | | | 89 km/h | | implied oneway |
| motorway | alternating | | 89 km/h | | implied oneway |
| motorway | reversible | | | | unroutable |
| primary | | roundabout | 64 km/h | | implied oneway |
| primary | alternating | roundabout | 64 km/h | | implied oneway |
| primary | reversible | roundabout | | | unroutable |
Scenario: Car - Check roundoff errors
Then routability should be
| highway | maxspeed | forw | backw |
| primary | | 64 km/h | 64 km/h |
| primary | 60 | 47 km/h | 47 km/h |
| primary | 60 | 47 km/h | 47 km/h |
| primary | 60 | 47 km/h | 47 km/h |
Scenario: Car - Side road penalties
Then routability should be
| highway | side_road | forw | backw | forw_rate | backw_rate |
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
-109
View File
@@ -1,109 +0,0 @@
@routing @basic @car
Feature: Basic Routing
Background:
Given the profile "car"
Given a grid size of 500 meters
@smallest
Scenario: Summaries when routing on a simple network
Given the node map
"""
b f
c d g
a e
"""
And the ways
| nodes | name |
| acb | road |
| de | 1 st |
| cd | |
| dg | blvd |
| df | street |
When I route I should get
| waypoints | route | summary |
| a,e | road,,1 st,1 st | road, 1 st |
# The via node `d` belongs to `cd`, `de`, `df`, `dg` and depending on the edge
# summary can be "road;street", "road, 1 st;1 st, street", "road, blvd;blvd, street"
# The test must be fixed by #2287
#| a,d,f | road,,,street,street | road;street |
| a,e,f | road,,1 st,1 st,1 st,street,street | road, 1 st;1 st, street |
Scenario: Name Empty
Given the node map
"""
a b c
"""
And the ways
| nodes | name |
| ab | road |
| bc | |
When I route I should get
| waypoints | route | summary |
| a,c | road, | road |
Scenario: Name Empty But Ref
Given the node map
"""
a b c
"""
And the ways
| nodes | name | ref |
| ab | road | |
| bc | | 101 |
When I route I should get
| waypoints | route | summary |
| a,c | road, | road, 101 |
Scenario: Only Refs
Given the node map
"""
a b c
"""
And the ways
| nodes | name | ref |
| ab | | 100 |
| bc | | 101 |
When I route I should get
| waypoints | route | summary |
| a,c | , | 100, 101 |
Scenario: Single Ref
Given the node map
"""
a b c
"""
And the ways
| nodes | name | ref |
| ab | | |
| bc | | 101 |
When I route I should get
| waypoints | route | summary |
| a,c | ,, | 101 |
Scenario: Nothing
Given the node map
"""
a b c
"""
And the ways
| nodes | name |
| ab | |
| bc | |
When I route I should get
| waypoints | route | summary |
| a,c | , | |
+48 -48
View File
@@ -4,7 +4,7 @@ Feature: Car - Surfaces
Background: Background:
Given the profile "car" Given the profile "car"
Scenario: Car - Routability of tracktype tags Scenario: Car - Routeability of tracktype tags
Then routability should be Then routability should be
| highway | tracktype | bothw | | highway | tracktype | bothw |
| trunk | grade1 | x | | trunk | grade1 | x |
@@ -27,7 +27,7 @@ Feature: Car - Surfaces
| trunk | impassable | | | trunk | impassable | |
| trunk | nonsense | x | | trunk | nonsense | x |
Scenario: Car - Routability of surface tags Scenario: Car - Routabiliy of surface tags
Then routability should be Then routability should be
| highway | surface | bothw | | highway | surface | bothw |
| trunk | asphalt | x | | trunk | asphalt | x |
@@ -40,13 +40,13 @@ Feature: Car - Surfaces
| highway | access | tracktype | smoothness | surface | forw | backw | | highway | access | tracktype | smoothness | surface | forw | backw |
| motorway | | | | | x | | | motorway | | | | | x | |
| motorway | no | grade1 | excellent | asphalt | | | | motorway | no | grade1 | excellent | asphalt | | |
| motorway | private | grade1 | excellent | asphalt | x | | | motorway | private | grade1 | excellent | asphalt | | |
| motorway | agricultural | grade1 | excellent | asphalt | | | | motorway | agricultural | grade1 | excellent | asphalt | | |
| motorway | forestry | grade1 | excellent | asphalt | | | | motorway | forestry | grade1 | excellent | asphalt | | |
| motorway | emergency | grade1 | excellent | asphalt | | | | motorway | emergency | grade1 | excellent | asphalt | | |
| primary | | | | | x | x | | primary | | | | | x | x |
| primary | private | grade1 | excellent | asphalt | x | x |
| primary | no | grade1 | excellent | asphalt | | | | primary | no | grade1 | excellent | asphalt | | |
| primary | private | grade1 | excellent | asphalt | | |
| primary | agricultural | grade1 | excellent | asphalt | | | | primary | agricultural | grade1 | excellent | asphalt | | |
| primary | forestry | grade1 | excellent | asphalt | | | | primary | forestry | grade1 | excellent | asphalt | | |
| primary | emergency | grade1 | excellent | asphalt | | | | primary | emergency | grade1 | excellent | asphalt | | |
@@ -64,65 +64,64 @@ Feature: Car - Surfaces
Scenario: Car - Surface should reduce speed Scenario: Car - Surface should reduce speed
Then routability should be Then routability should be
| highway | oneway | surface | forw | backw | | highway | oneway | surface | forw | backw |
| motorway | no | | 90 km/h | 90 km/h | | motorway | no | | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 | | motorway | no | asphalt | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 | | motorway | no | concrete | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 | | motorway | no | concrete:plates | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 | | motorway | no | concrete:lanes | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | paved | 90 km/h +-1 | 90 km/h +-1 | | motorway | no | paved | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | cement | 80 km/h +-1 | 80 km/h +-1 | | motorway | no | cement | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | compacted | 80 km/h +-1 | 80 km/h +-1 | | motorway | no | compacted | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | fine_gravel | 80 km/h +-1 | 80 km/h +-1 | | motorway | no | fine_gravel | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 | | motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 | | motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 | | motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | grass | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | grass | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | wood | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | wood | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | sett | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | sett | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | grass_paver | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | grass_paver | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | gravel | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | gravel | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | unpaved | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | unpaved | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | ground | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | ground | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | dirt | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | dirt | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | pebblestone | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | pebblestone | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | tartan | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | tartan | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | cobblestone | 30 km/h +-1 | 30 km/h +-1 | | motorway | no | cobblestone | 34 km/h +-1 | 34 km/h +-1 |
| motorway | no | clay | 30 km/h +-1 | 30 km/h +-1 | | motorway | no | clay | 34 km/h +-1 | 34 km/h +-1 |
| motorway | no | earth | 20 km/h +-1 | 20 km/h +-1 | | motorway | no | earth | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | stone | 20 km/h +-1 | 20 km/h +-1 | | motorway | no | stone | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 | | motorway | no | rocky | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 | | motorway | no | sand | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
Scenario: Car - Tracktypes should reduce speed Scenario: Car - Tracktypes should reduce speed
Then routability should be Then routability should be
| highway | oneway | tracktype | forw | backw | | highway | oneway | tracktype | forw | backw |
| motorway | no | | 90 km/h | 90 km/h | | motorway | no | | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 | | motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | grade2 | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | grade2 | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | grade3 | 30 km/h +-1 | 30 km/h +-1 | | motorway | no | grade3 | 34 km/h +-1 | 34 km/h +-1 |
| motorway | no | grade4 | 25 km/h +-1 | 25 km/h +-1 | | motorway | no | grade4 | 31 km/h +-1 | 31 km/h +-1 |
| motorway | no | grade5 | 20 km/h +-1 | 20 km/h +-1 | | motorway | no | grade5 | 26 km/h +-1 | 26 km/h +-1 |
Scenario: Car - Smoothness should reduce speed Scenario: Car - Smoothness should reduce speed
Then routability should be Then routability should be
| highway | oneway | smoothness | forw | backw | | highway | oneway | smoothness | forw | backw |
| motorway | no | | 90 km/h | 90 km/h | | motorway | no | | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | intermediate | 80 km/h | 80 km/h | | motorway | no | intermediate | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | bad | 40 km/h +-1 | 40 km/h +-1 | | motorway | no | bad | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | very_bad | 20 km/h +-1 | 20 km/h +-1 | | motorway | no | very_bad | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | horrible | 10 km/h +-1 | 10 km/h +-1 | | motorway | no | horrible | 18 km/h +-1 | 18 km/h +-1 |
| motorway | no | very_horrible | 5 km/h +-1 | 5 km/h +-1 | | motorway | no | very_horrible | 15 km/h +-1 | 15 km/h +-1 |
Scenario: Car - Combination of surface tags should use lowest speed Scenario: Car - Combination of surface tags should use lowest speed
Then routability should be Then routability should be
| highway | oneway | tracktype | surface | smoothness | bothw | | highway | oneway | tracktype | surface | smoothness | backw | forw |
| motorway | no | | | | 90 km/h | | motorway | no | | | | 80 km/h | 80 km/h |
| service | no | grade1 | asphalt | excellent | 15 km/h | | service | no | grade1 | asphalt | excellent | 23 km/h | 23 km/h |
| motorway | no | grade5 | asphalt | excellent | 20 km/h | | motorway | no | grade5 | asphalt | excellent | 26 km/h | 26 km/h |
| motorway | no | grade1 | mud | excellent | 10 km/h | | motorway | no | grade1 | mud | excellent | 18 km/h | 18 km/h |
| motorway | no | grade1 | asphalt | very_horrible | 5 km/h | | motorway | no | grade1 | asphalt | very_horrible | 15 km/h | 15 km/h |
| service | no | grade5 | mud | very_horrible | 5 km/h | | service | no | grade5 | mud | very_horrible | 15 km/h | 15 km/h |
Scenario: Car - Surfaces should not affect oneway direction Scenario: Car - Surfaces should not affect oneway direction
Then routability should be Then routability should be
@@ -139,3 +138,4 @@ Feature: Car - Surfaces
| primary | -1 | grade1 | excellent | asphalt | | x | | primary | -1 | grade1 | excellent | asphalt | | x |
| primary | -1 | grade5 | very_bad | mud | | x | | primary | -1 | grade5 | very_bad | mud | | x |
| primary | -1 | nonsense | nonsense | nonsense | | x | | primary | -1 | nonsense | nonsense | nonsense | | x |
+47
View File
@@ -0,0 +1,47 @@
@routing @speed @traffic
Feature: Traffic - speeds
Background: Use specific speeds
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | .05 | 0.1 |
| c | 0.0 | 0.1 |
| d | .05 | .03 |
| e | .05 | .066 |
| f | .075 | .066 |
| g | .075 | 0.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
And the speed file
"""
1,2,27
2,1,27
2,3,27
3,2,27
1,4,27
4,1,27
"""
Scenario: Weighting based on speed file
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the contract extra arguments "--segment-speed-file speeds.csv"
And I route I should get
| from | to | route | speed |
| a | b | ab,ab | 27 km/h |
| a | c | ab,bc,bc | 27 km/h |
| b | c | bc,bc | 27 km/h |
| a | d | ad,ad | 27 km/h |
| d | c | dc,dc | 36 km/h |
| g | b | ab,ab | 27 km/h |
| a | g | ab,ab | 27 km/h |
+29 -59
View File
@@ -3,33 +3,11 @@ Feature: Traffic - turn penalties
Background: Evenly spaced grid with multiple intersections Background: Evenly spaced grid with multiple intersections
Given the node map Given the node map
""" | | a:1 | | b:2 | |
a b | c:3 | d:4 | e:5 | f:6 | g:7 |
c d e f g | | h:8 | | i:9 | |
h i | j:10 | k:11 | l:12 | m:13 | n:14 |
j k l m n | | o:15 | | p:16 | |
o p
"""
And the nodes
| node | id |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
| e | 5 |
| f | 6 |
| g | 7 |
| h | 8 |
| i | 9 |
| j | 10 |
| k | 11 |
| l | 12 |
| m | 13 |
| n | 14 |
| o | 15 |
| p | 16 |
And the ways And the ways
| nodes | highway | | nodes | highway |
| ad | primary | | ad | primary |
@@ -52,22 +30,22 @@ Feature: Traffic - turn penalties
Scenario: Weighting not based on turn penalty file Scenario: Weighting not based on turn penalty file
When I route I should get When I route I should get
| from | to | route | speed | weight | time | | from | to | route | speed | time |
| a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 | | a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
# straight # straight
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 | | i | g | fim,fg,fg | 59 km/h | 12s +-1 |
# right # right
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 | | a | e | ad,def,def | 57 km/h | 12.5s +-1 |
# left # left
| c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 | | c | g | cd,def,fg,fg | 63 km/h | 23s +-1 |
# double straight # double straight
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 | | p | g | mp,fim,fg,fg | 61 km/h | 23.5s +-1 |
# straight-right # straight-right
| a | l | ad,dhk,klm,klm | 53 km/h | 27s +-1 | 27s +-1 | | a | l | ad,dhk,klm,klm | 60 km/h | 24s +-1 |
# straight-left # straight-left
| l | e | klm,dhk,def,def | 55 km/h | 26s +-1 | 26s +-1 | | l | e | klm,dhk,def,def | 59 km/h | 24.5s +-1 |
# double right # double right
| g | n | fg,fim,mn,mn | 44 km/h | 32s +-1 | 32s +-1 | | g | n | fg,fim,mn,mn | 57 km/h | 25s +-1 |
# double left # double left
Scenario: Weighting based on turn penalty file Scenario: Weighting based on turn penalty file
@@ -75,41 +53,35 @@ Feature: Traffic - turn penalties
""" """
9,6,7,1.8 9,6,7,1.8
9,13,14,24.5 9,13,14,24.5
8,4,3,35 8,4,3,26
12,11,8,9 12,11,8,9
8,11,12,23 8,11,12,13
1,4,5,-0.2 1,4,5,-0.2
""" """
# ifg right turn And the contract extra arguments "--turn-penalty-file penalties.csv"
# imn left turn
# hdc left turn
# lkh right turn
# hkl left turn
# ade left turn
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get When I route I should get
| from | to | route | speed | weight | time | | from | to | route | speed | time |
| a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 | | a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
# straight # straight
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 | | i | g | fim,fg,fg | 55 km/h | 13s +-1 |
# right - ifg penalty # right - ifg penalty
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 | | a | e | ad,def,def | 64 km/h | 11s +-1 |
# left - faster because of negative ade penalty # left - faster because of negative ade penalty
| c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 | | c | g | cd,def,fg,fg | 63 km/h | 23s +-1 |
# double straight # double straight
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 | | p | g | mp,fim,fg,fg | 59 km/h | 24.5s +-1 |
# straight-right - ifg penalty # straight-right - ifg penalty
| a | l | ad,def,fim,klm,klm | 58 km/h | 37 | 37s +-1 | | a | l | ad,def,fim,klm,klm | 61 km/h | 35.5s +-1 |
# was straight-left - forced around by hkl penalty # was straight-left - forced around by hkl penalty
| l | e | klm,fim,def,def | 44 km/h | 32.6 | 32s +-1 | | l | e | klm,fim,def,def | 57 km/h | 25s +-1 |
# double right - forced left by lkh penalty # double right - forced left by lkh penalty
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 | | g | n | fg,fim,mn,mn | 30 km/h | 47.5s +-1 |
# double left - imn penalty # double left - imn penalty
| j | c | jk,klm,fim,def,cd,cd | 53 km/h | 54.6 | 54s +-1 | | j | c | jk,klm,fim,def,cd,cd | 60 km/h | 48s +-1 |
# double left - hdc penalty ever so slightly higher than imn; forces all the way around # double left - hdc penalty ever so slightly higher than imn; forces all the way around
Scenario: Too-negative penalty clamps, but does not fail Scenario: Too-negative penalty clamps, but does not fail
Given the contract extra arguments "--turn-penalty-file {penalties_file}" Given the contract extra arguments "--turn-penalty-file penalties.csv"
And the profile "testbot" And the profile "testbot"
And the turn penalty file And the turn penalty file
""" """
@@ -117,9 +89,7 @@ Feature: Traffic - turn penalties
""" """
When I route I should get When I route I should get
| from | to | route | time | | from | to | route | time |
# The target point `d` can be in `ad`, `cd`, `deh` and `dhk` | a | d | ad,ad | 10s +-1 |
# The test must be fixed by #2287
#| a | d | ad,ad | 10s +-1 |
| a | e | ad,def,def | 10s +-1 | | a | e | ad,def,def | 10s +-1 |
| b | f | bf,bf | 10s +-1 | | b | f | bf,bf | 10s +-1 |
| b | g | bf,fg,fg | 20s +-1 | | b | g | bf,fg,fg | 20s +-1 |
-63
View File
@@ -1,63 +0,0 @@
@routing @car @weight
Feature: Car - weights
Background: Use specific speeds
Given the profile "car"
Scenario: Only routes down service road when that's the destination
Given the node map
"""
a--b--c
|
d
|
e--f--g
"""
And the ways
| nodes | highway |
| abc | residential |
| efg | residential |
| cg | tertiary |
| bdf | service |
When I route I should get
| from | to | route | speed | weight |
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
Scenario: Does not jump off the highway to go down service road
Given the node map
"""
a
|
b
|\
| e
|/
c
|
d
"""
And the nodes
| node | id |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
| e | 5 |
And the ways
| nodes | highway | oneway |
| ab | primary | yes |
| bc | primary | yes |
| cd | primary | yes |
| be | service | yes |
| ec | service | yes |
And the extract extra arguments "--generate-edge-lookup"
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the speed file
"""
2,5,8
"""
When I route I should get
| from | to | route | speed | weight |
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
| a | e | ab,be,be | 14 km/h | 112 |
-22
View File
@@ -95,25 +95,3 @@ Feature: Foot - Access tags on ways
| footway | | no | | x | | footway | | no | | x |
| motorway | | | yes | | | motorway | | | yes | |
| footway | | | no | x | | footway | | | no | x |
Scenario: Foot - Bridleways when access is explicit
Then routability should be
| highway | horse | bicycle | foot | bothw |
| bridleway | | | yes | x |
| bridleway | | yes | | |
| bridleway | designated | | | |
| bridleway | | | | |
Scenario: Foot - a way with missing :forward tag
Then routability should be
| highway | bicycle:backward | foot:backward | forw | backw |
| cycleway | designated | designated | | x |
Scenario: Foot - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | x |
| footway | permissive | x |
| garbagetag | permissive | x |
+11 -19
View File
@@ -7,11 +7,9 @@ Feature: Foot - Squares and other areas
@square @square
Scenario: Foot - Route along edge of a squares Scenario: Foot - Route along edge of a squares
Given the node map Given the node map
""" | x | |
x | a | b |
a b | d | c |
d c
"""
And the ways And the ways
| nodes | area | highway | | nodes | area | highway |
@@ -32,11 +30,9 @@ Feature: Foot - Squares and other areas
@building @building
Scenario: Foot - Don't route on buildings Scenario: Foot - Don't route on buildings
Given the node map Given the node map
""" | x | |
x | a | b |
a b | d | c |
d c
"""
And the ways And the ways
| nodes | highway | area | building | access | | nodes | highway | area | building | access |
@@ -57,11 +53,9 @@ Feature: Foot - Squares and other areas
@parking @parking
Scenario: Foot - parking areas Scenario: Foot - parking areas
Given the node map Given the node map
""" | e | | | f |
e f | x | a | b | y |
x a b y | | d | c | |
d c
"""
And the ways And the ways
| nodes | highway | amenity | | nodes | highway | amenity |
@@ -86,10 +80,8 @@ Feature: Foot - Squares and other areas
@train @platform @train @platform
Scenario: Foot - railway platforms Scenario: Foot - railway platforms
Given the node map Given the node map
""" | x | a | b | y |
x a b y | | d | c | |
d c
"""
And the ways And the ways
| nodes | highway | railway | | nodes | highway | railway |
+11 -17
View File
@@ -6,11 +6,9 @@ Feature: Foot - Handle ferry routes
Scenario: Foot - Ferry route Scenario: Foot - Ferry route
Given the node map Given the node map
""" | a | b | c | | |
a b c | | | d | | |
d | | | e | f | g |
e f g
"""
And the ways And the ways
| nodes | highway | route | foot | | nodes | highway | route | foot |
@@ -31,12 +29,10 @@ Feature: Foot - Handle ferry routes
Scenario: Foot - Ferry duration, single node Scenario: Foot - Ferry duration, single node
Given the node map Given the node map
""" | a | b | c | d |
a b c d | | | e | f |
e f | | | g | h |
g h | | | i | j |
i j
"""
And the ways And the ways
| nodes | highway | route | foot | duration | | nodes | highway | route | foot | duration |
@@ -52,10 +48,8 @@ Feature: Foot - Handle ferry routes
Scenario: Foot - Ferry duration, multiple nodes Scenario: Foot - Ferry duration, multiple nodes
Given the node map Given the node map
""" | x | | | | | y |
x y | | a | b | c | d | |
a b c d
"""
And the ways And the ways
| nodes | highway | route | foot | duration | | nodes | highway | route | foot | duration |
@@ -65,5 +59,5 @@ Feature: Foot - Handle ferry routes
When I route I should get When I route I should get
| from | to | route | time | | from | to | route | time |
| a | d | abcd,abcd | 3600s | | a | d | abcd,abcd | 3600s +-10 |
| d | a | abcd,abcd | 3600s | | d | a | abcd,abcd | 3600s +-10 |
+6 -10
View File
@@ -6,10 +6,8 @@ Feature: Foot - Street names in instructions
Scenario: Foot - A named street Scenario: Foot - A named street
Given the node map Given the node map
""" | a | b |
a b | | c |
c
"""
And the ways And the ways
| nodes | name | ref | | nodes | name | ref |
@@ -18,14 +16,12 @@ Feature: Foot - Street names in instructions
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | c | My Way,Your Way,Your Way | | a | c | My Way (A6),Your Way (B7),Your Way (B7) |
@unnamed @unnamed
Scenario: Foot - No longer use way type to describe unnamed ways, see #3231 Scenario: Foot - Use way type to describe unnamed ways
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -34,4 +30,4 @@ Feature: Foot - Street names in instructions
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | d | , | | a | d | {highway:footway},{highway:track},{highway:track} |
+7 -13
View File
@@ -6,37 +6,31 @@ Feature: Foot - Way ref
Scenario: Foot - Way with both name and ref Scenario: Foot - Way with both name and ref
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | name | ref | | nodes | name | ref |
| ab | Utopia Drive | E7 | | ab | Utopia Drive | E7 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route |
| a | b | Utopia Drive,Utopia Drive | E7,E7 | | a | b | Utopia Drive (E7),Utopia Drive (E7) |
Scenario: Foot - Way with only ref Scenario: Foot - Way with only ref
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | name | ref | | nodes | name | ref |
| ab | | E7 | | ab | | E7 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route |
| a | b | , | E7,E7 | | a | b | E7,E7 |
Scenario: Foot - Way with only name Scenario: Foot - Way with only name
Given the node map Given the node map
""" | a | b |
a b
"""
And the ways And the ways
| nodes | name | | nodes | name |
+36 -58
View File
@@ -8,11 +8,9 @@ Feature: Foot - Turn restrictions
@no_turning @no_turning
Scenario: Foot - No left turn Scenario: Foot - No left turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -34,11 +32,9 @@ Feature: Foot - Turn restrictions
@no_turning @no_turning
Scenario: Foot - No right turn Scenario: Foot - No right turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -60,11 +56,9 @@ Feature: Foot - Turn restrictions
@no_turning @no_turning
Scenario: Foot - No u-turn Scenario: Foot - No u-turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -86,11 +80,9 @@ Feature: Foot - Turn restrictions
@no_turning @no_turning
Scenario: Foot - Handle any no_* relation Scenario: Foot - Handle any no_* relation
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -112,11 +104,9 @@ Feature: Foot - Turn restrictions
@only_turning @only_turning
Scenario: Foot - Only left turn Scenario: Foot - Only left turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -138,11 +128,9 @@ Feature: Foot - Turn restrictions
@only_turning @only_turning
Scenario: Foot - Only right turn Scenario: Foot - Only right turn
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -164,11 +152,9 @@ Feature: Foot - Turn restrictions
@only_turning @only_turning
Scenario: Foot - Only straight on Scenario: Foot - Only straight on
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -190,11 +176,9 @@ Feature: Foot - Turn restrictions
@no_turning @no_turning
Scenario: Foot - Handle any only_* restriction Scenario: Foot - Handle any only_* restriction
Given the node map Given the node map
""" | | n | |
n | w | j | e |
w j e | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -216,11 +200,9 @@ Feature: Foot - Turn restrictions
@except @except
Scenario: Foot - Except tag and on no_ restrictions Scenario: Foot - Except tag and on no_ restrictions
Given the node map Given the node map
""" | b | x | c |
b x c | a | j | d |
a j d | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -248,11 +230,9 @@ Feature: Foot - Turn restrictions
@except @except
Scenario: Foot - Except tag and on only_ restrictions Scenario: Foot - Except tag and on only_ restrictions
Given the node map Given the node map
""" | a | | b |
a b | | j | |
j | | s | |
s
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
@@ -272,14 +252,12 @@ Feature: Foot - Turn restrictions
@except @except
Scenario: Foot - Multiple except tag values Scenario: Foot - Multiple except tag values
Given the node map Given the node map
""" | s | j | a |
s j a | | | b |
b | | | c |
c | | | d |
d | | | e |
e | | | f |
f
"""
And the ways And the ways
| nodes | oneway | | nodes | oneway |
+5 -7
View File
@@ -10,13 +10,11 @@ Feature: Roundabout Instructions
# make sense when you're going the opposite way around the roundabout. # make sense when you're going the opposite way around the roundabout.
Given the node map Given the node map
""" | | | v | | |
v | | | d | | |
d | s | a | | c | u |
s a c u | | | b | | |
b | | | t | | |
t
"""
And the ways And the ways
| nodes | junction | | nodes | junction |
-257
View File
@@ -1,257 +0,0 @@
@routing @guidance @turn-lanes
Feature: Turn Lane Guidance
Background:
Given the profile "car"
Given a grid size of 3 meters
@sliproads
Scenario: Separate Turn Lanes
Given the node map
"""
e
.
a ... b ..... c . g
` .
`... d
.
f
"""
And the ways
| nodes | turn:lanes:forward | name | oneway |
| ab | | in | yes |
| bc | left\|through | in | yes |
| bd | right | in | yes |
| ec | | cross | no |
| cd | | cross | no |
| df | | cross | no |
| cg | | straight | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | cd | d | no_left_turn |
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
@sliproads
Scenario: Separate Turn Lanes
Given the node map
"""
e
a . . b . . . c g
` .
` .
` d
f
"""
And the ways
| nodes | turn:lanes:forward | name | oneway |
| ab | | in | yes |
| bc | left\|through | in | yes |
| bd | right | in | yes |
| ec | | cross | no |
| cd | | cross | no |
| df | | cross | no |
| cg | | straight | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | cd | d | no_left_turn |
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
@sliproads
Scenario: Separate Turn Lanes Next to other turns
Given the node map
"""
. e
a . . b . . . c g
. ` .
. ` .
. d
. f
.
.
.
.
i . . h . . . j
"""
And the ways
| nodes | turn:lanes:forward | name | oneway |
| ab | | in | yes |
| bc | left\|through | in | yes |
| bd | right | in | yes |
| ec | | cross | no |
| cd | | cross | no |
| df | | cross | no |
| cg | | straight | no |
| bh | left\|right | turn | yes |
| ihj | | other | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | cd | d | no_left_turn |
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
@todo @2654 @none
#https://github.com/Project-OSRM/osrm-backend/issues/2645
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
Scenario: Kurt-Schuhmacher-Damm
Given the node map
"""
g f
| |
j --- h - e
| |
a --- b - c
i d
"""
And the ways
| nodes | name | highway | oneway | turn:lanes |
| ab | | motorway_link | yes | left\|none\|right |
| bc | | primary_link | yes | |
| cd | ksd | secondary | yes | |
| cef | ksd | primary | yes | |
| hj | | motorway_link | yes | |
| eh | | secondary_link | yes | |
| gh | ksd | primary | yes | |
| hbi | ksd | secondary | yes | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | ,ksd,ksd | depart,turn left,arrive | ,left:true none:true right:false, |
| a,i | ,ksd,ksd | depart,turn right,arrive | ,left:false none:true right:true, |
@todo @2650 @sliproads
#market and haight in SF, restricted turn
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
Scenario: Market/Haight without Through Street
Given the node map
"""
g j
| |
| |
| |
| |
| |
| |,f
|,e
,d |
a --------- b c |
/ | |
/ | |
/ | |
| | |
| | |
| | |
l h i
"""
And the ways
| nodes | name | highway | oneway | turn:lanes:forward |
| ab | ghough | secondary | yes | |
| bc | ghough | secondary | yes | through\|through |
| bd | ghough | secondary | yes | none\|through |
| def | ghough | secondary | yes | |
| gd | market | primary | yes | |
| dc | market | primary | yes | |
| ch | market | primary | yes | |
| iej | market | primary | yes | |
| bl | haight | residential | yes | left\|none |
And the relations
| type | way:from | way:to | node:via | restriction |
| relation | bd | dc | d | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
@todo @2650 @sliproads
#market and haight in SF, unrestricted
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
Scenario: Market/Haight without Through Street
Given the node map
"""
g j
| |
| |
| |
| |
| |
| |,f
|,e
,d |
a --------- b c |
/ | |
/ | |
/ | |
| | |
| | |
| | |
l h i
"""
And the ways
| nodes | name | highway | oneway | turn:lanes:forward |
| ab | ghough | secondary | yes | |
| bc | ghough | secondary | yes | through\|through |
| bd | ghough | secondary | yes | none\|through |
| def | ghough | secondary | yes | |
| gd | market | primary | yes | |
| dc | market | primary | yes | |
| ch | market | primary | yes | |
| iej | market | primary | yes | |
| bl | haight | residential | yes | left\|none |
When I route I should get
| waypoints | route | turns | lanes |
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
Scenario: Check sliproad handler loop's exit condition, Issue #2896
# http://www.openstreetmap.org/way/198481519
Given the node locations
| node | lat | lon |
| a | 7.6125350 | 126.5708309 |
| b | 7.6125156 | 126.5707219 |
| c | 7.6125363 | 126.5708337 |
And the ways
| nodes | name |
| cbac | |
When I route I should get
| from | to | route | turns |
| a | c | , | depart,arrive |
-854
View File
@@ -1,854 +0,0 @@
@routing @guidance @turn-lanes
Feature: Turn Lane Guidance
Background:
Given the profile "car"
Given a grid size of 20 meters
@anticipate
Scenario: Anticipate Lane Change for subsequent multi-lane intersections
Given the node map
"""
a b x
|
c d z
| |
y e
"""
And the ways
| nodes | turn:lanes:forward |
| ab | through\|right\|right\|right |
| bx | |
| bc | left\|left\|through |
| cd | through\|right |
| cy | |
| dz | |
| de | |
When I route I should get
| waypoints | route | turns | lanes | # |
| a,d | ab,bc,cd,cd | depart,turn right,turn left,arrive | ,straight:false right:true right:true right:false,left:true left:true straight:false, | 2 hops |
| a,e | ab,bc,cd,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:false right:true right:false,left:false left:true straight:false,straight:false right:true, | 3 hops |
@anticipate
Scenario: Anticipate Lane Change for quick same direction turns, staying on the same street
Given the node map
"""
a b x
|
c
|
e d y
"""
And the ways
| nodes | turn:lanes:forward | turn:lanes:backward | name |
| ab | through\|right\|right | | MySt |
| bx | | | XSt |
| bc | | left\|right | MySt |
| cd | left\|right | through\|through | MySt |
| de | | left\|left\|through | MySt |
| dy | | | YSt |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false right:false right:true,left:false right:true, |
| e,a | MySt,MySt,MySt,MySt | depart,continue left,turn left,arrive | ,left:true left:false straight:false,left:true right:false, |
@anticipate
Scenario: Anticipate Lane Change for quick same direction turns, changing between streets
Given the node map
"""
a b x
|
c
|
e d y
"""
And the ways
| nodes | turn:lanes:forward | turn:lanes:backward | name |
| ab | through\|right\|right | | AXSt |
| bx | | | AXSt |
| bc | | left\|right | BDSt |
| cd | left\|right | through\|through | BDSt |
| de | | left\|left\|through | EYSt |
| dy | | | EYSt |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | AXSt,BDSt,EYSt,EYSt | depart,turn right,turn right,arrive | ,straight:false right:false right:true,left:false right:true, |
| e,a | EYSt,BDSt,AXSt,AXSt | depart,turn left,turn left,arrive | ,left:true left:false straight:false,left:true right:false, |
@anticipate
Scenario: Anticipate Lane Change for quick turns during a merge
Given the node map
"""
a
\
x b c y
|
d
"""
And the ways
| nodes | turn:lanes:forward | name | highway | oneway |
| ab | slight_left\|slight_left | On | motorway_link | yes |
| xb | | Hwy | motorway | |
| bc | through\|slight_right | Hwy | motorway | |
| cd | | Off | motorway_link | yes |
| cy | | Hwy | motorway | |
When I route I should get
| waypoints | route | turns | lanes |
| a,d | On,Hwy,Off,Off | depart,merge slight right,off ramp right,arrive | ,slight left:false slight left:true,straight:false slight right:true, |
@anticipate
Scenario: Schoenefelder Kreuz
# https://www.openstreetmap.org/way/264306388#map=16/52.3202/13.5568
Given the node map
"""
a b x
\ / i
c d
\ j
"""
And the ways
| nodes | turn:lanes:forward | lanes | highway | oneway | name |
| ab | none\|none\|none\|slight_right\|slight_right | 5 | motorway | | abx |
| bx | | 3 | motorway | | abx |
| bc | | 2 | motorway_link | yes | bcd |
| cd | slight_left\|slight_left;slight_right\|slight_right | 3 | motorway_link | yes | bcd |
| di | slight_left\|slight_right | 2 | motorway_link | yes | di |
| dj | | 2 | motorway_link | yes | dj |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | abx,bcd,di,di | depart,off ramp right,fork slight left,arrive | ,none:false none:false none:false slight right:true slight right:true,slight left:true slight left;slight right:true slight right:false, |
| a,j | abx,bcd,dj,dj | depart,off ramp right,fork slight right,arrive | ,none:false none:false none:false slight right:true slight right:true,slight left:false slight left;slight right:true slight right:true, |
@anticipate
Scenario: Kreuz Oranienburg
# https://www.openstreetmap.org/way/4484007#map=18/52.70439/13.20269
Given the node map
"""
i a
' . . '
j c b x
"""
And the ways
| nodes | turn:lanes:forward | lanes | highway | oneway | name |
| ab | | 1 | motorway_link | yes | ab |
| xb | | 1 | motorway_link | yes | xbcj |
| bc | none\|slight_right | 2 | motorway_link | yes | xbcj |
| ci | | 1 | motorway_link | yes | ci |
| cj | | 1 | motorway_link | yes | xbcj |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | ab,ci,ci | depart,turn slight right,arrive | ,none:false slight right:true, |
| a,j | ab,xbcj | depart,arrive | , |
@anticipate
Scenario: Lane anticipation for fan-in
Given the node map
"""
a b x
|
c d z
| |
y e
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | through\|right\|right\|right | abx |
| bx | | abx |
| bc | left\|left\|through | bcy |
| cy | | bcy |
| cd | through\|right | cdz |
| dz | | cdz |
| de | | de |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:false right:true right:false,left:false left:true straight:false,straight:false right:true, |
@anticipate
Scenario: Lane anticipation for fan-out
Given the node map
"""
a b x
|
c d z
| |
y e
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | through\|right | abx |
| bx | | abx |
| bc | left\|left\|through | bcy |
| cy | | bcy |
| cd | through\|right\|right\|right | cdz |
| dz | | cdz |
| de | | de |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:true,left:true left:true straight:false,straight:false right:true right:true right:true, |
@anticipate
Scenario: Lane anticipation for fan-in followed by fan-out
Given the node map
"""
a b x
|
c d z
| |
y e
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | through\|right\|right\|right | abx |
| bx | | abx |
| bc | left\|left\|through | bcy |
| cy | | bcy |
| cd | through\|right\|right\|right | cdz |
| dz | | cdz |
| de | | de |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:true right:true right:false,left:true left:true straight:false,straight:false right:true right:true right:true, |
@anticipate
Scenario: Lane anticipation for fan-out followed by fan-in
Given the node map
"""
a b x
|
c d z
| |
y e
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | through\|right | abx |
| bx | | abx |
| bc | left\|left\|through | bcy |
| cy | | bcy |
| cd | through\|right | cdz |
| dz | | cdz |
| de | | de |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | abx,bcy,cdz,de,de | depart,turn right,turn left,turn right,arrive | ,straight:false right:true,left:false left:true straight:false,straight:false right:true, |
@anticipate
Scenario: Lane anticipation for multiple hops with same number of lanes
Given the node map
"""
a b x
|
c d z
| |
y e f
|
w
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | through\|right\|right\|right | abx |
| bx | | abx |
| bc | left\|left\|through | bcy |
| cy | | bcy |
| cd | through\|right\|right | cdz |
| dz | | cdz |
| de | left\|through | dew |
| ew | | dew |
| ef | | ef |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | abx,bcy,cdz,dew,ef,ef | depart,turn right,turn left,turn right,turn left,arrive | ,straight:false right:true right:false right:false,left:true left:false straight:false,straight:false right:true right:false,left:true straight:false, |
@anticipate
Scenario: Anticipate Lanes for through, through with lanes
Given the node map
"""
f g
/ /
a b c d e
\ \
h i
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | | main |
| bc | left\|through\|through\|through\|right | main |
| cd | left\|through\|right | main |
| de | | main |
| cf | | off |
| ch | | off |
| dg | | off |
| di | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | main,main,main | depart,use lane straight,arrive | ,left:false straight:false straight:true straight:false right:false, |
@anticipate
Scenario: Anticipate Lanes for through and collapse multiple use lanes
Given the node map
"""
e f g
/ / /
a b c d
\ \ \
h i j
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | left\|through\|through\|right | main |
| bc | left\|through\|through\|right | main |
| cd | left\|through\|through\|through\|right | main |
| be | | off |
| bh | | off |
| cf | | off |
| ci | | off |
| dg | | off |
| dj | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,c | main,main | depart,arrive | , |
| a,d | main,main | depart,arrive | , |
@anticipate
Scenario: Anticipate Lanes for through followed by left/right
Given the node map
"""
f g d
/ / /
a b c x
\ \ \
h i e
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | left\|through\|through\|through\|through\|right | main |
| bc | left\|through\|through\|right | main |
| cx | left\|right | main |
| xd | | left |
| xe | | right |
| bf | | off |
| bh | | off |
| cg | | off |
| ci | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,d | main,main,main,left,left | depart,use lane straight,use lane straight,turn left,arrive | ,left:false straight:false straight:true straight:false straight:false right:false,left:false straight:true straight:false right:false,left:true right:false, |
| a,e | main,main,main,right,right | depart,use lane straight,use lane straight,turn right,arrive | ,left:false straight:false straight:false straight:true straight:false right:false,left:false straight:false straight:true right:false,left:false right:true, |
@anticipate
Scenario: Anticipate Lanes for through with turn before / after
Given the node map
"""
c g l
b d e h - i
a f j
"""
And the ways
| nodes | turn:lanes:forward | name | oneway |
| ab | right\|right\|right\|right | ab | yes |
| cb | left\|left\|left\|left | cb | yes |
| bd | | bdehi | |
| de | left\|left\|through\|through\|through\|through\|right\|right | bdehi | |
| ef | | ef | |
| eg | | eg | |
| eh | | bdehi | |
| hi | left\|left\|right\|right | bdehi | |
| ij | | ij | |
| il | | il | |
When I route I should get
| waypoints | route | turns | lanes | # |
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| a,j | ab,bdehi,bdehi,ij,ij | depart,turn right,use lane straight,turn right,arrive | ,right:true right:true right:false right:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
| a,l | ab,bdehi,bdehi,il,il | depart,turn right,use lane straight,turn left,arrive | ,right:false right:false right:true right:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| c,l | cb,bdehi,bdehi,il,il | depart,turn left,use lane straight,turn left,arrive | ,left:false left:false left:true left:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
| c,j | cb,bdehi,bdehi,ij,ij | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false left:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
@anticipate
Scenario: Anticipate Lanes for turns with through before and after
Given a grid size of 10 meters
Given the node map
"""
a b q s h i
\ / /
e f g
/ \ \
c d r t j k
"""
And the ways
| nodes | turn:lanes:forward | name | highway | oneway |
| ab | through\|right\|right\|right | top | primary | yes |
| be | | top | primary | yes |
| bq | | off | primary | yes |
| ef | left\|through\|through\|through\|through\|right | main | primary | yes |
| fg | left\|left\|right\|right | main | primary | yes |
| fs | | off | primary | yes |
| ft | | off | primary | yes |
| gh | | top | primary | yes |
| hi | | top | primary | yes |
| cd | left\|left\|left\|through | bot | primary | yes |
| de | | bot | primary | yes |
| dr | | off | primary | yes |
| gj | | bot | primary | yes |
| jk | | bot | primary | yes |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | top,main,main,top,top | depart,turn right,use lane straight,turn left,arrive | ,straight:false right:false right:true right:true,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| a,k | top,main,main,bot,bot | depart,turn right,use lane straight,turn right,arrive | ,straight:false right:true right:true right:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
| c,i | bot,main,main,top,top | depart,turn left,use lane straight,turn left,arrive | ,left:false left:true left:true straight:false,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| c,k | bot,main,main,bot,bot | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false straight:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
@anticipate
Scenario: Anticipate Lanes for turn between throughs
Given the node map
"""
q
|
a b c s
| |
r d t
|
e
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | left\|through\|through\|through\|through\|through\|right | main |
| bq | | off |
| br | | off |
| bc | through\|through\|right\|right\|right | main |
| cs | | off |
| cd | left\|through\|through | main |
| de | | main |
| dt | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | main,main,main,main | depart,use lane straight,continue right,arrive | ,left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true, |
@anticipate @todo @2661
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
Given the node map
"""
/e\
a b d f
\c/
|
/g\
k h j l
\i/
"""
And the ways
| nodes | turn:lanes:forward | highway | junction | # |
| ab | slight_right\|slight_right\|slight_right | primary | | |
| bc | slight_left\|slight_right\|slight_right | primary | roundabout | top |
| cd | | primary | roundabout | top |
| de | | primary | roundabout | top |
| eb | | primary | roundabout | top |
| df | | primary | | |
| cg | slight_right\|slight_right | primary | | |
| gh | slight_left\|slight_right | primary | roundabout | bot |
| hi | | primary | roundabout | bot |
| ij | slight_left\|slight_right | primary | roundabout | bot |
| jg | | primary | roundabout | bot |
| hk | | primary | | |
| jl | | primary | | |
When I route I should get
| # | waypoints | route | turns | lanes |
| right-right | a,k | ab,cg,hk,hk | depart,roundabout-exit-1,roundabout-exit-1,arrive | ,slight right:false slight right:false slight right:true,slight right:false slight right:true, |
| right-left | a,l | ab,cg,jl,jl | depart,roundabout-exit-1,roundabout-exit-2,arrive | ,slight right:false slight right:false slight right:true,slight right:false slight right:true, |
| todo exits | a,f | ab,df,df | depart,roundabout-exit-2,arrive | ,slight right:false slight right:false slight right:true, |
| todo exits | a,e | ab,bc,eb | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true slight right:true, |
@anticipate @todo
Scenario: Roundabout with lanes only tagged on exit
Given the node map
"""
/e\
a b d f
\c/
"""
And the ways
| nodes | turn:lanes:forward | highway | junction |
| ab | | primary | |
| bc | | primary | roundabout |
| cd | slight_left\|slight_left\|slight_right | primary | roundabout |
| de | | primary | roundabout |
| eb | | primary | roundabout |
| df | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
Given the node map
"""
a
|
/b\
c g h
/| |
| d f
|/ \e/ \
x \ y
"""
And the ways
| nodes | turn:lanes:forward | highway | junction |
| ab | slight_right\|slight_right | primary | |
| bc | | primary | roundabout |
| cd | | primary | roundabout |
| de | | primary | roundabout |
| ef | | primary | roundabout |
| fg | through\|slight_right | primary | roundabout |
| gb | | primary | roundabout |
| gh | | primary | |
| cx | | primary | |
| dx | | primary | |
| ey | | primary | |
| fy | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
Given the node map
"""
/a\
x b d y
\c/
"""
And the ways
| nodes | turn:lanes:forward | highway | junction | name |
| xb | slight_right\|slight_right | primary | | xb |
| dy | | primary | | dy |
| ab | | primary | roundabout | roundabout |
| bc | | primary | roundabout | roundabout |
| cd | left\|slight_right | primary | roundabout | roundabout |
| da | | primary | roundabout | roundabout |
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
Given the profile file "car" extended with
"""
properties.left_hand_driving = true
"""
And the node map
"""
a
|
/b\
h c g
| |\
d f |
/ \e/ \|
x / y
"""
And the ways
| nodes | turn:lanes:forward | highway | junction |
| ab | slight_left\|slight_left | primary | |
| bg | | primary | roundabout |
| gf | | primary | roundabout |
| fe | | primary | roundabout |
| ed | | primary | roundabout |
| dc | slight_left | primary | roundabout |
| cb | | primary | roundabout |
| ch | | primary | |
| ex | | primary | |
| dx | | primary | |
| gy | | primary | |
| fy | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ab,ch,ch | depart,roundabout-exit-5,arrive | ,, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
Given the node map
"""
/a\
x b d y
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
|
|
|
|
|
|
|
|
c
"""
And the ways
| nodes | turn:lanes:forward | highway | junction | name |
| xb | slight_right\|slight_right | primary | | xb |
| dy | | primary | | dy |
| ab | | primary | roundabout | roundabout |
| bc | | primary | roundabout | roundabout |
| cd | left\|slight_right | primary | roundabout | roundabout |
| da | | primary | roundabout | roundabout |
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
@anticipate @todo @2032
Scenario: No Lanes for Roundabouts, see #2626
Given the node map
"""
a b x
|
/c\
d f g z
\e/ |
| h
y
"""
And the ways
| nodes | turn:lanes:forward | highway | junction | name |
| ab | through\|right\|right\|right\|right | primary | | abx |
| bx | | primary | | abx |
| bc | right\|right\|right\|right | primary | | bc |
| cd | | primary | roundabout | cdefc |
| de | slight_left\|slight_left\|slight_left\|slight_right | primary | roundabout | cdefc |
| ef | left\|slight_right\|slight_right | primary | roundabout | cdefc |
| fc | | primary | roundabout | cdefc |
| ey | | primary | | ey |
| fg | through\|right | primary | | fg |
| gz | | primary | | gz |
| gh | | primary | | gh |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | abx,bc,fg,gh,gh | depart,turn right,cdefc-exit-2,turn right,arrive | ,straight:false right:false right:false right:false right:true,,straight:false right:true, |
@anticipate
Scenario: Anticipate none tags
Given the node map
"""
c g l
b d e h - i
a f j
"""
And the ways
| nodes | turn:lanes:forward | highway | name |
| ab | none\|none\|right\|right | primary | abc |
| bc | | primary | abc |
| bd | | primary | bdeh |
| de | left\|none\|none\|right | primary | bdeh |
| eh | | primary | bdeh |
| ef | | primary | feg |
| eg | | primary | feg |
When I route I should get
| waypoints | route | turns | lanes |
| a,g | abc,bdeh,feg,feg | depart,turn right,turn left,arrive | ,none:false none:false right:true right:false,left:true none:false none:false right:false, |
| a,f | abc,bdeh,feg,feg | depart,turn right,turn right,arrive | ,none:false none:false right:false right:true,left:false none:false none:false right:true, |
@anticipate
Scenario: Triple Right keeping Left
Given the node map
"""
a b i
|
f e g |
| |
| |
j d c
|
h
"""
And the ways
| nodes | turn:lanes:forward | highway | name |
| abi | \|\|right\|right | primary | start |
| bch | \|\|right\|right | primary | first |
| cdj | \|\|right\|right | primary | second |
| de | left\|right\|right | secondary | third |
| feg | | tertiary | fourth |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,turn left,arrive | ,none:false none:false right:true right:false,none:false none:false right:true right:false,none:false none:false right:true right:false,left:true right:false right:false, |
| a,g | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,turn right,arrive | ,none:false none:false right:true right:true,none:false none:false right:true right:true,none:false none:false right:true right:true,left:false right:true right:true, |
@anticipate
Scenario: Tripple Left keeping Right
Given the node map
"""
i b a
|
| g e f
| |
| |
c d j
|
h
"""
And the ways
| nodes | turn:lanes:forward | highway | name |
| abi | left\|left\|\| | primary | start |
| bch | left\|left\|\| | primary | first |
| cdj | left\|left\|\| | primary | second |
| de | left\|left\|right | secondary | third |
| feg | | tertiary | fourth |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn right,arrive | ,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:false right:true, |
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
@anticipate
Scenario: Complex lane scenarios scale threshold for triggering Lane Anticipation
Given the node map
"""
a b x
|
|
|
|
|
|
|
|
|
|
c
|
e d y
"""
# With a grid size of 20m the duration is ~20s but our default threshold for Lane Anticipation is 15s.
# The additional lanes left and right of the turn scale the threshold up so that Lane Anticipation still triggers.
And the ways
| nodes | turn:lanes:forward | name |
| ab | through\|through\|right\|right | MySt |
| bx | | XSt |
| bc | | MySt |
| cd | left\|right | MySt |
| de | | MySt |
| dy | | YSt |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
@anticipate
Scenario: Don't Overdo It
Given the node map
"""
q r s t u v
| | | | | |
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
| | | | | | |
p o n m l k j
"""
And the ways
| nodes | name | turn:lanes:forward | oneway |
| ab | road | left\|\|\| | yes |
| bc | road | left\|\|\| | yes |
| cd | road | left\|\|\| | yes |
| de | road | left\|\|\| | yes |
| ef | road | left\|\|\| | yes |
| fg | road | left\|\|\| | yes |
| gh | road | \|\|right | yes |
| hi | road | | yes |
| qbp | 1st | | no |
| rco | 2nd | | no |
| sdn | 3rd | | no |
| tem | 4th | | no |
| ufl | 5th | | no |
| vgk | 6th | | no |
| hj | 7th | | no |
When I route I should get
| waypoints | route | turns | locations | lanes |
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
@@ -1,33 +0,0 @@
@routing @bicycle @mode
Feature: Bike - Mode flag
Background:
Given the profile "bicycle"
Given a grid size of 5 meters
Scenario: Bike Sliproad
Given the node map
"""
i
a b - c-d
` |
g-e-h
|
|
f
"""
And the nodes
| node | highway |
| c | traffic_signals |
And the ways
| nodes | highway | name | oneway:bicycle |
| abcd | cycleway | street | |
| eb | path | | yes |
| icef | tertiary | road | |
| geh | secondary | street | |
When I route I should get
| waypoints | route | turns |
| a,f | street,,road,road | depart,turn right,turn right,arrive |
@@ -1,139 +0,0 @@
@routing @guidance @staggered-intersections
Feature: Staggered Intersections
Background:
Given the profile "bicycle"
Given a grid size of 1 meters
# Note the one meter grid size: staggered intersections make zig-zags of a couple of meters only
Scenario: Staggered Intersection - pushing in the middle
Given the node map
"""
j
a b c
d
e f g
h
i
"""
And the ways
| nodes | highway | name | oneway |
| abc | residential | Oak St | |
| efg | residential | Oak St | |
| ihedcj | residential | Cedar Dr | yes |
When I route I should get
| waypoints | route | turns | modes |
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | cycling,pushing bike,cycling,cycling |
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
Scenario: Staggered Intersection - pushing at start
Given the node map
"""
j
a b c
d
e f g
h
i
"""
And the ways
| nodes | highway | name | oneway |
| cba | residential | Oak St | yes |
| efg | residential | Oak St | |
| ihedcj | residential | Cedar Dr | |
When I route I should get
| waypoints | route | turns | modes |
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,cycling,cycling |
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
Scenario: Staggered Intersection - pushing at end
Given the node map
"""
j
a b c
d
e f g
h
i
"""
And the ways
| nodes | highway | name | oneway |
| abc | residential | Oak St | |
| gfe | residential | Oak St | yes |
| ihedcj | residential | Cedar Dr | |
When I route I should get
| waypoints | route | turns | modes |
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | cycling,cycling,pushing bike,pushing bike |
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
Scenario: Staggered Intersection - pushing at start and end
Given the node map
"""
j
a b c
d
e f g
h
i
"""
And the ways
| nodes | highway | name | oneway |
| cba | residential | Oak St | yes |
| gfe | residential | Oak St | yes |
| ihedcj | residential | Cedar Dr | |
When I route I should get
| waypoints | route | turns | modes |
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
Scenario: Staggered Intersection - pushing at start and end
Given the node map
"""
j
a b c
d
e f g
h
i
"""
And the ways
| nodes | highway | name |
| cba | pedestrian | Oak St |
| gfe | pedestrian | Oak St |
| ihedcj | residential | Cedar Dr |
When I route I should get
| waypoints | route | turns | modes |
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | pushing bike,cycling,pushing bike,pushing bike |
Scenario: Staggered Intersection - control, all cycling on staggered intersection
Given the node map
"""
j
a b c
d
e f g
h
i
"""
And the ways
| nodes | highway | name |
| cba | residential | Oak St |
| gfe | residential | Oak St |
| ihedcj | residential | Cedar Dr |
When I route I should get
| waypoints | route | turns | modes |
| a,g | Oak St,Oak St | depart,arrive | cycling,cycling |
| g,a | Oak St,Oak St | depart,arrive | cycling,cycling |
+34 -46
View File
@@ -6,9 +6,7 @@ Feature: Car - Guidance - Bridges and Tunnels
Scenario: Simple Bridge Scenario: Simple Bridge
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | bridge | name | | nodes | highway | bridge | name |
@@ -22,11 +20,9 @@ Feature: Car - Guidance - Bridges and Tunnels
Scenario: Bridge with Immediate Turn Scenario: Bridge with Immediate Turn
Given the node map Given the node map
""" | | | | d |
d | a | | b | c |
a b c | | | | e |
e
"""
And the ways And the ways
| nodes | highway | bridge | name | | nodes | highway | bridge | name |
@@ -36,18 +32,16 @@ Feature: Car - Guidance - Bridges and Tunnels
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,arrive | | a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road left,arrive |
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,arrive | | a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road right,arrive |
| e | a | Nebenstraße,Hauptstraßenbrücke,Hauptstraße | depart,turn left,arrive | | e | a | Nebenstraße,Hauptstraßenbrücke,Hauptstraße | depart,turn left,arrive |
| d | a | Nebenstraße,Hauptstraßenbrücke,Hauptstraße | depart,turn right,arrive | | d | a | Nebenstraße,Hauptstraßenbrücke,Hauptstraße | depart,turn right,arrive |
Scenario: Bridge with Immediate Turn Front and Back Scenario: Bridge with Immediate Turn Front and Back
Given the node map Given the node map
""" | f | | | d |
f d | a | | b | c |
a b c | g | | | e |
g e
"""
And the ways And the ways
| nodes | highway | bridge | name | | nodes | highway | bridge | name |
@@ -58,20 +52,18 @@ Feature: Car - Guidance - Bridges and Tunnels
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| f | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,turn left,arrive | | f | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,end of road left,arrive |
| f | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,turn right,arrive | | f | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,end of road right,arrive |
| g | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,turn left,arrive | | g | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,end of road left,arrive |
| g | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,turn right,arrive | | g | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,end of road right,arrive |
| e | f | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn left,turn right,arrive | | e | f | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn left,end of road right,arrive |
| e | g | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn left,turn left,arrive | | e | g | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn left,end of road left,arrive |
| d | f | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn right,turn right,arrive | | d | f | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn right,end of road right,arrive |
| d | g | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn right,turn left,arrive | | d | g | Nebenstraße,Hauptstraßenbrücke,Anderestraße,Anderestraße | depart,turn right,end of road left,arrive |
Scenario: Simple Tunnel Scenario: Simple Tunnel
Given the node map Given the node map
""" | a | b | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | tunnel | name | | nodes | highway | tunnel | name |
@@ -85,11 +77,9 @@ Feature: Car - Guidance - Bridges and Tunnels
Scenario: Tunnel with Immediate Turn Scenario: Tunnel with Immediate Turn
Given the node map Given the node map
""" | | | | d |
d | a | | b | c |
a b c | | | | e |
e
"""
And the ways And the ways
| nodes | highway | tunnel | name | | nodes | highway | tunnel | name |
@@ -99,18 +89,16 @@ Feature: Car - Guidance - Bridges and Tunnels
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,arrive | | a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road left,arrive |
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,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 | | e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive | | d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
Scenario: Tunnel with Immediate Turn Front and Back Scenario: Tunnel with Immediate Turn Front and Back
Given the node map Given the node map
""" | f | | | d |
f d | a | | b | c |
a b c | g | | | e |
g e
"""
And the ways And the ways
| nodes | highway | bridge | name | | nodes | highway | bridge | name |
@@ -121,12 +109,12 @@ Feature: Car - Guidance - Bridges and Tunnels
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| f | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,turn left,arrive | | f | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,end of road left,arrive |
| f | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,turn right,arrive | | f | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,end of road right,arrive |
| g | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,turn left,arrive | | g | d | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,end of road left,arrive |
| g | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,turn right,arrive | | g | e | Anderestraße,Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,end of road right,arrive |
| e | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn right,arrive | | e | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,end of road right,arrive |
| e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn left,arrive | | e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,end of road left,arrive |
| d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn right,arrive | | d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,end of road right,arrive |
| d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn left,arrive | | d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,end of road left,arrive |
-69
View File
@@ -1,69 +0,0 @@
@routing @guidance
Feature: Features related to bugs
Background:
Given the profile "car"
Given a grid size of 5 meters
@2852
Scenario: Loop
Given the node map
"""
a 1 g b
e f
2
d h c
"""
And the ways
| nodes | name | oneway |
| agb | top | yes |
| bfc | right | yes |
| chd | bottom | yes |
| dea | left | yes |
And the nodes
| node | highway |
| g | traffic_signals |
| f | traffic_signals |
| h | traffic_signals |
| e | traffic_signals |
When I route I should get
| waypoints | route | turns |
| 1,2 | top,right,right | depart,new name right,arrive |
@3156
Scenario: Incorrect lanes tag
Given the node map
"""
a b
"""
And the ways
| nodes | lanes |
| ab | 1; 2 |
And the data has been saved to disk
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
Then it should exit successfully
@3418
Scenario: Bearings should be between 0-359
Given the node locations
| node | lon | lat |
| a | -122.0232176 | 37.3282203 |
| b | -122.0232199 | 37.3302422 |
| c | -122.0232252 | 37.3312787 |
And the ways
| nodes | name | highway |
| ab | Pear to Merrit | residential |
| bc | Merritt to Apricot | residential |
When I route I should get
| waypoints | route | intersections |
| a,c | Pear to Merrit,Merritt to Apricot,Merritt to Apricot | true:0;true:0 false:180;true:180 |
-282
View File
@@ -1,282 +0,0 @@
@routing @guidance
Feature: Rotary
Background:
Given the profile "car"
Given a grid size of 30 meters
Scenario: Enter and Exit
Given the node map
"""
a
b
h g c d
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bgecb | circular |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
Scenario: Only Enter
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
Scenario: Only Exit
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| b,c | bcegb,bcegb | depart,arrive |
| b,e | bcegb,bcegb | depart,arrive |
| b,g | bcegb,bcegb | depart,arrive |
| c,e | bcegb,bcegb | depart,arrive |
| c,g | bcegb,bcegb | depart,arrive |
| c,b | bcegb,bcegb | depart,arrive |
| e,g | bcegb,bcegb | depart,arrive |
| e,b | bcegb,bcegb | depart,arrive |
| e,c | bcegb,bcegb | depart,arrive |
| g,b | bcegb,bcegb | depart,arrive |
| g,c | bcegb,bcegb | depart,arrive |
| g,e | bcegb,bcegb | depart,arrive |
#needs to be adjusted when name-discovery works for entrys
Scenario: Mixed Entry and Exit
Given the node map
"""
c a
j b f
k e
l h d
g i
"""
And the ways
| nodes | junction | oneway |
| abc | | yes |
| def | | yes |
| ghi | | yes |
| jkl | | yes |
| bkheb | circular | yes |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
| d,f | def,def,def | depart,rotary-exit-1,arrive |
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
b
c d f
e
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
d
b c f
e
"""
And the ways
| nodes | junction |
| ad | |
| bcdb | circular |
| be | |
| cf | |
When I route I should get
| waypoints | route | turns |
| a,e | ad,be,be | depart,bcdb-exit-1,arrive |
| a,f | ad,cf,cf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
c
d b f
e
"""
And the ways
| nodes | junction |
| ac | |
| bcdb | circular |
| de | |
| bf | |
When I route I should get
| waypoints | route | turns |
| a,e | ac,de,de | depart,bcdb-exit-1,arrive |
| a,f | ac,bf,bf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
f
d c e
b
a
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
f
d c e
b
a
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
-92
View File
@@ -1,92 +0,0 @@
@routing @guidance @collapsing
Feature: Collapse
Background:
Given the profile "car"
Given a grid size of 5 meters
@reverse
Scenario: Collapse U-Turn Triangle Intersection
Given the node map
"""
g f e d
a b c
"""
And the ways
| nodes | highway | name | oneway |
| abc | primary | road | yes |
| defg | primary | road | yes |
| fb | primary_link | | yes |
| be | primary_link | | yes |
When I route I should get
| waypoints | route | turns |
| a,g | road,road,road | depart,continue uturn,arrive |
| d,c | road,road,road | depart,continue uturn,arrive |
@reverse @traffic-signals
Scenario: Collapse U-Turn Triangle Intersection
Given the node map
"""
g f j e d
h i
a b c
"""
And the ways
| nodes | highway | name | oneway |
| abc | primary | road | yes |
| dejfg | primary | road | yes |
| fhb | primary_link | | |
| bie | primary_link | | |
And the nodes
| node | highway |
| j | traffic_signals |
| h | traffic_signals |
| i | traffic_signals |
When I route I should get
| waypoints | route | turns |
| a,g | road,road,road | depart,continue uturn,arrive |
| d,c | road,road,road | depart,continue uturn,arrive |
Scenario: Forking before a turn (forky)
Given the node map
"""
g
.
c
a . . b .'
`d.
f e
"""
# note: check clooapse.feature for a similar test case where we do not
# classify the situation as Sliproad and therefore keep the fork inst.
And the ways
| nodes | name | oneway | highway |
| ab | road | yes | primary |
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road,road | depart,continue right,arrive |
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
-162
View File
@@ -1,162 +0,0 @@
@routing @guidance @collapsing
Feature: Collapse
Background:
Given the profile "car"
Given a grid size of 20 meters
Scenario: Collapse Steps While On Ferry
Given the node map
"""
j----a---c---b----k
~ ~ ~
~ ~ ~
~~~
d
~
~
~
e --- f
"""
And the ways
| nodes | highway | route | name |
| jacbk | primary | | land |
| ad | | ferry | sea |
| bd | | ferry | sea |
| cd | | ferry | sea |
| de | | ferry | sea |
| ef | primary | | pennydog-island |
When I route I should get
| waypoints | route | turns | modes | locations |
| f,j | pennydog-island,sea,land,land | depart,notification right,turn left,arrive | driving,ferry,driving,driving | f,e,b,j |
Scenario: Switching Ferry in a Harbour
Given the node map
"""
d
|
|
|
e - a ~ ~ ~ ~ b
~
~
~
c
|
f
"""
And the ways
| nodes | highway | route | name |
| ea | primary | | melee-island |
| ab | | ferry | melee-island-ferry |
| cf | primary | | monkey-island |
| bd | primary | | scabb-island |
| bc | primary | ferry | monkey-island-ferry |
When I route I should get
| waypoints | route | turns | modes |
| e,f | melee-island,melee-island-ferry,monkey-island-ferry,monkey-island,monkey-island | depart,notification straight,turn right,notification straight,arrive | driving,ferry,ferry,driving,driving |
Scenario: End of Road Ferries
Given the node map
"""
a - b ~ ~ ~ ~ c ~ ~ ~ ~ ~ d - e
~
~
~
~
~
~
~
f
|
g
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | land-left |
| de | primary | | land-right |
| gf | primary | | land-bottom |
| bcd | | ferry | ferry |
| fc | | ferry | ferry |
When I route I should get
| waypoints | route | turns |
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification straight,arrive |
Scenario: Fork Ferries
Given the node map
"""
a - b d - e
~ ~
~ ~
~ ~
~ ~
c
~
~
~
f
|
g
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | land-left |
| de | primary | | land-right |
| gf | primary | | land-bottom |
| cb | | ferry | ferry |
| cd | | ferry | ferry |
| fc | | ferry | ferry |
When I route I should get
| waypoints | route | turns |
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification right,arrive |
@negative
Scenario: Don't Detect Suppressed/Obvious Forks on Ferries
Given the node map
"""
. . . . . . . . .d
a - b ~ ~ ~ ~ ~ c <
' ' ' ' ' ' ' ' 'e
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | cursed-island |
| bc | | ferry | beagle |
| cd | service | | forker |
| ce | primary | | screw-me-not |
#the turns here could be better, but intersection classification shows you if you go left or right. But we cannot fork here
When I route I should get
| waypoints | route | turns |
| a,d | cursed-island,beagle,forker,forker | depart,notification straight,turn straight,arrive |
| a,e | cursed-island,beagle,screw-me-not,screw-me-not | depart,notification straight,turn straight,arrive |
@uturn @dead-end @ferry @via
Scenario: U-Turn on a dead-end ferry
Given the node map
"""
a - 1 - b ~ ~ ~ ~ ~ ~ ~ c
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | land |
| bc | | ferry | sea |
# we actually cannot check the route here, since two possible routes are equally valid:
# (ab)(bcb1) and (abcb)(b1) are exactly the same. Luckily, we only want to check for
# not asserting here.
When I route I should get
| waypoints |
| a,b,1 |
+156 -562
View File
@@ -7,14 +7,12 @@ Feature: Collapse
Scenario: Segregated Intersection, Cross Belonging to Single Street Scenario: Segregated Intersection, Cross Belonging to Single Street
Given the node map Given the node map
""" | | | i | l | | |
i l | | | | | | |
| d | | c | b | | a |
d c b a | e | | f | g | | h |
e f g h | | | | | | |
| | | j | k | | |
j k
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -52,14 +50,12 @@ Feature: Collapse
Scenario: Segregated Intersection, Cross Belonging to Correct Street Scenario: Segregated Intersection, Cross Belonging to Correct Street
Given the node map Given the node map
""" | | | i | l | | |
i l | | | | | | |
| d | | c | b | | a |
d c b a | e | | f | g | | h |
e f g h | | | | | | |
| | | j | k | | |
j k
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -97,14 +93,12 @@ Feature: Collapse
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets Scenario: Segregated Intersection, Cross Belonging to Mixed Streets
Given the node map Given the node map
""" | | | i | l | | |
i l | | | | | | |
| d | | c | b | | a |
d c b a | e | | f | g | | h |
e f g h | | | | | | |
| | | j | k | | |
j k
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -142,34 +136,24 @@ Feature: Collapse
Scenario: Partly Segregated Intersection, Two Segregated Roads Scenario: Partly Segregated Intersection, Two Segregated Roads
Given the node map Given the node map
""" | | g | | h | |
n m | | | | | |
| | | | | | | |
| | | c | | b | | a |
| | | d | | e | | f |
| | | | | | | |
| | | | | | | |
g h | | j | | i | |
c - b - a
d - e - f
j i
| |
| |
| |
| |
| |
k l
"""
And the ways And the ways
| nodes | highway | name | oneway | lanes | | nodes | highway | name | oneway |
| ab | primary | first | yes | | | ab | primary | first | yes |
| bc | primary | first | yes | | | bc | primary | first | yes |
| de | primary | first | yes | | | de | primary | first | yes |
| ef | primary | first | yes | | | ef | primary | first | yes |
| be | primary | first | no | | | be | primary | first | no |
| ngbhm | primary | second | yes | 5 | | gbh | primary | second | yes |
| liejk | primary | second | yes | 5 | | iej | primary | second | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
@@ -192,38 +176,24 @@ Feature: Collapse
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
Given the node map Given the node map
""" | | g | | h | |
n m | | | | | |
| | | | | | | |
| | | c | | b | | a |
| | | d | | e | | f |
| | | | | | | |
| | | | | | | |
| | | | j | | i | |
g h
\ /
c - b - a
d - e - f
/ \
j i
| |
| |
| |
| |
| |
| |
k l
"""
And the ways And the ways
| nodes | highway | name | oneway | lanes | | nodes | highway | name | oneway |
| ab | primary | first | yes | | | ab | primary | first | yes |
| bc | primary | first | yes | | | bc | primary | first | yes |
| de | primary | first | yes | | | de | primary | first | yes |
| ef | primary | first | yes | | | ef | primary | first | yes |
| be | primary | second | no | | | be | primary | second | no |
| ngbhm | primary | second | yes | 5 | | gbh | primary | second | yes |
| liejk | primary | second | yes | 5 | | iej | primary | second | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
@@ -246,14 +216,12 @@ Feature: Collapse
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles
Given the node map Given the node map
""" | | | i | l | | |
i l | | | | | | a |
a | | | c | b | | h |
c b h | d | | f | g | | |
d f g | e | | | | | |
e | | | j | k | | |
j k
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -291,14 +259,12 @@ Feature: Collapse
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2) Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2)
Given the node map Given the node map
""" | | | i | l | | |
i l | | | | | | |
| | | c | b | | |
c b | d | | f | g | | a |
d f g a | e | | | | | h |
e h | | | j | k | | |
j k
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -336,14 +302,12 @@ Feature: Collapse
Scenario: Entering a segregated road Scenario: Entering a segregated road
Given the node map Given the node map
""" | | a | f | | |
a f g | | | | | g |
| | . ' | | b | e | | |
b-e ' | | | | | |
/ / | | | | | |
/ / | c | d | | | |
c d
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -361,21 +325,20 @@ Feature: Collapse
| g,f | second,first,first | depart,turn right,arrive | | g,f | second,first,first | depart,turn right,arrive |
| g,c | second,first,first | depart,end of road left,arrive | | g,c | second,first,first | depart,end of road left,arrive |
Scenario: Do not collapse turning roads Scenario: Do not collapse turning roads
Given the node map Given the node map
""" | | | e | | |
e | | | c | | d |
c d | a | | b | f | |
a b f
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name |
| ab | primary | first | yes | | ab | primary | first |
| bc | primary | first | yes | | bc | primary | first |
| cd | primary | first | yes | | cd | primary | first |
| ce | primary | second | yes | | ce | primary | second |
| bf | primary | third | yes | | bf | primary | third |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
@@ -385,9 +348,7 @@ Feature: Collapse
Scenario: Bridge on unnamed road Scenario: Bridge on unnamed road
Given the node map Given the node map
""" | a | b | | | | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -401,11 +362,9 @@ Feature: Collapse
Scenario: Crossing Bridge into Segregated Turn Scenario: Crossing Bridge into Segregated Turn
Given the node map Given the node map
""" | | | | | | f |
f | i | h | | | g | e |
i h g e | a | b | | | c | d |
a b c d
"""
And the ways And the ways
| nodes | highway | oneway | name | | nodes | highway | oneway | name |
@@ -424,29 +383,17 @@ Feature: Collapse
Scenario: Pankenbruecke Scenario: Pankenbruecke
Given the node map Given the node map
""" | h | | | | | | i | | | | | | |
k j | | | b | c | d | e | f | | | | | | g |
| | | a | | | | | | | | | | | | |
| |
| |
a h
b
c
d
e
f-i
|
|
|
g
"""
And the ways And the ways
| nodes | highway | name | oneway | lanes | | nodes | highway | name | oneway |
| kabhj | primary | inroad | yes | 4 | | abh | primary | inroad | yes |
| bc | primary | inroad | no | | | bc | primary | inroad | no |
| cd | primary | bridge | no | | | cd | primary | bridge | no |
| defg | primary | outroad | no | | | defg | primary | outroad | no |
| fi | primary | cross | no | | | fi | primary | cross | no |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
@@ -455,13 +402,11 @@ Feature: Collapse
Scenario: Close Turns - Don't Collapse Scenario: Close Turns - Don't Collapse
Given the node map Given the node map
""" | | g | d | |
g d | | | | |
| e | b | c | f |
e b c f | | | | |
| | a | h | |
a h
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -479,10 +424,8 @@ Feature: Collapse
Scenario: No Name During Turns Scenario: No Name During Turns
Given the node map Given the node map
""" | a | b | |
a b | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -494,29 +437,10 @@ Feature: Collapse
| waypoints | route | turns | | waypoints | route | turns |
| a,d | road,road | depart,arrive | | a,d | road,road | depart,arrive |
Scenario: No Name During Turns - Ferry
Given the node map
"""
a b
c d
"""
And the ways
| nodes | highway | name | route |
| ab | tertiary | road | |
| bc | tertiary | | ferry |
| cd | tertiary | road | |
When I route I should get
| waypoints | route | turns |
| a,d | road,,road,road | depart,notification right,notification left,arrive |
Scenario: No Name During Turns, Random Oneway Scenario: No Name During Turns, Random Oneway
Given the node map Given the node map
""" | a | b | |
a b | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -530,11 +454,9 @@ Feature: Collapse
Scenario: Pulled Back Turn Scenario: Pulled Back Turn
Given the node map Given the node map
""" | | | d |
d | a | b | c |
a b c | | e | |
e
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -549,10 +471,8 @@ Feature: Collapse
Scenario: No Name During Turns, keep important turns Scenario: No Name During Turns, keep important turns
Given the node map Given the node map
""" | a | b | e |
a b e | | c | d |
c d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -567,51 +487,17 @@ Feature: Collapse
Scenario: Segregated Intersection into Slight Turn Scenario: Segregated Intersection into Slight Turn
Given the node map Given the node map
""" | h | | | | | | |
h | a | | | | | | |
a | | | | | | | |
| | | g | | | | |
g | | | b | f | | | |
b f | | | | c | | | |
c | | | | | | | |
| | | | | | | |
| | | | | | | e |
e | | | | | | | d |
d | | | j | i | | | |
j i
"""
And the ways
| nodes | highway | name | oneway |
| abcd | primary | road | yes |
| efgh | primary | road | yes |
| icf | secondary | in | yes |
| gbj | secondary | out | yes |
When I route I should get
| waypoints | route | turns |
| i,h | in,road,road | depart,turn left,arrive |
| a,d | road,road | depart,arrive |
| a,j | road,out,out | depart,turn slight right,arrive |
Scenario: Segregated Intersection into Very Slight Turn
Given the node map
"""
h
a
g
b
f
c
e
d
j i
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -628,11 +514,9 @@ Feature: Collapse
Scenario: Don't collapse everything to u-turn / too wide Scenario: Don't collapse everything to u-turn / too wide
Given the node map Given the node map
""" | a | | b | | e |
a b e | | | | | |
| d | | c | | f |
d c f
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -642,19 +526,17 @@ Feature: Collapse
When I route I should get When I route I should get
| waypoints | turns | route | | waypoints | turns | route |
| a,d | depart,continue right,turn right,arrive | road,road,road,road | | a,d | depart,continue right,end of road right,arrive | road,road,road,road |
| d,a | depart,continue left,turn left,arrive | road,road,road,road | | d,a | depart,continue left,end of road left,arrive | road,road,road,road |
Scenario: Forking before a turn Scenario: Forking before a turn
Given the node map Given the node map
""" | | | | g | |
g | | | | | |
| | | | c | |
c | a | | b | d | e |
a b d e | | | | | |
| | | | f | |
f
"""
And the ways And the ways
| nodes | name | oneway | highway | | nodes | name | oneway | highway |
@@ -662,14 +544,12 @@ Feature: Collapse
| bd | road | yes | primary | | bd | road | yes | primary |
| bc | road | yes | primary | | bc | road | yes | primary |
| de | road | yes | primary | | de | road | yes | primary |
| fd | cross | no | secondary | | fdcg | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn | | restriction | bd | fdcg | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn | | restriction | bc | fdcg | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
@@ -678,14 +558,12 @@ Feature: Collapse
Scenario: Forking before a turn (narrow) Scenario: Forking before a turn (narrow)
Given the node map Given the node map
""" | | | | g | |
g | | | | | |
| | | | c | |
c | a | b | | d | e |
a b d e | | | | | |
| | | | f | |
f
"""
And the ways And the ways
| nodes | name | oneway | highway | | nodes | name | oneway | highway |
@@ -693,14 +571,12 @@ Feature: Collapse
| bd | road | yes | primary | | bd | road | yes | primary |
| bc | road | yes | primary | | bc | road | yes | primary |
| de | road | yes | primary | | de | road | yes | primary |
| fd | cross | no | secondary | | fdcg | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn | | restriction | bd | fdcg | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn | | restriction | bc | fdcg | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
@@ -709,17 +585,12 @@ Feature: Collapse
Scenario: Forking before a turn (forky) Scenario: Forking before a turn (forky)
Given the node map Given the node map
""" | | | | g | | |
g | | | | | | |
. | | | | c | | |
c | a | b | | | | |
a . . b .' | | | | | d | |
` d. | | | | | f | e |
f e
"""
# as it is right now we don't classify this as a sliproad,
# check collapse-detail.feature for a similar test case
# which removes the fork here due to it being a Sliproad.
And the ways And the ways
| nodes | name | oneway | highway | | nodes | name | oneway | highway |
@@ -727,28 +598,25 @@ Feature: Collapse
| bd | road | yes | primary | | bd | road | yes | primary |
| bc | road | yes | primary | | bc | road | yes | primary |
| de | road | yes | primary | | de | road | yes | primary |
| fd | cross | no | secondary | | fdcg | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn | | restriction | bd | fdcg | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn | | restriction | bc | fdcg | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,g | road,cross,cross | depart,fork left,arrive | | a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road,road | depart,fork slight right,arrive | | a,e | road,road,road | depart,continue slight right,arrive |
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | # We should discuss whether the next item should be collapsed to depart,turn right,arrive.
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
Scenario: On-Off on Highway Scenario: On-Off on Highway
Given the node map Given the node map
""" | f | | | |
f | a | b | c | d |
a b c d | | | | e |
e
"""
And the ways And the ways
| nodes | name | highway | oneway | | nodes | name | highway | oneway |
@@ -762,277 +630,3 @@ Feature: Collapse
| f,d | on,Hwy,Hwy | depart,merge slight right,arrive | | f,d | on,Hwy,Hwy | depart,merge slight right,arrive |
| f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive | | f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive |
| a,e | Hwy,off,off | depart,off ramp right,arrive | | a,e | Hwy,off,off | depart,off ramp right,arrive |
@negative @straight
Scenario: Don't collapse going straight if actual turn
Given the node map
"""
e
c |
\ d - - - f
\|
b
|
|
a
"""
And the ways
| nodes | name | highway |
| abc | main | primary |
| bde | straight | residential |
| df | right | residential |
When I route I should get
| waypoints | route | turns | locations |
| a,c | main,main | depart,arrive | a,c |
| a,e | main,straight,straight | depart,turn straight,arrive | a,b,e |
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive | a,b,d,f |
Scenario: Entering a segregated road
Given the node map
"""
a f
g
b e
c d
"""
And the ways
| nodes | highway | name | oneway |
| abc | primary | first | yes |
| def | primary | first | yes |
| be | primary | first | no |
| ge | primary | second | no |
When I route I should get
| waypoints | route | turns |
| d,c | first,first,first | depart,continue uturn,arrive |
Scenario: Entering a segregated road slight turn
Given the node map
"""
a f
g
b e
c d
"""
And the ways
| nodes | highway | name | oneway |
| abc | primary | first | yes |
| def | primary | first | yes |
| be | primary | first | no |
| ge | primary | second | no |
When I route I should get
| waypoints | route | turns |
| d,c | first,first,first | depart,continue uturn,arrive |
Scenario: Do not collapse UseLane step when lanes change
Given the node map
"""
f g
a b c d e
h i
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | | main |
| bc | left\|through\|through\|through\|right | main |
| cd | left\|through\|right | main |
| de | | main |
| cf | | off |
| ch | | off |
| dg | | off |
| di | | off |
When I route I should get
| waypoints | route | turns |
| a,e | main,main,main | depart,use lane straight,arrive |
Scenario: But _do_ collapse UseLane step when lanes stay the same
Given the node map
"""
f g
a b c d e
h i
"""
And the ways
| nodes | turn:lanes:forward | name |
| ab | | main |
| bc | left\|through\|through\|through\|right | main |
| cd | left\|through\|through\|through\|right | main |
| de | | main |
| cf | | off |
| ch | | off |
| dg | | off |
| di | | off |
When I route I should get
| waypoints | route | turns |
| a,e | main,main | depart,arrive |
Scenario: Don't collapse different travel modes
Given the node map
"""
g h
a b c e f
d
i j
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | road |
| bc | primary | ferry | |
| cd | primary | | road |
| de | | ferry | |
| ef | primary | | road |
| bg | service | | turn |
| ci | service | | turn |
| dj | service | | turn |
| eh | service | | turn |
When I route I should get
| waypoints | route |
| a,f | road,,road,,road,road |
Scenario: U-Turn onto a Ferry
Given the node map
"""
i
j e d c h
k g a b f
"""
And the ways
| nodes | highway | route | name | oneway |
| abf | primary | | road | yes |
| hcd | primary | | road | yes |
| bc | primary | | | yes |
| di | service | | serv | yes |
| ed | | ferry | ferry | |
| ga | | ferry | ferry | |
| kg | primary | | on | yes |
| ej | primary | | off | yes |
When I route I should get
| waypoints | route | turns |
| k,j | on,ferry,road,road,ferry,off,off | depart,notification straight,notification straight,continue uturn,turn straight,notification straight,arrive |
# http://www.openstreetmap.org/#map=19/37.78090/-122.41251
Scenario: U-Turn onto unnamed-road
Given the node map
"""
d . _ h
' b . _ |
| ' e g
| f '
| 1 '
a '
"""
And the ways
| nodes | highway | turn:lanes | name | oneway |
| ab | secondary | | up | yes |
| gfa | secondary | | | yes |
| dbe | tertiary | | turn | no |
| he | secondary | through\|right | down | yes |
| ef | secondary | | down | yes |
When I route I should get
| waypoints | route | turns |
| a,1 | up,turn,, | depart,turn right,turn sharp right,arrive |
#http://www.openstreetmap.org/#map=19/52.48778/13.30024
Scenario: Hohenzollerdammbrücke
Given a grid size of 10 meters
Given the node map
"""
q s
p o
.. ..
. . . .
j - i - - - h - - - g - f
> k < > l <
a - b - - - c - - - d - e
. . . .
.. ..
m n
t r
"""
And the ways
| nodes | highway | name | oneway |
| ab | secondary | hohe | yes |
| bc | secondary | hohebruecke | yes |
| cd | secondary | hohebruecke | yes |
| bk | secondary | hohebruecke | yes |
| kh | secondary | hohebruecke | yes |
| ki | secondary | hohebruecke | yes |
| ck | secondary | hohebruecke | yes |
| de | secondary | hohe | yes |
| fg | secondary | hohe | yes |
| gh | secondary | hohebruecke | yes |
| hi | secondary | hohebruecke | yes |
| gl | secondary | hohebruecke | yes |
| lc | secondary | hohebruecke | yes |
| hl | secondary | hohebruecke | yes |
| ld | secondary | hohebruecke | yes |
| ij | secondary | hohe | yes |
| bm | motorway_link | a100 | yes |
| cm | motorway_link | a100 | yes |
| nc | motorway_link | a100 | yes |
| nd | motorway_link | a100 | yes |
| go | motorway_link | a100 | yes |
| ho | motorway_link | a100 | yes |
| ph | motorway_link | a100 | yes |
| pi | motorway_link | a100 | yes |
| qp | motorway_link | a100 | yes |
| mt | motorway_link | a100 | yes |
| rn | motorway_link | a100 | yes |
| os | motorway_link | a100 | yes |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | ck | kh | k | no_right_turn |
| restriction | bk | ki | k | no_left_turn |
| restriction | hl | lc | l | no_right_turn |
| restriction | gl | ld | l | no_left_turn |
| restriction | bc | cm | c | no_right_turn |
| restriction | bc | ck | c | no_left_turn |
| restriction | nc | cm | c | no_left_turn |
| restriction | nc | cd | c | no_right_turn |
| restriction | lc | ck | c | no_left_turn |
| restriction | lc | cd | c | no_right_turn |
| restriction | gh | ho | h | no_right_turn |
| restriction | gh | hl | h | no_left_turn |
| restriction | kh | hi | h | no_left_turn |
| restriction | kh | hl | h | no_right_turn |
| restriction | ph | ho | h | no_left_turn |
| restriction | ph | hi | h | no_right_turn |
When I route I should get
| waypoints | route | turns | locations |
| a,e | hohe,hohe | depart,arrive | a,e |
| a,s | hohe,a100,a100 | depart,on ramp left,arrive | a,b,s |
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
| a,j | | | |
| 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,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
+23 -38
View File
@@ -7,10 +7,8 @@ Feature: Continue Instructions
Scenario: Road turning left Scenario: Road turning left
Given the node map Given the node map
""" | | | c | |
c | a | | b | d |
a - b-d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -24,10 +22,8 @@ Feature: Continue Instructions
Scenario: Road turning left and straight Scenario: Road turning left and straight
Given the node map Given the node map
""" | | | c | |
c | a | | b | d |
a - b-d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -41,11 +37,9 @@ Feature: Continue Instructions
Scenario: Road turning left and straight Scenario: Road turning left and straight
Given the node map Given the node map
""" | | | c | |
c | a | | b | d |
a - b-d | | | e | |
e
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -61,10 +55,8 @@ Feature: Continue Instructions
Scenario: Road turning right Scenario: Road turning right
Given the node map Given the node map
""" | a | | b | d |
a - b-d | | | c | |
c
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -78,12 +70,10 @@ Feature: Continue Instructions
Scenario: Road turning slight left Scenario: Road turning slight left
Given the node map Given the node map
""" | | | | | c |
c | | | | | |
/ | a | | b | | |
a - b | | | | d | |
`d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -97,12 +87,10 @@ Feature: Continue Instructions
Scenario: Road turning slight right Scenario: Road turning slight right
Given the node map Given the node map
""" | | | | d | |
,d | a | | b | | |
a - b | | | | | |
\ | | | | | c |
c
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -116,13 +104,11 @@ Feature: Continue Instructions
Scenario: Road Loop Scenario: Road Loop
Given the node map Given the node map
""" | | | f | | e |
f - e | | | | | |
| | | a | | b | g | |
a - b-g | | | | | | |
| | | | | c | | d |
c - d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -134,5 +120,4 @@ Feature: Continue Instructions
| a,c | abcdefb,abcdefb,abcdefb | depart,continue right,arrive | | a,c | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
| a,f | abcdefb,abcdefb,abcdefb | depart,continue left,arrive | | a,f | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive | | a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
# continuing right here, since the turn to the left is more expensive | a,e | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
| a,e | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
+55 -861
View File
@@ -7,152 +7,43 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Turn Instead of Ramp Scenario: Turn Instead of Ramp
Given the node map Given the node map
""" | | | | | e | |
e | a | b | | | c | d |
a b-----c-d | | | | h | | |
`--h | | | | | | | |
|| | | | | 1 | | |
1|| | | | | | | |
|| | | | | | f | |
`f | | | | | | |
| | | | | | g | |
g
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name |
| abc | trunk | first | | | abcd | trunk | first |
| cd | trunk | first | | | bhf | trunk_link | |
| bhf | trunk_link | | yes | | ecfg | primary | second |
| cfg | primary | second | yes |
| ec | primary | second | |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | abc | cfg | c | no_right_turn | | restriction | abcd | ecfg | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,g | first,second,second | depart,turn right,arrive | | a,g | first,second,second | depart,turn right,arrive |
| a,1 | first,, | depart,turn right,arrive | | a,1 | first,, | depart,turn slight right,arrive |
Scenario: Turn Instead of Ramp Scenario: Turn Instead of Ramp
Given the node map Given the node map
""" | | | | | e | |
e | a | b | | | c | d |
a b-----c-d | | | | h | | |
`--h | | | | | | | |
|| | | | | | | |
1|| | | | | | | |
|| | | | | | f | |
`f | | | | | | |
| | | | | | | |
g | | | | | g | |
"""
And the ways
| nodes | highway | name | oneway | route |
| abc | trunk | first | yes | |
| cd | trunk | first | yes | |
| bhf | trunk_link | | yes | ferry |
| cfg | primary | second | yes | |
| ec | primary | second | yes | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | cfg | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,g | first,,second,second | depart,turn right,turn straight,arrive |
Scenario: Turning Sliproad onto a ferry
Given the node map
"""
e
a b-----c-d
`--h |
||
1||
||
`f
|
g
|
i
"""
And the ways
| nodes | highway | name | oneway | route |
| abc | trunk | first | | |
| cd | trunk | first | | |
| bhf | trunk_link | | yes | |
| cf | primary | second | yes | |
| fg | primary | second | yes | ferry |
| ec | primary | second | yes | |
| gi | primary | second | yes | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | cf | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,i | first,,second,second,second | depart,turn right,turn straight,notification straight,arrive |
| a,1 | first,, | depart,turn right,arrive |
Scenario: Turn Instead of Ramp - Max-Speed
Given the node map
"""
e
a-b-----c-------------------------d
`--h |
||
1||
||
`f
|
g
"""
And the ways
| nodes | highway | name | maxspeed | oneway |
| abc | trunk | first | 70 | |
| cd | trunk | first | 2 | |
| bhf | trunk_link | | 2 | yes |
| cfg | primary | second | 50 | yes |
| ec | primary | second | 50 | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | cfg | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,g | first,second,second | depart,turn right,arrive |
| a,1 | first,, | depart,turn right,arrive |
Scenario: Turn Instead of Ramp
Given the node map
"""
e
|
a-b-----c--d
`--h
\|
|
|
|
|
|
|
f
|
|
g
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -162,56 +53,26 @@ Feature: Slipways and Dedicated Turn Lanes
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive | | a,g | first,,second,second | depart,off ramp slight right,merge slight left,arrive |
Scenario: Turn Instead of Ramp
Given the node map
"""
e
|
a-b-----c-d
`--h
\|
|
|
f
|
|
g
"""
And the ways
| nodes | highway | name |
| abcd | motorway | first |
| bhf | motorway_link | |
| efg | primary | second |
When I route I should get
| waypoints | route | turns |
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
Scenario: Inner city expressway with on road Scenario: Inner city expressway with on road
Given the node map Given the node map
""" | a | b | | | | c |
a b-------c-g | | | | | f | |
`--f | | | | | | | |
\| | | | | | | |
| | | | | | | |
| | | | | | | d |
d | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | e |
e
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name |
| abc | primary | road | | | abc | primary | road |
| cg | primary | road | | | bfd | trunk_link | |
| bfd | trunk_link | | yes | | cde | trunk | trunk |
| cde | trunk | trunk | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
@@ -224,16 +85,14 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Slipway Round U-Turn Scenario: Slipway Round U-Turn
Given the node map Given the node map
""" | a | | f |
a f | | | |
| | | b | | e |
b e | | | |
|\ /| | | | |
| | | | | g | |
| g | | | | |
| | | c | | d |
c d
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -247,15 +106,13 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Slipway Steep U-Turn Scenario: Slipway Steep U-Turn
Given the node map Given the node map
""" | a | | f |
a f | | | |
| | | b | | e |
b e | | g | |
|\g/| | | | |
| | | | | |
| | | c | | d |
c d
"""
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
@@ -266,666 +123,3 @@ Feature: Slipways and Dedicated Turn Lanes
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,f | road,road,road | depart,continue uturn,arrive | | a,f | road,road,road | depart,continue uturn,arrive |
Scenario: Schwarzwaldstrasse Autobahn
Given the node map
"""
. i . . . . . h . . . . g
.j '. . '
a . k
' b . r c . d . e . . . . f
. . .
. . .
. . .
. . .
l . .
m . .
n q
. .
. .
. .
o p
"""
And the nodes
# the traffic light at `l` is not actually in the data, but necessary for the test to check everything
# http://www.openstreetmap.org/#map=19/48.99211/8.40336
| node | highway |
| r | traffic_signals |
| l | traffic_signals |
And the ways
| nodes | highway | name | ref | oneway |
| abrcd | secondary | Schwarzwaldstrasse | L561 | yes |
| hija | secondary | Schwarzwaldstrasse | L561 | yes |
| def | secondary | Ettlinger Strasse | | yes |
| gh | secondary | Ettlinger Strasse | | yes |
| blmn | secondary_link | | L561 | yes |
| hkc | secondary_link | Ettlinger Strasse | | yes |
| qdki | secondary_link | Ettlinger Allee | | yes |
| cn | secondary_link | Ettlinger Allee | | yes |
| no | primary | Ettlinger Allee | | yes |
| pq | primary | Ettlinger Allee | | yes |
| qe | secondary_link | Ettlinger Allee | | yes |
When I route I should get
| waypoints | route | turns | ref |
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,L561, |
Scenario: Traffic Lights everywhere
#http://map.project-osrm.org/?z=18&center=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
Given the node map
"""
a k l j
d b c i
e g
1
h
f
"""
And the nodes
| node | highway |
| b | traffic_signals |
| e | traffic_signals |
| g | traffic_signals |
And the ways
| nodes | highway | name | oneway |
| aklbci | secondary | Ebertstrasse | yes |
| kdeh | secondary_link | | yes |
| jcghf | primary | Brauerstrasse | yes |
When I route I should get
| waypoints | route | turns |
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive |
#2839
Scenario: Self-Loop
Given the node map
"""
/-l-----k---\
/ `j--
m \
/ i
/ \
| \
| h
| |
n |
| |
| g
o |
/ /
| f
/- p /
/ e
a ------- b --------------- c ----------------- d ---/
"""
And the ways
| nodes | name | oneway | highway | lanes |
| abc | circled | no | residential | 1 |
| cdefghijklmnopc | circled | yes | residential | 1 |
When I route I should get
| waypoints | bearings | route | turns |
| b,a | 90,10 270,10 | circled,circled | depart,arrive |
@todo
#due to the current turn function, the left turn bcp is exactly the same cost as pcb, a right turn. The right turn should be way faster,though
#for that reason we cannot distinguish between driving clockwise through the circle or counter-clockwise. Until this is improved, this case here
#has to remain as todo (see #https://github.com/Project-OSRM/osrm-backend/pull/2849)
Scenario: Self-Loop - Bidirectional
Given the node map
"""
/-l-----k---\
/ `j--
m \
/ i
/ \
| \
| h
| |
n |
| |
| g
o |
/ /
| f
/- p /
/ e
a ------- b --------------- c ----------------- d ---/
"""
And the ways
| nodes | name | oneway | highway | lanes |
| abc | circled | no | residential | 1 |
| cdefghijklmnopc | circled | no | residential | 1 |
When I route I should get
| waypoints | bearings | route | turns |
| b,a | 90,10 270,10 | circled,circled | depart,arrive |
#http://www.openstreetmap.org/#map=19/38.90597/-77.01276
Scenario: Don't falsly classify as sliproads
Given the node map
"""
j
a-b ----------------------------------------- c ------------d
\ |
\ |
\ |
\ |
\ |
e |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ 1
`---------- f ------- g ----------\
| \
i h
"""
And the ways
| nodes | name | highway | oneway | maxspeed |
| abcd | new york | primary | yes | 35 |
| befgh | m street | secondary | yes | 35 |
| igcj | 1st street | tertiary | no | 20 |
And the nodes
| node | highway |
| c | traffic_signals |
| g | traffic_signals |
When I route I should get
| waypoints | route | turns | # |
| a,d | new york,new york | depart,arrive | this is the sinatra route |
| a,j | new york,1st street,1st street | depart,turn left,arrive | |
| a,1 | new york,m street,1st street,1st street | depart,turn right,turn left,arrive | this can false be seen as a sliproad |
# Merging into degree two loop on dedicated turn detection / 2927
Scenario: Turn Instead of Ramp
Given the node map
"""
/--------------------f
g-----------h--\ |
d-----e
i c-----------j--/
| |
| |
| |
| |
| |
\ /
\ /
\ /
b
|
a
"""
And the ways
| nodes | highway | name | oneway |
| abi | primary | road | yes |
| bcjd | primary | loop | yes |
| dhgf | primary | loop | yes |
| fed | primary | loop | yes |
And the nodes
| node | highway |
| g | traffic_signals |
| c | traffic_signals |
# We don't actually care about routes here, this is all about endless loops in turn discovery
When I route I should get
| waypoints | route | turns |
| a,i | road,road,road | depart,fork slight left,arrive |
# The following tests are current false positives / false negatives #3199
@sliproads
# http://www.openstreetmap.org/#map=19/52.59847/13.14815
Scenario: Sliproad Detection
Given the node map
"""
a . . .
. .
b . . . . . . c . . . d
` . .
e . .
` . .
f . .
` . .
g i
` h .
"""
And the ways
| nodes | highway | name |
| abefgh | residential | Nachtigallensteig |
| bcd | residential | Kiebitzsteig |
| cg | residential | Haenflingsteig |
| hid | residential | Waldkauzsteig |
When I route I should get
| waypoints | route | turns |
| a,d | Nachtigallensteig,Kiebitzsteig,Kiebitzsteig | depart,turn left,arrive |
| a,h | Nachtigallensteig,Nachtigallensteig | depart,arrive |
@sliproads
Scenario: Not a obvious Sliproad
Given the node map
"""
d
.
s . a . . b . . c
` .
` e
.`
. `
f g
"""
And the ways
| nodes | highway | name | oneway |
| sabc | primary | sabc | |
| dbef | primary | dbef | yes |
| aeg | primary | aeg | yes |
When I route I should get
| waypoints | route | turns |
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
@sliproads
Scenario: Through Street, not a Sliproad although obvious
Given the node map
"""
d
.
s . a . . b . . c
` .
` e
. `
. `
f g
"""
And the ways
| nodes | highway | name | oneway |
| sabc | primary | sabc | |
| dbef | primary | dbef | yes |
| aeg | primary | aeg | yes |
When I route I should get
| waypoints | route | turns |
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
@sliproads
Scenario: Sliproad target turn is restricted
Given the node map
"""
d
.
s . a . . . . b . . c
` .
` .
` .
` .
`.
e
.`
f `
. ` g
"""
And the ways
| nodes | highway | name | oneway |
| sa | primary | sabc | |
| abc | primary | sabc | |
| dbe | primary | dbef | yes |
| ef | primary | dbef | |
| ae | primary | aeg | yes |
| eg | primary | aeg | |
# the reason we have to split ways at e is that otherwise we can't handle restrictions via e
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | ae | ef | e | no_right_turn |
When I route I should get
| waypoints | route | turns |
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
@sliproads
Scenario: Not a Sliproad, road not continuing straight
Given the node map
"""
d
.
s . a . . b . . c
` .
` e . . g
"""
And the ways
| nodes | highway | name | oneway |
| sabc | primary | sabc | |
| dbe | primary | dbe | yes |
| aeg | primary | aeg | yes |
When I route I should get
| waypoints | route | turns |
| s,c | sabc,sabc | depart,arrive |
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
@sliproads
Scenario: Intersection too far away with Traffic Light shortly after initial split
Given the node map
"""
d
.
s . a . . . . . . . . . . . . . t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b . . c
` . . . . . . . . . . . .
` . . . . . . . . . . . .
` . . . . . . . . . . . .
` . . . . . . . . . . . .
` . . . . . . . . . . . .
` . . . . . . . . . . . .
` . . .
` e
.
f
.
"""
And the nodes
| node | highway |
| t | traffic_signals |
And the ways
| nodes | highway | name | oneway |
| satbc | primary | sabc | |
| dbef | primary | dbef | yes |
| ae | primary | ae | yes |
When I route I should get
| waypoints | route | turns |
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive |
@sliproads
Scenario: Traffic Signal on Sliproad
Given the node map
"""
d
.
s . a . . . . . b . . c
` .
` .
` .
t .
` .
e
.
.
f
"""
And the nodes
| node | highway |
| t | traffic_signals |
And the ways
| nodes | highway | name | oneway |
| sabc | primary | sabc | |
| dbe | primary | dbe | yes |
| ef | primary | ef | |
| ate | primary | ate | yes |
When I route I should get
| waypoints | route | turns |
| s,f | sabc,ef,ef | depart,turn right,arrive |
@sliproads
Scenario: Sliproad tagged as link
Given the node map
"""
d
.
s . a . . . . . b . . c
` .
` .
` .
` .
` .
e
.
.
f
"""
And the ways
| nodes | highway | name | oneway |
| sabc | motorway | sabc | |
| dbef | motorway | dbef | yes |
| ae | motorway_link | ae | yes |
When I route I should get
| waypoints | route | turns |
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
@sliproads
Scenario: Sliproad with same-ish names
Given the node map
"""
d
.
s . a . . b . . c
` .
. e
..
.
f
.
t
"""
And the ways
| nodes | highway | name | ref | oneway |
| sabc | primary | main | | |
| dbe | primary | crossing | r0 | yes |
| eft | primary | crossing | r0;r1 | yes |
| af | primary | sliproad | | yes |
When I route I should get
| waypoints | route | turns |
| s,t | main,crossing,crossing | depart,turn right,arrive |
@sliproads
Scenario: Not a Sliproad, name mismatch
Given the node map
"""
d
.
s . a . . b . . c
` .
. e
. .
..
.
f
.
t
"""
And the ways
| nodes | highway | name | oneway |
| sabc | primary | main | |
| dbe | primary | top | yes |
| ef | primary | bottom | yes |
| ft | primary | away | yes |
| af | primary | sliproad | yes |
When I route I should get
| waypoints | route | turns |
| s,t | main,away,away | depart,turn right,arrive |
@sliproads
Scenario: Not a Sliproad, low road priority
Given the node map
"""
d
.
s . a . . b . . c
` .
. e
. .
..
.
f
.
t
"""
And the ways
# maxspeed otherwise service road will never be routed over and we won't see instructions
| nodes | highway | name | maxspeed | oneway |
| sabc | primary | main | 30 km/h | |
| dbe | primary | crossing | 30 km/h | yes |
| eft | primary | crossing | 30 km/h | yes |
| ft | primary | away | 30 km/h | yes |
| af | service | sliproad | 30 km/h | yes |
When I route I should get
| waypoints | route | turns |
| s,t | main,away,away | depart,turn right,arrive |
@sliproads
Scenario: Not a Sliproad, more than three roads at target intersection
Given the node map
"""
d
.
s . a . . b . . c
` .
. e
. .
..
. h
f .
. g
t
"""
And the ways
| nodes | highway | name | oneway |
| sabc | primary | main | |
| dbe | primary | top | yes |
| eft | primary | bottom | yes |
| fh | primary | another | |
| fg | primary | another | |
| af | primary | sliproad | yes |
When I route I should get
| waypoints | route | turns |
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
@sliproads:
Scenario: Throughabout-Sliproad
Given the node map
"""
t
|
- - e - -
/ \
| |
| |
z - s - a - - - - - - - b - - -x
' c y
| |
\ /
- -d - -
"""
And the ways
| nodes | name | highway | oneway | junction | # |
| zs | through | trunk | yes | | |
| sa | through | trunk | yes | | |
| ab | through | trunk | yes | | |
| bx | through | trunk | yes | | |
| ac | round | primary | yes | roundabout | |
| cdy | round | primary | yes | roundabout | |
| yb | round | primary | yes | roundabout | |
| be | round | primary | yes | roundabout | |
| ea | round | primary | yes | roundabout | |
| et | out | primary | yes | | the extraterrestrial |
| sc | | trunk_link | yes | | |
| yx | right | trunk_link | yes | | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sa | ab | a | only_straight |
| restriction | ab | bx | b | only_straight |
| restriction | yb | be | b | only_straight |
When I route I should get
| waypoints | route | turns | locations |
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
Scenario: Sliproad before a roundabout
Given the node map
"""
e
a - b - - c - d
'f|l'
m
g
|
.h-_
k - i |
'.j.'
"""
And the ways
| nodes | junction | oneway | highway | name |
| ab | | yes | primary | road |
| bc | | yes | primary | road |
| cd | | yes | primary | road |
| ec | | yes | secondary | |
| cm | | yes | secondary | |
| mg | | yes | primary | |
| gh | | no | primary | |
| hijh | roundabout | yes | primary | |
| ik | | yes | primary | |
| bfm | | yes | primary | |
| gld | | yes | primary | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bc | cd | c | only_straight |
When I route I should get
| waypoints | route | turns | locations |
| a,k | road,,, | depart,continue right,roundabout turn right exit-1,arrive | a,b,h,k |
+29 -37
View File
@@ -6,44 +6,36 @@ Feature: Destination Signs
Scenario: Car - route name assembly with destination signs Scenario: Car - route name assembly with destination signs
Given the node map Given the node map
""" | a | b |
a b | c | d |
c d | e | f |
e f | g | h |
g h | i | j |
i j | k | l |
k l | m | n |
m n | o | p |
o p | q | r |
q r
s t
u v
"""
And the ways And the ways
| nodes | name | ref | destination | destination:ref | destination:street | oneway | # | | nodes | name | ref | destination | destination:ref | oneway | # |
| ab | AB | E1 | | | | yes | | | ab | AB | E1 | | | yes | |
| cd | CD | | Berlin | | | yes | | | cd | CD | | Berlin | | yes | |
| ef | EF | | Berlin | A1 | | yes | | | ef | EF | | Berlin | A1 | yes | |
| gh | | | Berlin | A1 | | yes | | | gh | | | Berlin | A1 | yes | |
| ij | | | Berlin | | | yes | | | ij | | | Berlin | | yes | |
| kl | KL | E1 | Berlin | A1 | | yes | | | kl | KL | E1 | Berlin | A1 | yes | |
| mn | MN | | Berlin;Hamburg | A1;A2 | | yes | | | mn | MN | | Berlin;Hamburg | A1;A2 | yes | |
| op | OP | | Berlin;Hamburg | A1;A2 | | no | mis-tagged destination: not a oneway | | op | OP | | Berlin;Hamburg | A1;A2 | no | mis-tagged destination: not a oneway |
| qr | QR | | | A1;A2 | | yes | | | qr | QR | | | A1;A2 | yes | |
| st | ST | | | | St Street | yes | |
| uv | UV | | Berlin | | St Street | yes | |
When I route I should get When I route I should get
| from | to | route | destinations | ref | # | | from | to | route | destinations | # |
| a | b | AB,AB | , | E1,E1 | | | a | b | AB (E1),AB (E1) | , | |
| c | d | CD,CD | Berlin,Berlin | , | | | c | d | CD (Berlin),CD (Berlin) | Berlin,Berlin | |
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | | | e | f | EF (A1: Berlin),EF (A1: Berlin) | A1: Berlin,A1: Berlin | |
| g | h | , | A1: Berlin,A1: Berlin | , | | | g | h | , | A1: Berlin,A1: Berlin | |
| i | j | , | Berlin,Berlin | , | | | i | j | , | Berlin,Berlin | |
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | | | k | l | KL (E1),KL (E1) | A1: Berlin,A1: Berlin | |
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | | | m | n | MN (A1, A2: Berlin, Hamburg),MN (A1, A2: Berlin, Hamburg) | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | |
| o | p | OP,OP | , | , | guard against mis-tagging | | o | p | OP,OP | , | guard against mis-tagging |
| q | r | QR,QR | A1, A2,A1, A2 | , | | | q | r | QR (A1, A2),QR (A1, A2) | A1, A2,A1, A2 | |
| s | t | ST,ST | St Street,St Street | , | |
| u | v | UV,UV | Berlin,Berlin | , | city preferred over street |
@@ -1,43 +0,0 @@
@routing @guidance
Feature: Destination Signs
Background:
Given the profile "car"
Scenario: Car - route name assembly with destination signs accounting for directional tags
Given the node map
"""
a b
c d
e f
g h
i j
k l
m n
o p
q r
"""
And the ways
| nodes | name | ref | destination | destination:ref | destination:forward | destination:backward | oneway | # |
| ab | AB | | Berlin | | | | yes | |
| cd | CD | | | | Berlin | | yes | |
| ef | EF | | | | Berlin | Hamburg | -1 | |
| gh | GH | | | A1 | | | yes | |
| ij | IJ | | Berlin | A1 | | | no | mis-tagged destination: not a oneway |
| kl | KL | | | A1 | Berlin | Hamburg | yes | |
| mn | MN | | Berlin | A1 | Berlin | Hamburg | yes | |
| op | OP | | Berlin | | | Hamburg | -1 | |
| qr | QR | | | | | Hamburg | -1 | |
When I route I should get
| from | to | route | destinations | ref | # |
| a | b | AB,AB | Berlin,Berlin | , | |
| c | d | CD,CD | Berlin,Berlin | , | |
| f | e | EF,EF | Hamburg,Hamburg | , | |
| g | h | GH,GH | A1,A1 | , | |
| i | j | IJ,IJ | , | , | guard against mis-tagging |
| k | l | KL,KL | A1: Berlin,A1: Berlin | , | |
| m | n | MN,MN | A1: Berlin,A1: Berlin | , | |
| p | o | OP,OP | Hamburg,Hamburg | , | |
| r | q | QR,QR | Hamburg,Hamburg | , | |
@@ -1,39 +0,0 @@
@routing @guidance
Feature: Destination Signs
Background:
Given the profile "car"
Scenario: Car - route name assembly with destination signs accounting for directional:ref tags
Given the node map
"""
a b
c d
e f
g h
i j
k l
m n
o p
q r
"""
And the ways
| nodes | name | destination | destination:ref | destination:ref:forward | destination:ref:backward | destination:forward | destination:backward | oneway | # |
| ab | AB | Berlin | A1 | A1 | A2 | | | yes | |
| cd | CD | | A1 | A1 | A2 | Berlin | Hamburg | -1 | |
| ef | EF | | | A1 | A2 | Berlin | Hamburg | yes | |
| gh | GH | | | A1 | A2 | Berlin | Hamburg | -1 | |
| ij | IJ | Berlin | A1 | | A2 | Berlin | Hamburg | yes | |
| kl | KL | | A1 | | A2 | Berlin | Hamburg | -1 | |
| mn | MN | Berlin | A1 | A1 | | Berlin | Hamburg | no | mis-tagged destination: not a oneway |
When I route I should get
| from | to | route | destinations | ref | # |
| a | b | AB,AB | A1: Berlin,A1: Berlin | , | |
| d | c | CD,CD | A2: Hamburg,A2: Hamburg | , | |
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
| h | g | GH,GH | A2: Hamburg,A2: Hamburg | , | |
| i | j | IJ,IJ | A1: Berlin,A1: Berlin | , | |
| l | k | KL,KL | A2: Hamburg,A2: Hamburg | , | |
| m | n | MN,MN | , | , | guard against mis-tagging |
+42 -136
View File
@@ -7,211 +7,117 @@ Feature: End Of Road Instructions
Scenario: End of Road with through street Scenario: End of Road with through street
Given the node map Given the node map
""" | | | c |
c | a | | b |
a e b | | | d |
f d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
| aeb | primary | | ab | primary |
| cbd | primary | | cbd | primary |
| ef | primary |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | aeb,cbd,cbd | depart,end of road left,arrive | | a,c | ab,cbd,cbd | depart,end of road left,arrive |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive | | a,d | ab,cbd,cbd | depart,end of road right,arrive |
@3605
Scenario: End of Road with oneway through street
Given the node map
"""
c
a e b
f d
"""
And the ways
| nodes | highway | oneway |
| aeb | primary | no |
| cbd | primary | yes |
| ef | primary | no |
When I route I should get
| waypoints | route | turns |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
@3605
Scenario: End of Road fromnameless onto through street
Given the node map
"""
c
a e b
f d
"""
And the ways
| nodes | highway | oneway | name |
| aeb | primary | no | |
| cbd | primary | yes | cbd |
| ef | primary | no | ef |
When I route I should get
| waypoints | route | turns |
| a,d | ,cbd,cbd | depart,end of road right,arrive |
Scenario: End of Road with three streets Scenario: End of Road with three streets
Given the node map Given the node map
""" | | | c |
c | a | | b |
a e b | | | d |
f d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
| aeb | primary | | ab | primary |
| cb | primary | | cb | primary |
| bd | primary | | bd | primary |
| ef | primary |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | aeb,cb,cb | depart,end of road left,arrive | | a,c | ab,cb,cb | depart,end of road left,arrive |
| a,d | aeb,bd,bd | depart,end of road right,arrive | | a,d | ab,bd,bd | depart,end of road right,arrive |
Scenario: End of Road with three streets, slightly angled Scenario: End of Road with three streets, slightly angled
Given the node map Given the node map
""" | a | | | | | c |
a e c | | | | | | b |
f b | | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
| aeb | primary | | ab | primary |
| cb | primary | | cb | primary |
| bd | primary | | bd | primary |
| ef | primary |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | aeb,cb,cb | depart,end of road left,arrive | | a,c | ab,cb,cb | depart,end of road left,arrive |
| a,d | aeb,bd,bd | depart,end of road right,arrive | | a,d | ab,bd,bd | depart,end of road right,arrive |
Scenario: End of Road with three streets, slightly angled Scenario: End of Road with three streets, slightly angled
Given the node map Given the node map
""" | | | | | | c |
c | | | | | | b |
f b | a | | | | | d |
a e d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
| aeb | primary | | ab | primary |
| ef | primary |
| cb | primary | | cb | primary |
| bd | primary | | bd | primary |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | aeb,cb,cb | depart,end of road left,arrive | | a,c | ab,cb,cb | depart,end of road left,arrive |
| a,d | aeb,bd,bd | depart,end of road right,arrive | | a,d | ab,bd,bd | depart,end of road right,arrive |
Scenario: End of Road with through street, slightly angled Scenario: End of Road with through street, slightly angled
Given the node map Given the node map
""" | a | | | | | c |
a e c | | | | | | b |
f b | | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
| aeb | primary | | ab | primary |
| ef | primary |
| cbd | primary | | cbd | primary |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | aeb,cbd,cbd | depart,end of road left,arrive | | a,c | ab,cbd,cbd | depart,end of road left,arrive |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive | | a,d | ab,cbd,cbd | depart,end of road right,arrive |
Scenario: End of Road with through street, slightly angled Scenario: End of Road with through street, slightly angled
Given the node map Given the node map
""" | | | | | | c |
c | | | | | | b |
f b | a | | | | | d |
a e d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
| aeb | primary | | ab | primary |
| ef | primary |
| cbd | primary | | cbd | primary |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | aeb,cbd,cbd | depart,end of road left,arrive | | a,c | ab,cbd,cbd | depart,end of road left,arrive |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive | | a,d | ab,cbd,cbd | depart,end of road right,arrive |
Scenario: End of Road with two ramps - prefer ramp over end of road Scenario: End of Road with two ramps - prefer ramp over end of road
Given the node map Given the node map
""" | | | c |
c | a | | b |
a e b | | | d |
f d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
| aeb | primary | | ab | primary |
| ef | primary |
| bc | motorway_link | | bc | motorway_link |
| bd | motorway_link | | bd | motorway_link |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | aeb,bc,bc | depart,on ramp left,arrive | | a,c | ab,bc,bc | depart,on ramp left,arrive |
| a,d | aeb,bd,bd | depart,on ramp right,arrive | | a,d | ab,bd,bd | depart,on ramp right,arrive |
# http://www.openstreetmap.org/#map=19/52.49907/13.41836
@end-of-road @negative
Scenario: Don't Handle Circles as End-Of-Road
Given the node map
"""
r q
a s
b
j
l c i k
h
m
d n
e g
f
o p
"""
And the ways
| nodes | highway | name | oneway |
| abcdefghijsa | secondary | kotti | yes |
| ki | secondary | skal | yes |
| cl | secondary | skal | yes |
| md | secondary | skal | yes |
| gn | secondary | skal | yes |
| qa | tertiary | adal | no |
| br | residential | rei | yes |
| fo | secondary | kstr | yes |
| pg | secondary | kstr | yes |
When I route I should get
| waypoints | route | turns | # |
| k,l | skal,kotti,skal,skal | depart,turn right,turn right,arrive | # could be a case to find better turn instructions for |
+52 -141
View File
@@ -7,11 +7,9 @@ Feature: Fork Instructions
Scenario: Fork Same Road Class Scenario: Fork Same Road Class
Given the node map Given the node map
""" | | | | | c |
c | a | | b | | |
a b | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -24,48 +22,11 @@ Feature: Fork Instructions
| a,c | ab,bc,bc | depart,fork slight left,arrive | | a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork slight right,arrive | | a,d | ab,bd,bd | depart,fork slight right,arrive |
Scenario: Don't Fork On Single Road
Given the node map
"""
c
a b
d
"""
And the ways
| nodes | highway | oneway |
| ab | primary | no |
| cb | primary | yes |
| bd | primary | yes |
When I route I should get
| waypoints | route | turns |
| a,d | ab,bd,bd | depart,new name slight right,arrive |
Scenario: Don't Fork On Single Road
Given the node map
"""
c
a b d
"""
And the ways
| nodes | highway | oneway | name |
| ab | primary | no | road |
| cb | primary | yes | road |
| bd | primary | yes | turn |
When I route I should get
| waypoints | route | turns |
| a,d | road,turn,turn | depart,new name straight,arrive |
Scenario: Do not fork on link type Scenario: Do not fork on link type
Given the node map Given the node map
""" | | | | | c |
c | a | | b | | |
a b | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -80,11 +41,9 @@ Feature: Fork Instructions
Scenario: Fork in presence of other roads Scenario: Fork in presence of other roads
Given the node map Given the node map
""" | | | | | c |
c | a | | b | | |
a b | | e | | | d |
e d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -100,12 +59,10 @@ Feature: Fork Instructions
Scenario: Fork Turning Slight Left Scenario: Fork Turning Slight Left
Given the node map Given the node map
""" | | | | | | c |
c | | | | | | |
| a | | b | | | |
a b | | | | | d | |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -120,12 +77,10 @@ Feature: Fork Instructions
Scenario: Fork Turning Slight Right Scenario: Fork Turning Slight Right
Given the node map Given the node map
""" | | | | | c | |
c | a | | b | | | |
a b | | | | | | |
| | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -140,11 +95,9 @@ Feature: Fork Instructions
Scenario: Do not fork on service Scenario: Do not fork on service
Given the node map Given the node map
""" | | | | | c |
c | a | | b | | |
a b | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -158,11 +111,9 @@ Feature: Fork Instructions
Scenario: Fork Both Turning Slight Right Scenario: Fork Both Turning Slight Right
Given the node map Given the node map
""" | a | | b | | | |
a b | | | | | | c |
c | | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -177,11 +128,9 @@ Feature: Fork Instructions
Scenario: Fork Both Turning Slight Left Scenario: Fork Both Turning Slight Left
Given the node map Given the node map
""" | | | | | | c |
c | | | | | | d |
d | a | | b | | | |
a b
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -196,11 +145,9 @@ Feature: Fork Instructions
Scenario: Fork Both Turning Slight Right - Unnamed Scenario: Fork Both Turning Slight Right - Unnamed
Given the node map Given the node map
""" | a | | b | | | |
a b | | | | | | c |
c | | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -215,11 +162,9 @@ Feature: Fork Instructions
Scenario: Fork Both Turning Slight Left - Unnamed Scenario: Fork Both Turning Slight Left - Unnamed
Given the node map Given the node map
""" | | | | | | c |
c | | | | | | d |
d | a | | b | | | |
a b
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -234,11 +179,9 @@ Feature: Fork Instructions
Scenario: Fork Both Turning Very Slightly Right - Unnamed Scenario: Fork Both Turning Very Slightly Right - Unnamed
Given the node map Given the node map
""" | a | | b | | | | | | | | | | | | | | | |
a b | | | | | | | | | | | | c | | | | | | |
c | | | | | | | | | | | | | | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -253,11 +196,9 @@ Feature: Fork Instructions
Scenario: Fork Both Turning Very Slightly Right - Unnamed Ramps Scenario: Fork Both Turning Very Slightly Right - Unnamed Ramps
Given the node map Given the node map
""" | a | | b | | | | | | | | | | | | | | | |
a b | | | | | | | | | | | | c | | | | | | |
c | | | | | | | | | | | | | | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | name | | nodes | highway | name |
@@ -272,11 +213,9 @@ Feature: Fork Instructions
Scenario: Non-Fork on complex intersection - left Scenario: Non-Fork on complex intersection - left
Given the node map Given the node map
""" | | | | | c |
c | a | | b | | |
a b | | e | | | d |
e d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -291,11 +230,9 @@ Feature: Fork Instructions
Scenario: Non-Fork on complex intersection - right Scenario: Non-Fork on complex intersection - right
Given the node map Given the node map
""" | | e | | | c |
e c | a | | b | | |
a b | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -310,11 +247,9 @@ Feature: Fork Instructions
Scenario: Tripple fork Scenario: Tripple fork
Given the node map Given the node map
""" | | | | | | | | | c |
c | a | | b | | d | | | | |
a b d | | | | | | | | | e |
e
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -331,11 +266,9 @@ Feature: Fork Instructions
Scenario: Tripple fork -- middle obvious Scenario: Tripple fork -- middle obvious
Given the node map Given the node map
""" | | | | | c |
c | a | | b | | d |
a b d | | | | | e |
e
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -351,10 +284,8 @@ Feature: Fork Instructions
Scenario: Don't Fork when leaving Road Scenario: Don't Fork when leaving Road
Given the node map Given the node map
""" | a | | b | | c |
a b c | | | | | d |
d
"""
And the ways And the ways
| nodes | highway | | nodes | highway |
@@ -365,23 +296,3 @@ Feature: Fork Instructions
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc | depart,arrive | | a,c | abc,abc | depart,arrive |
| a,d | abc,bd,bd | depart,turn slight right,arrive | | a,d | abc,bd,bd | depart,turn slight right,arrive |
Scenario: Fork on motorway links - don't fork on through
Given the node map
"""
i a
j c b x
"""
And the ways
| nodes | name | highway |
| xb | xbcj | motorway_link |
| bc | xbcj | motorway_link |
| cj | xbcj | motorway_link |
| ci | off | motorway_link |
| ab | on | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,j | on,xbcj | depart,arrive |
| a,i | on,off,off | depart,turn slight right,arrive |
+64 -59
View File
@@ -7,10 +7,8 @@ Feature: Intersections Data
Scenario: Passing Three Way South Scenario: Passing Three Way South
Given the node map Given the node map
""" | a | | b | | c |
a b c | | | d | | |
d
"""
And the ways And the ways
| nodes | name | | nodes | name |
@@ -19,15 +17,13 @@ Feature: Intersections Data
| bd | corner | | bd | corner |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | turns | intersections |
| a,c | through,through | true:90,true:90 true:180 false:270;true:270 | | a,c | through,through | depart,arrive | true:90,true:90 true:180 false:270;true:270 |
Scenario: Passing Three Way North Scenario: Passing Three Way North
Given the node map Given the node map
""" | | | d | | |
d | a | | b | | c |
a b c
"""
And the ways And the ways
| nodes | name | | nodes | name |
@@ -36,15 +32,13 @@ Feature: Intersections Data
| bd | corner | | bd | corner |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | turns | intersections |
| a,c | through,through | true:90,true:0 true:90 false:270;true:270 | | a,c | through,through | depart,arrive | true:90,true:0 true:90 false:270;true:270 |
Scenario: Passing Oneway Street In Scenario: Passing Oneway Street In
Given the node map Given the node map
""" | | | d | | |
d | a | | b | | c |
a b c
"""
And the ways And the ways
| nodes | name | oneway | | nodes | name | oneway |
@@ -53,15 +47,13 @@ Feature: Intersections Data
| db | corner | yes | | db | corner | yes |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | turns | intersections |
| a,c | through,through | true:90,false:0 true:90 false:270;true:270 | | a,c | through,through | depart,arrive | true:90,false:0 true:90 false:270;true:270 |
Scenario: Passing Oneway Street Out Scenario: Passing Oneway Street Out
Given the node map Given the node map
""" | | | d | | |
d | a | | b | | c |
a b c
"""
And the ways And the ways
| nodes | name | oneway | | nodes | name | oneway |
@@ -70,16 +62,14 @@ Feature: Intersections Data
| bd | corner | yes | | bd | corner | yes |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | turns | intersections |
| a,c | through,through | true:90,true:0 true:90 false:270;true:270 | | a,c | through,through | depart,arrive | true:90,true:0 true:90 false:270;true:270 |
Scenario: Passing Two Intersections Scenario: Passing Two Intersections
Given the node map Given the node map
""" | | | e | | | | |
e | a | | b | | c | | d |
a b c d | | | | | f | | |
f
"""
And the ways And the ways
| nodes | name | | nodes | name |
@@ -90,16 +80,33 @@ Feature: Intersections Data
| cf | corner | | cf | corner |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | turns | intersections |
| a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 | | a,d | through,through | depart,arrive | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
Scenario: Regression test #2424
Given the node map
| | | e | | | | | | i | | | | |
| a | | b | | c | | d | | h | | k | | m |
| | | | | f | | | | | | l | | |
And the ways
| nodes | name |
| abcd | Fritz-Elsas-Straße |
| hkm | Fritz-Elsas-Straße |
| dhi | Martin-Luther-Straße |
| be | corner |
| kl | corner |
| cf | corner |
When I route I should get
| waypoints | route | turns |
| a,m | Fritz-Elsas-Straße,Fritz-Elsas-Straße| depart,arrive |
Scenario: Passing Two Intersections, Collapsing Scenario: Passing Two Intersections, Collapsing
Given the node map Given the node map
""" | | | e | | | | |
e | a | | b | | c | | d |
a b c d | | | | | f | | |
f
"""
And the ways And the ways
| nodes | name | | nodes | name |
@@ -110,25 +117,23 @@ Feature: Intersections Data
| cf | corner | | cf | corner |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | turns | intersections |
| a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 | | a,d | through,through | depart,arrive | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
| f,a | corner,through,through | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 | | f,a | corner,through,through | depart,end of road left,arrive | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 |
Scenario: Roundabouts Scenario: Roundabouts
Given the node map Given the node map
""" | | | | | e | | | | |
e | | | | | | | | | |
| | | | | a | | | | |
a | | | | 1 | | 4 | | | |
1 4 | | | | | | | | | |
| f | | b | | | | d | | h |
f b d h | | | | | | | | | |
| | | | 2 | | 3 | | | |
2 3 | | | | | c | | | | |
c | | | | | | | | | |
| | | | | g | | | | |
g
"""
And the ways And the ways
| nodes | junction | | nodes | junction |
@@ -139,10 +144,10 @@ Feature: Intersections Data
| hd | | | hd | |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | turns | intersections |
| e,f | ea,fb,fb | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:90 | | e,f | ea,fb,fb | depart,abcda-exit-1,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:90 |
| e,g | ea,gc,gc | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:0 | | e,g | ea,gc,gc | depart,abcda-exit-2,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:0 |
| e,h | ea,hd,hd | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330,true:90 false:210 true:330;true:270 | | e,h | ea,hd,hd | depart,abcda-exit-3,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330,true:90 false:210 true:330;true:270 |
| e,2 | ea,abcda,abcda | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:327 +-1 | | e,2 | ea,abcda,abcda | depart,abcda-exit-undefined,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:327 +-1 |
| 1,g | abcda,gc,gc | true:214;false:30 true:150 true:270,true:30 true:180 false:330;true:0 | | 1,g | abcda,gc,gc | depart,abcda-exit-2,arrive | true:214;false:30 true:150 true:270,true:30 true:180 false:330;true:0 |
| 1,3 | abcda,abcda | true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:214 | | 1,3 | abcda,abcda | depart,arrive | true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:214 |
-119
View File
@@ -1,119 +0,0 @@
@routing @guidance
Feature: Exceptions for routing onto low-priority roads
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Straight onto low-priority: same name
Given the node map
"""
c
a b d
e
"""
And the ways
| nodes | highway | name |
| abd | residential | road |
| eb | service | service |
| bc | service | service |
When I route I should get
| waypoints | route | turns |
| c,e | service,service | depart,arrive |
| e,c | service,service | depart,arrive |
Scenario: Straight onto low-priority: onto and from unnamed
Given the node map
"""
c
a b d
e
"""
And the ways
| nodes | highway | name |
| abd | residential | road |
| eb | service | |
| bc | service | |
When I route I should get
| waypoints | route | turns |
| e,c | , | depart,arrive |
| c,e | , | depart,arrive |
Scenario: Straight onto low-priority: unnamed
Given the node map
"""
c
a b d
e
"""
And the ways
| nodes | highway | name |
| abd | residential | road |
| eb | service | service |
| bc | service | |
When I route I should get
| waypoints | route | turns |
| e,c | service, | depart,arrive |
| c,e | ,service,service | depart,turn straight,arrive |
Scenario: Straight onto low-priority
Given the node map
"""
a b c
"""
And the ways
| nodes | highway | name |
| ab | residential | road |
| bc | service | service |
When I route I should get
| waypoints | route | turns |
| a,c | road,service,service | depart,new name straight,arrive |
Scenario: Straight onto low-priority, with driveway
Given the node map
"""
f
a b c
"""
And the ways
| nodes | highway | name |
| ab | residential | road |
| bc | service | road |
| bf | driveway | |
When I route I should get
| waypoints | route | turns |
| a,c | road,road | depart,arrive |
Scenario: Straight onto low-priority, with driveway
Given the node map
"""
f
a b c
"""
And the ways
| nodes | highway | name |
| ab | residential | road |
| bc | service | |
| bf | driveway | |
When I route I should get
| waypoints | route | turns |
| a,c | road, | depart,arrive |
| c,a | ,road,road | depart,new name straight,arrive |

Some files were not shown because too many files have changed in this diff Show More