Merge branch 'master' into feature/missingFiles-5359
This commit is contained in:
commit
cc8ded73d0
5
.babelrc
5
.babelrc
@ -1,8 +1,7 @@
|
||||
{
|
||||
"plugins": ["transform-class-properties"],
|
||||
"presets": [
|
||||
"stage-0",
|
||||
"es2015",
|
||||
"react"
|
||||
"@babel/preset-env",
|
||||
"@babel/preset-react"
|
||||
]
|
||||
}
|
||||
|
||||
86
.clang-tidy
86
.clang-tidy
@ -1,4 +1,86 @@
|
||||
---
|
||||
Checks: '-clang-analyzer-*,google-*,llvm-*,misc-*,readability-*,-google-build-explicit-make-pair,-google-explicit-constructor,-google-readability-braces-around-statements,-google-readability-casting,-google-readability-namespace-comments,-google-readability-function,-google-readability-todo,-google-runtime-int,-llvm-namespace-comment,-llvm-header-guard,-llvm-twine-local,-misc-argument-comment,-readability-braces-around-statements,-readability-identifier-naming'
|
||||
...
|
||||
Checks: >
|
||||
bugprone-*,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-branch-clone,
|
||||
-bugprone-misplaced-widening-cast,
|
||||
-bugprone-exception-escape,
|
||||
-bugprone-implicit-widening-of-multiplication-result,
|
||||
-bugprone-integer-division,
|
||||
-bugprone-reserved-identifier,
|
||||
-bugprone-unhandled-self-assignment,
|
||||
-bugprone-forward-declaration-namespace,
|
||||
-bugprone-sizeof-expression,
|
||||
-clang-analyzer-*,
|
||||
-clang-diagnostic-deprecated-declarations,
|
||||
-clang-diagnostic-constant-conversion,
|
||||
cppcoreguidelines-avoid-goto,
|
||||
cppcoreguidelines-no-malloc,
|
||||
cppcoreguidelines-virtual-class-destructor,
|
||||
google-*,
|
||||
-google-build-explicit-make-pair,
|
||||
-google-build-using-namespace,
|
||||
-google-explicit-constructor,
|
||||
-google-default-arguments,
|
||||
-google-readability-braces-around-statements,
|
||||
-google-readability-casting,
|
||||
-google-readability-namespace-comments,
|
||||
-google-readability-function,
|
||||
-google-readability-todo,
|
||||
-google-runtime-int,
|
||||
-google-build-namespaces,
|
||||
-google-runtime-references,
|
||||
-google-readability-function-size,
|
||||
llvm-*,
|
||||
-llvm-namespace-comment,
|
||||
-llvm-qualified-auto,
|
||||
-llvm-include-order,
|
||||
-llvm-else-after-return,
|
||||
-llvm-header-guard,
|
||||
-llvm-twine-local,
|
||||
misc-*,
|
||||
-misc-argument-comment,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-misc-unconventional-assign-operator,
|
||||
-misc-no-recursion,
|
||||
-misc-misplaced-const,
|
||||
-misc-definitions-in-headers,
|
||||
-misc-unused-parameters,
|
||||
performance-*,
|
||||
-performance-noexcept-move-constructor,
|
||||
-performance-move-const-arg,
|
||||
-performance-no-int-to-ptr,
|
||||
readability-*,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-braces-around-statements,
|
||||
-readability-container-size-empty,
|
||||
-readability-convert-member-functions-to-static,
|
||||
-readability-const-return-type,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
-readability-identifier-naming,
|
||||
-readability-implicit-bool-conversion,
|
||||
-readability-magic-numbers,
|
||||
-readability-else-after-return,
|
||||
-readability-inconsistent-declaration-parameter-name,
|
||||
-readability-isolate-declaration,
|
||||
-readability-redundant-declaration,
|
||||
-readability-uppercase-literal-suffix,
|
||||
-readability-named-parameter,
|
||||
-readability-qualified-auto,
|
||||
-readability-suspicious-call-argument,
|
||||
-readability-redundant-access-specifiers,
|
||||
-readability-redundant-member-init,
|
||||
-readability-static-definition-in-anonymous-namespace,
|
||||
-readability-use-anyofallof,
|
||||
-readability-simplify-boolean-expr,
|
||||
-readability-make-member-function-const,
|
||||
-readability-redundant-string-init,
|
||||
-readability-non-const-parameter,
|
||||
-readability-static-accessed-through-instance
|
||||
|
||||
WarningsAsErrors: '*'
|
||||
HeaderFilterRegex: '.*'
|
||||
|
||||
|
||||
|
||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -9,7 +9,7 @@ If your PR is still work in progress please attach the relevant label.
|
||||
|
||||
- [ ] CHANGELOG.md entry ([How to write a changelog entry](http://keepachangelog.com/en/1.0.0/#how))
|
||||
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
|
||||
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/testing.md)
|
||||
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/testing.md))
|
||||
- [ ] review
|
||||
- [ ] adjust for comments
|
||||
- [ ] cherry pick to release branch
|
||||
|
||||
84
.github/workflows/osrm-backend-docker.yml
vendored
Normal file
84
.github/workflows/osrm-backend-docker.yml
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
name: build and publish container image
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
|
||||
- name: Docker meta - debug
|
||||
id: metadebug
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
flavor: |
|
||||
latest=true
|
||||
suffix=-debug,onlatest=true
|
||||
|
||||
- name: Docker meta - assertions
|
||||
id: metaassertions
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
flavor: |
|
||||
latest=true
|
||||
suffix=-assertions,onlatest=true
|
||||
|
||||
- name: Log in to GitHub Docker Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build container image - debug
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: ./docker/Dockerfile
|
||||
tags: ${{ steps.metadebug.outputs.tags }}
|
||||
build-args: |
|
||||
DOCKER_TAG=${{ join(steps.metadebug.outputs.tags ) }}
|
||||
|
||||
|
||||
- name: Build container image - assertions
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: ./docker/Dockerfile
|
||||
tags: ${{ steps.metaassertions.outputs.tags }}
|
||||
build-args: |
|
||||
DOCKER_TAG=${{ join(steps.metaassertions.outputs.tags ) }}
|
||||
|
||||
# build and publish "normal" image as last to get it listed on top
|
||||
- name: Build container image - normal
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: ./docker/Dockerfile
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
build-args: |
|
||||
DOCKER_TAG=${{ join(steps.meta.outputs.tags ) }}
|
||||
|
||||
|
||||
|
||||
665
.github/workflows/osrm-backend.yml
vendored
Normal file
665
.github/workflows/osrm-backend.yml
vendored
Normal file
@ -0,0 +1,665 @@
|
||||
name: osrm-backend CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- v[1-9]+.[0-9]+.[0-9]+
|
||||
- v[1-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+
|
||||
- v[1-9]+.[0-9]+-[0-9a-zA-Z]+
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
CCACHE_TEMPDIR: /tmp/.ccache-temp
|
||||
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
|
||||
CCACHE_VERSION: 3.3.1
|
||||
CMAKE_VERSION: 3.21.2
|
||||
ENABLE_NODE_BINDINGS: "ON"
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
needs: format-taginfo-docs
|
||||
runs-on: windows-2022
|
||||
continue-on-error: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: pip install conan==1.50.0
|
||||
- run: conan --version
|
||||
- run: cmake --version
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- run: node --version
|
||||
- run: npm --version
|
||||
- run: npm install --ignore-scripts
|
||||
- run: npm link --ignore-scripts
|
||||
- uses: microsoft/setup-msbuild@v1.1
|
||||
- name: Build
|
||||
run: |
|
||||
.\scripts\ci\windows-build.bat
|
||||
|
||||
format-taginfo-docs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Enable Node.js cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
- name: Prepare environment
|
||||
run: |
|
||||
npm ci --ignore-scripts
|
||||
export MASON=${GITHUB_WORKSPACE}/scripts/mason.sh
|
||||
${MASON} install clang-format 10.0.0
|
||||
echo "$(${MASON} prefix clang-format 10.0.0)/bin" >> $GITHUB_PATH
|
||||
- name: Run checks
|
||||
run: |
|
||||
./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
./scripts/format.sh && ./scripts/error_on_dirty.sh
|
||||
node ./scripts/validate_changelog.js
|
||||
npm run docs && ./scripts/error_on_dirty.sh
|
||||
|
||||
docker-image:
|
||||
needs: format-taginfo-docs
|
||||
runs-on: ubuntu-22.04
|
||||
continue-on-error: false
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Enable osm.pbf cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: berlin-latest.osm.pbf
|
||||
key: v1-berlin-osm-pbf
|
||||
restore-keys: |
|
||||
v1-berlin-osm-pbf
|
||||
- name: Docker build
|
||||
run: |
|
||||
docker build -t osrm-backend-local -f docker/Dockerfile .
|
||||
- name: Test Docker image
|
||||
run: |
|
||||
if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then
|
||||
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
||||
fi
|
||||
TAG=osrm-backend-local
|
||||
# when `--memory-swap` value equals `--memory` it means container won't use swap
|
||||
# see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details
|
||||
MEMORY_ARGS="--memory=1g --memory-swap=1g"
|
||||
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm
|
||||
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm
|
||||
docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm &
|
||||
curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
|
||||
docker stop osrm-container
|
||||
|
||||
build-test-publish:
|
||||
needs: format-taginfo-docs
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- name: gcc-9-debug-cov
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
CCOMPILER: gcc-9
|
||||
CUCUMBER_TIMEOUT: 20000
|
||||
CXXCOMPILER: g++-9
|
||||
ENABLE_COVERAGE: ON
|
||||
|
||||
- name: gcc-9-debug-asan-ubsan
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
CCOMPILER: gcc-9
|
||||
CUCUMBER_TIMEOUT: 20000
|
||||
CXXCOMPILER: g++-9
|
||||
ENABLE_SANITIZER: ON
|
||||
TARGET_ARCH: x86_64-asan-ubsan
|
||||
OSRM_CONNECTION_RETRIES: 10
|
||||
OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5
|
||||
|
||||
- name: clang-6.0-debug
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
CLANG_VERSION: 6.0.0
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
|
||||
- name: clang-11.0-debug-clang-tidy
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
CLANG_VERSION: 11.0.0
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
ENABLE_CLANG_TIDY: ON
|
||||
|
||||
- name: conan-linux-debug-asan-ubsan
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CLANG_VERSION: 11.0.0
|
||||
ENABLE_CONAN: ON
|
||||
ENABLE_SANITIZER: ON
|
||||
|
||||
- name: conan-linux-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: gcc-11-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: gcc-11
|
||||
CXXCOMPILER: g++-11
|
||||
|
||||
- name: gcc-10-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: gcc-10
|
||||
CXXCOMPILER: g++-10
|
||||
|
||||
- name: gcc-9-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: gcc-9
|
||||
CXXCOMPILER: g++-9
|
||||
CXXFLAGS: -Wno-cast-function-type
|
||||
|
||||
- name: gcc-9-release-i686
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: gcc-9
|
||||
CFLAGS: "-m32 -msse2 -mfpmath=sse"
|
||||
CXXCOMPILER: g++-9
|
||||
CXXFLAGS: "-m32 -msse2 -mfpmath=sse"
|
||||
TARGET_ARCH: i686
|
||||
|
||||
- name: gcc-8-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: gcc-8
|
||||
CXXCOMPILER: g++-8
|
||||
CXXFLAGS: -Wno-cast-function-type
|
||||
|
||||
- name: gcc-7-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: gcc-7
|
||||
CXXCOMPILER: g++-7
|
||||
|
||||
- name: conan-osx-release-node-12
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: macos-11
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang
|
||||
CXXCOMPILER: clang++
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
ENABLE_ASSERTIONS: ON
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: conan-osx-release-node-14
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 14
|
||||
runs-on: macos-11
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang
|
||||
CXXCOMPILER: clang++
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
ENABLE_ASSERTIONS: ON
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: conan-osx-release-node-16
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 16
|
||||
runs-on: macos-11
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang
|
||||
CXXCOMPILER: clang++
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
ENABLE_ASSERTIONS: ON
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: gcc-7-release-shared
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
BUILD_SHARED_LIBS: ON
|
||||
CCOMPILER: gcc-7
|
||||
CXXCOMPILER: g++-7
|
||||
|
||||
- name: node-12-conan-linux-release
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Release
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: node-12-conan-linux-debug
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Debug
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: node-14-conan-linux-release
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 14
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Release
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: node-14-conan-linux-debug
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 14
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Debug
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
|
||||
- name: node-16-conan-linux-release
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Release
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: node-16-conan-linux-debug
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Debug
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: conan-osx-release-node-latest
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: latest
|
||||
runs-on: macos-11
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang
|
||||
CXXCOMPILER: clang++
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
ENABLE_ASSERTIONS: ON
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: node-latest-conan-linux-release
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: latest
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Release
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: node-latest-conan-linux-debug
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: latest
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Debug
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: conan-osx-release-node-lts
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: "lts/*"
|
||||
runs-on: macos-11
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang
|
||||
CXXCOMPILER: clang++
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
ENABLE_ASSERTIONS: ON
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: node-lts-conan-linux-release
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: "lts/*"
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Release
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: node-lts-conan-linux-debug
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: "lts/*"
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Debug
|
||||
CLANG_VERSION: 6.0.0
|
||||
ENABLE_GLIBC_WORKAROUND: ON
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
|
||||
name: ${{ matrix.name}}
|
||||
continue-on-error: ${{ matrix.continue-on-error }}
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
env:
|
||||
BUILD_TOOLS: ${{ matrix.BUILD_TOOLS }}
|
||||
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
|
||||
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }}
|
||||
CCOMPILER: ${{ matrix.CCOMPILER }}
|
||||
CFLAGS: ${{ matrix.CFLAGS }}
|
||||
CLANG_VERSION: ${{ matrix.CLANG_VERSION }}
|
||||
CUCUMBER_TIMEOUT: ${{ matrix.CUCUMBER_TIMEOUT }}
|
||||
CXXCOMPILER: ${{ matrix.CXXCOMPILER }}
|
||||
CXXFLAGS: ${{ matrix.CXXFLAGS }}
|
||||
ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }}
|
||||
ENABLE_CLANG_TIDY: ${{ matrix.ENABLE_CLANG_TIDY }}
|
||||
ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }}
|
||||
ENABLE_GLIBC_WORKAROUND: ${{ matrix.ENABLE_GLIBC_WORKAROUND }}
|
||||
ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }}
|
||||
ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }}
|
||||
NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }}
|
||||
TARGET_ARCH: ${{ matrix.TARGET_ARCH }}
|
||||
OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }}
|
||||
OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- name: Enable Node.js cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
- name: Enable compiler cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ matrix.name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ matrix.name }}-
|
||||
- name: Enable Conan cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.conan
|
||||
key: v2-conan-${{ matrix.name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
v2-conan-${{ matrix.name }}-
|
||||
- name: Enable test cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{github.workspace}}/test/cache
|
||||
key: v2-test-${{ matrix.name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
v2-test-${{ matrix.name }}-
|
||||
|
||||
- name: Prepare environment
|
||||
run: |
|
||||
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
|
||||
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
|
||||
|
||||
echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV
|
||||
echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV
|
||||
|
||||
if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then
|
||||
# We can only set this after checkout once we know the workspace directory
|
||||
echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV
|
||||
echo "UBSAN_OPTIONS=symbolize=1:halt_on_error=1:print_stacktrace=1:suppressions=${GITHUB_WORKSPACE}/scripts/ci/undefinedsanitizer.conf" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
if [[ "${RUNNER_OS}" == "Linux" ]]; then
|
||||
echo "JOBS=$((`nproc` + 1))" >> $GITHUB_ENV
|
||||
export MASON_OS=linux
|
||||
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
|
||||
echo "JOBS=$((`sysctl -n hw.ncpu` + 1))" >> $GITHUB_ENV
|
||||
sudo mdutil -i off /
|
||||
export MASON_OS=osx
|
||||
fi
|
||||
|
||||
echo "MASON=${GITHUB_WORKSPACE}/scripts/mason.sh" >> $GITHUB_ENV
|
||||
echo "CMAKE_URL=https://mason-binaries.s3.amazonaws.com/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}.tar.gz" >> $GITHUB_ENV
|
||||
echo "CMAKE_DIR=mason_packages/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}" >> $GITHUB_ENV
|
||||
|
||||
|
||||
- name: Install dev dependencies
|
||||
run: |
|
||||
python3 -m pip install conan==1.50.0
|
||||
|
||||
# CMake
|
||||
mkdir -p ${CMAKE_DIR}
|
||||
wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR}
|
||||
echo "${CMAKE_DIR}/bin" >> $GITHUB_PATH
|
||||
|
||||
# TBB
|
||||
${MASON} install tbb 2017_U7
|
||||
echo "LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_U7)/lib/:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
|
||||
|
||||
# ccache
|
||||
${MASON} install ccache ${CCACHE_VERSION}
|
||||
echo "$(${MASON} prefix ccache ${CCACHE_VERSION})/bin" >> $GITHUB_PATH
|
||||
|
||||
# clang
|
||||
if [[ -n ${CLANG_VERSION} ]]; then
|
||||
echo "CCOMPILER=clang" >> $GITHUB_ENV
|
||||
echo "CXXCOMPILER=clang++" >> $GITHUB_ENV
|
||||
${MASON} install clang++ ${CLANG_VERSION}
|
||||
echo "$(${MASON} prefix clang++ ${CLANG_VERSION})/bin" >> $GITHUB_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
|
||||
echo "$(${MASON} prefix binutils 2.27)/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
fi
|
||||
|
||||
# Linux dev packages
|
||||
if [ "${TARGET_ARCH}" != "i686" ] && [ "${ENABLE_CONAN}" != "ON" ]; then
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev libtbb-dev libboost-all-dev
|
||||
if [[ -z "${CLANG_VERSION}" ]]; then
|
||||
sudo apt-get install -y ${CXXCOMPILER}
|
||||
fi
|
||||
if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then
|
||||
sudo apt-get install -y lcov
|
||||
fi
|
||||
elif [[ $TARGET_ARCH == "i686" ]]; then
|
||||
source ./scripts/ci/before_install.${TARGET_ARCH}.sh
|
||||
echo "PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Prepare build
|
||||
run: |
|
||||
mkdir ${OSRM_BUILD_DIR}
|
||||
ccache --max-size=256M
|
||||
npm ci --ignore-scripts
|
||||
if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then
|
||||
lcov --directory . --zerocounters # clean cached files
|
||||
fi
|
||||
echo "CC=${CCOMPILER}" >> $GITHUB_ENV
|
||||
echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and install OSRM
|
||||
run: |
|
||||
echo "Using ${JOBS} jobs"
|
||||
pushd ${OSRM_BUILD_DIR}
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_CONAN=${ENABLE_CONAN:-OFF} \
|
||||
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \
|
||||
-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \
|
||||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \
|
||||
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
||||
-DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF}
|
||||
make --jobs=${JOBS}
|
||||
|
||||
if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then
|
||||
make tests --jobs=${JOBS}
|
||||
make benchmarks --jobs=${JOBS}
|
||||
ccache -s
|
||||
sudo make install
|
||||
if [[ "${RUNNER_OS}" == "Linux" ]]; then
|
||||
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV
|
||||
fi
|
||||
echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV
|
||||
fi
|
||||
popd
|
||||
- name: Build example
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
|
||||
run: |
|
||||
mkdir example/build && pushd example/build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||
make --jobs=${JOBS}
|
||||
popd
|
||||
|
||||
- name: Run all tests
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
|
||||
run: |
|
||||
make -C test/data benchmark
|
||||
|
||||
# macOS SIP strips the linker path. Reset this inside the running shell
|
||||
export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }}
|
||||
./example/build/osrm-example test/data/mld/monaco.osrm
|
||||
|
||||
# All tests assume to be run from the build directory
|
||||
pushd ${OSRM_BUILD_DIR}
|
||||
for i in ./unit_tests/*-tests ; do echo Running $i ; $i ; done
|
||||
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
|
||||
npm run nodejs-tests
|
||||
fi
|
||||
popd
|
||||
npm test
|
||||
- name: Run Node package tests only
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
|
||||
run: |
|
||||
npm run nodejs-tests
|
||||
- name: Upload test logs
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: logs
|
||||
path: test/logs/
|
||||
|
||||
- name: Generate code coverage
|
||||
if: ${{ matrix.ENABLE_COVERAGE == 'ON' }}
|
||||
run: |
|
||||
lcov --directory . --capture --output-file coverage.info # capture coverage info
|
||||
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
|
||||
lcov --list coverage.info #debug info
|
||||
# Uploading report to CodeCov
|
||||
- name: Upload code coverage
|
||||
if: ${{ matrix.ENABLE_COVERAGE == 'ON' }}
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
files: coverage.info
|
||||
name: codecov-osrm-backend
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
|
||||
- name: Build Node package
|
||||
if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }}
|
||||
run: ./scripts/ci/node_package.sh
|
||||
- name: Publish Node package
|
||||
if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }}
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifactErrorsFailBuild: true
|
||||
artifacts: build/stage/**/*.tar.gz
|
||||
omitBody: true
|
||||
omitBodyDuringUpdate: true
|
||||
omitName: true
|
||||
omitNameDuringUpdate: true
|
||||
replacesArtifacts: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
ci-complete:
|
||||
runs-on: ubuntu-18.04
|
||||
needs: [build-test-publish, docker-image, windows]
|
||||
steps:
|
||||
- run: echo "CI complete"
|
||||
519
.travis.yml
519
.travis.yml
@ -1,519 +0,0 @@
|
||||
language: cpp
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
||||
# sudo:required is needed for trusty images
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# enable building tags
|
||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||
|
||||
cache:
|
||||
npm: true
|
||||
ccache: true
|
||||
apt: true
|
||||
directories:
|
||||
- test/cache
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: "hk+32aXXF5t1ApaM2Wjqooz3dx1si907L87WRMkO47WlpJmUUU/Ye+MJk9sViH8MdhOcceocVAmdYl5/WFWOIbDWNlBya9QvXDZyIu2KIre/0QyOCTZbrsif8paBXKIO5O/R4OTvIZ8rvWZsadBdmAT9GSbDhih6FzqXAEgeIYQ="
|
||||
- secure: "VE+cFkseFwW4jK6XwkP0yW3h4DixPJ8+Eb3yKcchGZ5iIJxlZ/8i1vKHYxadgPRwSYwPSB14tF70xj2OmiT2keGzZUfphmPXinBaLEhYk+Bde+GZZkoSl5ND109I/LcyNr0nG9dDgtV6pkvFchgchpyP9JnVOOS0+crEZlAz0RE="
|
||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||
- 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
|
||||
- CCACHE_VERSION=3.3.1
|
||||
- CMAKE_VERSION=3.7.2
|
||||
- MASON="$(pwd)/scripts/mason.sh"
|
||||
- ENABLE_NODE_BINDINGS=On
|
||||
- NODE="10"
|
||||
|
||||
stages:
|
||||
- core
|
||||
- optional
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
# We override the compiler names here to yield better ccache behavior, which uses this as key
|
||||
include:
|
||||
|
||||
# Debug Builds
|
||||
- stage: core
|
||||
os: linux
|
||||
compiler: "format-taginfo-docs"
|
||||
env: NODE=10
|
||||
sudo: false
|
||||
before_install:
|
||||
install:
|
||||
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
||||
- source $NVM_DIR/nvm.sh
|
||||
- nvm install $NODE
|
||||
- nvm use $NODE
|
||||
- npm --version
|
||||
- npm ci --ignore-scripts
|
||||
script:
|
||||
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
- ${MASON} install clang-format 3.8.1
|
||||
- PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
|
||||
- node ./scripts/validate_changelog.js
|
||||
# See issue 4043
|
||||
#- npm run docs && ./scripts/error_on_dirty.sh
|
||||
after_success:
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-debug-cov"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'lcov']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
||||
before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- lcov --directory . --zerocounters # clean cached da files
|
||||
after_success:
|
||||
# Creating report
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- lcov --directory . --capture --output-file coverage.info # capture coverage info
|
||||
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
|
||||
- lcov --list coverage.info #debug info
|
||||
# Uploading report to CodeCov
|
||||
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-debug-asan"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
|
||||
- os: linux
|
||||
compiler: "clang-5.0-debug"
|
||||
addons: &clang50
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||
|
||||
- os: linux
|
||||
compiler: "mason-linux-debug-asan"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
|
||||
# Release Builds
|
||||
- os: linux
|
||||
compiler: "mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-9-release"
|
||||
addons: &gcc9
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-9' CXXCOMPILER='g++-9' BUILD_TYPE='Release' CXXFLAGS='-Wno-cast-function-type'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-8-release"
|
||||
addons: &gcc8
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-8', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-8' CXXCOMPILER='g++-8' BUILD_TYPE='Release' CXXFLAGS='-Wno-cast-function-type'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-release"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-release-i686"
|
||||
env: >
|
||||
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-5-release"
|
||||
addons: &gcc49
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release"
|
||||
addons: &gcc49
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-10"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="10"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-8"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="8"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
# Shared Library
|
||||
- os: linux
|
||||
compiler: "gcc-7-release-shared"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
# Node build jobs. These skip running the tests.
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-8-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-8-mason-linux-debug"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-10-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="10"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-10-mason-linux-debug"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="10"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: osx
|
||||
stage: optional
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-latest"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="node"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-latest-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-latest-mason-linux-debug"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-lts"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="--lts"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-lts-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-lts-mason-linux-debug"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=ON
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
allow_failures:
|
||||
- compiler: "mason-osx-release-node-latest"
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="node"
|
||||
- compiler: "node-latest-mason-linux-release"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node"
|
||||
- compiler: "node-latest-mason-linux-debug"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node"
|
||||
- compiler: "mason-osx-release-node-lts"
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="--lts"
|
||||
- compiler: "node-lts-mason-linux-release"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts"
|
||||
- compiler: "node-lts-mason-linux-debug"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts"
|
||||
|
||||
before_install:
|
||||
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
||||
- source $NVM_DIR/nvm.sh
|
||||
- nvm install $NODE
|
||||
- nvm use $NODE
|
||||
- node --version
|
||||
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
|
||||
- |
|
||||
if [[ -z $JOBS ]]; then
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
export JOBS=$((`nproc` + 1))
|
||||
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
||||
fi
|
||||
fi
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
sudo mdutil -i off /
|
||||
fi
|
||||
- export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
|
||||
- export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off")
|
||||
- echo "Using ${JOBS} jobs"
|
||||
- npm ci --ignore-scripts
|
||||
# Bootstrap cmake to be able to run mason
|
||||
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}.tar.gz"
|
||||
- CMAKE_DIR="mason_packages/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}"
|
||||
- mkdir -p ${CMAKE_DIR}
|
||||
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} || travis_terminate 1
|
||||
- export PATH=${CMAKE_DIR}/bin:${PATH}
|
||||
- ${MASON} install tbb 2017_U7 && export LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_U7)/lib/:${LD_LIBRARY_PATH}
|
||||
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_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} || travis_terminate 1
|
||||
# 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} || travis_terminate 1
|
||||
fi
|
||||
fi
|
||||
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
||||
- export OSRM_INSTALL_DIR="$(pwd)/install-osrm"
|
||||
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
|
||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||
- mkdir ${OSRM_BUILD_DIR}
|
||||
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
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_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
||||
-DBUILD_TOOLS=ON \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF}
|
||||
- echo "travis_fold:start:MAKE"
|
||||
- make --jobs=${JOBS}
|
||||
- make tests --jobs=${JOBS}
|
||||
- make benchmarks --jobs=${JOBS}
|
||||
- echo "travis_fold:end:MAKE"
|
||||
- ccache -s
|
||||
- sudo make install
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib
|
||||
fi
|
||||
- popd
|
||||
- mkdir example/build && pushd example/build
|
||||
- export PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
|
||||
script:
|
||||
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
||||
- make -C test/data benchmark
|
||||
- ./example/build/osrm-example test/data/mld/monaco.osrm
|
||||
# All tests assume to be run from the build directory
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- ./unit_tests/library-tests
|
||||
- ./unit_tests/extractor-tests
|
||||
- ./unit_tests/contractor-tests
|
||||
- ./unit_tests/engine-tests
|
||||
- ./unit_tests/util-tests
|
||||
- ./unit_tests/server-tests
|
||||
- ./unit_tests/partitioner-tests
|
||||
- |
|
||||
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
|
||||
npm run nodejs-tests
|
||||
fi
|
||||
- |
|
||||
- popd
|
||||
- npm test
|
||||
87
CHANGELOG.md
87
CHANGELOG.md
@ -1,9 +1,90 @@
|
||||
# Unreleased
|
||||
- Changes from 5.26.0
|
||||
- API:
|
||||
- FIXED: Use Boost.Beast to parse HTTP request. [#6294](https://github.com/Project-OSRM/osrm-backend/pull/6294)
|
||||
- FIXED: Fix inefficient osrm-routed connection handling [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113)
|
||||
- Misc:
|
||||
- CHANGED: missing files list is included in exception message. [#5360](https://github.com/Project-OSRM/osrm-backend/pull/5360)
|
||||
- CHANGED: Do not use deprecated Callback::Call overload in Node bindings. [#6318](https://github.com/Project-OSRM/osrm-backend/pull/6318)
|
||||
- FIXED: Fix distance calculation consistency. [#6315](https://github.com/Project-OSRM/osrm-backend/pull/6315)
|
||||
- FIXED: Fix performance issue after migration to sol2 3.3.0. [#6304](https://github.com/Project-OSRM/osrm-backend/pull/6304)
|
||||
- CHANGED: Pass osm_node_ids by reference in osrm::updater::Updater class. [#6298](https://github.com/Project-OSRM/osrm-backend/pull/6298)
|
||||
- FIXED: Fix bug with reading Set values from Lua scripts. [#6285](https://github.com/Project-OSRM/osrm-backend/pull/6285)
|
||||
- FIXED: Bug in bicycle profile that caused exceptions if there is a highway=bicycle in the data. [#6296](https://github.com/Project-OSRM/osrm-backend/pull/6296)
|
||||
- Build:
|
||||
- CHANGED: Use the latest node on CI. [#6317](https://github.com/Project-OSRM/osrm-backend/pull/6317)
|
||||
- CHANGED: Migrate Windows CI to GitHub Actions. [#6312](https://github.com/Project-OSRM/osrm-backend/pull/6312)
|
||||
- ADDED: Add smoke test for Docker image. [#6313](https://github.com/Project-OSRM/osrm-backend/pull/6313)
|
||||
- CHANGED: Update libosmium to version 2.18.0. [#6303](https://github.com/Project-OSRM/osrm-backend/pull/6303)
|
||||
- CHANGED: Remove EXACT from find_package if using Conan. [#6299](https://github.com/Project-OSRM/osrm-backend/pull/6299)
|
||||
- CHANGED: Configure Undefined Behaviour Sanitizer. [#6290](https://github.com/Project-OSRM/osrm-backend/pull/6290)
|
||||
- CHANGED: Use Conan instead of Mason to install code dependencies. [#6284](https://github.com/Project-OSRM/osrm-backend/pull/6284)
|
||||
- CHANGED: Migrate to C++17. Update sol2 to 3.3.0. [#6279](https://github.com/Project-OSRM/osrm-backend/pull/6279)
|
||||
- CHANGED: Update macOS CI image to macos-11. [#6286](https://github.com/Project-OSRM/osrm-backend/pull/6286)
|
||||
- CHANGED: Enable even more clang-tidy checks. [#6273](https://github.com/Project-OSRM/osrm-backend/pull/6273)
|
||||
- CHANGED: Configure CMake to not build flatbuffers tests and samples. [#6274](https://github.com/Project-OSRM/osrm-backend/pull/6274)
|
||||
- CHANGED: Enable more clang-tidy checks. [#6270](https://github.com/Project-OSRM/osrm-backend/pull/6270)
|
||||
- CHANGED: Configure clang-tidy job on CI. [#6261](https://github.com/Project-OSRM/osrm-backend/pull/6261)
|
||||
- CHANGED: Use Github Actions for building container images [#6138](https://github.com/Project-OSRM/osrm-backend/pull/6138)
|
||||
- CHANGED: Upgrade Boost dependency to 1.70 [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113)
|
||||
- CHANGED: Upgrade Ubuntu CI builds to 20.04 [#6119](https://github.com/Project-OSRM/osrm-backend/pull/6119)
|
||||
- CHANGED: Make building osrm-routed optional [#6144](https://github.com/Project-OSRM/osrm-backend/pull/6144)
|
||||
- FIXED: Run all unit tests in CI [#5248](https://github.com/Project-OSRM/osrm-backend/pull/5248)
|
||||
- FIXED: Fix installation of Mason CMake and 32 bit CI build [#6170](https://github.com/Project-OSRM/osrm-backend/pull/6170)
|
||||
- FIXED: Fixed Node docs generation check in CI. [#6058](https://github.com/Project-OSRM/osrm-backend/pull/6058)
|
||||
- CHANGED: Docker build, enabled arm64 build layer [#6172](https://github.com/Project-OSRM/osrm-backend/pull/6172)
|
||||
- CHANGED: Docker build, enabled apt-get update/install caching in separate layer for build phase [#6175](https://github.com/Project-OSRM/osrm-backend/pull/6175)
|
||||
|
||||
# 5.26.0
|
||||
- Changes from 5.25.0
|
||||
- API:
|
||||
- FIXED: Allow for special characters in the profile/method as part of the HTTP URL. [#6090](https://github.com/Project-OSRM/osrm-backend/pull/6090)
|
||||
- FIXED: Set osrm-routed to immediately close bad connections [#6112](https://github.com/Project-OSRM/osrm-backend/pull/6112)
|
||||
- Build:
|
||||
- CHANGED: Replace Travis with Github Actions for CI builds [#6071](https://github.com/Project-OSRM/osrm-backend/pull/6071)
|
||||
- FIXED: Fixed Boost link flags in pkg-config file. [#6083](https://github.com/Project-OSRM/osrm-backend/pull/6083)
|
||||
- FIXED: Fixed test cache to consider MLD executable changes. [#6129](https://github.com/Project-OSRM/osrm-backend/pull/6129)
|
||||
- Routing:
|
||||
- FIXED: Fix generation of inefficient MLD partitions [#6084](https://github.com/Project-OSRM/osrm-backend/pull/6084)
|
||||
- FIXED: Fix MLD level mask generation to support 64-bit masks. [#6123](https://github.com/Project-OSRM/osrm-backend/pull/6123)
|
||||
- FIXED: Fix metric offset overflow for large MLD partitions. This breaks the **data format** [#6124](https://github.com/Project-OSRM/osrm-backend/pull/6124)
|
||||
|
||||
# 5.25.0
|
||||
- Changes from 5.24.0
|
||||
- Build:
|
||||
- CHANGED: Node binaries now use Github Releases for hosting [#6030](https://github.com/Project-OSRM/osrm-backend/pull/6030)
|
||||
- Misc:
|
||||
- FIXED: Upgrade to @mapbox/node-pre-gyp fix various bugs with Node 12/14 [#5991](https://github.com/Project-OSRM/osrm-backend/pull/5991)
|
||||
- FIXED: `valid` type in documentation examples [#5990](https://github.com/Project-OSRM/osrm-backend/issues/5990)
|
||||
- FIXED: Remove redundant loading of .osrm.cell_metrics [#6019](https://github.com/Project-OSRM/osrm-backend/issues/6019)
|
||||
- CHANGED: Increase PackedOSMIDs size to 34 bits. This breaks the **data format** [#6020](https://github.com/Project-OSRM/osrm-backend/issues/6020)
|
||||
- Profile:
|
||||
- FIXED: Add kerb barrier exception to default car profile. [#5999](https://github.com/Project-OSRM/osrm-backend/pull/5999)
|
||||
|
||||
# 5.24.0
|
||||
- Changes from 5.23.0
|
||||
- Features
|
||||
- ADDED: Added support for multiple via-way restrictions. [#5907](https://github.com/Project-OSRM/osrm-backend/pull/5907)
|
||||
- ADDED: Add node bindings support for Node 12, 14, and publish binaries [#5918](https://github.com/Project-OSRM/osrm-backend/pull/5918)
|
||||
- REMOVED: we no longer publish Node 8 binary modules (they are still buildable from source) [#5918](https://github.com/Project-OSRM/osrm-backend/pull/5918)
|
||||
- Routing:
|
||||
- FIXED: Avoid copying ManyToMany table results [#5923](https://github.com/Project-OSRM/osrm-backend/pull/5923)
|
||||
- FIXED: Reduce copying in API parameter constructors [#5925](https://github.com/Project-OSRM/osrm-backend/pull/5925)
|
||||
- Misc:
|
||||
- CHANGED: Cleanup NodeJS dependencies [#5945](https://github.com/Project-OSRM/osrm-backend/pull/5945)
|
||||
- CHANGED: Unify `.osrm.turn_penalites_index` dump processing same with `.osrm.turn_weight_penalties` and `.osrm.turn_duration_penalties` [#5868](https://github.com/Project-OSRM/osrm-backend/pull/5868)
|
||||
- FIXED: Properly validate source/destination validation in NodeJS table service [#5595](https://github.com/Project-OSRM/osrm-backend/pull/5595/files)
|
||||
- FIXED: turn.roads_on_the_left not containing incoming roads and turn.roads_on_the_right not containing outgoing roads on two-way roads [#5128](https://github.com/Project-OSRM/osrm-backend/issues/5128)
|
||||
- Profile:
|
||||
- ADDED: Profile debug script which fetches a way from OSM then outputs the result of the profile. [#5908](https://github.com/Project-OSRM/osrm-backend/pull/5908)
|
||||
- Infrastructure
|
||||
- CHANGED: Bundled protozero updated to v1.7.0. [#5858](https://github.com/Project-OSRM/osrm-backend/pull/5858)
|
||||
- Features
|
||||
- CHANGED: missing files list is included in exception message. [#5360](https://github.com/Project-OSRM/osrm-backend/pull/5360)
|
||||
- Windows:
|
||||
- FIXED: Fix bit-shift overflow in MLD partition step. [#5878](https://github.com/Project-OSRM/osrm-backend/pull/5878)
|
||||
- FIXED: Fix vector bool permutation in graph contraction step [#5882](https://github.com/Project-OSRM/osrm-backend/pull/5882)
|
||||
- API:
|
||||
- FIXED: Undo libosrm API break by adding old interface as method overload [#5861](https://github.com/Project-OSRM/osrm-backend/pull/5861)
|
||||
- FIXED: Fixed validation of sources/destinations when accessed via node bindings [#5595](https://github.com/Project-OSRM/osrm-backend/pull/5595)
|
||||
|
||||
# 5.23.0
|
||||
- Changes from 5.22.0
|
||||
@ -85,7 +166,7 @@
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5076/)
|
||||
- CHANGED: Foot profile now blacklists barriers instead of whitelisting them [#5077
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5077/)
|
||||
- CHANGED: Support maxlength and maxweight in car profile [#5101](https://github.com/Project-OSRM/osrm-backend/pull/5101]
|
||||
- CHANGED: Support maxlength and maxweight in car profile [#5101](https://github.com/Project-OSRM/osrm-backend/pull/5101)
|
||||
- Bugfixes:
|
||||
- FIXED: collapsing of ExitRoundabout instructions [#5114](https://github.com/Project-OSRM/osrm-backend/issues/5114)
|
||||
- Misc:
|
||||
|
||||
271
CMakeLists.txt
271
CMakeLists.txt
@ -1,4 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
|
||||
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
|
||||
message(FATAL_ERROR "In-source builds are not allowed.
|
||||
@ -18,10 +21,11 @@ if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR})
|
||||
set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
option(ENABLE_MASON "Use mason for dependencies" OFF)
|
||||
option(ENABLE_CONAN "Use conan 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(BUILD_ROUTED "Build osrm-routed HTTP server" ON)
|
||||
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
||||
option(ENABLE_DEBUG_LOGGING "Use debug logging in release mode" OFF)
|
||||
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||
@ -31,27 +35,20 @@ option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
|
||||
option(ENABLE_GLIBC_WORKAROUND "Workaround GLIBC symbol exports" OFF)
|
||||
option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF)
|
||||
|
||||
if (ENABLE_CLANG_TIDY)
|
||||
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
|
||||
if(NOT CLANG_TIDY_COMMAND)
|
||||
message(FATAL_ERROR "ENABLE_CLANG_TIDY is ON but clang-tidy is not found!")
|
||||
else()
|
||||
message(STATUS "Found clang-tidy at ${CLANG_TIDY_COMMAND}")
|
||||
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND};--warnings-as-errors=*")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
if(ENABLE_MASON)
|
||||
# versions in use
|
||||
set(MASON_BOOST_VERSION "1.65.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_U7")
|
||||
|
||||
message(STATUS "Enabling mason")
|
||||
|
||||
find_program(CURL_FOUND curl)
|
||||
if(NOT CURL_FOUND)
|
||||
message(FATAL_ERROR "curl command required with -DENABLE_MASON")
|
||||
endif()
|
||||
|
||||
include(mason)
|
||||
endif()
|
||||
|
||||
# be compatible with version handling before cmake 3.x
|
||||
if (POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
@ -132,7 +129,7 @@ endif()
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_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/sol2-3.3.0/include)
|
||||
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)
|
||||
@ -162,7 +159,11 @@ add_library(CONTRACTOR OBJECT ${ContractorGlob})
|
||||
add_library(UPDATER OBJECT ${UpdaterGlob})
|
||||
add_library(STORAGE OBJECT ${StorageGlob})
|
||||
add_library(ENGINE OBJECT ${EngineGlob})
|
||||
add_library(SERVER OBJECT ${ServerGlob})
|
||||
|
||||
if (BUILD_ROUTED)
|
||||
add_library(SERVER OBJECT ${ServerGlob})
|
||||
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
||||
endif()
|
||||
|
||||
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
@ -170,7 +171,6 @@ add_executable(osrm-extract src/tools/extract.cpp)
|
||||
add_executable(osrm-partition src/tools/partition.cpp)
|
||||
add_executable(osrm-customize src/tools/customize.cpp)
|
||||
add_executable(osrm-contract src/tools/contract.cpp)
|
||||
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
@ -201,13 +201,6 @@ if(ENABLE_GOLD_LINKER)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Disable LTO when mason+gcc is detected before testing for / setting any flags.
|
||||
# Mason builds libraries with Clang, mixing does not work in the context of lto.
|
||||
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND ENABLE_LTO)
|
||||
set(ENABLE_LTO OFF)
|
||||
message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
|
||||
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.
|
||||
@ -308,9 +301,9 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
||||
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")
|
||||
# TODO: this was added for Mason, we are not sure if it is true after migration to Conan
|
||||
if(UNIX AND NOT APPLE AND ENABLE_CONAN AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
|
||||
message(WARNING "ENABLE_CONAN and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux systems currently")
|
||||
endif()
|
||||
|
||||
set(MAYBE_COVERAGE_LIBRARIES "")
|
||||
@ -323,11 +316,14 @@ if (ENABLE_COVERAGE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ftest-coverage -fprofile-arcs")
|
||||
endif()
|
||||
|
||||
|
||||
if (ENABLE_SANITIZER)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
||||
set(SANITIZER_FLAGS "-g -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=undefined -fno-omit-frame-pointer")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${SANITIZER_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SANITIZER_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Configuring compilers
|
||||
@ -360,7 +356,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
# using Visual Studio C++
|
||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # avoid compiler error C1128 from scripting_environment_lua.cpp
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32_LEAN_AND_MEAN") # avoid compiler error C2011 from dual #include of winsock.h and winsock2.h
|
||||
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
|
||||
@ -397,16 +392,13 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
|
||||
# Activate C++1y
|
||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++14")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++17")
|
||||
endif()
|
||||
|
||||
# Configuring other platform dependencies
|
||||
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")
|
||||
message(STATUS "Set Architecture to x64 on OS X")
|
||||
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
|
||||
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
|
||||
if(OSXLIBSTD)
|
||||
@ -433,7 +425,7 @@ include_directories(SYSTEM ${MICROTAR_INCLUDE_DIR})
|
||||
|
||||
set(MBXGEOM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/geometry.hpp-0.9.2/include")
|
||||
include_directories(SYSTEM ${MBXGEOM_INCLUDE_DIR})
|
||||
set(CHEAPRULER_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cheap-ruler-cpp-2.5.4/include")
|
||||
set(CHEAPRULER_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cheap-ruler-cpp-2778eb8/include")
|
||||
include_directories(SYSTEM ${CHEAPRULER_INCLUDE_DIR})
|
||||
|
||||
add_library(MICROTAR OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src/microtar.c")
|
||||
@ -445,83 +437,98 @@ include_directories(SYSTEM ${PROTOZERO_INCLUDE_DIR})
|
||||
set(VTZERO_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/vtzero/include")
|
||||
include_directories(SYSTEM ${VTZERO_INCLUDE_DIR})
|
||||
|
||||
set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "Disable the build of Flatbuffers tests and samples.")
|
||||
set(FLATBUFFERS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers")
|
||||
set(FLATBUFFERS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers/include")
|
||||
include_directories(${FLATBUFFERS_INCLUDE_DIR})
|
||||
include_directories(SYSTEM ${FLATBUFFERS_INCLUDE_DIR})
|
||||
add_subdirectory(${FLATBUFFERS_SRC_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
# 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")
|
||||
# see https://stackoverflow.com/questions/70898030/boost-link-error-using-conan-find-package
|
||||
if (MSVC)
|
||||
add_definitions(-DBOOST_ALL_NO_LIB)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CONAN)
|
||||
message(STATUS "Installing dependencies via Conan")
|
||||
|
||||
# Conan will generate Find*.cmake files to build directory, so we use them with the highest priority
|
||||
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR})
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_BINARY_DIR})
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/conan.cmake)
|
||||
|
||||
set(CONAN_BOOST_VERSION 1.79.0)
|
||||
set(CONAN_BZIP2_VERSION 1.0.8)
|
||||
set(CONAN_EXPAT_VERSION 2.2.10)
|
||||
set(CONAN_LUA_VERSION 5.4.4)
|
||||
set(CONAN_TBB_VERSION 2020.3)
|
||||
|
||||
set(CONAN_SYSTEM_INCLUDES ON)
|
||||
|
||||
# TODO:
|
||||
# if we link TBB dynamically osrm-extract.exe finishes on the first access to any TBB symbol
|
||||
# with exit code = -1073741515, which means that program cannot load required DLL.
|
||||
if (MSVC)
|
||||
set(TBB_SHARED False)
|
||||
else()
|
||||
set(TBB_SHARED True)
|
||||
endif()
|
||||
|
||||
conan_cmake_run(
|
||||
REQUIRES
|
||||
boost/${CONAN_BOOST_VERSION}
|
||||
bzip2/${CONAN_BZIP2_VERSION}
|
||||
expat/${CONAN_EXPAT_VERSION}
|
||||
lua/${CONAN_LUA_VERSION}
|
||||
tbb/${CONAN_TBB_VERSION}
|
||||
BASIC_SETUP
|
||||
BUILD missing
|
||||
GENERATORS cmake_find_package
|
||||
KEEP_RPATHS
|
||||
NO_OUTPUT_DIRS
|
||||
OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake
|
||||
tbb:shared=${TBB_SHARED}
|
||||
)
|
||||
|
||||
add_dependency_includes(${CONAN_INCLUDE_DIRS_BOOST})
|
||||
add_dependency_includes(${CONAN_INCLUDE_DIRS_BZIP2})
|
||||
add_dependency_includes(${CONAN_INCLUDE_DIRS_EXPAT})
|
||||
add_dependency_includes(${CONAN_INCLUDE_DIRS_LUA})
|
||||
add_dependency_includes(${CONAN_INCLUDE_DIRS_TBB})
|
||||
|
||||
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})
|
||||
find_package(Boost REQUIRED EXACT ${CONAN_BOOST_VERSION} COMPONENTS ${BOOST_COMPONENTS})
|
||||
set(Boost_DATE_TIME_LIBRARY "${Boost_date_time_LIB_TARGETS}")
|
||||
set(Boost_CHRONO_LIBRARY "${Boost_chrono_LIB_TARGETS}")
|
||||
set(Boost_PROGRAM_OPTIONS_LIBRARY "${Boost_program_options_LIB_TARGETS}")
|
||||
set(Boost_FILESYSTEM_LIBRARY "${Boost_filesystem_LIB_TARGETS}")
|
||||
set(Boost_IOSTREAMS_LIBRARY "${Boost_iostreams_LIB_TARGETS}")
|
||||
set(Boost_THREAD_LIBRARY "${Boost_thread_LIB_TARGETS}")
|
||||
set(Boost_SYSTEM_LIBRARY "${Boost_system_LIB_TARGETS}")
|
||||
set(Boost_ZLIB_LIBRARY "${Boost_zlib_LIB_TARGETS}")
|
||||
set(Boost_REGEX_LIBRARY "${Boost_regex_LIB_TARGETS}")
|
||||
set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY "${Boost_unit_test_framework_LIB_TARGETS}")
|
||||
|
||||
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
|
||||
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
|
||||
set(EXPAT_LIBRARIES ${MASON_PACKAGE_expat_STATIC_LIBS})
|
||||
find_package(BZip2 REQUIRED)
|
||||
find_package(EXPAT REQUIRED)
|
||||
find_package(lua REQUIRED)
|
||||
set(LUA_LIBRARIES ${lua_LIBRARIES})
|
||||
|
||||
mason_use(lua VERSION ${MASON_LUA_VERSION})
|
||||
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
|
||||
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
|
||||
find_package(TBB REQUIRED)
|
||||
|
||||
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,@loader_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
|
||||
# expat and bzip2 are used from conan 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})
|
||||
if (BUILD_ROUTED)
|
||||
# osrm-routed requires newer boost:asio
|
||||
find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
else()
|
||||
find_package(Boost 1.60 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
endif()
|
||||
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
||||
|
||||
find_package(TBB REQUIRED)
|
||||
@ -541,7 +548,6 @@ else()
|
||||
message(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
endif()
|
||||
|
||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
|
||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||
|
||||
# add a target to generate API documentation with Doxygen
|
||||
@ -575,19 +581,11 @@ if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILE
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# even with mason builds we want to link to system zlib
|
||||
# even with conan 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)
|
||||
@ -614,7 +612,9 @@ target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
target_link_libraries(osrm-partition osrm_partition ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-customize osrm_customize ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
||||
if (BUILD_ROUTED)
|
||||
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
||||
endif()
|
||||
|
||||
set(EXTRACTOR_LIBRARIES
|
||||
${BZIP2_LIBRARIES}
|
||||
@ -622,7 +622,7 @@ set(EXTRACTOR_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${EXPAT_LIBRARIES}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${LUA_LIBRARIES}
|
||||
${OSMIUM_LIBRARIES}
|
||||
${TBB_LIBRARIES}
|
||||
${ZLIB_LIBRARY}
|
||||
@ -630,7 +630,7 @@ set(EXTRACTOR_LIBRARIES
|
||||
set(GUIDANCE_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${LUA_LIBRARIES}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(PARTITIONER_LIBRARIES
|
||||
@ -656,7 +656,7 @@ set(UPDATER_LIBRARIES
|
||||
set(CONTRACTOR_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${LUA_LIBRARIES}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_RT_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
@ -697,7 +697,7 @@ install(TARGETS osrm-components DESTINATION bin)
|
||||
if(BUILD_TOOLS)
|
||||
message(STATUS "Activating OSRM internal tools")
|
||||
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES} ${TBB_LIBRARIES})
|
||||
|
||||
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
||||
endif()
|
||||
@ -719,7 +719,9 @@ set_property(TARGET osrm-extract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set_property(TARGET osrm-partition PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
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-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
if (BUILD_ROUTED)
|
||||
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
endif()
|
||||
|
||||
file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp)
|
||||
file(GLOB FlatbuffersGlob third_party/flatbuffers/include/flatbuffers/*.h)
|
||||
@ -748,7 +750,9 @@ install(TARGETS osrm-partition DESTINATION bin)
|
||||
install(TARGETS osrm-customize DESTINATION bin)
|
||||
install(TARGETS osrm-contract DESTINATION bin)
|
||||
install(TARGETS osrm-datastore DESTINATION bin)
|
||||
install(TARGETS osrm-routed DESTINATION bin)
|
||||
if (BUILD_ROUTED)
|
||||
install(TARGETS osrm-routed DESTINATION bin)
|
||||
endif()
|
||||
install(TARGETS osrm DESTINATION lib)
|
||||
install(TARGETS osrm_extract DESTINATION lib)
|
||||
install(TARGETS osrm_partition DESTINATION lib)
|
||||
@ -802,9 +806,26 @@ 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)
|
||||
# Boost uses imported targets, we need to use a generator expression to extract
|
||||
# the link libraries to be written to the pkg-config file.
|
||||
# Conan defines dependencies as CMake targets too, that's why we do the same for them.
|
||||
foreach(engine_lib ${ENGINE_LIBRARIES})
|
||||
if("${engine_lib}" MATCHES "^Boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*")
|
||||
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$<TARGET_LINKER_FILE:${engine_lib}>")
|
||||
else()
|
||||
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}")
|
||||
endif()
|
||||
endforeach(engine_lib)
|
||||
JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY)
|
||||
file(GENERATE
|
||||
OUTPUT
|
||||
${PROJECT_BINARY_DIR}/libosrm.pc
|
||||
INPUT
|
||||
${PROJECT_BINARY_DIR}/pkgconfig.configured)
|
||||
|
||||
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${PKGCONFIG_LIBRARY_DIR}/pkgconfig)
|
||||
|
||||
# uninstall target
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
| Linux / macOS | Windows | Code Coverage |
|
||||
| ------------- | ------- | ------------- |
|
||||
| [](https://travis-ci.org/Project-OSRM/osrm-backend) | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
| [](https://github.com/Project-OSRM/osrm-backend/actions/workflows/osrm-backend.yml) | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
|
||||
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
|
||||
|
||||
|
||||
@ -1,183 +0,0 @@
|
||||
@ECHO OFF
|
||||
SETLOCAL
|
||||
SET EL=0
|
||||
|
||||
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
SET PROJECT_DIR=%CD%
|
||||
ECHO PROJECT_DIR^: %PROJECT_DIR%
|
||||
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
||||
|
||||
|
||||
:: Check CMake version
|
||||
SET CMAKE_VERSION=3.16.3
|
||||
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
|
||||
ECHO cmake^: && cmake --version
|
||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
||||
|
||||
cmake --version | findstr /C:%CMAKE_VERSION% && GOTO CMAKE_OK
|
||||
|
||||
:CMAKE_NOT_OK
|
||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||
powershell Invoke-WebRequest https://cmake.org/files/v3.16/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
||||
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 %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
:CMAKE_OK
|
||||
ECHO CMAKE_OK
|
||||
cmake --version
|
||||
|
||||
ECHO activating VS command prompt ...
|
||||
SET PATH=C:\Program Files (x86)\MSBuild\15.0\Bin;%PATH%
|
||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
|
||||
ECHO platform^: %platform%
|
||||
|
||||
ECHO cl.exe version
|
||||
cl
|
||||
ECHO msbuild version
|
||||
msbuild /version
|
||||
|
||||
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
||||
SET DEPSPKG=osrm-deps-win-x64-14.2-2019.01.7z
|
||||
|
||||
:: local development
|
||||
ECHO.
|
||||
ECHO LOCAL_DEV^: %LOCAL_DEV%
|
||||
IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0
|
||||
IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL
|
||||
|
||||
IF EXIST %DEPSPKG% DEL %DEPSPKG%
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO downloading %DEPSPKG%
|
||||
powershell Invoke-WebRequest http://project-osrm.wolt.com/windows-build-deps/$env:DEPSPKG -OutFile $env:PROJECT_DIR\$env:DEPSPKG
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
:SKIPDL
|
||||
|
||||
IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
IF EXIST build ECHO deleting build dir... && RD /S /Q build
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive"
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
::tree osrm-deps
|
||||
|
||||
MKDIR build
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
cd build
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
SET OSRMDEPSDIR=%PROJECT_DIR%/osrm-deps
|
||||
set PREFIX=%OSRMDEPSDIR%/libs
|
||||
set BOOST_ROOT=%OSRMDEPSDIR%
|
||||
set BOOST_LIBRARYDIR=%BOOST_ROOT%/lib
|
||||
set TBB_INSTALL_DIR=%OSRMDEPSDIR%
|
||||
REM set TBB_ARCH_PLATFORM=intel64/vc17
|
||||
|
||||
ECHO OSRMDEPSDIR ^: %OSRMDEPSDIR%
|
||||
ECHO PREFIX ^: %PREFIX%
|
||||
ECHO BOOST_ROOT ^: %BOOST_ROOT%
|
||||
ECHO BOOST_LIBRARYDIR ^: %BOOST_LIBRARYDIR%
|
||||
ECHO TBB_INSTALL_DIR ^: %TBB_INSTALL_DIR%
|
||||
REM ECHO TBB_ARCH_PLATFORM ^: %TBB_ARCH_PLATFORM%
|
||||
|
||||
|
||||
ECHO calling cmake ....
|
||||
cmake .. ^
|
||||
-G "Visual Studio 16 2019" ^
|
||||
-DBOOST_ROOT=%BOOST_ROOT% ^
|
||||
-DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^
|
||||
-DBoost_ADDITIONAL_VERSIONS=1.73.0 ^
|
||||
-DBoost_USE_MULTITHREADED=ON ^
|
||||
-DBoost_USE_STATIC_LIBS=ON ^
|
||||
-DEXPAT_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DEXPAT_LIBRARY=%OSRMDEPSDIR%/lib/libexpat.lib ^
|
||||
-DBZIP2_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DBZIP2_LIBRARIES=%OSRMDEPSDIR%/lib/libbz2.lib ^
|
||||
-DLUA_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DLUA_LIBRARIES=%OSRMDEPSDIR%/lib/lua5.3.5.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DZLIB_LIBRARY=%OSRMDEPSDIR%/lib/libz.lib ^
|
||||
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
|
||||
-DCMAKE_INSTALL_PREFIX=%PREFIX%
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO building ...
|
||||
msbuild OSRM.sln ^
|
||||
/p:Configuration=%Configuration% ^
|
||||
/p:Platform=x64 ^
|
||||
/t:rebuild ^
|
||||
/p:BuildInParallel=true ^
|
||||
/m:%NUMBER_OF_PROCESSORS% ^
|
||||
/toolsversion:Current ^
|
||||
/p:PlatformToolset=v142 ^
|
||||
/clp:Verbosity=normal ^
|
||||
/nologo ^
|
||||
/flp1:logfile=build_errors.txt;errorsonly ^
|
||||
/flp2:logfile=build_warnings.txt;warningsonly
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
|
||||
CD %PROJECT_DIR%\build
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
|
||||
SET PATH=%PROJECT_DIR%\osrm-deps\lib;%PATH%
|
||||
|
||||
ECHO running extractor-tests.exe ...
|
||||
unit_tests\%Configuration%\extractor-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
|
||||
ECHO running engine-tests.exe ...
|
||||
unit_tests\%Configuration%\engine-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
|
||||
ECHO running util-tests.exe ...
|
||||
unit_tests\%Configuration%\util-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
|
||||
ECHO running server-tests.exe ...
|
||||
unit_tests\%Configuration%\server-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
|
||||
::TODO: CH processing sometimes mysteriously hangs, need to find why and enable tests below.
|
||||
::ECHO running library-tests.exe ...
|
||||
::SET test_region=monaco
|
||||
::SET test_region_ch=ch\monaco
|
||||
::SET test_region_corech=corech\monaco
|
||||
::SET test_region_mld=mld\monaco
|
||||
::SET test_osm=%test_region%.osm.pbf
|
||||
::IF NOT EXIST %test_osm% powershell Invoke-WebRequest http://project-osrm.wolt.com/testing/monaco.osm.pbf -OutFile %test_osm%
|
||||
::ECHO running %Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
||||
::%Configuration%\osrm-extract.exe
|
||||
::%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
||||
::MKDIR ch
|
||||
::XCOPY %test_region%.osrm.* ch\
|
||||
::XCOPY %test_region%.osrm ch\
|
||||
::MKDIR corech
|
||||
::XCOPY %test_region%.osrm.* corech\
|
||||
::XCOPY %test_region%.osrm corech\
|
||||
::MKDIR mld
|
||||
::XCOPY %test_region%.osrm.* mld\
|
||||
::XCOPY %test_region%.osrm mld\
|
||||
::%Configuration%\osrm-contract.exe %test_region_ch%.osrm
|
||||
::%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
|
||||
::%Configuration%\osrm-partition.exe %test_region_mld%.osrm
|
||||
::%Configuration%\osrm-customize.exe %test_region_mld%.osrm
|
||||
::XCOPY /Y ch\*.* ..\test\data\ch\
|
||||
::XCOPY /Y corech\*.* ..\test\data\corech\
|
||||
::XCOPY /Y mld\*.* ..\test\data\mld\
|
||||
::unit_tests\%Configuration%\library-tests.exe
|
||||
|
||||
:ERROR
|
||||
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
ECHO ERRORLEVEL^: %ERRORLEVEL%
|
||||
SET EL=%ERRORLEVEL%
|
||||
|
||||
:DONE
|
||||
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
EXIT /b %EL%
|
||||
27
appveyor.yml
27
appveyor.yml
@ -1,15 +1,3 @@
|
||||
environment:
|
||||
matrix:
|
||||
- configuration: Release
|
||||
# - configuration: Debug
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 6
|
||||
|
||||
# scripts that are called at very beginning, before repo cloning
|
||||
init:
|
||||
- git config --global core.autocrlf input
|
||||
|
||||
os: Visual Studio 2019
|
||||
|
||||
# clone directory
|
||||
@ -17,20 +5,11 @@ clone_folder: c:\projects\osrm
|
||||
|
||||
platform: x64
|
||||
|
||||
# no-op for the time being until someone with access to GitHub checks settings will remove integration with AppVeyor
|
||||
# https://github.com/Project-OSRM/osrm-backend/pull/6312#issuecomment-1217237055
|
||||
build_script:
|
||||
- CALL appveyor-build.bat
|
||||
|
||||
before_test:
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm install --ignore-scripts
|
||||
- npm link --ignore-scripts
|
||||
- SET PATH=%CD%\osrm-deps\lib;%PATH%
|
||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||
# TODO tests fail with "JavaScript heap out of memory", need a better host?
|
||||
# - npm test
|
||||
- EXIT 0
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ 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)
|
||||
set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)
|
||||
|
||||
if (Lua_FIND_VERSION_EXACT)
|
||||
if (Lua_FIND_VERSION_COUNT GREATER 1)
|
||||
|
||||
1026
cmake/conan.cmake
Normal file
1026
cmake/conan.cmake
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,14 +1,16 @@
|
||||
FROM debian:stretch-slim as builder
|
||||
FROM debian:bullseye-slim as builder
|
||||
ARG DOCKER_TAG
|
||||
ARG BUILD_CONCURRENCY
|
||||
RUN mkdir -p /src && mkdir -p /opt
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libxml2-dev \
|
||||
libzip-dev libboost1.74-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
|
||||
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
|
||||
RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)} && \
|
||||
apt-get update && \
|
||||
apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libxml2-dev \
|
||||
libzip-dev libboost1.62-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 && \
|
||||
echo "Building OSRM ${DOCKER_TAG}" && \
|
||||
git show --format="%H" | head -n1 > /opt/OSRM_GITSHA && \
|
||||
echo "Building OSRM gitsha $(cat /opt/OSRM_GITSHA)" && \
|
||||
@ -27,15 +29,15 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null ||
|
||||
strip /usr/local/bin/* && \
|
||||
rm -rf /src /usr/local/lib/libosrm*
|
||||
|
||||
|
||||
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
|
||||
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
|
||||
FROM debian:stretch-slim as runstage
|
||||
FROM debian:bullseye-slim as runstage
|
||||
RUN mkdir -p /src && mkdir -p /opt
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends libboost-program-options1.62.0 libboost-regex1.62.0 \
|
||||
libboost-date-time1.62.0 libboost-chrono1.62.0 libboost-filesystem1.62.0 \
|
||||
libboost-iostreams1.62.0 libboost-thread1.62.0 expat liblua5.2-0 libtbb2 &&\
|
||||
apt-get install -y --no-install-recommends libboost-program-options1.74.0 libboost-regex1.74.0 \
|
||||
libboost-date-time1.74.0 libboost-chrono1.74.0 libboost-filesystem1.74.0 \
|
||||
libboost-iostreams1.74.0 libboost-system1.74.0 libboost-thread1.74.0 \
|
||||
expat liblua5.2-0 libtbb2 &&\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=builder /usr/local /usr/local
|
||||
COPY --from=builder /opt /opt
|
||||
|
||||
16
docs/http.md
16
docs/http.md
@ -299,9 +299,9 @@ curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397
|
||||
|
||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
|
||||
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
|
||||
the i-th source to the j-th destination. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
|
||||
- `distances` array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel distance from
|
||||
the i-th waypoint to the j-th waypoint. Values are given in meters. Can be `null` if no route between `i` and `j` can be found.
|
||||
the i-th source to the j-th destination. Values are given in meters. Can be `null` if no route between `i` and `j` can be found.
|
||||
- `sources` array of `Waypoint` objects describing all sources in order
|
||||
- `destinations` array of `Waypoint` objects describing all destinations in order
|
||||
- `fallback_speed_cells` (optional) array of arrays containing `i,j` pairs indicating which cells contain estimated values based on `fallback_speed`. Will be absent if `fallback_speed` is not used.
|
||||
@ -762,8 +762,8 @@ step.
|
||||
{ "bearings" : [ 10, 92, 184, 270 ],
|
||||
"lanes" : [
|
||||
{ "indications" : [ "left", "straight" ],
|
||||
"valid" : "false" },
|
||||
{ "valid" : "true",
|
||||
"valid" : false },
|
||||
{ "valid" : true,
|
||||
"indications" : [ "right" ] }
|
||||
],
|
||||
"out" : 2,
|
||||
@ -774,9 +774,9 @@ step.
|
||||
{ "out" : 1,
|
||||
"lanes" : [
|
||||
{ "indications" : [ "straight" ],
|
||||
"valid" : "true" },
|
||||
"valid" : true },
|
||||
{ "indications" : [ "right" ],
|
||||
"valid" : "false" }
|
||||
"valid" : false }
|
||||
],
|
||||
"bearings" : [ 60, 240, 330 ],
|
||||
"in" : 0,
|
||||
@ -884,7 +884,7 @@ A `Lane` represents a turn lane at the corresponding turn location.
|
||||
```json
|
||||
{
|
||||
"indications": ["left", "straight"],
|
||||
"valid": "false"
|
||||
"valid": false
|
||||
}
|
||||
```
|
||||
|
||||
@ -919,7 +919,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
||||
"classes": ["toll", "restricted"],
|
||||
"lanes":{
|
||||
"indications": ["left", "straight"],
|
||||
"valid": "false"
|
||||
"valid": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@ -20,23 +20,24 @@ var osrm = new OSRM('network.osrm');
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** Options for creating an OSRM object or string to the `.osrm` file. (optional, default `{shared_memory:true}`)
|
||||
- `options.algorithm` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The algorithm to use for routing. Can be 'CH', 'CoreCH' or 'MLD'. Default is 'CH'.
|
||||
- `options` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** Options for creating an OSRM object or string to the `.osrm` file. (optional, default `{shared_memory:true}`)
|
||||
- `options.algorithm` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** The algorithm to use for routing. Can be 'CH', 'CoreCH' or 'MLD'. Default is 'CH'.
|
||||
Make sure you prepared the dataset with the correct toolchain.
|
||||
- `options.shared_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Connects to the persistent shared memory datastore.
|
||||
- `options.shared_memory` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Connects to the persistent shared memory datastore.
|
||||
This requires you to run `osrm-datastore` prior to creating an `OSRM` object.
|
||||
- `options.dataset_name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Connects to the persistent shared memory datastore defined by `--dataset_name` option when running `osrm-datastore`
|
||||
- `options.dataset_name` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Connects to the persistent shared memory datastore defined by `--dataset_name` option when running `osrm-datastore`.
|
||||
This requires you to run `osrm-datastore --dataset_name` prior to creating an `OSRM` object.
|
||||
- `options.memory_file` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** *DEPRECATED*
|
||||
- `options.memory_file` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** **DEPRECATED**
|
||||
Old behaviour: Path to a file on disk to store the memory using mmap. Current behaviour: setting this value is the same as setting `mmap_memory: true`.
|
||||
- `options.mmap_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Map on-disk files to virtual memory addresses (mmap), rather than loading into RAM.
|
||||
- `options.path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The path to the `.osrm` files. This is mutually exclusive with setting {options.shared_memory} to true.
|
||||
- `options.max_locations_trip` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in trip query (default: unlimited).
|
||||
- `options.max_locations_viaroute` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in viaroute query (default: unlimited).
|
||||
- `options.max_locations_distance_table` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in distance table query (default: unlimited).
|
||||
- `options.max_locations_map_matching` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in map-matching query (default: unlimited).
|
||||
- `options.max_results_nearest` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. results supported in nearest query (default: unlimited).
|
||||
- `options.max_alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max.number of alternatives supported in alternative routes query (default: 3).
|
||||
- `options.mmap_memory` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Map on-disk files to virtual memory addresses (mmap), rather than loading into RAM.
|
||||
- `options.path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** The path to the `.osrm` files. This is mutually exclusive with setting {options.shared_memory} to true.
|
||||
- `options.max_locations_trip` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in trip query (default: unlimited).
|
||||
- `options.max_locations_viaroute` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in viaroute query (default: unlimited).
|
||||
- `options.max_locations_distance_table` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in distance table query (default: unlimited).
|
||||
- `options.max_locations_map_matching` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in map-matching query (default: unlimited).
|
||||
- `options.max_radius_map_matching` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. radius size supported in map matching query (default: 5).
|
||||
- `options.max_results_nearest` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. results supported in nearest query (default: unlimited).
|
||||
- `options.max_alternatives` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. number of alternatives supported in alternative routes query (default: 3).
|
||||
|
||||
### route
|
||||
|
||||
@ -44,39 +45,39 @@ Returns the fastest route between two or more coordinates while visiting the way
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the route query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the route query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.alternatives` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes. (optional, default `false`)
|
||||
- `options.alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Search for up to this many alternative routes.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.alternatives` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes. (optional, default `false`)
|
||||
- `options.alternatives` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Search for up to this many alternative routes.
|
||||
_Please note that even if alternative routes are requested, a result cannot be guaranteed._ (optional, default `0`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route leg. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.continue_straight` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.waypoints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Indices to coordinates to treat as waypoints. If not supplied, all coordinates are waypoints. Must include first and last coordinate index.
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route leg. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.continue_straight` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
`null`/`true`/`false`
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `options.waypoints` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Indices to coordinates to treat as waypoints. If not supplied, all coordinates are waypoints. Must include first and last coordinate index.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM("berlin-latest.osrm");
|
||||
osrm.route({coordinates: [[13.438640,52.519930], [13.415852,52.513191]]}, function(err, result) {
|
||||
osrm.route({coordinates: [[52.519930,13.438640], [52.513191,13.415852]]}, function(err, result) {
|
||||
if(err) throw err;
|
||||
console.log(result.waypoints); // array of Waypoint objects representing all waypoints in order
|
||||
console.log(result.routes); // array of Route objects ordered by descending recommendation rank
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** An array of [Waypoint](#waypoint) objects representing all waypoints in order AND an array of [`Route`](#route) objects ordered by descending recommendation rank.
|
||||
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** An array of [Waypoint](#waypoint) objects representing all waypoints in order AND an array of [`Route`](#route) objects ordered by descending recommendation rank.
|
||||
|
||||
### nearest
|
||||
|
||||
@ -86,18 +87,18 @@ Note: `coordinates` in the general options only supports a single `{longitude},{
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the nearest query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the nearest query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.number` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of nearest segments that should be returned.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.number` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of nearest segments that should be returned.
|
||||
Must be an integer greater than or equal to `1`. (optional, default `1`)
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@ -113,37 +114,34 @@ osrm.nearest(options, function(err, response) {
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints`.
|
||||
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints`.
|
||||
**`waypoints`**: array of [`Ẁaypoint`](#waypoint) objects sorted by distance to the input coordinate.
|
||||
Each object has an additional `distance` property, which is the distance in meters to the supplied input coordinate.
|
||||
|
||||
### table
|
||||
|
||||
Computes duration table for the given locations. Allows for both symmetric and asymmetric
|
||||
tables. Optionally returns distance table.
|
||||
Computes duration table for the given locations. Allows for both symmetric and asymmetric tables.
|
||||
Optionally returns distance table.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the table query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the table query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.sources` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer < #coordinates`) to
|
||||
use
|
||||
location with given index as source. Default is to use all.
|
||||
- `options.destinations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer <
|
||||
#coordinates`) to use location with given index as destination. Default is to use all.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.fallback_speed` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Replace `null` responses in result with as-the-crow-flies estimates based on `fallback_speed`. Value is in metres/second.
|
||||
- `options.fallback_coordinate` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Either `input` (default) or `snapped`. If using a `fallback_speed`, use either the user-supplied coordinate (`input`), or the snapped coordinate (`snapped`) for calculating the as-the-crow-flies diestance between two points.
|
||||
- `options.scale_factor` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Multiply the table duration values in the table by this number for more controlled input into a route optimization solver.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `options.annotations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Return the requested table or tables in response. Can be `['duration']` (return the duration matrix, default) or `['duration', distance']` (return both the duration matrix and the distance matrix).
|
||||
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.sources` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer < #coordinates`) to use
|
||||
location with given index as source. Default is to use all.
|
||||
- `options.destinations` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer < #coordinates`) to use location with given index as destination. Default is to use all.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.fallback_speed` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Replace `null` responses in result with as-the-crow-flies estimates based on `fallback_speed`. Value is in metres/second.
|
||||
- `options.fallback_coordinate` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Either `input` (default) or `snapped`. If using a `fallback_speed`, use either the user-supplied coordinate (`input`), or the snapped coordinate (`snapped`) for calculating the as-the-crow-flies distance between two points.
|
||||
- `options.scale_factor` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Multiply the table duration values in the table by this number for more controlled input into a route optimization solver.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `options.annotations` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Return the requested table or tables in response. Can be `['duration']` (return the duration matrix, default), `[distance']` (return the distance matrix), or `['duration', distance']` (return both the duration matrix and the distance matrix).
|
||||
- `callback` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@ -158,14 +156,17 @@ var options = {
|
||||
};
|
||||
osrm.table(options, function(err, response) {
|
||||
console.log(response.durations); // array of arrays, matrix in row-major order
|
||||
console.log(response.distances); // array of arrays, matrix in row-major order
|
||||
console.log(response.sources); // array of Waypoint objects
|
||||
console.log(response.destinations); // array of Waypoint objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `durations`, `sources`, and `destinations`.
|
||||
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `durations`, `distances`, `sources`, and `destinations`.
|
||||
**`durations`**: array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from the i-th waypoint to the j-th waypoint.
|
||||
Values are given in seconds.
|
||||
**`distances`**: array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel time from the i-th waypoint to the j-th waypoint.
|
||||
Values are given in meters.
|
||||
**`sources`**: array of [`Ẁaypoint`](#waypoint) objects describing all sources in order.
|
||||
**`destinations`**: array of [`Ẁaypoint`](#waypoint) objects describing all destinations in order.
|
||||
**`fallback_speed_cells`**: (optional) if `fallback_speed` is used, will be an array of arrays of `row,column` values, indicating which cells contain estimated values.
|
||||
@ -181,10 +182,10 @@ and what weights they have applied.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `ZXY` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** an array consisting of `x`, `y`, and `z` values representing tile coordinates like
|
||||
- `ZXY` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** an array consisting of `x`, `y`, and `z` values representing tile coordinates like
|
||||
[wiki.openstreetmap.org/wiki/Slippy_map_tilenames](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames)
|
||||
and are supported by vector tile viewers like [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/).
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `callback` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@ -208,23 +209,23 @@ if they can not be matched successfully.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the match query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the match query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.timestamps` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>?** Timestamp of the input location (integers, UNIX-like timestamp).
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy. Can be `null` for default value `5` meters or `double >= 0`.
|
||||
- `options.gaps` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Allows the input track splitting based on huge timestamp gaps between points. Either `split` or `ignore` (optional, default `split`).
|
||||
- `options.tidy` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Allows the input track modification to obtain better matching quality for noisy tracks (optional, default `false`).
|
||||
- `options.waypoints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Indices to coordinates to treat as waypoints. If not supplied, all coordinates are waypoints. Must include first and last coordinate index.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.timestamps` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>?** Timestamp of the input location (integers, UNIX-like timestamp).
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy. Can be `null` for default value `5` meters or `double >= 0`.
|
||||
- `options.gaps` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Allows the input track splitting based on huge timestamp gaps between points. Either `split` or `ignore`. (optional, default `split`)
|
||||
- `options.tidy` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Allows the input track modification to obtain better matching quality for noisy tracks. (optional, default `false`)
|
||||
- `options.waypoints` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Indices to coordinates to treat as waypoints. If not supplied, all coordinates are waypoints. Must include first and last coordinate index.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@ -241,12 +242,15 @@ osrm.match(options, function(err, response) {
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `tracepoints` and `matchings`.
|
||||
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `tracepoints` and `matchings`.
|
||||
**`tracepoints`** Array of [`Ẁaypoint`](#waypoint) 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.
|
||||
Each `Waypoint` object includes two additional properties, 1) `matchings_index`: Index to the
|
||||
[`Route`](#route) object in matchings the sub-trace was matched to, 2) `waypoint_index`: Index of
|
||||
Each `Waypoint` object has the following additional properties,
|
||||
1) `matchings_index`: Index to the
|
||||
[`Route`](#route) object in matchings the sub-trace was matched to,
|
||||
2) `waypoint_index`: Index of
|
||||
the waypoint inside the matched route.
|
||||
3) `alternatives_count`: Number of probable alternative matchings for this trace point. A value of zero indicate that this point was matched unambiguously. Split the trace at these points for incremental map matching.
|
||||
**`matchings`** is an array of [`Route`](#route) objects that assemble the trace. Each `Route` object has an additional `confidence` property,
|
||||
which is the confidence of the matching. float value between `0` and `1`. `1` is very confident that the matching is correct.
|
||||
|
||||
@ -274,23 +278,23 @@ Right now, the following combinations are possible:
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `double >= 0` or `null` (unlimited, default).
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
|
||||
- `options.roundtrip` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route is a roundtrip. (optional, default `true`)
|
||||
- `options.source` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route starts at `any` or `first` coordinate. (optional, default `any`)
|
||||
- `options.destination` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route ends at `any` or `last` coordinate. (optional, default `any`)
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `double >= 0` or `null` (unlimited, default).
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
|
||||
- `options.roundtrip` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route is a roundtrip. (optional, default `true`)
|
||||
- `options.source` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route starts at `any` or `first` coordinate. (optional, default `any`)
|
||||
- `options.destination` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route ends at `any` or `last` coordinate. (optional, default `any`)
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
@ -312,19 +316,28 @@ osrm.trip(options, function(err, response) {
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints` and `trips`.
|
||||
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints` and `trips`.
|
||||
**`waypoints`**: an array of [`Waypoint`](#waypoint) objects representing all waypoints in input order.
|
||||
Each Waypoint object has the following additional properties,
|
||||
1) `trips_index`: index to trips of the sub-trip the point was matched to, and
|
||||
2) `waypoint_index`: index of the point in the trip.
|
||||
**`trips`**: an array of [`Route`](#route) objects that assemble the trace.
|
||||
|
||||
## Plugin behaviour
|
||||
## Configuration
|
||||
|
||||
All plugins support a second additional object that is available to configure some NodeJS specific behaviours.
|
||||
All plugins support a second additional object that is available to configure some NodeJS
|
||||
specific behaviours.
|
||||
|
||||
- `plugin_config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||
- `plugin_config.format` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The format of the result object to various API calls. Valid options are `object` (default), which returns a standard Javascript object, as described above, and `json_buffer`, which will return a NodeJS **[Buffer](https://nodejs.org/api/buffer.html)** object, containing a JSON string. The latter has the advantage that it can be immediately serialized to disk/sent over the network, and the generation of the string is performed outside the main NodeJS event loop. This option is ignored by the `tile` plugin.
|
||||
**Parameters**
|
||||
|
||||
- `plugin_config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Object literal containing parameters for the trip query.
|
||||
- `plugin_config.format` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** The format of the result object to various API calls.
|
||||
Valid options are `object` (default), which returns a
|
||||
standard Javascript object, as described above, and `json_buffer`, which will return a NodeJS
|
||||
**[Buffer](https://nodejs.org/api/buffer.html)** object, containing a JSON string. The latter has
|
||||
the advantage that it can be immediately serialized to disk/sent over the network, and the
|
||||
generation of the string is performed outside the main NodeJS event loop. This option is ignored
|
||||
by the `tile` plugin.
|
||||
|
||||
**Examples**
|
||||
|
||||
@ -350,7 +363,7 @@ Represents a route through (potentially multiple) waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
- `external` **documentation** in
|
||||
[`osrm-backend`](../http.md#route-object)
|
||||
|
||||
### RouteLeg
|
||||
@ -359,7 +372,7 @@ Represents a route between two waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
- `external` **documentation** in
|
||||
[`osrm-backend`](../http.md#routeleg-object)
|
||||
|
||||
### RouteStep
|
||||
@ -369,14 +382,14 @@ single way to the subsequent step.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
- `external` **documentation** in
|
||||
[`osrm-backend`](../http.md#routestep-object)
|
||||
|
||||
### StepManeuver
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
- `external` **documentation** in
|
||||
[`osrm-backend`](../http.md#stepmaneuver-object)
|
||||
|
||||
### Waypoint
|
||||
@ -385,5 +398,5 @@ Object used to describe waypoint on a route.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
- `external` **documentation** in
|
||||
[`osrm-backend`](../http.md#waypoint-object)
|
||||
|
||||
@ -50,7 +50,8 @@ We may introduce forward-compatible changes: query parameters and response prope
|
||||
7. Push tags and commits: `git push; git push --tags`
|
||||
8. On https://github.com/Project-OSRM/osrm-backend/releases press `Draft a new release`,
|
||||
write the release tag `vx.y.z` in the `Tag version` field, write the changelog entries in the `Describe this release` field
|
||||
and press `Publish release`.
|
||||
and press `Publish release`. Note that Travis deployments will create a release when publishing node binaries, so the release
|
||||
may already exist. In which case the description should be updated with the changelog entries.
|
||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
|
||||
`rm -rf node_modules && npm install` locally.
|
||||
|
||||
@ -12,20 +12,14 @@ Prepare directories for dependencies, build and target file location.Target dire
|
||||
|
||||
### Bzip2
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/bzip2-1.0.8.tar.gz
|
||||
* https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
|
||||
|
||||
1. Download from https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Issue `nmake /f makefile.msc`
|
||||
4. Copy bzlib.h to $target\include and libbz2.lib to $target\lib
|
||||
|
||||
### ZLib
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/zlib-1.2.11.tar.gz
|
||||
* https://www.zlib.net/zlib-1.2.11.tar.gz
|
||||
|
||||
1. Download https://www.zlib.net/zlib-1.2.11.tar.gz
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Switch to `contrib\vstudio\vc14`
|
||||
4. If needed, open `zlibvc.sln` with Visual Studio and retarget to your version of compiler and SDK.
|
||||
@ -34,10 +28,8 @@ Prepare directories for dependencies, build and target file location.Target dire
|
||||
|
||||
### ICU
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://wolt-project.wolt.com/deps/icu4c-66_1-src.zip
|
||||
1. Download and unpack.
|
||||
* https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.zip
|
||||
* https://wolt-project.wolt.com/deps/icu4c-66_1-data.zip
|
||||
* https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-data.zip
|
||||
2. Do retarget if neededby openinig .\source\allinone\allinone.sln and editing projects
|
||||
3. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
@ -48,10 +40,7 @@ Prepare directories for dependencies, build and target file location.Target dire
|
||||
|
||||
### Boost
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/boost_1_73_0.zip
|
||||
* https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.zip
|
||||
|
||||
1. Download and unpack https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.zip
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Build b2:
|
||||
bootstrap.bat --with-toolset=msvc-14.2
|
||||
@ -61,9 +50,7 @@ Prepare directories for dependencies, build and target file location.Target dire
|
||||
|
||||
### Expat
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/libexpat-2_2_9.zip
|
||||
* https://github.com/libexpat/libexpat/archive/R_2_2_9.zip
|
||||
1. Download and unpack https://github.com/libexpat/libexpat/archive/R_2_2_9.zip
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Configure build my calling cmake:
|
||||
mkdir expat\build
|
||||
@ -74,9 +61,7 @@ Prepare directories for dependencies, build and target file location.Target dire
|
||||
|
||||
### LUA
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/lua-5.3.5.tar.gz
|
||||
* https://www.lua.org/ftp/lua-5.3.5.tar.gz
|
||||
1. Download and unpack https://www.lua.org/ftp/lua-5.3.5.tar.gz
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Lua doesn't have native MSVC support, so you have to compile it by hand:
|
||||
cd src
|
||||
@ -88,9 +73,7 @@ Prepare directories for dependencies, build and target file location.Target dire
|
||||
|
||||
### TBB
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/oneTBB-v2020.2.zip
|
||||
* https://github.com/oneapi-src/oneTBB/archive/v2020.2.zip
|
||||
1. Download and unpack https://github.com/oneapi-src/oneTBB/archive/v2020.2.zip
|
||||
2. Retarget by opening build\vs2013\makefile.sln
|
||||
3. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
4. Switch to build\vs2013 and build: `msbuild makefle.sln /nologo /p:Configuration=Release /p:Platform=x64`
|
||||
|
||||
@ -45,7 +45,7 @@ Feature: Bicycle - Exclude flags
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | duration |
|
||||
| abcf | abcf | 301.2 |
|
||||
| abcf | abcf | 301 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f |
|
||||
|
||||
@ -9,7 +9,7 @@ Feature: Bike - Max speed restrictions
|
||||
Then routability should be
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h |
|
||||
| residential | 10 | 9 km/h |
|
||||
| residential | 10 | 10 km/h |
|
||||
|
||||
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
||||
Then routability should be
|
||||
@ -65,12 +65,12 @@ Feature: Bike - Max speed restrictions
|
||||
Then routability should be
|
||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| | | | 15 km/h | 15 km/h |
|
||||
| 10 | | | 9 km/h | 9 km/h |
|
||||
| | 10 | | 9 km/h | 15 km/h |
|
||||
| | | 10 | 14 km/h | 9 km/h |
|
||||
| 2 | 10 | | 9 km/h | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 9 km/h |
|
||||
| 2 | 5 | 10 | 5 km/h | 9 km/h |
|
||||
| 10 | | | 10 km/h | 10 km/h |
|
||||
| | 10 | | 10 km/h | 15 km/h |
|
||||
| | | 10 | 15 km/h | 10 km/h |
|
||||
| 2 | 10 | | 10 km/h | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 10 km/h |
|
||||
| 2 | 5 | 10 | 5 km/h | 10 km/h |
|
||||
|
||||
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
||||
Then routability should be
|
||||
|
||||
@ -33,7 +33,7 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| tertiary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| residential | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | track | 14 km/h | 14 km/h | 4.2 | 4.2 |
|
||||
| motorway | lane | 15 km/h | | 4.2 | |
|
||||
| primary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| secondary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
@ -41,7 +41,7 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| primary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| secondary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| residential | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| residential | lane | 14 km/h | 14 km/h | 4.2 | 4.2 |
|
||||
| cycleway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| motorway | shared_lane | 15 km/h | | 4.2 | |
|
||||
@ -59,7 +59,7 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| tertiary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| residential | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | track | | 15 km/h | 4 km/h +-1 | 4.2 | 1.1 |
|
||||
| footway | track | | 14 km/h | 4 km/h +-1 | 4.2 | 1.1 |
|
||||
| motorway | | track | 15 km/h | | 4.2 | |
|
||||
| primary | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary | | track | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
@ -67,7 +67,7 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| primary_link | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary_link | | track | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary_link | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| residential | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| residential | | track | 14 km/h | 14 km/h | 4.2 | 4.2 |
|
||||
| cycleway | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | | track | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
||||
| motorway | lane | | 15 km/h | | 4.2 | |
|
||||
@ -75,7 +75,7 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| secondary_link | lane | | 14 km/h | 14 km/h | 4.2 | 2.7 |
|
||||
| tertiary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| residential | lane | | 15 km/h +-1 | 15 km/h +-1 | 4.2 | 4.2 |
|
||||
| cycleway | lane | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
@ -84,7 +84,7 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| primary | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 2.7 | 4.2 |
|
||||
| tertiary | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| primary_link | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| primary_link | | lane | 14 km/h | 14 km/h | 2.1 | 4.2 |
|
||||
| secondary_link | | lane | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary_link | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| residential | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
@ -92,7 +92,7 @@ Feature: Bicycle - Adds penalties to unsafe roads
|
||||
| footway | | lane | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
||||
| motorway | shared_lane | | 15 km/h | | 4.2 | |
|
||||
| primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| motorway | | shared_lane | 15 km/h | | 4.2 | |
|
||||
| motorway | | shared_lane | 14 km/h | | 4.2 | |
|
||||
| primary | | shared_lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
|
||||
|
||||
|
||||
@ -8,29 +8,29 @@ Feature: Bike - Surfaces
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| cycleway | asphalt | 48 s |
|
||||
| cycleway | asphalt | 47.9 s |
|
||||
| cycleway | cobblestone:flattened | 72 s |
|
||||
| cycleway | paving_stones | 72 s |
|
||||
| cycleway | compacted | 72 s |
|
||||
| cycleway | cobblestone | 120 s |
|
||||
| cycleway | fine_gravel | 120 s |
|
||||
| cycleway | gravel | 120 s |
|
||||
| cycleway | pebblestone | 120.1 s |
|
||||
| cycleway | pebblestone | 120 s |
|
||||
| cycleway | dirt | 120 s |
|
||||
| cycleway | earth | 120 s |
|
||||
| cycleway | grass | 120 s |
|
||||
| cycleway | mud | 240 s |
|
||||
| cycleway | sand | 240.1 s |
|
||||
| cycleway | sand | 240 s |
|
||||
| cycleway | sett | 72 s |
|
||||
|
||||
Scenario: Bicycle - Good surfaces on small paths
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| path | | 60 s |
|
||||
| track | | 60 s |
|
||||
| track | asphalt | 60 s |
|
||||
| path | asphalt | 60 s |
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| path | | 59.9 s |
|
||||
| track | | 60 s |
|
||||
| track | asphalt | 60 s |
|
||||
| path | asphalt | 60 s |
|
||||
|
||||
Scenario: Bicycle - Surfaces should not make unknown ways routable
|
||||
Then routability should be
|
||||
|
||||
@ -37,6 +37,6 @@ Feature: Turn Penalties
|
||||
| from | to | distance | weight | # |
|
||||
| a | c | 900m +- 1 | 216 | Going straight has no penalties |
|
||||
| a | d | 900m +- 1 | 220.2 | Turning right had penalties |
|
||||
| e | g | 2100m +- 4| 503.9 | Going straght has no penalties |
|
||||
| e | h | 2100m +- 4| 515.1 | Turn sharp right has even higher penalties|
|
||||
| e | g | 2100m +- 5| 503.9 | Going straght has no penalties |
|
||||
| e | h | 2100m +- 5| 515.1 | Turn sharp right has even higher penalties|
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ Feature: Car - Restricted access
|
||||
Then routability should be
|
||||
| highway | hov | bothw | forw_rate | backw_rate |
|
||||
| primary | designated | x | 18.2 | 18.2 |
|
||||
| primary | yes | x | 18.2 | 18.2 |
|
||||
| primary | yes | x | 18.3 | 18.3 |
|
||||
| primary | no | x | 18.2 | 18.2 |
|
||||
|
||||
# Models:
|
||||
@ -196,7 +196,7 @@ Feature: Car - Restricted access
|
||||
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 |
|
||||
| motorway | lane | | 3 | designated | yes | x | | 25.3 |
|
||||
|
||||
@hov
|
||||
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
||||
@ -206,7 +206,7 @@ Feature: Car - Restricted access
|
||||
# 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.2 | 18.2 |
|
||||
#| primary | designated | | | | x | x | 18.2 | 18.2 |
|
||||
| primary | designated\|designated | designated\|designated | | | x | x | 18.2 | 18.2 |
|
||||
| primary | designated\|designated | designated\|designated | | | x | x | 18.3 | 18.3 |
|
||||
| primary | designated\|no | designated\|no | | | x | x | 18.2 | 18.2 |
|
||||
| primary | yes\|no | yes\|no | | | x | x | 18.2 | 18.2 |
|
||||
| primary | | | | | x | x | 18.2 | 18.2 |
|
||||
|
||||
@ -46,6 +46,18 @@ Feature: Car - Barriers
|
||||
| bollard | rising | x |
|
||||
| bollard | removable | |
|
||||
|
||||
# https://github.com/Project-OSRM/osrm-backend/issues/5996
|
||||
Scenario: Car - Kerb exception for barriers
|
||||
Then routability should be
|
||||
| node/barrier | node/highway | node/kerb | bothw |
|
||||
| kerb | | | |
|
||||
| kerb | crossing | | x |
|
||||
| kerb | crossing | yes | x |
|
||||
| kerb | | lowered | x |
|
||||
| kerb | | flush | x |
|
||||
| kerb | | raised | |
|
||||
| kerb | | yes | |
|
||||
|
||||
Scenario: Car - Height restrictions
|
||||
Then routability should be
|
||||
| node/barrier | node/maxheight | bothw |
|
||||
|
||||
@ -387,217 +387,37 @@ Feature: Car - Turn restrictions
|
||||
| m | p | mj,jp,jp |
|
||||
|
||||
@no_turning @conditionals
|
||||
Scenario: Car - only_right_turn
|
||||
Scenario: Car - Multiple conditional restrictions applicable to same turn
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# time stamp for 10am on Tues, 02 May 2017 GMT
|
||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d j b
|
||||
c
|
||||
j
|
||||
|
|
||||
k - l - m
|
||||
|
|
||||
n
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| aj | no |
|
||||
| jc | no |
|
||||
| bj | yes |
|
||||
| jd | yes |
|
||||
| nodes |
|
||||
| kl |
|
||||
| jl |
|
||||
| ln |
|
||||
| lm |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
||||
| restriction | kl | lj | l | only_left_turn @ (Sa-Su 07:00-10:30) |
|
||||
| restriction | kl | ln | l | only_right_turn @ (Mo-Fr 07:00-10:30) |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| b | c | bj,aj,aj,jc,jc |
|
||||
| b | a | bj,aj,aj |
|
||||
| b | d | bj,aj,aj,jd,jd |
|
||||
| k | m | kl,ln,ln,lm,lm |
|
||||
|
||||
@no_turning @conditionals
|
||||
Scenario: Car - No right turn
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# time stamp for 10am on Tues, 02 May 2017 GMT
|
||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d j b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| aj | no |
|
||||
| jc | no |
|
||||
| bj | yes |
|
||||
| jd | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | # |
|
||||
| b | c | bj,jc,jc | normal turn |
|
||||
| b | a | bj,jc,jc,aj,aj | avoids right turn |
|
||||
| b | d | bj,jd,jd | normal maneuver |
|
||||
|
||||
@only_turning @conditionals
|
||||
Scenario: Car - only_left_turn
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# time stamp for 10am on Tues, 02 May 2017 GMT
|
||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d j b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| aj | no |
|
||||
| jc | no |
|
||||
| bj | yes |
|
||||
| jd | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| b | c | bj,jc,jc |
|
||||
| b | a | bj,jc,jc,aj,aj |
|
||||
| b | d | bj,jc,jc,jd,jd |
|
||||
|
||||
@no_turning @conditionals
|
||||
Scenario: Car - No left turn
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# time stamp for 10am on Tues, 02 May 2017 GMT
|
||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d j b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| aj | no |
|
||||
| jc | no |
|
||||
| bj | yes |
|
||||
| jd | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| b | c | bj,aj,aj,jc,jc |
|
||||
| b | a | bj,aj,aj |
|
||||
| b | d | bj,jd,jd |
|
||||
|
||||
@no_turning @conditionals
|
||||
Scenario: Car - Conditional restriction is off
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# time stamp for 10am on Tues, 02 May 2017 GMT
|
||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d j b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| aj | no |
|
||||
| jc | no |
|
||||
| bj | yes |
|
||||
| jd | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| b | c | bj,jc,jc |
|
||||
| b | a | bj,aj,aj |
|
||||
| b | d | bj,jd,jd |
|
||||
|
||||
@no_turning @conditionals
|
||||
Scenario: Car - Conditional restriction is on
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# 10am utc, wed
|
||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
d j b
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| aj | no |
|
||||
| jc | no |
|
||||
| bj | yes |
|
||||
| jd | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
| restriction | jb | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| b | c | bj,jc,jc |
|
||||
| b | a | bj,jc,jc,aj,aj |
|
||||
| b | d | bj,jd,jd |
|
||||
|
||||
@no_turning @conditionals
|
||||
Scenario: Car - Conditional restriction with multiple time windows
|
||||
Given the extract extra arguments "--parse-conditional-restrictions"
|
||||
# 5pm Wed 02 May, 2017 GMT
|
||||
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400"
|
||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400"
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
p |
|
||||
\ |
|
||||
j
|
||||
| \
|
||||
c m
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| aj | no |
|
||||
| jc | no |
|
||||
| jp | yes |
|
||||
| mj | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | p | aj,jc,jc,jp,jp |
|
||||
| m | p | mj,jp,jp |
|
||||
|
||||
@restriction-way
|
||||
Scenario: Car - prohibit turn
|
||||
@ -719,7 +539,7 @@ Feature: Car - Turn restrictions
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,continue uturn,arrive |
|
||||
| f | d | cap north,florida nw,florida nw | depart,turn left,arrive |
|
||||
| f | d | cap north,florida nw,florida nw | depart,turn left,arrive |
|
||||
| e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive |
|
||||
|
||||
@no_turning @conditionals
|
||||
@ -796,8 +616,8 @@ Feature: Car - Turn restrictions
|
||||
| nodes | name |
|
||||
| ab | albic |
|
||||
| bc | albic |
|
||||
| db | dobe |
|
||||
| be | dobe |
|
||||
| db | dobe |
|
||||
| be | dobe |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction:conditional |
|
||||
@ -1047,7 +867,7 @@ Feature: Car - Turn restrictions
|
||||
| type | way:from | node:via | way:to | restriction:conditional |
|
||||
| restriction | be | e | de | no_right_turn @ (Mo-Fr 07:00-11:00) |
|
||||
|
||||
# node restrictino is off, way restriction is on
|
||||
# node restriction is off, way restriction is on
|
||||
When I route I should get
|
||||
| from | to | route | turns | locations |
|
||||
| a | d | ab,be,ef,ef,de,de | depart,turn right,turn left,continue uturn,new name straight,arrive | a,b,e,f,e,d |
|
||||
|
||||
@ -46,10 +46,10 @@ Feature: Car - Handle ferry routes
|
||||
|
||||
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 |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.5s |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.5s |
|
||||
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.5s |
|
||||
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.5s |
|
||||
|
||||
Scenario: Car - Properly handle simple durations
|
||||
Given the node map
|
||||
@ -117,4 +117,4 @@ Feature: Car - Handle ferry routes
|
||||
# Note that matching *should* work across unsnappable ferries
|
||||
When I match I should get
|
||||
| trace | geometry | duration |
|
||||
| abcdef| 1,1,1.000899,1,1.000899,1,1.002697,1,1.002697,1,1.003596,1,1.003596,1,1.005394,1,1.005394,1,1.006293,1 | 610.9 |
|
||||
| abcdef| 1,1,1.000898,1,1.000898,1,1.002695,1,1.002695,1,1.003594,1,1.003594,1,1.005391,1,1.005391,1,1.006289,1 | 611 |
|
||||
|
||||
@ -86,57 +86,57 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18.1 | 18.1 |
|
||||
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13.3 | 13.3 |
|
||||
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 6.7 | 6.7 |
|
||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13.3 | 18 |
|
||||
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 6.7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13.3 |
|
||||
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 6.7 |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13.3 | 3.3 |
|
||||
| primary | 60 | | | | 48 km/h | 48 km/h | 13.3 | 13.3 |
|
||||
| primary | 60 | 3 | | | 48 km/h | 48 km/h | 6.7 | 6.7 |
|
||||
| primary | | | 60 | | 48 km/h | 64 km/h | 13.3 | 18.1 |
|
||||
| primary | | 3 | 60 | | 48 km/h | 64 km/h | 6.7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 48 km/h | 18.1 | 13.3 |
|
||||
| primary | | 3 | | 60 | 64 km/h | 48 km/h | 9 | 6.7 |
|
||||
| primary | 15 | | 60 | | 48 km/h | 12 km/h | 13.3 | 3.3 |
|
||||
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 6.7 | 1.7 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3.3 | 13.3 |
|
||||
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 1.7 | 6.7 |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 6.7 | 13.3 |
|
||||
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3.3 | 6.7 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 48 km/h | 3.3 | 13.3 |
|
||||
| primary | 15 | 3 | | 60 | 12 km/h | 48 km/h | 1.7 | 6.7 |
|
||||
| primary | 15 | | 30 | 60 | 24 km/h | 48 km/h | 6.7 | 13.3 |
|
||||
| primary | 15 | 3 | 30 | 60 | 24 km/h | 48 km/h | 3.3 | 6.7 |
|
||||
|
||||
Scenario: Car - Single lane streets be ignored or incur a penalty
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18.1 | 18.1 |
|
||||
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13.3 | 13.3 |
|
||||
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 6.7 | 6.7 |
|
||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13.3 | 18 |
|
||||
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 6.7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13.3 |
|
||||
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 6.7 |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13.3 | 3.3 |
|
||||
| primary | 60 | | | | 48 km/h | 48 km/h | 13.3 | 13.3 |
|
||||
| primary | 60 | 1 | | | 48 km/h | 48 km/h | 6.7 | 6.7 |
|
||||
| primary | | | 60 | | 48 km/h | 64 km/h | 13.3 | 18.1 |
|
||||
| primary | | 1 | 60 | | 48 km/h | 64 km/h | 6.7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 48 km/h | 18.1 | 13.3 |
|
||||
| primary | | 1 | | 60 | 64 km/h | 48 km/h | 9 | 6.7 |
|
||||
| primary | 15 | | 60 | | 48 km/h | 12 km/h | 13.3 | 3.3 |
|
||||
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 6.7 | 1.7 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3.3 | 13.3 |
|
||||
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 1.7 | 6.7 |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 6.7 | 13.3 |
|
||||
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3.3 | 6.7 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 48 km/h | 3.3 | 13.3 |
|
||||
| primary | 15 | 1 | | 60 | 12 km/h | 48 km/h | 1.7 | 6.7 |
|
||||
| primary | 15 | | 30 | 60 | 24 km/h | 48 km/h | 6.7 | 13.3 |
|
||||
| primary | 15 | 1 | 30 | 60 | 24 km/h | 48 km/h | 3.3 | 6.7 |
|
||||
|
||||
Scenario: Car - Single lane streets only incur a penalty for two-way streets
|
||||
Then routability should be
|
||||
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | 30 | 1 | yes | 23 km/h | | 6.7 | |
|
||||
| primary | 30 | 1 | -1 | | 23 km/h | | 6.7 |
|
||||
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3.3 | 3.3 |
|
||||
| primary | 30 | 2 | | 23 km/h | 23 km/h | 6.7 | 6.7 |
|
||||
| primary | 30 | 1 | yes | 24 km/h | | 6.7 | |
|
||||
| primary | 30 | 1 | -1 | | 24 km/h | | 6.7 |
|
||||
| primary | 30 | 1 | | 24 km/h | 24 km/h | 3.3 | 3.3 |
|
||||
| primary | 30 | 2 | | 24 km/h | 24 km/h | 6.7 | 6.7 |
|
||||
|
||||
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 | | 6.7 |
|
||||
| primary | | 30 | | -1 | | 64 km/h | | 18 |
|
||||
| primary | | | 30 | -1 | | 23 km/h | | 6.7 |
|
||||
| primary | 20 | 30 | | -1 | | 15 km/h | | 4.4 |
|
||||
| primary | 20 | | 30 | -1 | | 23 km/h | | 6.7 |
|
||||
| primary | | | | -1 | | 64 km/h | | 18.1 |
|
||||
| primary | 30 | | | -1 | | 24 km/h | | 6.7 |
|
||||
| primary | | 30 | | -1 | | 64 km/h | | 18.1 |
|
||||
| primary | | | 30 | -1 | | 24 km/h | | 6.7 |
|
||||
| primary | 20 | 30 | | -1 | | 16 km/h | | 4.4 |
|
||||
| primary | 20 | | 30 | -1 | | 24 km/h | | 6.7 |
|
||||
|
||||
|
||||
Scenario: Car - Respect source:maxspeed
|
||||
|
||||
1033
features/car/multi_via_restrictions.feature
Normal file
1033
features/car/multi_via_restrictions.feature
Normal file
File diff suppressed because it is too large
Load Diff
@ -798,82 +798,6 @@ Feature: Car - Turn restrictions
|
||||
| from | to | route |
|
||||
| a | d | ab,be,de,de |
|
||||
|
||||
@restriction-way
|
||||
Scenario: Multi Way restriction
|
||||
Given the node map
|
||||
"""
|
||||
k j
|
||||
| |
|
||||
h - - g - f - - e
|
||||
| |
|
||||
| |
|
||||
a - - b - c - - d
|
||||
| |
|
||||
l i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | horiz | yes |
|
||||
| bc | horiz | yes |
|
||||
| cd | horiz | yes |
|
||||
| ef | horiz | yes |
|
||||
| fg | horiz | yes |
|
||||
| gh | horiz | yes |
|
||||
| ic | vert | yes |
|
||||
| cf | vert | yes |
|
||||
| fj | vert | yes |
|
||||
| kg | vert | yes |
|
||||
| gb | vert | yes |
|
||||
| bl | vert | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:via | way:to | restriction |
|
||||
| restriction | ab | bc,cf,fg | gh | no_u_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | h | horiz,vert,horiz,horiz |
|
||||
|
||||
@restriction-way
|
||||
Scenario: Multi-Way overlapping single-way
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
|
|
||||
a - b - c - d
|
||||
|
|
||||
f - g
|
||||
|
|
||||
h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| ab | abcd |
|
||||
| bc | abcd |
|
||||
| cd | abcd |
|
||||
| hf | hfb |
|
||||
| fb | hfb |
|
||||
| gf | gf |
|
||||
| ce | ce |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:via | way:to | restriction |
|
||||
| restriction | ab | bc | ce | only_left_turn |
|
||||
| restriction | gf | fb,bc | cd | only_u_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | locations |
|
||||
| a | d | abcd,ce,ce,abcd,abcd | depart,turn left,continue uturn,turn left,arrive | a,c,e,c,d |
|
||||
| a | e | abcd,ce,ce | depart,turn left,arrive | a,c,e |
|
||||
| a | f | abcd,hfb,hfb | depart,turn right,arrive | a,b,f |
|
||||
| g | e | gf,hfb,abcd,ce,ce | depart,turn right,turn right,turn left,arrive | g,f,b,c,e |
|
||||
| g | d | gf,hfb,abcd,abcd | depart,turn right,turn right,arrive | g,f,b,d |
|
||||
| h | e | hfb,abcd,ce,ce | depart,end of road right,turn left,arrive | h,b,c,e |
|
||||
| h | d | hfb,abcd,abcd | depart,end of road right,arrive | h,b,d |
|
||||
|
||||
|
||||
@restriction-way
|
||||
Scenario: Car - prohibit turn, traffic lights
|
||||
Given the node map
|
||||
@ -984,8 +908,6 @@ Feature: Car - Turn restrictions
|
||||
| restriction | ab | bge | de | no_right_turn |
|
||||
| restriction | bc | bge | ef | no_left_turn |
|
||||
|
||||
# this case is currently not handling the via-way restrictions and we need support for looking across traffic signals.
|
||||
# It is mainly included to show limitations and to prove that we don't crash hard here
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | ab,bge,ef,ef,de,de |
|
||||
|
||||
@ -9,29 +9,29 @@ Feature: Car - speeds
|
||||
Scenario: Car - speed of various way types
|
||||
Then routability should be
|
||||
| highway | oneway | bothw |
|
||||
| motorway | no | 89 km/h |
|
||||
| motorway_link | no | 44 km/h |
|
||||
| trunk | no | 85 km/h |
|
||||
| trunk_link | no | 39 km/h |
|
||||
| motorway | no | 90 km/h |
|
||||
| motorway_link | no | 45 km/h |
|
||||
| trunk | no | 84 km/h |
|
||||
| trunk_link | no | 40 km/h |
|
||||
| primary | no | 64 km/h |
|
||||
| primary_link | no | 29 km/h |
|
||||
| secondary | no | 55 km/h |
|
||||
| secondary_link | no | 24 km/h |
|
||||
| tertiary | no | 39 km/h |
|
||||
| primary_link | no | 30 km/h |
|
||||
| secondary | no | 54 km/h |
|
||||
| secondary_link | no | 25 km/h |
|
||||
| tertiary | no | 40 km/h |
|
||||
| tertiary_link | no | 20 km/h |
|
||||
| unclassified | no | 24 km/h |
|
||||
| residential | no | 24 km/h |
|
||||
| living_street | no | 9 km/h |
|
||||
| unclassified | no | 25 km/h |
|
||||
| residential | no | 25 km/h |
|
||||
| living_street | no | 10 km/h |
|
||||
| service | no | 15 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 |
|
||||
| tertiary | | | 40 km/h | 40 km/h | |
|
||||
| tertiary | alternating | | 40 km/h | 40 km/h | |
|
||||
| motorway | | | 90 km/h | | implied oneway |
|
||||
| motorway | alternating | | 90 km/h | | implied oneway |
|
||||
| motorway | reversible | | | | unroutable |
|
||||
| primary | | roundabout | 64 km/h | | implied oneway |
|
||||
| primary | alternating | roundabout | 64 km/h | | implied oneway |
|
||||
@ -42,12 +42,12 @@ Feature: Car - speeds
|
||||
|
||||
| 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 |
|
||||
| primary | 60 | 48 km/h | 48 km/h |
|
||||
| primary | 60 | 48 km/h | 48 km/h |
|
||||
| primary | 60 | 48 km/h | 48 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.4 | 14.4 |
|
||||
| primary | yes | 64 km/h | 64 km/h | 14.5 | 14.5 |
|
||||
|
||||
@ -53,8 +53,8 @@ Feature: Car - Allowed start/end modes
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | 2 | c |
|
||||
| 1 | 59.1 | 35.1 |
|
||||
| b | 35.1 | 11.1 |
|
||||
| 1 | 59.1 | 35.2 |
|
||||
| b | 35 | 11.1 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
@ -121,5 +121,5 @@ Feature: Car - Allowed start/end modes
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | 2 | c |
|
||||
| 1 | 59.1 | 35.1 |
|
||||
| b | 35.1 | 11.1 |
|
||||
| 1 | 59.1 | 35.2 |
|
||||
| b | 35 | 11.1 |
|
||||
@ -65,7 +65,7 @@ Feature: Car - Surfaces
|
||||
Then routability should be
|
||||
| highway | oneway | surface | forw | backw |
|
||||
| motorway | no | | 90 km/h | 90 km/h |
|
||||
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 |
|
||||
| motorway | no | asphalt | 91 km/h | 90 km/h +-1 |
|
||||
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 |
|
||||
|
||||
@ -59,7 +59,7 @@ Feature: Car - Handle traffic lights
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | geometry |
|
||||
| a | c | abc,abc | _ibE_ibE?gJ?gJ |
|
||||
| a | c | abc,abc | _ibE_ibE?gJ?eJ |
|
||||
|
||||
@traffic
|
||||
Scenario: Traffic update on the edge with a traffic signal
|
||||
@ -89,5 +89,5 @@ Feature: Car - Handle traffic lights
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed | weights | time | distances | a:datasources | a:nodes | a:speed | a:duration | a:weight |
|
||||
| a | c | abc,abc | 59 km/h | 24.2,0 | 24.2s | 399.9m,0m | 1:0 | 1:2:3 | 18:18 | 11.1:11.1 | 11.1:11.1 |
|
||||
| c | a | abc,abc | 59 km/h | 24.2,0 | 24.2s | 399.9m,0m | 0:1 | 3:2:1 | 18:18 | 11.1:11.1 | 11.1:11.1 |
|
||||
| a | c | abc,abc | 60 km/h | 24.2,0 | 24.2s | 400m,0m | 1:0 | 1:2:3 | 18:18 | 11.1:11.1 | 11.1:11.1 |
|
||||
| c | a | abc,abc | 60 km/h | 24.2,0 | 24.2s | 400m,0m | 0:1 | 3:2:1 | 18:18 | 11.1:11.1 | 11.1:11.1 |
|
||||
|
||||
@ -83,4 +83,4 @@ Feature: Car - weights
|
||||
| waypoints | bearings | route | distance | weights | times |
|
||||
| a,b | 90 90 | abc,abc | 200m | 200,0 | 11.1s,0s |
|
||||
| b,c | 90 90 | abc,abc | 200m | 200,0 | 11.1s,0s |
|
||||
| a,d | 90 180 | abc,bd,bd | 399.9m | 200,200,0 | 13.2s,11.1s,0s |
|
||||
| a,d | 90 180 | abc,bd,bd | 400m | 200,200,0 | 13.2s,11.1s,0s |
|
||||
|
||||
@ -20,3 +20,20 @@ Feature: Foot - Street names in instructions
|
||||
When I route I should get
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,, | ,A7,A7 |
|
||||
|
||||
|
||||
Scenario: Foot - Combines named roads with suffix changes
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| ab | High Street W |
|
||||
| bc | High Street E |
|
||||
| cd | Market Street |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | High Street W,Market Street,Market Street |
|
||||
|
||||
@ -29,7 +29,7 @@ Feature: Foot - Turn restrictions
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj,wj |
|
||||
| s | n | sj,nj,nj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej,ej |
|
||||
|
||||
@only_turning
|
||||
@ -55,7 +55,7 @@ Feature: Foot - Turn restrictions
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj,wj |
|
||||
| s | n | sj,nj,nj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej,ej |
|
||||
|
||||
@except
|
||||
|
||||
@ -103,7 +103,7 @@ Feature: Turn Lane Guidance
|
||||
|
||||
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, |
|
||||
| a,d | On,Hwy,Off,Off | depart,merge slight right,off ramp right,arrive | ,slight left:true slight left:true,straight:false slight right:true, |
|
||||
|
||||
|
||||
@anticipate
|
||||
@ -364,8 +364,8 @@ Feature: Turn Lane Guidance
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,d | main,left,left | depart,end of road 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,right,right | depart,end of road 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, |
|
||||
| a,d | main,left,left | depart,end of road left,arrive | ;left:false straight:true straight:true straight:true straight:true right:false;left:false straight:true straight:true right:false,left:true right:false, |
|
||||
| a,e | main,right,right | depart,end of road right,arrive | ;left:false straight:true straight:true straight:true straight:true right:false;left:false straight:true straight:true right:false,left:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for through with turn before / after
|
||||
@ -390,15 +390,15 @@ Feature: Turn Lane Guidance
|
||||
| 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,ij,ij | depart,turn right,end of road 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,il,il | depart,turn right,end of road 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,il,il | depart,turn left,end of road 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,ij,ij | depart,turn left,end of road 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 |
|
||||
| waypoints | route | turns | lanes | # |
|
||||
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:true right:true 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:true right:true,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
||||
| a,j | ab,bdehi,ij,ij | depart,turn right,end of road right,arrive | ,right:true right:true right:true right:true;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,il,il | depart,turn right,end of road left,arrive | ,right:true right:true 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:true left:true,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:true left:true left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
||||
| c,l | cb,bdehi,il,il | depart,turn left,end of road left,arrive | ,left:true left:true 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,ij,ij | depart,turn left,end of road right,arrive | ,left:true left:true left:true left:true;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
|
||||
@ -811,9 +811,9 @@ Feature: Turn Lane Guidance
|
||||
| hj | 7th | | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations | lanes |
|
||||
| a,i | road,road | depart,arrive | a,i | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:false;none:true none:true right:false, |
|
||||
| a,j | road,7th,7th | depart,turn right,arrive | a,h,j | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:false none:false none:true;left:false none:false none:false none:true,none:false none:false right:true, |
|
||||
| waypoints | route | turns | locations | lanes |
|
||||
| a,i | road,road | depart,arrive | a,i | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;none:true none:true right:false, |
|
||||
| a,j | road,7th,7th | depart,turn right,arrive | a,h,j | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:false none:false none:true,none:false none:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Oak St, Franklin St
|
||||
|
||||
@ -687,7 +687,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,ae,dbef,dbef | depart,fork slight right,turn right,arrive | s,a,e,f |
|
||||
| s,f | sabc,ae,dbef,dbef | depart,turn straight,turn right,arrive | s,a,e,f |
|
||||
|
||||
@sliproads
|
||||
Scenario: Traffic Signal on Sliproad
|
||||
|
||||
@ -64,7 +64,7 @@ Feature: Merge Segregated Roads
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,f | road,road,road,road | true:90,false:45 true:135 false:270;true:45 true:180 false:315;true:90 false:225 true:315;true:270 |
|
||||
| a,f | road,road,road | true:90,false:45 true:135 false:270;true:45 true:180 false:315,true:90 false:225 true:315;true:270 |
|
||||
|
||||
#https://www.openstreetmap.org/#map=19/52.50003/13.33915
|
||||
@negative
|
||||
@ -193,7 +193,7 @@ Feature: Merge Segregated Roads
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,g | road,road | true:90,false:90 true:150 false:270,true:90 false:270 true:345;true:270 |
|
||||
| a,g | road,road | true:90,false:90 true:165 false:270,true:90 false:270 true:345;true:270 |
|
||||
|
||||
Scenario: Merging parallel roads with intermediate bridges
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
|
||||
@ -277,7 +277,7 @@ Feature: Simple Turns
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | c | menz,rem | depart,arrive |
|
||||
| d | c | rem,rem,rem | depart,continue left,arrive |
|
||||
| d | c | rem,rem | depart,arrive |
|
||||
| c | d | rem,rem,rem | depart,continue right,arrive |
|
||||
| c | a | rem,menz | depart,arrive |
|
||||
|
||||
|
||||
@ -160,8 +160,8 @@ Feature: Ramp Guidance
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd,bd | depart,on ramp right,arrive |
|
||||
| a,c | ab,bc,bc | depart,turn left,arrive |
|
||||
| a,d | ab,bd,bd | depart,on ramp right,arrive |
|
||||
| a,c | ab,bc | depart,arrive |
|
||||
|
||||
Scenario: Fork Slight Ramp
|
||||
Given the node map
|
||||
@ -179,8 +179,8 @@ Feature: Ramp Guidance
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd,bd | depart,on ramp slight right,arrive |
|
||||
| a,c | ab,bc,bc | depart,turn slight left,arrive |
|
||||
| a,d | ab,bd,bd | depart,on ramp slight right,arrive |
|
||||
| a,c | ab,bc | depart,arrive |
|
||||
|
||||
Scenario: Fork Slight Ramp on Through Street
|
||||
Given the node map
|
||||
|
||||
@ -791,10 +791,10 @@ Feature: Basic Roundabout
|
||||
# the turn angles here are quite strange, so we do get uturns for exiting
|
||||
When I route I should get
|
||||
| from | to | route | turns | distance |
|
||||
| e | f | ed,af,af,af | depart,roundabout-exit-1,exit roundabout left,arrive | 80.1m |
|
||||
| f | e | af,ed,ed,ed | depart,roundabout-exit-1,exit roundabout uturn,arrive | 120.1m |
|
||||
| k | l | kg,hl,hl,hl | depart,roundabout-exit-1,exit roundabout right,arrive | 80.1m |
|
||||
| l | k | hl,kg,kg,kg | depart,roundabout-exit-1,exit roundabout uturn,arrive | 120.1m |
|
||||
| e | f | ed,af,af,af | depart,roundabout-exit-1,exit roundabout left,arrive | 80m |
|
||||
| f | e | af,ed,ed,ed | depart,roundabout-exit-1,exit roundabout uturn,arrive | 120m |
|
||||
| k | l | kg,hl,hl,hl | depart,roundabout-exit-1,exit roundabout right,arrive | 80m |
|
||||
| l | k | hl,kg,kg,kg | depart,roundabout-exit-1,exit roundabout uturn,arrive | 120m |
|
||||
|
||||
@4030 @4075
|
||||
Scenario: Service roundabout with service exits
|
||||
@ -846,5 +846,5 @@ Feature: Basic Roundabout
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | distance |
|
||||
| e | k | ebds,ufghl,ufghl,jhik,jhik | depart,rstur-exit-2,exit rotary right,turn right,arrive | 189.1m |
|
||||
| e | k | ebds,ufghl,ufghl,jhik,jhik | depart,rstur-exit-2,exit rotary right,turn right,arrive | 189.2m |
|
||||
| 1 | k | ebds,ufghl,ufghl,jhik,jhik | depart,rstur-exit-2,exit rotary right,turn right,arrive | 159.1m |
|
||||
|
||||
@ -836,9 +836,9 @@ Feature: Turn Lane Guidance
|
||||
| cf | secondary | bottom | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route | lanes |
|
||||
| a,d | depart,continue right,continue right,arrive | road,road,road,road | ,straight:false right:true,, |
|
||||
| d,a | depart,continue left,continue left,arrive | road,road,road,road | ,left:true straight:false,, |
|
||||
| waypoints | turns | route | lanes |
|
||||
| a,d | depart,continue uturn,arrive | road,road,road | ,straight:false right:true;, |
|
||||
| d,a | depart,continue uturn,arrive | road,road,road | ,left:true straight:false;, |
|
||||
|
||||
@simple
|
||||
Scenario: Merge Lanes Onto Freeway
|
||||
|
||||
@ -45,11 +45,12 @@ class OSRMBaseLoader{
|
||||
var retryCount = 0;
|
||||
let retry = (err) => {
|
||||
if (err) {
|
||||
if (retryCount < 10) {
|
||||
if (retryCount < this.scope.OSRM_CONNECTION_RETRIES) {
|
||||
const timeoutMs = 10 * Math.pow(this.scope.OSRM_CONNECTION_EXP_BACKOFF_COEF, retryCount);
|
||||
retryCount++;
|
||||
setTimeout(() => { tryConnect(this.scope.OSRM_IP, this.scope.OSRM_PORT, retry); }, 10);
|
||||
setTimeout(() => { tryConnect(this.scope.OSRM_IP, this.scope.OSRM_PORT, retry); }, timeoutMs);
|
||||
} else {
|
||||
callback(new Error("Could not connect to osrm-routed after ten retries."));
|
||||
callback(new Error(`Could not connect to osrm-routed after ${this.scope.OSRM_CONNECTION_RETRIES} retries.`));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -180,3 +180,30 @@ Feature: Turn Function Information
|
||||
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 3, access_turn_classification: 0/
|
||||
# turning abc, give information about about db
|
||||
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 0, access_turn_classification: 1/
|
||||
|
||||
Scenario: Turns should have correct information of two-way roads at intersection
|
||||
Given the node map
|
||||
"""
|
||||
b
|
||||
|
|
||||
a-c-d
|
||||
|
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ac | motorway | yes |
|
||||
| cd | motorway_link | yes |
|
||||
| bc | trunk | yes |
|
||||
| cb | trunk_link | yes |
|
||||
| ce | primary | yes |
|
||||
| ec | primary_link | yes |
|
||||
And the data has been saved to disk
|
||||
|
||||
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||
Then it should exit successfully
|
||||
# Turn acd
|
||||
# on the left there should be cb (and bc)
|
||||
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: true, highway_turn_classification: [0-9]+, access_turn_classification: 0, priority_class: 3/
|
||||
# on the right there should be ce and ec
|
||||
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: true, highway_turn_classification: [0-9]+, access_turn_classification: 0, priority_class: 4/
|
||||
|
||||
@ -20,6 +20,6 @@ Feature: osrm-extract with a profile containing raster source
|
||||
And the data has been saved to disk
|
||||
When I run "osrm-extract {osm_file} -p {profile_file}"
|
||||
Then stdout should contain "source loader"
|
||||
Then stdout should contain "slope: 0.0899"
|
||||
Then stdout should contain "slope: -0.0899"
|
||||
Then stdout should contain "slope: 0.0904"
|
||||
Then stdout should contain "slope: -0.0904"
|
||||
And it should exit successfully
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
var util = require('util');
|
||||
var d3 = require('d3-queue');
|
||||
var classes = require('../support/data_classes');
|
||||
const util = require('util');
|
||||
const d3 = require('d3-queue');
|
||||
const classes = require('../support/data_classes');
|
||||
|
||||
module.exports = function () {
|
||||
this.Then(/^routability should be$/, (table, callback) => {
|
||||
@ -115,8 +115,11 @@ module.exports = function () {
|
||||
var result = {};
|
||||
|
||||
var testDirection = (dir, callback) => {
|
||||
var a = new classes.Location(this.origin[0] + (1+this.WAY_SPACING*i) * this.zoom, this.origin[1]),
|
||||
b = new classes.Location(this.origin[0] + (3+this.WAY_SPACING*i) * this.zoom, this.origin[1]),
|
||||
const coordA = this.offsetOriginBy(1+this.WAY_SPACING*i, 0);
|
||||
const coordB = this.offsetOriginBy(3+this.WAY_SPACING*i, 0);
|
||||
|
||||
var a = new classes.Location(coordA[0], coordA[1]),
|
||||
b = new classes.Location(coordB[0], coordB[1]),
|
||||
r = {};
|
||||
|
||||
r.which = dir;
|
||||
|
||||
@ -114,9 +114,12 @@ module.exports = function() {
|
||||
let dependencies = [
|
||||
this.OSRM_EXTRACT_PATH,
|
||||
this.OSRM_CONTRACT_PATH,
|
||||
this.OSRM_CUSTOMIZE_PATH,
|
||||
this.OSRM_PARTITION_PATH,
|
||||
this.LIB_OSRM_EXTRACT_PATH,
|
||||
this.LIB_OSRM_GUIDANCE_PATH,
|
||||
this.LIB_OSRM_CONTRACT_PATH
|
||||
this.LIB_OSRM_CONTRACT_PATH,
|
||||
this.LIB_OSRM_CUSTOMIZE_PATH,
|
||||
this.LIB_OSRM_PARTITION_PATH
|
||||
];
|
||||
|
||||
var addLuaFiles = (directory, callback) => {
|
||||
|
||||
@ -9,17 +9,27 @@ const classes = require('./data_classes');
|
||||
const tableDiff = require('../lib/table_diff');
|
||||
const ensureDecimal = require('../lib/utils').ensureDecimal;
|
||||
const errorReason = require('../lib/utils').errorReason;
|
||||
const CheapRuler = require('cheap-ruler');
|
||||
|
||||
module.exports = function () {
|
||||
this.setGridSize = (meters) => {
|
||||
this.gridSize = parseFloat(meters);
|
||||
|
||||
// the constant is calculated (with BigDecimal as: 1.0/(DEG_TO_RAD*EARTH_RADIUS_IN_METERS
|
||||
// see ApproximateDistance() in ExtractorStructs.h
|
||||
// it's only accurate when measuring along the equator, or going exactly north-south
|
||||
this.zoom = parseFloat(meters) * 0.8990679362704610899694577444566908445396483347536032203503E-5;
|
||||
this.zoom = this.gridSize * 0.8990679362704610899694577444566908445396483347536032203503E-5;
|
||||
};
|
||||
|
||||
this.setOrigin = (origin) => {
|
||||
this.origin = origin;
|
||||
// we use C++ version of `cheap-ruler` inside OSRM in order to do distance calculations,
|
||||
// so here we use it too to have a bit more precise assertions
|
||||
this.ruler = new CheapRuler(this.origin[1], 'meters');
|
||||
};
|
||||
|
||||
this.offsetOriginBy = (xCells, yCells) => {
|
||||
return this.ruler.offset(this.origin, xCells * this.gridSize, yCells * this.gridSize);
|
||||
};
|
||||
|
||||
this.buildWaysFromTable = (table, callback) => {
|
||||
@ -35,9 +45,10 @@ module.exports = function () {
|
||||
// add some nodes
|
||||
|
||||
var makeFakeNode = (namePrefix, offset) => {
|
||||
const coord = this.offsetOriginBy(offset + this.WAY_SPACING * ri, 0);
|
||||
return new OSM.Node(this.makeOSMId(), this.OSM_USER, this.OSM_TIMESTAMP,
|
||||
this.OSM_UID, this.origin[0]+(offset + this.WAY_SPACING * ri) * this.zoom,
|
||||
this.origin[1], {name: util.format('%s%d', namePrefix, ri)});
|
||||
this.OSM_UID, coord[0],
|
||||
coord[1], {name: util.format('%s%d', namePrefix, ri)});
|
||||
};
|
||||
|
||||
var nodes = ['a','b','c','d','e'].map((l, i) => makeFakeNode(l, i));
|
||||
@ -98,7 +109,7 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.tableCoordToLonLat = (ci, ri) => {
|
||||
return [this.origin[0] + ci * this.zoom, this.origin[1] - ri * this.zoom].map(ensureDecimal);
|
||||
return this.offsetOriginBy(ci, -ri).map(ensureDecimal);
|
||||
};
|
||||
|
||||
this.addOSMNode = (name, lon, lat, id) => {
|
||||
|
||||
@ -40,6 +40,9 @@ module.exports = function () {
|
||||
|
||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||
this.OSRM_IP = process.env.OSRM_IP || '127.0.0.1';
|
||||
this.OSRM_CONNECTION_RETRIES = process.env.OSRM_CONNECTION_RETRIES && parseInt(process.env.OSRM_CONNECTION_RETRIES) || 10;
|
||||
this.OSRM_CONNECTION_EXP_BACKOFF_COEF = process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF && parseFloat(process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF) || 1.0;
|
||||
|
||||
this.HOST = `http://${this.OSRM_IP}:${this.OSRM_PORT}`;
|
||||
|
||||
this.OSRM_PROFILE = process.env.OSRM_PROFILE;
|
||||
@ -67,10 +70,13 @@ module.exports = function () {
|
||||
|
||||
this.OSRM_EXTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-extract', this.EXE));
|
||||
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
|
||||
this.OSRM_CUSTOMIZE_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-customize', this.EXE));
|
||||
this.OSRM_PARTITION_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-partition', this.EXE));
|
||||
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
|
||||
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
|
||||
this.LIB_OSRM_GUIDANCE_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_guidance'),
|
||||
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
|
||||
this.LIB_OSRM_CUSTOMIZE_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_customize'),
|
||||
this.LIB_OSRM_PARTITION_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_partition'),
|
||||
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
@ -111,7 +117,7 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
var q = d3.queue();
|
||||
[this.OSRM_EXTRACT_PATH, this.OSRM_CONTRACT_PATH, this.OSRM_ROUTED_PATH].forEach(bin => { q.defer(verify, bin); });
|
||||
[this.OSRM_EXTRACT_PATH, this.OSRM_CONTRACT_PATH, this.OSRM_CUSTOMIZE_PATH, this.OSRM_PARTITION_PATH, this.OSRM_ROUTED_PATH].forEach(bin => { q.defer(verify, bin); });
|
||||
q.awaitAll(callback);
|
||||
};
|
||||
|
||||
|
||||
@ -115,4 +115,4 @@ Feature: Annotations
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
|
||||
| a | c | abc,abc | 10:10 | 249.998641:299.931643 | 25:30 | 1:2:3 |
|
||||
| a | c | abc,abc | 10:10 | 249.987619:299.962882 | 25:30 | 1:2:3 |
|
||||
|
||||
@ -108,12 +108,12 @@ Feature: Bearing parameter
|
||||
| ha | yes | ring |
|
||||
|
||||
When I route I should get
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | q | 0 90 | ia,ring,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | q | 90 90 | kc,ring,ring,ring,ring | 0->90,90->180,270->0,0->90,90->0 |
|
||||
| 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 180 90 | me,ring,ring,ring,ring | 0->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,90->0 |
|
||||
| 0 | a | 270 90 | og,ring,ring,ring | 0->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||
| from | to | bearings | route | bearing |
|
||||
| 0 | q | 0 90 | ia,ring,ring,ring,ring,ring,ring | 0->0,0->90,90->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | q | 90 90 | kc,ring,ring,ring,ring,ring | 0->90,90->180,180->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
|
||||
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,0->90,90->0 |
|
||||
| 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,90->0 |
|
||||
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
|
||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||
|
||||
@ -20,5 +20,5 @@ Feature: Geometry Compression
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance | speed |
|
||||
| b | e | abcdef,abcdef | 588.5m | 36 km/h |
|
||||
| e | b | abcdef,abcdef | 588.5m | 36 km/h |
|
||||
| b | e | abcdef,abcdef | 588.7m | 36 km/h |
|
||||
| e | b | abcdef,abcdef | 588.7m | 36 km/h |
|
||||
|
||||
@ -90,8 +90,8 @@ Feature: Distance calculation
|
||||
| b | a | abc,abc | 100m |
|
||||
| b | c | abc,abc | 100m |
|
||||
| c | b | abc,abc | 100m |
|
||||
| a | c | abc,abc | 200m |
|
||||
| c | a | abc,abc | 200m |
|
||||
| a | c | abc,abc | 199.9m |
|
||||
| c | a | abc,abc | 199.9m |
|
||||
|
||||
Scenario: 1km distance
|
||||
Given a grid size of 1000 meters
|
||||
@ -134,7 +134,7 @@ Feature: Distance calculation
|
||||
| a | c | abcdefgh,abcdefgh | 20m |
|
||||
| a | d | abcdefgh,abcdefgh | 30m |
|
||||
| a | e | abcdefgh,abcdefgh | 40m |
|
||||
| a | f | abcdefgh,abcdefgh | 50m |
|
||||
| a | f | abcdefgh,abcdefgh | 50.1m |
|
||||
| a | g | abcdefgh,abcdefgh | 60m +-1 |
|
||||
| a | h | abcdefgh,abcdefgh | 70m +-1 |
|
||||
|
||||
@ -154,9 +154,9 @@ Feature: Distance calculation
|
||||
| from | to | route | distance |
|
||||
| a | b | abcdefgh,abcdefgh | 10m |
|
||||
| a | c | abcdefgh,abcdefgh | 20m |
|
||||
| a | d | abcdefgh,abcdefgh | 30m |
|
||||
| a | e | abcdefgh,abcdefgh | 40m |
|
||||
| a | f | abcdefgh,abcdefgh | 50m |
|
||||
| a | d | abcdefgh,abcdefgh | 29.9m |
|
||||
| a | e | abcdefgh,abcdefgh | 39.9m |
|
||||
| a | f | abcdefgh,abcdefgh | 49.9m |
|
||||
| a | g | abcdefgh,abcdefgh | 60m +-1 |
|
||||
| a | h | abcdefgh,abcdefgh | 70m +-1 |
|
||||
|
||||
|
||||
@ -22,10 +22,10 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
| f | 299.5 | 199.5 | 100.1 | 0 |
|
||||
| a | 0 | 100 | 199.9 | 300 |
|
||||
| b | 100 | 0 | 100 | 200 |
|
||||
| e | 199.9 | 100 | 0 | 100.1 |
|
||||
| f | 300 | 200 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network exact distances
|
||||
Given the node map
|
||||
@ -43,11 +43,11 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | z | b | c | d |
|
||||
| a | 0 | 100.1 | 199.5 | 298.9 | 398.3 |
|
||||
| z | 100.1 | 0 | 99.4 | 198.8 | 298.2 |
|
||||
| b | 199.5 | 99.4 | 0 | 99.4 | 198.8 |
|
||||
| c | 298.9 | 198.8 | 99.4 | 0 | 99.4 |
|
||||
| d | 398.3 | 298.2 | 198.8 | 99.4 | 0 |
|
||||
| a | 0 | 100 | 199.9 | 300 | 399.9 |
|
||||
| z | 100 | 0 | 100 | 200 | 300 |
|
||||
| b | 199.9 | 100 | 0 | 100.1 | 200 |
|
||||
| c | 300 | 200 | 100.1 | 0 | 100 |
|
||||
| d | 399.9 | 300 | 200 | 100 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network with toll exclude
|
||||
Given the query options
|
||||
@ -68,10 +68,10 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 100.1 | | |
|
||||
| b | 100.1 | 0 | | |
|
||||
| c | | | 0 | 100.1 |
|
||||
| d | | | 100.1 | 0 |
|
||||
| a | 0 | 100 | | |
|
||||
| b | 100 | 0 | | |
|
||||
| c | | | 0 | 100 |
|
||||
| d | | | 100 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network with motorway exclude
|
||||
Given the query options
|
||||
@ -92,7 +92,7 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 298.9 | 99.4 | 199.5 |
|
||||
| a | 0 | 299.9 | 100 | 199.9 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network disconnected motorway exclude
|
||||
Given the query options
|
||||
@ -113,7 +113,7 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e |
|
||||
| a | 0 | 50.1 | |
|
||||
| a | 0 | 50 | |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of minimal network with motorway and toll excludes
|
||||
Given the query options
|
||||
@ -134,7 +134,7 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | g |
|
||||
| a | 0 | 100.1 | | |
|
||||
| a | 0 | 100 | | |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix with different way speeds
|
||||
Given the node map
|
||||
@ -150,21 +150,21 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 100.1 | 200.1 | 300.2 |
|
||||
| b | 100.1 | 0 | 100.1 | 200.1 |
|
||||
| c | 200.1 | 100.1 | 0 | 100.1 |
|
||||
| d | 300.2 | 200.1 | 100.1 | 0 |
|
||||
| a | 0 | 100 | 200 | 300 |
|
||||
| b | 100 | 0 | 100.1 | 200 |
|
||||
| c | 200 | 100.1 | 0 | 100 |
|
||||
| d | 300 | 200 | 100 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 100.1 | 200.1 | 300.2 |
|
||||
| a | 0 | 100 | 200 | 300 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 100.1 |
|
||||
| c | 200.1 |
|
||||
| d | 300.2 |
|
||||
| b | 100 |
|
||||
| c | 200 |
|
||||
| d | 300 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of small grid
|
||||
Given the node map
|
||||
@ -183,10 +183,10 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
| f | 299.5 | 199.5 | 100.1 | 0 |
|
||||
| a | 0 | 100 | 199.9 | 300 |
|
||||
| b | 100 | 0 | 100 | 200 |
|
||||
| e | 199.9 | 100 | 0 | 100.1 |
|
||||
| f | 300 | 200 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of network with unroutable parts
|
||||
Given the node map
|
||||
@ -200,7 +200,7 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 100.1 |
|
||||
| a | 0 | 100 |
|
||||
| b | | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix of network with oneways
|
||||
@ -218,10 +218,10 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | x | y | d | e |
|
||||
| x | 0 | 300.2 | 399.6 | 299.5 |
|
||||
| y | 499 | 0 | 299.5 | 199.5 |
|
||||
| d | 199.5 | 299.5 | 0 | 298.9 |
|
||||
| e | 299.5 | 399.6 | 100.1 | 0 |
|
||||
| x | 0 | 300 | 400 | 300 |
|
||||
| y | 499.9 | 0 | 300 | 199.9 |
|
||||
| d | 199.9 | 300 | 0 | 300 |
|
||||
| e | 300 | 400 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Rectangular travel distance matrix
|
||||
Given the node map
|
||||
@ -240,53 +240,53 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I route I should get
|
||||
| from | to | distance |
|
||||
| e | a | 200m |
|
||||
| e | a | 199.9m |
|
||||
| e | b | 100m |
|
||||
| f | a | 299.9m |
|
||||
| f | a | 300m |
|
||||
| f | b | 200m |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| a | 0 | 100 | 199.9 | 300 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 100.1 |
|
||||
| e | 199.5 |
|
||||
| f | 299.5 |
|
||||
| b | 100 |
|
||||
| e | 199.9 |
|
||||
| f | 300 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| a | 0 | 100 | 199.9 | 300 |
|
||||
| b | 100 | 0 | 100 | 200 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b |
|
||||
| a | 0 | 100.1 |
|
||||
| b | 100.1 | 0 |
|
||||
| e | 199.5 | 99.4 |
|
||||
| f | 299.5 | 199.5 |
|
||||
| a | 0 | 100 |
|
||||
| b | 100 | 0 |
|
||||
| e | 199.9 | 100 |
|
||||
| f | 300 | 200 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
| a | 0 | 100 | 199.9 | 300 |
|
||||
| b | 100 | 0 | 100 | 200 |
|
||||
| e | 199.9 | 100 | 0 | 100.1 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e |
|
||||
| a | 0 | 100.1 | 199.5 |
|
||||
| b | 100.1 | 0 | 99.4 |
|
||||
| e | 199.5 | 99.4 | 0 |
|
||||
| f | 299.5 | 199.5 | 100.1 |
|
||||
| a | 0 | 100 | 199.9 |
|
||||
| b | 100 | 0 | 100 |
|
||||
| e | 199.9 | 100 | 0 |
|
||||
| f | 300 | 200 | 100.1 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | e | f |
|
||||
| a | 0 | 100.1 | 199.5 | 299.5 |
|
||||
| b | 100.1 | 0 | 99.4 | 199.5 |
|
||||
| e | 199.5 | 99.4 | 0 | 100.1 |
|
||||
| f | 299.5 | 199.5 | 100.1 | 0 |
|
||||
| a | 0 | 100 | 199.9 | 300 |
|
||||
| b | 100 | 0 | 100 | 200 |
|
||||
| e | 199.9 | 100 | 0 | 100.1 |
|
||||
| f | 300 | 200 | 100.1 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance 3x2 matrix
|
||||
Given the node map
|
||||
@ -306,8 +306,8 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | b | e | f |
|
||||
| a | 100.1 | 199.5 | 299.5 |
|
||||
| b | 0 | 99.4 | 199.5 |
|
||||
| a | 100 | 199.9 | 300 |
|
||||
| b | 0 | 100 | 200 |
|
||||
|
||||
Scenario: Testbot - All coordinates are from same small component
|
||||
Given a grid size of 300 meters
|
||||
@ -328,8 +328,8 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | f | g |
|
||||
| f | 0 | 298.2 |
|
||||
| g | 298.2 | 0 |
|
||||
| f | 0 | 300 |
|
||||
| g | 300 | 0 |
|
||||
|
||||
Scenario: Testbot - Coordinates are from different small component and snap to big CC
|
||||
Given a grid size of 300 meters
|
||||
@ -362,10 +362,10 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | f | g | h | i |
|
||||
| f | 0 | 298.2 | 0 | 298.2 |
|
||||
| g | 298.2 | 0 | 298.2 | 0 |
|
||||
| h | 0 | 298.2 | 0 | 298.2 |
|
||||
| i | 298.2 | 0 | 298.2 | 0 |
|
||||
| f | 0 | 300 | 0 | 300 |
|
||||
| g | 300 | 0 | 300 | 0 |
|
||||
| h | 0 | 300 | 0 | 300 |
|
||||
| i | 300 | 0 | 300 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix with loops
|
||||
Given the node map
|
||||
@ -383,10 +383,10 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | 1 | 2 | 3 | 4 |
|
||||
| 1 | 0 | 100.1 | 399.6 | 499.7 |
|
||||
| 2 | 699.1 | 0 | 299.5 | 399.6 |
|
||||
| 3 | 399.6 | 499.7 | 0 | 100.1 |
|
||||
| 4 | 299.5 | 399.6 | 699.1 | 0 |
|
||||
| 1 | 0 | 100.1 | 399.9 | 500 |
|
||||
| 2 | 699.8 | 0 | 299.9 | 399.9 |
|
||||
| 3 | 399.9 | 500 | 0 | 100.1 |
|
||||
| 4 | 299.9 | 399.9 | 699.8 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel distance matrix based on segment durations
|
||||
@ -424,11 +424,11 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d | e |
|
||||
| a | 0 | 100.1 | 200.1 | 300.2 | 398.9 |
|
||||
| b | 100.1 | 0 | 100.1 | 200.1 | 298.9 |
|
||||
| c | 200.1 | 100.1 | 0 | 100.1 | 198.8 |
|
||||
| d | 300.2 | 200.1 | 100.1 | 0 | 298.9 |
|
||||
| e | 398.9 | 298.9 | 198.8 | 298.9 | 0 |
|
||||
| a | 0 | 100 | 200 | 300 | 400 |
|
||||
| b | 100 | 0 | 100.1 | 200 | 300.1 |
|
||||
| c | 200 | 100.1 | 0 | 100 | 200 |
|
||||
| d | 300 | 200 | 100 | 0 | 300 |
|
||||
| e | 400 | 300.1 | 200 | 300 | 0 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix for alternative loop paths
|
||||
Given the profile file
|
||||
@ -468,25 +468,25 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
| 1 | 0 | 1096.7 | 298.9 | 199.5 | 598.4 | 498.3 | 897.3 | 797.9 |
|
||||
| 2 | 100.1 | 0 | 398.9 | 299.5 | 698.5 | 598.4 | 997.3 | 897.9 |
|
||||
| 3 | 897.9 | 797.9 | 0 | 1097.4 | 299.5 | 199.5 | 598.4 | 499 |
|
||||
| 4 | 997.3 | 897.3 | 99.4 | 0 | 398.9 | 298.9 | 697.8 | 598.4 |
|
||||
| 5 | 598.4 | 498.3 | 897.3 | 797.9 | 0 | 1096.7 | 298.9 | 199.5 |
|
||||
| 6 | 698.5 | 598.4 | 997.3 | 897.9 | 100.1 | 0 | 398.9 | 299.5 |
|
||||
| 7 | 299.5 | 199.5 | 598.4 | 499 | 897.9 | 797.9 | 0 | 1097.4 |
|
||||
| 8 | 398.9 | 298.9 | 697.8 | 598.4 | 997.3 | 897.3 | 99.4 | 0 |
|
||||
| 1 | 0 | 1099.8 | 300 | 199.9 | 600 | 499.9 | 899.9 | 799.9 |
|
||||
| 2 | 100.1 | 0 | 400 | 300 | 700 | 600 | 1000 | 899.9 |
|
||||
| 3 | 899.9 | 799.9 | 0 | 1099.8 | 300 | 199.9 | 600 | 499.9 |
|
||||
| 4 | 1000 | 899.9 | 100.1 | 0 | 400 | 300 | 700 | 600 |
|
||||
| 5 | 600 | 499.9 | 899.9 | 799.9 | 0 | 1099.8 | 300 | 199.9 |
|
||||
| 6 | 700 | 600 | 1000 | 899.9 | 100.1 | 0 | 400 | 300 |
|
||||
| 7 | 300 | 199.9 | 600 | 499.9 | 899.9 | 799.9 | 0 | 1099.8 |
|
||||
| 8 | 400 | 300 | 700 | 600 | 1000 | 899.9 | 100.1 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | 1 |
|
||||
| 1 | 0 |
|
||||
| 2 | 100.1 |
|
||||
| 3 | 897.9 |
|
||||
| 4 | 997.3 |
|
||||
| 5 | 598.4 |
|
||||
| 6 | 698.5 |
|
||||
| 7 | 299.5 |
|
||||
| 8 | 398.9 |
|
||||
| 3 | 899.9 |
|
||||
| 4 | 1000 |
|
||||
| 5 | 600 |
|
||||
| 6 | 700 |
|
||||
| 7 | 300 |
|
||||
| 8 | 400 |
|
||||
|
||||
Scenario: Testbot - Travel distance matrix with ties
|
||||
Given the node map
|
||||
@ -511,23 +511,23 @@ Feature: Basic Distance Matrix
|
||||
| from | to | route | distance |
|
||||
| a | b | ab,ab | 450m |
|
||||
| a | c | ac,ac | 200m |
|
||||
| a | d | ac,dc,dc | 499.9m |
|
||||
| a | d | ac,dc,dc | 500m |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 450.3 | 198.8 | 499 |
|
||||
| a | 0 | 450 | 200 | 500 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 450.3 |
|
||||
| c | 198.8 |
|
||||
| d | 499 |
|
||||
| b | 450 |
|
||||
| c | 200 |
|
||||
| d | 500 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | c |
|
||||
| a | 0 | 198.8 |
|
||||
| c | 198.8 | 0 |
|
||||
| a | 0 | 200 |
|
||||
| c | 200 | 0 |
|
||||
|
||||
|
||||
# Check rounding errors
|
||||
@ -544,7 +544,7 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d |
|
||||
| a | 0 | 1000.7 | 2001.4 | 3002.1 |
|
||||
| a | 0 | 1000.1 | 2000 | 3000.1 |
|
||||
|
||||
|
||||
Scenario: Testbot - OneToMany vs ManyToOne
|
||||
@ -562,12 +562,12 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b |
|
||||
| b | 240.4 | 0 |
|
||||
| b | 241.3 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 240.4 |
|
||||
| b | 241.3 |
|
||||
|
||||
Scenario: Testbot - Varying distances between nodes
|
||||
Given the node map
|
||||
@ -589,12 +589,13 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | c | d | e | f |
|
||||
| a | 0 | 100.1 | 300.2 | 650.5 | 1930.6 | 1533 |
|
||||
| b | 759 | 0 | 200.1 | 550.4 | 1830.5 | 1432.9 |
|
||||
| c | 558.8 | 658.9 | 0 | 350.3 | 1630.4 | 1232.8 |
|
||||
| d | 1478.9 | 1579 | 1779.1 | 0 | 1280.1 | 882.5 |
|
||||
| e | 198.8 | 298.9 | 499 | 710.3 | 0 | 1592.8 |
|
||||
| f | 596.4 | 696.5 | 896.6 | 1107.9 | 397.6 | 0 |
|
||||
| a | 0 | 100 | 300 | 650 | 1934.5 | 1534.6 |
|
||||
| b | 760.6 | 0 | 200 | 550.1 | 1834.6 | 1434.6 |
|
||||
| c | 560.6 | 660.5 | 0 | 350 | 1634.6 | 1234.6 |
|
||||
| d | 1484.6 | 1584.5| 1784.5 | 0 | 1284.5 | 884.6 |
|
||||
| e | 200 | 300 | 500 | 710.6 | 0 | 1595.2 |
|
||||
| f | 600 | 699.9 | 899.9 | 1110.5 | 399.9 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Filling in noroutes with estimates (defaults to input coordinate location)
|
||||
Given a grid size of 300 meters
|
||||
@ -614,21 +615,21 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 300.2 | 900.7 | 1501.1 |
|
||||
| b | 300.2 | 0 | 600.5 | 1200.9 |
|
||||
| f | 900.7 | 600.5 | 0 | 300.2 |
|
||||
| 1 | 1501.1 | 1200.9 | 300.2 | 0 |
|
||||
| a | 0 | 300 | 900 | 1500 |
|
||||
| b | 300 | 0 | 600 | 1200.1 |
|
||||
| f | 900 | 600 | 0 | 300 |
|
||||
| 1 | 1500 | 1200.1 | 300 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 300.2 | 900.7 | 1501.1 |
|
||||
| a | 0 | 300 | 900 | 1500 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 300.2 |
|
||||
| f | 900.7 |
|
||||
| 1 | 1501.1 |
|
||||
| b | 300 |
|
||||
| f | 900 |
|
||||
| 1 | 1500 |
|
||||
|
||||
Scenario: Testbot - Fise input coordinate
|
||||
Given a grid size of 300 meters
|
||||
@ -649,21 +650,21 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 300.2 | 900.7 | 1501.1 |
|
||||
| b | 300.2 | 0 | 600.5 | 1200.9 |
|
||||
| f | 900.7 | 600.5 | 0 | 300.2 |
|
||||
| 1 | 1501.1 | 1200.9 | 300.2 | 0 |
|
||||
| a | 0 | 300 | 900 | 1500 |
|
||||
| b | 300 | 0 | 600 | 1200.1 |
|
||||
| f | 900 | 600 | 0 | 300 |
|
||||
| 1 | 1500 | 1200.1 | 300 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 300.2 | 900.7 | 1501.1 |
|
||||
| a | 0 | 300 | 900 | 1500 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 300.2 |
|
||||
| f | 900.7 |
|
||||
| 1 | 1501.1 |
|
||||
| b | 300 |
|
||||
| f | 900 |
|
||||
| 1 | 1500 |
|
||||
|
||||
|
||||
Scenario: Testbot - Filling in noroutes with estimates - use snapped coordinate
|
||||
@ -685,28 +686,28 @@ Feature: Basic Distance Matrix
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 300.2 | 900.7 | 1200.9 |
|
||||
| b | 300.2 | 0 | 600.5 | 900.7 |
|
||||
| f | 900.7 | 600.5 | 0 | 300.2 |
|
||||
| 1 | 1200.9 | 900.7 | 300.2 | 0 |
|
||||
| a | 0 | 300 | 900 | 1200 |
|
||||
| b | 300 | 0 | 600 | 900 |
|
||||
| f | 900 | 600 | 0 | 300 |
|
||||
| 1 | 1200 | 900 | 300 | 0 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 300.2 | 900.7 | 1200.9 |
|
||||
| a | 0 | 300 | 900 | 1200 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 300.2 |
|
||||
| f | 900.7 |
|
||||
| 1 | 1200.9 |
|
||||
| b | 300 |
|
||||
| f | 900 |
|
||||
| 1 | 1200 |
|
||||
|
||||
Scenario: Ensure consistency with route, and make sure offsets work in both directions
|
||||
Given a grid size of 100 meters
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e f g h i j
|
||||
1 2
|
||||
1 2 3
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@ -715,11 +716,14 @@ Feature: Basic Distance Matrix
|
||||
| fghij |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| 1 | 2 | abcdef,fghij,fghij | 999.9m |
|
||||
| from | to | route | distance |
|
||||
| 1 | 2 | abcdef,fghij,fghij | 1000.1m |
|
||||
| 1 | 3 | abcdef,fghij,fghij | 1400.1m |
|
||||
| 2 | 3 | fghij,fghij | 400m |
|
||||
|
||||
|
||||
# TODO: this is "correct", but inconsistent with viaroute
|
||||
When I request a travel distance matrix I should get
|
||||
| | 1 | 2 |
|
||||
| 1 | 0 | 1000.7 |
|
||||
| 2 | 1000.7 | 0 |
|
||||
| | 1 | 2 | 3 |
|
||||
| 1 | 0 | 1000.1 | 1400.1 |
|
||||
| 2 | 1000.1 | 0 | 400 |
|
||||
| 3 | 1400.1 | 400 | 0 |
|
||||
@ -446,15 +446,15 @@ Feature: Basic Duration Matrix
|
||||
| ca | yes |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
| 1 | 0 | 11 | 3 | 2 | 6 | 5 | 8.9 | 7.9 |
|
||||
| 2 | 1 | 0 | 4 | 3 | 7 | 6 | 9.9 | 8.9 |
|
||||
| 3 | 9 | 8 | 0 | 11 | 3 | 2 | 5.9 | 4.9 |
|
||||
| 4 | 10 | 9 | 1 | 0 | 4 | 3 | 6.9 | 5.9 |
|
||||
| 5 | 6 | 5 | 9 | 8 | 0 | 11 | 2.9 | 1.9 |
|
||||
| 6 | 7 | 6 | 10 | 9 | 1 | 0 | 3.9 | 2.9 |
|
||||
| 7 | 3.1 | 2.1 | 6.1 | 5.1 | 9.1 | 8.1 | 0 | 11 |
|
||||
| 8 | 4.1 | 3.1 | 7.1 | 6.1 | 10.1 | 9.1 | 1 | 0 |
|
||||
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
| 1 | 0 | 10.9 | 3 | 1.9 | 6 | 4.9 | 9 | 7.9 |
|
||||
| 2 | 1.1 | 0 | 4.1 | 3 | 7.1 | 6 | 10.1 | 9 |
|
||||
| 3 | 9 | 7.9 | 0 | 10.9 | 3 | 1.9 | 6 | 4.9 |
|
||||
| 4 | 10.1 | 9 | 1.1 | 0 | 4.1 | 3 | 7.1 | 6 |
|
||||
| 5 | 6 | 4.9 | 9 | 7.9 | 0 | 10.9 | 3 | 1.9 |
|
||||
| 6 | 7.1 | 6 | 10.1 | 9 | 1.1 | 0 | 4.1 | 3 |
|
||||
| 7 | 3 | 1.9 | 6 | 4.9 | 9 | 7.9 | 0 | 10.9 |
|
||||
| 8 | 4.1 | 3 | 7.1 | 6 | 10.1 | 9 | 1.1 | 0 |
|
||||
|
||||
|
||||
Scenario: Testbot - Travel time matrix with ties
|
||||
@ -543,22 +543,22 @@ Feature: Basic Duration Matrix
|
||||
| fhigf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 18 | 30 |
|
||||
| b | 30 | 0 | 12 | 24 |
|
||||
| f | 18 | 12 | 0 | 30 |
|
||||
| 1 | 30 | 24 | 30 | 0 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 17.9 | 30 |
|
||||
| b | 30 | 0 | 12 | 24 |
|
||||
| f | 17.9 | 12 | 0 | 30 |
|
||||
| 1 | 30 | 24 | 30 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 18 | 30 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 17.9 | 30 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 30 |
|
||||
| f | 18 |
|
||||
| 1 | 30 |
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 30 |
|
||||
| f | 17.9 |
|
||||
| 1 | 30 |
|
||||
|
||||
When I request a travel time matrix I should get estimates for
|
||||
| | a | b | f | 1 |
|
||||
@ -596,22 +596,22 @@ Feature: Basic Duration Matrix
|
||||
| fhigf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 18 | 30 |
|
||||
| b | 30 | 0 | 12 | 24 |
|
||||
| f | 18 | 12 | 0 | 30 |
|
||||
| 1 | 30 | 24 | 30 | 0 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 17.9 | 30 |
|
||||
| b | 30 | 0 | 12 | 24 |
|
||||
| f | 17.9 | 12 | 0 | 30 |
|
||||
| 1 | 30 | 24 | 30 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 18 | 30 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 17.9 | 30 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 30 |
|
||||
| f | 18 |
|
||||
| 1 | 30 |
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 30 |
|
||||
| f | 17.9 |
|
||||
| 1 | 30 |
|
||||
|
||||
When I request a travel time matrix I should get estimates for
|
||||
| | a | b | f | 1 |
|
||||
@ -650,22 +650,22 @@ Feature: Basic Duration Matrix
|
||||
| fhigf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 18 | 24 |
|
||||
| b | 30 | 0 | 12 | 18 |
|
||||
| f | 18 | 12 | 0 | 30 |
|
||||
| 1 | 24 | 18 | 30 | 0 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 17.9 | 23.9 |
|
||||
| b | 30 | 0 | 12 | 17.9 |
|
||||
| f | 17.9 | 12 | 0 | 30 |
|
||||
| 1 | 23.9 | 17.9 | 30 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 18 | 24 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 30 | 17.9 | 23.9 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 30 |
|
||||
| f | 18 |
|
||||
| 1 | 24 |
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 30 |
|
||||
| f | 17.9 |
|
||||
| 1 | 23.9 |
|
||||
|
||||
When I request a travel time matrix I should get estimates for
|
||||
| | a | b | f | 1 |
|
||||
@ -719,22 +719,22 @@ Feature: Basic Duration Matrix
|
||||
| fhigf |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 60 | 36 | 48 |
|
||||
| b | 60 | 0 | 24 | 36 |
|
||||
| f | 36 | 24 | 0 | 60 |
|
||||
| 1 | 48 | 36 | 60 | 0 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 60 | 35.8 | 47.8 |
|
||||
| b | 60 | 0 | 24 | 35.8 |
|
||||
| f | 35.8 | 24 | 0 | 60 |
|
||||
| 1 | 47.8 | 35.8 | 60 | 0 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 60 | 36 | 48 |
|
||||
| | a | b | f | 1 |
|
||||
| a | 0 | 60 | 35.8 | 47.8 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 60 |
|
||||
| f | 36 |
|
||||
| 1 | 48 |
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| b | 60 |
|
||||
| f | 35.8 |
|
||||
| 1 | 47.8 |
|
||||
|
||||
When I request a travel time matrix I should get estimates for
|
||||
| | a | b | f | 1 |
|
||||
|
||||
@ -279,8 +279,8 @@ Feature: Basic Map Matching
|
||||
| fb | yes |
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | geometry |
|
||||
| efbc | efbc | 1,0.99964,1.00036,0.99964,1.00036,1,1.000719,1 |
|
||||
| trace | matchings | geometry |
|
||||
| efbc | efbc | 1,0.999638,1.000359,0.999638,1.000359,1,1.000719,1 |
|
||||
|
||||
Scenario: Testbot - Geometry details using geojson
|
||||
Given the query options
|
||||
@ -356,7 +356,7 @@ Feature: Basic Map Matching
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | alternatives |
|
||||
| abcdef | abcde | 0,0,0,0,1,1 |
|
||||
| abcdef | abcde | 0,0,0,1,1,1 |
|
||||
|
||||
Scenario: Testbot - Speed greater than speed threshold
|
||||
Given a grid size of 100 meters
|
||||
@ -652,7 +652,7 @@ Feature: Basic Map Matching
|
||||
|
||||
When I match I should get
|
||||
| trace | geometry | code |
|
||||
| defgh | 1,1,1,0.999461,1.000674,0.999461 | Ok |
|
||||
| defgh | 1,1,1,0.999457,1.000674,0.999457 | Ok |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - waypoints trimming too much geometry
|
||||
@ -682,8 +682,8 @@ Feature: Basic Map Matching
|
||||
| waypoints | 0;3 |
|
||||
| overview | full |
|
||||
When I match I should get
|
||||
| trace | geometry | code |
|
||||
| bgkj | 1.000135,1,1.000135,0.99964,1.000387,0.999137 | Ok |
|
||||
| trace | geometry | code |
|
||||
| bgkj | 1.000135,1,1.000135,0.999638,1.000386,0.999132 | Ok |
|
||||
|
||||
|
||||
@match @testbot
|
||||
@ -712,12 +712,12 @@ Feature: Basic Map Matching
|
||||
| overview | full |
|
||||
| steps | true |
|
||||
When I match I should get
|
||||
| trace | geometry | turns | code |
|
||||
| abc | 1,0.99973,1.00027,0.99973,1.000539,0.99973 | depart,arrive | Ok |
|
||||
| abd | 1,0.99973,1.00027,0.99973,1.00027,0.999461 | depart,turn right,arrive | Ok |
|
||||
| abe | 1,0.99973,1.00027,0.99973,1.00027,1 | depart,turn left,arrive | Ok |
|
||||
| ahd | 1,0.99973,1.00027,0.99973,1.00027,0.999461 | depart,turn right,arrive | Ok |
|
||||
| ahe | 1,0.99973,1.00027,0.99973,1.00027,1 | depart,turn left,arrive | Ok |
|
||||
| trace | geometry | turns | code |
|
||||
| abc | 1,0.999729,1.000269,0.999729,1.000539,0.999729 | depart,arrive | Ok |
|
||||
| abd | 1,0.999729,1.000269,0.999729,1.000269,0.999457 | depart,turn right,arrive | Ok |
|
||||
| abe | 1,0.999729,1.000269,0.999729,1.000269,1 | depart,turn left,arrive | Ok |
|
||||
| ahd | 1,0.999729,1.000269,0.999729,1.000269,0.999457 | depart,turn right,arrive | Ok |
|
||||
| ahe | 1,0.999729,1.000269,0.999729,1.000269,1 | depart,turn left,arrive | Ok |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - add source phantoms properly (one phantom on one edge)
|
||||
@ -740,9 +740,9 @@ Feature: Basic Map Matching
|
||||
| annotations | duration,weight |
|
||||
| generate_hints | false |
|
||||
When I match I should get
|
||||
| trace | geometry | a:duration | a:weight | duration |
|
||||
| 123 | 1.000135,1,1.000225,1,1.00036,1,1.000405,1,1.00045,1 | 1:1.5:0.5:0.5 | 1:1.5:0.5:0.5 | 3.5 |
|
||||
| 321 | 1.00045,1,1.000405,1,1.00036,1,1.000225,1,1.000135,1 | 0.5:0.5:1.5:1 | 0.5:0.5:1.5:1 | 3.5 |
|
||||
| trace | geometry | a:duration | a:weight | duration |
|
||||
| 123 | 1.000135,1,1.000225,1,1.000359,1,1.000404,1,1.000449,1 | 1:1.5:0.5:0.4 | 1:1.5:0.5:0.4 | 3.4 |
|
||||
| 321 | 1.000449,1,1.000404,1,1.000359,1,1.000225,1,1.000135,1 | 0.4:0.5:1.5:1 | 0.4:0.5:1.5:1 | 3.4 |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
||||
@ -765,9 +765,9 @@ Feature: Basic Map Matching
|
||||
| annotations | duration,weight |
|
||||
| generate_hints | false |
|
||||
When I match I should get
|
||||
| trace | geometry | a:duration | a:weight | duration |
|
||||
| 1234 | 1.000135,1,1.000225,1,1.000405,1,1.00045,1 | 1:2:0.5 | 1:2:0.5 | 3.5 |
|
||||
| 4321 | 1.00045,1,1.000405,1,1.000225,1,1.000135,1 | 0.5:2:1 | 0.5:2:1 | 3.5 |
|
||||
| trace | geometry | a:duration | a:weight | duration |
|
||||
| 1234 | 1.000135,1,1.000225,1,1.000404,1,1.000449,1 | 1:2:0.4 | 1:2:0.4 | 3.4 |
|
||||
| 4321 | 1.000449,1,1.000404,1,1.000225,1,1.000135,1 | 0.4:2:1 | 0.4:2:1 | 3.4 |
|
||||
|
||||
@match @testbot
|
||||
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
||||
@ -791,5 +791,5 @@ Feature: Basic Map Matching
|
||||
# These should have the same weights/duration in either direction
|
||||
When I match I should get
|
||||
| trace | geometry | a:distance | a:duration | a:weight | duration |
|
||||
| 2345 | 1.00018,1,1.000315,1 | 15.013264 | 1.5 | 1.5 | 1.5 |
|
||||
| 4321 | 1.00027,1,1.000135,1 | 15.013264 | 1.5 | 1.5 | 1.5 |
|
||||
| 2345 | 1.00018,1,1.000314,1 | 14.914666 | 1.4 | 1.4 | 1.4 |
|
||||
| 4321 | 1.00027,1,1.000135,1 | 15.02597 | 1.5 | 1.5 | 1.5 |
|
||||
@ -110,33 +110,34 @@ Feature: Multi level routing
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 2383.7 | 1566.9 | 1366.8 |
|
||||
| f | 2383.7 | 0 | 1293.3 | 1617.3 |
|
||||
| l | 1566.9 | 1293.3 | 0 | 800.5 |
|
||||
| o | 1366.8 | 1617.3 | 800.5 | 0 |
|
||||
| a | 0 | 2391.6 | 1570.8 | 1370.9 |
|
||||
| f | 2391.6 | 0 | 1297.2 | 1620.9 |
|
||||
| l | 1570.8 | 1297.2 | 0 | 800 |
|
||||
| o | 1370.9 | 1620.9 | 800 | 0 |
|
||||
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 2383.7 | 1566.9 | 1366.8 |
|
||||
| a | 0 | 2391.6 | 1570.8 | 1370.9 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a |
|
||||
| a | 0 |
|
||||
| f | 2383.7 |
|
||||
| l | 1566.9 |
|
||||
| o | 1366.8 |
|
||||
| f | 2391.6 |
|
||||
| l | 1570.8 |
|
||||
| o | 1370.9 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | f | l | o |
|
||||
| a | 0 | 2383.7 | 1566.9 | 1366.8 |
|
||||
| f | 2383.7 | 0 | 1293.3 | 1617.3 |
|
||||
| a | 0 | 2391.6 | 1570.8 | 1370.9 |
|
||||
| f | 2391.6 | 0 | 1297.2 | 1620.9 |
|
||||
|
||||
When I request a travel distance matrix I should get
|
||||
| | a | o |
|
||||
| a | 0 | 1366.8 |
|
||||
| f | 2383.7 | 1617.3 |
|
||||
| l | 1566.9 | 800.5 |
|
||||
| o | 1366.8 | 0 |
|
||||
| a | 0 | 1370.9 |
|
||||
| f | 2391.6 | 1620.9 |
|
||||
| l | 1570.8 | 800 |
|
||||
| o | 1370.9 | 0 |
|
||||
|
||||
Scenario: Testbot - Multi level routing: horizontal road
|
||||
Given the node map
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
@routing @testbot @nil
|
||||
Feature: Testbot - Check assigning nil values
|
||||
Scenario: Assign nil values to all way strings
|
||||
Feature: Testbot - Check assigning empty values
|
||||
Scenario: Assign empty values to all way strings
|
||||
Given the profile file
|
||||
"""
|
||||
functions = require('testbot')
|
||||
|
||||
function way_function(profile, way, result)
|
||||
result.name = nil
|
||||
result.ref = nil
|
||||
result.destinations = nil
|
||||
result.exits = nil
|
||||
result.pronunciation = nil
|
||||
result.turn_lanes_forward = nil
|
||||
result.turn_lanes_backward = nil
|
||||
result.name = ""
|
||||
result.ref = ""
|
||||
result.destinations = ""
|
||||
result.exits = ""
|
||||
result.pronunciation = ""
|
||||
result.turn_lanes_forward = ""
|
||||
result.turn_lanes_backward = ""
|
||||
|
||||
result.forward_speed = 10
|
||||
result.backward_speed = 10
|
||||
|
||||
@ -53,7 +53,7 @@ Feature: Routing close to the [0,0] origin
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| b | d | abcde,abcde | 200m |
|
||||
| b | d | abcde,abcde | 198.8m |
|
||||
| d | b | | |
|
||||
|
||||
Scenario: North-south oneways crossing the origin
|
||||
@ -71,5 +71,5 @@ Feature: Routing close to the [0,0] origin
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| b | d | abcde,abcde | 200m |
|
||||
| b | d | abcde,abcde | 200.2m |
|
||||
| d | b | | |
|
||||
|
||||
@ -26,8 +26,8 @@ Feature: Distance calculation
|
||||
| cd |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| c | d | cd,cd | 6028844m ~4.5% |
|
||||
| from | to | route | distance |
|
||||
| c | d | cd,cd | 6310675.7m ~4.5% |
|
||||
|
||||
Scenario: Approximated Longitudinal distances at latitude 80
|
||||
Given the node locations
|
||||
@ -54,8 +54,8 @@ Feature: Distance calculation
|
||||
| ab |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| a | b | ab,ab | 8905559m ~0.1% |
|
||||
| from | to | route | distance |
|
||||
| a | b | ab,ab | 8882574.6m ~0.1% |
|
||||
|
||||
Scenario: Approximated Latitudinal distances at longitude 45
|
||||
Given the node locations
|
||||
@ -68,8 +68,8 @@ Feature: Distance calculation
|
||||
| ab |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| a | b | ab,ab | 8905559m ~0.1% |
|
||||
| from | to | route | distance |
|
||||
| a | b | ab,ab | 8882574.6m ~0.1% |
|
||||
|
||||
Scenario: Approximated Latitudinal distances at longitude 80
|
||||
Given the node locations
|
||||
@ -83,4 +83,4 @@ Feature: Distance calculation
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| a | b | ab,ab | 8905559m ~0.1% |
|
||||
| a | b | ab,ab | 8882574.6m ~0.1% |
|
||||
|
||||
@ -23,13 +23,13 @@ Feature: Projection to nearest point on road
|
||||
|
||||
Scenario: Projection onto way at high latitudes, 1km distance
|
||||
When I route I should get
|
||||
| from | to | route | bearing | distance |
|
||||
| b | a | abc,abc | 0->225,225->0 | 1000m |
|
||||
| b | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
|
||||
| a | d | abc,abc | 0->45,45->0 | 1000m |
|
||||
| d | a | abc,abc | 0->225,225->0 | 1000m |
|
||||
| c | d | abc,abc | 0->225,225->0 | 1000m +- 3 |
|
||||
| d | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
|
||||
| from | to | route | bearing | distance |
|
||||
| b | a | abc,abc | 0->225,225->0 | 1002.9m |
|
||||
| b | c | abc,abc | 0->45,45->0 | 1005m +- 3 |
|
||||
| a | d | abc,abc | 0->45,45->0 | 1002.9m |
|
||||
| d | a | abc,abc | 0->225,225->0 | 1002.9m |
|
||||
| c | d | abc,abc | 0->225,225->0 | 1005m +- 3 |
|
||||
| d | c | abc,abc | 0->45,45->0 | 1005m +- 3 |
|
||||
|
||||
Scenario: Projection onto way at high latitudes, no distance
|
||||
When I route I should get
|
||||
|
||||
@ -48,13 +48,13 @@ Feature: Traffic - speeds
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed | weights | a:datasources |
|
||||
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0 |
|
||||
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
|
||||
| a | g | ad,df,fb,fb | 30 km/h | 1295.7,487.5,304.7,0 | 1:0:0 |
|
||||
| a | b | ad,de,eb,eb | 30 km/h | 1273.9,400.8,378.5,0 | 1:0:0 |
|
||||
| a | c | ad,dc,dc | 31 km/h | 1273.9,955.4,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 737.2,0 | 1 |
|
||||
| a | d | ad,ad | 27 km/h | 1273.9,0 | 1 |
|
||||
| d | c | dc,dc | 36 km/h | 955.4,0 | 0 |
|
||||
| g | b | fb,fb | 36 km/h | 164.4,0 | 0 |
|
||||
| a | g | ad,df,fb,fb | 30 km/h | 1293.9,486.8,304.3,0 | 1:0:0 |
|
||||
|
||||
|
||||
Scenario: Weighting based on speed file weights, ETA based on file durations
|
||||
@ -74,13 +74,13 @@ Feature: Traffic - speeds
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed | weights | a:datasources |
|
||||
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0 |
|
||||
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 |
|
||||
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1 |
|
||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1 |
|
||||
| a | g | ab,ab | 1 km/h | 10010.3,0 | 1 |
|
||||
| a | b | ad,de,eb,eb | 30 km/h | 1273.9,400.8,378.5,0 | 1:0:0 |
|
||||
| a | c | ad,dc,dc | 31 km/h | 1273.9,955.4,0 | 1:0 |
|
||||
| b | c | bc,bc | 27 km/h | 737.2,0 | 1 |
|
||||
| a | d | ad,ad | 27 km/h | 1273.9,0 | 1 |
|
||||
| d | c | dc,dc | 36 km/h | 955.4,0 | 0 |
|
||||
| g | b | ab,ab | 1 km/h | 9951.7,0 | 1 |
|
||||
| a | g | ab,ab | 1 km/h | 9951.7,0 | 1 |
|
||||
|
||||
|
||||
Scenario: Weighting based on speed file weights, ETA based on file durations
|
||||
@ -106,14 +106,14 @@ Feature: Traffic - speeds
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed | weights | a:datasources |
|
||||
| a | b | ab,ab | 1 km/h | 20020.73,0 | 1 |
|
||||
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1 |
|
||||
| b | c | bc,bc | 27 km/h | 741.51,0 | 1 |
|
||||
| a | d | ab,eb,de,de | 2 km/h | 20020.73,378.17,400.41,0 | 1:0:0 |
|
||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
|
||||
| g | b | ab,ab | 1 km/h | 10010.37,0 | 1 |
|
||||
| a | g | ab,ab | 1 km/h | 10010.36,0 | 1 |
|
||||
| g | a | ab,ab | 1 km/h | 10010.36,0 | 1 |
|
||||
| a | b | ab,ab | 1 km/h | 19903.37,0 | 1 |
|
||||
| a | c | ab,bc,bc | 2 km/h | 19903.37,737.16,0 | 1:1 |
|
||||
| b | c | bc,bc | 27 km/h | 737.16,0 | 1 |
|
||||
| a | d | ab,eb,de,de | 2 km/h | 19903.37,378.49,400.75,0 | 1:0:0 |
|
||||
| d | c | dc,dc | 36 km/h | 955.45,0 | 0 |
|
||||
| g | b | ab,ab | 1 km/h | 9951.69,0 | 1 |
|
||||
| a | g | ab,ab | 1 km/h | 9951.68,0 | 1 |
|
||||
| g | a | ab,ab | 1 km/h | 9951.68,0 | 1 |
|
||||
|
||||
|
||||
Scenario: Speeds that isolate a single node (a)
|
||||
@ -136,13 +136,13 @@ Feature: Traffic - speeds
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed | weights | a:datasources | a:speed | a:nodes|
|
||||
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 | 10 | 6:2 |
|
||||
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1 | 10:7.5 | 6:2:3 |
|
||||
| b | c | bc,bc | 27 km/h | 741.5,0 | 1 | 7.5 | 2:3 |
|
||||
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0 | 10:10 | 2:6:4 |
|
||||
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 | 10 | 4:3 |
|
||||
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
||||
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 | 10 | 6:2 |
|
||||
| a | b | fb,fb | 36 km/h | 328.9,0 | 0 | 10 | 6:2 |
|
||||
| a | c | fb,bc,bc | 30 km/h | 328.9,737.2,0 | 0:1 | 10:7.5 | 6:2:3 |
|
||||
| b | c | bc,bc | 27 km/h | 737.2,0 | 1 | 7.5 | 2:3 |
|
||||
| a | d | fb,df,df | 36 km/h | 139.8,486.8,0 | 0:0 | 10:10 | 2:6:4 |
|
||||
| d | c | dc,dc | 36 km/h | 955.4,0 | 0 | 10 | 4:3 |
|
||||
| g | b | fb,fb | 36 km/h | 164.4,0 | 0 | 10 | 6:2 |
|
||||
| a | g | fb,fb | 36 km/h | 164.5,0 | 0 | 10 | 6:2 |
|
||||
|
||||
|
||||
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||
|
||||
@ -62,8 +62,8 @@ Feature: Traffic - turn penalties applied to turn onto which a phantom node snap
|
||||
When I route I should get
|
||||
| from | to | route | speed | time | weights |
|
||||
| a | e | ab,be,be | 36 km/h | 40s +-1 | 16.7,20,0 |
|
||||
| 1 | e | ab,be,be | 36 km/h | 30s +-1 | 6.7,20,0 |
|
||||
| 1 | e | ab,be,be | 36 km/h | 30s +-1 | 6.8,20,0 |
|
||||
| b | f | bc,cf,cf | 36 km/h | 40s +-1 | 20,20,0 |
|
||||
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 | 10,20,0 |
|
||||
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 | 10.1,20,0 |
|
||||
| c | g | cd,dg,dg | 144 km/h | 10s +-1 | 120.8,20,0 |
|
||||
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 | 110.8,20,0 |
|
||||
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 | 110.9,20,0 |
|
||||
|
||||
@ -221,7 +221,7 @@ Feature: Basic trip planning
|
||||
|
||||
When I plan a trip I should get
|
||||
| waypoints | source | destination |roundtrip | trips | durations | distance |
|
||||
| a,b,d,e,c | first | last | false | abedc | 8.200000000000001 | 81.6 |
|
||||
| a,b,d,e,c | first | last | false | abedc | 8.200000000000001 | 81.4 |
|
||||
|
||||
|
||||
Scenario: Testbot - Trip: FSE with waypoints (more than 10)
|
||||
|
||||
@ -28,12 +28,12 @@ Feature: Weight tests
|
||||
| cde |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | a:weight |
|
||||
| s,t | abc,cde | 1.1:2:2:1 |
|
||||
| waypoints | route | a:weight |
|
||||
| s,t | abc,cde | 1.1:2:2:0.9 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | times | weight_name | weights |
|
||||
| s,t | abc,cde | 6.1s,0s | duration | 6.1,0 |
|
||||
| s,t | abc,cde | 6s,0s | duration | 6,0 |
|
||||
|
||||
# FIXME include/engine/guidance/assemble_geometry.hpp:95
|
||||
Scenario: Start and target on the same and adjacent edge
|
||||
@ -53,10 +53,10 @@ Feature: Weight tests
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | distances | weights | times | a:distance | a:duration | a:weight | a:speed |
|
||||
| s,t | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 2.1 | 2.1 | 9.5 |
|
||||
| t,s | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 2.1 | 2.1 | 9.5 |
|
||||
| s,e | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 30.026527:10.008842 | 3.1:1 | 3.1:1 | 9.7:10 |
|
||||
| e,s | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 10.008842:30.026527 | 1:3.1 | 1:3.1 | 10:9.7 |
|
||||
| s,t | abc,abc | 20m,0m | 2,0 | 2s,0s | 20.034627 | 2 | 2 | 10 |
|
||||
| t,s | abc,abc | 20m,0m | 2,0 | 2s,0s | 20.034627 | 2 | 2 | 10 |
|
||||
| s,e | abc,abc | 40m,0m | 3.9,0 | 3.9s,0s | 29.940636:10.017313 | 3:0.9 | 3:0.9 | 10:11.1 |
|
||||
| e,s | abc,abc | 40m,0m | 3.9,0 | 3.9s,0s | 10.017313:29.940636 | 0.9:3 | 0.9:3 | 11.1:10 |
|
||||
|
||||
|
||||
Scenario: Step weights -- way_function: fail if no weight or weight_per_meter property
|
||||
@ -173,13 +173,13 @@ Feature: Weight tests
|
||||
| fgh |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,f | , | 100m | 99.9,0 | 30s,0s |
|
||||
| f,a | , | 100m | 199.8,0 | 30s,0s |
|
||||
| a,h | , | 140m | 139.9,0 | 42s,0s |
|
||||
| h,a | , | 140m | 279.8,0 | 42s,0s |
|
||||
| f,h | , | 40m | 40,0 | 12s,0s |
|
||||
| h,f | , | 40m | 80,0 | 12s,0s |
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,f | , | 100m | 99.8,0 | 30s,0s |
|
||||
| f,a | , | 100m | 199.9,0 | 30s,0s |
|
||||
| a,h | , | 140m | 139.8,0 | 42s,0s |
|
||||
| h,a | , | 140m | 280.1,0 | 42s,0s |
|
||||
| f,h | , | 40.1m | 40,0 | 12s,0s |
|
||||
| h,f | , | 40.1m | 80.2,0 | 12s,0s |
|
||||
|
||||
Scenario: Step weights -- segment_function
|
||||
Given the profile file
|
||||
@ -281,11 +281,11 @@ Feature: Weight tests
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,c | , | 40m +-.1 | 5.119,0 | 289.9s,0s |
|
||||
| a,e | ,, | 60m +-.1 | 5.119,1.11,0 | 289.9s,100s,0s |
|
||||
| e,a | ,, | 60m +-.1 | 2.21,2.22,0 | 10.1s,200s,0s |
|
||||
| e,d | ,, | 40m +-.1 | 4.009,1.11,0 | 189.9s,100s,0s |
|
||||
| d,e | ,, | 40m +-.1 | 2.21,1.11,0 | 10.1s,100s,0s |
|
||||
| a,c | , | 40m +-.1 | 5.12,0 | 290s,0s |
|
||||
| a,e | ,, | 60m +-.1 | 5.12,1.11,0 | 290s,100s,0s |
|
||||
| e,a | ,, | 60m +-.1 | 2.21,2.22,0 | 10s,200s,0s |
|
||||
| e,d | ,, | 40m +-.1 | 4.01,1.11,0 | 190s,100s,0s |
|
||||
| d,e | ,, | 40m +-.1 | 2.21,1.11,0 | 10s,100s,0s |
|
||||
|
||||
@traffic @speed
|
||||
Scenario: Step weights -- segment_function with speed and turn updates
|
||||
@ -341,9 +341,9 @@ Feature: Weight tests
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,d | , | 59.9m | 20.5,0 | 24s,0s |
|
||||
| a,e | ,, | 60.1m | 27.2,10,0 | 38.5s,11s,0s |
|
||||
| d,e | ,, | 39.9m | 10,10,0 | 11s,11s,0s |
|
||||
| a,d | , | 60m | 20.5,0 | 24s,0s |
|
||||
| a,e | ,, | 60m | 27.2,10,0 | 38.5s,11s,0s |
|
||||
| d,e | ,, | 40m | 10,10,0 | 11s,11s,0s |
|
||||
|
||||
@traffic @speed
|
||||
Scenario: Step weights -- segment_function with speed and turn updates with fallback to durations
|
||||
@ -375,10 +375,10 @@ Feature: Weight tests
|
||||
And the customize extra arguments "--segment-speed-file {speeds_file} --turn-penalty-file {penalties_file}"
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,d | abcd,abcd | 59.9m | 6.996,0 | 7s,0s |
|
||||
| a,e | abcd,ce,ce | 60.1m | 6.005,2.002,0 | 6s,2s,0s |
|
||||
| d,e | abcd,ce,ce | 39.9m | 1.991,2.002,0 | 2s,2s,0s |
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,d | abcd,abcd | 60m | 7,0 | 7s,0s |
|
||||
| a,e | abcd,ce,ce | 60m | 5.997,2.001,0 | 6s,2s,0s |
|
||||
| d,e | abcd,ce,ce | 40m | 2.003,2.001,0 | 2s,2s,0s |
|
||||
|
||||
@traffic @speed
|
||||
Scenario: Updating speeds without affecting weights.
|
||||
@ -410,5 +410,5 @@ Feature: Weight tests
|
||||
And the customize extra arguments "--segment-speed-file {speeds_file}"
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,b | acdb,acdb | 78.3m | 11.744,0 | 56.4s,0s |
|
||||
| waypoints | route | distance | weights | times |
|
||||
| a,b | acdb,acdb | 78.3m | 11.742,0 | 56.4s,0s |
|
||||
|
||||
@ -38,8 +38,7 @@ if (ENABLE_FUZZING)
|
||||
"table_parameters"
|
||||
"tile_parameters"
|
||||
"trip_parameters"
|
||||
"url_parser"
|
||||
"request_parser")
|
||||
"url_parser")
|
||||
|
||||
foreach (target ${ServerTargets})
|
||||
add_fuzz_target(${target})
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
#include "server/request_parser.hpp"
|
||||
#include "server/http/request.hpp"
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
using osrm::server::RequestParser;
|
||||
using osrm::server::http::request;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
|
||||
{
|
||||
std::string in(reinterpret_cast<const char *>(data), size);
|
||||
|
||||
auto first = begin(in);
|
||||
auto last = end(in);
|
||||
|
||||
RequestParser parser;
|
||||
request req;
|
||||
|
||||
// &(*it) is needed to go from iterator to underlying item to pointer to underlying item
|
||||
parser.parse(req, &(*first), &(*last));
|
||||
|
||||
escape(&req);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -18,7 +18,7 @@ inline auto contractFullGraph(ContractorGraph contractor_graph,
|
||||
std::vector<EdgeWeight> node_weights)
|
||||
{
|
||||
auto num_nodes = contractor_graph.GetNumberOfNodes();
|
||||
contractGraph(contractor_graph, node_weights);
|
||||
contractGraph(contractor_graph, std::move(node_weights));
|
||||
|
||||
auto edges = toEdges<QueryEdge>(std::move(contractor_graph));
|
||||
std::vector<bool> edge_filter(edges.size(), true);
|
||||
@ -94,7 +94,7 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
||||
return GraphAndFilter{QueryGraph{num_nodes, std::move(edge_container.edges)},
|
||||
edge_container.MakeEdgeFilters()};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -164,7 +164,7 @@ struct ContractedEdgeContainer
|
||||
std::vector<MergedFlags> flags;
|
||||
std::vector<QueryEdge> edges;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -15,11 +15,11 @@ template <storage::Ownership Ownership> struct ContractedMetric
|
||||
detail::QueryGraph<Ownership> graph;
|
||||
std::vector<util::ViewOrVector<bool, Ownership>> edge_filter;
|
||||
};
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
using ContractedMetric = detail::ContractedMetric<storage::Ownership::Container>;
|
||||
using ContractedMetricView = detail::ContractedMetric<storage::Ownership::View>;
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -49,7 +49,7 @@ class Contractor
|
||||
private:
|
||||
ContractorConfig config;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif // PROCESSING_CHAIN_HPP
|
||||
|
||||
@ -43,10 +43,8 @@ namespace contractor
|
||||
struct ContractorConfig final : storage::IOConfig
|
||||
{
|
||||
ContractorConfig()
|
||||
: IOConfig({".osrm.ebg", ".osrm.ebg_nodes", ".osrm.properties"},
|
||||
{},
|
||||
{".osrm.hsgr", ".osrm.enw"}),
|
||||
requested_num_threads(0)
|
||||
: IOConfig(
|
||||
{".osrm.ebg", ".osrm.ebg_nodes", ".osrm.properties"}, {}, {".osrm.hsgr", ".osrm.enw"})
|
||||
{
|
||||
}
|
||||
|
||||
@ -62,18 +60,18 @@ struct ContractorConfig final : storage::IOConfig
|
||||
updater::UpdaterConfig updater_config;
|
||||
|
||||
// DEPRECATED to be removed in v6.0
|
||||
bool use_cached_priority;
|
||||
bool use_cached_priority = false;
|
||||
|
||||
unsigned requested_num_threads;
|
||||
unsigned requested_num_threads = 0;
|
||||
|
||||
// DEPRECATED to be removed in v6.0
|
||||
// A percentage of vertices that will be contracted for the hierarchy.
|
||||
// Offers a trade-off between preprocessing and query time.
|
||||
// The remaining vertices form the core of the hierarchy
|
||||
//(e.g. 0.8 contracts 80 percent of the hierarchy, leaving a core of 20%)
|
||||
double core_factor;
|
||||
double core_factor = 1.0;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif // EXTRACTOR_OPTIONS_HPP
|
||||
|
||||
@ -125,7 +125,7 @@ struct RangebasedCRC32
|
||||
private:
|
||||
IteratorbasedCRC32 crc32;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* ITERATOR_BASED_CRC32_H */
|
||||
|
||||
@ -52,8 +52,8 @@ inline void writeGraph(const boost::filesystem::path &path,
|
||||
serialization::write(writer, "/ch/metrics/" + pair.first, pair.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace files
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -77,7 +77,7 @@ struct QueryEdge
|
||||
data.distance == right.data.distance);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif // QUERYEDGE_HPP
|
||||
|
||||
@ -15,11 +15,11 @@ namespace detail
|
||||
{
|
||||
template <storage::Ownership Ownership>
|
||||
using QueryGraph = util::StaticGraph<typename QueryEdge::EdgeData, Ownership>;
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
using QueryGraph = detail::QueryGraph<storage::Ownership::Container>;
|
||||
using QueryGraphView = detail::QueryGraph<storage::Ownership::View>;
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif // QUERYEDGE_HPP
|
||||
|
||||
@ -46,8 +46,8 @@ void read(storage::tar::FileReader &reader,
|
||||
metric.edge_filter[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace serialization
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -212,9 +212,8 @@ class CellCustomizer
|
||||
}
|
||||
|
||||
const auto &data = graph.GetEdgeData(edge);
|
||||
if (data.forward &&
|
||||
(first_level ||
|
||||
partition.GetCell(level - 1, node) != partition.GetCell(level - 1, to)))
|
||||
if (data.forward && (first_level || partition.GetCell(level - 1, node) !=
|
||||
partition.GetCell(level - 1, to)))
|
||||
{
|
||||
const EdgeWeight to_weight = weight + data.weight;
|
||||
const EdgeDuration to_duration = duration + data.duration;
|
||||
@ -237,7 +236,7 @@ class CellCustomizer
|
||||
|
||||
const partitioner::MultiLevelPartition &partition;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_CELLS_CUSTOMIZER_HPP
|
||||
|
||||
@ -22,11 +22,11 @@ template <storage::Ownership Ownership> struct CellMetricImpl
|
||||
Vector<EdgeDuration> durations;
|
||||
Vector<EdgeDistance> distances;
|
||||
};
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
using CellMetric = detail::CellMetricImpl<storage::Ownership::Container>;
|
||||
using CellMetricView = detail::CellMetricImpl<storage::Ownership::View>;
|
||||
}
|
||||
}
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -39,7 +39,7 @@ struct CustomizationConfig final : storage::IOConfig
|
||||
|
||||
updater::UpdaterConfig updater_config;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
|
||||
|
||||
@ -34,7 +34,7 @@ template <typename EdgeDataT, storage::Ownership Ownership>
|
||||
void write(storage::tar::FileWriter &writer,
|
||||
const std::string &name,
|
||||
const MultiLevelGraph<EdgeDataT, Ownership> &graph);
|
||||
}
|
||||
} // namespace serialization
|
||||
|
||||
template <typename EdgeDataT, storage::Ownership Ownership>
|
||||
class MultiLevelGraph : public partitioner::MultiLevelGraph<EdgeDataT, Ownership>
|
||||
@ -126,7 +126,7 @@ using MultiLevelEdgeBasedGraph =
|
||||
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
||||
using MultiLevelEdgeBasedGraphView =
|
||||
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
||||
}
|
||||
}
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -106,8 +106,8 @@ inline void writeGraph(const boost::filesystem::path &path,
|
||||
writer.WriteFrom("/mld/connectivity_checksum", connectivity_checksum);
|
||||
serialization::write(writer, "/mld/multilevelgraph", graph);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace files
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -65,8 +65,8 @@ inline void write(storage::tar::FileWriter &writer,
|
||||
storage::serialization::write(writer, name + "/is_backward_edge", graph.is_backward_edge);
|
||||
storage::serialization::write(writer, name + "/node_to_edge_offset", graph.node_to_edge_offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace serialization
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -16,14 +16,14 @@ namespace ch
|
||||
struct Algorithm final
|
||||
{
|
||||
};
|
||||
}
|
||||
} // namespace ch
|
||||
// Multi-Level Dijkstra
|
||||
namespace mld
|
||||
{
|
||||
struct Algorithm final
|
||||
{
|
||||
};
|
||||
}
|
||||
} // namespace mld
|
||||
|
||||
// Algorithm names
|
||||
template <typename AlgorithmT> const char *name();
|
||||
@ -111,8 +111,8 @@ template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
|
||||
template <> struct HasExcludeFlags<mld::Algorithm> final : std::true_type
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -56,8 +56,8 @@ class BaseAPI
|
||||
// TODO: check forward/reverse
|
||||
return json::makeWaypoint(
|
||||
phantom.location,
|
||||
util::coordinate_calculation::fccApproximateDistance(phantom.location,
|
||||
phantom.input_location),
|
||||
util::coordinate_calculation::greatCircleDistance(phantom.location,
|
||||
phantom.input_location),
|
||||
facade.GetNameForID(facade.GetNameIndex(phantom.forward_segment_id.id)).to_string(),
|
||||
Hint{phantom, facade.GetCheckSum()});
|
||||
}
|
||||
@ -66,8 +66,8 @@ class BaseAPI
|
||||
// TODO: check forward/reverse
|
||||
return json::makeWaypoint(
|
||||
phantom.location,
|
||||
util::coordinate_calculation::fccApproximateDistance(phantom.location,
|
||||
phantom.input_location),
|
||||
util::coordinate_calculation::greatCircleDistance(phantom.location,
|
||||
phantom.input_location),
|
||||
facade.GetNameForID(facade.GetNameIndex(phantom.forward_segment_id.id))
|
||||
.to_string());
|
||||
}
|
||||
@ -114,7 +114,7 @@ class BaseAPI
|
||||
|
||||
auto waypoint = std::make_unique<fbresult::WaypointBuilder>(*builder);
|
||||
waypoint->add_location(&location);
|
||||
waypoint->add_distance(util::coordinate_calculation::fccApproximateDistance(
|
||||
waypoint->add_distance(util::coordinate_calculation::greatCircleDistance(
|
||||
phantom.location, phantom.input_location));
|
||||
waypoint->add_name(name_string);
|
||||
if (parameters.generate_hints)
|
||||
@ -128,8 +128,8 @@ class BaseAPI
|
||||
const BaseParameters ¶meters;
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -92,21 +92,21 @@ struct BaseParameters
|
||||
|
||||
SnappingType snapping = SnappingType::Default;
|
||||
|
||||
BaseParameters(const std::vector<util::Coordinate> coordinates_ = {},
|
||||
const std::vector<boost::optional<Hint>> hints_ = {},
|
||||
BaseParameters(std::vector<util::Coordinate> coordinates_ = {},
|
||||
std::vector<boost::optional<Hint>> hints_ = {},
|
||||
std::vector<boost::optional<double>> radiuses_ = {},
|
||||
std::vector<boost::optional<Bearing>> bearings_ = {},
|
||||
std::vector<boost::optional<Approach>> approaches_ = {},
|
||||
bool generate_hints_ = true,
|
||||
std::vector<std::string> exclude = {},
|
||||
const SnappingType snapping_ = SnappingType::Default)
|
||||
: coordinates(coordinates_), hints(hints_), radiuses(radiuses_), bearings(bearings_),
|
||||
approaches(approaches_), exclude(std::move(exclude)), generate_hints(generate_hints_),
|
||||
snapping(snapping_)
|
||||
: coordinates(std::move(coordinates_)), hints(std::move(hints_)),
|
||||
radiuses(std::move(radiuses_)), bearings(std::move(bearings_)),
|
||||
approaches(std::move(approaches_)), exclude(std::move(exclude)),
|
||||
generate_hints(generate_hints_), snapping(snapping_)
|
||||
{
|
||||
}
|
||||
|
||||
// FIXME add validation for invalid bearing values
|
||||
bool IsValid() const
|
||||
{
|
||||
return (hints.empty() || hints.size() == coordinates.size()) &&
|
||||
@ -115,7 +115,7 @@ struct BaseParameters
|
||||
(approaches.empty() || approaches.size() == coordinates.size()) &&
|
||||
std::all_of(bearings.begin(),
|
||||
bearings.end(),
|
||||
[](const boost::optional<Bearing> bearing_and_range) {
|
||||
[](const boost::optional<Bearing> &bearing_and_range) {
|
||||
if (bearing_and_range)
|
||||
{
|
||||
return bearing_and_range->IsValid();
|
||||
@ -124,8 +124,8 @@ struct BaseParameters
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // ROUTE_PARAMETERS_HPP
|
||||
|
||||
@ -16,8 +16,8 @@ namespace api
|
||||
{
|
||||
using ResultT =
|
||||
mapbox::util::variant<util::json::Object, std::string, flatbuffers::FlatBufferBuilder>;
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -112,8 +112,8 @@ util::json::Object makeRouteLeg(guidance::RouteLeg leg, util::json::Array steps)
|
||||
util::json::Array makeRouteLegs(std::vector<guidance::RouteLeg> legs,
|
||||
std::vector<util::json::Value> step_geometries,
|
||||
std::vector<util::json::Object> annotations);
|
||||
}
|
||||
}
|
||||
} // namespace json
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
|
||||
@ -248,8 +248,8 @@ class MatchAPI final : public RouteAPI
|
||||
const tidy::Result &tidy_result;
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -68,8 +68,11 @@ struct MatchParameters : public RouteParameters
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
MatchParameters(std::vector<unsigned> timestamps_, GapsType gaps_, bool tidy_, Args... args_)
|
||||
: MatchParameters(std::move(timestamps_), gaps_, tidy_, {}, std::forward<Args>(args_)...)
|
||||
MatchParameters(const std::vector<unsigned> ×tamps_,
|
||||
GapsType gaps_,
|
||||
bool tidy_,
|
||||
Args &&... args_)
|
||||
: MatchParameters(timestamps_, gaps_, tidy_, {}, std::forward<Args>(args_)...)
|
||||
{
|
||||
}
|
||||
|
||||
@ -77,10 +80,11 @@ struct MatchParameters : public RouteParameters
|
||||
MatchParameters(std::vector<unsigned> timestamps_,
|
||||
GapsType gaps_,
|
||||
bool tidy_,
|
||||
std::vector<std::size_t> waypoints_,
|
||||
Args... args_)
|
||||
: RouteParameters{std::forward<Args>(args_)..., waypoints_},
|
||||
timestamps{std::move(timestamps_)}, gaps(gaps_), tidy(tidy_)
|
||||
const std::vector<std::size_t> &waypoints_,
|
||||
Args &&... args_)
|
||||
: RouteParameters{std::forward<Args>(args_)..., waypoints_}, timestamps{std::move(
|
||||
timestamps_)},
|
||||
gaps(gaps_), tidy(tidy_)
|
||||
{
|
||||
}
|
||||
|
||||
@ -94,8 +98,8 @@ struct MatchParameters : public RouteParameters
|
||||
(timestamps.empty() || timestamps.size() == coordinates.size());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -122,7 +122,7 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5})
|
||||
// Walk over adjacent (coord, ts)-pairs, with rhs being the candidate to discard or keep
|
||||
for (std::size_t current = 0, next = 1; next < params.coordinates.size() - 1; ++current, ++next)
|
||||
{
|
||||
auto distance_delta = util::coordinate_calculation::haversineDistance(
|
||||
auto distance_delta = util::coordinate_calculation::greatCircleDistance(
|
||||
params.coordinates[current], params.coordinates[next]);
|
||||
running.distance_in_meters += distance_delta;
|
||||
const auto over_distance = running.distance_in_meters >= cfg.distance_in_meters;
|
||||
@ -200,9 +200,9 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5})
|
||||
return result;
|
||||
}
|
||||
|
||||
} // ns tidy
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace tidy
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -159,8 +159,8 @@ class NearestAPI final : public BaseAPI
|
||||
}
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -52,8 +52,8 @@ struct NearestParameters : public BaseParameters
|
||||
|
||||
bool IsValid() const { return BaseParameters::IsValid() && number_of_results >= 1; }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // ENGINE_API_NEAREST_PARAMETERS_HPP
|
||||
|
||||
@ -688,7 +688,7 @@ class RouteAPI : public BaseAPI
|
||||
intersection.classes.begin(),
|
||||
intersection.classes.end(),
|
||||
classes.begin(),
|
||||
[&fb_result](const std::string cls) { return fb_result.CreateString(cls); });
|
||||
[&fb_result](const std::string &cls) { return fb_result.CreateString(cls); });
|
||||
auto classes_vector = fb_result.CreateVector(classes);
|
||||
auto entry_vector = fb_result.CreateVector(intersection.entry);
|
||||
|
||||
@ -988,8 +988,8 @@ class RouteAPI : public BaseAPI
|
||||
}
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -87,19 +87,13 @@ struct RouteParameters : public BaseParameters
|
||||
const GeometriesType geometries_,
|
||||
const OverviewType overview_,
|
||||
const boost::optional<bool> continue_straight_,
|
||||
Args... args_)
|
||||
Args &&... args_)
|
||||
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one
|
||||
// below.
|
||||
: BaseParameters{std::forward<Args>(args_)...},
|
||||
steps{steps_},
|
||||
alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u},
|
||||
annotations{false},
|
||||
annotations_type{AnnotationsType::None},
|
||||
geometries{geometries_},
|
||||
overview{overview_},
|
||||
continue_straight{continue_straight_},
|
||||
waypoints()
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{false},
|
||||
annotations_type{AnnotationsType::None}, geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints()
|
||||
{
|
||||
}
|
||||
|
||||
@ -111,7 +105,7 @@ struct RouteParameters : public BaseParameters
|
||||
const GeometriesType geometries_,
|
||||
const OverviewType overview_,
|
||||
const boost::optional<bool> continue_straight_,
|
||||
Args... args_)
|
||||
Args &&... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_},
|
||||
annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None},
|
||||
@ -129,12 +123,12 @@ struct RouteParameters : public BaseParameters
|
||||
const GeometriesType geometries_,
|
||||
const OverviewType overview_,
|
||||
const boost::optional<bool> continue_straight_,
|
||||
Args... args_)
|
||||
Args &&... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u},
|
||||
annotations{annotations_ == AnnotationsType::None ? false : true},
|
||||
annotations_type{annotations_}, geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints()
|
||||
annotations{annotations_ != AnnotationsType::None}, annotations_type{annotations_},
|
||||
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_},
|
||||
waypoints()
|
||||
{
|
||||
}
|
||||
|
||||
@ -147,12 +141,12 @@ struct RouteParameters : public BaseParameters
|
||||
const OverviewType overview_,
|
||||
const boost::optional<bool> continue_straight_,
|
||||
std::vector<std::size_t> waypoints_,
|
||||
const Args... args_)
|
||||
const Args &&... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_},
|
||||
annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None},
|
||||
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_},
|
||||
waypoints{waypoints_}
|
||||
geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints{std::move(waypoints_)}
|
||||
{
|
||||
}
|
||||
|
||||
@ -165,12 +159,12 @@ struct RouteParameters : public BaseParameters
|
||||
const OverviewType overview_,
|
||||
const boost::optional<bool> continue_straight_,
|
||||
std::vector<std::size_t> waypoints_,
|
||||
Args... args_)
|
||||
Args &&... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u},
|
||||
annotations{annotations_ == AnnotationsType::None ? false : true},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_ !=
|
||||
AnnotationsType::None},
|
||||
annotations_type{annotations_}, geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints{waypoints_}
|
||||
continue_straight{continue_straight_}, waypoints{std::move(waypoints_)}
|
||||
{
|
||||
}
|
||||
|
||||
@ -217,8 +211,8 @@ inline RouteParameters::AnnotationsType operator|=(RouteParameters::AnnotationsT
|
||||
{
|
||||
return lhs = lhs | rhs;
|
||||
}
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -407,8 +407,8 @@ class TableAPI final : public BaseAPI
|
||||
const TableParameters ¶meters;
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@ -85,7 +85,7 @@ struct TableParameters : public BaseParameters
|
||||
template <typename... Args>
|
||||
TableParameters(std::vector<std::size_t> sources_,
|
||||
std::vector<std::size_t> destinations_,
|
||||
Args... args_)
|
||||
Args &&... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, sources{std::move(sources_)},
|
||||
destinations{std::move(destinations_)}
|
||||
{
|
||||
@ -95,7 +95,7 @@ struct TableParameters : public BaseParameters
|
||||
TableParameters(std::vector<std::size_t> sources_,
|
||||
std::vector<std::size_t> destinations_,
|
||||
const AnnotationsType annotations_,
|
||||
Args... args_)
|
||||
Args &&... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, sources{std::move(sources_)},
|
||||
destinations{std::move(destinations_)}, annotations{annotations_}
|
||||
{
|
||||
@ -108,7 +108,7 @@ struct TableParameters : public BaseParameters
|
||||
double fallback_speed_,
|
||||
FallbackCoordinateType fallback_coordinate_type_,
|
||||
double scale_factor_,
|
||||
Args... args_)
|
||||
Args &&... args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, sources{std::move(sources_)},
|
||||
destinations{std::move(destinations_)}, fallback_speed{fallback_speed_},
|
||||
fallback_coordinate_type{fallback_coordinate_type_}, annotations{annotations_},
|
||||
@ -122,7 +122,7 @@ struct TableParameters : public BaseParameters
|
||||
if (!BaseParameters::IsValid())
|
||||
return false;
|
||||
|
||||
// Distance Table makes only sense with 2+ coodinates
|
||||
// Distance Table makes only sense with 2+ coordinates
|
||||
if (coordinates.size() < 2)
|
||||
return false;
|
||||
|
||||
@ -166,8 +166,8 @@ inline TableParameters::AnnotationsType &operator|=(TableParameters::Annotations
|
||||
{
|
||||
return lhs = lhs | rhs;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // ENGINE_API_TABLE_PARAMETERS_HPP
|
||||
|
||||
@ -70,8 +70,8 @@ struct TileParameters final
|
||||
return valid_x && valid_y && valid_z;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user