Merge branch 'master' into sf-warnings

This commit is contained in:
Siarhei Fedartsou 2022-09-30 10:14:21 +02:00
commit 3c9debdd3d
27 changed files with 2003 additions and 1286 deletions

3
.gitattributes vendored
View File

@ -13,3 +13,6 @@
# Declare files that will always have LF line endings on checkout. # Declare files that will always have LF line endings on checkout.
*.sh text eol=lf *.sh text eol=lf
# https://eslint.org/docs/latest/rules/linebreak-style#using-this-rule-with-version-control-systems
*.js text eol=lf

View File

@ -24,6 +24,9 @@ jobs:
needs: format-taginfo-docs needs: format-taginfo-docs
runs-on: windows-2022 runs-on: windows-2022
continue-on-error: false continue-on-error: false
env:
BUILD_TYPE: Release
ENABLE_APPLE_SILICON: "OFF"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: pip install conan==1.51.3 - run: pip install conan==1.51.3
@ -34,12 +37,38 @@ jobs:
node-version: 16 node-version: 16
- run: node --version - run: node --version
- run: npm --version - run: npm --version
- name: Prepare environment
shell: bash
run: |
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
- run: npm install --ignore-scripts - run: npm install --ignore-scripts
- run: npm link --ignore-scripts - run: npm link --ignore-scripts
- uses: microsoft/setup-msbuild@v1.1 - uses: microsoft/setup-msbuild@v1.1
- name: Build - name: Build
run: | run: |
.\scripts\ci\windows-build.bat .\scripts\ci\windows-build.bat
- name: Run node tests
shell: bash
run: |
./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm
node test/nodejs/index.js
- name: Build Node package
shell: bash
run: ./scripts/ci/node_package.sh
- name: Publish Node package
if: ${{ env.PUBLISH == 'On' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: build/stage/**/*.tar.gz
omitBody: true
omitBodyDuringUpdate: true
omitName: true
omitNameDuringUpdate: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
format-taginfo-docs: format-taginfo-docs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
@ -182,6 +211,7 @@ jobs:
BUILD_TYPE: Release BUILD_TYPE: Release
CCOMPILER: gcc-11 CCOMPILER: gcc-11
CXXCOMPILER: g++-11 CXXCOMPILER: g++-11
ENABLE_BENCHMARKS: ON
- name: gcc-10-release - name: gcc-10-release
continue-on-error: false continue-on-error: false
@ -234,7 +264,7 @@ jobs:
CCOMPILER: gcc-7 CCOMPILER: gcc-7
CXXCOMPILER: g++-7 CXXCOMPILER: g++-7
- name: conan-osx-release-node-12 - name: conan-macos-x64-release-node-12
build_node_package: true build_node_package: true
continue-on-error: false continue-on-error: false
node: 12 node: 12
@ -247,7 +277,7 @@ jobs:
ENABLE_ASSERTIONS: ON ENABLE_ASSERTIONS: ON
ENABLE_CONAN: ON ENABLE_CONAN: ON
- name: conan-osx-release-node-14 - name: conan-macos-x64-release-node-14
build_node_package: true build_node_package: true
continue-on-error: false continue-on-error: false
node: 14 node: 14
@ -260,7 +290,7 @@ jobs:
ENABLE_ASSERTIONS: ON ENABLE_ASSERTIONS: ON
ENABLE_CONAN: ON ENABLE_CONAN: ON
- name: conan-osx-release-node-16 - name: conan-macos-x64-release-node-16
build_node_package: true build_node_package: true
continue-on-error: false continue-on-error: false
node: 16 node: 16
@ -273,6 +303,20 @@ jobs:
ENABLE_ASSERTIONS: ON ENABLE_ASSERTIONS: ON
ENABLE_CONAN: 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 - name: gcc-7-release-shared
continue-on-error: false continue-on-error: false
node: 12 node: 12
@ -350,7 +394,7 @@ jobs:
ENABLE_CONAN: ON ENABLE_CONAN: ON
NODE_PACKAGE_TESTS_ONLY: ON NODE_PACKAGE_TESTS_ONLY: ON
- name: conan-osx-release-node-latest - name: conan-macos-x64-release-node-latest
build_node_package: true build_node_package: true
continue-on-error: true continue-on-error: true
node: latest node: latest
@ -362,6 +406,19 @@ jobs:
ENABLE_ASSERTIONS: ON ENABLE_ASSERTIONS: ON
ENABLE_CONAN: ON ENABLE_CONAN: ON
- name: conan-macos-arm64-release-node-latest
build_node_package: true
continue-on-error: true
node: latest
runs-on: macos-11
BUILD_TYPE: Release
CCOMPILER: clang
CXXCOMPILER: clang++
CUCUMBER_TIMEOUT: 60000
ENABLE_ASSERTIONS: ON
ENABLE_CONAN: ON
ENABLE_APPLE_SILICON: ON
- name: node-latest-conan-linux-release - name: node-latest-conan-linux-release
build_node_package: true build_node_package: true
continue-on-error: true continue-on-error: true
@ -384,7 +441,7 @@ jobs:
ENABLE_CONAN: ON ENABLE_CONAN: ON
NODE_PACKAGE_TESTS_ONLY: ON NODE_PACKAGE_TESTS_ONLY: ON
- name: conan-osx-release-node-lts - name: conan-macos-x64-release-node-lts
build_node_package: true build_node_package: true
continue-on-error: true continue-on-error: true
node: "lts/*" node: "lts/*"
@ -396,6 +453,19 @@ jobs:
ENABLE_ASSERTIONS: ON ENABLE_ASSERTIONS: ON
ENABLE_CONAN: 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 - name: node-lts-conan-linux-release
build_node_package: true build_node_package: true
continue-on-error: true continue-on-error: true
@ -436,6 +506,7 @@ jobs:
ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }} ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }}
ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }} ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }}
NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }} NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }}
ENABLE_APPLE_SILICON: ${{ matrix.ENABLE_APPLE_SILICON }}
TARGET_ARCH: ${{ matrix.TARGET_ARCH }} TARGET_ARCH: ${{ matrix.TARGET_ARCH }}
OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }} OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }}
OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }} OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }}
@ -464,9 +535,9 @@ jobs:
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ~/.conan path: ~/.conan
key: v4-conan-${{ matrix.name }}-${{ github.sha }} key: v6-conan-${{ matrix.name }}-${{ github.sha }}
restore-keys: | restore-keys: |
v4-conan-${{ matrix.name }}- v6-conan-${{ matrix.name }}-
- name: Enable test cache - name: Enable test cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -479,10 +550,8 @@ jobs:
run: | run: |
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV
echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV
if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then
# We can only set this after checkout once we know the workspace directory # We can only set this after checkout once we know the workspace directory
echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV
@ -497,12 +566,10 @@ jobs:
sudo mdutil -i off / sudo mdutil -i off /
export MASON_OS=osx export MASON_OS=osx
fi fi
echo "MASON=${GITHUB_WORKSPACE}/scripts/mason.sh" >> $GITHUB_ENV echo "MASON=${GITHUB_WORKSPACE}/scripts/mason.sh" >> $GITHUB_ENV
echo "CMAKE_URL=https://mason-binaries.s3.amazonaws.com/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}.tar.gz" >> $GITHUB_ENV echo "CMAKE_URL=https://mason-binaries.s3.amazonaws.com/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}.tar.gz" >> $GITHUB_ENV
echo "CMAKE_DIR=mason_packages/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}" >> $GITHUB_ENV echo "CMAKE_DIR=mason_packages/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}" >> $GITHUB_ENV
- name: Install dev dependencies - name: Install dev dependencies
run: | run: |
python3 -m pip install conan==1.51.3 python3 -m pip install conan==1.51.3
@ -530,7 +597,6 @@ jobs:
# Linux dev packages # Linux dev packages
if [ "${TARGET_ARCH}" != "i686" ] && [ "${ENABLE_CONAN}" != "ON" ]; then if [ "${TARGET_ARCH}" != "i686" ] && [ "${ENABLE_CONAN}" != "ON" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev libboost-all-dev sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev libboost-all-dev
if [[ "${CCOMPILER}" != clang-* ]]; then if [[ "${CCOMPILER}" != clang-* ]]; then
@ -572,6 +638,17 @@ jobs:
echo "Using ${JOBS} jobs" echo "Using ${JOBS} jobs"
pushd ${OSRM_BUILD_DIR} pushd ${OSRM_BUILD_DIR}
# handle Apple Silicon cross compilation
if [[ "${ENABLE_APPLE_SILICON}" == "ON" ]]; then
ARCH=arm64
TARGET="${ARCH}-apple-darwin"
CFLAGS="$CFLAGS --target=$TARGET"
CXXFLAGS="$CXXFLAGS --target=$TARGET"
APPLE_SILICON_FLAGS=(-DCMAKE_C_COMPILER_TARGET="$TARGET" -DCMAKE_CXX_COMPILER_TARGET="$TARGET" -DCMAKE_SYSTEM_PROCESSOR="${ARCH}" -DCMAKE_SYSTEM_NAME="Darwin" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS")
else
APPLE_SILICON_FLAGS=()
fi
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \
@ -582,10 +659,12 @@ jobs:
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
-DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \
-DENABLE_CCACHE=ON \ -DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
"${APPLE_SILICON_FLAGS[@]}"
make --jobs=${JOBS} make --jobs=${JOBS}
if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" && "${ENABLE_APPLE_SILICON}" != "ON" ]]; then
make tests --jobs=${JOBS} make tests --jobs=${JOBS}
make benchmarks --jobs=${JOBS} make benchmarks --jobs=${JOBS}
ccache -s ccache -s
@ -597,15 +676,14 @@ jobs:
fi fi
popd popd
- name: Build example - name: Build example
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
run: | run: |
mkdir example/build && pushd example/build mkdir example/build && pushd example/build
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
make --jobs=${JOBS} make --jobs=${JOBS}
popd popd
- name: Run all tests - name: Run all tests
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
run: | run: |
make -C test/data benchmark make -C test/data benchmark
@ -621,8 +699,18 @@ jobs:
fi fi
popd popd
npm test npm test
- name: Run benchmarks
if: ${{ matrix.ENABLE_BENCHMARKS == 'ON' }}
run: |
pushd ${OSRM_BUILD_DIR}
make --jobs=${JOBS} benchmarks
./src/benchmarks/alias-bench
./src/benchmarks/match-bench ../test/data/ch/monaco.osrm
./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: Run Node package tests only
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
run: | run: |
npm run nodejs-tests npm run nodejs-tests
- name: Upload test logs - name: Upload test logs
@ -647,9 +735,17 @@ jobs:
name: codecov-osrm-backend name: codecov-osrm-backend
fail_ci_if_error: true fail_ci_if_error: true
verbose: true verbose: true
- name: Check Apple Silicon binary
if: ${{ matrix.ENABLE_APPLE_SILICON == 'ON' }}
run: |
ARCH=$(file ./lib/binding/node_osrm.node | awk '{printf $NF}')
if [[ "$ARCH" != "arm64" ]]; then
file ./lib/binding/node_osrm.node
>&2 echo "Wrong architecture!"
exit 1
fi
- name: Build Node package - name: Build Node package
if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} if: ${{ matrix.build_node_package }}
run: ./scripts/ci/node_package.sh run: ./scripts/ci/node_package.sh
- name: Publish Node package - name: Publish Node package
if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }}

