Compare commits

..

23 Commits

Author SHA1 Message Date
Daniel Patterson 54ab5373cf Fix tests - backported changes need old namespace. 2017-01-18 22:58:43 -08:00
Daniel Patterson 57bd2cda0f Update changelog and version for 5.5.4 2017-01-18 22:25:20 -08:00
Moritz Kobitzsch bfbdd18834 fix emitting invalid turn types, now surfacing due to changes in obvious detection
Conflicts:
	features/guidance/dedicated-turn-roads.feature
	include/extractor/guidance/intersection.hpp
2017-01-18 17:22:14 +01:00
Daniel J. Hofmann 5159d57201 Changelog Item for #3561 2017-01-17 12:54:38 +01:00
Michael Krasnyk bc38275146 Added missing backward_speed for cycleways 2017-01-17 12:53:08 +01:00
Moritz Kobitzsch c77add50e2 cherry-pick https://github.com/Project-OSRM/osrm-backend/pull/3555 2017-01-17 10:27:33 +01:00
Michael Krasnyk 37e36fd165 Fix possible division by zero by clamping latitude to 85.05°
Resolves #3530
2017-01-17 10:08:27 +01:00
Michael Krasnyk 341109a8f4 Adjusted number of nodes in annotation, resolves #3515
Conflicts:
	CHANGELOG.md
