Compare commits

..

14 Commits

Author SHA1 Message Date
Moritz Kobitzsch 1a22e7da2b update version to 5.3.2 2016-08-09 12:06:47 +02:00
Moritz Kobitzsch 40a86d43cd fix 2754 2016-08-09 12:04:26 +02:00
Moritz Kobitzsch 68d20c6ccc fix removal of multiple geometries for first vertex 2016-08-09 12:03:29 +02:00
Daniel J. Hofmann fe491bf92c Allow Travis builds for this branch 2016-08-04 15:22:51 +02:00
Daniel J. Hofmann 7b432b34bb Update CMakeLists.txt version to 5.3.1 2016-08-04 15:12:48 +02:00
Daniel J. Hofmann 6983cd0de2 Adapt Changelog for v5.3.1 2016-08-04 15:06:44 +02:00
Daniel J. Hofmann fe8177077c Disable our added failing cucumber tests for now 2016-08-04 14:58:06 +02:00
Daniel J. Hofmann 5f339f4ed6 Fall back to generic match finding if not a reverse-lane 2016-08-04 14:57:59 +02:00
Daniel J. Hofmann 3c0b52c637 Skip handling none values for our edge cases for now..
Conflicts:
	src/extractor/guidance/turn_lane_augmentation.cpp
2016-08-04 14:57:53 +02:00
Daniel Patterson 877fc5b42c Add a minimal version of the failing test case. 2016-08-04 14:57:47 +02:00
Daniel J. Hofmann e28785e399 Reproducing breaking intersection in cucumber scenario
Conflicts:
	src/extractor/guidance/turn_lane_augmentation.cpp
2016-08-04 14:57:39 +02:00
Daniel J. Hofmann 2c4a54ce05 Try to come up with a small test case 2016-08-04 14:57:32 +02:00
Michael Krasnyk a8afc74590 Fix #2706 by using correct fallback u-turn
Regression is due to a combination of 08248e3853
and http://www.openstreetmap.org/changeset/40938983
where in ways http://www.openstreetmap.org/way/27292481
and http://www.openstreetmap.org/way/432488408
nodes
4315134884 (part of way 432488408)
4315134891 (part of way 432488408)
4315134886 (part of way 432488408)
form a u-turn that has index 0 after sorting and used as an allowed one
with a reversed edge.
A u-turn that corresponds to the condition uturn_could_be_valid == true has index 1
and ignored.
2016-07-31 22:46:10 +02:00
Daniel J. Hofmann d195eee7c4 Lane Handling for multiple indications per lane as in left;left|, fixes #2694
Before we asserted on unique lane indications per lane. Turns out the
OSM data contains lane strings such as:

    left;left|right

Which represents two lanes as in:

    <<     >
     ||    |

The two left indications _on a single lane_ look like data issue.
And we can't represent this with our enum-approach at the moment.