View File

@ -9,6 +9,7 @@
- NodeJS: - NodeJS:
- FIXED: Support `skip_waypoints` in Node bindings [#6060](https://github.com/Project-OSRM/osrm-backend/pull/6060) - FIXED: Support `skip_waypoints` in Node bindings [#6060](https://github.com/Project-OSRM/osrm-backend/pull/6060)
- Misc: - Misc:
- CHANGED: Improve performance of map matching via getPathDistance optimization. [#6378](https://github.com/Project-OSRM/osrm-backend/pull/6378)
- CHANGED: Optimize RestrictionParser performance. [#6344](https://github.com/Project-OSRM/osrm-backend/pull/6344) - CHANGED: Optimize RestrictionParser performance. [#6344](https://github.com/Project-OSRM/osrm-backend/pull/6344)
- ADDED: Support floats for speed value in traffic updates CSV. [#6327](https://github.com/Project-OSRM/osrm-backend/pull/6327) - ADDED: Support floats for speed value in traffic updates CSV. [#6327](https://github.com/Project-OSRM/osrm-backend/pull/6327)
- CHANGED: Use Lua 5.4 in Docker image. [#6346](https://github.com/Project-OSRM/osrm-backend/pull/6346) - CHANGED: Use Lua 5.4 in Docker image. [#6346](https://github.com/Project-OSRM/osrm-backend/pull/6346)
@ -22,6 +23,8 @@
- FIXED: Bug in bicycle profile that caused exceptions if there is a highway=bicycle in the data. [#6296](https://github.com/Project-OSRM/osrm-backend/pull/6296) - FIXED: Bug in bicycle profile that caused exceptions if there is a highway=bicycle in the data. [#6296](https://github.com/Project-OSRM/osrm-backend/pull/6296)
- FIXED: Internal refactoring of identifier types used in data facade [#6044](https://github.com/Project-OSRM/osrm-backend/pull/6044) - FIXED: Internal refactoring of identifier types used in data facade [#6044](https://github.com/Project-OSRM/osrm-backend/pull/6044)
- Build: - Build:
- ADDED: Build Node bindings on Windows. [#6334](https://github.com/Project-OSRM/osrm-backend/pull/6334)
- ADDED: Configure cross-compilation for Apple Silicon. [#6360](https://github.com/Project-OSRM/osrm-backend/pull/6360)
- CHANGED: Use apt-get to install Clang on CI. [#6345](https://github.com/Project-OSRM/osrm-backend/pull/6345) - CHANGED: Use apt-get to install Clang on CI. [#6345](https://github.com/Project-OSRM/osrm-backend/pull/6345)
- CHANGED: Fix TBB in case of Conan + NodeJS build. [#6333](https://github.com/Project-OSRM/osrm-backend/pull/6333) - CHANGED: Fix TBB in case of Conan + NodeJS build. [#6333](https://github.com/Project-OSRM/osrm-backend/pull/6333)
- CHANGED: Migrate to modern TBB version. [#6300](https://github.com/Project-OSRM/osrm-backend/pull/6300) - CHANGED: Migrate to modern TBB version. [#6300](https://github.com/Project-OSRM/osrm-backend/pull/6300)
@ -57,6 +60,10 @@
- ADDED: Support snapping to multiple ways at an input location. [#5953](https://github.com/Project-OSRM/osrm-backend/pull/5953) - ADDED: Support snapping to multiple ways at an input location. [#5953](https://github.com/Project-OSRM/osrm-backend/pull/5953)
- FIXED: Fix snapping target locations to ways used in turn restrictions. [#6339](https://github.com/Project-OSRM/osrm-backend/pull/6339) - FIXED: Fix snapping target locations to ways used in turn restrictions. [#6339](https://github.com/Project-OSRM/osrm-backend/pull/6339)
- ADDED: Support OSM traffic signal directions. [#6153](https://github.com/Project-OSRM/osrm-backend/pull/6153) - ADDED: Support OSM traffic signal directions. [#6153](https://github.com/Project-OSRM/osrm-backend/pull/6153)
- FIXED: Ensure u-turn exists in intersection view. [#6376](https://github.com/Project-OSRM/osrm-backend/pull/6376)
- Profile:
- CHANGED: Bicycle surface speeds [#6212](https://github.com/Project-OSRM/osrm-backend/pull/6212)
# 5.26.0 # 5.26.0
- Changes from 5.25.0 - Changes from 5.25.0

View File

@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE) if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed. message(FATAL_ERROR "In-source builds are not allowed.
Please create a directory and run cmake from there, passing the path to this source directory as the last argument. Please create a directory and run cmake from there, passing the path to this source directory as the last argument.
@ -60,6 +61,15 @@ if (POLICY CMP0074)
endif() endif()
project(OSRM C CXX) project(OSRM C CXX)
# add @loader_path/$ORIGIN to rpath to make binaries relocatable
if (APPLE)
set(CMAKE_BUILD_RPATH "@loader_path")
else()
set(CMAKE_BUILD_RPATH "\$ORIGIN")
# https://stackoverflow.com/questions/6324131/rpath-origin-not-having-desired-effect
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin")
endif()
include(JSONParser) include(JSONParser)
file(READ "package.json" packagejsonraw) file(READ "package.json" packagejsonraw)
sbeParseJson(packagejson packagejsonraw) sbeParseJson(packagejson packagejsonraw)
@ -184,7 +194,7 @@ if(ENABLE_GOLD_LINKER)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "GNU gold") if("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags") set(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") set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
message(STATUS "Using GNU gold as linker.") message(STATUS "Using GNU gold as linker.")
@ -490,11 +500,15 @@ if(ENABLE_CONAN)
NO_OUTPUT_DIRS NO_OUTPUT_DIRS
OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake
onetbb:shared=${TBB_SHARED} onetbb:shared=${TBB_SHARED}
boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it
BUILD missing BUILD missing
) )
# explicitly say Conan to use x86 dependencies if build for x86 platforms (https://github.com/conan-io/cmake-conan/issues/141) # explicitly say Conan to use x86 dependencies if build for x86 platforms (https://github.com/conan-io/cmake-conan/issues/141)
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
conan_cmake_run("${CONAN_ARGS};ARCH;x86") conan_cmake_run("${CONAN_ARGS};ARCH;x86")
# cross-compilation for Apple Silicon
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
conan_cmake_run("${CONAN_ARGS};ARCH;armv8")
else() else()
conan_cmake_run("${CONAN_ARGS}") conan_cmake_run("${CONAN_ARGS}")
endif() endif()
@ -867,15 +881,16 @@ if (ENABLE_FUZZING)
add_subdirectory(fuzz) add_subdirectory(fuzz)
endif () endif ()
# add headers sanity check target that includes all headers independently # add headers sanity check target that includes all headers independently
# make sure we have all deps for the nodejs sub project's includes (nan, node)
if (ENABLE_NODE_BINDINGS)
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers") set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
file(GLOB_RECURSE headers_to_check file(GLOB_RECURSE headers_to_check
${PROJECT_BINARY_DIR}/*.hpp ${PROJECT_BINARY_DIR}/*.hpp
${PROJECT_SOURCE_DIR}/include/*.hpp) ${PROJECT_SOURCE_DIR}/include/*.hpp)
foreach(header ${headers_to_check}) foreach(header ${headers_to_check})
if ("${header}" MATCHES ".*/include/nodejs/.*")
# we do not check NodeJS bindings headers
continue()
endif()
get_filename_component(filename ${header} NAME_WE) get_filename_component(filename ${header} NAME_WE)
set(filename "${check_headers_dir}/${filename}.cpp") set(filename "${check_headers_dir}/${filename}.cpp")
if (NOT EXISTS ${filename}) if (NOT EXISTS ${filename})
@ -885,4 +900,4 @@ if (ENABLE_NODE_BINDINGS)
endforeach() endforeach()
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources}) add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir}) set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
endif()

View File

@ -9,28 +9,34 @@ Feature: Bike - Surfaces
| highway | surface | bothw | | highway | surface | bothw |
| cycleway | | 48 s | | cycleway | | 48 s |
| cycleway | asphalt | 47.9 s | | cycleway | asphalt | 47.9 s |
| cycleway | chipseal | 48 s |
| cycleway | concrete | 48 s |
| cycleway | concrete_lanes | 48 s |
| cycleway | cobblestone:flattened | 72 s | | cycleway | cobblestone:flattened | 72 s |
| cycleway | paving_stones | 72 s | | cycleway | paving_stones | 72 s |
| cycleway | wood | 72 s |
| cycleway | compacted | 72 s | | cycleway | compacted | 72 s |
| cycleway | cobblestone | 120 s | | cycleway | fine_gravel | 72 s |
| cycleway | fine_gravel | 120 s | | cycleway | ground | 72 s |
| cycleway | dirt | 90 s |
| cycleway | cobblestone | 102.9 s |
| cycleway | gravel | 120 s | | cycleway | gravel | 120 s |
| cycleway | pebblestone | 120 s | | cycleway | pebblestone | 120 s |
| cycleway | dirt | 120 s | | cycleway | dirt | 90 s |
| cycleway | earth | 120 s | | cycleway | earth | 120 s |
| cycleway | grass | 120 s | | cycleway | grass | 120 s |
| cycleway | mud | 240 s | | cycleway | mud | 240 s |
| cycleway | sand | 240 s | | cycleway | sand | 240 s |
| cycleway | sett | 72 s | | cycleway | sett | 80 s |
Scenario: Bicycle - Good surfaces on small paths Scenario: Bicycle - Good surfaces on small paths
Then routability should be Then routability should be
| highway | surface | bothw | | highway | surface | bothw |
| cycleway | | 48 s | | cycleway | | 48 s |
| path | | 59.9 s | | path | | 55.3 s |
| track | | 60 s | | track | | 60 s |
| track | asphalt | 60 s | | track | asphalt | 60 s |
| path | asphalt | 60 s | | path | asphalt | 55.4 s |
Scenario: Bicycle - Surfaces should not make unknown ways routable Scenario: Bicycle - Surfaces should not make unknown ways routable
Then routability should be Then routability should be

View File

@ -0,0 +1,31 @@
@routing @foot
Feature: Foot - Intersections
Background:
Given the profile "foot"
Given a grid size of 2 meters
# https://github.com/Project-OSRM/osrm-backend/issues/6218
Scenario: Foot - Handles non-planar intersections
Given the node map
"""
f
|
a
|
b---c---d
|
e
"""
And the ways
| nodes | highway | foot | layer |
| ac | footway | yes | 0 |
| bc | footway | yes | 0 |
| cd | footway | yes | 0 |
| cef | footway | yes | 1 |
When I route I should get
| from | to | route |
| a | d | ac,cd,cd |

View File

@ -28,6 +28,7 @@
#include "util/json_util.hpp" #include "util/json_util.hpp"
#include <iterator> #include <iterator>
#include <map>
#include <vector> #include <vector>
namespace osrm namespace osrm

View File

@ -6,6 +6,7 @@
#include "engine/guidance/route_leg.hpp" #include "engine/guidance/route_leg.hpp"
#include "engine/guidance/route_step.hpp" #include "engine/guidance/route_step.hpp"
#include "engine/internal_route_result.hpp" #include "engine/internal_route_result.hpp"
#include "util/coordinate_calculation.hpp"
#include "util/typedefs.hpp" #include "util/typedefs.hpp"
#include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/join.hpp>

View File

@ -54,6 +54,7 @@ struct PhantomNode
forward_distance_offset(0), reverse_distance_offset(0), forward_distance_offset(0), reverse_distance_offset(0),
forward_duration(MAXIMAL_EDGE_DURATION), reverse_duration(MAXIMAL_EDGE_DURATION), forward_duration(MAXIMAL_EDGE_DURATION), reverse_duration(MAXIMAL_EDGE_DURATION),
forward_duration_offset(0), reverse_duration_offset(0), forward_duration_offset(0), reverse_duration_offset(0),
component({INVALID_COMPONENTID, 0}),
fwd_segment_position(0), is_valid_forward_source{false}, is_valid_forward_target{false}, fwd_segment_position(0), is_valid_forward_source{false}, is_valid_forward_target{false},
is_valid_reverse_source{false}, is_valid_reverse_target{false}, bearing(0) is_valid_reverse_source{false}, is_valid_reverse_target{false}, bearing(0)

View File

@ -353,49 +353,21 @@ double getPathDistance(const DataFacade<Algorithm> &facade,
const PhantomNode &source_phantom, const PhantomNode &source_phantom,
const PhantomNode &target_phantom) const PhantomNode &target_phantom)
{ {
using util::coordinate_calculation::detail::DEGREE_TO_RAD; double distance = 0.0;
using util::coordinate_calculation::detail::EARTH_RADIUS; auto prev_coordinate = source_phantom.location;
double distance = 0;
double prev_lat =
static_cast<double>(util::toFloating(source_phantom.location.lat)) * DEGREE_TO_RAD;
double prev_lon =
static_cast<double>(util::toFloating(source_phantom.location.lon)) * DEGREE_TO_RAD;
double prev_cos = std::cos(prev_lat);
for (const auto &p : unpacked_path) for (const auto &p : unpacked_path)
{ {
const auto current_coordinate = facade.GetCoordinateOfNode(p.turn_via_node); const auto current_coordinate = facade.GetCoordinateOfNode(p.turn_via_node);
const double current_lat = distance +=
static_cast<double>(util::toFloating(current_coordinate.lat)) * DEGREE_TO_RAD; util::coordinate_calculation::greatCircleDistance(prev_coordinate, current_coordinate);
const double current_lon =
static_cast<double>(util::toFloating(current_coordinate.lon)) * DEGREE_TO_RAD;
const double current_cos = std::cos(current_lat);
const double sin_dlon = std::sin((prev_lon - current_lon) / 2.0); prev_coordinate = current_coordinate;
const double sin_dlat = std::sin((prev_lat - current_lat) / 2.0);
const double aharv = sin_dlat * sin_dlat + prev_cos * current_cos * sin_dlon * sin_dlon;
const double charv = 2. * std::atan2(std::sqrt(aharv), std::sqrt(1.0 - aharv));
distance += EARTH_RADIUS * charv;
prev_lat = current_lat;
prev_lon = current_lon;
prev_cos = current_cos;
} }
const double current_lat = distance +=
static_cast<double>(util::toFloating(target_phantom.location.lat)) * DEGREE_TO_RAD; util::coordinate_calculation::greatCircleDistance(prev_coordinate, target_phantom.location);
const double current_lon =
static_cast<double>(util::toFloating(target_phantom.location.lon)) * DEGREE_TO_RAD;
const double current_cos = std::cos(current_lat);
const double sin_dlon = std::sin((prev_lon - current_lon) / 2.0);
const double sin_dlat = std::sin((prev_lat - current_lat) / 2.0);
const double aharv = sin_dlat * sin_dlat + prev_cos * current_cos * sin_dlon * sin_dlon;
const double charv = 2. * std::atan2(std::sqrt(aharv), std::sqrt(1.0 - aharv));
distance += EARTH_RADIUS * charv;
return distance; return distance;
} }

View File

@ -1,107 +0,0 @@
#ifndef OSRM_EXTRACTOR_GEOJSON_DEBUG_POLICIES
#define OSRM_EXTRACTOR_GEOJSON_DEBUG_POLICIES
#include <algorithm>
#include <vector>
#include "extractor/query_node.hpp"
#include "util/coordinate.hpp"
#include "util/json_container.hpp"
#include "util/node_based_graph.hpp"
#include "util/typedefs.hpp"
#include "guidance/coordinate_extractor.hpp"
#include "guidance/intersection.hpp"
#include "util/coordinate.hpp"
#include "util/geojson_debug_policy_toolkit.hpp"
#include <boost/optional.hpp>
namespace osrm
{
namespace extractor
{
// generate a visualisation of an intersection, printing the coordinates used for angle calculation
template <typename IntersectionType> struct IntersectionPrinter
{
IntersectionPrinter(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<extractor::QueryNode> &node_coordinates,
const extractor::guidance::CoordinateExtractor &coordinate_extractor);
// renders the used coordinate locations for all entries/as well as the resulting
// intersection-classification
util::json::Array operator()(const NodeID intersection_node,
const IntersectionType &intersection,
const boost::optional<util::json::Object> &node_style = {},
const boost::optional<util::json::Object> &way_style = {}) const;
const util::NodeBasedDynamicGraph &node_based_graph;
const std::vector<extractor::QueryNode> &node_coordinates;
const extractor::guidance::CoordinateExtractor &coordinate_extractor;
};
// IMPLEMENTATION
template <typename IntersectionType>
IntersectionPrinter<IntersectionType>::IntersectionPrinter(
const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<extractor::QueryNode> &node_coordinates,
const extractor::guidance::CoordinateExtractor &coordinate_extractor)
: node_based_graph(node_based_graph), node_coordinates(node_coordinates),
coordinate_extractor(coordinate_extractor)
{
}
template <typename IntersectionType>
util::json::Array IntersectionPrinter<IntersectionType>::operator()(
const NodeID intersection_node,
const IntersectionType &intersection,
const boost::optional<util::json::Object> &node_style,
const boost::optional<util::json::Object> &way_style) const
{
// request the number of lanes. This process needs to be in sync with what happens over at
// intersection analysis
const auto intersection_lanes =
intersection.FindMaximum(guidance::makeExtractLanesForRoad(node_based_graph));
std::vector<util::Coordinate> coordinates;
coordinates.reserve(intersection.size());
coordinates.push_back(node_coordinates[intersection_node]);
const auto road_to_coordinate = [&](const auto &road) {
const constexpr auto FORWARD = false;
const auto to_node = node_based_graph.GetTarget(road.eid);
return coordinate_extractor.GetCoordinateAlongRoad(
intersection_node, road.eid, FORWARD, to_node, intersection_lanes);
};
std::transform(intersection.begin(),
intersection.end(),
std::back_inserter(coordinates),
road_to_coordinate);
util::json::Array features;
features.values.push_back(
util::makeFeature("MultiPoint", makeJsonArray(coordinates), node_style));
if (coordinates.size() > 1)
{
std::vector<util::Coordinate> line_coordinates(2);
line_coordinates[0] = coordinates.front();
const auto coordinate_to_line = [&](const util::Coordinate coordinate) {
line_coordinates[1] = coordinate;
return util::makeFeature("LineString", makeJsonArray(line_coordinates), way_style);
};
std::transform(std::next(coordinates.begin()),
coordinates.end(),
std::back_inserter(features.values),
coordinate_to_line);
}
return features;
}
} /* namespace extractor */
} /* namespace osrm */
#endif /* OSRM_EXTRACTOR_GEOJSON_DEBUG_POLICIES */

View File

@ -135,7 +135,8 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
inline NodeBasedEdgeClassification::NodeBasedEdgeClassification() inline NodeBasedEdgeClassification::NodeBasedEdgeClassification()
: forward(false), backward(false), is_split(false), roundabout(false), circular(false), : forward(false), backward(false), is_split(false), roundabout(false), circular(false),
startpoint(false), restricted(false) startpoint(false), restricted(false), highway_turn_classification(0),
access_turn_classification(0)
{ {
} }

View File

@ -28,7 +28,7 @@ struct TurnRestriction
// The turn sequence that the restriction applies to. // The turn sequence that the restriction applies to.
TurnPath turn_path; TurnPath turn_path;
// Indicates if the restriction turn *must* or *must not* be taken. // Indicates if the restriction turn *must* or *must not* be taken.
bool is_only; bool is_only = false;
// We represent conditional and unconditional restrictions with the same structure. // We represent conditional and unconditional restrictions with the same structure.
// Unconditional restrictions will have empty conditions. // Unconditional restrictions will have empty conditions.
std::vector<util::OpeningHours> condition; std::vector<util::OpeningHours> condition;

View File

@ -1,14 +1,14 @@
#ifndef OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_ #ifndef OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_
#define OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_ #define OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_
#include "extractor/intersection/constants.hpp"
#include <algorithm> #include <algorithm>
#include <boost/assert.hpp>
#include <cmath> #include <cmath>
#include <cstdint> #include <cstdint>
#include <cstdlib> #include <cstdlib>
#include <string> #include <string>
#include "extractor/intersection/constants.hpp"
namespace osrm namespace osrm
{ {
namespace extractor namespace extractor

View File

@ -38,17 +38,17 @@ struct LuaScriptingContext final
RasterContainer raster_sources; RasterContainer raster_sources;
sol::state state; sol::state state;
bool has_turn_penalty_function; bool has_turn_penalty_function = false;
bool has_node_function; bool has_node_function = false;
bool has_way_function; bool has_way_function = false;
bool has_segment_function; bool has_segment_function = false;
sol::function turn_function; sol::function turn_function;
sol::function way_function; sol::function way_function;
sol::function node_function; sol::function node_function;
sol::function segment_function; sol::function segment_function;
int api_version; int api_version = 4;
sol::table profile_table; sol::table profile_table;
// Reference to immutable location dependent data and locations memo // Reference to immutable location dependent data and locations memo

View File

@ -231,7 +231,7 @@ class MultiLevelGraph : public util::StaticGraph<EdgeDataT, Ownership>
protected: protected:
Vector<EdgeOffset> node_to_edge_offset; Vector<EdgeOffset> node_to_edge_offset;
std::uint32_t connectivity_checksum; std::uint32_t connectivity_checksum = 0;
}; };
using MultiLevelEdgeBasedGraph = using MultiLevelEdgeBasedGraph =

View File

@ -107,11 +107,11 @@ class Server
} }
} }
RequestHandler request_handler;
unsigned thread_pool_size; unsigned thread_pool_size;
boost::asio::io_context io_context; boost::asio::io_context io_context;
boost::asio::ip::tcp::acceptor acceptor; boost::asio::ip::tcp::acceptor acceptor;
std::shared_ptr<Connection> new_connection; std::shared_ptr<Connection> new_connection;
RequestHandler request_handler;
}; };
} // namespace server } // namespace server
} // namespace osrm } // namespace osrm

View File

@ -211,7 +211,7 @@ struct SharedRegion
char name[MAX_NAME_LENGTH + 1]; char name[MAX_NAME_LENGTH + 1];
std::uint64_t timestamp; std::uint64_t timestamp;
std::uint16_t shm_key; std::uint16_t shm_key = 0;
}; };
// Keeps a list of all shared regions in a fixed-sized struct // Keeps a list of all shared regions in a fixed-sized struct

View File

@ -66,7 +66,7 @@ struct UpdaterConfig final : storage::IOConfig
IOConfig::UseDefaultOutputNames(base); IOConfig::UseDefaultOutputNames(base);
} }
double log_edge_updates_factor; double log_edge_updates_factor = 0.0;
std::time_t valid_now; std::time_t valid_now;
std::vector<std::string> segment_speed_lookup_paths; std::vector<std::string> segment_speed_lookup_paths;