2017-01-17 10:02:07 +01:00
Daniel Patterson a0b1a5df8c Update version and CHANGELOG for 5.5.3. 2017-01-11 17:14:18 -08:00
Daniel Patterson 411313f666 Backport NumLanesToTheRight/NumLanesToTheLeft to support 6ea9f9fdf1 2017-01-11 16:44:25 -08:00
Moritz Kobitzsch ada0a1e8f8 fix coordinate assertion for walking profile with steps 2017-01-11 21:57:11 +00:00
Moritz Kobitzsch 74611f94fa Remove assertions that could be triggered by bad data. (#3469)
When two consecutive nodes have identical coordinates, there is no valid
bearing.  For now, make equal nodes have bearing 0.

Full fix still needs to be done via https://github.com/Project-OSRM/osrm-backend/issues/3470.
2017-01-11 21:55:29 +00:00
Michael Krasnyk eaff3b4210 Make a hard reset of named barrier mutexes on signal 2017-01-11 21:43:01 +00:00
Jihyun Yu 1fb9f3e1eb Fix copying vector on std::sort comparator (#3504) 2017-01-11 21:41:17 +00:00
Daniel J. Hofmann 6ea9f9fdf1 Consider number of lanes to cross, resolves #3025.
Lane Anticipation currently triggers on quick steps with lanes. This
changeset makes the "quick" part more dynamic by taking lanes left and
right of the turn into account. The reasoning for this is as follows.

The user can drive on the leftmost or rightmost lane and has to cross
all lanes left or right of the turn, respecitvely.

We scale our threshold appropriately, which now means the threshold
describes the duration the user needs for crossing _a single lane_.

Note: this is a heuristic and assumes the worst case. Which in my
opinion is fine to do since triggering Lane Anticipation in complex
scenarios is desirable.
2017-01-11 21:37:17 +00:00
Daniel Patterson 434a3a638a Make Travis buildit. 2016-12-21 15:31:03 -08:00
Daniel Patterson 6305f4a529 Update changelog and version. 2016-12-21 15:18:30 -08:00
Patrick Niklaus 646b1631ab Revert "Smarter search radius formula for map matching"
This reverts commit b73c59088c.
2016-12-21 15:14:33 -08:00
Patrick Niklaus a852ab1c43 Revert "Fix capture"
This reverts commit 4f81e31d63.
2016-12-21 15:14:33 -08:00
Patrick Niklaus ff25fc70f0 Revert "Hardcode search radius parameters"
This reverts commit 2c9e18d5a9.
2016-12-21 15:14:33 -08:00
Patrick Niklaus b34ed587d0 Revert "Fix call to std::min"
This reverts commit 8bb183bc8c.
2016-12-21 15:14:33 -08:00
Daniel Patterson b58329104a Bump version field and update CHANGELOG. 2016-12-16 13:58:21 -08:00
Patrick Niklaus d188e8e2a8 Fix changing shared memory in multi-process setup (#3462)
This change fixes two bugs:

1. A dead-lock that occurs between osrm-datastore and libosrm when an
   old dataset is free during a data update. This happened because the
   mutexes where acquired in a different order.

2. A region is deleted eventhough it is still in use. This happens when
   libosrm gets overtaken by osrm-datastore, so the new dataset is in
   the same region the old one was.
2016-12-16 13:54:57 -08:00
1070 changed files with 16308 additions and 40474 deletions
-3
View File
@@ -94,6 +94,3 @@ node_modules
/server.ini
*.swp
# local lua debugging file
debug.lua
+17 -15
View File
@@ -13,7 +13,7 @@ notifications:
branches:
only:
- master
- "5.6"
- 5.5
cache:
ccache: true
@@ -28,7 +28,6 @@ env:
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
- CCACHE_VERSION=3.3.1
- CMAKE_VERSION=3.6.2
- MASON="$(pwd)/third_party/mason/mason"
matrix:
fast_finish: true
@@ -46,12 +45,12 @@ matrix:
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
compiler: "clang-3.9-debug"
compiler: "clang-3.8-debug"
addons: &clang38
apt:
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']
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Debug' BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
env: CLANG_VERSION='3.8.1' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
- os: osx
osx_image: xcode8.2
@@ -66,7 +65,7 @@ matrix:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON
env: CLANG_VERSION='3.8.1' BUILD_TYPE='Release' ENABLE_MASON=ON
- os: linux
compiler: "gcc-6-release"
@@ -80,7 +79,7 @@ matrix:
compiler: "gcc-6-release-i686"
env: >
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
- os: linux
compiler: "gcc-4.9-release"
@@ -123,10 +122,6 @@ before_install:
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export JOBS=$((`nproc` + 1))
fi
- |
if [ -n "${RUN_CLANG_FORMAT}" ]; then
${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export JOBS=$((`sysctl -n hw.ncpu` + 1))
@@ -136,18 +131,22 @@ before_install:
- source ./scripts/install_node.sh 4
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
- npm install
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
- ${MASON} install cmake ${CMAKE_VERSION} && export PATH=$(${MASON} prefix cmake ${CMAKE_VERSION})/bin:${PATH}
- ./third_party/mason/mason install ccache ${CCACHE_VERSION}
- export PATH=$(./third_party/mason/mason prefix ccache ${CCACHE_VERSION})/bin:${PATH}
- ./third_party/mason/mason install cmake ${CMAKE_VERSION}
- export PATH=$(./third_party/mason/mason prefix cmake ${CMAKE_VERSION})/bin:${PATH}
- |
if [[ ! -z ${CLANG_VERSION} ]]; then
export CCOMPILER='clang'
export CXXCOMPILER='clang++'
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH}
./third_party/mason/mason install clang++ ${CLANG_VERSION}
export PATH=$(./third_party/mason/mason prefix clang++ ${CLANG_VERSION})/bin:${PATH}
# we only enable lto for release builds
# and therefore don't need to us ld.gold or llvm tools for linking
# for debug builds
if [[ ${BUILD_TYPE} == 'Release' ]]; then
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH}
./third_party/mason/mason install binutils 2.27
export PATH=$(./third_party/mason/mason prefix binutils 2.27)/bin:${PATH}
fi
fi
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
@@ -172,7 +171,6 @@ install:
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo ldconfig
fi
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
- popd
- mkdir example/build && pushd example/build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
@@ -197,6 +195,10 @@ script:
- npm test
after_success:
- |
if [ -n "${RUN_CLANG_FORMAT}" ]; then
./scripts/format.sh # we don't want to fail just yet
fi
- |
if [ -n "${ENABLE_COVERAGE}" ]; then
bash <(curl -s https://codecov.io/bash)
+20 -52
View File
@@ -1,62 +1,30 @@
# 5.6.3
- Changes from 5.6.0
# 5.5.4
- Changes from 5.5.3
- Bugfixes
- #3790 Fix incorrect speed values in tile plugin
- PR #3561 - added missing backwards speeds for cycleways in bicycle profile
- PR #3515 - adjusted number of `nodes` in `annotation`
- Ticket #3430 - Fix possible division by zero by clamping latitude to +/- 85.05
- PR #3555 - Fix an error that occurs when a road forks immediately after exiting a ferry
- PR #3575 - Don't emit invalid turn types for obvious turns at sliproads and roundabouts.
# 5.6.2
- Changes from 5.6.0
- Bugfixes
- Fix incorrect forward datasources getter in facade
- Fix include `access=private` non-car roads in the car profile
# 5.5.3
- Changes from 5.5.2
- Bugfixes:
- PR #3504 - debug tiles were very slow to generate due to unnecessarily copying data in a hot loop.
- PR #3556 - fix an assertion in the walking profile triggered by tight spiral stairwells
- PR #3469 - don't assert when identical coordinates are supplied to some calculations - OSM data contains these, we shouldn't crash.
- Enhancements:
- backported 6ea9f9fdf19 - when anticipating upcoming lanes, consider how many lanes need to be crossed to get there.
- when using osrm-datastore, it will attempt to clean up locks if it crashes.
# 5.6.1
- Changes from 5.6.0
- Bugfixes
- Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
# 5.6.0
- Changes from 5.5
- Bugfixes
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
- Fix #3515 adjusted number of `nodes` in `annotation`
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
- Fix #2844 handle up to 16777215 code units in OSM names
- Infrastructure
- Support building rpm packages.
- Guidance
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
- Profiles
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
- `properties` object has a new `weight_name` field, default value is "duration"
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
- Infrastructure
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
- Tools:
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
- Trip Plugin
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
# 5.5.2
- Changes from 5.5.1
- Revert smarter map-matching search radius. The increased radius causes performance degredation when map-matching against non-car road networks with more edges.
# 5.5.1
- Changes from 5.5.0
- API:
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
- Bugfixes
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
- Fixes #3455 where a deadlock could occur if re-loading new data under heavy load with multiple consumers osrm-datastore
# 5.5.0
- Changes from 5.4.0
+59 -88
View File
@@ -17,22 +17,23 @@ endif()
option(ENABLE_MASON "Use mason for dependencies" OFF)
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
option(BUILD_TOOLS "Build OSRM tools" OFF)
option(BUILD_PACKAGE "Build OSRM package" OFF)
option(BUILD_COMPONENTS "Build osrm-components" OFF)
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
option(ENABLE_LTO "Use LTO if available" OFF)
option(ENABLE_LTO "Use LTO if available" ON)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
if(ENABLE_MASON)
# versions in use
set(MASON_BOOST_VERSION "1.63.0")
set(MASON_BOOST_VERSION "1.61.0")
set(MASON_STXXL_VERSION "1.4.1")
set(MASON_EXPAT_VERSION "2.2.0")
set(MASON_LUA_VERSION "5.2.4")
set(MASON_LUABIND_VERSION "e414c57bcb687bb3091b7c55bbff6947f052e46b")
set(MASON_BZIP2_VERSION "1.0.6")
set(MASON_TBB_VERSION "2017_20161128")
set(MASON_TBB_VERSION "43_20150316")
message(STATUS "Enabling mason")
@@ -52,7 +53,7 @@ endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 5)
set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION_PATCH 4)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
@@ -76,7 +77,6 @@ endfunction(add_dependency_defines)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCXXCompilerFlag)
include(FindPackageHandleStandardArgs)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -92,22 +92,17 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
endif()
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
endif()
endif()
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
"-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}"
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FingerPrint-Config.cmake"
COMMENT "Configuring revision fingerprint"
VERBATIM)
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
configure_file(
@@ -128,6 +123,7 @@ add_library(STORAGE OBJECT ${StorageGlob})
add_library(ENGINE OBJECT ${EngineGlob})
add_library(SERVER OBJECT ${ServerGlob})
add_dependencies(UTIL FingerPrintConfigure)
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
add_executable(osrm-extract src/tools/extract.cpp)
@@ -232,7 +228,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
find_program(GCC_AR gcc-ar)
find_program(GCC_RANLIB gcc-ranlib)
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
message(WARNING "GCC specific binutils not found.")
else()
message(STATUS "Using GCC specific binutils for LTO:")
message(STATUS " ${GCC_AR}")
@@ -286,7 +282,7 @@ endif()
# Configuring compilers
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(COLOR_FLAG "-fdiagnostics-color=auto")
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
@@ -294,7 +290,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(COLOR_FLAG "")
endif()
# using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
if(WIN32) # using mingw
add_dependency_defines(-DWIN32)
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
@@ -407,6 +403,10 @@ if(ENABLE_MASON)
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
mason_use(luabind_lua524 VERSION ${MASON_LUABIND_VERSION})
add_dependency_includes(${MASON_PACKAGE_luabind_lua524_INCLUDE_DIRS})
set(LUABIND_LIBRARY ${MASON_PACKAGE_luabind_lua524_STATIC_LIBS})
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
@@ -434,6 +434,10 @@ if(ENABLE_MASON)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
if(BUILD_COMPONENTS)
message(FATAL_ERROR "BUILD_COMPONENTS is not supported with ENABLE_MASON")
endif()
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
@@ -443,17 +447,18 @@ if(ENABLE_MASON)
else()
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
add_dependency_includes(${Boost_INCLUDE_DIRS})
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
endif()
find_package(TBB REQUIRED)
add_dependency_includes(${TBB_INCLUDE_DIR})
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
endif()
find_package(Luabind REQUIRED)
add_dependency_includes(${LUABIND_INCLUDE_DIR})
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
add_dependency_includes(${LUA_INCLUDE_DIR})
find_package(EXPAT REQUIRED)
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
@@ -464,32 +469,9 @@ else()
find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})
FIND_PACKAGE(Lua 5.2 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
# Now fall back to a lua verison without exact
# in case this cmake version also forces patch versions
FIND_PACKAGE(Lua 5.2)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
add_dependency_includes(${LUA_INCLUDE_DIR})
if(BUILD_COMPONENTS)
find_package(GDAL)
endif()
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
@@ -530,6 +512,7 @@ if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
@@ -573,6 +556,7 @@ set(EXTRACTOR_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${EXPAT_LIBRARIES}
${LUABIND_LIBRARY}
${USED_LUA_LIBRARIES}
${OSMIUM_LIBRARIES}
${STXXL_LIBRARY}
@@ -582,6 +566,7 @@ set(EXTRACTOR_LIBRARIES
set(CONTRACTOR_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${LUABIND_LIBRARY}
${USED_LUA_LIBRARIES}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
@@ -612,25 +597,33 @@ target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# BUILD_COMPONENTS
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES})
install(TARGETS osrm-components DESTINATION bin)
if(BUILD_COMPONENTS)
if(GDAL_FOUND)
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES})
include_directories(SYSTEM ${GDAL_INCLUDE_DIR})
target_link_libraries(osrm-components ${GDAL_LIBRARIES} ${BOOST_BASE_LIBRARIES})
install(TARGETS osrm-components DESTINATION bin)
else()
message(WARNING "libgdal and/or development headers not found")
endif()
endif()
if(BUILD_TOOLS)
message(STATUS "Activating OSRM internal tools")
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-unlock-all ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if(UNIX AND NOT APPLE)
target_link_libraries(osrm-unlock-all rt)
endif()
add_executable(osrm-springclean src/tools/springclean.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-springclean ${BOOST_BASE_LIBRARIES})
install(TARGETS osrm-io-benchmark DESTINATION bin)
find_package(Shapefile) # package libshp-dev
if(Shapefile_FOUND)
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LIBSHAPEFILE_LIBRARY})
install(TARGETS osrm-extract-conditionals DESTINATION bin)
endif()
install(TARGETS osrm-unlock-all DESTINATION bin)
install(TARGETS osrm-springclean DESTINATION bin)
endif()
if (ENABLE_ASSERTIONS)
@@ -671,16 +664,11 @@ install(TARGETS osrm_extract DESTINATION lib)
install(TARGETS osrm_contract DESTINATION lib)
install(TARGETS osrm_store DESTINATION lib)
# Install profiles and support library to /usr/local/share/osrm/profiles by default
set(DefaultProfilesDir profiles)
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
# Setup exporting variables for pkgconfig and subproject
#
if(BUILD_PACKAGE)
include(CPackConfig)
if(BUILD_DEBIAN_PACKAGE)
include(CPackDebianConfig)
include(CPack)
endif()
@@ -718,7 +706,7 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)
# uninstall target
configure_file(
@@ -747,20 +735,3 @@ if (ENABLE_FUZZING)
add_subdirectory(fuzz)
endif ()
## add headers sanity check target that includes all headers independently
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
file(GLOB_RECURSE headers_to_check
${PROJECT_BINARY_DIR}/*.hpp
${PROJECT_SOURCE_DIR}/include/*.hpp)
foreach(header ${headers_to_check})
get_filename_component(filename ${header} NAME_WE)
set(filename "${check_headers_dir}/${filename}.cpp")
if (NOT EXISTS ${filename})
file(WRITE ${filename} "#include \"${header}\"\n")
endif()
list(APPEND sources ${filename})
endforeach()
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
-22
View File
@@ -7,28 +7,6 @@ You can add a :+1: emoji to the issue if you want to express interest in this.
# Developer
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
To save development time a local hook `.git/hooks/pre-push`
```
#!/bin/sh
remote="$1"
if [ x"$remote" = xorigin ] ; then
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
echo "Rejected push to $remote/master" ; exit 1
fi
./scripts/format.sh
if [ $? -ne 0 ] ; then
echo "Unstaged format changes" ; exit 1
fi
fi
```
could check code format, modify a local repository and reject push due to unstaged formatting changes.
Also `pre-push` hook rejects direct pushes to `origin/master`.
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
+41 -63
View File
@@ -1,87 +1,64 @@
## Open Source Routing Machine
## About
| Linux / macOS | Windows | Code Coverage |
| ------------- | ------- | ------------- |
| [![Travis](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=master)](https://travis-ci.org/Project-OSRM/osrm-backend) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [![Codecov](https://codecov.io/gh/Project-OSRM/osrm-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/Project-OSRM/osrm-backend) |
The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
## Current build status
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
- Nearest - Snaps coordinates to the street network and returns the nearest matches
- Route - Finds the fastest route between coordinates
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
- Match - Snaps noisy GPS traces to the road network in the most plausible way
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
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
- [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
| build config | status |
|:-------------|:-------|
| Linux | [![Build Status](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=master)](https://travis-ci.org/Project-OSRM/osrm-backend) |
| Windows | [![Build status](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
| Coverage | [![codecov](https://codecov.io/gh/Project-OSRM/osrm-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/Project-OSRM/osrm-backend) |
## Contact
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
- IRC: server `irc.oftc.net`, channel: `#osrm` (see: `https://www.oftc.net`, and for a webchat: `https://webchat.oftc.net`)
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
## Quick Start
## Building
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 on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
#### Install dependencies
```bash
sudo apt install build-essential git cmake pkg-config \
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
```
#### Compile and install OSRM binaries:
```bash
mkdir -p build
cd build
cmake ..
cmake --build .
sudo cmake --build . --target install
```
#### Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
```bash
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
```
#### Pre-process the extract and start the HTTP server
```
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm
```
#### Running Queries
```
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
```
To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
## Documentation
### Full documentation
- [Hosted documentation](http://project-osrm.org)
- [osrm-routed HTTP API documentation](docs/http.md)
- [libosrm API documentation](docs/libosrm.md)
### Quick start
Building OSRM assuming all dependencies are installed:
```
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
sudo cmake --build . --target install
```
Loading preparing a dataset and starting the server:
```
osrm-extract data.osm.pbf -p profiles/car.lua
osrm-contract data.osrm
osrm-routed data.osrm
```
Running a query on your local server:
```
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
```
### Running a request against the Demo Server
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
Simple query with instructions and alternatives on Berlin:
First read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
Then run simple query with instructions and alternatives on Berlin:
```
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
@@ -109,3 +86,4 @@ When using the code in a (scientific) publication, please cite
address = {New York, NY, USA},
}
```
+2 -13
View File
@@ -10,10 +10,10 @@ ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
ECHO cmake^: && cmake --version
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
cmake --version | findstr /C:"3.7.0" && GOTO CMAKE_OK
:CMAKE_NOT_OK
SET CMAKE_VERSION=3.7.1
SET CMAKE_VERSION=3.7.0-rc2
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
@@ -119,27 +119,16 @@ SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
ECHO running extractor-tests.exe ...
unit_tests\%Configuration%\extractor-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running engine-tests.exe ...
unit_tests\%Configuration%\engine-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running util-tests.exe ...
unit_tests\%Configuration%\util-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running server-tests.exe ...
unit_tests\%Configuration%\server-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running library-tests.exe ...
SET test_region=monaco
SET test_osm=%test_region%.osm.pbf
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
%Configuration%\osrm-contract.exe %test_region%.osrm
unit_tests\%Configuration%\library-tests.exe %test_region%.osrm
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
ECHO ========= CREATING PACKAGES ==========
+1 -11
View File
@@ -3,9 +3,6 @@ environment:
- configuration: Release
# - configuration: Debug
install:
- ps: Install-Product node 6
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
@@ -20,14 +17,7 @@ platform: x64
build_script:
- CALL appveyor-build.bat
before_test:
- node --version
- npm --version
- npm install
- npm link
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
- SET OSRM_BUILD_DIR=build\%Configuration%
- npm test
test: off
artifacts:
- path: osrm_Release.zip
-44
View File
@@ -1,44 +0,0 @@
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
ENDIF()
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
SET(CPACK_STRIP_FILES "TRUE")
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
SET(CPACK_GENERATOR "DEB")
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
else(DPKG_PROGRAM)
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
if(RPMBUILD_PROGRAM)
SET(CPACK_GENERATOR "RPM")
execute_process(
COMMAND ${RPM_PROGRAM} --eval %{_arch}
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif(RPMBUILD_PROGRAM)
endif(DPKG_PROGRAM)
+41
View File
@@ -0,0 +1,41 @@
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
ENDIF()
INCLUDE(FindDebArch)
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
# To create a proper Debian/Ubuntu package, the following CMake
# options should be used:
SET(CPACK_STRIP_FILES "TRUE")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
+1 -7
View File
@@ -172,18 +172,12 @@ if (LUA_LIBRARY)
if (UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
# include dl library for statically-linked Lua library
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# For Windows and Mac, don't need to explicitly include the math library
else ()
set(LUA_LIBRARIES "${LUA_LIBRARY}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
+93
View File
@@ -0,0 +1,93 @@
# Locate Luabind library
# This module defines
# LUABIND_FOUND, if false, do not try to link to Luabind
# LUABIND_LIBRARIES
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
# First we try using EXACT but in some verison of
# cmake this would also match patch versions
FIND_PACKAGE(Lua 5.2 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
# Now fall back to a lua verison without exact
# in case this cmake version also forces patch versions
FIND_PACKAGE(Lua 5.2)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES luabind include/luabind include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local # DarwinPorts
/opt
)
FIND_LIBRARY(LUABIND_LIBRARY
NAMES luabind luabind09
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local
/opt
)
FIND_LIBRARY(LUABIND_LIBRARY_DBG
NAMES luabindd
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local
/opt
)
IF(LUABIND_LIBRARY)
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
ENDIF(LUABIND_LIBRARY)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
IF( NOT LUABIND_FIND_QUIETLY )
IF( LUABIND_FOUND )
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
ENDIF()
IF( LUABIND_LIBRARY_DBG )
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
ENDIF()
ENDIF()
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
-21
View File
@@ -1,21 +0,0 @@
# - Try to find Shapefile C Library
# http://shapelib.maptools.org/
#
# Exports:
# Shapefile_FOUND
# LIBSHAPEFILE_INCLUDE_DIR
# LIBSHAPEFILE_LIBRARY
# Hints:
# LIBSHAPEFILE_LIBRARY_DIR
find_path(LIBSHAPEFILE_INCLUDE_DIR
shapefil.h)
find_library(LIBSHAPEFILE_LIBRARY
NAMES shp
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Shapefile DEFAULT_MSG
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
+24
View File
@@ -0,0 +1,24 @@
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
set(NEWFILE ${OLDFILE}.tmp)
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
file(MD5 ${SOURCE_DIR}/src/storage/storage.cpp MD5OBJECTS)
CONFIGURE_FILE(${INFILE} ${NEWFILE})
file(MD5 ${NEWFILE} MD5NEW)
if (EXISTS ${OLDFILE})
file(MD5 ${OLDFILE} MD5OLD)
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
file(REMOVE_RECURSE ${OLDFILE})
file(RENAME ${NEWFILE} ${OLDFILE})
else()
file(REMOVE_RECURSE ${NEWFILE})
message(STATUS "Fingerprint unchanged, not regenerating")
endif()
else()
file(RENAME ${NEWFILE} ${OLDFILE})
endif()
+1 -1
View File
@@ -2,7 +2,7 @@ FROM ubuntu:14.04
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 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 libluabind-dev libboost-all-dev ccache
RUN apt-get -y install curl cmake cmake-curses-gui git
WORKDIR /opt
-1
View File
@@ -20,7 +20,6 @@ A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we pro
The initialisation to do so looks like this:
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
Make sure to give the guar a name, so it actually gets a lifetime.
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
+57 -103
View File
@@ -24,12 +24,11 @@ To pass parameters to each location some options support an array like encoding:
**Request options**
| Option | Values | Description |
|----------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
| Option | Values | Description |
|------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
Where the elements follow the following format:
@@ -56,14 +55,14 @@ Example: 2nd location use the default value for `option`:
```curl
# Query on Berlin with three coordinates:
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
# Using polyline:
curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'
```
### Responses
Every response object has a `code` property containing one of the strings below or a service dependent code:
Every response object has a `code` field containing one of the strings below or a service dependent code:
| Type | Description |
|-------------------|----------------------------------------------------------------------------------|
@@ -172,10 +171,10 @@ In addition to the [general options](#general-options) the following options are
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|steps |`true`, `false` (default) |Return route steps for each route leg |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
@@ -191,7 +190,7 @@ In case of error the following `code`s are supported in addition to the general
|-------------------|-----------------|
| `NoRoute` | No route found. |
All other properties might be undefined.
All other fields might be undefined.
#### Example Request
@@ -257,7 +256,7 @@ In case of error the following `code`s are supported in addition to the general
|-------------------|-----------------|
| `NoTable` | No route found. |
All other properties might be undefined.
All other fields might be undefined.
### Match service
@@ -275,7 +274,7 @@ In addition to the [general options](#general-options) the following options are
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|steps |`true`, `false` (default) |Return route steps for each route |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
@@ -307,66 +306,31 @@ In case of error the following `code`s are supported in addition to the general
|-------------------|---------------------|
| `NoMatch` | No matchings found. |
All other properties might be undefined.
All other fields might be undefined.
### Trip service
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints.
The returned path does not have to be the fastest path. As TSP is NP-hard it only returns an approximation.
Note that all input coordinates have to be connected for the trip service to work.
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 if the input coordinates can not be joined by a single trip (e.g. the coordinates are on several disconnected islands)
multiple trips for each connected component are returned.
```endpoint
GET /trip/v1/{profile}/{coordinates}?roundtrip={true|false}&source{any|first}&destination{any|last}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
GET /trip/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
```
In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description |
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|roundtrip |`true` (default), `false` |Return route is a roundtrip |
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|steps |`true`, `false` (default) |Return route instructions for each trip |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
**Fixing Start and End Points**
**Response**
It is possible to explicitely set the start or end coordinate of the trip.
When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
Right now, the following combinations are possible:
| roundtrip | source | destination | supported |
| :-- | :-- | :-- | :-- |
| true | first | last | **yes** |
| true | first | any | **yes** |
| true | any | last | **yes** |
| true | any | any | **yes** |
| false | first | last | **yes** |
| false | first | any | no |
| false | any | last | no |
| false | any | any | no |
#### Example Requests
```curl
# Round trip in Berlin with three stops:
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
```
```curl
# Round trip in Berlin with four stops, starting at the first stop, ending at the last:
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=last'
```
#### Response
- `code`: if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
- `trips_index`: Index to `trips` of the sub-trip the point was matched to.
- `waypoint_index`: Index of the point in the trip.
@@ -376,10 +340,9 @@ In case of error the following `code`s are supported in addition to the general
| Type | Description |
|-------------------|---------------------|
| `NoTrips` | No trips found because input coordinates are not connected.|
| `NotImplemented` | This request is not supported |
| `NoTrips` | No trips found. |
All other properties might be undefined.
All other fields might be undefined.
### Tile service
@@ -409,7 +372,7 @@ Vector tiles contain two layers:
`speeds` layer:
| Property | Type | Description |
| Field | Type | Description |
| ------------ | --------- | ---------------------------------------- |
| `speed` | `integer` | the speed on that road segment, in km/h |
| `is_small` | `boolean` | whether this segment belongs to a small (< 1000 node) [strongly connected component](https://en.wikipedia.org/wiki/Strongly_connected_component) |
@@ -419,7 +382,7 @@ Vector tiles contain two layers:
`turns` layer:
| Property | Type | Description |
| Field | Type | Description |
| ------------ | --------- | ---------------------------------------- |
| `bearing_in` | `integer` | the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East |
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
@@ -436,16 +399,14 @@ Represents a route through (potentially multiple) waypoints.
- `distance`: The distance traveled by the route, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds.
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` property for a parameter documentation.
- `weight`: The calculated weight of the route.
- `weight_name`: The name of the weight profile used during extraction phase.
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` field for a parameter documentation.
| overview | Description |
|------------|-----------------------------|
| simplified | Geometry is simplified according to the highest zoom level it can still be displayed on full. |
| full | Geometry is not simplified. |
| false | Geometry is not added. |
- `legs`: The legs between the given waypoints, an array of `RouteLeg` objects.
#### Example
@@ -456,8 +417,6 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
{
"distance": 90.0,
"duration": 300.0,
"weight": 300.0,
"weight_name": "duration",
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
"legs": [
{
@@ -482,16 +441,15 @@ Represents a route between two waypoints.
- `distance`: The distance traveled by this route leg, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds.
- `weight`: The calculated weight of the route leg.
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
| steps | |
|--------------|-----------------------------------------------------------------------|
| true | Names of the two major roads used. Can be empty if route is too short.|
| false | empty `string` |
- `steps`: Depends on the `steps` parameter.
| steps | |
|--------------|-----------------------------------------------------------------------|
| true | array of `RouteStep` objects describing the turn-by-turn instructions |
@@ -501,8 +459,8 @@ Represents a route between two waypoints.
| annotations | |
|--------------|-----------------------------------------------------------------------|
| true | An `Annotation` object containing node ids, durations distances and |
| false | weights `undefined` |
| true | An `Annotation` object containing node ids, durations and distances |
| false | `undefined` |
#### Example
@@ -512,14 +470,12 @@ With `steps=false` and `annotations=true`:
{
"distance": 30.0,
"duration": 100.0,
"weight": 100.0,
"steps": [],
"annotation": {
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
}
}
```
@@ -534,8 +490,6 @@ Annotation of the whole route leg with fine-grained information about each segme
- `duration`: The duration between each pair of coordinates, in seconds
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
- `weight`: The weights between each pair of coordinates
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
#### Example
@@ -544,8 +498,7 @@ Annotation of the whole route leg with fine-grained information about each segme
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"weight": [15,15,40,15,15]
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
}
```
@@ -561,7 +514,6 @@ step.
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds.
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
- `weight`: The calculated weight of the step.
| `geometry` | |
|------------|--------------------------------------------------------------------|
@@ -576,8 +528,6 @@ step.
- `mode`: A string signifying the mode of transportation.
- `maneuver`: A `StepManeuver` object representing the maneuver.
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
- `rotary_name`: The name for the rotary. Optionally included, if the step is a rotary and a rotary name is available.
- `rotary_pronunciation`: The pronunciation hint of the rotary name. Optionally included, if the step is a rotary and a rotary pronunciation is available.
#### Example
@@ -586,7 +536,6 @@ step.
"geometry" : "{lu_IypwpAVrAvAdI",
"mode" : "driving",
"duration" : 15.6,
"weight" : 15.6,
"intersections" : [
{ "bearings" : [ 10, 92, 184, 270 ],
"lanes" : [
@@ -628,12 +577,12 @@ step.
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
- `bearing_before`: The clockwise angle from true north to the
direction of travel immediately before the maneuver. Range 0-359.
direction of travel immediately before the maneuver.
- `bearing_after`: The clockwise angle from true north to the
direction of travel immediately after the maneuver. Range 0-359.
direction of travel immediately after the maneuver.
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
Types unknown to the client should be handled like the `turn` type, the existence of correct `modifier` values is guranteed.
Types unknown to the client should be handled like the `turn` type, the existance of correct `modifier` values is guranteed.
| `type` | Description |
|------------------|--------------------------------------------------------------|
| `turn` | a basic turn into direction of the `modifier` |
@@ -648,8 +597,8 @@ step.
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
| `use lane` | going straight on a specific lane |
| `continue` | Turn in direction of `modifier` to stay on the same road |
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |
| `roundabout` | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name/rotary_pronunciation` in addition to the `exit` parameter. |
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
@@ -657,7 +606,7 @@ step.
between all instructions. They only offer a fallback in case nothing else is to report.
- `modifier` An optional `string` indicating the direction change of the maneuver.
| `modifier` | Description |
|-------------------|-------------------------------------------|
| `uturn` | indicates reversal of direction |
@@ -668,18 +617,22 @@ step.
| `slight left` | a slight turn to the left |
| `left` | a normal turn to the left |
| `sharp left` | a sharp turn to the left |
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
The meaning depends on the `type` property.
The meaning depends on the `type` field.
| `type` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
- `exit` An optional `integer` indicating number of the exit to take. The property exists for the `roundabout` / `rotary` property:
Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout.
- `exit` An optional `integer` indicating number of the exit to take. The field exists for the following `type` field:
| `type` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `roundabout`/`rotary` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
@@ -691,7 +644,7 @@ A `Lane` represents a turn lane at the corresponding turn location.
**Properties**
- `indications`: a indication (e.g. marking on the road) specifying the turn lane. A road can have multiple indications (e.g. an arrow pointing straight and left). The indications are given in an array, each containing one of the following types. Further indications might be added on without an API version change.
| `value` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `none` | No dedicated indication is shown. |
@@ -703,7 +656,7 @@ A `Lane` represents a turn lane at the corresponding turn location.
| `slight left` | An indication indicating a slight left turn (i.e. slightly bend arrow). |
| `left` | An indication indicating a left turn (i.e. bend arrow). |
| `sharp left` | An indication indicating a sharp left turn (i.e. strongly bend arrow). |
- `valid`: a boolean flag indicating whether the lane is a valid choice in the current maneuver
#### Example
@@ -723,7 +676,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
**Properties**
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection.
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
`false` indicates that the turn onto the respective road would violate a restriction.
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
@@ -741,7 +694,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
"in":0,
"out":2,
"bearings":[60,150,240,330],
"entry":["false","true","true","true"],
"entry":["false","true","true","true"]
"lanes":{
"indications": ["left", "straight"],
"valid": "false"
@@ -757,6 +710,7 @@ Object used to describe waypoint on a route.
- `name` Name of the street the coordinate snapped to
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
- `distance` The distance of the snapped point from the original
- `hint` Unique internal identifier of the segment (ephemeral, not constant over data updates)
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
+1 -24
View File
@@ -1,6 +1,6 @@
# Testsuite
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing.
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucucmber.js for scenario driven testing.
## Unit Tests
@@ -28,29 +28,6 @@ This dataset is a small extract and may not even contain all tags or edge cases.
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
See the library tests for how to add new dataset dependent tests.
To prepare the test data simply `cd test/data/` and then run `make`.
### Running Tests
To build the unit tests:
```
cd build
cmake ..
make tests
```
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
```
./engine-tests
```
For `library-tests` you will need to provide a path to the test data:
```
./library-tests ../../test/data/monaco.osrm
```
## Cucumber
-15
View File
@@ -182,18 +182,3 @@ Feature: Bike - Access tags on ways
| bridleway | | yes | | x |
| bridleway | designated | | | |
| bridleway | | | | |
Scenario: Bike - Tram with oneway when access is implicit
Then routability should be
| highway | railway | access | oneway | bothw |
| residential | tram | | yes | x |
| service | tram | psv | yes | x |
Scenario: Bike - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | x |
| footway | permissive | x |
| garbagetag | permissive | x |
+3 -3
View File
@@ -44,8 +44,8 @@ Feature: Bicycle - Handle cycling
| efg | primary | | |
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 | 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 |
| e | c | 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 |
+3 -3
View File
@@ -64,6 +64,6 @@ Feature: Bike - Handle ferry routes
| abcd | | ferry | yes | 1:00 |
When I route I should get
| from | to | route | time |
| a | d | abcd,abcd | 3600s |
| d | a | abcd,abcd | 3600s |
| from | to | route | time |
| a | d | abcd,abcd | 3600s +-10 |
| d | a | abcd,abcd | 3600s +-10 |
+14 -14
View File
@@ -7,15 +7,15 @@ Feature: Bike - Max speed restrictions
Scenario: Bicycle - Respect maxspeeds when lower that way type speed
Then routability should be
| highway | maxspeed | bothw |
| residential | | 15 km/h |
| residential | 10 | 9 km/h |
| highway | maxspeed | bothw |
| residential | | 15 km/h +- 1 |
| residential | 10 | 10 km/h +- 1 |
Scenario: Bicycle - Ignore maxspeed when higher than way speed
Then routability should be
| highway | maxspeed | bothw |
| residential | | 15 km/h |
| residential | 80 | 15 km/h |
| highway | maxspeed | bothw |
| residential | | 15 km/h +- 1 |
| residential | 80 | 15 km/h |
@todo
Scenario: Bicycle - Maxspeed formats
@@ -63,14 +63,14 @@ Feature: Bike - Max speed restrictions
| snail | 720s ~10% |
Then routability should be
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
| | | | 15 km/h | 15 km/h |
| 10 | | | 9 km/h | 9 km/h |
| | 10 | | 9 km/h | 15 km/h |
| | | 10 | 14 km/h | 9 km/h |
| 2 | 10 | | 9 km/h | 2 km/h |
| 2 | | 10 | 2 km/h | 9 km/h |
| 2 | 5 | 10 | 5 km/h | 9 km/h |
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
| | | | 15 km/h +- 1 | 15 km/h +- 1 |
| 10 | | | 10 km/h +- 1 | 10 km/h +- 1 |
| | 10 | | 10 km/h +- 1 | 15 km/h +- 1 |
| | | 10 | 15 km/h | 10 km/h +- 1 |
| 2 | 10 | | 10 km/h +- 1 | 2 km/h |
| 2 | | 10 | 2 km/h | 10 km/h +- 1 |
| 2 | 5 | 10 | 5 km/h | 10 km/h +- 1 |
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
Then routability should be
+16 -17
View File
@@ -6,28 +6,27 @@ Feature: Bike - Surfaces
Scenario: Bicycle - Slow surfaces
Then routability should be
| highway | surface | bothw |
| cycleway | | 48 s |
| cycleway | asphalt | 48 s |
| cycleway | cobblestone:flattened | 72 s |
| cycleway | paving_stones | 72 s |
| cycleway | compacted | 72 s |
| cycleway | cobblestone | 120 s |
| cycleway | fine_gravel | 120 s |
| cycleway | gravel | 120 s |
| cycleway | pebblestone | 120.1 s |
| cycleway | dirt | 120 s |
| cycleway | earth | 120 s |
| cycleway | grass | 120 s |
| cycleway | mud | 240 s |
| cycleway | sand | 240.1 s |
| cycleway | sett | 72 s |
| highway | surface | bothw |
| cycleway | | 48 s |
| cycleway | asphalt | 47.9 s|
| cycleway | cobblestone:flattened | 72 s |
| cycleway | paving_stones | 72 s |
| cycleway | compacted | 72 s |
| cycleway | cobblestone | 120 s |
| cycleway | fine_gravel | 120 s |
| cycleway | gravel | 120 s |
| cycleway | pebblestone | 120 s |
| cycleway | dirt | 120 s |
| cycleway | earth | 120 s |
| cycleway | grass | 120 s |
| cycleway | mud | 240 s |
| cycleway | sand | 240 s |
Scenario: Bicycle - Good surfaces on small paths
Then routability should be
| highway | surface | bothw |
| cycleway | | 48 s |
| path | | 60 s |
| path | | 59.9 s|
| track | | 60 s |
| track | asphalt | 60 s |
| path | asphalt | 60 s |
+41 -112
View File
@@ -119,13 +119,12 @@ Feature: Car - Restricted access
| permissive | x |
| designated | x |
| no | |
| private | x |
| private | |
| agricultural | |
| forestry | |
| psv | |
| delivery | x |
| delivery | |
| some_tag | x |
| destination | x |
Scenario: Car - Access tags on nodes
@@ -135,11 +134,11 @@ Feature: Car - Restricted access
| permissive | x |
| designated | x |
| no | |
| private | x |
| private | |
| agricultural | |
| forestry | |
| psv | |
| delivery | x |
| delivery | |
| some_tag | x |
Scenario: Car - Access tags on both node and way
@@ -157,15 +156,15 @@ Feature: Car - Restricted access
Scenario: Car - Access combinations
Then routability should be
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
| runway | private | | | permissive | x | x | |
| primary | forestry | | yes | | x | x | |
| cycleway | | | designated | | x | x | |
| residential | | yes | no | | | | |
| motorway | yes | permissive | | private | x | | implied oneway |
| trunk | agricultural | designated | permissive | no | | | |
| pedestrian | | | | | | | |
| pedestrian | | | | destination | | | temporary disabled #3773 |
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
| runway | private | | | permissive | x |
| primary | forestry | | yes | | x |
| cycleway | | | designated | | x |
| residential | | yes | no | | |
| motorway | yes | permissive | | private | |
| trunk | agricultural | designated | permissive | no | |
| pedestrian | | | | | |
| pedestrian | | | | destination | x |
Scenario: Car - Ignore access tags for other modes
Then routability should be
@@ -180,45 +179,34 @@ Feature: Car - Restricted access
| primary | | | | no | x |
@hov
Scenario: Car - designated HOV ways are rated low
Scenario: Car - only designated HOV ways are ignored by default
Then routability should be
| highway | hov | bothw | forw_rate | backw_rate |
| primary | designated | x | 18 | 18 |
| primary | yes | x | 18 | 18 |
| primary | no | x | 18 | 18 |
# Models:
# https://www.openstreetmap.org/way/124891268
# https://www.openstreetmap.org/way/237173472
@hov
Scenario: Car - I-66 use HOV-only roads with heavy penalty
Then routability should be
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
| motorway | lane | | 3 | designated | yes | x | | 25 |
| highway | hov | bothw |
| primary | designated | |
| primary | yes | x |
| primary | no | x |
@hov
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
Scenario: Car - a way with all lanes HOV-designated is inaccessible by default (similar to hov=designated)
Then routability should be
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
| primary | designated | designated | | | x | x | 18 | 18 |
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
#| primary | | designated | | | x | x | 18 | 18 |
#| primary | designated | | | | x | x | 18 | 18 |
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
| primary | | | | | x | x | 18 | 18 |
| primary | designated | | | -1 | | x | | 18 |
| primary | | designated | | -1 | | x | | 18 |
| primary | | | designated | yes | x | | 18 | |
| primary | | | designated | -1 | | x | | 18 |
| primary | | | designated\| | yes | x | | 18 | |
| primary | | | designated\| | -1 | | x | | 18 |
| primary | | | designated\|designated | yes | x | | 18 | |
| primary | | | designated\|designated | -1 | | x | | 18 |
| primary | | | designated\|yes | yes | x | | 18 | |
| primary | | | designated\|no | -1 | | x | | 18 |
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw |
| primary | designated | designated | | | | |
| primary | | designated | | | x | |
| primary | designated | | | | | x |
| primary | designated\|designated | designated\|designated | | | | |
| primary | designated\|no | designated\|no | | | x | x |
| primary | yes\|no | yes\|no | | | x | x |
| primary | | | | | x | x |
| primary | designated | | | -1 | | x |
| primary | | designated | | -1 | | |
| primary | | | designated | yes | | |
| primary | | | designated | -1 | | |
| primary | | | designated\| | yes | x | |
| primary | | | designated\| | -1 | | x |
| primary | | | designated\|designated | yes | | |
| primary | | | designated\|designated | -1 | | |
| primary | | | designated\|yes | yes | x | |
| primary | | | designated\|no | -1 | | x |
Scenario: Car - these toll roads always work
Then routability should be
@@ -226,10 +214,12 @@ Feature: Car - Restricted access
| primary | no | x |
| primary | snowmobile | x |
Scenario: Car - toll=yes ways are enabled by default
# To test this we need issue #2781
@todo
Scenario: Car - only toll=yes ways are ignored by default
Then routability should be
| highway | toll | bothw |
| primary | yes | x |
| primary | yes | |
Scenario: Car - directional access tags
Then routability should be
@@ -242,64 +232,3 @@ Feature: Car - Restricted access
| primary | no | | yes | | x |
| primary | no | yes | | x | |
| primary | no | yes | yes | x | x |
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
Then routability should be
| node/barrier | access | bothw |
| gate | | x |
| gate | no | |
| gate | yes | x |
| gate | permissive | x |
| gate | designated | x |
| gate | private | x |
| gate | garbagetag | x |
Scenario: Car - a way with conditional access
Then routability should be
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
Scenario: Car - a way with a list of tags
Then routability should be
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw | # |
| primary | | no | destination | | x | |
| primary | destination;agricultural | destination | | x | x | |
| footway | | | destination | | | temporary #3373 |
| track | destination;agricultural | destination | | | x | temporary #3373 |
Scenario: Car - Don't route over steps even if marked as accessible
Then routability should be
| highway | access | forw | backw |
| steps | yes | | |
| steps | no | | |
| primary | | x | x |
Scenario: Car - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | |
| footway | permissive | x |
| garbagetag | permissive | x |
Scenario: Car - Access private blacklist
Then routability should be
| highway | access | bothw |
| footway | yes | x |
| pedestrian | private | |
| footway | private | |
| service | private | |
| cycleway | private | |
| track | private | |
Scenario: Car - Access blacklist
Then routability should be
| highway | access | bothw |
| primary | | x |
| primary | customer | |
| primary | emergency | |
| primary | forestry | |
| primary | agricultural | |
| primary | psv | |
| primary | no | |
+2 -2
View File
@@ -29,14 +29,14 @@ Feature: Car - Barriers
| gate | permissive | x |
| gate | designated | x |
| gate | no | |
| gate | private | x |
| gate | private | |
| gate | agricultural | |
| wall | | |
| wall | yes | x |
| wall | permissive | x |
| wall | designated | x |
| wall | no | |
| wall | private | x |
| wall | private | |
| wall | agricultural | |
Scenario: Car - Rising bollard exception for barriers
+2 -23
View File
@@ -29,27 +29,6 @@ Feature: Car - Handle driving
| c | f | cde,efg,efg | driving,driving,driving |
| c | g | cde,efg,efg | driving,driving,driving |
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
Given the node map
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | bridge |
| abc | primary | |
| cde | | movable |
| efg | primary | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
| c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
| e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
Scenario: Car - Properly handle durations
Given the node map
"""
@@ -66,7 +45,7 @@ Feature: Car - Handle driving
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 7 km/h |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 5 km/h |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 6 km/h |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 4 km/h |
| c | e | cde,cde | driving,driving | 2 km/h |
| e | c | cde,cde | driving,driving | 2 km/h |
+1 -51
View File
@@ -1,4 +1,4 @@
@routing @car @destination
@routing @car @destination @todo
Feature: Car - Destination only, no passing through
Background:
@@ -81,53 +81,3 @@ Feature: Car - Destination only, no passing through
| e | a | de,cd,bc,ab,ab |
| b | d | bc,cd,cd |
| d | b | cd,bc,bc |
Scenario: Car - Routing around a way that becomes destination only
Given the node map
"""
b
\
|
e++d++++++c--i
| \
\ h--a
\ |
\___________g
"""
And the ways
| nodes | access | oneway |
| ah | | no |
| ihg | | no |
| eg | | no |
| icde | | no |
| cde | destination | no |
| eb | | no |
When I route I should get
| from | to | route | # |
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
| b | d | eb,cde,cde | # ends in restricted way correctly |
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
Scenario: Car - Routing around a way that becomes destination only
Given the node map
"""
a---c---b
+ \
+ |
d |
\___e
"""
And the ways
| nodes | access | oneway |
| acbe | | no |
| cd | destination | no |
| de | | no |
When I route I should get
| from | to | route |
| e | a | acbe,acbe |
| d | a | de,acbe,acbe |
| c | d | cd,cd |
+10 -31
View File
@@ -29,27 +29,6 @@ Feature: Car - Handle ferry routes
| c | f | cde,efg,efg | ferry,driving,driving |
| c | g | cde,efg,efg | ferry,driving,driving |
Scenario: Car - Use default speeds to calculate duration if no duration given
Given the node map
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route |
| abc | primary | |
| cde | | ferry |
| efg | primary | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.4s |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
Scenario: Car - Properly handle simple durations
Given the node map
"""
@@ -65,11 +44,11 @@ Feature: Car - Handle ferry routes
| efg | primary | | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
| c | e | cde,cde | ferry,ferry | 11 km/h |
| e | c | cde,cde | ferry,ferry | 11 km/h |
Scenario: Car - Properly handle ISO 8601 durations
Given the node map
@@ -86,8 +65,8 @@ Feature: Car - Handle ferry routes
| efg | primary | | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
| c | e | cde,cde | ferry,ferry | 11 km/h |
| e | c | cde,cde | ferry,ferry | 11 km/h |
-36
View File
@@ -1,36 +0,0 @@
@routing @car @hov
Feature: Car - Handle driving
Background:
Given the profile "car"
And a grid size of 100 meters
Scenario: Car - Avoid hov when not on hov
Given the node map
"""
b=========c========================e====j
~ ~ ~
a ~ f----m
| i |
| | ----------------l
| | /
g_______________h______k_____n
"""
And the ways
| nodes | highway | hov |
| ab | motorway_link | |
| bcej | motorway | designated |
| ag | primary | |
| ghkn | primary | |
| ih | primary | |
| kl | secondary | |
| lf | secondary | |
| ci | motorway_link | |
| ef | motorway_link | |
| fm | secondary | |
When I route I should get
| from | to | route |
| a | m | ag,ghkn,kl,lf,fm,fm |
| c | m | bcej,ef,fm,fm |
+56 -59
View File
@@ -6,7 +6,7 @@ OSRM will use 4/5 of the projected free-flow speed.
Given the profile "car"
Given a grid size of 1000 meters
Scenario: Car - Respect maxspeeds when lower than way type speed
Scenario: Car - Respect maxspeeds when lower that way type speed
Given the node map
"""
a b c d e f g
@@ -23,7 +23,7 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get
| from | to | route | speed |
| a | b | ab,ab | 85 km/h |
| a | b | ab,ab | 68 km/h |
| b | c | bc,bc | 48 km/h |
| c | d | cd,cd | 40 km/h |
| d | e | de,de | 64 km/h |
@@ -37,30 +37,26 @@ OSRM will use 4/5 of the projected free-flow speed.
"""
And the ways
| nodes | highway | maxspeed | # |
| ab | residential | | default residential speed is 25 |
| bc | residential | 90 | |
| cd | living_street | FR:urban | |
| nodes | highway | maxspeed |
| ab | residential | |
| bc | residential | 90 |
| cd | living_street | FR:urban |
When I route I should get
| from | to | route | speed |
| a | b | ab,ab | 25 km/h |
# default residential speed is 25, don't mess with this
| a | b | ab,ab | 20 km/h |
| b | c | bc,bc | 72 km/h |
# parsed maxspeeds are scaled by profile's speed_reduction value
| c | d | cd,cd | 40 km/h |
# symbolic posted speeds without explicit exceptions are parsed
# from the profile's maxspeed_table_default table
Scenario: Car - Forward/backward maxspeed are scaled by profile's speed_reduction if explicitly set
Scenario: Car - Forward/backward maxspeed
Given a grid size of 100 meters
Then routability should be
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | 65 km/h | 65 km/h |
| primary | | | | 52 km/h | 52 km/h |
| primary | 60 | | | 48 km/h | 48 km/h |
| primary | | 60 | | 48 km/h | 65 km/h |
| primary | | | 60 | 65 km/h | 48 km/h |
| primary | | 60 | | 48 km/h | 48 km/h +- 5 |
| primary | | | 60 | 52 km/h | 52 km/h +- 5 |
| primary | 15 | 60 | | 48 km/h | 12 km/h |
| primary | 15 | | 60 | 12 km/h | 48 km/h |
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
@@ -85,55 +81,56 @@ OSRM will use 4/5 of the projected free-flow speed.
Scenario: Car - Too narrow streets should be ignored or incur a penalty
Then routability should be
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 |
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | | 52 km/h | 52 km/h |
| primary | | 3 | | | 32 km/h | 32 km/h |
| primary | 60 | | | | 47 km/h | 47 km/h |
| primary | 60 | 3 | | | 29 km/h | 29 km/h |
| primary | | | 60 | | 47 km/h | 52 km/h |
| primary | | 3 | 60 | | 29 km/h | 32 km/h |
| primary | | | | 60 | 52 km/h | 47 km/h |
| primary | | 3 | | 60 | 32 km/h | 29 km/h |
| primary | 15 | | 60 | | 47 km/h | 11 km/h |
| primary | 15 | 3 | 60 | | 29 km/h | 7 km/h |
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
| primary | 15 | 3 | | 60 | 7 km/h | 29 km/h |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
| primary | 15 | 3 | 30 | 60 | 14 km/h | 29 km/h |
Scenario: Car - Single lane streets be ignored or incur a penalty
Then routability should be
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 |
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | | 52 km/h | 52 km/h |
| primary | | 1 | | | 32 km/h | 32 km/h |
| primary | 60 | | | | 47 km/h | 47 km/h |
| primary | 60 | 1 | | | 29 km/h | 29 km/h |
| primary | | | 60 | | 47 km/h | 52 km/h |
| primary | | 1 | 60 | | 29 km/h | 32 km/h |
| primary | | | | 60 | 52 km/h | 47 km/h |
| primary | | 1 | | 60 | 32 km/h | 29 km/h |
| primary | 15 | | 60 | | 47 km/h | 11 km/h |
| primary | 15 | 1 | 60 | | 29 km/h | 7 km/h |
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
| primary | 15 | 1 | | 60 | 7 km/h | 29 km/h |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
| primary | 15 | 1 | 30 | 60 | 14 km/h | 29 km/h |
Scenario: Car - Single lane streets only incur a penalty for two-way streets
Scenario: Car - Single lane streets only incure a penalty for two-way streets
Then routability should be
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
| primary | 30 | 1 | yes | 23 km/h | | 7 | |
| primary | 30 | 1 | -1 | | 23 km/h | | 7 |
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 |
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 |
| highway | maxspeed | lanes | oneway | forw | backw |
| primary | 30 | 1 | yes | 23 km/h | |
| primary | 30 | 1 | -1 | | 23 km/h |
| primary | 30 | 1 | | 15 km/h | 15 km/h |
| primary | 30 | 2 | | 23 km/h | 23 km/h |
Scenario: Car - Forward/backward maxspeed on reverse oneways
Scenario: Car - Forwward/backward maxspeed on reverse oneways
Then routability should be
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
| primary | | | | -1 | | 64 km/h | | 18 |
| primary | 30 | | | -1 | | 23 km/h | | 7 |
| primary | | 30 | | -1 | | 64 km/h | | 18 |
| primary | | | 30 | -1 | | 23 km/h | | 7 |
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw |
| primary | | | | -1 | | 52 km/h |
| primary | 30 | | | -1 | | 23 km/h |
| primary | | 30 | | -1 | | 52 km/h |
| primary | | | 30 | -1 | | 23 km/h |
| primary | 20 | 30 | | -1 | | 16 km/h |
| primary | 20 | | 30 | -1 | | 23 km/h |
-16
View File
@@ -15,22 +15,6 @@ Feature: Car - Oneway streets
| highway | oneway | forw | backw |
| primary | -1 | | x |
Scenario: Car - Mode specific oneway
Then routability should be
| highway | oneway:motorcar | oneway:motor_vehicle | oneway:vehicle | oneway | forw | backw |
| primary | | | | | x | x |
| primary | yes | | | | x | |
| primary | | yes | | | x | |
| primary | | | yes | | x | |
| primary | | | | yes | x | |
| primary | yes | no | | | x | |
| primary | | yes | no | | x | |
| primary | | | yes | no | x | |
| primary | | | | yes | x | |
| primary | no | yes | | | x | x |
| primary | | no | yes | | x | x |
| primary | | | no | yes | x | x |
Scenario: Car - Implied oneways
Then routability should be
| highway | junction | forw | backw | # |
+7 -7
View File
@@ -4,11 +4,11 @@ Feature: Car - Surfaces
Background:
Given the profile "car"
Scenario: Car - Ways tagged service should reduce speed
Scenario: Car - Surface should reduce speed
Then routability should be
| highway | service | forw | backw | forw_rate |
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | emergency_access | | | |
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
| highway | service | forw | backw |
| service | alley | 5 km/h +-1 | 5 km/h +-1 |
| service | emergency_access | | |
| service | driveway | 5 km/h +-1 | 5 km/h +-1 |
| service | drive-through | 5 km/h +-1 | 5 km/h +-1 |
| service | parking | 5 km/h +-1 | 5 km/h +-1 |
+24 -40
View File
@@ -5,49 +5,33 @@ Feature: Car - speeds
Given the profile "car"
And a grid size of 1000 meters
# should more or less match default speeds in car profile, but may be different due to rounding errors
Scenario: Car - speed of various way types
Then routability should be
| highway | oneway | bothw |
| motorway | no | 89 km/h |
| motorway_link | no | 44 km/h |
| trunk | no | 85 km/h |
| trunk_link | no | 39 km/h |
| primary | no | 64 km/h |
| primary_link | no | 29 km/h |
| secondary | no | 55 km/h |
| secondary_link | no | 24 km/h |
| tertiary | no | 39 km/h |
| tertiary_link | no | 20 km/h |
| unclassified | no | 24 km/h |
| residential | no | 24 km/h |
| living_street | no | 9 km/h |
| service | no | 15 km/h |
| motorway | no | 71 km/h |
| motorway_link | no | 36 km/h |
| trunk | no | 68 km/h |
| trunk_link | no | 31 km/h |
| primary | no | 52 km/h |
| primary_link | no | 23 km/h |
| secondary | no | 44 km/h |
| secondary_link | no | 19 km/h |
| tertiary | no | 31 km/h |
| tertiary_link | no | 16 km/h |
| unclassified | no | 19 km/h |
| residential | no | 19 km/h |
| living_street | no | 8 km/h |
| service | no | 11 km/h |
# Alternating oneways scale rates but not speeds
# Alternating oneways have to take average waiting time into account.
Scenario: Car - scaled speeds for oneway=alternating
Then routability should be
| highway | oneway | junction | forw | backw | # |
| tertiary | | | 39 km/h | 39 km/h | |
| tertiary | alternating | | 39 km/h | 39 km/h | |
| motorway | | | 89 km/h | | implied oneway |
| motorway | alternating | | 89 km/h | | implied oneway |
| motorway | reversible | | | | unroutable |
| primary | | roundabout | 64 km/h | | implied oneway |
| primary | alternating | roundabout | 64 km/h | | implied oneway |
| primary | reversible | roundabout | | | unroutable |
Scenario: Car - Check roundoff errors
Then routability should be
| highway | maxspeed | forw | backw |
| primary | | 64 km/h | 64 km/h |
| primary | 60 | 47 km/h | 47 km/h |
| primary | 60 | 47 km/h | 47 km/h |
| primary | 60 | 47 km/h | 47 km/h |
Scenario: Car - Side road penalties
Then routability should be
| highway | side_road | forw | backw | forw_rate | backw_rate |
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
| highway | oneway | junction | forw | backw | # |
| tertiary | | | 31 km/h | 31 km/h | |
| tertiary | alternating | | 12 km/h +- 1 | 12 km/h +- 1 | |
| motorway | | | 71 km/h | | implied oneway |
| motorway | alternating | | 28 km/h +- 1 | | implied oneway |
| motorway | reversible | | | | unroutable |
| primary | | roundabout | 52 km/h | | implied oneway |
| primary | alternating | roundabout | 20 km/h +- 1 | | implied oneway |
| primary | reversible | roundabout | | | unroutable |
+49 -50
View File
@@ -40,13 +40,13 @@ Feature: Car - Surfaces
| highway | access | tracktype | smoothness | surface | forw | backw |
| motorway | | | | | x | |
| motorway | no | grade1 | excellent | asphalt | | |
| motorway | private | grade1 | excellent | asphalt | x | |
| motorway | private | grade1 | excellent | asphalt | | |
| motorway | agricultural | grade1 | excellent | asphalt | | |
| motorway | forestry | grade1 | excellent | asphalt | | |
| motorway | emergency | grade1 | excellent | asphalt | | |
| primary | | | | | x | x |
| primary | private | grade1 | excellent | asphalt | x | x |
| primary | no | grade1 | excellent | asphalt | | |
| primary | private | grade1 | excellent | asphalt | | |
| primary | agricultural | grade1 | excellent | asphalt | | |
| primary | forestry | grade1 | excellent | asphalt | | |
| primary | emergency | grade1 | excellent | asphalt | | |
@@ -64,65 +64,64 @@ Feature: Car - Surfaces
Scenario: Car - Surface should reduce speed
Then routability should be
| highway | oneway | surface | forw | backw |
| motorway | no | | 90 km/h | 90 km/h |
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 |
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | paved | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | cement | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | compacted | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | fine_gravel | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | grass | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | wood | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | sett | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | grass_paver | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | gravel | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | unpaved | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | ground | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | dirt | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | pebblestone | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | tartan | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | cobblestone | 30 km/h +-1 | 30 km/h +-1 |
| motorway | no | clay | 30 km/h +-1 | 30 km/h +-1 |
| motorway | no | earth | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | stone | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
| motorway | no | | 72 km/h | 72 km/h |
| motorway | no | asphalt | 72 km/h | 72 km/h +-1 |
| motorway | no | concrete | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | concrete:plates | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | concrete:lanes | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | paved | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | cement | 64 km/h +-1 | 64 km/h +-1 |
| motorway | no | compacted | 64 km/h +-1 | 64 km/h +-1 |
| motorway | no | fine_gravel | 64 km/h +-1 | 64 km/h +-1 |
| motorway | no | paving_stones | 48 km/h +-1 | 48 km/h +-1 |
| motorway | no | metal | 48 km/h +-1 | 48 km/h +-1 |
| motorway | no | bricks | 48 km/h +-1 | 48 km/h +-1 |
| motorway | no | grass | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | wood | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | sett | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | grass_paver | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | gravel | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | unpaved | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | ground | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | dirt | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | pebblestone | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | tartan | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | cobblestone | 24 km/h +-1 | 24 km/h +-1 |
| motorway | no | clay | 24 km/h +-1 | 24 km/h +-1 |
| motorway | no | earth | 16 km/h +-1 | 16 km/h +-1 |
| motorway | no | stone | 16 km/h +-1 | 16 km/h +-1 |
| motorway | no | rocky | 16 km/h +-1 | 16 km/h +-1 |
| motorway | no | sand | 16 km/h +-1 | 16 km/h +-1 |
Scenario: Car - Tracktypes should reduce speed
Then routability should be
| highway | oneway | tracktype | forw | backw |
| motorway | no | | 90 km/h | 90 km/h |
| motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | grade2 | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | grade3 | 30 km/h +-1 | 30 km/h +-1 |
| motorway | no | grade4 | 25 km/h +-1 | 25 km/h +-1 |
| motorway | no | grade5 | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | | 72 km/h | 72 km/h |
| motorway | no | grade1 | 48 km/h +-1 | 48 km/h +-1 |
| motorway | no | grade2 | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | grade3 | 24 km/h +-1 | 24 km/h +-1 |
| motorway | no | grade4 | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | grade5 | 16 km/h +-1 | 16 km/h +-1 |
Scenario: Car - Smoothness should reduce speed
Then routability should be
| highway | oneway | smoothness | forw | backw |
| motorway | no | | 90 km/h | 90 km/h |
| motorway | no | intermediate | 80 km/h | 80 km/h |
| motorway | no | bad | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | very_bad | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | horrible | 10 km/h +-1 | 10 km/h +-1 |
| motorway | no | very_horrible | 5 km/h +-1 | 5 km/h +-1 |
| motorway | no | | 72 km/h | 72 km/h |
| motorway | no | intermediate | 64 km/h | 64 km/h |
| motorway | no | bad | 32 km/h +-1 | 32 km/h +-1 |
| motorway | no | very_bad | 16 km/h +-1 | 16 km/h +-1 |
| motorway | no | horrible | 8 km/h +-1 | 8 km/h +-1 |
| motorway | no | very_horrible | 4 km/h +-1 | 4 km/h +-1 |
Scenario: Car - Combination of surface tags should use lowest speed
Then routability should be
| highway | oneway | tracktype | surface | smoothness | bothw |
| motorway | no | | | | 90 km/h |
| service | no | grade1 | asphalt | excellent | 15 km/h |
| motorway | no | grade5 | asphalt | excellent | 20 km/h |
| motorway | no | grade1 | mud | excellent | 10 km/h |
| motorway | no | grade1 | asphalt | very_horrible | 5 km/h |
| service | no | grade5 | mud | very_horrible | 5 km/h |
| highway | oneway | tracktype | surface | smoothness | backw | forw |
| motorway | no | | | | 72 km/h | 72 km/h |
| service | no | grade1 | asphalt | excellent | 12 km/h | 12 km/h |
| motorway | no | grade5 | asphalt | excellent | 16 km/h | 16 km/h |
| motorway | no | grade1 | mud | excellent | 8 km/h | 8 km/h |
| motorway | no | grade1 | asphalt | very_horrible | 4 km/h | 4 km/h |
| service | no | grade5 | mud | very_horrible | 4 km/h | 4 km/h |
Scenario: Car - Surfaces should not affect oneway direction
Then routability should be
+127
View File
@@ -0,0 +1,127 @@
@routing @speed @traffic
Feature: Traffic - speeds
Background: Use specific speeds
Scenario: Weighting based on speed file
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,27
4,1,27
"""
And I route I should get
| from | to | route | speed |
| a | b | ad,de,eb,eb | 30 km/h |
| a | c | ad,dc,dc | 31 km/h |
| b | c | bc,bc | 27 km/h |
| a | d | ad,ad | 27 km/h |
| d | c | dc,dc | 36 km/h |
| g | b | fb,fb | 36 km/h |
| a | g | ad,df,fb,fb | 30 km/h |
Scenario: Speeds that isolate a single node (a)
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
| h | 2.075 | 19.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,0
4,1,0
"""
And I route I should get
| from | to | route | speed |
| a | b | fb,fb | 36 km/h |
| a | c | fb,bc,bc | 30 km/h |
| b | c | bc,bc | 27 km/h |
| a | d | fb,df,df | 36 km/h |
| d | c | dc,dc | 36 km/h |
| g | b | fb,fb | 36 km/h |
| a | g | fb,fb | 36 km/h |
Scenario: Verify that negative values cause an error, they're not valid at all
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
| h | 1.075 | 10.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the speed file
"""
1,2,-10
2,1,-20
2,3,27
3,2,27
1,4,-3
4,1,-5
"""
And the data has been extracted
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
And stderr should contain "malformed"
And it should exit with an error
+36 -42
View File
@@ -52,23 +52,23 @@ Feature: Traffic - turn penalties
Scenario: Weighting not based on turn penalty file
When I route I should get
| from | to | route | speed | weight | time |
| a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 |
# straight
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
# right
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
# left
| c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
# straight-right
| a | l | ad,dhk,klm,klm | 53 km/h | 27s +-1 | 27s +-1 |
# straight-left
| l | e | klm,dhk,def,def | 55 km/h | 26s +-1 | 26s +-1 |
# double right
| g | n | fg,fim,mn,mn | 44 km/h | 32s +-1 | 32s +-1 |
# double left
| from | to | route | speed | time |
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
# straight
| i | g | fim,fg,fg | 45 km/h | 16s +-1 |
# right
| a | e | ad,def,def | 38 km/h | 19s +-1 |
# left
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 48 km/h | 29s +-1 |
# straight-right
| a | l | ad,dhk,klm,klm | 44 km/h | 33s +-1 |
# straight-left
| l | e | klm,dhk,def,def | 45 km/h | 32s +-1 |
# double right
| g | n | fg,fim,mn,mn | 38 km/h | 38s +-1 |
# double left
Scenario: Weighting based on turn penalty file
Given the turn penalty file
@@ -80,33 +80,27 @@ Feature: Traffic - turn penalties
8,11,12,23
1,4,5,-0.2
"""
# ifg right turn
# imn left turn
# hdc left turn
# lkh right turn
# hkl left turn
# ade left turn
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get
| from | to | route | speed | weight | time |
| a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 |
# straight
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
# right - ifg penalty
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
# left - faster because of negative ade penalty
| c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
# straight-right - ifg penalty
| a | l | ad,def,fim,klm,klm | 58 km/h | 37 | 37s +-1 |
# was straight-left - forced around by hkl penalty
| l | e | klm,fim,def,def | 44 km/h | 32.6 | 32s +-1 |
# double right - forced left by lkh penalty
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
# double left - imn penalty
| 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
| from | to | route | speed | time |
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
# straight
| i | g | fim,fg,fg | 46 km/h | 15s +-1 |
# right - ifg penalty
| a | e | ad,def,def | 53 km/h | 14s +-1 |
# left - faster because of negative ade penalty
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 49 km/h | 29s +-1 |
# straight-right - ifg penalty
| a | l | ad,def,fim,klm,klm | 48 km/h | 45s +-1 |
# was straight-left - forced around by hkl penalty
| l | e | klm,fim,def,def | 38 km/h | 38s +-1 |
# double right - forced left by lkh penalty
| g | n | fg,fim,mn,mn | 25 km/h | 57s +-1 |
# double left - imn penalty
| j | c | jk,klm,fim,def,cd,cd | 44 km/h | 65.8s +-1 |
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
Scenario: Too-negative penalty clamps, but does not fail
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
-63
View File
@@ -1,63 +0,0 @@
@routing @car @weight
Feature: Car - weights
Background: Use specific speeds
Given the profile "car"
Scenario: Only routes down service road when that's the destination
Given the node map
"""
a--b--c
|
d
|
e--f--g
"""
And the ways
| nodes | highway |
| abc | residential |
| efg | residential |
| cg | tertiary |
| bdf | service |
When I route I should get
| from | to | route | speed | weight |
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
Scenario: Does not jump off the highway to go down service road
Given the node map
"""
a
|
b
|\
| e
|/
c
|
d
"""
And the nodes
| node | id |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
| e | 5 |
And the ways
| nodes | highway | oneway |
| ab | primary | yes |
| bc | primary | yes |
| cd | primary | yes |
| be | service | yes |
| ec | service | yes |
And the extract extra arguments "--generate-edge-lookup"
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the speed file
"""
2,5,8
"""
When I route I should get
| from | to | route | speed | weight |
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
| a | e | ab,be,be | 14 km/h | 112 |
-14
View File
@@ -103,17 +103,3 @@ Feature: Foot - Access tags on ways
| bridleway | | yes | | |
| bridleway | designated | | | |
| bridleway | | | | |
Scenario: Foot - a way with missing :forward tag
Then routability should be
| highway | bicycle:backward | foot:backward | forw | backw |
| cycleway | designated | designated | | x |
Scenario: Foot - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | x |
| footway | permissive | x |
| garbagetag | permissive | x |
+3 -3
View File
@@ -64,6 +64,6 @@ Feature: Foot - Handle ferry routes
| abcd | | ferry | yes | 1:00 |
When I route I should get
| from | to | route | time |
| a | d | abcd,abcd | 3600s |
| d | a | abcd,abcd | 3600s |
| from | to | route | time |
| a | d | abcd,abcd | 3600s +-10 |
| d | a | abcd,abcd | 3600s +-10 |
+34 -34
View File
@@ -124,10 +124,10 @@ Feature: Turn Lane Guidance
Given the node map
"""
g f
| |
j --- h - e
| |
a --- b - c
j h e
a b c
i d
"""
@@ -154,21 +154,21 @@ Feature: Turn Lane Guidance
Given the node map
"""
g j
| |
| |
| |
| |
| |
| |,f
|,e
,d |
a --------- b c |
/ | |
/ | |
/ | |
| | |
| | |
| | |
f
e
d
a b c
l h i
"""
@@ -202,21 +202,21 @@ Feature: Turn Lane Guidance
Given the node map
"""
g j
| |
| |
| |
| |
| |
| |,f
|,e
,d |
a --------- b c |
/ | |
/ | |
/ | |
| | |
| | |
| | |
f
e
d
a b c
l h i
"""
@@ -818,37 +818,3 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
@anticipate
Scenario: Don't Overdo It
Given the node map
"""
q r s t u v
| | | | | |
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
| | | | | | |
p o n m l k j
"""
And the ways
| nodes | name | turn:lanes:forward | oneway |
| ab | road | left\|\|\| | yes |
| bc | road | left\|\|\| | yes |
| cd | road | left\|\|\| | yes |
| de | road | left\|\|\| | yes |
| ef | road | left\|\|\| | yes |
| fg | road | left\|\|\| | yes |
| gh | road | \|\|right | yes |
| hi | road | | yes |
| qbp | 1st | | no |
| rco | 2nd | | no |
| sdn | 3rd | | no |
| tem | 4th | | no |
| ufl | 5th | | no |
| vgk | 6th | | no |
| hj | 7th | | no |
When I route I should get
| waypoints | route | turns | locations | lanes |
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
-17
View File
@@ -50,20 +50,3 @@ Feature: Features related to bugs
And the data has been saved to disk
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
Then it should exit successfully
@3418
Scenario: Bearings should be between 0-359
Given the node locations
| node | lon | lat |
| a | -122.0232176 | 37.3282203 |
| b | -122.0232199 | 37.3302422 |
| c | -122.0232252 | 37.3312787 |
And the ways
| nodes | name | highway |
| ab | Pear to Merrit | residential |
| bc | Merritt to Apricot | residential |
When I route I should get
| waypoints | route | intersections |
| a,c | Pear to Merrit,Merritt to Apricot,Merritt to Apricot | true:0;true:0 false:180;true:180 |
-162
View File
@@ -1,162 +0,0 @@
@routing @guidance @collapsing
Feature: Collapse
Background:
Given the profile "car"
Given a grid size of 20 meters
Scenario: Collapse Steps While On Ferry
Given the node map
"""
j----a---c---b----k
~ ~ ~
~ ~ ~
~~~
d
~
~
~
e --- f
"""
And the ways
| nodes | highway | route | name |
| jacbk | primary | | land |
| ad | | ferry | sea |
| bd | | ferry | sea |
| cd | | ferry | sea |
| de | | ferry | sea |
| ef | primary | | pennydog-island |
When I route I should get
| waypoints | route | turns | modes | locations |
| f,j | pennydog-island,sea,land,land | depart,notification right,turn left,arrive | driving,ferry,driving,driving | f,e,b,j |
Scenario: Switching Ferry in a Harbour
Given the node map
"""
d
|
|
|
e - a ~ ~ ~ ~ b
~
~
~
c
|
f
"""
And the ways
| nodes | highway | route | name |
| ea | primary | | melee-island |
| ab | | ferry | melee-island-ferry |
| cf | primary | | monkey-island |
| bd | primary | | scabb-island |
| bc | primary | ferry | monkey-island-ferry |
When I route I should get
| waypoints | route | turns | modes |
| e,f | melee-island,melee-island-ferry,monkey-island-ferry,monkey-island,monkey-island | depart,notification straight,turn right,notification straight,arrive | driving,ferry,ferry,driving,driving |
Scenario: End of Road Ferries
Given the node map
"""
a - b ~ ~ ~ ~ c ~ ~ ~ ~ ~ d - e
~
~
~
~
~
~
~
f
|
g
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | land-left |
| de | primary | | land-right |
| gf | primary | | land-bottom |
| bcd | | ferry | ferry |
| fc | | ferry | ferry |
When I route I should get
| waypoints | route | turns |
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification straight,arrive |
Scenario: Fork Ferries
Given the node map
"""
a - b d - e
~ ~
~ ~
~ ~
~ ~
c
~
~
~
f
|
g
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | land-left |
| de | primary | | land-right |
| gf | primary | | land-bottom |
| cb | | ferry | ferry |
| cd | | ferry | ferry |
| fc | | ferry | ferry |
When I route I should get
| waypoints | route | turns |
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification right,arrive |
@negative
Scenario: Don't Detect Suppressed/Obvious Forks on Ferries
Given the node map
"""
. . . . . . . . .d
a - b ~ ~ ~ ~ ~ c <
' ' ' ' ' ' ' ' 'e
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | cursed-island |
| bc | | ferry | beagle |
| cd | service | | forker |
| ce | primary | | screw-me-not |
#the turns here could be better, but intersection classification shows you if you go left or right. But we cannot fork here
When I route I should get
| waypoints | route | turns |
| a,d | cursed-island,beagle,forker,forker | depart,notification straight,turn straight,arrive |
| a,e | cursed-island,beagle,screw-me-not,screw-me-not | depart,notification straight,turn straight,arrive |
@uturn @dead-end @ferry @via
Scenario: U-Turn on a dead-end ferry
Given the node map
"""
a - 1 - b ~ ~ ~ ~ ~ ~ ~ c
"""
And the ways
| nodes | highway | route | name |
| ab | primary | | land |
| bc | | ferry | sea |
# we actually cannot check the route here, since two possible routes are equally valid:
# (ab)(bcb1) and (abcb)(b1) are exactly the same. Luckily, we only want to check for
# not asserting here.
When I route I should get
| waypoints |
| a,b,1 |
+69 -79
View File
@@ -143,33 +143,37 @@ Feature: Collapse
Scenario: Partly Segregated Intersection, Two Segregated Roads
Given the node map
"""
n m
| |
| |
| |
| |
| |
g h
c - b - a
d - e - f
j i
| |
| |
| |
| |
| |
k l
n m
g h
c b a
d e f
j i
k l
"""
And the ways
| nodes | highway | name | oneway | lanes |
| ab | primary | first | yes | |
| bc | primary | first | yes | |
| de | primary | first | yes | |
| ef | primary | first | yes | |
| be | primary | first | no | |
| ngbhm | primary | second | yes | 5 |
| liejk | primary | second | yes | 5 |
| nodes | highway | name | oneway |
| ab | primary | first | yes |
| bc | primary | first | yes |
| de | primary | first | yes |
| ef | primary | first | yes |
| be | primary | first | no |
| ngbhm | primary | second | yes |
| liejk | primary | second | yes |
When I route I should get
| waypoints | route | turns |
@@ -193,37 +197,33 @@ Feature: Collapse
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
Given the node map
"""
n m
| |
| |
| |
| |
| |
| |
g h
\ /
c - b - a
d - e - f
/ \
j i
| |
| |
| |
| |
| |
| |
k l
n m
g h
c b a
d e f
j i
k l
"""
And the ways
| nodes | highway | name | oneway | lanes |
| ab | primary | first | yes | |
| bc | primary | first | yes | |
| de | primary | first | yes | |
| ef | primary | first | yes | |
| be | primary | second | no | |
| ngbhm | primary | second | yes | 5 |
| liejk | primary | second | yes | 5 |
| nodes | highway | name | oneway |
| ab | primary | first | yes |
| bc | primary | first | yes |
| de | primary | first | yes |
| ef | primary | first | yes |
| be | primary | second | no |
| ngbhm | primary | second | yes |
| liejk | primary | second | yes |
When I route I should get
| waypoints | route | turns |
@@ -353,13 +353,13 @@ Feature: Collapse
| ge | primary | second | no |
When I route I should get
| waypoints | route | turns |
| d,c | first,first,first | depart,continue uturn,arrive |
| a,f | first,first,first | depart,continue uturn,arrive |
| a,g | first,second,second | depart,turn left,arrive |
| d,g | first,second,second | depart,turn right,arrive |
| g,f | second,first,first | depart,turn right,arrive |
| g,c | second,first,first | depart,end of road left,arrive |
| waypoints | route | turns |
| d,c | first,first,first | depart,continue uturn,arrive |
| a,f | first,first,first | depart,continue uturn,arrive |
| a,g | first,second,second | depart,turn left,arrive |
| d,g | first,second,second | depart,turn right,arrive |
| g,f | second,first,first | depart,turn right,arrive |
| g,c | second,first,first | depart,turn left,arrive |
Scenario: Do not collapse turning roads
Given the node map
@@ -425,28 +425,18 @@ Feature: Collapse
Scenario: Pankenbruecke
Given the node map
"""
k j
| |
| |
| |
a h
b
c
d
e
f-i
|
|
|
g
j h i
b c d e f g
k a
"""
And the ways
| nodes | highway | name | oneway | lanes |
| kabhj | primary | inroad | yes | 4 |
| bc | primary | inroad | no | |
| cd | primary | bridge | no | |
| defg | primary | outroad | no | |
| fi | primary | cross | no | |
| nodes | highway | name | oneway |
| kabhj | primary | inroad | yes |
| bc | primary | inroad | no |
| cd | primary | bridge | no |
| defg | primary | outroad | no |
| fi | primary | cross | no |
When I route I should get
| waypoints | route | turns |
+15 -15
View File
@@ -9,7 +9,7 @@ Feature: Continue Instructions
Given the node map
"""
c
a - b-d
a b d
"""
And the ways
@@ -26,7 +26,7 @@ Feature: Continue Instructions
Given the node map
"""
c
a - b-d
a b d
"""
And the ways
@@ -43,7 +43,7 @@ Feature: Continue Instructions
Given the node map
"""
c
a - b-d
a b d
e
"""
@@ -62,7 +62,7 @@ Feature: Continue Instructions
Scenario: Road turning right
Given the node map
"""
a - b-d
a b d
c
"""
@@ -80,9 +80,9 @@ Feature: Continue Instructions
Given the node map
"""
c
/
a - b
`d
a b
d
"""
And the ways
@@ -98,9 +98,9 @@ Feature: Continue Instructions
Scenario: Road turning slight right
Given the node map
"""
,d
a - b
\
d
a b
c
"""
@@ -117,11 +117,11 @@ Feature: Continue Instructions
Scenario: Road Loop
Given the node map
"""
f - e
| |
a - b-g |
| |
c - d
f e
a b g
c d
"""
And the ways
+118 -228
View File
@@ -9,13 +9,13 @@ Feature: Slipways and Dedicated Turn Lanes
Given the node map
"""
e
a b-----c-d
`--h |
||
1||
||
`f
|
a b . . c d
`h .
`
1 `
.
f
.
g
"""
@@ -36,81 +36,16 @@ Feature: Slipways and Dedicated Turn Lanes
| a,g | first,second,second | depart,turn right,arrive |
| a,1 | first,, | depart,turn right,arrive |
Scenario: Turn Instead of Ramp
Given the node map
"""
e
a b-----c-d
`--h |
||
1||
||
`f
|
g
"""
And the ways
| nodes | highway | name | oneway | route |
| abc | trunk | first | yes | |
| cd | trunk | first | yes | |
| bhf | trunk_link | | yes | ferry |
| cfg | primary | second | yes | |
| ec | primary | second | yes | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | cfg | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,g | first,,second,second | depart,turn right,turn straight,arrive |
Scenario: Turning Sliproad onto a ferry
Given the node map
"""
e
a b-----c-d
`--h |
||
1||
||
`f
|
g
|
i
"""
And the ways
| nodes | highway | name | oneway | route |
| abc | trunk | first | | |
| cd | trunk | first | | |
| bhf | trunk_link | | yes | |
| cf | primary | second | yes | |
| fg | primary | second | yes | ferry |
| ec | primary | second | yes | |
| gi | primary | second | yes | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | cf | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,i | first,,second,second,second | depart,turn right,turn straight,notification straight,arrive |
| a,1 | first,, | depart,turn right,arrive |
Scenario: Turn Instead of Ramp - Max-Speed
Given the node map
"""
e
a-b-----c-------------------------d
`--h |
`h |
||
1||
||
`f
`|
f
|
g
"""
@@ -137,20 +72,18 @@ Feature: Slipways and Dedicated Turn Lanes
Given the node map
"""
e
|
a-b-----c--d
`--h
\|
|
|
|
|
|
|
a b c d
h
f
|
|
g
"""
@@ -168,16 +101,14 @@ Feature: Slipways and Dedicated Turn Lanes
Given the node map
"""
e
|
a-b-----c-d
`--h
\|
|
|
a b c d
h
f
|
|
g
"""
@@ -194,15 +125,15 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Inner city expressway with on road
Given the node map
"""
a b-------c-g
`--f |
\|
|
|
a b . . . c g
`f .
`
.
.
d
|
|
|
.
.
.
e
"""
@@ -226,12 +157,12 @@ Feature: Slipways and Dedicated Turn Lanes
Given the node map
"""
a f
| |
b e
|\ /|
| | |
| g |
| |
g
c d
"""
@@ -249,11 +180,11 @@ Feature: Slipways and Dedicated Turn Lanes
Given the node map
"""
a f
| |
b e
|\g/|
| |
| |
g
c d
"""
@@ -350,23 +281,23 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Self-Loop
Given the node map
"""
/-l-----k---\
/ `j--
m \
/ i
/ \
| \
| h
| |
n |
| |
| g
o |
/ /
| f
/- p /
/ e
a ------- b --------------- c ----------------- d ---/
l k
j
m
i
h
n
g
o
f
p
e
a b c d
"""
And the ways
@@ -385,23 +316,23 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Self-Loop - Bidirectional
Given the node map
"""
/-l-----k---\
/ `j--
m \
/ i
/ \
| \
| h
| |
n |
| |
| g
o |
/ /
| f
/- p /
/ e
a ------- b --------------- c ----------------- d ---/
l k
j
m
i
h
n
g
o
f
p
e
a b c d
"""
And the ways
@@ -418,30 +349,31 @@ Feature: Slipways and Dedicated Turn Lanes
Given the node map
"""
j
a-b ----------------------------------------- c ------------d
\ |
\ |
\ |
\ |
\ |
e |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ 1
`---------- f ------- g ----------\
| \
a b c d
e
1
f g
i h
"""
@@ -466,20 +398,20 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Turn Instead of Ramp
Given the node map
"""
/--------------------f
g-----------h--\ |
d-----e
i c-----------j--/
| |
| |
| |
| |
| |
\ /
\ /
\ /
f
g h
d e
i c j
b
|
a
"""
@@ -851,48 +783,6 @@ Feature: Slipways and Dedicated Turn Lanes
| waypoints | route | turns |
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
@sliproads:
Scenario: Throughabout-Sliproad
Given the node map
"""
t
|
- - e - -
/ \
| |
| |
z - s - a - - - - - - - b - - -x
' c y
| |
\ /
- -d - -
"""
And the ways
| nodes | name | highway | oneway | junction | # |
| zs | through | trunk | yes | | |
| sa | through | trunk | yes | | |
| ab | through | trunk | yes | | |
| bx | through | trunk | yes | | |
| ac | round | primary | yes | roundabout | |
| cdy | round | primary | yes | roundabout | |
| yb | round | primary | yes | roundabout | |
| be | round | primary | yes | roundabout | |
| ea | round | primary | yes | roundabout | |
| et | out | primary | yes | | the extraterrestrial |
| sc | | trunk_link | yes | | |
| yx | right | trunk_link | yes | | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sa | ab | a | only_straight |
| restriction | ab | bx | b | only_straight |
| restriction | yb | be | b | only_straight |
When I route I should get
| waypoints | route | turns | locations |
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
Scenario: Sliproad before a roundabout
Given the node map
"""
@@ -922,7 +812,7 @@ Feature: Slipways and Dedicated Turn Lanes
| bfm | | yes | primary | |
| gld | | yes | primary | |
And the relations
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bc | cd | c | only_straight |
+20 -26
View File
@@ -16,34 +16,28 @@ Feature: Destination Signs
m n
o p
q r
s t
u v
"""
And the ways
| nodes | name | ref | destination | destination:ref | destination:street | oneway | # |
| ab | AB | E1 | | | | yes | |
| cd | CD | | Berlin | | | yes | |
| ef | EF | | Berlin | A1 | | yes | |
| gh | | | Berlin | A1 | | yes | |
| ij | | | Berlin | | | yes | |
| kl | KL | E1 | Berlin | A1 | | yes | |
| mn | MN | | Berlin;Hamburg | A1;A2 | | yes | |
| op | OP | | Berlin;Hamburg | A1;A2 | | no | mis-tagged destination: not a oneway |
| qr | QR | | | A1;A2 | | yes | |
| st | ST | | | | St Street | yes | |
| uv | UV | | Berlin | | St Street | yes | |
| nodes | name | ref | destination | destination:ref | oneway | # |
| ab | AB | E1 | | | yes | |
| cd | CD | | Berlin | | yes | |
| ef | EF | | Berlin | A1 | yes | |
| gh | | | Berlin | A1 | yes | |
| ij | | | Berlin | | yes | |
| kl | KL | E1 | Berlin | A1 | yes | |
| mn | MN | | Berlin;Hamburg | A1;A2 | yes | |
| op | OP | | Berlin;Hamburg | A1;A2 | no | mis-tagged destination: not a oneway |
| qr | QR | | | A1;A2 | yes | |
When I route I should get
| from | to | route | destinations | ref | # |
| a | b | AB,AB | , | E1,E1 | |
| c | d | CD,CD | Berlin,Berlin | , | |
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
| g | h | , | A1: Berlin,A1: Berlin | , | |
| i | j | , | Berlin,Berlin | , | |
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
| o | p | OP,OP | , | , | guard against mis-tagging |
| q | r | QR,QR | A1, A2,A1, A2 | , | |
| s | t | ST,ST | St Street,St Street | , | |
| u | v | UV,UV | Berlin,Berlin | , | city preferred over street |
| from | to | route | destinations | ref | # |
| a | b | AB,AB | , | E1,E1 | |
| c | d | CD,CD | Berlin,Berlin | , | |
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
| g | h | , | A1: Berlin,A1: Berlin | , | |
| i | j | , | Berlin,Berlin | , | |
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
| o | p | OP,OP | , | , | guard against mis-tagging |
| q | r | QR,QR | A1, A2,A1, A2 | , | |
@@ -36,4 +36,4 @@ Feature: Destination Signs
| h | g | GH,GH | A2: Hamburg,A2: Hamburg | , | |
| i | j | IJ,IJ | A1: Berlin,A1: Berlin | , | |
| l | k | KL,KL | A2: Hamburg,A2: Hamburg | , | |
| m | n | MN,MN | , | , | guard against mis-tagging |
| m | n | MN,MN | , | , | guard against mis-tagging |
-38
View File
@@ -24,44 +24,6 @@ Feature: End Of Road Instructions
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
@3605
Scenario: End of Road with oneway through street
Given the node map
"""
c
a e b
f d
"""
And the ways
| nodes | highway | oneway |
| aeb | primary | no |
| cbd | primary | yes |
| ef | primary | no |
When I route I should get
| waypoints | route | turns |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
@3605
Scenario: End of Road fromnameless onto through street
Given the node map
"""
c
a e b
f d
"""
And the ways
| nodes | highway | oneway | name |
| aeb | primary | no | |
| cbd | primary | yes | cbd |
| ef | primary | no | ef |
When I route I should get
| waypoints | route | turns |
| a,d | ,cbd,cbd | depart,end of road right,arrive |
Scenario: End of Road with three streets
Given the node map
"""
@@ -1,525 +0,0 @@
@guidance @merge-segregated
Feature: Merge Segregated Roads
Background:
Given the profile "car"
Given a grid size of 3 meters
#http://www.openstreetmap.org/#map=18/52.49950/13.33916
@negative
Scenario: oneway link road
Given the node map
"""
f - - - - - - -_-_e - - - - d
...''
a - - - b'- - - - - - - - - c
"""
And the ways
| nodes | name | oneway |
| abc | road | yes |
| def | road | yes |
| be | road | yes |
When I route I should get
| waypoints | route | intersections |
| a,c | road,road | true:90,true:75 true:90 false:270;true:270 |
| d,f | road,road | true:270,false:90 false:255 true:270;true:90 |
#http://www.openstreetmap.org/#map=18/52.48337/13.36184
@negative
Scenario: Square Area - Same Name as road for in/out
Given the node map
"""
i
|
|
|
g
/ \
/ \
/ \
/ \
/ \
a - - - - c e - - - - f
\ /
\ /
\ /
\ /
\ /
d
|
|
|
j
"""
And the ways
| nodes | name | oneway |
| ac | road | no |
| ef | road | no |
| cdegc | road | yes |
| ig | top | no |
| jd | bot | no |
When I route I should get
| waypoints | route | intersections |
| a,f | road,road,road,road | true:90,false:45 true:135 false:270;true:45 true:180 false:315;true:90 false:225 true:315;true:270 |
#https://www.openstreetmap.org/#map=19/52.50003/13.33915
@negative
Scenario: Short Segment due to different roads
Given the node map
"""
. d
. '
. '
. '
. '
a - - - - - - - b - - c - - - - - - e
. .
. .
. .
. .
.
f
|
|
|
|
g
"""
And the ways
| nodes | name | oneway |
| abce | pass | no |
| db | pass | yes |
| fg | aug | no |
| bfc | aug | yes |
When I route I should get
| waypoints | route | intersections |
| a,e | pass,pass | true:90,false:60 true:90 true:165 false:270,true:90 false:195 false:270;true:270 |
@negative
Scenario: Tripple Merge should not be possible
Given the node map
"""
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
.
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
'
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
"""
And the ways
| nodes | name | oneway |
| ab | in | no |
| gfb | merge | yes |
| be | merge | yes |
| dcb | merge | yes |
When I route I should get
| waypoints | route | intersections |
| a,e | in,merge,merge | true:90;false:60 true:90 false:120 false:270;true:270 |
Scenario: Tripple Merge should not be possible
Given the node map
"""
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
.
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
'
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
"""
And the ways
| nodes | name | oneway |
| ab | in | no |
| gfb | merge | yes |
| eb | merge | yes |
| bcd | merge | yes |
When I route I should get
| waypoints | route | intersections |
| a,d | in,merge,merge | true:90;false:60 false:90 true:120 false:270;true:270 |
@negative
Scenario: Don't accept turn-restrictions
Given the node map
"""
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
/ \
a - - - b g - - h
\ /
e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - f
"""
And the ways
| nodes | name | oneway |
| ab | road | yes |
| befgh | road | yes |
| bcdg | road | yes |
# This is an artificial scenario - not reasonable. It is only to test the merging on turn-restrictions
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | ab | bcdg | b | no_left_turn |
When I route I should get
| waypoints | route | intersections |
| a,h | road,road | true:90,false:60 true:120 false:270,true:90 false:240 false:300;true:270 |
@negative
Scenario: Actual Turn into segregated ways
Given the node map
"""
a - - - b - < - < - < - < - < - < - < - < - < - < - < c -
| \
| |
| |
d |
\ |
\ |
e > - > - > - > - > - > - > - > - > - > - > f - - - - - - g
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| fcb | road | yes |
| bdef | road | yes |
| fg | road | no |
When I route I should get
| waypoints | route | intersections |
| a,g | road,road | true:90,false:90 true:150 false:270,true:90 false:270 true:345;true:270 |
Scenario: Merging parallel roads with intermediate bridges
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
Given the node map
"""
f
|
.e.
/ \
/ \
g d
| |
| |
| |
| |
| |
| |
| |
| |
h c
\ /
\ /
\ /
b
|
a
|
|
r - x - s
|
|
y
"""
And the ways
| nodes | name | highway | oneway | lanes |
| ab | Hermannstr | secondary | | 2 |
| bc | Hermannstr | secondary | yes | 2 |
| cd | Hermannbruecke | secondary | yes | 2 |
| de | Hermannstr | secondary | yes | 2 |
| ef | Hermannstr | secondary | | 4 |
| eg | Hermannstr | secondary | yes | 2 |
| gh | Hermannbruecke | secondary | yes | 2 |
| hb | Hermannstr | secondary | yes | 2 |
| xa | Hermannstr | secondary | | 4 |
| yx | Hermannstr | secondary | | 4 |
| rxs | Silbersteinstr | tertiary | | 1 |
And the nodes
| node | highway |
| x | traffic_signals |
#the intermediate intersections of degree two indicate short segments of new names. At some point, we probably want to get rid of these
When I route I should get
| waypoints | turns | route | intersections |
| a,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 false:180,true:0 false:180;true:180 |
| f,a | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180;true:0 |
| y,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 true:90 false:180 true:270,true:0 false:180,true:0 false:180;true:180 |
| f,y | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180,false:0 true:90 true:180 true:270;true:0 |
Scenario: Four Way Intersection Double Through Street Segregated
Given the node map
"""
q p
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
b c
\ /
\ /
\ /
j - - - - - - - - - - - - - - - - - i . \ / , d - - - - - - - - - - - - - - - - - o
. \/ .
> a <
. /\ '
. / \ '
k - - - - - - - - - - - - - - - - - h / \ e - - - - - - - - - - - - - - - - - n
/ \
/ \
g f
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
l m
"""
And the ways
| nodes | highway | oneway | name | lanes |
| khaij | primary | yes | first | 4 |
| odaen | primary | yes | first | 4 |
| qbacp | primary | yes | second | 4 |
| mfagl | primary | yes | second | 4 |
When I route I should get
| waypoints | route | turns |
| f,e | second,first,first | depart,turn right,arrive |
| f,c | second,second | depart,arrive |
| f,i | second,first,first | depart,turn left,arrive |
| f,g | second,second,second | depart,continue uturn,arrive |
| d,c | first,second,second | depart,turn right,arrive |
| d,i | first,first | depart,arrive |
| d,g | first,second,second | depart,turn left,arrive |
| d,e | first,first,first | depart,continue uturn,arrive |
| b,i | second,first,first | depart,turn right,arrive |
| b,g | second,second | depart,arrive |
| b,e | second,first,first | depart,turn left,arrive |
| b,c | second,second,second | depart,continue uturn,arrive |
| h,g | first,second,second | depart,turn right,arrive |
| h,e | first,first | depart,arrive |
| h,c | first,second,second | depart,turn left,arrive |
| h,i | first,first,first | depart,continue uturn,arrive |
Scenario: Middle Island Over Bridge
Given the node map
"""
a
|
.b.
c h
| |
| |
1 2
| |
d g
'e'
|
f
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bc | road | yes |
| cd | bridge | yes |
| de | road | yes |
| eg | road | yes |
| gh | bridge | yes |
| hb | road | yes |
When I route I should get
| waypoints | turns | route | intersections |
| a,f | depart,arrive | road,road | true:180,false:0 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,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 |
| g,a | depart,new name straight,arrive | bridge,road,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
Scenario: Traffic Circle
Given the node map
"""
a - - - - b - - - e - - - c - - - - d
\ /
\ /
f
|
|
|
g
"""
And the ways
| nodes | name | oneway |
| ab | left | no |
| bfceb | circle | yes |
| fg | bottom | no |
| cd | right | no |
When I route I should get
| waypoints | route | intersections |
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
Scenario: Middle Island
Given the node map
"""
a
|
b
c h
| |
| |
| |
| |
d g
e
|
f
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bcde | road | yes |
| eghb | road | yes |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | road,road |
| c,f | depart,arrive | road,road |
| f,a | depart,arrive | road,road |
| g,a | depart,arrive | road,road |
Scenario: Traffic Island
Given the node map
"""
f
a - - b < > d - - e
c
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| de | road | no |
| bcdfb | road | yes |
When I route I should get
| waypoints | route | intersections |
| a,e | road,road | true:90;true:270 |
@negative
Scenario: Turning Road, Don't remove sliproads
Given the node map
"""
h - - - - - g - - - - - - f - - - - - e
_ '
.
a - - - - - b - - - - - - c - - - - - d
|
|
|
i
"""
And the ways
| nodes | name | oneway |
| ab | road | yes |
| bcd | road | yes |
| efgh | road | yes |
| fb | road | yes |
| bi | turn | yes |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | fb | bcd | b | no_left_turn |
When I route I should get
| waypoints | route | turns | intersections |
| a,d | road,road | depart,arrive | true:90,false:60 true:90 true:180 false:270;true:270 |
| e,h | road,road | depart,arrive | true:270,false:90 true:240 true:270;true:90 |
| e,i | road,turn,turn | depart,turn left,arrive | true:270;false:90 true:240 true:270,false:60 false:90 true:180 false:270;true:0 |
@negative
Scenario: Meeting Turn Roads
Given the node map
"""
k l
| |
| |
| |
h - - - - - g - - - - - - - f - - - - - e
| ' ' |
| x |
| . . |
a - - - - - b - - - - - - - c - - - - - d
| |
| |
| |
i j
"""
And the ways
| nodes | name | oneway |
| ab | horiz | yes |
| bc | horiz | yes |
| cd | horiz | yes |
| ef | horiz | yes |
| fg | horiz | yes |
| gh | horiz | yes |
| kg | vert | yes |
| gb | vert | yes |
| bi | vert | yes |
| jc | vert | yes |
| cf | vert | yes |
| fl | vert | yes |
| gx | horiz | no |
| xc | horiz | no |
| fx | horiz | no |
| xb | horiz | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bc | cf | c | no_left_turn |
| restriction | fg | gb | g | no_left_turn |
| restriction | cf | fg | f | no_left_turn |
| restriction | gb | bc | b | no_left_turn |
| restriction | xb | bc | b | no_left_turn |
| restriction | xc | cf | c | no_left_turn |
| restriction | xf | fg | f | no_left_turn |
| 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
When I route I should get
| waypoints | route | intersections |
| 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 |
| 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 |
+36 -35
View File
@@ -8,8 +8,8 @@ Feature: Motorway Guidance
Scenario: Ramp Exit Right
Given the node map
"""
a-b-c-d-e
`--f-g
a b c d e
f g
"""
And the ways
@@ -25,9 +25,9 @@ Feature: Motorway Guidance
Scenario: Ramp Exit Right Curved Right
Given the node map
"""
a-b-c
`f`d
`g`e
a b c
f d
g e
"""
And the ways
@@ -43,11 +43,12 @@ Feature: Motorway Guidance
Scenario: Ramp Exit Right Curved Left
Given the node map
"""
,e
,d,g
a-b-c-f
e
d g
a b c f
"""
And the ways
| nodes | highway | oneway |
| abcde | motorway | |
@@ -62,8 +63,8 @@ Feature: Motorway Guidance
Scenario: Ramp Exit Left
Given the node map
"""
/--f-g
a-b-c-d-e
f g
a b c d e
"""
And the ways
@@ -79,9 +80,9 @@ Feature: Motorway Guidance
Scenario: Ramp Exit Left Curved Left
Given the node map
"""
,g,e
,f,d
a-b-c
g e
f d
a b c
"""
And the ways
@@ -97,9 +98,9 @@ Feature: Motorway Guidance
Scenario: Ramp Exit Left Curved Right
Given the node map
"""
a-b-c-f
`d`g
`e
a b c f
d g
e
"""
And the ways
@@ -115,8 +116,8 @@ Feature: Motorway Guidance
Scenario: On Ramp Right
Given the node map
"""
a-b-c-d-e
f-g---'
a b c d e
f g
"""
And the ways
@@ -132,8 +133,8 @@ Feature: Motorway Guidance
Scenario: On Ramp Left
Given the node map
"""
f-g---,
a-b-c-d-e
f g
a b c d e
"""
And the ways
@@ -149,9 +150,9 @@ Feature: Motorway Guidance
Scenario: Highway Fork
Given the node map
"""
/--d-e
a-b-c
\--f-g
d e
a b c
f g
"""
And the ways
@@ -167,9 +168,9 @@ Feature: Motorway Guidance
Scenario: Fork After Ramp
Given the node map
"""
/--d-e
a-b-c
\--f-g
d e
a b c
f g
"""
And the ways
@@ -186,8 +187,8 @@ Feature: Motorway Guidance
Scenario: On And Off Ramp Right
Given the node map
"""
a-b---c---d-e
f-g--/ \--h i
a b c d e
f g h i
"""
And the ways
@@ -206,8 +207,8 @@ Feature: Motorway Guidance
Scenario: On And Off Ramp Left
Given the node map
"""
f-g--\/---h-i
a-b---c---d-e
f g h i
a b c d e
"""
And the ways
@@ -226,9 +227,9 @@ Feature: Motorway Guidance
Scenario: Merging Motorways
Given the node map
"""
e\
a-b-c
d/
e
a b c
d
"""
And the ways
@@ -245,8 +246,8 @@ Feature: Motorway Guidance
Scenario: Handle 90 degree off ramps correctly
Given the node map
"""
a\
x-b---c-y
a
x b c y
d
"""
+116 -25
View File
@@ -13,28 +13,23 @@ Feature: Simple Turns
^
/ \
c d
| |\
| | e
| |
| |
| |
| |
| |
| |
g f
|\
| e
|
f
"""
And the ways
| nodes | name | highway | oneway |
| ab | road | primary | no |
| bcg | road | primary | yes |
| bc | road | primary | yes |
| fdb | road | primary | yes |
| ed | turn | primary | yes |
| de | turn | primary | no |
When I route I should get
| waypoints | turns | route | intersections |
| f,a | depart,arrive | road,road | true:0,true:0 false:150 false:180;true:180 |
| e,a | depart,turn slight right,arrive | turn,road,road | true:333;true:0 false:150 false:180;true:180 |
| waypoints | turns | route |
| f,a | depart,arrive | road,road |
| e,a | depart,turn slight right,arrive | turn,road,road |
Scenario: Turning into splitting road
Given the node map
@@ -44,22 +39,16 @@ Feature: Simple Turns
/\
/ \
c d
| |\
| | e
| |
| |
| |
| |
| |
| |
| |
h f
|\
| e
|
f
"""
And the ways
| nodes | name | highway | oneway |
| ab | road | primary | no |
| bch | road | primary | yes |
| bc | road | primary | yes |
| fdb | road | primary | yes |
| de | turn | primary | no |
| bg | left | primary | yes |
@@ -72,6 +61,108 @@ Feature: Simple Turns
| f,g | depart,turn left,arrive | road,left,left |
| f,c | depart,continue uturn,arrive | road,road,road |
Scenario: Middle Island
Given the node map
"""
a
b
c h
d g
e
f
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bcde | road | yes |
| eghb | road | yes |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | road,road |
| c,f | depart,arrive | road,road |
| f,a | depart,arrive | road,road |
| g,a | depart,arrive | road,road |
Scenario: Middle Island Over Bridge
Given the node map
"""
a
|
.b.
c h
| |
| |
1 2
| |
d g
'e'
|
f
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bc | road | yes |
| cd | bridge | yes |
| de | road | yes |
| eg | road | yes |
| gh | bridge | yes |
| hb | road | yes |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | road,road |
| c,f | depart,new name straight,arrive | bridge,road,road |
| 1,f | depart,new name straight,arrive | bridge,road,road |
| f,a | depart,arrive | road,road |
| g,a | depart,new name straight,arrive | bridge,road,road |
| 2,a | depart,new name straight,arrive | bridge,road,road |
@negative
Scenario: Don't Collapse Places:
Given the node map
"""
h
g
a b e f
c
d
"""
And the ways
| nodes | name | oneway |
| ab | place | no |
| cd | bottom | no |
| ef | place | no |
| gh | top | no |
| bcegb | place | yes |
When I route I should get
| waypoints | turns | route |
| a,d | depart,turn right,arrive | place,bottom,bottom |
| a,f | depart,continue left,continue right,arrive | place,place,place,place |
| d,f | depart,turn right,continue right,arrive | bottom,place,place,place |
| d,h | depart,turn right,continue left,turn right,arrive | bottom,place,place,top,top |
@bug @not-sorted @3179
Scenario: Adjusting road angles to not be sorted
Given the node map
+4 -4
View File
@@ -261,7 +261,7 @@ Feature: Ramp Guidance
"""
d - e - g
|
a - b ~ ~ ~ ~ ~ ~ ~ c
a - b ~ ~ ~ ~ ~ ~ ~ c
` f
"""
@@ -271,8 +271,8 @@ Feature: Ramp Guidance
| bc | | ferry | boaty mc boatface | m2 |
| cf | | ferry | boaty mc boatface | |
| cd | | ferry | boaty mc boatface's cousin | |
| de | motorway_link | | | |
| de | motorway_link | | | |
When I route I should get
| waypoints | route |
| a,e | boarding,boaty mc boatface,, |
| waypoints | route |
| a,e | boarding,boaty mc boatface,boaty mc boatface's cousin,, |
-146
View File
@@ -535,149 +535,3 @@ Feature: Basic Roundabout
| i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
| i,d | Petersburger Strasse,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,arrive |
| i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,arrive |
@turboroundabout
# http://www.openstreetmap.org/?mlat=48.782118&mlon=8.194456&zoom=16#map=19/48.78216/8.19457
Scenario: Turboroundabout, Baden-Baden
Given the node map
"""
a p
b o
d c m n
f e k l
g i
h j
"""
And the ways
| nodes | highway | oneway | junction | name | turn:lanes |
| ab | trunk_link | yes | | | |
| bc | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
| cd | trunk | yes | | Europastrasse | |
| ce | trunk | yes | roundabout | Europaplatz | |
| fe | trunk | yes | | Europastrasse | |
| eg | trunk | yes | roundabout | Europaplatz | |
| gh | residential | yes | | Allee Cite | |
| gi | trunk | yes | roundabout | Europaplatz | |
| ji | residential | yes | | Allee Cite | |
| ik | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
| kl | trunk | yes | | Europastrasse | |
| km | trunk | yes | roundabout | Europaplatz | |
| nm | trunk | yes | | Europastrasse | |
| mo | trunk | yes | roundabout | Europaplatz | |
| op | trunk_link | yes | | | |
| ob | trunk | yes | roundabout | Europaplatz | |
When I route I should get
| waypoints | route | turns | lanes |
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive | ,, |
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive | ,, |
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive | ,, |
| a,p | ,, | depart,Europaplatz-exit-4,arrive | ,, |
@turboroundabout
# http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506
Scenario: Turboroundabout, Königstein im Taunus
Given the node map
"""
a
b w t v
c s u
d r
f e q
g p
h i n
j k m
l o
"""
And the ways
| nodes | highway | oneway | junction | name | turn:lanes |
| ab | primary | yes | | Le-Cannet-Rocheville-Strasse | |
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
| bc | primary | yes | roundabout | | through\|through;right |
| cd | primary | yes | roundabout | | through\|through\|right;through |
| df | tertiary | yes | | Frankfurter Strasse | |
| de | primary | yes | roundabout | | through\|through\|right;through |
| fe | tertiary | yes | | Frankfurter Strasse | |
| eg | primary | yes | roundabout | | through\|through\|right;through |
| gh | primary | yes | | Bischof-Kaller-Strasse | |
| gi | primary | yes | roundabout | | left\|through;slight_left\|through |
| ji | primary | yes | | Bischof-Kaller-Strasse | |
| ik | primary | yes | roundabout | | left\|through;slight_left\|through |
| km | primary | yes | roundabout | | |
| kl | primary | yes | | Sodener Strasse | |
| mn | primary | yes | roundabout | | through\|through;right |
| on | primary | yes | | Sodener Strasse | |
| np | primary | yes | roundabout | | through\|through;right |
| pq | primary | yes | roundabout | | through\|through\|right;through |
| qr | primary | yes | | | |
| qs | primary | yes | roundabout | | |
| us | primary_link | yes | | | |
| st | primary | yes | roundabout | | |
| vt | primary | yes | | | |
| tw | primary | yes | roundabout | | left\|left\|right\|right |
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
| wb | primary | yes | roundabout | | through\|through;right |
When I route I should get
| waypoints | route | turns | lanes |
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive | ,, |
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive | ,, |
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive | ,, |
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive | ,, |
| u,r | ,, | depart,roundabout-exit-5,arrive | ,, |
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive | ,, |
| n,m | , | depart,arrive | , |
@turboroundabout
# http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711
Scenario: Turboroundabout, Rheinfelden (Baden)
Given the node map
"""
r w
a l k
b j
c
d i
s e f g h v
t u
"""
And the ways
| nodes | highway | oneway | junction |
| ar | secondary | yes | |
| ab | primary | yes | roundabout |
| rb | secondary | yes | |
| bc | primary | yes | roundabout |
| cd | primary | yes | roundabout |
| ds | primary | yes | |
| se | primary | yes | |
| de | primary | yes | roundabout |
| ef | primary | yes | roundabout |
| ft | unclassified | yes | |
| fg | primary | yes | roundabout |
| ug | unclassified | yes | |
| gh | primary | yes | roundabout |
| hv | primary | yes | |
| hi | primary | yes | roundabout |
| vi | primary | yes | |
| ij | primary | yes | roundabout |
| jw | tertiary | yes | |
| jk | primary | yes | roundabout |
| wk | tertiary | yes | |
| kl | primary | yes | roundabout |
| la | primary | yes | roundabout |
When I route I should get
| waypoints | route | turns |
| w,r | wk,ar,ar | depart,roundabout-exit-1,arrive |
| w,s | wk,ds,ds | depart,roundabout-exit-2,arrive |
| w,t | wk,ft,ft | depart,roundabout-exit-3,arrive |
| w,v | wk,hv,hv | depart,roundabout-exit-4,arrive |
| u,v | ug,hv,hv | depart,roundabout-exit-1,arrive |
| u,w | ug,jw,jw | depart,roundabout-exit-2,arrive |
| u,r | ug,ar,ar | depart,roundabout-exit-3,arrive |
| u,s | ug,ds,ds | depart,roundabout-exit-4,arrive |
| u,t | ug,ft,ft | depart,roundabout-exit-5,arrive |
@@ -105,7 +105,7 @@ Feature: Staggered Intersections
j
a b c
d
e f g
e f g
h
"""
+5 -5
View File
@@ -8,8 +8,8 @@ Feature: Suppressed Turns
Scenario: Do not announce passing a exit ramp
Given the node map
"""
a-b-c-d-e
\---f-g
a b c d e
f g
"""
And the ways
@@ -24,7 +24,7 @@ Feature: Suppressed Turns
Scenario: Do not announce reference changes
Given the node map
"""
a-b-c-d-e-f
a b c d e f
"""
And the ways
@@ -43,7 +43,7 @@ Feature: Suppressed Turns
Scenario: Don't Announce Turn on following major road class -- service
Given the node map
"""
a-b-d
a b d
c
"""
@@ -59,7 +59,7 @@ Feature: Suppressed Turns
Scenario: Don't Announce Turn on following major road class -- residential
Given the node map
"""
a-b-d
a b d
c
"""
+11 -65
View File
@@ -768,31 +768,7 @@ Feature: Simple Turns
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
g h
g h
"""
And the nodes
@@ -808,15 +784,15 @@ Feature: Simple Turns
| cjk | Friede | no | | tertiary |
When I route I should get
| 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,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 |
| 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 |
| 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,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:180 true:270 true:345;true:90 |
| waypoints | route | turns |
| a,g | Perle,Heide,Heide | depart,turn right,arrive |
| a,k | Perle,Friede,Friede | depart,turn left,arrive |
| a,e | Perle,Perle | depart,arrive |
| e,k | Perle,Friede,Friede | depart,turn right,arrive |
| e,g | Perle,Heide,Heide | depart,turn left,arrive |
| h,k | Heide,Friede,Friede | depart,new name slight left,arrive |
| h,e | Heide,Perle,Perle | depart,turn right,arrive |
| h,a | Heide,Perle,Perle | depart,turn left,arrive |
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
Scenario: Curved Exit from Curved Road
@@ -954,36 +930,6 @@ Feature: Simple Turns
. . .
. . .
i . .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
e a
"""
@@ -1358,7 +1304,7 @@ Feature: Simple Turns
|
|
|
ga - - -b
g a - - -b
f /
d -c
"""
+13 -54
View File
@@ -599,21 +599,22 @@ Feature: Turn Lane Guidance
Scenario: Segregated Intersection Merges With Lanes
Given the node map
"""
a e
| |
| |
b d
h c
' -- g - - f
f
e d
c g
a b
h
"""
And the ways
| nodes | name | turn:lanes:forward | oneway | highway | lanes |
| abc | road | left\|left\|left\|through\|through | yes | primary | 5 |
| cde | road | | yes | primary | 3 |
| hc | cross | | yes | secondary | |
| cg | straight | | no | tertiary | |
| cf | left | | yes | primary | |
| nodes | name | turn:lanes:forward | oneway | highway |
| abc | road | left\|left\|left\|through\|through | yes | primary |
| cde | road | | yes | primary |
| hc | cross | | yes | secondary |
| cg | straight | | no | tertiary |
| cf | left | | yes | primary |
When I route I should get
| waypoints | route | turns | lanes |
@@ -1158,45 +1159,3 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | bearings | route | turns |
| 1,a | 90,2 180,180 | | |
@3379
Scenario: Don't Turn through potential through lanes
Given the node map
"""
d
|
a - - - - b - - - - - c
|
e
"""
And the ways
| nodes | name | oneway | turn:lanes:forward |
| ab | road | yes | left\|none\|none |
| bc | road | yes | |
| ebd | cross | no | |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
| a,c | road,road | depart,arrive | , |
@3379
Scenario: Don't Turn through potential through lanes
Given the node map
"""
d
|
a - - - - b - - - - - c
|
e
"""
And the ways
| nodes | name | oneway | turn:lanes:forward |
| ab | road | yes | none\|none\|right |
| bc | road | yes | |
| ebd | cross | no | |
When I route I should get
| waypoints | route | turns | lanes |
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
| a,c | road,road | depart,arrive | , |
+140 -25
View File
@@ -278,6 +278,52 @@ Feature: Simple Turns
| x | z | xy,yz,yz | depart,turn right,arrive |
| z | x | yz,xy,xy | depart,turn left,arrive |
Scenario: Four Way Intersection Double Through Street Segregated
Given the node map
"""
q p
b c
j i d o
a
k h e n
g f
l m
"""
And the ways
| nodes | highway | oneway | name |
| khaij | primary | yes | first |
| odaen | primary | yes | first |
| qbacp | primary | yes | second |
| mfagl | primary | yes | second |
When I route I should get
| waypoints | route | turns |
| f,e | second,first,first | depart,turn right,arrive |
| f,c | second,second | depart,arrive |
| f,i | second,first,first | depart,turn left,arrive |
| f,g | second,second,second | depart,continue uturn,arrive |
| d,c | first,second,second | depart,turn right,arrive |
| d,i | first,first | depart,arrive |
| d,g | first,second,second | depart,turn left,arrive |
| d,e | first,first,first | depart,continue uturn,arrive |
| b,i | second,first,first | depart,turn right,arrive |
| b,g | second,second | depart,arrive |
| b,e | second,first,first | depart,turn left,arrive |
| b,c | second,second,second | depart,continue uturn,arrive |
| h,g | first,second,second | depart,turn right,arrive |
| h,e | first,first | depart,arrive |
| h,c | first,second,second | depart,turn left,arrive |
| h,i | first,first,first | depart,continue uturn,arrive |
Scenario: Three Way Similar Sharp Turns
Given the node map
"""
@@ -1034,6 +1080,100 @@ Feature: Simple Turns
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
Scenario: Collapse Turn Instruction, Issue #2725
Given the node map
"""
f
e
g d
h c
b
a
r x s
y
"""
And the ways
| nodes | name | highway | oneway |
| ab | Hermannstr | secondary | |
| bc | Hermannstr | secondary | yes |
| cd | Hermannbruecke | secondary | yes |
| de | Hermannstr | secondary | yes |
| ef | Hermannstr | secondary | |
| eg | Hermannstr | secondary | yes |
| gh | Hermannbruecke | secondary | yes |
| hb | Hermannstr | secondary | yes |
| xa | Hermannstr | secondary | |
| yx | Hermannstr | secondary | |
| rxs | Silbersteinstr | tertiary | |
And the nodes
| node | highway |
| x | traffic_signals |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | Hermannstr,Hermannstr |
| f,a | depart,arrive | Hermannstr,Hermannstr |
| y,f | depart,arrive | Hermannstr,Hermannstr |
| f,y | depart,arrive | Hermannstr,Hermannstr |
Scenario: Collapse Turn Instruction, Issue #2725 - not trivially mergable at e
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
Given the node map
"""
f
e
g d
h c
b
a
r x s
y
"""
And the ways
| nodes | name | highway | oneway |
| ab | Hermannstr | secondary | |
| bc | Hermannstr | secondary | yes |
| cd | Hermannbruecke | secondary | yes |
| de | Hermannstr | secondary | yes |
| ef | Hermannstr | secondary | |
| eg | Hermannstr | secondary | yes |
| gh | Hermannbruecke | secondary | yes |
| hb | Hermannstr | secondary | yes |
| xa | Hermannstr | secondary | |
| yx | Hermannstr | secondary | |
| rxs | Silbersteinstr | tertiary | |
And the nodes
| node | highway |
| x | traffic_signals |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | Hermannstr,Hermannstr |
| f,a | depart,arrive | Hermannstr,Hermannstr |
| y,f | depart,arrive | Hermannstr,Hermannstr |
| f,y | depart,arrive | Hermannstr,Hermannstr |
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291
@3002
Scenario: Obvious Index wigh very narrow turn to the right
@@ -1235,28 +1375,3 @@ Feature: Simple Turns
When I route I should get
| waypoints | turns | route |
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |
#http://www.openstreetmap.org/#map=19/49.48761/8.47618
@todo @3365
Scenario: Turning Road - Segregated
Given the node map
"""
f d
| |
a - - - b - c
| |
| |
g e
"""
And the ways
| nodes | name | ref | oneway |
| ab | Goethe | B 38 | yes |
| bc | | B 38 | yes |
| ec | Fried | | yes |
| cd | Fried | B 38 | yes |
| fbg | Fried | | yes |
When I route I should get
| waypoints | route | turns |
| a,d | Goethe,Fried,Fried | depart,continue left,arrive |
| a,g | Goethe,Fried,Fried | depart,turn right,arrive |
+6 -8
View File
@@ -36,8 +36,8 @@ class OSRMBaseLoader{
osrmDown (callback) {
if (this.osrmIsRunning()) {
this.child.on('exit', (code, signal) => { callback();});
this.child.kill('SIGINT');
this.child.on('exit', (code, signal) => {callback();});
this.child.kill();
} else callback();
}
@@ -78,10 +78,9 @@ class OSRMDirectLoader extends OSRMBaseLoader {
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
this.child = this.scope.runBin('osrm-routed', util.format("%s -p %d", this.inputFile, this.scope.OSRM_PORT), this.scope.environment, (err) => {
if (err && err.signal !== 'SIGINT') {
this.child = null;
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
}
if (err) {
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
}
});
callback();
}
@@ -116,8 +115,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
if (this.osrmIsRunning()) return callback();
this.child = this.scope.runBin('osrm-routed', util.format('--shared-memory=1 -p %d', this.scope.OSRM_PORT), this.scope.environment, (err) => {
if (err && err.signal !== 'SIGINT') {
this.child = null;
if (err) {
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
}
});
+34 -103
View File
@@ -7,117 +7,48 @@ var chalk = require('chalk');
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
String.prototype.padLeft = function(char, length) {
return char.repeat(Math.max(0, length - this.length)) + this;
}
String.prototype.padRight = function(char, length) {
return this + char.repeat(Math.max(0, length - this.length));
}
module.exports = function (expected, actual) {
let headers = expected.raw()[0];
let expectedRows = expected.hashes();
let tableError = false;
let statusRows = [];
let columnStatus = {}
let expected_keys = expected.hashes();
let diff = [];
let hasErrors = false;
expectedRows.forEach((expectedRow, i) => {
var good = 0, bad = 0;
expected_keys.forEach((row, i) => {
var rowError = false;
statusRows[i] = {};
var statusRow = statusRows[i];
for (var key in expectedRow) {
var actualRow = actual[i]
var row
if (unescapeStr(expectedRow[key]) != actualRow[key]) {
statusRow[key] = false;
tableError = true;
columnStatus[key] = false;
for (var j in row) {
if (unescapeStr(row[j]) != actual[i][j]) {
rowError = true;
hasErrors = true;
break;
}
}
});
if (!tableError) return null;
// determine column widths
var widths = {};
var wantStr = '(-) ';
var gotStr = '(+) ';
var okStr = ' ';
headers.forEach( (key) => {
widths[key] = key.length;
});
expectedRows.forEach((row,i) => {
var cells = []
headers.forEach( (key) => {
var content = row[key]
var length = content.length;
if(widths[key]==null || length > widths[key])
widths[key] = length;
});
});
// format
var lines = [chalk.red('Tables were not identical:')];
var cells;
// header row
cells = []
headers.forEach( (key) => {
var content = key.padRight(' ', widths[key] );
if (columnStatus[key] == false )
content = okStr + content;
cells.push( chalk.white( content ) );
});
lines.push( '| ' + cells.join(' | ') + ' |');
// content rows
expectedRows.forEach((row,i) => {
var cells;
var rowError = Object.keys(statusRows[i]).length > 0;
// expected row
cells = []
headers.forEach( (key) => {
var content = row[key].padRight(' ', widths[key] );
if (statusRows[i][key] == false)
cells.push( chalk.yellow( wantStr + content) );
else {
if (rowError) {
if (columnStatus[key]==false)
content = okStr + content
cells.push( chalk.yellow( content) );
}
else {
if (columnStatus[key]==false)
content = okStr + content
cells.push( chalk.green( content) );
}
}
});
lines.push('| ' + cells.join(' | ') + ' |');
// if error in row, insert extra row showing actual result
if (rowError) {
cells = []
headers.forEach( (key) => {
var content = actual[i][key].padRight(' ', widths[key] );
if (statusRows[i][key] == false)
cells.push( chalk.red( gotStr + content) );
else {
if (columnStatus[key]==false)
cells.push( chalk.red( okStr + content) );
else
cells.push( chalk.red( content) );
}
});
lines.push('| ' + cells.join(' | ') + ' |');
bad++;
diff.push(Object.assign({}, row, {c_status: 'undefined'}));
diff.push(Object.assign({}, actual[i], {c_status: 'comment'}));
} else {
good++;
diff.push(row);
}
});
return lines.join('\n');
if (!hasErrors) return null;
var s = ['Tables were not identical:'];
s.push(headers.map(key => ' ' + key).join(' | '));
diff.forEach((row) => {
var rowString = '| ';
headers.forEach((header) => {
if (!row.c_status) rowString += chalk.green(' ' + row[header] + ' | ');
else if (row.c_status === 'undefined') rowString += chalk.yellow('(-) ' + row[header] + ' | ');
else rowString += chalk.red('(+) ' + row[header] + ' | ');
});
s.push(rowString);
});
return s.join('\n') + '\nTODO this is a temp workaround waiting for https://github.com/cucumber/cucumber-js/issues/534';
};
+2 -2
View File
@@ -11,7 +11,7 @@ module.exports = {
errorReason: (err) => {
return err.signal ?
'killed by signal ' + err.signal :
'exited with code ' + err.code;
util.format('killed by signal %s', err.signal) :
util.format('exited with code %d', err.code);
}
};
@@ -28,11 +28,3 @@ Feature: osrm-contract command line options: datasources
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
+3 -3
View File
@@ -4,7 +4,7 @@ Feature: osrm-contract command line options: help
Scenario: osrm-contract - Help should be shown when no options are passed
When I try to run "osrm-contract"
Then stderr should be empty
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
And stdout should contain "osrm-contract <input.osrm> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
@@ -18,7 +18,7 @@ Feature: osrm-contract command line options: help
Scenario: osrm-contract - Help, short
When I run "osrm-contract -h"
Then stderr should be empty
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
And stdout should contain "osrm-contract <input.osrm> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
@@ -32,7 +32,7 @@ Feature: osrm-contract command line options: help
Scenario: osrm-contract - Help, long
When I run "osrm-contract --help"
Then stderr should be empty
And stdout should contain /osrm-contract(.exe)? <input.osrm> \[options\]:/
And stdout should contain "osrm-contract <input.osrm> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
+1 -1
View File
@@ -24,5 +24,5 @@ Feature: osrm-contract command line options: invalid options
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"
Then stderr should contain ".osrm.edge_penalties"
And it should exit with an error
+3 -3
View File
@@ -7,7 +7,7 @@ Feature: osrm-extract command line options: help
Scenario: osrm-extract - Help should be shown when no options are passed
When I run "osrm-extract"
Then stderr should be empty
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
@@ -21,7 +21,7 @@ Feature: osrm-extract command line options: help
Scenario: osrm-extract - Help, short
When I run "osrm-extract -h"
Then stderr should be empty
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
@@ -35,7 +35,7 @@ Feature: osrm-extract command line options: help
Scenario: osrm-extract - Help, long
When I run "osrm-extract --help"
Then stderr should be empty
And stdout should contain /osrm-extract(.exe)? <input.osm/.osm.bz2/.osm.pbf> \[options\]:/
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
-28
View File
@@ -1,28 +0,0 @@
@extract
Feature: osrm-extract lua ways:get_nodes()
Background:
Given the node map
"""
a b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
Scenario: osrm-extract - Passing base file
Given the profile file "testbot" extended with
"""
function way_function(way, result)
for _, node in ipairs(way:get_nodes()) do
print('node id ' .. node:id())
end
result.forward_mode = mode.driving
result.forward_speed = 1
end
"""
When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
And stdout should contain "node id 1"
And stdout should contain "node id 2"
-107
View File
@@ -1,107 +0,0 @@
Feature: Profile API version 0
Background:
Given a grid size of 100 meters
Scenario: Not-defined API version
Given the profile file
"""
function way_function(way, result)
result.forward_mode = mode.driving
result.forward_speed = 1
end
"""
And the node map
"""
ab
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
When I try to run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
And stderr should not contain "Invalid profile API version"
Scenario: Out-bound API version
Given the profile file
"""
api_version = 2
"""
And the node map
"""
ab
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
When I try to run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit with an error
And stderr should contain "Invalid profile API version"
Scenario: Basic profile function calls and property values
Given the profile file
"""
api_version = 0
-- set profile properties
properties.u_turn_penalty = 20
properties.traffic_signal_penalty = 2
properties.max_speed_for_map_matching = 180/3.6
properties.use_turn_restrictions = true
properties.continue_straight_at_waypoint = true
properties.left_hand_driving = false
properties.weight_name = 'duration'
function node_function (node, result)
print ('node_function ' .. node:id())
end
function way_function(way, result)
result.name = way:get_value_by_key('name')
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.forward_speed = 36
result.backward_speed = 36
print ('way_function ' .. way:id() .. ' ' .. result.name)
end
function turn_function (angle)
print('turn_function ' .. angle)
return angle == 0 and 0 or 42
end
function segment_function (source, target, distance, weight)
print ('segment_function ' .. source.lon .. ' ' .. source.lat)
end
"""
And the node map
"""
a
b c d
e
"""
And the ways
| nodes |
| ac |
| cb |
| cd |
| ce |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
And stdout should contain "node_function"
And stdout should contain "way_function"
And stdout should contain "turn_function"
And stdout should contain "segment_function"
When I route I should get
| from | to | route | time |
| a | b | ac,cb,cb | 24.2s |
| a | d | ac,cd,cd | 24.2s |
| a | e | ac,ce,ce | 20s |
@@ -1,66 +0,0 @@
Feature: Profile API version 1
Background:
Given a grid size of 100 meters
Scenario: Basic profile function calls and property values
Given the profile file
"""
api_version = 1
-- set profile properties
properties.max_speed_for_map_matching = 180/3.6
properties.use_turn_restrictions = true
properties.continue_straight_at_waypoint = true
properties.weight_name = 'test_version1'
function node_function (node, result)
print ('node_function ' .. node:id())
end
function way_function(way, result)
result.name = way:get_value_by_key('name')
result.weight = 10
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.forward_speed = 36
result.backward_speed = 36
print ('way_function ' .. way:id() .. ' ' .. result.name)
end
function turn_function (turn)
print('turn_function', turn.angle, turn.turn_type, turn.direction_modifier, turn.has_traffic_light)
turn.weight = turn.angle == 0 and 0 or 4.2
turn.duration = turn.weight
end
function segment_function (segment)
print ('segment_function ' .. segment.source.lon .. ' ' .. segment.source.lat)
end
"""
And the node map
"""
a
bcd
e
"""
And the ways
| nodes |
| ac |
| cb |
| cd |
| ce |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
And stdout should contain "node_function"
And stdout should contain "way_function"
And stdout should contain "turn_function"
And stdout should contain "segment_function"
When I route I should get
| from | to | route | time |
| a | b | ac,cb,cb | 19.2s |
| a | d | ac,cd,cd | 19.2s |
| a | e | ac,ce,ce | 20s |
+3 -3
View File
@@ -7,7 +7,7 @@ Feature: osrm-routed command line options: help
Scenario: osrm-routed - Help should be shown when no options are passed
When I run "osrm-routed"
Then stderr should be empty
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
@@ -26,7 +26,7 @@ Feature: osrm-routed command line options: help
Scenario: osrm-routed - Help, short
When I run "osrm-routed -h"
Then stderr should be empty
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
@@ -45,7 +45,7 @@ Feature: osrm-routed command line options: help
Scenario: osrm-routed - Help, long
When I run "osrm-routed --help"
Then stderr should be empty
And stdout should contain /osrm-routed(.exe)? <base.osrm> \[<options>\]:/
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
+3 -5
View File
@@ -239,15 +239,13 @@ module.exports = function () {
});
this.Given(/^the profile file(?: "([^"]*)" extended with)?$/, (profile, data, callback) => {
const lua_profiles_path = this.PROFILES_PATH.split(path.sep).join('/');
let text = 'package.path = "' + lua_profiles_path + '/?.lua;" .. package.path\n';
let text = 'package.path = "' + this.PROFILES_PATH + '/?.lua;" .. package.path\n';
if (profile == null) {
text += data + '\n';
} else {
text += 'local f = assert(io.open("' + lua_profiles_path + '/' + profile + '.lua", "r"))\n';
text += 'local s = f:read("*all") .. [[\n' + data + '\n]]\n';
text += 'local f = assert(io.open("' + this.PROFILES_PATH + '/' + profile + '.lua", "r"))\n';
text += 'local m = assert(loadstring(f:read("*all") .. [[\n' + data + '\n]]))\n';
text += 'f:close()\n';
text += 'local m = assert(loadstring and loadstring(s) or load(s))\n';
text += 'm()\n';
}
this.profileFile = this.profileCacheFile;
+9 -17
View File
@@ -83,10 +83,7 @@ module.exports = function () {
duration = json.matchings[0].duration;
}
// annotation response values are requested by 'a:{type_name}'
var found = false;
headers.forEach((h) => { if (h.match(/^a:/)) found = true; });
if (found) {
if (headers.has('annotation')) {
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
annotation = this.annotationList(json.matchings[0]);
}
@@ -95,6 +92,11 @@ module.exports = function () {
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
geometry = json.matchings[0].geometry;
}
if (headers.has('OSM IDs')) {
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
OSMIDs = this.OSMIDList(json.matchings[0]);
}
}
if (headers.has('turns')) {
@@ -109,19 +111,9 @@ module.exports = function () {
got.duration = duration.toString();
}
// if header matches 'a:*', parse out the values for *
// and return in that header
headers.forEach((k) => {
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight'];
if (k.match(/^a:/)) {
let a_type = k.slice(2);
if (whitelist.indexOf(a_type) == -1)
return cb(new Error('Unrecognized annotation field:' + a_type));
if (!annotation[a_type])
return cb(new Error('Annotation not found in response: ' + a_type));
got[k] = annotation[a_type];
}
});
if (headers.has('annotation')) {
got.annotation = annotation.toString();
}
if (headers.has('geometry')) {
if (this.queryParams['geometries'] === 'polyline') {
+2 -3
View File
@@ -70,9 +70,8 @@ module.exports = function () {
assert.ok(this.stdout.indexOf(str) > -1);
});
this.Then(/^stderr should( not)? contain "(.*?)"$/, (not, str) => {
const contains = this.stderr.indexOf(str) > -1;
assert.ok(typeof not === 'undefined' ? contains : !contains);
this.Then(/^stderr should contain "(.*?)"$/, (str) => {
assert.ok(this.stderr.indexOf(str) > -1);
});
this.Then(/^stdout should contain \/(.*)\/$/, (regexStr) => {
+4 -38
View File
@@ -6,46 +6,19 @@ module.exports = function () {
this.Then(/^routability should be$/, (table, callback) => {
this.buildWaysFromTable(table, () => {
var directions = ['forw','backw','bothw'],
testedHeaders = ['forw','backw','bothw','forw_rate','backw_rate','bothw_rate'],
headers = new Set(Object.keys(table.hashes()[0]));
if (!testedHeaders.some(k => !!headers.has(k))) {
throw new Error('*** routability table must contain either "forw", "backw", "bothw", "forw_rate" or "backw_rate" column');
if (!directions.some(k => !!headers.has(k))) {
throw new Error('*** routability table must contain either "forw", "backw" or "bothw" column');
}
this.reprocessAndLoadData((e) => {
if (e) return callback(e);
var testRow = (row, i, cb) => {
var outputRow = Object.assign({}, row);
// clear the fields that are tested for in the copied response object
for (var field in outputRow) {
if (testedHeaders.indexOf(field) != -1)
outputRow[field] = '';
}
testRoutabilityRow(i, (err, result) => {
if (err) return cb(err);
directions.filter(d => headers.has(d + '_rate')).forEach((direction) => {
var rate = direction + '_rate';
var want = row[rate];
switch (true) {
case '' === want:
outputRow[rate] = result[direction].status ?
result[direction].status.toString() : '';
break;
case /^\d+$/.test(want):
if (result[direction].rate !== undefined && !isNaN(result[direction].rate)) {
outputRow[rate] = result[direction].rate.toString();
} else {
outputRow[rate] = '';
}
break;
default:
throw new Error(util.format('*** Unknown expectation format: %s for header %s', want, rate));
}
});
directions.filter(d => headers.has(d)).forEach((direction) => {
var usingShortcut = false,
want = row[direction];
@@ -58,8 +31,6 @@ module.exports = function () {
usingShortcut = row[direction];
}
// TODO split out accessible/not accessible value from forw/backw headers
// rename forw/backw to forw/backw_speed
switch (true) {
case '' === want:
case 'x' === want:
@@ -92,7 +63,7 @@ module.exports = function () {
}
if (this.FuzzyMatch.match(outputRow[direction], want)) {
outputRow[direction] = usingShortcut ? usingShortcut : row[direction];
outputRow[direction] = [usingShortcut ? usingShortcut : row[direction]];
}
});
@@ -104,10 +75,6 @@ module.exports = function () {
});
});
// makes simple a-b request using the given cucumber test routability conditions
// result is an object containing the calculated values for 'rate', 'status',
// 'time', 'distance', and 'speed' for forwards and backwards routing, as well as
// a bothw object that diffs forwards/backwards
var testRoutabilityRow = (i, cb) => {
var result = {};
@@ -131,7 +98,6 @@ module.exports = function () {
if (r.route.split(',')[0] === util.format('w%d', i)) {
r.time = r.json.routes[0].duration;
r.distance = r.json.routes[0].distance;
r.rate = Math.round(r.distance / r.json.routes[0].weight);
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
} else {
r.status = null;
@@ -167,7 +133,7 @@ module.exports = function () {
scb();
};
['rate', 'status', 'time', 'distance', 'speed'].forEach((key) => {
['status', 'time', 'distance', 'speed'].forEach((key) => {
sq.defer(parseRes, key);
});
+5 -24
View File
@@ -24,6 +24,7 @@ module.exports = function () {
} else if (row[k]) {
params[match[1]] = [row[k]];
}
got[k] = row[k];
}
}
@@ -34,11 +35,11 @@ module.exports = function () {
}
if (headers.has('status')) {
got.status = json.code;
got.status = json.status.toString();
}
if (headers.has('message')) {
got.message = json.message;
got.message = json.status_message;
}
if (headers.has('geometry')) {
@@ -58,7 +59,6 @@ module.exports = function () {
var subTrips;
var trip_durations;
var trip_distance;
if (res.statusCode === 200) {
if (headers.has('trips')) {
subTrips = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map((sl, i) => {
@@ -74,19 +74,13 @@ module.exports = function () {
})));
trip_durations = all_durations.map( a => a.reduce(add, 0));
}
if(headers.has('distance')) {
var all_distance = json.trips.filter(t => !!t).map(t => t.legs).map(tl => Array.prototype.concat.apply([], tl.map(sl => {
return sl.distance;
})));
trip_distance = all_distance.map( a => a.reduce(add, 0));
}
}
var ok = true,
encodedResult = '',
extendedTarget = '';
if (json.trips) row.trips.split(',').forEach((sub, si) => {
row.trips.split(',').forEach((sub, si) => {
if (si >= subTrips.length) {
ok = false;
} else {
@@ -111,10 +105,10 @@ module.exports = function () {
got.via_points = row.via_points;
} else {
got.trips = encodedResult;
got.trips = extendedTarget;
}
got.durations = trip_durations;
got.distance = trip_distance;
for (var key in row) {
if (this.FuzzyMatch.match(got[key], row[key])) {
@@ -150,19 +144,6 @@ module.exports = function () {
waypoints.push(node);
});
got = { waypoints: row.waypoints };
if (row.source) {
params.source = got.source = row.source;
}
if (row.destination) {
params.destination = got.destination = row.destination;
}
if (row.hasOwnProperty('roundtrip')) { //roundtrip is a boolean so row.roundtrip alone doesn't work as a check here
params.roundtrip = got.roundtrip = row.roundtrip;
}
this.requestTrip(waypoints, params, afterRequest);
} else {
throw new Error('*** no waypoints');
+1 -3
View File
@@ -141,9 +141,7 @@ module.exports = function() {
// converts the scenario titles in file prefixes
this.getScenarioID = (scenario) => {
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\):\*#]/g, '')
.replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.')
.substring(0, 64);
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\)]/g, '').replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.');
return util.format('%d_%s', scenario.getLine(), name);
};
+1 -1
View File
@@ -248,7 +248,7 @@ module.exports = function () {
q.awaitAll((err, actual) => {
if (err) return callback(err);
let diff = tableDiff(table, actual);
if (diff) callback(diff);
if (diff) callback(new Error(diff));
else callback();
});
};
+27 -17
View File
@@ -27,11 +27,10 @@ module.exports = function () {
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
}
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
this.DEFAULT_PROFILE = 'bicycle';
this.DEFAULT_INPUT_FORMAT = 'osm';
this.DEFAULT_LOAD_METHOD = this.PLATFORM_WINDOWS ? 'directly' : 'datastore';
this.DEFAULT_LOAD_METHOD = 'datastore';
this.DEFAULT_ORIGIN = [1,1];
this.OSM_USER = 'osrm';
this.OSM_GENERATOR = 'osrm-test';
@@ -43,33 +42,44 @@ module.exports = function () {
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
if (this.PLATFORM_WINDOWS) {
// TODO make sure this works on win
if (process.platform.match(/indows.*/)) {
this.TERMSIGNAL = 9;
this.EXE = '.exe';
this.LIB = '.dll';
this.QQ = '"';
} else {
this.TERMSIGNAL = 'SIGTERM';
this.EXE = '';
}
// heuristically detect .so/.a/.dll/.lib suffix
this.LIB = ['lib%s.a', 'lib%s.so', '%s.dll', '%s.lib'].find((format) => {
// heuristically detect .so/.a suffix
this.LIB = null;
try {
const lib = this.BIN_PATH + '/' + util.format(format, 'osrm');
fs.accessSync(lib, fs.F_OK);
} catch(e) { return false; }
return true;
});
const dot_a = util.format('%s/libosrm%s', this.BIN_PATH, '.a');
fs.accessSync(dot_a, fs.F_OK);
this.LIB = '.a';
} catch(e) { /*nop*/ }
if (this.LIB === undefined) {
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
try {
const dot_so = util.format('%s/libosrm%s', this.BIN_PATH, '.so');
fs.accessSync(dot_so, fs.F_OK);
this.LIB = '.so';
} catch(e) { /*nop*/ }
if (!this.LIB) {
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
}
this.QQ = '';
}
this.OSRM_EXTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-extract', this.EXE));
this.OSRM_CONTRACT_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-contract', this.EXE));
this.OSRM_ROUTED_PATH = path.resolve(util.format('%s/%s%s', this.BIN_PATH, 'osrm-routed', this.EXE));
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_extract'),
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm_contract'),
this.LIB_OSRM_PATH = util.format('%s/' + this.LIB, this.BIN_PATH, 'osrm');
this.LIB_OSRM_EXTRACT_PATH = util.format('%s/libosrm_extract%s', this.BIN_PATH, this.LIB),
this.LIB_OSRM_CONTRACT_PATH = util.format('%s/libosrm_contract%s', this.BIN_PATH, this.LIB),
this.LIB_OSRM_PATH = util.format('%s/libosrm%s', this.BIN_PATH, this.LIB);
// eslint-disable-next-line no-console
console.info(util.format('Node Version', process.version));
@@ -98,7 +108,7 @@ module.exports = function () {
var verify = (binPath, cb) => {
fs.exists(binPath, (exists) => {
if (!exists) return cb(new Error(util.format('%s is missing. Build failed?', binPath)));
var helpPath = util.format('%s --help', binPath);
var helpPath = util.format('%s --help > /dev/null 2>&1', binPath);
child_process.exec(helpPath, (err) => {
if (err) {
return cb(new Error(util.format('*** %s exited with code %d', helpPath, err.code)));
+13 -21
View File
@@ -164,20 +164,20 @@ module.exports = function () {
};
this.annotationList = (instructions) => {
if (!('annotation' in instructions.legs[0]))
return '';
function zip(list_1, list_2, list_3)
{
let tuples = [];
for (let i = 0; i < list_1.length; ++i) {
tuples.push([list_1[i], list_2[i], list_3[i]]);
}
return tuples;
}
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
};
var merged = {};
instructions.legs.map(l => {
Object.keys(l.annotation).forEach(a => {
if (!merged[a]) merged[a] = [];
merged[a].push(l.annotation[a].join(':'));
});
});
Object.keys(merged).map(a => {
merged[a] = merged[a].join(',');
});
return merged;
this.OSMIDList = (instructions) => {
// OSM node IDs also come from the annotation list
return instructions.legs.map(l => l.annotation.nodes.map(n => n.toString()).join(',')).join(',');
};
this.lanesList = (instructions) => {
@@ -250,12 +250,4 @@ module.exports = function () {
this.distanceList = (instructions) => {
return this.extractInstructionList(instructions, s => s.distance + 'm');
};
this.weightName = (instructions) => {
return instructions ? instructions.weight_name : '';
};
this.weightList = (instructions) => {
return this.extractInstructionList(instructions, s => s.weight);
};
};
+1 -2
View File
@@ -1,6 +1,5 @@
'use strict';
const path = require('path');
const fs = require('fs');
const util = require('util');
const child_process = require('child_process');
@@ -37,7 +36,7 @@ module.exports = function () {
};
this.runBin = (bin, options, env, callback) => {
let cmd = path.resolve(util.format('%s/%s%s', this.BIN_PATH, bin, this.EXE));
let cmd = util.format('%s%s/%s%s%s', this.QQ, this.BIN_PATH, bin, this.EXE, this.QQ);
let opts = options.split(' ').filter((x) => { return x && x.length > 0; });
let log = fs.createWriteStream(this.scenarioLogFile, {'flags': 'a'});
log.write(util.format('*** running %s %s\n', cmd, options));
+2 -33
View File
@@ -35,7 +35,7 @@ module.exports = function () {
if (err) return cb(err);
if (body && body.length) {
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
distances, summary, intersections, lanes, locations, annotation, weight_name, weights;
distances, summary, intersections, lanes, locations;
let json = JSON.parse(body);
@@ -55,9 +55,6 @@ module.exports = function () {
lanes = this.lanesList(json.routes[0]);
summary = this.summary(json.routes[0]);
locations = this.locations(json.routes[0]);
annotation = this.annotationList(json.routes[0]);
weight_name = this.weightName(json.routes[0]);
weights = this.weightList(json.routes[0]);
}
if (headers.has('status')) {
@@ -92,8 +89,7 @@ module.exports = function () {
}
var distance = hasRoute && json.routes[0].distance,
time = hasRoute && json.routes[0].duration,
weight = hasRoute && json.routes[0].weight;
time = hasRoute && json.routes[0].duration;
if (headers.has('distance')) {
if (row.distance.length) {
@@ -105,16 +101,6 @@ module.exports = function () {
}
}
if (headers.has('weight')) {
if (row.weight.length) {
if (!row.weight.match(/[\d\.]+/))
return cb(new Error('*** Weight must be specified as a numeric value. (ex: 8)'));
got.weight = instructions ? util.format('%d', weight) : '';
} else {
got.weight = '';
}
}
if (headers.has('time')) {
if (!row.time.match(/\d+s/))
return cb(new Error('*** Time must be specied in seconds. (ex: 60s)'));
@@ -144,20 +130,6 @@ module.exports = function () {
got.locations = (locations || '').trim();
}
// if header matches 'a:*', parse out the values for *
// and return in that header
headers.forEach((k) => {
let whitelist = ['duration', 'distance', 'datasources', 'nodes', 'weight', 'speed'];
if (k.match(/^a:/)) {
let a_type = k.slice(2);
if (whitelist.indexOf(a_type) == -1)
return cb(new Error('Unrecognized annotation field', a_type));
if (!annotation[a_type])
return cb(new Error('Annotation not found in response', a_type));
got[k] = annotation[a_type];
}
});
var putValue = (key, value) => {
if (headers.has(key)) got[key] = instructions ? value : '';
};
@@ -170,9 +142,6 @@ module.exports = function () {
putValue('distances', distances);
putValue('pronunciations', pronunciations);
putValue('destinations', destinations);
putValue('weight_name', weight_name);
putValue('weights', weights);
putValue('weight', weight);
}
for (var key in row) {
+7 -7
View File
@@ -37,13 +37,13 @@ Feature: Bearing parameter
| bc |
When I route I should get
| from | to | bearings | route | bearing |
| 0 | c | 0 0 | | |
| 0 | c | 45 45 | bc,bc | 0->45,45->0 |
| 0 | c | 85 85 | | |
| 0 | c | 95 95 | | |
| 0 | c | 135 135 | ac,ac | 0->135,135->0 |
| 0 | c | 180 180 | | |
| from | to | bearings | route | bearing |
| 0 | c | 0 0 | | |
| 0 | c | 45 45 | bc,bc | 0->44,44->0 +- 1 |
| 0 | c | 85 85 | | |
| 0 | c | 95 95 | | |
| 0 | c | 135 135 | ac,ac | 0->135,135->0 +- 1|
| 0 | c | 180 180 | | |
Scenario: Testbot - Initial bearing on split way
Given the node map
+2 -2
View File
@@ -20,5 +20,5 @@ Feature: Geometry Compression
When I route I should get
| from | to | route | distance | speed |
| b | e | abcdef,abcdef | 588.5m | 36 km/h |
| e | b | abcdef,abcdef | 588.5m | 36 km/h |
| b | e | abcdef,abcdef | 588.6m | 36 km/h |
| e | b | abcdef,abcdef | 588.6m | 36 km/h |
+62 -62
View File
@@ -16,8 +16,8 @@ Feature: Distance calculation
| ab |
When I route I should get
| from | to | route | distance |
| a | b | ab,ab | 100m |
| from | to | route | distance |
| a | b | ab,ab | 100m +- 2 |
Scenario: Distance should equal sum of segments, leftwinded
Given the node map
@@ -33,7 +33,7 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | d | abcde,abcde | 300m +-1 |
| a | d | abcde,abcde | 300m +-2 |
Scenario: Distance should equal sum of segments, rightwinded
Given the node map
@@ -49,7 +49,7 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | d | abcde,abcde | 300m +-1 |
| a | d | abcde,abcde | 300m +-2 |
Scenario: 10m distances
Given a grid size of 10 meters
@@ -65,12 +65,12 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | b | abc,abc | 10m |
| b | a | abc,abc | 10m |
| b | c | abc,abc | 10m |
| c | b | abc,abc | 10m |
| a | c | abc,abc | 20m |
| c | a | abc,abc | 20m |
| a | b | abc,abc | 10m +-2 |
| b | a | abc,abc | 10m +-2 |
| b | c | abc,abc | 10m +-2 |
| c | b | abc,abc | 10m +-2 |
| a | c | abc,abc | 20m +-4 |
| c | a | abc,abc | 20m +-4 |
Scenario: 100m distances
Given a grid size of 100 meters
@@ -86,12 +86,12 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | b | abc,abc | 100m |
| b | a | abc,abc | 100m |
| b | c | abc,abc | 100m |
| c | b | abc,abc | 100m |
| a | c | abc,abc | 200m |
| c | a | abc,abc | 200m |
| a | b | abc,abc | 100m +-2 |
| b | a | abc,abc | 100m +-2 |
| b | c | abc,abc | 100m +-2 |
| c | b | abc,abc | 100m +-2 |
| a | c | abc,abc | 200m +-4 |
| c | a | abc,abc | 200m +-4 |
Scenario: 1km distance
Given a grid size of 1000 meters
@@ -107,12 +107,12 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | b | abc,abc | 1000m +-1 |
| b | a | abc,abc | 1000m +-1 |
| b | c | abc,abc | 1000m +-1 |
| c | b | abc,abc | 1000m +-1 |
| a | c | abc,abc | 2000m +-1 |
| c | a | abc,abc | 2000m +-1 |
| a | b | abc,abc | 1000m +-2 |
| b | a | abc,abc | 1000m +-2 |
| b | c | abc,abc | 1000m +-2 |
| c | b | abc,abc | 1000m +-2 |
| a | c | abc,abc | 2000m +-4 |
| c | a | abc,abc | 2000m +-4 |
Scenario: Distance of a winding south-north path
Given a grid size of 10 meters
@@ -130,13 +130,13 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | b | abcdefgh,abcdefgh | 10m |
| a | c | abcdefgh,abcdefgh | 20m |
| a | d | abcdefgh,abcdefgh | 30m |
| a | e | abcdefgh,abcdefgh | 40m |
| a | f | abcdefgh,abcdefgh | 50m |
| a | g | abcdefgh,abcdefgh | 60m +-1 |
| a | h | abcdefgh,abcdefgh | 70m +-1 |
| a | b | abcdefgh,abcdefgh | 10m +-2 |
| a | c | abcdefgh,abcdefgh | 20m +-4 |
| a | d | abcdefgh,abcdefgh | 30m +-6 |
| a | e | abcdefgh,abcdefgh | 40m +-8 |
| a | f | abcdefgh,abcdefgh | 50m +-10 |
| a | g | abcdefgh,abcdefgh | 60m +-12 |
| a | h | abcdefgh,abcdefgh | 70m +-14 |
Scenario: Distance of a winding east-west path
Given a grid size of 10 meters
@@ -152,13 +152,13 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | b | abcdefgh,abcdefgh | 10m |
| a | c | abcdefgh,abcdefgh | 20m |
| a | d | abcdefgh,abcdefgh | 30m |
| a | e | abcdefgh,abcdefgh | 40m |
| a | f | abcdefgh,abcdefgh | 50m |
| a | g | abcdefgh,abcdefgh | 60m +-1 |
| a | h | abcdefgh,abcdefgh | 70m +-1 |
| a | b | abcdefgh,abcdefgh | 10m +-2 |
| a | c | abcdefgh,abcdefgh | 20m +-4 |
| a | d | abcdefgh,abcdefgh | 30m +-6 |
| a | e | abcdefgh,abcdefgh | 40m +-8 |
| a | f | abcdefgh,abcdefgh | 50m +-10 |
| a | g | abcdefgh,abcdefgh | 60m +-12 |
| a | h | abcdefgh,abcdefgh | 70m +-14 |
Scenario: Geometric distances
Given a grid size of 100 meters
@@ -201,31 +201,31 @@ Feature: Distance calculation
| xy |
When I route I should get
| from | to | route | distance |
| x | a | xa,xa | 300m +-1 |
| x | b | xb,xb | 316m +-1 |
| x | c | xc,xc | 360m +-1 |
| x | d | xd,xd | 424m +-1 |
| x | e | xe,xe | 360m +-1 |
| x | f | xf,xf | 316m +-1 |
| x | g | xg,xg | 300m +-1 |
| x | h | xh,xh | 316m +-1 |
| x | i | xi,xi | 360m +-1 |
| x | j | xj,xj | 424m +-1 |
| x | k | xk,xk | 360m +-1 |
| x | l | xl,xl | 316m +-1 |
| x | m | xm,xm | 300m +-1 |
| x | n | xn,xn | 316m +-1 |
| x | o | xo,xo | 360m +-1 |
| x | p | xp,xp | 424m +-1 |
| x | q | xq,xq | 360m +-1 |
| x | r | xr,xr | 316m +-1 |
| x | s | xs,xs | 300m +-1 |
| x | t | xt,xt | 316m +-1 |
| x | u | xu,xu | 360m +-1 |
| x | v | xv,xv | 424m +-1 |
| x | w | xw,xw | 360m +-1 |
| x | y | xy,xy | 316m +-1 |
| from | to | route | distance |
| x | a | xa,xa | 300m +-2 |
| x | b | xb,xb | 316m +-2 |
| x | c | xc,xc | 360m +-2 |
| x | d | xd,xd | 424m +-2 |
| x | e | xe,xe | 360m +-2 |
| x | f | xf,xf | 316m +-2 |
| x | g | xg,xg | 300m +-2 |
| x | h | xh,xh | 316m +-2 |
| x | i | xi,xi | 360m +-2 |
| x | j | xj,xj | 424m +-2 |
| x | k | xk,xk | 360m +-2 |
| x | l | xl,xl | 316m +-2 |
| x | m | xm,xm | 300m +-2 |
| x | n | xn,xn | 316m +-2 |
| x | o | xo,xo | 360m +-2 |
| x | p | xp,xp | 424m +-2 |
| x | q | xq,xq | 360m +-2 |
| x | r | xr,xr | 316m +-2 |
| x | s | xs,xs | 300m +-2 |
| x | t | xt,xt | 316m +-2 |
| x | u | xu,xu | 360m +-2 |
| x | v | xv,xv | 424m +-2 |
| x | w | xw,xw | 360m +-2 |
| x | y | xy,xy | 316m +-2 |
@maze
Scenario: Distance of a maze of short segments
@@ -245,4 +245,4 @@ Feature: Distance calculation
When I route I should get
| from | to | route | distance |
| a | t | abcdefghijklmnopqrst,abcdefghijklmnopqrst | 133m +-1 |
| a | t | abcdefghijklmnopqrst,abcdefghijklmnopqrst | 133m +-2 |
+3 -74
View File
@@ -52,9 +52,9 @@ Feature: Basic Distance Matrix
| ab |
When I request a travel time matrix I should get
| | a | b |
| a | 0 | 10 |
| b | 10 | 0 |
| | a | b |
| a | 0 | 9 +- 2 |
| b | 9 ~15% | 0 |
Scenario: Testbot - Travel time matrix of small grid
Given the node map
@@ -219,74 +219,3 @@ Feature: Basic Distance Matrix
| 2 | 70 +-1 | 0 | 30 +-1 | 40 +-1 |
| 3 | 40 +-1 | 50 +-1 | 0 | 10 +-1 |
| 4 | 30 +-1 | 40 +-1 | 70 +-1 | 0 |
Scenario: Testbot - Travel time matrix based on segment durations
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
function segment_function (segment)
segment.weight = 2
segment.duration = 11
end
"""
And the node map
"""
a-b-c-d
.
e
"""
And the ways
| nodes |
| abcd |
| ce |
When I request a travel time matrix I should get
| | a | b | c | d | e |
| a | 0 | 11 | 22 | 33 | 33 |
| b | 11 | 0 | 11 | 22 | 22 |
| c | 22 | 11 | 0 | 11 | 11 |
| d | 33 | 22 | 11 | 0 | 22 |
| e | 33 | 22 | 11 | 22 | 0 |
Scenario: Testbot - Travel time matrix for alternative loop paths
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_precision = 3
function segment_function (segment)
segment.weight = 777
segment.duration = 3
end
"""
And the node map
"""
a 2 1 b
7 4
8 3
c 5 6 d
"""
And the ways
| nodes | oneway |
| ab | yes |
| bd | yes |
| dc | yes |
| ca | yes |
When I request a travel time matrix I should get
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 1 | 0 | 11 | 3 | 2 | 6 | 5 | 8.9 | 7.9 |
| 2 | 1 | 0 | 4 | 3 | 7 | 6 | 9.9 | 8.9 |
| 3 | 9 | 8 | 0 | 11 | 3 | 2 | 5.9 | 4.9 |
| 4 | 10 | 9 | 1 | 0 | 4 | 3 | 6.9 | 5.9 |
| 5 | 6 | 5 | 9 | 8 | 0 | 11 | 2.9 | 1.9 |
| 6 | 7 | 6 | 10 | 9 | 1 | 0 | 3.9 | 2.9 |
| 7 | 3.1 | 2.1 | 6.1 | 5.1 | 9.1 | 8.1 | 0 | 11 |
| 8 | 4.1 | 3.1 | 7.1 | 6.1 | 10.1 | 9.1 | 1 | 0 |
+4 -4
View File
@@ -164,8 +164,8 @@ Feature: Testbot - Handle ferry routes
| xa | primary | | |
| yg | primary | | |
| xy | primary | | |
| abcd | | ferry | 0:02 |
| defg | | ferry | 0:02 |
| abcd | | ferry | 0:01 |
| defg | | ferry | 0:01 |
When I route I should get
| from | to | route | time |
@@ -187,8 +187,8 @@ Feature: Testbot - Handle ferry routes
When I route I should get
| from | to | route | time |
| a | g | abcdefg,abcdefg | 23400s +-3 |
| g | a | abcdefg,abcdefg | 23400s +-3 |
| a | g | abcdefg,abcdefg | 23400s +-2 |
| g | a | abcdefg,abcdefg | 23400s +-2 |
@todo
Scenario: Testbot - Ferry duration formats
+21 -46
View File
@@ -118,35 +118,9 @@ Feature: Basic Map Matching
| dcba | hgfe |
| efgh | abcd |
Scenario: Testbot - request duration annotations
Given the query options
| annotations | duration |
Given the node map
"""
a b c d e g h
i
"""
And the ways
| nodes | oneway |
| abcdegh | no |
| ci | no |
And the speed file
"""
1,2,36
"""
And the contract extra arguments "--segment-speed-file {speeds_file}"
When I match I should get
| trace | matchings | a:duration |
| ach | ach | 1:1,0:1:1:2:1 |
Scenario: Testbot - Duration details
Given the query options
| annotations | duration,nodes |
| annotations | true |
Given the node map
"""
@@ -167,15 +141,15 @@ Feature: Basic Map Matching
And the contract extra arguments "--segment-speed-file {speeds_file}"
When I match I should get
| trace | matchings | a:duration |
| abeh | abeh | 1:0,1:1:1,0:2:1 |
| abci | abci | 1:0,1,0:1 |
| trace | matchings | annotation |
| abeh | abeh | 1:9.897633:1,0:0:0,1:10.008842:0,1:10.008842:0,1:10.008842:0,0:0:0,2:20.017685:0,1:10.008842:0 |
| abci | abci | 1:9.897633:1,0:0:0,1:10.008842:0,0:0.111209:0,1:10.010367:0 |
# The following is the same as the above, but separated for readability (line length)
When I match I should get
| trace | matchings | a:nodes |
| abeh | abeh | 1:2:3,2:3:4:5,4:5:6:7 |
| abci | abci | 1:2:3,2:3,2:3:8 |
| trace | matchings | OSM IDs |
| abeh | abeh | 1,2,3,2,3,4,5,4,5,6,7 |
| abci | abci | 1,2,3,2,3,8,3,8 |
Scenario: Testbot - Regression test for #3037
Given the query options
@@ -200,8 +174,8 @@ Feature: Basic Map Matching
| fb | yes |
When I match I should get
| trace | matchings | geometry |
| efbc | efbc | 1,0.99964,1.00036,0.99964,1.00036,1,1.000719,1 |
| trace | matchings | geometry |
| efbc | efbc | 1,0.99964,1.000359,0.99964,1.000359,1,1.000718,1 |
Scenario: Testbot - Geometry details using geojson
Given the query options
@@ -220,8 +194,8 @@ Feature: Basic Map Matching
| bd | no |
When I match I should get
| trace | matchings | geometry |
| abd | abd | 1,1,1.00009,1,1.00009,1,1.00009,0.99991 |
| trace | matchings | geometry |
| abd | abd | 1,1,1.000089,1,1.000089,1,1.000089,0.99991 |
Scenario: Testbot - Geometry details using polyline
Given the query options
@@ -260,8 +234,8 @@ Feature: Basic Map Matching
| bd | no |
When I match I should get
| trace | matchings | geometry |
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
| trace | matchings | geometry |
| abd | abd | 1,1,1,1.000089,1,1.000089,0.99991,1.000089 |
Scenario: Testbot - Speed greater than speed threshhold
Given a grid size of 10 meters
@@ -303,7 +277,7 @@ Feature: Basic Map Matching
| abcd | 0 1 2 3 | abcd |
# Regression test 1 for issue 3176
Scenario: Testbot - multiple segments: properly expose OSM IDs
Scenario: Testbot - multiuple segments: properly expose OSM IDs
Given the query options
| annotations | true |
@@ -332,9 +306,9 @@ Feature: Basic Map Matching
| fg | no |
When I match I should get
| trace | a:nodes |
| 12 | 1:2:3:4:5:6:7 |
| 21 | 7:6:5:4:3:2:1 |
| trace | OSM IDs |
| 12 | 1,2,3,4,5,6,7 |
| 21 | 7,6,5,4,3,2,1 |
# Regression test 2 for issue 3176
Scenario: Testbot - same edge: properly expose OSM IDs
@@ -360,6 +334,7 @@ Feature: Basic Map Matching
| abcdef | no |
When I match I should get
| trace | a:nodes |
| 12 | 1:2:3:4:5:6 |
| 21 | 6:5:4:3:2:1 |
| trace | OSM IDs |
| 12 | 1,2,3,4,5,6 |
| 21 | 6,5,4,3,2,1 |
+2 -2
View File
@@ -53,7 +53,7 @@ Feature: Routing close to the [0,0] origin
When I route I should get
| from | to | route | distance |
| b | d | abcde,abcde | 200m |
| b | d | abcde,abcde | 200m +-2 |
| d | b | | |
Scenario: North-south oneways crossing the origin
@@ -71,5 +71,5 @@ Feature: Routing close to the [0,0] origin
When I route I should get
| from | to | route | distance |
| b | d | abcde,abcde | 200m |
| b | d | abcde,abcde | 200m +-2 |
| d | b | | |
+14 -14
View File
@@ -11,11 +11,11 @@ Feature: Projection to nearest point on road
Given the profile "testbot"
Given the node locations
| node | lat | lon |
| a | 80.000000 | 0.0000000 |
| b | 80.006350 | 0.0366666 |
| c | 80.012730 | 0.0733333 |
| d | 80.000000 | 0.0733333 |
| node | lat | lon |
| a | 80.00000 | 0.00000 |
| b | 80.00639 | 0.03667 |
| c | 80.01278 | 0.07333 |
| d | 80.00000 | 0.07333 |
And the ways
| nodes |
@@ -23,16 +23,16 @@ Feature: Projection to nearest point on road
Scenario: Projection onto way at high latitudes, 1km distance
When I route I should get
| from | to | route | bearing | distance |
| b | a | abc,abc | 0->225,225->0 | 1000m |
| b | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
| a | d | abc,abc | 0->45,45->0 | 1000m |
| d | a | abc,abc | 0->225,225->0 | 1000m |
| c | d | abc,abc | 0->225,225->0 | 1000m +- 3 |
| d | c | abc,abc | 0->45,45->0 | 1000m +- 3 |
| from | to | route | bearing | distance |
| b | a | abc,abc | 0->225,225->0 | 1000m +- 7 |
| b | c | abc,abc | 0->45,45->0 | 1000m +- 7 |
| a | d | abc,abc | 0->45,45->0 | 1000m +- 7 |
| d | a | abc,abc | 0->225,225->0 | 1000m +- 7 |
| c | d | abc,abc | 0->225,224->0 | 1000m +- 8 |
| d | c | abc,abc | 0->44,45->0 | 1000m +- 8 |
Scenario: Projection onto way at high latitudes, no distance
When I route I should get
| from | to | route | distance |
| d | b | abc,abc | 0m |
| b | d | abc,abc | 0m |
| d | b | abc,abc | 0m +-5 |
| b | d | abc,abc | 0m +-5 |
@@ -9,10 +9,13 @@ Feature: Testbot - side bias
"""
Scenario: Left hand bias
Given the profile file "car" extended with
Given the profile file "testbot" extended with
"""
properties.left_hand_driving = true
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
function turn_function (angle)
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
return (angle >= 0) and k * 1.2 or k / 1.2
end
"""
Given the node map
"""
@@ -28,14 +31,17 @@ Feature: Testbot - side bias
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 24s +-1 |
| d | c | bd,bc,bc | 27s +-1 |
| d | a | bd,ab,ab | 82s +-1 |
| d | c | bd,bc,bc | 100s +-1 |
Scenario: Right hand bias
Given the profile file "car" extended with
Given the profile file "testbot" extended with
"""
properties.left_hand_driving = false
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
function turn_function (angle)
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
return (angle >= 0) and k / 1.2 or k * 1.2
end
"""
And the node map
"""
@@ -51,9 +57,8 @@ Feature: Testbot - side bias
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 27s +-1 |
# should be inverse of left hand bias
| d | c | bd,bc,bc | 24s +-1 |
| d | a | bd,ab,ab | 100s +-1 |
| d | c | bd,bc,bc | 82s +-1 |
Scenario: Roundabout exit counting for left sided driving
And a grid size of 10 meters
-152
View File
@@ -1,152 +0,0 @@
@routing @speed @traffic
Feature: Traffic - speeds
Background: Use specific speeds
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
And the profile "testbot"
And the extract extra arguments "--generate-edge-lookup"
Scenario: Weighting based on speed file
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,27
4,1,27
"""
And the query options
| annotations | datasources |
When I route I should get
| from | to | route | speed | weights | a:datasources |
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0:0 |
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
| a | g | ad,df,fb,fb | 30 km/h | 1275.7,487.5,304.7,0 | 1:0:0 |
Scenario: Weighting based on speed file weights, ETA based on file durations
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,1,20020.7
2,1,1,20020.7
2,3,27,741.5
3,2,27,741.5
1,4,27,1275.7
4,1,27,1275.7
"""
And the query options
| annotations | datasources |
When I route I should get
| from | to | route | speed | weights | a:datasources |
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 | 1:0:0:0 |
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 | 1:0 |
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
| a | d | ad,ad | 27 km/h | 1275.7,0 | 1:0 |
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
| g | b | ab,ab | 1 km/h | 10010.4,0 | 1:0 |
| a | g | ab,ab | 1 km/h | 10010.3,0 | 1 |
Scenario: Weighting based on speed file weights, ETA based on file durations
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_precision = 3
"""
And the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,1,20020.789
2,1,1,20020.123
2,3,27,741.56789
3,2,27,741.3
1,4,1,34445.12
4,1,1,34445.3
"""
And the query options
| annotations | datasources |
When I route I should get
| from | to | route | speed | weights | a:datasources |
| a | b | ab,ab | 1 km/h | 20020.789,0 | 1:0 |
| a | c | ab,bc,bc | 2 km/h | 20020.789,741.568,0 | 1:1:0 |
| b | c | bc,bc | 27 km/h | 741.568,0 | 1:0 |
| a | d | ab,eb,de,de | 2 km/h | 20020.789,378.169,400.415,0 | 1:0:0 |
| d | c | dc,dc | 36 km/h | 956.805,0 | 0 |
| g | b | ab,ab | 1 km/h | 10010.392,0 | 1:0 |
| a | g | ab,ab | 1 km/h | 10010.397,0 | 1 |
| g | a | ab,ab | 1 km/h | 10010.064,0 | 1:1 |
Scenario: Speeds that isolate a single node (a)
Given the contract extra arguments "--segment-speed-file {speeds_file}"
And the node locations
| node | lat | lon |
| h | 2.075 | 19.1 |
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,0
4,1,0
"""
And the query options
| annotations | true |
When I route I should get
| from | to | route | speed | weights | a:datasources |
| a | b | fb,fb | 36 km/h | 329.4,0 | 0 |
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 | 0:1:0 |
| b | c | bc,bc | 27 km/h | 741.5,0 | 1:0 |
| a | d | fb,df,df | 36 km/h | 140,487.5,0 | 0:0:0 |
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
| g | b | fb,fb | 36 km/h | 164.7,0 | 0 |
| a | g | fb,fb | 36 km/h | 164.7,0 | 0 |
Scenario: Verify that negative values cause an error, they're not valid at all
Given the speed file
"""
1,2,-10
2,1,-20
2,3,27
3,2,27
1,4,-3
4,1,-5
"""
And the data has been extracted
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
And stderr should contain "malformed"
And it should exit with an error
@@ -37,30 +37,14 @@ Feature: Traffic - turn penalties applied to turn onto which a phantom node snap
Given the turn penalty file
"""
1,2,5,0,comment
3,4,7,-30
3,4,7,-20
"""
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get
| from | to | route | speed | time |
| a | e | ab,be,be | 36 km/h | 40s +-1 |
| 1 | e | ab,be,be | 36 km/h | 30s +-1 |
| b | f | bc,cf,cf | 36 km/h | 40s +-1 |
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 |
| c | g | cd,dg,dg | 144 km/h | 10s +-1 |
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 |
Scenario: Weighting based on turn penalty file with weights
Given the turn penalty file
"""
1,2,5,0,-3.33,comment
3,4,7,-30,100.75
"""
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get
| from | to | route | speed | time | weights |
| a | e | ab,be,be | 36 km/h | 40s +-1 | 16.7,20,0 |
| 1 | e | ab,be,be | 36 km/h | 30s +-1 | 6.7,20,0 |
| b | f | bc,cf,cf | 36 km/h | 40s +-1 | 20,20,0 |
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 | 10,20,0 |
| c | g | cd,dg,dg | 144 km/h | 10s +-1 | 120.8,20,0 |
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 | 110.8,20,0 |
| from | to | route | speed | time |
| a | e | ab,be,be | 36 km/h | 40s +-1 |
| 1 | e | ab,be,be | 36 km/h | 30s +-1 |
| b | f | bc,cf,cf | 36 km/h | 40s +-1 |
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 |
| c | g | cd,dg,dg | 71 km/h | 20s +-1 |
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 |
+23 -206
View File
@@ -5,25 +5,7 @@ Feature: Basic trip planning
Given the profile "testbot"
Given a grid size of 10 meters
Scenario: Testbot - Trip: Roundtrip with one waypoint
Given the node map
"""
a b
c d
"""
And the ways
| nodes |
| ab |
| bc |
| cb |
| da |
When I plan a trip I should get
| waypoints | trips |
| a | aa |
Scenario: Testbot - Trip: Roundtrip with waypoints (less than 10)
Scenario: Testbot - Trip planning with less than 10 nodes
Given the node map
"""
a b
@@ -42,7 +24,7 @@ Feature: Basic trip planning
| a,b,c,d | abcda | 7.6 |
| d,b,c,a | dbcad | 7.6 |
Scenario: Testbot - Trip: Roundtrip waypoints (more than 10)
Scenario: Testbot - Trip planning with more than 10 nodes
Given the node map
"""
a b c d
@@ -55,6 +37,7 @@ Feature: Basic trip planning
| nodes |
| ab |
| bc |
| cb |
| de |
| ef |
| fg |
@@ -65,85 +48,12 @@ Feature: Basic trip planning
| kl |
| la |
When I plan a trip I should get
| waypoints | trips |
| a,b,c,d,e,f,g,h,i,j,k,l | alkjihgfedcba |
| a,b,c,d,e,f,g,h,i,j,k,l | cbalkjihgfedc |
Scenario: Testbot - Trip: Roundtrip FS waypoints (more than 10)
Given the node map
"""
a b c d
l e
k f
j i h g
"""
And the ways
| nodes |
| ab |
| bc |
| de |
| ef |
| fg |
| gh |
| hi |
| ij |
| jk |
| kl |
| la |
When I plan a trip I should get
| waypoints | source | trips |
| a,b,c,d,e,f,g,h,i,j,k,l | first | alkjihgfedcba |
Scenario: Testbot - Trip: Roundtrip FE waypoints (more than 10)
Given the query options
| source | last |
Given the node map
"""
a b c d
l e
k f
j i h g
"""
And the ways
| nodes |
| ab |
| bc |
| de |
| ef |
| fg |
| gh |
| hi |
| ij |
| jk |
| kl |
| la |
When I plan a trip I should get
| waypoints | trips |
| a,b,c,d,e,f,g,h,i,j,k,l | lkjihgfedcbal |
Scenario: Testbot - Trip: Unroutable roundtrip with waypoints (less than 10)
Given the node map
"""
a b
d c
"""
And the ways
| nodes |
| ab |
| dc |
When I plan a trip I should get
| waypoints | status | message |
| a,b,c,d | NoTrips | No trip visiting all destinations possible. |
Scenario: Testbot - Trip: Unroutable roundtrip with waypoints (more than 10)
Scenario: Testbot - Trip planning with multiple scc
Given the node map
"""
a b c d
@@ -152,7 +62,7 @@ Feature: Basic trip planning
j i h g
q m n
p o
p o
"""
And the ways
@@ -175,106 +85,13 @@ Feature: Basic trip planning
| pq |
| qm |
When I plan a trip I should get
| waypoints | status | message |
| a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p | NoTrips | No trip visiting all destinations possible. |
# Test TFSE
Scenario: Testbot - Trip: TFSE with errors
Given the node map
"""
a b
d c
"""
And the ways
| nodes |
| ab |
| dc |
When I plan a trip I should get
| waypoints | source | destination | roundtrip | status | message |
| a,b,c,d | first | last | false | NoTrips | No trip visiting all destinations possible. |
Scenario: Testbot - Trip: FSE with waypoints (less than 10)
Given the node map
"""
a b
c
e d
"""
And the ways
| nodes |
| ab |
| ac |
| ad |
| ae |
| bc |
| bd |
| be |
| cd |
| ce |
| de |
When I plan a trip I should get
| waypoints | source | destination |roundtrip | trips | durations | distance |
| a,b,d,e,c | first | last | false | abedc | 8.200000000000001 | 81.6 |
| waypoints | trips |
| a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p | defghijklabcd,mnopm |
Scenario: Testbot - Trip: FSE with waypoints (more than 10)
Given the node map
"""
a b c d e f g h i j k
"""
And the ways
| nodes |
| ab |
| bc |
| cd |
| de |
| ef |
| fg |
| gh |
| hi |
| ij |
| jk |
When I plan a trip I should get
| waypoints | source | destination | roundtrip | trips | durations | distance |
| a,b,c,d,e,h,i,j,k,g,f | first | last | false | abcdeghijkf | 15 | 149.8 |
Scenario: Testbot - Trip: FSE roundtrip with waypoints (less than 10)
Given the node map
"""
a b
c
e d
"""
And the ways
| nodes |
| ab |
| ac |
| ad |
| ae |
| bc |
| bd |
| be |
| cd |
| ce |
| de |
When I plan a trip I should get
| waypoints | source | destination | roundtrip | trips |
| a,b,d,e,c | first | last | true | abedca |
Scenario: Testbot - Trip: midway points in isoldated roads should return no trips
# Test single node in each component #1850
Scenario: Testbot - Trip planning with less than 10 nodes
Given the node map
"""
a 1 b
@@ -288,10 +105,10 @@ Feature: Basic trip planning
| cd |
When I plan a trip I should get
| waypoints | status | message |
| 1,2 | NoTrips | No trip visiting all destinations possible. |
| waypoints | trips |
| 1,2 | |
Scenario: Testbot - Trip: Repeated Coordinate
Scenario: Testbot - Repeated Coordinate
Given the node map
"""
a b
@@ -306,7 +123,7 @@ Feature: Basic trip planning
| a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a | |
Scenario: Testbot - Trip: geometry details of geojson
Scenario: Testbot - Trip with geometry details of geojson
Given the query options
| geometries | geojson |
@@ -324,11 +141,11 @@ Feature: Basic trip planning
| da |
When I plan a trip I should get
| waypoints | trips | durations | geometry |
| a,b,c,d | abcda | 7.6 | 1,1,1.00009,1,1,0.99991,1.00009,1,1,1,1.00009,0.99991,1,1 |
| d,b,c,a | dbcad | 7.6 | 1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009,1,1,1,1.00009,0.99991 |
| waypoints | trips | durations | geometry |
| a,b,c,d | abcda | 7.6 | 1,1,1.000089,1,1,0.99991,1.000089,1,1,1,1.000089,0.99991,1,1 |
| d,b,c,a | dbcad | 7.6 | 1.000089,0.99991,1,1,1.000089,1,1,0.99991,1.000089,1,1,1,1.000089,0.99991 |
Scenario: Testbot - Trip: geometry details of polyline
Scenario: Testbot - Trip with geometry details of polyline
Given the query options
| geometries | polyline |
@@ -350,7 +167,7 @@ Feature: Basic trip planning
| a,b,c,d | abcda | 7.6 | 1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009,1,1 |
| d,b,c,a | dbcad | 7.6 | 0.99991,1.00009,1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009 |
Scenario: Testbot - Trip: geometry details of polyline6
Scenario: Testbot - Trip with geometry details of polyline6
Given the query options
| geometries | polyline6 |
@@ -368,6 +185,6 @@ Feature: Basic trip planning
| da |
When I plan a trip I should get
| waypoints | trips | durations | geometry |
| a,b,c,d | abcda | 7.6 | 1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009,1,1 |
| d,b,c,a | dbcad | 7.6 | 0.99991,1.00009,1,1,1,1.00009,0.99991,1,1,1.00009,1,1,0.99991,1.00009 |
| waypoints | trips | durations | geometry |
| a,b,c,d | abcda | 7.6 | 1,1,1,1.000089,0.99991,1,1,1.000089,1,1,0.99991,1.000089,1,1 |
| d,b,c,a | dbcad | 7.6 | 0.99991,1.000089,1,1,1,1.000089,0.99991,1,1,1.000089,1,1,0.99991,1.000089 |
+2 -1
View File
@@ -23,6 +23,7 @@ Feature: Handling of UTF characters
| c | d | Cyrillic Москва,Cyrillic Москва |
@todo
Scenario: Up to 255 Unicode Code Points (255 x Panda Code Point)
Given the node map
"""
@@ -34,6 +35,6 @@ Feature: Handling of UTF characters
| ab | ab | primary |
| bc | 🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 | primary |
When I route 2 times I should get
When I route 100 times I should get
| from | to | route |
| a | c | ab,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 |
-16
View File
@@ -327,19 +327,3 @@ Feature: Via points
When I route I should get
| waypoints | route |
| a,b,e | |
@todo @3359
Scenario: U-Turn In Bearings
Given the node map
"""
a 1 b
"""
And the ways
| nodes |
| ab |
When I route I should get
| waypoints | bearings | route | turns |
| 1,a | 90,2 270,2 | ab,ab,ab | depart,turn uturn,arrive |
| 1,b | 270,2 90,2 | ab,ab,ab | depart,turn uturn,arrive |
-321
View File
@@ -1,321 +0,0 @@
@testbot
Feature: Weight tests
Background:
Given the profile "testbot"
Given a grid size of 10 meters
Given the extract extra arguments "--generate-edge-lookup"
Given the query options
| geometries | geojson |
Scenario: Weight details
Given the query options
| annotations | weight |
Given the node map
"""
s
·
a---b---c
|
d
|··t
e
"""
And the ways
| nodes |
| abc |
| cde |
When I route I should get
| waypoints | route | a:weight |
| s,t | abc,cde,cde | 1.1:2:2:1 |
When I route I should get
| waypoints | route | times | weight_name | weights |
| s,t | abc,cde,cde | 3.1s,3s,0s | duration | 3.1,3,0 |
# FIXME include/engine/guidance/assemble_geometry.hpp:95
Scenario: Start and target on the same and adjacent edge
Given the query options
| annotations | distance,duration,weight,nodes,speed |
Given the node map
"""
a-------b-------c
· · ·
s t e
"""
And the ways
| nodes |
| abc |
When I route I should get
| waypoints | route | distances | weights | times | a:distance | a:duration | a:weight | a:speed |
| s,t | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 3 | 3 | 6.7 |
| t,s | abc,abc | 20m,0m | 2.1,0 | 2.1s,0s | 20.017685 | 3.1 | 3.1 | 6.5 |
| s,e | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 30.026527:10.008842 | 3.1:1 | 3.1:1 | 9.7:10 |
| e,s | abc,abc | 40m,0m | 4.1,0 | 4.1s,0s | 10.008842:30.026527 | 1:3.1 | 1:3.1 | 10:9.7 |
Scenario: Step weights -- way_function: fail if no weight or weight_per_meter property
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.forward_speed = 42
result.backward_speed = 42
end
"""
And the node map
"""
a---b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
Then stderr should contain "There are no edges"
And it should exit with an error
Scenario: Step weights -- way_function: second way wins
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.duration = 42
result.weight = 35
end
"""
Given the node map
"""
a---b---c---d---e---f---g---h
"""
And the ways
| nodes |
| abcdef |
| abcdefgh |
When I route I should get
| waypoints | route | distance | weights | times |
| a,f | , | 100m | 25,0 | 30s,0s |
| f,a | , | 100m | 25,0 | 30s,0s |
| a,h | , | 140m +-1 | 35,0 | 42s,0s |
| h,a | , | 140m +-1 | 35,0 | 42s,0s |
Scenario: Step weights -- way_function: higher weight_per_meter is preferred
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.duration = 42
result.forward_rate = 1
result.backward_rate = 0.5
end
"""
Given the node map
"""
a---b---c---d---e---f---g---h
"""
And the ways
| nodes |
| abcdefgh |
| abcdef |
| fgh |
When I route I should get
| waypoints | route | distance | weights | times |
| a,f | , | 100m | 99.9,0 | 30s,0s |
| f,a | , | 100m | 199.8,0 | 30s,0s |
| a,h | , | 140m | 139.9,0 | 42s,0s |
| h,a | , | 140m | 279.8,0 | 42s,0s |
| f,h | , | 40m | 40,0 | 12s,0s |
| h,f | , | 40m | 80,0 | 12s,0s |
Scenario: Step weights -- segment_function
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.weight = 42
result.duration = 3
end
function segment_function (segment)
segment.weight = 1
segment.duration = 11
end
"""
Given the node map
"""
a---b---c---d---e---f---g---h
"""
And the ways
| nodes |
| abcdefgh |
| abcdef |
| fgh |
When I route I should get
| waypoints | route | distance | weights | times |
| a,f | , | 100m | 5,0 | 55s,0s |
| f,a | , | 100m | 5,0 | 55s,0s |
| a,h | , | 140m +-1 | 7,0 | 77s,0s |
| h,a | , | 140m +-1 | 7,0 | 77s,0s |
| f,h | , | 40m +-1 | 2,0 | 22s,0s |
| h,f | , | 40m +-1 | 2,0 | 22s,0s |
Scenario: Step weights -- segment_function and turn_function with weight precision
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
properties.weight_precision = 3
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.weight = 42
result.duration = 3
end
function segment_function (segment)
segment.weight = 1.11
segment.duration = 100
end
function turn_function (turn)
print (turn.angle)
turn.weight = 2 + turn.angle / 100
turn.duration = turn.angle
end
"""
Given the node map
"""
a---b---c---d
e
"""
And the ways
| nodes |
| abcd |
| ce |
When I route I should get
| waypoints | route | distance | weights | times |
| a,c | , | 40m +-.1 | 5.119,0 | 289.9s,0s |
| a,e | ,, | 60m +-.1 | 5.119,1.11,0 | 289.9s,100s,0s |
| e,a | ,, | 60m +-.1 | 2.21,2.22,0 | 10.1s,200s,0s |
| e,d | ,, | 40m +-.1 | 4.009,1.11,0 | 189.9s,100s,0s |
| d,e | ,, | 40m +-.1 | 2.21,1.11,0 | 10.1s,100s,0s |
Scenario: Step weights -- segment_function with speed and turn updates
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.weight = 42
result.duration = 3
end
function segment_function (segment)
segment.weight = 10
segment.duration = 11
end
"""
And the node map
"""
a---b---c---d
.
e
"""
And the ways
| nodes |
| abcd |
| ce |
And the speed file
"""
1,2,36,42
2,1,36,42
"""
And the turn penalty file
"""
2,3,5,25.5,16.7
"""
And the contract extra arguments "--segment-speed-file {speeds_file} --turn-penalty-file {penalties_file}"
When I route I should get
| waypoints | route | distance | weights | times |
| a,d | , | 59.9m | 62,0 | 24s,0s |
| a,e | ,, | 60.1m | 68.7,10,0 | 38.5s,11s,0s |
| d,e | ,, | 39.9m | 10,10,0 | 11s,11s,0s |
Scenario: Step weights -- segment_function with speed and turn updates with fallback to durations
Given the profile file "testbot" extended with
"""
api_version = 1
properties.weight_precision = 3
"""
And the node map
"""
a---b---c---d
.
e
"""
And the ways
| nodes |
| abcd |
| ce |
And the speed file
"""
1,2,24
2,1,24
"""
And the turn penalty file
"""
2,3,5,1
"""
And the contract extra arguments "--segment-speed-file {speeds_file} --turn-penalty-file {penalties_file}"
When I route I should get
| waypoints | route | distance | weights | times |
| a,d | abcd,abcd | 59.9m | 6.993,0 | 7s,0s |
| a,e | abcd,ce,ce | 60.1m | 6.002,2.002,0 | 6s,2s,0s |
| d,e | abcd,ce,ce | 39.9m | 1.991,2.002,0 | 2s,2s,0s |
+14 -3
View File
@@ -78,9 +78,20 @@ class Contractor
private:
ContractorConfig config;
EdgeID LoadEdgeExpandedGraph(const ContractorConfig &config,
std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
std::vector<EdgeWeight> &node_weights);
EdgeID
LoadEdgeExpandedGraph(const std::string &edge_based_graph_path,
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
std::vector<EdgeWeight> &node_weights,
const std::string &edge_segment_lookup_path,
const std::string &edge_penalty_path,
const std::vector<std::string> &segment_speed_path,
const std::vector<std::string> &turn_penalty_path,
const std::string &nodes_filename,
const std::string &geometry_filename,
const std::string &datasource_names_filename,
const std::string &datasource_indexes_filename,
const std::string &rtree_leaf_filename,
const double log_edge_updates_factor);
};
}
}
+3 -10
View File
@@ -39,7 +39,7 @@ namespace contractor
struct ContractorConfig
{
ContractorConfig() : requested_num_threads(0), weight_multiplier(10.) {}
ContractorConfig() : requested_num_threads(0) {}
// Infer the output names from the path of the .osrm file
void UseDefaultOutputNames()
@@ -49,15 +49,12 @@ struct ContractorConfig
graph_output_path = osrm_input_path.string() + ".hsgr";
edge_based_graph_path = osrm_input_path.string() + ".ebg";
edge_segment_lookup_path = osrm_input_path.string() + ".edge_segment_lookup";
turn_weight_penalties_path = osrm_input_path.string() + ".turn_weight_penalties";
turn_duration_penalties_path = osrm_input_path.string() + ".turn_duration_penalties";
turn_penalties_index_path = osrm_input_path.string() + ".turn_penalties_index";
edge_penalty_path = osrm_input_path.string() + ".edge_penalties";
node_based_graph_path = osrm_input_path.string() + ".nodes";
geometry_path = osrm_input_path.string() + ".geometry";
rtree_leaf_path = osrm_input_path.string() + ".fileIndex";
datasource_names_path = osrm_input_path.string() + ".datasource_names";
datasource_indexes_path = osrm_input_path.string() + ".datasource_indexes";
profile_properties_path = osrm_input_path.string() + ".properties";
}
boost::filesystem::path config_file_path;
@@ -69,9 +66,7 @@ struct ContractorConfig
std::string edge_based_graph_path;
std::string edge_segment_lookup_path;
std::string turn_weight_penalties_path;
std::string turn_duration_penalties_path;
std::string turn_penalties_index_path;
std::string edge_penalty_path;
std::string node_based_graph_path;
std::string geometry_path;
std::string rtree_leaf_path;
@@ -79,7 +74,6 @@ struct ContractorConfig
unsigned requested_num_threads;
double log_edge_updates_factor;
double weight_multiplier;
// A percentage of vertices that will be contracted for the hierarchy.
// Offers a trade-off between preprocessing and query time.
@@ -91,7 +85,6 @@ struct ContractorConfig
std::vector<std::string> turn_penalty_lookup_paths;
std::string datasource_indexes_path;
std::string datasource_names_path;
std::string profile_properties_path;
};
}
}
@@ -1,50 +0,0 @@
#ifndef OSRM_CONTRACTOR_DIJKSTRA_HPP
#define OSRM_CONTRACTOR_DIJKSTRA_HPP
#include "contractor/contractor_graph.hpp"
#include "contractor/contractor_heap.hpp"
#include "util/typedefs.hpp"
#include <cstddef>
namespace osrm
{
namespace contractor
{
// allow access to the heap itself, add Dijkstra functionality on top
class ContractorDijkstra
{
public:
ContractorDijkstra(std::size_t heap_size);
// search the graph up
void Run(const unsigned number_of_targets,
const int node_limit,
const int weight_limit,
const NodeID forbidden_node,
const ContractorGraph &graph);
// adaption of the heap interface
void Clear();
bool WasInserted(const NodeID node) const;
void Insert(const NodeID node,
const ContractorHeap::WeightType weight,
const ContractorHeap::DataType &data);
// cannot be const due to node-hash access in the binary heap :(
ContractorHeap::WeightType GetKey(const NodeID node);
private:
void RelaxNode(const NodeID node,
const int node_weight,
const NodeID forbidden_node,
const ContractorGraph &graph);
ContractorHeap heap;
};
} // namespace contractor
} // namespace osrm
#endif // OSRM_CONTRACTOR_DIJKSTRA_HPP
-47
View File
@@ -1,47 +0,0 @@
#ifndef OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_
#define OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_
#include "util/dynamic_graph.hpp"
#include <algorithm>
namespace osrm
{
namespace contractor
{
struct ContractorEdgeData
{
ContractorEdgeData()
: weight(0), duration(0), id(0), originalEdges(0), shortcut(0), forward(0), backward(0),
is_original_via_node_ID(false)
{
}
ContractorEdgeData(EdgeWeight weight,
EdgeWeight duration,
unsigned original_edges,
unsigned id,
bool shortcut,
bool forward,
bool backward)
: weight(weight), duration(duration), id(id),
originalEdges(std::min((1u << 28) - 1u, original_edges)), shortcut(shortcut),
forward(forward), backward(backward), is_original_via_node_ID(false)
{
}
EdgeWeight weight;
EdgeWeight duration;
unsigned id;
unsigned originalEdges : 28;
bool shortcut : 1;
bool forward : 1;
bool backward : 1;
bool is_original_via_node_ID : 1;
};
using ContractorGraph = util::DynamicGraph<ContractorEdgeData>;
using ContractorEdge = ContractorGraph::InputEdge;
} // namespace contractor
} // namespace osrm
#endif // OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_

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