We don't want to crash there, so silently swallow this and
generate a single left|right for it.
2016-07-26 12:18:15 +02:00
190 changed files with 2998 additions and 7458 deletions
-12
View File
@@ -1,12 +0,0 @@
# 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?
+24 -3
View File
@@ -13,7 +13,7 @@ notifications:
branches:
only:
- master
- 5.4
- "5.3"
cache:
ccache: true
@@ -25,7 +25,7 @@ env:
global:
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
- CASHER_TIME_OUT=1000
- JOBS=4
matrix:
@@ -43,6 +43,14 @@ 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']
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
compiler: "clang-3.8-debug"
addons: &clang38
@@ -69,6 +77,19 @@ matrix:
compiler: "gcc-5-release-i686"
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
#- os: linux
#- compiler: clang
@@ -131,7 +152,7 @@ install:
fi
- mkdir build && pushd build
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
- 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
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=ON
- echo "travis_fold:start:MAKE"
- make osrm-extract --jobs=3
- make --jobs=${JOBS}
+8 -30
View File
@@ -1,35 +1,13 @@
# 5.4.0-rc.3
Changes from 5.4.0-rc.2
# 5.3.2
Changes from 5.3.1
- 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
- fixed a bug that occurred when trimming very short segments at the begin/end of a route (less than 1 meter)
# 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.3.1
Changes from 5.3.1
- Bugfixes:
- Disabled broken lane handling for complex uturn/oneway combinations for now (190 intersections affected on the planet)
- Fixed a bug with overlaping geometries, which broke OSRM on recent Egypt extracts with data-modelling issues
# 5.3.0
Changes from 5.3.0-rc.3
+6 -42
View File
@@ -9,8 +9,8 @@ endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 4)
set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION_MINOR 3)
set(OSRM_VERSION_PATCH 2)
# these two functions build up custom variables:
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
@@ -54,8 +54,6 @@ option(ENABLE_ASSERTIONS OFF)
option(COVERAGE OFF)
option(SANITIZER OFF)
option(ENABLE_LTO "Use LTO if available" ON)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
@@ -117,26 +115,6 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
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.25")
message(STATUS "Disabling gc-sections on gold binutils < 2.25, 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)
message(STATUS "Configuring OSRM in release mode")
# Check if LTO is available
@@ -227,7 +205,7 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
message(STATUS "Setting linker optimizations")
if(NOT (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
# Tell compiler to put every function in separate section, linker can then match sections and functions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
# Tell linker to do dead code and data eminination during link time discarding sections
@@ -242,9 +220,9 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# Activate C++1y
# Activate C++11
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
# Configuring other platform dependencies
@@ -266,7 +244,6 @@ if(UNIX AND NOT APPLE)
set(MAYBE_RT_LIBRARY rt)
endif()
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")
find_package(Osmium REQUIRED COMPONENTS io)
@@ -439,7 +416,7 @@ file(GLOB VariantGlob third_party/variant/*.hpp)
file(GLOB LibraryGlob include/osrm/*.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(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp)
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(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
@@ -521,16 +498,3 @@ add_custom_target(uninstall
# Modular build system: each directory registered here provides its own CMakeLists.txt
add_subdirectory(unit_tests)
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 ()
-5
View File
@@ -10,11 +10,6 @@ The Open Source Routing Machine is a high performance routing engine written in
| Windows | [![Build status](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
| Coverage | [![codecov](https://codecov.io/gh/Project-OSRM/osrm-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/Project-OSRM/osrm-backend) |
## Contact
- IRC: 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
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).
+8 -41
View File
@@ -30,17 +30,17 @@ http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=va
| Service | Description |
|-------------|-----------------------------------------------------------|
| [`route`](#service-route) | fastest path between given coordinates |
| [`route`](#service-route) | shortest path between given coordinates |
| [`nearest`](#service-nearest) | returns the nearest street segment for a given coordinate |
| [`table`](#service-table) | computes distance tables for given coordinates |
| [`match`](#service-match) | matches given coordinates to the road network |
| [`trip`](#service-trip) | Compute the fastest round trip between given coordinates |
| [`trip`](#service-trip) | Compute the shortest round trip between given coordinates |
| [`tile`](#service-tile) | Return vector tiles containing debugging info |
- `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
- `coordinates`: String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`.
- `format`: Only `json` is supported at the moment. This parameter is optional and defaults to `json`.
- `format`: Only `json` is supportest 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).
To pass parameters to each location some options support an array like encoding:
@@ -181,14 +181,6 @@ In case of error the following `code`s are supported in addition to the general
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`
### Request
```
@@ -302,7 +294,7 @@ All other fields might be undefined.
## Service `trip`
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
The returned path does not have to be the fastest path, as TSP is NP-hard it is only an approximation.
The returned path does not have to be the shortest path, as TSP is NP-hard it is only an approximation.
Note that if the input coordinates can not be joined by a single trip (e.g. the coordinates are on several disconnected islands)
multiple trips for each connected component are returned.
@@ -407,8 +399,8 @@ Represents a route between two waypoints.
| annotations | |
|--------------|-----------------------------------------------------------------------|
| true | An `Annotation` object containing node ids, durations and distances |
| false | `undefined` |
| true | returns distance and durations of each coordinate along the route |
| false | will not exist |
#### Example
@@ -422,35 +414,11 @@ With `steps=false` and `annotations=true`:
"annotation": {
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
}
}
```
### 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
A step consists of a maneuver such as a turn or merge, followed
@@ -469,7 +437,6 @@ 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)|
- `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.
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
- `mode`: A string signifying the mode of transportation.
@@ -538,7 +505,7 @@ step.
| `use lane` | going straight on a specific lane |
| `continue` | Turn in direction of `modifier` to stay on the same road |
| `roundabout` | traverse roundabout, has additional 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/rotary_pronunciation` in addition to the `exit` parameter. |
| `rotary` | a larger version of a roundabout, can offer `rotary_name` in addition to the `exit` parameter. |
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
@@ -624,7 +591,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.
- `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.
- `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.
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the turn location
#### Example
```
-13
View File
@@ -32,16 +32,3 @@ 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)
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
View File
@@ -1,50 +1,50 @@
# Releasing a new OSRM version
We are using http://semver.org/ for versioning with major, minor and patch versions.
Do decide if this is a major or minor version bump use: http://semver.org/
## Guarantees
What we guarantee on major version changes:
We are giving the following guarantees between versions:
- Breaking changes will be in the changelog
- If we break an HTTP API we bump the version
### Major version change
What we guarantee on minor version changes:
- There are no guarantees about compatiblity of APIs or datasets
- Breaking changes will be noted as `BREAKING` in the changelog
- HTTP API does not include breaking changes
- C++ library API does not include breaking changes
- node-osrm API does not include breaking changes
### Minor version change
What we DO NOT guarantee on minor version changes:
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.
- file format comp ability. Breakage will be listed in the changelog.
- new turn types and fields may be introduced. How to handle this see [the HTTP API docs](http.md).
- Forward-compatible HTTP API
- Forward-compatible C++ library API
- Forward-compatible node-osrm API
- No compatiblity between OSRM datasets (needs new processing)
What we guarantee on patch version changes:
### Patch version change
- HTTP API does not include breaking changes
- C++ library API does not include breaking changes
- node-osrm API does not include breaking changes
- full file format compatibility
- No change of query parameters or response formats
- Compatible HTTP API
- Compatible C++ library API
- Compatible node-osrm API
- Compatible OSRM datasets
## Major or Minor release x.y
## Release and branch management
1. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
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
- 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
## Patch release x.y.z
## Releasing a version
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.
1. Check out the appropriate release branch x.y
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:)
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.
6. Push tags and commits: `git push; git push --tags`
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
7. Proceede with the `node-osrm` release as outlined in the repository.
8. Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
+6 -2
View File
@@ -18,7 +18,7 @@
#include <cstdlib>
int main(int argc, const char *argv[])
int main(int argc, const char *argv[]) try
{
if (argc < 2)
{
@@ -67,7 +67,6 @@ int main(int argc, const char *argv[])
std::cout << "Distance: " << distance << " meter\n";
std::cout << "Duration: " << duration << " seconds\n";
return EXIT_SUCCESS;
}
else if (status == Status::Error)
{
@@ -79,3 +78,8 @@ int main(int argc, const char *argv[])
return EXIT_FAILURE;
}
}
catch (const std::exception &e)
{
std::cerr << "Error: " << e.what() << std::endl;
return EXIT_FAILURE;
}
+2 -2
View File
@@ -15,8 +15,8 @@ Feature: Bike - Street names in instructions
| bc | Your Way | A7 |
When I route I should get
| from | to | route | ref |
| a | c | My Way,Your Way,Your Way | A6,A7,A7 |
| from | to | route |
| a | c | My Way (A6),Your Way (A7),Your Way (A7) |
@unnamed
Scenario: Bike - Use way type to describe unnamed ways
+4 -4
View File
@@ -13,8 +13,8 @@ Feature: Bike - Way ref
| ab | Utopia Drive | E7 |
When I route I should get
| from | to | route | ref |
| a | b | Utopia Drive,Utopia Drive | E7,E7 |
| from | to | route |
| a | b | Utopia Drive (E7),Utopia Drive (E7) |
Scenario: Bike - Way with only ref
Given the node map
@@ -25,8 +25,8 @@ Feature: Bike - Way ref
| ab | | E7 |
When I route I should get
| from | to | route | ref |
| a | b | {highway:primary},{highway:primary} | E7,E7 |
| from | to | route |
| a | b | E7,E7 |
Scenario: Bike - Way with only name
Given the node map
+1 -21
View File
@@ -5,7 +5,7 @@ Feature: Car - Restricted access
Background:
Given the profile "car"
Scenario: Car - Access tag hierarchy on ways
Scenario: Car - Access tag hierarchy on ways
Then routability should be
| access | vehicle | motor_vehicle | motorcar | bothw |
| | | | | x |
@@ -148,23 +148,3 @@ Feature: Car - Restricted access
| primary | | | no | | x |
| runway | | | | yes | |
| 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 - 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 | |
+8 -8
View File
@@ -41,10 +41,10 @@ Feature: Car - Handle ferry routes
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
| c | e | cde,cde | ferry,ferry | 11 km/h |
| e | c | cde,cde | ferry,ferry | 11 km/h |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
| c | e | cde,cde | ferry,ferry | 12 km/h |
| e | c | cde,cde | ferry,ferry | 12 km/h |
Scenario: Car - Properly handle ISO 8601 durations
Given the node map
@@ -60,7 +60,7 @@ Feature: Car - Handle ferry routes
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
| c | e | cde,cde | ferry,ferry | 11 km/h |
| e | c | cde,cde | ferry,ferry | 11 km/h |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 25 km/h |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 20 km/h |
| c | e | cde,cde | ferry,ferry | 12 km/h |
| e | c | cde,cde | ferry,ferry | 12 km/h |
+6 -51
View File
@@ -15,8 +15,8 @@ Feature: Car - Street names in instructions
| bc | Your Way | A1 |
When I route I should get
| from | to | route | ref |
| a | c | My Way,Your Way,Your Way | ,A1,A1|
| from | to | route |
| a | c | My Way,Your Way (A1),Your Way (A1) |
Scenario: Car - A named street with pronunciation
Given the node map
@@ -25,32 +25,15 @@ Feature: Car - Street names in instructions
| | c | |
And the ways
| nodes | name |name:pronunciation | ref |
| nodes | name |name:pronunciation | ref |
| ab | My Way | | |
| bd | My Way | meyeway | A1 |
| 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
| from | to | route | pronunciations |
| a | c | Houston St,Houston St | hew-stun,hew-stun |
| a | e | Houston St,Houston St,Houston St | hew-stun,how-stun,how-stun |
| from | to | route | pronunciations |
| a | d | My Way,My Way (A1) | ,meyeway |
| 1 | c | Your Way,Your Way | yourewaye,yourewaye |
@todo
Scenario: Car - Use way type to describe unnamed ways
@@ -65,31 +48,3 @@ Feature: Car - Street names in instructions
When I route I should get
| from | to | route |
| 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 |
+4 -44
View File
@@ -149,27 +149,11 @@ Feature: Car - Turn restrictions
| type | way:from | way:to | node:via | restriction |
| 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
| from | to | route |
| s | r | sj,ej,re,re |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | |
| s | e | |
@only_turning
Scenario: Car - Only right turn
@@ -446,27 +430,3 @@ Feature: Car - Turn restrictions
| a | b | ax,xy,yb,yb |
| 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 |
-13
View File
@@ -1,13 +0,0 @@
@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 |
+12 -93
View File
@@ -2,8 +2,6 @@
Feature: Traffic - speeds
Background: Use specific speeds
Scenario: Weighting based on speed file
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
@@ -23,106 +21,27 @@ Feature: Traffic - speeds
| 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.csv"
Given the speed file
And the speed file
"""
1,2,0
2,1,0
1,2,27
2,1,27
2,3,27
3,2,27
1,4,27
4,1,27
"""
And I route I should get
| from | to | route | speed |
| a | b | ad,de,eb,eb | 30 km/h |
| a | c | ad,dc,dc | 31 km/h |
| b | c | bc,bc | 27 km/h |
| a | d | ad,ad | 27 km/h |
| d | c | dc,dc | 36 km/h |
| g | b | fb,fb | 36 km/h |
| a | g | ad,df,fb,fb | 30 km/h |
Scenario: Speeds that isolate a single node (a)
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | .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 |
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"
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 |
| from | to | route | speed |
| a | b | ab,ab | 27 km/h |
| a | c | ab,bc,bc | 27 km/h |
| b | c | bc,bc | 27 km/h |
| a | d | ad,ad | 27 km/h |
| d | c | dc,dc | 36 km/h |
| g | b | ab,ab | 27 km/h |
| a | g | ab,ab | 27 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 contract extra arguments "--segment-speed-file speeds.csv"
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 run "osrm-contract --segment-speed-file speeds.csv {extracted_base}.osrm"
And stderr should contain "malformed"
And it should exit with code not 0
+12 -12
View File
@@ -33,19 +33,19 @@ Feature: Traffic - turn penalties
| from | to | route | speed | time |
| a | h | ad,dhk,dhk | 63 km/h | 11.5s +-1 |
# straight
| i | g | fim,fg,fg | 53 km/h | 13.5s +-1 |
| i | g | fim,fg,fg | 59 km/h | 12s +-1 |
# right
| a | e | ad,def,def | 43 km/h | 16.7s +-1 |
| a | e | ad,def,def | 57 km/h | 12.5s +-1 |
# left
| c | g | cd,def,fg,fg | 63 km/h | 23s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 58 km/h | 24.9s +-1 |
| p | g | mp,fim,fg,fg | 61 km/h | 23.5s +-1 |
# straight-right
| a | l | ad,dhk,klm,klm | 51 km/h | 28.1s +-1 |
| a | l | ad,dhk,klm,klm | 60 km/h | 24s +-1 |
# straight-left
| l | e | klm,dhk,def,def | 53 km/h | 27s +-1 |
| l | e | klm,dhk,def,def | 59 km/h | 24.5s +-1 |
# double right
| g | n | fg,fim,mn,mn | 43 km/h | 33.4s +-1 |
| g | n | fg,fim,mn,mn | 57 km/h | 25s +-1 |
# double left
Scenario: Weighting based on turn penalty file
@@ -53,9 +53,9 @@ Feature: Traffic - turn penalties
"""
9,6,7,1.8
9,13,14,24.5
8,4,3,30
8,4,3,26
12,11,8,9
8,11,12,23
8,11,12,13
1,4,5,-0.2
"""
And the contract extra arguments "--turn-penalty-file penalties.csv"
@@ -71,13 +71,13 @@ Feature: Traffic - turn penalties
# double straight
| p | g | mp,fim,fg,fg | 59 km/h | 24.5s +-1 |
# straight-right - ifg penalty
| a | l | ad,def,fim,klm,klm | 57 km/h | 38.2s +-1 |
| a | l | ad,def,fim,klm,klm | 61 km/h | 35.5s +-1 |
# was straight-left - forced around by hkl penalty
| l | e | klm,fim,def,def | 43 km/h | 33.4s +-1 |
| l | e | klm,fim,def,def | 57 km/h | 25s +-1 |
# double right - forced left by lkh penalty
| g | n | fg,fim,mn,mn | 27 km/h | 52.6s +-1 |
| g | n | fg,fim,mn,mn | 30 km/h | 47.5s +-1 |
# double left - imn penalty
| j | c | jk,klm,fim,def,cd,cd | 51 km/h | 56.2s +-1 |
| j | c | jk,klm,fim,def,cd,cd | 60 km/h | 48s +-1 |
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
Scenario: Too-negative penalty clamps, but does not fail
+1 -1
View File
@@ -16,7 +16,7 @@ Feature: Foot - Street names in instructions
When I route I should get
| from | to | route |
| a | c | My Way,Your Way,Your Way |
| a | c | My Way (A6),Your Way (B7),Your Way (B7) |
@unnamed
Scenario: Foot - Use way type to describe unnamed ways
+3 -3
View File
@@ -14,7 +14,7 @@ Feature: Foot - Way ref
When I route I should get
| from | to | route |
| a | b | Utopia Drive,Utopia Drive |
| a | b | Utopia Drive (E7),Utopia Drive (E7) |
Scenario: Foot - Way with only ref
Given the node map
@@ -25,8 +25,8 @@ Feature: Foot - Way ref
| ab | | E7 |
When I route I should get
| from | to | route |
| a | b | {highway:primary},{highway:primary} |
| from | to | route |
| a | b | E7,E7 |
Scenario: Foot - Way with only name
Given the node map
-236
View File
@@ -1,236 +0,0 @@
@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 @bug @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 @bug @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 @bug @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 |
+60 -277
View File
@@ -135,9 +135,9 @@ Feature: Turn Lane Guidance
| cj | | 1 | motorway_link | yes | xbcj |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | ab,ci,ci | depart,turn slight right,arrive | ,none:false slight right:true, |
| a,j | ab,xbcj | depart,arrive | , |
| waypoints | route | turns | lanes |
| a,i | ab,xbcj,ci,ci | depart,merge slight left,turn slight right,arrive | ,,none:false slight right:true, |
| a,j | ab,xbcj,xbcj | depart,merge slight left,arrive | ,, |
@anticipate
@@ -257,170 +257,7 @@ Feature: Turn Lane Guidance
When I route I should get
| 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:true right:false right:false,left:true left:false straight:false,straight:false right:true right:false,left:true straight:false, |
@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, |
| 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, |
@anticipate @todo @bug @2661
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
@@ -434,20 +271,20 @@ Feature: Turn Lane Guidance
| | | i | | |
And the ways
| nodes | turn:lanes:forward | highway | junction | # |
| nodes | turn:lanes:forward | highway | junction | # |
| ab | slight_right\|slight_right\|slight_right | primary | | |
| bc | slight_left\|slight_right\|slight_right | primary | roundabout | top |
| cd | | primary | roundabout | top |
| de | | primary | roundabout | top |
| eb | | primary | roundabout | top |
| df | | primary | | |
| cg | slight_right\|slight_right | primary | | |
| gh | slight_left\|slight_right | primary | roundabout | bot |
| hi | | primary | roundabout | bot |
| ij | slight_left\|slight_right | primary | roundabout | bot |
| jg | | primary | roundabout | bot |
| hk | | primary | | |
| jl | | primary | | |
| cd | | primary | roundabout | top |
| de | | primary | roundabout | top |
| eb | | primary | roundabout | top |
| df | | primary | | |
| cg | slight_right\|slight_right | primary | | |
| gh | slight_left\|slight_right | primary | roundabout | bot |
| hi | | primary | roundabout | bot |
| ij | slight_left\|slight_right | primary | roundabout | bot |
| jg | | primary | roundabout | bot |
| hk | | primary | | |
| jl | | primary | | |
When I route I should get
| # | waypoints | route | turns | lanes |
@@ -464,20 +301,20 @@ Feature: Turn Lane Guidance
| | | c | | |
And the ways
| nodes | turn:lanes:forward | highway | junction |
| ab | | primary | |
| bc | | primary | roundabout |
| nodes | turn:lanes:forward | highway | junction |
| ab | | primary | |
| bc | | primary | roundabout |
| cd | slight_left\|slight_left\|slight_right | primary | roundabout |
| de | | primary | roundabout |
| eb | | primary | roundabout |
| df | | primary | |
| de | | primary | roundabout |
| eb | | primary | roundabout |
| df | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
Scenario: Anticipate with lanes in roundabout where we stay on the roundabout for multiple exits
Given the node map
| | | a | | |
| | | b | | |
@@ -494,7 +331,7 @@ Feature: Turn Lane Guidance
| cd | | primary | roundabout |
| de | | primary | roundabout |
| ef | | primary | roundabout |
| fg | through\|slight_right | primary | roundabout |
| fg | slight_right | primary | roundabout |
| gb | | primary | roundabout |
| gh | | primary | |
| cx | | primary | |
@@ -503,11 +340,11 @@ Feature: Turn Lane Guidance
| fy | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,, |
| waypoints | route | turns | lanes |
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,slight right:false slight right:true, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
Scenario: Departing or arriving inside a roundabout does not yet anticipate lanes
Given the node map
| | | a | | |
| x | b | | d | y |
@@ -523,44 +360,13 @@ Feature: Turn Lane Guidance
| da | | primary | roundabout | roundabout |
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,slight right:false slight right:true, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
@anticipate
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
Scenario: Departing or arriving inside a roundabout does not yet anticipate lanes (BIG version)
Given the node map
| | | a | | |
| x | b | | d | y |
@@ -610,13 +416,13 @@ Feature: Turn Lane Guidance
| da | | primary | roundabout | roundabout |
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,slight right:false slight right:true, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,slight right:true slight right:true, |
@anticipate @todo @2032
Scenario: No Lanes for Roundabouts, see #2626
@anticipate
Scenario: Anticipate Lanes for turns before and / or after roundabout
Given the node map
| a | b | | | x |
| | c | | | |
@@ -626,47 +432,24 @@ Feature: Turn Lane Guidance
| | y | | | |
And the ways
| nodes | turn:lanes:forward | highway | junction | name |
| ab | through\|right\|right\|right\|right | primary | | abx |
| bx | | primary | | abx |
| bc | right\|right\|right\|right | primary | | bc |
| cd | | primary | roundabout | cdefc |
| de | slight_left\|slight_left\|slight_left\|slight_right | primary | roundabout | cdefc |
| ef | left\|slight_right\|slight_right | primary | roundabout | cdefc |
| fc | | primary | roundabout | cdefc |
| ey | | primary | | ey |
| fg | through\|right | primary | | fg |
| gz | | primary | | gz |
| gh | | primary | | gh |
| nodes | turn:lanes:forward | highway | junction | name |
| ab | through\|right\|right\|right\|right | primary | | abx |
| bx | | primary | | abx |
| bc | right\|right\|right\|right | primary | | bc |
| cd | | primary | roundabout | cdefc |
| de | slight_left\|slight_left&slight_left\|slight_right | primary | roundabout | cdefc |
| ef | left\|slight_right\|slight_right | primary | roundabout | cdefc |
| fc | | primary | roundabout | cdefc |
| ey | | primary | | ey |
| fg | through\|right | primary | | fg |
| gz | | primary | | gz |
| gh | | primary | | gh |
When I route I should get
| 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,,straight:false right:true, |
| 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, |
@anticipate
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
@anticipate @bug @todo
Scenario: Tripple Right keeping Left
Given the node map
| a | | | | b | | i |
@@ -687,11 +470,11 @@ Feature: Turn Lane Guidance
| feg | | tertiary | fourth |
When I route I should get
| waypoints | route | turns | lanes |
| 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,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, |
| 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,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, |
@anticipate
@anticipate @bug @todo
Scenario: Tripple Left keeping Right
Given the node map
| i | | b | | | | a |
@@ -712,6 +495,6 @@ Feature: Turn Lane Guidance
| feg | | tertiary | fourth |
When I route I should get
| waypoints | route | turns | lanes |
| 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,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, |
| 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,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, |
-35
View File
@@ -1,35 +0,0 @@
@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 |
-53
View File
@@ -1,53 +0,0 @@
@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 |
+36 -244
View File
@@ -136,12 +136,6 @@ Feature: Collapse
Scenario: Partly Segregated Intersection, Two Segregated Roads
Given the node map
| | n | | m | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | g | | h | |
| | | | | |
| | | | | |
@@ -150,12 +144,6 @@ Feature: Collapse
| | | | | |
| | | | | |
| | j | | i | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | k | | l | |
And the ways
| nodes | highway | name | oneway |
@@ -164,8 +152,8 @@ Feature: Collapse
| de | primary | first | yes |
| ef | primary | first | yes |
| be | primary | first | no |
| ngbhm | primary | second | yes |
| liejk | primary | second | yes |
| gbh | primary | second | yes |
| iej | primary | second | yes |
When I route I should get
| waypoints | route | turns |
@@ -188,10 +176,6 @@ Feature: Collapse
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
Given the node map
| | n | | m | |
| | | | | |
| | | | | |
| | | | | |
| | g | | h | |
| | | | | |
| | | | | |
@@ -200,10 +184,6 @@ Feature: Collapse
| | | | | |
| | | | | |
| | j | | i | |
| | | | | |
| | | | | |
| | | | | |
| | k | | l | |
And the ways
| nodes | highway | name | oneway |
@@ -212,8 +192,8 @@ Feature: Collapse
| de | primary | first | yes |
| ef | primary | first | yes |
| be | primary | second | no |
| ngbhm | primary | second | yes |
| liejk | primary | second | yes |
| gbh | primary | second | yes |
| iej | primary | second | yes |
When I route I should get
| waypoints | route | turns |
@@ -322,12 +302,12 @@ Feature: Collapse
Scenario: Entering a segregated road
Given the node map
| | a | f | | | | g |
| | | | | | | |
| | b | e | | | | |
| | | | | | | |
| | | | | | | |
| c | d | | | | | |
| | a | f | | |
| | | | | g |
| | b | e | | |
| | | | | |
| | | | | |
| c | d | | | |
And the ways
| nodes | highway | name | oneway |
@@ -345,6 +325,7 @@ Feature: Collapse
| g,f | second,first,first | depart,turn right,arrive |
| g,c | second,first,first | depart,end of road left,arrive |
Scenario: Do not collapse turning roads
Given the node map
| | | e | | |
@@ -352,12 +333,12 @@ Feature: Collapse
| a | | b | f | |
And the ways
| nodes | highway | name | oneway |
| ab | primary | first | yes |
| bc | primary | first | yes |
| cd | primary | first | yes |
| ce | primary | second | yes |
| bf | primary | third | yes |
| nodes | highway | name |
| ab | primary | first |
| bc | primary | first |
| cd | primary | first |
| ce | primary | second |
| bf | primary | third |
When I route I should get
| waypoints | route | turns |
@@ -402,13 +383,13 @@ Feature: Collapse
Scenario: Pankenbruecke
Given the node map
| j | | | | h | | | | | | i | | | | | | |
| | | | | | | b | c | d | e | f | | | | | | g |
| k | | | | a | | | | | | | | | | | | |
| h | | | | | | i | | | | | | |
| | | b | c | d | e | f | | | | | | g |
| a | | | | | | | | | | | | |
And the ways
| nodes | highway | name | oneway |
| kabhj | primary | inroad | yes |
| abh | primary | inroad | yes |
| bc | primary | inroad | no |
| cd | primary | bridge | no |
| defg | primary | outroad | no |
@@ -525,36 +506,6 @@ Feature: Collapse
| icf | secondary | in | 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
| waypoints | route | turns |
| i,h | in,road,road | depart,turn slight left,arrive |
@@ -620,28 +571,26 @@ Feature: Collapse
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
| fdcg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
| restriction | bd | fdcg | d | no_left_turn |
| restriction | bc | fdcg | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road | depart,arrive |
| waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road | depart,arrive |
Scenario: Forking before a turn (forky)
Given the node map
| | | | | | g | | |
| | | | | | | | |
| | | | | | c | | |
| a | | | b | | | | |
| | | | | | | d | |
| | | | | | | f | e |
| | | | g | | |
| | | | | | |
| | | | c | | |
| a | b | | | | |
| | | | | d | |
| | | | | f | e |
And the ways
| nodes | name | oneway | highway |
@@ -649,14 +598,12 @@ Feature: Collapse
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
| fdcg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
| restriction | bd | fdcg | d | no_left_turn |
| restriction | bc | fdcg | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
@@ -683,158 +630,3 @@ Feature: Collapse
| f,d | on,Hwy,Hwy | depart,merge slight 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 |
@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 |
+4 -150
View File
@@ -52,8 +52,8 @@ Feature: Slipways and Dedicated Turn Lanes
| efg | primary | second |
When I route I should get
| waypoints | route | turns |
| a,g | first,,second,second | depart,off ramp slight right,turn straight,arrive |
| waypoints | route | turns |
| a,g | first,,second,second | depart,off ramp slight right,merge slight left,arrive |
Scenario: Inner city expressway with on road
Given the node map
@@ -165,151 +165,5 @@ Feature: Slipways and Dedicated Turn Lanes
| 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&center=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
| waypoints | route | turns |
| 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 |
| waypoints | route | turns |
| a,o | Schwarzwaldstrasse (L561),Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive |
+10 -10
View File
@@ -29,13 +29,13 @@ Feature: Destination Signs
| qr | QR | | | A1;A2 | yes | |
When I route I should get
| from | to | route | destinations | ref | # |
| a | b | AB,AB | , | E1,E1 | |
| c | d | CD,CD | Berlin,Berlin | , | |
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
| g | h | , | A1: Berlin,A1: Berlin | , | |
| i | j | , | Berlin,Berlin | , | |
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
| o | p | OP,OP | , | , | guard against mis-tagging |
| q | r | QR,QR | A1, A2,A1, A2 | , | |
| from | to | route | destinations | # |
| a | b | AB (E1),AB (E1) | , | |
| c | d | CD (Berlin),CD (Berlin) | Berlin,Berlin | |
| e | f | EF (A1: Berlin),EF (A1: Berlin) | A1: Berlin,A1: Berlin | |
| g | h | , | A1: Berlin,A1: Berlin | |
| i | j | , | Berlin,Berlin | |
| k | l | KL (E1),KL (E1) | A1: Berlin,A1: Berlin | |
| m | n | MN (A1, A2: Berlin, Hamburg),MN (A1, A2: Berlin, Hamburg) | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | |
| o | p | OP,OP | , | guard against mis-tagging |
| q | r | QR (A1, A2),QR (A1, A2) | A1, A2,A1, A2 | |
+3 -3
View File
@@ -311,6 +311,6 @@ Feature: Fork Instructions
| ab | on | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,j | on,xbcj | depart,arrive |
| a,i | on,off,off | depart,turn slight right,arrive |
| waypoints | route | turns |
| a,j | on,xbcj,xbcj | depart,merge slight left,arrive |
| a,i | on,xbcj,off,off | depart,merge slight left,turn slight right,arrive |
+18 -58
View File
@@ -3,14 +3,13 @@ Feature: Merging
Background:
Given the profile "car"
And a grid size of 10 meters
Given a grid size of 10 meters
@merge
Scenario: Merge on Four Way Intersection
Given the node map
| d | | | | | | | | | |
| a | | b | | | | | | | c |
| e | | | | | | | | | |
| d | | |
| a | b | c |
| e | | |
And the ways
| nodes | highway |
@@ -19,15 +18,14 @@ Feature: Merging
| eb | primary |
When I route I should get
| waypoints | route | turns |
| d,c | db,abc,abc | depart,turn straight,arrive |
| e,c | eb,abc,abc | depart,turn straight,arrive |
| waypoints | route | turns |
| d,c | db,abc,abc | depart,merge slight right,arrive |
| e,c | eb,abc,abc | depart,merge slight left,arrive |
@merge
Scenario: Merge on Three Way Intersection Right
Given the node map
| d | | | | | | | | | |
| a | | b | | | | | | | c |
| d | | |
| a | b | c |
And the ways
| nodes | highway |
@@ -35,30 +33,13 @@ Feature: Merging
| db | primary |
When I route I should get
| waypoints | route | turns |
| d,c | db,abc,abc | depart,turn straight,arrive |
| waypoints | route | turns |
| d,c | db,abc,abc | depart,merge slight right,arrive |
@merge @negative
Scenario: Don't Merge on Short-Three Way Intersection Right
Given the node map
| d | | | | | | | |
| a | | b | | | | | c |
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 slight left,arrive |
@merge
Scenario: Merge on Three Way Intersection Right
Given the node map
| a | | b | | | | | | | c |
| d | | | | | | | | | |
| a | b | c |
| d | | |
And the ways
| nodes | highway |
@@ -66,21 +47,15 @@ Feature: Merging
| db | primary |
When I route I should get
| waypoints | route | turns |
| d,c | db,abc,abc | depart,turn straight,arrive |
| waypoints | route | turns |
| d,c | db,abc,abc | depart,merge slight left,arrive |
@merge
Scenario: Merge onto a turning road
Given the node map
| | | | | | | e |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | d | |
| | | | | | | |
| | | | | | | |
@@ -96,21 +71,6 @@ Feature: Merging
| fd | residential | in |
When I route I should get
| waypoints | turns | route |
| f,e | depart,turn straight,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 |
| waypoints | turns | route |
| f,e | depart,merge slight left,arrive | in,road,road |
| f,a | depart,turn sharp left,arrive | in,road,road |
+4 -4
View File
@@ -125,10 +125,10 @@ Feature: New-Name Instructions
| | | | | c |
And the ways
| nodes | highway | oneway |
| ab | residential | yes |
| bc | residential | yes |
| bd | service | yes |
| nodes | highway |
| ab | residential |
| bc | residential |
| bd | service |
When I route I should get
| waypoints | route | turns |
-126
View File
@@ -1,126 +0,0 @@
@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 |
+15 -15
View File
@@ -83,14 +83,14 @@ Feature: Ramp Guidance
Scenario: Ramp Off Though Street
Given the node map
| | | | | c |
| a | | | b | |
| | | | d | |
| | | c |
| a | b | |
| | d | |
And the ways
| nodes | highway | oneway |
| abc | tertiary | yes |
| bd | motorway_link | yes |
| nodes | highway |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
@@ -108,9 +108,9 @@ Feature: Ramp Guidance
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,on ramp straight,arrive |
| a,c | abc,abc | depart,arrive |
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,on ramp straight,arrive |
| a,c | abc,abc,abc | depart,continue left,arrive |
Scenario: Fork Ramp Off Turning Though Street
Given the node map
@@ -124,9 +124,9 @@ Feature: Ramp Guidance
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,on ramp right,arrive |
| a,c | abc,abc | depart,arrive |
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,on ramp right,arrive |
| a,c | abc,abc,abc | depart,continue left,arrive |
Scenario: Fork Ramp
Given the node map
@@ -174,9 +174,9 @@ Feature: Ramp Guidance
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,on ramp slight right,arrive |
| a,c | abc,abc | depart,arrive |
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,on ramp slight right,arrive |
| a,c | abc,abc,abc | depart,continue slight left,arrive |
Scenario: Fork Slight Ramp on Obvious Through Street
Given the node map
+31
View File
@@ -5,6 +5,37 @@ Feature: Basic Roundabout
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-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
Given the node map
| | | a | | |
@@ -1,37 +0,0 @@
@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 |
-102
View File
@@ -389,105 +389,3 @@ Feature: Basic Roundabout
| 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 |
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 |
+149 -57
View File
@@ -5,6 +5,37 @@ Feature: Basic Roundabout
Given the profile "car"
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
Given the node map
| | | a | | |
@@ -229,7 +260,7 @@ Feature: Basic Roundabout
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
Scenario: Collinear in Y
Scenario: Collinear in Y
Given the node map
| | a |
| | b |
@@ -249,6 +280,87 @@ Feature: Basic Roundabout
| 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 | | |
| 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
#See 39.933742 -75.082345
Given the node map
@@ -283,9 +395,9 @@ Feature: Basic Roundabout
| dmg | roundabout | | trunk_link | yes | |
When I route I should get
| waypoints | route | turns | ref |
| a,e | crescent,crescent,crescent | depart,roundabout-exit-3,arrive | US 130,US 130,US 130 |
| j,l | ,, | depart,roundabout-exit-2,arrive | NJ 38,NJ 38,NJ 38 |
| waypoints | route | turns |
| a,e | crescent (US 130),crescent (US 130),crescent (US 130) | depart,roundabout-exit-3,arrive |
| j,l | NJ 38,NJ 38,NJ 38 | depart,roundabout-exit-2,arrive |
Scenario: Double Roundabout with through-lane
#http://map.project-osrm.org/?z=18&center=38.911752%2C-77.048667&loc=38.912003%2C-77.050831&loc=38.909277%2C-77.042516&hl=en&alt=0
@@ -326,61 +438,41 @@ Feature: Basic Roundabout
| waypoints | route | turns |
| a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,dupont circle-exit-1,arrive |
#2856 - http://www.openstreetmap.org/#map=19/47.23318/-1.56563
Scenario: Linked Roundabouts
Scenario: Enter and Exit - Traffic Signals
Given the node map
| | | | | | | | | | | | | | x |
| | u | | | | | | | | | | | r | |
| | | | | | | | | | | | | | |
| | | | t | | | | | | | | | | |
| | | | | | | | | | | s | | | |
| | | v | | | i | | h | | g | | | | |
| | | | | | | | | | | | q | | |
| | | | | | | | | | | | | | |
| | | | j | | | | | | | | f | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | a | | | | | | | | e | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | b | | c | | d | | p | | |
| | | | | | | | | | | | | | |
| | | m | | | | | | | | n | | | |
| | | | | l | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | k | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | w | | | | | | | | | | o | | |
| | | a | | |
| | i | b | l | |
| h | g | | c | d |
| | j | e | k | |
| | | f | | |
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
| node | highway |
| i | traffic_signals |
| j | traffic_signals |
| k | traffic_signals |
| l | traffic_signals |
And the nodes
| node | highway |
| c | give_way |
| h | give_way |
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bigjekclb | roundabout |
When I route I should get
| waypoints | route | turns |
# since we cannot handle these invalid roundabout tags yet, we cannout output roundabout taggings. This will hopefully change some day
#| w,x | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive |
| w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn slight left,arrive |
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 |
@@ -1,92 +0,0 @@
@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 |
+5 -18
View File
@@ -3,7 +3,7 @@ Feature: Suppress New Names on dedicated Suffices
Background:
Given the profile "car"
Given a grid size of 2000 meters
Given a grid size of 10 meters
Scenario: Suffix To Suffix
Given the node map
@@ -28,8 +28,8 @@ Feature: Suppress New Names on dedicated Suffices
| bc | 42 S | 101 |
When I route I should get
| waypoints | route | turns | ref |
| a,c | 42 N,42 S | depart,arrive | ,101 |
| waypoints | route | turns |
| a,c | 42 N,42 S (101) | depart,arrive |
Scenario: Prefix Change
Given the node map
@@ -44,19 +44,6 @@ Feature: Suppress New Names on dedicated Suffices
| waypoints | route | turns |
| 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
Given the node map
| a | | b | | c |
@@ -67,8 +54,8 @@ Feature: Suppress New Names on dedicated Suffices
| bc | East 42 | |
When I route I should get
| waypoints | route | turns | ref |
| a,c | West 42,East 42 | depart,arrive | 101, |
| waypoints | route | turns |
| a,c | West 42 (101),East 42 | depart,arrive |
Scenario: Suffix To Suffix - Turn
Given the node map
+2 -2
View File
@@ -32,8 +32,8 @@ Feature: Suppressed Turns
| ef | motorway | highway | A1 |
When I route I should get
| waypoints | route | turns | ref |
| a,f | highway,highway | depart,arrive | A1,A1 |
| waypoints | route | turns |
| a,f | highway (A1),highway (A1) | depart,arrive |
Scenario: Don't Announce Turn on following major road class -- service
+30 -190
View File
@@ -5,7 +5,7 @@ Feature: Turn Lane Guidance
Given the profile "car"
Given a grid size of 20 meters
@simple
@bug
Scenario: Basic Turn Lane 3-way Turn with empty lanes
Given the node map
| a | | b | | c |
@@ -24,23 +24,6 @@ Feature: Turn Lane Guidance
| 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, |
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
Given the node map
| | | e | | |
@@ -63,7 +46,6 @@ Feature: Turn Lane Guidance
| 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, |
@simple @none
Scenario: Basic Turn Lane 4-Way Turn using none
Given the node map
| | | e | | |
@@ -83,7 +65,6 @@ Feature: Turn Lane Guidance
| 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, |
@simple @reverse
Scenario: Basic Turn Lane 4-Way With U-Turn Lane
Given the node map
| | | e | | |
@@ -106,7 +87,6 @@ Feature: Turn Lane Guidance
#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
Given the node map
| a | | b | | c |
@@ -124,45 +104,7 @@ Feature: Turn Lane Guidance
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
| a,c | road,road | depart,arrive | , |
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
@bug
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
@PROFILE @LANES
Scenario: Turn with Bus-Lane but without lanes
Given the node map
| a | | b | | c |
@@ -181,7 +123,7 @@ Feature: Turn Lane Guidance
| 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
@todo @bug @collapse @partition-lanes
@todo @bug
Scenario: Turn Lanes at Segregated Road
Given the node map
| | | i | l | | |
@@ -226,7 +168,6 @@ Feature: Turn Lane Guidance
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
#copy of former case to prevent further regression
@collapse @partition-lanes
Scenario: Turn Lanes at Segregated Road
Given the node map
| | | i | l | | |
@@ -260,7 +201,6 @@ Feature: Turn Lane Guidance
| i,j | cross,cross | depart,arrive | , |
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
@partition-lanes
Scenario: Turn Lanes at Segregated Road
Given the node map
| | | g | f | | |
@@ -283,7 +223,6 @@ Feature: Turn Lane Guidance
| 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
@2654 @previous-lanes
Scenario: Turn Lanes Given earlier than actual turn
Given the node map
| a | | b | c | | d |
@@ -302,7 +241,6 @@ Feature: Turn Lane Guidance
| a,e | road,turn,turn | depart,turn right,arrive | ,none:false right:true, |
| a,d | road,road | depart,arrive | , |
@2654 @previous-lanes
Scenario: Turn Lanes Given earlier than actual turn
Given the node map
| a | | b | c | d | | e | | f | g | h | | i |
@@ -325,7 +263,6 @@ Feature: Turn Lane Guidance
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ,left:true none:false, |
| i,a | road,road | depart,arrive | , |
@previous-lanes
Scenario: Passing a one-way street
Given the node map
| e | | | f | |
@@ -342,7 +279,6 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes |
| 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
Given the node map
| e | | | f | |
@@ -360,10 +296,8 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| 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, |
@partition-lanes @previous-lanes
Scenario: Passing a one-way street, partly pulled back lanes, no through
Given the node map
| e | | | f |
@@ -383,7 +317,7 @@ Feature: Turn Lane Guidance
| 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, |
@todo @bug @partition-lanes @previous-lanes
@todo @bug
Scenario: Narrowing Turn Lanes
Given the node map
| | | | | g | |
@@ -406,7 +340,6 @@ Feature: Turn Lane Guidance
| 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, |
@previous-lanes
Scenario: Turn at a traffic light
Given the node map
| a | b | c | d |
@@ -428,7 +361,7 @@ Feature: Turn Lane Guidance
| a,d | road,road | depart,arrive | , |
| a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
@bug @todo @roundabout
@bug @todo
Scenario: Theodor Heuss Platz
Given the node map
| | | | i | o | | | l | |
@@ -465,7 +398,6 @@ 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,o | top,top,top | depart,roundabout-exit-5,arrive | ,, |
@sliproads
Scenario: Turn Lanes Breaking up
Given the node map
| | | | g | |
@@ -476,34 +408,30 @@ Feature: Turn Lane Guidance
| | | | f | |
And the ways
| nodes | name | turn:lanes:forward | oneway | highway |
| ab | road | left\|left\|through\|through\|right | yes | primary |
| bd | road | through\|through\|right | yes | primary |
| bc | road | left\|left | yes | primary |
| de | road | | yes | primary |
| fd | cross | | | secondary |
| dc | cross | | | secondary |
| cg | cross | | | secondary |
| nodes | name | turn:lanes:forward | oneway | highway |
| ab | road | left\|left\|through\|through | yes | primary |
| bd | road | through\|through | yes | primary |
| bc | road | left\|left | yes | primary |
| de | road | | yes | primary |
| fdcg | cross | | | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
| restriction | bd | fdcg | d | no_left_turn |
| restriction | bc | fdcg | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| 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 | , |
| waypoints | route | turns | lanes |
| a,g | road,cross,cross | depart,turn left,arrive | ,left:true left:true straight:false straight:false, |
| 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
Given the node map
| | | | | | | h | |
| | | | | f | | e | j |
| a | b | | | | | | |
| | | | | c | | d | i |
| | | | | | | g | |
| | | | | | h | |
| | | | | f | e | j |
| a | b | | | | | |
| | | | | c | d | i |
| | | | | | g | |
And the ways
| nodes | name | turn:lanes:forward | oneway | highway |
@@ -512,25 +440,16 @@ Feature: Turn Lane Guidance
| bc | road | \|through\|right | yes | primary |
| cd | road | \|through\|right | yes | primary |
| fc | road | | no | tertiary |
| je | road | | yes | primary |
| ef | road | | yes | primary |
| fb | road | | yes | primary |
| eh | cross | | no | primary |
| de | cross | | no | primary |
| gd | cross | | no | primary |
| jefb | road | | yes | primary |
| gdeh | 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 |
| a | g | 180,180 180,180 | road,cross,cross | depart,turn right,arrive | ,none:false straight:false right:true, |
| a | h | 180,180 180,180 | road,cross,cross | depart,turn left,arrive | ,none:true straight:false right:false, |
| 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, |
@reverse
Scenario: Segregated Intersection Merges With Lanes
Given the node map
| | | | | | | f |
@@ -555,7 +474,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,g | road,straight,straight | depart,new name straight,arrive | ,left:false left:false left:false straight:true straight:true, |
@bug @todo @roundabout
@bug @todo
Scenario: Passing Through a Roundabout
Given the node map
| | | h | | g | | |
@@ -582,7 +501,6 @@ Feature: Turn Lane Guidance
| i,j | left,bottom,bottom | depart,round-exit-1,arrive | ,0, |
| i,k | left,right,right | depart,round-exit-2,arrive | ,1, |
@previous-lanes
Scenario: Crossing Traffic Light
Given the node map
| a | | b | | c | | d |
@@ -603,7 +521,6 @@ Feature: Turn Lane Guidance
| 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, |
@ramp
Scenario: Highway Ramp
Given the node map
| a | | b | | c | | d |
@@ -642,7 +559,6 @@ Feature: Turn Lane Guidance
| a,g | off,road,road | depart,turn_left,arrive | ,left:true right:false, |
| a,h | | | |
@ramp
Scenario: Off Ramp In a Turn
Given the node map
| a | | | | | | | | | | | |
@@ -661,7 +577,6 @@ Feature: Turn Lane Guidance
| a,c | hwy,hwy | depart,arrive | , |
| 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
Given the node map
| h | | | | | g | | | | | | f |
@@ -680,7 +595,6 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false,|
@reverse
Scenario: Reverse Lane in Segregated Road with none
Given the node map
| h | | | | | g | | | | | | f |
@@ -699,7 +613,6 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes |
| 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
Given the node map
| h | | | | | g | | | | | | f |
@@ -720,7 +633,6 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes |
| 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
Given the node map
| a | | b | | e |
@@ -740,7 +652,6 @@ Feature: Turn Lane Guidance
| 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,, |
@simple
Scenario: Merge Lanes Onto Freeway
Given the node map
| a | | | b | c |
@@ -755,7 +666,6 @@ Feature: Turn Lane Guidance
| waypoints | turns | route | lanes |
| 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
Given the node map
| i | | | | | a |
@@ -770,9 +680,9 @@ Feature: Turn Lane Guidance
| ab | on | motorway_link | |
When I route I should get
| waypoints | route | turns | lanes |
| a,j | on,xbcj | depart,arrive | , |
| a,i | on,off,off | depart,turn slight right,arrive | ,none:false slight right:true, |
| waypoints | route | turns | lanes |
| a,j | on,xbcj,xbcj | depart,merge slight left,arrive | ,, |
| a,i | on,xbcj,off,off | depart,merge slight left,turn slight right,arrive | ,,none:false slight right:true, |
#http://www.openstreetmap.org/#map=17/52.47414/13.35712
@todo @ramp @2645
@@ -814,8 +724,8 @@ Feature: Turn Lane Guidance
And the ways
| nodes | name | highway | turn:lanes:forward |
| ab | road | primary | through;right |
| bc | road | primary | through;right |
| ab | road | primary | through,right |
| bc | road | primary | through,right |
| cd | road | primary | |
| xa | road | primary | |
| be | turn | primary | |
@@ -825,27 +735,6 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes |
| 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
Given the node map
@@ -957,52 +846,3 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes |
| d,a ||||
# 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, |
+13 -198
View File
@@ -246,28 +246,22 @@ Feature: Simple Turns
Scenario: Four Way Intersection Double Through Street Segregated
Given the node map
| | | | | q | | p | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | b | | c | | | | |
| j | | | i | | | | d | | | o |
| | | | | | a | | | | | |
| k | | | h | | | | e | | | n |
| | | | | g | | f | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | l | | m | | | | |
| | b | | c | |
| i | | | | d |
| | | a | | |
| h | | | | e |
| | g | | f | |
And the ways
| nodes | highway | oneway | name |
| khaij | primary | yes | first |
| odaen | primary | yes | first |
| qbacp | primary | yes | second |
| mfagl | primary | yes | second |
| ha | primary | yes | first |
| ai | primary | yes | first |
| ae | primary | yes | first |
| da | primary | yes | first |
| ba | primary | yes | second |
| ac | primary | yes | second |
| fa | primary | yes | second |
| ag | primary | yes | second |
When I route I should get
| waypoints | route | turns |
@@ -885,182 +879,3 @@ Feature: Simple Turns
| waypoints | turns | route |
| 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 |
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 |
+1 -1
View File
@@ -7,7 +7,7 @@ Feature: osrm-routed command line options: invalid options
Scenario: osrm-routed - Non-existing option
When I run "osrm-routed --fly-me-to-the-moon"
Then stdout should be empty
And stderr should contain "unrecognised"
And stderr should contain "exception"
And stderr should contain "fly-me-to-the-moon"
And it should exit with code 1
+1 -2
View File
@@ -35,8 +35,7 @@ module.exports = function () {
var actual = [];
actual.push(table.headers);
this.reprocessAndLoadData((e) => {
if (e) return callback(e);
this.reprocessAndLoadData(() => {
// compute matrix
var params = this.queryParams;
+1 -2
View File
@@ -6,8 +6,7 @@ module.exports = function () {
this.When(/^I match I should get$/, (table, callback) => {
var got;
this.reprocessAndLoadData((e) => {
if (e) return callback(e);
this.reprocessAndLoadData(() => {
var testRow = (row, ri, cb) => {
var afterRequest = (err, res) => {
if (err) return cb(err);
+1 -2
View File
@@ -2,8 +2,7 @@ var util = require('util');
module.exports = function () {
this.When(/^I request nearest I should get$/, (table, callback) => {
this.reprocessAndLoadData((e) => {
if (e) return callback(e);
this.reprocessAndLoadData(() => {
var testRow = (row, ri, cb) => {
var inNode = this.findNodeByName(row.in);
if (!inNode) throw new Error(util.format('*** unknown in-node "%s"'), row.in);
-4
View File
@@ -30,10 +30,6 @@ module.exports = function () {
assert.equal(this.exitCode, parseInt(code));
});
this.Then(/^it should exit with code not (\d+)$/, (code) => {
assert.notEqual(this.exitCode, parseInt(code));
});
this.Then(/^stdout should contain "(.*?)"$/, (str) => {
assert.ok(this.stdout.indexOf(str) > -1);
});
+1 -2
View File
@@ -2,8 +2,7 @@ var assert = require('assert');
module.exports = function () {
this.When(/^I request \/(.*)$/, (path, callback) => {
this.reprocessAndLoadData((e) => {
if (e) return callback(e);
this.reprocessAndLoadData(() => {
this.requestPath(path, {}, (err, res, body) => {
this.response = res;
callback(err, res, body);
+1 -2
View File
@@ -4,8 +4,7 @@ module.exports = function () {
this.When(/^I plan a trip I should get$/, (table, callback) => {
var got;
this.reprocessAndLoadData((e) => {
if (e) return callback(e);
this.reprocessAndLoadData(() => {
var testRow = (row, ri, cb) => {
var afterRequest = (err, res) => {
if (err) return cb(err);
+1 -2
View File
@@ -339,8 +339,7 @@ module.exports = function () {
};
this.reprocessAndLoadData = (callback) => {
this.reprocess((e) => {
if (e) return callback(e);
this.reprocess(() => {
this.OSRMLoader.load(util.format('%s.osrm', this.osmData.contractedFile), callback);
});
};
+5 -9
View File
@@ -139,10 +139,6 @@ module.exports = function () {
return this.extractInstructionList(instructions, s => s.name);
};
this.refList = (instructions) => {
return this.extractInstructionList(instructions, s => s.ref || '');
};
this.pronunciationList = (instructions) => {
return this.extractInstructionList(instructions, s => s.pronunciation || '');
};
@@ -156,15 +152,15 @@ module.exports = function () {
};
this.annotationList = (instructions) => {
function zip(list_1, list_2, list_3)
function zip(list_1, list_2)
{
let tuples = [];
let pairs = [];
for (let i = 0; i < list_1.length; ++i) {
tuples.push([list_1[i], list_2[i], list_3[i]]);
pairs.push([list_1[i], list_2[i]]);
}
return tuples;
return pairs;
}
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance).map(p => { return p.join(':'); }).join(','); }).join(',');
};
this.OSMIDList = (instructions) => {
+2 -5
View File
@@ -24,8 +24,7 @@ module.exports = function () {
};
this.WhenIRouteIShouldGet = (table, callback) => {
this.reprocessAndLoadData((e) => {
if (e) return callback(e);
this.reprocessAndLoadData(() => {
var headers = new Set(table.raw()[0]);
var requestRow = (row, ri, cb) => {
@@ -34,7 +33,7 @@ module.exports = function () {
var afterRequest = (err, res, body) => {
if (err) return cb(err);
if (body && body.length) {
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
let destinations, pronunciations, instructions, bearings, turns, modes, times,
distances, summary, intersections, lanes;
let json = JSON.parse(body);
@@ -44,7 +43,6 @@ module.exports = function () {
if (hasRoute) {
instructions = this.wayList(json.routes[0]);
pronunciations = this.pronunciationList(json.routes[0]);
refs = this.refList(json.routes[0]);
destinations = this.destinationsList(json.routes[0]);
bearings = this.bearingList(json.routes[0]);
turns = this.turnList(json.routes[0]);
@@ -129,7 +127,6 @@ module.exports = function () {
if (headers.has(key)) got[key] = instructions ? value : '';
};
putValue('ref', refs);
putValue('bearing', bearings);
putValue('turns', turns);
putValue('modes', modes);
+9 -9
View File
@@ -104,12 +104,12 @@ Feature: Bearing parameter
| ha | yes | ring |
When I route I should get
| from | to | bearings | route | bearing |
| 0 | q | 0 90 | ia,ring,ring | 0->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 | 0->90,90->180,90->0 |
| 0 | a | 135 90 | ld,ring,ring | 0->135,135->270,90->0 |
| 0 | a | 180 90 | me,ring,ring | 0->180,180->270,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 | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |
| 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 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
| 0 | q | 90 90 | kc,ring,ring,ring,ring | 0->90,90->180,270->0,0->90,90->0 |
| 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,0->90,90->0 |
| 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,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 |
+3 -11
View File
@@ -4,7 +4,6 @@ Feature: Basic Map Matching
Background:
Given the profile "testbot"
Given a grid size of 10 meters
Given the extract extra arguments "--generate-edge-lookup"
Scenario: Testbot - Map matching with outlier that has no candidate
Given a grid size of 100 meters
@@ -119,17 +118,10 @@ Feature: Basic Map Matching
| abcdegh | no |
| ci | no |
And the speed file
"""
1,2,36
"""
And the contract extra arguments "--segment-speed-file speeds.csv"
When I match I should get
| trace | matchings | annotation |
| abeh | abcedgh | 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:1,0:0:0,1:10.008842:0,0:0.111209:0,1:10.010367:0 |
| 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 |
| abci | abc,ci | 1:9.897633,0:0,1:10.008842,0:0.111209,1:10.010367 |
# The following is the same as the above, but separated for readability (line length)
When I match I should get
-83
View File
@@ -1,83 +0,0 @@
@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,7 +23,7 @@ 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
Given the turn penalty file
"""
1,2,5,0,comment
1,2,5,0
3,4,7,-20
"""
And the contract extra arguments "--turn-penalty-file penalties.csv"
-15
View File
@@ -19,18 +19,3 @@ Feature: Handling of UTF characters
| a | b | Scandinavian København,Scandinavian København |
| b | c | Japanese ,Japanese |
| 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,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼,🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼🐼 |
+1 -36
View File
@@ -173,7 +173,7 @@ Feature: Via points
| c,d,a | abc,bd,bd,bd,abc,abc |
# See issue #2349
@bug @todo
@bug
Scenario: Via point at a dead end with oneway
Given the node map
| a | b | c |
@@ -262,38 +262,3 @@ Feature: Via points
| 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 |
| 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 | |
-58
View File
@@ -1,58 +0,0 @@
# 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 ()
-18
View File
@@ -1,18 +0,0 @@
#include "util/string_util.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::util::escape_JSON;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
const std::string in(reinterpret_cast<const char *>(data), size);
const auto escaped = escape_JSON(in);
escape(escaped.data());
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
#include "engine/api/match_parameters.hpp"
#include "server/api/parameters_parser.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::api::parseParameters;
using osrm::engine::api::MatchParameters;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
const auto last = end(in);
const auto param = parseParameters<MatchParameters>(first, last);
escape(&param);
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
#include "engine/api/nearest_parameters.hpp"
#include "server/api/parameters_parser.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::api::parseParameters;
using osrm::engine::api::NearestParameters;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
const auto last = end(in);
const auto param = parseParameters<NearestParameters>(first, last);
escape(&param);
return 0;
}
-28
View File
@@ -1,28 +0,0 @@
#include "server/request_parser.hpp"
#include "server/http/request.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::RequestParser;
using osrm::server::http::request;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
auto last = end(in);
RequestParser parser;
request req;
// &(*it) is needed to go from iterator to underlying item to pointer to underlying item
parser.parse(req, &(*first), &(*last));
escape(&req);
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
#include "engine/api/route_parameters.hpp"
#include "server/api/parameters_parser.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::api::parseParameters;
using osrm::engine::api::RouteParameters;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
const auto last = end(in);
const auto param = parseParameters<RouteParameters>(first, last);
escape(&param);
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
#include "engine/api/table_parameters.hpp"
#include "server/api/parameters_parser.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::api::parseParameters;
using osrm::engine::api::TableParameters;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
const auto last = end(in);
const auto param = parseParameters<TableParameters>(first, last);
escape(&param);
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
#include "engine/api/tile_parameters.hpp"
#include "server/api/parameters_parser.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::api::parseParameters;
using osrm::engine::api::TileParameters;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
const auto last = end(in);
const auto param = parseParameters<TileParameters>(first, last);
escape(&param);
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
#include "engine/api/trip_parameters.hpp"
#include "server/api/parameters_parser.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::api::parseParameters;
using osrm::engine::api::TripParameters;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
const auto last = end(in);
const auto param = parseParameters<TripParameters>(first, last);
escape(&param);
return 0;
}
-21
View File
@@ -1,21 +0,0 @@
#include "server/api/url_parser.hpp"
#include "util/string_util.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::util::URIDecode;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
const std::string in(reinterpret_cast<const char *>(data), size);
std::string out;
(void)URIDecode(in, out);
escape(out.data());
return 0;
}
-21
View File
@@ -1,21 +0,0 @@
#include "server/api/url_parser.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::api::parseURL;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
const auto last = end(in);
const auto param = parseURL(first, last);
escape(&param);
return 0;
}
-16
View File
@@ -1,16 +0,0 @@
#ifndef OSRM_FUZZ_UTIL_HPP
#define OSRM_FUZZ_UTIL_HPP
#include <type_traits>
// Fakes observable side effects the compiler can not optimize away
template <typename T> inline void escape(T p)
{
static_assert(std::is_pointer<T>::value, "");
asm volatile("" : : "g"((void *)p) : "memory");
}
// Possibly reads and writes all the memory in your system
inline void clobber() { asm volatile("" : : : "memory"); }
#endif
+7 -12
View File
@@ -150,7 +150,6 @@ class RouteAPI : public BaseAPI
leg_geometry,
phantoms.source_phantom,
phantoms.target_phantom);
leg.steps = guidance::removeLanesFromRoundabouts(std::move(leg.steps));
leg.steps = guidance::anticipateLaneChange(std::move(leg.steps));
leg.steps = guidance::collapseUseLane(std::move(leg.steps));
leg_geometry = guidance::resyncGeometry(std::move(leg_geometry), leg.steps);
@@ -207,22 +206,19 @@ class RouteAPI : public BaseAPI
util::json::Array durations;
util::json::Array distances;
util::json::Array nodes;
util::json::Array datasources;
auto &leg_geometry = leg_geometries[idx];
durations.values.reserve(leg_geometry.annotations.size());
distances.values.reserve(leg_geometry.annotations.size());
nodes.values.reserve(leg_geometry.osm_node_ids.size());
datasources.values.reserve(leg_geometry.annotations.size());
std::for_each(leg_geometry.annotations.begin(),
leg_geometry.annotations.end(),
[this, &durations, &distances, &datasources](
const guidance::LegGeometry::Annotation &step) {
durations.values.push_back(step.duration);
distances.values.push_back(step.distance);
datasources.values.push_back(step.datasource);
});
std::for_each(
leg_geometry.annotations.begin(),
leg_geometry.annotations.end(),
[this, &durations, &distances](const guidance::LegGeometry::Annotation &step) {
durations.values.push_back(step.duration);
distances.values.push_back(step.distance);
});
std::for_each(leg_geometry.osm_node_ids.begin(),
leg_geometry.osm_node_ids.end(),
[this, &nodes](const OSMNodeID &node_id) {
@@ -232,7 +228,6 @@ class RouteAPI : public BaseAPI
annotation.values["distance"] = std::move(distances);
annotation.values["duration"] = std::move(durations);
annotation.values["nodes"] = std::move(nodes);
annotation.values["datasources"] = std::move(datasources);
annotations.push_back(std::move(annotation));
}
}
@@ -152,8 +152,6 @@ class BaseDataFacade
virtual std::string GetNameForID(const unsigned name_id) const = 0;
virtual std::string GetRefForID(const unsigned name_id) const = 0;
virtual std::string GetPronunciationForID(const unsigned name_id) const = 0;
virtual std::string GetDestinationsForID(const unsigned name_id) const = 0;
@@ -360,7 +360,7 @@ class InternalDataFacade final : public BaseDataFacade
std::vector<util::guidance::BearingClass> bearing_classes;
// and the actual bearing values
std::uint64_t num_bearings;
intersection_stream.read(reinterpret_cast<char *>(&num_bearings), sizeof(num_bearings));
intersection_stream.read(reinterpret_cast<char*>(&num_bearings),sizeof(num_bearings));
m_bearing_values_table.resize(num_bearings);
intersection_stream.read(reinterpret_cast<char *>(&m_bearing_values_table[0]),
sizeof(m_bearing_values_table[0]) * num_bearings);
@@ -636,15 +636,6 @@ class InternalDataFacade final : public BaseDataFacade
return result;
}
std::string GetRefForID(const unsigned name_id) const override final
{
// We store the ref after the name, destination and pronunciation of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2), ref (3)
return GetNameForID(name_id + 3);
}
std::string GetPronunciationForID(const unsigned name_id) const override final
{
// We store the pronunciation after the name and destination of a street.
@@ -276,6 +276,11 @@ class SharedDataFacade final : public BaseDataFacade
void LoadCoreInformation()
{
if (data_layout->num_entries[storage::SharedDataLayout::CORE_MARKER] <= 0)
{
return;
}
auto core_marker_ptr = data_layout->GetBlockPtr<unsigned>(
shared_memory, storage::SharedDataLayout::CORE_MARKER);
util::ShM<bool, true>::vector is_core_node(
@@ -707,21 +712,12 @@ class SharedDataFacade final : public BaseDataFacade
return result;
}
std::string GetRefForID(const unsigned name_id) const override final
{
// We store the ref after the name, destination and pronunciation of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2), ref (3)
return GetNameForID(name_id + 3);
}
std::string GetPronunciationForID(const unsigned name_id) const override final
{
// We store the pronunciation after the name and destination of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2), ref (3)
// name (0), destination (1), pronunciation (2)
return GetNameForID(name_id + 2);
}
@@ -730,7 +726,7 @@ class SharedDataFacade final : public BaseDataFacade
// We store the destination after the name of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2), ref (3)
// name (0), destination (1), pronunciation (2)
return GetNameForID(name_id + 1);
}
@@ -844,8 +840,7 @@ class SharedDataFacade final : public BaseDataFacade
else
return extractor::guidance::TurnLaneDescription(
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id],
m_lane_description_masks.begin() +
m_lane_description_offsets[lane_description_id + 1]);
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id + 1]);
}
};
}
-2
View File
@@ -51,7 +51,6 @@ namespace engine
* - Route
* - Table
* - Match
* - Nearest
*
* In addition, shared memory can be used for datasets loaded with osrm-datastore.
*
@@ -66,7 +65,6 @@ struct EngineConfig final
int max_locations_viaroute = -1;
int max_locations_distance_table = -1;
int max_locations_map_matching = -1;
int max_results_nearest = -1;
bool use_shared_memory = true;
};
}
+31 -100
View File
@@ -20,12 +20,6 @@ namespace osrm
namespace engine
{
inline std::pair<bool, bool> boolPairAnd(const std::pair<bool, bool> &A,
const std::pair<bool, bool> &B)
{
return std::make_pair(A.first && B.first, A.second && B.second);
}
// Implements complex queries on top of an RTree and builds PhantomNodes from it.
//
// Only holds a weak reference on the RTree and coordinates!
@@ -54,7 +48,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
{
auto results =
rtree.Nearest(input_coordinate,
[this](const CandidateSegment &segment) { return HasValidEdge(segment); },
[](const CandidateSegment &) { return std::make_pair(true, true); },
[this, max_distance, input_coordinate](const std::size_t,
const CandidateSegment &segment) {
return CheckSegmentDistance(input_coordinate, segment, max_distance);
@@ -74,8 +68,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
auto results = rtree.Nearest(
input_coordinate,
[this, bearing, bearing_range, max_distance](const CandidateSegment &segment) {
return boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
HasValidEdge(segment));
return CheckSegmentBearing(segment, bearing, bearing_range);
},
[this, max_distance, input_coordinate](const std::size_t,
const CandidateSegment &segment) {
@@ -93,15 +86,14 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
const int bearing,
const int bearing_range) const
{
auto results = rtree.Nearest(
input_coordinate,
[this, bearing, bearing_range](const CandidateSegment &segment) {
return boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
HasValidEdge(segment));
},
[max_results](const std::size_t num_results, const CandidateSegment &) {
return num_results >= max_results;
});
auto results =
rtree.Nearest(input_coordinate,
[this, bearing, bearing_range](const CandidateSegment &segment) {
return CheckSegmentBearing(segment, bearing, bearing_range);
},
[max_results](const std::size_t num_results, const CandidateSegment &) {
return num_results >= max_results;
});
return MakePhantomNodes(input_coordinate, results);
}
@@ -116,17 +108,16 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
const int bearing,
const int bearing_range) const
{
auto results = rtree.Nearest(
input_coordinate,
[this, bearing, bearing_range](const CandidateSegment &segment) {
return boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
HasValidEdge(segment));
},
[this, max_distance, max_results, input_coordinate](const std::size_t num_results,
const CandidateSegment &segment) {
return num_results >= max_results ||
CheckSegmentDistance(input_coordinate, segment, max_distance);
});
auto results =
rtree.Nearest(input_coordinate,
[this, bearing, bearing_range](const CandidateSegment &segment) {
return CheckSegmentBearing(segment, bearing, bearing_range);
},
[this, max_distance, max_results, input_coordinate](
const std::size_t num_results, const CandidateSegment &segment) {
return num_results >= max_results ||
CheckSegmentDistance(input_coordinate, segment, max_distance);
});
return MakePhantomNodes(input_coordinate, results);
}
@@ -138,7 +129,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
{
auto results =
rtree.Nearest(input_coordinate,
[this](const CandidateSegment &segment) { return HasValidEdge(segment); },
[](const CandidateSegment &) { return std::make_pair(true, true); },
[max_results](const std::size_t num_results, const CandidateSegment &) {
return num_results >= max_results;
});
@@ -155,7 +146,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
{
auto results =
rtree.Nearest(input_coordinate,
[this](const CandidateSegment &segment) { return HasValidEdge(segment); },
[](const CandidateSegment &) { return std::make_pair(true, true); },
[this, max_distance, max_results, input_coordinate](
const std::size_t num_results, const CandidateSegment &segment) {
return num_results >= max_results ||
@@ -175,18 +166,14 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
bool has_big_component = false;
auto results = rtree.Nearest(
input_coordinate,
[this, &has_big_component, &has_small_component](const CandidateSegment &segment) {
[&has_big_component, &has_small_component](const CandidateSegment &segment) {
auto use_segment = (!has_small_component ||
(!has_big_component && !segment.data.component.is_tiny));
auto use_directions = std::make_pair(use_segment, use_segment);
const auto valid_edges = HasValidEdge(segment);
if (valid_edges.first || valid_edges.second)
{
has_big_component = has_big_component || !segment.data.component.is_tiny;
has_small_component = has_small_component || segment.data.component.is_tiny;
}
use_directions = boolPairAnd(use_directions, valid_edges);
has_big_component = has_big_component || !segment.data.component.is_tiny;
has_small_component = has_small_component || segment.data.component.is_tiny;
return use_directions;
},
[this, &has_big_component, max_distance, input_coordinate](
@@ -214,22 +201,14 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
bool has_big_component = false;
auto results = rtree.Nearest(
input_coordinate,
[this, &has_big_component, &has_small_component](const CandidateSegment &segment) {
[&has_big_component, &has_small_component](const CandidateSegment &segment) {
auto use_segment = (!has_small_component ||
(!has_big_component && !segment.data.component.is_tiny));
auto use_directions = std::make_pair(use_segment, use_segment);
if (!use_directions.first && !use_directions.second)
return use_directions;
const auto valid_edges = HasValidEdge(segment);
if (valid_edges.first || valid_edges.second)
{
has_big_component = has_big_component || !segment.data.component.is_tiny;
has_small_component = has_small_component || segment.data.component.is_tiny;
has_big_component = has_big_component || !segment.data.component.is_tiny;
has_small_component = has_small_component || segment.data.component.is_tiny;
}
use_directions = boolPairAnd(use_directions, valid_edges);
return use_directions;
},
[&has_big_component](const std::size_t num_results, const CandidateSegment &) {
@@ -260,13 +239,10 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
auto use_segment = (!has_small_component ||
(!has_big_component && !segment.data.component.is_tiny));
auto use_directions = std::make_pair(use_segment, use_segment);
use_directions = boolPairAnd(use_directions, HasValidEdge(segment));
if (use_segment)
{
use_directions =
boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
HasValidEdge(segment));
use_directions = CheckSegmentBearing(segment, bearing, bearing_range);
if (use_directions.first || use_directions.second)
{
has_big_component = has_big_component || !segment.data.component.is_tiny;
@@ -307,13 +283,10 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
auto use_segment = (!has_small_component ||
(!has_big_component && !segment.data.component.is_tiny));
auto use_directions = std::make_pair(use_segment, use_segment);
use_directions = boolPairAnd(use_directions, HasValidEdge(segment));
if (use_segment)
{
use_directions =
boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
HasValidEdge(segment));
use_directions = CheckSegmentBearing(segment, bearing, bearing_range);
if (use_directions.first || use_directions.second)
{
has_big_component = has_big_component || !segment.data.component.is_tiny;
@@ -467,48 +440,6 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
return std::make_pair(forward_bearing_valid, backward_bearing_valid);
}
/**
* Checks to see if the edge weights are valid. We might have an edge,
* but a traffic update might set the speed to 0 (weight == INVALID_EDGE_WEIGHT).
* which means that this edge is not currently traversible. If this is the case,
* then we shouldn't snap to this edge.
*/
std::pair<bool, bool> HasValidEdge(const CandidateSegment &segment) const
{
bool forward_edge_valid = false;
bool reverse_edge_valid = false;
if (segment.data.forward_packed_geometry_id != SPECIAL_EDGEID)
{
std::vector<EdgeWeight> forward_weight_vector;
datafacade.GetUncompressedWeights(segment.data.forward_packed_geometry_id,
forward_weight_vector);
if (forward_weight_vector[segment.data.fwd_segment_position] != INVALID_EDGE_WEIGHT)
{
forward_edge_valid = segment.data.forward_segment_id.enabled;
}
}
if (segment.data.reverse_packed_geometry_id != SPECIAL_EDGEID)
{
std::vector<EdgeWeight> reverse_weight_vector;
datafacade.GetUncompressedWeights(segment.data.reverse_packed_geometry_id,
reverse_weight_vector);
BOOST_ASSERT(segment.data.fwd_segment_position < reverse_weight_vector.size());
if (reverse_weight_vector[reverse_weight_vector.size() -
segment.data.fwd_segment_position - 1] != INVALID_EDGE_WEIGHT)
{
reverse_edge_valid = segment.data.reverse_segment_id.enabled;
}
}
return std::make_pair(forward_edge_valid, reverse_edge_valid);
}
const RTreeT &rtree;
const CoordinateList &coordinates;
DataFacadeT &datafacade;
+3 -13
View File
@@ -50,10 +50,6 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
geometry.osm_node_ids.push_back(facade.GetOSMNodeIDOfNode(
reverse_geometry[reverse_geometry.size() - source_node.fwd_segment_position - 1]));
std::vector<uint8_t> forward_datasource_vector;
facade.GetUncompressedDatasources(source_node.forward_packed_geometry_id,
forward_datasource_vector);
auto cumulative_distance = 0.;
auto current_distance = 0.;
auto prev_coordinate = geometry.locations.front();
@@ -73,8 +69,8 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
}
prev_coordinate = coordinate;
geometry.annotations.emplace_back(LegGeometry::Annotation{
current_distance, path_point.duration_until_turn / 10., path_point.datasource_id});
geometry.annotations.emplace_back(
LegGeometry::Annotation{current_distance, path_point.duration_until_turn / 10.});
geometry.locations.push_back(std::move(coordinate));
geometry.osm_node_ids.push_back(facade.GetOSMNodeIDOfNode(path_point.turn_via_node));
}
@@ -83,14 +79,8 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
cumulative_distance += current_distance;
// segment leading to the target node
geometry.segment_distances.push_back(cumulative_distance);
std::vector<DatasourceID> forward_datasources;
facade.GetUncompressedDatasources(target_node.forward_packed_geometry_id, forward_datasources);
geometry.annotations.emplace_back(
LegGeometry::Annotation{current_distance,
target_node.forward_weight / 10.,
forward_datasources[target_node.fwd_segment_position]});
LegGeometry::Annotation{current_distance, target_node.forward_weight / 10.});
geometry.segment_offsets.push_back(geometry.locations.size());
geometry.locations.push_back(target_node.location);
+1 -11
View File
@@ -103,18 +103,15 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
{
BOOST_ASSERT(segment_duration >= 0);
const auto name = facade.GetNameForID(step_name_id);
const auto ref = facade.GetRefForID(step_name_id);
const auto pronunciation = facade.GetPronunciationForID(step_name_id);
const auto destinations = facade.GetDestinationsForID(step_name_id);
const auto distance = leg_geometry.segment_distances[segment_index];
steps.push_back(RouteStep{step_name_id,
std::move(name),
std::move(ref),
std::move(pronunciation),
std::move(destinations),
NO_ROTARY_NAME,
NO_ROTARY_NAME,
segment_duration / 10.0,
distance,
path_point.travel_mode,
@@ -170,11 +167,9 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
BOOST_ASSERT(duration >= 0);
steps.push_back(RouteStep{step_name_id,
facade.GetNameForID(step_name_id),
facade.GetRefForID(step_name_id),
facade.GetPronunciationForID(step_name_id),
facade.GetDestinationsForID(step_name_id),
NO_ROTARY_NAME,
NO_ROTARY_NAME,
duration / 10.,
distance,
target_mode,
@@ -197,11 +192,9 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
steps.push_back(RouteStep{source_node.name_id,
facade.GetNameForID(source_node.name_id),
facade.GetRefForID(source_node.name_id),
facade.GetPronunciationForID(source_node.name_id),
facade.GetDestinationsForID(source_node.name_id),
NO_ROTARY_NAME,
NO_ROTARY_NAME,
duration / 10.,
leg_geometry.segment_distances[segment_index],
source_mode,
@@ -233,11 +226,9 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
BOOST_ASSERT(!leg_geometry.locations.empty());
steps.push_back(RouteStep{target_node.name_id,
facade.GetNameForID(target_node.name_id),
facade.GetRefForID(target_node.name_id),
facade.GetPronunciationForID(target_node.name_id),
facade.GetDestinationsForID(target_node.name_id),
NO_ROTARY_NAME,
NO_ROTARY_NAME,
ZERO_DURATION,
ZERO_DISTANCE,
target_mode,
@@ -256,8 +247,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
BOOST_ASSERT(steps.back().intersections.front().entry.size() == 1);
BOOST_ASSERT(steps.back().maneuver.waypoint_type == WaypointType::Arrive);
BOOST_ASSERT(steps.back().intersections.front().lanes.lanes_in_turn == 0);
BOOST_ASSERT(steps.back().intersections.front().lanes.first_lane_from_the_right ==
INVALID_LANEID);
BOOST_ASSERT(steps.back().intersections.front().lanes.first_lane_from_the_right == INVALID_LANEID);
BOOST_ASSERT(steps.back().intersections.front().lane_description.empty());
return steps;
}
@@ -4,7 +4,6 @@
#include <vector>
#include "engine/guidance/route_step.hpp"
#include "util/attributes.hpp"
namespace osrm
{
@@ -18,14 +17,9 @@ namespace guidance
// we anticipate lane changes emitting only matching lanes early on.
// the second parameter describes the duration that we feel two segments need to be apart to count
// as separate maneuvers.
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
const double min_duration_needed_for_lane_change = 15);
// Remove all lane information from roundabouts. See #2626.
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> removeLanesFromRoundabouts(std::vector<RouteStep> steps);
} // namespace guidance
} // namespace engine
} // namespace osrm
-1
View File
@@ -39,7 +39,6 @@ struct LegGeometry
{
double distance;
double duration;
DatasourceID datasource;
};
std::vector<Annotation> annotations;
+1 -17
View File
@@ -1,11 +1,9 @@
#ifndef ENGINE_GUIDANCE_POST_PROCESSING_HPP
#define ENGINE_GUIDANCE_POST_PROCESSING_HPP
#include "engine/datafacade/datafacade_base.hpp"
#include "engine/guidance/leg_geometry.hpp"
#include "engine/guidance/route_step.hpp"
#include "engine/phantom_node.hpp"
#include "util/attributes.hpp"
#include <vector>
@@ -15,8 +13,8 @@ namespace engine
{
namespace guidance
{
// passed as none-reference to modify in-place and move out again
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> postProcess(std::vector<RouteStep> steps);
// Multiple possible reasons can result in unnecessary/confusing instructions
@@ -24,17 +22,8 @@ std::vector<RouteStep> postProcess(std::vector<RouteStep> steps);
// intersection would result in two instructions to turn left.
// Collapsing such turns into a single turn instruction, we give a clearer
// set of instructionst that is not cluttered by unnecessary turns/name changes.
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps);
// A check whether two instructions can be treated as one. This is only the case for very short
// maneuvers that can, in some form, be seen as one. Lookahead of one step.
bool collapsable(const RouteStep &step, const RouteStep &next);
// Elongate a step by another. the data is added either at the front, or the back
OSRM_ATTR_WARN_UNUSED
RouteStep elongate(RouteStep step, const RouteStep &by_step);
// trim initial/final segment of very short length.
// This function uses in/out parameter passing to modify both steps and geometry in place.
// We use this method since both steps and geometry are closely coupled logically but
@@ -43,18 +32,15 @@ RouteStep elongate(RouteStep step, const RouteStep &by_step);
void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry);
// assign relative locations to depart/arrive instructions
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> assignRelativeLocations(std::vector<RouteStep> steps,
const LegGeometry &geometry,
const PhantomNode &source_node,
const PhantomNode &target_node);
// collapse suppressed instructions remaining into intersections array
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps);
// remove steps invalidated by post-processing
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> removeNoTurnInstructions(std::vector<RouteStep> steps);
// remove use lane information that is not actually a turn. For post-processing, we need to
@@ -64,7 +50,6 @@ std::vector<RouteStep> removeNoTurnInstructions(std::vector<RouteStep> steps);
// FIXME this is currently only a heuristic. We need knowledge on which lanes actually might become
// turn lanes. If a straight lane becomes a turn lane, this might be something to consider. Right
// now we bet on lane-anticipation to catch this.
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps);
// postProcess will break the connection between the leg geometry
@@ -72,7 +57,6 @@ std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps);
// between routing maneuvers and the route steps itself.
// If required, we can get both in sync again using this function.
// Move in LegGeometry for modification in place.
OSRM_ATTR_WARN_UNUSED
LegGeometry resyncGeometry(LegGeometry leg_geometry, const std::vector<RouteStep> &steps);
} // namespace guidance
+2 -6
View File
@@ -25,10 +25,10 @@ namespace guidance
// a --> b --> c
// this struct saves the information of the segment b,c.
// Notable exceptions are Departure and Arrival steps.
// Departure: s --> a --> b. Represents the segment s,a with location being s.
// Departue: s --> a --> b. Represents the segment s,a with location being s.
// Arrive: a --> b --> t. The segment (b,t) is already covered by the previous segment.
// A representation of intermediate intersections
// A represenetation of intermediate intersections
struct Intersection
{
static const constexpr std::size_t NO_INDEX = std::numeric_limits<std::size_t>::max();
@@ -58,11 +58,9 @@ struct RouteStep
{
unsigned name_id;
std::string name;
std::string ref;
std::string pronunciation;
std::string destinations;
std::string rotary_name;
std::string rotary_pronunciation;
double duration;
double distance;
extractor::TravelMode mode;
@@ -80,8 +78,6 @@ inline RouteStep getInvalidRouteStep()
"",
"",
"",
"",
"",
0,
0,
TRAVEL_MODE_INACCESSIBLE,
+3 -4
View File
@@ -17,10 +17,9 @@ namespace guidance
enum class WaypointType : std::uint8_t
{
None = 0,
Arrive = 1,
Depart = 2,
MaxWaypointType = 3
None,
Arrive,
Depart,
};
struct StepManeuver
-3
View File
@@ -33,9 +33,6 @@ struct PathData
extractor::TravelMode travel_mode : 4;
// entry class of the turn, indicating possibility of turns
EntryClassID entry_classid;
// Source of the speed value on this road segment
DatasourceID datasource_id;
};
struct InternalRouteResult
+1 -4
View File
@@ -15,12 +15,9 @@ namespace plugins
class NearestPlugin final : public BasePlugin
{
public:
explicit NearestPlugin(datafacade::BaseDataFacade &facade, const int max_results);
explicit NearestPlugin(datafacade::BaseDataFacade &facade);
Status HandleRequest(const api::NearestParameters &params, util::json::Object &result);
private:
const int max_results;
};
}
}
@@ -90,11 +90,14 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
if (new_distance < upper_bound)
{
// if loops are forced, they are so at the source
if ((force_loop_forward && forward_heap.GetData(node).parent == node) ||
(force_loop_reverse && reverse_heap.GetData(node).parent == node) ||
// in this case we are looking at a bi-directional way where the source
// and target phantom are on the same edge based node
new_distance < 0)
if (new_distance >= 0 &&
(!force_loop_forward || forward_heap.GetData(node).parent != node) &&
(!force_loop_reverse || reverse_heap.GetData(node).parent != node))
{
middle_node_id = node;
upper_bound = new_distance;
}
else
{
// check whether there is a loop present at the node
for (const auto edge : facade->GetAdjacentEdgeRange(node))
@@ -118,13 +121,6 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
}
}
}
else
{
BOOST_ASSERT(new_distance >= 0);
middle_node_id = node;
upper_bound = new_distance;
}
}
}
@@ -298,18 +294,16 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
? phantom_node_pair.source_phantom.backward_travel_mode
: facade->GetTravelModeForEdgeID(ed.id);
const auto geometry_index = facade->GetGeometryIndexForEdgeID(ed.id);
std::vector<NodeID> id_vector;
facade->GetUncompressedGeometry(geometry_index, id_vector);
facade->GetUncompressedGeometry(facade->GetGeometryIndexForEdgeID(ed.id),
id_vector);
BOOST_ASSERT(id_vector.size() > 0);
std::vector<EdgeWeight> weight_vector;
facade->GetUncompressedWeights(geometry_index, weight_vector);
facade->GetUncompressedWeights(facade->GetGeometryIndexForEdgeID(ed.id),
weight_vector);
BOOST_ASSERT(weight_vector.size() > 0);
std::vector<DatasourceID> datasource_vector;
facade->GetUncompressedDatasources(geometry_index, datasource_vector);
auto total_weight = std::accumulate(weight_vector.begin(), weight_vector.end(), 0);
BOOST_ASSERT(weight_vector.size() == id_vector.size());
@@ -335,8 +329,7 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
extractor::guidance::TurnInstruction::NO_TURN(),
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
travel_mode,
INVALID_ENTRY_CLASSID,
datasource_vector[i]});
INVALID_ENTRY_CLASSID});
}
BOOST_ASSERT(unpacked_path.size() > 0);
if (facade->hasLaneData(ed.id))
@@ -350,7 +343,6 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
std::size_t start_index = 0, end_index = 0;
std::vector<unsigned> id_vector;
std::vector<EdgeWeight> weight_vector;
std::vector<DatasourceID> datasource_vector;
const bool is_local_path = (phantom_node_pair.source_phantom.forward_packed_geometry_id ==
phantom_node_pair.target_phantom.forward_packed_geometry_id) &&
unpacked_path.empty();
@@ -363,9 +355,6 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
facade->GetUncompressedWeights(
phantom_node_pair.target_phantom.reverse_packed_geometry_id, weight_vector);
facade->GetUncompressedDatasources(
phantom_node_pair.target_phantom.reverse_packed_geometry_id, datasource_vector);
if (is_local_path)
{
start_index =
@@ -386,9 +375,6 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
facade->GetUncompressedWeights(
phantom_node_pair.target_phantom.forward_packed_geometry_id, weight_vector);
facade->GetUncompressedDatasources(
phantom_node_pair.target_phantom.forward_packed_geometry_id, datasource_vector);
}
// Given the following compressed geometry:
@@ -410,8 +396,7 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{{0, INVALID_LANEID}, INVALID_LANE_DESCRIPTIONID},
target_traversed_in_reverse ? phantom_node_pair.target_phantom.backward_travel_mode
: phantom_node_pair.target_phantom.forward_travel_mode,
INVALID_ENTRY_CLASSID,
datasource_vector[i]});
INVALID_ENTRY_CLASSID});
}
if (unpacked_path.size() > 0)
@@ -528,12 +513,7 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
std::vector<NodeID> &packed_path) const
{
NodeID current_node_id = middle_node_id;
// all initial nodes will have itself as parent, or a node not in the heap
// in case of a core search heap. We need a distinction between core entry nodes
// and start nodes since otherwise start node specific code that assumes
// node == node.parent (e.g. the loop code) might get actived.
while (current_node_id != search_heap.GetData(current_node_id).parent &&
search_heap.WasInserted(search_heap.GetData(current_node_id).parent))
while (current_node_id != search_heap.GetData(current_node_id).parent)
{
current_node_id = search_heap.GetData(current_node_id).parent;
packed_path.emplace_back(current_node_id);
@@ -645,9 +625,8 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
NodeID middle = SPECIAL_NODEID;
distance = duration_upper_bound;
using CoreEntryPoint = std::tuple<NodeID, EdgeWeight, NodeID>;
std::vector<CoreEntryPoint> forward_entry_points;
std::vector<CoreEntryPoint> reverse_entry_points;
std::vector<std::pair<NodeID, EdgeWeight>> forward_entry_points;
std::vector<std::pair<NodeID, EdgeWeight>> reverse_entry_points;
// get offset to account for offsets on phantom nodes on compressed edges
const auto min_edge_offset = std::min(0, forward_heap.MinKey());
@@ -664,7 +643,7 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{
const NodeID node = forward_heap.DeleteMin();
const int key = forward_heap.GetKey(node);
forward_entry_points.emplace_back(node, key, forward_heap.GetData(node).parent);
forward_entry_points.emplace_back(node, key);
}
else
{
@@ -685,7 +664,7 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{
const NodeID node = reverse_heap.DeleteMin();
const int key = reverse_heap.GetKey(node);
reverse_entry_points.emplace_back(node, key, reverse_heap.GetData(node).parent);
reverse_entry_points.emplace_back(node, key);
}
else
{
@@ -701,27 +680,36 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
}
}
}
const auto insertInCoreHeap = [](const CoreEntryPoint &p,
SearchEngineData::QueryHeap &core_heap) {
NodeID id;
EdgeWeight weight;
NodeID parent;
// TODO this should use std::apply when we get c++17 support
std::tie(id, weight, parent) = p;
core_heap.Insert(id, weight, parent);
// TODO check if unordered_set might be faster
// sort by id and increasing by distance
auto entry_point_comparator = [](const std::pair<NodeID, EdgeWeight> &lhs,
const std::pair<NodeID, EdgeWeight> &rhs) {
return lhs.first < rhs.first || (lhs.first == rhs.first && lhs.second < rhs.second);
};
std::sort(forward_entry_points.begin(), forward_entry_points.end(), entry_point_comparator);
std::sort(reverse_entry_points.begin(), reverse_entry_points.end(), entry_point_comparator);
NodeID last_id = SPECIAL_NODEID;
forward_core_heap.Clear();
reverse_core_heap.Clear();
for (const auto &p : forward_entry_points)
{
insertInCoreHeap(p, forward_core_heap);
if (p.first == last_id)
{
continue;
}
forward_core_heap.Insert(p.first, p.second, p.first);
last_id = p.first;
}
reverse_core_heap.Clear();
last_id = SPECIAL_NODEID;
for (const auto &p : reverse_entry_points)
{
insertInCoreHeap(p, reverse_core_heap);
if (p.first == last_id)
{
continue;
}
reverse_core_heap.Insert(p.first, p.second, p.first);
last_id = p.first;
}
// get offset to account for offsets on phantom nodes on compressed edges
@@ -114,11 +114,7 @@ class ShortestPathRouting final
needs_loop_forwad,
needs_loop_backwards);
}
// if no route is found between two parts of the via-route, the entire route becomes
// invalid. Adding to invalid edge weight sadly doesn't return an invalid edge weight. Here
// we prevent the possible overflow, faking the addition of infinity + x == infinity
if (new_total_distance != INVALID_EDGE_WEIGHT)
new_total_distance += std::min(total_distance_to_forward, total_distance_to_reverse);
new_total_distance += std::min(total_distance_to_forward, total_distance_to_reverse);
}
// searches shortest path between:
+21 -20
View File
@@ -36,13 +36,13 @@
#include <boost/filesystem/fstream.hpp>
struct lua_State;
namespace osrm
{
namespace extractor
{
class ScriptingEnvironment;
namespace lookup
{
// Set to 1 byte alignment
@@ -83,21 +83,21 @@ class EdgeBasedGraphFactory
EdgeBasedGraphFactory(const EdgeBasedGraphFactory &) = delete;
EdgeBasedGraphFactory &operator=(const EdgeBasedGraphFactory &) = delete;
explicit EdgeBasedGraphFactory(std::shared_ptr<util::NodeBasedDynamicGraph> node_based_graph,
const CompressedEdgeContainer &compressed_edge_container,
const std::unordered_set<NodeID> &barrier_nodes,
const std::unordered_set<NodeID> &traffic_lights,
std::shared_ptr<const RestrictionMap> restriction_map,
const std::vector<QueryNode> &node_info_list,
ProfileProperties profile_properties,
const util::NameTable &name_table,
std::vector<std::uint32_t> &turn_lane_offsets,
std::vector<guidance::TurnLaneType::Mask> &turn_lane_masks,
guidance::LaneDescriptionMap &lane_description_map);
explicit EdgeBasedGraphFactory(
std::shared_ptr<util::NodeBasedDynamicGraph> node_based_graph,
const CompressedEdgeContainer &compressed_edge_container,
const std::unordered_set<NodeID> &barrier_nodes,
const std::unordered_set<NodeID> &traffic_lights,
std::shared_ptr<const RestrictionMap> restriction_map,
const std::vector<QueryNode> &node_info_list,
ProfileProperties profile_properties,
const util::NameTable &name_table,
const std::vector<std::uint32_t> &turn_lane_offsets,
const std::vector<guidance::TurnLaneType::Mask> &turn_lane_masks);
void Run(ScriptingEnvironment &scripting_environment,
const std::string &original_edge_data_filename,
void Run(const std::string &original_edge_data_filename,
const std::string &turn_lane_data_filename,
lua_State *lua_state,
const std::string &edge_segment_lookup_filename,
const std::string &edge_penalty_filename,
const bool generate_edge_lookup);
@@ -127,6 +127,8 @@ class EdgeBasedGraphFactory
const NodeID w,
const double angle) const;
std::int32_t GetTurnPenalty(double angle, lua_State *lua_state) const;
private:
using EdgeData = util::NodeBasedDynamicGraph::EdgeData;
@@ -154,16 +156,15 @@ class EdgeBasedGraphFactory
ProfileProperties profile_properties;
const util::NameTable &name_table;
std::vector<std::uint32_t> &turn_lane_offsets;
std::vector<guidance::TurnLaneType::Mask> &turn_lane_masks;
guidance::LaneDescriptionMap &lane_description_map;
const std::vector<std::uint32_t> &turn_lane_offsets;
const std::vector<guidance::TurnLaneType::Mask> &turn_lane_masks;
void CompressGeometry();
unsigned RenumberEdges();
void GenerateEdgeExpandedNodes();
void GenerateEdgeExpandedEdges(ScriptingEnvironment &scripting_environment,
const std::string &original_edge_data_filename,
void GenerateEdgeExpandedEdges(const std::string &original_edge_data_filename,
const std::string &turn_lane_data_filename,
lua_State *lua_state,
const std::string &edge_segment_lookup_filename,
const std::string &edge_fixed_penalties_filename,
const bool generate_edge_lookup);
+8 -5
View File
@@ -34,16 +34,16 @@ class ExtractionContainers
#endif
void PrepareNodes();
void PrepareRestrictions();
void PrepareEdges(ScriptingEnvironment &scripting_environment);
void PrepareEdges(lua_State *segment_state);
void WriteNodes(std::ofstream &file_out_stream) const;
void WriteRestrictions(const std::string &restrictions_file_name) const;
void WriteEdges(std::ofstream &file_out_stream) const;
void WriteCharData(const std::string &file_name);
void
WriteTurnLaneMasks(const std::string &file_name,
const stxxl::vector<std::uint32_t> &turn_lane_offsets,
const stxxl::vector<guidance::TurnLaneType::Mask> &turn_lane_masks) const;
void WriteCharData(const std::string &file_name);
public:
using STXXLNodeIDVector = stxxl::vector<OSMNodeID>;
@@ -60,6 +60,8 @@ class ExtractionContainers
STXXLNameCharData name_char_data;
STXXLNameOffsets name_offsets;
// an adjacency array containing all turn lane masks
stxxl::vector<std::uint32_t> turn_lane_offsets;
stxxl::vector<guidance::TurnLaneType::Mask> turn_lane_masks;
STXXLRestrictionsVector restrictions_list;
STXXLWayIDStartEndVector way_start_end_id_list;
std::unordered_map<OSMNodeID, NodeID> external_to_internal_node_id_map;
@@ -67,10 +69,11 @@ class ExtractionContainers
ExtractionContainers();
void PrepareData(ScriptingEnvironment &scripting_environment,
const std::string &output_file_name,
void PrepareData(const std::string &output_file_name,
const std::string &restrictions_file_name,
const std::string &names_file_name);
const std::string &names_file_name,
const std::string &turn_lane_file_name,
lua_State *segment_state);
};
}
}
@@ -106,12 +106,6 @@ trimLaneString(std::string lane_string, std::int32_t count_left, std::int32_t co
{
return extractor::guidance::trimLaneString(std::move(lane_string), count_left, count_right);
}
inline std::string applyAccessTokens(const std::string &lane_string,
const std::string &access_tokens)
{
return extractor::guidance::applyAccessTokens(lane_string, access_tokens);
}
}
}
-5
View File
@@ -1,7 +1,6 @@
#ifndef EXTRACTION_WAY_HPP
#define EXTRACTION_WAY_HPP
#include "extractor/guidance/road_classification.hpp"
#include "extractor/travel_mode.hpp"
#include "util/guidance/turn_lanes.hpp"
#include "util/typedefs.hpp"
@@ -33,14 +32,12 @@ struct ExtractionWay
is_startpoint = true;
is_access_restricted = false;
name.clear();
ref.clear();
pronunciation.clear();
destinations.clear();
forward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
backward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
turn_lanes_forward.clear();
turn_lanes_backward.clear();
road_classification = guidance::RoadClassification();
}
// These accessors exists because it's not possible to take the address of a bitfield,
@@ -54,7 +51,6 @@ struct ExtractionWay
double backward_speed;
double duration;
std::string name;
std::string ref;
std::string pronunciation;
std::string destinations;
std::string turn_lanes_forward;
@@ -64,7 +60,6 @@ struct ExtractionWay
bool is_startpoint;
TravelMode forward_travel_mode : 4;
TravelMode backward_travel_mode : 4;
guidance::RoadClassification road_classification;
};
}
}
+3 -14
View File
@@ -35,7 +35,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "util/guidance/bearing_class.hpp"
#include "util/guidance/entry_class.hpp"
#include "util/guidance/turn_lanes.hpp"
#include "util/typedefs.hpp"
@@ -44,20 +43,20 @@ namespace osrm
namespace extractor
{
class ScriptingEnvironment;
struct ProfileProperties;
class Extractor
{
public:
Extractor(ExtractorConfig extractor_config) : config(std::move(extractor_config)) {}
int run(ScriptingEnvironment &scripting_environment);
int run();
private:
ExtractorConfig config;
std::pair<std::size_t, EdgeID>
BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment,
BuildEdgeExpandedGraph(lua_State *lua_state,
const ProfileProperties &profile_properties,
std::vector<QueryNode> &internal_to_external_node_map,
std::vector<EdgeBasedNode> &node_based_edge_list,
std::vector<bool> &node_is_startpoint,
@@ -88,16 +87,6 @@ class Extractor
const std::vector<std::uint32_t> &node_based_intersection_classes,
const std::vector<util::guidance::BearingClass> &bearing_classes,
const std::vector<util::guidance::EntryClass> &entry_classes) const;
void WriteTurnLaneData(const std::string &turn_lane_file) const;
// globals persisting during the extraction process and the graph generation process
// during turn lane analysis, we might have to combine lanes for roads that are modelled as two
// but are more or less experienced as one. This can be due to solid lines in between lanes, for
// example, that genereate a small separation between them. As a result, we might have to
// augment the turn lane map during processing, further adding more types.
guidance::LaneDescriptionMap turn_lane_map;
};
}
}
+6 -28
View File
@@ -1,8 +1,8 @@
#ifndef EXTRACTOR_CALLBACKS_HPP
#define EXTRACTOR_CALLBACKS_HPP
#include "extractor/guidance/turn_lane_types.hpp"
#include "util/typedefs.hpp"
#include "extractor/guidance/turn_lane_types.hpp"
#include <boost/functional/hash.hpp>
#include <boost/optional/optional_fwd.hpp>
@@ -16,24 +16,6 @@ class Node;
class Way;
}
namespace std
{
template <> struct hash<std::tuple<std::string, std::string, std::string, std::string>>
{
std::size_t
operator()(const std::tuple<std::string, std::string, std::string, std::string> &mk) const
noexcept
{
std::size_t seed = 0;
boost::hash_combine(seed, std::get<0>(mk));
boost::hash_combine(seed, std::get<1>(mk));
boost::hash_combine(seed, std::get<2>(mk));
boost::hash_combine(seed, std::get<3>(mk));
return seed;
}
};
}
namespace osrm
{
namespace extractor
@@ -45,7 +27,7 @@ struct ExtractionNode;
struct ExtractionWay;
/**
* This class is used by the extractor with the results of the
* This class is uses by the extractor with the results of the
* osmium based parsing and the customization through the lua profile.
*
* It mediates between the multi-threaded extraction process and the external memory containers.
@@ -54,12 +36,11 @@ struct ExtractionWay;
class ExtractorCallbacks
{
private:
// used to deduplicate street names, refs, destinations, pronunciation: actually maps to name
// ids
using MapKey = std::tuple<std::string, std::string, std::string, std::string>;
// used to deduplicate street names and street destinations: actually maps to name ids
using MapKey = std::pair<std::string, std::string>;
using MapVal = unsigned;
std::unordered_map<MapKey, MapVal> string_map;
guidance::LaneDescriptionMap lane_description_map;
std::unordered_map<MapKey, MapVal, boost::hash<MapKey>> string_map;
std::unordered_map<guidance::TurnLaneDescription,LaneDescriptionID,guidance::TurnLaneDescription_hash> lane_description_map;
ExtractionContainers &external_memory;
public:
@@ -76,9 +57,6 @@ class ExtractorCallbacks
// warning: caller needs to take care of synchronization!
void ProcessWay(const osmium::Way &current_way, const ExtractionWay &result_way);
// destroys the internal laneDescriptionMap
guidance::LaneDescriptionMap &&moveOutLaneDescriptionMap();
};
}
}
+1
View File
@@ -77,6 +77,7 @@ struct ExtractorConfig
intersection_class_data_output_path = basepath + ".osrm.icd";
}
boost::filesystem::path config_file_path;
boost::filesystem::path input_path;
boost::filesystem::path profile_path;
@@ -0,0 +1,84 @@
#ifndef OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_
#define OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_
#include <cstdint>
#include <string>
// Forward Declaration to allow usage of external osmium::Way
namespace osmium
{
class Way;
}
namespace osrm
{
namespace extractor
{
namespace guidance
{
enum class FunctionalRoadClass : std::uint8_t
{
UNKNOWN = 0,
MOTORWAY,
MOTORWAY_LINK,
TRUNK,
TRUNK_LINK,
PRIMARY,
PRIMARY_LINK,
SECONDARY,
SECONDARY_LINK,
TERTIARY,
TERTIARY_LINK,
UNCLASSIFIED,
RESIDENTIAL,
SERVICE,
LIVING_STREET,
LOW_PRIORITY_ROAD // a road simply included for connectivity. Should be avoided at all cost
};
FunctionalRoadClass functionalRoadClassFromTag(std::string const &tag);
inline bool isRampClass(const FunctionalRoadClass road_class)
{
// Primary Roads and down are usually too small to announce their links as ramps
return road_class == FunctionalRoadClass::MOTORWAY_LINK ||
road_class == FunctionalRoadClass::TRUNK_LINK;
}
// Links are usually smaller than ramps, but are sometimes tagged
// as MOTORWAY_LINK if they exit/enter a motorway/trunk road.
inline bool isLinkClass(const FunctionalRoadClass road_class)
{
return road_class == FunctionalRoadClass::MOTORWAY_LINK ||
road_class == FunctionalRoadClass::TRUNK_LINK ||
road_class == FunctionalRoadClass::PRIMARY_LINK ||
road_class == FunctionalRoadClass::SECONDARY_LINK ||
road_class == FunctionalRoadClass::TERTIARY_LINK;
}
// check wheter a class is a motorway like class
inline bool isMotorwayClass(const FunctionalRoadClass road_class)
{
return road_class == FunctionalRoadClass::MOTORWAY || road_class == FunctionalRoadClass::TRUNK;
}
// TODO augment this with all data required for guidance generation
struct RoadClassificationData
{
FunctionalRoadClass road_class = FunctionalRoadClass::UNKNOWN;
void augment(const osmium::Way &way);
};
inline bool operator==(const RoadClassificationData lhs, const RoadClassificationData rhs)
{
return lhs.road_class == rhs.road_class;
}
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif // OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_
+3 -12
View File
@@ -18,24 +18,15 @@ const double constexpr MAXIMAL_ALLOWED_NO_TURN_DEVIATION = 3.;
const double constexpr NARROW_TURN_ANGLE = 40.;
const double constexpr GROUP_ANGLE = 60;
// angle difference that can be classified as straight, if its the only narrow turn
const double constexpr FUZZY_ANGLE_DIFFERENCE = 25.;
const double constexpr FUZZY_ANGLE_DIFFERENCE = 20.;
const double constexpr DISTINCTION_RATIO = 2;
// Named roundabouts with radii larger then than this are seen as rotary
const double constexpr MAX_ROUNDABOUT_RADIUS = 15;
// Unnamed small roundabouts that look like intersections are announced as turns,
// guard against data issues or such roundabout intersections getting too large.
const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 25;
const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 5;
const double constexpr MAX_ROUNDABOUT_RADIUS = 15; // 30 m diameter as final distinction
const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
const int constexpr MAX_SLIPROAD_THRESHOLD = 250;
// Road priorities give an idea of how obvious a turn is. If two priorities differ greatly (e.g.
// service road over a primary road, the better priority can be seen as obvious due to its road
// category).
const double constexpr PRIORITY_DISTINCTION_FACTOR = 2.0;
} // namespace guidance
} // namespace extractor
} // namespace osrm
@@ -5,7 +5,6 @@
#include "extractor/guidance/intersection.hpp"
#include "extractor/query_node.hpp"
#include "extractor/restriction_map.hpp"
#include "util/attributes.hpp"
#include "util/name_table.hpp"
#include "util/node_based_graph.hpp"
#include "util/typedefs.hpp"
@@ -35,17 +34,6 @@ class IntersectionGenerator
Intersection operator()(const NodeID nid, const EdgeID via_eid) const;
// Graph Compression cannot compress every setting. For example any barrier/traffic light cannot
// be compressed. As a result, a simple road of the form `a ----- b` might end up as having an
// intermediate intersection, if there is a traffic light in between. If we want to look farther
// down a road, finding the next actual decision requires the look at multiple intersections.
// Here we follow the road until we either reach a dead end or find the next intersection with
// more than a single next road.
Intersection GetActualNextIntersection(const NodeID starting_node,
const EdgeID via_edge,
NodeID *resulting_from_node,
EdgeID *resulting_via_edge) const;
private:
const util::NodeBasedDynamicGraph &node_based_graph;
const RestrictionMap &restriction_map;
@@ -58,16 +46,7 @@ class IntersectionGenerator
// node reached
// from `from_node` via `via_eid`
// The resulting candidates have to be analysed for their actual instructions later on.
OSRM_ATTR_WARN_UNUSED
Intersection GetConnectedRoads(const NodeID from_node, const EdgeID via_eid) const;
// check if two indices in an intersection can be seen as a single road in the perceived
// intersection representation See below for an example. Utility function for
// MergeSegregatedRoads
bool CanMerge(const NodeID intersection_node,
const Intersection &intersection,
std::size_t first_index,
std::size_t second_index) const;
Intersection getConnectedRoads(const NodeID from_node, const EdgeID via_eid) const;
// Merge segregated roads to omit invalid turns in favor of treating segregated roads as
// one.
@@ -80,24 +59,7 @@ class IntersectionGenerator
//
// The treatment results in a straight turn angle of 180º rather than a turn angle of approx
// 160
OSRM_ATTR_WARN_UNUSED
Intersection MergeSegregatedRoads(const NodeID intersection_node,
Intersection intersection) const;
// The counterpiece to mergeSegregatedRoads. While we can adjust roads that split up at the
// intersection itself, it can also happen that intersections are connected to joining roads.
//
// * *
// * is converted to *
// v a --- a ---
// v ^ +
// v ^ +
// b
//
// for the local view of b at a.
OSRM_ATTR_WARN_UNUSED
Intersection AdjustForJoiningRoads(const NodeID node_at_intersection,
Intersection intersection) const;
Intersection mergeSegregatedRoads(Intersection intersection) const;
};
} // namespace guidance
@@ -2,7 +2,6 @@
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_
#include "extractor/guidance/intersection.hpp"
#include "extractor/guidance/intersection_generator.hpp"
#include "extractor/query_node.hpp"
#include "extractor/suffix_table.hpp"
@@ -29,10 +28,8 @@ class IntersectionHandler
IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<QueryNode> &node_info_list,
const util::NameTable &name_table,
const SuffixTable &street_name_suffix_table,
const IntersectionGenerator &intersection_generator);
virtual ~IntersectionHandler() = default;
const SuffixTable &street_name_suffix_table);
virtual ~IntersectionHandler();
// check whether the handler can actually handle the intersection
virtual bool
@@ -47,7 +44,6 @@ class IntersectionHandler
const std::vector<QueryNode> &node_info_list;
const util::NameTable &name_table;
const SuffixTable &street_name_suffix_table;
const IntersectionGenerator &intersection_generator;
// counts the number on allowed entry roads
std::size_t countValid(const Intersection &intersection) const;
@@ -55,16 +51,7 @@ class IntersectionHandler
// Decide on a basic turn types
TurnType::Enum findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
// Find the most obvious turn to follow. The function returns an index into the intersection
// determining whether there is a road that can be seen as obvious turn in the presence of many
// other possible turns. The function will consider road categories and other inputs like the
// turn angles.
std::size_t findObviousTurn(const EdgeID via_edge, const Intersection &intersection) const;
// Obvious turns can still take multiple forms. This function looks at the turn onto a road
// candidate when coming from a via_edge and determines the best instruction to emit.
// `through_street` indicates if the street turned onto is a through sreet (think mergees and
// similar)
// Get the Instruction for an obvious turn
TurnInstruction getInstructionForObvious(const std::size_t number_of_candidates,
const EdgeID via_edge,
const bool through_street,
@@ -10,6 +10,11 @@ namespace extractor
namespace guidance
{
// possible fork
bool isFork(const ConnectedRoad &uturn,
const ConnectedRoad &possible_right_fork,
const ConnectedRoad &possible_left_fork);
// Ending in a T-Intersection
bool isEndOfRoad(const ConnectedRoad &uturn,
const ConnectedRoad &possible_right_turn,
@@ -2,11 +2,9 @@
#define OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_
#include "extractor/guidance/intersection.hpp"
#include "extractor/guidance/intersection_generator.hpp"
#include "extractor/guidance/intersection_handler.hpp"
#include "extractor/query_node.hpp"
#include "util/attributes.hpp"
#include "util/name_table.hpp"
#include "util/node_based_graph.hpp"
@@ -27,10 +25,8 @@ class MotorwayHandler : public IntersectionHandler
MotorwayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<QueryNode> &node_info_list,
const util::NameTable &name_table,
const SuffixTable &street_name_suffix_table,
const IntersectionGenerator &intersection_generator);
~MotorwayHandler() override final = default;
const SuffixTable &street_name_suffix_table);
~MotorwayHandler() override final;
// check whether the handler can actually handle the intersection
bool canProcess(const NodeID nid,
@@ -43,17 +39,11 @@ class MotorwayHandler : public IntersectionHandler
Intersection intersection) const override final;
private:
OSRM_ATTR_WARN_UNUSED
Intersection handleSliproads(const NodeID intersection_node_id,
Intersection intersection) const;
OSRM_ATTR_WARN_UNUSED
Intersection fromMotorway(const EdgeID via_edge, Intersection intersection) const;
OSRM_ATTR_WARN_UNUSED
Intersection fromRamp(const EdgeID via_edge, Intersection intersection) const;
OSRM_ATTR_WARN_UNUSED
Intersection fallback(Intersection intersection) const;
};
@@ -1,127 +0,0 @@
#ifndef OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_
#define OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_
#include <cmath>
#include <cstdint>
#include <string>
#include <unordered_map>
#include <osmium/osm.hpp>
namespace osrm
{
namespace extractor
{
namespace guidance
{
// Priorities are used to distinguish between how likely a turn is in comparison to a different
// road. The priorities here are used to distinguish between obvious turns (e.g. following a primary
// road next to a residential one is obvious). The decision what is obvious is described in the
// guidance constants.
namespace RoadPriorityClass
{
typedef std::uint8_t Enum;
// Top priority Road
const constexpr Enum MOTORWAY = 0;
// Second highest priority
const constexpr Enum TRUNK = 2;
// Main roads
const constexpr Enum PRIMARY = 4;
const constexpr Enum SECONDARY = 6;
const constexpr Enum TERTIARY = 8;
// Residential Categories
const constexpr Enum MAIN_RESIDENTIAL = 10;
const constexpr Enum SIDE_RESIDENTIAL = 11;
// Link Category
const constexpr Enum LINK_ROAD = 14;
// Bike Accessible
const constexpr Enum BIKE_PATH = 16;
// Walk Accessible
const constexpr Enum FOOT_PATH = 18;
// Link types are usually not considered in forks, unless amongst each other.
// a road simply offered for connectivity. Will be ignored in forks/other decisions. Always
// considered non-obvious to continue on
const constexpr Enum CONNECTIVITY = 31;
} // namespace Road Class
#pragma pack(push, 1)
class RoadClassification
{
// a class that behaves like a motorway (separated directions)
std::uint8_t motorway_class : 1;
// all types of link classes
std::uint8_t link_class : 1;
// a low priority class is a pure connectivity way. It can be ignored in multiple decisions
// (e.g. fork on a primary vs service will not happen)
std::uint8_t may_be_ignored : 1;
// the road priority is used as an indicator for forks. If the roads are of similar priority
// (difference <=1), we can see the road as a fork. Else one of the road classes is seen as
// obvious choice
RoadPriorityClass::Enum road_priority_class : 5;
public:
// default construction
RoadClassification()
: motorway_class(0), link_class(0), may_be_ignored(1),
road_priority_class(RoadPriorityClass::CONNECTIVITY)
{
}
RoadClassification(bool motorway_class,
bool link_class,
bool may_be_ignored,
RoadPriorityClass::Enum road_priority_class)
: motorway_class(motorway_class), link_class(link_class), may_be_ignored(may_be_ignored),
road_priority_class(road_priority_class)
{
}
bool IsMotorwayClass() const { return (0 != motorway_class) && (0 == link_class); }
void SetMotorwayFlag(const bool new_value) { motorway_class = new_value; }
bool IsRampClass() const { return (0 != motorway_class) && (0 != link_class); }
bool IsLinkClass() const { return (0 != link_class); }
void SetLinkClass(const bool new_value) { link_class = new_value; }
bool IsLowPriorityRoadClass() const { return (0 != may_be_ignored); }
void SetLowPriorityFlag(const bool new_value) { may_be_ignored = new_value; }
std::uint32_t GetPriority() const { return static_cast<std::uint32_t>(road_priority_class); }
RoadPriorityClass::Enum GetClass() const { return road_priority_class; }
void SetClass(const RoadPriorityClass::Enum new_value) { road_priority_class = new_value; }
bool operator==(const RoadClassification &other) const
{
return motorway_class == other.motorway_class && link_class == other.link_class &&
may_be_ignored == other.may_be_ignored &&
road_priority_class == other.road_priority_class;
}
bool operator!=(const RoadClassification &other) const { return !(*this == other); }
std::string ToString() const
{
return std::string() + (motorway_class ? "motorway" : "normal") +
(link_class ? "_link" : "") + (may_be_ignored ? " ignorable " : " important ") +
std::to_string(road_priority_class);
}
};
#pragma pack(pop)
static_assert(
sizeof(RoadClassification) == 1,
"Road Classification should fit a byte. Increasing this has a severe impact on memory.");
inline bool canBeSeenAsFork(const RoadClassification first, const RoadClassification second)
{
return std::abs(static_cast<int>(first.GetPriority()) -
static_cast<int>(second.GetPriority())) <= 1;
}
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif // OSRM_EXTRACTOR_CLASSIFICATION_DATA_HPP_

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