Compare commits

..

35 Commits

Author SHA1 Message Date
Patrick Niklaus cc0c28f366 Fix formating for cherry-picked commit 2017-03-09 12:05:01 +00:00
Michael Krasnyk 66cc99703c Compute correct speed values in tile plugin 2017-03-09 11:49:10 +00:00
Patrick Niklaus f7fbca3e5e Update changelog 2017-03-03 17:27:28 +00:00
Patrick Niklaus 9695eaa28a Fix tile datasize check 2017-03-03 16:03:47 +00:00
Patrick Niklaus 0d7546a510 Only allow restricted access for road of certain highway type 2017-03-03 16:03:36 +00:00
Michael Krasnyk 9dc8136240 Fix incorrect forward datasources getter in facade 2017-03-03 10:52:53 +00:00
Patrick Niklaus a02a83f8bd Other flakey test 2017-03-02 15:24:38 +00:00
Patrick Niklaus 9b18f55d29 Update changelog 2017-03-02 15:00:49 +00:00
Patrick Niklaus a3434e7ae9 Mark test as flaky and track in own issue. 2017-03-02 14:59:10 +00:00
Patrick Niklaus 64b15028e4 Print 0 rate 2017-03-02 14:58:14 +00:00
karenzshea d8e466fdaa simplify test, add intersection turn test 2017-03-02 14:58:01 +00:00
karenzshea 43bbe8f2ae add restricted penalty on NoTurn turns 2017-03-02 14:57:49 +00:00
karenzshea b5c10b1fbf clamp speed value to js max 2017-02-22 16:13:01 +00:00
Daniel J. Hofmann 57d93fc5dc Updates TBB to latest stable version for 5.6 release 2017-02-20 13:55:42 +00:00
karenzshea 3aba2bc2d0 expose data about turning onto restricted roads to turn function 2017-02-20 13:55:19 +00:00
Daniel J. Hofmann c42478f0ee Updates sol2 to v2.15.8, resolves #3733 2017-02-20 10:14:17 +00:00
Moritz Kobitzsch ea583a77ff reduce verbosity of use-lane in combination with lane-anticipation 2017-02-15 21:57:58 +00:00
Kajari Ghosh dd999e112e Update http.md
Clarify where optional rotary properties will be added
2017-02-15 21:56:30 +00:00
Daniel Patterson 69c54bef72 Allow routing on toll roads by default (#3712) 2017-02-14 20:02:15 -08:00
karenzshea cfee0f1109 add unit test for annotations=true returning all annotations 2017-02-13 18:11:47 +00:00
karenzshea c7ce758e1c parse parameters.annotations into AnnotationsType::All 2017-02-13 18:11:03 +00:00
Karen Shea 3ac4fb5933 add error logging for missing osrm file to library tests (#3704) 2017-02-13 17:22:42 +00:00
karenzshea 2afe5e971b use qi - parser to work with 0 speed file lines 2017-02-13 17:22:42 +00:00
karenzshea 519b744502 clang format 2017-02-13 17:22:42 +00:00
karenzshea d3c2ac671f round speed to 1 decimal place 2017-02-13 17:22:42 +00:00
karenzshea 07a1a907f8 add unit test to check that speeds are equal to distance/duration 2017-02-13 17:22:42 +00:00
karenzshea 062cae82a0 return speed annotations 2017-02-13 17:22:42 +00:00
Quinn Chrzan 316c7781a3 Unit testing docs (#3698)
* Updating library-tests and associated documentation to be more informative

* Fixing heading markup for updated unit testing docs
2017-02-13 17:22:42 +00:00
Karen Shea e11bcfece5 Update http.md 2017-02-13 17:22:42 +00:00
Moritz Kobitzsch cb8dee3e60 comments 2017-02-13 17:22:42 +00:00
Moritz Kobitzsch a1abe71d9f fix handling none-tags in presence of multiple turns within 2017-02-13 17:22:42 +00:00
Moritz Kobitzsch d54c837e51 add failing test 2017-02-13 17:22:42 +00:00
Patrick Niklaus 106d17541d Fix side road penalties and add test 2017-02-13 17:22:42 +00:00
Michael Krasnyk ad29b237e3 make annotations={true|false|(values)+} grammar 2017-02-13 17:22:42 +00:00
Patrick Niklaus febefb4684 Enable 5.6 travis builds 2017-02-10 14:40:33 +00:00
1174 changed files with 38666 additions and 28927 deletions
+2 -7
View File
@@ -47,9 +47,6 @@ Thumbs.db
/build/ /build/
/example/build/ /example/build/
/test/data/monaco* /test/data/monaco*
/test/data/ch
/test/data/corech
/test/data/mld
/cmake/postinst /cmake/postinst
# Eclipse related files # # Eclipse related files #
@@ -89,6 +86,7 @@ stxxl.errlog
/test/cache /test/cache
/test/speeds.csv /test/speeds.csv
/test/penalties.csv /test/penalties.csv
/test/data/monaco.*
node_modules node_modules
# Deprecated config file # # Deprecated config file #
@@ -98,7 +96,4 @@ node_modules
*.swp *.swp
# local lua debugging file # local lua debugging file
debug.lua debug.lua
# node-osrm artifacts
lib/binding
-10
View File
@@ -1,10 +0,0 @@
*
!README.md
!CHANGELOG.md
!CONTRIBUTING.MD
!LICENCE.TXT
!package.json
!example
!lib/*.js
!profiles/*
!profiles/lib/*
+36 -66
View File
@@ -7,18 +7,15 @@ git:
sudo: required sudo: required
dist: trusty dist: trusty
nodejs:
- "4"
notifications: notifications:
email: false email: false
branches: branches:
only: only:
- master - master
- "5.6"
cache: cache:
yarn: true
ccache: true ccache: true
apt: true apt: true
directories: directories:
@@ -30,8 +27,8 @@ env:
- CCACHE_COMPRESS=1 - CCACHE_COMPRESS=1
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742 - CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
- CCACHE_VERSION=3.3.1 - CCACHE_VERSION=3.3.1
- CMAKE_VERSION=3.7.2 - CMAKE_VERSION=3.6.2
- MASON="$(pwd)/scripts/mason.sh" - MASON="$(pwd)/third_party/mason/mason"
matrix: matrix:
fast_finish: true fast_finish: true
@@ -46,23 +43,21 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
- os: linux - os: linux
compiler: "clang-4.0-debug" compiler: "clang-3.9-debug"
addons: &clang40 addons: &clang38
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000 env: CLANG_VERSION='3.9.1' BUILD_TYPE='Debug' BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
- os: linux - os: osx
compiler: "mason-linux-debug-santize" osx_image: xcode8.2
addons: compiler: "mason-osx-release"
apt: # we use the xcode provides clang and don't install our own
sources: ['ubuntu-toolchain-r-test'] env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON ENABLE_NODE_BINDINGS=ON
# Release Builds # Release Builds
- os: linux - os: linux
@@ -71,7 +66,7 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON
- os: linux - os: linux
compiler: "gcc-6-release" compiler: "gcc-6-release"
@@ -79,13 +74,13 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_COMPONENTS=ON
- os: linux - os: linux
compiler: "gcc-6-release-i686" compiler: "gcc-6-release-i686"
env: > env: >
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
- os: linux - os: linux
compiler: "gcc-4.9-release" compiler: "gcc-4.9-release"
@@ -95,20 +90,14 @@ matrix:
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache'] packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release' env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
- os: osx
osx_image: xcode8.2
compiler: "mason-osx-release"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON
# Disabled because of CI slowness # Disabled because of CI slowness
#- os: linux #- os: linux
#- compiler: clang #- compiler: clang
#- addons: &clang40 #- addons: &clang38
#- apt: #- apt:
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test'] #- sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
#- packages: ['clang-4.0', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] #- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' #- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
# Shared Library # Shared Library
- os: linux - os: linux
@@ -117,16 +106,16 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON BUILD_COMPONENTS=ON
# Disabled because CI slowness # Disabled because CI slowness
#- os: linux #- os: linux
#- compiler: clang #- compiler: clang
#- addons: &clang40 #- addons: &clang38
#- apt: #- apt:
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test'] #- sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
#- packages: ['clang-4.0', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] #- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON #- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
before_install: before_install:
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi - if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
@@ -142,18 +131,13 @@ before_install:
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export JOBS=$((`sysctl -n hw.ncpu` + 1)) export JOBS=$((`sysctl -n hw.ncpu` + 1))
sudo mdutil -i off / sudo mdutil -i off /
npm install -g yarn
fi fi
- echo "Using ${JOBS} jobs" - echo "Using ${JOBS} jobs"
- yarn install --ignore-scripts - source ./scripts/install_node.sh 4
# Bootstrap cmake to be able to run mason - npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}.tar.gz" - npm install
- CMAKE_DIR="mason_packages/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}"
- mkdir -p ${CMAKE_DIR}
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} || exit 1
- export PATH=${CMAKE_DIR}/bin:${PATH}
- ${MASON} install tbb 2017_20161128 && export LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_20161128)/lib/:${LD_LIBRARY_PATH}
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH} - ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
- ${MASON} install cmake ${CMAKE_VERSION} && export PATH=$(${MASON} prefix cmake ${CMAKE_VERSION})/bin:${PATH}
- | - |
if [[ ! -z ${CLANG_VERSION} ]]; then if [[ ! -z ${CLANG_VERSION} ]]; then
export CCOMPILER='clang' export CCOMPILER='clang'
@@ -176,16 +160,7 @@ install:
- export OSRM_BUILD_DIR="$(pwd)/build-osrm" - export OSRM_BUILD_DIR="$(pwd)/build-osrm"
- mkdir ${OSRM_BUILD_DIR} && pushd ${OSRM_BUILD_DIR} - mkdir ${OSRM_BUILD_DIR} && pushd ${OSRM_BUILD_DIR}
- export CC=${CCOMPILER} CXX=${CXXCOMPILER} - export CC=${CCOMPILER} CXX=${CXXCOMPILER}
- | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
-DBUILD_TOOLS=ON \
-DENABLE_CCACHE=ON
- echo "travis_fold:start:MAKE" - echo "travis_fold:start:MAKE"
- make --jobs=${JOBS} - make --jobs=${JOBS}
- make tests --jobs=${JOBS} - make tests --jobs=${JOBS}
@@ -197,37 +172,32 @@ install:
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo ldconfig sudo ldconfig
fi fi
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
- popd - popd
- mkdir example/build && pushd example/build - mkdir example/build && pushd example/build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make --jobs=${JOBS} - make --jobs=${JOBS}
- popd - popd
# building docs only works with npm3+ not with yarn or npm2 - npm run build-api-docs
#- yarn run docs
script: script:
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi - if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
- echo "travis_fold:start:BENCHMARK"
- make -C test/data benchmark - make -C test/data benchmark
- ./example/build/osrm-example test/data/ch/monaco.osrm - echo "travis_fold:end:BENCHMARK"
- ./example/build/osrm-example test/data/monaco.osrm
# All tests assume to be run from the build directory # All tests assume to be run from the build directory
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
- ./unit_tests/library-tests - ./unit_tests/library-tests ../test/data/monaco.osrm
- ./unit_tests/extractor-tests - ./unit_tests/extractor-tests
- ./unit_tests/engine-tests - ./unit_tests/engine-tests
- ./unit_tests/util-tests - ./unit_tests/util-tests
- ./unit_tests/server-tests - ./unit_tests/server-tests
- ./unit_tests/partition-tests
- popd - popd
- yarn test - npm test
after_success: after_success:
- | - |
if [ -n "${ENABLE_COVERAGE}" ]; then if [ -n "${ENABLE_COVERAGE}" ]; then
bash <(curl -s https://codecov.io/bash) bash <(curl -s https://codecov.io/bash)
fi fi
- |
if [ -n "${ENABLE_NODE_BINDINGS}" ]; then
source ./scripts/travis/build.sh
./scripts/travis/publish.sh
fi
+2 -11
View File
@@ -1,13 +1,3 @@
# 5.7.0
- Changes from 5.6
- NodeJs Bindings
- Merged https://github.com/Project-OSRM/node-osrm into repository. Build via `cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On`.
- Internals
- Shared memory notification via conditional variables on Linux or semaphore queue on OS X and Windows with a limit of 128 OSRM Engine instances
- Files
- .osrm.datasource_index file was removed. Data is now part of .osrm.geometries.
- .osrm.edge_lookup was removed. The option `--generate-edge-lookup` does nothing now.
- `osrm-contract` does not depend on the `.osrm.fileIndex` file anymore
# 5.6.3 # 5.6.3
- Changes from 5.6.0 - Changes from 5.6.0
@@ -18,11 +8,12 @@
- Changes from 5.6.0 - Changes from 5.6.0
- Bugfixes - Bugfixes
- Fix incorrect forward datasources getter in facade - Fix incorrect forward datasources getter in facade
- Fix include `access=private` non-car roads in the car profile
# 5.6.1 # 5.6.1
- Changes from 5.6.0 - Changes from 5.6.0
- Bugfixes - Bugfixes
- Fix #3754 add restricted penalty on NoTurn turns - Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
# 5.6.0 # 5.6.0
- Changes from 5.5 - Changes from 5.5
+31 -106
View File
@@ -24,19 +24,15 @@ option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
option(ENABLE_LTO "Use LTO if available" OFF) option(ENABLE_LTO "Use LTO if available" OFF)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON) option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(ENABLE_MASON) if(ENABLE_MASON)
# versions in use # versions in use
set(MASON_BOOST_VERSION "1.63.0") set(MASON_BOOST_VERSION "1.63.0")
set(MASON_STXXL_VERSION "1.4.1-1") set(MASON_STXXL_VERSION "1.4.1")
set(MASON_EXPAT_VERSION "2.2.0") set(MASON_EXPAT_VERSION "2.2.0")
set(MASON_LUA_VERSION "5.2.4") set(MASON_LUA_VERSION "5.2.4")
set(MASON_BZIP2_VERSION "1.0.6") set(MASON_BZIP2_VERSION "1.0.6")
set(MASON_TBB_VERSION "2017_20161128") set(MASON_TBB_VERSION "2017_20161128")
set(MASON_LIBSHP_VERSION "1.3.0")
message(STATUS "Enabling mason") message(STATUS "Enabling mason")
@@ -45,7 +41,8 @@ if(ENABLE_MASON)
message(FATAL_ERROR "curl command required with -DENABLE_MASON") message(FATAL_ERROR "curl command required with -DENABLE_MASON")
endif() endif()
include(mason) set(MASON_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason)
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason.cmake)
endif() endif()
# be compatible with version handling before cmake 3.x # be compatible with version handling before cmake 3.x
@@ -54,7 +51,7 @@ if (POLICY CMP0048)
endif() endif()
project(OSRM C CXX) project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5) set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 7) set(OSRM_VERSION_MINOR 5)
set(OSRM_VERSION_PATCH 0) set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}") set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
@@ -66,11 +63,9 @@ add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
# include_directories and add_definitions for both # include_directories and add_definitions for both
# this build and for sharing externally via pkg-config # this build and for sharing externally via pkg-config
function(add_dependency_includes) function(add_dependency_includes includes)
if(${ARGC} GREATER 0) list(APPEND DEPENDENCIES_INCLUDE_DIRS "${includes}")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${ARGV}") set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
endif()
endfunction(add_dependency_includes) endfunction(add_dependency_includes)
function(add_dependency_defines defines) function(add_dependency_defines defines)
@@ -83,6 +78,8 @@ include(CheckCXXCompilerFlag)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
include(GNUInstallDirs) include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(bitness 32) set(bitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bitness 64) set(bitness 64)
@@ -119,20 +116,14 @@ configure_file(
) )
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp) file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp) file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
file(GLOB PartitionerGlob src/partition/*.cpp)
file(GLOB CustomizerGlob src/customize/*.cpp)
file(GLOB ContractorGlob src/contractor/*.cpp) file(GLOB ContractorGlob src/contractor/*.cpp)
file(GLOB UpdaterGlob src/updater/*.cpp)
file(GLOB StorageGlob src/storage/*.cpp) file(GLOB StorageGlob src/storage/*.cpp)
file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp) file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp) file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
add_library(UTIL OBJECT ${UtilGlob}) add_library(UTIL OBJECT ${UtilGlob})
add_library(EXTRACTOR OBJECT ${ExtractorGlob}) add_library(EXTRACTOR OBJECT ${ExtractorGlob})
add_library(PARTITIONER OBJECT ${PartitionerGlob})
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
add_library(CONTRACTOR OBJECT ${ContractorGlob}) add_library(CONTRACTOR OBJECT ${ContractorGlob})
add_library(UPDATER OBJECT ${UpdaterGlob})
add_library(STORAGE OBJECT ${StorageGlob}) add_library(STORAGE OBJECT ${StorageGlob})
add_library(ENGINE OBJECT ${EngineGlob}) add_library(ENGINE OBJECT ${EngineGlob})
add_library(SERVER OBJECT ${ServerGlob}) add_library(SERVER OBJECT ${ServerGlob})
@@ -140,17 +131,12 @@ add_library(SERVER OBJECT ${ServerGlob})
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
add_executable(osrm-extract src/tools/extract.cpp) add_executable(osrm-extract src/tools/extract.cpp)
add_executable(osrm-partition src/tools/partition.cpp)
add_executable(osrm-customize src/tools/customize.cpp)
add_executable(osrm-contract src/tools/contract.cpp) add_executable(osrm-contract src/tools/contract.cpp)
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>) add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>) add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>) add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>) add_library(osrm_extract $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>) add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_partition $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_customize $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>) add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
if(ENABLE_GOLD_LINKER) if(ENABLE_GOLD_LINKER)
@@ -173,13 +159,6 @@ if(ENABLE_GOLD_LINKER)
endif() endif()
endif() endif()
# Disable LTO when mason+gcc is detected before testing for / setting any flags.
# Mason builds libraries with Clang, mixing does not work in the context of lto.
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND ENABLE_LTO)
set(ENABLE_LTO OFF)
message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
endif()
# Explicitly set the build type to Release if no other type is specified # Explicitly set the build type to Release if no other type is specified
# on the command line. Without this, cmake defaults to an unoptimized, # on the command line. Without this, cmake defaults to an unoptimized,
# non-debug build, which almost nobody wants. # non-debug build, which almost nobody wants.
@@ -307,7 +286,7 @@ endif()
# Configuring compilers # Configuring compilers
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(COLOR_FLAG "-fdiagnostics-color=auto") set(COLOR_FLAG "-fdiagnostics-color=auto")
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG) check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
@@ -320,21 +299,12 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
add_dependency_defines(-DWIN32) add_dependency_defines(-DWIN32)
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32) set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
endif() 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} STREQUAL "Intel") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
# using Intel C++ # using Intel C++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
# using Visual Studio C++ # using Visual Studio C++
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib) set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # avoid compiler error C1128 from scripting_environment_lua.cpp
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC) add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS) add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS)
add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation
@@ -445,10 +415,6 @@ if(ENABLE_MASON)
add_dependency_includes(${MASON_PACKAGE_tbb_INCLUDE_DIRS}) add_dependency_includes(${MASON_PACKAGE_tbb_INCLUDE_DIRS})
set(TBB_LIBRARIES ${MASON_PACKAGE_tbb_LDFLAGS}) set(TBB_LIBRARIES ${MASON_PACKAGE_tbb_LDFLAGS})
mason_use(libshp2 VERSION ${MASON_LIBSHP_VERSION})
set(LIBSHAPEFILE_INCLUDE_DIR ${MASON_PACKAGE_libshp2_INCLUDE_DIRS})
set(LIBSHAPEFILE_LIBRARY ${MASON_PACKAGE_libshp2_LDFLAGS})
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS) if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work") message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
endif() endif()
@@ -538,9 +504,7 @@ else()
# note libosmium depends on expat and bzip2 # note libosmium depends on expat and bzip2
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
if(NOT OSMIUM_INCLUDE_DIR) set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
endif()
find_package(Osmium REQUIRED COMPONENTS io) find_package(Osmium REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR}) include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
@@ -600,8 +564,6 @@ set(BOOST_ENGINE_LIBRARIES
# Binaries # Binaries
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-partition osrm_partition ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-customize osrm_customize ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY}) target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
@@ -617,25 +579,6 @@ set(EXTRACTOR_LIBRARIES
${TBB_LIBRARIES} ${TBB_LIBRARIES}
${ZLIB_LIBRARY} ${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}) ${MAYBE_COVERAGE_LIBRARIES})
set(PARTITIONER_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
set(CUSTOMIZER_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(UPDATER_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(CONTRACTOR_LIBRARIES set(CONTRACTOR_LIBRARIES
${BOOST_BASE_LIBRARIES} ${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
@@ -665,11 +608,8 @@ set(UTIL_LIBRARIES
${MAYBE_COVERAGE_LIBRARIES}) ${MAYBE_COVERAGE_LIBRARIES})
# Libraries # Libraries
target_link_libraries(osrm ${ENGINE_LIBRARIES}) target_link_libraries(osrm ${ENGINE_LIBRARIES})
target_link_libraries(osrm_update ${UPDATER_LIBRARIES}) target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update)
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES}) target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update)
target_link_libraries(osrm_store ${STORAGE_LIBRARIES}) target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# BUILD_COMPONENTS # BUILD_COMPONENTS
@@ -685,11 +625,10 @@ if(BUILD_TOOLS)
install(TARGETS osrm-io-benchmark DESTINATION bin) install(TARGETS osrm-io-benchmark DESTINATION bin)
find_package(Shapefile) # package libshp-dev find_package(Shapefile) # package libshp-dev
if(SHAPEFILE_FOUND AND (Boost_VERSION VERSION_GREATER 106000 OR ENABLE_MASON)) if(Shapefile_FOUND)
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>) add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR}) target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LIBSHAPEFILE_LIBRARY})
${LIBSHAPEFILE_LIBRARY} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARY} ${EXPAT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS osrm-extract-conditionals DESTINATION bin) install(TARGETS osrm-extract-conditionals DESTINATION bin)
endif() endif()
endif() endif()
@@ -703,7 +642,6 @@ endif()
# (i.e., from /usr/local/bin/) the linker can find library dependencies. For # (i.e., from /usr/local/bin/) the linker can find library dependencies. For
# more info see http://www.cmake.org/Wiki/CMake_RPATH_handling # more info see http://www.cmake.org/Wiki/CMake_RPATH_handling
set_property(TARGET osrm-extract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-extract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-partition PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
@@ -714,27 +652,22 @@ file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp) set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp) set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp) set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp) set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp) set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
install(FILES ${EngineHeader} DESTINATION include/osrm/engine) install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
install(FILES ${UtilHeader} DESTINATION include/osrm/util) install(FILES ${UtilHeader} DESTINATION include/osrm/util)
install(FILES ${StorageHeader} DESTINATION include/osrm/storage) install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor) install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partition)
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor) install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
install(FILES ${LibraryGlob} DESTINATION include/osrm) install(FILES ${LibraryGlob} DESTINATION include/osrm)
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api) install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
install(FILES ${VariantGlob} DESTINATION include/mapbox) install(FILES ${VariantGlob} DESTINATION include/mapbox)
install(TARGETS osrm-extract DESTINATION bin) install(TARGETS osrm-extract DESTINATION bin)
install(TARGETS osrm-partition DESTINATION bin)
install(TARGETS osrm-contract DESTINATION bin) install(TARGETS osrm-contract DESTINATION bin)
install(TARGETS osrm-datastore DESTINATION bin) install(TARGETS osrm-datastore DESTINATION bin)
install(TARGETS osrm-routed DESTINATION bin) install(TARGETS osrm-routed DESTINATION bin)
install(TARGETS osrm DESTINATION lib) install(TARGETS osrm DESTINATION lib)
install(TARGETS osrm_extract DESTINATION lib) install(TARGETS osrm_extract DESTINATION lib)
install(TARGETS osrm_partition DESTINATION lib)
install(TARGETS osrm_update DESTINATION lib)
install(TARGETS osrm_contract DESTINATION lib) install(TARGETS osrm_contract DESTINATION lib)
install(TARGETS osrm_store DESTINATION lib) install(TARGETS osrm_store DESTINATION lib)
@@ -801,11 +734,6 @@ add_custom_target(uninstall
add_subdirectory(unit_tests) add_subdirectory(unit_tests)
add_subdirectory(src/benchmarks) add_subdirectory(src/benchmarks)
if (ENABLE_NODE_BINDINGS)
add_subdirectory(src/nodejs)
endif()
if (ENABLE_FUZZING) if (ENABLE_FUZZING)
# Requires libosrm being built with sanitizers; make configurable and default to ubsan # Requires libosrm being built with sanitizers; make configurable and default to ubsan
set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing") set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing")
@@ -821,21 +749,18 @@ if (ENABLE_FUZZING)
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) set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
if (ENABLE_NODE_BINDINGS) file(GLOB_RECURSE headers_to_check
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers") ${PROJECT_BINARY_DIR}/*.hpp
file(GLOB_RECURSE headers_to_check ${PROJECT_SOURCE_DIR}/include/*.hpp)
${PROJECT_BINARY_DIR}/*.hpp foreach(header ${headers_to_check})
${PROJECT_SOURCE_DIR}/include/*.hpp) get_filename_component(filename ${header} NAME_WE)
foreach(header ${headers_to_check}) set(filename "${check_headers_dir}/${filename}.cpp")
get_filename_component(filename ${header} NAME_WE) if (NOT EXISTS ${filename})
set(filename "${check_headers_dir}/${filename}.cpp") file(WRITE ${filename} "#include \"${header}\"\n")
if (NOT EXISTS ${filename}) endif()
file(WRITE ${filename} "#include \"${header}\"\n") list(APPEND sources ${filename})
endif() endforeach()
list(APPEND sources ${filename}) add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
endforeach() set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
endif()
+15 -34
View File
@@ -20,15 +20,6 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine - [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend - [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response - [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
- [osrm-backend-docker](https://hub.docker.com/r/osrm/osrm-backend/) - Ready to use Docker images
## Documentation
### Full documentation
- [Hosted documentation](http://project-osrm.org)
- [osrm-routed HTTP API documentation](docs/http.md)
- [libosrm API documentation](docs/libosrm.md)
## Contact ## Contact
@@ -37,29 +28,10 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
## Quick Start ## Quick Start
The easiest and quickest way to setup your own routing engine backend is to use Docker images we provide.
### Using Docker
We base the Docker images on Alpine Linux and make sure they are as lightweight as possible (around 10-15 MB).
In the following, replace `X.Y.Z` with the current stable release version.
```
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-contract /data/berlin-latest.osrm
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-routed /data/berlin-latest.osrm
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
```
### Building from Source
The following targets Ubuntu 16.04. The following targets Ubuntu 16.04.
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki). For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
Install dependencies #### Install dependencies
```bash ```bash
sudo apt install build-essential git cmake pkg-config \ sudo apt install build-essential git cmake pkg-config \
@@ -67,7 +39,7 @@ libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
``` ```
Compile and install OSRM binaries #### Compile and install OSRM binaries:
```bash ```bash
mkdir -p build mkdir -p build
@@ -77,13 +49,13 @@ cmake --build .
sudo cmake --build . --target install sudo cmake --build . --target install
``` ```
Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/) #### Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
```bash ```bash
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
``` ```
Pre-process the extract and start the HTTP server #### Pre-process the extract and start the HTTP server
``` ```
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
@@ -91,13 +63,22 @@ osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm osrm-routed berlin-latest.osrm
``` ```
Running Queries #### Running Queries
``` ```
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
``` ```
### Request Against the Demo Server ## Documentation
### Full documentation
- [Hosted documentation](http://project-osrm.org)
- [osrm-routed HTTP API documentation](docs/http.md)
- [libosrm API documentation](docs/libosrm.md)
### Running a request against the Demo Server
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy). Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
Simple query with instructions and alternatives on Berlin: Simple query with instructions and alternatives on Berlin:
+2 -14
View File
@@ -134,23 +134,11 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running library-tests.exe ... ECHO running library-tests.exe ...
SET test_region=monaco SET test_region=monaco
SET test_region_ch=ch\monaco
SET test_region_corech=corech\monaco
SET test_region_mld=mld\monaco
SET test_osm=%test_region%.osm.pbf SET test_osm=%test_region%.osm.pbf
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm% IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm% %Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
MKDIR ch %Configuration%\osrm-contract.exe %test_region%.osrm
XCOPY %test_region%.osrm %test_region%.osrm.* ch\ unit_tests\%Configuration%\library-tests.exe %test_region%.osrm
MKDIR corech
XCOPY %test_region%.osrm %test_region%.osrm.* corech\
MKDIR mld
XCOPY %test_region%.osrm %test_region%.osrm.* mld\
%Configuration%\osrm-contract.exe %test_region_ch%.osrm
%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
%Configuration%\osrm-partition.exe %test_region_mld%.osrm
%Configuration%\osrm-customize.exe %test_region_mld%.osrm
unit_tests\%Configuration%\library-tests.exe
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
ECHO ========= CREATING PACKAGES ========== ECHO ========= CREATING PACKAGES ==========
+2 -2
View File
@@ -23,8 +23,8 @@ build_script:
before_test: before_test:
- node --version - node --version
- npm --version - npm --version
- npm install --ignore-scripts - npm install
- npm link --ignore-scripts - npm link
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH% - SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
- SET OSRM_BUILD_DIR=build\%Configuration% - SET OSRM_BUILD_DIR=build\%Configuration%
- npm test - npm test
+11 -13
View File
@@ -57,7 +57,7 @@
if (WIN32) if (WIN32)
# has em64t/vc8 em64t/vc9 # has em64t/vc8 em64t/vc9
# has ia32/vc7.1 ia32/vc8 ia32/vc9 # has ia32/vc7.1 ia32/vc8 ia32/vc9
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB") set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_NAME "tbb")
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
@@ -102,7 +102,7 @@ if (UNIX)
endif(NOT TBB_ARCHITECTURE) endif(NOT TBB_ARCHITECTURE)
else (APPLE) else (APPLE)
# LINUX # LINUX
set(_TBB_DEFAULT_INSTALL_DIR "/usr") set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_NAME "tbb")
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
@@ -185,14 +185,15 @@ set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
# containing the headers. # containing the headers.
find_path(TBB_INCLUDE_DIR find_path(TBB_INCLUDE_DIR
tbb/task_scheduler_init.h tbb/task_scheduler_init.h
HINTS ${TBB_INC_SEARCH_DIR} ENV CPATH PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
) )
mark_as_advanced(TBB_INCLUDE_DIR) mark_as_advanced(TBB_INCLUDE_DIR)
#-- Look for libraries #-- Look for libraries
# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh] # GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
set (_TBB_LIBRARY_DIR set (_TBB_LIBRARY_DIR
${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM} ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
) )
@@ -212,11 +213,6 @@ endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "
# GvdB: Mac OS X distribution places libraries directly in lib directory. # GvdB: Mac OS X distribution places libraries directly in lib directory.
list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib) list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
if(EXISTS ${_TBB_INSTALL_DIR}/build)
file(GLOB _TBB_BUILD_DIR_RELEASE ${_TBB_INSTALL_DIR}/build/*_release)
file(GLOB _TBB_BUILD_DIR_DEBUG ${_TBB_INSTALL_DIR}/build/*_debug)
endif()
# Jiri: No reason not to check the default paths. From recent versions, # Jiri: No reason not to check the default paths. From recent versions,
# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH # tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
# variables, which now point to the directories of the lib files. # variables, which now point to the directories of the lib files.
@@ -226,8 +222,10 @@ endif()
# and LD_LIBRARY_PATH environment variables is now even more important # and LD_LIBRARY_PATH environment variables is now even more important
# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates # that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
# the use of TBB built from sources. # the use of TBB built from sources.
find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_BUILD_DIR_RELEASE} ${_TBB_LIBRARY_DIR}) find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_BUILD_DIR_RELEASE} ${_TBB_LIBRARY_DIR}) PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
#Extract path from TBB_LIBRARY name #Extract path from TBB_LIBRARY name
get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH) get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
@@ -238,9 +236,9 @@ mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
#-- Look for debug libraries #-- Look for debug libraries
# Jiri: Changed the same way as for the release libraries. # Jiri: Changed the same way as for the release libraries.
find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_BUILD_DIR_DEBUG} ${_TBB_LIBRARY_DIR} find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_BUILD_DIR_DEBUG} ${_TBB_LIBRARY_DIR} find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
# Jiri: Self-built TBB stores the debug libraries in a separate directory. # Jiri: Self-built TBB stores the debug libraries in a separate directory.
-587
View File
@@ -1,587 +0,0 @@
# Copyright (c) 2015, Colin Taylor
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# FindNodeJS.cmake CMake module vendored from the node-cmake project (v1.2).
# This script uses CMake 3.1+ features
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1.0)
message(FATAL_ERROR "FindNodeJS.cmake uses CMake 3.1+ features")
endif()
# Force a build type to be set (ignored on config based generators)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
endif()
# Capture module information
set(NodeJS_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
get_filename_component(NodeJS_MODULE_NAME ${NodeJS_MODULE_PATH} NAME)
# Allow users to specify the installed location of the Node.js package
set(NodeJS_ROOT_DIR "" CACHE PATH
"The root directory of the node.js installed package")
# Allow users to specify that downloaded sources should be used
option(NodeJS_DOWNLOAD "Download the required source files" Off)
# Allow users to force downloading of node packages
option(NodeJS_FORCE_DOWNLOAD "Download the source files every time" Off)
# Allow users to force archive extraction
option(NodeJS_FORCE_EXTRACT "Extract the archive every time" Off)
# Make libc++ the default when compiling with clang
option(NodeJS_USE_CLANG_STDLIB "Use libc++ when compiling with clang" On)
if(APPLE)
set(NodeJS_USE_CLANG_STDLIB On CACHE BOOL "" FORCE)
endif()
if(WIN32)
# Allow users to specify that the executable should be downloaded
option(NodeJS_DOWNLOAD_EXECUTABLE
"Download matching executable if available" Off
)
endif()
# Try to find the node.js executable
# The node executable under linux may not be the correct program
find_program(NodeJS_EXECUTABLE
NAMES node
PATHS ${NodeJS_ROOT_DIR}
PATH_SUFFIXES nodejs node
)
set(NodeJS_VALIDATE_EXECUTABLE 1)
if(NodeJS_EXECUTABLE)
execute_process(
COMMAND ${NodeJS_EXECUTABLE} --version
RESULT_VARIABLE NodeJS_VALIDATE_EXECUTABLE
OUTPUT_VARIABLE NodeJS_INSTALLED_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${NodeJS_EXECUTABLE} -p "process.platform"
OUTPUT_VARIABLE NodeJS_INSTALLED_PLATFORM
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${NodeJS_EXECUTABLE} -p "process.arch"
OUTPUT_VARIABLE NodeJS_INSTALLED_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
# If node isn't the node.js binary, try the nodejs binary
if(NOT NodeJS_VALIDATE_EXECUTABLE EQUAL 0)
find_program(NodeJS_EXECUTABLE
NAMES nodejs
PATHS ${NodeJS_ROOT_DIR}
PATH_SUFFIXES nodejs node
)
set(NodeJS_VALIDATE_EXECUTABLE 1)
if(NodeJS_EXECUTABLE)
execute_process(
COMMAND ${NodeJS_EXECUTABLE} --version
RESULT_VARIABLE NodeJS_VALIDATE_EXECUTABLE
OUTPUT_VARIABLE NodeJS_INSTALLED_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
if(NOT NodeJS_VALIDATE_EXECUTABLE EQUAL 0)
message(WARNING "Node.js executable could not be found. \
Set NodeJS_ROOT_DIR to the installed location of the executable or \
install Node.js to its default location.")
endif()
endif()
# Determine if a variant is set in the components
list(APPEND NodeJS_OTHER_COMPONENTS
X64 IA32 ARM WIN32 LINUX DARWIN
)
set(NodeJS_COMPONENTS_CONTAINS_VARIANT False)
foreach(NodeJS_COMPONENT ${NodeJS_FIND_COMPONENTS})
list(FIND NodeJS_OTHER_COMPONENTS ${NodeJS_COMPONENT} NodeJS_OTHER_INDEX)
if(NodeJS_OTHER_INDEX EQUAL -1)
set(NodeJS_COMPONENTS_CONTAINS_VARIANT True)
break()
endif()
endforeach()
# Get the targeted version of Node.js (or one of its derivatives)
if(NOT NodeJS_VERSION)
if(NodeJS_FIND_VERSION)
set(NodeJS_VERSION ${NodeJS_FIND_VERSION})
elseif(NodeJS_INSTALLED_VERSION AND NOT NodeJS_COMPONENTS_CONTAINS_VARIANT)
string(SUBSTRING ${NodeJS_INSTALLED_VERSION} 1 -1 NodeJS_VERSION)
else()
message(FATAL_ERROR "Node.js version is not set. Set the VERSION \
property of the find_package command to the required version of the \
Node.js sources")
endif()
endif()
# Determine the target platform for the compiled module
# Uses several mechanisms in order:
#
# 1. CMake cache (allows overriding on the command line)
# 2. Node architecture when binary is available
# 3. CMake architecture
#
set(NodeJS_PLATFORM "" CACHE STRING "Target node.js platform for module")
if(NOT NodeJS_PLATFORM)
if(NodeJS_EXECUTABLE)
set(NodeJS_PLATFORM ${NodeJS_INSTALLED_PLATFORM})
elseif(WIN32)
set(NodeJS_PLATFORM "win32")
elseif(UNIX)
if(APPLE)
set(NodeJS_PLATFORM "darwin")
else()
set(NodeJS_PLATFORM "linux")
endif()
else()
message(FATAL_ERROR "Node.js platform is not set. Add the platform \
to the find_package components section or set NodeJS_PLATFORM in the \
cache.")
endif()
endif()
# Convenience variables for the platform type
if(NodeJS_PLATFORM STREQUAL "win32")
set(NodeJS_PLATFORM_WIN32 True)
set(NodeJS_PLATFORM_LINUX False)
set(NodeJS_PLATFORM_DARWIN False)
elseif(NodeJS_PLATFORM STREQUAL "linux")
set(NodeJS_PLATFORM_WIN32 False)
set(NodeJS_PLATFORM_LINUX True)
set(NodeJS_PLATFORM_DARWIN False)
elseif(NodeJS_PLATFORM STREQUAL "darwin")
set(NodeJS_PLATFORM_WIN32 False)
set(NodeJS_PLATFORM_LINUX False)
set(NodeJS_PLATFORM_DARWIN True)
endif()
# Determine the target architecture for the compiled module
# Uses several mechanisms in order:
#
# 1. CMake cache (allows overriding on the command line)
# 2. Node architecture when binary is available
# 3. Compiler architecture under MSVC
#
set(NodeJS_ARCH "" CACHE STRING "Target node.js architecture for module")
if(NOT NodeJS_ARCH)
if(NodeJS_EXECUTABLE)
set(NodeJS_ARCH ${NodeJS_INSTALLED_ARCH})
elseif(MSVC)
if(CMAKE_CL_64)
set(NodeJS_ARCH "x64")
else()
set(NodeJS_ARCH "ia32")
endif()
else()
message(FATAL_ERROR "Node.js architecture is not set. Add the \
architecture to the find_package components section or set NodeJS_ARCH \
in the cache.")
endif()
endif()
# Convenience variables for the architecture
if(NodeJS_ARCH STREQUAL "x64")
set(NodeJS_ARCH_X64 True)
set(NodeJS_ARCH_IA32 False)
set(NodeJS_ARCH_ARM False)
elseif(NodeJS_ARCH STREQUAL "ia32")
set(NodeJS_ARCH_X64 False)
set(NodeJS_ARCH_IA32 True)
set(NodeJS_ARCH_ARM False)
elseif(NodeJS_ARCH STREQUAL "arm")
set(NodeJS_ARCH_X64 False)
set(NodeJS_ARCH_IA32 False)
set(NodeJS_ARCH_ARM True)
endif()
# Include helper functions
include(util/NodeJSUtil)
# Default variant name
# Used by the installed header comparison below
set(NodeJS_DEFAULT_VARIANT_NAME "node.js")
# Variables for Node.js artifacts across variants
# Specify all of these variables for each new variant
set(NodeJS_VARIANT_NAME "") # The printable name of the variant
set(NodeJS_VARIANT_BASE "") # A file name safe version of the variant
set(NodeJS_URL "") # The URL for the artifacts
set(NodeJS_SOURCE_PATH "") # The URL path of the source archive
set(NodeJS_CHECKSUM_PATH "") # The URL path of the checksum file
set(NodeJS_CHECKSUM_TYPE "") # The checksum type (algorithm)
set(NodeJS_WIN32_LIBRARY_PATH "") # The URL path of the windows library
set(NodeJS_WIN32_BINARY_PATH "") # The URL path of the windows executable
set(NodeJS_WIN32_LIBRARY_NAME "") # The name of the windows library
set(NodeJS_WIN32_BINARY_NAME "") # The name of the windows executable
set(NodeJS_DEFAULT_INCLUDE True) # Enable default include behavior
set(NodeJS_DEFAULT_LIBS True) # Include the default libraries
set(NodeJS_HAS_WIN32_PREFIX True) # Does the variant use library prefixes
set(NodeJS_HAS_WIN32_BINARY True) # Does the variant have win32 executables
set(NodeJS_HAS_OPENSSL True) # Does the variant include openssl headers
set(NodeJS_HEADER_VERSION 0.12.7) # Version after header-only archives start
set(NodeJS_SHA256_VERSION 0.7.0) # Version after sha256 checksums start
set(NodeJS_PREFIX_VERSION 0.12.7) # Version after windows prefixing starts
set(NodeJS_CXX11R_VERSION 0.12.7) # Version after c++11 is required
set(NodeJS_SOURCE_INCLUDE True) # Use the include paths from a source archive
set(NodeJS_HEADER_INCLUDE False) # Use the include paths from a header archive
set(NodeJS_INCLUDE_PATHS "") # Set of header dirs inside the source archive
set(NodeJS_LIBRARIES "") # The set of libraries to link with addon
set(NodeJS_WIN32_DELAYLOAD "") # Set of executables to delayload on windows
# NodeJS variants
# Selects download target based on configured component
# Include NodeJS last to provide default configurations when omitted
file(
GLOB NodeJS_SUPPORTED_VARIANTS
RELATIVE ${CMAKE_CURRENT_LIST_DIR}/variants
${CMAKE_CURRENT_LIST_DIR}/variants/*
)
foreach(NodeJS_SUPPORTED_VARIANT ${NodeJS_SUPPORTED_VARIANTS})
get_filename_component(NodeJS_SUPPORTED_VARIANT_NAME
${NodeJS_SUPPORTED_VARIANT} NAME_WE
)
if(NOT NodeJS_SUPPORTED_VARIANT_NAME STREQUAL "NodeJS")
include(variants/${NodeJS_SUPPORTED_VARIANT_NAME})
endif()
endforeach()
include(variants/NodeJS)
# Populate version variables, including version components
set(NodeJS_VERSION_STRING "v${NodeJS_VERSION}")
# Populate the remaining version variables
string(REPLACE "." ";" NodeJS_VERSION_PARTS ${NodeJS_VERSION})
list(GET NodeJS_VERSION_PARTS 0 NodeJS_VERSION_MAJOR)
list(GET NodeJS_VERSION_PARTS 1 NodeJS_VERSION_MINOR)
list(GET NodeJS_VERSION_PARTS 2 NodeJS_VERSION_PATCH)
# If the version we're looking for is the version that is installed,
# try finding the required headers. Don't do this under windows (where
# headers are not part of the installed content), when the user has
# specified that headers should be downloaded or when using a variant other
# than the default
if((NOT NodeJS_PLATFORM_WIN32) AND (NOT NodeJS_DOWNLOAD) AND
NodeJS_VARIANT_NAME STREQUAL NodeJS_DEFAULT_VARIANT_NAME AND
NodeJS_INSTALLED_VERSION STREQUAL NodeJS_VERSION_STRING AND
NodeJS_INSTALLED_PLATFORM STREQUAL NodeJS_PLATFORM AND
NodeJS_INSTALLED_ARCH STREQUAL NodeJS_ARCH)
# node.h is really generic and too easy for cmake to find the wrong
# file, so use the directory as a guard, and then just tack it on to
# the actual path
#
# Specifically ran into this under OSX, where python contains a node.h
# that gets found instead
find_path(NodeJS_INCLUDE_PARENT node/node.h)
set(NodeJS_INCLUDE_DIRS ${NodeJS_INCLUDE_PARENT}/node)
# Under all systems that support this, there are no libraries required
# for linking (symbols are resolved via the main executable at runtime)
set(NodeJS_LIBRARIES "")
# Otherwise, headers and required libraries must be downloaded to the project
# to supplement what is installed
else()
# Create a folder for downloaded artifacts
set(NodeJS_DOWNLOAD_PATH
${CMAKE_CURRENT_BINARY_DIR}/${NodeJS_VARIANT_BASE}
)
set(NodeJS_DOWNLOAD_PATH ${NodeJS_DOWNLOAD_PATH}-${NodeJS_VERSION_STRING})
file(MAKE_DIRECTORY ${NodeJS_DOWNLOAD_PATH})
# Download the checksum file for validating all other downloads
# Conveniently, if this doesn't download correctly, the setup fails
# due to checksum failures
set(NodeJS_CHECKSUM_FILE ${NodeJS_DOWNLOAD_PATH}/CHECKSUM)
nodejs_download(
${NodeJS_URL}/${NodeJS_CHECKSUM_PATH}
${NodeJS_CHECKSUM_FILE}
${NodeJS_FORCE_DOWNLOAD}
)
file(READ ${NodeJS_CHECKSUM_FILE} NodeJS_CHECKSUM_DATA)
# Download and extract the main source archive
set(NodeJS_SOURCE_FILE ${NodeJS_DOWNLOAD_PATH}/headers.tar.gz)
nodejs_checksum(
${NodeJS_CHECKSUM_DATA} ${NodeJS_SOURCE_PATH} NodeJS_SOURCE_CHECKSUM
)
nodejs_download(
${NodeJS_URL}/${NodeJS_SOURCE_PATH}
${NodeJS_SOURCE_FILE}
${NodeJS_SOURCE_CHECKSUM}
${NodeJS_CHECKSUM_TYPE}
${NodeJS_FORCE_DOWNLOAD}
)
set(NodeJS_HEADER_PATH ${NodeJS_DOWNLOAD_PATH}/src)
nodejs_extract(
${NodeJS_SOURCE_FILE}
${NodeJS_HEADER_PATH}
${NodeJS_FORCE_EXTRACT}
)
# Populate include directories from the extracted source archive
foreach(NodeJS_HEADER_BASE ${NodeJS_INCLUDE_PATHS})
set(NodeJS_INCLUDE_DIR ${NodeJS_HEADER_PATH}/${NodeJS_HEADER_BASE})
if(NOT EXISTS ${NodeJS_INCLUDE_DIR})
message(FATAL_ERROR "Include does not exist: ${NodeJS_INCLUDE_DIR}")
endif()
list(APPEND NodeJS_INCLUDE_DIRS ${NodeJS_INCLUDE_DIR})
endforeach()
# Download required library files when targeting windows
if(NodeJS_PLATFORM_WIN32)
# Download the windows library
set(NodeJS_WIN32_LIBRARY_FILE
${NodeJS_DOWNLOAD_PATH}/lib/${NodeJS_ARCH}
)
set(NodeJS_WIN32_LIBRARY_FILE
${NodeJS_WIN32_LIBRARY_FILE}/${NodeJS_WIN32_LIBRARY_NAME}
)
nodejs_checksum(
${NodeJS_CHECKSUM_DATA} ${NodeJS_WIN32_LIBRARY_PATH}
NodeJS_WIN32_LIBRARY_CHECKSUM
)
nodejs_download(
${NodeJS_URL}/${NodeJS_WIN32_LIBRARY_PATH}
${NodeJS_WIN32_LIBRARY_FILE}
${NodeJS_WIN32_LIBRARY_CHECKSUM}
${NodeJS_CHECKSUM_TYPE}
${NodeJS_FORCE_DOWNLOAD}
)
list(APPEND NodeJS_LIBRARIES ${NodeJS_WIN32_LIBRARY_FILE})
# If provided, download the windows executable
if(NodeJS_WIN32_BINARY_PATH AND
NodeJS_DOWNLOAD_EXECUTABLE)
set(NodeJS_WIN32_BINARY_FILE
${NodeJS_DOWNLOAD_PATH}/lib/${NodeJS_ARCH}
)
set(NodeJS_WIN32_BINARY_FILE
${NodeJS_WIN32_BINARY_FILE}/${NodeJS_WIN32_BINARY_NAME}
)
nodejs_checksum(
${NodeJS_CHECKSUM_DATA} ${NodeJS_WIN32_BINARY_PATH}
NodeJS_WIN32_BINARY_CHECKSUM
)
nodejs_download(
${NodeJS_URL}/${NodeJS_WIN32_BINARY_PATH}
${NodeJS_WIN32_BINARY_FILE}
${NodeJS_WIN32_BINARY_CHECKSUM}
${NodeJS_CHECKSUM_TYPE}
${NodeJS_FORCE_DOWNLOAD}
)
endif()
endif()
endif()
# Support windows delay loading
if(NodeJS_PLATFORM_WIN32)
list(APPEND NodeJS_LINK_FLAGS /IGNORE:4199)
set(NodeJS_WIN32_DELAYLOAD_CONDITION "")
foreach(NodeJS_WIN32_DELAYLOAD_BINARY ${NodeJS_WIN32_DELAYLOAD})
list(APPEND NodeJS_LINK_FLAGS
/DELAYLOAD:${NodeJS_WIN32_DELAYLOAD_BINARY}
)
list(APPEND NodeJS_WIN32_DELAYLOAD_CONDITION
"_stricmp(info->szDll, \"${NodeJS_WIN32_DELAYLOAD_BINARY}\") != 0"
)
endforeach()
string(REPLACE ";" " &&\n "
NodeJS_WIN32_DELAYLOAD_CONDITION
"${NodeJS_WIN32_DELAYLOAD_CONDITION}"
)
configure_file(
${NodeJS_MODULE_PATH}/src/win_delay_load_hook.c
${CMAKE_CURRENT_BINARY_DIR}/win_delay_load_hook.c @ONLY
)
list(APPEND NodeJS_ADDITIONAL_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/win_delay_load_hook.c
)
endif()
# Allow undefined symbols on OSX
if(NodeJS_PLATFORM_DARWIN)
list(APPEND NodeJS_LINK_FLAGS "-undefined dynamic_lookup")
endif()
# Use libc++ when clang is the compiler by default
if(NodeJS_USE_CLANG_STDLIB AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*")
list(APPEND NodeJS_COMPILE_OPTIONS -stdlib=libc++)
endif()
# Require c++11 support after a specific point, but only if the user hasn't
# specified an override
if(NOT NodeJS_CXX_STANDARD)
if(NodeJS_VERSION VERSION_GREATER NodeJS_CXX11R_VERSION)
set(NodeJS_CXX_STANDARD 11)
else()
set(NodeJS_CXX_STANDARD 98)
endif()
endif()
# Set required definitions
list(APPEND NodeJS_DEFINITIONS BUILDING_NODE_EXTENSION)
if(NodeJS_PLATFORM_DARWIN)
list(APPEND NodeJS_DEFINITIONS _DARWIN_USE_64_BIT_INODE=1)
endif()
if(NOT NodeJS_PLATFORM_WIN32)
list(APPEND NodeJS_DEFINITIONS
_LARGEFILE_SOURCE
_FILE_OFFSET_BITS=64
)
endif()
function(add_nodejs_module NAME)
# Build a shared library for the module
add_library(${NAME} SHARED ${ARGN} ${NodeJS_ADDITIONAL_SOURCES})
# Include required headers
# Find and include Nan as well (always available as its a
# dependency of this module)
nodejs_find_module_fallback(nan ${CMAKE_CURRENT_SOURCE_DIR} NAN_PATH)
target_include_directories(${NAME}
PUBLIC ${NodeJS_INCLUDE_DIRS}
PUBLIC ${NAN_PATH}
)
# Set module properties
# This ensures proper naming of the module library across all platforms
get_target_property(COMPILE_OPTIONS ${NAME} COMPILE_OPTIONS)
if(NOT COMPILE_OPTIONS)
set(COMPILE_OPTIONS "")
endif()
set(COMPILE_OPTIONS ${COMPILE_OPTIONS} ${NodeJS_COMPILE_OPTIONS})
get_target_property(LINK_FLAGS ${NAME} LINK_FLAGS)
if(NOT LINK_FLAGS)
set(LINK_FLAGS "")
endif()
foreach(NodeJS_LINK_FLAG ${NodeJS_LINK_FLAGS})
set(LINK_FLAGS "${LINK_FLAGS} ${NodeJS_LINK_FLAG}")
endforeach()
set_target_properties(${NAME} PROPERTIES
PREFIX ""
SUFFIX ".node"
MACOSX_RPATH ON
POSITION_INDEPENDENT_CODE TRUE
COMPILE_OPTIONS "${COMPILE_OPTIONS}"
LINK_FLAGS "${LINK_FLAGS}"
CXX_STANDARD_REQUIRED TRUE
CXX_STANDARD ${NodeJS_CXX_STANDARD}
)
# Output the module in a per build type directory
# This makes builds consistent with visual studio and other generators
# that build by configuration
if(NOT CMAKE_CONFIGURATION_TYPES)
set_property(TARGET ${NAME} PROPERTY LIBRARY_OUTPUT_DIRECTORY
${CMAKE_BUILD_TYPE}
)
endif()
# Set any required complier flags
# Mostly used under windows
target_compile_definitions(${NAME} PRIVATE ${NodeJS_DEFINITIONS})
# Link against required NodeJS libraries
target_link_libraries(${NAME} ${NodeJS_LIBRARIES})
endfunction()
# Write out the configuration for node scripts
configure_file(
${NodeJS_MODULE_PATH}/build.json.in
${CMAKE_CURRENT_BINARY_DIR}/build.json @ONLY
)
# Make sure we haven't violated the version-to-standard mapping
if(NodeJS_VERSION VERSION_GREATER NodeJS_CXX11R_VERSION AND
NodeJS_CXX_STANDARD EQUAL 98)
message(FATAL_ERROR "${NodeJS_VARIANT_NAME} ${NodeJS_VERSION} \
requires C++11 or newer to build")
endif()
# This is a find_package file, handle the standard invocation
include(FindPackageHandleStandardArgs)
set(NodeJS_TARGET "${NodeJS_VARIANT_NAME} ${NodeJS_PLATFORM}/${NodeJS_ARCH}")
find_package_handle_standard_args(NodeJS
FOUND_VAR NodeJS_FOUND
REQUIRED_VARS NodeJS_TARGET NodeJS_INCLUDE_DIRS
VERSION_VAR NodeJS_VERSION
)
# Mark variables that users shouldn't modify
mark_as_advanced(
NodeJS_VALIDATE_EXECUTABLE
NodeJS_OTHER_COMPONENTS
NodeJS_COMPONENTS_CONTAINS_VARIANT
NodeJS_COMPONENT
NodeJS_OTHER_INDEX
NodeJS_VERSION_STRING
NodeJS_VERSION_MAJOR
NodeJS_VERSION_MINOR
NodeJS_VERSION_PATCH
NodeJS_VERSION_TWEAK
NodeJS_PLATFORM
NodeJS_PLATFORM_WIN32
NodeJS_PLATFORM_LINUX
NodeJS_PLATFORM_DARWIN
NodeJS_ARCH
NodeJS_ARCH_X64
NodeJS_ARCH_IA32
NodeJS_ARCH_ARM
NodeJS_DEFAULT_VARIANT_NAME
NodeJS_VARIANT_BASE
NodeJS_VARIANT_NAME
NodeJS_URL
NodeJS_SOURCE_PATH
NodeJS_CHECKSUM_PATH
NodeJS_CHECKSUM_TYPE
NodeJS_WIN32_LIBRARY_PATH
NodeJS_WIN32_BINARY_PATH
NodeJS_WIN32_LIBRARY_NAME
NodeJS_WIN32_BINARY_NAME
NodeJS_DEFAULT_INCLUDE
NodeJS_DEFAULT_LIBS
NodeJS_HAS_WIN32_BINARY
NodeJS_HEADER_VERSION
NodeJS_SHA256_VERISON
NodeJS_PREFIX_VERSION
NodeJS_SOURCE_INCLUDE
NodeJS_HEADER_INCLUDE
NodeJS_INCLUDE_PATHS
NodeJS_WIN32_DELAYLOAD
NodeJS_DOWNLOAD_PATH
NodeJS_CHECKSUM_FILE
NodeJS_CHECKSUM_DATA
NodeJS_SOURCE_FILE
NodeJS_SOURCE_CHECKSUM
NodeJS_HEADER_PATH
NodeJS_HEADER_BASE
NodeJS_INCLUDE_DIR
NodeJS_WIN32_LIBRARY_FILE
NodeJS_WIN32_LIBRARY_CHECKSUM
NodeJS_WIN32_BINARY_FILE
NodeJS_WIN32_BINARY_CHECKSUM
NodeJS_NAN_PATH
NodeJS_LINK_FLAGS
NodeJS_COMPILE_OPTIONS
NodeJS_ADDITIONAL_SOURCES
NodeJS_WIN32_DELAYLOAD_CONDITION
NodeJS_WIN32_DELAYLOAD_BINARY
NodeJS_TARGET
)
-10
View File
@@ -1,10 +0,0 @@
{
"build_type": "@CMAKE_BUILD_TYPE@",
"generator": "@CMAKE_GENERATOR@",
"toolset": "@CMAKE_GENERATOR_TOOLSET@",
"platform": "@CMAKE_GENERATOR_PLATFORM@",
"variant": "@NodeJS_VARIANT_BASE@",
"version": "@NodeJS_VERSION@",
"download": "@NodeJS_DOWNLOAD@",
"standard": "@NodeJS_CXX_STANDARD@"
}
-28
View File
@@ -1,28 +0,0 @@
set(GITHUB_API_TOKEN $ENV{GITHUB_API_TOKEN})
set(GITHUB_AUTH "")
if(GITHUB_API_TOKEN)
set(GITHUB_AUTH "?access_token=${GITHUB_API_TOKEN}")
endif()
set(GITHUB_API_URL "https://api.github.com")
function(github_get_rate_limit VAR)
set(RATE_LIMIT_FILE ${CMAKE_CURRENT_BINARY_DIR}/GITHUBRATE)
set(RATE_LIMIT_URL ${GITHUB_API_URL}/rate_limit${GITHUB_AUTH})
nodejs_download(
${RATE_LIMIT_URL}
${RATE_LIMIT_FILE}
ON
)
file(READ ${RATE_LIMIT_FILE} RATE_LIMIT_DATA)
string(REGEX MATCH "\"remaining\": ([0-9]+),"
RATE_LIMIT_MATCH ${RATE_LIMIT_DATA})
set(${VAR} ${CMAKE_MATCH_1} PARENT_SCOPE)
endfunction()
mark_as_advanced(
GITHUB_AUTH
GITHUB_API_TOKEN
GITHUB_API_URL
)
-166
View File
@@ -1,166 +0,0 @@
function(nodejs_check_file FILE)
set(MESSAGE "File ${FILE} does not exist or is empty")
if(ARGC GREATER 1)
set(MESSAGE ${ARGV1})
endif()
# Make sure the file has contents
file(READ ${FILE} FILE_CONTENT LIMIT 1 HEX)
if(NOT FILE_CONTENT)
file(REMOVE ${FILE})
message(FATAL_ERROR ${MESSAGE})
endif()
endfunction()
function(nodejs_download URL FILE)
# Function optionally takes a checksum and a checksum type, and
# a force value
# Either can be specified without the other, but checksum must come first
if(ARGC GREATER 2)
set(CHECKSUM ${ARGV2})
if(CHECKSUM STREQUAL "On" OR CHECKSUM STREQUAL "ON" OR
CHECKSUM STREQUAL "True" OR CHECKSUM STREQUAL "TRUE" OR
CHECKSUM STREQUAL "Off" OR CHECKSUM STREQUAL "OFF" OR
CHECKSUM STREQUAL "False" OR CHECKSUM STREQUAL "FALSE")
set(FORCE ${CHECKSUM})
unset(CHECKSUM)
elseif(ARGC GREATER 3)
set(TYPE ${ARGV3})
else()
message(FATAL_ERROR "Checksum type must be specified")
endif()
elseif(ARGC GREATER 4)
set(CHECKSUM ${ARGV2})
set(TYPE ${ARGV3})
set(FORCE ${ARGV4})
endif()
# If the file exists, no need to download it again unless its being forced
if(NOT FORCE AND EXISTS ${FILE})
return()
endif()
# Download the file
message(STATUS "Downloading: ${URL}")
file(DOWNLOAD
${URL}
${FILE}
SHOW_PROGRESS
)
# Make sure the file has contents
nodejs_check_file(${FILE} "Unable to download ${URL}")
# If a checksum is provided, validate the downloaded file
if(CHECKSUM)
message(STATUS "Validating: ${FILE}")
file(${TYPE} ${FILE} DOWNLOAD_CHECKSUM)
message(STATUS "Checksum: ${CHECKSUM}")
message(STATUS "Download: ${DOWNLOAD_CHECKSUM}")
if(NOT CHECKSUM STREQUAL DOWNLOAD_CHECKSUM)
file(REMOVE ${FILE})
message(FATAL_ERROR "Validation failure: ${FILE}")
endif()
endif()
endfunction()
function(nodejs_checksum DATA FILE VAR)
string(REGEX MATCH "([A-Fa-f0-9]+)[\t ]+${FILE}" CHECKSUM_MATCH ${DATA})
if(CMAKE_MATCH_1)
set(${VAR} ${CMAKE_MATCH_1} PARENT_SCOPE)
else()
message(FATAL_ERROR "Unable to extract file checksum")
endif()
endfunction()
function(nodejs_extract FILE DIR)
# Function optionally takes a force value
if(ARGC GREATER 2)
set(FORCE ${ARGV2})
endif()
# If the archvie has been extracted, no need to extract again unless it
# is being forced
if(NOT FORCE AND EXISTS ${DIR})
return()
endif()
# Make a temporary directory for extracting the output
set(EXTRACT_DIR ${CMAKE_CURRENT_BINARY_DIR}/extract)
if(EXISTS ${EXTRACT_DIR})
file(REMOVE_RECURSE ${EXTRACT_DIR})
endif()
file(MAKE_DIRECTORY ${EXTRACT_DIR})
# Extract the archive
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xfz ${FILE}
WORKING_DIRECTORY ${EXTRACT_DIR}
)
# If only one element is extracted, the archive contained a nested
# folder; use the inner folder as the extracted folder
file(GLOB EXTRACT_CHILDREN ${EXTRACT_DIR}/*)
list(LENGTH EXTRACT_CHILDREN NUM_CHILDREN)
set(TARGET_DIR ${EXTRACT_DIR})
if(NUM_CHILDREN EQUAL 1)
list(GET EXTRACT_CHILDREN 0 TARGET_DIR)
endif()
# Move the folder to the target path
if(EXISTS ${DIR})
file(REMOVE_RECURSE ${DIR})
endif()
file(RENAME ${TARGET_DIR} ${DIR})
# Make sure to clean up the extraction folder when the inner folder
# is used
file(REMOVE_RECURSE ${EXTRACT_DIR})
endfunction()
function(nodejs_find_module NAME BASE PATH)
# Find a node module using the same search path that require uses
# without needing a node binary
set(ROOT ${BASE})
set(DRIVE "^[A-Za-z]?:?/$")
# Walk up the directory tree until at the root
while(NOT ROOT MATCHES ${DRIVE} AND NOT
EXISTS ${ROOT}/node_modules/${NAME})
get_filename_component(ROOT ${ROOT} DIRECTORY)
endwhile()
# Operate like the CMake find_* functions, returning NOTFOUND if the
# module can't be found
if(ROOT MATCHES ${DRIVE})
set(${PATH} ${NAME}-NOTFOUND PARENT_SCOPE)
else()
set(${PATH} ${ROOT}/node_modules/${NAME} PARENT_SCOPE)
endif()
endfunction()
macro(nodejs_find_module_fallback NAME BASE PATH)
# Look in the provided path first
# If the module isn't found, try searching from the module
nodejs_find_module(${NAME} ${BASE} ${PATH})
if(NOT ${PATH})
nodejs_find_module(${NAME} ${NodeJS_MODULE_PATH} ${PATH})
endif()
endmacro()
function(nodejs_get_version URL VAR)
set(NWJS_LATEST_RELEASE_URL
"${NWJS_URL_BASE}/latest/${NodeJS_CHECKSUM_PATH}")
set(VERSION_FILE ${CMAKE_CURRENT_BINARY_DIR}/VERSION)
nodejs_download(
${URL}
${VERSION_FILE}
ON
)
nodejs_check_file(${VERSION_FILE})
file(READ ${VERSION_FILE} VERSION_DATA)
string(REGEX MATCH "v([0-9]+\.[0-9]+\.[0-9]+)"
VERSION_MATCH ${VERSION_DATA}
)
set(${VAR} ${CMAKE_MATCH_1} PARENT_SCOPE)
endfunction()
-81
View File
@@ -1,81 +0,0 @@
set(ELECTRON_VARIANT_BASE "electron")
set(ELECTRON_WIN32_BINARY_NAME "${ELECTRON_VARIANT_BASE}.exe")
list(APPEND NodeJS_WIN32_DELAYLOAD ${ELECTRON_WIN32_BINARY_NAME})
if(NodeJS_FIND_REQUIRED_ELECTRON OR
NodeJS_VARIANT STREQUAL ${ELECTRON_VARIANT_BASE})
if(NodeJS_VERSION STREQUAL "latest")
include(util/Github)
github_get_rate_limit(GITHUB_RATE_LIMIT)
# Handle determining the latest release
# Very complicated, due to electron not following the "latest"
# convention of other variants
set(ELECTRON_LATEST_RELEASE_FILE ${CMAKE_CURRENT_BINARY_DIR}/ELECTRON)
set(ELECTRON_LATEST_RELEASE_URL
${GITHUB_API_URL}/repos/atom/electron/releases/latest${GITHUB_AUTH}
)
if(GITHUB_RATE_LIMIT GREATER 0)
nodejs_download(
${ELECTRON_LATEST_RELEASE_URL}
${ELECTRON_LATEST_RELEASE_FILE}
ON
)
endif()
nodejs_check_file(
${ELECTRON_LATEST_RELEASE_FILE}
"Releases file could not be downloaded, likely \
because github rate limit was exceeded. Wait until the limit \
passes or set GITHUB_API_TOKEN in your environment to a valid \
github developer token."
)
file(READ ${ELECTRON_LATEST_RELEASE_FILE} ELECTRON_LATEST_RELEASE_DATA)
string(REGEX MATCH "\"tag_name\"\: \"v([0-9]+\.[0-9]+\.[0-9]+)\""
ELECTRON_LATEST_RELEASE_MATCH ${ELECTRON_LATEST_RELEASE_DATA})
set(NodeJS_VERSION ${CMAKE_MATCH_1})
endif()
set(NodeJS_VARIANT_NAME "Electron.js")
# SHASUMS of any kind is inaccessible prior to 0.16.0
if(NodeJS_VERSION VERSION_LESS 0.16.0)
message(FATAL_ERROR "Electron is only supported for versions >= 0.16.0")
endif()
# Electron switched to IOJS after 0.25.0
# Probably needs to be bounded on the upper side if/when they switch
# back to node mainline due to iojs-node merge
set(NodeJS_VARIANT_BASE "node")
if(NodeJS_VERSION VERSION_GREATER 0.25.0)
set(NodeJS_VARIANT_BASE "iojs")
endif()
# Url is hard to get, because it will immediately resolve to a CDN
# Extracted from the electron website
set(NodeJS_URL
"https://atom.io/download/atom-shell/v${NodeJS_VERSION}"
)
# Headers become available for IOJS base ONLY!
# Variant base switch above handles this
set(NodeJS_HEADER_VERSION 0.30.1)
# Header only archive uses source style paths
set(NodeJS_DEFAULT_INCLUDE False)
# Hard to determine, but versions seem to start at 16, and SHA256 is
# available
set(NodeJS_SHA256_VERSION 0.15.9)
# C++11 and Prefixing start after the IOJS switch
# Will carry forward after node mainline so no need for upper bound (whew)
set(NodeJS_PREFIX_VERSION 0.25.0)
set(NodeJS_CXX11R_VERSION 0.25.0)
# The executable is not provided on the CDN
# In theory, I could support a BINARY_URL to get this from github
set(NodeJS_HAS_WIN32_BINARY False)
# OpenSSL isn't included in the headers
set(NodeJS_HAS_OPENSSL False)
endif()
-25
View File
@@ -1,25 +0,0 @@
set(IOJS_URL_BASE "https://iojs.org/dist")
set(IOJS_VARIANT_BASE "iojs")
set(IOJS_WIN32_BINARY_NAME "${IOJS_VARIANT_BASE}.exe")
list(APPEND NodeJS_WIN32_DELAYLOAD ${IOJS_WIN32_BINARY_NAME})
if(NodeJS_FIND_REQUIRED_IOJS OR NodeJS_VARIANT STREQUAL ${IOJS_VARIANT_BASE})
if(NodeJS_VERSION STREQUAL "latest")
set(IOJS_LATEST_RELEASE_URL
"${IOJS_URL_BASE}/latest/SHASUMS256.txt")
nodejs_get_version(${IOJS_LATEST_RELEASE_URL} NodeJS_VERSION)
endif()
set(NodeJS_VARIANT_NAME "io.js")
set(NodeJS_VARIANT_BASE ${IOJS_VARIANT_BASE})
set(NodeJS_URL "${IOJS_URL_BASE}/v${NodeJS_VERSION}")
set(NodeJS_HEADER_VERSION 2.3.1)
set(NodeJS_WIN32_BINARY_NAME "${IOJS_WIN32_BINARY_NAME}")
endif()
mark_as_advanced(
IOJS_URL_BASE
IOJS_VARIANT_BASE
IOJS_WIN32_BINARY_NAME
IOJS_LATEST_RELEASE_URL
)
-30
View File
@@ -1,30 +0,0 @@
set(NWJS_URL_BASE "http://dl.nwjs.io")
set(NWJS_VARIANT_BASE "nw")
set(NWJS_WIN32_BINARY_NAME "${NWJS_VARIANT_BASE}.exe")
list(APPEND NodeJS_WIN32_DELAYLOAD ${NWJS_WIN32_BINARY_NAME})
if(NodeJS_FIND_REQUIRED_NWJS OR NodeJS_VARIANT STREQUAL ${NWJS_VARIANT_BASE})
set(NodeJS_CHECKSUM_PATH "MD5SUMS")
set(NodeJS_CHECKSUM_TYPE "MD5")
if(NodeJS_VERSION STREQUAL "latest")
set(NWJS_LATEST_RELEASE_URL
"${NWJS_URL_BASE}/latest/${NodeJS_CHECKSUM_PATH}")
nodejs_get_version(${NWJS_LATEST_RELEASE_URL} NodeJS_VERSION)
endif()
set(NodeJS_VARIANT_NAME "nw.js")
set(NodeJS_VARIANT_BASE ${NWJS_VARIANT_BASE})
set(NodeJS_URL "${NWJS_URL_BASE}/v${NodeJS_VERSION}")
set(NodeJS_SOURCE_PATH "nw-headers-v${NodeJS_VERSION}.tar.gz")
set(NodeJS_DEFAULT_INCLUDE False)
set(NodeJS_HAS_WIN32_PREFIX False)
set(NodeJS_HAS_WIN32_BINARY False)
endif()
mark_as_advanced(
NWJS_URL_BASE
NWJS_VARIANT_BASE
NWJS_WIN32_BINARY_NAME
NWJS_LATEST_RELEASE_URL
)
-131
View File
@@ -1,131 +0,0 @@
set(NodeJS_URL_BASE http://nodejs.org/dist)
set(NodeJS_DEFAULT_VARIANT_BASE "node")
set(NodeJS_DEFAULT_WIN32_BINARY_NAME "${NodeJS_DEFAULT_VARIANT_BASE}.exe")
list(APPEND NodeJS_WIN32_DELAYLOAD ${NodeJS_DEFAULT_WIN32_BINARY_NAME})
if(NodeJS_VERSION STREQUAL "latest")
set(NodeJS_LATEST_RELEASE_URL
"${NodeJS_URL_BASE}/latest/SHASUMS256.txt")
nodejs_get_version(${NodeJS_LATEST_RELEASE_URL} NodeJS_VERSION)
endif()
if(NOT NodeJS_VARIANT_NAME)
set(NodeJS_VARIANT_NAME ${NodeJS_DEFAULT_VARIANT_NAME})
endif()
if(NOT NodeJS_VARIANT_BASE)
set(NodeJS_VARIANT_BASE ${NodeJS_DEFAULT_VARIANT_BASE})
endif()
if(NOT NodeJS_URL)
set(NodeJS_URL "${NodeJS_URL_BASE}/v${NodeJS_VERSION}")
endif()
if(NOT NodeJS_SOURCE_PATH)
set(NodeJS_SOURCE_PATH "${NodeJS_VARIANT_BASE}-v${NodeJS_VERSION}")
# Use the headers archive when its available
if(NodeJS_VERSION VERSION_GREATER ${NodeJS_HEADER_VERSION})
set(NodeJS_SOURCE_PATH "${NodeJS_SOURCE_PATH}-headers")
endif()
set(NodeJS_SOURCE_PATH "${NodeJS_SOURCE_PATH}.tar.gz")
endif()
if(NodeJS_DEFAULT_INCLUDE AND
NodeJS_VERSION VERSION_GREATER ${NodeJS_HEADER_VERSION})
set(NodeJS_SOURCE_INCLUDE False)
set(NodeJS_HEADER_INCLUDE True)
endif()
if(NodeJS_SOURCE_INCLUDE)
list(APPEND NodeJS_INCLUDE_PATHS
src
deps/uv/include
deps/v8/include
deps/zlib
)
# OpenSSL is an optional header
if(NodeJS_HAS_OPENSSL)
list(APPEND NodeJS_INCLUDE_PATHS
deps/openssl/openssl/include
)
endif()
endif()
if(NodeJS_HEADER_INCLUDE)
set(NodeJS_INCLUDE_PATHS include/node)
endif()
if(NOT NodeJS_CHECKSUM_TYPE)
# Use SHA256 when available
if(NodeJS_VERSION VERSION_GREATER ${NodeJS_SHA256_VERSION})
set(NodeJS_CHECKSUM_TYPE "SHA256")
else()
set(NodeJS_CHECKSUM_TYPE "SHA1")
endif()
endif()
if(NOT NodeJS_CHECKSUM_PATH)
set(NodeJS_CHECKSUM_PATH "SHASUMS")
if(NodeJS_CHECKSUM_TYPE STREQUAL "SHA256")
set(NodeJS_CHECKSUM_PATH "${NodeJS_CHECKSUM_PATH}256")
endif()
set(NodeJS_CHECKSUM_PATH "${NodeJS_CHECKSUM_PATH}.txt")
endif()
# Library and binary are based on variant base
if(NOT NodeJS_WIN32_LIBRARY_NAME)
set(NodeJS_WIN32_LIBRARY_NAME ${NodeJS_VARIANT_BASE}.lib)
endif()
if(NOT NodeJS_WIN32_BINARY_NAME)
set(NodeJS_WIN32_BINARY_NAME ${NodeJS_VARIANT_BASE}.exe)
endif()
if(NOT NodeJS_WIN32_LIBRARY_PATH)
# The library location is prefixed after a specific version
if(NodeJS_HAS_WIN32_PREFIX AND
NodeJS_VERSION VERSION_GREATER ${NodeJS_PREFIX_VERSION})
set(NodeJS_WIN32_LIBRARY_PATH "win-")
if(NodeJS_ARCH_IA32)
set(NodeJS_WIN32_LIBRARY_PATH "${NodeJS_WIN32_LIBRARY_PATH}x86/")
endif()
endif()
# 64-bit versions are prefixed
if(NodeJS_ARCH_X64)
set(NodeJS_WIN32_LIBRARY_PATH "${NodeJS_WIN32_LIBRARY_PATH}x64/")
endif()
set(NodeJS_WIN32_LIBRARY_PATH
"${NodeJS_WIN32_LIBRARY_PATH}${NodeJS_WIN32_LIBRARY_NAME}"
)
endif()
if(NodeJS_HAS_WIN32_BINARY AND NOT NodeJS_WIN32_BINARY_PATH)
# The executable location is prefixed after a specific version
if(NodeJS_HAS_WIN32_PREFIX AND
NodeJS_VERSION VERSION_GREATER ${NodeJS_PREFIX_VERSION})
set(NodeJS_WIN32_BINARY_PATH "win-")
if(NodeJS_ARCH_IA32)
set(NodeJS_WIN32_BINARY_PATH "${NodeJS_WIN32_BINARY_PATH}x86/")
endif()
endif()
# 64-bit versions are prefixed
if(NodeJS_ARCH_X64)
set(NodeJS_WIN32_BINARY_PATH "${NodeJS_WIN32_BINARY_PATH}x64/")
endif()
set(NodeJS_WIN32_BINARY_PATH
"${NodeJS_WIN32_BINARY_PATH}${NodeJS_WIN32_BINARY_NAME}"
)
endif()
# Specify windows libraries
# XXX: This may need to be version/variant specific in the future
if(NodeJS_DEFAULT_LIBS AND NodeJS_PLATFORM_WIN32)
list(APPEND NodeJS_LIBRARIES
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib DelayImp.lib
)
endif()
mark_as_advanced(
NodeJS_URL_BASE
NodeJS_DEFAULT_VARIANT_BASE
NodeJS_DEFAULT_WIN32_BINARY_NAME
NodeJS_LATEST_RELEASE_URL
)
+4 -2
View File
@@ -2,6 +2,8 @@ module.exports = {
default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions', default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions',
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions', verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
todo: '--strict --tags @todo --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', all: '--strict --require features/support --require features/step_definitions'
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@match --tags ~@alternative --tags ~@matrix --tags ~@trip --tags ~@via --require features/support --require features/step_definitions -f progress'
} }
+14 -42
View File
@@ -1,46 +1,18 @@
FROM alpine:3.5 FROM ubuntu:14.04
ARG DOCKER_TAG RUN apt-get update -y && apt-get install -y software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libboost-all-dev ccache
RUN apt-get -y install curl cmake cmake-curses-gui git
RUN mkdir /src
COPY . /src
RUN mkdir /opt
WORKDIR /opt WORKDIR /opt
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \ RUN git clone --depth 1 --branch v0.31.0 https://github.com/creationix/nvm.git
case ${DOCKER_TAG} in *"-debug"*) BUILD_TYPE="Debug";; *) BUILD_TYPE="Release";; esac && \ RUN /bin/bash -c "source /opt/nvm/nvm.sh && nvm install v4"
\
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.1-dev libtbb@testing libtbb-dev@testing && \
\
echo "Building libstxxl" && \
cd /opt && \
git clone --depth 1 --branch 1.4.1 https://github.com/stxxl/stxxl.git && \
cd stxxl && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j${NPROC} && \
make install && \
\
echo "Building OSRM ${DOCKER_TAG}" && \
cd /src && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_LTO=On .. && \
make -j${NPROC} install && \
cd ../profiles && \
cp -r * /opt && \
\
echo "Cleaning up" && \
strip /usr/local/bin/* && \
rm /usr/local/lib/libstxxl* && \
cd /opt && \
apk del boost-dev && \
apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.1-dev git make gcc && \
apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.1 expat && \
rm -rf /src /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm*
EXPOSE 5000 RUN useradd -ms /bin/bash mapbox
USER mapbox
ENV HOME /home/mapbox
WORKDIR /home/mapbox
RUN echo "source /opt/nvm/nvm.sh" > .bashrc
RUN echo "source /home/mapbox/.bashrc" > .profile
+6
View File
@@ -0,0 +1,6 @@
# Docker based continious integration
Run ```./docker/build-image.sh``` to build a docker image.
The image contains all the build dependencies and the state of the local git repository.
Run ```./docker/run-gcc.sh``` to build OSRM with g++ and run all tests.
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
set -o pipefail
docker build \
-t mapbox/osrm:linux \
docker/
-9
View File
@@ -1,9 +0,0 @@
#!/bin/sh
# We've placed the Dockerfile under docker/ so that the generically named
# hooks/ directory doesn't pollute the main directory. Because we need to
# COPY the source into the container, we need to use some -f gymnastics to
# ensure that "COPY . /src" is referring to the repo root, not the directory
# that contains the Dockerfile.
# This script gets executed with a pwd of wherever the Dockerfile is.
docker build --build-arg DOCKER_TAG=${DOCKER_TAG} -t $IMAGE_NAME -f Dockerfile ..
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
set -o pipefail
docker run \
-i \
-e "CXX=clang++" \
-v `pwd`:/home/mapbox/osrm-backend \
-t mapbox/osrm:linux \
/bin/bash -lc "osrm-backend/docker/test.sh"
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
set -o pipefail
docker run \
-i \
-e "CXX=g++-5" \
-e "CC=gcc-5" \
-v `pwd`:/home/mapbox/osrm-backend \
-t mapbox/osrm:linux \
/bin/bash -lc "osrm-backend/docker/test.sh"
Executable
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
set -o pipefail
export CMAKEOPTIONS="-DCMAKE_BUILD_TYPE=Release"
cd /home/mapbox/osrm-backend
[ -d build ] && rm -rf build
mkdir -p build
cd build
cmake .. $CMAKEOPTIONS -DBUILD_TOOLS=1
make -j`nproc`
make tests -j`nproc`
#./unit_tests/server-tests
#./unit_tests/library-tests
#./unit_tests/extractor-tests
#./unit_tests/util-tests
cd ..
npm test
+4 -5
View File
@@ -247,7 +247,7 @@ curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHu
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes. - `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from - `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found. the i-th waypoint to the j-th waypoint. Values are given in seconds.
- `sources` array of `Waypoint` objects describing all sources in order - `sources` array of `Waypoint` objects describing all sources in order
- `destinations` array of `Waypoint` objects describing all destinations in order - `destinations` array of `Waypoint` objects describing all destinations in order
@@ -298,7 +298,6 @@ The area to search is chosen such that the correct candidate should be considere
Each `Waypoint` object has the following additional properties: Each `Waypoint` object has the following additional properties:
- `matchings_index`: Index to the `Route` object in `matchings` the sub-trace was matched to. - `matchings_index`: Index to the `Route` object in `matchings` the sub-trace was matched to.
- `waypoint_index`: Index of the waypoint inside the matched route. - `waypoint_index`: Index of the waypoint inside the matched route.
- `alternatives_count`: number of alternative routes leading to the destination from this trace point. 0 means there are no other routes reaching destination. Greater values mean that there are different routes available and different route can be selected if you provide more coordinates.
- `matchings`: An array of `Route` objects that assemble the trace. Each `Route` object has the following additional properties: - `matchings`: An array of `Route` objects that assemble the trace. Each `Route` object has the following additional properties:
- `confidence`: Confidence of the matching. `float` value between 0 and 1. 1 is very confident that the matching is correct. - `confidence`: Confidence of the matching. `float` value between 0 and 1. 1 is very confident that the matching is correct.
@@ -324,7 +323,7 @@ In addition to the [general options](#general-options) the following options are
|Option |Values |Description | |Option |Values |Description |
|------------|------------------------------------------------|---------------------------------------------------------------------------| |------------|------------------------------------------------|---------------------------------------------------------------------------|
|roundtrip |`true` (default), `false` |Return route is a roundtrip (route returns to first location) | |roundtrip |`true` (default), `false` |Return route is a roundtrip |
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate | |source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate | |destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|steps |`true`, `false` (default) |Return route instructions for each trip | |steps |`true`, `false` (default) |Return route instructions for each trip |
@@ -484,9 +483,9 @@ Represents a route between two waypoints.
- `distance`: The distance traveled by this route leg, in `float` meters. - `distance`: The distance traveled by this route leg, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds. - `duration`: The estimated travel time, in `float` number of seconds.
- `weight`: The calculated weight of the route leg. - `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 | | | steps | |
|--------------|-----------------------------------------------------------------------| |--------------|-----------------------------------------------------------------------|
| true | Names of the two major roads used. Can be empty if route is too short.| | true | Names of the two major roads used. Can be empty if route is too short.|
| false | empty `string` | | false | empty `string` |
-333
View File
@@ -1,333 +0,0 @@
# OSRM
The `OSRM` method is the main constructor for creating an OSRM instance. An OSRM instance requires a `.osrm` network,
which is prepared by the OSRM Backend C++ library.
You can create such a `.osrm` file by running the OSRM binaries we ship in `node_modules/osrm/lib/binding/` and default
profiles (e.g. for setting speeds and determining road types to route on) in `node_modules/osrm/profiles/`:
node_modules/osrm/lib/binding/osrm-extract data.osm.pbf -p node_modules/osrm/profiles/car.lua
node_modules/osrm/lib/binding/osrm-contract data.osrm
Consult the [osrm-backend](https://github.com/Project-OSRM/osrm-backend) documentation or further details.
Once you have a complete `network.osrm` file, you can calculate networks in javascript with this library using the
methods below. To create an OSRM instance with your network you need to construct an instance like this:
```javascript
var osrm = new OSRM('network.osrm');
```
#### Methods
| Service | Description |
| -------------------------- | --------------------------------------------------------- |
| [`osrm.route`](#route) | shortest path between given coordinates |
| [`osrm.nearest`](#nearest) | returns the nearest street segment for a given coordinate |
| [`osrm.table`](#table) | computes distance tables for given coordinates |
| [`osrm.match`](#match) | matches given coordinates to the road network |
| [`osrm.trip`](#trip) | Compute the shortest trip between given coordinates |
| [`osrm.tile`](#tile) | Return vector tiles containing debugging info |
#### General Options
Each OSRM method (except for `OSRM.tile()`) has set of general options as well as unique options, outlined below.
| Option | Values | Description | Format |
| --------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| coordinates | `array` of `coordinate` elements: `[{coordinate}, ...]` | The coordinates this request will use. | `array` with `[{lon},{lat}]` values, in decimal degrees |
| bearings | `array` of `bearing` elements: `[{bearing}, ...]` | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. | `null` or `array` with `[{value},{range}]` `integer 0 .. 360,integer 0 .. 180` |
| radiuses | `array` of `radius` elements: `[{radius}, ...]` | Limits the search to given radius in meters. | `null` or `double >= 0` or `unlimited` (default) |
| hints | `array` of `hint` elements: `[{hint}, ...]` | Hint to derive position in street network. | Base64 `string` |
| generate\_hints | `true` (default) or `false` | Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. | `Boolean` |
## route
Returns the fastest route between two or more coordinates while visiting the waypoints in order.
**Parameters**
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the route query.
- `options.alternatives` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Search for alternative routes and return as well. _Please note that even if an alternative route is requested, a result cannot be guaranteed._ (optional, default `false`)
- `options.steps` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route steps for each route leg. (optional, default `false`)
- `options.annotations` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)] or \[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** Return annotations for each route leg for duration, nodes, distance, weight, datasources and/or speed. Annotations can be `false` or `true` (no/full annotations) or an array of strings with `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed`. (optional, default `false`)
- `options.geometries` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
- `options.overview` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
- `options.continue_straight` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile. `null`/`true`/`false`
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
```javascript
var osrm = new OSRM("berlin-latest.osrm");
osrm.route({coordinates: [[13.438640,52.519930], [13.415852, 52.513191]]}, function(err, result) {
if(err) throw err;
console.log(result.waypoints); // array of Waypoint objects representing all waypoints in order
console.log(result.routes); // array of Route objects ordered by descending recommendation rank
});
```
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** An array of [Waypoint](#waypoint) objects representing all waypoints in order AND an array of [`Route`](#route) objects ordered by descending recommendation rank.
## nearest
Snaps a coordinate to the street network and returns the nearest n matches.
Note: `coordinates` in the general options only supports a single `{longitude},{latitude}` entry.
**Parameters**
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the nearest query.
- `options.number` **\[[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** Number of nearest segments that should be returned.
Must be an integer greater than or equal to `1`. (optional, default `1`)
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
```javascript
var osrm = new OSRM('network.osrm');
var options = {
coordinates: [[13.388860,52.517037]],
number: 3,
bearings: [[0,20]]
};
osrm.nearest(options, function(err, response) {
console.log(response.waypoints); // array of Waypoint objects
});
```
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints`.
**`waypoints`**: array of [`Ẁaypoint`](#waypoint) objects sorted by distance to the input coordinate.
Each object has an additional `distance` property, which is the distance in meters to the supplied
input coordinate.
## table
Computes duration tables for the given locations. Allows for both symmetric and asymmetric tables.
**Parameters**
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the table query.
- `options.sources` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** An array of `index` elements (`0 <= integer < #coordinates`) to use
location with given index as source. Default is to use all.
- `options.destinations` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** An array of `index` elements (`0 <= integer < #coordinates`) to use location with given index as destination. Default is to use all.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
```javascript
var osrm = new OSRM('network.osrm');
var options = {
coordinates: [
[13.388860,52.517037],
[13.397634,52.529407],
[13.428555,52.523219]
]
};
osrm.table(options, function(err, response) {
console.log(response.durations); // array of arrays, matrix in row-major order
console.log(response.sources); // array of Waypoint objects
console.log(response.destinations); // array of Waypoint objects
});
```
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `durations`, `sources`, and `destinations`.
**`durations`**: array of arrays that stores the matrix in row-major order. `durations[i][j]`
gives the travel time from the i-th waypoint to the j-th waypoint. Values are given in seconds.
**`sources`**: array of [`Ẁaypoint`](#waypoint) objects describing all sources in order.
**`destinations`**: array of [`Ẁaypoint`](#waypoint) objects describing all destinations in order.
## tile
This generates [Mapbox Vector Tiles](https://mapbox.com/vector-tiles) that can be viewed with a
vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can
be used to examine the routing graph. The tiles are generated directly from the data in-memory,
so are in sync with actual routing results, and let you examine which roads are actually routable,
and what weights they have applied.
**Parameters**
- `ZXY` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** an array consisting of `x`, `y`, and `z` values representing tile coordinates like
[wiki.openstreetmap.org/wiki/Slippy_map_tilenames](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames)
and are supported by vector tile viewers like [Mapbox GL JS]\(<https://www.mapbox.com/mapbox-gl-js/api/>.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
```javascript
var osrm = new OSRM('network.osrm');
osrm.tile([0, 0, 0], function(err, response) {
if (err) throw err;
fs.writeFileSync('./tile.vector.pbf', response); // write the buffer to a file
});
```
Returns **[Buffer](https://nodejs.org/api/buffer.html)** contains a Protocol Buffer encoded vector tile.
## match
Map matching matches given GPS points to the road network in the most plausible way.
Please note the request might result multiple sub-traces. Large jumps in the timestamps
(>60s) or improbable transitions lead to trace splits if a complete matching could
not be found. The algorithm might not be able to match all points. Outliers are removed
if they can not be matched successfully.
**Parameters**
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the match query.
- `options.steps` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route steps for each route. (optional, default `false`)
- `options.annotations` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)] or \[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** Return annotations for each route leg for duration, nodes, distance, weight, datasources and/or speed. Annotations can be `false` or `true` (no/full annotations) or an array of strings with `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed`. (optional, default `false`)
- `options.geometries` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Returned route geometry format (influences overview
and per step). Can also be `geojson`. (optional, default `polyline`)
- `options.overview` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Add overview geometry either `full`, `simplified`
according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
- `options.timestamps` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>]** Timestamp of the input location (integers, UNIX-like timestamp).
- `options.radiuses` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** Standard deviation of GPS precision used for map matching.
If applicable use GPS accuracy (`double >= 0`, default `5m`).
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
```javascript
var osrm = new OSRM('network.osrm');
var options = {
coordinates: [[13.393252,52.542648],[13.39478,52.543079],[13.397389,52.542107]],
timestamps: [1424684612, 1424684616, 1424684620]
};
osrm.match(options, function(err, response) {
if (err) throw err;
console.log(response.tracepoints); // array of Waypoint objects
console.log(response.matchings); // array of Route objects
});
```
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `tracepoints` and `matchings`.
**`tracepoints`** Array of [`Ẁaypoint`](#waypoint) objects representing all points of the trace in order.
If the trace point was ommited by map matching because it is an outlier, the entry will be null. Each
`Waypoint` object includes two additional properties, 1) `matchings_index`: Index to the
[`Route`](#route) object in matchings the sub-trace was matched to, 2) `waypoint_index`: Index of
the waypoint inside the matched route.
**`matchings`** is an array of [`Route`](#route) objects that
assemble the trace. Each `Route` object has an additional `confidence` property, which is the confidence of
the matching. float value between `0` and `1`. `1` is very confident that the matching is correct.
## trip
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm). The returned path does not have to be the fastest path, as TSP is NP-hard it is only an approximation. Note that all input coordinates have to be connected for the trip service to work.
**Parameters**
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
- `options.roundtrip` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route is a roundtrip. (optional, default `true`)
- `options.source` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Return route starts at `any` coordinate. Can also be `first`. (optional, default `any`)
- `options.destination` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Return route ends at `any` coordinate. Can also be `last`. (optional, default `any`)
- `options.steps` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route steps for each route. (optional, default `false`)
- `options.annotations` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)] or \[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** Return annotations for each route leg for duration, nodes, distance, weight, datasources and/or speed. Annotations can be `false` or `true` (no/full annotations) or an array of strings with `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed`. (optional, default `false`)
- `options.geometries` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Returned route geometry format (influences overview
and per step). Can also be `geojson`. (optional, default `polyline`)
- `options.overview` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Fixing Start and End Points**
It is possible to explicitly set the start or end coordinate of the trip. When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
Right now, the following combinations are possible:
| roundtrip | source | destination | supported |
| :-- | :-- | :-- | :-- |
| true | first | last | **yes** |
| true | first | any | **yes** |
| true | any | last | **yes** |
| true | any | any | **yes** |
| false | first | last | **yes** |
| false | first | any | no |
| false | any | last | no |
| false | any | any | no |
**Examples**
Roundtrip Request
```javascript
var osrm = new OSRM('network.osrm');
var options = {
coordinates: [
[13.36761474609375, 52.51663871100423],
[13.374481201171875, 52.506191342034576]
]
}
osrm.trip(options, function(err, response) {
if (err) throw err;
console.log(response.waypoints); // array of Waypoint objects
console.log(response.trips); // array of Route objects
});
```
Non Roundtrip Request
```javascript
var osrm = new OSRM('network.osrm');
var options = {
coordinates: [
[13.36761474609375, 52.51663871100423],
[13.374481201171875, 52.506191342034576]
],
source: "first",
destination: "last",
roundtrip: false
}
osrm.trip(options, function(err, response) {
if (err) throw err;
console.log(response.waypoints); // array of Waypoint objects
console.log(response.trips); // array of Route objects
});
```
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints` and `trips`.
**`waypoints`**: an array of [`Ẁaypoint`](#waypoint) objects representing all waypoints in input order.
Each Waypoint object has the following additional properties, 1) `trips_index`: index to trips of the
sub-trip the point was matched to, and 2) `waypoint_index`: index of the point in the trip.
**`trips`**: an array of [`Route`](#route) objects that assemble the trace.
# Responses
Responses
## Route
Represents a route through (potentially multiple) waypoints.
**Parameters**
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#route)
## RouteLeg
Represents a route between two waypoints.
**Parameters**
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#routeleg)
## RouteStep
A step consists of a maneuver such as a turn or merge, followed by a distance of travel along a single way to the subsequent step.
**Parameters**
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#routestep)
## StepManeuver
**Parameters**
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#stepmanuever)
## Waypoint
Object used to describe waypoint on a route.
**Parameters**
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#waypoint)
-86
View File
@@ -1,86 +0,0 @@
# Releasing
Releasing a new version of `node-osrm` is mostly automated using Travis CI.
The version of `node-osrm` is locked to the same version as `osrm-backend`. Every `node-osrm` should have a `osrm-backend` release of the same version. Of course, only release a `node-osrm` after the release has been tagged in `osrm-backend`.
These steps all happen on `master`. After the release is out, create a branch using the MAJOR.MINOR version of the release to document code changes made for that version.
### Steps to release
1. Update the `osrm_release` field in `package.json` to the corresonding git tag in `osrm-backend.`
Confirm the desired OSRM branch and commit to `master`.
1. Bump node-osrm version
Update the `CHANGELOG.md` and the `package.json` version if needed.
1. Check that Travis CI [builds are passing](https://travis-ci.org/Project-OSRM/node-osrm) for the latest commit on `master`.
1. Publishing binaries
If travis builds are passing then it's time to publish binaries by committing with a message containing `[publish binary]`. Use an empty commit for this.
```
git commit --allow-empty -m "[publish binary] vMAJOR.MINOR.PATCH"
```
1. Test
Locally you can now test binaries. Cleanup, re-install, and run the tests like:
```
make clean
npm install # will pull remote binaries
npm ls # confirm deps are correct
make test
```
1. Tag
Once binaries are published for Linux and OS X then its time to tag a new release and add the changelog to the tag:
```
git tag vMAJOR.MINOR.PATCH -a
git push --tags
```
1. Publish node-osrm. **we only do this for stable releases**
First ensure your local `node-pre-gyp` is up to date:
```
npm ls
```
This is important because it is bundled during packaging.
If you see any errors then do:
```
rm -rf node_modules/node-pre-gyp
npm install node-pre-gyp
```
Now we're ready to publish `node-osrm` to <https://www.npmjs.org/package/osrm>:
```
npm publish
```
Dependent apps can now pull from the npm registry like:
```
"dependencies": {
"osrm": "^MAJOR.MINOR.PATCH"
}
```
Or can still pull from the github tag like:
```
"dependencies": {
"osrm": "https://github.com/Project-OSRM/node-osrm/archive/vMAJOR.MINOR.PATCH.tar.gz"
}
```
+6
View File
@@ -46,6 +46,12 @@ You should see the compiled binaries in `build/unit_tests`, you can then run eac
./engine-tests ./engine-tests
``` ```
For `library-tests` you will need to provide a path to the test data:
```
./library-tests ../../test/data/monaco.osrm
```
## Cucumber ## Cucumber
For a general introduction on cucumber in our testsuite, have a look at [the wiki](https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite). For a general introduction on cucumber in our testsuite, have a look at [the wiki](https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite).
+2 -2
View File
@@ -58,8 +58,8 @@ int main(int argc, const char *argv[])
const auto distance = route.values["distance"].get<json::Number>().value; const auto distance = route.values["distance"].get<json::Number>().value;
const auto duration = route.values["duration"].get<json::Number>().value; const auto duration = route.values["duration"].get<json::Number>().value;
// Warn users if extract does not contain the default coordinates from above // Warn users if extract does not contain the default Berlin coordinates from above
if (distance == 0 || duration == 0) if (distance == 0 or duration == 0)
{ {
std::cout << "Note: distance or duration is zero. "; std::cout << "Note: distance or duration is zero. ";
std::cout << "You are probably doing a query outside of the OSM extract.\n\n"; std::cout << "You are probably doing a query outside of the OSM extract.\n\n";
-32
View File
@@ -1,32 +0,0 @@
process.env.UV_THREADPOOL_SIZE = Math.ceil(require('os').cpus().length * 1.5);
var express = require('express');
var OSRM = require('..');
var path = require('path');
var app = express();
var osrm = new OSRM(path.join(__dirname,"../test/data/ch/monaco.osrm"));
// Accepts a query like:
// http://localhost:8888?start=13.414307,52.521835&end=13.402290,52.523728
app.get('/', function(req, res) {
if (!req.query.start || !req.query.end) {
return res.json({"error":"invalid start and end query"});
}
var coordinates = [];
var start = req.query.start.split(',');
coordinates.push([+start[0],+start[1]]);
var end = req.query.end.split(',');
coordinates.push([+end[0],+end[1]]);
var query = {
coordinates: coordinates,
alternateRoute: req.query.alternatives !== 'false'
};
osrm.route(query, function(err, result) {
if (err) return res.json({"error":err.message});
return res.json(result);
});
});
console.log('Listening on port: ' + 8888);
app.listen(8888);
+158 -144
View File
@@ -7,179 +7,193 @@ Feature: Bike - Access tags on ways
Scenario: Bike - Access tag hierarchy on ways Scenario: Bike - Access tag hierarchy on ways
Then routability should be Then routability should be
| highway | access | vehicle | bicycle | bothw | | highway | access | vehicle | bicycle | bothw |
| primary | | | | cycling | | | | | | x |
| primary | yes | | | cycling | | | yes | | | x |
| primary | no | | | | | | no | | | |
| primary | | yes | | cycling | | | | yes | | x |
| primary | | no | | | | | | no | | |
| primary | no | yes | | cycling | | | no | yes | | x |
| primary | yes | no | | | | | yes | no | | |
| primary | | | yes | cycling | | | | | yes | x |
| primary | | | no | | | | | | no | |
| primary | no | | yes | cycling | | | no | | yes | x |
| primary | yes | | no | | | | yes | | no | |
| primary | | no | yes | cycling | | | | no | yes | x |
| primary | | yes | no | | | | | yes | no | |
| runway | | | | |
| runway | yes | | | x |
| runway | no | | | |
| runway | | yes | | x |
| runway | | no | | |
| runway | no | yes | | x |
| runway | yes | no | | |
| runway | | | yes | x |
| runway | | | no | |
| runway | no | | yes | x |
| runway | yes | | no | |
| runway | | no | yes | x |
| runway | | yes | no | |
@todo @todo
Scenario: Bike - Access tag in forward direction Scenario: Bike - Access tag in forward direction
Then routability should be Then routability should be
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw | | highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
| primary | | | | cycling | | | | | | | x | |
| primary | yes | | | cycling | | | | yes | | | x | |
| primary | no | | | | | | | no | | | | |
| primary | | yes | | cycling | | | | | yes | | x | |
| primary | | no | | | | | | | no | | | |
| primary | no | yes | | cycling | | | | no | yes | | x | |
| primary | yes | no | | | | | | yes | no | | | |
| primary | | | yes | cycling | | | | | | yes | x | |
| primary | | | no | | | | | | | no | | |
| primary | no | | yes | cycling | | | | no | | yes | x | |
| primary | yes | | no | | | | | yes | | no | | |
| primary | | no | yes | cycling | | | | | no | yes | x | |
| primary | | yes | no | | | | | | yes | no | | |
| runway | | | | cycling | | | runway | | | | x | |
| runway | yes | | | cycling | | | runway | yes | | | x | |
| runway | no | | | | | | runway | no | | | | |
| runway | | yes | | cycling | | | runway | | yes | | x | |
| runway | | no | | | | | runway | | no | | | |
| runway | no | yes | | cycling | | | runway | no | yes | | x | |
| runway | yes | no | | | | | runway | yes | no | | | |
| runway | | | yes | cycling | | | runway | | | yes | x | |
| runway | | | no | | | | runway | | | no | | |
| runway | no | | yes | cycling | | | runway | no | | yes | x | |
| runway | yes | | no | | | | runway | yes | | no | | |
| runway | | no | yes | cycling | | | runway | | no | yes | x | |
| runway | | yes | no | | | | runway | | yes | no | | |
@todo @todo
Scenario: Bike - Access tag in backward direction Scenario: Bike - Access tag in backward direction
Then routability should be Then routability should be
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw | | highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
| primary | | | | | cycling | | | | | | | x |
| primary | yes | | | | cycling | | | yes | | | | x |
| primary | no | | | | | | | no | | | | |
| primary | | yes | | | cycling | | | | yes | | | x |
| primary | | no | | | | | | | no | | | |
| primary | no | yes | | | cycling | | | no | yes | | | x |
| primary | yes | no | | | | | | yes | no | | | |
| primary | | | yes | | cycling | | | | | yes | | x |
| primary | | | no | | | | | | | no | | |
| primary | no | | yes | | cycling | | | no | | yes | | x |
| primary | yes | | no | | | | | yes | | no | | |
| primary | | no | yes | | cycling | | | | no | yes | | x |
| primary | | yes | no | | | | | | yes | no | | |
| runway | | | | | cycling | | runway | | | | | x |
| runway | yes | | | | cycling | | runway | yes | | | | x |
| runway | no | | | | | | runway | no | | | | |
| runway | | yes | | | cycling | | runway | | yes | | | x |
| runway | | no | | | | | runway | | no | | | |
| runway | no | yes | | | cycling | | runway | no | yes | | | x |
| runway | yes | no | | | | | runway | yes | no | | | |
| runway | | | yes | | cycling | | runway | | | yes | | x |
| runway | | | no | | | | runway | | | no | | |
| runway | no | | yes | | cycling | | runway | no | | yes | | x |
| runway | yes | | no | | | | runway | yes | | no | | |
| runway | | no | yes | | cycling | | runway | | no | yes | | x |
| runway | | yes | no | | | | runway | | yes | no | | |
Scenario: Bike - Overwriting implied acccess on ways Scenario: Bike - Overwriting implied acccess on ways
Then routability should be Then routability should be
| highway | access | vehicle | bicycle | bothw | | highway | access | vehicle | bicycle | bothw |
| cycleway | | | | cycling | | cycleway | | | | x |
| runway | | | | | | runway | | | | |
| cycleway | no | | | | | cycleway | no | | | |
| cycleway | | no | | | | cycleway | | no | | |
| cycleway | | | no | | | cycleway | | | no | |
| runway | yes | | | cycling | | runway | yes | | | x |
| runway | | yes | | cycling | | runway | | yes | | x |
| runway | | | yes | cycling | | runway | | | yes | x |
Scenario: Bike - Access tags on ways Scenario: Bike - Access tags on ways
Then routability should be Then routability should be
| access | vehicle | bicycle | bothw | | access | vehicle | bicycle | bothw |
| | | | cycling | | | | | x |
| yes | | | cycling | | yes | | | x |
| permissive | | | cycling | | permissive | | | x |
| designated | | | cycling | | designated | | | x |
| some_tag | | | cycling | | some_tag | | | x |
| no | | | | | no | | | |
| private | | | | | private | | | |
| agricultural | | | | | agricultural | | | |
| forestry | | | | | forestry | | | |
| delivery | | | | | delivery | | | |
| | yes | | cycling | | | yes | | x |
| | permissive | | cycling | | | permissive | | x |
| | designated | | cycling | | | designated | | x |
| | some_tag | | cycling | | | some_tag | | x |
| | no | | | | | no | | |
| | private | | | | | private | | |
| | agricultural | | | | | agricultural | | |
| | forestry | | | | | forestry | | |
| | delivery | | | | | delivery | | |
| | | yes | cycling | | | | yes | x |
| | | permissive | cycling | | | | permissive | x |
| | | designated | cycling | | | | designated | x |
| | | some_tag | cycling | | | | some_tag | x |
| | | no | | | | | no | |
| | | private | | | | | private | |
| | | agricultural | | | | | agricultural | |
| | | forestry | | | | | forestry | |
| | | delivery | | | | | delivery | |
Scenario: Bike - Access tags on both node and way Scenario: Bike - Access tags on both node and way
Then routability should be Then routability should be
| access | node/access | bothw | | access | node/access | bothw |
| yes | yes | cycling | | yes | yes | x |
| yes | no | | | yes | no | |
| yes | some_tag | cycling | | yes | some_tag | x |
| no | yes | | | no | yes | |
| no | no | | | no | no | |
| no | some_tag | | | no | some_tag | |
| some_tag | yes | cycling | | some_tag | yes | x |
| some_tag | no | | | some_tag | no | |
| some_tag | some_tag | cycling | | some_tag | some_tag | x |
Scenario: Bike - Access combinations Scenario: Bike - Access combinations
Then routability should be Then routability should be
| highway | access | vehicle | bicycle | forw | backw | | highway | access | vehicle | bicycle | forw | backw |
| runway | private | | yes | cycling | cycling | | runway | private | | yes | x | x |
| footway | | no | permissive | cycling | cycling | | footway | | no | permissive | x | x |
| motorway | | | yes | cycling | | | motorway | | | yes | x | |
| track | forestry | | permissive | cycling | cycling | | track | forestry | | permissive | x | x |
| cycleway | yes | designated | no | | | | cycleway | yes | designated | no | | |
| primary | | yes | private | | | | primary | | yes | private | | |
| residential | permissive | | no | | | | residential | permissive | | no | | |
Scenario: Bike - Ignore access tags for other modes Scenario: Bike - Ignore access tags for other modes
Then routability should be Then routability should be
| highway | boat | motor_vehicle | moped | bothw | | highway | boat | motor_vehicle | moped | bothw |
| river | yes | | | | | river | yes | | | |
| cycleway | no | | | cycling | | cycleway | no | | | x |
| runway | | yes | | | | runway | | yes | | |
| cycleway | | no | | cycling | | cycleway | | no | | x |
| runway | | | yes | | | runway | | | yes | |
| cycleway | | | no | cycling | | cycleway | | | no | x |
Scenario: Bike - Bridleways when access is explicit Scenario: Bike - Bridleways when access is explicit
Then routability should be Then routability should be
| highway | horse | foot | bicycle | bothw | | highway | horse | foot | bicycle | bothw |
| bridleway | | | yes | cycling | | bridleway | | | yes | x |
| bridleway | | yes | | pushing bike | | bridleway | | yes | | x |
| bridleway | designated | | | | | bridleway | designated | | | |
| bridleway | | | | | | bridleway | | | | |
Scenario: Bike - Tram with oneway when access is implicit Scenario: Bike - Tram with oneway when access is implicit
Then routability should be Then routability should be
| highway | railway | access | oneway | forw | backw | | highway | railway | access | oneway | bothw |
| residential | tram | | yes | cycling | pushing bike | | residential | tram | | yes | x |
| service | tram | psv | yes | cycling | pushing bike | | service | tram | psv | yes | x |
Scenario: Bike - Access combinations Scenario: Bike - Access combinations
Then routability should be Then routability should be
| highway | access | bothw | | highway | access | bothw |
| primary | permissive | cycling | | primary | permissive | x |
| steps | permissive | cycling | | steps | permissive | x |
| footway | permissive | cycling | | footway | permissive | x |
| garbagetag | permissive | cycling | | garbagetag | permissive | x |
+53 -53
View File
@@ -7,62 +7,62 @@ Feature: Bike - Access tags on nodes
Scenario: Bike - Access tag hierarchy on nodes Scenario: Bike - Access tag hierarchy on nodes
Then routability should be Then routability should be
| node/access | node/vehicle | node/bicycle | node/highway | bothw | | node/access | node/vehicle | node/bicycle | node/highway | bothw |
| | | | | cycling | | | | | | x |
| yes | | | | cycling | | yes | | | | x |
| no | | | | | | no | | | | |
| | yes | | | cycling | | | yes | | | x |
| | no | | | | | | no | | | |
| no | yes | | | cycling | | no | yes | | | x |
| yes | no | | | | | yes | no | | | |
| | | yes | | cycling | | | | yes | | x |
| | | no | | | | | | no | | |
| | | no | crossing | cycling | | | | no | crossing | x |
| no | | yes | | cycling | | no | | yes | | x |
| yes | | no | | | | yes | | no | | |
| | no | yes | | cycling | | | no | yes | | x |
| | yes | no | | | | | yes | no | | |
Scenario: Bike - Overwriting implied acccess on nodes doesn't overwrite way Scenario: Bike - Overwriting implied acccess on nodes doesn't overwrite way
Then routability should be Then routability should be
| highway | node/access | node/vehicle | node/bicycle | bothw | | highway | node/access | node/vehicle | node/bicycle | bothw |
| cycleway | | | | cycling | | cycleway | | | | x |
| runway | | | | | | runway | | | | |
| cycleway | no | | | | | cycleway | no | | | |
| cycleway | | no | | | | cycleway | | no | | |
| cycleway | | | no | | | cycleway | | | no | |
| runway | yes | | | | | runway | yes | | | |
| runway | | yes | | | | runway | | yes | | |
| runway | | | yes | | | runway | | | yes | |
Scenario: Bike - Access tags on nodes Scenario: Bike - Access tags on nodes
Then routability should be Then routability should be
| node/access | node/vehicle | node/bicycle | bothw | | node/access | node/vehicle | node/bicycle | bothw |
| | | | cycling | | | | | x |
| yes | | | cycling | | yes | | | x |
| permissive | | | cycling | | permissive | | | x |
| designated | | | cycling | | designated | | | x |
| some_tag | | | cycling | | some_tag | | | x |
| no | | | | | no | | | |
| private | | | | | private | | | |
| agricultural | | | | | agricultural | | | |
| forestry | | | | | forestry | | | |
| delivery | | | | | delivery | | | |
| | yes | | cycling | | | yes | | x |
| | permissive | | cycling | | | permissive | | x |
| | designated | | cycling | | | designated | | x |
| | some_tag | | cycling | | | some_tag | | x |
| | no | | | | | no | | |
| | private | | | | | private | | |
| | agricultural | | | | | agricultural | | |
| | forestry | | | | | forestry | | |
| | delivery | | | | | delivery | | |
| | | yes | cycling | | | | yes | x |
| | | permissive | cycling | | | | permissive | x |
| | | designated | cycling | | | | designated | x |
| | | some_tag | cycling | | | | some_tag | x |
| | | no | | | | | no | |
| | | private | | | | | private | |
| | | agricultural | | | | | agricultural | |
| | | forestry | | | | | forestry | |
| | | delivery | | | | | delivery | |
+22 -22
View File
@@ -71,17 +71,17 @@ Feature: Bike - Squares and other areas
| abcda | (nil) | parking | | abcda | (nil) | parking |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| x | y | xa,abcda,by | | x | y | xa,abcda,by,by |
| y | x | by,abcda,xa | | y | x | by,abcda,xa,xa |
| a | b | abcda,abcda | | a | b | abcda,abcda |
| a | d | abcda,abcda | | a | d | abcda,abcda |
| b | c | abcda,abcda | | b | c | abcda,abcda |
| c | b | abcda,abcda | | c | b | abcda,abcda |
| c | d | abcda,abcda | | c | d | abcda,abcda |
| d | c | abcda,abcda | | d | c | abcda,abcda |
| d | a | abcda,abcda | | d | a | abcda,abcda |
| a | d | abcda,abcda | | a | d | abcda,abcda |
@train @platform @train @platform
@@ -99,14 +99,14 @@ Feature: Bike - Squares and other areas
| abcda | (nil) | platform | | abcda | (nil) | platform |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| x | y | xa,abcda,by | | x | y | xa,abcda,by,by |
| y | x | by,abcda,xa | | y | x | by,abcda,xa,xa |
| a | b | abcda,abcda | | a | b | abcda,abcda |
| a | d | abcda,abcda | | a | d | abcda,abcda |
| b | c | abcda,abcda | | b | c | abcda,abcda |
| c | b | abcda,abcda | | c | b | abcda,abcda |
| c | d | abcda,abcda | | c | d | abcda,abcda |
| d | c | abcda,abcda | | d | c | abcda,abcda |
| d | a | abcda,abcda | | d | a | abcda,abcda |
| a | d | abcda,abcda | | a | d | abcda,abcda |
+11 -11
View File
@@ -7,9 +7,9 @@ Feature: Bicycle - Handle cycling
Scenario: Bicycle - Use a ferry route Scenario: Bicycle - Use a ferry route
Given the node map Given the node map
""" """
a b c a b c
d d
e f g e f g
""" """
And the ways And the ways
@@ -19,22 +19,22 @@ Feature: Bicycle - Handle cycling
| efg | primary | | | | efg | primary | | |
When I route I should get When I route I should get
| from | to | route | modes | | from | to | route | modes |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | | a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | | b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| e | c | cde,cde | cycling,cycling | | e | c | cde,cde | cycling,cycling |
| e | b | cde,abc,abc | cycling,cycling,cycling | | e | b | cde,abc,abc | cycling,cycling,cycling |
| e | a | cde,abc,abc | cycling,cycling,cycling | | e | a | cde,abc,abc | cycling,cycling,cycling |
| c | e | cde,cde | cycling,cycling | | c | e | cde,cde | cycling,cycling |
| c | f | cde,efg,efg | cycling,cycling,cycling | | c | f | cde,efg,efg | cycling,cycling,cycling |
| c | g | cde,efg,efg | cycling,cycling,cycling | | c | g | cde,efg,efg | cycling,cycling,cycling |
Scenario: Bicycle - Properly handle durations Scenario: Bicycle - Properly handle durations
Given the node map Given the node map
""" """
a b c a b c
d d
e f g e f g
""" """
And the ways And the ways
@@ -45,7 +45,7 @@ Feature: Bicycle - Handle cycling
When I route I should get When I route I should get
| from | to | route | modes | speed | | from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 6 km/h | | a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h | | b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
| c | e | cde,cde | cycling,cycling | 2 km/h | | c | e | cde,cde | cycling,cycling | 2 km/h |
| e | c | cde,cde | cycling,cycling | 2 km/h | | e | c | cde,cde | cycling,cycling | 2 km/h |
+1 -1
View File
@@ -159,7 +159,7 @@ Feature: Bike - Mode flag
| c | a | bc,ab,ab | pushing bike,cycling,cycling | | c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike | | d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike | | a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | pushing bike,cycling,cycling | | b | d | bc,cd,cd | pushing bike,cycling,cycling |
Scenario: Bicycle - Modes when starting on forward oneway Scenario: Bicycle - Modes when starting on forward oneway
Given the node map Given the node map
+2 -2
View File
@@ -17,8 +17,8 @@ Feature: Bike - Street names in instructions
| bc | Your Way | A7 | | bc | Your Way | A7 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route | ref |
| a | c | My Way,Your Way | A6,A7 | | a | c | My Way,Your Way,Your Way | A6,A7,A7 |
@unnamed @unnamed
Scenario: Bike - No longer use way type to describe unnamed ways, see #3231 Scenario: Bike - No longer use way type to describe unnamed ways, see #3231
+66 -68
View File
@@ -8,15 +8,13 @@ Feature: Bike - Oneway streets
Scenario: Bike - Simple oneway Scenario: Bike - Simple oneway
Then routability should be Then routability should be
| highway | foot | oneway | forw | backw | | highway | foot | oneway | forw | backw |
| primary | no | yes | cycling | | | primary | no | yes | x | |
| primary | | yes | cycling | pushing bike |
Scenario: Simple reverse oneway Scenario: Simple reverse oneway
Then routability should be Then routability should be
| highway | foot | oneway | forw | backw | | highway | foot | oneway | forw | backw |
| primary | no | -1 | | cycling | | primary | no | -1 | | x |
| primary | | -1 | pushing bike | cycling |
Scenario: Bike - Around the Block Scenario: Bike - Around the Block
Given the node map Given the node map
@@ -41,83 +39,83 @@ Feature: Bike - Oneway streets
Scenario: Bike - Handle various oneway tag values Scenario: Bike - Handle various oneway tag values
Then routability should be Then routability should be
| foot | oneway | forw | backw | | foot | oneway | forw | backw |
| no | | cycling | cycling | | no | | x | x |
| no | nonsense | cycling | cycling | | no | nonsense | x | x |
| no | no | cycling | cycling | | no | no | x | x |
| no | false | cycling | cycling | | no | false | x | x |
| no | 0 | cycling | cycling | | no | 0 | x | x |
| no | yes | cycling | | | no | yes | x | |
| no | true | cycling | | | no | true | x | |
| no | 1 | cycling | | | no | 1 | x | |
| no | -1 | | cycling | | no | -1 | | x |
Scenario: Bike - Implied oneways Scenario: Bike - Implied oneways
Then routability should be Then routability should be
| highway | foot | bicycle | junction | forw | backw | # | | highway | foot | bicycle | junction | forw | backw | # |
| | no | | | cycling | cycling | | | | no | | | x | x | |
| | no | | roundabout | cycling | | | | | no | | roundabout | x | | |
| motorway | no | yes | | cycling | | | | motorway | no | yes | | x | | |
| motorway_link | no | yes | | cycling | cycling | does not imply oneway | | motorway_link | no | yes | | x | x | does not imply oneway |
| motorway | no | yes | roundabout | cycling | | | | motorway | no | yes | roundabout | x | | |
| motorway_link | no | yes | roundabout | cycling | | | | motorway_link | no | yes | roundabout | x | | |
Scenario: Bike - Overriding implied oneways Scenario: Bike - Overriding implied oneways
Then routability should be Then routability should be
| highway | foot | junction | oneway | forw | backw | | highway | foot | junction | oneway | forw | backw |
| primary | no | roundabout | no | cycling | cycling | | primary | no | roundabout | no | x | x |
| primary | no | roundabout | yes | cycling | | | primary | no | roundabout | yes | x | |
| motorway_link | no | | -1 | | | | motorway_link | no | | -1 | | |
| trunk_link | no | | -1 | | | | trunk_link | no | | -1 | | |
| primary | no | roundabout | -1 | | cycling | | primary | no | roundabout | -1 | | x |
Scenario: Bike - Oneway:bicycle should override normal oneways tags Scenario: Bike - Oneway:bicycle should override normal oneways tags
Then routability should be Then routability should be
| foot | oneway:bicycle | oneway | junction | forw | backw | | foot | oneway:bicycle | oneway | junction | forw | backw |
| no | yes | | | cycling | | | no | yes | | | x | |
| no | yes | yes | | cycling | | | no | yes | yes | | x | |
| no | yes | no | | cycling | | | no | yes | no | | x | |
| no | yes | -1 | | cycling | | | no | yes | -1 | | x | |
| no | yes | | roundabout | cycling | | | no | yes | | roundabout | x | |
| no | no | | | cycling | cycling | | no | no | | | x | x |
| no | no | yes | | cycling | cycling | | no | no | yes | | x | x |
| no | no | no | | cycling | cycling | | no | no | no | | x | x |
| no | no | -1 | | cycling | cycling | | no | no | -1 | | x | x |
| no | no | | roundabout | cycling | cycling | | no | no | | roundabout | x | x |
| no | -1 | | | | cycling | | no | -1 | | | | x |
| no | -1 | yes | | | cycling | | no | -1 | yes | | | x |
| no | -1 | no | | | cycling | | no | -1 | no | | | x |
| no | -1 | -1 | | | cycling | | no | -1 | -1 | | | x |
| no | -1 | | roundabout | | cycling | | no | -1 | | roundabout | | x |
Scenario: Bike - Contra flow Scenario: Bike - Contra flow
Then routability should be Then routability should be
| foot | oneway | cycleway | forw | backw | | foot | oneway | cycleway | forw | backw |
| no | yes | opposite | cycling | cycling | | no | yes | opposite | x | x |
| no | yes | opposite_track | cycling | cycling | | no | yes | opposite_track | x | x |
| no | yes | opposite_lane | cycling | cycling | | no | yes | opposite_lane | x | x |
| no | -1 | opposite | cycling | cycling | | no | -1 | opposite | x | x |
| no | -1 | opposite_track | cycling | cycling | | no | -1 | opposite_track | x | x |
| no | -1 | opposite_lane | cycling | cycling | | no | -1 | opposite_lane | x | x |
| no | no | opposite | cycling | cycling | | no | no | opposite | x | x |
| no | no | opposite_track | cycling | cycling | | no | no | opposite_track | x | x |
| no | no | opposite_lane | cycling | cycling | | no | no | opposite_lane | x | x |
Scenario: Bike - Should not be affected by car tags Scenario: Bike - Should not be affected by car tags
Then routability should be Then routability should be
| foot | junction | oneway | oneway:car | forw | backw | | foot | junction | oneway | oneway:car | forw | backw |
| no | | yes | yes | cycling | | | no | | yes | yes | x | |
| no | | yes | no | cycling | | | no | | yes | no | x | |
| no | | yes | -1 | cycling | | | no | | yes | -1 | x | |
| no | | no | yes | cycling | cycling | | no | | no | yes | x | x |
| no | | no | no | cycling | cycling | | no | | no | no | x | x |
| no | | no | -1 | cycling | cycling | | no | | no | -1 | x | x |
| no | | -1 | yes | | cycling | | no | | -1 | yes | | x |
| no | | -1 | no | | cycling | | no | | -1 | no | | x |
| no | | -1 | -1 | | cycling | | no | | -1 | -1 | | x |
| no | roundabout | | yes | cycling | | | no | roundabout | | yes | x | |
| no | roundabout | | no | cycling | | | no | roundabout | | no | x | |
| no | roundabout | | -1 | cycling | | | no | roundabout | | -1 | x | |
Scenario: Bike - Two consecutive oneways Scenario: Bike - Two consecutive oneways
Given the node map Given the node map
+34 -30
View File
@@ -3,30 +3,34 @@ Feature: Bike - Accessability of different way types
Background: Background:
Given the profile "bicycle" Given the profile "bicycle"
Given the shortcuts
| key | value |
| bike | 15 km/h ~20% |
| foot | 5 km/h ~20% |
Scenario: Bike - Pushing bikes on pedestrian-only ways Scenario: Bike - Pushing bikes on pedestrian-only ways
Then routability should be Then routability should be
| highway | oneway | forw | backw | | highway | oneway | forw | backw |
| (nil) | | | | | (nil) | | | |
| cycleway | | cycling | cycling | | cycleway | | bike | bike |
| primary | | cycling | cycling | | primary | | bike | bike |
| pedestrian | | pushing bike | pushing bike | | pedestrian | | foot | foot |
| cycleway | | cycling | cycling | | footway | | foot | foot |
| primary | yes | cycling | pushing bike | | primary | yes | bike | foot |
Scenario: Bike - Pushing bikes against normal oneways Scenario: Bike - Pushing bikes against normal oneways
Then routability should be Then routability should be
| highway | oneway | forw | backw | | highway | oneway | forw | backw |
| (nil) | | | | | (nil) | | | |
| primary | yes | cycling | pushing bike | | primary | yes | bike | foot |
| pedestrian | yes | pushing bike | pushing bike | | pedestrian | yes | foot | foot |
Scenario: Bike - Pushing bikes against reverse oneways Scenario: Bike - Pushing bikes against reverse oneways
Then routability should be Then routability should be
| highway | oneway | forw | backw | | highway | oneway | forw | backw |
| (nil) | | | | | (nil) | | | |
| primary | -1 | pushing bike | cycling | | primary | -1 | foot | bike |
| pedestrian | -1 | pushing bike | pushing bike | | pedestrian | -1 | foot | foot |
@square @square
Scenario: Bike - Push bikes on pedestrian areas Scenario: Bike - Push bikes on pedestrian areas
@@ -43,7 +47,7 @@ Feature: Bike - Accessability of different way types
| abcda | yes | pedestrian | | abcda | yes | pedestrian |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | b | abcda,abcda | | a | b | abcda,abcda |
| a | d | abcda,abcda | | a | d | abcda,abcda |
| b | c | abcda,abcda | | b | c | abcda,abcda |
@@ -55,19 +59,19 @@ Feature: Bike - Accessability of different way types
Scenario: Bike - Pushing bikes on ways with foot=yes Scenario: Bike - Pushing bikes on ways with foot=yes
Then routability should be Then routability should be
| highway | foot | forw | backw | | highway | foot | forw | backw |
| motorway | | | | | motorway | | | |
| motorway | yes | pushing bike | | | motorway | yes | foot | |
| runway | | | | | runway | | | |
| runway | yes | pushing bike | pushing bike | | runway | yes | foot | foot |
@todo @todo
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
Then routability should be Then routability should be
| highway | foot:forward | foot:backward | forw | backw | | highway | foot:forward | foot:backward | forw | backw |
| motorway | | | | | | motorway | | | | |
| motorway | yes | | pushing bike | | | motorway | yes | | foot | |
| motorway | | yes | | pushing bike | | motorway | | yes | | foot |
@construction @construction
Scenario: Bike - Don't allow routing on ways still under construction Scenario: Bike - Don't allow routing on ways still under construction
@@ -100,11 +104,11 @@ Feature: Bike - Accessability of different way types
| cf | primary | | | cf | primary | |
When I route I should get When I route I should get
| from | to | route | modes | | from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling | | a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling | | d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | pushing bike,cycling,cycling | | c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike | | d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc. Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
Given the node map Given the node map
-1
View File
@@ -5,7 +5,6 @@ Feature: Bike - Turn restrictions
Background: Background:
Given the profile "bicycle" Given the profile "bicycle"
Given a grid size of 200 meters
@no_turning @no_turning
Scenario: Bike - No left turn Scenario: Bike - No left turn
+26 -26
View File
@@ -7,33 +7,33 @@ Feature: Bike - Handle ferry routes
Scenario: Bike - Bringing bikes on trains Scenario: Bike - Bringing bikes on trains
Then routability should be Then routability should be
| highway | railway | bicycle | bothw | | highway | railway | bicycle | bothw |
| primary | | | cycling | | primary | | | x |
| (nil) | train | | | | (nil) | train | | |
| (nil) | train | no | | | (nil) | train | no | |
| (nil) | train | yes | train | | (nil) | train | yes | x |
| (nil) | railway | | | | (nil) | railway | | |
| (nil) | railway | no | | | (nil) | railway | no | |
| (nil) | railway | yes | train | | (nil) | railway | yes | x |
| (nil) | subway | | | | (nil) | subway | | |
| (nil) | subway | no | | | (nil) | subway | no | |
| (nil) | subway | yes | train | | (nil) | subway | yes | x |
| (nil) | tram | | | | (nil) | tram | | |
| (nil) | tram | no | | | (nil) | tram | no | |
| (nil) | tram | yes | train | | (nil) | tram | yes | x |
| (nil) | light_rail | | | | (nil) | light_rail | | |
| (nil) | light_rail | no | | | (nil) | light_rail | no | |
| (nil) | light_rail | yes | train | | (nil) | light_rail | yes | x |
| (nil) | monorail | | | | (nil) | monorail | | |
| (nil) | monorail | no | | | (nil) | monorail | no | |
| (nil) | monorail | yes | train | | (nil) | monorail | yes | x |
| (nil) | some_tag | | | | (nil) | some_tag | | |
| (nil) | some_tag | no | | | (nil) | some_tag | no | |
| (nil) | some_tag | yes | cycling | | (nil) | some_tag | yes | x |
@construction @construction
Scenario: Bike - Don't route on railways under construction Scenario: Bike - Don't route on railways under construction
Then routability should be Then routability should be
| highway | railway | bicycle | bothw | | highway | railway | bicycle | bothw |
| primary | | | cycling | | primary | | | x |
| (nil) | construction | yes | | | (nil) | construction | yes | |
+7 -8
View File
@@ -3,7 +3,6 @@ Feature: Turn Penalties
Background: Background:
Given the profile "turnbot" Given the profile "turnbot"
Given a grid size of 200 meters
Scenario: Bike - turns should incur a delay that depend on the angle Scenario: Bike - turns should incur a delay that depend on the angle
@@ -27,10 +26,10 @@ Feature: Turn Penalties
When I route I should get When I route I should get
| from | to | route | time | distance | | from | to | route | time | distance |
| s | a | sj,ja,ja | 63s +-1 | 483m +-1 | | s | a | sj,ja,ja | 39s +-1 | 242m +-1 |
| s | b | sj,jb,jb | 50s +-1 | 400m +-1 | | s | b | sj,jb,jb | 30s +-1 | 200m +-1 |
| s | c | sj,jc,jc | 54s +-1 | 483m +-1 | | s | c | sj,jc,jc | 29s +-1 | 242m +-1 |
| s | d | sj,jd,jd | 40s +-1 | 400m +-1 | | s | d | sj,jd,jd | 20s +-1 | 200m +-1 |
| s | e | sj,je,je | 53s +-1 | 483m +-1 | | s | e | sj,je,je | 29s +-1 | 242m +-1 |
| s | f | sj,jf,jf | 50s +-1 | 400m +-1 | | s | f | sj,jf,jf | 30s +-1 | 200m +-1 |
| s | g | sj,jg,jg | 63s +-1 | 483m +-1 | | s | g | sj,jg,jg | 39s +-1 | 242m +-1 |
+1 -2
View File
@@ -292,15 +292,14 @@ Feature: Car - Restricted access
| service | private | | | service | private | |
| cycleway | private | | | cycleway | private | |
| track | private | | | track | private | |
| footway | customers | |
Scenario: Car - Access blacklist Scenario: Car - Access blacklist
Then routability should be Then routability should be
| highway | access | bothw | | highway | access | bothw |
| primary | | x | | primary | | x |
| primary | customer | |
| primary | emergency | | | primary | emergency | |
| primary | forestry | | | primary | forestry | |
| primary | agricultural | | | primary | agricultural | |
| primary | psv | | | primary | psv | |
| primary | no | | | primary | no | |
| primary | customers | x |
+7 -8
View File
@@ -3,7 +3,6 @@ Feature: Car - Handle driving
Background: Background:
Given the profile "car" Given the profile "car"
Given a grid size of 200 meters
Scenario: Car - Use a ferry route Scenario: Car - Use a ferry route
Given the node map Given the node map
@@ -16,7 +15,7 @@ Feature: Car - Handle driving
And the ways And the ways
| nodes | highway | bridge | bicycle | | nodes | highway | bridge | bicycle |
| abc | primary | | | | abc | primary | | |
| cde | primary | movable | yes | | cde | | movable | yes |
| efg | primary | | | | efg | primary | | |
When I route I should get When I route I should get
@@ -41,15 +40,15 @@ Feature: Car - Handle driving
And the ways And the ways
| nodes | highway | bridge | | nodes | highway | bridge |
| abc | primary | | | abc | primary | |
| cde | primary | movable | | cde | | movable |
| efg | primary | | | efg | primary | |
When I route I should get When I route I should get
| from | to | route | modes | speed | time | | from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 13 km/h | 340s +-1 | | a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 318s +-1 | | b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
| c | e | cde,cde | driving,driving | 5 km/h | 295s +-1 | | c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
| e | c | cde,cde | driving,driving | 5 km/h | 295s +-1 | | e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
Scenario: Car - Properly handle durations Scenario: Car - Properly handle durations
Given the node map Given the node map
@@ -62,7 +61,7 @@ Feature: Car - Handle driving
And the ways And the ways
| nodes | highway | bridge | duration | | nodes | highway | bridge | duration |
| abc | primary | | | | abc | primary | | |
| cde | primary | movable | 00:10:00 | | cde | | movable | 00:05:00 |
| efg | primary | | | | efg | primary | | |
When I route I should get When I route I should get
+6 -6
View File
@@ -23,11 +23,11 @@ Feature: Car - Destination only, no passing through
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | b | ab,ab | | a | b | ab,ab |
| a | c | ab,bcd | | a | c | ab,bcd,bcd |
| a | d | ab,bcd,bcd | | a | d | ab,bcd,bcd |
| a | e | axye,axye | | a | e | axye,axye |
| e | d | de,de | | e | d | de,de |
| e | c | de,bcd | | e | c | de,bcd,bcd |
| e | b | de,bcd,bcd | | e | b | de,bcd,bcd |
| e | a | axye,axye | | e | a | axye,axye |
@@ -51,12 +51,12 @@ Feature: Car - Destination only, no passing through
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | b | ab,ab | | a | b | ab,ab |
| a | c | ab,bc | | a | c | ab,bc,bc |
| a | d | ab,cd | | a | d | ab,bc,cd,cd |
| a | e | axye,axye | | a | e | axye,axye |
| e | d | de,de | | e | d | de,de |
| e | c | de,cd | | e | c | de,cd,cd |
| e | b | de,bc | | e | b | de,cd,bc,bc |
| e | a | axye,axye | | e | a | axye,axye |
Scenario: Car - Routing inside a destination only area Scenario: Car - Routing inside a destination only area
+5 -5
View File
@@ -18,8 +18,8 @@ Feature: Car - Street names in instructions
| bc | Your Way | A1 | | bc | Your Way | A1 |
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route | ref |
| a | c | My Way,Your Way | ,A1| | a | c | My Way,Your Way,Your Way | ,A1,A1|
Scenario: Car - A named street with pronunciation Scenario: Car - A named street with pronunciation
Given the node map Given the node map
@@ -36,9 +36,9 @@ Feature: Car - Street names in instructions
| cd | Your Way | yourewaye | | | cd | Your Way | yourewaye | |
When I route I should get When I route I should get
| from | to | route | pronunciations | ref | | from | to | route | pronunciations | ref |
| a | d | My Way,My Way | ,meyeway | ,A1 | | a | d | My Way,My Way,My Way | ,meyeway,meyeway | ,A1,A1 |
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , | | 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
# See #2860 # See #2860
Scenario: Car - same street name but different pronunciation Scenario: Car - same street name but different pronunciation
+1 -1
View File
@@ -5,7 +5,7 @@ Feature: Basic Routing
Given the profile "car" Given the profile "car"
Given a grid size of 500 meters Given a grid size of 500 meters
@smallest @via @smallest
Scenario: Summaries when routing on a simple network Scenario: Summaries when routing on a simple network
Given the node map Given the node map
""" """
+7 -9
View File
@@ -53,13 +53,13 @@ Feature: Traffic - turn penalties
Scenario: Weighting not based on turn penalty file Scenario: Weighting not based on turn penalty file
When I route I should get When I route I should get
| from | to | route | speed | weight | time | | from | to | route | speed | weight | time |
| a | h | ad,dhk | 65 km/h | 11s +-1 | 11s +-1 | | a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 |
# straight # straight
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 | | i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
# right # right
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 | | a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
# left # left
| c | g | cd,def,fg | 65 km/h | 22s +-1 | 22s +-1 | | c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 |
# double straight # double straight
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 | | p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
# straight-right # straight-right
@@ -87,16 +87,15 @@ Feature: Traffic - turn penalties
# hkl left turn # hkl left turn
# ade left turn # ade left turn
And the contract extra arguments "--turn-penalty-file {penalties_file}" And the contract extra arguments "--turn-penalty-file {penalties_file}"
And the customize extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get When I route I should get
| from | to | route | speed | weight | time | | from | to | route | speed | weight | time |
| a | h | ad,dhk | 65 km/h | 11 | 11s +-1 | | a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 |
# straight # straight
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 | | i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
# right - ifg penalty # right - ifg penalty
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 | | a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
# left - faster because of negative ade penalty # left - faster because of negative ade penalty
| c | g | cd,def,fg | 65 km/h | 22 | 22s +-1 | | c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 |
# double straight # double straight
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 | | p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
# straight-right - ifg penalty # straight-right - ifg penalty
@@ -106,13 +105,12 @@ Feature: Traffic - turn penalties
# double right - forced left by lkh penalty # double right - forced left by lkh penalty
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 | | g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
# double left - imn penalty # double left - imn penalty
| j | c | jk,klm,fim,def,cd | 53 km/h | 54.6 | 54s +-1 | | j | c | jk,klm,fim,def,cd,cd | 53 km/h | 54.6 | 54s +-1 |
# double left - hdc penalty ever so slightly higher than imn; forces all the way around # double left - hdc penalty ever so slightly higher than imn; forces all the way around
Scenario: Too-negative penalty clamps, but does not fail Scenario: Too-negative penalty clamps, but does not fail
Given the profile "testbot" Given the contract extra arguments "--turn-penalty-file {penalties_file}"
And the contract extra arguments "--turn-penalty-file {penalties_file}" And the profile "testbot"
And the customize extra arguments "--turn-penalty-file {penalties_file}"
And the turn penalty file And the turn penalty file
""" """
1,4,5,-10 1,4,5,-10
-1
View File
@@ -53,7 +53,6 @@ Feature: Car - weights
| ec | service | yes | | ec | service | yes |
And the extract extra arguments "--generate-edge-lookup" And the extract extra arguments "--generate-edge-lookup"
And the contract extra arguments "--segment-speed-file {speeds_file}" And the contract extra arguments "--segment-speed-file {speeds_file}"
And the customize extra arguments "--segment-speed-file {speeds_file}"
And the speed file And the speed file
""" """
2,5,8 2,5,8
-1
View File
@@ -3,7 +3,6 @@ Feature: Foot - Squares and other areas
Background: Background:
Given the profile "foot" Given the profile "foot"
Given a grid size of 200 meters
@square @square
Scenario: Foot - Route along edge of a squares Scenario: Foot - Route along edge of a squares
-1
View File
@@ -3,7 +3,6 @@ Feature: Foot - Street names in instructions
Background: Background:
Given the profile "foot" Given the profile "foot"
Given a grid size of 200 meters
Scenario: Foot - A named street Scenario: Foot - A named street
Given the node map Given the node map
-1
View File
@@ -4,7 +4,6 @@ Feature: Foot - Turn restrictions
Background: Background:
Given the profile "foot" Given the profile "foot"
Given a grid size of 200 meters
@no_turning @no_turning
Scenario: Foot - No left turn Scenario: Foot - No left turn
+11 -11
View File
@@ -297,19 +297,19 @@ Feature: Turn Lane Guidance
""" """
And the ways And the ways
| nodes | turn:lanes:forward | name | destination | oneway | | nodes | turn:lanes:forward | name |
| ab | | main | One | yes | | ab | | main |
| bc | left\|through\|through\|through\|right | main | One | yes | | bc | left\|through\|through\|through\|right | main |
| cd | left\|through\|right | main | Two | yes | | cd | left\|through\|right | main |
| de | | main | Three | yes | | de | | main |
| cf | | off | | yes | | cf | | off |
| ch | | off | | yes | | ch | | off |
| dg | | off | | yes | | dg | | off |
| di | | off | | yes | | di | | off |
When I route I should get When I route I should get
| waypoints | route | turns | destinations | lanes | locations | | waypoints | route | turns | lanes |
| a,e | main,main,main | depart,use lane straight,arrive | One,Two,Three | ,left:false straight:false straight:true straight:false right:false, | a,c,e | | a,e | main,main,main | depart,use lane straight,arrive | ,left:false straight:false straight:true straight:false right:false, |
@anticipate @anticipate
Scenario: Anticipate Lanes for through and collapse multiple use lanes Scenario: Anticipate Lanes for through and collapse multiple use lanes
+2 -2
View File
@@ -33,8 +33,8 @@ Feature: Features related to bugs
| e | traffic_signals | | e | traffic_signals |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| 1,2 | top,right | depart,arrive | | 1,2 | top,right,right | depart,new name right,arrive |
@3156 @3156
Scenario: Incorrect lanes tag Scenario: Incorrect lanes tag
+21 -78
View File
@@ -9,10 +9,10 @@ Feature: Collapse
Scenario: Collapse U-Turn Triangle Intersection Scenario: Collapse U-Turn Triangle Intersection
Given the node map Given the node map
""" """
g---f---e---d g f e d
\ /
\ /
a-----b-----c a b c
""" """
And the ways And the ways
@@ -23,27 +23,27 @@ Feature: Collapse
| be | primary_link | | yes | | be | primary_link | | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g | | a,g | road,road,road | depart,continue uturn,arrive |
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c | | d,c | road,road,road | depart,continue uturn,arrive |
@reverse @traffic-signals @reverse @traffic-signals
Scenario: Collapse U-Turn Triangle Intersection Scenario: Collapse U-Turn Triangle Intersection
Given the node map Given the node map
""" """
g---f---j---e---d g f j e d
\ /
h i h i
\ /
a-------b-------c a b c
""" """
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
| abc | primary | road | yes | | abc | primary | road | yes |
| dejfg | primary | road | yes | | dejfg | primary | road | yes |
| fhb | primary_link | | yes | | fhb | primary_link | | |
| bie | primary_link | | yes | | bie | primary_link | | |
And the nodes And the nodes
| node | highway | | node | highway |
@@ -52,9 +52,9 @@ Feature: Collapse
| i | traffic_signals | | i | traffic_signals |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g | | a,g | road,road,road | depart,continue uturn,arrive |
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c | | d,c | road,road,road | depart,continue uturn,arrive |
Scenario: Forking before a turn (forky) Scenario: Forking before a turn (forky)
Given the node map Given the node map
@@ -66,7 +66,7 @@ Feature: Collapse
`d. `d.
f e f e
""" """
# note: check collapse.feature for a similar test case where we do not # note: check clooapse.feature for a similar test case where we do not
# classify the situation as Sliproad and therefore keep the fork inst. # classify the situation as Sliproad and therefore keep the fork inst.
And the ways And the ways
@@ -85,65 +85,8 @@ Feature: Collapse
| restriction | bc | dc | c | no_right_turn | | restriction | bc | dc | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g | | a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e | | a,e | road,road,road | depart,continue right,arrive |
# We should discuss whether the next item should be collapsed to depart,turn right,arrive. # We should discuss whether the next item should be collapsed to depart,turn right,arrive.
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive | a,b,d,f | | a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
Scenario: Forking before a turn (forky), larger
Given the node map
"""
g
.
c
.'|
.' |
a . . b .' |
' . |
` d
f ' e
"""
And the ways
| nodes | name | oneway | highway |
| ab | road | yes | primary |
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns | locations |
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e |
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive | a,b,d,f |
Scenario: Pulled Back Turn
Given the node map
"""
d
|
a-b-c
|
e
"""
And the ways
| nodes | highway | name |
| abc | tertiary | road |
| cd | tertiary | left |
| be | tertiary | right |
When I route I should get
| waypoints | route | turns |
| a,d | road,left,left | depart,turn left,arrive |
| a,e | road,right,right | depart,turn right,arrive |
+285 -268
View File
@@ -32,23 +32,23 @@ Feature: Collapse
| gb | primary | first | yes | | gb | primary | first | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,l | first,second,second | depart,turn right,arrive | a,b,l | | a,l | first,second,second | depart,turn right,arrive |
| a,d | first,first | depart,arrive | a,d | | a,d | first,first | depart,arrive |
| a,j | first,second,second | depart,turn left,arrive | a,c,j | | a,j | first,second,second | depart,turn left,arrive |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h | | a,h | first,first,first | depart,continue uturn,arrive |
| e,j | first,second,second | depart,turn right,arrive | e,f,j | | e,j | first,second,second | depart,turn right,arrive |
| e,h | first,first | depart,arrive | e,h | | e,h | first,first | depart,arrive |
| e,l | first,second,second | depart,turn left,arrive | e,g,l | | e,l | first,second,second | depart,turn left,arrive |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d | | e,d | first,first,first | depart,continue uturn,arrive |
| k,h | second,first,first | depart,turn right,arrive | k,g,h | | k,h | second,first,first | depart,turn right,arrive |
| k,l | second,second | depart,arrive | k,l | | k,l | second,second | depart,arrive |
| k,d | second,first,first | depart,turn left,arrive | k,b,d | | k,d | second,first,first | depart,turn left,arrive |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j | | k,j | second,second,second | depart,continue uturn,arrive |
| i,d | second,first,first | depart,turn right,arrive | i,c,d | | i,d | second,first,first | depart,turn right,arrive |
| i,j | second,second | depart,arrive | i,j | | i,j | second,second | depart,arrive |
| i,h | second,first,first | depart,turn left,arrive | i,f,h | | i,h | second,first,first | depart,turn left,arrive |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l | | i,l | second,second,second | depart,continue uturn,arrive |
Scenario: Segregated Intersection, Cross Belonging to Correct Street Scenario: Segregated Intersection, Cross Belonging to Correct Street
Given the node map Given the node map
@@ -77,23 +77,23 @@ Feature: Collapse
| gb | primary | second | yes | | gb | primary | second | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,l | first,second,second | depart,turn right,arrive | a,b,l | | a,l | first,second,second | depart,turn right,arrive |
| a,d | first,first | depart,arrive | a,d | | a,d | first,first | depart,arrive |
| a,j | first,second,second | depart,turn left,arrive | a,c,j | | a,j | first,second,second | depart,turn left,arrive |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h | | a,h | first,first,first | depart,continue uturn,arrive |
| e,j | first,second,second | depart,turn right,arrive | e,f,j | | e,j | first,second,second | depart,turn right,arrive |
| e,h | first,first | depart,arrive | e,h | | e,h | first,first | depart,arrive |
| e,l | first,second,second | depart,turn left,arrive | e,g,l | | e,l | first,second,second | depart,turn left,arrive |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d | | e,d | first,first,first | depart,continue uturn,arrive |
| k,h | second,first,first | depart,turn right,arrive | k,g,h | | k,h | second,first,first | depart,turn right,arrive |
| k,l | second,second | depart,arrive | k,l | | k,l | second,second | depart,arrive |
| k,d | second,first,first | depart,turn left,arrive | k,b,d | | k,d | second,first,first | depart,turn left,arrive |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j | | k,j | second,second,second | depart,continue uturn,arrive |
| i,d | second,first,first | depart,turn right,arrive | i,c,d | | i,d | second,first,first | depart,turn right,arrive |
| i,j | second,second | depart,arrive | i,j | | i,j | second,second | depart,arrive |
| i,h | second,first,first | depart,turn left,arrive | i,f,h | | i,h | second,first,first | depart,turn left,arrive |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l | | i,l | second,second,second | depart,continue uturn,arrive |
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets Scenario: Segregated Intersection, Cross Belonging to Mixed Streets
Given the node map Given the node map
@@ -122,23 +122,23 @@ Feature: Collapse
| gb | primary | first | yes | | gb | primary | first | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,l | first,second,second | depart,turn right,arrive | a,b,l | | a,l | first,second,second | depart,turn right,arrive |
| a,d | first,first | depart,arrive | a,d | | a,d | first,first | depart,arrive |
| a,j | first,second,second | depart,turn left,arrive | a,c,j | | a,j | first,second,second | depart,turn left,arrive |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h | | a,h | first,first,first | depart,continue uturn,arrive |
| e,j | first,second,second | depart,turn right,arrive | e,f,j | | e,j | first,second,second | depart,turn right,arrive |
| e,h | first,first | depart,arrive | e,h | | e,h | first,first | depart,arrive |
| e,l | first,second,second | depart,turn left,arrive | e,g,l | | e,l | first,second,second | depart,turn left,arrive |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d | | e,d | first,first,first | depart,continue uturn,arrive |
| k,h | second,first,first | depart,turn right,arrive | k,g,h | | k,h | second,first,first | depart,turn right,arrive |
| k,l | second,second | depart,arrive | k,l | | k,l | second,second | depart,arrive |
| k,d | second,first,first | depart,turn left,arrive | k,b,d | | k,d | second,first,first | depart,turn left,arrive |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j | | k,j | second,second,second | depart,continue uturn,arrive |
| i,d | second,first,first | depart,turn right,arrive | i,c,d | | i,d | second,first,first | depart,turn right,arrive |
| i,j | second,second | depart,arrive | i,j | | i,j | second,second | depart,arrive |
| i,h | second,first,first | depart,turn left,arrive | i,f,h | | i,h | second,first,first | depart,turn left,arrive |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l | | i,l | second,second,second | depart,continue uturn,arrive |
Scenario: Partly Segregated Intersection, Two Segregated Roads Scenario: Partly Segregated Intersection, Two Segregated Roads
Given the node map Given the node map
@@ -172,23 +172,23 @@ Feature: Collapse
| liejk | primary | second | yes | 5 | | liejk | primary | second | yes | 5 |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,h | first,second,second | depart,turn right,arrive | a,b,h | | a,h | first,second,second | depart,turn right,arrive |
| a,c | first,first | depart,arrive | a,c | | a,c | first,first | depart,arrive |
| a,j | first,second,second | depart,turn left,arrive | a,b,j | | a,j | first,second,second | depart,turn left,arrive |
| a,f | first,first,first | depart,continue uturn,arrive | a,b,f | | a,f | first,first,first | depart,continue uturn,arrive |
| d,j | first,second,second | depart,turn right,arrive | d,e,j | | d,j | first,second,second | depart,turn right,arrive |
| d,f | first,first | depart,arrive | d,f | | d,f | first,first | depart,arrive |
| d,h | first,second,second | depart,turn left,arrive | d,e,h | | d,h | first,second,second | depart,turn left,arrive |
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c | | d,c | first,first,first | depart,continue uturn,arrive |
| g,c | second,first,first | depart,turn right,arrive | g,b,c | | g,c | second,first,first | depart,turn right,arrive |
| g,j | second,second | depart,arrive | g,j | | g,j | second,second | depart,arrive |
| g,f | second,first,first | depart,turn left,arrive | g,e,f | | g,f | second,first,first | depart,turn left,arrive |
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h | | g,h | second,second,second | depart,continue uturn,arrive |
| i,f | second,first,first | depart,turn right,arrive | i,e,f | | i,f | second,first,first | depart,turn right,arrive |
| i,h | second,second | depart,arrive | i,h | | i,h | second,second | depart,arrive |
| i,c | second,first,first | depart,turn left,arrive | i,b,c | | i,c | second,first,first | depart,turn left,arrive |
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j | | i,j | second,second,second | depart,continue uturn,arrive |
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
Given the node map Given the node map
@@ -226,23 +226,23 @@ Feature: Collapse
| liejk | primary | second | yes | 5 | | liejk | primary | second | yes | 5 |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,h | first,second,second | depart,turn right,arrive | a,b,h | | a,h | first,second,second | depart,turn right,arrive |
| a,c | first,first | depart,arrive | a,c | | a,c | first,first | depart,arrive |
| a,j | first,second,second | depart,turn left,arrive | a,b,j | | a,j | first,second,second | depart,turn left,arrive |
| a,f | first,first,first | depart,continue uturn,arrive | a,b,f | | a,f | first,first,first | depart,continue uturn,arrive |
| d,j | first,second,second | depart,turn right,arrive | d,e,j | | d,j | first,second,second | depart,turn right,arrive |
| d,f | first,first | depart,arrive | d,f | | d,f | first,first | depart,arrive |
| d,h | first,second,second | depart,turn left,arrive | d,e,h | | d,h | first,second,second | depart,turn left,arrive |
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c | | d,c | first,first,first | depart,continue uturn,arrive |
| g,c | second,first,first | depart,turn right,arrive | g,b,c | | g,c | second,first,first | depart,turn right,arrive |
| g,j | second,second | depart,arrive | g,j | | g,j | second,second | depart,arrive |
| g,f | second,first,first | depart,turn left,arrive | g,e,f | | g,f | second,first,first | depart,turn left,arrive |
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h | | g,h | second,second,second | depart,continue uturn,arrive |
| i,f | second,first,first | depart,turn right,arrive | i,e,f | | i,f | second,first,first | depart,turn right,arrive |
| i,h | second,second | depart,arrive | i,h | | i,h | second,second | depart,arrive |
| i,c | second,first,first | depart,turn left,arrive | i,b,c | | i,c | second,first,first | depart,turn left,arrive |
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j | | i,j | second,second,second | depart,continue uturn,arrive |
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles
Given the node map Given the node map
@@ -271,23 +271,23 @@ Feature: Collapse
| gb | primary | first | yes | | gb | primary | first | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,l | first,second,second | depart,turn right,arrive | a,b,l | | a,l | first,second,second | depart,turn right,arrive |
| a,d | first,first | depart,arrive | a,d | | a,d | first,first | depart,arrive |
| a,j | first,second,second | depart,turn left,arrive | a,c,j | | a,j | first,second,second | depart,turn left,arrive |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h | | a,h | first,first,first | depart,continue uturn,arrive |
| e,j | first,second,second | depart,turn right,arrive | e,f,j | | e,j | first,second,second | depart,turn right,arrive |
| e,h | first,first | depart,arrive | e,h | | e,h | first,first | depart,arrive |
| e,l | first,second,second | depart,turn left,arrive | e,g,l | | e,l | first,second,second | depart,turn left,arrive |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d | | e,d | first,first,first | depart,continue uturn,arrive |
| k,h | second,first,first | depart,turn right,arrive | k,g,h | | k,h | second,first,first | depart,turn right,arrive |
| k,l | second,second | depart,arrive | k,l | | k,l | second,second | depart,arrive |
| k,d | second,first,first | depart,turn left,arrive | k,b,d | | k,d | second,first,first | depart,turn left,arrive |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j | | k,j | second,second,second | depart,continue uturn,arrive |
| i,d | second,first,first | depart,turn right,arrive | i,c,d | | i,d | second,first,first | depart,turn right,arrive |
| i,j | second,second | depart,arrive | i,j | | i,j | second,second | depart,arrive |
| i,h | second,first,first | depart,turn left,arrive | i,f,h | | i,h | second,first,first | depart,turn left,arrive |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l | | i,l | second,second,second | depart,continue uturn,arrive |
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2) Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2)
Given the node map Given the node map
@@ -316,23 +316,23 @@ Feature: Collapse
| gb | primary | first | yes | | gb | primary | first | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,l | first,second,second | depart,turn right,arrive | a,b,l | | a,l | first,second,second | depart,turn right,arrive |
| a,d | first,first | depart,arrive | a,d | | a,d | first,first | depart,arrive |
| a,j | first,second,second | depart,turn left,arrive | a,c,j | | a,j | first,second,second | depart,turn left,arrive |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h | | a,h | first,first,first | depart,continue uturn,arrive |
| e,j | first,second,second | depart,turn right,arrive | e,f,j | | e,j | first,second,second | depart,turn right,arrive |
| e,h | first,first | depart,arrive | e,h | | e,h | first,first | depart,arrive |
| e,l | first,second,second | depart,turn left,arrive | e,g,l | | e,l | first,second,second | depart,turn left,arrive |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d | | e,d | first,first,first | depart,continue uturn,arrive |
| k,h | second,first,first | depart,turn right,arrive | k,g,h | | k,h | second,first,first | depart,turn right,arrive |
| k,l | second,second | depart,arrive | k,l | | k,l | second,second | depart,arrive |
| k,d | second,first,first | depart,turn left,arrive | k,b,d | | k,d | second,first,first | depart,turn left,arrive |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j | | k,j | second,second,second | depart,continue uturn,arrive |
| i,d | second,first,first | depart,turn right,arrive | i,c,d | | i,d | second,first,first | depart,turn right,arrive |
| i,j | second,second | depart,arrive | i,j | | i,j | second,second | depart,arrive |
| i,h | second,first,first | depart,turn left,arrive | i,f,h | | i,h | second,first,first | depart,turn left,arrive |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l | | i,l | second,second,second | depart,continue uturn,arrive |
Scenario: Entering a segregated road Scenario: Entering a segregated road
Given the node map Given the node map
@@ -353,20 +353,20 @@ Feature: Collapse
| ge | primary | second | no | | ge | primary | second | no |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c | | d,c | first,first,first | depart,continue uturn,arrive |
| a,f | first,first,first | depart,continue uturn,arrive | a,b,f | | a,f | first,first,first | depart,continue uturn,arrive |
| a,g | first,second,second | depart,turn left,arrive | a,b,g | | a,g | first,second,second | depart,turn left,arrive |
| d,g | first,second,second | depart,turn right,arrive | d,e,g | | d,g | first,second,second | depart,turn right,arrive |
| g,f | second,first,first | depart,turn right,arrive | g,e,f | | g,f | second,first,first | depart,turn right,arrive |
| g,c | second,first,first | depart,end of road left,arrive | g,b,c | | g,c | second,first,first | depart,end of road left,arrive |
Scenario: Do not collapse turning roads Scenario: Do not collapse turning roads
Given the node map Given the node map
""" """
e e
c---d c d
a---b-f a b f
""" """
And the ways And the ways
@@ -378,10 +378,10 @@ Feature: Collapse
| bf | primary | third | yes | | bf | primary | third | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,d | first,first,first,first | depart,continue left,continue right,arrive | a,b,c,d | | a,d | first,first,first,first | depart,continue left,continue right,arrive |
| a,e | first,second,second | depart,turn left,arrive | a,b,e | | a,e | first,second,second | depart,turn left,arrive |
| a,f | first,third,third | depart,turn straight,arrive | a,b,f | | a,f | first,third,third | depart,turn straight,arrive |
Scenario: Bridge on unnamed road Scenario: Bridge on unnamed road
Given the node map Given the node map
@@ -399,14 +399,12 @@ Feature: Collapse
| waypoints | route | turns | | waypoints | route | turns |
| a,d | , | depart,arrive | | a,d | , | depart,arrive |
# This scenario could be considered to require a `turn left`. The danger to create random/unwanted instructions Scenario: Crossing Bridge into Segregated Turn
# from a setting like this are just to big, though. Therefore I opted to use `depart,arrive` only
Scenario: Crossing Bridge into Segregated Turn
Given the node map Given the node map
""" """
f f
i-h-----g-e i h g e
a-b-----c-d a b c d
""" """
And the ways And the ways
@@ -421,8 +419,8 @@ Feature: Collapse
| hi | primary | yes | to_bridge | | hi | primary | yes | to_bridge |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,f | to_bridge,target_road | depart,arrive | a,f | | a,f | to_bridge,target_road,target_road | depart,turn left,arrive |
Scenario: Pankenbruecke Scenario: Pankenbruecke
Given the node map Given the node map
@@ -440,12 +438,8 @@ Feature: Collapse
| |
| |
| |
|
|
|
g g
""" """
And the ways And the ways
| nodes | highway | name | oneway | lanes | | nodes | highway | name | oneway | lanes |
| kabhj | primary | inroad | yes | 4 | | kabhj | primary | inroad | yes | 4 |
@@ -455,17 +449,17 @@ Feature: Collapse
| fi | primary | cross | no | | | fi | primary | cross | no | |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | inroad,outroad,outroad | depart,new name straight,arrive | a,d,g | | a,g | inroad,outroad,outroad | depart,new name straight,arrive |
| a,i | inroad,cross,cross | depart,turn left,arrive | a,f,i | | a,i | inroad,cross,cross | depart,turn left,arrive |
Scenario: Close Turns - Don't Collapse Scenario: Close Turns - Don't Collapse
Given the node map Given the node map
""" """
g d g d
| |
e-b-c-f e b c f
| |
a h a h
""" """
@@ -478,10 +472,10 @@ Feature: Collapse
| ch | primary | reverse | | ch | primary | reverse |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,d | in,cross,out,out | depart,turn right,turn left,arrive | a,b,c,d | | a,d | in,cross,out,out | depart,turn right,turn left,arrive |
| a,h | in,cross,reverse,reverse | depart,turn right,turn right,arrive | a,b,c,h | | a,h | in,cross,reverse,reverse | depart,turn right,turn right,arrive |
| g,d | straight,cross,out,out | depart,turn left,turn left,arrive | g,b,c,d | | g,d | straight,cross,out,out | depart,turn left,turn left,arrive |
Scenario: No Name During Turns Scenario: No Name During Turns
Given the node map Given the node map
@@ -534,6 +528,25 @@ Feature: Collapse
| waypoints | route | turns | | waypoints | route | turns |
| a,d | road,road | depart,arrive | | a,d | road,road | depart,arrive |
Scenario: Pulled Back Turn
Given the node map
"""
d
a b c
e
"""
And the ways
| nodes | highway | name |
| abc | tertiary | road |
| cd | tertiary | left |
| be | tertiary | right |
When I route I should get
| waypoints | route | turns |
| a,d | road,left,left | depart,turn left,arrive |
| a,e | road,right,right | depart,turn right,arrive |
Scenario: No Name During Turns, keep important turns Scenario: No Name During Turns, keep important turns
Given the node map Given the node map
""" """
@@ -556,15 +569,15 @@ Feature: Collapse
Given the node map Given the node map
""" """
h h
a . a
..
.g g
b f b f
| c . c
| | . ,
| | . .
| | . e e
| | d d
j i j i
""" """
@@ -576,27 +589,27 @@ Feature: Collapse
| gbj | secondary | out | yes | | gbj | secondary | out | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| i,h | in,road,road | depart,turn left,arrive | i,f,h | | i,h | in,road,road | depart,turn left,arrive |
| a,d | road,road | depart,arrive | a,d | | a,d | road,road | depart,arrive |
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j | | a,j | road,out,out | depart,turn slight right,arrive |
Scenario: Segregated Intersection into Very Slight Turn Scenario: Segregated Intersection into Very Slight Turn
Given the node map Given the node map
""" """
h h
a. a
.,
..
.g g
b. b
| f f
| c . c
| |. .
| | . .
| | . .
| | . e e
| | d d
j i j i
""" """
@@ -608,17 +621,17 @@ Feature: Collapse
| gbj | secondary | out | yes | | gbj | secondary | out | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| i,h | in,road,road | depart,turn slight left,arrive | i,f,h | | i,h | in,road,road | depart,turn slight left,arrive |
| a,d | road,road | depart,arrive | a,d | | a,d | road,road | depart,arrive |
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j | | a,j | road,out,out | depart,turn slight right,arrive |
Scenario: Don't collapse everything to u-turn / too wide Scenario: Don't collapse everything to u-turn / too wide
Given the node map Given the node map
""" """
a---b---e a b e
|
d---c---f d c f
""" """
And the ways And the ways
@@ -628,18 +641,18 @@ Feature: Collapse
| cf | secondary | bottom | | cf | secondary | bottom |
When I route I should get When I route I should get
| waypoints | turns | route | locations | | waypoints | turns | route |
| a,d | depart,continue right,turn right,arrive | road,road,road,road | a,b,c,d | | a,d | depart,continue right,turn right,arrive | road,road,road,road |
| d,a | depart,continue left,turn left,arrive | road,road,road,road | d,c,b,a | | d,a | depart,continue left,turn left,arrive | road,road,road,road |
Scenario: Forking before a turn Scenario: Forking before a turn
Given the node map Given the node map
""" """
g g
|
.c c
a---b-d-e a b d e
|
f f
""" """
@@ -659,18 +672,18 @@ Feature: Collapse
| restriction | bc | dc | c | no_right_turn | | restriction | bc | dc | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g | | a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road | depart,arrive | a,e | | a,e | road,road | depart,arrive |
Scenario: Forking before a turn (narrow) Scenario: Forking before a turn (narrow)
Given the node map Given the node map
""" """
g g
|
..c c
a-b---d-e a b d e
|
f f
""" """
@@ -690,9 +703,44 @@ Feature: Collapse
| restriction | bc | dc | c | no_right_turn | | restriction | bc | dc | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g | | a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road | depart,arrive | a,e | | a,e | road,road | depart,arrive |
Scenario: Forking before a turn (forky)
Given the node map
"""
g
.
c
a . . b .'
` d.
f e
"""
# as it is right now we don't classify this as a sliproad,
# check collapse-detail.feature for a similar test case
# which removes the fork here due to it being a Sliproad.
And the ways
| nodes | name | oneway | highway |
| ab | road | yes | primary |
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,g | road,cross,cross | depart,fork left,arrive |
| a,e | road,road,road | depart,fork slight right,arrive |
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive |
Scenario: On-Off on Highway Scenario: On-Off on Highway
Given the node map Given the node map
@@ -709,11 +757,11 @@ Feature: Collapse
| ce | off | motorway_link | yes | | ce | off | motorway_link | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,d | Hwy,Hwy | depart,arrive | a,d | | a,d | Hwy,Hwy | depart,arrive |
| f,d | on,Hwy,Hwy | depart,merge slight right,arrive | f,b,d | | f,d | on,Hwy,Hwy | depart,merge slight right,arrive |
| f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive | f,b,c,e | | f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive |
| a,e | Hwy,off,off | depart,off ramp right,arrive | a,c,e | | a,e | Hwy,off,off | depart,off ramp right,arrive |
@negative @straight @negative @straight
Scenario: Don't collapse going straight if actual turn Scenario: Don't collapse going straight if actual turn
@@ -760,8 +808,8 @@ Feature: Collapse
| ge | primary | second | no | | ge | primary | second | no |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c | | d,c | first,first,first | depart,continue uturn,arrive |
Scenario: Entering a segregated road slight turn Scenario: Entering a segregated road slight turn
Given the node map Given the node map
@@ -782,8 +830,8 @@ Feature: Collapse
| ge | primary | second | no | | ge | primary | second | no |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c | | d,c | first,first,first | depart,continue uturn,arrive |
Scenario: Do not collapse UseLane step when lanes change Scenario: Do not collapse UseLane step when lanes change
Given the node map Given the node map
@@ -807,8 +855,8 @@ Feature: Collapse
| di | | off | | di | | off |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,e | main,main,main | depart,use lane straight,arrive | a,c,e | | a,e | main,main,main | depart,use lane straight,arrive |
Scenario: But _do_ collapse UseLane step when lanes stay the same Scenario: But _do_ collapse UseLane step when lanes stay the same
Given the node map Given the node map
@@ -864,10 +912,10 @@ Feature: Collapse
Given the node map Given the node map
""" """
i i
j e ~ ~ ~ ~ d c h j e d c h
|
|
k g ~ ~ ~ ~ a b f k g a b f
""" """
And the ways And the ways
@@ -882,8 +930,8 @@ Feature: Collapse
| ej | primary | | off | yes | | ej | primary | | off | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| k,j | on,ferry,road,road,ferry,off,off | depart,notification straight,notification straight,continue uturn,turn straight,notification straight,arrive | k,g,a,b,d,e,j | | k,j | on,ferry,road,road,ferry,off,off | depart,notification straight,notification straight,continue uturn,turn straight,notification straight,arrive |
# http://www.openstreetmap.org/#map=19/37.78090/-122.41251 # http://www.openstreetmap.org/#map=19/37.78090/-122.41251
Scenario: U-Turn onto unnamed-road Scenario: U-Turn onto unnamed-road
@@ -906,8 +954,8 @@ Feature: Collapse
| ef | secondary | | down | yes | | ef | secondary | | down | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,1 | up,turn,, | depart,turn right,turn sharp right,arrive | a,b,e,_ | | a,1 | up,turn,, | depart,turn right,turn sharp right,arrive |
#http://www.openstreetmap.org/#map=19/52.48778/13.30024 #http://www.openstreetmap.org/#map=19/52.48778/13.30024
Scenario: Hohenzollerdammbrücke Scenario: Hohenzollerdammbrücke
@@ -959,21 +1007,23 @@ Feature: Collapse
| os | motorway_link | a100 | yes | | os | motorway_link | a100 | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | ck | ki | k | only_straight_on | | restriction | ck | kh | k | no_right_turn |
| restriction | bk | kh | k | only_straight_on | | restriction | bk | ki | k | no_left_turn |
| restriction | hl | ld | l | only_straight_on | | restriction | hl | lc | l | no_right_turn |
| restriction | gl | lc | l | only_straight_on | | restriction | gl | ld | l | no_left_turn |
| restriction | bc | cm | c | no_right_turn | | restriction | bc | cm | c | no_right_turn |
| restriction | bc | ck | c | no_left_turn | | restriction | bc | ck | c | no_left_turn |
| restriction | nc | cm | c | no_left_turn | | restriction | nc | cm | c | no_left_turn |
| restriction | nc | cd | c | no_right_turn | | restriction | nc | cd | c | no_right_turn |
| restriction | lc | cm | c | only_straight_on | | restriction | lc | ck | c | no_left_turn |
| restriction | gh | ho | h | no_right_turn | | restriction | lc | cd | c | no_right_turn |
| restriction | gh | hl | h | no_left_turn | | restriction | gh | ho | h | no_right_turn |
| restriction | kh | ho | h | only_straight_on | | restriction | gh | hl | h | no_left_turn |
| restriction | ph | ho | h | no_left_turn | | restriction | kh | hi | h | no_left_turn |
| restriction | ph | hi | h | no_right_turn | | restriction | kh | hl | h | no_right_turn |
| restriction | ph | ho | h | no_left_turn |
| restriction | ph | hi | h | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns | locations |
@@ -986,36 +1036,3 @@ Feature: Collapse
| f,e | | | | | f,e | | | |
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j | | q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j |
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e | | q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
Scenario: Forking before a turn (forky)
Given the node map
"""
g
.
c
a . . b .'
` d.
f e
"""
#Check collapse.detail for a similar case (shorter) that does not classify these turns as a sliproad anymore
And the ways
| nodes | name | oneway | highway |
| ab | road | yes | primary |
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns | locations |
| a,g | road,cross,cross | depart,fork left,arrive | a,b,g |
| a,e | road,road,road | depart,fork slight right,arrive | a,b,e |
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | a,b,d,f |
+86 -101
View File
@@ -21,22 +21,20 @@ Feature: Slipways and Dedicated Turn Lanes
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
| ab | trunk | first | | | abc | trunk | first | |
| bc | trunk | first | |
| cd | trunk | first | | | cd | trunk | first | |
| bhf | trunk_link | | yes | | bhf | trunk_link | | yes |
| cf | primary | second | yes | | cfg | primary | second | yes |
| fg | primary | second | yes | | ec | primary | second | |
| ec | primary | second | no |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | bc | cf | c | no_right_turn | | restriction | abc | cfg | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | first,second,second | depart,turn right,arrive | a,b,g | | a,g | first,second,second | depart,turn right,arrive |
| a,1 | first,, | depart,turn right,arrive | a,b,_ | | a,1 | first,, | depart,turn right,arrive |
Scenario: Turn Instead of Ramp Scenario: Turn Instead of Ramp
Given the node map Given the node map
@@ -64,10 +62,9 @@ Feature: Slipways and Dedicated Turn Lanes
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | abc | cfg | c | no_right_turn | | restriction | abc | cfg | c | no_right_turn |
#this is very ugly :(, but we don't have a way to overrule ramps right now, also: this tagging sucks When I route I should get
When I route I should get | waypoints | route | turns |
| waypoints | route | turns | | a,g | first,,second,second | depart,turn right,turn straight,arrive |
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
Scenario: Turning Sliproad onto a ferry Scenario: Turning Sliproad onto a ferry
Given the node map Given the node map
@@ -100,9 +97,9 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | abc | cf | c | no_right_turn | | restriction | abc | cf | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,i | first,,second,second,second | depart,off ramp right,turn straight,notification straight,arrive | | a,i | first,,second,second,second | depart,turn right,turn straight,notification straight,arrive |
| a,1 | first,, | depart,off ramp right,arrive | | a,1 | first,, | depart,turn right,arrive |
Scenario: Turn Instead of Ramp - Max-Speed Scenario: Turn Instead of Ramp - Max-Speed
Given the node map Given the node map
@@ -120,22 +117,20 @@ Feature: Slipways and Dedicated Turn Lanes
And the ways And the ways
| nodes | highway | name | maxspeed | oneway | | nodes | highway | name | maxspeed | oneway |
| ab | trunk | first | 70 | | | abc | trunk | first | 70 | |
| bc | trunk | first | 70 | |
| cd | trunk | first | 2 | | | cd | trunk | first | 2 | |
| bhf | trunk_link | | 2 | yes | | bhf | trunk_link | | 2 | yes |
| cf | primary | second | 50 | yes | | cfg | primary | second | 50 | yes |
| fg | primary | second | 50 | yes | | ec | primary | second | 50 | |
| ec | primary | second | 50 | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | bc | cf | c | no_right_turn | | restriction | abc | cfg | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | first,second,second | depart,turn right,arrive | a,b,g | | a,g | first,second,second | depart,turn right,arrive |
| a,1 | first,, | depart,turn right,arrive | a,b,_ | | a,1 | first,, | depart,turn right,arrive |
Scenario: Turn Instead of Ramp Scenario: Turn Instead of Ramp
@@ -166,8 +161,8 @@ Feature: Slipways and Dedicated Turn Lanes
| efg | primary | second | | efg | primary | second |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive | a,b,f,g | | a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
Scenario: Turn Instead of Ramp Scenario: Turn Instead of Ramp
Given the node map Given the node map
@@ -193,8 +188,8 @@ Feature: Slipways and Dedicated Turn Lanes
| efg | primary | second | | efg | primary | second |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive | a,b,f,g | | a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
Scenario: Inner city expressway with on road Scenario: Inner city expressway with on road
Given the node map Given the node map
@@ -213,20 +208,18 @@ Feature: Slipways and Dedicated Turn Lanes
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
| ab | primary | road | | | abc | primary | road | |
| bc | primary | road | |
| cg | primary | road | | | cg | primary | road | |
| bfd | trunk_link | | yes | | bfd | trunk_link | | yes |
| cd | trunk | trunk | yes | | cde | trunk | trunk | yes |
| de | trunk | trunk | yes |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | bc | cd | c | no_right_turn | | restriction | abc | cde | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,e | road,trunk,trunk | depart,turn right,arrive | a,b,e | | a,e | road,trunk,trunk | depart,turn right,arrive |
Scenario: Slipway Round U-Turn Scenario: Slipway Round U-Turn
@@ -249,8 +242,8 @@ Feature: Slipways and Dedicated Turn Lanes
| def | primary | road | yes | | def | primary | road | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f | | a,f | road,road,road | depart,continue uturn,arrive |
Scenario: Slipway Steep U-Turn Scenario: Slipway Steep U-Turn
Given the node map Given the node map
@@ -271,8 +264,8 @@ Feature: Slipways and Dedicated Turn Lanes
| def | primary | road | yes | | def | primary | road | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f | | a,f | road,road,road | depart,continue uturn,arrive |
Scenario: Schwarzwaldstrasse Autobahn Scenario: Schwarzwaldstrasse Autobahn
Given the node map Given the node map
@@ -316,21 +309,21 @@ Feature: Slipways and Dedicated Turn Lanes
| qe | secondary_link | Ettlinger Allee | | yes | | qe | secondary_link | Ettlinger Allee | | yes |
When I route I should get When I route I should get
| waypoints | route | turns | ref | locations | | waypoints | route | turns | ref |
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,, | a,b,o | | a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,L561, |
Scenario: Traffic Lights everywhere Scenario: Traffic Lights everywhere
#http://map.project-osrm.org/?z=18&center=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0 #http://map.project-osrm.org/?z=18&center=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
Given the node map Given the node map
""" """
a - - k-l-. j a k l j
''d'b-c-i d b c i
\ |
e g e g
\|
1\| 1
h h
|
f f
""" """
@@ -342,24 +335,16 @@ Feature: Slipways and Dedicated Turn Lanes
And the ways And the ways
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
| ak | secondary | Ebertstrasse | yes | | aklbci | secondary | Ebertstrasse | yes |
| klbc | secondary | Ebertstrasse | yes |
| ci | secondary | Ebertstrasse | yes |
| kdeh | secondary_link | | yes | | kdeh | secondary_link | | yes |
| jc | primary | Brauerstrasse | yes | | jcghf | primary | Brauerstrasse | yes |
| cgh | primary | Brauerstrasse | yes |
| hf | primary | Brauerstrasse | yes |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | klbc | cgh | c | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive | a,i | | a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive | a,l | | a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive | a,k,f | | a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive | a,k,_ | | a,1 | Ebertstrasse,, | depart,turn slight right,arrive |
#2839 #2839
Scenario: Self-Loop Scenario: Self-Loop
@@ -370,7 +355,7 @@ Feature: Slipways and Dedicated Turn Lanes
m \ m \
/ i / i
/ \ / \
| \ | \
| h | h
| | | |
n | n |
@@ -405,7 +390,7 @@ Feature: Slipways and Dedicated Turn Lanes
m \ m \
/ i / i
/ \ / \
| \ | \
| h | h
| | | |
n | n |
@@ -472,10 +457,10 @@ Feature: Slipways and Dedicated Turn Lanes
| g | traffic_signals | | g | traffic_signals |
When I route I should get When I route I should get
| waypoints | route | turns | locations | # | | waypoints | route | turns | # |
| a,d | new york,new york | depart,arrive | a,d | this is the sinatra route | | a,d | new york,new york | depart,arrive | this is the sinatra route |
| a,j | new york,1st street,1st street | depart,turn left,arrive | a,c,j | | | a,j | new york,1st street,1st street | depart,turn left,arrive | |
| a,1 | new york,m street,1st street,1st street | depart,turn right,turn left,arrive | a,b,g,_ | this can falsly be seen as a sliproad | | a,1 | new york,m street,1st street,1st street | depart,turn right,turn left,arrive | this can false be seen as a sliproad |
# Merging into degree two loop on dedicated turn detection / 2927 # Merging into degree two loop on dedicated turn detection / 2927
Scenario: Turn Instead of Ramp Scenario: Turn Instead of Ramp
@@ -490,7 +475,7 @@ Feature: Slipways and Dedicated Turn Lanes
| | | |
| | | |
| | | |
\ / \ /
\ / \ /
\ / \ /
b b
@@ -512,8 +497,8 @@ Feature: Slipways and Dedicated Turn Lanes
# We don't actually care about routes here, this is all about endless loops in turn discovery # We don't actually care about routes here, this is all about endless loops in turn discovery
When I route I should get When I route I should get
| waypoints | route | | waypoints | route | turns |
| a,i | road,road,road | | a,i | road,road,road | depart,fork slight left,arrive |
# The following tests are current false positives / false negatives #3199 # The following tests are current false positives / false negatives #3199
@@ -543,9 +528,9 @@ Feature: Slipways and Dedicated Turn Lanes
| hid | residential | Waldkauzsteig | | hid | residential | Waldkauzsteig |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,d | Nachtigallensteig,Kiebitzsteig,Kiebitzsteig | depart,turn left,arrive | a,b,d | | a,d | Nachtigallensteig,Kiebitzsteig,Kiebitzsteig | depart,turn left,arrive |
| a,h | Nachtigallensteig,Nachtigallensteig | depart,arrive | a,h | | a,h | Nachtigallensteig,Nachtigallensteig | depart,arrive |
@sliproads @sliproads
@@ -569,8 +554,8 @@ Feature: Slipways and Dedicated Turn Lanes
| aeg | primary | aeg | yes | | aeg | primary | aeg | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive | s,a,e,f | | s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
@sliproads @sliproads
Scenario: Through Street, not a Sliproad although obvious Scenario: Through Street, not a Sliproad although obvious
@@ -593,8 +578,8 @@ Feature: Slipways and Dedicated Turn Lanes
| aeg | primary | aeg | yes | | aeg | primary | aeg | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive | s,a,e,f | | s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
@sliproads @sliproads
Scenario: Sliproad target turn is restricted Scenario: Sliproad target turn is restricted
@@ -629,9 +614,9 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | ae | ef | e | no_right_turn | | restriction | ae | ef | e | no_right_turn |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,b,f | | s,f | sabc,dbef,dbef | depart,turn right,arrive |
| s,g | sabc,aeg,aeg | depart,turn right,arrive | s,a,g | | s,g | sabc,aeg,aeg | depart,turn right,arrive |
@sliproads @sliproads
Scenario: Not a Sliproad, road not continuing straight Scenario: Not a Sliproad, road not continuing straight
@@ -651,9 +636,9 @@ Feature: Slipways and Dedicated Turn Lanes
| aeg | primary | aeg | yes | | aeg | primary | aeg | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,c | sabc,sabc | depart,arrive | s,c | | s,c | sabc,sabc | depart,arrive |
| s,g | sabc,aeg,aeg | depart,turn right,arrive | s,a,g | | s,g | sabc,aeg,aeg | depart,turn right,arrive |
@sliproads @sliproads
Scenario: Intersection too far away with Traffic Light shortly after initial split Scenario: Intersection too far away with Traffic Light shortly after initial split
@@ -686,8 +671,8 @@ Feature: Slipways and Dedicated Turn Lanes
| ae | primary | ae | yes | | ae | primary | ae | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive | s,a,e,f | | s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive |
@sliproads @sliproads
Scenario: Traffic Signal on Sliproad Scenario: Traffic Signal on Sliproad
@@ -719,8 +704,8 @@ Feature: Slipways and Dedicated Turn Lanes
| ate | primary | ate | yes | | ate | primary | ate | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,f | sabc,ef,ef | depart,turn right,arrive | s,a,f | | s,f | sabc,ef,ef | depart,turn right,arrive |
@sliproads @sliproads
Scenario: Sliproad tagged as link Scenario: Sliproad tagged as link
@@ -747,8 +732,8 @@ Feature: Slipways and Dedicated Turn Lanes
| ae | motorway_link | ae | yes | | ae | motorway_link | ae | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f | | s,f | sabc,dbef,dbef | depart,turn right,arrive |
@sliproads @sliproads
Scenario: Sliproad with same-ish names Scenario: Sliproad with same-ish names
@@ -774,8 +759,8 @@ Feature: Slipways and Dedicated Turn Lanes
| af | primary | sliproad | | yes | | af | primary | sliproad | | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,t | main,crossing,crossing | depart,turn right,arrive | s,a,t | | s,t | main,crossing,crossing | depart,turn right,arrive |
@sliproads @sliproads
Scenario: Not a Sliproad, name mismatch Scenario: Not a Sliproad, name mismatch
@@ -803,8 +788,8 @@ Feature: Slipways and Dedicated Turn Lanes
| af | primary | sliproad | yes | | af | primary | sliproad | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,t | main,away,away | depart,turn right,arrive | s,a,t | | s,t | main,away,away | depart,turn right,arrive |
@sliproads @sliproads
Scenario: Not a Sliproad, low road priority Scenario: Not a Sliproad, low road priority
@@ -833,8 +818,8 @@ Feature: Slipways and Dedicated Turn Lanes
| af | service | sliproad | 30 km/h | yes | | af | service | sliproad | 30 km/h | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,t | main,away,away | depart,turn right,arrive | s,a,t | | s,t | main,away,away | depart,turn right,arrive |
@sliproads @sliproads
Scenario: Not a Sliproad, more than three roads at target intersection Scenario: Not a Sliproad, more than three roads at target intersection
@@ -863,8 +848,8 @@ Feature: Slipways and Dedicated Turn Lanes
| af | primary | sliproad | yes | | af | primary | sliproad | yes |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive | s,a,f,g | | s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
@sliproads: @sliproads:
Scenario: Throughabout-Sliproad Scenario: Throughabout-Sliproad
@@ -942,5 +927,5 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | bc | cd | c | only_straight | | restriction | bc | cd | c | only_straight |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns | locations |
| a,k | road,,, | depart,turn right,roundabout turn right exit-1,arrive | a,b,h,k | | a,k | road,,, | depart,continue right,roundabout turn right exit-1,arrive | a,b,h,k |
+7 -7
View File
@@ -39,8 +39,8 @@ Feature: Fork Instructions
| bd | primary | yes | | bd | primary | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ab,bd | depart,arrive | | a,d | ab,bd,bd | depart,new name slight right,arrive |
Scenario: Don't Fork On Single Road Scenario: Don't Fork On Single Road
Given the node map Given the node map
@@ -56,8 +56,8 @@ Feature: Fork Instructions
| bd | primary | yes | turn | | bd | primary | yes | turn |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | road,turn | depart,arrive | | a,d | road,turn,turn | depart,new name straight,arrive |
Scenario: Do not fork on link type Scenario: Do not fork on link type
Given the node map Given the node map
@@ -382,6 +382,6 @@ Feature: Fork Instructions
| ab | on | motorway_link | | ab | on | motorway_link |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,j | on,xbcj | depart,arrive | | a,j | on,xbcj | depart,arrive |
| a,i | on,off,off | depart,turn right,arrive | | a,i | on,off,off | depart,turn slight right,arrive |
+3 -3
View File
@@ -110,9 +110,9 @@ Feature: Intersections Data
| cf | corner | | cf | corner |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | intersections |
| a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 | | a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
| f,a | corner,throughbridge,through | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 | | f,a | corner,through,through | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 |
Scenario: Roundabouts Scenario: Roundabouts
Given the node map Given the node map
+5 -5
View File
@@ -80,8 +80,8 @@ Feature: Exceptions for routing onto low-priority roads
| bc | service | service | | bc | service | service |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | road,service | depart,arrive | | a,c | road,service,service | depart,new name straight,arrive |
Scenario: Straight onto low-priority, with driveway Scenario: Straight onto low-priority, with driveway
Given the node map Given the node map
@@ -114,6 +114,6 @@ Feature: Exceptions for routing onto low-priority roads
| bf | driveway | | | bf | driveway | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | road, | depart,arrive | | a,c | road, | depart,arrive |
| c,a | ,road | depart,arrive | | c,a | ,road,road | depart,new name straight,arrive |
@@ -354,13 +354,13 @@ Feature: Merge Segregated Roads
| hb | road | yes | | hb | road | yes |
When I route I should get When I route I should get
| waypoints | turns | route | intersections | | waypoints | turns | route | intersections |
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 | | a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
| c,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 | | c,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
| 1,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 | | 1,f | depart,new name straight,arrive | bridge,road,road | true:180;false:0 true:180;true:0 |
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 | | f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
| g,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 | | g,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
| 2,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 | | 2,a | depart,new name straight,arrive | bridge,road,road | true:0;true:0 false:180;true:180 |
@negative @negative
Scenario: Traffic Circle Scenario: Traffic Circle
@@ -501,25 +501,25 @@ Feature: Merge Segregated Roads
| jc | vert | yes | | jc | vert | yes |
| cf | vert | yes | | cf | vert | yes |
| fl | vert | yes | | fl | vert | yes |
| xg | horiz | no | | gx | horiz | no |
| xc | horiz | no | | xc | horiz | no |
| xf | horiz | no | | fx | horiz | no |
| xb | horiz | no | | xb | horiz | no |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
| restriction | bc | cf | c | no_left_turn | | restriction | bc | cf | c | no_left_turn |
| restriction | fg | gb | g | no_left_turn | | restriction | fg | gb | g | no_left_turn |
| restriction | gb | bc | b | no_left_turn | | restriction | cf | fg | f | no_left_turn |
| restriction | cf | fg | f | no_left_turn | | restriction | gb | bc | b | no_left_turn |
| restriction | xb | xf | x | only_straight_on | | restriction | xb | bc | b | no_left_turn |
| restriction | xf | xb | x | only_straight_on | | restriction | xc | cf | c | no_left_turn |
| restriction | xg | xc | x | only_straight_on | | restriction | xf | fg | f | no_left_turn |
| restriction | xc | xg | x | only_straight_on | | restriction | xg | gb | g | no_left_turn |
# the goal here should be not to mention the intersection in the middle at all and also suppress the segregated parts # the goal here should be not to mention the intersection in the middle at all and also suppress the segregated parts
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | intersections |
| a,l | horiz,vert,vert | true:90;false:0 true:60 true:90 true:180 false:270,true:60 false:120 false:240 false:300,true:0 false:90 false:180 false:240 true:270;true:180 | | a,l | horiz,vert,vert | true:90;false:0 true:60 true:90 true:180 false:270,true:60 true:120 false:240 true:300,true:0 false:90 false:180 false:240 false:270;true:180 |
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 | | a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,false:60 false:120 false:240 true:300,false:0 false:90 false:120 true:180 true:270;true:90 | | j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,true:60 false:120 true:240 true:300,false:0 false:90 false:120 false:180 true:270;true:90 |
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 | | j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
+1 -1
View File
@@ -3,7 +3,7 @@ Feature: New-Name Instructions
Background: Background:
Given the profile "car" Given the profile "car"
Given a grid size of 150 meters Given a grid size of 100 meters
Scenario: Undisturbed name Change Scenario: Undisturbed name Change
Given the node map Given the node map
+2 -2
View File
@@ -97,5 +97,5 @@ Feature: Simple Turns
| ei | left | yes | | ei | left | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route |
| g,a | in,road,road | depart,fork right,arrive | | g,a | in,road,road |
+3 -3
View File
@@ -233,9 +233,9 @@ Feature: Ramp Guidance
| cd | motorway | | cd | motorway |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,d | ac,cd | depart,arrive | | a,d | ac,cd,cd | depart,new name slight left,arrive |
| b,d | bc,cd | depart,arrive | | b,d | bc,cd,cd | depart,new name slight right,arrive |
Scenario: Two Ramps Joining into common Motorway Unnamed Scenario: Two Ramps Joining into common Motorway Unnamed
Given the node map Given the node map
+3 -3
View File
@@ -410,10 +410,10 @@ Feature: Basic Roundabout
| h | give_way | | h | give_way |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
# since we cannot handle these invalid roundabout tags yet, we cannot output roundabout taggings. This will hopefully change some day # since we cannot handle these invalid roundabout tags yet, we cannout output roundabout taggings. This will hopefully change some day
#| w,x | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive | #| w,x | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive |
| w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn straight,arrive | w,b,d,f,x | | w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn straight,arrive |
Scenario: Use Lane in Roundabout Scenario: Use Lane in Roundabout
Given the node map Given the node map
@@ -25,20 +25,20 @@ Feature: Staggered Intersections
| jcdehi | residential | Cedar Dr | | jcdehi | residential | Cedar Dr |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | Oak St,Oak St | depart,arrive | a,g | | a,g | Oak St,Oak St | depart,arrive |
| g,a | Oak St,Oak St | depart,arrive | g,a | | g,a | Oak St,Oak St | depart,arrive |
Scenario: Staggered Intersection: do not collapse if long segment in between Scenario: Staggered Intersection: do not collapse if long segment in between
Given the node map Given the node map
""" """
j j
a b c a b c
|
|
d d
|
|
e f g e f g
h h
i i
@@ -51,18 +51,16 @@ Feature: Staggered Intersections
| jcdehi | residential | Cedar Dr | | jcdehi | residential | Cedar Dr |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | a,c,e,g | | a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | g,e,c,a | | g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
Scenario: Staggered Intersection: do not collapse if not left-right or right-left Scenario: Staggered Intersection: do not collapse if not left-right or right-left
Given the node map Given the node map
""" """
j j
a b c a b c
|
d d
|
g f e g f e
h h
i i
@@ -75,11 +73,11 @@ Feature: Staggered Intersections
| jcdehi | residential | Cedar Dr | | jcdehi | residential | Cedar Dr |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | Oak St,Oak St,Oak St | depart,continue uturn,arrive | a,c,g | | a,g | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
| g,a | Oak St,Oak St,Oak St | depart,continue uturn,arrive | g,e,a | | g,a | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
Scenario: Staggered Intersection: use new-name if the names are not the same Scenario: Staggered Intersection: do not collapse if the names are not the same
Given the node map Given the node map
""" """
j j
@@ -97,9 +95,9 @@ Feature: Staggered Intersections
| jcdehi | residential | Cedar Dr | | jcdehi | residential | Cedar Dr |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,g | Oak St,Elm St | depart,arrive | a,g | | a,g | Oak St,Cedar Dr,Elm St,Elm St | depart,turn right,turn left,arrive |
| g,a | Elm St,Oak St | depart,arrive | g,a | | g,a | Elm St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
Scenario: Staggered Intersection: do not collapse if a mode change is involved Scenario: Staggered Intersection: do not collapse if a mode change is involved
Given the node map Given the node map
@@ -107,7 +105,7 @@ Feature: Staggered Intersections
j j
a b c a b c
d d
e~~f - - - - g e f g
h h
""" """
@@ -119,9 +117,9 @@ Feature: Staggered Intersections
| jcdeh | primary | road | | | jcdeh | primary | road | |
When I route I should get When I route I should get
| waypoints | route | turns | modes | locations | | waypoints | route | turns | modes |
| a,g | to_sea,road,to_sea,road,road | depart,turn right,turn left,notification straight,arrive | driving,driving,ferry,driving,driving | a,c,e,f,g | | a,g | to_sea,road,to_sea,road,road | depart,turn right,turn left,notification straight,arrive | driving,driving,ferry,driving,driving |
| g,a | road,to_sea,road,to_sea,to_sea | depart,notification straight,turn right,turn left,arrive | driving,ferry,driving,driving,driving | g,f,e,c,a | | g,a | road,to_sea,road,to_sea,to_sea | depart,notification straight,turn right,turn left,arrive | driving,ferry,driving,driving,driving |
Scenario: Staggered Intersection: do not collapse intermediary intersections Scenario: Staggered Intersection: do not collapse intermediary intersections
Given the node map Given the node map
@@ -129,9 +127,7 @@ Feature: Staggered Intersections
j j
a b c a b c
e f g e f g
|
d d
|
k l m k l m
i i
""" """
@@ -144,6 +140,6 @@ Feature: Staggered Intersections
| jcedki | residential | Cedar Dr | | jcedki | residential | Cedar Dr |
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns |
| a,m | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | a,c,k,m | | a,m | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
| m,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | m,k,c,a | | m,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
+23 -23
View File
@@ -150,7 +150,7 @@ Feature: Simple Turns
| nodes | highway | name | lanes | oneway | | nodes | highway | name | lanes | oneway |
| akb | primary | road | 4 | yes | | akb | primary | road | 4 | yes |
| hgi | primary | road | 4 | yes | | hgi | primary | road | 4 | yes |
| kcdefg | primary_link | | 1 | yes | | akcdefg | primary_link | | 1 | yes |
| gj | tertiary | turn | 1 | | | gj | tertiary | turn | 1 | |
When I route I should get When I route I should get
@@ -444,7 +444,7 @@ Feature: Simple Turns
When I route I should get When I route I should get
| waypoints | route | turns | locations | # | | waypoints | route | turns | locations | # |
| g,f | turn,road,road | depart,turn left,arrive | g,e,f | #could offer an additional turn at `e` if you don't detect the turn in between as curve | | g,f | turn,road | depart,arrive | g,f | #could offer an additional turn at `e` if you don't detect the turn in between as curve |
| c,f | road,road,road | depart,continue right,arrive | c,b,f | | | c,f | road,road,road | depart,continue right,arrive | c,b,f | |
#http://www.openstreetmap.org/search?query=52.479264%2013.295617#map=19/52.47926/13.29562 #http://www.openstreetmap.org/search?query=52.479264%2013.295617#map=19/52.47926/13.29562
@@ -808,15 +808,15 @@ Feature: Simple Turns
| cjk | Friede | no | | tertiary | | cjk | Friede | no | | tertiary |
When I route I should get When I route I should get
| waypoints | route | turns | intersections | | waypoints | route | turns | intersections |
| a,g | Perle,Heide,Heide | depart,turn right,arrive | true:90;true:90 true:180 false:270 true:345;true:18 | | a,g | Perle,Heide,Heide | depart,turn right,arrive | true:90;true:90 true:180 false:270 true:345;true:18 |
| a,k | Perle,Friede,Friede | depart,turn left,arrive | true:90;true:90 true:180 false:270 true:345;true:153 | | a,k | Perle,Friede,Friede | depart,turn left,arrive | true:90;true:90 true:180 false:270 true:345;true:153 |
| a,e | Perle,Perle | depart,arrive | true:90,true:90 true:180 false:270 true:345;true:270 | | a,e | Perle,Perle | depart,arrive | true:90,true:90 true:180 false:270 true:345;true:270 |
| e,k | Perle,Friede,Friede | depart,turn right,arrive | true:270;false:90 true:180 true:270 true:345;true:153 | | e,k | Perle,Friede,Friede | depart,turn right,arrive | true:270;false:90 true:180 true:270 true:345;true:153 |
| e,g | Perle,Heide,Heide | depart,turn left,arrive | true:270;false:90 true:180 true:270 true:345;true:18 | | e,g | Perle,Heide,Heide | depart,turn left,arrive | true:270;false:90 true:180 true:270 true:345;true:18 |
| h,k | Heide,Friede | depart,arrive | true:16,true:90 true:180 true:270 true:345;true:153 | | h,k | Heide,Friede,Friede | depart,new name straight,arrive | true:16;true:90 true:180 true:270 true:345;true:153 |
| h,e | Heide,Perle,Perle | depart,turn right,arrive | true:16;true:90 true:180 true:270 true:345;true:270 | | h,e | Heide,Perle,Perle | depart,turn right,arrive | true:16;true:90 true:180 true:270 true:345;true:270 |
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:180 true:270 true:345;true:90 | | h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:180 true:270 true:345;true:90 |
#http://www.openstreetmap.org/#map=19/52.53293/13.32956 #http://www.openstreetmap.org/#map=19/52.53293/13.32956
Scenario: Curved Exit from Curved Road Scenario: Curved Exit from Curved Road
@@ -852,9 +852,9 @@ Feature: Simple Turns
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive | | a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
| a,g | Siemens,Erna | depart,arrive | | a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive | | g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
| g,a | Erna,Siemens | depart,arrive | | g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |
#http://www.openstreetmap.org/#map=19/52.51303/13.32170 #http://www.openstreetmap.org/#map=19/52.51303/13.32170
Scenario: Ernst Reuter Platz Scenario: Ernst Reuter Platz
@@ -1188,12 +1188,12 @@ Feature: Simple Turns
| j | traffic_signals | | j | traffic_signals |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | rose,trift | depart,arrive | | a,c | rose,trift,trift | depart,new name slight left,arrive |
| a,k | rose,muhle,muhle | depart,turn slight right,arrive | | a,k | rose,muhle,muhle | depart,turn slight right,arrive |
| d,f | trift,rose | depart,arrive | | d,f | trift,rose,rose | depart,new name straight,arrive |
| d,k | trift,muhle,muhle | depart,turn sharp left,arrive | | d,k | trift,muhle,muhle | depart,turn sharp left,arrive |
| d,c | trift,trift,trift | depart,continue uturn,arrive | | d,c | trift,trift,trift | depart,continue uturn,arrive |
#http://www.openstreetmap.org/#map=19/52.50740/13.44824 #http://www.openstreetmap.org/#map=19/52.50740/13.44824
Scenario: Turning Loop at the end of the road Scenario: Turning Loop at the end of the road
@@ -1275,8 +1275,8 @@ Feature: Simple Turns
| bcde | 6 | | bcde | 6 |
When I route I should get When I route I should get
| waypoints | route | | waypoints | route |
| a,e | ab,bcde | | a,e | ab,bcde,bcde |
@3401 @3401
@@ -1312,8 +1312,8 @@ Feature: Simple Turns
# we don't care for turn instructions, this is a coordinate extraction bug check # we don't care for turn instructions, this is a coordinate extraction bug check
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | intersections |
| a,g | ab,bcdefgh | true:90,true:45 false:180 false:270;true:180 | | a,g | ab,bcdefgh,bcdefgh | true:90;true:45 false:180 false:270;true:180 |
#https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580 #https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580
Scenario: Oszillating Lower Priority Road Scenario: Oszillating Lower Priority Road
+12 -27
View File
@@ -3,7 +3,7 @@ Feature: Turn Lane Guidance
Background: Background:
Given the profile "car" Given the profile "car"
Given a grid size of 5 meters Given a grid size of 20 meters
@simple @simple
Scenario: Basic Turn Lane 3-way Turn with empty lanes Scenario: Basic Turn Lane 3-way Turn with empty lanes
@@ -602,17 +602,6 @@ Feature: Turn Lane Guidance
a e a e
| | | |
| | | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
b d b d
h c h c
' -- g - - f ' -- g - - f
@@ -620,8 +609,8 @@ Feature: Turn Lane Guidance
And the ways And the ways
| nodes | name | turn:lanes:forward | oneway | highway | lanes | | nodes | name | turn:lanes:forward | oneway | highway | lanes |
| abc | road | left\|left\|left\|through\|through | yes | primary | 2 | | abc | road | left\|left\|left\|through\|through | yes | primary | 5 |
| cde | road | | yes | primary | 2 | | cde | road | | yes | primary | 3 |
| hc | cross | | yes | secondary | | | hc | cross | | yes | secondary | |
| cg | straight | | no | tertiary | | | cg | straight | | no | tertiary | |
| cf | left | | yes | primary | | | cf | left | | yes | primary | |
@@ -819,10 +808,6 @@ Feature: Turn Lane Guidance
""" """
a b e a b e
d c f d c f
""" """
@@ -873,9 +858,9 @@ Feature: Turn Lane Guidance
| ab | on | motorway_link | | | ab | on | motorway_link | |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,j | on,xbcj | depart,arrive | , | | a,j | on,xbcj | depart,arrive | , |
| a,i | on,off,off | depart,turn right,arrive | ,none:false slight right:true, | | a,i | on,off,off | depart,turn slight right,arrive | ,none:false slight right:true, |
#http://www.openstreetmap.org/#map=17/52.47414/13.35712 #http://www.openstreetmap.org/#map=17/52.47414/13.35712
@todo @ramp @2645 @todo @ramp @2645
@@ -952,9 +937,9 @@ Feature: Turn Lane Guidance
| dce | cross | primary | yes | | 1 | | dce | cross | primary | yes | | 1 |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | locations | | waypoints | route | turns | lanes |
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g | | a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, |
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e | | a,e | road,cross,cross | depart,turn left,arrive | ,left:true right:false, |
Scenario: Partitioned turn, Slight Curve Scenario: Partitioned turn, Slight Curve
Given the node map Given the node map
@@ -975,9 +960,9 @@ Feature: Turn Lane Guidance
| dce | cross | primary | yes | | | dce | cross | primary | yes | |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | locations | | waypoints | route | turns | lanes |
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g | | a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, |
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e | | a,e | road,cross,cross | depart,turn left,arrive | ,left:true right:false, |
Scenario: Lane Parsing Issue #2694 Scenario: Lane Parsing Issue #2694
Given the node map Given the node map
+44 -44
View File
@@ -23,15 +23,15 @@ Feature: Simple Turns
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | ab,cb,cb | depart,turn left,arrive | | a,c | ab,cb,cb | depart,turn left,arrive |
| a,e | ab,eb | depart,arrive | | a,e | ab,eb,eb | depart,new name straight,arrive |
| a,d | ab,db,db | depart,turn right,arrive | | a,d | ab,db,db | depart,turn right,arrive |
| c,a | cb,ab,ab | depart,turn right,arrive | | c,a | cb,ab,ab | depart,turn right,arrive |
| c,d | cb,db | depart,arrive | | c,d | cb,db,db | depart,new name straight,arrive |
| c,e | cb,eb,eb | depart,turn left,arrive | | c,e | cb,eb,eb | depart,turn left,arrive |
| d,a | db,ab,ab | depart,turn left,arrive | | d,a | db,ab,ab | depart,turn left,arrive |
| d,c | db,cb | depart,arrive | | d,c | db,cb,cb | depart,new name straight,arrive |
| d,e | db,eb,eb | depart,turn right,arrive | | d,e | db,eb,eb | depart,turn right,arrive |
| e,a | eb,ab | depart,arrive | | e,a | eb,ab,ab | depart,new name straight,arrive |
| e,c | eb,cb,cb | depart,turn right,arrive | | e,c | eb,cb,cb | depart,turn right,arrive |
| e,d | eb,db,db | depart,turn left,arrive | | e,d | eb,db,db | depart,turn left,arrive |
@@ -53,15 +53,15 @@ Feature: Simple Turns
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | ab,cb,cb | depart,turn left,arrive | | a,c | ab,cb,cb | depart,turn left,arrive |
| a,e | ab,eb | depart,arrive | | a,e | ab,eb,eb | depart,new name straight,arrive |
| a,d | ab,db,db | depart,turn right,arrive | | a,d | ab,db,db | depart,turn right,arrive |
| c,a | cb,ab,ab | depart,turn right,arrive | | c,a | cb,ab,ab | depart,turn right,arrive |
| c,d | cb,db | depart,arrive | | c,d | cb,db,db | depart,new name straight,arrive |
| c,e | cb,eb,eb | depart,turn left,arrive | | c,e | cb,eb,eb | depart,turn left,arrive |
| d,a | db,ab,ab | depart,turn left,arrive | | d,a | db,ab,ab | depart,turn left,arrive |
| d,c | db,cb | depart,arrive | | d,c | db,cb,cb | depart,new name straight,arrive |
| d,e | db,eb,eb | depart,turn right,arrive | | d,e | db,eb,eb | depart,turn right,arrive |
| e,a | eb,ab | depart,arrive | | e,a | eb,ab,ab | depart,new name straight,arrive |
| e,c | eb,cb,cb | depart,turn right,arrive | | e,c | eb,cb,cb | depart,turn right,arrive |
| e,d | eb,db,db | depart,turn left,arrive | | e,d | eb,db,db | depart,turn left,arrive |
@@ -86,10 +86,10 @@ Feature: Simple Turns
| a,e | abe,abe | depart,arrive | | a,e | abe,abe | depart,arrive |
| a,d | abe,db,db | depart,turn right,arrive | | a,d | abe,db,db | depart,turn right,arrive |
| c,a | cb,abe,abe | depart,turn right,arrive | | c,a | cb,abe,abe | depart,turn right,arrive |
| c,d | cb,db | depart,arrive | | c,d | cb,db,db | depart,new name straight,arrive |
| c,e | cb,abe,abe | depart,turn left,arrive | | c,e | cb,abe,abe | depart,turn left,arrive |
| d,a | db,abe,abe | depart,turn left,arrive | | d,a | db,abe,abe | depart,turn left,arrive |
| d,c | db,cb | depart,arrive | | d,c | db,cb,cb | depart,new name straight,arrive |
| d,e | db,abe,abe | depart,turn right,arrive | | d,e | db,abe,abe | depart,turn right,arrive |
| e,a | abe,abe | depart,arrive | | e,a | abe,abe | depart,arrive |
| e,c | abe,cb,cb | depart,turn right,arrive | | e,c | abe,cb,cb | depart,turn right,arrive |
@@ -139,9 +139,9 @@ Feature: Simple Turns
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | ab,cb,cb | depart,turn left,arrive | | a,c | ab,cb,cb | depart,turn left,arrive |
| a,d | ab,db | depart,arrive | | a,d | ab,db,db | depart,new name straight,arrive |
| d,c | db,cb,cb | depart,turn right,arrive | | d,c | db,cb,cb | depart,turn right,arrive |
| d,a | db,ab | depart,arrive | | d,a | db,ab,ab | depart,new name straight,arrive |
Scenario: Three Way Intersection - Meeting Oneways Scenario: Three Way Intersection - Meeting Oneways
Given the node map Given the node map
@@ -208,7 +208,7 @@ Feature: Simple Turns
| b,c | ab,ac,ac | depart,turn sharp left,arrive | | b,c | ab,ac,ac | depart,turn sharp left,arrive |
| b,d | ab,ad,ad | depart,turn left,arrive | | b,d | ab,ad,ad | depart,turn left,arrive |
| b,e | ab,ae,ae | depart,turn slight left,arrive | | b,e | ab,ae,ae | depart,turn slight left,arrive |
| b,f | ab,af | depart,arrive | | b,f | ab,af,af | depart,new name straight,arrive |
| b,g | ab,ag,ag | depart,turn slight right,arrive | | b,g | ab,ag,ag | depart,turn slight right,arrive |
| b,h | ab,ah,ah | depart,turn right,arrive | | b,h | ab,ah,ah | depart,turn right,arrive |
| b,i | ab,ai,ai | depart,turn sharp right,arrive | | b,i | ab,ai,ai | depart,turn sharp right,arrive |
@@ -241,7 +241,7 @@ Feature: Simple Turns
| b,c | ab,ac,ac | depart,turn sharp left,arrive | | b,c | ab,ac,ac | depart,turn sharp left,arrive |
| b,d | ab,ad,ad | depart,turn left,arrive | | b,d | ab,ad,ad | depart,turn left,arrive |
| b,e | ab,ae,ae | depart,turn slight left,arrive | | b,e | ab,ae,ae | depart,turn slight left,arrive |
| b,f | ab,af | depart,arrive | | b,f | ab,af,af | depart,new name straight,arrive |
| b,g | ab,ag,ag | depart,turn slight right,arrive | | b,g | ab,ag,ag | depart,turn slight right,arrive |
| b,h | ab,ah,ah | depart,turn right,arrive | | b,h | ab,ah,ah | depart,turn right,arrive |
| b,i | ab,ai,ai | depart,turn sharp right,arrive | | b,i | ab,ai,ai | depart,turn sharp right,arrive |
@@ -743,10 +743,10 @@ Feature: Simple Turns
| be | primary | no | | be | primary | no |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,c | abc,abc | depart,arrive | | a,c | abc,abc | depart,arrive |
| d,e | db,be | depart,arrive | | d,e | db,be,be | depart,new name slight right,arrive |
| e,d | be,db | depart,arrive | | e,d | be,db,db | depart,new name slight left,arrive |
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 1 Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 1
Given the node map Given the node map
@@ -904,19 +904,19 @@ Feature: Simple Turns
| bd | residential | in | | bd | residential | in |
When I route I should get When I route I should get
| waypoints | turns | route | | waypoints | turns | route |
| a,c | depart,arrive | road,road | | a,c | depart,arrive | road,road |
| d,a | depart,turn left,arrive | in,road,road | | d,a | depart,turn left,arrive | in,road,road |
| d,c | depart,arrive | in,road | | d,c | depart,new name straight,arrive | in,road,road |
Scenario: Channing Street Scenario: Channing Street
Given the node map Given the node map
""" """
g f g f
| |
d---c-b-a d c b a
| |
| |
h e h e
""" """
@@ -1030,9 +1030,9 @@ Feature: Simple Turns
| ec | Molkenmarkt | secondary | yes | | ec | Molkenmarkt | secondary | yes |
When I route I should get When I route I should get
| waypoints | turns | route | | waypoints | turns | route |
| a,d | depart,arrive | Molkenmarkt,Stralauer Str | | a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
| e,d | depart,arrive | Molkenmarkt,Stralauer Str | | e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291 # http://www.openstreetmap.org/#map=18/39.28158/-76.62291
@3002 @3002
@@ -1149,19 +1149,19 @@ Feature: Simple Turns
| a,c | in,through,through | depart,turn left,arrive | | a,c | in,through,through | depart,turn left,arrive |
# http://www.openstreetmap.org/#map=19/52.51556/13.41832 # http://www.openstreetmap.org/#map=19/52.51556/13.41832
Scenario: No Slight Right at Stralauer Strasse Scenario: No Slight Right over Jannowitzbruecke
Given the node map Given the node map
""" """
l m l m
| | | |
f._ | | f._ | |
' g---h. ' g---h.
| | '-i | | '.
| | | | i
a_ | | a_ | |
''.b---c ''.b---c
| |' d._ | |'d._
| | 'e | | 'e
j k j k
""" """
@@ -1175,20 +1175,20 @@ Feature: Simple Turns
| kchm | Alexanderstr | primary | yes | | kchm | Alexanderstr | primary | yes |
When I route I should get When I route I should get
| waypoints | turns | route | | waypoints | turns | route |
| a,e | depart,arrive | Stralauer Str,Holzmarktstr | | a,e | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
Scenario: No Slight Right at Stralauer Strasse -- less extreme Scenario: No Slight Right over Jannowitzbruecke -- less extreme
Given the node map Given the node map
""" """
l m l m
| | | |
f_ | | f_ | |
' 'g---h_ ' 'g h_
| | '\_ | | '\_
| | i | | i
a_ | | a_ | |
'_ b___c_ '_ b c_
| | \_ | | \_
| | e | | e
j k j k
@@ -1204,20 +1204,20 @@ Feature: Simple Turns
| kchm | Alexanderstr | primary | yes | | kchm | Alexanderstr | primary | yes |
When I route I should get When I route I should get
| waypoints | turns | route | | waypoints | turns | route |
| a,e | depart,arrive | Stralauer Str,Holzmarktstr | | a,e | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
Scenario: No Slight Right at Stralauer Strasse Scenario: No Slight Right over Jannowitzbruecke
Given the node map Given the node map
""" """
l m l m
| | | |
| | | |
_ _ g---h_ _ _ g h_
f' | | '_ f' | | '_
| | i | | i
| | | |
_ _b---c__ _ _b c__
a' | | 'd a' | | 'd
| | | |
j k j k
+2 -4
View File
@@ -77,8 +77,7 @@ class OSRMDirectLoader extends OSRMBaseLoader {
osrmUp (callback) { osrmUp (callback) {
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!")); if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
const command_arguments = util.format('%s -p %d -a %s', this.inputFile, this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM); this.child = this.scope.runBin('osrm-routed', util.format("%s -p %d", this.inputFile, this.scope.OSRM_PORT), this.scope.environment, (err) => {
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
if (err && err.signal !== 'SIGINT') { if (err && err.signal !== 'SIGINT') {
this.child = null; this.child = null;
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd)); throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
@@ -116,8 +115,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
osrmUp (callback) { osrmUp (callback) {
if (this.osrmIsRunning()) return callback(); if (this.osrmIsRunning()) return callback();
const command_arguments = util.format('--shared-memory=1 -p %d -a %s', this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM); this.child = this.scope.runBin('osrm-routed', util.format('--shared-memory=1 -p %d', this.scope.OSRM_PORT), this.scope.environment, (err) => {
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
if (err && err.signal !== 'SIGINT') { if (err && err.signal !== 'SIGINT') {
this.child = null; this.child = null;
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd)); throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
+4 -4
View File
@@ -36,7 +36,7 @@ module.exports = function (expected, actual) {
} }
} }
}); });
if (!tableError) return null; if (!tableError) return null;
@@ -68,7 +68,7 @@ module.exports = function (expected, actual) {
// header row // header row
cells = [] cells = []
headers.forEach( (key) => { headers.forEach( (key) => {
var content = String(key).padRight(' ', widths[key] ); var content = key.padRight(' ', widths[key] );
if (columnStatus[key] == false ) if (columnStatus[key] == false )
content = okStr + content; content = okStr + content;
cells.push( chalk.white( content ) ); cells.push( chalk.white( content ) );
@@ -83,7 +83,7 @@ module.exports = function (expected, actual) {
// expected row // expected row
cells = [] cells = []
headers.forEach( (key) => { headers.forEach( (key) => {
var content = String(row[key]).padRight(' ', widths[key] ); var content = row[key].padRight(' ', widths[key] );
if (statusRows[i][key] == false) if (statusRows[i][key] == false)
cells.push( chalk.yellow( wantStr + content) ); cells.push( chalk.yellow( wantStr + content) );
else { else {
@@ -105,7 +105,7 @@ module.exports = function (expected, actual) {
if (rowError) { if (rowError) {
cells = [] cells = []
headers.forEach( (key) => { headers.forEach( (key) => {
var content = String(actual[i][key]).padRight(' ', widths[key] ); var content = actual[i][key].padRight(' ', widths[key] );
if (statusRows[i][key] == false) if (statusRows[i][key] == false)
cells.push( chalk.red( gotStr + content) ); cells.push( chalk.red( gotStr + content) );
else { else {
@@ -0,0 +1,38 @@
@prepare @options @files
Feature: osrm-contract command line options: datasources
# expansions:
# {processed_file} => path to .osrm file
Background:
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the speed file
"""
1,2,50
2,1,50
2,3,50
3,2,50
1,4,50
4,1,50
"""
And the data has been extracted
Scenario: osrm-contract - Passing base file
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
And it should exit successfully
Scenario: osrm-contract - Passing base file
Given the speed file
"""
"""
And the data has been extracted
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
Then it should exit successfully
@@ -22,8 +22,8 @@ Feature: osrm-contract command line option: edge-weight-updates-over-factor
Scenario: Logging weight with updates over factor of 2, long segment Scenario: Logging weight with updates over factor of 2, long segment
When I run "osrm-extract --profile {profile_file} {osm_file} --generate-edge-lookup" When I run "osrm-extract --profile {profile_file} {osm_file} --generate-edge-lookup"
When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}" When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}"
And stderr should contain "Segment: 1,2" And stderr should contain "weight updates"
And stderr should contain "Segment: 1,3" And stderr should contain "New speed: 100 kph"
And I route I should get And I route I should get
| from | to | route | speed | | from | to | route | speed |
| a | b | ab,ab | 100 km/h | | a | b | ab,ab | 100 km/h |
+28
View File
@@ -0,0 +1,28 @@
@prepare @options @invalid
Feature: osrm-contract command line options: invalid options
Background:
Given the profile "testbot"
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been extracted
Scenario: osrm-contract - Non-existing option
When I try to run "osrm-contract --fly-me-to-the-moon"
Then stdout should be empty
And stderr should contain "option"
And stderr should contain "fly-me-to-the-moon"
And it should exit with an error
# This tests the error messages when you try to use --segment-speed-file,
# but osrm-extract has not been run with --generate-edge-lookup
Scenario: osrm-contract - Someone forgot --generate-edge-lookup on osrm-extract
When I try to run "osrm-contract --segment-speed-file /dev/null {processed_file}"
Then stderr should contain "Error while trying to mmap"
Then stderr should contain ".osrm.turn_penalties_index"
And it should exit with an error
+1 -1
View File
@@ -1,4 +1,4 @@
@contract @options @version @prepare @options @version
Feature: osrm-contract command line options: version Feature: osrm-contract command line options: version
# the regex will match these two formats: # the regex will match these two formats:
# v0.3.7.0 # this is the normal format when you build from a git clone # v0.3.7.0 # this is the normal format when you build from a git clone
-23
View File
@@ -1,23 +0,0 @@
@customize @options @files
Feature: osrm-contract command line options: files
Background:
Given the profile "testbot"
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been extracted
And the data has been partitioned
Scenario: osrm-customize - Passing base file
When I run "osrm-customize {processed_file}"
Then it should exit successfully
Scenario: osrm-customize - Missing input file
When I try to run "osrm-customize over-the-rainbow.osrm"
And stderr should contain "over-the-rainbow.osrm"
And stderr should contain "not found"
And it should exit with an error
-35
View File
@@ -1,35 +0,0 @@
@contract @options @help
Feature: osrm-customize command line options: help
Scenario: osrm-customize - Help should be shown when no options are passed
When I try to run "osrm-customize"
Then stderr should be empty
And stdout should contain /osrm-customize(.exe)? <input.osrm> \[options\]:/
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "Configuration:"
And stdout should contain "--threads"
And it should exit with an error
Scenario: osrm-customize - Help, short
When I run "osrm-customize -h"
Then stderr should be empty
And stdout should contain /osrm-customize(.exe)? <input.osrm> \[options\]:/
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "Configuration:"
And stdout should contain "--threads"
And it should exit successfully
Scenario: osrm-customize - Help, long
When I run "osrm-customize --help"
Then stderr should be empty
And stdout should contain /osrm-customize(.exe)? <input.osrm> \[options\]:/
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "Configuration:"
And stdout should contain "--threads"
And it should exit successfully
@@ -1,20 +0,0 @@
@prepare @options @invalid
Feature: osrm-customize command line options: invalid options
Background:
Given the profile "testbot"
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been extracted
Scenario: osrm-customize - Non-existing option
When I try to run "osrm-customize --fly-me-to-the-moon"
Then stdout should be empty
And stderr should contain "option"
And stderr should contain "fly-me-to-the-moon"
And it should exit with an error
@@ -1,19 +0,0 @@
@prepare @options @version
Feature: osrm-customize command line options: version
Background:
Given the profile "testbot"
Scenario: osrm-customize - Version, short
When I run "osrm-customize --v"
Then stderr should be empty
And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
And it should exit successfully
Scenario: osrm-customize - Version, long
When I run "osrm-customize --version"
Then stderr should be empty
And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
And it should exit successfully
+3
View File
@@ -14,6 +14,7 @@ Feature: osrm-extract command line options: help
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--profile" And stdout should contain "--profile"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--generate-edge-lookup"
And stdout should contain "--small-component-size" And stdout should contain "--small-component-size"
And it should exit successfully And it should exit successfully
@@ -27,6 +28,7 @@ Feature: osrm-extract command line options: help
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--profile" And stdout should contain "--profile"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--generate-edge-lookup"
And stdout should contain "--small-component-size" And stdout should contain "--small-component-size"
And it should exit successfully And it should exit successfully
@@ -40,5 +42,6 @@ Feature: osrm-extract command line options: help
And stdout should contain "Configuration:" And stdout should contain "Configuration:"
And stdout should contain "--profile" And stdout should contain "--profile"
And stdout should contain "--threads" And stdout should contain "--threads"
And stdout should contain "--generate-edge-lookup"
And stdout should contain "--small-component-size" And stdout should contain "--small-component-size"
And it should exit successfully And it should exit successfully
-22
View File
@@ -1,22 +0,0 @@
@partition @options @files
Feature: osrm-partition command line options: files
Background:
Given the profile "testbot"
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been extracted
Scenario: osrm-partition - Passing base file
When I run "osrm-partition {processed_file}"
Then it should exit successfully
Scenario: osrm-partition - Missing input file
When I try to run "osrm-partition over-the-rainbow.osrm"
And stderr should contain "over-the-rainbow.osrm"
And stderr should contain "not found"
And it should exit with an error
-50
View File
@@ -1,50 +0,0 @@
@partition @options @help
Feature: osrm-partition command line options: help
Scenario: osrm-partition - Help should be shown when no options are passed
When I try to run "osrm-partition"
Then stderr should be empty
And stdout should contain /osrm-partition(.exe)? <input.osrm> \[options\]:/
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "Configuration:"
And stdout should contain "--threads"
And stdout should contain "--min-cell-size"
And stdout should contain "--balance"
And stdout should contain "--boundary"
And stdout should contain "--optimizing-cuts"
And stdout should contain "--small-component-size"
And it should exit with an error
Scenario: osrm-partition - Help, short
When I run "osrm-partition -h"
Then stderr should be empty
And stdout should contain /osrm-partition(.exe)? <input.osrm> \[options\]:/
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "Configuration:"
And stdout should contain "--threads"
And stdout should contain "--min-cell-size"
And stdout should contain "--balance"
And stdout should contain "--boundary"
And stdout should contain "--optimizing-cuts"
And stdout should contain "--small-component-size"
And it should exit successfully
Scenario: osrm-partition - Help, long
When I run "osrm-partition --help"
Then stderr should be empty
And stdout should contain /osrm-partition(.exe)? <input.osrm> \[options\]:/
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "Configuration:"
And stdout should contain "--threads"
And stdout should contain "--min-cell-size"
And stdout should contain "--balance"
And stdout should contain "--boundary"
And stdout should contain "--optimizing-cuts"
And stdout should contain "--small-component-size"
And it should exit successfully
@@ -1,20 +0,0 @@
@partition @options @invalid
Feature: osrm-partition command line options: invalid options
Background:
Given the profile "testbot"
And the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been extracted
Scenario: osrm-partition - Non-existing option
When I try to run "osrm-partition --fly-me-to-the-moon"
Then stdout should be empty
And stderr should contain "option"
And stderr should contain "fly-me-to-the-moon"
And it should exit with an error
@@ -1,19 +0,0 @@
@partition @options @version
Feature: osrm-partition command line options: version
Background:
Given the profile "testbot"
Scenario: osrm-partition - Version, short
When I run "osrm-partition --v"
Then stderr should be empty
And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
And it should exit successfully
Scenario: osrm-partition - Version, long
When I run "osrm-partition --version"
Then stderr should be empty
And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
And it should exit successfully
+1 -1
View File
@@ -104,4 +104,4 @@ end
| from | to | route | time | | from | to | route | time |
| a | b | ac,cb,cb | 24.2s | | a | b | ac,cb,cb | 24.2s |
| a | d | ac,cd,cd | 24.2s | | a | d | ac,cd,cd | 24.2s |
| a | e | ac,ce | 20s | | a | e | ac,ce,ce | 20s |
+1 -4
View File
@@ -13,9 +13,6 @@ properties.max_speed_for_map_matching = 180/3.6
properties.use_turn_restrictions = true properties.use_turn_restrictions = true
properties.continue_straight_at_waypoint = true properties.continue_straight_at_waypoint = true
properties.weight_name = 'test_version1' properties.weight_name = 'test_version1'
properties.weight_precision = 2
assert(properties.max_turn_weight == 327.67)
function node_function (node, result) function node_function (node, result)
print ('node_function ' .. node:id()) print ('node_function ' .. node:id())
@@ -66,4 +63,4 @@ end
| from | to | route | time | | from | to | route | time |
| a | b | ac,cb,cb | 19.2s | | a | b | ac,cb,cb | 19.2s |
| a | d | ac,cd,cd | 19.2s | | a | d | ac,cd,cd | 19.2s |
| a | e | ac,ce | 20s | | a | e | ac,ce,ce | 20s |
+5 -11
View File
@@ -23,16 +23,6 @@ module.exports = function () {
callback(); callback();
}); });
this.Given(/^the partition extra arguments "(.*?)"$/, (args, callback) => {
this.partitionArgs = this.expandOptions(args);
callback();
});
this.Given(/^the customize extra arguments "(.*?)"$/, (args, callback) => {
this.customizeArgs = this.expandOptions(args);
callback();
});
this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => { this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => {
this.setGridSize(meters); this.setGridSize(meters);
callback(); callback();
@@ -269,7 +259,11 @@ module.exports = function () {
this.writeAndLinkOSM(callback); this.writeAndLinkOSM(callback);
}); });
this.Given(/^the data has been (extract|contract|partition|customiz)ed$/, (step, callback) => { this.Given(/^the data has been extracted$/, (callback) => {
this.reprocess(callback);
});
this.Given(/^the data has been contracted$/, (callback) => {
this.reprocess(callback); this.reprocess(callback);
}); });
+1 -9
View File
@@ -39,8 +39,7 @@ module.exports = function () {
duration = '', duration = '',
annotation = '', annotation = '',
geometry = '', geometry = '',
OSMIDs = '', OSMIDs = '';
alternatives = '';
if (res.statusCode === 200) { if (res.statusCode === 200) {
@@ -96,10 +95,6 @@ module.exports = function () {
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace'); if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
geometry = json.matchings[0].geometry; geometry = json.matchings[0].geometry;
} }
if (headers.has('alternatives')) {
alternatives = this.alternativesList(json);
}
} }
if (headers.has('turns')) { if (headers.has('turns')) {
@@ -142,9 +137,6 @@ module.exports = function () {
got['OSM IDs'] = OSMIDs; got['OSM IDs'] = OSMIDs;
} }
if (headers.has('alternatives')) {
got['alternatives'] = alternatives;
}
var ok = true; var ok = true;
var encodedResult = '', var encodedResult = '',
extendedTarget = ''; extendedTarget = '';
+31 -13
View File
@@ -12,7 +12,7 @@ module.exports = function () {
}; };
this.runAndSafeOutput = (binary, options, callback) => { this.runAndSafeOutput = (binary, options, callback) => {
return this.runBin(binary, this.expandOptions(options), this.environment, (err, stdout, stderr) => { this.runBin(binary, this.expandOptions(options), this.environment, (err, stdout, stderr) => {
this.stdout = stdout; this.stdout = stdout;
this.stderr = stderr; this.stderr = stderr;
this.exitCode = err && err.code || 0; this.exitCode = err && err.code || 0;
@@ -25,22 +25,36 @@ module.exports = function () {
this.runAndSafeOutput('osrm-routed', options, callback); this.runAndSafeOutput('osrm-routed', options, callback);
}); });
this.When(/^I run "osrm\-(extract|contract|partition|customize)\s?(.*?)"$/, (binary, options, callback) => { this.When(/^I run "osrm\-extract\s?(.*?)"$/, (options, callback) => {
const stamp = this.processedCacheFile + '.stamp_' + binary; const stamp = this.processedCacheFile + '.extract';
this.runAndSafeOutput('osrm-' + binary, options, (err) => { this.runAndSafeOutput('osrm-extract', options, (err) => {
if (err) return callback(err); if (err) return callback(err);
fs.writeFile(stamp, 'ok', callback); fs.writeFile(stamp, 'ok', callback);
}); });
}); });
this.When(/^I try to run "(osrm\-[a-z]+)\s?(.*?)"$/, (binary, options, callback) => { this.When(/^I run "osrm\-contract\s?(.*?)"$/, (options, callback) => {
this.runAndSafeOutput(binary, options, () => { callback(); }); const stamp = this.processedCacheFile + '.contract';
this.runAndSafeOutput('osrm-contract', options, (err) => {
if (err) return callback(err);
fs.writeFile(stamp, 'ok', callback);
});
}); });
this.When(/^I run "osrm\-datastore\s?(.*?)"(?: with input "([^"]*)")?$/, (options, input, callback) => { this.When(/^I try to run "osrm\-routed\s?(.*?)"$/, (options, callback) => {
let child = this.runAndSafeOutput('osrm-datastore', options, callback); this.runAndSafeOutput('osrm-routed', options, () => { callback(); });
if (input !== undefined) });
child.stdin.write(input);
this.When(/^I try to run "osrm\-extract\s?(.*?)"$/, (options, callback) => {
this.runAndSafeOutput('osrm-extract', options, () => { callback(); });
});
this.When(/^I try to run "osrm\-contract\s?(.*?)"$/, (options, callback) => {
this.runAndSafeOutput('osrm-contract', options, () => { callback(); });
});
this.When(/^I run "osrm\-datastore\s?(.*?)"$/, (options, callback) => {
this.runAndSafeOutput('osrm-datastore', options, callback);
}); });
this.Then(/^it should exit successfully$/, () => { this.Then(/^it should exit successfully$/, () => {
@@ -52,9 +66,8 @@ module.exports = function () {
assert.ok(this.exitCode !== 0 || this.termSignal); assert.ok(this.exitCode !== 0 || this.termSignal);
}); });
this.Then(/^stdout should( not)? contain "(.*?)"$/, (not, str) => { this.Then(/^stdout should contain "(.*?)"$/, (str) => {
const contains = this.stdout.indexOf(str) > -1; assert.ok(this.stdout.indexOf(str) > -1);
assert.ok(typeof not === 'undefined' ? contains : !contains);
}); });
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => { this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
@@ -88,6 +101,11 @@ module.exports = function () {
assert.equal(this.stderr.split('\n').length - 1, parseInt(lines)); assert.equal(this.stderr.split('\n').length - 1, parseInt(lines));
}); });
this.Then(/^datasource names should contain "(.+)"$/, (expectedData) => {
const actualData = fs.readFileSync(this.processedCacheFile + '.datasource_names', {encoding:'UTF-8'}).trim().split('\n').join(',');
assert.equal(actualData, expectedData);
});
this.Given(/^the query options$/, (table, callback) => { this.Given(/^the query options$/, (table, callback) => {
table.raw().forEach(tuple => { table.raw().forEach(tuple => {
this.queryParams[tuple[0]] = tuple[1]; this.queryParams[tuple[0]] = tuple[1];
+5 -15
View File
@@ -10,7 +10,7 @@ module.exports = function () {
headers = new Set(Object.keys(table.hashes()[0])); headers = new Set(Object.keys(table.hashes()[0]));
if (!testedHeaders.some(k => !!headers.has(k))) { if (!testedHeaders.some(k => !!headers.has(k))) {
throw new Error('*** routability table must contain either "forw", "backw", "bothw", "forw_rate" or "backw_mode" column'); throw new Error('*** routability table must contain either "forw", "backw", "bothw", "forw_rate" or "backw_rate" column');
} }
this.reprocessAndLoadData((e) => { this.reprocessAndLoadData((e) => {
@@ -62,12 +62,9 @@ module.exports = function () {
// rename forw/backw to forw/backw_speed // rename forw/backw to forw/backw_speed
switch (true) { switch (true) {
case '' === want: case '' === want:
outputRow[direction] = result[direction].status ?
result[direction].mode : '';
break;
case 'x' === want: case 'x' === want:
outputRow[direction] = result[direction].status ? outputRow[direction] = result[direction].status ?
'x' : ''; result[direction].status.toString() : '';
break; break;
case /^[\d\.]+ s/.test(want): case /^[\d\.]+ s/.test(want):
// the result here can come back as a non-number value like // the result here can come back as a non-number value like
@@ -91,7 +88,7 @@ module.exports = function () {
} }
break; break;
default: default:
outputRow[direction] = result[direction].mode || ''; throw new Error(util.format('*** Unknown expectation format: %s', want));
} }
if (this.FuzzyMatch.match(outputRow[direction], want)) { if (this.FuzzyMatch.match(outputRow[direction], want)) {
@@ -109,7 +106,7 @@ module.exports = function () {
// makes simple a-b request using the given cucumber test routability conditions // makes simple a-b request using the given cucumber test routability conditions
// result is an object containing the calculated values for 'rate', 'status', // result is an object containing the calculated values for 'rate', 'status',
// 'time', 'distance', 'speed' and 'mode', for forwards and backwards routing, as well as // 'time', 'distance', and 'speed' for forwards and backwards routing, as well as
// a bothw object that diffs forwards/backwards // a bothw object that diffs forwards/backwards
var testRoutabilityRow = (i, cb) => { var testRoutabilityRow = (i, cb) => {
var result = {}; var result = {};
@@ -136,13 +133,6 @@ module.exports = function () {
r.distance = r.json.routes[0].distance; r.distance = r.json.routes[0].distance;
r.rate = Math.round(r.distance / r.json.routes[0].weight); r.rate = Math.round(r.distance / r.json.routes[0].weight);
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null; r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
// use the mode of the first step of the route
// for routability table test, we can assume the mode is the same throughout the route,
// since the route is just a single way
if( r.json.routes[0].legs[0] && r.json.routes[0].legs[0].steps[0] ) {
r.mode = r.json.routes[0].legs[0].steps[0].mode;
}
} else { } else {
r.status = null; r.status = null;
} }
@@ -177,7 +167,7 @@ module.exports = function () {
scb(); scb();
}; };
['rate', 'status', 'time', 'distance', 'speed' ,'mode'].forEach((key) => { ['rate', 'status', 'time', 'distance', 'speed'].forEach((key) => {
sq.defer(parseRes, key); sq.defer(parseRes, key);
}); });
+5 -36
View File
@@ -179,7 +179,7 @@ module.exports = function () {
}; };
this.extractData = (p, callback) => { this.extractData = (p, callback) => {
let stamp = p.processedCacheFile + '.stamp_extract'; let stamp = p.processedCacheFile + '.extract';
fs.exists(stamp, (exists) => { fs.exists(stamp, (exists) => {
if (exists) return callback(); if (exists) return callback();
@@ -193,7 +193,7 @@ module.exports = function () {
}; };
this.contractData = (p, callback) => { this.contractData = (p, callback) => {
let stamp = p.processedCacheFile + '.stamp_contract'; let stamp = p.processedCacheFile + '.contract';
fs.exists(stamp, (exists) => { fs.exists(stamp, (exists) => {
if (exists) return callback(); if (exists) return callback();
@@ -206,46 +206,15 @@ module.exports = function () {
}); });
}; };
this.partitionData = (p, callback) => { this.extractAndContract = (callback) => {
let stamp = p.processedCacheFile + '.stamp_partition';
fs.exists(stamp, (exists) => {
if (exists) return callback();
this.runBin('osrm-partition', util.format('%s %s', p.partitionArgs, p.processedCacheFile), p.environment, (err) => {
if (err) {
return callback(new Error(util.format('osrm-partition %s: %s', errorReason(err), err.cmd)));
}
fs.writeFile(stamp, 'ok', callback);
});
});
};
this.customizeData = (p, callback) => {
let stamp = p.processedCacheFile + '.stamp_customize';
fs.exists(stamp, (exists) => {
if (exists) return callback();
this.runBin('osrm-customize', util.format('%s %s', p.customizeArgs, p.processedCacheFile), p.environment, (err) => {
if (err) {
return callback(new Error(util.format('osrm-customize %s: %s', errorReason(err), err)));
}
fs.writeFile(stamp, 'ok', callback);
});
});
};
this.extractContractPartitionAndCustomize = (callback) => {
// a shallow copy of scenario parameters to avoid data inconsistency // a shallow copy of scenario parameters to avoid data inconsistency
// if a cucumber timeout occurs during deferred jobs // if a cucumber timeout occurs during deferred jobs
let p = {extractArgs: this.extractArgs, contractArgs: this.contractArgs, let p = {extractArgs: this.extractArgs, contractArgs: this.contractArgs,
partitionArgs: this.partitionArgs, customizeArgs: this.customizeArgs,
profileFile: this.profileFile, inputCacheFile: this.inputCacheFile, profileFile: this.profileFile, inputCacheFile: this.inputCacheFile,
processedCacheFile: this.processedCacheFile, environment: this.environment}; processedCacheFile: this.processedCacheFile, environment: this.environment};
let queue = d3.queue(1); let queue = d3.queue(1);
queue.defer(this.extractData.bind(this), p); queue.defer(this.extractData.bind(this), p);
queue.defer(this.contractData.bind(this), p); queue.defer(this.contractData.bind(this), p);
queue.defer(this.partitionData.bind(this), p);
queue.defer(this.customizeData.bind(this), p);
queue.awaitAll(callback); queue.awaitAll(callback);
}; };
@@ -259,14 +228,14 @@ module.exports = function () {
this.reprocess = (callback) => { this.reprocess = (callback) => {
let queue = d3.queue(1); let queue = d3.queue(1);
queue.defer(this.writeAndLinkOSM.bind(this)); queue.defer(this.writeAndLinkOSM.bind(this));
queue.defer(this.extractContractPartitionAndCustomize.bind(this)); queue.defer(this.extractAndContract.bind(this));
queue.awaitAll(callback); queue.awaitAll(callback);
}; };
this.reprocessAndLoadData = (callback) => { this.reprocessAndLoadData = (callback) => {
let queue = d3.queue(1); let queue = d3.queue(1);
queue.defer(this.writeAndLinkOSM.bind(this)); queue.defer(this.writeAndLinkOSM.bind(this));
queue.defer(this.extractContractPartitionAndCustomize.bind(this)); queue.defer(this.extractAndContract.bind(this));
queue.defer(this.osrmLoader.load.bind(this.osrmLoader), this.processedCacheFile); queue.defer(this.osrmLoader.load.bind(this.osrmLoader), this.processedCacheFile);
queue.awaitAll(callback); queue.awaitAll(callback);
}; };
+2 -3
View File
@@ -31,15 +31,14 @@ module.exports = function () {
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env); this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
this.DEFAULT_PROFILE = 'bicycle'; this.DEFAULT_PROFILE = 'bicycle';
this.DEFAULT_INPUT_FORMAT = 'osm'; this.DEFAULT_INPUT_FORMAT = 'osm';
this.DEFAULT_LOAD_METHOD = 'datastore'; this.DEFAULT_LOAD_METHOD = this.PLATFORM_WINDOWS ? 'directly' : 'datastore';
this.DEFAULT_ORIGIN = [1,1]; this.DEFAULT_ORIGIN = [1,1];
this.OSM_USER = 'osrm'; this.OSM_USER = 'osrm';
this.OSM_GENERATOR = 'osrm-test';
this.OSM_UID = 1; this.OSM_UID = 1;
this.OSM_TIMESTAMP = '2000-01-01T00:00:00Z'; this.OSM_TIMESTAMP = '2000-01-01T00:00:00Z';
this.WAY_SPACING = 100; this.WAY_SPACING = 100;
this.DEFAULT_GRID_SIZE = 100; // meters this.DEFAULT_GRID_SIZE = 100; // meters
// get algorithm name from the command line profile argument
this.ROUTING_ALGORITHM = process.argv[process.argv.indexOf('-p') + 1] === 'mld' ? 'MLD' : 'CH';
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000; this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT; this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
-2
View File
@@ -35,8 +35,6 @@ module.exports = function () {
this.queryParams = {}; this.queryParams = {};
this.extractArgs = ''; this.extractArgs = '';
this.contractArgs = ''; this.contractArgs = '';
this.partitionArgs = '';
this.customizeArgs = '';
this.environment = Object.assign(this.DEFAULT_ENVIRONMENT); this.environment = Object.assign(this.DEFAULT_ENVIRONMENT);
this.resetOSM(); this.resetOSM();
-5
View File
@@ -180,11 +180,6 @@ module.exports = function () {
return merged; return merged;
}; };
this.alternativesList = (instructions) => {
// alternatives_count come from tracepoints list
return instructions.tracepoints.map(t => t.alternatives_count.toString()).join(',');
};
this.lanesList = (instructions) => { this.lanesList = (instructions) => {
return this.extractInstructionList(instructions, instruction => { return this.extractInstructionList(instructions, instruction => {
if( 'lanes' in instruction.intersections[0] ) if( 'lanes' in instruction.intersections[0] )
-4
View File
@@ -46,10 +46,6 @@ module.exports = function () {
let child = child_process.execFile(cmd, opts, {maxBuffer: 1024 * 1024 * 1000, env: env}, callback); let child = child_process.execFile(cmd, opts, {maxBuffer: 1024 * 1024 * 1000, env: env}, callback);
child.on('exit', function(code) { child.on('exit', function(code) {
log.write(util.format('*** %s exited with code %d\n', bin, code)); log.write(util.format('*** %s exited with code %d\n', bin, code));
// remove listeners and close log file -> some tail messages can be lost
child.stdout.removeListener('data', child.logFunc);
child.stderr.removeListener('data', child.logFunc);
log.end();
}.bind(this)); }.bind(this));
this.setupOutputLog(child, log); this.setupOutputLog(child, log);
return child; return child;
+2 -2
View File
@@ -152,9 +152,9 @@ module.exports = function () {
let a_type = k.slice(2); let a_type = k.slice(2);
if (whitelist.indexOf(a_type) == -1) if (whitelist.indexOf(a_type) == -1)
return cb(new Error('Unrecognized annotation field', a_type)); return cb(new Error('Unrecognized annotation field', a_type));
if (annotation && !annotation[a_type]) if (!annotation[a_type])
return cb(new Error('Annotation not found in response', a_type)); return cb(new Error('Annotation not found in response', a_type));
got[k] = annotation && annotation[a_type] || ''; got[k] = annotation[a_type];
} }
}); });
@@ -3,7 +3,6 @@ Feature: Alternative route
Background: Background:
Given the profile "testbot" Given the profile "testbot"
Given a grid size of 200 meters
Scenario: Alternative Loop Paths Scenario: Alternative Loop Paths
Given the node map Given the node map
+5 -7
View File
@@ -3,7 +3,6 @@ Feature: Basic Routing
Background: Background:
Given the profile "testbot" Given the profile "testbot"
Given a grid size of 100 meters
@smallest @smallest
Scenario: A single way with two nodes Scenario: A single way with two nodes
@@ -146,6 +145,7 @@ Feature: Basic Routing
| c | b | bc,bc | | c | b | bc,bc |
Scenario: 3 connected triangles Scenario: 3 connected triangles
Given a grid size of 100 meters
Given the node map Given the node map
""" """
x a b s x a b s
@@ -178,14 +178,12 @@ Feature: Basic Routing
| c | a | ca,ca | | c | a | ca,ca |
| c | b | bc,bc | | c | b | bc,bc |
Scenario: To ways connected at a 90 degree angle Scenario: To ways connected at a 45 degree angle
Given the node map Given the node map
""" """
a a
|
b b
| c d e
c----d----e
""" """
And the ways And the ways
@@ -272,7 +270,7 @@ Feature: Basic Routing
| de | primary | | | de | primary | |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| d | c | de,ce,ce | | d | c | de,ce,ce |
| e | d | de,de | | e | d | de,de |
@@ -296,7 +294,7 @@ Feature: Basic Routing
Scenario: Ambiguous edge names - Use lexicographically smallest name Scenario: Ambiguous edge names - Use lexicographically smallest name
Given the node map Given the node map
""" """
a-------b-------c a b c
""" """
And the ways And the ways
-1
View File
@@ -3,7 +3,6 @@ Feature: Compass bearing
Background: Background:
Given the profile "testbot" Given the profile "testbot"
Given a grid size of 200 meters
Scenario: Bearing when going northwest Scenario: Bearing when going northwest
Given the node map Given the node map
+11 -11
View File
@@ -64,17 +64,17 @@ Feature: Bearing parameter
| ha | yes | | ha | yes |
When I route I should get When I route I should get
| from | to | bearings | route | bearing | | from | to | bearings | route | bearing |
| 0 | b | 10 10 | bc,bc | 0->0,0->0 | | 0 | b | 10 10 | bc,bc | 0->0,0->0 |
| 0 | b | 90 90 | ab,ab | 0->90,90->0 | | 0 | b | 90 90 | ab,ab | 0->90,90->0 |
| 0 | b | 170 170 | da,da | 0->0,0->0 | | 0 | b | 170 170 | da,da | 0->0,0->0 |
| 0 | b | 189 189 | da,da | 0->0,0->0 | | 0 | b | 189 189 | da,da | 0->0,0->0 |
| 0 | 1 | 90 270 | ab,cd,cd | 0->90,90->0,270->0 | | 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 |
| 1 | 2 | 10 10 | bc,bc | 0->0,0->0 | | 1 | 2 | 10 10 | bc,bc | 0->0,0->0 |
| 1 | 2 | 90 90 | ab,cd,ab,ab | 0->90,90->0,270->180,90->0 | | 1 | 2 | 90 90 | ab,bc,cd,da,ab,ab | 0->90,90->0,0->270,270->180,180->90,90->0 |
| 1 | 0 | 189 189 | da,da | 0->180,180->0 | | 1 | 0 | 189 189 | da,da | 0->180,180->0 |
| 1 | 2 | 270 270 | cd,cd | 0->270,270->0 | | 1 | 2 | 270 270 | cd,cd | 0->270,270->0 |
| 1 | 2 | 349 349 | | | | 1 | 2 | 349 349 | | |
Scenario: Testbot - Initial bearing in all direction Scenario: Testbot - Initial bearing in all direction
Given the node map Given the node map

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