Compare commits
197 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cf8a3d51f | |||
| 7886a1d446 | |||
| fbeacde0d5 | |||
| 59c60f7c54 | |||
| 46922646c2 | |||
| 1e0ec0ab8f | |||
| 3bde88eec5 | |||
| 513a799665 | |||
| 74989f8906 | |||
| 9bf288c6dc | |||
| 3905074a81 | |||
| 42afcdf115 | |||
| 117c6b77aa | |||
| 5f5675d361 | |||
| c6472eb289 | |||
| 7b756bd0e9 | |||
| 8aed6d0d68 | |||
| d63c0ab9b9 | |||
| 0ef9580a9a | |||
| 31a997a3f7 | |||
| 2ab7fcb0b2 | |||
| e498dff90e | |||
| a9bde88dcb | |||
| d5d8f62c0d | |||
| f04377abff | |||
| e82f678665 | |||
| 4db1b7bea5 | |||
| 32c5f14ed3 | |||
| cbd88c63b9 | |||
| 621e302a38 | |||
| 1db794b2cb | |||
| a1ccedb5bf | |||
| 189f8c3265 | |||
| 12238ebb52 | |||
| b033ac9f0b | |||
| a411589092 | |||
| 45673581ea | |||
| f9ecdca5d5 | |||
| accdbe92f0 | |||
| 644d082cb9 | |||
| f948fb081b | |||
| 42445dc10c | |||
| c1041e5a64 | |||
| b2bc169547 | |||
| 5713460331 | |||
| cc2e26fd52 | |||
| c0bd9da645 | |||
| 7348e7ca55 | |||
| 519dc986f9 | |||
| 1ae2964b0f | |||
| 237e8e02fd | |||
| 865052352e | |||
| 2064d6b2ce | |||
| 6c9227d4d0 | |||
| ef66e271c1 | |||
| 7c3b587028 | |||
| d399014633 | |||
| e27ce0e518 | |||
| 1a1e16c5b4 | |||
| 01e7232add | |||
| c69f99f282 | |||
| 391163cba0 | |||
| 4cddec298f | |||
| c306a59854 | |||
| dcc1b5ab2b | |||
| 938dff011f | |||
| 9123c93a90 | |||
| a551286a8f | |||
| 86fd04e556 | |||
| b6dbf81206 | |||
| af47252efe | |||
| 3b81b39998 | |||
| 802b93fa9a | |||
| 7899444135 | |||
| 1ab2b87cc0 | |||
| 97c66c6c82 | |||
| 733207d4a1 | |||
| a0ed70f0a2 | |||
| d3a6b5a77e | |||
| 7a523713c7 | |||
| f7265892ed | |||
| be266c7c2b | |||
| b1b41435b6 | |||
| 8f32a80778 | |||
| 5d79e0ac2f | |||
| 47a6cd5462 | |||
| 7528b27f99 | |||
| a4f9499305 | |||
| bb244e28bb | |||
| 6fac14dbd8 | |||
| 8b144f22c9 | |||
| 146eb3a20e | |||
| d8e444e620 | |||
| da9d63a384 | |||
| c5e85f3d6d | |||
| e05750547c | |||
| 315823cce1 | |||
| 6ff07f4e82 | |||
| 41b54cf25d | |||
| 5ee15ee339 | |||
| 01b0bce2d5 | |||
| cb57ccacef | |||
| 7e0d14b113 | |||
| d06eec5e42 | |||
| 9648821a79 | |||
| 21fb18fe5e | |||
| 6a2518c0df | |||
| 7886d06839 | |||
| 5a9eb6ef72 | |||
| b6c3d1d5bf | |||
| 9b2f6585fb | |||
| 46fd17a9ff | |||
| da73bae9c6 | |||
| 766e2713ab | |||
| 9957254a5a | |||
| 9f6859561c | |||
| 88573a66cd | |||
| 3ccbe9842c | |||
| 5971822f82 | |||
| cdf6baba1d | |||
| 4b7ddb6826 | |||
| 06b74c1f08 | |||
| 3a0eed2ee5 | |||
| 2557bdcf39 | |||
| 12d478784b | |||
| 38fef77d70 | |||
| e8bae78749 | |||
| e14bc30428 | |||
| 9485c97738 | |||
| 11aed6c93e | |||
| d53c267129 | |||
| 2f6de614c1 | |||
| 087080a6c3 | |||
| 41b22916f3 | |||
| 89f1071947 | |||
| 464de785cb | |||
| 8986777c58 | |||
| 65def1a9e2 | |||
| 176c2244ad | |||
| b161e10b73 | |||
| 5bef5dcb04 | |||
| 46a4c27582 | |||
| acc6da86de | |||
| 4d84bc0f01 | |||
| c737635a3b | |||
| b7eeafb183 | |||
| 677306eeee | |||
| 2284ebaacb | |||
| 6b4975b2e4 | |||
| 94c38d115a | |||
| b1e309b4eb | |||
| e8ce119972 | |||
| 8b7cd2931b | |||
| 8bee57b0b0 | |||
| 6bfe3a2d41 | |||
| 7f71f0ed12 | |||
| 583aaff286 | |||
| b24f5c7c1a | |||
| 026f71934b | |||
| 1353d55880 | |||
| b09f637d02 | |||
| 979f9cab20 | |||
| eb6083daf5 | |||
| c4718495a0 | |||
| 0d36d472c9 | |||
| 35422a0fb5 | |||
| d012b44b7f | |||
| eda6d9dc7c | |||
| 63c86198a3 | |||
| 33bdfe9cf9 | |||
| a87c5998a1 | |||
| c918a7957b | |||
| 61e6afdef0 | |||
| 95dc36e908 | |||
| 951a4dc112 | |||
| c09b9b4c99 | |||
| b0873e2aa4 | |||
| 2bdb8fce63 | |||
| d8a692740a | |||
| 14797c421e | |||
| 280b000f07 | |||
| fb4834458e | |||
| c7a1576100 | |||
| aebf6fa0b1 | |||
| f76e3d4522 | |||
| eaf42ba437 | |||
| e83905b783 | |||
| 0b868969be | |||
| b4710633b1 | |||
| 7d076e9344 | |||
| 71d64e8cd9 | |||
| 748fd3efa9 | |||
| 1fc63e1e72 | |||
| fd6bb5ec1f | |||
| 261dbf3edd | |||
| 9e323d2d42 | |||
| 1309dd2a0f |
@@ -0,0 +1,12 @@
|
|||||||
|
# Issue
|
||||||
|
|
||||||
|
What issue is this PR targeting? Is there no issue that covers the problem addressed here? Please open a corresponding issue and link it from here.
|
||||||
|
|
||||||
|
## Tasklist
|
||||||
|
- [ ] ADD OWN TASKS HERE
|
||||||
|
- [ ] add regression / cucumber cases (see docs/testing.md)
|
||||||
|
- [ ] review
|
||||||
|
- [ ] adjust for for comments
|
||||||
|
|
||||||
|
## Requirements / Relations
|
||||||
|
Link any requirements here. Other pull requests this PR is based on?
|
||||||
+3
-24
@@ -13,7 +13,7 @@ notifications:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- "5.3"
|
- 5.4
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
ccache: true
|
ccache: true
|
||||||
@@ -25,7 +25,7 @@ env:
|
|||||||
global:
|
global:
|
||||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||||
- CCACHE_COMPRESS=1
|
- CCACHE_COMPRESS=1
|
||||||
- CASHER_TIME_OUT=1000
|
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
||||||
- JOBS=4
|
- JOBS=4
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
@@ -43,14 +43,6 @@ matrix:
|
|||||||
packages: ['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']
|
packages: ['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']
|
||||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
|
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-4.8-debug"
|
|
||||||
addons: &gcc48
|
|
||||||
apt:
|
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
|
||||||
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
|
||||||
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Debug'
|
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "clang-3.8-debug"
|
compiler: "clang-3.8-debug"
|
||||||
addons: &clang38
|
addons: &clang38
|
||||||
@@ -77,19 +69,6 @@ matrix:
|
|||||||
compiler: "gcc-5-release-i686"
|
compiler: "gcc-5-release-i686"
|
||||||
env: TARGET_ARCH='i686' CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
env: TARGET_ARCH='i686' CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-4.8-release-armhf"
|
|
||||||
env: TARGET_ARCH='armhf' CCOMPILER='arm-linux-gnueabihf-gcc-4.8' CXXCOMPILER='arm-linux-gnueabihf-g++-4.8' BUILD_TYPE='Release'
|
|
||||||
|
|
||||||
# Disabled because of CI slowness
|
|
||||||
#- os: linux
|
|
||||||
#- compiler: gcc
|
|
||||||
#- addons: &gcc48
|
|
||||||
#- apt:
|
|
||||||
#- sources: ['ubuntu-toolchain-r-test']
|
|
||||||
#- packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
|
||||||
#- env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Release'
|
|
||||||
|
|
||||||
# Disabled because of CI slowness
|
# Disabled because of CI slowness
|
||||||
#- os: linux
|
#- os: linux
|
||||||
#- compiler: clang
|
#- compiler: clang
|
||||||
@@ -152,7 +131,7 @@ install:
|
|||||||
fi
|
fi
|
||||||
- mkdir build && pushd build
|
- mkdir build && pushd build
|
||||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=ON
|
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=ON -DENABLE_CCACHE=ON
|
||||||
- echo "travis_fold:start:MAKE"
|
- echo "travis_fold:start:MAKE"
|
||||||
- make osrm-extract --jobs=3
|
- make osrm-extract --jobs=3
|
||||||
- make --jobs=${JOBS}
|
- make --jobs=${JOBS}
|
||||||
|
|||||||
+82
-11
@@ -1,16 +1,87 @@
|
|||||||
# 5.3.2
|
# 5.4.3
|
||||||
Changes from 5.3.1
|
- Changes from 5.4.2
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
- fixed a bug that occurred when trimming very short segments at the begin/end of a route (less than 1 meter)
|
- #3254 Fixed a bug that could end up hiding roundabout instructions
|
||||||
|
- #3260 fixed a bug that provided the wrong location in the arrival instruction
|
||||||
|
|
||||||
# 5.3.1
|
# 5.4.2
|
||||||
Changes from 5.3.1
|
- Changes from 5.4.1
|
||||||
- Bugfixes:
|
- Bugfixes
|
||||||
- Disabled broken lane handling for complex uturn/oneway combinations for now (190 intersections affected on the planet)
|
- #3032 Fixed a bug that could result in emitting `invalid` as an instruction type on sliproads with mode changes
|
||||||
- Fixed a bug with overlaping geometries, which broke OSRM on recent Egypt extracts with data-modelling issues
|
- #3085 Fixed an outdated assertion that could throw without a cause for concern
|
||||||
|
- #3037 Fixed omitting the last coordinate for overview=simplified
|
||||||
|
- #3176 Fixed exposing wrong OSM ids in matching
|
||||||
|
- Fixes splitting logic in map matching
|
||||||
|
|
||||||
|
# 5.4.1
|
||||||
|
- Changes from 5.4.0
|
||||||
|
- Bugfixes
|
||||||
|
- #3016: Fixes shared memory updates while queries are running
|
||||||
|
|
||||||
|
# 5.4.0
|
||||||
|
- Changes from 5.3.0
|
||||||
|
- Profiles
|
||||||
|
- includes library guidance.lua that offers preliminary configuration on guidance.
|
||||||
|
- added left_hand_driving flag in global profile properties
|
||||||
|
- modified turn penalty function for car profile - better fit to real data
|
||||||
|
- return `ref` and `name` as separate fields. Do no use ref or destination as fallback for name value
|
||||||
|
- Guidance
|
||||||
|
- Handle Access tags for lanes, only considering valid lanes in lane-guidance (think car | car | bike | car)
|
||||||
|
- API:
|
||||||
|
- `annotations=true` now returns the data source id for each segment as `datasources`
|
||||||
|
- Reduced semantic of merge to refer only to merges from a lane onto a motorway-like road
|
||||||
|
- new `ref` field in the `RouteStep` object. It contains the reference code or name of a way. Previously merged into the `name` property like `name (ref)` and are now separate fields.
|
||||||
|
- Bugfixes
|
||||||
|
- Fixed an issue that would result in segfaults for viaroutes with an invalid intermediate segment when u-turns were allowed at the via-location
|
||||||
|
- Invalid only_* restrictions could result in loss of connectivity. As a fallback, we assume all turns allowed when the restriction is not valid
|
||||||
|
- Fixed a bug that could result in an infinite loop when finding information about an upcoming intersection
|
||||||
|
- Fixed a bug that led to not discovering if a road simply looses a considered prefix
|
||||||
|
- BREAKING: Fixed a bug that could crash postprocessing of instructions on invalid roundabout taggings. This change requires reprocessing datasets with osrm-extract and osrm-contract
|
||||||
|
- Fixed an issue that could emit `invalid` as instruction when ending on a sliproad after a traffic-light
|
||||||
|
- Fixed an issue that would detect turning circles as sliproads
|
||||||
|
- Fixed a bug where post-processing instructions (e.g. left + left -> uturn) could result in false pronunciations
|
||||||
|
- Fixes a bug where a bearing range of zero would cause exhaustive graph traversals
|
||||||
|
- Fixes a bug where certain looped geometries could cause an infinite loop during extraction
|
||||||
|
- Infrastructure:
|
||||||
|
- Adds a feature to limit results in nearest service with a default of 100 in `osrm-routed`
|
||||||
|
|
||||||
|
# 5.4.0-rc.7
|
||||||
|
- Chages from 5.4.0-rc.6
|
||||||
|
- Bugfixes re-introduce space between two entries in summaries
|
||||||
|
|
||||||
|
# 5.4.0-rc.6
|
||||||
|
- Changes from 5.4.0-rc.5
|
||||||
|
- Bugfixes
|
||||||
|
- fixed a bug where polyline decoding on a defective polyline could end up in out-of-bound access on a vector
|
||||||
|
- Guidance
|
||||||
|
- Summaries have been improved to consider references as well
|
||||||
|
|
||||||
|
# 5.4.0-rc.5
|
||||||
|
- Changes from 5.4.0-rc.4
|
||||||
|
- Guidance
|
||||||
|
- Improved detection of obvious name changes
|
||||||
|
- Profiles
|
||||||
|
- The default profile for car now excludes HOV-only routes in navigation by default
|
||||||
|
- Bugfixes
|
||||||
|
- Fixed a bug that could result in endless loops in combination with sliproads
|
||||||
|
|
||||||
|
# 5.4.0-rc.4
|
||||||
|
- Changes from 5.4.0-rc.3
|
||||||
|
- Bugfixes
|
||||||
|
- Fixed a bug where roundabout intersections could result in breaking assertions when immediately exited
|
||||||
|
|
||||||
|
# 5.4.0-rc.3
|
||||||
|
- Changes from 5.4.0-rc.2
|
||||||
|
- Bugfixes
|
||||||
|
- BREAKING: Fixed a bug where some roads could be falsly identified as sliproadsi This change requires reprocessing datasets with osrm-extract and osrm-contract
|
||||||
|
- BREAKING: Fixed a bug that resulted in false names/ref/destination/pronunciation This change requires reprocessing datasets with osrm-extract and osrm-contract
|
||||||
|
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
|
||||||
|
- replaced lhs/rhs profiles by using test defined profiles
|
||||||
|
- Trip Plugin
|
||||||
|
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
|
||||||
|
|
||||||
# 5.3.0
|
# 5.3.0
|
||||||
Changes from 5.3.0-rc.3
|
- Changes from 5.3.0-rc.3
|
||||||
- Guidance
|
- Guidance
|
||||||
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
||||||
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
|
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
|
||||||
@@ -18,7 +89,7 @@
|
|||||||
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
|
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
|
||||||
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
|
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
|
||||||
|
|
||||||
Changes form 5.2.7
|
- Changes form 5.2.7
|
||||||
- API
|
- API
|
||||||
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
|
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
|
||||||
- Introduces `lanes` to the `Intersection` object. The lane data contains both the markings at the intersection and a flag indicating if they can be chosen for the next turn
|
- Introduces `lanes` to the `Intersection` object. The lane data contains both the markings at the intersection and a flag indicating if they can be chosen for the next turn
|
||||||
@@ -42,7 +113,7 @@
|
|||||||
- Fix devide by zero on updating speed data using osrm-contract
|
- Fix devide by zero on updating speed data using osrm-contract
|
||||||
|
|
||||||
# 5.3.0 RC3
|
# 5.3.0 RC3
|
||||||
Changes from 5.3.0-rc.2
|
- Changes from 5.3.0-rc.2
|
||||||
- Guidance
|
- Guidance
|
||||||
- Improved detection of obvious turns
|
- Improved detection of obvious turns
|
||||||
- Improved turn lane detection
|
- Improved turn lane detection
|
||||||
|
|||||||
+44
-6
@@ -9,8 +9,8 @@ endif()
|
|||||||
|
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
set(OSRM_VERSION_MINOR 3)
|
set(OSRM_VERSION_MINOR 4)
|
||||||
set(OSRM_VERSION_PATCH 2)
|
set(OSRM_VERSION_PATCH 3)
|
||||||
|
|
||||||
# these two functions build up custom variables:
|
# these two functions build up custom variables:
|
||||||
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
|
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
|
||||||
@@ -54,6 +54,8 @@ option(ENABLE_ASSERTIONS OFF)
|
|||||||
option(COVERAGE OFF)
|
option(COVERAGE OFF)
|
||||||
option(SANITIZER OFF)
|
option(SANITIZER OFF)
|
||||||
option(ENABLE_LTO "Use LTO if available" ON)
|
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)
|
||||||
|
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||||
@@ -115,6 +117,26 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_GOLD_LINKER)
|
||||||
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||||
|
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||||
|
message(STATUS "Using GNU gold as linker.")
|
||||||
|
|
||||||
|
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
|
||||||
|
string(REGEX REPLACE ".*\\(GNU Binutils[^\\)0-9]+([0-9]+\\.[0-9]+)[^\\)]*\\).*" "\\1" GOLD_BINUTILS_VERSION "${LD_VERSION}")
|
||||||
|
if ("${GOLD_BINUTILS_VERSION}" VERSION_LESS "2.26")
|
||||||
|
message(STATUS "Disabling gc-sections on gold binutils < 2.26, see: https://sourceware.org/bugzilla/show_bug.cgi?id=17639")
|
||||||
|
set(LD_AVOID_GC_SECTIONS TRUE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(WARNING "GNU gold linker isn't available.")
|
||||||
|
set(ENABLE_GOLD_LINKER OFF)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES Release)
|
if(CMAKE_BUILD_TYPE MATCHES Release)
|
||||||
message(STATUS "Configuring OSRM in release mode")
|
message(STATUS "Configuring OSRM in release mode")
|
||||||
# Check if LTO is available
|
# Check if LTO is available
|
||||||
@@ -205,7 +227,7 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT
|
|||||||
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
|
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
|
||||||
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
|
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
|
||||||
message(STATUS "Setting linker optimizations")
|
message(STATUS "Setting linker optimizations")
|
||||||
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
if(NOT (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
|
||||||
# Tell compiler to put every function in separate section, linker can then match sections and functions
|
# Tell compiler to put every function in separate section, linker can then match sections and functions
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
|
||||||
# Tell linker to do dead code and data eminination during link time discarding sections
|
# Tell linker to do dead code and data eminination during link time discarding sections
|
||||||
@@ -220,13 +242,15 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||||
|
|
||||||
# Activate C++11
|
# Activate C++1y
|
||||||
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configuring other platform dependencies
|
# Configuring other platform dependencies
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
|
||||||
|
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||||
message(STATUS "Set Architecture to x64 on OS X")
|
message(STATUS "Set Architecture to x64 on OS X")
|
||||||
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
|
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
|
||||||
@@ -244,6 +268,7 @@ if(UNIX AND NOT APPLE)
|
|||||||
set(MAYBE_RT_LIBRARY rt)
|
set(MAYBE_RT_LIBRARY rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
||||||
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
||||||
find_package(Osmium REQUIRED COMPONENTS io)
|
find_package(Osmium REQUIRED COMPONENTS io)
|
||||||
@@ -416,7 +441,7 @@ file(GLOB VariantGlob third_party/variant/*.hpp)
|
|||||||
file(GLOB LibraryGlob include/osrm/*.hpp)
|
file(GLOB LibraryGlob include/osrm/*.hpp)
|
||||||
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
||||||
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
|
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
|
||||||
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp)
|
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp)
|
||||||
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
||||||
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
||||||
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
|
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
|
||||||
@@ -498,3 +523,16 @@ add_custom_target(uninstall
|
|||||||
# Modular build system: each directory registered here provides its own CMakeLists.txt
|
# Modular build system: each directory registered here provides its own CMakeLists.txt
|
||||||
add_subdirectory(unit_tests)
|
add_subdirectory(unit_tests)
|
||||||
add_subdirectory(src/benchmarks)
|
add_subdirectory(src/benchmarks)
|
||||||
|
|
||||||
|
if (ENABLE_FUZZING)
|
||||||
|
# Requires libosrm being built with sanitizers; make configurable and default to ubsan
|
||||||
|
set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing")
|
||||||
|
set_property(CACHE FUZZ_SANITIZER PROPERTY STRINGS "undefined" "integer" "address" "memory" "thread" "leak")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||||
|
|
||||||
|
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
|
||||||
|
|
||||||
|
add_subdirectory(fuzz)
|
||||||
|
endif ()
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ The Open Source Routing Machine is a high performance routing engine written in
|
|||||||
| Windows | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
| Windows | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||||
| Coverage | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
| Coverage | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
- 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`
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|||||||
+4
-6
@@ -1,10 +1,8 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
default: '--require features --tags ~@stress --tags ~@todo',
|
default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions',
|
||||||
verify: '--require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress',
|
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
|
||||||
jenkins: '--require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress',
|
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
||||||
bugs: '--require features --tags @bug',
|
all: '--strict --require features/support --require features/step_definitions'
|
||||||
todo: '--require features --tags @todo',
|
|
||||||
all: '--require features'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+41
-8
@@ -30,17 +30,17 @@ http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=va
|
|||||||
|
|
||||||
| Service | Description |
|
| Service | Description |
|
||||||
|-------------|-----------------------------------------------------------|
|
|-------------|-----------------------------------------------------------|
|
||||||
| [`route`](#service-route) | shortest path between given coordinates |
|
| [`route`](#service-route) | fastest path between given coordinates |
|
||||||
| [`nearest`](#service-nearest) | returns the nearest street segment for a given coordinate |
|
| [`nearest`](#service-nearest) | returns the nearest street segment for a given coordinate |
|
||||||
| [`table`](#service-table) | computes distance tables for given coordinates |
|
| [`table`](#service-table) | computes distance tables for given coordinates |
|
||||||
| [`match`](#service-match) | matches given coordinates to the road network |
|
| [`match`](#service-match) | matches given coordinates to the road network |
|
||||||
| [`trip`](#service-trip) | Compute the shortest round trip between given coordinates |
|
| [`trip`](#service-trip) | Compute the fastest round trip between given coordinates |
|
||||||
| [`tile`](#service-tile) | Return vector tiles containing debugging info |
|
| [`tile`](#service-tile) | Return vector tiles containing debugging info |
|
||||||
|
|
||||||
- `version`: Version of the protocol implemented by the service.
|
- `version`: Version of the protocol implemented by the service.
|
||||||
- `profile`: Mode of transportation, is determined by the profile that is used to prepare the data
|
- `profile`: Mode of transportation, is determined by the profile that is used to prepare the data
|
||||||
- `coordinates`: String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`.
|
- `coordinates`: String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`.
|
||||||
- `format`: Only `json` is supportest at the moment. This parameter is optional and defaults to `json`.
|
- `format`: Only `json` is supported at the moment. This parameter is optional and defaults to `json`.
|
||||||
|
|
||||||
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 and can be generated using [this package](https://www.npmjs.com/package/polyline).
|
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 and can be generated using [this package](https://www.npmjs.com/package/polyline).
|
||||||
To pass parameters to each location some options support an array like encoding:
|
To pass parameters to each location some options support an array like encoding:
|
||||||
@@ -181,6 +181,14 @@ In case of error the following `code`s are supported in addition to the general
|
|||||||
|
|
||||||
All other fields might be undefined.
|
All other fields might be undefined.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
Query on Berlin with three coordinates and no overview geometry returned:
|
||||||
|
|
||||||
|
```
|
||||||
|
http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
|
||||||
|
```
|
||||||
|
|
||||||
## Service `table`
|
## Service `table`
|
||||||
### Request
|
### Request
|
||||||
```
|
```
|
||||||
@@ -294,7 +302,7 @@ All other fields might be undefined.
|
|||||||
## Service `trip`
|
## Service `trip`
|
||||||
|
|
||||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
|
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
|
||||||
The returned path does not have to be the shortest path, as TSP is NP-hard it is only an approximation.
|
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)
|
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.
|
multiple trips for each connected component are returned.
|
||||||
|
|
||||||
@@ -399,8 +407,8 @@ Represents a route between two waypoints.
|
|||||||
|
|
||||||
| annotations | |
|
| annotations | |
|
||||||
|--------------|-----------------------------------------------------------------------|
|
|--------------|-----------------------------------------------------------------------|
|
||||||
| true | returns distance and durations of each coordinate along the route |
|
| true | An `Annotation` object containing node ids, durations and distances |
|
||||||
| false | will not exist |
|
| false | `undefined` |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@@ -414,11 +422,35 @@ With `steps=false` and `annotations=true`:
|
|||||||
"annotation": {
|
"annotation": {
|
||||||
"distance": [5,5,10,5,5],
|
"distance": [5,5,10,5,5],
|
||||||
"duration": [15,15,40,15,15],
|
"duration": [15,15,40,15,15],
|
||||||
|
"datasources": [1,0,0,0,1],
|
||||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Annotation
|
||||||
|
|
||||||
|
Annotation of the whole route leg with fine-grained information about each segment or node id.
|
||||||
|
|
||||||
|
#### Properties
|
||||||
|
|
||||||
|
- `distance`: The distance, in metres, between each pair of coordinates
|
||||||
|
- `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
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"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]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### RouteStep
|
### RouteStep
|
||||||
|
|
||||||
A step consists of a maneuver such as a turn or merge, followed
|
A step consists of a maneuver such as a turn or merge, followed
|
||||||
@@ -437,6 +469,7 @@ step.
|
|||||||
| geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) or [GeoJSON `Point`](http://geojson.org/geojson-spec.html#point) if it is only one coordinate (not wrapped by a GeoJSON feature)|
|
| geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) or [GeoJSON `Point`](http://geojson.org/geojson-spec.html#point) if it is only one coordinate (not wrapped by a GeoJSON feature)|
|
||||||
|
|
||||||
- `name`: The name of the way along which travel proceeds.
|
- `name`: The name of the way along which travel proceeds.
|
||||||
|
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
|
||||||
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
|
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
|
||||||
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
|
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
|
||||||
- `mode`: A string signifying the mode of transportation.
|
- `mode`: A string signifying the mode of transportation.
|
||||||
@@ -505,7 +538,7 @@ step.
|
|||||||
| `use lane` | going straight on a specific lane |
|
| `use lane` | going straight on a specific lane |
|
||||||
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
||||||
| `roundabout` | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
|
| `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 larger version of a roundabout, can offer `rotary_name` in addition to the `exit` parameter. |
|
| `rotary` | a larger version of a roundabout, 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`. |
|
| `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 |
|
| `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 |
|
||||||
|
|
||||||
@@ -591,7 +624,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers.
|
in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers.
|
||||||
- `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the
|
- `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the
|
||||||
direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers.
|
direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers.
|
||||||
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the turn location
|
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the intersection. If no lane information is available for an intersection, the `lanes` property will not be present.
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -32,3 +32,16 @@ Given an OpenStreetMap way, the way_function will either return nothing (meaning
|
|||||||
All other calculations stem from that, including the returned timings in driving directions, but also, less directly, it feeds into the actual routing decisions the engine will take (a way with a slow traversal speed, may be less favoured than a way with fast traversal speed, but it depends how long it is, and... what it connects to in the rest of the network graph)
|
All other calculations stem from that, including the returned timings in driving directions, but also, less directly, it feeds into the actual routing decisions the engine will take (a way with a slow traversal speed, may be less favoured than a way with fast traversal speed, but it depends how long it is, and... what it connects to in the rest of the network graph)
|
||||||
|
|
||||||
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the way_function. Instead a way_function will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, before arriving at the result.
|
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the way_function. Instead a way_function will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, before arriving at the result.
|
||||||
|
|
||||||
|
## Guidance
|
||||||
|
|
||||||
|
The guidance parameters in profiles are currently a work in progress. They can and will change.
|
||||||
|
Please be aware of this when using guidance configuration possibilities.
|
||||||
|
|
||||||
|
### Road Classification
|
||||||
|
|
||||||
|
Guidance uses road classes to decide on when/if to emit specific instructions and to discover which road is obvious when following a route.
|
||||||
|
Classification uses three flags and a priority-category.
|
||||||
|
The flags indicate whether a road is a motorway (required for on/off ramps), a link type (the ramps itself, if also a motorway) and whether a road may be omittted in considerations (is considered purely for connectivity).
|
||||||
|
The priority-category influences the decision which road is considered the obvious choice and which roads can be seen as fork.
|
||||||
|
Forks can be emitted between roads of similar priority category only. Obvious choices follow a major priority road, if the priority difference is large.
|
||||||
|
|||||||
+32
-32
@@ -1,50 +1,50 @@
|
|||||||
# Releasing a new OSRM version
|
# Releasing a new OSRM version
|
||||||
|
|
||||||
Do decide if this is a major or minor version bump use: http://semver.org/
|
We are using http://semver.org/ for versioning with major, minor and patch versions.
|
||||||
|
|
||||||
What we guarantee on major version changes:
|
## Guarantees
|
||||||
|
|
||||||
- Breaking changes will be in the changelog
|
We are giving the following guarantees between versions:
|
||||||
- If we break an HTTP API we bump the version
|
|
||||||
|
|
||||||
What we guarantee on minor version changes:
|
### Major version change
|
||||||
|
|
||||||
- HTTP API does not include breaking changes
|
- There are no guarantees about compatiblity of APIs or datasets
|
||||||
- C++ library API does not include breaking changes
|
- Breaking changes will be noted as `BREAKING` in the changelog
|
||||||
- node-osrm API does not include breaking changes
|
|
||||||
|
|
||||||
What we DO NOT guarantee on minor version changes:
|
### Minor version change
|
||||||
|
|
||||||
- file format comp ability. Breakage will be listed in the changelog.
|
We may introduce forward-compatible changes: query parameters and response properties may be added in responses, but existing properties may not be changed or removed. One exception to this is the addition of new turn types, which we see as forward-compatible changes.
|
||||||
- new turn types and fields may be introduced. How to handle this see [the HTTP API docs](http.md).
|
|
||||||
|
|
||||||
What we guarantee on patch version changes:
|
- Forward-compatible HTTP API
|
||||||
|
- Forward-compatible C++ library API
|
||||||
|
- Forward-compatible node-osrm API
|
||||||
|
- No compatiblity between OSRM datasets (needs new processing)
|
||||||
|
|
||||||
- HTTP API does not include breaking changes
|
### Patch version change
|
||||||
- C++ library API does not include breaking changes
|
|
||||||
- node-osrm API does not include breaking changes
|
|
||||||
- full file format compatibility
|
|
||||||
|
|
||||||
## Major or Minor release x.y
|
- No change of query parameters or response formats
|
||||||
|
- Compatible HTTP API
|
||||||
|
- Compatible C++ library API
|
||||||
|
- Compatible node-osrm API
|
||||||
|
- Compatible OSRM datasets
|
||||||
|
|
||||||
1. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
## Release and branch management
|
||||||
2. Make sure `CHANGELOG.md` is up to date.
|
|
||||||
3. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
|
||||||
4. Use an annotated tag to mark the release: `git tag vx.y.0 -a` Body of the tag description should be the changelog entries.
|
|
||||||
5. Push tags and commits: `git push; git push --tags`
|
|
||||||
6. Branch of the `vx.y.0` tag to create a release branch `x.y`:
|
|
||||||
`git branch x.y. vx.y.0; git push -u x.y:origin/x.y`
|
|
||||||
7. Modify `.travis.yml` to allow builds for the `x.y` branch.
|
|
||||||
8. Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
|
||||||
|
|
||||||
## Patch release x.y.z
|
- The `master` branch is for the bleeding edge development
|
||||||
|
- We create and maintain release branches `x.y` to control the release flow
|
||||||
|
- No minor or major version will be released without a code-equal release candidates
|
||||||
|
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
|
||||||
|
- Patch versions may be released without a release candidate
|
||||||
|
- We may backport fixes to older versions and release them as patch versions
|
||||||
|
|
||||||
1. Check out the appropriate release branch x.y
|
## Releasing a version
|
||||||
2. Make sure all fixes are listed in the changelog and included in the branch
|
|
||||||
3. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
1. Check out the appropriate release branch `x.y`
|
||||||
|
2. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||||
|
3. Make sure `CHANGELOG.md` is up to date.
|
||||||
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||||
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||||
6. Push tags and commits: `git push; git push --tags`
|
6. Push tags and commits: `git push; git push --tags`
|
||||||
7. Proceede with the `node-osrm` release as outlined in the repository.
|
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
|
||||||
8. Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
int main(int argc, const char *argv[]) try
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
@@ -34,7 +34,7 @@ int main(int argc, const char *argv[]) try
|
|||||||
config.use_shared_memory = false;
|
config.use_shared_memory = false;
|
||||||
|
|
||||||
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
||||||
OSRM osrm{config};
|
const OSRM osrm{config};
|
||||||
|
|
||||||
// The following shows how to use the Route service; configure this service
|
// The following shows how to use the Route service; configure this service
|
||||||
RouteParameters params;
|
RouteParameters params;
|
||||||
@@ -67,6 +67,7 @@ int main(int argc, const char *argv[]) try
|
|||||||
|
|
||||||
std::cout << "Distance: " << distance << " meter\n";
|
std::cout << "Distance: " << distance << " meter\n";
|
||||||
std::cout << "Duration: " << duration << " seconds\n";
|
std::cout << "Duration: " << duration << " seconds\n";
|
||||||
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
else if (status == Status::Error)
|
else if (status == Status::Error)
|
||||||
{
|
{
|
||||||
@@ -78,8 +79,3 @@ int main(int argc, const char *argv[]) try
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
|
||||||
{
|
|
||||||
std::cerr << "Error: " << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ Feature: Bike - Street names in instructions
|
|||||||
| bc | Your Way | A7 |
|
| bc | Your Way | A7 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route | ref |
|
||||||
| a | c | My Way (A6),Your Way (A7),Your Way (A7) |
|
| a | c | My Way,Your Way,Your Way | A6,A7,A7 |
|
||||||
|
|
||||||
@unnamed
|
@unnamed
|
||||||
Scenario: Bike - Use way type to describe unnamed ways
|
Scenario: Bike - Use way type to describe unnamed ways
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ Feature: Bike - Way ref
|
|||||||
| ab | Utopia Drive | E7 |
|
| ab | Utopia Drive | E7 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route | ref |
|
||||||
| a | b | Utopia Drive (E7),Utopia Drive (E7) |
|
| a | b | Utopia Drive,Utopia Drive | E7,E7 |
|
||||||
|
|
||||||
Scenario: Bike - Way with only ref
|
Scenario: Bike - Way with only ref
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -25,8 +25,8 @@ Feature: Bike - Way ref
|
|||||||
| ab | | E7 |
|
| ab | | E7 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route | ref |
|
||||||
| a | b | E7,E7 |
|
| a | b | {highway:primary},{highway:primary} | E7,E7 |
|
||||||
|
|
||||||
Scenario: Bike - Way with only name
|
Scenario: Bike - Way with only name
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -148,3 +148,42 @@ Feature: Car - Restricted access
|
|||||||
| primary | | | no | | x |
|
| primary | | | no | | x |
|
||||||
| runway | | | | yes | |
|
| runway | | | | yes | |
|
||||||
| primary | | | | no | x |
|
| primary | | | | no | x |
|
||||||
|
|
||||||
|
Scenario: Car - only designated HOV ways are ignored by default
|
||||||
|
Then routability should be
|
||||||
|
| highway | hov | bothw |
|
||||||
|
| primary | designated | |
|
||||||
|
| primary | yes | x |
|
||||||
|
| primary | no | x |
|
||||||
|
|
||||||
|
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 |
|
||||||
|
| 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 | | |
|
||||||
|
| primary | | designated | | -1 | | x |
|
||||||
|
| primary | | | designated | yes | | |
|
||||||
|
| primary | | | designated | -1 | | |
|
||||||
|
| 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
|
||||||
|
| highway | toll | bothw |
|
||||||
|
| primary | no | x |
|
||||||
|
| primary | snowmobile | x |
|
||||||
|
|
||||||
|
# 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 | |
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ Feature: Car - Handle ferry routes
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
|
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
|
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||||
| c | e | cde,cde | ferry,ferry | 12 km/h |
|
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||||
| e | c | cde,cde | ferry,ferry | 12 km/h |
|
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||||
|
|
||||||
Scenario: Car - Properly handle ISO 8601 durations
|
Scenario: Car - Properly handle ISO 8601 durations
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -60,7 +60,7 @@ Feature: Car - Handle ferry routes
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | modes | speed |
|
| from | to | route | modes | speed |
|
||||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
|
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h |
|
||||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
|
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||||
| c | e | cde,cde | ferry,ferry | 12 km/h |
|
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||||
| e | c | cde,cde | ferry,ferry | 12 km/h |
|
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ Feature: Car - Street names in instructions
|
|||||||
| bc | Your Way | A1 |
|
| bc | Your Way | A1 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route | ref |
|
||||||
| a | c | My Way,Your Way (A1),Your Way (A1) |
|
| a | c | My Way,Your Way,Your Way | ,A1,A1|
|
||||||
|
|
||||||
Scenario: Car - A named street with pronunciation
|
Scenario: Car - A named street with pronunciation
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -30,10 +30,27 @@ Feature: Car - Street names in instructions
|
|||||||
| bd | My Way | meyeway | A1 |
|
| bd | My Way | meyeway | A1 |
|
||||||
| cd | Your Way | yourewaye | |
|
| cd | Your Way | yourewaye | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | pronunciations | ref |
|
||||||
|
| a | d | My Way,My Way | ,meyeway | ,A1 |
|
||||||
|
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
|
||||||
|
|
||||||
|
# See #2860
|
||||||
|
Scenario: Car - same street name but different pronunciation
|
||||||
|
Given the node map
|
||||||
|
| a | b | c |
|
||||||
|
| | d | |
|
||||||
|
| | e | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | name:pronunciation |
|
||||||
|
| abc | Houston St | hew-stun |
|
||||||
|
| bde | Houston St | how-stun |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | pronunciations |
|
| from | to | route | pronunciations |
|
||||||
| a | d | My Way,My Way (A1) | ,meyeway |
|
| a | c | Houston St,Houston St | hew-stun,hew-stun |
|
||||||
| 1 | c | Your Way,Your Way | yourewaye,yourewaye |
|
| a | e | Houston St,Houston St,Houston St | hew-stun,how-stun,how-stun |
|
||||||
|
|
||||||
@todo
|
@todo
|
||||||
Scenario: Car - Use way type to describe unnamed ways
|
Scenario: Car - Use way type to describe unnamed ways
|
||||||
@@ -48,3 +65,31 @@ Feature: Car - Street names in instructions
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | tertiary,residential,residential |
|
| a | c | tertiary,residential,residential |
|
||||||
|
|
||||||
|
Scenario: Inner city expressway with on road
|
||||||
|
Given the node map
|
||||||
|
| a | b | | | | c | g |
|
||||||
|
| | | | | f | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | d | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | e | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | name:pronunciation |
|
||||||
|
| abc | primary | road | roooaad |
|
||||||
|
| cg | primary | road | roooaad |
|
||||||
|
| bfd | trunk_link | | |
|
||||||
|
| cde | trunk | trunk | truank |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | abc | cde | c | no_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | pronunciations |
|
||||||
|
| a,e | road,trunk,trunk | depart,turn right,arrive | roooaad,truank,truank |
|
||||||
|
|||||||
@@ -149,11 +149,27 @@ Feature: Car - Turn restrictions
|
|||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | wj | j | only_left_turn |
|
| restriction | sj | wj | j | only_left_turn |
|
||||||
|
|
||||||
|
Scenario: Car - Only right turn, invalid
|
||||||
|
Given the node map
|
||||||
|
| | n | | |
|
||||||
|
| w | j | e | r |
|
||||||
|
| | s | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| sj | yes |
|
||||||
|
| nj | -1 |
|
||||||
|
| wj | -1 |
|
||||||
|
| ej | -1 |
|
||||||
|
| re | -1 |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | sj | er | j | only_right_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| s | r | sj,ej,re,re |
|
||||||
| s | n | |
|
|
||||||
| s | e | |
|
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only right turn
|
Scenario: Car - Only right turn
|
||||||
@@ -430,3 +446,27 @@ Feature: Car - Turn restrictions
|
|||||||
| a | b | ax,xy,yb,yb |
|
| a | b | ax,xy,yb,yb |
|
||||||
| b | a | yb,xy,ax,ax |
|
| b | a | yb,xy,ax,ax |
|
||||||
|
|
||||||
|
@specific
|
||||||
|
Scenario: Car - Ignore unrecognized restriction
|
||||||
|
Given the node map
|
||||||
|
| | n | |
|
||||||
|
| w | j | e |
|
||||||
|
| | s | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| sj | yes |
|
||||||
|
| nj | -1 |
|
||||||
|
| wj | -1 |
|
||||||
|
| ej | -1 |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | sj | wj | j | yield |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| s | w | sj,wj,wj |
|
||||||
|
| s | n | sj,nj,nj |
|
||||||
|
| s | e | sj,ej,ej |
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
@routing @car @surface
|
||||||
|
Feature: Car - Surfaces
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
|
||||||
|
Scenario: Car - Surface should reduce speed
|
||||||
|
Then routability should be
|
||||||
|
| highway | service | forw | backw |
|
||||||
|
| service | alley | 5 km/h +-1 | 5 km/h +-1 |
|
||||||
|
| service | emergency_access | | |
|
||||||
|
| service | driveway | 15 km/h +-1| 15 km/h +-1 |
|
||||||
|
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
@routing @basic @car
|
||||||
|
Feature: Basic Routing
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 500 meters
|
||||||
|
|
||||||
|
@smallest
|
||||||
|
Scenario: Summaries when routing on a simple network
|
||||||
|
Given the node map
|
||||||
|
| b | | | f |
|
||||||
|
| | | | |
|
||||||
|
| c | d | | g |
|
||||||
|
| | | | |
|
||||||
|
| a | | e | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name |
|
||||||
|
| acb | road |
|
||||||
|
| de | 1 st |
|
||||||
|
| cd | |
|
||||||
|
| dg | blvd |
|
||||||
|
| df | street |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | summary |
|
||||||
|
| a,e | road,,1 st,1 st | road, 1 st |
|
||||||
|
| a,d,f | road,,,street,street | road;street |
|
||||||
|
| a,e,f | road,,1 st,1 st,1 st,street,street | road, 1 st;1 st, street |
|
||||||
|
|
||||||
|
Scenario: Name Empty
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name |
|
||||||
|
| ab | road |
|
||||||
|
| bc | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | summary |
|
||||||
|
| a,c | road, | road |
|
||||||
|
|
||||||
|
Scenario: Name Empty But Ref
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | road | |
|
||||||
|
| bc | | 101 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | summary |
|
||||||
|
| a,c | road, | road, 101 |
|
||||||
|
|
||||||
|
Scenario: Only Refs
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | | 100 |
|
||||||
|
| bc | | 101 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | summary |
|
||||||
|
| a,c | , | 100, 101 |
|
||||||
|
|
||||||
|
Scenario: Single Ref
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | | |
|
||||||
|
| bc | | 101 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | summary |
|
||||||
|
| a,c | ,, | 101 |
|
||||||
|
|
||||||
|
Scenario: Nothing
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name |
|
||||||
|
| ab | |
|
||||||
|
| bc | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | summary |
|
||||||
|
| a,c | , | |
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
Feature: Traffic - speeds
|
Feature: Traffic - speeds
|
||||||
|
|
||||||
Background: Use specific speeds
|
Background: Use specific speeds
|
||||||
|
|
||||||
|
Scenario: Weighting based on speed file
|
||||||
Given the node locations
|
Given the node locations
|
||||||
| node | lat | lon |
|
| node | lat | lon |
|
||||||
| a | 0.1 | 0.1 |
|
| a | 0.1 | 0.1 |
|
||||||
@@ -21,27 +23,105 @@ Feature: Traffic - speeds
|
|||||||
| eb | primary |
|
| eb | primary |
|
||||||
| df | primary |
|
| df | primary |
|
||||||
| fb | primary |
|
| fb | primary |
|
||||||
And the speed file
|
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,27
|
1,2,0
|
||||||
2,1,27
|
2,1,0
|
||||||
2,3,27
|
2,3,27
|
||||||
3,2,27
|
3,2,27
|
||||||
1,4,27
|
1,4,27
|
||||||
4,1,27
|
4,1,27
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Scenario: Weighting based on speed file
|
|
||||||
Given the profile "testbot"
|
|
||||||
Given the extract extra arguments "--generate-edge-lookup"
|
|
||||||
Given the contract extra arguments "--segment-speed-file speeds.csv"
|
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 27 km/h |
|
| a | b | ad,de,eb,eb | 30 km/h |
|
||||||
| a | c | ab,bc,bc | 27 km/h |
|
| a | c | ad,dc,dc | 31 km/h |
|
||||||
| b | c | bc,bc | 27 km/h |
|
| b | c | bc,bc | 27 km/h |
|
||||||
| a | d | ad,ad | 27 km/h |
|
| a | d | ad,ad | 27 km/h |
|
||||||
| d | c | dc,dc | 36 km/h |
|
| d | c | dc,dc | 36 km/h |
|
||||||
| g | b | ab,ab | 27 km/h |
|
| g | b | fb,fb | 36 km/h |
|
||||||
| a | g | ab,ab | 27 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 | .05 | 0.1 |
|
||||||
|
| c | 0.0 | 0.1 |
|
||||||
|
| d | .05 | .03 |
|
||||||
|
| e | .05 | .066 |
|
||||||
|
| f | .075 | .066 |
|
||||||
|
| g | .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 | .05 | 0.1 |
|
||||||
|
| c | 0.0 | 0.1 |
|
||||||
|
| d | .05 | .03 |
|
||||||
|
| e | .05 | .066 |
|
||||||
|
| f | .075 | .066 |
|
||||||
|
| g | .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
|
||||||
|
|||||||
@@ -33,19 +33,19 @@ Feature: Traffic - turn penalties
|
|||||||
| from | to | route | speed | time |
|
| from | to | route | speed | time |
|
||||||
| a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
|
| a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
|
||||||
# straight
|
# straight
|
||||||
| i | g | fim,fg,fg | 59 km/h | 12s +-1 |
|
| i | g | fim,fg,fg | 53 km/h | 13.5s +-1 |
|
||||||
# right
|
# right
|
||||||
| a | e | ad,def,def | 57 km/h | 12.5s +-1 |
|
| a | e | ad,def,def | 43 km/h | 16.7s +-1 |
|
||||||
# left
|
# left
|
||||||
| c | g | cd,def,fg,fg | 63 km/h | 23s +-1 |
|
| c | g | cd,def,fg,fg | 63 km/h | 23s +-1 |
|
||||||
# double straight
|
# double straight
|
||||||
| p | g | mp,fim,fg,fg | 61 km/h | 23.5s +-1 |
|
| p | g | mp,fim,fg,fg | 58 km/h | 24.9s +-1 |
|
||||||
# straight-right
|
# straight-right
|
||||||
| a | l | ad,dhk,klm,klm | 60 km/h | 24s +-1 |
|
| a | l | ad,dhk,klm,klm | 51 km/h | 28.1s +-1 |
|
||||||
# straight-left
|
# straight-left
|
||||||
| l | e | klm,dhk,def,def | 59 km/h | 24.5s +-1 |
|
| l | e | klm,dhk,def,def | 53 km/h | 27s +-1 |
|
||||||
# double right
|
# double right
|
||||||
| g | n | fg,fim,mn,mn | 57 km/h | 25s +-1 |
|
| g | n | fg,fim,mn,mn | 43 km/h | 33.4s +-1 |
|
||||||
# double left
|
# double left
|
||||||
|
|
||||||
Scenario: Weighting based on turn penalty file
|
Scenario: Weighting based on turn penalty file
|
||||||
@@ -53,12 +53,12 @@ Feature: Traffic - turn penalties
|
|||||||
"""
|
"""
|
||||||
9,6,7,1.8
|
9,6,7,1.8
|
||||||
9,13,14,24.5
|
9,13,14,24.5
|
||||||
8,4,3,26
|
8,4,3,30
|
||||||
12,11,8,9
|
12,11,8,9
|
||||||
8,11,12,13
|
8,11,12,23
|
||||||
1,4,5,-0.2
|
1,4,5,-0.2
|
||||||
"""
|
"""
|
||||||
And the contract extra arguments "--turn-penalty-file penalties.csv"
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | time |
|
| from | to | route | speed | time |
|
||||||
| a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
|
| a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
|
||||||
@@ -71,17 +71,17 @@ Feature: Traffic - turn penalties
|
|||||||
# double straight
|
# double straight
|
||||||
| p | g | mp,fim,fg,fg | 59 km/h | 24.5s +-1 |
|
| p | g | mp,fim,fg,fg | 59 km/h | 24.5s +-1 |
|
||||||
# straight-right - ifg penalty
|
# straight-right - ifg penalty
|
||||||
| a | l | ad,def,fim,klm,klm | 61 km/h | 35.5s +-1 |
|
| a | l | ad,def,fim,klm,klm | 57 km/h | 38.2s +-1 |
|
||||||
# was straight-left - forced around by hkl penalty
|
# was straight-left - forced around by hkl penalty
|
||||||
| l | e | klm,fim,def,def | 57 km/h | 25s +-1 |
|
| l | e | klm,fim,def,def | 43 km/h | 33.4s +-1 |
|
||||||
# double right - forced left by lkh penalty
|
# double right - forced left by lkh penalty
|
||||||
| g | n | fg,fim,mn,mn | 30 km/h | 47.5s +-1 |
|
| g | n | fg,fim,mn,mn | 27 km/h | 52.6s +-1 |
|
||||||
# double left - imn penalty
|
# double left - imn penalty
|
||||||
| j | c | jk,klm,fim,def,cd,cd | 60 km/h | 48s +-1 |
|
| j | c | jk,klm,fim,def,cd,cd | 51 km/h | 56.2s +-1 |
|
||||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||||
|
|
||||||
Scenario: Too-negative penalty clamps, but does not fail
|
Scenario: Too-negative penalty clamps, but does not fail
|
||||||
Given the contract extra arguments "--turn-penalty-file penalties.csv"
|
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
And the profile "testbot"
|
And the profile "testbot"
|
||||||
And the turn penalty file
|
And the turn penalty file
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Feature: Foot - Street names in instructions
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | c | My Way (A6),Your Way (B7),Your Way (B7) |
|
| a | c | My Way,Your Way,Your Way |
|
||||||
|
|
||||||
@unnamed
|
@unnamed
|
||||||
Scenario: Foot - Use way type to describe unnamed ways
|
Scenario: Foot - Use way type to describe unnamed ways
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Feature: Foot - Way ref
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | Utopia Drive (E7),Utopia Drive (E7) |
|
| a | b | Utopia Drive,Utopia Drive |
|
||||||
|
|
||||||
Scenario: Foot - Way with only ref
|
Scenario: Foot - Way with only ref
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -26,7 +26,7 @@ Feature: Foot - Way ref
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| a | b | E7,E7 |
|
| a | b | {highway:primary},{highway:primary} |
|
||||||
|
|
||||||
Scenario: Foot - Way with only name
|
Scenario: Foot - Way with only name
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -0,0 +1,236 @@
|
|||||||
|
@routing @guidance @turn-lanes
|
||||||
|
Feature: Turn Lane Guidance
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 3 meters
|
||||||
|
|
||||||
|
@sliproads
|
||||||
|
Scenario: Separate Turn Lanes
|
||||||
|
Given the node map
|
||||||
|
| | | | | | | | e | |
|
||||||
|
| a | | | b | | | | c | g |
|
||||||
|
| | | | | | | | d | |
|
||||||
|
| | | | | | | | f | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name | oneway |
|
||||||
|
| ab | | in | yes |
|
||||||
|
| bc | left\|through | in | yes |
|
||||||
|
| bd | right | in | yes |
|
||||||
|
| ec | | cross | no |
|
||||||
|
| cd | | cross | no |
|
||||||
|
| df | | cross | no |
|
||||||
|
| cg | | straight | no |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | bd | cd | d | no_left_turn |
|
||||||
|
| restriction | bc | cd | c | no_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
||||||
|
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||||
|
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||||
|
|
||||||
|
@sliproads
|
||||||
|
Scenario: Separate Turn Lanes
|
||||||
|
Given the node map
|
||||||
|
| | | | | | | | e | |
|
||||||
|
| a | | | b | | | | c | g |
|
||||||
|
| | | | | | | | d | |
|
||||||
|
| | | | | | | | f | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name | oneway |
|
||||||
|
| ab | | in | yes |
|
||||||
|
| bc | left\|through | in | yes |
|
||||||
|
| bd | right | in | yes |
|
||||||
|
| ec | | cross | no |
|
||||||
|
| cd | | cross | no |
|
||||||
|
| df | | cross | no |
|
||||||
|
| cg | | straight | no |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | bd | cd | d | no_left_turn |
|
||||||
|
| restriction | bc | cd | c | no_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
||||||
|
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||||
|
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||||
|
|
||||||
|
@sliproads
|
||||||
|
Scenario: Separate Turn Lanes Next to other turns
|
||||||
|
Given the node map
|
||||||
|
| | | | | | | | e | |
|
||||||
|
| a | | | b | | | | c | g |
|
||||||
|
| | | | | | | | d | |
|
||||||
|
| | | | | | | | f | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| i | | | h | | | | j | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name | oneway |
|
||||||
|
| ab | | in | yes |
|
||||||
|
| bc | left\|through | in | yes |
|
||||||
|
| bd | right | in | yes |
|
||||||
|
| ec | | cross | no |
|
||||||
|
| cd | | cross | no |
|
||||||
|
| df | | cross | no |
|
||||||
|
| cg | | straight | no |
|
||||||
|
| bh | left\|right | turn | yes |
|
||||||
|
| ihj | | other | no |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | bd | cd | d | no_left_turn |
|
||||||
|
| restriction | bc | cd | c | no_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
|
||||||
|
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||||
|
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||||
|
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
|
||||||
|
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
|
||||||
|
|
||||||
|
@todo @2654 @none
|
||||||
|
#https://github.com/Project-OSRM/osrm-backend/issues/2645
|
||||||
|
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
|
||||||
|
Scenario: Kurt-Schuhmacher-Damm
|
||||||
|
Given the node map
|
||||||
|
| | | | g | | f |
|
||||||
|
| | | | | | |
|
||||||
|
| j | | | h | | e |
|
||||||
|
| | | | | | |
|
||||||
|
| a | | | b | | c |
|
||||||
|
| | | | i | | d |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | turn:lanes |
|
||||||
|
| ab | | motorway_link | yes | left\|none\|right |
|
||||||
|
| bc | | primary_link | yes | |
|
||||||
|
| cd | ksd | secondary | yes | |
|
||||||
|
| cef | ksd | primary | yes | |
|
||||||
|
| hj | | motorway_link | yes | |
|
||||||
|
| eh | | secondary_link | yes | |
|
||||||
|
| gh | ksd | primary | yes | |
|
||||||
|
| hbi | ksd | secondary | yes | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,f | ,ksd,ksd | depart,turn left,arrive | ,left:true none:true right:false, |
|
||||||
|
| a,i | ,ksd,ksd | depart,turn right,arrive | ,left:false none:true right:true, |
|
||||||
|
|
||||||
|
@todo @2650 @sliproads
|
||||||
|
#market and haight in SF, restricted turn
|
||||||
|
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
|
||||||
|
Scenario: Market/Haight without Through Street
|
||||||
|
Given the node map
|
||||||
|
| | | | | | | | g | j | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | f |
|
||||||
|
| | | | | | | | | e | |
|
||||||
|
| | | | | | | | d | | |
|
||||||
|
| a | | | | | | b | c | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | l | | | h | i | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | turn:lanes:forward |
|
||||||
|
| ab | ghough | secondary | yes | |
|
||||||
|
| bc | ghough | secondary | yes | through\|through |
|
||||||
|
| bd | ghough | secondary | yes | none\|through |
|
||||||
|
| def | ghough | secondary | yes | |
|
||||||
|
| gd | market | primary | yes | |
|
||||||
|
| dc | market | primary | yes | |
|
||||||
|
| ch | market | primary | yes | |
|
||||||
|
| iej | market | primary | yes | |
|
||||||
|
| bl | haight | residential | yes | left\|none |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| relation | bd | dc | d | no_right_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
|
||||||
|
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
|
||||||
|
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
|
||||||
|
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
|
||||||
|
|
||||||
|
@todo @2650 @sliproads
|
||||||
|
#market and haight in SF, unrestricted
|
||||||
|
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
|
||||||
|
Scenario: Market/Haight without Through Street
|
||||||
|
Given the node map
|
||||||
|
| | | | | | | | g | j | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | f |
|
||||||
|
| | | | | | | | | e | |
|
||||||
|
| | | | | | | | d | | |
|
||||||
|
| a | | | | | | b | c | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | l | | | h | i | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | turn:lanes:forward |
|
||||||
|
| ab | ghough | secondary | yes | |
|
||||||
|
| bc | ghough | secondary | yes | through\|through |
|
||||||
|
| bd | ghough | secondary | yes | none\|through |
|
||||||
|
| def | ghough | secondary | yes | |
|
||||||
|
| gd | market | primary | yes | |
|
||||||
|
| dc | market | primary | yes | |
|
||||||
|
| ch | market | primary | yes | |
|
||||||
|
| iej | market | primary | yes | |
|
||||||
|
| bl | haight | residential | yes | left\|none |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
|
||||||
|
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
|
||||||
|
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
|
||||||
|
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
|
||||||
|
|
||||||
|
Scenario: Check sliproad handler loop's exit condition, Issue #2896
|
||||||
|
# http://www.openstreetmap.org/way/198481519
|
||||||
|
Given the node locations
|
||||||
|
| node | lat | lon |
|
||||||
|
| a | 7.6125350 | 126.5708309 |
|
||||||
|
| b | 7.6125156 | 126.5707219 |
|
||||||
|
| c | 7.6125363 | 126.5708337 |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name |
|
||||||
|
| cbac | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns |
|
||||||
|
| a | c | , | depart,arrive |
|
||||||
@@ -136,8 +136,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,i | ab,xbcj,ci,ci | depart,merge slight left,turn slight right,arrive | ,,none:false slight right:true, |
|
| a,i | ab,ci,ci | depart,turn slight right,arrive | ,none:false slight right:true, |
|
||||||
| a,j | ab,xbcj,xbcj | depart,merge slight left,arrive | ,, |
|
| a,j | ab,xbcj | depart,arrive | , |
|
||||||
|
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
@@ -257,9 +257,172 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | abx,bcy,cdz,dew,ef,ef | depart,turn right,turn left,turn right,turn left,arrive | ,straight:false right:false right:true right:false,left:false left:true straight:false,straight:false right:true right:false,left:true straight:false, |
|
| a,f | abx,bcy,cdz,dew,ef,ef | depart,turn right,turn left,turn right,turn left,arrive | ,straight:false right:true right:false right:false,left:true left:false straight:false,straight:false right:true right:false,left:true straight:false, |
|
||||||
|
|
||||||
@anticipate @todo @bug @2661
|
@anticipate
|
||||||
|
Scenario: Anticipate Lanes for through, through with lanes
|
||||||
|
Given the node map
|
||||||
|
| | | | f | g | |
|
||||||
|
| | | | | | |
|
||||||
|
| a | b | c | d | | e |
|
||||||
|
| | | | | | |
|
||||||
|
| | | | h | i | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name |
|
||||||
|
| ab | | main |
|
||||||
|
| bc | left\|through\|through\|through\|right | main |
|
||||||
|
| cd | left\|through\|right | main |
|
||||||
|
| de | | main |
|
||||||
|
| cf | | off |
|
||||||
|
| ch | | off |
|
||||||
|
| dg | | off |
|
||||||
|
| di | | off |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,e | main,main,main | depart,use lane straight,arrive | ,left:false straight:false straight:true straight:false right:false, |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: Anticipate Lanes for through and collapse multiple use lanes
|
||||||
|
Given the node map
|
||||||
|
| | | e | f | g |
|
||||||
|
| | | | | |
|
||||||
|
| a | b | c | d | |
|
||||||
|
| | | | | |
|
||||||
|
| | | h | i | j |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name |
|
||||||
|
| ab | left\|through\|through\|right | main |
|
||||||
|
| bc | left\|through\|through\|right | main |
|
||||||
|
| cd | left\|through\|through\|through\|right | main |
|
||||||
|
| be | | off |
|
||||||
|
| bh | | off |
|
||||||
|
| cf | | off |
|
||||||
|
| ci | | off |
|
||||||
|
| dg | | off |
|
||||||
|
| dj | | off |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,c | main,main | depart,arrive | , |
|
||||||
|
| a,d | main,main | depart,arrive | , |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: Anticipate Lanes for through followed by left/right
|
||||||
|
Given the node map
|
||||||
|
| | | f | g | |
|
||||||
|
| | | | | d |
|
||||||
|
| a | b | c | x | |
|
||||||
|
| | | | | e |
|
||||||
|
| | | h | i | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name |
|
||||||
|
| ab | left\|through\|through\|through\|through\|right | main |
|
||||||
|
| bc | left\|through\|through\|right | main |
|
||||||
|
| cx | left\|right | main |
|
||||||
|
| xd | | left |
|
||||||
|
| xe | | right |
|
||||||
|
| bf | | off |
|
||||||
|
| bh | | off |
|
||||||
|
| cg | | off |
|
||||||
|
| ci | | off |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,d | main,main,main,left,left | depart,use lane straight,use lane straight,turn left,arrive | ,left:false straight:false straight:true straight:false straight:false right:false,left:false straight:true straight:false right:false,left:true right:false, |
|
||||||
|
| a,e | main,main,main,right,right | depart,use lane straight,use lane straight,turn right,arrive | ,left:false straight:false straight:false straight:true straight:false right:false,left:false straight:false straight:true right:false,left:false right:true, |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: Anticipate Lanes for through with turn before / after
|
||||||
|
Given the node map
|
||||||
|
| a | b | c |
|
||||||
|
| | d | |
|
||||||
|
| f | e | g |
|
||||||
|
| | h | |
|
||||||
|
| j | i | l |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name | oneway |
|
||||||
|
| ab | right\|right\|right\|right | ab | yes |
|
||||||
|
| cb | left\|left\|left\|left | cb | yes |
|
||||||
|
| bd | | bdehi | |
|
||||||
|
| de | left\|left\|through\|through\|through\|through\|right\|right | bdehi | |
|
||||||
|
| ef | | ef | |
|
||||||
|
| eg | | eg | |
|
||||||
|
| eh | | bdehi | |
|
||||||
|
| hi | left\|left\|right\|right | bdehi | |
|
||||||
|
| ij | | ij | |
|
||||||
|
| il | | il | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes | # |
|
||||||
|
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
||||||
|
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
||||||
|
| a,j | ab,bdehi,bdehi,ij,ij | depart,turn right,use lane straight,turn right,arrive | ,right:true right:true right:false right:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
|
||||||
|
| a,l | ab,bdehi,bdehi,il,il | depart,turn right,use lane straight,turn left,arrive | ,right:false right:false right:true right:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
|
||||||
|
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
|
||||||
|
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
|
||||||
|
| c,l | cb,bdehi,bdehi,il,il | depart,turn left,use lane straight,turn left,arrive | ,left:false left:false left:true left:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
|
||||||
|
| c,j | cb,bdehi,bdehi,ij,ij | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false left:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: Anticipate Lanes for turns with through before and after
|
||||||
|
Given the node map
|
||||||
|
| a | b | q | | s | h | i |
|
||||||
|
| | | e | f | g | | |
|
||||||
|
| c | d | r | | t | j | k |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name |
|
||||||
|
| ab | through\|right\|right\|right | top |
|
||||||
|
| be | | top |
|
||||||
|
| bq | | off |
|
||||||
|
| ef | left\|through\|through\|through\|through\|right | main |
|
||||||
|
| fg | left\|left\|right\|right | main |
|
||||||
|
| fs | | off |
|
||||||
|
| ft | | off |
|
||||||
|
| gh | | top |
|
||||||
|
| hi | | top |
|
||||||
|
| cd | left\|left\|left\|through | bot |
|
||||||
|
| de | | bot |
|
||||||
|
| dr | | off |
|
||||||
|
| gj | | bot |
|
||||||
|
| jk | | bot |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,i | top,main,main,top,top | depart,turn right,use lane straight,turn left,arrive | ,straight:false right:false right:true right:true,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
||||||
|
| a,k | top,main,main,bot,bot | depart,turn right,use lane straight,turn right,arrive | ,straight:false right:true right:true right:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
||||||
|
| c,i | bot,main,main,top,top | depart,turn left,use lane straight,turn left,arrive | ,left:false left:true left:true straight:false,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
|
||||||
|
| c,k | bot,main,main,bot,bot | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false straight:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: Anticipate Lanes for turn between throughs
|
||||||
|
Given the node map
|
||||||
|
| | q | | |
|
||||||
|
| a | b | c | s |
|
||||||
|
| | r | d | t |
|
||||||
|
| | | e | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name |
|
||||||
|
| ab | left\|through\|through\|through\|through\|through\|right | main |
|
||||||
|
| bq | | off |
|
||||||
|
| br | | off |
|
||||||
|
| bc | through\|through\|right\|right\|right | main |
|
||||||
|
| cs | | off |
|
||||||
|
| cd | left\|through\|through | main |
|
||||||
|
| de | | main |
|
||||||
|
| dt | | off |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,e | main,main,main,main | depart,use lane straight,continue right,arrive | ,left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true, |
|
||||||
|
|
||||||
|
@anticipate @todo @2661
|
||||||
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
|
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | e | | |
|
| | | e | | |
|
||||||
@@ -314,7 +477,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
|
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Anticipate with lanes in roundabout where we stay on the roundabout for multiple exits
|
Scenario: No Lanes for Roundabouts, see #2626
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | a | | |
|
| | | a | | |
|
||||||
| | | b | | |
|
| | | b | | |
|
||||||
@@ -331,7 +494,7 @@ Feature: Turn Lane Guidance
|
|||||||
| cd | | primary | roundabout |
|
| cd | | primary | roundabout |
|
||||||
| de | | primary | roundabout |
|
| de | | primary | roundabout |
|
||||||
| ef | | primary | roundabout |
|
| ef | | primary | roundabout |
|
||||||
| fg | slight_right | primary | roundabout |
|
| fg | through\|slight_right | primary | roundabout |
|
||||||
| gb | | primary | roundabout |
|
| gb | | primary | roundabout |
|
||||||
| gh | | primary | |
|
| gh | | primary | |
|
||||||
| cx | | primary | |
|
| cx | | primary | |
|
||||||
@@ -341,10 +504,10 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,slight right:false slight right:true, |
|
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Departing or arriving inside a roundabout does not yet anticipate lanes
|
Scenario: No Lanes for Roundabouts, see #2626
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | a | | |
|
| | | a | | |
|
||||||
| x | b | | d | y |
|
| x | b | | d | y |
|
||||||
@@ -361,12 +524,43 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,slight right:false slight right:true, |
|
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
|
||||||
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
|
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||||
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
|
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate
|
||||||
Scenario: Departing or arriving inside a roundabout does not yet anticipate lanes (BIG version)
|
Scenario: No Lanes for Roundabouts, see #2626
|
||||||
|
Given the profile "lhs"
|
||||||
|
And the node map
|
||||||
|
| | | a | | |
|
||||||
|
| | | b | | |
|
||||||
|
| h | c | | g | |
|
||||||
|
| | | | | |
|
||||||
|
| | d | | f | |
|
||||||
|
| | | e | | |
|
||||||
|
| x | | | | y |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | highway | junction |
|
||||||
|
| ab | slight_left\|slight_left | primary | |
|
||||||
|
| bg | | primary | roundabout |
|
||||||
|
| gf | | primary | roundabout |
|
||||||
|
| fe | | primary | roundabout |
|
||||||
|
| ed | | primary | roundabout |
|
||||||
|
| dc | slight_left | primary | roundabout |
|
||||||
|
| cb | | primary | roundabout |
|
||||||
|
| ch | | primary | |
|
||||||
|
| ex | | primary | |
|
||||||
|
| dx | | primary | |
|
||||||
|
| gy | | primary | |
|
||||||
|
| fy | | primary | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,h | ab,ch,ch | depart,roundabout-exit-5,arrive | ,, |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: No Lanes for Roundabouts, see #2626
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | a | | |
|
| | | a | | |
|
||||||
| x | b | | d | y |
|
| x | b | | d | y |
|
||||||
@@ -417,12 +611,12 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,slight right:false slight right:true, |
|
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
|
||||||
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
|
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||||
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
|
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
|
||||||
|
|
||||||
@anticipate
|
@anticipate @todo @2032
|
||||||
Scenario: Anticipate Lanes for turns before and / or after roundabout
|
Scenario: No Lanes for Roundabouts, see #2626
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | | | x |
|
| a | b | | | x |
|
||||||
| | c | | | |
|
| | c | | | |
|
||||||
@@ -437,7 +631,7 @@ Feature: Turn Lane Guidance
|
|||||||
| bx | | primary | | abx |
|
| bx | | primary | | abx |
|
||||||
| bc | right\|right\|right\|right | primary | | bc |
|
| bc | right\|right\|right\|right | primary | | bc |
|
||||||
| cd | | primary | roundabout | cdefc |
|
| cd | | primary | roundabout | cdefc |
|
||||||
| de | slight_left\|slight_left&slight_left\|slight_right | primary | roundabout | cdefc |
|
| de | slight_left\|slight_left\|slight_left\|slight_right | primary | roundabout | cdefc |
|
||||||
| ef | left\|slight_right\|slight_right | primary | roundabout | cdefc |
|
| ef | left\|slight_right\|slight_right | primary | roundabout | cdefc |
|
||||||
| fc | | primary | roundabout | cdefc |
|
| fc | | primary | roundabout | cdefc |
|
||||||
| ey | | primary | | ey |
|
| ey | | primary | | ey |
|
||||||
@@ -447,10 +641,33 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | abx,bc,fg,gh,gh | depart,turn right,cdefc-exit-2,turn right,arrive | ,straight:false right:false right:false right:false right:true,right:false right:false right:false right:true,straight:false right:true, |
|
| a,h | abx,bc,fg,gh,gh | depart,turn right,cdefc-exit-2,turn right,arrive | ,straight:false right:false right:false right:false right:true,,straight:false right:true, |
|
||||||
|
|
||||||
@anticipate @bug @todo
|
@anticipate
|
||||||
Scenario: Tripple Right keeping Left
|
Scenario: Anticipate none tags
|
||||||
|
Given the node map
|
||||||
|
| a | b | c |
|
||||||
|
| | d | |
|
||||||
|
| f | e | g |
|
||||||
|
| | h | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | highway | name |
|
||||||
|
| ab | none\|none\|right\|right | primary | abc |
|
||||||
|
| bc | | primary | abc |
|
||||||
|
| bd | | primary | bdeh |
|
||||||
|
| de | left\|none\|none\|right | primary | bdeh |
|
||||||
|
| eh | | primary | bdeh |
|
||||||
|
| ef | | primary | feg |
|
||||||
|
| eg | | primary | feg |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,g | abc,bdeh,feg,feg | depart,turn right,turn left,arrive | ,none:false none:false right:true right:false,left:true none:false none:false right:false, |
|
||||||
|
| a,f | abc,bdeh,feg,feg | depart,turn right,turn right,arrive | ,none:false none:false right:false right:true,left:false none:false none:false right:true, |
|
||||||
|
|
||||||
|
@anticipate
|
||||||
|
Scenario: Triple Right keeping Left
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | | | b | | i |
|
| a | | | | b | | i |
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
@@ -471,10 +688,10 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,end of road left,arrive | ,none:false none:true right:false right:false,none:false none:true right:false right:false,none:false none:true right:false right:false,left:true right:false right:false, |
|
| a,f | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,turn left,arrive | ,none:false none:false right:true right:false,none:false none:false right:true right:false,none:false none:false right:true right:false,left:true right:false right:false, |
|
||||||
| a,g | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,end of road right,arrive | ,none:false none:false right:true right:true,none:false none:false right:true right:true,none:false none:false right:true right:true,left:false right:true right:true, |
|
| a,g | start,first,second,third,fourth,fourth | depart,turn right,turn right,turn right,turn right,arrive | ,none:false none:false right:true right:true,none:false none:false right:true right:true,none:false none:false right:true right:true,left:false right:true right:true, |
|
||||||
|
|
||||||
@anticipate @bug @todo
|
@anticipate
|
||||||
Scenario: Tripple Left keeping Right
|
Scenario: Tripple Left keeping Right
|
||||||
Given the node map
|
Given the node map
|
||||||
| i | | b | | | | a |
|
| i | | b | | | | a |
|
||||||
@@ -496,5 +713,5 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,end of road right,arrive | ,left:false left:false none:true none:false,left:false left:false none:true none:false,left:false left:false none:true none:false,left:false left:false right:true, |
|
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn right,arrive | ,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:false right:true, |
|
||||||
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,end of road left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
|
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
@routing @guidance
|
||||||
|
Feature: Features related to bugs
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 5 meters
|
||||||
|
|
||||||
|
@2852
|
||||||
|
Scenario: Loop
|
||||||
|
Given the node map
|
||||||
|
| a | 1 | | g | | | b |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| e | | | | | | f |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | 2 |
|
||||||
|
| d | | | h | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway |
|
||||||
|
| agb | top | yes |
|
||||||
|
| bfc | right | yes |
|
||||||
|
| chd | bottom | yes |
|
||||||
|
| dea | left | yes |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| g | traffic_signals |
|
||||||
|
| f | traffic_signals |
|
||||||
|
| h | traffic_signals |
|
||||||
|
| e | traffic_signals |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| 1,2 | top,right,right | depart,new name right,arrive |
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
@routing @guidance @collapsing
|
||||||
|
Feature: Collapse
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 5 meters
|
||||||
|
|
||||||
|
@reverse
|
||||||
|
Scenario: Collapse U-Turn Triangle Intersection
|
||||||
|
Given the node map
|
||||||
|
| g | | f | | e | | d |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| a | | | b | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abc | primary | road | yes |
|
||||||
|
| defg | primary | road | yes |
|
||||||
|
| fb | primary_link | | |
|
||||||
|
| be | primary_link | | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||||
|
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||||
|
|
||||||
|
@reverse @traffic-signals
|
||||||
|
Scenario: Collapse U-Turn Triangle Intersection
|
||||||
|
Given the node map
|
||||||
|
| g | | f | | j | | e | | d |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | h | | i | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abc | primary | road | yes |
|
||||||
|
| dejfg | primary | road | yes |
|
||||||
|
| fhb | primary_link | | |
|
||||||
|
| bie | primary_link | | |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| j | traffic_signals |
|
||||||
|
| h | traffic_signals |
|
||||||
|
| i | traffic_signals |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||||
|
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||||
@@ -136,6 +136,12 @@ Feature: Collapse
|
|||||||
|
|
||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||||
Given the node map
|
Given the node map
|
||||||
|
| | n | | m | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
| | g | | h | |
|
| | g | | h | |
|
||||||
| | | | | |
|
| | | | | |
|
||||||
| | | | | |
|
| | | | | |
|
||||||
@@ -144,6 +150,12 @@ Feature: Collapse
|
|||||||
| | | | | |
|
| | | | | |
|
||||||
| | | | | |
|
| | | | | |
|
||||||
| | j | | i | |
|
| | j | | i | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | k | | l | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name | oneway |
|
||||||
@@ -152,8 +164,8 @@ Feature: Collapse
|
|||||||
| de | primary | first | yes |
|
| de | primary | first | yes |
|
||||||
| ef | primary | first | yes |
|
| ef | primary | first | yes |
|
||||||
| be | primary | first | no |
|
| be | primary | first | no |
|
||||||
| gbh | primary | second | yes |
|
| ngbhm | primary | second | yes |
|
||||||
| iej | primary | second | yes |
|
| liejk | primary | second | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -176,6 +188,10 @@ Feature: Collapse
|
|||||||
|
|
||||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||||
Given the node map
|
Given the node map
|
||||||
|
| | n | | m | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
| | g | | h | |
|
| | g | | h | |
|
||||||
| | | | | |
|
| | | | | |
|
||||||
| | | | | |
|
| | | | | |
|
||||||
@@ -184,6 +200,10 @@ Feature: Collapse
|
|||||||
| | | | | |
|
| | | | | |
|
||||||
| | | | | |
|
| | | | | |
|
||||||
| | j | | i | |
|
| | j | | i | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | k | | l | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name | oneway |
|
||||||
@@ -192,8 +212,8 @@ Feature: Collapse
|
|||||||
| de | primary | first | yes |
|
| de | primary | first | yes |
|
||||||
| ef | primary | first | yes |
|
| ef | primary | first | yes |
|
||||||
| be | primary | second | no |
|
| be | primary | second | no |
|
||||||
| gbh | primary | second | yes |
|
| ngbhm | primary | second | yes |
|
||||||
| iej | primary | second | yes |
|
| liejk | primary | second | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -302,12 +322,12 @@ Feature: Collapse
|
|||||||
|
|
||||||
Scenario: Entering a segregated road
|
Scenario: Entering a segregated road
|
||||||
Given the node map
|
Given the node map
|
||||||
| | a | f | | |
|
| | a | f | | | | g |
|
||||||
| | | | | g |
|
| | | | | | | |
|
||||||
| | b | e | | |
|
| | b | e | | | | |
|
||||||
| | | | | |
|
| | | | | | | |
|
||||||
| | | | | |
|
| | | | | | | |
|
||||||
| c | d | | | |
|
| c | d | | | | | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name | oneway |
|
||||||
@@ -325,7 +345,6 @@ Feature: Collapse
|
|||||||
| g,f | second,first,first | depart,turn right,arrive |
|
| g,f | second,first,first | depart,turn right,arrive |
|
||||||
| g,c | second,first,first | depart,end of road left,arrive |
|
| g,c | second,first,first | depart,end of road left,arrive |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Do not collapse turning roads
|
Scenario: Do not collapse turning roads
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | e | | |
|
| | | e | | |
|
||||||
@@ -333,12 +352,12 @@ Feature: Collapse
|
|||||||
| a | | b | f | |
|
| a | | b | f | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name |
|
| nodes | highway | name | oneway |
|
||||||
| ab | primary | first |
|
| ab | primary | first | yes |
|
||||||
| bc | primary | first |
|
| bc | primary | first | yes |
|
||||||
| cd | primary | first |
|
| cd | primary | first | yes |
|
||||||
| ce | primary | second |
|
| ce | primary | second | yes |
|
||||||
| bf | primary | third |
|
| bf | primary | third | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -383,13 +402,13 @@ Feature: Collapse
|
|||||||
|
|
||||||
Scenario: Pankenbruecke
|
Scenario: Pankenbruecke
|
||||||
Given the node map
|
Given the node map
|
||||||
| h | | | | | | i | | | | | | |
|
| j | | | | h | | | | | | i | | | | | | |
|
||||||
| | | b | c | d | e | f | | | | | | g |
|
| | | | | | | b | c | d | e | f | | | | | | g |
|
||||||
| a | | | | | | | | | | | | |
|
| k | | | | a | | | | | | | | | | | | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | name | oneway |
|
| nodes | highway | name | oneway |
|
||||||
| abh | primary | inroad | yes |
|
| kabhj | primary | inroad | yes |
|
||||||
| bc | primary | inroad | no |
|
| bc | primary | inroad | no |
|
||||||
| cd | primary | bridge | no |
|
| cd | primary | bridge | no |
|
||||||
| defg | primary | outroad | no |
|
| defg | primary | outroad | no |
|
||||||
@@ -506,6 +525,36 @@ Feature: Collapse
|
|||||||
| icf | secondary | in | yes |
|
| icf | secondary | in | yes |
|
||||||
| gbj | secondary | out | yes |
|
| gbj | secondary | out | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| i,h | in,road,road | depart,turn left,arrive |
|
||||||
|
| a,d | road,road | depart,arrive |
|
||||||
|
| a,j | road,out,out | depart,turn slight right,arrive |
|
||||||
|
|
||||||
|
Scenario: Segregated Intersection into Very Slight Turn
|
||||||
|
Given the node map
|
||||||
|
| h | | | | | | |
|
||||||
|
| a | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | g | | | | |
|
||||||
|
| | | b | | | | |
|
||||||
|
| | | | f | | | |
|
||||||
|
| | | | c | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | e |
|
||||||
|
| | | | | | | d |
|
||||||
|
| | | j | i | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abcd | primary | road | yes |
|
||||||
|
| efgh | primary | road | yes |
|
||||||
|
| icf | secondary | in | yes |
|
||||||
|
| gbj | secondary | out | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| i,h | in,road,road | depart,turn slight left,arrive |
|
| i,h | in,road,road | depart,turn slight left,arrive |
|
||||||
@@ -571,12 +620,14 @@ Feature: Collapse
|
|||||||
| bd | road | yes | primary |
|
| bd | road | yes | primary |
|
||||||
| bc | road | yes | primary |
|
| bc | road | yes | primary |
|
||||||
| de | road | yes | primary |
|
| de | road | yes | primary |
|
||||||
| fdcg | cross | no | secondary |
|
| fd | cross | no | secondary |
|
||||||
|
| dc | cross | no | secondary |
|
||||||
|
| cg | cross | no | secondary |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | bd | fdcg | d | no_left_turn |
|
| restriction | bd | dc | d | no_left_turn |
|
||||||
| restriction | bc | fdcg | c | no_right_turn |
|
| restriction | bc | dc | c | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -585,12 +636,12 @@ Feature: Collapse
|
|||||||
|
|
||||||
Scenario: Forking before a turn (forky)
|
Scenario: Forking before a turn (forky)
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | | g | | |
|
| | | | | | g | | |
|
||||||
| | | | | | |
|
| | | | | | | | |
|
||||||
| | | | c | | |
|
| | | | | | c | | |
|
||||||
| a | b | | | | |
|
| a | | | b | | | | |
|
||||||
| | | | | d | |
|
| | | | | | | d | |
|
||||||
| | | | | f | e |
|
| | | | | | | f | e |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | oneway | highway |
|
| nodes | name | oneway | highway |
|
||||||
@@ -598,12 +649,14 @@ Feature: Collapse
|
|||||||
| bd | road | yes | primary |
|
| bd | road | yes | primary |
|
||||||
| bc | road | yes | primary |
|
| bc | road | yes | primary |
|
||||||
| de | road | yes | primary |
|
| de | road | yes | primary |
|
||||||
| fdcg | cross | no | secondary |
|
| fd | cross | no | secondary |
|
||||||
|
| dc | cross | no | secondary |
|
||||||
|
| cg | cross | no | secondary |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | bd | fdcg | d | no_left_turn |
|
| restriction | bd | dc | d | no_left_turn |
|
||||||
| restriction | bc | fdcg | c | no_right_turn |
|
| restriction | bc | dc | c | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -630,3 +683,158 @@ Feature: Collapse
|
|||||||
| f,d | on,Hwy,Hwy | depart,merge slight right,arrive |
|
| f,d | on,Hwy,Hwy | depart,merge slight right,arrive |
|
||||||
| f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive |
|
| f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive |
|
||||||
| a,e | Hwy,off,off | depart,off ramp right,arrive |
|
| a,e | Hwy,off,off | depart,off ramp right,arrive |
|
||||||
|
|
||||||
|
@negative @straight
|
||||||
|
Scenario: Don't collapse going straight if actual turn
|
||||||
|
Given the node map
|
||||||
|
| | c | e | | |
|
||||||
|
| | | d | | f |
|
||||||
|
| | | | | |
|
||||||
|
| | | b | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | a | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway |
|
||||||
|
| abc | main | primary |
|
||||||
|
| bde | straight | residential |
|
||||||
|
| df | right | residential |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | main,main | depart,arrive |
|
||||||
|
| a,e | main,straight,straight | depart,turn straight,arrive |
|
||||||
|
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive |
|
||||||
|
|
||||||
|
Scenario: Entering a segregated road
|
||||||
|
Given the node map
|
||||||
|
| | a | f | | |
|
||||||
|
| | | | | g |
|
||||||
|
| | b | e | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| c | d | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abc | primary | first | yes |
|
||||||
|
| def | primary | first | yes |
|
||||||
|
| be | primary | first | no |
|
||||||
|
| ge | primary | second | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||||
|
|
||||||
|
Scenario: Entering a segregated road slight turn
|
||||||
|
Given the node map
|
||||||
|
| | | a | f | |
|
||||||
|
| | | | | g |
|
||||||
|
| | b | e | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| c | d | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abc | primary | first | yes |
|
||||||
|
| def | primary | first | yes |
|
||||||
|
| be | primary | first | no |
|
||||||
|
| ge | primary | second | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||||
|
|
||||||
|
Scenario: Do not collapse UseLane step when lanes change
|
||||||
|
Given the node map
|
||||||
|
| | | | f | g | |
|
||||||
|
| | | | | | |
|
||||||
|
| a | b | c | d | | e |
|
||||||
|
| | | | | | |
|
||||||
|
| | | | h | i | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name |
|
||||||
|
| ab | | main |
|
||||||
|
| bc | left\|through\|through\|through\|right | main |
|
||||||
|
| cd | left\|through\|right | main |
|
||||||
|
| de | | main |
|
||||||
|
| cf | | off |
|
||||||
|
| ch | | off |
|
||||||
|
| dg | | off |
|
||||||
|
| di | | off |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,e | main,main,main | depart,use lane straight,arrive |
|
||||||
|
|
||||||
|
Scenario: But _do_ collapse UseLane step when lanes stay the same
|
||||||
|
Given the node map
|
||||||
|
| | | | f | g | |
|
||||||
|
| | | | | | |
|
||||||
|
| a | b | c | d | | e |
|
||||||
|
| | | | | | |
|
||||||
|
| | | | h | i | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes:forward | name |
|
||||||
|
| ab | | main |
|
||||||
|
| bc | left\|through\|through\|through\|right | main |
|
||||||
|
| cd | left\|through\|through\|through\|right | main |
|
||||||
|
| de | | main |
|
||||||
|
| cf | | off |
|
||||||
|
| ch | | off |
|
||||||
|
| dg | | off |
|
||||||
|
| di | | off |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,e | main,main | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: Don't collapse different travel modes
|
||||||
|
Given the node map
|
||||||
|
| g | | | | | | | h | |
|
||||||
|
| a | b | | c | | | | e | f |
|
||||||
|
| | | | | | d | | | |
|
||||||
|
| | | | i | j | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name |
|
||||||
|
| ab | primary | | road |
|
||||||
|
| bc | primary | ferry | |
|
||||||
|
| cd | primary | | road |
|
||||||
|
| de | | ferry | |
|
||||||
|
| ef | primary | | road |
|
||||||
|
| bg | service | | turn |
|
||||||
|
| ci | service | | turn |
|
||||||
|
| dj | service | | turn |
|
||||||
|
| eh | service | | turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route |
|
||||||
|
| a,f | road,,road,,road,road |
|
||||||
|
|
||||||
|
Scenario: U-Turn onto a Ferry
|
||||||
|
Given the node map
|
||||||
|
| | | | | | | i | | |
|
||||||
|
| j | e | | | | | d | c | h |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| k | g | | | | | a | b | f |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | route | name | oneway |
|
||||||
|
| bf | primary | | road | yes |
|
||||||
|
| hcd | primary | | road | yes |
|
||||||
|
| bc | primary | | | yes |
|
||||||
|
| di | service | | serv | yes |
|
||||||
|
| ed | | ferry | ferry | |
|
||||||
|
| gab | | ferry | ferry | |
|
||||||
|
| kg | primary | | on | yes |
|
||||||
|
| ej | primary | | off | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| k,j | on,ferry,,ferry,off,off | depart,new name straight,continue uturn,turn straight,new name straight,arrive |
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | first,,second,second | depart,off ramp slight right,merge slight left,arrive |
|
| a,g | first,,second,second | depart,off ramp slight right,turn straight,arrive |
|
||||||
|
|
||||||
Scenario: Inner city expressway with on road
|
Scenario: Inner city expressway with on road
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -164,6 +164,188 @@ Feature: Slipways and Dedicated Turn Lanes
|
|||||||
| pq | primary | Ettlinger Allee | | yes |
|
| pq | primary | Ettlinger Allee | | yes |
|
||||||
| qe | secondary_link | Ettlinger Allee | | yes |
|
| qe | secondary_link | Ettlinger Allee | | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | ref |
|
||||||
|
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,, |
|
||||||
|
|
||||||
|
Scenario: Traffic Lights everywhere
|
||||||
|
#http://map.project-osrm.org/?z=18¢er=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
|
||||||
|
Given the node map
|
||||||
|
| a | | | k | l | | | j | |
|
||||||
|
| | | | | | d | b | c | i |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | e | g | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | 1 | | |
|
||||||
|
| | | | | | | | h | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | | | | | f | |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| b | traffic_signals |
|
||||||
|
| e | traffic_signals |
|
||||||
|
| g | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| aklbci | secondary | Ebertstrasse | yes |
|
||||||
|
| kdeh | secondary_link | | yes |
|
||||||
|
| jcghf | primary | Brauerstrasse | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,o | Schwarzwaldstrasse (L561),Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive |
|
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||||
|
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||||
|
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
|
||||||
|
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive |
|
||||||
|
|
||||||
|
#2839
|
||||||
|
Scenario: Self-Loop
|
||||||
|
Given the node map
|
||||||
|
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | l | | | k | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | j | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | m | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | h |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | n | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g |
|
||||||
|
| | | | | | | | | | | | | | | | | | | o | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f | |
|
||||||
|
| | | | | | | | | | | | | | | | | | p | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | e | | | |
|
||||||
|
| a | | | | | b | | | | | | | | | c | | | | | | | | | | d | | | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway | highway | lanes |
|
||||||
|
| abc | circled | no | residential | 1 |
|
||||||
|
| cdefghijklmnopc | circled | yes | residential | 1 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | bearings | route | turns |
|
||||||
|
| b,a | 90,10 270,10 | circled,circled | depart,arrive |
|
||||||
|
|
||||||
|
@todo
|
||||||
|
#due to the current turn function, the left turn bcp is exactly the same cost as pcb, a right turn. The right turn should be way faster,though
|
||||||
|
#for that reason we cannot distinguish between driving clockwise through the circle or counter-clockwise. Until this is improved, this case here
|
||||||
|
#has to remain as todo (see #https://github.com/Project-OSRM/osrm-backend/pull/2849)
|
||||||
|
Scenario: Self-Loop - Bidirectional
|
||||||
|
Given the node map
|
||||||
|
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | l | | | k | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | j | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | m | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | h |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | n | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g |
|
||||||
|
| | | | | | | | | | | | | | | | | | | o | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f | |
|
||||||
|
| | | | | | | | | | | | | | | | | | p | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | e | | | |
|
||||||
|
| a | | | | | b | | | | | | | | | c | | | | | | | | | | d | | | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | oneway | highway | lanes |
|
||||||
|
| abc | circled | no | residential | 1 |
|
||||||
|
| cdefghijklmnopc | circled | no | residential | 1 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | bearings | route | turns |
|
||||||
|
| b,a | 90,10 270,10 | circled,circled | depart,arrive |
|
||||||
|
|
||||||
|
#http://www.openstreetmap.org/#map=19/38.90597/-77.01276
|
||||||
|
Scenario: Don't falsly classify as sliproads
|
||||||
|
Given the node map
|
||||||
|
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | j | | | | | | | |
|
||||||
|
| a | b | | | | | | | | | | | | | | | | | | | | | | c | | | | | | | d |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | e | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | 1 | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | f | | | | | g | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | | | | | | i | | | | | | | h |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | maxspeed |
|
||||||
|
| abcd | new york | primary | yes | 35 |
|
||||||
|
| befgh | m street | secondary | yes | 35 |
|
||||||
|
| igcj | 1st street | tertiary | no | 20 |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| c | traffic_signals |
|
||||||
|
| g | traffic_signals |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | # |
|
||||||
|
| a,d | new york,new york | depart,arrive | this is the sinatra route |
|
||||||
|
| a,j | new york,1st street,1st street | depart,turn left,arrive | |
|
||||||
|
| a,1 | new york,m street,1st street,1st street | depart,turn right,turn left,arrive | this can false be seen as a sliproad |
|
||||||
|
|
||||||
|
# Merging into degree two loop on dedicated turn detection / 2927
|
||||||
|
Scenario: Turn Instead of Ramp
|
||||||
|
Given the node map
|
||||||
|
| | | | | | | | | | | | | | | | f |
|
||||||
|
| | | | | g | | | | | | h | | | | | |
|
||||||
|
| | | | | | | | | | | | | d | | | e |
|
||||||
|
| i | | | | c | | | | | | j | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | b | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | |
|
||||||
|
| | | a | | | | | | | | | | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abi | primary | road | yes |
|
||||||
|
| bcjd | primary | loop | yes |
|
||||||
|
| dhgf | primary | loop | yes |
|
||||||
|
| fed | primary | loop | yes |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| g | traffic_signals |
|
||||||
|
| c | traffic_signals |
|
||||||
|
|
||||||
|
# We don't actually care about routes here, this is all about endless loops in turn discovery
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,i | road,road,road | depart,fork slight left,arrive |
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ Feature: Destination Signs
|
|||||||
| qr | QR | | | A1;A2 | yes | |
|
| qr | QR | | | A1;A2 | yes | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | destinations | # |
|
| from | to | route | destinations | ref | # |
|
||||||
| a | b | AB (E1),AB (E1) | , | |
|
| a | b | AB,AB | , | E1,E1 | |
|
||||||
| c | d | CD (Berlin),CD (Berlin) | Berlin,Berlin | |
|
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||||
| e | f | EF (A1: Berlin),EF (A1: Berlin) | A1: Berlin,A1: Berlin | |
|
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||||
| g | h | , | A1: Berlin,A1: Berlin | |
|
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||||
| i | j | , | Berlin,Berlin | |
|
| i | j | , | Berlin,Berlin | , | |
|
||||||
| k | l | KL (E1),KL (E1) | A1: Berlin,A1: Berlin | |
|
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||||
| m | n | MN (A1, A2: Berlin, Hamburg),MN (A1, A2: Berlin, Hamburg) | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | |
|
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||||
| o | p | OP,OP | , | guard against mis-tagging |
|
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||||
| q | r | QR (A1, A2),QR (A1, A2) | A1, A2,A1, A2 | |
|
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||||
|
|||||||
@@ -312,5 +312,5 @@ Feature: Fork Instructions
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,j | on,xbcj,xbcj | depart,merge slight left,arrive |
|
| a,j | on,xbcj | depart,arrive |
|
||||||
| a,i | on,xbcj,off,off | depart,merge slight left,turn slight right,arrive |
|
| a,i | on,off,off | depart,turn slight right,arrive |
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ Feature: Merging
|
|||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 10 meters
|
And a grid size of 10 meters
|
||||||
|
|
||||||
|
@merge
|
||||||
Scenario: Merge on Four Way Intersection
|
Scenario: Merge on Four Way Intersection
|
||||||
Given the node map
|
Given the node map
|
||||||
| d | | |
|
| d | | | | | | | | | |
|
||||||
| a | b | c |
|
| a | | b | | | | | | | c |
|
||||||
| e | | |
|
| e | | | | | | | | | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway |
|
| nodes | highway |
|
||||||
@@ -19,13 +20,14 @@ Feature: Merging
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| d,c | db,abc,abc | depart,merge slight right,arrive |
|
| d,c | db,abc,abc | depart,turn straight,arrive |
|
||||||
| e,c | eb,abc,abc | depart,merge slight left,arrive |
|
| e,c | eb,abc,abc | depart,turn straight,arrive |
|
||||||
|
|
||||||
|
@merge
|
||||||
Scenario: Merge on Three Way Intersection Right
|
Scenario: Merge on Three Way Intersection Right
|
||||||
Given the node map
|
Given the node map
|
||||||
| d | | |
|
| d | | | | | | | | | |
|
||||||
| a | b | c |
|
| a | | b | | | | | | | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway |
|
| nodes | highway |
|
||||||
@@ -34,12 +36,13 @@ Feature: Merging
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| d,c | db,abc,abc | depart,merge slight right,arrive |
|
| d,c | db,abc,abc | depart,turn straight,arrive |
|
||||||
|
|
||||||
Scenario: Merge on Three Way Intersection Right
|
@merge @negative
|
||||||
|
Scenario: Don't Merge on Short-Three Way Intersection Right
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c |
|
| d | | | | | | | |
|
||||||
| d | | |
|
| a | | b | | | | | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway |
|
| nodes | highway |
|
||||||
@@ -48,14 +51,36 @@ Feature: Merging
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| d,c | db,abc,abc | depart,merge slight left,arrive |
|
| d,c | db,abc,abc | depart,turn slight left,arrive |
|
||||||
|
|
||||||
|
|
||||||
|
@merge
|
||||||
|
Scenario: Merge on Three Way Intersection Right
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | | | | | | c |
|
||||||
|
| d | | | | | | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| abc | primary |
|
||||||
|
| db | primary |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| d,c | db,abc,abc | depart,turn straight,arrive |
|
||||||
|
|
||||||
|
@merge
|
||||||
Scenario: Merge onto a turning road
|
Scenario: Merge onto a turning road
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | | | | | e |
|
| | | | | | | e |
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
| | | | | | d | |
|
| | | | | | d | |
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
@@ -72,5 +97,20 @@ Feature: Merging
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route |
|
| waypoints | turns | route |
|
||||||
| f,e | depart,merge slight left,arrive | in,road,road |
|
| f,e | depart,turn straight,arrive | in,road,road |
|
||||||
| f,a | depart,turn sharp left,arrive | in,road,road |
|
| f,a | depart,turn sharp left,arrive | in,road,road |
|
||||||
|
|
||||||
|
@merge
|
||||||
|
Scenario: Merge onto a motorway
|
||||||
|
Given the node map
|
||||||
|
| d | | | | | | | | | |
|
||||||
|
| a | | | b | | | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| abc | A100 | motorway | yes |
|
||||||
|
| db | | motorway_link | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| d,c | ,A100,A100 | depart,merge slight right,arrive |
|
||||||
|
|||||||
@@ -125,10 +125,10 @@ Feature: New-Name Instructions
|
|||||||
| | | | | c |
|
| | | | | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway |
|
| nodes | highway | oneway |
|
||||||
| ab | residential |
|
| ab | residential | yes |
|
||||||
| bc | residential |
|
| bc | residential | yes |
|
||||||
| bd | service |
|
| bd | service | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -164,3 +164,172 @@ Feature: New-Name Instructions
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,e | name,with-name,with-name | depart,new name straight,arrive |
|
| a,e | name,with-name,with-name | depart,new name straight,arrive |
|
||||||
| b,e | with-name,with-name | depart,arrive |
|
| b,e | with-name,with-name | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: Both Name and Ref Empty
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | | |
|
||||||
|
| bc | | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | , | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: Same Name, Ref Extended
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | A | B1 |
|
||||||
|
| bc | C | B1;B2 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | A,C,C | depart,new name straight,arrive |
|
||||||
|
|
||||||
|
Scenario: Same Name, Ref Removed
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | A | B1;B2 |
|
||||||
|
| bc | C | B1 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | A,C,C | depart,new name straight,arrive |
|
||||||
|
|
||||||
|
Scenario: Name Removed, Ref Extended
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | A | B1 |
|
||||||
|
| bc | | B1;B2 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | A, | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: Name Added, Ref Removed
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref |
|
||||||
|
| ab | | B1 |
|
||||||
|
| bc | A | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | ,A,A | depart,new name straight,arrive |
|
||||||
|
|
||||||
|
Scenario: Prefix Change
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ab | North Central Expressway | US 75 | motorway |
|
||||||
|
| bc | Central Expressway | US 75 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | North Central Expressway,Central Expressway,Central Expressway | depart,new name straight,arrive |
|
||||||
|
|
||||||
|
Scenario: Prefix Change
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ba | North Central Expressway | US 75 | motorway |
|
||||||
|
| cb | Central Expressway | US 75 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| c,a | Central Expressway,North Central Expressway,North Central Expressway | depart,new name straight,arrive |
|
||||||
|
|
||||||
|
Scenario: No Name, Same Reference
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ab | Central Expressway | US 75 | motorway |
|
||||||
|
| bc | | US 75 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | Central Expressway, | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: No Name, Same Reference
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ab | | US 75 | motorway |
|
||||||
|
| bc | Central Expressway | US 75 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | ,Central Expressway | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: No Name, Same Reference
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ab | | US 75;US 69 | motorway |
|
||||||
|
| bc | | US 75 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | , | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: No Name, Same Reference
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ab | | US 69;US 75 | motorway |
|
||||||
|
| bc | | US 75 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | , | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: No Name, Same Reference
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ab | | US 75 | motorway |
|
||||||
|
| bc | | US 75;US 69 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | , | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: No Name, Same Reference
|
||||||
|
Given the node map
|
||||||
|
| a | | | | b | | | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | ref | highway |
|
||||||
|
| ab | | US 75 | motorway |
|
||||||
|
| bc | | US 69;US 75 | motorway |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | , | depart,arrive |
|
||||||
|
|||||||
@@ -0,0 +1,126 @@
|
|||||||
|
@routing @guidance @perceived-angles
|
||||||
|
Feature: Simple Turns
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 5 meters
|
||||||
|
|
||||||
|
Scenario: Turning into splitting road
|
||||||
|
Given the node map
|
||||||
|
| | a | | |
|
||||||
|
| | b | | |
|
||||||
|
| | | | |
|
||||||
|
| | | | |
|
||||||
|
| c | | d | |
|
||||||
|
| | | | |
|
||||||
|
| | | | e |
|
||||||
|
| | | | |
|
||||||
|
| | | f | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| ab | road | primary | no |
|
||||||
|
| bc | road | primary | yes |
|
||||||
|
| fdb | road | primary | yes |
|
||||||
|
| de | turn | primary | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| f,a | depart,arrive | road,road |
|
||||||
|
| e,a | depart,turn slight right,arrive | turn,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 |
|
||||||
@@ -83,14 +83,14 @@ Feature: Ramp Guidance
|
|||||||
|
|
||||||
Scenario: Ramp Off Though Street
|
Scenario: Ramp Off Though Street
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | c |
|
| | | | | c |
|
||||||
| a | b | |
|
| a | | | b | |
|
||||||
| | d | |
|
| | | | d | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway |
|
| nodes | highway | oneway |
|
||||||
| abc | tertiary |
|
| abc | tertiary | yes |
|
||||||
| bd | motorway_link |
|
| bd | motorway_link | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -110,7 +110,7 @@ Feature: Ramp Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | abc,bd,bd | depart,on ramp straight,arrive |
|
| a,d | abc,bd,bd | depart,on ramp straight,arrive |
|
||||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
| a,c | abc,abc | depart,arrive |
|
||||||
|
|
||||||
Scenario: Fork Ramp Off Turning Though Street
|
Scenario: Fork Ramp Off Turning Though Street
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -126,7 +126,7 @@ Feature: Ramp Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | abc,bd,bd | depart,on ramp right,arrive |
|
| a,d | abc,bd,bd | depart,on ramp right,arrive |
|
||||||
| a,c | abc,abc,abc | depart,continue left,arrive |
|
| a,c | abc,abc | depart,arrive |
|
||||||
|
|
||||||
Scenario: Fork Ramp
|
Scenario: Fork Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -176,7 +176,7 @@ Feature: Ramp Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | abc,bd,bd | depart,on ramp slight right,arrive |
|
| a,d | abc,bd,bd | depart,on ramp slight right,arrive |
|
||||||
| a,c | abc,abc,abc | depart,continue slight left,arrive |
|
| a,c | abc,abc | depart,arrive |
|
||||||
|
|
||||||
Scenario: Fork Slight Ramp on Obvious Through Street
|
Scenario: Fork Slight Ramp on Obvious Through Street
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -5,37 +5,6 @@ Feature: Basic Roundabout
|
|||||||
Given the profile "bicycle"
|
Given the profile "bicycle"
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
|
|
||||||
Scenario: Enter and Exit
|
|
||||||
Given the node map
|
|
||||||
| | | a | | |
|
|
||||||
| | | b | | |
|
|
||||||
| h | g | | c | d |
|
|
||||||
| | | e | | |
|
|
||||||
| | | f | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bgecb | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
|
||||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
|
||||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
|
||||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
|
||||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
|
||||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
|
||||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
|
||||||
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
|
|
||||||
|
|
||||||
Scenario: Only Enter
|
Scenario: Only Enter
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | a | | |
|
| | | a | | |
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
@routing @guidance
|
||||||
|
Feature: Basic Roundabout
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "bicycle"
|
||||||
|
Given a grid size of 10 meters
|
||||||
|
|
||||||
|
Scenario: Enter and Exit
|
||||||
|
Given the node map
|
||||||
|
| | | a | | |
|
||||||
|
| | | b | | |
|
||||||
|
| h | g | | c | d |
|
||||||
|
| | | e | | |
|
||||||
|
| | | f | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction |
|
||||||
|
| ab | |
|
||||||
|
| cd | |
|
||||||
|
| ef | |
|
||||||
|
| gh | |
|
||||||
|
| bgecb | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| d,f | cd,ef,ef | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| d,h | cd,gh,gh | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| f,h | ef,gh,gh | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| h,a | gh,ab,ab | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| h,d | gh,cd,cd | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| h,f | gh,ef,ef | depart,roundabout turn right exit-1,arrive |
|
||||||
@@ -389,3 +389,125 @@ Feature: Basic Roundabout
|
|||||||
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive | 0->180,180->224,180->0 |
|
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive | 0->180,180->224,180->0 |
|
||||||
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive | 0->180,180->224,270->0 |
|
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive | 0->180,180->224,270->0 |
|
||||||
|
|
||||||
|
Scenario: Enter and Exit - Bearings
|
||||||
|
Given the node map
|
||||||
|
| | | | a | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | i | b | l | | |
|
||||||
|
| h | | g | | c | | d |
|
||||||
|
| | | j | e | k | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | f | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction |
|
||||||
|
| ab | |
|
||||||
|
| cd | |
|
||||||
|
| ef | |
|
||||||
|
| gh | |
|
||||||
|
| bigjekclb | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | bearing |
|
||||||
|
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive | 0->180,180->270,90->0 |
|
||||||
|
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive | 0->180,180->270,180->0 |
|
||||||
|
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive | 0->180,180->270,270->0 |
|
||||||
|
|
||||||
|
Scenario: Large radius Roundabout Intersection and ways modelled out: East Mission St, North 7th St
|
||||||
|
# http://www.openstreetmap.org/way/348812150
|
||||||
|
# Note: grid size is 3 meter, this roundabout is more like 5-10 meters in radius
|
||||||
|
Given the node map
|
||||||
|
| | | | a | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | b | | n | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | c | | | | m | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| e | | d | | | | k | | l |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | f | | | | j | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | g | | i | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
|
| | | | h | | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction | highway | name |
|
||||||
|
| ab | | tertiary | North 7th St |
|
||||||
|
| ed | | tertiary | East Mission St |
|
||||||
|
| hg | | tertiary | North 7th St |
|
||||||
|
| lk | | tertiary | East Mission St |
|
||||||
|
| bcdfgijkmnb | roundabout | tertiary | Roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,e | North 7th St,East Mission St,East Mission St | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| a,h | North 7th St,North 7th St,North 7th St | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| a,l | North 7th St,East Mission St,East Mission St | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| h,l | North 7th St,East Mission St,East Mission St | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| h,a | North 7th St,North 7th St,North 7th St | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| h,e | North 7th St,East Mission St,East Mission St | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| e,h | East Mission St,North 7th St,North 7th St | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| e,l | East Mission St,East Mission St,East Mission St | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| e,a | East Mission St,North 7th St,North 7th St | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| l,a | East Mission St,North 7th St,North 7th St | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| l,e | East Mission St,East Mission St,East Mission St | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| l,h | East Mission St,North 7th St,North 7th St | depart,roundabout turn left exit-3,arrive |
|
||||||
|
|
||||||
|
Scenario: Enter and Exit - Traffic Signals
|
||||||
|
Given the node map
|
||||||
|
| | | a | | |
|
||||||
|
| | i | b | l | |
|
||||||
|
| h | g | | c | d |
|
||||||
|
| | j | e | k | |
|
||||||
|
| | | f | | |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| i | traffic_signals |
|
||||||
|
| j | traffic_signals |
|
||||||
|
| k | traffic_signals |
|
||||||
|
| l | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction |
|
||||||
|
| ab | |
|
||||||
|
| cd | |
|
||||||
|
| ef | |
|
||||||
|
| gh | |
|
||||||
|
| bigjekclb | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| d,f | cd,ef,ef | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| d,h | cd,gh,gh | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| f,h | ef,gh,gh | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
|
||||||
|
| h,a | gh,ab,ab | depart,roundabout turn left exit-3,arrive |
|
||||||
|
| h,d | gh,cd,cd | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| h,f | gh,ef,ef | depart,roundabout turn right exit-1,arrive |
|
||||||
|
|
||||||
|
#http://www.openstreetmap.org/#map=19/41.03275/-2.18990
|
||||||
|
#at some point we probably want to recognise these situations and don't mention the roundabout at all here
|
||||||
|
Scenario: Enter And Exit Throughabout
|
||||||
|
Given the node map
|
||||||
|
| | | | | | h | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| c | b | | d | | | | e | | f |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | a | | | | g | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | junction | oneway |
|
||||||
|
| dghd | tertiary_link | | roundabout | |
|
||||||
|
| cbdef | trunk | through | | no |
|
||||||
|
| ab | residential | in | | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,f | depart,turn right,roundabout turn straight exit-1,arrive | in,through,through,through |
|
||||||
|
|||||||
@@ -5,37 +5,6 @@ Feature: Basic Roundabout
|
|||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
|
|
||||||
Scenario: Enter and Exit
|
|
||||||
Given the node map
|
|
||||||
| | | a | | |
|
|
||||||
| | | b | | |
|
|
||||||
| h | g | | c | d |
|
|
||||||
| | | e | | |
|
|
||||||
| | | f | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bgecb | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
|
||||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
|
||||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
|
||||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
|
||||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
|
||||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
|
||||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
|
||||||
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
|
|
||||||
|
|
||||||
Scenario: Only Enter
|
Scenario: Only Enter
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | a | | |
|
| | | a | | |
|
||||||
@@ -67,6 +36,25 @@ Feature: Basic Roundabout
|
|||||||
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||||
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
|
||||||
|
|
||||||
|
#2927
|
||||||
|
Scenario: Only Roundabout
|
||||||
|
Given the node map
|
||||||
|
| | | a | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| b | | | | d |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | c | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction |
|
||||||
|
| abcda | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | abcda,abcda | depart,arrive |
|
||||||
|
|
||||||
Scenario: Only Exit
|
Scenario: Only Exit
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | a | | |
|
| | | a | | |
|
||||||
@@ -280,87 +268,6 @@ Feature: Basic Roundabout
|
|||||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
| a | | |
|
|
||||||
| b | | |
|
|
||||||
| c | d | f |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| ce | |
|
|
||||||
| df | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
| a | | |
|
|
||||||
| d | | |
|
|
||||||
| b | c | f |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ad | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| be | |
|
|
||||||
| cf | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ad,be,be | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ad,cf,cf | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Collinear in X,Y
|
|
||||||
Given the node map
|
|
||||||
| a | | |
|
|
||||||
| c | | |
|
|
||||||
| d | b | f |
|
|
||||||
| e | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ac | |
|
|
||||||
| bcdb | roundabout |
|
|
||||||
| de | |
|
|
||||||
| bf | |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns |
|
|
||||||
| a,e | ac,de,de | depart,roundabout-exit-1,arrive |
|
|
||||||
| a,f | ac,bf,bf | depart,roundabout-exit-2,arrive |
|
|
||||||
|
|
||||||
Scenario: Enter and Exit - Bearings
|
|
||||||
Given the node map
|
|
||||||
| | | | a | | | |
|
|
||||||
| | | | | | | |
|
|
||||||
| | | i | b | l | | |
|
|
||||||
| h | | g | | c | | d |
|
|
||||||
| | | j | e | k | | |
|
|
||||||
| | | | | | | |
|
|
||||||
| | | | f | | | |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bigjekclb | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
|
||||||
| waypoints | route | turns | bearing |
|
|
||||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive | 0->180,180->270,90->0 |
|
|
||||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive | 0->180,180->270,180->0 |
|
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive | 0->180,180->270,270->0 |
|
|
||||||
|
|
||||||
Scenario: Motorway Roundabout
|
Scenario: Motorway Roundabout
|
||||||
#See 39.933742 -75.082345
|
#See 39.933742 -75.082345
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -395,9 +302,9 @@ Feature: Basic Roundabout
|
|||||||
| dmg | roundabout | | trunk_link | yes | |
|
| dmg | roundabout | | trunk_link | yes | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns | ref |
|
||||||
| a,e | crescent (US 130),crescent (US 130),crescent (US 130) | depart,roundabout-exit-3,arrive |
|
| a,e | crescent,crescent,crescent | depart,roundabout-exit-3,arrive | US 130,US 130,US 130 |
|
||||||
| j,l | NJ 38,NJ 38,NJ 38 | depart,roundabout-exit-2,arrive |
|
| j,l | ,, | depart,roundabout-exit-2,arrive | NJ 38,NJ 38,NJ 38 |
|
||||||
|
|
||||||
Scenario: Double Roundabout with through-lane
|
Scenario: Double Roundabout with through-lane
|
||||||
#http://map.project-osrm.org/?z=18¢er=38.911752%2C-77.048667&loc=38.912003%2C-77.050831&loc=38.909277%2C-77.042516&hl=en&alt=0
|
#http://map.project-osrm.org/?z=18¢er=38.911752%2C-77.048667&loc=38.912003%2C-77.050831&loc=38.909277%2C-77.042516&hl=en&alt=0
|
||||||
@@ -438,41 +345,106 @@ Feature: Basic Roundabout
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,dupont circle-exit-1,arrive |
|
| a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,dupont circle-exit-1,arrive |
|
||||||
|
|
||||||
Scenario: Enter and Exit - Traffic Signals
|
#2856 - http://www.openstreetmap.org/#map=19/47.23318/-1.56563
|
||||||
|
Scenario: Linked Roundabouts
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | a | | |
|
| | | | | | | | | | | | | | x |
|
||||||
| | i | b | l | |
|
| | u | | | | | | | | | | | r | |
|
||||||
| h | g | | c | d |
|
| | | | | | | | | | | | | | |
|
||||||
| | j | e | k | |
|
| | | | t | | | | | | | | | | |
|
||||||
| | | f | | |
|
| | | | | | | | | | | s | | | |
|
||||||
|
| | | v | | | i | | h | | g | | | | |
|
||||||
|
| | | | | | | | | | | | q | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | j | | | | | | | | f | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | a | | | | | | | | e | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | b | | c | | d | | p | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | m | | | | | | | | n | | | |
|
||||||
|
| | | | | l | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | k | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | |
|
||||||
|
| | w | | | | | | | | | | o | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction | name | highway | oneway |
|
||||||
|
| abija | roundabout | egg | primary | yes |
|
||||||
|
| defgd | roundabout | egg | primary | yes |
|
||||||
|
| bcd | roundabout | egg | primary | yes |
|
||||||
|
| ghi | | egg | primary | yes |
|
||||||
|
| amklb | | ll | primary | yes |
|
||||||
|
| wk | | ll | primary | no |
|
||||||
|
| dnope | | lr | secondary | yes |
|
||||||
|
| fqrsg | | tr | primary | yes |
|
||||||
|
| rx | | tr | primary | no |
|
||||||
|
| ituvj | | tl | primary | yes |
|
||||||
|
|
||||||
And the nodes
|
And the nodes
|
||||||
| node | highway |
|
| node | highway |
|
||||||
| i | traffic_signals |
|
| c | give_way |
|
||||||
| j | traffic_signals |
|
| h | give_way |
|
||||||
| k | traffic_signals |
|
|
||||||
| l | traffic_signals |
|
|
||||||
|
|
||||||
And the ways
|
|
||||||
| nodes | junction |
|
|
||||||
| ab | |
|
|
||||||
| cd | |
|
|
||||||
| ef | |
|
|
||||||
| gh | |
|
|
||||||
| bigjekclb | roundabout |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
|
# since we cannot handle these invalid roundabout tags yet, we cannout output roundabout taggings. This will hopefully change some day
|
||||||
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
|
#| w,x | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive |
|
||||||
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
|
| w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn slight left,arrive |
|
||||||
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
|
|
||||||
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
|
|
||||||
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
|
|
||||||
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
|
|
||||||
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
|
|
||||||
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
|
|
||||||
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
|
|
||||||
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
|
|
||||||
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
|
|
||||||
|
|
||||||
|
@3254
|
||||||
|
Scenario: Driving up to and through a roundabout
|
||||||
|
Given the node map
|
||||||
|
| | g | | | | | | | a | | | | |
|
||||||
|
| | | | | | | | | | | | | |
|
||||||
|
| e | f | | | | | b | | | | d | | h |
|
||||||
|
| | | | | | | | | | | | | |
|
||||||
|
| | i | | | | | | | c | | | | |
|
||||||
|
| | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | k | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction | name | highway |
|
||||||
|
| abcda | roundabout | roundabout | residential |
|
||||||
|
| gfi | | side | residential |
|
||||||
|
| efb | | left | residential |
|
||||||
|
| dh | | right | residential |
|
||||||
|
| ck | | bottom | residential |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| e,h | left,right,right | depart,roundabout-exit-2,arrive |
|
||||||
|
|
||||||
|
@3254
|
||||||
|
Scenario: Driving up to and through a roundabout
|
||||||
|
Given the node map
|
||||||
|
| | g | | | | a | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| e | f | | b | | | | d | | h |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | i | | | | c | | | | |
|
||||||
|
| | | | | | | | | | |
|
||||||
|
| | | | | | k | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction | name | highway |
|
||||||
|
| abcda | roundabout | roundabout | residential |
|
||||||
|
| gfi | | side | residential |
|
||||||
|
| efb | | left | residential |
|
||||||
|
| dh | | right | residential |
|
||||||
|
| ck | | bottom | residential |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| e,h | left,right,right | depart,roundabout-exit-2,arrive |
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
@routing @guidance @staggered-intersections
|
||||||
|
Feature: Staggered Intersections
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 1 meters
|
||||||
|
# Note the one meter grid size: staggered intersections make zig-zags of a couple of meters only
|
||||||
|
|
||||||
|
# https://www.openstreetmap.org/#map=19/39.26022/-84.25144
|
||||||
|
Scenario: Staggered Intersection: Oak St, Cedar Dr
|
||||||
|
Given the node map
|
||||||
|
| | | j | | |
|
||||||
|
| a | b | c | | |
|
||||||
|
| | | d | | |
|
||||||
|
| | | e | f | g |
|
||||||
|
| | | h | | |
|
||||||
|
| | | i | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name |
|
||||||
|
| abc | residential | Oak St |
|
||||||
|
| efg | residential | Oak St |
|
||||||
|
| jcdehi | residential | Cedar Dr |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,g | Oak St,Oak St | depart,arrive |
|
||||||
|
| g,a | Oak St,Oak St | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: Staggered Intersection: do not collapse if long segment in between
|
||||||
|
Given the node map
|
||||||
|
| | | j | | |
|
||||||
|
| a | b | c | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | d | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | e | f | g |
|
||||||
|
| | | h | | |
|
||||||
|
| | | i | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name |
|
||||||
|
| abc | residential | Oak St |
|
||||||
|
| efg | residential | Oak St |
|
||||||
|
| jcdehi | residential | Cedar Dr |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||||
|
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||||
|
|
||||||
|
Scenario: Staggered Intersection: do not collapse if not left-right or right-left
|
||||||
|
Given the node map
|
||||||
|
| | | j | | |
|
||||||
|
| a | b | c | | |
|
||||||
|
| | | d | | |
|
||||||
|
| g | f | e | | |
|
||||||
|
| | | h | | |
|
||||||
|
| | | i | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name |
|
||||||
|
| abc | residential | Oak St |
|
||||||
|
| efg | residential | Oak St |
|
||||||
|
| jcdehi | residential | Cedar Dr |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,g | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
|
||||||
|
| g,a | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
|
||||||
|
|
||||||
|
Scenario: Staggered Intersection: do not collapse if the names are not the same
|
||||||
|
Given the node map
|
||||||
|
| | | j | | |
|
||||||
|
| a | b | c | | |
|
||||||
|
| | | d | | |
|
||||||
|
| | | e | f | g |
|
||||||
|
| | | h | | |
|
||||||
|
| | | i | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name |
|
||||||
|
| abc | residential | Oak St |
|
||||||
|
| efg | residential | Elm St |
|
||||||
|
| jcdehi | residential | Cedar Dr |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,g | Oak St,Cedar Dr,Elm St,Elm St | depart,turn right,turn left,arrive |
|
||||||
|
| g,a | Elm St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||||
@@ -3,7 +3,7 @@ Feature: Suppress New Names on dedicated Suffices
|
|||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 2000 meters
|
||||||
|
|
||||||
Scenario: Suffix To Suffix
|
Scenario: Suffix To Suffix
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -28,8 +28,8 @@ Feature: Suppress New Names on dedicated Suffices
|
|||||||
| bc | 42 S | 101 |
|
| bc | 42 S | 101 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns | ref |
|
||||||
| a,c | 42 N,42 S (101) | depart,arrive |
|
| a,c | 42 N,42 S | depart,arrive | ,101 |
|
||||||
|
|
||||||
Scenario: Prefix Change
|
Scenario: Prefix Change
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -44,6 +44,19 @@ Feature: Suppress New Names on dedicated Suffices
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,c | West 42,East 42 | depart,arrive |
|
| a,c | West 42,East 42 | depart,arrive |
|
||||||
|
|
||||||
|
Scenario: Prefix Change ref
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name |
|
||||||
|
| ab | West 42 |
|
||||||
|
| bc | 42 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,c | West 42,42 | depart,arrive |
|
||||||
|
|
||||||
Scenario: Prefix Change and Reference
|
Scenario: Prefix Change and Reference
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | | c |
|
| a | | b | | c |
|
||||||
@@ -54,8 +67,8 @@ Feature: Suppress New Names on dedicated Suffices
|
|||||||
| bc | East 42 | |
|
| bc | East 42 | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns | ref |
|
||||||
| a,c | West 42 (101),East 42 | depart,arrive |
|
| a,c | West 42,East 42 | depart,arrive | 101, |
|
||||||
|
|
||||||
Scenario: Suffix To Suffix - Turn
|
Scenario: Suffix To Suffix - Turn
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ Feature: Suppressed Turns
|
|||||||
| ef | motorway | highway | A1 |
|
| ef | motorway | highway | A1 |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns | ref |
|
||||||
| a,f | highway (A1),highway (A1) | depart,arrive |
|
| a,f | highway,highway | depart,arrive | A1,A1 |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Don't Announce Turn on following major road class -- service
|
Scenario: Don't Announce Turn on following major road class -- service
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Feature: Turn Lane Guidance
|
|||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
Given a grid size of 20 meters
|
Given a grid size of 20 meters
|
||||||
|
|
||||||
@bug
|
@simple
|
||||||
Scenario: Basic Turn Lane 3-way Turn with empty lanes
|
Scenario: Basic Turn Lane 3-way Turn with empty lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | | c |
|
| a | | b | | c |
|
||||||
@@ -24,6 +24,23 @@ Feature: Turn Lane Guidance
|
|||||||
| c,a | straight,in,in | depart,new name straight,arrive | ,left:false straight:true none:true none:true, |
|
| c,a | straight,in,in | depart,new name straight,arrive | ,left:false straight:true none:true none:true, |
|
||||||
| c,d | straight,right,right | depart,turn left,arrive | ,left:true straight:false none:false none:false, |
|
| c,d | straight,right,right | depart,turn left,arrive | ,left:true straight:false none:false none:false, |
|
||||||
|
|
||||||
|
Scenario: Basic Turn Lane 3-way Turn with designated lane
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
| | | d | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | turn:lanes | turn:lanes:forward | name | vehicle:lanes:forward |
|
||||||
|
| ab | | through\|through\|right | in | yes\|no\|yes |
|
||||||
|
| bc | | | straight | |
|
||||||
|
| bd | | | right | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,c | in,straight,straight | depart,new name straight,arrive | ,straight:true right:false, |
|
||||||
|
| a,d | in,right,right | depart,turn right,arrive | ,straight:false right:true, |
|
||||||
|
|
||||||
|
@simple
|
||||||
Scenario: Basic Turn Lane 4-Way Turn
|
Scenario: Basic Turn Lane 4-Way Turn
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | e | | |
|
| | | e | | |
|
||||||
@@ -46,6 +63,7 @@ Feature: Turn Lane Guidance
|
|||||||
| d,e | right,left,left | depart,new name straight,arrive | ,left:false none:true, |
|
| d,e | right,left,left | depart,new name straight,arrive | ,left:false none:true, |
|
||||||
| d,c | right,straight,straight | depart,turn right,arrive | ,left:false none:true, |
|
| d,c | right,straight,straight | depart,turn right,arrive | ,left:false none:true, |
|
||||||
|
|
||||||
|
@simple @none
|
||||||
Scenario: Basic Turn Lane 4-Way Turn using none
|
Scenario: Basic Turn Lane 4-Way Turn using none
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | e | | |
|
| | | e | | |
|
||||||
@@ -65,6 +83,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,d | in,right,right | depart,turn right,arrive | ,none:false right:true, |
|
| a,d | in,right,right | depart,turn right,arrive | ,none:false right:true, |
|
||||||
| a,e | in,left,left | depart,turn left,arrive | ,none:true right:false, |
|
| a,e | in,left,left | depart,turn left,arrive | ,none:true right:false, |
|
||||||
|
|
||||||
|
@simple @reverse
|
||||||
Scenario: Basic Turn Lane 4-Way With U-Turn Lane
|
Scenario: Basic Turn Lane 4-Way With U-Turn Lane
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | e | | |
|
| | | e | | |
|
||||||
@@ -87,6 +106,7 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
|
|
||||||
#this next test requires decision on how to announce lanes for going straight if there is no turn
|
#this next test requires decision on how to announce lanes for going straight if there is no turn
|
||||||
|
@simple @psv @none
|
||||||
Scenario: Turn with Bus-Lane
|
Scenario: Turn with Bus-Lane
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | | c |
|
| a | | b | | c |
|
||||||
@@ -104,7 +124,44 @@ Feature: Turn Lane Guidance
|
|||||||
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
||||||
| a,c | road,road | depart,arrive | , |
|
| a,c | road,road | depart,arrive | , |
|
||||||
|
|
||||||
@PROFILE @LANES
|
Scenario: Turn with Bus-Lane Left
|
||||||
|
Given the node map
|
||||||
|
| | | d | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| a | | b | | c | | f |
|
||||||
|
| | | | | e | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | turn:lanes:forward | lanes:psv:forward | oneway |
|
||||||
|
| ab | road | left\|through\| | 1 | yes |
|
||||||
|
| bc | road | | | yes |
|
||||||
|
| bd | turn | | | yes |
|
||||||
|
| cf | turn | | | yes |
|
||||||
|
| ce | side | | | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,d | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
|
||||||
|
| a,c | road,road | depart,arrive | , |
|
||||||
|
|
||||||
|
# This tests whether empty/invalid PSV tags cause osrm-extract to crash
|
||||||
|
Scenario: Turn with Bus-Lane
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
| | | | | |
|
||||||
|
| | | d | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | turn:lanes:forward | lanes:psv:forward | lanes:psv:backward |
|
||||||
|
| ab | road | through\|right\| | 1 | foo |
|
||||||
|
| bc | road | | | |
|
||||||
|
| bd | turn | | | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
||||||
|
|
||||||
|
@simple @psv
|
||||||
Scenario: Turn with Bus-Lane but without lanes
|
Scenario: Turn with Bus-Lane but without lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | | c |
|
| a | | b | | c |
|
||||||
@@ -123,7 +180,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,c | road,road | depart,arrive |
|
| a,c | road,road | depart,arrive |
|
||||||
|
|
||||||
#turn lanes are often drawn at the incoming road, even though the actual turn requires crossing the intersection first
|
#turn lanes are often drawn at the incoming road, even though the actual turn requires crossing the intersection first
|
||||||
@todo @bug
|
@todo @collapse @partition-lanes
|
||||||
Scenario: Turn Lanes at Segregated Road
|
Scenario: Turn Lanes at Segregated Road
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | i | l | | |
|
| | | i | l | | |
|
||||||
@@ -168,6 +225,7 @@ Feature: Turn Lane Guidance
|
|||||||
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
|
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
|
||||||
|
|
||||||
#copy of former case to prevent further regression
|
#copy of former case to prevent further regression
|
||||||
|
@collapse @partition-lanes
|
||||||
Scenario: Turn Lanes at Segregated Road
|
Scenario: Turn Lanes at Segregated Road
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | i | l | | |
|
| | | i | l | | |
|
||||||
@@ -201,6 +259,7 @@ Feature: Turn Lane Guidance
|
|||||||
| i,j | cross,cross | depart,arrive | , |
|
| i,j | cross,cross | depart,arrive | , |
|
||||||
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
|
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
|
||||||
|
|
||||||
|
@partition-lanes
|
||||||
Scenario: Turn Lanes at Segregated Road
|
Scenario: Turn Lanes at Segregated Road
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | g | f | | |
|
| | | g | f | | |
|
||||||
@@ -223,6 +282,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||||
|
|
||||||
#this can happen due to traffic lights / lanes not drawn up to the intersection itself
|
#this can happen due to traffic lights / lanes not drawn up to the intersection itself
|
||||||
|
@2654 @previous-lanes
|
||||||
Scenario: Turn Lanes Given earlier than actual turn
|
Scenario: Turn Lanes Given earlier than actual turn
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | c | | d |
|
| a | | b | c | | d |
|
||||||
@@ -241,6 +301,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,e | road,turn,turn | depart,turn right,arrive | ,none:false right:true, |
|
| a,e | road,turn,turn | depart,turn right,arrive | ,none:false right:true, |
|
||||||
| a,d | road,road | depart,arrive | , |
|
| a,d | road,road | depart,arrive | , |
|
||||||
|
|
||||||
|
@2654 @previous-lanes
|
||||||
Scenario: Turn Lanes Given earlier than actual turn
|
Scenario: Turn Lanes Given earlier than actual turn
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | c | d | | e | | f | g | h | | i |
|
| a | | b | c | d | | e | | f | g | h | | i |
|
||||||
@@ -263,6 +324,7 @@ Feature: Turn Lane Guidance
|
|||||||
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ,left:true none:false, |
|
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ,left:true none:false, |
|
||||||
| i,a | road,road | depart,arrive | , |
|
| i,a | road,road | depart,arrive | , |
|
||||||
|
|
||||||
|
@previous-lanes
|
||||||
Scenario: Passing a one-way street
|
Scenario: Passing a one-way street
|
||||||
Given the node map
|
Given the node map
|
||||||
| e | | | f | |
|
| e | | | f | |
|
||||||
@@ -279,6 +341,7 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
|
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
|
||||||
|
|
||||||
|
@partition-lanes
|
||||||
Scenario: Passing a one-way street, partly pulled back lanes
|
Scenario: Passing a one-way street, partly pulled back lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
| e | | | f | |
|
| e | | | f | |
|
||||||
@@ -296,8 +359,10 @@ Feature: Turn Lane Guidance
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight;right:false, |
|
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight;right:false, |
|
||||||
|
| a,d | road,road | depart,arrive | , |
|
||||||
| a,g | road,right,right | depart,turn right,arrive | ,left:false straight;right:true, |
|
| a,g | road,right,right | depart,turn right,arrive | ,left:false straight;right:true, |
|
||||||
|
|
||||||
|
@partition-lanes @previous-lanes
|
||||||
Scenario: Passing a one-way street, partly pulled back lanes, no through
|
Scenario: Passing a one-way street, partly pulled back lanes, no through
|
||||||
Given the node map
|
Given the node map
|
||||||
| e | | | f |
|
| e | | | f |
|
||||||
@@ -317,7 +382,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true right:false, |
|
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true right:false, |
|
||||||
| a,g | road,right,right | depart,turn right,arrive | ,left:false right:true, |
|
| a,g | road,right,right | depart,turn right,arrive | ,left:false right:true, |
|
||||||
|
|
||||||
@todo @bug
|
@todo @partition-lanes @previous-lanes
|
||||||
Scenario: Narrowing Turn Lanes
|
Scenario: Narrowing Turn Lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | | | g | |
|
| | | | | g | |
|
||||||
@@ -340,6 +405,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,e | road,through,through | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
| a,e | road,through,through | depart,new name straight,arrive | ,left:false straight:true right:false, |
|
||||||
| a,f | road,right,right | depart,turn right,arrive | ,left:false straight:false right:true, |
|
| a,f | road,right,right | depart,turn right,arrive | ,left:false straight:false right:true, |
|
||||||
|
|
||||||
|
@previous-lanes
|
||||||
Scenario: Turn at a traffic light
|
Scenario: Turn at a traffic light
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c | d |
|
| a | b | c | d |
|
||||||
@@ -361,7 +427,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,d | road,road | depart,arrive | , |
|
| a,d | road,road | depart,arrive | , |
|
||||||
| a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
| a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
|
||||||
|
|
||||||
@bug @todo
|
@todo @roundabout
|
||||||
Scenario: Theodor Heuss Platz
|
Scenario: Theodor Heuss Platz
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | | i | o | | | l | |
|
| | | | i | o | | | l | |
|
||||||
@@ -398,6 +464,7 @@ Feature: Turn Lane Guidance
|
|||||||
| i,l | top,top-right-out,top-right-out | depart,roundabout-exit-4,arrive | ,slight left:true slight left;slight right:true slight right:false slight right:false, |
|
| i,l | top,top-right-out,top-right-out | depart,roundabout-exit-4,arrive | ,slight left:true slight left;slight right:true slight right:false slight right:false, |
|
||||||
| i,o | top,top,top | depart,roundabout-exit-5,arrive | ,, |
|
| i,o | top,top,top | depart,roundabout-exit-5,arrive | ,, |
|
||||||
|
|
||||||
|
@sliproads
|
||||||
Scenario: Turn Lanes Breaking up
|
Scenario: Turn Lanes Breaking up
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | | g | |
|
| | | | g | |
|
||||||
@@ -409,29 +476,33 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | turn:lanes:forward | oneway | highway |
|
| nodes | name | turn:lanes:forward | oneway | highway |
|
||||||
| ab | road | left\|left\|through\|through | yes | primary |
|
| ab | road | left\|left\|through\|through\|right | yes | primary |
|
||||||
| bd | road | through\|through | yes | primary |
|
| bd | road | through\|through\|right | yes | primary |
|
||||||
| bc | road | left\|left | yes | primary |
|
| bc | road | left\|left | yes | primary |
|
||||||
| de | road | | yes | primary |
|
| de | road | | yes | primary |
|
||||||
| fdcg | cross | | | secondary |
|
| fd | cross | | | secondary |
|
||||||
|
| dc | cross | | | secondary |
|
||||||
|
| cg | cross | | | secondary |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | bd | fdcg | d | no_left_turn |
|
| restriction | bd | dc | d | no_left_turn |
|
||||||
| restriction | bc | fdcg | c | no_right_turn |
|
| restriction | bc | dc | c | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,g | road,cross,cross | depart,turn left,arrive | ,left:true left:true straight:false straight:false, |
|
| a,g | road,cross,cross | depart,turn left,arrive | ,left:true left:true straight:false straight:false right:false, |
|
||||||
| a,e | road,road | depart,arrive | , |
|
| a,e | road,road | depart,arrive | , |
|
||||||
|
|
||||||
|
#NEEDS TO BE INVESTIGATED. Turn restriction shouldn't be here. See #2867
|
||||||
|
@reverse @previous-lanes
|
||||||
Scenario: U-Turn Road at Intersection
|
Scenario: U-Turn Road at Intersection
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | | | | h | |
|
| | | | | | | h | |
|
||||||
| | | | | f | e | j |
|
| | | | | f | | e | j |
|
||||||
| a | b | | | | | |
|
| a | b | | | | | | |
|
||||||
| | | | | c | d | i |
|
| | | | | c | | d | i |
|
||||||
| | | | | | g | |
|
| | | | | | | g | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | turn:lanes:forward | oneway | highway |
|
| nodes | name | turn:lanes:forward | oneway | highway |
|
||||||
@@ -440,8 +511,16 @@ Feature: Turn Lane Guidance
|
|||||||
| bc | road | \|through\|right | yes | primary |
|
| bc | road | \|through\|right | yes | primary |
|
||||||
| cd | road | \|through\|right | yes | primary |
|
| cd | road | \|through\|right | yes | primary |
|
||||||
| fc | road | | no | tertiary |
|
| fc | road | | no | tertiary |
|
||||||
| jefb | road | | yes | primary |
|
| je | road | | yes | primary |
|
||||||
| gdeh | cross | | no | primary |
|
| ef | road | | yes | primary |
|
||||||
|
| fb | road | | yes | primary |
|
||||||
|
| eh | cross | | no | primary |
|
||||||
|
| de | cross | | no | primary |
|
||||||
|
| gd | cross | | no | primary |
|
||||||
|
|
||||||
|
And the relations
|
||||||
|
| type | way:from | way:to | node:via | restriction |
|
||||||
|
| restriction | de | ef | e | no_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | turns | lanes |
|
| from | to | bearings | route | turns | lanes |
|
||||||
@@ -450,6 +529,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a | i | 180,180 180,180 | road,road | depart,arrive | , |
|
| a | i | 180,180 180,180 | road,road | depart,arrive | , |
|
||||||
| b | a | 90,2 270,2 | road,road,road | depart,continue uturn,arrive | ,none:true straight:false right:false, |
|
| b | a | 90,2 270,2 | road,road,road | depart,continue uturn,arrive | ,none:true straight:false right:false, |
|
||||||
|
|
||||||
|
@reverse
|
||||||
Scenario: Segregated Intersection Merges With Lanes
|
Scenario: Segregated Intersection Merges With Lanes
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | | | | | f |
|
| | | | | | | f |
|
||||||
@@ -474,7 +554,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,e | road,road,road | depart,turn uturn,arrive | ,left:true left:false left:false straight:false straight:false, |
|
| a,e | road,road,road | depart,turn uturn,arrive | ,left:true left:false left:false straight:false straight:false, |
|
||||||
| a,g | road,straight,straight | depart,new name straight,arrive | ,left:false left:false left:false straight:true straight:true, |
|
| a,g | road,straight,straight | depart,new name straight,arrive | ,left:false left:false left:false straight:true straight:true, |
|
||||||
|
|
||||||
@bug @todo
|
@todo @roundabout
|
||||||
Scenario: Passing Through a Roundabout
|
Scenario: Passing Through a Roundabout
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | h | | g | | |
|
| | | h | | g | | |
|
||||||
@@ -501,6 +581,7 @@ Feature: Turn Lane Guidance
|
|||||||
| i,j | left,bottom,bottom | depart,round-exit-1,arrive | ,0, |
|
| i,j | left,bottom,bottom | depart,round-exit-1,arrive | ,0, |
|
||||||
| i,k | left,right,right | depart,round-exit-2,arrive | ,1, |
|
| i,k | left,right,right | depart,round-exit-2,arrive | ,1, |
|
||||||
|
|
||||||
|
@previous-lanes
|
||||||
Scenario: Crossing Traffic Light
|
Scenario: Crossing Traffic Light
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | | c | | d |
|
| a | | b | | c | | d |
|
||||||
@@ -521,6 +602,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,d | road,road | depart,arrive | , |
|
| a,d | road,road | depart,arrive | , |
|
||||||
| a,e | road,cross,cross | depart,turn slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
| a,e | road,cross,cross | depart,turn slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
||||||
|
|
||||||
|
@ramp
|
||||||
Scenario: Highway Ramp
|
Scenario: Highway Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | | c | | d |
|
| a | | b | | c | | d |
|
||||||
@@ -537,7 +619,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,d | hwy,hwy | depart,arrive | , |
|
| a,d | hwy,hwy | depart,arrive | , |
|
||||||
| a,e | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
| a,e | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
|
||||||
|
|
||||||
@bug @todo
|
@todo
|
||||||
Scenario: Turning Off Ramp
|
Scenario: Turning Off Ramp
|
||||||
Given the node map
|
Given the node map
|
||||||
| | a | |
|
| | a | |
|
||||||
@@ -559,6 +641,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,g | off,road,road | depart,turn_left,arrive | ,left:true right:false, |
|
| a,g | off,road,road | depart,turn_left,arrive | ,left:true right:false, |
|
||||||
| a,h | | | |
|
| a,h | | | |
|
||||||
|
|
||||||
|
@ramp
|
||||||
Scenario: Off Ramp In a Turn
|
Scenario: Off Ramp In a Turn
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | | | | | | | | | | |
|
| a | | | | | | | | | | | |
|
||||||
@@ -577,6 +660,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,c | hwy,hwy | depart,arrive | , |
|
| a,c | hwy,hwy | depart,arrive | , |
|
||||||
| a,d | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false slight right:true, |
|
| a,d | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false slight right:true, |
|
||||||
|
|
||||||
|
@reverse
|
||||||
Scenario: Reverse Lane in Segregated Road
|
Scenario: Reverse Lane in Segregated Road
|
||||||
Given the node map
|
Given the node map
|
||||||
| h | | | | | g | | | | | | f |
|
| h | | | | | g | | | | | | f |
|
||||||
@@ -595,6 +679,7 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false,|
|
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false,|
|
||||||
|
|
||||||
|
@reverse
|
||||||
Scenario: Reverse Lane in Segregated Road with none
|
Scenario: Reverse Lane in Segregated Road with none
|
||||||
Given the node map
|
Given the node map
|
||||||
| h | | | | | g | | | | | | f |
|
| h | | | | | g | | | | | | f |
|
||||||
@@ -613,6 +698,7 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
|
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
|
||||||
|
|
||||||
|
@reverse
|
||||||
Scenario: Reverse Lane in Segregated Road with none, Service Turn Prior
|
Scenario: Reverse Lane in Segregated Road with none, Service Turn Prior
|
||||||
Given the node map
|
Given the node map
|
||||||
| h | | | | | g | | | | | | f |
|
| h | | | | | g | | | | | | f |
|
||||||
@@ -633,6 +719,7 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
|
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
|
||||||
|
|
||||||
|
@simple
|
||||||
Scenario: Don't collapse everything to u-turn / too wide
|
Scenario: Don't collapse everything to u-turn / too wide
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | b | | e |
|
| a | | b | | e |
|
||||||
@@ -652,6 +739,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,d | depart,continue right,turn right,arrive | road,road,road,road | ,straight:false right:true,, |
|
| a,d | depart,continue right,turn right,arrive | road,road,road,road | ,straight:false right:true,, |
|
||||||
| d,a | depart,continue left,turn left,arrive | road,road,road,road | ,left:true straight:false,, |
|
| d,a | depart,continue left,turn left,arrive | road,road,road,road | ,left:true straight:false,, |
|
||||||
|
|
||||||
|
@simple
|
||||||
Scenario: Merge Lanes Onto Freeway
|
Scenario: Merge Lanes Onto Freeway
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | | | b | c |
|
| a | | | b | c |
|
||||||
@@ -666,6 +754,7 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | turns | route | lanes |
|
| waypoints | turns | route | lanes |
|
||||||
| d,c | depart,merge slight left,arrive | ramp,Hwy,Hwy | ,slight right:true slight right:true, |
|
| d,c | depart,merge slight left,arrive | ramp,Hwy,Hwy | ,slight right:true slight right:true, |
|
||||||
|
|
||||||
|
@2654 @simple
|
||||||
Scenario: Fork on motorway links - don't fork on through but use lane
|
Scenario: Fork on motorway links - don't fork on through but use lane
|
||||||
Given the node map
|
Given the node map
|
||||||
| i | | | | | a |
|
| i | | | | | a |
|
||||||
@@ -681,8 +770,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| a,j | on,xbcj,xbcj | depart,merge slight left,arrive | ,, |
|
| a,j | on,xbcj | depart,arrive | , |
|
||||||
| a,i | on,xbcj,off,off | depart,merge slight left,turn slight right,arrive | ,,none:false slight right:true, |
|
| a,i | on,off,off | depart,turn slight right,arrive | ,none:false slight right:true, |
|
||||||
|
|
||||||
#http://www.openstreetmap.org/#map=17/52.47414/13.35712
|
#http://www.openstreetmap.org/#map=17/52.47414/13.35712
|
||||||
@todo @ramp @2645
|
@todo @ramp @2645
|
||||||
@@ -724,8 +813,8 @@ Feature: Turn Lane Guidance
|
|||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | name | highway | turn:lanes:forward |
|
| nodes | name | highway | turn:lanes:forward |
|
||||||
| ab | road | primary | through,right |
|
| ab | road | primary | through;right |
|
||||||
| bc | road | primary | through,right |
|
| bc | road | primary | through;right |
|
||||||
| cd | road | primary | |
|
| cd | road | primary | |
|
||||||
| xa | road | primary | |
|
| xa | road | primary | |
|
||||||
| be | turn | primary | |
|
| be | turn | primary | |
|
||||||
@@ -735,6 +824,27 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| x,d | road,road | depart,arrive | , |
|
| x,d | road,road | depart,arrive | , |
|
||||||
|
|
||||||
|
@partition-lanes
|
||||||
|
Scenario: Partitioned turn, Slight Curve
|
||||||
|
Given the node map
|
||||||
|
| | | f | | e |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | c |
|
||||||
|
| a | | b | | |
|
||||||
|
| | | g | | d |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | turn:lanes:forward |
|
||||||
|
| ab | road | primary | yes | left\|right |
|
||||||
|
| bc | cross | primary | yes | |
|
||||||
|
| fbg | cross | primary | yes | |
|
||||||
|
| dce | cross | primary | yes | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, |
|
||||||
|
| a,e | road,cross,cross | depart,turn left,arrive | ,left:true right:false, |
|
||||||
|
|
||||||
Scenario: Lane Parsing Issue #2694
|
Scenario: Lane Parsing Issue #2694
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -753,7 +863,7 @@ Feature: Turn Lane Guidance
|
|||||||
| a,c | ab,bc,bc | depart,turn left,arrive | ,left:true right:false, |
|
| a,c | ab,bc,bc | depart,turn left,arrive | ,left:true right:false, |
|
||||||
|
|
||||||
# http://www.openstreetmap.org/#map=19/47.97685/7.82933&layers=D
|
# http://www.openstreetmap.org/#map=19/47.97685/7.82933&layers=D
|
||||||
@bug @todo
|
@todo
|
||||||
Scenario: Lane Parsing Issue #2706: None Assignments I
|
Scenario: Lane Parsing Issue #2706: None Assignments I
|
||||||
Given the node map
|
Given the node map
|
||||||
| | f | | | j | |
|
| | f | | | j | |
|
||||||
@@ -793,7 +903,7 @@ Feature: Turn Lane Guidance
|
|||||||
# Note: at the moment we don't care about routes, we care about the extract process triggering assertions
|
# Note: at the moment we don't care about routes, we care about the extract process triggering assertions
|
||||||
|
|
||||||
# https://www.openstreetmap.org/#map=19/47.99257/7.83276&layers=D
|
# https://www.openstreetmap.org/#map=19/47.99257/7.83276&layers=D
|
||||||
@bug @todo
|
@todo
|
||||||
Scenario: Lane Parsing Issue #2706: None Assignments II
|
Scenario: Lane Parsing Issue #2706: None Assignments II
|
||||||
Given the node map
|
Given the node map
|
||||||
| | k | l | |
|
| | k | l | |
|
||||||
@@ -828,7 +938,7 @@ Feature: Turn Lane Guidance
|
|||||||
| i,e ||||
|
| i,e ||||
|
||||||
# Note: at the moment we don't care about routes, we care about the extract process triggering assertions
|
# Note: at the moment we don't care about routes, we care about the extract process triggering assertions
|
||||||
|
|
||||||
@bug @todo
|
@todo
|
||||||
Scenario: Lane Parsing Issue #2706: None Assignments III - Minimal reproduction recipe
|
Scenario: Lane Parsing Issue #2706: None Assignments III - Minimal reproduction recipe
|
||||||
Given the node map
|
Given the node map
|
||||||
| | | l | |
|
| | | l | |
|
||||||
@@ -846,3 +956,52 @@ Feature: Turn Lane Guidance
|
|||||||
| waypoints | route | turns | lanes |
|
| waypoints | route | turns | lanes |
|
||||||
| d,a ||||
|
| d,a ||||
|
||||||
# Note: at the moment we don't care about routes, we care about the extract process triggering assertions
|
# Note: at the moment we don't care about routes, we care about the extract process triggering assertions
|
||||||
|
|
||||||
|
@reverse @2730 @todo
|
||||||
|
Scenario: Reverse on the right
|
||||||
|
Given the node map
|
||||||
|
| a | | | c | |
|
||||||
|
| | | | b | d |
|
||||||
|
| f | | | e | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | turn:lanes:forward | oneway |
|
||||||
|
| ab | primary | in | left\|through\|right;reverse | yes |
|
||||||
|
| bc | primary | left | | no |
|
||||||
|
| bd | primary | through | | no |
|
||||||
|
| be | primary | right | | no |
|
||||||
|
| bf | primary | in | | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,c | in,left,left | depart,turn left,arrive | ,left:true straight:false right;uturn:false, |
|
||||||
|
| a,d | in,through,through | depart,new name straight,arrive | ,left:false straight:true right;uturn:false, |
|
||||||
|
| a,e | in,right,right | depart,turn right,arrive | ,left:false straight:false right;uturn:true, |
|
||||||
|
|
||||||
|
@todo @2654
|
||||||
|
#https://github.com/Project-OSRM/osrm-backend/issues/2645
|
||||||
|
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
|
||||||
|
Scenario: Kurt-Schuhmacher-Damm
|
||||||
|
Given the node map
|
||||||
|
| | | | g | | f |
|
||||||
|
| | | | | | |
|
||||||
|
| j | | | h | | e |
|
||||||
|
| | | | | | |
|
||||||
|
| a | | | b | | c |
|
||||||
|
| | | | i | | d |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway | turn:lanes |
|
||||||
|
| ab | | motorway_link | yes | left\|none\|right |
|
||||||
|
| bc | | primary_link | yes | |
|
||||||
|
| cd | ksd | secondary | yes | |
|
||||||
|
| cef | ksd | primary | yes | |
|
||||||
|
| hj | | motorway_link | yes | |
|
||||||
|
| eh | | secondary_link | yes | |
|
||||||
|
| gh | ksd | primary | yes | |
|
||||||
|
| hbi | ksd | secondary | yes | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | lanes |
|
||||||
|
| a,f | ,ksd,ksd | depart,turn left,arrive | ,left:true none:true right:false, |
|
||||||
|
| a,i | ,ksd,ksd | depart,turn right,arrive | ,left:false none:true right:true, |
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
@routing @guidance
|
||||||
|
Feature: Turn Location Feature
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the profile "car"
|
||||||
|
Given a grid size of 10 meters
|
||||||
|
|
||||||
|
Scenario: Simple feature to test turn locations
|
||||||
|
Given the node map
|
||||||
|
| | c | |
|
||||||
|
| a | b | d |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway |
|
||||||
|
| ab | primary |
|
||||||
|
| cb | primary |
|
||||||
|
| db | primary |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | locations |
|
||||||
|
| a,c | ab,cb,cb | depart,turn left,arrive | a,b,c |
|
||||||
+198
-13
@@ -246,22 +246,28 @@ Feature: Simple Turns
|
|||||||
|
|
||||||
Scenario: Four Way Intersection Double Through Street Segregated
|
Scenario: Four Way Intersection Double Through Street Segregated
|
||||||
Given the node map
|
Given the node map
|
||||||
| | b | | c | |
|
| | | | | q | | p | | | | |
|
||||||
| i | | | | d |
|
| | | | | | | | | | | |
|
||||||
| | | a | | |
|
| | | | | | | | | | | |
|
||||||
| h | | | | e |
|
| | | | | | | | | | | |
|
||||||
| | g | | f | |
|
| | | | | | | | | | | |
|
||||||
|
| | | | | b | | c | | | | |
|
||||||
|
| j | | | i | | | | d | | | o |
|
||||||
|
| | | | | | a | | | | | |
|
||||||
|
| k | | | h | | | | e | | | n |
|
||||||
|
| | | | | g | | f | | | | |
|
||||||
|
| | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | |
|
||||||
|
| | | | | l | | m | | | | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | highway | oneway | name |
|
| nodes | highway | oneway | name |
|
||||||
| ha | primary | yes | first |
|
| khaij | primary | yes | first |
|
||||||
| ai | primary | yes | first |
|
| odaen | primary | yes | first |
|
||||||
| ae | primary | yes | first |
|
| qbacp | primary | yes | second |
|
||||||
| da | primary | yes | first |
|
| mfagl | primary | yes | second |
|
||||||
| ba | primary | yes | second |
|
|
||||||
| ac | primary | yes | second |
|
|
||||||
| fa | primary | yes | second |
|
|
||||||
| ag | primary | yes | second |
|
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
@@ -879,3 +885,182 @@ Feature: Simple Turns
|
|||||||
| waypoints | turns | route |
|
| waypoints | turns | route |
|
||||||
| a,d | depart,arrive | Channing Street Northeast,Channing Street Northwest |
|
| a,d | depart,arrive | Channing Street Northeast,Channing Street Northwest |
|
||||||
| a,h | depart,turn left,arrive | Channing Street Northeast,North Capitol Street Northeast,North Capitol Street Northeast |
|
| a,h | depart,turn left,arrive | Channing Street Northeast,North Capitol Street Northeast,North Capitol Street Northeast |
|
||||||
|
|
||||||
|
Scenario: V St NW, Florida Ave NW: Turn Instruction
|
||||||
|
# https://www.mapillary.com/app/?focus=map&lat=38.91815595&lng=-77.03880249&z=17&pKey=sCxepTOCTZD3OoBXuqGEOw
|
||||||
|
# http://www.openstreetmap.org/way/6062557#map=19/38.91805/-77.03892
|
||||||
|
Given the node map
|
||||||
|
| y | | | x | | |
|
||||||
|
| | | c | | | |
|
||||||
|
| | d | | | b | a |
|
||||||
|
| | | | | | |
|
||||||
|
| e | | | | | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| abc | V St NW | tertiary | yes |
|
||||||
|
| xcde | Florida Ave NW | tertiary | yes |
|
||||||
|
| yd | Champlain St NW | residential | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,e | depart,turn left,arrive | V St NW,Florida Ave NW,Florida Ave NW |
|
||||||
|
|
||||||
|
# http://www.openstreetmap.org/node/182805179
|
||||||
|
Scenario: Make Sharp Left at Traffic Signal
|
||||||
|
Given the node map
|
||||||
|
| | | | g | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | f | | | y |
|
||||||
|
| i | | | | | | |
|
||||||
|
| j | k | a | | b | | x |
|
||||||
|
| | | | e | | c | |
|
||||||
|
| | | | | d | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| | | | h | | | |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| f | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| yf | yf | trunk_link | yes |
|
||||||
|
| gfeh | Centreville Road | primary | |
|
||||||
|
| fi | fi | trunk_link | yes |
|
||||||
|
| ij | Bloomingdale Road | residential | |
|
||||||
|
| jkabx | Blue Star Memorial Hwy | trunk | |
|
||||||
|
| bcde | bcde | trunk_link | yes |
|
||||||
|
| kh | kh | trunk_link | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,h | depart,off ramp right,turn sharp left,arrive | Blue Star Memorial Hwy,bcde,Centreville Road,Centreville Road |
|
||||||
|
|
||||||
|
@todo
|
||||||
|
# https://www.openstreetmap.org/#map=20/52.51609/13.41080
|
||||||
|
Scenario: Unnecessary Slight Left onto Stralauer Strasse
|
||||||
|
Given the node map
|
||||||
|
| | e | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| a | | b | | c | | d |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| ab | Molkenmarkt | secondary | yes |
|
||||||
|
| bc | Stralauer Str | secondary | yes |
|
||||||
|
| cd | Stralauer Str | secondary | yes |
|
||||||
|
| ec | Molkenmarkt | secondary | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| a,d | depart,arrive | Molkenmarkt,Stralauer Str |
|
||||||
|
| e,d | depart,arrive | Molkenmarkt,Stralauer Str |
|
||||||
|
|
||||||
|
Scenario: Unnecessary Slight Left onto Stralauer Strasse
|
||||||
|
Given the node map
|
||||||
|
| | e | | | | | |
|
||||||
|
| | | | | | | |
|
||||||
|
| a | | b | | c | | d |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway | oneway |
|
||||||
|
| ab | Molkenmarkt | secondary | yes |
|
||||||
|
| bc | Molkenmarkt | secondary | yes |
|
||||||
|
| cd | Stralauer Str | secondary | yes |
|
||||||
|
| ec | Molkenmarkt | secondary | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | turns | route |
|
||||||
|
| 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 |
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const crypto = require('crypto');
|
||||||
|
const d3 = require('d3-queue');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
hashOfFiles: (paths, cb) => {
|
||||||
|
let queue = d3.queue();
|
||||||
|
for (let i = 0; i < paths.length; ++i) {
|
||||||
|
queue.defer(fs.readFile, paths[i]);
|
||||||
|
}
|
||||||
|
queue.awaitAll((err, results) => {
|
||||||
|
if (err) return cb(err);
|
||||||
|
let checksum = crypto.createHash('md5');
|
||||||
|
for (let i = 0; i < results.length; ++i) {
|
||||||
|
checksum.update(results[i]);
|
||||||
|
}
|
||||||
|
cb(null, checksum.digest('hex'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
hashOfFile: (path, cb) => {
|
||||||
|
fs.readFile(path, (err, result) => {
|
||||||
|
if (err) return cb(err);
|
||||||
|
let checksum = crypto.createHash('md5');
|
||||||
|
checksum.update(result);
|
||||||
|
cb(null, checksum.digest('hex'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var builder = require('xmlbuilder');
|
const builder = require('xmlbuilder');
|
||||||
|
const ensureDecimal = require('./utils').ensureDecimal;
|
||||||
var ensureDecimal = (i) => {
|
|
||||||
if (parseInt(i) === i) return i.toFixed(1);
|
|
||||||
else return i;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DB {
|
class DB {
|
||||||
constructor () {
|
constructor () {
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const util = require('util');
|
||||||
|
const Timeout = require('node-timeout');
|
||||||
|
const tryConnect = require('../lib/try_connect');
|
||||||
|
const errorReason = require('./utils').errorReason;
|
||||||
|
|
||||||
|
class OSRMBaseLoader{
|
||||||
|
constructor (scope) {
|
||||||
|
this.scope = scope;
|
||||||
|
this.child = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
launch (callback) {
|
||||||
|
var limit = Timeout(this.scope.TIMEOUT, { err: new Error('*** Launching osrm-routed timed out.') });
|
||||||
|
|
||||||
|
var runLaunch = (cb) => {
|
||||||
|
this.osrmUp(() => { this.waitForConnection(cb); });
|
||||||
|
};
|
||||||
|
|
||||||
|
runLaunch(limit((e) => { if (e) callback(e); else callback(); }));
|
||||||
|
}
|
||||||
|
|
||||||
|
shutdown (callback) {
|
||||||
|
if (!this.osrmIsRunning()) return callback();
|
||||||
|
|
||||||
|
var limit = Timeout(this.scope.TIMEOUT, { err: new Error('*** Shutting down osrm-routed timed out.')});
|
||||||
|
|
||||||
|
this.osrmDown(limit(callback));
|
||||||
|
}
|
||||||
|
|
||||||
|
osrmIsRunning () {
|
||||||
|
return this.child && !this.child.killed;
|
||||||
|
}
|
||||||
|
|
||||||
|
osrmDown (callback) {
|
||||||
|
if (this.osrmIsRunning()) {
|
||||||
|
this.child.on('exit', (code, signal) => {callback();});
|
||||||
|
this.child.kill();
|
||||||
|
} else callback();
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForConnection (callback) {
|
||||||
|
var retryCount = 0;
|
||||||
|
let retry = (err) => {
|
||||||
|
if (err) {
|
||||||
|
if (retryCount < 10) {
|
||||||
|
retryCount++;
|
||||||
|
setTimeout(() => { tryConnect(this.scope.OSRM_PORT, retry); }, 10);
|
||||||
|
} else {
|
||||||
|
callback(new Error("Could not connect to osrm-routed after ten retries."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
tryConnect(this.scope.OSRM_PORT, retry);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class OSRMDirectLoader extends OSRMBaseLoader {
|
||||||
|
constructor (scope) {
|
||||||
|
super(scope);
|
||||||
|
}
|
||||||
|
|
||||||
|
load (inputFile, callback) {
|
||||||
|
this.inputFile = inputFile;
|
||||||
|
this.shutdown(() => {
|
||||||
|
this.launch(callback);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
osrmUp (callback) {
|
||||||
|
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) {
|
||||||
|
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class OSRMDatastoreLoader extends OSRMBaseLoader {
|
||||||
|
constructor (scope) {
|
||||||
|
super(scope);
|
||||||
|
}
|
||||||
|
|
||||||
|
load (inputFile, callback) {
|
||||||
|
this.inputFile = inputFile;
|
||||||
|
|
||||||
|
this.loadData((err) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
if (!this.osrmIsRunning()) this.launch(callback);
|
||||||
|
else {
|
||||||
|
this.scope.setupOutputLog(this.child, fs.createWriteStream(this.scope.scenarioLogFile, {'flags': 'a'}));
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
loadData (callback) {
|
||||||
|
this.scope.runBin('osrm-datastore', this.inputFile, this.scope.environment, (err) => {
|
||||||
|
if (err) return callback(new Error('*** osrm-datastore exited with ' + err.code + ': ' + err));
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
osrmUp (callback) {
|
||||||
|
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) {
|
||||||
|
throw new Error(util.format('osrm-routed %s: %s', errorReason(err), err.cmd));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// we call the callback here, becuase we don't want to wait for the child process to finish
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class OSRMLoader {
|
||||||
|
constructor (scope) {
|
||||||
|
this.scope = scope;
|
||||||
|
this.sharedLoader = new OSRMDatastoreLoader(this.scope);
|
||||||
|
this.directLoader = new OSRMDirectLoader(this.scope);
|
||||||
|
this.method = scope.DEFAULT_LOAD_METHOD;
|
||||||
|
}
|
||||||
|
|
||||||
|
load (inputFile, callback) {
|
||||||
|
if (this.method === 'datastore') {
|
||||||
|
this.directLoader.shutdown((err) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
this.loader = this.sharedLoader;
|
||||||
|
this.sharedLoader.load(inputFile, callback);
|
||||||
|
});
|
||||||
|
} else if (this.method === 'directly') {
|
||||||
|
this.sharedLoader.shutdown((err) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
this.loader = this.directLoader;
|
||||||
|
this.directLoader.load(inputFile, callback);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
callback(new Error('*** Unknown load method ' + method));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setLoadMethod (method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
shutdown (callback) {
|
||||||
|
if (!this.loader) return callback();
|
||||||
|
|
||||||
|
this.loader.shutdown(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
up () {
|
||||||
|
return this.loader ? this.loader.osrmIsRunning() : false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = OSRMLoader;
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var util = require('util');
|
||||||
|
var path = require('path');
|
||||||
|
var fs = require('fs');
|
||||||
|
var chalk = require('chalk');
|
||||||
|
|
||||||
|
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
|
||||||
|
|
||||||
|
module.exports = function (expected, actual) {
|
||||||
|
let headers = expected.raw()[0];
|
||||||
|
let expected_keys = expected.hashes();
|
||||||
|
let diff = [];
|
||||||
|
let hasErrors = false;
|
||||||
|
|
||||||
|
var good = 0, bad = 0;
|
||||||
|
|
||||||
|
expected_keys.forEach((row, i) => {
|
||||||
|
var rowError = false;
|
||||||
|
|
||||||
|
for (var j in row) {
|
||||||
|
if (unescapeStr(row[j]) != actual[i][j]) {
|
||||||
|
rowError = true;
|
||||||
|
hasErrors = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rowError) {
|
||||||
|
bad++;
|
||||||
|
diff.push(Object.assign({}, row, {c_status: 'undefined'}));
|
||||||
|
diff.push(Object.assign({}, actual[i], {c_status: 'comment'}));
|
||||||
|
} else {
|
||||||
|
good++;
|
||||||
|
diff.push(row);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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';
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const net = require('net');
|
||||||
|
const Timeout = require('node-timeout');
|
||||||
|
|
||||||
|
module.exports = function tryConnect(port, callback) {
|
||||||
|
net.connect({ port: port, host: '127.0.0.1' })
|
||||||
|
.on('connect', () => { callback(); })
|
||||||
|
.on('error', () => {
|
||||||
|
callback(new Error('Could not connect.'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const util = require('util');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
|
||||||
|
ensureDecimal: (i) => {
|
||||||
|
if (parseInt(i) === i) return i.toFixed(1);
|
||||||
|
else return i;
|
||||||
|
},
|
||||||
|
|
||||||
|
errorReason: (err) => {
|
||||||
|
return err.signal ?
|
||||||
|
util.format('killed by signal %s', err.signal) :
|
||||||
|
util.format('exited with code %d', err.code);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
@prepare @options @files
|
@prepare @options @files
|
||||||
Feature: osrm-contract command line options: datasources
|
Feature: osrm-contract command line options: datasources
|
||||||
# expansions:
|
# expansions:
|
||||||
# {extracted_base} => path to current extracted input file
|
# {processed_file} => path to .osrm file
|
||||||
# {profile} => path to current profile script
|
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
@@ -24,7 +23,6 @@ Feature: osrm-contract command line options: datasources
|
|||||||
And the data has been extracted
|
And the data has been extracted
|
||||||
|
|
||||||
Scenario: osrm-contract - Passing base file
|
Scenario: osrm-contract - Passing base file
|
||||||
When I run "osrm-contract --segment-speed-file speeds.csv {extracted_base}.osrm"
|
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||||
Then stderr should be empty
|
Then datasource names should contain "lua profile,25_osrmcontract_passing_base_file_speeds"
|
||||||
And datasource names should contain "lua profile,speeds"
|
And it should exit successfully
|
||||||
And it should exit with code 0
|
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
@prepare @options @files
|
@prepare @options @files
|
||||||
Feature: osrm-contract command line options: files
|
Feature: osrm-contract command line options: files
|
||||||
# expansions:
|
|
||||||
# {extracted_base} => path to current extracted input file
|
|
||||||
# {profile} => path to current profile script
|
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
And the node map
|
And the node map
|
||||||
@@ -14,12 +10,11 @@ Feature: osrm-contract command line options: files
|
|||||||
And the data has been extracted
|
And the data has been extracted
|
||||||
|
|
||||||
Scenario: osrm-contract - Passing base file
|
Scenario: osrm-contract - Passing base file
|
||||||
When I run "osrm-contract {extracted_base}.osrm"
|
When I run "osrm-contract {processed_file}"
|
||||||
Then stderr should be empty
|
Then it should exit successfully
|
||||||
And it should exit with code 0
|
|
||||||
|
|
||||||
Scenario: osrm-contract - Missing input file
|
Scenario: osrm-contract - Missing input file
|
||||||
When I run "osrm-contract over-the-rainbow.osrm"
|
When I try to run "osrm-contract over-the-rainbow.osrm"
|
||||||
And stderr should contain "over-the-rainbow.osrm"
|
And stderr should contain "over-the-rainbow.osrm"
|
||||||
And stderr should contain "not found"
|
And stderr should contain "not found"
|
||||||
And it should exit with code 1
|
And it should exit with an error
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Feature: osrm-contract command line options: help
|
Feature: osrm-contract command line options: help
|
||||||
|
|
||||||
Scenario: osrm-contract - Help should be shown when no options are passed
|
Scenario: osrm-contract - Help should be shown when no options are passed
|
||||||
When I run "osrm-contract"
|
When I try to run "osrm-contract"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||||
And stdout should contain "Options:"
|
And stdout should contain "Options:"
|
||||||
@@ -13,7 +13,7 @@ Feature: osrm-contract command line options: help
|
|||||||
And stdout should contain "--core"
|
And stdout should contain "--core"
|
||||||
And stdout should contain "--level-cache"
|
And stdout should contain "--level-cache"
|
||||||
And stdout should contain "--segment-speed-file"
|
And stdout should contain "--segment-speed-file"
|
||||||
And it should exit with code 1
|
And it should exit with an error
|
||||||
|
|
||||||
Scenario: osrm-contract - Help, short
|
Scenario: osrm-contract - Help, short
|
||||||
When I run "osrm-contract -h"
|
When I run "osrm-contract -h"
|
||||||
@@ -27,7 +27,7 @@ Feature: osrm-contract command line options: help
|
|||||||
And stdout should contain "--core"
|
And stdout should contain "--core"
|
||||||
And stdout should contain "--level-cache"
|
And stdout should contain "--level-cache"
|
||||||
And stdout should contain "--segment-speed-file"
|
And stdout should contain "--segment-speed-file"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-contract - Help, long
|
Scenario: osrm-contract - Help, long
|
||||||
When I run "osrm-contract --help"
|
When I run "osrm-contract --help"
|
||||||
@@ -41,4 +41,4 @@ Feature: osrm-contract command line options: help
|
|||||||
And stdout should contain "--core"
|
And stdout should contain "--core"
|
||||||
And stdout should contain "--level-cache"
|
And stdout should contain "--level-cache"
|
||||||
And stdout should contain "--segment-speed-file"
|
And stdout should contain "--segment-speed-file"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ Feature: osrm-contract command line options: invalid options
|
|||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
|
|
||||||
Scenario: osrm-contract - Non-existing option
|
Scenario: osrm-contract - Non-existing option
|
||||||
When I run "osrm-contract --fly-me-to-the-moon"
|
When I try to run "osrm-contract --fly-me-to-the-moon"
|
||||||
Then stdout should be empty
|
Then stdout should be empty
|
||||||
And stderr should contain "option"
|
And stderr should contain "option"
|
||||||
And stderr should contain "fly-me-to-the-moon"
|
And stderr should contain "fly-me-to-the-moon"
|
||||||
And it should exit with code 1
|
And it should exit with an error
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ Feature: osrm-contract command line options: version
|
|||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain 1 line
|
And stdout should contain 1 line
|
||||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-contract - Version, long
|
Scenario: osrm-contract - Version, long
|
||||||
When I run "osrm-contract --version"
|
When I run "osrm-contract --version"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain 1 line
|
And stdout should contain 1 line
|
||||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|||||||
@@ -14,17 +14,15 @@ Feature: osrm-extract command line options: files
|
|||||||
And the data has been saved to disk
|
And the data has been saved to disk
|
||||||
|
|
||||||
Scenario: osrm-extract - Passing base file
|
Scenario: osrm-extract - Passing base file
|
||||||
When I run "osrm-extract {osm_base}.osm --profile {profile}"
|
When I run "osrm-extract {osm_file} --profile {profile_file}"
|
||||||
Then stderr should be empty
|
Then it should exit successfully
|
||||||
And it should exit with code 0
|
|
||||||
|
|
||||||
Scenario: osrm-extract - Order of options should not matter
|
Scenario: osrm-extract - Order of options should not matter
|
||||||
When I run "osrm-extract --profile {profile} {osm_base}.osm"
|
When I run "osrm-extract --profile {profile_file} {osm_file}"
|
||||||
Then stderr should be empty
|
Then it should exit successfully
|
||||||
And it should exit with code 0
|
|
||||||
|
|
||||||
Scenario: osrm-extract - Missing input file
|
Scenario: osrm-extract - Missing input file
|
||||||
When I run "osrm-extract over-the-rainbow.osrm --profile {profile}"
|
When I try to run "osrm-extract over-the-rainbow.osrm --profile {profile_file}"
|
||||||
And stderr should contain "over-the-rainbow.osrm"
|
And stderr should contain "over-the-rainbow.osrm"
|
||||||
And stderr should contain "not found"
|
And stderr should contain "not found"
|
||||||
And it should exit with code 1
|
And it should exit with an error
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Feature: osrm-extract command line options: help
|
|||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
And stdout should contain "--generate-edge-lookup"
|
And stdout should contain "--generate-edge-lookup"
|
||||||
And stdout should contain "--small-component-size"
|
And stdout should contain "--small-component-size"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-extract - Help, short
|
Scenario: osrm-extract - Help, short
|
||||||
When I run "osrm-extract -h"
|
When I run "osrm-extract -h"
|
||||||
@@ -30,7 +30,7 @@ Feature: osrm-extract command line options: help
|
|||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
And stdout should contain "--generate-edge-lookup"
|
And stdout should contain "--generate-edge-lookup"
|
||||||
And stdout should contain "--small-component-size"
|
And stdout should contain "--small-component-size"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-extract - Help, long
|
Scenario: osrm-extract - Help, long
|
||||||
When I run "osrm-extract --help"
|
When I run "osrm-extract --help"
|
||||||
@@ -44,4 +44,4 @@ Feature: osrm-extract command line options: help
|
|||||||
And stdout should contain "--threads"
|
And stdout should contain "--threads"
|
||||||
And stdout should contain "--generate-edge-lookup"
|
And stdout should contain "--generate-edge-lookup"
|
||||||
And stdout should contain "--small-component-size"
|
And stdout should contain "--small-component-size"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ Feature: osrm-extract command line options: invalid options
|
|||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
|
|
||||||
Scenario: osrm-extract - Non-existing option
|
Scenario: osrm-extract - Non-existing option
|
||||||
When I run "osrm-extract --fly-me-to-the-moon"
|
When I try to run "osrm-extract --fly-me-to-the-moon"
|
||||||
Then stdout should be empty
|
Then stdout should be empty
|
||||||
And stderr should contain "option"
|
And stderr should contain "option"
|
||||||
And stderr should contain "fly-me-to-the-moon"
|
And stderr should contain "fly-me-to-the-moon"
|
||||||
And it should exit with code 1
|
And it should exit with an error
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ Feature: osrm-extract command line options: version
|
|||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain 1 line
|
And stdout should contain 1 line
|
||||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-extract - Version, long
|
Scenario: osrm-extract - Version, long
|
||||||
When I run "osrm-extract --version"
|
When I run "osrm-extract --version"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain 1 line
|
And stdout should contain 1 line
|
||||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ Feature: osrm-routed command line options: files
|
|||||||
And stdout should contain /^\[info\] loaded plugin: viaroute/
|
And stdout should contain /^\[info\] loaded plugin: viaroute/
|
||||||
And stdout should contain /^\[info\] trial run/
|
And stdout should contain /^\[info\] trial run/
|
||||||
And stdout should contain /^\[info\] shutdown completed/
|
And stdout should contain /^\[info\] shutdown completed/
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Feature: osrm-routed command line options: help
|
|||||||
And stdout should contain "--max-trip-size"
|
And stdout should contain "--max-trip-size"
|
||||||
And stdout should contain "--max-table-size"
|
And stdout should contain "--max-table-size"
|
||||||
And stdout should contain "--max-matching-size"
|
And stdout should contain "--max-matching-size"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-routed - Help, short
|
Scenario: osrm-routed - Help, short
|
||||||
When I run "osrm-routed -h"
|
When I run "osrm-routed -h"
|
||||||
@@ -40,7 +40,7 @@ Feature: osrm-routed command line options: help
|
|||||||
And stdout should contain "--max-trip-size"
|
And stdout should contain "--max-trip-size"
|
||||||
And stdout should contain "--max-table-size"
|
And stdout should contain "--max-table-size"
|
||||||
And stdout should contain "--max-matching-size"
|
And stdout should contain "--max-matching-size"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-routed - Help, long
|
Scenario: osrm-routed - Help, long
|
||||||
When I run "osrm-routed --help"
|
When I run "osrm-routed --help"
|
||||||
@@ -59,4 +59,4 @@ Feature: osrm-routed command line options: help
|
|||||||
And stdout should contain "--max-table-size"
|
And stdout should contain "--max-table-size"
|
||||||
And stdout should contain "--max-table-size"
|
And stdout should contain "--max-table-size"
|
||||||
And stdout should contain "--max-matching-size"
|
And stdout should contain "--max-matching-size"
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ Feature: osrm-routed command line options: invalid options
|
|||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
|
|
||||||
Scenario: osrm-routed - Non-existing option
|
Scenario: osrm-routed - Non-existing option
|
||||||
When I run "osrm-routed --fly-me-to-the-moon"
|
When I try to run "osrm-routed --fly-me-to-the-moon"
|
||||||
Then stdout should be empty
|
Then stdout should be empty
|
||||||
And stderr should contain "exception"
|
And stderr should contain "unrecognised"
|
||||||
And stderr should contain "fly-me-to-the-moon"
|
And stderr should contain "fly-me-to-the-moon"
|
||||||
And it should exit with code 1
|
And it should exit with an error
|
||||||
|
|
||||||
Scenario: osrm-routed - Missing file
|
Scenario: osrm-routed - Missing file
|
||||||
When I run "osrm-routed over-the-rainbow.osrm"
|
When I try to run "osrm-routed over-the-rainbow.osrm"
|
||||||
Then stderr should contain "over-the-rainbow.osrm"
|
Then stderr should contain "over-the-rainbow.osrm"
|
||||||
And stderr should contain "not found"
|
And stderr should contain "not found"
|
||||||
And it should exit with code 1
|
And it should exit with an error
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ Feature: osrm-routed command line options: version
|
|||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain 1 line
|
And stdout should contain 1 line
|
||||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|
||||||
Scenario: osrm-routed - Version, long
|
Scenario: osrm-routed - Version, long
|
||||||
When I run "osrm-routed --version"
|
When I run "osrm-routed --version"
|
||||||
Then stderr should be empty
|
Then stderr should be empty
|
||||||
And stdout should contain 1 line
|
And stdout should contain 1 line
|
||||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||||
And it should exit with code 0
|
And it should exit successfully
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
@raster @extract
|
@raster @extract
|
||||||
Feature: osrm-extract with a profile containing raster source
|
Feature: osrm-extract with a profile containing raster source
|
||||||
# expansions:
|
|
||||||
# {osm_base} => path to current input file
|
|
||||||
# {profile} => path to current profile script
|
|
||||||
|
|
||||||
Scenario: osrm-extract on a valid profile
|
Scenario: osrm-extract on a valid profile
|
||||||
Given the profile "rasterbot"
|
Given the profile "rasterbot"
|
||||||
And the node map
|
And the node map
|
||||||
@@ -11,8 +7,15 @@ Feature: osrm-extract with a profile containing raster source
|
|||||||
And the ways
|
And the ways
|
||||||
| nodes |
|
| nodes |
|
||||||
| ab |
|
| ab |
|
||||||
|
And the raster source
|
||||||
|
"""
|
||||||
|
0 0 0 0
|
||||||
|
0 0 0 250
|
||||||
|
0 0 250 500
|
||||||
|
0 0 0 250
|
||||||
|
0 0 0 0
|
||||||
|
"""
|
||||||
And the data has been saved to disk
|
And the data has been saved to disk
|
||||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
When I run "osrm-extract {osm_file} -p {profile_file}"
|
||||||
Then stderr should be empty
|
Then stdout should contain "source loader"
|
||||||
And stdout should contain "source loader"
|
And it should exit successfully
|
||||||
And it should exit with code 0
|
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ Feature: Raster - weights
|
|||||||
|
|
||||||
Scenario: Weighting not based on raster sources
|
Scenario: Weighting not based on raster sources
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
When I run "osrm-extract {osm_file} -p {profile_file}"
|
||||||
And I run "osrm-contract {osm_base}.osm"
|
And I run "osrm-contract {processed_file}"
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 36 km/h |
|
| a | b | ab,ab | 36 km/h |
|
||||||
@@ -44,9 +44,9 @@ Feature: Raster - weights
|
|||||||
|
|
||||||
Scenario: Weighting based on raster sources
|
Scenario: Weighting based on raster sources
|
||||||
Given the profile "rasterbot"
|
Given the profile "rasterbot"
|
||||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
When I run "osrm-extract {osm_file} -p {profile_file}"
|
||||||
Then stdout should contain "evaluating segment"
|
Then stdout should contain "evaluating segment"
|
||||||
And I run "osrm-contract {osm_base}.osm"
|
And I run "osrm-contract {processed_file}"
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 8 km/h |
|
| a | b | ab,ab | 8 km/h |
|
||||||
@@ -62,9 +62,9 @@ Feature: Raster - weights
|
|||||||
|
|
||||||
Scenario: Weighting based on raster sources
|
Scenario: Weighting based on raster sources
|
||||||
Given the profile "rasterbotinterp"
|
Given the profile "rasterbotinterp"
|
||||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
When I run "osrm-extract {osm_file} -p {profile_file}"
|
||||||
Then stdout should contain "evaluating segment"
|
Then stdout should contain "evaluating segment"
|
||||||
And I run "osrm-contract {osm_base}.osm"
|
And I run "osrm-contract {processed_file}"
|
||||||
And I route I should get
|
And I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab,ab | 8 km/h |
|
| a | b | ab,ab | 8 km/h |
|
||||||
|
|||||||
@@ -2,19 +2,23 @@ var util = require('util');
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var d3 = require('d3-queue');
|
var d3 = require('d3-queue');
|
||||||
var OSM = require('../support/build_osm');
|
var OSM = require('../lib/osm');
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.Given(/^the profile "([^"]*)"$/, (profile, callback) => {
|
this.Given(/^the profile "([^"]*)"$/, (profile, callback) => {
|
||||||
this.setProfile(profile, callback);
|
this.profile = profile;
|
||||||
|
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the extract extra arguments "(.*?)"$/, (args, callback) => {
|
this.Given(/^the extract extra arguments "(.*?)"$/, (args, callback) => {
|
||||||
this.setExtractArgs(args, callback);
|
this.extractArgs = this.expandOptions(args);
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the contract extra arguments "(.*?)"$/, (args, callback) => {
|
this.Given(/^the contract extra arguments "(.*?)"$/, (args, callback) => {
|
||||||
this.setContractArgs(args, callback);
|
this.contractArgs = this.expandOptions(args);
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => {
|
this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => {
|
||||||
@@ -228,58 +232,46 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the raster source$/, (data, callback) => {
|
this.Given(/^the raster source$/, (data, callback) => {
|
||||||
this.updateFingerprintExtract(data);
|
// TODO: Don't overwrite if it exists
|
||||||
fs.writeFile(path.resolve(this.TEST_FOLDER, 'rastersource.asc'), data, callback);
|
fs.writeFile(this.rasterCacheFile, data, callback);
|
||||||
|
// we need this to pass it to the profiles
|
||||||
|
this.environment = Object.assign({OSRM_RASTER_SOURCE: this.rasterCacheFile}, this.environment);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the speed file$/, (data, callback) => {
|
this.Given(/^the speed file$/, (data, callback) => {
|
||||||
this.updateFingerprintContract(data);
|
// TODO: Don't overwrite if it exists
|
||||||
fs.writeFile(path.resolve(this.TEST_FOLDER, 'speeds.csv'), data, callback);
|
fs.writeFile(this.speedsCacheFile, data, callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the turn penalty file$/, (data, callback) => {
|
this.Given(/^the turn penalty file$/, (data, callback) => {
|
||||||
this.updateFingerprintContract(data);
|
// TODO: Don't overwrite if it exists
|
||||||
fs.writeFile(path.resolve(this.TEST_FOLDER, 'penalties.csv'), data, callback);
|
fs.writeFile(this.penaltiesCacheFile, data, callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the data has been saved to disk$/, (callback) => {
|
this.Given(/^the data has been saved to disk$/, (callback) => {
|
||||||
try {
|
|
||||||
this.reprocess(callback);
|
this.reprocess(callback);
|
||||||
} catch(e) {
|
|
||||||
this.processError = e;
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the data has been extracted$/, (callback) => {
|
this.Given(/^the data has been extracted$/, (callback) => {
|
||||||
this.osmData.populate(() => {
|
this.reprocess(callback);
|
||||||
this.writeAndExtract((err) => {
|
|
||||||
if (err) this.processError = err;
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the data has been contracted$/, (callback) => {
|
this.Given(/^the data has been contracted$/, (callback) => {
|
||||||
this.reprocess((err) => {
|
this.reprocess(callback);
|
||||||
if (err) this.processError = err;
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^osrm\-routed is stopped$/, (callback) => {
|
this.Given(/^osrm\-routed is stopped$/, (callback) => {
|
||||||
this.OSRMLoader.shutdown((err) => {
|
this.OSRMLoader.shutdown(callback);
|
||||||
if (err) this.processError = err;
|
});
|
||||||
|
|
||||||
|
this.Given(/^data is loaded directly/, (callback) => {
|
||||||
|
this.osrmLoader.setLoadMethod('directly');
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
this.Given(/^data is loaded directly/, () => {
|
this.Given(/^data is loaded with datastore$/, (callback) => {
|
||||||
this.loadMethod = 'directly';
|
this.osrmLoader.setLoadMethod('datastore');
|
||||||
});
|
callback();
|
||||||
|
|
||||||
this.Given(/^data is loaded with datastore$/, () => {
|
|
||||||
this.loadMethod = 'datastore';
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Given(/^the HTTP method "([^"]*)"$/, (method, callback) => {
|
this.Given(/^the HTTP method "([^"]*)"$/, (method, callback) => {
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ module.exports = function () {
|
|||||||
var actual = [];
|
var actual = [];
|
||||||
actual.push(table.headers);
|
actual.push(table.headers);
|
||||||
|
|
||||||
this.reprocessAndLoadData(() => {
|
this.reprocessAndLoadData((e) => {
|
||||||
|
if (e) return callback(e);
|
||||||
// compute matrix
|
// compute matrix
|
||||||
var params = this.queryParams;
|
var params = this.queryParams;
|
||||||
|
|
||||||
@@ -52,8 +53,6 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var testRow = (row, ri, cb) => {
|
var testRow = (row, ri, cb) => {
|
||||||
var ok = true;
|
|
||||||
|
|
||||||
for (var k in result[ri]) {
|
for (var k in result[ri]) {
|
||||||
if (this.FuzzyMatch.match(result[ri][k], row[k])) {
|
if (this.FuzzyMatch.match(result[ri][k], row[k])) {
|
||||||
result[ri][k] = row[k];
|
result[ri][k] = row[k];
|
||||||
@@ -61,15 +60,9 @@ module.exports = function () {
|
|||||||
result[ri][k] = '';
|
result[ri][k] = '';
|
||||||
} else {
|
} else {
|
||||||
result[ri][k] = result[ri][k].toString();
|
result[ri][k] = result[ri][k].toString();
|
||||||
ok = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
var failed = { attempt: 'distance_matrix', query: this.query, response: response };
|
|
||||||
this.logFail(row, result[ri], [failed]);
|
|
||||||
}
|
|
||||||
|
|
||||||
result[ri][''] = row[''];
|
result[ri][''] = row[''];
|
||||||
cb(null, result[ri]);
|
cb(null, result[ri]);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.Before((scenario, callback) => {
|
|
||||||
this.scenarioTitle = scenario.getName();
|
|
||||||
|
|
||||||
this.loadMethod = this.DEFAULT_LOAD_METHOD;
|
|
||||||
this.queryParams = {};
|
|
||||||
var d = new Date();
|
|
||||||
this.scenarioTime = util.format('%d-%d-%dT%s:%s:%sZ', d.getFullYear(), d.getMonth()+1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds());
|
|
||||||
this.resetData();
|
|
||||||
this.hasLoggedPreprocessInfo = false;
|
|
||||||
this.hasLoggedScenarioInfo = false;
|
|
||||||
this.setGridSize(this.DEFAULT_GRID_SIZE);
|
|
||||||
this.setOrigin(this.DEFAULT_ORIGIN);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var d3 = require('d3-queue');
|
|
||||||
var polyline = require('polyline');
|
var polyline = require('polyline');
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.When(/^I match I should get$/, (table, callback) => {
|
this.When(/^I match I should get$/, (table, callback) => {
|
||||||
var got;
|
var got;
|
||||||
|
|
||||||
this.reprocessAndLoadData(() => {
|
this.reprocessAndLoadData((e) => {
|
||||||
|
if (e) return callback(e);
|
||||||
var testRow = (row, ri, cb) => {
|
var testRow = (row, ri, cb) => {
|
||||||
var afterRequest = (err, res) => {
|
var afterRequest = (err, res) => {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
@@ -42,7 +44,28 @@ module.exports = function () {
|
|||||||
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
if (headers.has('matchings')) {
|
if (headers.has('matchings')) {
|
||||||
subMatchings = json.matchings.filter(m => !!m).map(sub => sub.matched_points);
|
subMatchings = [];
|
||||||
|
|
||||||
|
// find the first matched
|
||||||
|
let start_index = 0;
|
||||||
|
while (start_index < json.tracepoints.length && json.tracepoints[start_index] === null) start_index++;
|
||||||
|
|
||||||
|
var sub = [];
|
||||||
|
let prev_index = null;
|
||||||
|
for(var i = start_index; i < json.tracepoints.length; i++){
|
||||||
|
if (json.tracepoints[i] === null) continue;
|
||||||
|
|
||||||
|
let current_index = json.tracepoints[i].matchings_index;
|
||||||
|
|
||||||
|
if(prev_index !== current_index) {
|
||||||
|
if (sub.length > 0) subMatchings.push(sub);
|
||||||
|
sub = [];
|
||||||
|
prev_index = current_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub.push(json.tracepoints[i].location);
|
||||||
|
}
|
||||||
|
subMatchings.push(sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('turns')) {
|
if (headers.has('turns')) {
|
||||||
@@ -67,11 +90,11 @@ module.exports = function () {
|
|||||||
|
|
||||||
if (headers.has('geometry')) {
|
if (headers.has('geometry')) {
|
||||||
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
||||||
geometry = json.matchings[0].geometry;
|
geometry = json.matchings[0].geometry.coordinates;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('OSM IDs')) {
|
if (headers.has('OSM IDs')) {
|
||||||
if (json.matchings.length != 1) throw new Error('*** CHecking annotation only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking annotation only supported for matchings with one subtrace');
|
||||||
OSMIDs = this.OSMIDList(json.matchings[0]);
|
OSMIDs = this.OSMIDList(json.matchings[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,17 +130,8 @@ module.exports = function () {
|
|||||||
var encodedResult = '',
|
var encodedResult = '',
|
||||||
extendedTarget = '';
|
extendedTarget = '';
|
||||||
|
|
||||||
var q = d3.queue();
|
var testSubMatching = (sub, si) => {
|
||||||
|
var testSubNode = (ni) => {
|
||||||
var testSubMatching = (sub, si, scb) => {
|
|
||||||
if (si >= subMatchings.length) {
|
|
||||||
ok = false;
|
|
||||||
q.abort();
|
|
||||||
scb();
|
|
||||||
} else {
|
|
||||||
var sq = d3.queue();
|
|
||||||
|
|
||||||
var testSubNode = (ni, ncb) => {
|
|
||||||
var node = this.findNodeByName(sub[ni]),
|
var node = this.findNodeByName(sub[ni]),
|
||||||
outNode = subMatchings[si][ni];
|
outNode = subMatchings[si][ni];
|
||||||
|
|
||||||
@@ -125,26 +139,32 @@ module.exports = function () {
|
|||||||
encodedResult += sub[ni];
|
encodedResult += sub[ni];
|
||||||
extendedTarget += sub[ni];
|
extendedTarget += sub[ni];
|
||||||
} else {
|
} else {
|
||||||
|
if (outNode != null) {
|
||||||
encodedResult += util.format('? [%s,%s]', outNode[0], outNode[1]);
|
encodedResult += util.format('? [%s,%s]', outNode[0], outNode[1]);
|
||||||
|
} else {
|
||||||
|
encodedResult += '?';
|
||||||
|
}
|
||||||
extendedTarget += util.format('%s [%d,%d]', node.lat, node.lon);
|
extendedTarget += util.format('%s [%d,%d]', node.lat, node.lon);
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
ncb();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var i=0; i<sub.length; i++) {
|
for (var i=0; i<sub.length; i++) {
|
||||||
sq.defer(testSubNode, i);
|
testSubNode(i);
|
||||||
}
|
|
||||||
|
|
||||||
sq.awaitAll(scb);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
row.matchings.split(',').forEach((sub, si) => {
|
if (headers.has('matchings')) {
|
||||||
q.defer(testSubMatching, sub, si);
|
if (subMatchings.length != row.matchings.split(',').length) {
|
||||||
});
|
ok = false;
|
||||||
|
cb(new Error('*** table matchings and api response are not the same'));
|
||||||
|
}
|
||||||
|
|
||||||
|
row.matchings.split(',').forEach((sub, si) => {
|
||||||
|
testSubMatching(sub, si);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
q.awaitAll(() => {
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (headers.has('matchings')) {
|
if (headers.has('matchings')) {
|
||||||
got.matchings = row.matchings;
|
got.matchings = row.matchings;
|
||||||
@@ -156,11 +176,9 @@ module.exports = function () {
|
|||||||
} else {
|
} else {
|
||||||
got.matchings = encodedResult;
|
got.matchings = encodedResult;
|
||||||
row.matchings = extendedTarget;
|
row.matchings = extendedTarget;
|
||||||
this.logFail(row, got, { matching: { query: this.query, response: res } });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cb(null, got);
|
cb(null, got);
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (row.request) {
|
if (row.request) {
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ var util = require('util');
|
|||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.When(/^I request nearest I should get$/, (table, callback) => {
|
this.When(/^I request nearest I should get$/, (table, callback) => {
|
||||||
this.reprocessAndLoadData(() => {
|
this.reprocessAndLoadData((e) => {
|
||||||
|
if (e) return callback(e);
|
||||||
var testRow = (row, ri, cb) => {
|
var testRow = (row, ri, cb) => {
|
||||||
var inNode = this.findNodeByName(row.in);
|
var inNode = this.findNodeByName(row.in);
|
||||||
if (!inNode) throw new Error(util.format('*** unknown in-node "%s"'), row.in);
|
if (!inNode) throw new Error(util.format('*** unknown in-node "%s"'), row.in);
|
||||||
@@ -21,24 +22,16 @@ module.exports = function () {
|
|||||||
|
|
||||||
var got = { in: row.in, out: row.out };
|
var got = { in: row.in, out: row.out };
|
||||||
|
|
||||||
var ok = true;
|
|
||||||
|
|
||||||
Object.keys(row).forEach((key) => {
|
Object.keys(row).forEach((key) => {
|
||||||
if (key === 'out') {
|
if (key === 'out') {
|
||||||
if (this.FuzzyMatch.matchLocation(coord, outNode)) {
|
if (this.FuzzyMatch.matchLocation(coord, outNode)) {
|
||||||
got[key] = row[key];
|
got[key] = row[key];
|
||||||
} else {
|
} else {
|
||||||
row[key] = util.format('%s [%d,%d]', row[key], outNode.lat, outNode.lon);
|
row[key] = util.format('%s [%d,%d]', row[key], outNode.lat, outNode.lon);
|
||||||
ok = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
var failed = { attempt: 'nearest', query: this.query, response: response };
|
|
||||||
this.logFail(row, got, [failed]);
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, got);
|
cb(null, got);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -2,32 +2,58 @@ var assert = require('assert');
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.When(/^I run "osrm\-routed\s?(.*?)"$/, { timeout: this.TIMEOUT }, (options, callback) => {
|
this.resetOptionsOutput = () => {
|
||||||
this.runBin('osrm-routed', options, () => {
|
this.stdout = null;
|
||||||
callback();
|
this.stderr = null;
|
||||||
|
this.exitCode = null;
|
||||||
|
this.termSignal = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.runAndSafeOutput = (binary, options, callback) => {
|
||||||
|
this.runBin(binary, this.expandOptions(options), this.environment, (err, stdout, stderr) => {
|
||||||
|
this.stdout = stdout;
|
||||||
|
this.stderr = stderr;
|
||||||
|
this.exitCode = err && err.code || 0;
|
||||||
|
this.termSignal = err && err.signal || '';
|
||||||
|
callback(err);
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.When(/^I run "osrm\-routed\s?(.*?)"$/, { timeout: this.TIMEOUT }, (options, callback) => {
|
||||||
|
this.runAndSafeOutput('osrm-routed', options, callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.When(/^I run "osrm\-extract\s?(.*?)"$/, (options, callback) => {
|
this.When(/^I run "osrm\-extract\s?(.*?)"$/, (options, callback) => {
|
||||||
this.runBin('osrm-extract', options, () => {
|
this.runAndSafeOutput('osrm-extract', options, callback);
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.When(/^I run "osrm\-contract\s?(.*?)"$/, (options, callback) => {
|
this.When(/^I run "osrm\-contract\s?(.*?)"$/, (options, callback) => {
|
||||||
this.runBin('osrm-contract', options, () => {
|
this.runAndSafeOutput('osrm-contract', options, callback);
|
||||||
callback();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.When(/^I try to run "osrm\-routed\s?(.*?)"$/, (options, callback) => {
|
||||||
|
this.runAndSafeOutput('osrm-routed', options, () => { callback(); });
|
||||||
|
});
|
||||||
|
|
||||||
|
this.When(/^I try to run "osrm\-extract\s?(.*?)"$/, (options, callback) => {
|
||||||
|
this.runAndSafeOutput('osrm-extract', options, () => { callback(); });
|
||||||
|
});
|
||||||
|
|
||||||
|
this.When(/^I try to run "osrm\-contract\s?(.*?)"$/, (options, callback) => {
|
||||||
|
this.runAndSafeOutput('osrm-contract', options, () => { callback(); });
|
||||||
});
|
});
|
||||||
|
|
||||||
this.When(/^I run "osrm\-datastore\s?(.*?)"$/, (options, callback) => {
|
this.When(/^I run "osrm\-datastore\s?(.*?)"$/, (options, callback) => {
|
||||||
this.runBin('osrm-datastore', options, () => {
|
this.runAndSafeOutput('osrm-datastore', options, callback);
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^it should exit with code (\d+)$/, (code) => {
|
this.Then(/^it should exit successfully$/, () => {
|
||||||
assert.equal(this.exitCode, parseInt(code));
|
assert.equal(this.exitCode, 0);
|
||||||
|
assert.equal(this.termSignal, '');
|
||||||
|
});
|
||||||
|
|
||||||
|
this.Then(/^it should exit with an error$/, () => {
|
||||||
|
assert.ok(this.exitCode !== 0 || this.termSignal);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^stdout should contain "(.*?)"$/, (str) => {
|
this.Then(/^stdout should contain "(.*?)"$/, (str) => {
|
||||||
@@ -61,7 +87,7 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^datasource names should contain "(.+)"$/, (expectedData) => {
|
this.Then(/^datasource names should contain "(.+)"$/, (expectedData) => {
|
||||||
var actualData = fs.readFileSync(this.osmData.extractedFile + '.osrm.datasource_names', {encoding:'UTF-8'}).trim().split('\n').join(',');
|
var actualData = fs.readFileSync(this.processedCacheFile + '.datasource_names', {encoding:'UTF-8'}).trim().split('\n').join(',');
|
||||||
assert.equal(actualData, expectedData);
|
assert.equal(actualData, expectedData);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ var assert = require('assert');
|
|||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.When(/^I request \/(.*)$/, (path, callback) => {
|
this.When(/^I request \/(.*)$/, (path, callback) => {
|
||||||
this.reprocessAndLoadData(() => {
|
this.reprocessAndLoadData((e) => {
|
||||||
|
if (e) return callback(e);
|
||||||
this.requestPath(path, {}, (err, res, body) => {
|
this.requestPath(path, {}, (err, res, body) => {
|
||||||
this.response = res;
|
this.response = res;
|
||||||
callback(err, res, body);
|
callback(err, res, body);
|
||||||
@@ -50,7 +51,7 @@ module.exports = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.Then(/^"([^"]*)" should return code (\d+)$/, (binary, code) => {
|
this.Then(/^"([^"]*)" should return code (\d+)$/, (binary, code) => {
|
||||||
assert.ok(this.processError instanceof this.OSRMError);
|
assert.ok(this.processError instanceof Error);
|
||||||
assert.equal(this.processError.process, binary);
|
assert.equal(this.processError.process, binary);
|
||||||
assert.equal(parseInt(this.processError.code), parseInt(code));
|
assert.equal(parseInt(this.processError.code), parseInt(code));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.reprocessAndLoadData((e) => {
|
this.reprocessAndLoadData((e) => {
|
||||||
if (e) callback(e);
|
if (e) return callback(e);
|
||||||
var testRow = (row, i, cb) => {
|
var testRow = (row, i, cb) => {
|
||||||
var outputRow = row;
|
var outputRow = row;
|
||||||
|
|
||||||
@@ -41,10 +41,6 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (outputRow != row) {
|
|
||||||
this.logFail(row, outputRow, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, outputRow);
|
cb(null, outputRow);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -116,7 +112,7 @@ module.exports = function () {
|
|||||||
sq.defer(parseRes, key);
|
sq.defer(parseRes, key);
|
||||||
});
|
});
|
||||||
|
|
||||||
sq.awaitAll(() => { cb(null, result); });
|
sq.awaitAll((err) => { cb(err, result); });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ module.exports = function () {
|
|||||||
this.When(/^I plan a trip I should get$/, (table, callback) => {
|
this.When(/^I plan a trip I should get$/, (table, callback) => {
|
||||||
var got;
|
var got;
|
||||||
|
|
||||||
this.reprocessAndLoadData(() => {
|
this.reprocessAndLoadData((e) => {
|
||||||
|
if (e) return callback(e);
|
||||||
var testRow = (row, ri, cb) => {
|
var testRow = (row, ri, cb) => {
|
||||||
var afterRequest = (err, res) => {
|
var afterRequest = (err, res) => {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
@@ -84,23 +85,14 @@ module.exports = function () {
|
|||||||
} else {
|
} else {
|
||||||
got.trips = encodedResult;
|
got.trips = encodedResult;
|
||||||
got.trips = extendedTarget;
|
got.trips = extendedTarget;
|
||||||
this.logFail(row, got, { trip: { query: this.query, response: res }});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = true;
|
|
||||||
|
|
||||||
for (var key in row) {
|
for (var key in row) {
|
||||||
if (this.FuzzyMatch.match(got[key], row[key])) {
|
if (this.FuzzyMatch.match(got[key], row[key])) {
|
||||||
got[key] = row[key];
|
got[key] = row[key];
|
||||||
} else {
|
|
||||||
ok = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
this.logFail(row, got, { trip: { query: this.query, response: res }});
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, got);
|
cb(null, got);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,184 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const d3 = require('d3-queue');
|
||||||
|
const fs = require('fs');
|
||||||
|
const util = require('util');
|
||||||
|
const path = require('path');
|
||||||
|
const mkdirp = require('mkdirp');
|
||||||
|
const hash = require('../lib/hash');
|
||||||
|
const rimraf = require('rimraf');
|
||||||
|
|
||||||
|
module.exports = function() {
|
||||||
|
this.initializeCache = (callback) => {
|
||||||
|
this.getOSRMHash((err, osrmHash) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
this.osrmHash = osrmHash;
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// computes all paths for every feature
|
||||||
|
this.setupFeatures = (features, callback) => {
|
||||||
|
this.featureIDs = {};
|
||||||
|
this.featureCacheDirectories = {};
|
||||||
|
this.featureProcessedCacheDirectories = {};
|
||||||
|
let queue = d3.queue();
|
||||||
|
|
||||||
|
function initializeFeature(feature, callback) {
|
||||||
|
let uri = feature.getUri();
|
||||||
|
|
||||||
|
// setup cache for feature data
|
||||||
|
hash.hashOfFile(uri, (err, hash) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
|
||||||
|
// shorten uri to be realtive to 'features/'
|
||||||
|
let featurePath = path.relative(path.resolve('./features'), uri);
|
||||||
|
// bicycle/bollards/{HASH}/
|
||||||
|
let featureID = path.join(featurePath, hash);
|
||||||
|
let featureCacheDirectory = this.getFeatureCacheDirectory(featureID);
|
||||||
|
let featureProcessedCacheDirectory = this.getFeatureProcessedCacheDirectory(featureCacheDirectory, this.osrmHash);
|
||||||
|
this.featureIDs[uri] = featureID;
|
||||||
|
this.featureCacheDirectories[uri] = featureCacheDirectory;
|
||||||
|
this.featureProcessedCacheDirectories[uri] = featureProcessedCacheDirectory;
|
||||||
|
|
||||||
|
d3.queue(1)
|
||||||
|
.defer(mkdirp, featureProcessedCacheDirectory)
|
||||||
|
.defer(this.cleanupFeatureCache.bind(this), featureCacheDirectory, hash)
|
||||||
|
.defer(this.cleanupProcessedFeatureCache.bind(this), featureProcessedCacheDirectory, this.osrmHash)
|
||||||
|
.awaitAll(callback);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < features.length; ++i) {
|
||||||
|
queue.defer(initializeFeature.bind(this), features[i]);
|
||||||
|
}
|
||||||
|
queue.awaitAll(callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.cleanupProcessedFeatureCache = (directory, osrmHash, callback) => {
|
||||||
|
let parentPath = path.resolve(path.join(directory, '..'));
|
||||||
|
fs.readdir(parentPath, (err, files) => {
|
||||||
|
let q = d3.queue();
|
||||||
|
function runStats(path, callback) {
|
||||||
|
fs.stat(path, (err, stat) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
callback(null, {file: path, stat: stat});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
files.map(f => { q.defer(runStats, path.join(parentPath, f)); });
|
||||||
|
q.awaitAll((err, results) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
let q = d3.queue();
|
||||||
|
results.forEach(r => {
|
||||||
|
if (r.stat.isDirectory() && r.file.search(osrmHash) < 0) {
|
||||||
|
q.defer(rimraf, r.file);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
q.awaitAll(callback);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.cleanupFeatureCache = (directory, featureHash, callback) => {
|
||||||
|
let parentPath = path.resolve(path.join(directory, '..'));
|
||||||
|
fs.readdir(parentPath, (err, files) => {
|
||||||
|
let q = d3.queue();
|
||||||
|
files.filter(name => { return name !== featureHash;})
|
||||||
|
.map((f) => { q.defer(rimraf, path.join(parentPath, f)); });
|
||||||
|
q.awaitAll(callback);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setupFeatureCache = (feature) => {
|
||||||
|
let uri = feature.getUri();
|
||||||
|
this.featureID = this.featureIDs[uri];
|
||||||
|
this.featureCacheDirectory = this.featureCacheDirectories[uri];
|
||||||
|
this.featureProcessedCacheDirectory = this.featureProcessedCacheDirectories[uri];
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setupScenarioCache = (scenarioID) => {
|
||||||
|
this.scenarioCacheFile = this.getScenarioCacheFile(this.featureCacheDirectory, scenarioID);
|
||||||
|
this.processedCacheFile = this.getProcessedCacheFile(this.featureProcessedCacheDirectory, scenarioID);
|
||||||
|
this.inputCacheFile = this.getInputCacheFile(this.featureProcessedCacheDirectory, scenarioID);
|
||||||
|
this.rasterCacheFile = this.getRasterCacheFile(this.featureProcessedCacheDirectory, scenarioID);
|
||||||
|
this.speedsCacheFile = this.getSpeedsCacheFile(this.featureProcessedCacheDirectory, scenarioID);
|
||||||
|
this.penaltiesCacheFile = this.getPenaltiesCacheFile(this.featureProcessedCacheDirectory, scenarioID);
|
||||||
|
};
|
||||||
|
|
||||||
|
// returns a hash of all OSRM code side dependencies
|
||||||
|
this.getOSRMHash = (callback) => {
|
||||||
|
let dependencies = [
|
||||||
|
this.OSRM_EXTRACT_PATH,
|
||||||
|
this.OSRM_CONTRACT_PATH,
|
||||||
|
this.LIB_OSRM_EXTRACT_PATH,
|
||||||
|
this.LIB_OSRM_CONTRACT_PATH
|
||||||
|
];
|
||||||
|
|
||||||
|
var addLuaFiles = (directory, callback) => {
|
||||||
|
fs.readdir(path.normalize(directory), (err, files) => {
|
||||||
|
if (err) return callback(err);
|
||||||
|
|
||||||
|
var luaFiles = files.filter(f => !!f.match(/\.lua$/)).map(f => path.normalize(directory + '/' + f));
|
||||||
|
Array.prototype.push.apply(dependencies, luaFiles);
|
||||||
|
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Note: we need a serialized queue here to ensure that the order of the files
|
||||||
|
// passed is stable. Otherwise the hash will not be stable
|
||||||
|
d3.queue(1)
|
||||||
|
.defer(addLuaFiles, this.PROFILES_PATH)
|
||||||
|
.defer(addLuaFiles, this.PROFILES_PATH + '/lib')
|
||||||
|
.awaitAll(hash.hashOfFiles.bind(hash, dependencies, callback));
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/bicycle/bollards/{HASH}/
|
||||||
|
this.getFeatureCacheDirectory = (featureID) => {
|
||||||
|
return path.join(this.CACHE_PATH, featureID);
|
||||||
|
};
|
||||||
|
|
||||||
|
// converts the scenario titles in file prefixes
|
||||||
|
this.getScenarioID = (scenario) => {
|
||||||
|
let name = scenario.getName().toLowerCase().replace(/[\/\-'=,\(\)]/g, '').replace(/\s/g, '_').replace(/__/g, '_').replace(/\.\./g, '.');
|
||||||
|
return util.format('%d_%s', scenario.getLine(), name);
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/{feature_path}/{feature_hash}/{scenario}_raster.asc
|
||||||
|
this.getRasterCacheFile = (featureCacheDirectory, scenarioID) => {
|
||||||
|
return path.join(featureCacheDirectory, scenarioID) + '_raster.asc';
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/{feature_path}/{feature_hash}/{scenario}_speeds.csv
|
||||||
|
this.getSpeedsCacheFile = (featureCacheDirectory, scenarioID) => {
|
||||||
|
return path.join(featureCacheDirectory, scenarioID) + '_speeds.csv';
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/{feature_path}/{feature_hash}/{scenario}_penalties.csv
|
||||||
|
this.getPenaltiesCacheFile = (featureCacheDirectory, scenarioID) => {
|
||||||
|
return path.join(featureCacheDirectory, scenarioID) + '_penalties.csv';
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/{feature_path}/{feature_hash}/{scenario}.osm
|
||||||
|
this.getScenarioCacheFile = (featureCacheDirectory, scenarioID) => {
|
||||||
|
return path.join(featureCacheDirectory, scenarioID) + '.osm';
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/{feature_path}/{feature_hash}/{osrm_hash}/
|
||||||
|
this.getFeatureProcessedCacheDirectory = (featureCacheDirectory, osrmHash) => {
|
||||||
|
return path.join(featureCacheDirectory, osrmHash);
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/{feature_path}/{feature_hash}/{osrm_hash}/{scenario}.osrm
|
||||||
|
this.getProcessedCacheFile = (featureProcessedCacheDirectory, scenarioID) => {
|
||||||
|
return path.join(featureProcessedCacheDirectory, scenarioID) + '.osrm';
|
||||||
|
};
|
||||||
|
|
||||||
|
// test/cache/{feature_path}/{feature_hash}/{osrm_hash}/{scenario}.osm
|
||||||
|
this.getInputCacheFile = (featureProcessedCacheDirectory, scenarioID) => {
|
||||||
|
return path.join(featureProcessedCacheDirectory, scenarioID) + '.osm';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var path = require('path');
|
|
||||||
var util = require('util');
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
var OSM = require('./build_osm');
|
|
||||||
var classes = require('./data_classes');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.initializeOptions = (callback) => {
|
|
||||||
this.profile = this.profile || this.DEFAULT_SPEEDPROFILE;
|
|
||||||
|
|
||||||
this.OSMDB = this.OSMDB || new OSM.DB();
|
|
||||||
|
|
||||||
this.nameNodeHash = this.nameNodeHash || {};
|
|
||||||
|
|
||||||
this.locationHash = this.locationHash || {};
|
|
||||||
|
|
||||||
this.nameWayHash = this.nameWayHash || {};
|
|
||||||
|
|
||||||
this.osmData = new classes.osmData(this);
|
|
||||||
|
|
||||||
this.OSRMLoader = this._OSRMLoader();
|
|
||||||
|
|
||||||
this.PREPROCESS_LOG_FILE = path.resolve(this.TEST_FOLDER, 'preprocessing.log');
|
|
||||||
|
|
||||||
this.LOG_FILE = path.resolve(this.TEST_FOLDER, 'fail.log');
|
|
||||||
|
|
||||||
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
|
||||||
|
|
||||||
this.DESTINATION_REACHED = 15; // OSRM instruction code
|
|
||||||
|
|
||||||
this.shortcutsHash = this.shortcutsHash || {};
|
|
||||||
|
|
||||||
var hashLuaLib = (cb) => {
|
|
||||||
fs.readdir(path.normalize(this.PROFILES_PATH + '/lib/'), (err, files) => {
|
|
||||||
if (err) cb(err);
|
|
||||||
var luaFiles = files.filter(f => !!f.match(/\.lua$/)).map(f => path.normalize(this.PROFILES_PATH + '/lib/' + f));
|
|
||||||
this.hashOfFiles(luaFiles, hash => {
|
|
||||||
this.luaLibHash = hash;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashProfile = (cb) => {
|
|
||||||
this.hashProfile((hash) => {
|
|
||||||
this.profileHash = hash;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashExtract = (cb) => {
|
|
||||||
var files = [ util.format('%s/osrm-extract%s', this.BIN_PATH, this.EXE),
|
|
||||||
util.format('%s/libosrm_extract%s', this.BIN_PATH, this.LIB) ];
|
|
||||||
this.hashOfFiles(files, (hash) => {
|
|
||||||
this.binExtractHash = hash;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashContract = (cb) => {
|
|
||||||
var files = [ util.format('%s/osrm-contract%s', this.BIN_PATH, this.EXE),
|
|
||||||
util.format('%s/libosrm_contract%s', this.BIN_PATH, this.LIB) ];
|
|
||||||
this.hashOfFiles(files, (hash) => {
|
|
||||||
this.binContractHash = hash;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var hashRouted = (cb) => {
|
|
||||||
var files = [ util.format('%s/osrm-routed%s', this.BIN_PATH, this.EXE),
|
|
||||||
util.format('%s/libosrm%s', this.BIN_PATH, this.LIB) ];
|
|
||||||
this.hashOfFiles(files, (hash) => {
|
|
||||||
this.binRoutedHash = hash;
|
|
||||||
this.fingerprintRoute = this.hashString(this.binRoutedHash);
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
d3.queue()
|
|
||||||
.defer(hashLuaLib)
|
|
||||||
.defer(hashProfile)
|
|
||||||
.defer(hashExtract)
|
|
||||||
.defer(hashContract)
|
|
||||||
.defer(hashRouted)
|
|
||||||
.awaitAll(() => {
|
|
||||||
this.AfterConfiguration(() => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.updateFingerprintExtract = (str) => {
|
|
||||||
this.fingerprintExtract = this.hashString([this.fingerprintExtract, str].join('-'));
|
|
||||||
};
|
|
||||||
|
|
||||||
this.updateFingerprintContract = (str) => {
|
|
||||||
this.fingerprintContract = this.hashString([this.fingerprintContract, str].join('-'));
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setProfile = (profile, cb) => {
|
|
||||||
var lastProfile = this.profile;
|
|
||||||
if (profile !== lastProfile) {
|
|
||||||
this.profile = profile;
|
|
||||||
this.hashProfile((hash) => {
|
|
||||||
this.profileHash = hash;
|
|
||||||
this.updateFingerprintExtract(this.profileHash);
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.updateFingerprintExtract(this.profileHash);
|
|
||||||
cb();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setExtractArgs = (args, callback) => {
|
|
||||||
this.extractArgs = args;
|
|
||||||
this.updateFingerprintExtract(args);
|
|
||||||
callback();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setContractArgs = (args, callback) => {
|
|
||||||
this.contractArgs = args;
|
|
||||||
this.updateFingerprintContract(args);
|
|
||||||
callback();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
+84
-191
@@ -1,11 +1,14 @@
|
|||||||
var fs = require('fs');
|
'use strict';
|
||||||
var path = require('path');
|
|
||||||
var util = require('util');
|
|
||||||
var exec = require('child_process').exec;
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
|
|
||||||
var OSM = require('./build_osm');
|
const fs = require('fs');
|
||||||
var classes = require('./data_classes');
|
const util = require('util');
|
||||||
|
const d3 = require('d3-queue');
|
||||||
|
|
||||||
|
const OSM = require('../lib/osm');
|
||||||
|
const classes = require('./data_classes');
|
||||||
|
const tableDiff = require('../lib/table_diff');
|
||||||
|
const ensureDecimal = require('../lib/utils').ensureDecimal;
|
||||||
|
const errorReason = require('../lib/utils').errorReason;
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.setGridSize = (meters) => {
|
this.setGridSize = (meters) => {
|
||||||
@@ -94,13 +97,8 @@ module.exports = function () {
|
|||||||
q.awaitAll(callback);
|
q.awaitAll(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.ensureDecimal = (i) => {
|
|
||||||
if (parseInt(i) === i) return i.toFixed(1);
|
|
||||||
else return i;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.tableCoordToLonLat = (ci, ri) => {
|
this.tableCoordToLonLat = (ci, ri) => {
|
||||||
return [this.origin[0] + ci * this.zoom, this.origin[1] - ri * this.zoom].map(this.ensureDecimal);
|
return [this.origin[0] + ci * this.zoom, this.origin[1] - ri * this.zoom].map(ensureDecimal);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addOSMNode = (name, lon, lat, id) => {
|
this.addOSMNode = (name, lon, lat, id) => {
|
||||||
@@ -128,12 +126,22 @@ module.exports = function () {
|
|||||||
return fromNode;
|
return fromNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.findWayByName = (s) => {
|
// find a node based on an array containing lon/lat
|
||||||
return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')];
|
this.findNodeByLocation = (node_location) => {
|
||||||
|
var searched_coordinate = new classes.Location(node_location[0],node_location[1]);
|
||||||
|
for (var node in this.nameNodeHash)
|
||||||
|
{
|
||||||
|
var node_coordinate = new classes.Location(this.nameNodeHash[node].lon,this.nameNodeHash[node].lat);
|
||||||
|
if (this.FuzzyMatch.matchCoordinate(searched_coordinate, node_coordinate, this.zoom))
|
||||||
|
{
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '_';
|
||||||
};
|
};
|
||||||
|
|
||||||
this.resetData = () => {
|
this.findWayByName = (s) => {
|
||||||
this.resetOSM();
|
return this.nameWayHash[s.toString()] || this.nameWayHash[s.toString().split('').reverse().join('')];
|
||||||
};
|
};
|
||||||
|
|
||||||
this.makeOSMId = () => {
|
this.makeOSMId = () => {
|
||||||
@@ -143,205 +151,88 @@ module.exports = function () {
|
|||||||
|
|
||||||
this.resetOSM = () => {
|
this.resetOSM = () => {
|
||||||
this.OSMDB.clear();
|
this.OSMDB.clear();
|
||||||
this.osmData.reset();
|
|
||||||
this.nameNodeHash = {};
|
this.nameNodeHash = {};
|
||||||
this.locationHash = {};
|
this.locationHash = {};
|
||||||
|
this.shortcutsHash = {};
|
||||||
this.nameWayHash = {};
|
this.nameWayHash = {};
|
||||||
this.osmID = 0;
|
this.osmID = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.writeOSM = (callback) => {
|
this.writeOSM = (callback) => {
|
||||||
fs.exists(this.DATA_FOLDER, (exists) => {
|
fs.exists(this.scenarioCacheFile, (exists) => {
|
||||||
var mkDirFn = exists ? (cb) => { cb(); } : fs.mkdir.bind(fs.mkdir, this.DATA_FOLDER);
|
if (exists) callback();
|
||||||
mkDirFn((err) => {
|
else {
|
||||||
if (err) return callback(err);
|
this.OSMDB.toXML((xml) => {
|
||||||
var osmPath = path.resolve(this.DATA_FOLDER, util.format('%s.osm', this.osmData.osmFile));
|
fs.writeFile(this.scenarioCacheFile, xml, callback);
|
||||||
fs.exists(osmPath, (exists) => {
|
|
||||||
if (!exists) fs.writeFile(osmPath, this.osmData.str, callback);
|
|
||||||
else callback();
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.isExtracted = (callback) => {
|
|
||||||
fs.exists(util.format('%s.osrm', this.osmData.extractedFile), (core) => {
|
|
||||||
if (!core) return callback(false);
|
|
||||||
fs.exists(util.format('%s.osrm.names', this.osmData.extractedFile), (names) => {
|
|
||||||
if (!names) return callback(false);
|
|
||||||
fs.exists(util.format('%s.osrm.restrictions', this.osmData.extractedFile), (restrictions) => {
|
|
||||||
return callback(restrictions);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.isContracted = (callback) => {
|
|
||||||
fs.exists(util.format('%s.osrm.hsgr', this.osmData.contractedFile), callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.writeTimestamp = (callback) => {
|
|
||||||
fs.writeFile(util.format('%s.osrm.timestamp', this.osmData.contractedFile), this.OSM_TIMESTAMP, callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.writeInputData = (callback) => {
|
|
||||||
this.writeOSM((err) => {
|
|
||||||
if (err) return callback(err);
|
|
||||||
this.writeTimestamp(callback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.extractData = (callback) => {
|
|
||||||
this.logPreprocessInfo();
|
|
||||||
this.log(util.format('== Extracting %s.osm...', this.osmData.osmFile), 'preprocess');
|
|
||||||
var cmd = util.format('%s/osrm-extract %s.osm %s --profile %s/%s.lua >>%s 2>&1',
|
|
||||||
this.BIN_PATH, this.osmData.osmFile, this.extractArgs || '', this.PROFILES_PATH, this.profile, this.PREPROCESS_LOG_FILE);
|
|
||||||
this.log(cmd);
|
|
||||||
process.chdir(this.TEST_FOLDER);
|
|
||||||
exec(cmd, (err) => {
|
|
||||||
if (err) {
|
|
||||||
this.log(util.format('*** Exited with code %d', err.code), 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
return callback(this.ExtractError(err.code, util.format('osrm-extract exited with code %d', err.code)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
var rename = (file, cb) => {
|
|
||||||
this.log(util.format('Renaming %s.%s to %s.%s', this.osmData.osmFile, file, this.osmData.extractedFile, file), 'preprocess');
|
|
||||||
fs.rename([this.osmData.osmFile, file].join('.'), [this.osmData.extractedFile, file].join('.'), (err) => {
|
|
||||||
if (err) return cb(this.FileError(null, 'failed to rename data file after extracting'));
|
|
||||||
cb();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var renameIfExists = (file, cb) => {
|
this.linkOSM = (callback) => {
|
||||||
fs.stat([this.osmData.osmFile, file].join('.'), (doesNotExistErr, exists) => {
|
fs.exists(this.inputCacheFile, (exists) => {
|
||||||
if (exists) rename(file, cb);
|
if (exists) callback();
|
||||||
else cb();
|
else {
|
||||||
});
|
fs.link(this.scenarioCacheFile, this.inputCacheFile, callback);
|
||||||
};
|
|
||||||
|
|
||||||
['osrm', 'osrm.ebg', 'osrm.edges', 'osrm.enw', 'osrm.fileIndex', 'osrm.geometry', 'osrm.icd',
|
|
||||||
'osrm.names', 'osrm.nodes', 'osrm.properties', 'osrm.ramIndex', 'osrm.restrictions', 'osrm.tld', 'osrm.tls'].forEach(file => {
|
|
||||||
q.defer(rename, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
['osrm.edge_penalties', 'osrm.edge_segment_lookup'].forEach(file => {
|
|
||||||
q.defer(renameIfExists, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll((err) => {
|
|
||||||
this.log('Finished extracting ' + this.osmData.extractedFile, 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
callback(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.contractData = (callback) => {
|
|
||||||
this.logPreprocessInfo();
|
|
||||||
this.log(util.format('== Contracting %s.osm...', this.osmData.extractedFile), 'preprocess');
|
|
||||||
var cmd = util.format('%s/osrm-contract %s %s.osrm >>%s 2>&1',
|
|
||||||
this.BIN_PATH, this.contractArgs || '', this.osmData.extractedFile, this.PREPROCESS_LOG_FILE);
|
|
||||||
this.log(cmd);
|
|
||||||
process.chdir(this.TEST_FOLDER);
|
|
||||||
exec(cmd, (err) => {
|
|
||||||
if (err) {
|
|
||||||
this.log(util.format('*** Exited with code %d', err.code), 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
return callback(this.ContractError(err.code, util.format('osrm-contract exited with code %d', err.code)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var rename = (file, cb) => {
|
|
||||||
this.log(util.format('Renaming %s.%s to %s.%s', this.osmData.extractedFile, file, this.osmData.contractedFile, file), 'preprocess');
|
|
||||||
fs.rename([this.osmData.extractedFile, file].join('.'), [this.osmData.contractedFile, file].join('.'), (err) => {
|
|
||||||
if (err) return cb(this.FileError(null, 'failed to rename data file after contracting.'));
|
|
||||||
cb();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var renameIfExists = (file, cb) => {
|
this.extractData = (p, callback) => {
|
||||||
fs.stat([this.osmData.extractedFile, file].join('.'), (doesNotExistErr, exists) => {
|
let stamp = p.processedCacheFile + '.extract';
|
||||||
if (exists) rename(file, cb);
|
fs.exists(stamp, (exists) => {
|
||||||
else cb();
|
if (exists) return callback();
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var copy = (file, cb) => {
|
this.runBin('osrm-extract', util.format('%s --profile %s %s', p.extractArgs, p.profileFile, p.inputCacheFile), p.environment, (err) => {
|
||||||
this.log(util.format('Copying %s.%s to %s.%s', this.osmData.extractedFile, file, this.osmData.contractedFile, file), 'preprocess');
|
if (err) {
|
||||||
fs.createReadStream([this.osmData.extractedFile, file].join('.'))
|
return callback(new Error(util.format('osrm-extract %s: %s', errorReason(err), err.cmd)));
|
||||||
.pipe(fs.createWriteStream([this.osmData.contractedFile, file].join('.'))
|
}
|
||||||
.on('finish', cb)
|
fs.writeFile(stamp, 'ok', callback);
|
||||||
)
|
|
||||||
.on('error', () => {
|
|
||||||
return cb(this.FileError(null, 'failed to copy data after contracting.'));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var q = d3.queue();
|
|
||||||
|
|
||||||
['osrm', 'osrm.core', 'osrm.datasource_indexes', 'osrm.datasource_names', 'osrm.ebg','osrm.edges',
|
|
||||||
'osrm.enw', 'osrm.fileIndex', 'osrm.geometry', 'osrm.hsgr', 'osrm.icd','osrm.level', 'osrm.names',
|
|
||||||
'osrm.nodes', 'osrm.properties', 'osrm.ramIndex', 'osrm.restrictions', 'osrm.tld', 'osrm.tls'].forEach((file) => {
|
|
||||||
q.defer(rename, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
['osrm.edge_penalties', 'osrm.edge_segment_lookup'].forEach(file => {
|
|
||||||
q.defer(renameIfExists, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
[].forEach((file) => {
|
|
||||||
q.defer(copy, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
q.awaitAll((err) => {
|
|
||||||
this.log('Finished contracting ' + this.osmData.contractedFile, 'preprocess');
|
|
||||||
process.chdir('../');
|
|
||||||
callback(err);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var noop = (cb) => cb();
|
this.contractData = (p, callback) => {
|
||||||
|
let stamp = p.processedCacheFile + '.contract';
|
||||||
|
fs.exists(stamp, (exists) => {
|
||||||
|
if (exists) return callback();
|
||||||
|
|
||||||
|
this.runBin('osrm-contract', util.format('%s %s', p.contractArgs, p.processedCacheFile), p.environment, (err) => {
|
||||||
|
if (err) {
|
||||||
|
return callback(new Error(util.format('osrm-contract %s: %s', errorReason(err), err)));
|
||||||
|
}
|
||||||
|
fs.writeFile(stamp, 'ok', callback);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.extractAndContract = (callback) => {
|
||||||
|
// a shallow copy of scenario parameters to avoid data inconsistency
|
||||||
|
// if a cucumber timeout occurs during deferred jobs
|
||||||
|
let p = {extractArgs: this.extractArgs, contractArgs: this.contractArgs,
|
||||||
|
profileFile: this.profileFile, inputCacheFile: this.inputCacheFile,
|
||||||
|
processedCacheFile: this.processedCacheFile, environment: this.environment};
|
||||||
|
let queue = d3.queue(1);
|
||||||
|
queue.defer(this.extractData.bind(this), p);
|
||||||
|
queue.defer(this.contractData.bind(this), p);
|
||||||
|
queue.awaitAll(callback);
|
||||||
|
};
|
||||||
|
|
||||||
this.reprocess = (callback) => {
|
this.reprocess = (callback) => {
|
||||||
this.osmData.populate(() => {
|
let queue = d3.queue(1);
|
||||||
this.isContracted((isContracted) => {
|
queue.defer(this.writeOSM.bind(this));
|
||||||
if (!isContracted) {
|
queue.defer(this.linkOSM.bind(this));
|
||||||
this.writeAndExtract((e) => {
|
queue.defer(this.extractAndContract.bind(this));
|
||||||
if (e) return callback(e);
|
queue.awaitAll(callback);
|
||||||
this.contractData((e) => {
|
|
||||||
if (e) return callback(e);
|
|
||||||
this.logPreprocessDone();
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.log('Already contracted ' + this.osmData.contractedFile, 'preprocess');
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.writeAndExtract = (callback) => {
|
|
||||||
this.writeInputData((e) => {
|
|
||||||
if (e) return callback(e);
|
|
||||||
this.isExtracted((isExtracted) => {
|
|
||||||
var extractFn = isExtracted ? noop : this.extractData;
|
|
||||||
if (isExtracted) this.log('Already extracted ' + this.osmData.extractedFile, 'preprocess');
|
|
||||||
extractFn((e) => {
|
|
||||||
callback(e);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.reprocessAndLoadData = (callback) => {
|
this.reprocessAndLoadData = (callback) => {
|
||||||
this.reprocess(() => {
|
let queue = d3.queue(1);
|
||||||
this.OSRMLoader.load(util.format('%s.osrm', this.osmData.contractedFile), callback);
|
queue.defer(this.writeOSM.bind(this));
|
||||||
});
|
queue.defer(this.linkOSM.bind(this));
|
||||||
|
queue.defer(this.extractAndContract.bind(this));
|
||||||
|
queue.defer(this.osrmLoader.load.bind(this.osrmLoader), this.processedCacheFile);
|
||||||
|
queue.awaitAll(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.processRowsAndDiff = (table, fn, callback) => {
|
this.processRowsAndDiff = (table, fn, callback) => {
|
||||||
@@ -351,7 +242,9 @@ module.exports = function () {
|
|||||||
|
|
||||||
q.awaitAll((err, actual) => {
|
q.awaitAll((err, actual) => {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
this.diffTables(table, actual, {}, callback);
|
let diff = tableDiff(table, actual);
|
||||||
|
if (diff) callback(new Error(diff));
|
||||||
|
else callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var util = require('util');
|
const util = require('util');
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Location: class {
|
Location: class {
|
||||||
@@ -11,43 +10,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
osmData: class {
|
|
||||||
constructor (scope) {
|
|
||||||
this.scope = scope;
|
|
||||||
this.str = null;
|
|
||||||
this.hash = null;
|
|
||||||
this.fingerprintOSM = null;
|
|
||||||
this.osmFile = null;
|
|
||||||
this.extractedFile = null;
|
|
||||||
this.contractedFile = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
populate (callback) {
|
|
||||||
this.scope.OSMDB.toXML((str) => {
|
|
||||||
this.str = str;
|
|
||||||
|
|
||||||
this.hash = this.scope.hashString(str);
|
|
||||||
this.fingerprintOSM = this.scope.hashString(this.hash);
|
|
||||||
|
|
||||||
this.osmFile = path.resolve(this.scope.DATA_FOLDER, this.fingerprintOSM);
|
|
||||||
|
|
||||||
this.extractedFile = path.resolve([this.osmFile, this.scope.fingerprintExtract].join('_'));
|
|
||||||
this.contractedFile = path.resolve([this.osmFile, this.scope.fingerprintExtract, this.scope.fingerprintContract].join('_'));
|
|
||||||
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
reset () {
|
|
||||||
this.str = null;
|
|
||||||
this.hash = null;
|
|
||||||
this.fingerprintOSM = null;
|
|
||||||
this.osmFile = null;
|
|
||||||
this.extractedFile = null;
|
|
||||||
this.contractedFile = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
FuzzyMatch: class {
|
FuzzyMatch: class {
|
||||||
match (got, want) {
|
match (got, want) {
|
||||||
var matchPercent = want.match(/(.*)\s+~(.+)%$/),
|
var matchPercent = want.match(/(.*)\s+~(.+)%$/),
|
||||||
@@ -145,8 +107,16 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
matchLocation (got, want) {
|
matchLocation (got, want) {
|
||||||
|
if (got == null || want == null) return false;
|
||||||
return this.match(got[0], util.format('%d ~0.0025%', want.lon)) &&
|
return this.match(got[0], util.format('%d ~0.0025%', want.lon)) &&
|
||||||
this.match(got[1], util.format('%d ~0.0025%', want.lat));
|
this.match(got[1], util.format('%d ~0.0025%', want.lat));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
matchCoordinate (got, want, zoom) {
|
||||||
|
if (got == null || want == null) return false;
|
||||||
|
return this.match(got.lon, util.format('%d +- %d', want.lon, 0.25*zoom)) &&
|
||||||
|
this.match(got.lat, util.format('%d +- %d', want.lat, 0.25*zoom));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+80
-46
@@ -1,32 +1,46 @@
|
|||||||
var path = require('path');
|
'use strict';
|
||||||
var util = require('util');
|
|
||||||
var fs = require('fs');
|
|
||||||
var exec = require('child_process').exec;
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const util = require('util');
|
||||||
|
const fs = require('fs');
|
||||||
|
const d3 = require('d3-queue');
|
||||||
|
const child_process = require('child_process');
|
||||||
|
const tryConnect = require('../lib/try_connect');
|
||||||
|
|
||||||
|
// Sets up all constants that are valid for all features
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.initializeEnv = (callback) => {
|
this.initializeEnv = (callback) => {
|
||||||
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
|
||||||
this.TIMEOUT = process.env.CUCUMBER_TIMEOUT && parseInt(process.env.CUCUMBER_TIMEOUT) || 5000;
|
this.TIMEOUT = process.env.CUCUMBER_TIMEOUT && parseInt(process.env.CUCUMBER_TIMEOUT) || 5000;
|
||||||
|
// set cucumber default timeout
|
||||||
this.setDefaultTimeout(this.TIMEOUT);
|
this.setDefaultTimeout(this.TIMEOUT);
|
||||||
this.ROOT_FOLDER = process.cwd();
|
this.ROOT_PATH = process.cwd();
|
||||||
|
|
||||||
|
this.TEST_PATH = path.resolve(this.ROOT_PATH, 'test');
|
||||||
|
this.CACHE_PATH = path.resolve(this.TEST_PATH, 'cache');
|
||||||
|
this.LOGS_PATH = path.resolve(this.TEST_PATH, 'logs');
|
||||||
|
|
||||||
|
this.PROFILES_PATH = path.resolve(this.ROOT_PATH, 'profiles');
|
||||||
|
this.FIXTURES_PATH = path.resolve(this.ROOT_PATH, 'unit_tests/fixtures');
|
||||||
|
this.BIN_PATH = process.env.OSRM_BUILD_DIR && process.env.OSRM_BUILD_DIR || path.resolve(this.ROOT_PATH, 'build');
|
||||||
|
var stxxl_config = path.resolve(this.ROOT_PATH, 'test/.stxxl');
|
||||||
|
if (!fs.existsSync(stxxl_config)) {
|
||||||
|
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
||||||
|
this.DEFAULT_PROFILE = 'bicycle';
|
||||||
|
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||||
|
this.DEFAULT_LOAD_METHOD = 'datastore';
|
||||||
|
this.DEFAULT_ORIGIN = [1,1];
|
||||||
this.OSM_USER = 'osrm';
|
this.OSM_USER = 'osrm';
|
||||||
this.OSM_GENERATOR = 'osrm-test';
|
this.OSM_GENERATOR = 'osrm-test';
|
||||||
this.OSM_UID = 1;
|
this.OSM_UID = 1;
|
||||||
this.TEST_FOLDER = path.resolve(this.ROOT_FOLDER, 'test');
|
|
||||||
this.DATA_FOLDER = path.resolve(this.TEST_FOLDER, 'cache');
|
|
||||||
this.OSM_TIMESTAMP = '2000-01-01T00:00:00Z';
|
this.OSM_TIMESTAMP = '2000-01-01T00:00:00Z';
|
||||||
this.DEFAULT_SPEEDPROFILE = 'bicycle';
|
|
||||||
this.WAY_SPACING = 100;
|
this.WAY_SPACING = 100;
|
||||||
this.DEFAULT_GRID_SIZE = 100; // meters
|
this.DEFAULT_GRID_SIZE = 100; // meters
|
||||||
this.PROFILES_PATH = path.resolve(this.ROOT_FOLDER, 'profiles');
|
|
||||||
this.FIXTURES_PATH = path.resolve(this.ROOT_FOLDER, 'unit_tests/fixtures');
|
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
|
||||||
this.BIN_PATH = process.env.OSRM_BUILD_DIR && process.env.OSRM_BUILD_DIR || path.resolve(this.ROOT_FOLDER, 'build');
|
this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT;
|
||||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
|
||||||
this.DEFAULT_ORIGIN = [1,1];
|
|
||||||
this.DEFAULT_LOAD_METHOD = 'datastore';
|
|
||||||
this.OSRM_ROUTED_LOG_FILE = path.resolve(this.TEST_FOLDER, 'osrm-routed.log');
|
|
||||||
this.ERROR_LOG_FILE = path.resolve(this.TEST_FOLDER, 'error.log');
|
|
||||||
|
|
||||||
// TODO make sure this works on win
|
// TODO make sure this works on win
|
||||||
if (process.platform.match(/indows.*/)) {
|
if (process.platform.match(/indows.*/)) {
|
||||||
@@ -37,36 +51,67 @@ module.exports = function () {
|
|||||||
} else {
|
} else {
|
||||||
this.TERMSIGNAL = 'SIGTERM';
|
this.TERMSIGNAL = 'SIGTERM';
|
||||||
this.EXE = '';
|
this.EXE = '';
|
||||||
|
|
||||||
|
// heuristically detect .so/.a suffix
|
||||||
|
this.LIB = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
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*/ }
|
||||||
|
|
||||||
|
try {
|
||||||
|
const dot_so = util.format('%s/libosrm%s', this.BIN_PATH, '.so');
|
||||||
|
fs.accessSync(dot_so, fs.F_OK);
|
||||||
this.LIB = '.so';
|
this.LIB = '.so';
|
||||||
|
} catch(e) { /*nop*/ }
|
||||||
|
|
||||||
|
if (!this.LIB) {
|
||||||
|
throw new Error('*** Unable to detect dynamic or static libosrm libraries');
|
||||||
|
}
|
||||||
|
|
||||||
this.QQ = '';
|
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/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
|
// eslint-disable-next-line no-console
|
||||||
console.info(util.format('Node Version', process.version));
|
console.info(util.format('Node Version', process.version));
|
||||||
if (parseInt(process.version.match(/v(\d)/)[1]) < 4) throw new Error('*** PLease upgrade to Node 4.+ to run OSRM cucumber tests');
|
if (parseInt(process.version.match(/v(\d)/)[1]) < 4) throw new Error('*** Please upgrade to Node 4.+ to run OSRM cucumber tests');
|
||||||
|
|
||||||
fs.exists(this.TEST_FOLDER, (exists) => {
|
fs.exists(this.TEST_PATH, (exists) => {
|
||||||
if (!exists) throw new Error(util.format('*** Test folder %s doesn\'t exist.', this.TEST_FOLDER));
|
if (exists)
|
||||||
callback();
|
return callback();
|
||||||
|
else
|
||||||
|
return callback(new Error('*** Test folder doesn\'t exist.'));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.verifyOSRMIsNotRunning = () => {
|
this.getProfilePath = (profile) => {
|
||||||
if (this.OSRMLoader.up()) {
|
return path.resolve(this.PROFILES_PATH, profile + '.lua');
|
||||||
throw new Error('*** osrm-routed is already running.');
|
};
|
||||||
}
|
|
||||||
|
this.verifyOSRMIsNotRunning = (callback) => {
|
||||||
|
tryConnect(this.OSRM_PORT, (err) => {
|
||||||
|
if (!err) return callback(new Error('*** osrm-routed is already running.'));
|
||||||
|
else callback();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.verifyExistenceOfBinaries = (callback) => {
|
this.verifyExistenceOfBinaries = (callback) => {
|
||||||
var verify = (bin, cb) => {
|
var verify = (binPath, cb) => {
|
||||||
var binPath = path.resolve(util.format('%s/%s%s', this.BIN_PATH, bin, this.EXE));
|
|
||||||
fs.exists(binPath, (exists) => {
|
fs.exists(binPath, (exists) => {
|
||||||
if (!exists) throw new Error(util.format('%s is missing. Build failed?', binPath));
|
if (!exists) return cb(new Error(util.format('%s is missing. Build failed?', binPath)));
|
||||||
var helpPath = util.format('%s --help > /dev/null 2>&1', binPath);
|
var helpPath = util.format('%s --help > /dev/null 2>&1', binPath);
|
||||||
exec(helpPath, (err) => {
|
child_process.exec(helpPath, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
this.log(util.format('*** Exited with code %d', err.code), 'preprocess');
|
return cb(new Error(util.format('*** %s exited with code %d', helpPath, err.code)));
|
||||||
throw new Error(util.format('*** %s exited with code %d', helpPath, err.code));
|
|
||||||
}
|
}
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
@@ -74,23 +119,12 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var q = d3.queue();
|
var q = d3.queue();
|
||||||
['osrm-extract', 'osrm-contract', 'osrm-routed'].forEach(bin => { q.defer(verify, bin); });
|
[this.OSRM_EXTRACT_PATH, this.OSRM_CONTRACT_PATH, this.OSRM_ROUTED_PATH].forEach(bin => { q.defer(verify, bin); });
|
||||||
q.awaitAll(() => {
|
q.awaitAll(callback);
|
||||||
callback();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.AfterConfiguration = (callback) => {
|
|
||||||
this.clearLogFiles(() => {
|
|
||||||
this.verifyOSRMIsNotRunning();
|
|
||||||
this.verifyExistenceOfBinaries(() => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
process.on('exit', () => {
|
process.on('exit', () => {
|
||||||
if (this.OSRMLoader.loader) this.OSRMLoader.shutdown(() => {});
|
this.osrmLoader.shutdown(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('SIGINT', () => {
|
process.on('SIGINT', () => {
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
var util = require('util');
|
|
||||||
var path = require('path');
|
|
||||||
var fs = require('fs');
|
|
||||||
var chalk = require('chalk');
|
|
||||||
|
|
||||||
var OSRMError = class extends Error {
|
|
||||||
constructor (process, code, msg, log, lines) {
|
|
||||||
super(msg);
|
|
||||||
this.process = process;
|
|
||||||
this.code = code;
|
|
||||||
this.msg = msg;
|
|
||||||
this.lines = lines;
|
|
||||||
this.log = log;
|
|
||||||
}
|
|
||||||
|
|
||||||
extract (callback) {
|
|
||||||
this.logTail(this.log, this.lines, callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
// toString (callback) {
|
|
||||||
// this.extract((tail) => {
|
|
||||||
// callback(util.format('*** %s\nLast %s from %s:\n%s\n', this.msg, this.lines, this.log, tail));
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
logTail (logPath, n, callback) {
|
|
||||||
var expanded = path.resolve(this.TEST_FOLDER, logPath);
|
|
||||||
fs.exists(expanded, (exists) => {
|
|
||||||
if (exists) {
|
|
||||||
fs.readFile(expanded, (err, data) => {
|
|
||||||
var lines = data.toString().trim().split('\n');
|
|
||||||
callback(lines
|
|
||||||
.slice(lines.length - n)
|
|
||||||
.map(line => util.format(' %s', line))
|
|
||||||
.join('\n'));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
callback(util.format('File %s does not exist!', expanded));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var unescapeStr = (str) => str.replace(/\\\|/g, '\|').replace(/\\\\/g, '\\');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
OSRMError: OSRMError,
|
|
||||||
|
|
||||||
FileError: class extends OSRMError {
|
|
||||||
constructor (logFile, code, msg) {
|
|
||||||
super ('fileutil', code, msg, logFile, 5);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
LaunchError: class extends OSRMError {
|
|
||||||
constructor (logFile, launchProcess, code, msg) {
|
|
||||||
super (launchProcess, code, msg, logFile, 5);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
ExtractError: class extends OSRMError {
|
|
||||||
constructor (logFile, code, msg) {
|
|
||||||
super('osrm-extract', code, msg, logFile, 3);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
ContractError: class extends OSRMError {
|
|
||||||
constructor (logFile, code, msg) {
|
|
||||||
super('osrm-contract', code, msg, logFile, 3);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
RoutedError: class extends OSRMError {
|
|
||||||
constructor (logFile, msg) {
|
|
||||||
super('osrm-routed', null, msg, logFile, 3);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
TableDiffError: class extends Error {
|
|
||||||
constructor (expected, actual) {
|
|
||||||
super();
|
|
||||||
this.headers = expected.raw()[0];
|
|
||||||
this.expected = expected.hashes();
|
|
||||||
this.actual = actual;
|
|
||||||
this.diff = [];
|
|
||||||
this.hasErrors = false;
|
|
||||||
|
|
||||||
var good = 0, bad = 0;
|
|
||||||
|
|
||||||
this.expected.forEach((row, i) => {
|
|
||||||
var rowError = false;
|
|
||||||
|
|
||||||
for (var j in row) {
|
|
||||||
if (unescapeStr(row[j]) != actual[i][j]) {
|
|
||||||
rowError = true;
|
|
||||||
this.hasErrors = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rowError) {
|
|
||||||
bad++;
|
|
||||||
this.diff.push(Object.assign({}, row, {c_status: 'undefined'}));
|
|
||||||
this.diff.push(Object.assign({}, actual[i], {c_status: 'comment'}));
|
|
||||||
} else {
|
|
||||||
good++;
|
|
||||||
this.diff.push(row);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
get string () {
|
|
||||||
if (!this.hasErrors) return null;
|
|
||||||
|
|
||||||
var s = ['Tables were not identical:'];
|
|
||||||
s.push(this.headers.map(key => ' ' + key).join(' | '));
|
|
||||||
this.diff.forEach((row) => {
|
|
||||||
var rowString = '| ';
|
|
||||||
this.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';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
var exceptions = require('./exception_classes');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.OSRMError = exceptions.OSRMError,
|
|
||||||
|
|
||||||
this.FileError = (code, msg) => new (exceptions.FileError.bind(exceptions.FileError, this.PREPROCESS_LOG_FILE))(code, msg);
|
|
||||||
|
|
||||||
this.LaunchError = (code, launchProcess, msg) => new (exceptions.LaunchError.bind(exceptions.LaunchError, this.ERROR_LOG_FILE))(code, launchProcess, msg);
|
|
||||||
|
|
||||||
this.ExtractError = (code, msg) => new (exceptions.ExtractError.bind(exceptions.ExtractError, this.PREPROCESS_LOG_FILE))(code, msg);
|
|
||||||
|
|
||||||
this.ContractError = (code, msg) => new (exceptions.ContractError.bind(exceptions.ContractError, this.PREPROCESS_LOG_FILE))(code, msg);
|
|
||||||
|
|
||||||
this.RoutedError = (msg) => new (exceptions.RoutedError.bind(exceptions.RoutedError, this.OSRM_ROUTED_LOG_FILE))(msg);
|
|
||||||
};
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var path = require('path');
|
|
||||||
var crypto = require('crypto');
|
|
||||||
var d3 = require('d3-queue');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.hashOfFiles = (paths, cb) => {
|
|
||||||
paths = Array.isArray(paths) ? paths : [paths];
|
|
||||||
var shasum = crypto.createHash('sha1'), hashedFiles = false;
|
|
||||||
|
|
||||||
var q = d3.queue(1);
|
|
||||||
|
|
||||||
var addFile = (path, cb) => {
|
|
||||||
fs.readFile(path, (err, data) => {
|
|
||||||
if (err && err.code === 'ENOENT') cb(); // ignore non-existing files
|
|
||||||
else if (err) cb(err);
|
|
||||||
else {
|
|
||||||
shasum.update(data);
|
|
||||||
hashedFiles = true;
|
|
||||||
cb();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
paths.forEach(path => { q.defer(addFile, path); });
|
|
||||||
|
|
||||||
q.awaitAll(err => {
|
|
||||||
if (err) throw new Error('*** Error reading files:', err);
|
|
||||||
if (!hashedFiles) throw new Error('*** No files found: [' + paths.join(', ') + ']');
|
|
||||||
cb(shasum.digest('hex'));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.hashProfile = (cb) => {
|
|
||||||
this.hashOfFiles(path.resolve(this.PROFILES_PATH, this.profile + '.lua'), cb);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.hashString = (str) => {
|
|
||||||
return crypto.createHash('sha1').update(str).digest('hex');
|
|
||||||
};
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
+50
-25
@@ -1,36 +1,61 @@
|
|||||||
var util = require('util');
|
'use strict';
|
||||||
|
|
||||||
|
var d3 = require('d3-queue');
|
||||||
|
var path = require('path');
|
||||||
|
var mkdirp = require('mkdirp');
|
||||||
|
var rimraf = require('rimraf');
|
||||||
|
var OSM = require('../lib/osm');
|
||||||
|
var OSRMLoader = require('../lib/osrm_loader');
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.BeforeFeatures((features, callback) => {
|
this.registerHandler('BeforeFeatures', {timeout: 30000}, (features, callback) => {
|
||||||
this.pid = null;
|
this.osrmLoader = new OSRMLoader(this);
|
||||||
this.initializeEnv(() => {
|
this.OSMDB = new OSM.DB();
|
||||||
this.initializeOptions(callback);
|
|
||||||
});
|
let queue = d3.queue(1);
|
||||||
|
queue.defer(this.initializeEnv.bind(this));
|
||||||
|
queue.defer(this.verifyOSRMIsNotRunning.bind(this));
|
||||||
|
queue.defer(this.verifyExistenceOfBinaries.bind(this));
|
||||||
|
queue.defer(this.initializeCache.bind(this));
|
||||||
|
queue.defer(this.setupFeatures.bind(this, features));
|
||||||
|
queue.awaitAll(callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Before((scenario, callback) => {
|
this.BeforeFeature((feature, callback) => {
|
||||||
this.scenarioTitle = scenario.getName();
|
this.profile = this.DEFAULT_PROFILE;
|
||||||
|
this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
|
||||||
this.loadMethod = this.DEFAULT_LOAD_METHOD;
|
this.setupFeatureCache(feature);
|
||||||
this.queryParams = {};
|
|
||||||
var d = new Date();
|
|
||||||
this.scenarioTime = util.format('%d-%d-%dT%s:%s:%sZ', d.getFullYear(), d.getMonth()+1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds());
|
|
||||||
this.resetData();
|
|
||||||
this.hasLoggedPreprocessInfo = false;
|
|
||||||
this.hasLoggedScenarioInfo = false;
|
|
||||||
this.setGridSize(this.DEFAULT_GRID_SIZE);
|
|
||||||
this.setOrigin(this.DEFAULT_ORIGIN);
|
|
||||||
this.fingerprintExtract = this.hashString([this.luaLibHash, this.binExtractHash].join('-'));
|
|
||||||
this.fingerprintContract = this.hashString(this.binContractHash);
|
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.Before((scenario, callback) => {
|
||||||
|
this.osrmLoader.setLoadMethod(this.DEFAULT_LOAD_METHOD);
|
||||||
|
this.setGridSize(this.DEFAULT_GRID_SIZE);
|
||||||
|
this.setOrigin(this.DEFAULT_ORIGIN);
|
||||||
|
this.queryParams = {};
|
||||||
|
this.extractArgs = '';
|
||||||
|
this.contractArgs = '';
|
||||||
|
this.environment = Object.assign(this.DEFAULT_ENVIRONMENT);
|
||||||
|
this.resetOSM();
|
||||||
|
|
||||||
|
this.scenarioID = this.getScenarioID(scenario);
|
||||||
|
this.setupScenarioCache(this.scenarioID);
|
||||||
|
|
||||||
|
// setup output logging
|
||||||
|
let logDir = path.join(this.LOGS_PATH, this.featureID);
|
||||||
|
this.scenarioLogFile = path.join(logDir, this.scenarioID) + '.log';
|
||||||
|
d3.queue(1)
|
||||||
|
.defer(mkdirp, logDir)
|
||||||
|
.defer(rimraf, this.scenarioLogFile)
|
||||||
|
.awaitAll(callback);
|
||||||
|
});
|
||||||
|
|
||||||
this.After((scenario, callback) => {
|
this.After((scenario, callback) => {
|
||||||
this.setExtractArgs('', () => {
|
this.resetOptionsOutput();
|
||||||
this.setContractArgs('', () => {
|
callback();
|
||||||
if (this.loadMethod === 'directly' && !!this.OSRMLoader.loader) this.OSRMLoader.shutdown(callback);
|
|
||||||
else callback();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.AfterFeatures((features, callback) => {
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ module.exports = function () {
|
|||||||
return paramString;
|
return paramString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// FIXME this needs to be simplified!
|
||||||
|
// - remove usage of node-timeout
|
||||||
|
// - replace with node's native timout mechanism
|
||||||
this.sendRequest = (baseUri, parameters, callback) => {
|
this.sendRequest = (baseUri, parameters, callback) => {
|
||||||
var limit = Timeout(this.TIMEOUT, { err: { statusCode: 408 } });
|
var limit = Timeout(this.TIMEOUT, { err: { statusCode: 408 } });
|
||||||
|
|
||||||
@@ -28,9 +31,9 @@ module.exports = function () {
|
|||||||
|
|
||||||
request(this.query, (err, res, body) => {
|
request(this.query, (err, res, body) => {
|
||||||
if (err && err.code === 'ECONNREFUSED') {
|
if (err && err.code === 'ECONNREFUSED') {
|
||||||
throw new Error('*** osrm-routed is not running.');
|
return cb(new Error('*** osrm-routed is not running.'));
|
||||||
} else if (err && err.statusCode === 408) {
|
} else if (err && err.statusCode === 408) {
|
||||||
throw new Error();
|
return cb(new Error());
|
||||||
}
|
}
|
||||||
|
|
||||||
return cb(err, res, body);
|
return cb(err, res, body);
|
||||||
@@ -40,11 +43,10 @@ module.exports = function () {
|
|||||||
runRequest(limit((err, res, body) => {
|
runRequest(limit((err, res, body) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.statusCode === 408)
|
if (err.statusCode === 408)
|
||||||
return callback(this.RoutedError('*** osrm-routed did not respond'));
|
return callback(new Error('*** osrm-routed did not respond'));
|
||||||
else if (err.code === 'ECONNREFUSED')
|
else if (err.code === 'ECONNREFUSED')
|
||||||
return callback(this.RoutedError('*** osrm-routed is not running'));
|
return callback(new Error('*** osrm-routed is not running'));
|
||||||
}
|
}
|
||||||
//console.log(body+"\n");
|
|
||||||
return callback(err, res, body);
|
return callback(err, res, body);
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
var launchClasses = require('./launch_classes');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this._OSRMLoader = () => new (launchClasses._OSRMLoader.bind(launchClasses._OSRMLoader, this))();
|
|
||||||
};
|
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
var fs = require('fs');
|
|
||||||
var spawn = require('child_process').spawn;
|
|
||||||
var util = require('util');
|
|
||||||
var net = require('net');
|
|
||||||
var Timeout = require('node-timeout');
|
|
||||||
|
|
||||||
var OSRMBaseLoader = class {
|
|
||||||
constructor (scope) {
|
|
||||||
this.scope = scope;
|
|
||||||
}
|
|
||||||
|
|
||||||
launch (callback) {
|
|
||||||
var limit = Timeout(this.scope.TIMEOUT, { err: this.scope.RoutedError('Launching osrm-routed timed out.') });
|
|
||||||
|
|
||||||
var runLaunch = (cb) => {
|
|
||||||
this.osrmUp(() => { this.waitForConnection(cb); });
|
|
||||||
};
|
|
||||||
|
|
||||||
runLaunch(limit((e) => { if (e) callback(e); else callback(); }));
|
|
||||||
}
|
|
||||||
|
|
||||||
shutdown (callback) {
|
|
||||||
var limit = Timeout(this.scope.TIMEOUT, { err: this.scope.RoutedError('Shutting down osrm-routed timed out.')});
|
|
||||||
|
|
||||||
var runShutdown = (cb) => {
|
|
||||||
this.osrmDown(cb);
|
|
||||||
};
|
|
||||||
|
|
||||||
runShutdown(limit((e) => { if (e) callback(e); else callback(); }));
|
|
||||||
}
|
|
||||||
|
|
||||||
osrmIsRunning () {
|
|
||||||
return !!this.scope.pid && this.child && !this.child.killed;
|
|
||||||
}
|
|
||||||
|
|
||||||
osrmDown (callback) {
|
|
||||||
if (this.scope.pid) {
|
|
||||||
process.kill(this.scope.pid, this.scope.TERMSIGNAL);
|
|
||||||
this.waitForShutdown(callback);
|
|
||||||
this.scope.pid = null;
|
|
||||||
} else callback(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
waitForConnection (callback) {
|
|
||||||
var retryCount = 0;
|
|
||||||
var connectWithRetry = () => {
|
|
||||||
net.connect({ port: this.scope.OSRM_PORT, host: '127.0.0.1' })
|
|
||||||
.on('connect', () => { callback(); })
|
|
||||||
.on('error', () => {
|
|
||||||
if (retryCount < 2) {
|
|
||||||
retryCount++;
|
|
||||||
setTimeout(connectWithRetry, 100);
|
|
||||||
} else {
|
|
||||||
callback(new Error('Could not connect to osrm-routed after three retires'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
connectWithRetry();
|
|
||||||
}
|
|
||||||
|
|
||||||
waitForShutdown (callback) {
|
|
||||||
var check = () => {
|
|
||||||
if (!this.osrmIsRunning()) return callback();
|
|
||||||
};
|
|
||||||
setTimeout(check, 100);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var OSRMDirectLoader = class extends OSRMBaseLoader {
|
|
||||||
constructor (scope) {
|
|
||||||
super(scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
load (inputFile, callback) {
|
|
||||||
this.inputFile = inputFile;
|
|
||||||
this.shutdown(() => {
|
|
||||||
this.launch(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
osrmUp (callback) {
|
|
||||||
if (this.scope.pid) return callback();
|
|
||||||
var writeToLog = (data) => {
|
|
||||||
fs.appendFile(this.scope.OSRM_ROUTED_LOG_FILE, data, (err) => { if (err) throw err; });
|
|
||||||
};
|
|
||||||
|
|
||||||
var child = spawn(util.format('%s/osrm-routed', this.scope.BIN_PATH), [this.inputFile, util.format('-p%d', this.scope.OSRM_PORT)]);
|
|
||||||
this.scope.pid = child.pid;
|
|
||||||
child.stdout.on('data', writeToLog);
|
|
||||||
child.stderr.on('data', writeToLog);
|
|
||||||
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var OSRMDatastoreLoader = class extends OSRMBaseLoader {
|
|
||||||
constructor (scope) {
|
|
||||||
super(scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
load (inputFile, callback) {
|
|
||||||
this.inputFile = inputFile;
|
|
||||||
this.loadData((err) => {
|
|
||||||
if (err) return callback(err);
|
|
||||||
if (!this.scope.pid) return this.launch(callback);
|
|
||||||
else callback();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
loadData (callback) {
|
|
||||||
this.scope.runBin('osrm-datastore', this.inputFile, (err) => {
|
|
||||||
if (err) return callback(this.scope.LaunchError(this.exitCode, 'datastore', err));
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
osrmUp (callback) {
|
|
||||||
if (this.scope.pid) return callback();
|
|
||||||
var writeToLog = (data) => {
|
|
||||||
fs.appendFile(this.scope.OSRM_ROUTED_LOG_FILE, data, (err) => { if (err) throw err; });
|
|
||||||
};
|
|
||||||
|
|
||||||
var child = spawn(util.format('%s/osrm-routed', this.scope.BIN_PATH), ['--shared-memory=1', util.format('-p%d', this.scope.OSRM_PORT)]);
|
|
||||||
this.child = child;
|
|
||||||
this.scope.pid = child.pid;
|
|
||||||
child.stdout.on('data', writeToLog);
|
|
||||||
child.stderr.on('data', writeToLog);
|
|
||||||
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
_OSRMLoader: class {
|
|
||||||
constructor (scope) {
|
|
||||||
this.scope = scope;
|
|
||||||
this.loader = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
load (inputFile, callback) {
|
|
||||||
var method = this.scope.loadMethod;
|
|
||||||
if (method === 'datastore') {
|
|
||||||
this.loader = new OSRMDatastoreLoader(this.scope);
|
|
||||||
this.loader.load(inputFile, callback);
|
|
||||||
} else if (method === 'directly') {
|
|
||||||
this.loader = new OSRMDirectLoader(this.scope);
|
|
||||||
this.loader.load(inputFile, callback);
|
|
||||||
} else {
|
|
||||||
callback(new Error('*** Unknown load method ' + method));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shutdown (callback) {
|
|
||||||
this.loader.shutdown(callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
up () {
|
|
||||||
return this.loader ? this.loader.osrmIsRunning() : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.clearLogFiles = (callback) => {
|
|
||||||
// emptying existing files, rather than deleting and writing new ones makes it
|
|
||||||
// easier to use tail -f from the command line
|
|
||||||
fs.writeFile(this.OSRM_ROUTED_LOG_FILE, '', err => {
|
|
||||||
if (err) throw err;
|
|
||||||
fs.writeFile(this.PREPROCESS_LOG_FILE, '', err => {
|
|
||||||
if (err) throw err;
|
|
||||||
fs.writeFile(this.LOG_FILE, '', err => {
|
|
||||||
if (err) throw err;
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var log = this.log = (s, type) => {
|
|
||||||
s = s || '';
|
|
||||||
type = type || null;
|
|
||||||
var file = type === 'preprocess' ? this.PREPROCESS_LOG_FILE : this.LOG_FILE;
|
|
||||||
fs.appendFile(file, s + '\n', err => {
|
|
||||||
if (err) throw err;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.logScenarioFailInfo = () => {
|
|
||||||
if (this.hasLoggedScenarioInfo) return;
|
|
||||||
|
|
||||||
log('=========================================');
|
|
||||||
log('Failed scenario: ' + this.scenarioTitle);
|
|
||||||
log('Time: ' + this.scenarioTime);
|
|
||||||
log('Fingerprint osm stage: ' + this.osmData.fingerprintOSM);
|
|
||||||
log('Fingerprint extract stage: ' + this.fingerprintExtract);
|
|
||||||
log('Fingerprint contract stage: ' + this.fingerprintContract);
|
|
||||||
log('Fingerprint route stage: ' + this.fingerprintRoute);
|
|
||||||
log('Profile: ' + this.profile);
|
|
||||||
log();
|
|
||||||
log('```xml'); // so output can be posted directly to github comment fields
|
|
||||||
log(this.osmData.str.trim());
|
|
||||||
log('```');
|
|
||||||
log();
|
|
||||||
log();
|
|
||||||
|
|
||||||
this.hasLoggedScenarioInfo = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.logFail = (expected, got, attempts) => {
|
|
||||||
this.logScenarioFailInfo();
|
|
||||||
log('== ');
|
|
||||||
log('Expected: ' + JSON.stringify(expected));
|
|
||||||
log('Got: ' + JSON.stringify(got));
|
|
||||||
log();
|
|
||||||
['route','forw','backw'].forEach((direction) => {
|
|
||||||
if (attempts[direction]) {
|
|
||||||
log('Direction: ' + direction);
|
|
||||||
log('Query: ' + attempts[direction].query);
|
|
||||||
log('Response: ' + attempts[direction].response.body);
|
|
||||||
log();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.logPreprocessInfo = () => {
|
|
||||||
if (this.hasLoggedPreprocessInfo) return;
|
|
||||||
log('=========================================', 'preprocess');
|
|
||||||
log('Preprocessing data for scenario: ' + this.scenarioTitle, 'preprocess');
|
|
||||||
log('Time: ' + this.scenarioTime, 'preprocess');
|
|
||||||
log('', 'preprocess');
|
|
||||||
log('== OSM data:', 'preprocess');
|
|
||||||
log('```xml', 'preprocess'); // so output can be posted directly to github comment fields
|
|
||||||
log(this.osmData.str, 'preprocess');
|
|
||||||
log('```', 'preprocess');
|
|
||||||
log('', 'preprocess');
|
|
||||||
log('== Profile:', 'preprocess');
|
|
||||||
log(this.profile, 'preprocess');
|
|
||||||
log('', 'preprocess');
|
|
||||||
this.hasLoggedPreprocessInfo = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.logPreprocess = (str) => {
|
|
||||||
this.logPreprocessInfo();
|
|
||||||
log(str, 'preprocess');
|
|
||||||
};
|
|
||||||
|
|
||||||
this.logPreprocessDone = () => {
|
|
||||||
log('Done with preprocessing at ' + new Date(), 'preprocess');
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var Timeout = require('node-timeout');
|
const Timeout = require('node-timeout');
|
||||||
var request = require('request');
|
const request = require('request');
|
||||||
|
const ensureDecimal = require('../lib/utils').ensureDecimal;
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.requestPath = (service, params, callback) => {
|
this.requestPath = (service, params, callback) => {
|
||||||
@@ -42,7 +43,7 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var encodeWaypoints = (waypoints) => {
|
var encodeWaypoints = (waypoints) => {
|
||||||
return waypoints.map(w => [w.lon, w.lat].map(this.ensureDecimal).join(','));
|
return waypoints.map(w => [w.lon, w.lat].map(ensureDecimal).join(','));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.requestRoute = (waypoints, bearings, userParams, callback) => {
|
this.requestRoute = (waypoints, bearings, userParams, callback) => {
|
||||||
@@ -131,7 +132,7 @@ module.exports = function () {
|
|||||||
|
|
||||||
this.summary = (instructions) => {
|
this.summary = (instructions) => {
|
||||||
if (instructions) {
|
if (instructions) {
|
||||||
return instructions.legs.map(l => l.summary).join(',');
|
return instructions.legs.map(l => l.summary).join(';');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,6 +140,10 @@ module.exports = function () {
|
|||||||
return this.extractInstructionList(instructions, s => s.name);
|
return this.extractInstructionList(instructions, s => s.name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.refList = (instructions) => {
|
||||||
|
return this.extractInstructionList(instructions, s => s.ref || '');
|
||||||
|
};
|
||||||
|
|
||||||
this.pronunciationList = (instructions) => {
|
this.pronunciationList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, s => s.pronunciation || '');
|
return this.extractInstructionList(instructions, s => s.pronunciation || '');
|
||||||
};
|
};
|
||||||
@@ -152,15 +157,15 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.annotationList = (instructions) => {
|
this.annotationList = (instructions) => {
|
||||||
function zip(list_1, list_2)
|
function zip(list_1, list_2, list_3)
|
||||||
{
|
{
|
||||||
let pairs = [];
|
let tuples = [];
|
||||||
for (let i = 0; i < list_1.length; ++i) {
|
for (let i = 0; i < list_1.length; ++i) {
|
||||||
pairs.push([list_1[i], list_2[i]]);
|
tuples.push([list_1[i], list_2[i], list_3[i]]);
|
||||||
}
|
}
|
||||||
return pairs;
|
return tuples;
|
||||||
}
|
}
|
||||||
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance).map(p => { return p.join(':'); }).join(','); }).join(',');
|
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
|
||||||
};
|
};
|
||||||
|
|
||||||
this.OSMIDList = (instructions) => {
|
this.OSMIDList = (instructions) => {
|
||||||
@@ -206,6 +211,14 @@ module.exports = function () {
|
|||||||
.join(',');
|
.join(',');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.locations = (instructions) => {
|
||||||
|
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
|
||||||
|
.map(v => {
|
||||||
|
return this.findNodeByLocation(v.maneuver.location);
|
||||||
|
})
|
||||||
|
.join(',');
|
||||||
|
};
|
||||||
|
|
||||||
this.intersectionList = (instructions) => {
|
this.intersectionList = (instructions) => {
|
||||||
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
|
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
|
||||||
.map( v => {
|
.map( v => {
|
||||||
|
|||||||
+42
-30
@@ -1,40 +1,52 @@
|
|||||||
var fs = require('fs');
|
'use strict';
|
||||||
var util = require('util');
|
|
||||||
var exec = require('child_process').exec;
|
const fs = require('fs');
|
||||||
|
const util = require('util');
|
||||||
|
const child_process = require('child_process');
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
this.runBin = (bin, options, callback) => {
|
// replaces placeholders for in user supplied commands
|
||||||
var opts = options.slice();
|
this.expandOptions = (options) => {
|
||||||
|
let opts = options.slice();
|
||||||
|
let table = {
|
||||||
|
'{osm_file}': this.inputCacheFile,
|
||||||
|
'{processed_file}': this.processedCacheFile,
|
||||||
|
'{profile_file}': this.profileFile,
|
||||||
|
'{rastersource_file}': this.rasterCacheFile,
|
||||||
|
'{speeds_file}': this.speedsCacheFile,
|
||||||
|
'{penalties_file}': this.penaltiesCacheFile
|
||||||
|
};
|
||||||
|
|
||||||
if (opts.match('{osm_base}')) {
|
for (let k in table) {
|
||||||
if (!this.osmData.osmFile) throw new Error('*** {osm_base} is missing');
|
opts = opts.replace(k, table[k]);
|
||||||
opts = opts.replace('{osm_base}', this.osmData.osmFile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.match('{extracted_base}')) {
|
return opts;
|
||||||
if (!this.osmData.extractedFile) throw new Error('*** {extracted_base} is missing');
|
};
|
||||||
opts = opts.replace('{extracted_base}', this.osmData.extractedFile);
|
|
||||||
|
this.setupOutputLog = (process, log) => {
|
||||||
|
if (process.logFunc) {
|
||||||
|
process.stdout.removeListener('data', process.logFunc);
|
||||||
|
process.stderr.removeListener('data', process.logFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.match('{contracted_base}')) {
|
process.logFunc = (message) => { log.write(message); };
|
||||||
if (!this.osmData.contractedFile) throw new Error('*** {contracted_base} is missing');
|
process.stdout.on('data', process.logFunc);
|
||||||
opts = opts.replace('{contracted_base}', this.osmData.contractedFile);
|
process.stderr.on('data', process.logFunc);
|
||||||
}
|
};
|
||||||
|
|
||||||
if (opts.match('{profile}')) {
|
this.runBin = (bin, options, env, callback) => {
|
||||||
opts = opts.replace('{profile}', [this.PROFILES_PATH, this.profile + '.lua'].join('/'));
|
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'});
|
||||||
var cmd = util.format('%s%s/%s%s%s %s 2>%s', this.QQ, this.BIN_PATH, bin, this.EXE, this.QQ, opts, this.ERROR_LOG_FILE);
|
log.write(util.format('*** running %s %s\n', cmd, options));
|
||||||
process.chdir(this.TEST_FOLDER);
|
// we need to set a large maxbuffer here because we have long running processes like osrm-routed
|
||||||
exec(cmd, (err, stdout, stderr) => {
|
// with lots of log output
|
||||||
this.stdout = stdout.toString();
|
let child = child_process.execFile(cmd, opts, {maxBuffer: 1024 * 1024 * 1000, env: env}, callback);
|
||||||
fs.readFile(this.ERROR_LOG_FILE, (e, data) => {
|
child.on('exit', function(code) {
|
||||||
this.stderr = data ? data.toString() : '';
|
log.write(util.format('*** %s exited with code %d\n', bin, code));
|
||||||
this.exitCode = err && err.code || 0;
|
}.bind(this));
|
||||||
process.chdir('../');
|
this.setupOutputLog(child, log);
|
||||||
callback(err, stdout, stderr);
|
return child;
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.WhenIRouteIShouldGet = (table, callback) => {
|
this.WhenIRouteIShouldGet = (table, callback) => {
|
||||||
this.reprocessAndLoadData(() => {
|
this.reprocessAndLoadData((e) => {
|
||||||
|
if (e) return callback(e);
|
||||||
var headers = new Set(table.raw()[0]);
|
var headers = new Set(table.raw()[0]);
|
||||||
|
|
||||||
var requestRow = (row, ri, cb) => {
|
var requestRow = (row, ri, cb) => {
|
||||||
@@ -33,8 +34,8 @@ module.exports = function () {
|
|||||||
var afterRequest = (err, res, body) => {
|
var afterRequest = (err, res, body) => {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
if (body && body.length) {
|
if (body && body.length) {
|
||||||
let destinations, pronunciations, instructions, bearings, turns, modes, times,
|
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
|
||||||
distances, summary, intersections, lanes;
|
distances, summary, intersections, lanes, locations;
|
||||||
|
|
||||||
let json = JSON.parse(body);
|
let json = JSON.parse(body);
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ module.exports = function () {
|
|||||||
if (hasRoute) {
|
if (hasRoute) {
|
||||||
instructions = this.wayList(json.routes[0]);
|
instructions = this.wayList(json.routes[0]);
|
||||||
pronunciations = this.pronunciationList(json.routes[0]);
|
pronunciations = this.pronunciationList(json.routes[0]);
|
||||||
|
refs = this.refList(json.routes[0]);
|
||||||
destinations = this.destinationsList(json.routes[0]);
|
destinations = this.destinationsList(json.routes[0]);
|
||||||
bearings = this.bearingList(json.routes[0]);
|
bearings = this.bearingList(json.routes[0]);
|
||||||
turns = this.turnList(json.routes[0]);
|
turns = this.turnList(json.routes[0]);
|
||||||
@@ -52,6 +54,7 @@ module.exports = function () {
|
|||||||
distances = this.distanceList(json.routes[0]);
|
distances = this.distanceList(json.routes[0]);
|
||||||
lanes = this.lanesList(json.routes[0]);
|
lanes = this.lanesList(json.routes[0]);
|
||||||
summary = this.summary(json.routes[0]);
|
summary = this.summary(json.routes[0]);
|
||||||
|
locations = this.locations(json.routes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('status')) {
|
if (headers.has('status')) {
|
||||||
@@ -91,7 +94,7 @@ module.exports = function () {
|
|||||||
if (headers.has('distance')) {
|
if (headers.has('distance')) {
|
||||||
if (row.distance.length) {
|
if (row.distance.length) {
|
||||||
if (!row.distance.match(/\d+m/))
|
if (!row.distance.match(/\d+m/))
|
||||||
throw new Error('*** Distance must be specified in meters. (ex: 250m)');
|
return cb(new Error('*** Distance must be specified in meters. (ex: 250m)'));
|
||||||
got.distance = instructions ? util.format('%dm', distance) : '';
|
got.distance = instructions ? util.format('%dm', distance) : '';
|
||||||
} else {
|
} else {
|
||||||
got.distance = '';
|
got.distance = '';
|
||||||
@@ -100,7 +103,7 @@ module.exports = function () {
|
|||||||
|
|
||||||
if (headers.has('time')) {
|
if (headers.has('time')) {
|
||||||
if (!row.time.match(/\d+s/))
|
if (!row.time.match(/\d+s/))
|
||||||
throw new Error('*** Time must be specied in seconds. (ex: 60s)');
|
return cb(new Error('*** Time must be specied in seconds. (ex: 60s)'));
|
||||||
got.time = instructions ? util.format('%ds', time) : '';
|
got.time = instructions ? util.format('%ds', time) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +114,7 @@ module.exports = function () {
|
|||||||
if (headers.has('speed')) {
|
if (headers.has('speed')) {
|
||||||
if (row.speed !== '' && instructions) {
|
if (row.speed !== '' && instructions) {
|
||||||
if (!row.speed.match(/\d+ km\/h/))
|
if (!row.speed.match(/\d+ km\/h/))
|
||||||
throw new Error('*** Speed must be specied in km/h. (ex: 50 km/h)');
|
cb(new Error('*** Speed must be specied in km/h. (ex: 50 km/h)'));
|
||||||
var speed = time > 0 ? Math.round(3.6*distance/time) : null;
|
var speed = time > 0 ? Math.round(3.6*distance/time) : null;
|
||||||
got.speed = util.format('%d km/h', speed);
|
got.speed = util.format('%d km/h', speed);
|
||||||
} else {
|
} else {
|
||||||
@@ -123,10 +126,15 @@ module.exports = function () {
|
|||||||
got.intersections = (intersections || '').trim();
|
got.intersections = (intersections || '').trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headers.has('locations')){
|
||||||
|
got.locations = (locations || '').trim();
|
||||||
|
}
|
||||||
|
|
||||||
var putValue = (key, value) => {
|
var putValue = (key, value) => {
|
||||||
if (headers.has(key)) got[key] = instructions ? value : '';
|
if (headers.has(key)) got[key] = instructions ? value : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
putValue('ref', refs);
|
||||||
putValue('bearing', bearings);
|
putValue('bearing', bearings);
|
||||||
putValue('turns', turns);
|
putValue('turns', turns);
|
||||||
putValue('modes', modes);
|
putValue('modes', modes);
|
||||||
@@ -136,20 +144,12 @@ module.exports = function () {
|
|||||||
putValue('destinations', destinations);
|
putValue('destinations', destinations);
|
||||||
}
|
}
|
||||||
|
|
||||||
var ok = true;
|
|
||||||
|
|
||||||
for (var key in row) {
|
for (var key in row) {
|
||||||
if (this.FuzzyMatch.match(got[key], row[key])) {
|
if (this.FuzzyMatch.match(got[key], row[key])) {
|
||||||
got[key] = row[key];
|
got[key] = row[key];
|
||||||
} else {
|
|
||||||
ok = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
this.logFail(row, got, { route: { query: this.query, response: res }});
|
|
||||||
}
|
|
||||||
|
|
||||||
cb(null, got);
|
cb(null, got);
|
||||||
} else {
|
} else {
|
||||||
cb(new Error('request failed to return valid body'));
|
cb(new Error('request failed to return valid body'));
|
||||||
@@ -186,11 +186,11 @@ module.exports = function () {
|
|||||||
|
|
||||||
if (row.from && row.to) {
|
if (row.from && row.to) {
|
||||||
var fromNode = this.findNodeByName(row.from);
|
var fromNode = this.findNodeByName(row.from);
|
||||||
if (!fromNode) throw new Error(util.format('*** unknown from-node "%s"'), row.from);
|
if (!fromNode) return cb(new Error(util.format('*** unknown from-node "%s"'), row.from));
|
||||||
waypoints.push(fromNode);
|
waypoints.push(fromNode);
|
||||||
|
|
||||||
var toNode = this.findNodeByName(row.to);
|
var toNode = this.findNodeByName(row.to);
|
||||||
if (!toNode) throw new Error(util.format('*** unknown to-node "%s"'), row.to);
|
if (!toNode) return cb(new Error(util.format('*** unknown to-node "%s"'), row.to));
|
||||||
waypoints.push(toNode);
|
waypoints.push(toNode);
|
||||||
|
|
||||||
got.from = row.from;
|
got.from = row.from;
|
||||||
@@ -199,13 +199,13 @@ module.exports = function () {
|
|||||||
} else if (row.waypoints) {
|
} else if (row.waypoints) {
|
||||||
row.waypoints.split(',').forEach((n) => {
|
row.waypoints.split(',').forEach((n) => {
|
||||||
var node = this.findNodeByName(n.trim());
|
var node = this.findNodeByName(n.trim());
|
||||||
if (!node) throw new Error('*** unknown waypoint node "%s"', n.trim());
|
if (!node) return cb(new Error('*** unknown waypoint node "%s"', n.trim()));
|
||||||
waypoints.push(node);
|
waypoints.push(node);
|
||||||
});
|
});
|
||||||
got.waypoints = row.waypoints;
|
got.waypoints = row.waypoints;
|
||||||
this.requestRoute(waypoints, bearings, params, afterRequest);
|
this.requestRoute(waypoints, bearings, params, afterRequest);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('*** no waypoints');
|
return cb(new Error('*** no waypoints'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
var DifferentError = require('./exception_classes').TableDiffError;
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
this.diffTables = (expected, actual, options, callback) => {
|
|
||||||
// this is a temp workaround while waiting for https://github.com/cucumber/cucumber-js/issues/534
|
|
||||||
|
|
||||||
var error = new DifferentError(expected, actual);
|
|
||||||
|
|
||||||
return callback(error.string);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -11,8 +11,8 @@ Feature: Handle bad data in a graceful manner
|
|||||||
Given the ways
|
Given the ways
|
||||||
| nodes |
|
| nodes |
|
||||||
|
|
||||||
When the data has been contracted
|
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
|
||||||
Then "osrm-extract" should return code 1
|
Then it should exit with an error
|
||||||
|
|
||||||
Scenario: Only dead-end oneways
|
Scenario: Only dead-end oneways
|
||||||
Given the node map
|
Given the node map
|
||||||
|
|||||||
@@ -105,11 +105,11 @@ Feature: Bearing parameter
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | bearings | route | bearing |
|
| from | to | bearings | route | bearing |
|
||||||
| 0 | q | 0 90 | ia,ring,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,0->90,90->0 |
|
| 0 | q | 0 90 | ia,ring,ring | 0->0,0->90,90->0 |
|
||||||
| 0 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
|
| 0 | a | 45 90 | jb,ring,ring | 0->45,45->180,90->0 |
|
||||||
| 0 | q | 90 90 | kc,ring,ring,ring,ring | 0->90,90->180,270->0,0->90,90->0 |
|
| 0 | q | 90 90 | kc,ring,ring | 0->90,90->180,90->0 |
|
||||||
| 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
|
| 0 | a | 135 90 | ld,ring,ring | 0->135,135->270,90->0 |
|
||||||
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,0->90,90->0 |
|
| 0 | a | 180 90 | me,ring,ring | 0->180,180->270,90->0 |
|
||||||
| 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,90->0 |
|
| 0 | a | 225 90 | nf,ring,ring | 0->225,225->0,90->0 |
|
||||||
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
|
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 |
|
||||||
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
@routing @testbot @bug
|
|
||||||
Feature: Known bugs
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the profile "testbot"
|
|
||||||
@@ -4,6 +4,9 @@ Feature: Basic Map Matching
|
|||||||
Background:
|
Background:
|
||||||
Given the profile "testbot"
|
Given the profile "testbot"
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
|
Given the extract extra arguments "--generate-edge-lookup"
|
||||||
|
Given the query options
|
||||||
|
| geometries | geojson |
|
||||||
|
|
||||||
Scenario: Testbot - Map matching with outlier that has no candidate
|
Scenario: Testbot - Map matching with outlier that has no candidate
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
@@ -20,7 +23,7 @@ Feature: Basic Map Matching
|
|||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | timestamps | matchings |
|
| trace | timestamps | matchings |
|
||||||
| ab1d | 0 1 2 3 | abcd |
|
| ab1d | 0 1 2 3 | ad |
|
||||||
|
|
||||||
Scenario: Testbot - Map matching with trace splitting
|
Scenario: Testbot - Map matching with trace splitting
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -102,8 +105,8 @@ Feature: Basic Map Matching
|
|||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings |
|
| trace | matchings |
|
||||||
| dcba | hg,gf,fe |
|
| dcba | hgfe |
|
||||||
| efgh | ab,bc,cd |
|
| efgh | abcd |
|
||||||
|
|
||||||
Scenario: Testbot - Duration details
|
Scenario: Testbot - Duration details
|
||||||
Given the query options
|
Given the query options
|
||||||
@@ -118,25 +121,56 @@ Feature: Basic Map Matching
|
|||||||
| abcdegh | no |
|
| abcdegh | no |
|
||||||
| ci | 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
|
When I match I should get
|
||||||
| trace | matchings | annotation |
|
| trace | matchings | annotation |
|
||||||
| abeh | abcedgh | 1:9.897633,0:0,1:10.008842,1:10.008842,1:10.008842,0:0,2:20.017685,1:10.008842 |
|
| 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 | abc,ci | 1:9.897633,0:0,1:10.008842,0:0.111209,1:10.010367 |
|
| 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)
|
# The following is the same as the above, but separated for readability (line length)
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | OSM IDs |
|
| trace | matchings | OSM IDs |
|
||||||
| abeh | abcedgh | 1,2,3,2,3,4,5,4,5,6,7 |
|
| abeh | abeh | 1,2,3,2,3,4,5,4,5,6,7 |
|
||||||
| abci | abc,ci | 1,2,3,2,3,8,3,8 |
|
| abci | abci | 1,2,3,2,3,8,3,8 |
|
||||||
|
|
||||||
|
Scenario: Testbot - Regression test for #3037
|
||||||
|
Given the query options
|
||||||
|
| overview | simplified |
|
||||||
|
| geometries | geojson |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| | | | | |
|
||||||
|
| e | | f | | g |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abc | yes |
|
||||||
|
| efg | yes |
|
||||||
|
| ae | yes |
|
||||||
|
| cg | yes |
|
||||||
|
| fb | yes |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | matchings | geometry |
|
||||||
|
| efbc | efbc | 1,0.99964,1.000178,0.99964,1.000178,1,1.000359,1 |
|
||||||
|
|
||||||
Scenario: Testbot - Geometry details
|
Scenario: Testbot - Geometry details
|
||||||
Given the query options
|
Given the query options
|
||||||
| overview | full |
|
| overview | full |
|
||||||
| geometries | polyline |
|
| geometries | geojson |
|
||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c |
|
| a | | b | | c |
|
||||||
| | d | |
|
| | | d | | |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
@@ -145,4 +179,63 @@ Feature: Basic Map Matching
|
|||||||
|
|
||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | geometry |
|
| trace | matchings | geometry |
|
||||||
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
|
| abd | abd | 1,1,1.000179,1,1.000178,1,1.000178,0.99991 |
|
||||||
|
|
||||||
|
# Regression test 1 for issue 3176
|
||||||
|
Scenario: Testbot - multiuple segments: properly expose OSM IDs
|
||||||
|
Given the query options
|
||||||
|
| annotations | true |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
| a | 1 | b | | c | | d | | e | | f | 2 | g |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | id |
|
||||||
|
| a | 1 |
|
||||||
|
| b | 2 |
|
||||||
|
| c | 3 |
|
||||||
|
| d | 4 |
|
||||||
|
| e | 5 |
|
||||||
|
| f | 6 |
|
||||||
|
| g | 7 |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| ab | no |
|
||||||
|
| bc | no |
|
||||||
|
| cd | no |
|
||||||
|
| de | no |
|
||||||
|
| ef | no |
|
||||||
|
| fg | no |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| 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
|
||||||
|
Given the query options
|
||||||
|
| annotations | true |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
| a | 1 | b | | c | | d | | e | 2 | f |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | id |
|
||||||
|
| a | 1 |
|
||||||
|
| b | 2 |
|
||||||
|
| c | 3 |
|
||||||
|
| d | 4 |
|
||||||
|
| e | 5 |
|
||||||
|
| f | 6 |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abcdef | no |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | OSM IDs |
|
||||||
|
| 12 | 1,2,3,4,5,6 |
|
||||||
|
| 21 | 6,5,4,3,2,1 |
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
@routing @testbot @sidebias
|
||||||
|
Feature: Testbot - side bias
|
||||||
|
|
||||||
|
Scenario: Left hand bias
|
||||||
|
Given the profile "lhs"
|
||||||
|
And the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
| | | | | |
|
||||||
|
| | | d | | |
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| bc |
|
||||||
|
| bd |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | time |
|
||||||
|
| d | a | bd,ab,ab | 82s +-1 |
|
||||||
|
| d | c | bd,bc,bc | 100s +-1 |
|
||||||
|
|
||||||
|
Scenario: Right hand bias
|
||||||
|
Given the profile "rhs"
|
||||||
|
And the node map
|
||||||
|
| a | | b | | c |
|
||||||
|
| | | | | |
|
||||||
|
| | | d | | |
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| ab |
|
||||||
|
| bc |
|
||||||
|
| bd |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | time |
|
||||||
|
| d | a | bd,ab,ab | 100s +-1 |
|
||||||
|
| d | c | bd,bc,bc | 82s +-1 |
|
||||||
|
|
||||||
|
Scenario: Roundabout exit counting for left sided driving
|
||||||
|
Given the profile "lhs"
|
||||||
|
And a grid size of 10 meters
|
||||||
|
And the node map
|
||||||
|
| | | a | | |
|
||||||
|
| | | b | | |
|
||||||
|
| h | g | | c | d |
|
||||||
|
| | | e | | |
|
||||||
|
| | | f | | |
|
||||||
|
And the ways
|
||||||
|
| nodes | junction |
|
||||||
|
| ab | |
|
||||||
|
| cd | |
|
||||||
|
| ef | |
|
||||||
|
| gh | |
|
||||||
|
| bcegb | roundabout |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
||||||
|
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
||||||
|
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
|
||||||
|
|
||||||
|
Scenario: Mixed Entry and Exit
|
||||||
|
Given the profile "lhs"
|
||||||
|
And a grid size of 10 meters
|
||||||
|
And the node map
|
||||||
|
| | c | | a | |
|
||||||
|
| j | | b | | f |
|
||||||
|
| | k | | e | |
|
||||||
|
| l | | h | | d |
|
||||||
|
| | g | | i | |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | junction | oneway |
|
||||||
|
| cba | | yes |
|
||||||
|
| fed | | yes |
|
||||||
|
| ihg | | yes |
|
||||||
|
| lkj | | yes |
|
||||||
|
| behkb | roundabout | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns |
|
||||||
|
| c,a | cba,cba,cba | depart,roundabout-exit-1,arrive |
|
||||||
|
| l,a | lkj,cba,cba | depart,roundabout-exit-2,arrive |
|
||||||
|
| i,a | ihg,cba,cba | depart,roundabout-exit-3,arrive |
|
||||||
@@ -23,10 +23,10 @@ Feature: Traffic - turn penalties applied to turn onto which a phantom node snap
|
|||||||
Scenario: Weighting based on turn penalty file, with an extreme negative value -- clamps and does not fail
|
Scenario: Weighting based on turn penalty file, with an extreme negative value -- clamps and does not fail
|
||||||
Given the turn penalty file
|
Given the turn penalty file
|
||||||
"""
|
"""
|
||||||
1,2,5,0
|
1,2,5,0,comment
|
||||||
3,4,7,-20
|
3,4,7,-20
|
||||||
"""
|
"""
|
||||||
And the contract extra arguments "--turn-penalty-file penalties.csv"
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | time |
|
| from | to | route | speed | time |
|
||||||
| a | e | ab,be,be | 36 km/h | 40s +-1 |
|
| a | e | ab,be,be | 36 km/h | 40s +-1 |
|
||||||
|
|||||||
@@ -19,3 +19,18 @@ Feature: Handling of UTF characters
|
|||||||
| a | b | Scandinavian København,Scandinavian København |
|
| a | b | Scandinavian København,Scandinavian København |
|
||||||
| b | c | Japanese 東京,Japanese 東京 |
|
| b | c | Japanese 東京,Japanese 東京 |
|
||||||
| c | d | Cyrillic Москва,Cyrillic Москва |
|
| c | d | Cyrillic Москва,Cyrillic Москва |
|
||||||
|
|
||||||
|
|
||||||
|
@todo
|
||||||
|
Scenario: Up to 255 Unicode Code Points (255 x Panda Code Point)
|
||||||
|
Given the node map
|
||||||
|
| a | b | c |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | highway |
|
||||||
|
| ab | ab | primary |
|
||||||
|
| bc | 🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 | primary |
|
||||||
|
|
||||||
|
When I route 100 times I should get
|
||||||
|
| from | to | route |
|
||||||
|
| a | c | ab,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 |
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ Feature: Via points
|
|||||||
| c,d,a | abc,bd,bd,bd,abc,abc |
|
| c,d,a | abc,bd,bd,bd,abc,abc |
|
||||||
|
|
||||||
# See issue #2349
|
# See issue #2349
|
||||||
@bug
|
@todo
|
||||||
Scenario: Via point at a dead end with oneway
|
Scenario: Via point at a dead end with oneway
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b | c |
|
| a | b | c |
|
||||||
@@ -262,3 +262,38 @@ Feature: Via points
|
|||||||
| 3,2,1 | ab,bc,cd,da,ab,ab,ab,bc,cd,da,ab,ab | 3000m +-1 |
|
| 3,2,1 | ab,bc,cd,da,ab,ab,ab,bc,cd,da,ab,ab | 3000m +-1 |
|
||||||
| 6,5,4 | bc,cd,da,ab,bc,bc,bc,cd,da,ab,bc,bc | 3000m +-1 |
|
| 6,5,4 | bc,cd,da,ab,bc,bc,bc,cd,da,ab,bc,bc | 3000m +-1 |
|
||||||
| 9,8,7 | cd,da,ab,bc,cd,cd,cd,da,ab,bc,cd,cd | 3000m +-1 |
|
| 9,8,7 | cd,da,ab,bc,cd,cd,cd,da,ab,bc,cd,cd | 3000m +-1 |
|
||||||
|
|
||||||
|
# See issue #2706
|
||||||
|
# this case is currently broken. It simply works as put here due to staggered intersections triggering a name collapse.
|
||||||
|
# See 2824 for further information
|
||||||
|
@todo
|
||||||
|
Scenario: Incorrect ordering of nodes can produce multiple U-turns
|
||||||
|
Given the node map
|
||||||
|
| | a | | | |
|
||||||
|
| e | b | c | d | f |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abcd | no |
|
||||||
|
| ebbdcf | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| e | f | ebbdcf,ebbdcf |
|
||||||
|
|
||||||
|
@2798
|
||||||
|
Scenario: UTurns Enabled
|
||||||
|
Given the node map
|
||||||
|
| a | b | c | d | e |
|
||||||
|
|
||||||
|
And the query options
|
||||||
|
| continue_straight | false |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abc | yes |
|
||||||
|
| edc | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route |
|
||||||
|
| a,b,e | |
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Fuzz testing using LLVM's libFuzzer.
|
||||||
|
#
|
||||||
|
# See:
|
||||||
|
# - http://llvm.org/docs/LibFuzzer.html
|
||||||
|
# - http://llvm.org/releases/3.8.0/docs/LibFuzzer.html
|
||||||
|
#
|
||||||
|
# TODO(daniel-j-h):
|
||||||
|
# - make more user friendly, at the moment we require you to build and install libFuzzer.a
|
||||||
|
# - pick up LLVM_ROOT
|
||||||
|
# - build libFuzzer on the fly
|
||||||
|
#
|
||||||
|
# clang++ -std=c++11 -stdlib=libc++ -c -g -O2 ~/llvm/lib/Fuzzer/*.cpp -I~/llvm/lib/Fuzzer
|
||||||
|
# ar ruv libFuzzer.a Fuzzer*.o
|
||||||
|
|
||||||
|
if (ENABLE_FUZZING)
|
||||||
|
|
||||||
|
include(ProcessorCount)
|
||||||
|
ProcessorCount(nproc)
|
||||||
|
|
||||||
|
macro(add_fuzz_target binary)
|
||||||
|
add_executable(${binary} ${binary}.cc $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:SERVER>)
|
||||||
|
target_link_libraries(${binary} Fuzzer osrm)
|
||||||
|
target_include_directories(${binary} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
add_custom_target(fuzz-${binary}
|
||||||
|
DEPENDS ${binary}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory "corpus/${binary}"
|
||||||
|
COMMAND ${binary} -use_traces=1 -jobs=${nproc} -workers=${nproc} -max_len=4096 "corpus/${binary}"
|
||||||
|
COMMENT "Fuzzing ${binary}" VERBATIM)
|
||||||
|
endmacro ()
|
||||||
|
|
||||||
|
|
||||||
|
set(ServerTargets
|
||||||
|
"match_parameters"
|
||||||
|
"nearest_parameters"
|
||||||
|
"route_parameters"
|
||||||
|
"table_parameters"
|
||||||
|
"tile_parameters"
|
||||||
|
"trip_parameters"
|
||||||
|
"url_parser"
|
||||||
|
"request_parser")
|
||||||
|
|
||||||
|
foreach (target ${ServerTargets})
|
||||||
|
add_fuzz_target(${target})
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
|
||||||
|
set(UtilTargets
|
||||||
|
"escape_json"
|
||||||
|
"uri_decode")
|
||||||
|
|
||||||
|
foreach (target ${UtilTargets})
|
||||||
|
add_fuzz_target(${target})
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
|
||||||
|
endif ()
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user