View File

@ -27,6 +27,7 @@ THE SOFTWARE.
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <memory.h>
#if defined(_MSC_VER) #if defined(_MSC_VER)
#include "rapidjson/msinttypes/stdint.h" #include "rapidjson/msinttypes/stdint.h"

2733
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@
"private": false, "private": false,
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.", "description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
"dependencies": { "dependencies": {
"@mapbox/node-pre-gyp": "^1.0.1", "@mapbox/node-pre-gyp": "^1.0.9",
"cheap-ruler": "^3.0.2", "cheap-ruler": "^3.0.2",
"mkdirp": "^0.5.5", "mkdirp": "^0.5.6",
"nan": "^2.14.2", "nan": "^2.16.0",
"node-cmake": "^2.5.1", "node-cmake": "^2.5.1",
"rimraf": "^2.7.1" "rimraf": "^2.7.1"
}, },
@ -39,18 +39,18 @@
"node": ">=4.0.0" "node": ">=4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.14.5", "@babel/cli": "^7.18.10",
"@babel/core": "^7.14.6", "@babel/core": "^7.18.13",
"@babel/preset-env": "^7.14.5", "@babel/preset-env": "^7.18.10",
"@babel/preset-react": "^7.14.5", "@babel/preset-react": "^7.18.6",
"acorn": "^8.4.0", "acorn": "^8.8.0",
"ansi-escape-sequences": "^5.1.2", "ansi-escape-sequences": "^5.1.2",
"aws-sdk": "~2.0.31", "aws-sdk": "~2.0.31",
"babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-class-properties": "^6.24.1",
"babelify": "^10.0.0", "babelify": "^10.0.0",
"browserify": "^17.0.0", "browserify": "^17.0.0",
"chalk": "^1.1.3", "chalk": "^1.1.3",
"command-line-args": "^5.1.1", "command-line-args": "^5.2.1",
"command-line-usage": "^5.0.4", "command-line-usage": "^5.0.4",
"csv-stringify": "^3.0.0", "csv-stringify": "^3.0.0",
"cucumber": "^1.2.1", "cucumber": "^1.2.1",
@ -59,13 +59,13 @@
"documentation": "^4.0.0", "documentation": "^4.0.0",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"faucet": "^0.0.1", "faucet": "^0.0.1",
"jsonpath": "^1.1.0", "jsonpath": "^1.1.1",
"node-timeout": "0.0.4", "node-timeout": "0.0.4",
"polyline": "^0.2.0", "polyline": "^0.2.0",
"request": "^2.88.2", "request": "^2.88.2",
"tape": "^4.13.3", "tape": "^4.16.0",
"turf": "^3.0.14", "turf": "^3.0.14",
"uglify-js": "^3.13.9", "uglify-js": "^3.17.0",
"xmlbuilder": "^4.2.1" "xmlbuilder": "^4.2.1"
}, },
"bundleDependencies": [ "bundleDependencies": [

View File

@ -133,7 +133,7 @@ function setup()
road = default_speed, road = default_speed,
service = default_speed, service = default_speed,
track = 12, track = 12,
path = 12 path = 13
}, },
pedestrian_speeds = { pedestrian_speeds = {
@ -174,21 +174,25 @@ function setup()
surface_speeds = { surface_speeds = {
asphalt = default_speed, asphalt = default_speed,
chipseal = default_speed,
concrete = default_speed,
concrete_lanes = default_speed,
wood = 10,
["cobblestone:flattened"] = 10, ["cobblestone:flattened"] = 10,
paving_stones = 10, paving_stones = 10,
compacted = 10, compacted = 10,
cobblestone = 6, cobblestone = 7,
unpaved = 6, unpaved = 6,
fine_gravel = 6, fine_gravel = 10,
gravel = 6, gravel = 6,
pebblestone = 6, pebblestone = 6,
ground = 6, ground = 10,
dirt = 6, dirt = 8,
earth = 6, earth = 6,
grass = 6, grass = 6,
mud = 3, mud = 3,
sand = 3, sand = 3,
sett = 10 sett = 9
}, },
classes = Sequence { classes = Sequence {

View File

@ -7,13 +7,16 @@ echo "node version is:"
which node which node
node -v node -v
if [[ ${PUBLISH} == 'On' ]]; then
echo "PUBLISH is set to '${PUBLISH}', publishing!"
NPM_FLAGS='' NPM_FLAGS=''
if [[ ${BUILD_TYPE} == "Debug" ]]; then if [[ ${BUILD_TYPE} == "Debug" ]]; then
NPM_FLAGS='--debug' NPM_FLAGS='--debug'
fi fi
# append --target_arch in order to handle cross-compilation for Apple Silicon
if [[ "$ENABLE_APPLE_SILICON" == "ON" ]]; then
NPM_FLAGS="${NPM_FLAGS} --target_arch=arm64"
fi
echo "dumping binary meta..." echo "dumping binary meta..."
./node_modules/.bin/node-pre-gyp reveal $NPM_FLAGS ./node_modules/.bin/node-pre-gyp reveal $NPM_FLAGS
@ -32,6 +35,3 @@ if [[ ${PUBLISH} == 'On' ]]; then
fi fi
./node_modules/.bin/node-pre-gyp package testpackage $NPM_FLAGS ./node_modules/.bin/node-pre-gyp package testpackage $NPM_FLAGS
else
echo "PUBLISH is set to '${PUBLISH}', skipping."
fi

View File

@ -11,7 +11,7 @@ mkdir build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cd build cd build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_TOOLS=ON -G "Visual Studio 17 2022" .. cmake -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "Visual Studio 17 2022" ..
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
msbuild OSRM.sln ^ msbuild OSRM.sln ^
@ -25,10 +25,6 @@ msbuild OSRM.sln ^
/nologo /nologo
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR
dir C:\Users\runneradmin\.conan\
dir C:\Users\runneradmin\.conan\data\tbb\2020.3\_\_\package\e9a552ebe8f994398de9ceee972f0ad207df0658\lib\
SET PATH=C:\Users\runneradmin\.conan\data\tbb\2020.3\_\_\package\e9a552ebe8f994398de9ceee972f0ad207df0658\lib\;%PATH%
CD %PROJECT_DIR%\build CD %PROJECT_DIR%\build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF %ERRORLEVEL% NEQ 0 GOTO ERROR

View File

@ -617,12 +617,13 @@ IntersectionView convertToIntersectionView(const util::NodeBasedDynamicGraph &gr
std::vector<IntersectionViewDataWithAngle> pre_intersection_view; std::vector<IntersectionViewDataWithAngle> pre_intersection_view;
IntersectionViewData uturn{{SPECIAL_EDGEID, 0., 0., 0.}, false, 0.}; IntersectionViewData uturn{{SPECIAL_EDGEID, 0., 0., 0.}, false, 0.};
std::size_t allowed_uturns_number = 0; std::size_t allowed_uturns_number = 0;
for (const auto &outgoing_edge : outgoing_edges)
{
const auto is_uturn = [](const auto angle) { const auto is_uturn = [](const auto angle) {
return std::fabs(angle) < std::numeric_limits<double>::epsilon(); return std::fabs(angle) < std::numeric_limits<double>::epsilon();
}; };
for (const auto &outgoing_edge : outgoing_edges)
{
const auto edge_it = findEdge(edge_geometries, outgoing_edge.edge); const auto edge_it = findEdge(edge_geometries, outgoing_edge.edge);
const auto is_merged = merged_edges.count(outgoing_edge.edge) != 0; const auto is_merged = merged_edges.count(outgoing_edge.edge) != 0;
const auto is_turn_allowed = intersection::isTurnAllowed(graph, const auto is_turn_allowed = intersection::isTurnAllowed(graph,
@ -678,6 +679,7 @@ IntersectionView convertToIntersectionView(const util::NodeBasedDynamicGraph &gr
BOOST_ASSERT(uturn.eid != SPECIAL_EDGEID); BOOST_ASSERT(uturn.eid != SPECIAL_EDGEID);
if (uturn.entry_allowed || allowed_uturns_number == 0) if (uturn.entry_allowed || allowed_uturns_number == 0)
{ // Add the true U-turn if it is allowed or no other U-turns found { // Add the true U-turn if it is allowed or no other U-turns found
BOOST_ASSERT(uturn.angle == 0.);
pre_intersection_view.insert(pre_intersection_view.begin(), {uturn, 0}); pre_intersection_view.insert(pre_intersection_view.begin(), {uturn, 0});
} }
@ -706,6 +708,22 @@ IntersectionView convertToIntersectionView(const util::NodeBasedDynamicGraph &gr
} }
} }
auto no_uturn = std::none_of(pre_intersection_view.begin(),
pre_intersection_view.end(),
[&is_uturn](const IntersectionViewDataWithAngle &road) {
return is_uturn(road.first.angle);
});
// After all of this, if we now don't have a u-turn, let's add one to the intersection.
// This is a hack to fix the triggered assertion ( see:
// https://github.com/Project-OSRM/osrm-backend/issues/6218 ). Ideally we would fix this more
// robustly, but this will require overhauling all of the intersection logic.
if (no_uturn)
{
BOOST_ASSERT(!uturn.entry_allowed && allowed_uturns_number > 0);
BOOST_ASSERT(uturn.angle == 0.);
pre_intersection_view.insert(pre_intersection_view.begin(), {uturn, 0});
}
// Copy intersection view data // Copy intersection view data
IntersectionView intersection_view; IntersectionView intersection_view;
intersection_view.reserve(pre_intersection_view.size()); intersection_view.reserve(pre_intersection_view.size());

View File

@ -14,7 +14,7 @@ nodejs_init()
message(STATUS "Configuring node_osrm bindings for NodeJs ${NODEJS_VERSION}") message(STATUS "Configuring node_osrm bindings for NodeJs ${NODEJS_VERSION}")
add_nodejs_module(node_osrm node_osrm.cpp) add_nodejs_module(node_osrm node_osrm.cpp)
set_target_properties(node_osrm PROPERTIES CXX_STANDARD 14) set_target_properties(node_osrm PROPERTIES CXX_STANDARD 17)
# TODO: we disable clang-tidy for this target, because it causes errors in third-party NodeJs related headers # TODO: we disable clang-tidy for this target, because it causes errors in third-party NodeJs related headers
set_target_properties(node_osrm PROPERTIES CXX_CLANG_TIDY "") set_target_properties(node_osrm PROPERTIES CXX_CLANG_TIDY "")
# TODO: we turn off some warnings for this target, because it causes errors in third-party NodeJs related headers # TODO: we turn off some warnings for this target, because it causes errors in third-party NodeJs related headers