Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e68237e03 | |||
| 2016d468bb | |||
| d234c7246c | |||
| 3f9347cfb2 | |||
| db7946d762 | |||
| 522d0f066e | |||
| 3bb82ce1e2 | |||
| 62e11fd5db | |||
| 503d558e90 | |||
| af59a9cfae | |||
| 72da455185 | |||
| 0ca913132a | |||
| 134da91fa8 | |||
| d51631401e | |||
| d6afe91d8f | |||
| 192d077ada | |||
| 82b73ed9ab | |||
| 0e7c3d8ad4 | |||
| a63ba91c8f | |||
| 51e04209e3 | |||
| 56ed2cb196 | |||
| ebd9ab4548 | |||
| 376282d946 | |||
| 53295760ac | |||
| e590dae5f6 | |||
| d9df33dd0a | |||
| 95c4523987 | |||
| 26987f9049 | |||
| 7c06726a35 | |||
| d7c44f0bc0 | |||
| a4aa153ba4 | |||
| 1204b746d5 | |||
| 076cbd7018 | |||
| afd340da44 | |||
| 898cbe8da4 | |||
| 16c6f23791 | |||
| 612ca82a06 | |||
| 1215062e4c | |||
| 5292172770 | |||
| 6e5f0d74bd | |||
| 5bab68c737 | |||
| 152a52bc1a | |||
| c605b1db38 | |||
| f4189d9487 | |||
| f983d626ac | |||
| 73b2a86a95 | |||
| 2044398dfd | |||
| 095b726a92 | |||
| 18dcd27a9b | |||
| a1b3efe260 | |||
| 6d10523440 | |||
| 2bbb347f57 | |||
| 5f82d0c9ba | |||
| aeaf5e0735 | |||
| 8a186e6f49 | |||
| 2ea168c26c | |||
| a12625afac | |||
| 8bff55cd85 | |||
| bb4fd93fab | |||
| b13820f520 | |||
| fc12b6c365 | |||
| cb515ba42f | |||
| 634e7fe392 | |||
| 6ab8728807 | |||
| 0ae5190937 | |||
| a1c1fefd6e | |||
| 6fa7bd8abd | |||
| 7359d6a21b | |||
| 5dda33fa88 | |||
| 5280ca4e16 | |||
| 2c02d4e5ab | |||
| 54d486ae12 | |||
| 85e6a854aa | |||
| 12f49d6f24 | |||
| 7149547645 | |||
| 565959b389 | |||
| 5c9d0d152c | |||
| 274dcc58a5 | |||
| d06b23d819 | |||
| 91e9623b31 | |||
| 0021ccef59 | |||
| 38e4b0b9d6 | |||
| ddde7e1ea6 | |||
| 4dfae26be7 | |||
| 40805f7058 | |||
| 8e3fa70eb0 | |||
| 41ff79aa1d | |||
| 6dfb7d4ede | |||
| 71a638a14f | |||
| 4fd4c3b563 | |||
| 242c07443a | |||
| 1047cc1bfd | |||
| 9c7d75d7d4 | |||
| 3f0ded653d | |||
| 61810b9205 | |||
| 8273e8b0e2 | |||
| dd04760982 | |||
| 768c33127a | |||
| 251ffe4a50 | |||
| 53f2da5d5e |
@@ -42,12 +42,15 @@ Checks: >
|
||||
-llvm-twine-local,
|
||||
misc-*,
|
||||
-misc-argument-comment,
|
||||
-misc-const-correctness,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-misc-unconventional-assign-operator,
|
||||
-misc-no-recursion,
|
||||
-misc-misplaced-const,
|
||||
-misc-definitions-in-headers,
|
||||
-misc-unused-parameters,
|
||||
modernize-concat-nested-namespaces,
|
||||
modernize-use-using,
|
||||
performance-*,
|
||||
-performance-noexcept-move-constructor,
|
||||
-performance-no-int-to-ptr,
|
||||
|
||||
+111
-220
@@ -20,7 +20,7 @@ env:
|
||||
ENABLE_NODE_BINDINGS: "ON"
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
windows-release-node:
|
||||
needs: format-taginfo-docs
|
||||
runs-on: windows-2022
|
||||
continue-on-error: false
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
ENABLE_APPLE_SILICON: "OFF"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: pip install conan==1.53.0
|
||||
- run: pip install "conan<2.0.0"
|
||||
- run: conan --version
|
||||
- run: cmake --version
|
||||
- uses: actions/setup-node@v3
|
||||
@@ -73,11 +73,11 @@ jobs:
|
||||
format-taginfo-docs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12
|
||||
node-version: 16
|
||||
- name: Enable Node.js cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
@@ -95,6 +95,30 @@ jobs:
|
||||
./scripts/format.sh && ./scripts/error_on_dirty.sh
|
||||
node ./scripts/validate_changelog.js
|
||||
npm run docs && ./scripts/error_on_dirty.sh
|
||||
npm audit --production
|
||||
|
||||
routed-js:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- 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: Compile routed-js
|
||||
run: |
|
||||
pushd routed-js
|
||||
npm ci
|
||||
npx tsc
|
||||
popd
|
||||
./scripts/error_on_dirty.sh
|
||||
|
||||
docker-image:
|
||||
needs: format-taginfo-docs
|
||||
@@ -146,7 +170,7 @@ jobs:
|
||||
include:
|
||||
- name: gcc-9-debug-cov
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
@@ -157,7 +181,7 @@ jobs:
|
||||
|
||||
- name: gcc-9-debug-asan-ubsan
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
@@ -171,7 +195,7 @@ jobs:
|
||||
|
||||
- name: clang-6.0-debug
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
@@ -179,20 +203,20 @@ jobs:
|
||||
CXXCOMPILER: clang++-6.0
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
|
||||
- name: clang-11.0-debug-clang-tidy
|
||||
- name: clang-15.0-debug-clang-tidy
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-22.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Debug
|
||||
CCOMPILER: clang-14
|
||||
CXXCOMPILER: clang++-14
|
||||
CCOMPILER: clang-15
|
||||
CXXCOMPILER: clang++-15
|
||||
CUCUMBER_TIMEOUT: 60000
|
||||
ENABLE_CLANG_TIDY: ON
|
||||
|
||||
- name: conan-linux-debug-asan-ubsan
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
@@ -203,7 +227,7 @@ jobs:
|
||||
|
||||
- name: conan-linux-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
@@ -211,9 +235,20 @@ jobs:
|
||||
CXXCOMPILER: clang++-6.0
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: gcc-12-release
|
||||
continue-on-error: false
|
||||
node: 16
|
||||
runs-on: ubuntu-22.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: gcc-12
|
||||
CXXCOMPILER: g++-12
|
||||
ENABLE_BENCHMARKS: ON
|
||||
CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized'
|
||||
|
||||
- name: gcc-11-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
@@ -223,7 +258,7 @@ jobs:
|
||||
|
||||
- name: gcc-10-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
@@ -232,7 +267,7 @@ jobs:
|
||||
|
||||
- name: gcc-9-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
@@ -242,7 +277,7 @@ jobs:
|
||||
|
||||
- name: gcc-9-conan-release-i686
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
@@ -252,10 +287,10 @@ jobs:
|
||||
CXXFLAGS: "-m32 -msse2 -mfpmath=sse"
|
||||
TARGET_ARCH: i686
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
|
||||
- name: gcc-8-release
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 16
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TOOLS: ON
|
||||
BUILD_TYPE: Release
|
||||
@@ -263,82 +298,10 @@ jobs:
|
||||
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-macos-x64-release-node-12
|
||||
- name: conan-linux-release-node
|
||||
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-macos-x64-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-macos-x64-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: conan-macos-arm64-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
|
||||
ENABLE_APPLE_SILICON: 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
|
||||
node: 18
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang-6.0
|
||||
@@ -346,10 +309,10 @@ jobs:
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: node-12-conan-linux-debug
|
||||
- name: conan-linux-debug-node
|
||||
build_node_package: true
|
||||
continue-on-error: false
|
||||
node: 12
|
||||
node: 18
|
||||
runs-on: ubuntu-20.04
|
||||
BUILD_TYPE: Debug
|
||||
CCOMPILER: clang-6.0
|
||||
@@ -357,55 +320,10 @@ jobs:
|
||||
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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: conan-macos-x64-release-node-latest
|
||||
- name: conan-macos-x64-release-node
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: latest
|
||||
node: 18
|
||||
runs-on: macos-11
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang
|
||||
@@ -414,10 +332,10 @@ jobs:
|
||||
ENABLE_ASSERTIONS: ON
|
||||
ENABLE_CONAN: ON
|
||||
|
||||
- name: conan-macos-arm64-release-node-latest
|
||||
- name: conan-macos-arm64-release-node
|
||||
build_node_package: true
|
||||
continue-on-error: true
|
||||
node: latest
|
||||
node: 18
|
||||
runs-on: macos-11
|
||||
BUILD_TYPE: Release
|
||||
CCOMPILER: clang
|
||||
@@ -427,75 +345,6 @@ jobs:
|
||||
ENABLE_CONAN: ON
|
||||
ENABLE_APPLE_SILICON: 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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
- name: conan-macos-x64-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: conan-macos-arm64-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
|
||||
ENABLE_APPLE_SILICON: 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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
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
|
||||
CCOMPILER: clang-6.0
|
||||
CXXCOMPILER: clang++-6.0
|
||||
ENABLE_CONAN: ON
|
||||
NODE_PACKAGE_TESTS_ONLY: ON
|
||||
|
||||
name: ${{ matrix.name}}
|
||||
continue-on-error: ${{ matrix.continue-on-error }}
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
@@ -519,7 +368,7 @@ jobs:
|
||||
OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }}
|
||||
OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
@@ -550,9 +399,9 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{github.workspace}}/test/cache
|
||||
key: v3-test-${{ matrix.name }}-${{ github.sha }}
|
||||
key: v4-test-${{ matrix.name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
v3-test-${{ matrix.name }}-
|
||||
v4-test-${{ matrix.name }}-
|
||||
|
||||
- name: Prepare environment
|
||||
run: |
|
||||
@@ -574,7 +423,13 @@ jobs:
|
||||
|
||||
- name: Install dev dependencies
|
||||
run: |
|
||||
python3 -m pip install conan==1.53.0
|
||||
python3 -m pip install "conan<2.0.0"
|
||||
|
||||
# workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499
|
||||
# and that's why CI cannot find conan executable installed above
|
||||
if [[ "${RUNNER_OS}" == "macOS" ]]; then
|
||||
echo "/Library/Frameworks/Python.framework/Versions/Current/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
|
||||
# ccache
|
||||
if [[ "${RUNNER_OS}" == "Linux" ]]; then
|
||||
@@ -586,6 +441,12 @@ jobs:
|
||||
# clang
|
||||
if [[ "${CCOMPILER}" == "clang-6.0" ]]; then
|
||||
sudo apt-get update -y && sudo apt-get install clang++-6
|
||||
elif [[ "${CCOMPILER}" == "clang-15" ]]; then
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-get update -y && sudo apt-get install software-properties-common
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main'
|
||||
sudo apt-get update -y && sudo apt-get install clang++-15 clang-tidy-15
|
||||
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100000
|
||||
fi
|
||||
|
||||
# Linux dev packages
|
||||
@@ -614,7 +475,6 @@ jobs:
|
||||
tar zxvf onetbb.tgz
|
||||
sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/
|
||||
sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/
|
||||
|
||||
- name: Prepare build
|
||||
run: |
|
||||
mkdir ${OSRM_BUILD_DIR}
|
||||
@@ -675,6 +535,9 @@ jobs:
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||
make --jobs=${JOBS}
|
||||
popd
|
||||
- name: Install osrm-routed-js dependencies
|
||||
if: ${{ matrix.node != 12 && matrix.ENABLE_APPLE_SILICON != 'ON' && matrix.TARGET_ARCH != 'i686' }}
|
||||
run: cd routed-js && npm ci && npm link && osrm-routed-js --version
|
||||
- name: Run all tests
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
||||
run: |
|
||||
@@ -703,10 +566,38 @@ jobs:
|
||||
./src/benchmarks/packedvector-bench
|
||||
./src/benchmarks/rtree-bench ../test/data/monaco.osrm.ramIndex ../test/data/monaco.osrm.fileIndex ../test/data/monaco.osrm.nbg_nodes
|
||||
popd
|
||||
- name: Run Node package tests only
|
||||
|
||||
- name: Use Node 16
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Run Node package tests on Node 16
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
||||
run: |
|
||||
node --version
|
||||
npm run nodejs-tests
|
||||
- name: Use Node 18
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Run Node package tests on Node 18
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
||||
run: |
|
||||
node --version
|
||||
npm run nodejs-tests
|
||||
- name: Use Node latest
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
- name: Run Node package tests on Node-latest
|
||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
||||
run: |
|
||||
node --version
|
||||
npm run nodejs-tests
|
||||
|
||||
- name: Upload test logs
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
@@ -757,6 +648,6 @@ jobs:
|
||||
|
||||
ci-complete:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [build-test-publish, docker-image, windows]
|
||||
needs: [build-test-publish, docker-image, routed-js, windows-release-node]
|
||||
steps:
|
||||
- run: echo "CI complete"
|
||||
|
||||
@@ -105,3 +105,4 @@ debug.lua
|
||||
|
||||
# node-osrm artifacts
|
||||
lib/binding
|
||||
|
||||
|
||||
@@ -1,13 +1,37 @@
|
||||
# Unreleased
|
||||
- Changes from 5.27.1
|
||||
- Features
|
||||
- ADDED: Add support for a default_radius flag. [#6575](https://github.com/Project-OSRM/osrm-backend/pull/6575)
|
||||
- ADDED: Add support for disabling feature datasets. [#6666](https://github.com/Project-OSRM/osrm-backend/pull/6666)
|
||||
- Build:
|
||||
- ADDED: Add CI job which builds OSRM with gcc 12. [#6455](https://github.com/Project-OSRM/osrm-backend/pull/6455)
|
||||
- CHANGED: Upgrade to clang-tidy 15. [#6439](https://github.com/Project-OSRM/osrm-backend/pull/6439)
|
||||
- CHANGED: Update actions/cache to v3. [#6420](https://github.com/Project-OSRM/osrm-backend/pull/6420)
|
||||
- REMOVED: Drop support of Node 12 & 14. [#6431](https://github.com/Project-OSRM/osrm-backend/pull/6431)
|
||||
- ADDED: Add 'load directly' mode to default Cucumber test suite. [#6663](https://github.com/Project-OSRM/osrm-backend/pull/6663)
|
||||
- NodeJS:
|
||||
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
|
||||
- Misc:
|
||||
- FIXED: Fix an error in a RouteParameters AnnotationsType operator overload. [#6646](https://github.com/Project-OSRM/osrm-backend/pull/6646)
|
||||
- ADDED: Add support for "unlimited" to be passed as a value for the default-radius and max-matching-radius flags. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
|
||||
- CHANGED: Allow -1.0 as unlimited for default_radius value. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
|
||||
- CHANGED: keep libosrm* in the docker image for downstream linking [#6602](https://github.com/Project-OSRM/osrm-backend/pull/6602)
|
||||
- CHANGED: Move vector in CSVFilesParser instead copying it. [#6470](https://github.com/Project-OSRM/osrm-backend/pull/6470)
|
||||
- REMOVED: Get rid of unused functions in util/json_util.hpp. [#6446](https://github.com/Project-OSRM/osrm-backend/pull/6446)
|
||||
- FIXED: Apply workaround for Conan installation issue on CI. [#6442](https://github.com/Project-OSRM/osrm-backend/pull/6442)
|
||||
- FIXED: Fix `npm audit` warnings in NPM package. [#6437](https://github.com/Project-OSRM/osrm-backend/pull/6437)
|
||||
- FIXED: Handle snapping parameter for all plugins in NodeJs bindings, but not for Route only. [#6417](https://github.com/Project-OSRM/osrm-backend/pull/6417)
|
||||
- FIXED: Fix annotations=true handling in NodeJS bindings & libosrm. [#6415](https://github.com/Project-OSRM/osrm-backend/pull/6415/)
|
||||
- FIXED: Fix bindings compilation issue on the latest Node. Update NAN to 2.17.0. [#6416](https://github.com/Project-OSRM/osrm-backend/pull/6416)
|
||||
- CHANGED: Make edge metrics strongly typed [#6420](https://github.com/Project-OSRM/osrm-backend/pull/6420)
|
||||
- FIXED: Typo in file name src/util/timed_historgram.cpp -> src/util/timed_histogram.cpp [#6428](https://github.com/Project-OSRM/osrm-backend/issues/6428)
|
||||
- CHANGED: Replace boost::string_ref with std::string_view [#6433](https://github.com/Project-OSRM/osrm-backend/pull/6433)
|
||||
- ADDED: Print tracebacks for Lua runtime errors [#6564](https://github.com/Project-OSRM/osrm-backend/pull/6564)
|
||||
- FIXED: Added a variable to preprocessor guard in file osrm-backend/include/util/range_table.hpp to solve build error. [#6596](https://github.com/Project-OSRM/osrm-backend/pull/6596)
|
||||
- FIXED: Ensure required file check in osrm-routed is correctly enforced. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
|
||||
- FIXED: Correct HTTP docs to reflect summary output dependency on steps parameter. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
|
||||
- Profiles:
|
||||
- FIXED: Bicycle and foot profiles now don't route on proposed ways [#6615](https://github.com/Project-OSRM/osrm-backend/pull/6615)
|
||||
- Routing:
|
||||
- FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419)
|
||||
# 5.27.1
|
||||
|
||||
+16
-169
@@ -1,8 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
|
||||
message(FATAL_ERROR "In-source builds are not allowed.
|
||||
@@ -33,7 +33,6 @@ option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
||||
option(ENABLE_LTO "Use LTO if available" OFF)
|
||||
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
|
||||
option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF)
|
||||
|
||||
@@ -113,29 +112,12 @@ include(CheckCXXCompilerFlag)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(bitness 32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(bitness 64)
|
||||
message(STATUS "Building on a 64 bit system")
|
||||
else()
|
||||
message(STATUS "Building on a 32 bit system")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||
endif()
|
||||
|
||||
# Strictly require GCC>=5.0 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||
message(FATAL_ERROR "GCC>=5.0 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2-3.3.0/include)
|
||||
@@ -190,26 +172,6 @@ add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER>
|
||||
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
|
||||
|
||||
if(ENABLE_GOLD_LINKER)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
message(STATUS "Using GNU gold as linker.")
|
||||
|
||||
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
|
||||
string(REGEX REPLACE ".*\\(GNU Binutils[^\\)0-9]+([0-9]+\\.[0-9]+)[^\\)]*\\).*" "\\1" GOLD_BINUTILS_VERSION "${LD_VERSION}")
|
||||
if ("${GOLD_BINUTILS_VERSION}" VERSION_LESS "2.26")
|
||||
message(STATUS "Disabling gc-sections on gold binutils < 2.26, see: https://sourceware.org/bugzilla/show_bug.cgi?id=17639")
|
||||
set(LD_AVOID_GC_SECTIONS TRUE)
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "GNU gold linker isn't available.")
|
||||
set(ENABLE_GOLD_LINKER OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Explicitly set the build type to Release if no other type is specified
|
||||
# on the command line. Without this, cmake defaults to an unoptimized,
|
||||
# non-debug build, which almost nobody wants.
|
||||
@@ -247,74 +209,17 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -ggdb")
|
||||
endif()
|
||||
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
||||
message(STATUS "Configuring release mode optimizations")
|
||||
# Check if LTO is available
|
||||
check_cxx_compiler_flag("-Wl,-flto" LTO_AVAILABLE)
|
||||
|
||||
if(ENABLE_LTO AND LTO_AVAILABLE)
|
||||
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
# GCC in addition allows parallelizing LTO
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NPROC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=${NPROC}")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
|
||||
endif()
|
||||
set(CHECK_LTO_SRC "int main(){return 0;}")
|
||||
check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS)
|
||||
if(LTO_WORKS)
|
||||
message(STATUS "LTO working")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -flto")
|
||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -flto")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
|
||||
else()
|
||||
message(STATUS "LTO broken")
|
||||
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
|
||||
set(ENABLE_LTO Off)
|
||||
endif()
|
||||
|
||||
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW)
|
||||
find_program(GCC_AR gcc-ar)
|
||||
find_program(GCC_RANLIB gcc-ranlib)
|
||||
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
||||
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
|
||||
else()
|
||||
message(STATUS "Using GCC specific binutils for LTO:")
|
||||
message(STATUS " ${GCC_AR}")
|
||||
message(STATUS " ${GCC_RANLIB}")
|
||||
set(CMAKE_AR ${GCC_AR})
|
||||
set(CMAKE_RANLIB ${GCC_RANLIB})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Same for clang LTO requires their own toolchain
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
find_program(LLVM_AR llvm-ar)
|
||||
find_program(LLVM_RANLIB llvm-ranlib)
|
||||
if ("${LLVM_AR}" STREQUAL "LLVM_AR-NOTFOUND" OR "${LLVM_RANLIB}" STREQUAL "LLVM_RANLIB-NOTFOUND")
|
||||
message(WARNING "LLVM specific binutils not found.")
|
||||
else()
|
||||
message(STATUS "Using LLVM specific binutils for LTO:")
|
||||
message(STATUS " ${LLVM_AR}")
|
||||
message(STATUS " ${LLVM_RANLIB}")
|
||||
set(CMAKE_AR ${LLVM_AR})
|
||||
set(CMAKE_RANLIB ${LLVM_RANLIB})
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_LTO AND (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT LTO_SUPPORTED OUTPUT error)
|
||||
if(LTO_SUPPORTED)
|
||||
message(STATUS "IPO / LTO enabled")
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
else()
|
||||
message(WARNING "IPO / LTO not supported: <${error}>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# 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 "")
|
||||
if (ENABLE_COVERAGE)
|
||||
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
@@ -352,14 +257,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
add_dependency_defines(-DWIN32)
|
||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||
endif()
|
||||
|
||||
# -fpermissive is required for parallel_do Intel TBB internal issue with GCC < 5
|
||||
# https://github.com/Project-OSRM/osrm-backend/pull/3603#issuecomment-277688589
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||
message(STATUS "Adding -fpermissive for GCC version < 5 bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51048). See #3603.")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
||||
endif()
|
||||
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
# using Intel C++
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
|
||||
@@ -377,50 +274,11 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
target_link_libraries(osrm-extract wsock32 ws2_32)
|
||||
endif()
|
||||
|
||||
# Configuring linker
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT_VARIABLE LINKER_VERSION)
|
||||
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
|
||||
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
|
||||
message(STATUS "Setting linker optimizations")
|
||||
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
|
||||
# Tell compiler to put every function in separate section, linker can then match sections and functions
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
|
||||
# Tell linker to do dead code and data eminination during link time discarding sections
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--gc-sections")
|
||||
endif()
|
||||
# Default linker optimization flags
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common")
|
||||
|
||||
else()
|
||||
message(STATUS "Using unknown linker, not setting linker optimizations")
|
||||
endif ()
|
||||
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_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++17")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++17")
|
||||
endif()
|
||||
|
||||
# Configuring other platform dependencies
|
||||
if(APPLE)
|
||||
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
|
||||
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
|
||||
if(OSXLIBSTD)
|
||||
message(STATUS "linking against ${OSXLIBSTD}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=${OSXLIBSTD}")
|
||||
elseif(DARWIN_VERSION GREATER 12)
|
||||
message(STATUS "linking against libc++")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(MAYBE_RT_LIBRARY -lrt)
|
||||
find_library(RT_LIB rt)
|
||||
if (RT_LIB)
|
||||
set(MAYBE_RT_LIBRARY -lrt)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
@@ -432,11 +290,6 @@ include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
|
||||
set(MICROTAR_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src")
|
||||
include_directories(SYSTEM ${MICROTAR_INCLUDE_DIR})
|
||||
|
||||
set(MBXGEOM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/geometry.hpp-0.9.2/include")
|
||||
include_directories(SYSTEM ${MBXGEOM_INCLUDE_DIR})
|
||||
set(CHEAPRULER_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cheap-ruler-cpp-2778eb8/include")
|
||||
include_directories(SYSTEM ${CHEAPRULER_INCLUDE_DIR})
|
||||
|
||||
add_library(MICROTAR OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src/microtar.c")
|
||||
set_property(TARGET MICROTAR PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
target_no_warning(MICROTAR unused-variable)
|
||||
@@ -550,12 +403,7 @@ if(ENABLE_CONAN)
|
||||
# expat and bzip2 are used from conan rather than the system
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
|
||||
else()
|
||||
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()
|
||||
find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
||||
|
||||
find_package(TBB REQUIRED)
|
||||
@@ -602,7 +450,6 @@ if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILE
|
||||
message(STATUS "Using ccache to speed up incremental builds")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
set(ENV{CCACHE_CPP2} "true")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[](https://github.com/Project-OSRM/osrm-backend/actions/workflows/osrm-backend.yml) [](https://codecov.io/gh/Project-OSRM/osrm-backend) [](https://discord.gg/es9CdcCXcb)
|
||||
|
||||
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
|
||||
High performance routing engine written in C++ designed to run on OpenStreetMap data.
|
||||
|
||||
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
|
||||
- Nearest - Snaps coordinates to the street network and returns the nearest matches
|
||||
@@ -32,7 +32,7 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
||||
|
||||
## Contact
|
||||
|
||||
- Discord: [https://discord.gg/es9CdcCXcb](join)
|
||||
- Discord: [join](https://discord.gg/es9CdcCXcb)
|
||||
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
|
||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||
|
||||
@@ -58,12 +58,12 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
|
||||
|
||||
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
||||
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf || echo "osrm-extract failed"
|
||||
|
||||
The flag `-v "${PWD}:/data"` creates the directory `/data` inside the docker container and makes the current working directory `"${PWD}"` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `"${PWD}/berlin-latest.osm.pbf"` on the host.
|
||||
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-partition /data/berlin-latest.osrm || echo "osrm-partition failed"
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-customize /data/berlin-latest.osrm || echo "osrm-customize failed"
|
||||
|
||||
Note there is no `berlin-latest.osrm` file, but multiple `berlin-latest.osrm.*` files, i.e. `berlin-latest.osrm` is not file path, but "base" path referring to set of files and there is an option to omit this `.osrm` suffix completely(e.g. `osrm-partition /data/berlin-latest`).
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
# - Check whether the CXX compiler supports a given flag.
|
||||
# CHECK_CXX_COMPILER_FLAG(<flag> <var>)
|
||||
# <flag> - the compiler flag
|
||||
# <var> - variable to store the result
|
||||
# This internally calls the check_cxx_source_compiles macro. See help
|
||||
# for CheckCXXSourceCompiles for a listing of variables that can
|
||||
# modify the build.
|
||||
|
||||
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
|
||||
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
|
||||
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
|
||||
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
|
||||
# Some compilers do not fail with a bad flag
|
||||
FAIL_REGEX "unrecognized .*option" # GNU
|
||||
FAIL_REGEX "ignoring unknown option" # MSVC
|
||||
FAIL_REGEX "[Uu]nknown option" # HP
|
||||
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
|
||||
FAIL_REGEX "command option .* is not recognized" # XL
|
||||
)
|
||||
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
|
||||
ENDMACRO (CHECK_CXX_COMPILER_FLAG)
|
||||
+4
-1
@@ -36,7 +36,10 @@
|
||||
# This is because, the lua location is not standardized and may exist in
|
||||
# locations other than lua/
|
||||
|
||||
include(FindPkgConfig)
|
||||
if(NOT PKG_CONFIG_FOUND)
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(PkgConfig)
|
||||
endif()
|
||||
|
||||
unset(_lua_include_subdirs)
|
||||
unset(_lua_library_names)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# https://github.com/sbellus/json-cmake/blob/9913da8800b95322d393894d3525d634568f305e/JSONParser.cmake
|
||||
# MIT Licensed - https://github.com/sbellus/json-cmake/blob/master/LICENSE
|
||||
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
if (DEFINED JSonParserGuard)
|
||||
return()
|
||||
|
||||
+5
-3
@@ -1,7 +1,9 @@
|
||||
module.exports = {
|
||||
default: '--strict --tags ~@stress --tags ~@todo --tags ~@mld-only --require features/support --require features/step_definitions',
|
||||
verify: '--strict --tags ~@stress --tags ~@todo --tags ~@mld-only -f progress --require features/support --require features/step_definitions',
|
||||
default: '--strict --tags ~@stress --tags ~@todo --tags ~@mld --require features/support --require features/step_definitions',
|
||||
ch: '--strict --tags ~@stress --tags ~@todo --tags ~@mld -f progress --require features/support --require features/step_definitions',
|
||||
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
||||
all: '--strict --require features/support --require features/step_definitions',
|
||||
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions -f progress'
|
||||
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions -f progress',
|
||||
verify_routed_js: '--strict --tags ~@skip_on_routed_js --tags ~@stress --tags ~@todo --tags ~@mld-only -f progress --require features/support --require features/step_definitions',
|
||||
mld_routed_js: '--strict --tags ~@skip_on_routed_js --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions -f progress',
|
||||
};
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ RUN mkdir -p /src && mkdir -p /opt
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get -y --no-install-recommends install ca-certificates cmake make git gcc g++ libbz2-dev libxml2-dev wget \
|
||||
libzip-dev libboost1.74-all-dev lua5.4 liblua5.4-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
|
||||
libzip-dev libboost1.74-all-dev lua5.4 liblua5.4-dev pkg-config -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
|
||||
|
||||
RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
|
||||
ldconfig /usr/local/lib && \
|
||||
@@ -37,7 +37,7 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
|
||||
cd ../profiles && \
|
||||
cp -r * /opt && \
|
||||
strip /usr/local/bin/* && \
|
||||
rm -rf /src /usr/local/lib/libosrm*
|
||||
rm -rf /src
|
||||
|
||||
|
||||
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
|
||||
|
||||
+2
-2
@@ -32,9 +32,9 @@ For outputting data into our file (debug.geojson), we simply need to call the ma
|
||||
### Possible Scopeguard Location
|
||||
Think of the scopeguard as you would do of any reference. If you wan't to access to logging during a call, the guard object must be alive and valid.
|
||||
|
||||
As an example: a good location to create the a scopeguard to log decisions in the edge-based-graph-factory would be right before we run it ([here](https://github.com/Project-OSRM/osrm-backend/blob/a933b5d94943bf3edaf42c84a614a99650d23cba/src/extractor/extractor.cpp#L497)). If you put `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", node_coordinate_vector);` at that location, you can then print `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);` anywhere within the `edge-based-graph-factory`.
|
||||
As an example: a good location to create a scopeguard to log decisions in the edge-based-graph-factory would be right before we run it ([here](https://github.com/Project-OSRM/osrm-backend/blob/a933b5d94943bf3edaf42c84a614a99650d23cba/src/extractor/extractor.cpp#L497)). If you put `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", node_coordinate_vector);` at that location, you can then print `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);` anywhere within the `edge-based-graph-factory`.
|
||||
|
||||
This location would enable call for all guidance related pre-processing which is called in the edge-based-graph-factory.
|
||||
This location would enable calls for all guidance related pre-processing which is called in the edge-based-graph-factory.
|
||||
Logging any turn-handler decisions, for example, would now be possible.
|
||||
|
||||
## Limitations
|
||||
|
||||
+21
-20
@@ -88,10 +88,11 @@ Every response object has a `code` property containing one of the strings below
|
||||
| `InvalidService` | Service name is invalid. |
|
||||
| `InvalidVersion` | Version is not found. |
|
||||
| `InvalidOptions` | Options are invalid. |
|
||||
| `InvalidQuery` | The query string is syntactically malformed. |
|
||||
| `InvalidQuery` | The query string is syntactically malformed. |
|
||||
| `InvalidValue` | The successfully parsed query parameters are invalid. |
|
||||
| `NoSegment` | One of the supplied input coordinates could not snap to the street segment. |
|
||||
| `NoSegment` | One of the supplied input coordinates could not snap to the street segment. |
|
||||
| `TooBig` | The request size violates one of the service-specific request size restrictions. |
|
||||
| `DisabledDataset` | The request tried to access a disabled dataset. |
|
||||
|
||||
- `message` is a **optional** human-readable error message. All other status types are service-dependent.
|
||||
- In case of an error the HTTP status code will be `400`. Otherwise, the HTTP status code will be `200` and `code` will be `Ok`.
|
||||
@@ -130,7 +131,7 @@ In addition to the [general options](#general-options) the following options are
|
||||
|number |`integer >= 1` (default `1`) |Number of nearest segments that should be returned. |
|
||||
|
||||
As `waypoints` is a single thing, returned by that service, using it with the option `skip_waypoints` set to `true` is quite useless, but still
|
||||
possible. In that case, only the `code` field will be returned.
|
||||
possible. In that case, only the `code` field will be returned.
|
||||
|
||||
**Response**
|
||||
|
||||
@@ -648,12 +649,12 @@ Represents a route between two waypoints.
|
||||
- `distance`: The distance traveled by this route leg, in `float` meters.
|
||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||
- `weight`: The calculated weight of the route leg.
|
||||
- `summary`: Summary of the route taken as `string`. Depends on the `summary` parameter:
|
||||
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
|
||||
|
||||
| summary | |
|
||||
|--------------|-----------------------------------------------------------------------|
|
||||
| true | Names of the two major roads used. Can be empty if the route is too short.|
|
||||
| false | empty `string` |
|
||||
| steps | |
|
||||
|-------|-----------------------------------------------------------------------|
|
||||
| true | Names of the two major roads used. Can be empty if the route is too short.|
|
||||
| false | empty `string` |
|
||||
|
||||
- `steps`: Depends on the `steps` parameter.
|
||||
|
||||
@@ -953,11 +954,11 @@ The object is used to describe the waypoint on a route.
|
||||
|
||||
## Flatbuffers format
|
||||
|
||||
The default response format is `json`, but OSRM supports binary [`flatbuffers`](https://google.github.io/flatbuffers/) format, which
|
||||
The default response format is `json`, but OSRM supports binary [`flatbuffers`](https://google.github.io/flatbuffers/) format, which
|
||||
is much faster in serialization/deserialization, comparing to `json`.
|
||||
|
||||
The format itself is described in message descriptors, located at `include/engine/api/flatbuffers` directory. Those descriptors could
|
||||
be compiled to provide protocol parsers in Go/Javascript/Typescript/Java/Dart/C#/Python/Lobster/Lua/Rust/PHP/Kotlin. Precompiled
|
||||
be compiled to provide protocol parsers in Go/Javascript/Typescript/Java/Dart/C#/Python/Lobster/Lua/Rust/PHP/Kotlin. Precompiled
|
||||
protocol parser for C++ is supplied with OSRM.
|
||||
|
||||
`Flatbuffers` format provides exactly the same data, as `json` format with a slightly different layout, which was optimized to minimize
|
||||
@@ -971,7 +972,7 @@ Root object is the only object, available from a 'raw' `flatbuffers` buffer. It
|
||||
|
||||
**Properties**
|
||||
|
||||
- `error`: `bool` Marks response as erroneous. An erroneous response should include the `code` fieldset, all the other fields may not be present.
|
||||
- `error`: `bool` Marks response as erroneous. An erroneous response should include the `code` fieldset, all the other fields may not be present.
|
||||
- `code`: `Error` Error description object, only present, when `error` is `true`
|
||||
- `waypoints`: `[Waypoint]` Array of `Waypoint` objects. Should present for every service call, unless `skip_waypoints` is set to `true`. Table service will put `sources` array here.
|
||||
- `routes`: `[RouteObject]` Array of `RouteObject` objects. May be empty or absent. Should present for Route/Trip/Match services call.
|
||||
@@ -983,21 +984,21 @@ Contains error information.
|
||||
|
||||
**Properties**
|
||||
|
||||
- `code`: `string` Error code
|
||||
- `code`: `string` Error code
|
||||
- `message`: `string` Detailed error message
|
||||
|
||||
### Waypoint object
|
||||
|
||||
Almost the same as `json` Waypoint object. The following properties differ:
|
||||
|
||||
- `location`: `Position` Same as `json` location field, but different format.
|
||||
- `location`: `Position` Same as `json` location field, but different format.
|
||||
- `nodes`: `Uint64Pair` Same as `json` nodes field, but different format.
|
||||
|
||||
### RouteObject object
|
||||
|
||||
Almost the same as `json` Route object. The following properties differ:
|
||||
|
||||
- `polyline`: `string` Same as `json` geometry.polyline or geometry.polyline6 fields. One field for both formats.
|
||||
- `polyline`: `string` Same as `json` geometry.polyline or geometry.polyline6 fields. One field for both formats.
|
||||
- `coordinates`: `[Position]` Same as `json` geometry.coordinates field, but different format.
|
||||
- `legs`: `[Leg]` Array of `Leg` objects.
|
||||
|
||||
@@ -1012,7 +1013,7 @@ Almost the same as `json` Leg object. The following properties differ:
|
||||
|
||||
Almost the same as `json` Step object. The following properties differ:
|
||||
|
||||
- `polyline`: `string` Same as `json` geometry.polyline or geometry.polyline6 fields. One field for both formats.
|
||||
- `polyline`: `string` Same as `json` geometry.polyline or geometry.polyline6 fields. One field for both formats.
|
||||
- `coordinates`: `[Position]` Same as `json` geometry.coordinates field, but different format.
|
||||
- `maneuver`: `StepManeuver` Same as `json` maneuver field, but different format.
|
||||
|
||||
@@ -1035,7 +1036,7 @@ Almost the same as `json` Step object. The following properties differ:
|
||||
| `ExitRoundabout` | Describes a maneuver exiting a roundabout (usually preceded by a `roundabout` instruction) |
|
||||
| `ExitRotary` | Describes the maneuver exiting a rotary (large named roundabout) |
|
||||
|
||||
- `driving_side`: `bool` Ttrue stands for the left side driving.
|
||||
- `driving_side`: `bool` Ttrue stands for the left side driving.
|
||||
- `intersections`: `[Intersection]` Same as `json` intersections field, but different format.
|
||||
|
||||
### Intersection object
|
||||
@@ -1049,7 +1050,7 @@ Almost the same as `json` Intersection object. The following properties differ:
|
||||
|
||||
Almost the same as `json` Lane object. The following properties differ:
|
||||
|
||||
- `indications`: `Turn` Array of `Turn` enum values.
|
||||
- `indications`: `Turn` Array of `Turn` enum values.
|
||||
|
||||
| `value` | Description |
|
||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
@@ -1089,16 +1090,16 @@ Almost the same as `json` StepManeuver object. The following properties differ:
|
||||
| `ExitRoundabout` | Describes a maneuver exiting a roundabout (usually preceded by a `roundabout` instruction) |
|
||||
| `ExitRotary` | Describes the maneuver exiting a rotary (large named roundabout) |
|
||||
|
||||
- `modifier`: `Turn` Maneuver turn (enum)
|
||||
- `modifier`: `Turn` Maneuver turn (enum)
|
||||
|
||||
### Annotation object
|
||||
|
||||
Exactly the same as `json` annotation object.
|
||||
Exactly the same as `json` annotation object.
|
||||
|
||||
|
||||
### Position object
|
||||
|
||||
A point on Earth.
|
||||
A point on Earth.
|
||||
|
||||
***Properties***
|
||||
- `longitute`: `float` Point's longitude
|
||||
|
||||
+3
-1
@@ -31,6 +31,7 @@ var osrm = new OSRM('network.osrm');
|
||||
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/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.disable_feature_dataset` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Disables a feature dataset from being loaded into memory if not needed. Options: `ROUTE_STEPS`, `ROUTE_GEOMETRY`.
|
||||
- `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).
|
||||
@@ -38,6 +39,7 @@ var osrm = new OSRM('network.osrm');
|
||||
- `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).
|
||||
- `options.default_radius` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Default radius for queries (default: unlimited).
|
||||
|
||||
### route
|
||||
|
||||
@@ -248,7 +250,7 @@ osrm.match(options, function(err, response) {
|
||||
|
||||
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.
|
||||
If the trace point was omitted by map matching because it is an outlier, the entry will be null.
|
||||
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
-2
@@ -113,7 +113,7 @@ excludable | Sequence of Sets | Determines which class
|
||||
classes | Sequence | Determines the allowed classes that can be referenced using `{forward,backward}_classes` on the way in the `process_way` function.
|
||||
restrictions | Sequence | Determines which turn restrictions will be used for this profile.
|
||||
suffix_list | Set | List of name suffixes needed for determining if "Highway 101 NW" the same road as "Highway 101 ES".
|
||||
relation_types | Sequence | Determines wich relations should be cached for processing in this profile. It contains relations types
|
||||
relation_types | Sequence | Determines which relations should be cached for processing in this profile. It contains relations types
|
||||
|
||||
### process_node(profile, node, result, relations)
|
||||
Process an OSM node to determine whether this node is a barrier or can be passed and whether passing it incurs a delay.
|
||||
@@ -349,7 +349,7 @@ The input data must an ASCII file with rows of integers. e.g.:
|
||||
|
||||
In your `segment_function` you can then access the raster source and use `raster:query()` to query to find the nearest data point, or `raster:interpolate()` to interpolate a value based on nearby data points.
|
||||
|
||||
You must check whether the result is valid before use it.
|
||||
You must check whether the result is valid before using it.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
+4
-4
@@ -300,7 +300,7 @@ And the relations
|
||||
The setting looks perfectly fine at first glance. However, it is not well defined.
|
||||
The forbidden right turn could be either a superfluous addition, forbidding the turn `cb` to `be`, or actually refer to the turn `ab` to `bd` to say that a turn is forbidden here.
|
||||
|
||||
To model turn-restrictions correctly and unique, we need to split segments that contribute to the restriction into the smallest possible parts.
|
||||
To model turn-restrictions correctly and uniquely, we need to split segments that contribute to the restriction into the smallest possible parts.
|
||||
E.g. the above scenario could correctly be expressed as:
|
||||
|
||||
```
|
||||
@@ -360,7 +360,7 @@ When I route I should get
|
||||
|
||||
And the test reports `turn right` for the route `a->e`, where before it said `slight right`.
|
||||
|
||||
If you changed the turn angles, obviously you can expect changes in the distinction between `slight right` and `right`.
|
||||
If you change the turn angles, obviously you can expect changes in the distinction between `slight right` and `right`.
|
||||
In such a case it is, of course, reasonable to change the expected route to report `right` instead of `slight right`. You should consider inspecting the actual turn angles at `b` to see if you feel that change is justified.
|
||||
|
||||
However, you should never adjust the test itself.
|
||||
@@ -390,9 +390,9 @@ In this case we would see a very slight turn angle. If your change now reports d
|
||||
|
||||
### Consider Post-Processing Impacts
|
||||
|
||||
Some changes you might see could look completely unrelated. To understand the impact of your changes, you can make use of the debugging utilities you can finde in `util/debug.hpp` (and potentially other related headers).
|
||||
Some changes you might see could look completely unrelated. To understand the impact of your changes, you can make use of the debugging utilities you can find in `util/debug.hpp` (and potentially other related headers).
|
||||
|
||||
If your test is inspecting a series of turns (remember, a turn not necessarily equals an instruction), you could see interaction with post-processing.
|
||||
If your test is inspecting a series of turns (remember, a turn does not necessarily equals an instruction), you could see interaction with post-processing.
|
||||
To see the unprocessed turns, you should print the steps at the end of step assembly (`assembleSteps` in `engine/guidance/assemble_steps.hpp`).
|
||||
|
||||
If you see unexpected changes, you can consider adding the `locations` field to your test to study what location a turn is reported at.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.8)
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
|
||||
message(FATAL_ERROR "In-source builds are not allowed.
|
||||
@@ -12,20 +12,18 @@ endif()
|
||||
|
||||
project(osrm-example C CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
set(bitness 32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(bitness 64)
|
||||
message(STATUS "Building on a 64 bit system")
|
||||
else()
|
||||
message(STATUS "Building on a 32 bit system")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||
endif()
|
||||
|
||||
link_directories(${LibOSRM_LIBRARY_DIRS})
|
||||
add_executable(osrm-example example.cpp)
|
||||
|
||||
|
||||
@@ -78,6 +78,15 @@ Feature: Bike - Accessability of different way types
|
||||
| construction | yes | | |
|
||||
| construction | | yes | |
|
||||
|
||||
@proposed
|
||||
Scenario: Bike - Don't allow routing on ways still being proposed
|
||||
Then routability should be
|
||||
| highway | foot | bicycle | proposed | bothw |
|
||||
| primary | | | | x |
|
||||
| proposed | | | | |
|
||||
| proposed | yes | | yes | |
|
||||
| proposed | | yes | yes | |
|
||||
|
||||
@roundabout
|
||||
Scenario: Bike - Don't push bikes against oneway flow on roundabouts
|
||||
Then routability should be
|
||||
|
||||
@@ -36,3 +36,9 @@ Feature: Foot - Accessability of different way types
|
||||
| highway | leisure | forw |
|
||||
| (nil) | track | x |
|
||||
|
||||
Scenario: Foot - Proposed ways
|
||||
Then routability should be
|
||||
| highway | foot | proposed | forw |
|
||||
| footway | | | x |
|
||||
| proposed | | | |
|
||||
| proposed | yes | yes | |
|
||||
|
||||
+26
-18
@@ -68,8 +68,9 @@ class OSRMDirectLoader extends OSRMBaseLoader {
|
||||
super(scope);
|
||||
}
|
||||
|
||||
load (inputFile, callback) {
|
||||
this.inputFile = inputFile;
|
||||
load (ctx, callback) {
|
||||
this.inputFile = ctx.inputFile;
|
||||
this.loaderArgs = ctx.loaderArgs;
|
||||
this.shutdown(() => {
|
||||
this.launch(callback);
|
||||
});
|
||||
@@ -78,7 +79,7 @@ class OSRMDirectLoader extends OSRMBaseLoader {
|
||||
osrmUp (callback) {
|
||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||
|
||||
const command_arguments = util.format('%s -p %d -i %s -a %s', this.inputFile, this.scope.OSRM_PORT, this.scope.OSRM_IP, this.scope.ROUTING_ALGORITHM);
|
||||
const command_arguments = util.format('%s -p %d -i %s -a %s %s', this.inputFile, this.scope.OSRM_PORT, this.scope.OSRM_IP, this.scope.ROUTING_ALGORITHM, this.loaderArgs);
|
||||
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
||||
if (err && err.signal !== 'SIGINT') {
|
||||
this.child = null;
|
||||
@@ -101,8 +102,9 @@ class OSRMmmapLoader extends OSRMBaseLoader {
|
||||
super(scope);
|
||||
}
|
||||
|
||||
load (inputFile, callback) {
|
||||
this.inputFile = inputFile;
|
||||
load (ctx, callback) {
|
||||
this.inputFile = ctx.inputFile;
|
||||
this.loaderArgs = ctx.loaderArgs;
|
||||
this.shutdown(() => {
|
||||
this.launch(callback);
|
||||
});
|
||||
@@ -111,7 +113,7 @@ class OSRMmmapLoader extends OSRMBaseLoader {
|
||||
osrmUp (callback) {
|
||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||
|
||||
const command_arguments = util.format('%s -p %d -i %s -a %s --mmap', this.inputFile, this.scope.OSRM_PORT, this.scope.OSRM_IP, this.scope.ROUTING_ALGORITHM);
|
||||
const command_arguments = util.format('%s -p %d -i %s -a %s --mmap %s', this.inputFile, this.scope.OSRM_PORT, this.scope.OSRM_IP, this.scope.ROUTING_ALGORITHM, this.loaderArgs);
|
||||
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
|
||||
if (err && err.signal !== 'SIGINT') {
|
||||
this.child = null;
|
||||
@@ -134,8 +136,9 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
||||
super(scope);
|
||||
}
|
||||
|
||||
load (inputFile, callback) {
|
||||
this.inputFile = inputFile;
|
||||
load (ctx, callback) {
|
||||
this.inputFile = ctx.inputFile;
|
||||
this.loaderArgs = ctx.loaderArgs;
|
||||
|
||||
this.loadData((err) => {
|
||||
if (err) return callback(err);
|
||||
@@ -148,7 +151,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
|
||||
}
|
||||
|
||||
loadData (callback) {
|
||||
const command_arguments = util.format('--dataset-name=%s %s', this.scope.DATASET_NAME, this.inputFile);
|
||||
const command_arguments = util.format('--dataset-name=%s %s %s', this.scope.DATASET_NAME, this.inputFile, this.loaderArgs);
|
||||
this.scope.runBin('osrm-datastore', command_arguments, this.scope.environment, (err) => {
|
||||
if (err) return callback(new Error('*** osrm-datastore exited with ' + err.code + ': ' + err));
|
||||
callback();
|
||||
@@ -185,11 +188,16 @@ class OSRMLoader {
|
||||
this.loader = {shutdown: (cb) => cb() };
|
||||
}
|
||||
if (this.method === 'datastore') {
|
||||
this.loader.shutdown((err) => {
|
||||
if (err) return callback(err);
|
||||
this.loader = this.sharedLoader;
|
||||
this.sharedLoader.load(inputFile, callback);
|
||||
});
|
||||
// shutdown only if we are switching from another loader type
|
||||
if (this.loader !== this.sharedLoader) {
|
||||
this.loader.shutdown((err) => {
|
||||
if (err) return callback(err);
|
||||
this.loader = this.sharedLoader;
|
||||
this.sharedLoader.load(inputFile, callback);
|
||||
});
|
||||
} else {
|
||||
this.sharedLoader.load(inputFile, callback);
|
||||
}
|
||||
} else if (this.method === 'directly') {
|
||||
this.loader.shutdown((err) => {
|
||||
if (err) return callback(err);
|
||||
@@ -198,12 +206,12 @@ class OSRMLoader {
|
||||
});
|
||||
} else if (this.method === 'mmap') {
|
||||
this.loader.shutdown((err) => {
|
||||
if (err) return callback(err);
|
||||
this.loader = this.mmapLoader;
|
||||
this.mmapLoader.load(inputFile, callback);
|
||||
if (err) return callback(err);
|
||||
this.loader = this.mmapLoader;
|
||||
this.mmapLoader.load(inputFile, callback);
|
||||
});
|
||||
} else {
|
||||
callback(new Error('*** Unknown load method ' + method));
|
||||
callback(new Error('*** Unknown load method ' + this.method));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
@routing @disable-feature-dataset
|
||||
Feature: disable-feature-dataset command line options
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
And the node map
|
||||
"""
|
||||
0
|
||||
a b c
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
| bc |
|
||||
|
||||
Scenario: disable-feature-dataset - geometry disabled error
|
||||
Given the data load extra arguments "--disable-feature-dataset ROUTE_GEOMETRY"
|
||||
|
||||
# The default values
|
||||
And the query options
|
||||
| overview | simplified |
|
||||
| annotations | false |
|
||||
| steps | false |
|
||||
| skip_waypoints | false |
|
||||
|
||||
When I route I should get
|
||||
| from | to | code |
|
||||
| a | c | DisabledDataset |
|
||||
|
||||
When I plan a trip I should get
|
||||
| waypoints | code |
|
||||
| a,b,c | DisabledDataset |
|
||||
|
||||
When I match I should get
|
||||
| trace | code |
|
||||
| abc | DisabledDataset |
|
||||
|
||||
Scenario: disable-feature-dataset - geometry disabled error table
|
||||
Given the data load extra arguments "--disable-feature-dataset ROUTE_GEOMETRY"
|
||||
|
||||
When I request nearest I should get
|
||||
| in | code |
|
||||
| 0 | DisabledDataset |
|
||||
|
||||
When I request a travel time matrix with these waypoints I should get the response code
|
||||
| waypoints | code |
|
||||
| a,b,c | DisabledDataset |
|
||||
|
||||
|
||||
Scenario: disable-feature-dataset - geometry disabled success
|
||||
Given the data load extra arguments "--disable-feature-dataset ROUTE_GEOMETRY"
|
||||
|
||||
# No geometry values returned
|
||||
And the query options
|
||||
| overview | false |
|
||||
| annotations | false |
|
||||
| steps | false |
|
||||
| skip_waypoints | true |
|
||||
|
||||
When I route I should get
|
||||
| from | to | code |
|
||||
| a | c | Ok |
|
||||
|
||||
When I plan a trip I should get
|
||||
| waypoints | code |
|
||||
| a,b,c | Ok |
|
||||
|
||||
When I match I should get
|
||||
| trace | code |
|
||||
| abc | Ok |
|
||||
|
||||
Scenario: disable-feature-dataset - geometry disabled error table
|
||||
Given the data load extra arguments "--disable-feature-dataset ROUTE_GEOMETRY"
|
||||
|
||||
And the query options
|
||||
| skip_waypoints | true |
|
||||
|
||||
# You would never do this, but just to prove the point.
|
||||
When I request nearest I should get
|
||||
| in | code |
|
||||
| 0 | Ok |
|
||||
|
||||
When I request a travel time matrix with these waypoints I should get the response code
|
||||
| waypoints | code |
|
||||
| a,b,c | Ok |
|
||||
|
||||
|
||||
Scenario: disable-feature-dataset - steps disabled error
|
||||
Given the data load extra arguments "--disable-feature-dataset ROUTE_STEPS"
|
||||
|
||||
# Default + annotations, steps
|
||||
And the query options
|
||||
| overview | simplified |
|
||||
| annotations | true |
|
||||
| steps | true |
|
||||
|
||||
When I route I should get
|
||||
| from | to | code |
|
||||
| a | c | DisabledDataset |
|
||||
|
||||
When I plan a trip I should get
|
||||
| waypoints | code |
|
||||
| a,b,c | DisabledDataset |
|
||||
|
||||
When I match I should get
|
||||
| trace | code |
|
||||
| abc | DisabledDataset |
|
||||
|
||||
|
||||
Scenario: disable-feature-dataset - geometry disabled error table
|
||||
Given the data load extra arguments "--disable-feature-dataset ROUTE_STEPS"
|
||||
|
||||
When I request nearest I should get
|
||||
| in | code |
|
||||
| 0 | Ok |
|
||||
|
||||
When I request a travel time matrix with these waypoints I should get the response code
|
||||
| waypoints | code |
|
||||
| a,b,c | Ok |
|
||||
|
||||
|
||||
Scenario: disable-feature-dataset - steps disabled success
|
||||
Given the data load extra arguments "--disable-feature-dataset ROUTE_STEPS"
|
||||
|
||||
# Default + steps
|
||||
And the query options
|
||||
| overview | simplified |
|
||||
| annotations | true |
|
||||
| steps | false |
|
||||
|
||||
When I route I should get
|
||||
| from | to | code |
|
||||
| a | c | Ok |
|
||||
|
||||
When I plan a trip I should get
|
||||
| waypoints | code |
|
||||
| a,b,c | Ok |
|
||||
|
||||
When I match I should get
|
||||
| trace | code |
|
||||
| abc | Ok |
|
||||
|
||||
@@ -4,6 +4,7 @@ Feature: osrm-routed command line options: help
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: osrm-routed - Help should be shown when no options are passed
|
||||
When I run "osrm-routed"
|
||||
Then stderr should be empty
|
||||
@@ -22,8 +23,10 @@ Feature: osrm-routed command line options: help
|
||||
And stdout should contain "--max-trip-size"
|
||||
And stdout should contain "--max-table-size"
|
||||
And stdout should contain "--max-matching-size"
|
||||
And stdout should contain "--default-radius"
|
||||
And it should exit successfully
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: osrm-routed - Help, short
|
||||
When I run "osrm-routed -h"
|
||||
Then stderr should be empty
|
||||
@@ -42,8 +45,11 @@ Feature: osrm-routed command line options: help
|
||||
And stdout should contain "--max-trip-size"
|
||||
And stdout should contain "--max-table-size"
|
||||
And stdout should contain "--max-matching-size"
|
||||
And stdout should contain "--default-radius"
|
||||
And it should exit successfully
|
||||
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: osrm-routed - Help, long
|
||||
When I run "osrm-routed --help"
|
||||
Then stderr should be empty
|
||||
@@ -62,4 +68,5 @@ Feature: osrm-routed command line options: help
|
||||
And stdout should contain "--max-table-size"
|
||||
And stdout should contain "--max-table-size"
|
||||
And stdout should contain "--max-matching-size"
|
||||
And stdout should contain "--default-radius"
|
||||
And it should exit successfully
|
||||
|
||||
@@ -4,6 +4,7 @@ Feature: osrm-routed command line options: invalid options
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: osrm-routed - Non-existing option
|
||||
When I try to run "osrm-routed --fly-me-to-the-moon"
|
||||
Then stdout should be empty
|
||||
@@ -11,6 +12,7 @@ Feature: osrm-routed command line options: invalid options
|
||||
And stderr should contain "fly-me-to-the-moon"
|
||||
And it should exit with an error
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: osrm-routed - Missing file
|
||||
When I try to run "osrm-routed over-the-rainbow.osrm"
|
||||
Then stderr should contain "over-the-rainbow.osrm"
|
||||
|
||||
@@ -33,6 +33,11 @@ module.exports = function () {
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Given(/^the data load extra arguments "(.*?)"$/, (args, callback) => {
|
||||
this.loaderArgs = this.expandOptions(args);
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => {
|
||||
this.setGridSize(meters);
|
||||
callback();
|
||||
|
||||
@@ -5,6 +5,7 @@ var FBResult = require('../support/fbresult_generated').osrm.engine.api.fbresult
|
||||
|
||||
module.exports = function () {
|
||||
const durationsRegex = new RegExp(/^I request a travel time matrix I should get$/);
|
||||
const durationsCodeOnlyRegex = new RegExp(/^I request a travel time matrix with these waypoints I should get the response code$/);
|
||||
const distancesRegex = new RegExp(/^I request a travel distance matrix I should get$/);
|
||||
const estimatesRegex = new RegExp(/^I request a travel time matrix I should get estimates for$/);
|
||||
const durationsRegexFb = new RegExp(/^I request a travel time matrix with flatbuffers I should get$/);
|
||||
@@ -17,6 +18,7 @@ module.exports = function () {
|
||||
const FORMAT_FB = 'flatbuffers';
|
||||
|
||||
this.When(durationsRegex, function(table, callback) {tableParse.call(this, table, DURATIONS_NO_ROUTE, 'durations', FORMAT_JSON, callback);}.bind(this));
|
||||
this.When(durationsCodeOnlyRegex, function(table, callback) {tableCodeOnlyParse.call(this, table, 'durations', FORMAT_JSON, callback);}.bind(this));
|
||||
this.When(distancesRegex, function(table, callback) {tableParse.call(this, table, DISTANCES_NO_ROUTE, 'distances', FORMAT_JSON, callback);}.bind(this));
|
||||
this.When(estimatesRegex, function(table, callback) {tableParse.call(this, table, DISTANCES_NO_ROUTE, 'fallback_speed_cells', FORMAT_JSON, callback);}.bind(this));
|
||||
this.When(durationsRegexFb, function(table, callback) {tableParse.call(this, table, DURATIONS_NO_ROUTE, 'durations', FORMAT_FB, callback);}.bind(this));
|
||||
@@ -27,6 +29,64 @@ const durationsParse = function(v) { return isNaN(parseInt(v)); };
|
||||
const distancesParse = function(v) { return isNaN(parseFloat(v)); };
|
||||
const estimatesParse = function(v) { return isNaN(parseFloat(v)); };
|
||||
|
||||
function tableCodeOnlyParse(table, annotation, format, callback) {
|
||||
|
||||
const params = this.queryParams;
|
||||
params.annotations = ['durations','fallback_speed_cells'].indexOf(annotation) !== -1 ? 'duration' : 'distance';
|
||||
params.output = format;
|
||||
|
||||
var got;
|
||||
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
var testRow = (row, ri, cb) => {
|
||||
var afterRequest = (err, res) => {
|
||||
if (err) return cb(err);
|
||||
|
||||
for (var k in row) {
|
||||
var match = k.match(/param:(.*)/);
|
||||
if (match) {
|
||||
if (row[k] === '(nil)') {
|
||||
params[match[1]] = null;
|
||||
} else if (row[k]) {
|
||||
params[match[1]] = [row[k]];
|
||||
}
|
||||
got[k] = row[k];
|
||||
}
|
||||
}
|
||||
|
||||
var json;
|
||||
got.code = 'unknown';
|
||||
if (res.body.length) {
|
||||
json = JSON.parse(res.body);
|
||||
got.code = json.code;
|
||||
}
|
||||
|
||||
cb(null, got);
|
||||
};
|
||||
|
||||
var params = this.queryParams,
|
||||
waypoints = [];
|
||||
if (row.waypoints) {
|
||||
row.waypoints.split(',').forEach((n) => {
|
||||
var node = this.findNodeByName(n);
|
||||
if (!node) throw new Error(util.format('*** unknown waypoint node "%s"', n.trim()));
|
||||
waypoints.push({ coord: node, type: 'loc' });
|
||||
|
||||
});
|
||||
got = { waypoints: row.waypoints };
|
||||
|
||||
this.requestTable(waypoints, params, afterRequest);
|
||||
} else {
|
||||
throw new Error('*** no waypoints');
|
||||
}
|
||||
};
|
||||
|
||||
this.processRowsAndDiff(table, testRow, callback);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function tableParse(table, noRoute, annotation, format, callback) {
|
||||
|
||||
const parse = annotation == 'distances' ? distancesParse : (annotation == 'durations' ? durationsParse : estimatesParse);
|
||||
@@ -62,9 +122,6 @@ function tableParse(table, noRoute, annotation, format, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
var actual = [];
|
||||
actual.push(table.headers);
|
||||
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
// compute matrix
|
||||
|
||||
@@ -12,35 +12,43 @@ module.exports = function () {
|
||||
var inNode = this.findNodeByName(row.in);
|
||||
if (!inNode) throw new Error(util.format('*** unknown in-node "%s"', row.in));
|
||||
|
||||
var outNode = this.findNodeByName(row.out);
|
||||
if (!outNode) throw new Error(util.format('*** unknown out-node "%s"', row.out));
|
||||
|
||||
this.requestNearest(inNode, this.queryParams, (err, response) => {
|
||||
if (err) return cb(err);
|
||||
var coord;
|
||||
var headers = new Set(table.raw()[0]);
|
||||
|
||||
if (response.statusCode === 200 && response.body.length) {
|
||||
var got = { in: row.in};
|
||||
|
||||
if (response.body.length) {
|
||||
var json = JSON.parse(response.body);
|
||||
got.code = json.code;
|
||||
|
||||
coord = json.waypoints[0].location;
|
||||
if (response.statusCode === 200) {
|
||||
|
||||
var got = { in: row.in, out: row.out };
|
||||
|
||||
if (headers.has('data_version')) {
|
||||
got.data_version = json.data_version || '';
|
||||
}
|
||||
|
||||
Object.keys(row).forEach((key) => {
|
||||
if (key === 'out') {
|
||||
if (this.FuzzyMatch.matchLocation(coord, outNode)) {
|
||||
got[key] = row[key];
|
||||
} else {
|
||||
row[key] = util.format('%s [%d,%d]', row[key], outNode.lat, outNode.lon);
|
||||
}
|
||||
if (headers.has('data_version')) {
|
||||
got.data_version = json.data_version || '';
|
||||
}
|
||||
});
|
||||
|
||||
if (json.waypoints && json.waypoints.length && row.out) {
|
||||
coord = json.waypoints[0].location;
|
||||
|
||||
got.out = row.out;
|
||||
|
||||
var outNode = this.findNodeByName(row.out);
|
||||
if (!outNode) throw new Error(util.format('*** unknown out-node "%s"', row.out));
|
||||
|
||||
Object.keys(row).forEach((key) => {
|
||||
if (key === 'out') {
|
||||
if (this.FuzzyMatch.matchLocation(coord, outNode)) {
|
||||
got[key] = row[key];
|
||||
} else {
|
||||
row[key] = util.format('%s [%d,%d]', row[key], outNode.lat, outNode.lon);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
cb(null, got);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -33,6 +33,11 @@ module.exports = function () {
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Then(/^HTTP code should be (\d+)$/, (code, callback) => {
|
||||
assert(this.response.statusCode, parseInt(code));
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Then(/^status message should be "(.*?)"$/, (message, callback) => {
|
||||
try {
|
||||
this.json = JSON.parse(this.response.body);
|
||||
|
||||
@@ -91,7 +91,7 @@ module.exports = function () {
|
||||
|
||||
var encodedResult = '';
|
||||
|
||||
if (json.trips) row.trips.split(',').forEach((sub, si) => {
|
||||
if (json.trips && row.trips) row.trips.split(',').forEach((sub, si) => {
|
||||
if (si >= subTrips.length) {
|
||||
ok = false;
|
||||
} else {
|
||||
@@ -134,7 +134,6 @@ module.exports = function () {
|
||||
} else {
|
||||
var params = this.queryParams,
|
||||
waypoints = [];
|
||||
params['steps'] = 'true';
|
||||
if (row.from && row.to) {
|
||||
var fromNode = this.findNodeByName(row.from);
|
||||
if (!fromNode) throw new Error(util.format('*** unknown from-node "%s"', row.from));
|
||||
|
||||
@@ -280,10 +280,11 @@ module.exports = function () {
|
||||
};
|
||||
|
||||
this.reprocessAndLoadData = (callback) => {
|
||||
let p = {loaderArgs: this.loaderArgs, inputFile: this.processedCacheFile};
|
||||
let queue = d3.queue(1);
|
||||
queue.defer(this.writeAndLinkOSM.bind(this));
|
||||
queue.defer(this.extractContractPartitionAndCustomize.bind(this));
|
||||
queue.defer(this.osrmLoader.load.bind(this.osrmLoader), this.processedCacheFile);
|
||||
queue.defer(this.osrmLoader.load.bind(this.osrmLoader), p);
|
||||
queue.awaitAll(callback);
|
||||
};
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ module.exports = function () {
|
||||
this.setDefaultTimeout(this.TIMEOUT);
|
||||
this.ROOT_PATH = process.cwd();
|
||||
|
||||
this.USE_ROUTED_JS = process.env.OSRM_USE_ROUTED_JS || false;
|
||||
|
||||
this.TEST_PATH = path.resolve(this.ROOT_PATH, 'test');
|
||||
this.CACHE_PATH = path.resolve(this.TEST_PATH, 'cache');
|
||||
this.LOGS_PATH = path.resolve(this.TEST_PATH, 'logs');
|
||||
@@ -27,7 +29,8 @@ module.exports = function () {
|
||||
this.DEFAULT_ENVIRONMENT = process.env;
|
||||
this.DEFAULT_PROFILE = 'bicycle';
|
||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||
this.DEFAULT_LOAD_METHOD = process.argv[process.argv.indexOf('-m') +1].match('mmap') ? 'mmap' : 'datastore';
|
||||
let loadMethod = process.argv[process.argv.indexOf('-m') +1];
|
||||
this.DEFAULT_LOAD_METHOD = loadMethod.match('mmap') ? 'mmap' : loadMethod.match('directly') ? 'directly' : 'datastore';
|
||||
this.DEFAULT_ORIGIN = [1,1];
|
||||
this.OSM_USER = 'osrm';
|
||||
this.OSM_UID = 1;
|
||||
@@ -40,9 +43,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_RETRIES = process.env.OSRM_CONNECTION_RETRIES && parseInt(process.env.OSRM_CONNECTION_RETRIES) || 100;
|
||||
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;
|
||||
|
||||
@@ -37,6 +37,7 @@ module.exports = function () {
|
||||
this.contractArgs = '';
|
||||
this.partitionArgs = '';
|
||||
this.customizeArgs = '';
|
||||
this.loaderArgs = '';
|
||||
this.environment = Object.assign(this.DEFAULT_ENVIRONMENT);
|
||||
this.resetOSM();
|
||||
|
||||
|
||||
@@ -101,7 +101,8 @@ module.exports = function () {
|
||||
|
||||
this.requestTrip = (waypoints, userParams, callback) => {
|
||||
var defaults = {
|
||||
output: 'json'
|
||||
output: 'json',
|
||||
steps: 'true'
|
||||
},
|
||||
params = this.overwriteParams(defaults, userParams);
|
||||
|
||||
|
||||
@@ -39,7 +39,11 @@ module.exports = function () {
|
||||
|
||||
this.runBin = (bin, options, env, callback) => {
|
||||
let cmd = path.resolve(util.format('%s/%s%s', this.BIN_PATH, bin, this.EXE));
|
||||
if (this.USE_ROUTED_JS && bin === 'osrm-routed') {
|
||||
cmd = 'osrm-routed-js';
|
||||
}
|
||||
let opts = options.split(' ').filter((x) => { return x && x.length > 0; });
|
||||
|
||||
let log = fs.createWriteStream(this.scenarioLogFile, {'flags': 'a'});
|
||||
log.write(util.format('*** running %s %s\n', cmd, options));
|
||||
// we need to set a large maxbuffer here because we have long running processes like osrm-routed
|
||||
|
||||
@@ -40,7 +40,7 @@ Feature: Alternative route
|
||||
| 7 | 8 | ca,ab,bd,dc,ca,ca | |
|
||||
|
||||
|
||||
@mld-only
|
||||
@mld
|
||||
Scenario: Alternative loop paths on a single node with an asymmetric circle
|
||||
# The test checks only MLD implementation, alternatives results are unpredictable for CH on windows (#4691, #4693)
|
||||
Given a grid size of 10 meters
|
||||
|
||||
@@ -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.987618946:299.962882039 | 25:30 | 1:2:3 |
|
||||
| a | c | abc,abc | 10:10 | 249.9876189:299.962882 +- 1e-7 | 25:30 | 1:2:3 |
|
||||
@@ -80,7 +80,7 @@ Feature: Testbot - Exclude flags
|
||||
| a | c | |
|
||||
| a | f | |
|
||||
| f | d | fg,gd,gd |
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - exclude with unsupported exclude combination
|
||||
Given the query options
|
||||
| exclude | TwoWords2 |
|
||||
@@ -88,7 +88,7 @@ Feature: Testbot - Exclude flags
|
||||
When I route I should get
|
||||
| from | to | status | message |
|
||||
| a | d | 400 | Exclude flag combination is not supported. |
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - exclude with invalid exclude class name
|
||||
Given the query options
|
||||
| exclude | foo |
|
||||
|
||||
@@ -32,6 +32,7 @@ Feature: Ways of loading data
|
||||
Then stderr should be empty
|
||||
And it should exit successfully
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: osrm-datastore - Fail if no shared memory blocks are loaded
|
||||
When I run "osrm-datastore --spring-clean" with input "Y"
|
||||
And I try to run "osrm-routed --shared-memory=1"
|
||||
|
||||
@@ -563,6 +563,7 @@ Feature: Basic Map Matching
|
||||
| trace | timestamps | code |
|
||||
| abcd | 0 1 62 63 | NoMatch |
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - Map matching invalid waypoints
|
||||
Given the node map
|
||||
"""
|
||||
@@ -580,6 +581,7 @@ Feature: Basic Map Matching
|
||||
| trace | code |
|
||||
| abcd | InvalidOptions |
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Matching fail with waypoints param missing start/end
|
||||
Given the node map
|
||||
"""
|
||||
@@ -788,7 +790,7 @@ Feature: Basic Map Matching
|
||||
| 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
|
||||
@match @testbot @skip_on_routed_js
|
||||
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
@@ -810,6 +812,6 @@ 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.000314,1 | 14.914666491 | 1.4 | 1.4 | 1.4 |
|
||||
| 4321 | 1.00027,1,1.000135,1 | 15.025969972 | 1.5 | 1.5 | 1.5 |
|
||||
| 2345 | 1.00018,1,1.000314,1 | 14.91466649 | 1.4 | 1.4 | 1.4 |
|
||||
| 4321 | 1.00027,1,1.000135,1 | 15.02596997 | 1.5 | 1.5 | 1.5 |
|
||||
|
||||
|
||||
@@ -570,7 +570,8 @@ Feature: Snapping at intersections
|
||||
| a,f,k | ac,cf,cf,fj,kj,kj | 132.8s | 132.8 |
|
||||
| k,f | ik,fi,fi | 54.3s | 54.3 |
|
||||
| f,a | ef,ae,ae | 66.6s | 66.6 |
|
||||
| k,f,a | kj,fj,fj,ef,ae,ae | 141.399999999s | 141.399999999 |
|
||||
| k,f,a | kj,fj,fj,ef,ae,ae | 141.4s +- 1e-7 | 141.4 +- 1e-7 |
|
||||
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f | k |
|
||||
@@ -626,4 +627,4 @@ Feature: Snapping at intersections
|
||||
| a,f,k | ad,df,df,fj,kj,kj | 105.6s | 105.6 |
|
||||
| k,f | ik,fi,fi | 54.3s | 54.3 |
|
||||
| f,a | ef,ae,ae | 66.6s | 66.6 |
|
||||
| k,f,a | ik,fi,fi,ef,ae,ae | 120.899999999s | 120.899999999 |
|
||||
| k,f,a | ik,fi,fi,ef,ae,ae | 120.9s +- 1e-7 | 120.9 +- 1e-7 |
|
||||
|
||||
@@ -18,7 +18,7 @@ Feature: Status messages
|
||||
| from | to | route | status | message |
|
||||
| a | b | ab,ab | 200 | |
|
||||
| b | a | ab,ab | 200 | |
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: No route found
|
||||
Given the node map
|
||||
"""
|
||||
@@ -39,6 +39,7 @@ Feature: Status messages
|
||||
| a | c | | 400 | Impossible route between points |
|
||||
| b | d | | 400 | Impossible route between points |
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Malformed requests
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
|
||||
@@ -4,7 +4,8 @@ Feature: Basic trip planning
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - Trip: Invalid options (like was in test suite for a long time)
|
||||
Given the node map
|
||||
"""
|
||||
@@ -222,7 +223,7 @@ Feature: Basic trip planning
|
||||
| waypoints | trips | roundtrip | durations |
|
||||
| a,b,c,d,e,f,g,h,i,j,k,l | lkjihgfedcbal | true | 22 |
|
||||
| a,b,c,d,e,f,g,h,i,j,k,l | cbakjihgfedl | false | 19 |
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - Trip: Unroutable roundtrip with waypoints (less than 10)
|
||||
Given the node map
|
||||
"""
|
||||
@@ -240,7 +241,7 @@ Feature: Basic trip planning
|
||||
| waypoints | status | message |
|
||||
| a,b,c,d | NoTrips | No trip visiting all destinations possible. |
|
||||
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - Trip: Unroutable roundtrip with waypoints (more than 10)
|
||||
Given the node map
|
||||
"""
|
||||
@@ -278,6 +279,7 @@ Feature: Basic trip planning
|
||||
| a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p | NoTrips | No trip visiting all destinations possible. |
|
||||
|
||||
# Test TFSE
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - Trip: TFSE with errors
|
||||
Given the node map
|
||||
"""
|
||||
@@ -371,7 +373,7 @@ Feature: Basic trip planning
|
||||
| waypoints | source | destination | roundtrip | trips |
|
||||
| a,b,d,e,c | first | last | true | abedca |
|
||||
|
||||
|
||||
@skip_on_routed_js
|
||||
Scenario: Testbot - Trip: midway points in isolated roads should return no trips
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
@@ -52,11 +52,11 @@ Feature: Weight tests
|
||||
| abc |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | distances | weights | times | a:distance | a:duration | a:weight | a:speed |
|
||||
| s,t | abc,abc | 20m,0m | 2,0 | 2s,0s | 20.034626629 | 2 | 2 | 10 |
|
||||
| t,s | abc,abc | 20m,0m | 2,0 | 2s,0s | 20.034626629 | 2 | 2 | 10 |
|
||||
| s,e | abc,abc | 40m,0m | 3.9,0 | 3.9s,0s | 29.940636463:10.017313314 | 3:0.9 | 3:0.9 | 10:11.1 |
|
||||
| e,s | abc,abc | 40m,0m | 3.9,0 | 3.9s,0s | 10.017313314:29.940636463 | 0.9:3 | 0.9:3 | 11.1:10 |
|
||||
| waypoints | route | distances | weights | times | a:distance | a:duration | a:weight | a:speed |
|
||||
| s,t | abc,abc | 20m,0m | 2,0 | 2s,0s | 20.03462663 +- 1e-7 | 2 | 2 | 10 |
|
||||
| t,s | abc,abc | 20m,0m | 2,0 | 2s,0s | 20.03462663 +- 1e-7 | 2 | 2 | 10 |
|
||||
| s,e | abc,abc | 40m,0m | 3.9,0 | 3.9s,0s | 29.94063646:10.01731331 +- 1e-7 | 3:0.9 | 3:0.9 | 10:11.1 |
|
||||
| e,s | abc,abc | 40m,0m | 3.9,0 | 3.9s,0s | 10.01731331:29.94063646 +- 1e-7 | 0.9:3 | 0.9:3 | 11.1:10 |
|
||||
|
||||
|
||||
Scenario: Step weights -- way_function: fail if no weight or weight_per_meter property
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
Feature: Tile service
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
Scenario: Smoke test
|
||||
Given the origin 52.5212,13.3919
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
And the ways
|
||||
| nodes |
|
||||
| ab |
|
||||
When I request /tile/v1/testbot/tile(8800,5373,14).mvt
|
||||
Then HTTP code should be 200
|
||||
@@ -7,9 +7,7 @@
|
||||
#include "contractor/graph_contractor_adaptors.hpp"
|
||||
#include "contractor/query_graph.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
using GraphAndFilter = std::tuple<QueryGraph, std::vector<std::vector<bool>>>;
|
||||
@@ -94,7 +92,6 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
|
||||
return GraphAndFilter{QueryGraph{num_nodes, edge_container.edges},
|
||||
edge_container.MakeEdgeFilters()};
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
struct ContractedEdgeContainer
|
||||
@@ -164,7 +162,6 @@ struct ContractedEdgeContainer
|
||||
std::vector<MergedFlags> flags;
|
||||
std::vector<QueryEdge> edges;
|
||||
};
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
|
||||
#include "contractor/query_graph.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
namespace detail
|
||||
@@ -19,7 +17,6 @@ template <storage::Ownership Ownership> struct ContractedMetric
|
||||
|
||||
using ContractedMetric = detail::ContractedMetric<storage::Ownership::Container>;
|
||||
using ContractedMetricView = detail::ContractedMetric<storage::Ownership::View>;
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,9 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "contractor/contractor_config.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
/// Base class of osrm-contract
|
||||
@@ -49,7 +47,6 @@ class Contractor
|
||||
private:
|
||||
ContractorConfig config;
|
||||
};
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // PROCESSING_CHAIN_HPP
|
||||
|
||||
@@ -35,9 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
struct ContractorConfig final : storage::IOConfig
|
||||
@@ -71,7 +69,6 @@ struct ContractorConfig final : storage::IOConfig
|
||||
//(e.g. 0.8 contracts 80 percent of the hierarchy, leaving a core of 20%)
|
||||
double core_factor = 1.0;
|
||||
};
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // EXTRACTOR_OPTIONS_HPP
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include "util/dynamic_graph.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
struct ContractorEdgeData
|
||||
@@ -42,7 +40,6 @@ struct ContractorEdgeData
|
||||
using ContractorGraph = util::DynamicGraph<ContractorEdgeData>;
|
||||
using ContractorEdge = ContractorGraph::InputEdge;
|
||||
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
#include "util/typedefs.hpp"
|
||||
#include "util/xor_fast_hash_storage.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
struct ContractorHeapData
|
||||
{
|
||||
@@ -24,7 +22,6 @@ using ContractorHeap = util::QueryHeap<NodeID,
|
||||
ContractorHeapData,
|
||||
util::XORFastHashStorage<NodeID, NodeID>>;
|
||||
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
void search(ContractorHeap &heap,
|
||||
@@ -20,7 +18,6 @@ void search(ContractorHeap &heap,
|
||||
const EdgeWeight weight_limit,
|
||||
const NodeID forbidden_node);
|
||||
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // OSRM_CONTRACTOR_DIJKSTRA_HPP
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
class IteratorbasedCRC32
|
||||
@@ -125,7 +123,6 @@ struct RangebasedCRC32
|
||||
private:
|
||||
IteratorbasedCRC32 crc32;
|
||||
};
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif /* ITERATOR_BASED_CRC32_H */
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
{
|
||||
namespace files
|
||||
namespace osrm::contractor::files
|
||||
{
|
||||
// reads .osrm.hsgr file
|
||||
template <typename ContractedMetricT>
|
||||
@@ -52,8 +48,6 @@ inline void writeGraph(const boost::filesystem::path &path,
|
||||
serialization::write(writer, "/ch/metrics/" + pair.first, pair.second);
|
||||
}
|
||||
}
|
||||
} // namespace files
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor::files
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
std::vector<bool> contractGraph(ContractorGraph &graph,
|
||||
@@ -37,7 +35,6 @@ inline auto contractGraph(ContractorGraph &graph,
|
||||
graph, {}, std::move(node_is_contractable), std::move(node_weights), core_factor);
|
||||
}
|
||||
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
// Make sure to move in the input edge list!
|
||||
@@ -177,7 +175,6 @@ template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT g
|
||||
return edges;
|
||||
}
|
||||
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // OSRM_CONTRACTOR_GRAPH_CONTRACTION_ADAPTORS_HPP_
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
|
||||
#include <tuple>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
struct QueryEdge
|
||||
@@ -77,7 +75,6 @@ struct QueryEdge
|
||||
data.distance == right.data.distance);
|
||||
}
|
||||
};
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // QUERYEDGE_HPP
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
#include "util/static_graph.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
namespace osrm::contractor
|
||||
{
|
||||
|
||||
namespace detail
|
||||
@@ -19,7 +17,6 @@ using QueryGraph = util::StaticGraph<typename QueryEdge::EdgeData, Ownership>;
|
||||
|
||||
using QueryGraph = detail::QueryGraph<storage::Ownership::Container>;
|
||||
using QueryGraphView = detail::QueryGraph<storage::Ownership::View>;
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor
|
||||
|
||||
#endif // QUERYEDGE_HPP
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
#include "storage/serialization.hpp"
|
||||
#include "storage/tar.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace contractor
|
||||
{
|
||||
namespace serialization
|
||||
namespace osrm::contractor::serialization
|
||||
{
|
||||
|
||||
template <storage::Ownership Ownership>
|
||||
@@ -46,8 +42,6 @@ void read(storage::tar::FileReader &reader,
|
||||
metric.edge_filter[index]);
|
||||
}
|
||||
}
|
||||
} // namespace serialization
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
} // namespace osrm::contractor::serialization
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
namespace osrm::customizer
|
||||
{
|
||||
|
||||
class CellCustomizer
|
||||
@@ -235,7 +233,6 @@ class CellCustomizer
|
||||
|
||||
const partitioner::MultiLevelPartition &partition;
|
||||
};
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
} // namespace osrm::customizer
|
||||
|
||||
#endif // OSRM_CELLS_CUSTOMIZER_HPP
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
#include "util/typedefs.hpp"
|
||||
#include "util/vector_view.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
namespace osrm::customizer
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -26,7 +24,6 @@ template <storage::Ownership Ownership> struct CellMetricImpl
|
||||
|
||||
using CellMetric = detail::CellMetricImpl<storage::Ownership::Container>;
|
||||
using CellMetricView = detail::CellMetricImpl<storage::Ownership::View>;
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
} // namespace osrm::customizer
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
|
||||
#include "customizer/customizer_config.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
namespace osrm::customizer
|
||||
{
|
||||
|
||||
class Customizer
|
||||
@@ -14,7 +12,6 @@ class Customizer
|
||||
int Run(const CustomizationConfig &config);
|
||||
};
|
||||
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
} // namespace osrm::customizer
|
||||
|
||||
#endif // OSRM_CUSTOMIZE_CUSTOMIZER_HPP
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
#include "storage/io_config.hpp"
|
||||
#include "updater/updater_config.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
namespace osrm::customizer
|
||||
{
|
||||
|
||||
struct CustomizationConfig final : storage::IOConfig
|
||||
@@ -39,7 +37,6 @@ struct CustomizationConfig final : storage::IOConfig
|
||||
|
||||
updater::UpdaterConfig updater_config;
|
||||
};
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
} // namespace osrm::customizer
|
||||
|
||||
#endif // OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
namespace osrm::customizer
|
||||
{
|
||||
|
||||
struct EdgeBasedGraphEdgeData
|
||||
@@ -126,7 +124,6 @@ using MultiLevelEdgeBasedGraph =
|
||||
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
||||
using MultiLevelEdgeBasedGraphView =
|
||||
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
|
||||
} // namespace customizer
|
||||
} // namespace osrm
|
||||
} // namespace osrm::customizer
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
{
|
||||
namespace files
|
||||
namespace osrm::customizer::files
|
||||
{
|
||||
|
||||
// reads .osrm.cell_metrics file
|
||||
@@ -106,8 +102,6 @@ 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
|
||||
} // namespace osrm::customizer::files
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
#include "storage/shared_memory_ownership.hpp"
|
||||
#include "storage/tar.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace customizer
|
||||
{
|
||||
namespace serialization
|
||||
namespace osrm::customizer::serialization
|
||||
{
|
||||
|
||||
template <storage::Ownership Ownership>
|
||||
@@ -65,8 +61,6 @@ 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
|
||||
} // namespace osrm::customizer::serialization
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
// Contraction Hiearchy
|
||||
@@ -111,8 +107,6 @@ 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
|
||||
} // namespace osrm::engine::routing_algorithms
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,11 +18,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
static const constexpr char *INTERSECTION_DELIMITER = " / ";
|
||||
@@ -57,8 +53,8 @@ class BaseAPI
|
||||
{
|
||||
// TODO: check forward/reverse
|
||||
const auto toName = [this](const auto &phantom) {
|
||||
return facade.GetNameForID(facade.GetNameIndex(phantom.forward_segment_id.id))
|
||||
.to_string();
|
||||
return std::string(
|
||||
facade.GetNameForID(facade.GetNameIndex(phantom.forward_segment_id.id)));
|
||||
};
|
||||
const auto noEmpty = [](const auto &name) { return !name.empty(); };
|
||||
|
||||
@@ -128,8 +124,8 @@ class BaseAPI
|
||||
static_cast<float>(static_cast<double>(util::toFloating(snapped_location.lat))));
|
||||
|
||||
const auto toName = [this](const auto &phantom) {
|
||||
return facade.GetNameForID(facade.GetNameIndex(phantom.forward_segment_id.id))
|
||||
.to_string();
|
||||
return std::string(
|
||||
facade.GetNameForID(facade.GetNameIndex(phantom.forward_segment_id.id)));
|
||||
};
|
||||
const auto noEmpty = [](const auto &name) { return !name.empty(); };
|
||||
|
||||
@@ -170,8 +166,6 @@ class BaseAPI
|
||||
const BaseParameters ¶meters;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,11 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -124,8 +120,6 @@ struct BaseParameters
|
||||
});
|
||||
}
|
||||
};
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif // ROUTE_PARAMETERS_HPP
|
||||
|
||||
@@ -8,16 +8,10 @@
|
||||
|
||||
#include "util/json_container.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
using ResultT =
|
||||
mapbox::util::variant<util::json::Object, std::string, flatbuffers::FlatBufferBuilder>;
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
namespace osrm {
|
||||
namespace engine {
|
||||
namespace api {
|
||||
namespace fbresult {
|
||||
namespace osrm::engine::api::fbresult {
|
||||
|
||||
struct Position;
|
||||
|
||||
@@ -219,7 +216,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Uint64Pair FLATBUFFERS_FINAL_CLASS {
|
||||
FLATBUFFERS_STRUCT_END(Uint64Pair, 16);
|
||||
|
||||
struct WaypointT : public flatbuffers::NativeTable {
|
||||
typedef Waypoint TableType;
|
||||
using TableType = Waypoint;
|
||||
std::string hint;
|
||||
float distance;
|
||||
std::string name;
|
||||
@@ -239,7 +236,7 @@ struct WaypointT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Waypoint FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef WaypointT NativeTableType;
|
||||
using NativeTableType = WaypointT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_HINT = 4,
|
||||
VT_DISTANCE = 6,
|
||||
@@ -393,14 +390,14 @@ inline flatbuffers::Offset<Waypoint> CreateWaypointDirect(
|
||||
flatbuffers::Offset<Waypoint> CreateWaypoint(flatbuffers::FlatBufferBuilder &_fbb, const WaypointT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct MetadataT : public flatbuffers::NativeTable {
|
||||
typedef Metadata TableType;
|
||||
using TableType = Metadata;
|
||||
std::vector<std::string> datasource_names;
|
||||
MetadataT() {
|
||||
}
|
||||
};
|
||||
|
||||
struct Metadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef MetadataT NativeTableType;
|
||||
using NativeTableType = MetadataT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_DATASOURCE_NAMES = 4
|
||||
};
|
||||
@@ -457,7 +454,7 @@ inline flatbuffers::Offset<Metadata> CreateMetadataDirect(
|
||||
flatbuffers::Offset<Metadata> CreateMetadata(flatbuffers::FlatBufferBuilder &_fbb, const MetadataT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct AnnotationT : public flatbuffers::NativeTable {
|
||||
typedef Annotation TableType;
|
||||
using TableType = Annotation;
|
||||
std::vector<uint32_t> distance;
|
||||
std::vector<uint32_t> duration;
|
||||
std::vector<uint32_t> datasources;
|
||||
@@ -470,7 +467,7 @@ struct AnnotationT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef AnnotationT NativeTableType;
|
||||
using NativeTableType = AnnotationT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_DISTANCE = 4,
|
||||
VT_DURATION = 6,
|
||||
@@ -609,7 +606,7 @@ inline flatbuffers::Offset<Annotation> CreateAnnotationDirect(
|
||||
flatbuffers::Offset<Annotation> CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct StepManeuverT : public flatbuffers::NativeTable {
|
||||
typedef StepManeuver TableType;
|
||||
using TableType = StepManeuver;
|
||||
std::unique_ptr<osrm::engine::api::fbresult::Position> location;
|
||||
uint16_t bearing_before;
|
||||
uint16_t bearing_after;
|
||||
@@ -626,7 +623,7 @@ struct StepManeuverT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct StepManeuver FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef StepManeuverT NativeTableType;
|
||||
using NativeTableType = StepManeuverT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_LOCATION = 4,
|
||||
VT_BEARING_BEFORE = 6,
|
||||
@@ -722,7 +719,7 @@ inline flatbuffers::Offset<StepManeuver> CreateStepManeuver(
|
||||
flatbuffers::Offset<StepManeuver> CreateStepManeuver(flatbuffers::FlatBufferBuilder &_fbb, const StepManeuverT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct LaneT : public flatbuffers::NativeTable {
|
||||
typedef Lane TableType;
|
||||
using TableType = Lane;
|
||||
std::vector<osrm::engine::api::fbresult::Turn> indications;
|
||||
bool valid;
|
||||
LaneT()
|
||||
@@ -731,7 +728,7 @@ struct LaneT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Lane FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef LaneT NativeTableType;
|
||||
using NativeTableType = LaneT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_INDICATIONS = 4,
|
||||
VT_VALID = 6
|
||||
@@ -799,7 +796,7 @@ inline flatbuffers::Offset<Lane> CreateLaneDirect(
|
||||
flatbuffers::Offset<Lane> CreateLane(flatbuffers::FlatBufferBuilder &_fbb, const LaneT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct IntersectionT : public flatbuffers::NativeTable {
|
||||
typedef Intersection TableType;
|
||||
using TableType = Intersection;
|
||||
std::unique_ptr<osrm::engine::api::fbresult::Position> location;
|
||||
std::vector<int16_t> bearings;
|
||||
std::vector<std::string> classes;
|
||||
@@ -814,7 +811,7 @@ struct IntersectionT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Intersection FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef IntersectionT NativeTableType;
|
||||
using NativeTableType = IntersectionT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_LOCATION = 4,
|
||||
VT_BEARINGS = 6,
|
||||
@@ -950,7 +947,7 @@ inline flatbuffers::Offset<Intersection> CreateIntersectionDirect(
|
||||
flatbuffers::Offset<Intersection> CreateIntersection(flatbuffers::FlatBufferBuilder &_fbb, const IntersectionT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct StepT : public flatbuffers::NativeTable {
|
||||
typedef Step TableType;
|
||||
using TableType = Step;
|
||||
float distance;
|
||||
float duration;
|
||||
std::string polyline;
|
||||
@@ -976,7 +973,7 @@ struct StepT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Step FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef StepT NativeTableType;
|
||||
using NativeTableType = StepT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_DISTANCE = 4,
|
||||
VT_DURATION = 6,
|
||||
@@ -1234,7 +1231,7 @@ inline flatbuffers::Offset<Step> CreateStepDirect(
|
||||
flatbuffers::Offset<Step> CreateStep(flatbuffers::FlatBufferBuilder &_fbb, const StepT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct LegT : public flatbuffers::NativeTable {
|
||||
typedef Leg TableType;
|
||||
using TableType = Leg;
|
||||
double distance;
|
||||
double duration;
|
||||
double weight;
|
||||
@@ -1249,7 +1246,7 @@ struct LegT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Leg FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef LegT NativeTableType;
|
||||
using NativeTableType = LegT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_DISTANCE = 4,
|
||||
VT_DURATION = 6,
|
||||
@@ -1369,7 +1366,7 @@ inline flatbuffers::Offset<Leg> CreateLegDirect(
|
||||
flatbuffers::Offset<Leg> CreateLeg(flatbuffers::FlatBufferBuilder &_fbb, const LegT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct RouteObjectT : public flatbuffers::NativeTable {
|
||||
typedef RouteObject TableType;
|
||||
using TableType = RouteObject;
|
||||
float distance;
|
||||
float duration;
|
||||
float weight;
|
||||
@@ -1387,7 +1384,7 @@ struct RouteObjectT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct RouteObject FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef RouteObjectT NativeTableType;
|
||||
using NativeTableType = RouteObjectT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_DISTANCE = 4,
|
||||
VT_DURATION = 6,
|
||||
@@ -1534,7 +1531,7 @@ inline flatbuffers::Offset<RouteObject> CreateRouteObjectDirect(
|
||||
flatbuffers::Offset<RouteObject> CreateRouteObject(flatbuffers::FlatBufferBuilder &_fbb, const RouteObjectT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct TableT : public flatbuffers::NativeTable {
|
||||
typedef Table TableType;
|
||||
using TableType = Table;
|
||||
std::vector<float> durations;
|
||||
uint16_t rows;
|
||||
uint16_t cols;
|
||||
@@ -1548,7 +1545,7 @@ struct TableT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Table FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef TableT NativeTableType;
|
||||
using NativeTableType = TableT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_DURATIONS = 4,
|
||||
VT_ROWS = 6,
|
||||
@@ -1671,7 +1668,7 @@ inline flatbuffers::Offset<Table> CreateTableDirect(
|
||||
flatbuffers::Offset<Table> CreateTable(flatbuffers::FlatBufferBuilder &_fbb, const TableT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct ErrorT : public flatbuffers::NativeTable {
|
||||
typedef Error TableType;
|
||||
using TableType = Error;
|
||||
std::string code;
|
||||
std::string message;
|
||||
ErrorT() {
|
||||
@@ -1679,7 +1676,7 @@ struct ErrorT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct Error FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef ErrorT NativeTableType;
|
||||
using NativeTableType = ErrorT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_CODE = 4,
|
||||
VT_MESSAGE = 6
|
||||
@@ -1749,7 +1746,7 @@ inline flatbuffers::Offset<Error> CreateErrorDirect(
|
||||
flatbuffers::Offset<Error> CreateError(flatbuffers::FlatBufferBuilder &_fbb, const ErrorT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
struct FBResultT : public flatbuffers::NativeTable {
|
||||
typedef FBResult TableType;
|
||||
using TableType = FBResult;
|
||||
bool error;
|
||||
std::unique_ptr<osrm::engine::api::fbresult::ErrorT> code;
|
||||
std::string data_version;
|
||||
@@ -1762,7 +1759,7 @@ struct FBResultT : public flatbuffers::NativeTable {
|
||||
};
|
||||
|
||||
struct FBResult FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef FBResultT NativeTableType;
|
||||
using NativeTableType = FBResultT;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_ERROR = 4,
|
||||
VT_CODE = 6,
|
||||
@@ -2431,9 +2428,6 @@ inline std::unique_ptr<osrm::engine::api::fbresult::FBResultT> UnPackSizePrefixe
|
||||
return std::unique_ptr<osrm::engine::api::fbresult::FBResultT>(GetSizePrefixedFBResult(buf)->UnPack(res));
|
||||
}
|
||||
|
||||
} // namespace fbresult
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_FBRESULT_OSRM_ENGINE_API_FBRESULT_H_
|
||||
|
||||
@@ -19,16 +19,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
struct Hint;
|
||||
|
||||
namespace api
|
||||
{
|
||||
namespace json
|
||||
namespace api::json
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -112,9 +108,7 @@ 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
|
||||
} // namespace api::json
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif // ENGINE_GUIDANCE_API_RESPONSE_GENERATOR_HPP_
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
|
||||
#include "util/integer_range.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
class MatchAPI final : public RouteAPI
|
||||
@@ -253,8 +249,6 @@ class MatchAPI final : public RouteAPI
|
||||
const tidy::Result &tidy_result;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,11 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -98,8 +94,6 @@ struct MatchParameters : public RouteParameters
|
||||
(timestamps.empty() || timestamps.size() == coordinates.size());
|
||||
}
|
||||
};
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,13 +11,7 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/dynamic_bitset.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
{
|
||||
namespace tidy
|
||||
namespace osrm::engine::api::tidy
|
||||
{
|
||||
|
||||
struct Thresholds
|
||||
@@ -200,9 +194,6 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5})
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace tidy
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api::tidy
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
class NearestAPI final : public BaseAPI
|
||||
@@ -164,8 +160,6 @@ class NearestAPI final : public BaseAPI
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,11 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "engine/api/base_parameters.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -52,8 +48,6 @@ struct NearestParameters : public BaseParameters
|
||||
|
||||
bool IsValid() const { return BaseParameters::IsValid() && number_of_results >= 1; }
|
||||
};
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif // ENGINE_API_NEAREST_PARAMETERS_HPP
|
||||
|
||||
@@ -31,11 +31,7 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
class RouteAPI : public BaseAPI
|
||||
@@ -1001,8 +997,6 @@ class RouteAPI : public BaseAPI
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,11 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -206,13 +202,11 @@ inline RouteParameters::AnnotationsType operator|(RouteParameters::AnnotationsTy
|
||||
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
|
||||
}
|
||||
|
||||
inline RouteParameters::AnnotationsType operator|=(RouteParameters::AnnotationsType lhs,
|
||||
RouteParameters::AnnotationsType rhs)
|
||||
inline RouteParameters::AnnotationsType &operator|=(RouteParameters::AnnotationsType &lhs,
|
||||
RouteParameters::AnnotationsType rhs)
|
||||
{
|
||||
return lhs = lhs | rhs;
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,11 +22,7 @@
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
class TableAPI final : public BaseAPI
|
||||
@@ -422,8 +418,6 @@ class TableAPI final : public BaseAPI
|
||||
const TableParameters ¶meters;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,11 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -166,8 +162,6 @@ inline TableParameters::AnnotationsType &operator|=(TableParameters::Annotations
|
||||
{
|
||||
return lhs = lhs | rhs;
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif // ENGINE_API_TABLE_PARAMETERS_HPP
|
||||
|
||||
@@ -30,11 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -70,8 +66,6 @@ struct TileParameters final
|
||||
return valid_x && valid_y && valid_z;
|
||||
}
|
||||
};
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
|
||||
#include "util/integer_range.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
class TripAPI final : public RouteAPI
|
||||
@@ -180,8 +176,6 @@ class TripAPI final : public RouteAPI
|
||||
const TripParameters ¶meters;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <boost/optional.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
namespace osrm::engine::api
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -76,8 +72,6 @@ struct TripParameters : public RouteParameters
|
||||
|
||||
bool IsValid() const { return RouteParameters::IsValid(); }
|
||||
};
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::api
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,9 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
enum class Approach : std::uint8_t
|
||||
@@ -41,6 +39,5 @@ enum class Approach : std::uint8_t
|
||||
UNRESTRICTED = 1
|
||||
|
||||
};
|
||||
}
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
#endif
|
||||
|
||||
@@ -28,9 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef OSRM_ENGINE_BEARING_HPP
|
||||
#define OSRM_ENGINE_BEARING_HPP
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
struct Bearing
|
||||
@@ -46,7 +44,6 @@ inline bool operator==(const Bearing lhs, const Bearing rhs)
|
||||
return lhs.bearing == rhs.bearing && lhs.range == rhs.range;
|
||||
}
|
||||
inline bool operator!=(const Bearing lhs, const Bearing rhs) { return !(lhs == rhs); }
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
namespace detail
|
||||
@@ -149,7 +147,6 @@ class DataWatchdogImpl<AlgorithmT, datafacade::ContiguousInternalMemoryDataFacad
|
||||
// once a new dataset arrives.
|
||||
template <typename AlgorithmT, template <typename A> class FacadeT>
|
||||
using DataWatchdog = detail::DataWatchdogImpl<AlgorithmT, FacadeT<AlgorithmT>>;
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,15 +3,12 @@
|
||||
|
||||
#include "engine/datafacade/contiguous_internalmem_datafacade.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
using DataFacadeBase = datafacade::ContiguousInternalMemoryDataFacadeBase;
|
||||
template <typename AlgorithmT>
|
||||
using DataFacade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
#include "util/filtered_graph.hpp"
|
||||
#include "util/integer_range.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
// Namespace local aliases for algorithms
|
||||
@@ -109,8 +105,6 @@ template <> class AlgorithmDataFacade<MLD>
|
||||
virtual EdgeID FindEdge(const NodeID edge_based_node_from,
|
||||
const NodeID edge_based_node_to) const = 0;
|
||||
};
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::datafacade
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
|
||||
#include "storage/shared_data_index.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
class ContiguousBlockAllocator
|
||||
@@ -19,8 +15,6 @@ class ContiguousBlockAllocator
|
||||
virtual const storage::SharedDataIndex &GetIndex() = 0;
|
||||
};
|
||||
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::datafacade
|
||||
|
||||
#endif // OSRM_ENGINE_DATAFACADE_CONTIGUOUS_BLOCK_ALLOCATOR_HPP_
|
||||
|
||||
@@ -28,13 +28,29 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
static const std::string DATASET_TURN_DATA = "TurnData";
|
||||
static const std::string DATASET_TURN_LANE_DATA = "NameLaneData";
|
||||
static const std::string DATASET_NAME_DATA = "NameData";
|
||||
static const std::string DATASET_INTERSECTION_BEARINGS = "IntersectionBearings";
|
||||
static const std::string DATASET_ENTRY_CLASS = "EntryClass";
|
||||
|
||||
/**
|
||||
* Macro is not ideal. But without it we either have to:
|
||||
* a) Write this boiler-plate for every usage of an optional dataset.
|
||||
* b) Convert to a function and add lots of polluting NOLINT(bugprone-unchecked-optional-access)
|
||||
* comments. This macro keeps the API code readable.
|
||||
*/
|
||||
#define CHECK_DATASET_DISABLED(val, dataset) \
|
||||
{ \
|
||||
if (!(val)) \
|
||||
{ \
|
||||
throw osrm::util::DisabledDatasetException((dataset)); \
|
||||
} \
|
||||
}
|
||||
|
||||
template <typename AlgorithmT> class ContiguousInternalMemoryAlgorithmDataFacade;
|
||||
|
||||
template <>
|
||||
@@ -142,21 +158,18 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
extractor::Datasources *m_datasources;
|
||||
|
||||
std::uint32_t m_check_sum;
|
||||
StringView m_data_timestamp;
|
||||
std::string_view m_data_timestamp;
|
||||
util::vector_view<util::Coordinate> m_coordinate_list;
|
||||
extractor::PackedOSMIDsView m_osmnodeid_list;
|
||||
util::vector_view<std::uint32_t> m_lane_description_offsets;
|
||||
util::vector_view<extractor::TurnLaneType::Mask> m_lane_description_masks;
|
||||
std::optional<util::vector_view<std::uint32_t>> m_lane_description_offsets;
|
||||
std::optional<util::vector_view<extractor::TurnLaneType::Mask>> m_lane_description_masks;
|
||||
util::vector_view<TurnPenalty> m_turn_weight_penalties;
|
||||
util::vector_view<TurnPenalty> m_turn_duration_penalties;
|
||||
extractor::SegmentDataView segment_data;
|
||||
extractor::EdgeBasedNodeDataView edge_based_node_data;
|
||||
guidance::TurnDataView turn_data;
|
||||
std::optional<guidance::TurnDataView> turn_data;
|
||||
|
||||
util::vector_view<char> m_datasource_name_data;
|
||||
util::vector_view<std::size_t> m_datasource_name_offsets;
|
||||
util::vector_view<std::size_t> m_datasource_name_lengths;
|
||||
util::vector_view<util::guidance::LaneTupleIdPair> m_lane_tupel_id_pairs;
|
||||
std::optional<util::vector_view<util::guidance::LaneTupleIdPair>> m_lane_tuple_id_pairs;
|
||||
|
||||
util::vector_view<extractor::StorageManeuverOverride> m_maneuver_overrides;
|
||||
util::vector_view<NodeID> m_maneuver_override_node_sequences;
|
||||
@@ -165,16 +178,24 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
std::unique_ptr<SharedGeospatialQuery> m_geospatial_query;
|
||||
boost::filesystem::path file_index_path;
|
||||
|
||||
extractor::IntersectionBearingsView intersection_bearings_view;
|
||||
std::optional<extractor::IntersectionBearingsView> intersection_bearings_view;
|
||||
|
||||
extractor::NameTableView m_name_table;
|
||||
std::optional<extractor::NameTableView> m_name_table;
|
||||
// the look-up table for entry classes. An entry class lists the possibility of entry for all
|
||||
// available turns. Such a class id is stored with every edge.
|
||||
util::vector_view<util::guidance::EntryClass> m_entry_class_table;
|
||||
std::optional<util::vector_view<util::guidance::EntryClass>> m_entry_class_table;
|
||||
|
||||
// allocator that keeps the allocation data
|
||||
std::shared_ptr<ContiguousBlockAllocator> allocator;
|
||||
|
||||
bool isIndexed(const storage::SharedDataIndex &index, const std::string &name)
|
||||
{
|
||||
bool result = false;
|
||||
index.List(name,
|
||||
boost::make_function_output_iterator([&](const auto &) { result = true; }));
|
||||
return result;
|
||||
}
|
||||
|
||||
void InitializeInternalPointers(const storage::SharedDataIndex &index,
|
||||
const std::string &metric_name,
|
||||
const std::size_t exclude_index)
|
||||
@@ -187,7 +208,17 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
|
||||
exclude_mask = m_profile_properties->excludable_classes[exclude_index];
|
||||
|
||||
m_check_sum = *index.GetBlockPtr<std::uint32_t>("/common/connectivity_checksum");
|
||||
// We no longer use "/common/connectivity_checksum", as osrm.edges is an optional dataset.
|
||||
// Instead, we load the value from the MLD or CH graph, whichever is loaded.
|
||||
if (isIndexed(index, "/mld/connectivity_checksum"))
|
||||
{
|
||||
m_check_sum = *index.GetBlockPtr<std::uint32_t>("/mld/connectivity_checksum");
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_ASSERT(isIndexed(index, "/ch/connectivity_checksum"));
|
||||
m_check_sum = *index.GetBlockPtr<std::uint32_t>("/ch/connectivity_checksum");
|
||||
}
|
||||
|
||||
m_data_timestamp = make_timestamp_view(index, "/common/timestamp");
|
||||
|
||||
@@ -200,13 +231,23 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
|
||||
edge_based_node_data = make_ebn_data_view(index, "/common/ebg_node_data");
|
||||
|
||||
turn_data = make_turn_data_view(index, "/common/turn_data");
|
||||
if (isIndexed(index, "/common/turn_data"))
|
||||
{
|
||||
turn_data = make_turn_data_view(index, "/common/turn_data");
|
||||
}
|
||||
|
||||
m_name_table = make_name_table_view(index, "/common/names");
|
||||
if (isIndexed(index, "/common/names"))
|
||||
{
|
||||
m_name_table = make_name_table_view(index, "/common/names");
|
||||
}
|
||||
|
||||
std::tie(m_lane_description_offsets, m_lane_description_masks) =
|
||||
make_turn_lane_description_views(index, "/common/turn_lanes");
|
||||
m_lane_tupel_id_pairs = make_lane_data_view(index, "/common/turn_lanes");
|
||||
if (isIndexed(index, "/common/turn_lanes"))
|
||||
{
|
||||
std::tie(m_lane_description_offsets, m_lane_description_masks) =
|
||||
make_turn_lane_description_views(index, "/common/turn_lanes");
|
||||
|
||||
m_lane_tuple_id_pairs = make_lane_data_view(index, "/common/turn_lanes");
|
||||
}
|
||||
|
||||
m_turn_weight_penalties = make_turn_weight_view(index, "/common/turn_penalty");
|
||||
m_turn_duration_penalties = make_turn_duration_view(index, "/common/turn_penalty");
|
||||
@@ -215,10 +256,12 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
|
||||
m_datasources = index.GetBlockPtr<extractor::Datasources>("/common/data_sources_names");
|
||||
|
||||
intersection_bearings_view =
|
||||
make_intersection_bearings_view(index, "/common/intersection_bearings");
|
||||
|
||||
m_entry_class_table = make_entry_classes_view(index, "/common/entry_classes");
|
||||
if (isIndexed(index, "/common/intersection_bearings"))
|
||||
{
|
||||
intersection_bearings_view =
|
||||
make_intersection_bearings_view(index, "/common/intersection_bearings");
|
||||
m_entry_class_table = make_entry_classes_view(index, "/common/entry_classes");
|
||||
}
|
||||
|
||||
std::tie(m_maneuver_overrides, m_maneuver_override_node_sequences) =
|
||||
make_maneuver_overrides_views(index, "/common/maneuver_overrides");
|
||||
@@ -309,7 +352,8 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
osrm::guidance::TurnInstruction
|
||||
GetTurnInstructionForEdgeID(const EdgeID edge_based_edge_id) const override final
|
||||
{
|
||||
return turn_data.GetTurnInstruction(edge_based_edge_id);
|
||||
CHECK_DATASET_DISABLED(turn_data, DATASET_TURN_DATA);
|
||||
return turn_data->GetTurnInstruction(edge_based_edge_id);
|
||||
}
|
||||
|
||||
std::vector<RTreeLeaf> GetEdgesInBox(const util::Coordinate south_west,
|
||||
@@ -408,32 +452,37 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
return edge_based_node_data.GetNameID(edge_based_node_id);
|
||||
}
|
||||
|
||||
StringView GetNameForID(const NameID id) const override final
|
||||
std::string_view GetNameForID(const NameID id) const override final
|
||||
{
|
||||
return m_name_table.GetNameForID(id);
|
||||
CHECK_DATASET_DISABLED(m_name_table, DATASET_NAME_DATA);
|
||||
return m_name_table->GetNameForID(id);
|
||||
}
|
||||
|
||||
StringView GetRefForID(const NameID id) const override final
|
||||
std::string_view GetRefForID(const NameID id) const override final
|
||||
{
|
||||
return m_name_table.GetRefForID(id);
|
||||
CHECK_DATASET_DISABLED(m_name_table, DATASET_NAME_DATA);
|
||||
return m_name_table->GetRefForID(id);
|
||||
}
|
||||
|
||||
StringView GetPronunciationForID(const NameID id) const override final
|
||||
std::string_view GetPronunciationForID(const NameID id) const override final
|
||||
{
|
||||
return m_name_table.GetPronunciationForID(id);
|
||||
CHECK_DATASET_DISABLED(m_name_table, DATASET_NAME_DATA);
|
||||
return m_name_table->GetPronunciationForID(id);
|
||||
}
|
||||
|
||||
StringView GetDestinationsForID(const NameID id) const override final
|
||||
std::string_view GetDestinationsForID(const NameID id) const override final
|
||||
{
|
||||
return m_name_table.GetDestinationsForID(id);
|
||||
CHECK_DATASET_DISABLED(m_name_table, DATASET_NAME_DATA);
|
||||
return m_name_table->GetDestinationsForID(id);
|
||||
}
|
||||
|
||||
StringView GetExitsForID(const NameID id) const override final
|
||||
std::string_view GetExitsForID(const NameID id) const override final
|
||||
{
|
||||
return m_name_table.GetExitsForID(id);
|
||||
CHECK_DATASET_DISABLED(m_name_table, DATASET_NAME_DATA);
|
||||
return m_name_table->GetExitsForID(id);
|
||||
}
|
||||
|
||||
StringView GetDatasourceName(const DatasourceID id) const override final
|
||||
std::string_view GetDatasourceName(const DatasourceID id) const override final
|
||||
{
|
||||
return m_datasources->GetSourceName(id);
|
||||
}
|
||||
@@ -463,46 +512,60 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
util::guidance::BearingClass
|
||||
GetBearingClass(const NodeID node_based_node_id) const override final
|
||||
{
|
||||
return intersection_bearings_view.GetBearingClass(node_based_node_id);
|
||||
CHECK_DATASET_DISABLED(intersection_bearings_view, DATASET_INTERSECTION_BEARINGS);
|
||||
return intersection_bearings_view->GetBearingClass(node_based_node_id);
|
||||
}
|
||||
|
||||
guidance::TurnBearing PreTurnBearing(const EdgeID edge_based_edge_id) const override final
|
||||
{
|
||||
return turn_data.GetPreTurnBearing(edge_based_edge_id);
|
||||
CHECK_DATASET_DISABLED(turn_data, DATASET_TURN_DATA);
|
||||
return turn_data->GetPreTurnBearing(edge_based_edge_id);
|
||||
}
|
||||
guidance::TurnBearing PostTurnBearing(const EdgeID edge_based_edge_id) const override final
|
||||
{
|
||||
return turn_data.GetPostTurnBearing(edge_based_edge_id);
|
||||
CHECK_DATASET_DISABLED(turn_data, DATASET_TURN_DATA);
|
||||
return turn_data->GetPostTurnBearing(edge_based_edge_id);
|
||||
}
|
||||
|
||||
util::guidance::EntryClass GetEntryClass(const EdgeID edge_based_edge_id) const override final
|
||||
{
|
||||
auto entry_class_id = turn_data.GetEntryClassID(edge_based_edge_id);
|
||||
return m_entry_class_table.at(entry_class_id);
|
||||
CHECK_DATASET_DISABLED(m_entry_class_table, DATASET_ENTRY_CLASS);
|
||||
CHECK_DATASET_DISABLED(turn_data, DATASET_TURN_DATA);
|
||||
|
||||
auto entry_class_id = turn_data->GetEntryClassID(edge_based_edge_id);
|
||||
return m_entry_class_table->at(entry_class_id);
|
||||
}
|
||||
|
||||
bool HasLaneData(const EdgeID edge_based_edge_id) const override final
|
||||
{
|
||||
return turn_data.HasLaneData(edge_based_edge_id);
|
||||
CHECK_DATASET_DISABLED(turn_data, DATASET_TURN_DATA);
|
||||
return turn_data->HasLaneData(edge_based_edge_id);
|
||||
}
|
||||
|
||||
util::guidance::LaneTupleIdPair
|
||||
GetLaneData(const EdgeID edge_based_edge_id) const override final
|
||||
{
|
||||
CHECK_DATASET_DISABLED(turn_data, DATASET_TURN_DATA);
|
||||
CHECK_DATASET_DISABLED(m_lane_tuple_id_pairs, DATASET_TURN_LANE_DATA);
|
||||
|
||||
BOOST_ASSERT(HasLaneData(edge_based_edge_id));
|
||||
return m_lane_tupel_id_pairs.at(turn_data.GetLaneDataID(edge_based_edge_id));
|
||||
return m_lane_tuple_id_pairs->at(turn_data->GetLaneDataID(edge_based_edge_id));
|
||||
}
|
||||
|
||||
extractor::TurnLaneDescription
|
||||
GetTurnDescription(const LaneDescriptionID lane_description_id) const override final
|
||||
{
|
||||
CHECK_DATASET_DISABLED(m_lane_description_offsets, DATASET_TURN_LANE_DATA);
|
||||
CHECK_DATASET_DISABLED(m_lane_description_masks, DATASET_TURN_LANE_DATA);
|
||||
|
||||
if (lane_description_id == INVALID_LANE_DESCRIPTIONID)
|
||||
return {};
|
||||
else
|
||||
return extractor::TurnLaneDescription(
|
||||
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id],
|
||||
m_lane_description_masks.begin() +
|
||||
m_lane_description_offsets[lane_description_id + 1]);
|
||||
m_lane_description_masks->begin() +
|
||||
m_lane_description_offsets->at(lane_description_id),
|
||||
m_lane_description_masks->begin() +
|
||||
m_lane_description_offsets->at(lane_description_id + 1));
|
||||
}
|
||||
|
||||
bool IsLeftHandDriving(const NodeID edge_based_node_id) const override final
|
||||
@@ -693,8 +756,6 @@ class ContiguousInternalMemoryDataFacade<MLD> final
|
||||
{
|
||||
}
|
||||
};
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::datafacade
|
||||
|
||||
#endif // CONTIGUOUS_INTERNALMEM_DATAFACADE_HPP
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "util/integer_range.hpp"
|
||||
#include "util/packed_vector.hpp"
|
||||
#include "util/string_util.hpp"
|
||||
#include "util/string_view.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include "osrm/coordinate.hpp"
|
||||
@@ -37,17 +36,12 @@
|
||||
|
||||
#include <engine/bearing.hpp>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
{
|
||||
|
||||
using StringView = util::StringView;
|
||||
|
||||
class BaseDataFacade
|
||||
{
|
||||
@@ -113,7 +107,7 @@ class BaseDataFacade
|
||||
GetUncompressedReverseDatasources(const PackedGeometryID id) const = 0;
|
||||
|
||||
// Gets the name of a datasource
|
||||
virtual StringView GetDatasourceName(const DatasourceID id) const = 0;
|
||||
virtual std::string_view GetDatasourceName(const DatasourceID id) const = 0;
|
||||
|
||||
virtual osrm::guidance::TurnInstruction
|
||||
GetTurnInstructionForEdgeID(const EdgeID edge_based_edge_id) const = 0;
|
||||
@@ -157,15 +151,15 @@ class BaseDataFacade
|
||||
|
||||
virtual NameID GetNameIndex(const NodeID edge_based_node_id) const = 0;
|
||||
|
||||
virtual StringView GetNameForID(const NameID id) const = 0;
|
||||
virtual std::string_view GetNameForID(const NameID id) const = 0;
|
||||
|
||||
virtual StringView GetRefForID(const NameID id) const = 0;
|
||||
virtual std::string_view GetRefForID(const NameID id) const = 0;
|
||||
|
||||
virtual StringView GetPronunciationForID(const NameID id) const = 0;
|
||||
virtual std::string_view GetPronunciationForID(const NameID id) const = 0;
|
||||
|
||||
virtual StringView GetDestinationsForID(const NameID id) const = 0;
|
||||
virtual std::string_view GetDestinationsForID(const NameID id) const = 0;
|
||||
|
||||
virtual StringView GetExitsForID(const NameID id) const = 0;
|
||||
virtual std::string_view GetExitsForID(const NameID id) const = 0;
|
||||
|
||||
virtual bool GetContinueStraightDefault() const = 0;
|
||||
|
||||
@@ -191,8 +185,6 @@ class BaseDataFacade
|
||||
virtual std::vector<extractor::ManeuverOverride>
|
||||
GetOverridesThatStartAt(const NodeID edge_based_node_id) const = 0;
|
||||
};
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::datafacade
|
||||
|
||||
#endif // DATAFACADE_BASE_HPP
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -37,8 +33,6 @@ class MMapMemoryAllocator final : public ContiguousBlockAllocator
|
||||
std::string rtree_filename;
|
||||
};
|
||||
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::datafacade
|
||||
|
||||
#endif // OSRM_ENGINE_DATAFACADE_SHARED_MEMORY_ALLOCATOR_HPP_
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -34,8 +30,6 @@ class ProcessMemoryAllocator final : public ContiguousBlockAllocator
|
||||
std::unique_ptr<char[]> internal_memory;
|
||||
};
|
||||
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::datafacade
|
||||
|
||||
#endif // OSRM_ENGINE_DATAFACADE_PROCESS_MEMORY_ALLOCATOR_HPP_
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -35,8 +31,6 @@ class SharedMemoryAllocator final : public ContiguousBlockAllocator
|
||||
std::vector<std::unique_ptr<storage::SharedMemory>> memory_regions;
|
||||
};
|
||||
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine::datafacade
|
||||
|
||||
#endif // OSRM_ENGINE_DATAFACADE_SHARED_MEMORY_ALLOCATOR_HPP_
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
// This class selects the right facade for
|
||||
template <template <typename A> class FacadeT, typename AlgorithmT> class DataFacadeFactory
|
||||
@@ -152,7 +150,6 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
|
||||
std::unordered_map<std::string, extractor::ClassData> name_to_class;
|
||||
const extractor::ProfileProperties *properties = nullptr;
|
||||
};
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#include "engine/datafacade/process_memory_allocator.hpp"
|
||||
#include "engine/datafacade_factory.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -103,7 +101,6 @@ template <typename AlgorithmT>
|
||||
using ImmutableProvider = detail::ImmutableProvider<AlgorithmT, DataFacade>;
|
||||
template <typename AlgorithmT>
|
||||
using ExternalProvider = detail::ExternalProvider<AlgorithmT, DataFacade>;
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -75,7 +73,6 @@ inline std::vector<util::Coordinate> douglasPeucker(const std::vector<util::Coor
|
||||
{
|
||||
return douglasPeucker(begin(geometry), end(geometry), zoom_level);
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif /* DOUGLAS_PEUCKER_HPP_ */
|
||||
|
||||
+12
-11
@@ -23,9 +23,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
class EngineInterface
|
||||
@@ -45,12 +43,16 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
||||
{
|
||||
public:
|
||||
explicit Engine(const EngineConfig &config)
|
||||
: route_plugin(config.max_locations_viaroute, config.max_alternatives), //
|
||||
table_plugin(config.max_locations_distance_table), //
|
||||
nearest_plugin(config.max_results_nearest), //
|
||||
trip_plugin(config.max_locations_trip), //
|
||||
match_plugin(config.max_locations_map_matching, config.max_radius_map_matching), //
|
||||
tile_plugin() //
|
||||
: route_plugin(config.max_locations_viaroute,
|
||||
config.max_alternatives,
|
||||
config.default_radius), //
|
||||
table_plugin(config.max_locations_distance_table, config.default_radius), //
|
||||
nearest_plugin(config.max_results_nearest, config.default_radius), //
|
||||
trip_plugin(config.max_locations_trip, config.default_radius), //
|
||||
match_plugin(config.max_locations_map_matching,
|
||||
config.max_radius_map_matching,
|
||||
config.default_radius), //
|
||||
tile_plugin() //
|
||||
|
||||
{
|
||||
if (config.use_shared_memory)
|
||||
@@ -130,7 +132,6 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
||||
const plugins::MatchPlugin match_plugin;
|
||||
const plugins::TilePlugin tile_plugin;
|
||||
};
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif // OSRM_IMPL_HPP
|
||||
|
||||
@@ -29,15 +29,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define ENGINE_CONFIG_HPP
|
||||
|
||||
#include "storage/storage_config.hpp"
|
||||
#include "osrm/datasets.hpp"
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -86,15 +85,16 @@ struct EngineConfig final
|
||||
int max_locations_map_matching = -1;
|
||||
double max_radius_map_matching = -1.0;
|
||||
int max_results_nearest = -1;
|
||||
boost::optional<double> default_radius = -1.0;
|
||||
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
|
||||
bool use_shared_memory = true;
|
||||
boost::filesystem::path memory_file;
|
||||
bool use_mmap = true;
|
||||
Algorithm algorithm = Algorithm::CH;
|
||||
std::vector<storage::FeatureDataset> disable_feature_dataset;
|
||||
std::string verbosity;
|
||||
std::string dataset_name;
|
||||
};
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif // SERVER_CONFIG_HPP
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
inline std::pair<bool, bool> operator&&(const std::pair<bool, bool> &a,
|
||||
@@ -74,7 +72,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
||||
[this, &max_distance, &max_results, input_coordinate](const std::size_t num_results,
|
||||
const CandidateSegment &segment) {
|
||||
return (max_results && num_results >= *max_results) ||
|
||||
(max_distance &&
|
||||
(max_distance && max_distance != -1.0 &&
|
||||
CheckSegmentDistance(input_coordinate, segment, *max_distance));
|
||||
});
|
||||
|
||||
@@ -165,7 +163,8 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
||||
auto distance = GetSegmentDistance(input_coordinate, segment);
|
||||
auto further_than_big_component = distance > big_component_distance;
|
||||
auto no_more_candidates = has_big_component && further_than_big_component;
|
||||
auto too_far_away = max_distance && distance > *max_distance;
|
||||
auto too_far_away =
|
||||
max_distance && max_distance != -1.0 && distance > *max_distance;
|
||||
|
||||
// Time to terminate the search when:
|
||||
// 1. We've found a node from a big component and the next candidate is further away
|
||||
@@ -583,7 +582,6 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
||||
const CoordinateList &coordinates;
|
||||
DataFacadeT &datafacade;
|
||||
};
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
} // namespace osrm::engine
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user