Compare commits

...

71 Commits

Author SHA1 Message Date
Daniel Patterson 677598a8d8 Blank commit to trigger TravisCI. 2021-01-28 09:03:40 -08:00
Daniel Patterson 781a2ad0f8 Release 5.24.0 2021-01-28 06:11:02 -08:00
Karen Shea a613375460 Validate source/destination indices correctly in nodejs support (#5595)
* validate source/destination indices correctly

Co-authored-by: Denis Chapligin <denis.chaplygin@wolt.com>
Co-authored-by: Daniel Patterson <danpat@danpat.net>
2021-01-28 06:02:01 -08:00
Richard Fairhurst 960269f95a Merge pull request #5131 from themylogin/master
Fix turn.roads_on_the_left and turn.roads_on_the right for two-way roads
2021-01-28 14:00:17 +00:00
Dane Springmeyer ed7b1baacc Don't bundle node-pre-gyp (#5520)
Bundling node-pre-gyp was only needed for node v4 and earlier.

Remove it to avoid errors like:

> npm ERR! enoent ENOENT: no such file or directory, rename '/home/circleci/project/node_modules/node_or_tools/node_modules/abbrev' -> '/home/circleci/project/node_modules/node_or_tools/node_modules/.abbrev.DELETE'

More context: https://github.com/mapbox/node-pre-gyp/issues/260#issuecomment-407222286
2021-01-27 09:19:32 -08:00
Daniel Patterson d4e7b3d60b Cleanup node dependencies. (#5945)
* Cleanup node dependencies.
2021-01-27 09:17:15 -08:00
Michael Bell bd3eb6591e Undo libosrm API break by adding old interface as method overload (#5861)
Removes the breaking libosrm API change by adding the old interface to
the new. This does not introduce any new breaks.

The downside of this is that it allows for multiple ways to
return JSON responses.
2021-01-27 09:14:44 -08:00
themylogin b0b8069ab0 clang-format 2021-01-27 13:12:20 +01:00
themylogin d9d873903f Account merged edges when processing turn legs 2021-01-27 10:53:48 +01:00
themylogin e7acc9df76 Fix turn.roads_on_the_left and turn.roads_on_the right for two-way roads #5128 2021-01-27 10:53:00 +01:00
Denis Chapligin b6557b8cac Merge pull request #5927 from OgreTransporter/master
Bugfix Lua 5.4 not working
2021-01-21 15:23:39 +02:00
Denis Chapligin a05d7a8f73 Merge pull request #5926 from mjjbell/mbell/parameter_improvements
Reduce copying in API parameter constructors
2021-01-21 15:22:26 +02:00
Transporter 35ff807e1d Bugfix Lua 5.4 not working 2021-01-07 10:48:59 +01:00
Michael Bell e554624438 Reduce copying in API parameter constructors
When using non-default constructors for the API parameter classes,
vector arguments like coordinates and hints are copied at least once
(twice when passed as lvalue arguments).

Enable perfect forwarding of BaseParameter arguments and
pass-by-value in the constructor that uses the argument. This
ensures we copy at most once (zero for rvalue arguments).
2021-01-06 23:15:35 +00:00
Michael Bell 58ba3fc84f Avoid copying ManyToMany table results (#5923)
Regardless of any copy elision on the returned pair value, the
duration and distance results are always copied.

Fix this by passing rvalue references to std::make_pair.
2021-01-04 08:46:51 -08:00
Denis Chapligin dddf83db7b Merge pull request #5908 from systemed/debug_way
Profile debug script which fetches a way from OSM
2020-12-21 20:14:37 +02:00
Michael Bell 5266ac1635 Add support for multiple via-way restrictions (#5907)
Currently OSRM only supports turn restrictions with a single via-node or one
via-way. OSM allows for multiple via-ways to represent longer and more
complex restrictions.

This PR extends the use of duplicate nodes for representng via-way turn
restrictions to also support multi via-way restrictions. Effectively, this
increases the edge-based graph size by the number of edges in multi via-way
restrictions. However, given the low number of these restrictions it
has little effect on total graph size.

In addition, we add a new step in the extraction phase that constructs
a restriction graph to support more complex relationships between restrictions,
such as nested restrictions and overlapping restrictions.
2020-12-20 13:59:57 -08:00
Denis Chapligin eb1d399f3b Merge pull request #5894 from xlaussel/avoid_samelookup_in_heap_map
Avoid samelookup in heap map
2020-12-20 22:17:49 +02:00
Andrey Gurevich 6bf68fb0c6 Update http.md (#5914)
Looks like a mistake in the description of Table api
2020-12-20 08:39:35 -08:00
Alin Mindroc 33b2a193f9 Fix node14 compilation issues (#5918)
* Use Nan:: getters and setters for node 12/14 compatibility
* Drop support for publishing node 8 bindings, add publishing support for node 12, 14

Co-authored-by: Daniel Patterson <danpat@danpat.net>
2020-12-19 15:37:01 -08:00
systemed 158d260cbb Mention new script in changelog 2020-12-15 12:51:28 +00:00
systemed 83b17e664c Update comments 2020-12-15 12:49:52 +00:00
xlaussel 89a9bc9d70 Undo changes to package-json.com :
Revert to master version
2020-12-14 08:38:31 +01:00
Denis Chapligin b0a4ad92c4 Merge pull request #5887 from dburnsii/upgrade_libsol2_v2.20.6
Upgrade libsol2 v2.20.6
2020-12-13 22:55:44 +02:00
systemed 9a20e8e614 Profile debug script to fetch a way from OSM 2020-12-10 11:02:04 +00:00
Desone Burns II af5efd2abb Merge branch 'master' of github.com:Project-OSRM/osrm-backend into upgrade_libsol2_v2.20.6 2020-12-03 16:50:35 -07:00
Desone Burns II 9ae9a1f6d7 Fix table checks 2020-12-03 16:42:57 -07:00
Denis Chapligin 370081ec14 Merge pull request #5903 from bxl-forever/maxspeed-brussels
Update car.lua - new maxspeed default speed for Brussels, Belgium
2020-12-03 11:22:42 +02:00
bxl-forever d340f4eabc Update car.lua - new maxspeed default speed for Brussels, Belgium
Those new speeds apply by law as from Jan. 1, 2021 within the entire Brussels-Capital Region, one of the 3 regions of Belgium.
2020-12-02 13:32:12 +01:00
Desone Burns II 0e10b94d38 Merge branch 'master' of github.com:Project-OSRM/osrm-backend into HEAD 2020-12-01 19:24:11 -07:00
Desone Burns II 1a5e5df6bd Use table lookup as boolean 2020-12-01 19:23:10 -07:00
Denis Chapligin 18a0f6c1f8 Merge pull request #5891 from mloskot/ml/check-indexed-data-for-empty-values
Avoid dereferencing iterators over empty indexed data values
2020-12-01 15:26:58 +02:00
Desone Burns II 8510d6850a Cast string to number in Lua 2020-11-30 17:25:35 -07:00
Desone Burns II 566cf785f5 Initialize empty Lua object 2020-11-30 14:13:18 -07:00
xlaussel 687a3cdfbe Merge branch 'master' into avoid_samelookup_in_heap_map 2020-11-26 21:29:27 +01:00
Daniel Patterson 50d9632ed7 Upgrade formatting to clang-format 10 (#5895)
* Update formatting tools to clang-format-10

* Reformat using clang-format-10.0.09
2020-11-26 07:21:39 -08:00
xlaussel f376225080 Changed code failing when compiling asserts 2020-11-25 13:25:04 +01:00
xlaussel fcb7dd2a21 format code 2020-11-25 12:42:01 +01:00
xlaussel aa06029801 References removed for extracted heapNode: could lead to bugs because the same was sometimes modified after when relaxing outgoing edges 2020-11-25 11:22:30 +01:00
Desone Burns II 1ce573ef35 Fix lua nil for MacOS 2020-11-24 08:26:24 -07:00
Desone Burns II cf13a9714d clang-format-3.8 changed files 2020-11-24 08:06:26 -07:00
xlaussel 8697a6b14a Changes and corrections before change request
Cucumber successfull
2020-11-24 12:43:08 +01:00
xlaussel 9a32722634 other improvements.
Variable renaming with better names
2020-11-24 11:05:11 +01:00
Desone Burns II 24d0af6faf clang-format changed file 2020-11-23 17:12:13 -07:00
Desone Burns II b1646622e6 Changed nil test to empty test 2020-11-23 17:07:10 -07:00
xlaussel 697c2ff88d other improvements.
Variable renaming with better names
2020-11-23 23:11:41 +01:00
xlaussel e181cb325c other improvements.
Variable renaming with better names
2020-11-23 23:10:22 +01:00
xlaussel 41af9615cd Improvements 2020-11-23 23:00:27 +01:00
xlaussel 13067844ee Changes made 2020-11-23 22:33:08 +01:00
Desone Burns II ca68518763 Remove context from get_nodes call 2020-11-23 13:24:44 -07:00
Desone Burns II f6065de494 Added nil check to table conversion 2020-11-23 13:21:55 -07:00
Mateusz Łoskot 58fbda0483 Avoid dereferencing iterators over empty indexed data values
It seems the values can be empty even if size of blocks
is non-zero (e.g. blocks.size()==1)
2020-11-23 21:21:35 +01:00
Desone Burns II e693b8963a Remove unsigned 0 comparison 2020-11-19 17:15:17 -07:00
Desone Burns II 5b6e82fa9c Revert "Copy nodes to lua table"
This reverts commit a7a088d416.
2020-11-19 17:14:38 -07:00
Desone Burns II a7a088d416 Copy nodes to lua table 2020-11-19 15:39:31 -07:00
Desone Burns II 43b920bfb5 Merge branch 'master' of https://github.com/Project-OSRM/osrm-backend into upgrade_libsol2_v2.20.6 2020-11-18 17:11:02 -07:00
Desone Burns II deacc8fb5c Update to sol2 v2.20.6 2020-11-18 17:01:43 -07:00
Denis Chapligin a3f1c2afb0 Merge pull request #5882 from mjjbell/mbell/windows_contractor
Fix osrm-contract, tests, on Windows
2020-11-18 14:33:57 +02:00
Denis Chapligin 7e4fbaf4a8 Merge pull request #5884 from dburnsii/upgrade_libosmium_v2.15.6
Upgrade libosmium to v2.15.6
2020-11-18 10:41:28 +02:00
Desone Burns II dfc1bfc27e Upgrade libosmium to v2.15.6 2020-11-17 14:59:06 -07:00
Michael Bell 96acdaf0d5 Fix osrm-contract, tests, on Windows
As part of graph contraction, node renumbering leads to
in-place permuting of graph state, including boolean vector elements.

std::vector<bool> returns proxy objects when referencing individual
bits. To correctly swap bool elements using MSVC, we need to explicitly
apply std::vector<bool>::swap.

Making this change fixes osrm-contract on Windows.

We also correct failing tests and other undefined behaviours
(mainly iterator access outside boundaries) highlighted by MSVC.
2020-11-15 14:22:26 +00:00
Denis Chapligin 98fd17589d Merge pull request #5868 from wangyoucao577/feature/unify-turn-index-dump
Unify .osrm.turn_penalties_index dump same with turn_weight_penalties/turn_duration_penalties
2020-11-10 11:20:55 +02:00
Denis Chapligin 21444ce7cb Merge pull request #5878 from mjjbell/mbell/fix_windows_partition
Fix bit-shift overflow in MLD partition step for Windows builds
2020-11-09 11:43:14 +02:00
Michael Bell b840c0be95 Fix bit-shift overflow in MLD partition step for Windows builds
For very large graphs, generation of MLD level masks fail on Windows
due to bit shift overflow of unsigned long values.

Correct by using unsigned long long literals, which are 64 bit on
all major systems.
2020-11-08 03:51:11 +00:00
Jay Zhang 17eb39d0a9 fix: clangformat 2020-10-26 01:19:17 +00:00
Jay Zhang c090457f1f docs: changelog 2020-10-23 09:48:21 +00:00
Jay Zhang 7d28b7aa3a feat: unify turn_penalties_index dump same with turn_weight_penalties and turn_duration_penalties 2020-10-23 09:38:56 +00:00
Guannan Du 1ba8aba466 Fix Issue#5864 build errors on mac OS (#5865)
* Fix Issue#5864 build errors on mac OS

Co-authored-by: Guannan Du <guannan.du@Guannans-MacBook-Pro-2.local>
2020-10-21 07:00:55 -07:00
Denis Chapligin 9f80f6d64d Merge pull request #5859 from akashihi/protozeroupdate
Updated bundled protozero to v1.7.0
2020-10-20 10:45:32 +03:00
Denis Chaplygin a8362d75b5 Updated bundled protozero to v1.7.0 2020-10-16 10:28:48 +03:00
Daniel Patterson df3ed43d70 Reset master for next version. 2020-10-14 14:10:33 -07:00
1275 changed files with 424686 additions and 39216 deletions
+65 -8
View File
@@ -62,8 +62,8 @@ matrix:
- npm ci --ignore-scripts
script:
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
- ${MASON} install clang-format 3.8.1
- PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
- ${MASON} install clang-format 10.0.0
- PATH=$(${MASON} prefix clang-format 10.0.0)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
- node ./scripts/validate_changelog.js
# See issue 4043
#- npm run docs && ./scripts/error_on_dirty.sh
@@ -177,9 +177,17 @@ matrix:
- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-8"
compiler: "mason-osx-release-node-12"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="8"
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="12"
after_success:
- ./scripts/travis/publish.sh
- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-14"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="14"
after_success:
- ./scripts/travis/publish.sh
@@ -195,12 +203,12 @@ matrix:
# Node build jobs. These skip running the tests.
- os: linux
sudo: false
compiler: "node-8-mason-linux-release"
compiler: "node-14-mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="14"
install:
- pushd ${OSRM_BUILD_DIR}
- |
@@ -219,12 +227,60 @@ matrix:
- os: linux
sudo: false
compiler: "node-8-mason-linux-debug"
compiler: "node-14-mason-linux-debug"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="14"
install:
- pushd ${OSRM_BUILD_DIR}
- |
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- os: linux
sudo: false
compiler: "node-12-mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="12"
install:
- pushd ${OSRM_BUILD_DIR}
- |
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- os: linux
sudo: false
compiler: "node-12-mason-linux-debug"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="12"
install:
- pushd ${OSRM_BUILD_DIR}
- |
@@ -510,6 +566,7 @@ script:
- ./unit_tests/util-tests
- ./unit_tests/server-tests
- ./unit_tests/partitioner-tests
- ./unit_tests/customizer-tests
- |
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
npm run nodejs-tests
+25
View File
@@ -1,3 +1,28 @@
# 5.24.0
- Changes from 5.23.0
- Features
- ADDED: Added support for multiple via-way restrictions. [#5907](https://github.com/Project-OSRM/osrm-backend/pull/5907)
- ADDED: Add node bindings support for Node 12, 14, and publish binaries [#5918](https://github.com/Project-OSRM/osrm-backend/pull/5918)
- REMOVED: we no longer publish Node 8 binary modules (they are still buildable from source) [#5918](https://github.com/Project-OSRM/osrm-backend/pull/5918)
- Routing:
- FIXED: Avoid copying ManyToMany table results [#5923](https://github.com/Project-OSRM/osrm-backend/pull/5923)
- FIXED: Reduce copying in API parameter constructors [#5925](https://github.com/Project-OSRM/osrm-backend/pull/5925)
- Misc:
- CHANGED: Cleanup NodeJS dependencies [#5945](https://github.com/Project-OSRM/osrm-backend/pull/5945)
- CHANGED: Unify `.osrm.turn_penalites_index` dump processing same with `.osrm.turn_weight_penalties` and `.osrm.turn_duration_penalties` [#5868](https://github.com/Project-OSRM/osrm-backend/pull/5868)
- FIXED: Properly validate source/destination validation in NodeJS table service [#5595](https://github.com/Project-OSRM/osrm-backend/pull/5595/files)
- FIXED: turn.roads_on_the_left not containing incoming roads and turn.roads_on_the_right not containing outgoing roads on two-way roads [#5128](https://github.com/Project-OSRM/osrm-backend/issues/5128)
- Profile:
- ADDED: Profile debug script which fetches a way from OSM then outputs the result of the profile. [#5908](https://github.com/Project-OSRM/osrm-backend/pull/5908)
- Infrastructure
- CHANGED: Bundled protozero updated to v1.7.0. [#5858](https://github.com/Project-OSRM/osrm-backend/pull/5858)
- Windows:
- FIXED: Fix bit-shift overflow in MLD partition step. [#5878](https://github.com/Project-OSRM/osrm-backend/pull/5878)
- FIXED: Fix vector bool permutation in graph contraction step [#5882](https://github.com/Project-OSRM/osrm-backend/pull/5882)
- API:
- FIXED: Undo libosrm API break by adding old interface as method overload [#5861](https://github.com/Project-OSRM/osrm-backend/pull/5861)
- FIXED: Fixed validation of sources/destinations when accessed via node bindings [#5595](https://github.com/Project-OSRM/osrm-backend/pull/5595)
# 5.23.0
- Changes from 5.22.0
- Build:
+39 -28
View File
@@ -131,6 +131,10 @@ ECHO running extractor-tests.exe ...
unit_tests\%Configuration%\extractor-tests.exe
IF %ERRORLEVEL% EQU 1 GOTO ERROR
ECHO running contractor-tests.exe ...
unit_tests\%Configuration%\contractor-tests.exe
IF %ERRORLEVEL% EQU 1 GOTO ERROR
ECHO running engine-tests.exe ...
unit_tests\%Configuration%\engine-tests.exe
IF %ERRORLEVEL% EQU 1 GOTO ERROR
@@ -143,34 +147,41 @@ ECHO running server-tests.exe ...
unit_tests\%Configuration%\server-tests.exe
IF %ERRORLEVEL% EQU 1 GOTO ERROR
::TODO: CH processing sometimes mysteriously hangs, need to find why and enable tests below.
::ECHO running library-tests.exe ...
::SET test_region=monaco
::SET test_region_ch=ch\monaco
::SET test_region_corech=corech\monaco
::SET test_region_mld=mld\monaco
::SET test_osm=%test_region%.osm.pbf
::IF NOT EXIST %test_osm% powershell Invoke-WebRequest http://project-osrm.wolt.com/testing/monaco.osm.pbf -OutFile %test_osm%
::ECHO running %Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
::%Configuration%\osrm-extract.exe
::%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
::MKDIR ch
::XCOPY %test_region%.osrm.* ch\
::XCOPY %test_region%.osrm ch\
::MKDIR corech
::XCOPY %test_region%.osrm.* corech\
::XCOPY %test_region%.osrm corech\
::MKDIR mld
::XCOPY %test_region%.osrm.* mld\
::XCOPY %test_region%.osrm mld\
::%Configuration%\osrm-contract.exe %test_region_ch%.osrm
::%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
::%Configuration%\osrm-partition.exe %test_region_mld%.osrm
::%Configuration%\osrm-customize.exe %test_region_mld%.osrm
::XCOPY /Y ch\*.* ..\test\data\ch\
::XCOPY /Y corech\*.* ..\test\data\corech\
::XCOPY /Y mld\*.* ..\test\data\mld\
::unit_tests\%Configuration%\library-tests.exe
ECHO running partitioner-tests.exe ...
unit_tests\%Configuration%\partitioner-tests.exe
IF %ERRORLEVEL% EQU 1 GOTO ERROR
ECHO running customizer-tests.exe ...
unit_tests\%Configuration%\customizer-tests.exe
IF %ERRORLEVEL% EQU 1 GOTO ERROR
ECHO running library-tests.exe ...
SET test_region=monaco
SET test_region_ch=ch\monaco
SET test_region_corech=corech\monaco
SET test_region_mld=mld\monaco
SET test_osm=%test_region%.osm.pbf
IF NOT EXIST %test_osm% powershell Invoke-WebRequest http://project-osrm.wolt.com/testing/monaco.osm.pbf -OutFile %test_osm%
ECHO running %Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
%Configuration%\osrm-extract.exe
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
MKDIR ch
XCOPY %test_region%.osrm.* ch\
XCOPY %test_region%.osrm ch\
MKDIR corech
XCOPY %test_region%.osrm.* corech\
XCOPY %test_region%.osrm corech\
MKDIR mld
XCOPY %test_region%.osrm.* mld\
XCOPY %test_region%.osrm mld\
%Configuration%\osrm-contract.exe %test_region_ch%.osrm
%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
%Configuration%\osrm-partition.exe %test_region_mld%.osrm
%Configuration%\osrm-customize.exe %test_region_mld%.osrm
XCOPY /Y ch\*.* ..\test\data\ch\
XCOPY /Y corech\*.* ..\test\data\corech\
XCOPY /Y mld\*.* ..\test\data\mld\
unit_tests\%Configuration%\library-tests.exe
:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+2 -2
View File
@@ -299,9 +299,9 @@ curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
the i-th source to the j-th destination. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
- `distances` array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel distance from
the i-th waypoint to the j-th waypoint. Values are given in meters. Can be `null` if no route between `i` and `j` can be found.
the i-th source to the j-th destination. Values are given in meters. Can be `null` if no route between `i` and `j` can be found.
- `sources` array of `Waypoint` objects describing all sources in order
- `destinations` array of `Waypoint` objects describing all destinations in order
- `fallback_speed_cells` (optional) array of arrays containing `i,j` pairs indicating which cells contain estimated values based on `fallback_speed`. Will be absent if `fallback_speed` is not used.
+19 -199
View File
@@ -387,217 +387,37 @@ Feature: Car - Turn restrictions
| m | p | mj,jp,jp |
@no_turning @conditionals
Scenario: Car - only_right_turn
Scenario: Car - Multiple conditional restrictions applicable to same turn
Given the extract extra arguments "--parse-conditional-restrictions"
# time stamp for 10am on Tues, 02 May 2017 GMT
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map
"""
a
d j b
c
j
|
k - l - m
|
n
"""
And the ways
| nodes | oneway |
| aj | no |
| jc | no |
| bj | yes |
| jd | yes |
| nodes |
| kl |
| jl |
| ln |
| lm |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
| restriction | kl | lj | l | only_left_turn @ (Sa-Su 07:00-10:30) |
| restriction | kl | ln | l | only_right_turn @ (Mo-Fr 07:00-10:30) |
When I route I should get
| from | to | route |
| b | c | bj,aj,aj,jc,jc |
| b | a | bj,aj,aj |
| b | d | bj,aj,aj,jd,jd |
| k | m | kl,ln,ln,lm,lm |
@no_turning @conditionals
Scenario: Car - No right turn
Given the extract extra arguments "--parse-conditional-restrictions"
# time stamp for 10am on Tues, 02 May 2017 GMT
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map
"""
a
d j b
c
"""
And the ways
| nodes | oneway |
| aj | no |
| jc | no |
| bj | yes |
| jd | yes |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
When I route I should get
| from | to | route | # |
| b | c | bj,jc,jc | normal turn |
| b | a | bj,jc,jc,aj,aj | avoids right turn |
| b | d | bj,jd,jd | normal maneuver |
@only_turning @conditionals
Scenario: Car - only_left_turn
Given the extract extra arguments "--parse-conditional-restrictions"
# time stamp for 10am on Tues, 02 May 2017 GMT
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map
"""
a
d j b
c
"""
And the ways
| nodes | oneway |
| aj | no |
| jc | no |
| bj | yes |
| jd | yes |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
When I route I should get
| from | to | route |
| b | c | bj,jc,jc |
| b | a | bj,jc,jc,aj,aj |
| b | d | bj,jc,jc,jd,jd |
@no_turning @conditionals
Scenario: Car - No left turn
Given the extract extra arguments "--parse-conditional-restrictions"
# time stamp for 10am on Tues, 02 May 2017 GMT
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map
"""
a
d j b
c
"""
And the ways
| nodes | oneway |
| aj | no |
| jc | no |
| bj | yes |
| jd | yes |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) |
When I route I should get
| from | to | route |
| b | c | bj,aj,aj,jc,jc |
| b | a | bj,aj,aj |
| b | d | bj,jd,jd |
@no_turning @conditionals
Scenario: Car - Conditional restriction is off
Given the extract extra arguments "--parse-conditional-restrictions"
# time stamp for 10am on Tues, 02 May 2017 GMT
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
Given the node map
"""
a
d j b
c
"""
And the ways
| nodes | oneway |
| aj | no |
| jc | no |
| bj | yes |
| jd | yes |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
When I route I should get
| from | to | route |
| b | c | bj,jc,jc |
| b | a | bj,aj,aj |
| b | d | bj,jd,jd |
@no_turning @conditionals
Scenario: Car - Conditional restriction is on
Given the extract extra arguments "--parse-conditional-restrictions"
# 10am utc, wed
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
Given the node map
"""
a
d j b
c
"""
And the ways
| nodes | oneway |
| aj | no |
| jc | no |
| bj | yes |
| jd | yes |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | jb | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
When I route I should get
| from | to | route |
| b | c | bj,jc,jc |
| b | a | bj,jc,jc,aj,aj |
| b | d | bj,jd,jd |
@no_turning @conditionals
Scenario: Car - Conditional restriction with multiple time windows
Given the extract extra arguments "--parse-conditional-restrictions"
# 5pm Wed 02 May, 2017 GMT
Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400"
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400"
Given the node map
"""
a
p |
\ |
j
| \
c m
"""
And the ways
| nodes | oneway |
| aj | no |
| jc | no |
| jp | yes |
| mj | yes |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
When I route I should get
| from | to | route |
| a | p | aj,jc,jc,jp,jp |
| m | p | mj,jp,jp |
@restriction-way
Scenario: Car - prohibit turn
@@ -719,7 +539,7 @@ Feature: Car - Turn restrictions
When I route I should get
| from | to | route | turns |
| a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,continue uturn,arrive |
| f | d | cap north,florida nw,florida nw | depart,turn left,arrive |
| f | d | cap north,florida nw,florida nw | depart,turn left,arrive |
| e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive |
@no_turning @conditionals
@@ -796,8 +616,8 @@ Feature: Car - Turn restrictions
| nodes | name |
| ab | albic |
| bc | albic |
| db | dobe |
| be | dobe |
| db | dobe |
| be | dobe |
And the relations
| type | way:from | way:to | node:via | restriction:conditional |
@@ -1047,7 +867,7 @@ Feature: Car - Turn restrictions
| type | way:from | node:via | way:to | restriction:conditional |
| restriction | be | e | de | no_right_turn @ (Mo-Fr 07:00-11:00) |
# node restrictino is off, way restriction is on
# node restriction is off, way restriction is on
When I route I should get
| from | to | route | turns | locations |
| a | d | ab,be,ef,ef,de,de | depart,turn right,turn left,continue uturn,new name straight,arrive | a,b,e,f,e,d |
File diff suppressed because it is too large Load Diff
-78
View File
@@ -798,82 +798,6 @@ Feature: Car - Turn restrictions
| from | to | route |
| a | d | ab,be,de,de |
@restriction-way
Scenario: Multi Way restriction
Given the node map
"""
k j
| |
h - - g - f - - e
| |
| |
a - - b - c - - d
| |
l i
"""
And the ways
| nodes | name | oneway |
| ab | horiz | yes |
| bc | horiz | yes |
| cd | horiz | yes |
| ef | horiz | yes |
| fg | horiz | yes |
| gh | horiz | yes |
| ic | vert | yes |
| cf | vert | yes |
| fj | vert | yes |
| kg | vert | yes |
| gb | vert | yes |
| bl | vert | yes |
And the relations
| type | way:from | way:via | way:to | restriction |
| restriction | ab | bc,cf,fg | gh | no_u_turn |
When I route I should get
| from | to | route |
| a | h | horiz,vert,horiz,horiz |
@restriction-way
Scenario: Multi-Way overlapping single-way
Given the node map
"""
e
|
a - b - c - d
|
f - g
|
h
"""
And the ways
| nodes | name |
| ab | abcd |
| bc | abcd |
| cd | abcd |
| hf | hfb |
| fb | hfb |
| gf | gf |
| ce | ce |
And the relations
| type | way:from | way:via | way:to | restriction |
| restriction | ab | bc | ce | only_left_turn |
| restriction | gf | fb,bc | cd | only_u_turn |
When I route I should get
| from | to | route | turns | locations |
| a | d | abcd,ce,ce,abcd,abcd | depart,turn left,continue uturn,turn left,arrive | a,c,e,c,d |
| a | e | abcd,ce,ce | depart,turn left,arrive | a,c,e |
| a | f | abcd,hfb,hfb | depart,turn right,arrive | a,b,f |
| g | e | gf,hfb,abcd,ce,ce | depart,turn right,turn right,turn left,arrive | g,f,b,c,e |
| g | d | gf,hfb,abcd,abcd | depart,turn right,turn right,arrive | g,f,b,d |
| h | e | hfb,abcd,ce,ce | depart,end of road right,turn left,arrive | h,b,c,e |
| h | d | hfb,abcd,abcd | depart,end of road right,arrive | h,b,d |
@restriction-way
Scenario: Car - prohibit turn, traffic lights
Given the node map
@@ -984,8 +908,6 @@ Feature: Car - Turn restrictions
| restriction | ab | bge | de | no_right_turn |
| restriction | bc | bge | ef | no_left_turn |
# this case is currently not handling the via-way restrictions and we need support for looking across traffic signals.
# It is mainly included to show limitations and to prove that we don't crash hard here
When I route I should get
| from | to | route |
| a | d | ab,bge,ef,ef,de,de |
@@ -180,3 +180,30 @@ Feature: Turn Function Information
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 3, access_turn_classification: 0/
# turning abc, give information about about db
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: false, highway_turn_classification: 0, access_turn_classification: 1/
Scenario: Turns should have correct information of two-way roads at intersection
Given the node map
"""
b
|
a-c-d
|
e
"""
And the ways
| nodes | highway | oneway |
| ac | motorway | yes |
| cd | motorway_link | yes |
| bc | trunk | yes |
| cb | trunk_link | yes |
| ce | primary | yes |
| ec | primary_link | yes |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
# Turn acd
# on the left there should be cb (and bc)
And stdout should contain /roads_on_the_left \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: true, highway_turn_classification: [0-9]+, access_turn_classification: 0, priority_class: 3/
# on the right there should be ce and ec
And stdout should contain /roads_on_the_right \[1\] speed: [0-9]+, is_incoming: true, is_outgoing: true, highway_turn_classification: [0-9]+, access_turn_classification: 0, priority_class: 4/
+9 -9
View File
@@ -1,18 +1,18 @@
@routing @testbot @nil
Feature: Testbot - Check assigning nil values
Scenario: Assign nil values to all way strings
Feature: Testbot - Check assigning empty values
Scenario: Assign empty values to all way strings
Given the profile file
"""
functions = require('testbot')
function way_function(profile, way, result)
result.name = nil
result.ref = nil
result.destinations = nil
result.exits = nil
result.pronunciation = nil
result.turn_lanes_forward = nil
result.turn_lanes_backward = nil
result.name = ""
result.ref = ""
result.destinations = ""
result.exits = ""
result.pronunciation = ""
result.turn_lanes_forward = ""
result.turn_lanes_backward = ""
result.forward_speed = 10
result.backward_speed = 10
@@ -94,7 +94,7 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
return GraphAndFilter{QueryGraph{num_nodes, std::move(edge_container.edges)},
edge_container.MakeEdgeFilters()};
}
}
}
} // namespace contractor
} // namespace osrm
#endif
@@ -164,7 +164,7 @@ struct ContractedEdgeContainer
std::vector<MergedFlags> flags;
std::vector<QueryEdge> edges;
};
}
}
} // namespace contractor
} // namespace osrm
#endif
+3 -3
View File
@@ -15,11 +15,11 @@ template <storage::Ownership Ownership> struct ContractedMetric
detail::QueryGraph<Ownership> graph;
std::vector<util::ViewOrVector<bool, Ownership>> edge_filter;
};
}
} // namespace detail
using ContractedMetric = detail::ContractedMetric<storage::Ownership::Container>;
using ContractedMetricView = detail::ContractedMetric<storage::Ownership::View>;
}
}
} // namespace contractor
} // namespace osrm
#endif
+2 -2
View File
@@ -49,7 +49,7 @@ class Contractor
private:
ContractorConfig config;
};
}
}
} // namespace contractor
} // namespace osrm
#endif // PROCESSING_CHAIN_HPP
+2 -2
View File
@@ -73,7 +73,7 @@ struct ContractorConfig final : storage::IOConfig
//(e.g. 0.8 contracts 80 percent of the hierarchy, leaving a core of 20%)
double core_factor;
};
}
}
} // namespace contractor
} // namespace osrm
#endif // EXTRACTOR_OPTIONS_HPP
+2 -2
View File
@@ -125,7 +125,7 @@ struct RangebasedCRC32
private:
IteratorbasedCRC32 crc32;
};
}
}
} // namespace contractor
} // namespace osrm
#endif /* ITERATOR_BASED_CRC32_H */
+3 -3
View File
@@ -52,8 +52,8 @@ inline void writeGraph(const boost::filesystem::path &path,
serialization::write(writer, "/ch/metrics/" + pair.first, pair.second);
}
}
}
}
}
} // namespace files
} // namespace contractor
} // namespace osrm
#endif
+2 -2
View File
@@ -77,7 +77,7 @@ struct QueryEdge
data.distance == right.data.distance);
}
};
}
}
} // namespace contractor
} // namespace osrm
#endif // QUERYEDGE_HPP
+2 -2
View File
@@ -19,7 +19,7 @@ using QueryGraph = util::StaticGraph<typename QueryEdge::EdgeData, Ownership>;
using QueryGraph = detail::QueryGraph<storage::Ownership::Container>;
using QueryGraphView = detail::QueryGraph<storage::Ownership::View>;
}
}
} // namespace contractor
} // namespace osrm
#endif // QUERYEDGE_HPP
+3 -3
View File
@@ -46,8 +46,8 @@ void read(storage::tar::FileReader &reader,
metric.edge_filter[index]);
}
}
}
}
}
} // namespace serialization
} // namespace contractor
} // namespace osrm
#endif
+4 -5
View File
@@ -212,9 +212,8 @@ class CellCustomizer
}
const auto &data = graph.GetEdgeData(edge);
if (data.forward &&
(first_level ||
partition.GetCell(level - 1, node) != partition.GetCell(level - 1, to)))
if (data.forward && (first_level || partition.GetCell(level - 1, node) !=
partition.GetCell(level - 1, to)))
{
const EdgeWeight to_weight = weight + data.weight;
const EdgeDuration to_duration = duration + data.duration;
@@ -237,7 +236,7 @@ class CellCustomizer
const partitioner::MultiLevelPartition &partition;
};
}
}
} // namespace customizer
} // namespace osrm
#endif // OSRM_CELLS_CUSTOMIZER_HPP
+3 -3
View File
@@ -22,11 +22,11 @@ template <storage::Ownership Ownership> struct CellMetricImpl
Vector<EdgeDuration> durations;
Vector<EdgeDistance> distances;
};
}
} // namespace detail
using CellMetric = detail::CellMetricImpl<storage::Ownership::Container>;
using CellMetricView = detail::CellMetricImpl<storage::Ownership::View>;
}
}
} // namespace customizer
} // namespace osrm
#endif
+2 -2
View File
@@ -39,7 +39,7 @@ struct CustomizationConfig final : storage::IOConfig
updater::UpdaterConfig updater_config;
};
}
}
} // namespace customizer
} // namespace osrm
#endif // OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
+3 -3
View File
@@ -34,7 +34,7 @@ template <typename EdgeDataT, storage::Ownership Ownership>
void write(storage::tar::FileWriter &writer,
const std::string &name,
const MultiLevelGraph<EdgeDataT, Ownership> &graph);
}
} // namespace serialization
template <typename EdgeDataT, storage::Ownership Ownership>
class MultiLevelGraph : public partitioner::MultiLevelGraph<EdgeDataT, Ownership>
@@ -126,7 +126,7 @@ using MultiLevelEdgeBasedGraph =
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
using MultiLevelEdgeBasedGraphView =
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
}
}
} // namespace customizer
} // namespace osrm
#endif
+3 -3
View File
@@ -106,8 +106,8 @@ inline void writeGraph(const boost::filesystem::path &path,
writer.WriteFrom("/mld/connectivity_checksum", connectivity_checksum);
serialization::write(writer, "/mld/multilevelgraph", graph);
}
}
}
}
} // namespace files
} // namespace customizer
} // namespace osrm
#endif
+3 -3
View File
@@ -65,8 +65,8 @@ inline void write(storage::tar::FileWriter &writer,
storage::serialization::write(writer, name + "/is_backward_edge", graph.is_backward_edge);
storage::serialization::write(writer, name + "/node_to_edge_offset", graph.node_to_edge_offset);
}
}
}
}
} // namespace serialization
} // namespace customizer
} // namespace osrm
#endif
+5 -5
View File
@@ -16,14 +16,14 @@ namespace ch
struct Algorithm final
{
};
}
} // namespace ch
// Multi-Level Dijkstra
namespace mld
{
struct Algorithm final
{
};
}
} // namespace mld
// Algorithm names
template <typename AlgorithmT> const char *name();
@@ -111,8 +111,8 @@ template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
template <> struct HasExcludeFlags<mld::Algorithm> final : std::true_type
{
};
}
}
}
} // namespace routing_algorithms
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -128,8 +128,8 @@ class BaseAPI
const BaseParameters &parameters;
};
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+10 -10
View File
@@ -92,21 +92,21 @@ struct BaseParameters
SnappingType snapping = SnappingType::Default;
BaseParameters(const std::vector<util::Coordinate> coordinates_ = {},
const std::vector<boost::optional<Hint>> hints_ = {},
BaseParameters(std::vector<util::Coordinate> coordinates_ = {},
std::vector<boost::optional<Hint>> hints_ = {},
std::vector<boost::optional<double>> radiuses_ = {},
std::vector<boost::optional<Bearing>> bearings_ = {},
std::vector<boost::optional<Approach>> approaches_ = {},
bool generate_hints_ = true,
std::vector<std::string> exclude = {},
const SnappingType snapping_ = SnappingType::Default)
: coordinates(coordinates_), hints(hints_), radiuses(radiuses_), bearings(bearings_),
approaches(approaches_), exclude(std::move(exclude)), generate_hints(generate_hints_),
snapping(snapping_)
: coordinates(std::move(coordinates_)), hints(std::move(hints_)),
radiuses(std::move(radiuses_)), bearings(std::move(bearings_)),
approaches(std::move(approaches_)), exclude(std::move(exclude)),
generate_hints(generate_hints_), snapping(snapping_)
{
}
// FIXME add validation for invalid bearing values
bool IsValid() const
{
return (hints.empty() || hints.size() == coordinates.size()) &&
@@ -115,7 +115,7 @@ struct BaseParameters
(approaches.empty() || approaches.size() == coordinates.size()) &&
std::all_of(bearings.begin(),
bearings.end(),
[](const boost::optional<Bearing> bearing_and_range) {
[](const boost::optional<Bearing> &bearing_and_range) {
if (bearing_and_range)
{
return bearing_and_range->IsValid();
@@ -124,8 +124,8 @@ struct BaseParameters
});
}
};
}
}
}
} // namespace api
} // namespace engine
} // namespace osrm
#endif // ROUTE_PARAMETERS_HPP
+3 -3
View File
@@ -16,8 +16,8 @@ namespace api
{
using ResultT =
mapbox::util::variant<util::json::Object, std::string, flatbuffers::FlatBufferBuilder>;
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+2 -2
View File
@@ -112,8 +112,8 @@ util::json::Object makeRouteLeg(guidance::RouteLeg leg, util::json::Array steps)
util::json::Array makeRouteLegs(std::vector<guidance::RouteLeg> legs,
std::vector<util::json::Value> step_geometries,
std::vector<util::json::Object> annotations);
}
}
} // namespace json
} // namespace api
} // namespace engine
} // namespace osrm
+3 -3
View File
@@ -248,8 +248,8 @@ class MatchAPI final : public RouteAPI
const tidy::Result &tidy_result;
};
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+13 -9
View File
@@ -68,8 +68,11 @@ struct MatchParameters : public RouteParameters
}
template <typename... Args>
MatchParameters(std::vector<unsigned> timestamps_, GapsType gaps_, bool tidy_, Args... args_)
: MatchParameters(std::move(timestamps_), gaps_, tidy_, {}, std::forward<Args>(args_)...)
MatchParameters(const std::vector<unsigned> &timestamps_,
GapsType gaps_,
bool tidy_,
Args &&... args_)
: MatchParameters(timestamps_, gaps_, tidy_, {}, std::forward<Args>(args_)...)
{
}
@@ -77,10 +80,11 @@ struct MatchParameters : public RouteParameters
MatchParameters(std::vector<unsigned> timestamps_,
GapsType gaps_,
bool tidy_,
std::vector<std::size_t> waypoints_,
Args... args_)
: RouteParameters{std::forward<Args>(args_)..., waypoints_},
timestamps{std::move(timestamps_)}, gaps(gaps_), tidy(tidy_)
const std::vector<std::size_t> &waypoints_,
Args &&... args_)
: RouteParameters{std::forward<Args>(args_)..., waypoints_}, timestamps{std::move(
timestamps_)},
gaps(gaps_), tidy(tidy_)
{
}
@@ -94,8 +98,8 @@ struct MatchParameters : public RouteParameters
(timestamps.empty() || timestamps.size() == coordinates.size());
}
};
}
}
}
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+4 -4
View File
@@ -200,9 +200,9 @@ inline Result tidy(const MatchParameters &params, Thresholds cfg = {15., 5})
return result;
}
} // ns tidy
} // ns api
} // ns engine
} // ns osrm
} // namespace tidy
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -159,8 +159,8 @@ class NearestAPI final : public BaseAPI
}
};
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -52,8 +52,8 @@ struct NearestParameters : public BaseParameters
bool IsValid() const { return BaseParameters::IsValid() && number_of_results >= 1; }
};
}
}
}
} // namespace api
} // namespace engine
} // namespace osrm
#endif // ENGINE_API_NEAREST_PARAMETERS_HPP
+3 -3
View File
@@ -988,8 +988,8 @@ class RouteAPI : public BaseAPI
}
};
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+20 -26
View File
@@ -87,19 +87,13 @@ struct RouteParameters : public BaseParameters
const GeometriesType geometries_,
const OverviewType overview_,
const boost::optional<bool> continue_straight_,
Args... args_)
Args &&... args_)
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one
// below.
: BaseParameters{std::forward<Args>(args_)...},
steps{steps_},
alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u},
annotations{false},
annotations_type{AnnotationsType::None},
geometries{geometries_},
overview{overview_},
continue_straight{continue_straight_},
waypoints()
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{false},
annotations_type{AnnotationsType::None}, geometries{geometries_}, overview{overview_},
continue_straight{continue_straight_}, waypoints()
{
}
@@ -111,7 +105,7 @@ struct RouteParameters : public BaseParameters
const GeometriesType geometries_,
const OverviewType overview_,
const boost::optional<bool> continue_straight_,
Args... args_)
Args &&... args_)
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_},
annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None},
@@ -129,12 +123,12 @@ struct RouteParameters : public BaseParameters
const GeometriesType geometries_,
const OverviewType overview_,
const boost::optional<bool> continue_straight_,
Args... args_)
Args &&... args_)
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u},
annotations{annotations_ == AnnotationsType::None ? false : true},
annotations_type{annotations_}, geometries{geometries_}, overview{overview_},
continue_straight{continue_straight_}, waypoints()
annotations{annotations_ != AnnotationsType::None}, annotations_type{annotations_},
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_},
waypoints()
{
}
@@ -147,12 +141,12 @@ struct RouteParameters : public BaseParameters
const OverviewType overview_,
const boost::optional<bool> continue_straight_,
std::vector<std::size_t> waypoints_,
const Args... args_)
const Args &&... args_)
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_},
annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None},
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_},
waypoints{waypoints_}
geometries{geometries_}, overview{overview_},
continue_straight{continue_straight_}, waypoints{std::move(waypoints_)}
{
}
@@ -165,12 +159,12 @@ struct RouteParameters : public BaseParameters
const OverviewType overview_,
const boost::optional<bool> continue_straight_,
std::vector<std::size_t> waypoints_,
Args... args_)
Args &&... args_)
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u},
annotations{annotations_ == AnnotationsType::None ? false : true},
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_ !=
AnnotationsType::None},
annotations_type{annotations_}, geometries{geometries_}, overview{overview_},
continue_straight{continue_straight_}, waypoints{waypoints_}
continue_straight{continue_straight_}, waypoints{std::move(waypoints_)}
{
}
@@ -217,8 +211,8 @@ inline RouteParameters::AnnotationsType operator|=(RouteParameters::AnnotationsT
{
return lhs = lhs | rhs;
}
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -407,8 +407,8 @@ class TableAPI final : public BaseAPI
const TableParameters &parameters;
};
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+7 -7
View File
@@ -85,7 +85,7 @@ struct TableParameters : public BaseParameters
template <typename... Args>
TableParameters(std::vector<std::size_t> sources_,
std::vector<std::size_t> destinations_,
Args... args_)
Args &&... args_)
: BaseParameters{std::forward<Args>(args_)...}, sources{std::move(sources_)},
destinations{std::move(destinations_)}
{
@@ -95,7 +95,7 @@ struct TableParameters : public BaseParameters
TableParameters(std::vector<std::size_t> sources_,
std::vector<std::size_t> destinations_,
const AnnotationsType annotations_,
Args... args_)
Args &&... args_)
: BaseParameters{std::forward<Args>(args_)...}, sources{std::move(sources_)},
destinations{std::move(destinations_)}, annotations{annotations_}
{
@@ -108,7 +108,7 @@ struct TableParameters : public BaseParameters
double fallback_speed_,
FallbackCoordinateType fallback_coordinate_type_,
double scale_factor_,
Args... args_)
Args &&... args_)
: BaseParameters{std::forward<Args>(args_)...}, sources{std::move(sources_)},
destinations{std::move(destinations_)}, fallback_speed{fallback_speed_},
fallback_coordinate_type{fallback_coordinate_type_}, annotations{annotations_},
@@ -122,7 +122,7 @@ struct TableParameters : public BaseParameters
if (!BaseParameters::IsValid())
return false;
// Distance Table makes only sense with 2+ coodinates
// Distance Table makes only sense with 2+ coordinates
if (coordinates.size() < 2)
return false;
@@ -166,8 +166,8 @@ inline TableParameters::AnnotationsType &operator|=(TableParameters::Annotations
{
return lhs = lhs | rhs;
}
}
}
}
} // namespace api
} // namespace engine
} // namespace osrm
#endif // ENGINE_API_TABLE_PARAMETERS_HPP
+3 -3
View File
@@ -70,8 +70,8 @@ struct TileParameters final
return valid_x && valid_y && valid_z;
}
};
}
}
}
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -175,8 +175,8 @@ class TripAPI final : public RouteAPI
const TripParameters &parameters;
};
} // ns api
} // ns engine
} // ns osrm
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+5 -5
View File
@@ -65,8 +65,8 @@ struct TripParameters : public RouteParameters
DestinationType destination_,
bool roundtrip_,
Args &&... args_)
: RouteParameters{std::forward<Args>(args_)...}, source{source_}, destination{destination_},
roundtrip{roundtrip_}
: RouteParameters{std::forward<Args>(args_)...}, source{source_},
destination{destination_}, roundtrip{roundtrip_}
{
}
@@ -76,8 +76,8 @@ struct TripParameters : public RouteParameters
bool IsValid() const { return RouteParameters::IsValid(); }
};
}
}
}
} // namespace api
} // namespace engine
} // namespace osrm
#endif
+1 -1
View File
@@ -42,5 +42,5 @@ enum class Approach : std::uint8_t
};
}
}
} // namespace osrm
#endif
+3 -3
View File
@@ -38,7 +38,7 @@ using BinaryFromBase64 = boost::archive::iterators::transform_width<
8, // get a view of 8 bit
6 // from a sequence of 6 bit
>;
} // ns detail
} // namespace detail
namespace engine
{
@@ -135,7 +135,7 @@ template <typename T> T decodeBase64Bytewise(const std::string &encoded)
return x;
}
} // ns engine
} // ns osrm
} // namespace engine
} // namespace osrm
#endif /* OSRM_BASE64_HPP */
+2 -2
View File
@@ -46,7 +46,7 @@ inline bool operator==(const Bearing lhs, const Bearing rhs)
return lhs.bearing == rhs.bearing && lhs.range == rhs.range;
}
inline bool operator!=(const Bearing lhs, const Bearing rhs) { return !(lhs == rhs); }
}
}
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -142,14 +142,14 @@ class DataWatchdogImpl<AlgorithmT, datafacade::ContiguousInternalMemoryDataFacad
storage::SharedRegion *updatable_shared_region;
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT> facade_factory;
};
}
} // namespace detail
// This class monitors the shared memory region that contains the pointers to
// the data and layout regions that should be used. This region is updated
// once a new dataset arrives.
template <typename AlgorithmT, template <typename A> class FacadeT>
using DataWatchdog = detail::DataWatchdogImpl<AlgorithmT, FacadeT<AlgorithmT>>;
}
}
} // namespace engine
} // namespace osrm
#endif
+2 -2
View File
@@ -11,7 +11,7 @@ namespace engine
using DataFacadeBase = datafacade::ContiguousInternalMemoryDataFacadeBase;
template <typename AlgorithmT>
using DataFacade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
}
}
} // namespace engine
} // namespace osrm
#endif
@@ -99,8 +99,8 @@ template <> class AlgorithmDataFacade<MLD>
// searches for a specific edge
virtual EdgeID FindEdge(const NodeID from, const NodeID to) const = 0;
};
}
}
}
} // namespace datafacade
} // namespace engine
} // namespace osrm
#endif
@@ -609,7 +609,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
auto found_range = std::equal_range(
m_maneuver_overrides.begin(), m_maneuver_overrides.end(), edge_based_node_id, Comp{});
std::for_each(found_range.first, found_range.second, [&](const auto & override) {
std::for_each(found_range.first, found_range.second, [&](const auto &override) {
std::vector<NodeID> sequence(
m_maneuver_override_node_sequences.begin() + override.node_sequence_offset_begin,
m_maneuver_override_node_sequences.begin() + override.node_sequence_offset_end);
@@ -760,8 +760,8 @@ class ContiguousInternalMemoryDataFacade<MLD> final
{
}
};
}
}
}
} // namespace datafacade
} // namespace engine
} // namespace osrm
#endif // CONTIGUOUS_INTERNALMEM_DATAFACADE_HPP
@@ -223,8 +223,8 @@ class BaseDataFacade
virtual std::vector<extractor::ManeuverOverride>
GetOverridesThatStartAt(const NodeID edge_based_node_id) const = 0;
};
}
}
}
} // namespace datafacade
} // namespace engine
} // namespace osrm
#endif // DATAFACADE_BASE_HPP
+3 -3
View File
@@ -70,7 +70,7 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
"The exclude prefix needs to be a valid data path.");
std::size_t index =
std::stoi(exclude_prefix.substr(index_begin + 1, exclude_prefix.size()));
BOOST_ASSERT(index >= 0 && index < facades.size());
BOOST_ASSERT(index < facades.size());
facades[index] = std::make_shared<const Facade>(allocator, metric_name, index);
}
@@ -152,7 +152,7 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
std::unordered_map<std::string, extractor::ClassData> name_to_class;
const extractor::ProfileProperties *properties = nullptr;
};
}
}
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -93,7 +93,7 @@ class WatchingProvider : public DataFacadeProvider<AlgorithmT, FacadeT>
return watchdog.Get(params);
}
};
}
} // namespace detail
template <typename AlgorithmT>
using DataFacadeProvider = detail::DataFacadeProvider<AlgorithmT, DataFacade>;
@@ -103,7 +103,7 @@ template <typename AlgorithmT>
using ImmutableProvider = detail::ImmutableProvider<AlgorithmT, DataFacade>;
template <typename AlgorithmT>
using ExternalProvider = detail::ExternalProvider<AlgorithmT, DataFacade>;
}
}
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -57,7 +57,7 @@ const constexpr std::uint64_t DOUGLAS_PEUCKER_THRESHOLDS[19] = {
const constexpr auto DOUGLAS_PEUCKER_THRESHOLDS_SIZE =
sizeof(DOUGLAS_PEUCKER_THRESHOLDS) / sizeof(*DOUGLAS_PEUCKER_THRESHOLDS);
} // ns detail
} // namespace detail
// These functions compute the bitvector of indicating generalized input
// points according to the (Ramer-)Douglas-Peucker algorithm.
@@ -75,7 +75,7 @@ inline std::vector<util::Coordinate> douglasPeucker(const std::vector<util::Coor
{
return douglasPeucker(begin(geometry), end(geometry), zoom_level);
}
}
}
} // namespace engine
} // namespace osrm
#endif /* DOUGLAS_PEUCKER_HPP_ */
+2 -2
View File
@@ -130,7 +130,7 @@ template <typename Algorithm> class Engine final : public EngineInterface
const plugins::MatchPlugin match_plugin;
const plugins::TilePlugin tile_plugin;
};
}
}
} // namespace engine
} // namespace osrm
#endif // OSRM_IMPL_HPP
+2 -2
View File
@@ -94,7 +94,7 @@ struct EngineConfig final
std::string verbosity;
std::string dataset_name;
};
}
}
} // namespace engine
} // namespace osrm
#endif // SERVER_CONFIG_HPP
+2 -2
View File
@@ -715,7 +715,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
const CoordinateList &coordinates;
DataFacadeT &datafacade;
};
}
}
} // namespace engine
} // namespace osrm
#endif
@@ -167,8 +167,8 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
return geometry;
}
}
}
}
} // namespace guidance
} // namespace engine
} // namespace osrm
#endif
+1 -1
View File
@@ -122,7 +122,7 @@ std::array<std::uint32_t, SegmentNumber> summarizeRoute(const datafacade::BaseDa
[](const NamedSegment &segment) { return segment.name_id; });
return summary;
}
}
} // namespace detail
inline RouteLeg assembleLeg(const datafacade::BaseDataFacade &facade,
const std::vector<PathData> &route_data,
+1 -1
View File
@@ -35,7 +35,7 @@ std::pair<short, short> getDepartBearings(const LegGeometry &leg_geometry,
std::pair<short, short> getArriveBearings(const LegGeometry &leg_geometry,
const PhantomNode &target_node,
const bool traversed_in_reverse);
} // ns detail
} // namespace detail
inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &facade,
const std::vector<PathData> &leg_data,
+1 -1
View File
@@ -163,7 +163,7 @@ void combineRouteSteps(RouteStep &step_at_turn_location,
void suppressStep(RouteStep &step_at_turn_location, RouteStep &step_after_turn_location);
} /* namespace guidance */
} /* namespace osrm */
} // namespace engine
} /* namespace osrm */
#endif /* OSRM_ENGINE_GUIDANCE_COLLAPSE_HPP_ */
+3 -3
View File
@@ -64,8 +64,8 @@ struct LegGeometry
return segment_offsets.size() - 1;
}
};
}
}
}
} // namespace guidance
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -14,8 +14,8 @@ struct Route
double duration;
double weight;
};
}
}
}
} // namespace guidance
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -23,8 +23,8 @@ struct RouteLeg
std::string summary;
std::vector<RouteStep> steps;
};
}
}
}
} // namespace guidance
} // namespace engine
} // namespace osrm
#endif
+1 -1
View File
@@ -46,5 +46,5 @@ inline StepManeuver getInvalidStepManeuver()
} // namespace guidance
} // namespace engine
} // namespace osrmn
} // namespace osrm
#endif
+2 -2
View File
@@ -67,7 +67,7 @@ static_assert(sizeof(Hint) == 80 + 4, "Hint is bigger than expected");
constexpr std::size_t ENCODED_HINT_SIZE = 112;
static_assert(ENCODED_HINT_SIZE / 4 * 3 >= sizeof(Hint),
"ENCODED_HINT_SIZE does not match size of Hint");
}
}
} // namespace engine
} // namespace osrm
#endif
+2 -2
View File
@@ -173,7 +173,7 @@ inline InternalRouteResult CollapseInternalRouteResult(const InternalRouteResult
collapsed.unpacked_path_segments.size());
return collapsed;
}
}
}
} // namespace engine
} // namespace osrm
#endif // RAW_ROUTE_DATA_H
@@ -98,8 +98,8 @@ class BayesClassifier
double positive_apriori_probability;
double negative_apriori_probability;
};
}
}
}
} // namespace map_matching
} // namespace engine
} // namespace osrm
#endif // BAYES_CLASSIFIER_HPP
@@ -137,8 +137,8 @@ template <class CandidateLists> struct HiddenMarkovModel
return initial_timestamp;
}
};
}
}
}
} // namespace map_matching
} // namespace engine
} // namespace osrm
#endif // HIDDEN_MARKOV_MODEL
@@ -51,8 +51,8 @@ struct MatchingConfidence
private:
ClassifierT classifier;
};
}
}
}
} // namespace map_matching
} // namespace engine
} // namespace osrm
#endif
+3 -3
View File
@@ -19,8 +19,8 @@ struct SubMatching
std::vector<unsigned> alternatives_count;
double confidence;
};
}
}
}
} // namespace map_matching
} // namespace engine
} // namespace osrm
#endif
+11 -9
View File
@@ -44,14 +44,15 @@ namespace engine
struct PhantomNode
{
PhantomNode()
: forward_segment_id{SPECIAL_SEGMENTID, false},
reverse_segment_id{SPECIAL_SEGMENTID, false}, forward_weight(INVALID_EDGE_WEIGHT),
reverse_weight(INVALID_EDGE_WEIGHT), forward_weight_offset(0), reverse_weight_offset(0),
: forward_segment_id{SPECIAL_SEGMENTID, false}, reverse_segment_id{SPECIAL_SEGMENTID,
false},
forward_weight(INVALID_EDGE_WEIGHT), reverse_weight(INVALID_EDGE_WEIGHT),
forward_weight_offset(0), reverse_weight_offset(0),
forward_distance(INVALID_EDGE_DISTANCE), reverse_distance(INVALID_EDGE_DISTANCE),
forward_distance_offset(0), reverse_distance_offset(0),
forward_duration(MAXIMAL_EDGE_DURATION), reverse_duration(MAXIMAL_EDGE_DURATION),
forward_duration_offset(0), reverse_duration_offset(0), fwd_segment_position(0),
is_valid_forward_source{false}, is_valid_forward_target{false},
forward_duration_offset(0), reverse_duration_offset(0),
fwd_segment_position(0), is_valid_forward_source{false}, is_valid_forward_target{false},
is_valid_reverse_source{false}, is_valid_reverse_target{false}, bearing(0)
{
@@ -109,8 +110,9 @@ struct PhantomNode
bool IsValid(const unsigned number_of_nodes) const
{
return location.IsValid() && ((forward_segment_id.id < number_of_nodes) ||
(reverse_segment_id.id < number_of_nodes)) &&
return location.IsValid() &&
((forward_segment_id.id < number_of_nodes) ||
(reverse_segment_id.id < number_of_nodes)) &&
((forward_weight != INVALID_EDGE_WEIGHT) ||
(reverse_weight != INVALID_EDGE_WEIGHT)) &&
((forward_duration != MAXIMAL_EDGE_DURATION) ||
@@ -234,7 +236,7 @@ struct PhantomNodes
PhantomNode source_phantom;
PhantomNode target_phantom;
};
}
}
} // namespace engine
} // namespace osrm
#endif // PHANTOM_NODES_H
+3 -3
View File
@@ -38,8 +38,8 @@ class MatchPlugin : public BasePlugin
const int max_locations_map_matching;
const double max_radius_map_matching;
};
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif // MATCH_HPP
+3 -3
View File
@@ -26,8 +26,8 @@ class NearestPlugin final : public BasePlugin
private:
const int max_results;
};
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif /* NEAREST_HPP */
+7 -5
View File
@@ -131,8 +131,10 @@ class BasePlugin
return phantom_pair.first;
};
const auto use_closed_phantom = [](
const std::pair<PhantomNode, PhantomNode> &phantom_pair) { return phantom_pair.first; };
const auto use_closed_phantom =
[](const std::pair<PhantomNode, PhantomNode> &phantom_pair) {
return phantom_pair.first;
};
const bool every_phantom_is_in_tiny_cc = std::all_of(std::begin(phantom_node_pair_list),
std::end(phantom_node_pair_list),
@@ -388,8 +390,8 @@ class BasePlugin
std::to_string(missing_index);
}
};
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif /* BASE_PLUGIN_HPP */
+3 -3
View File
@@ -27,8 +27,8 @@ class TablePlugin final : public BasePlugin
private:
const int max_locations_distance_table;
};
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif // TABLE_HPP
+3 -3
View File
@@ -30,8 +30,8 @@ class TilePlugin final : public BasePlugin
const api::TileParameters &parameters,
osrm::engine::api::ResultT &pbf_buffer) const;
};
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif /* TILEPLUGIN_HPP */
+3 -3
View File
@@ -42,8 +42,8 @@ class TripPlugin final : public BasePlugin
const api::TripParameters &parameters,
osrm::engine::api::ResultT &json_result) const;
};
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif // TRIP_HPP
+3 -3
View File
@@ -35,8 +35,8 @@ class ViaRoutePlugin final : public BasePlugin
const api::RouteParameters &route_parameters,
osrm::engine::api::ResultT &json_result) const;
};
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
#endif // VIA_ROUTE_HPP
+3 -3
View File
@@ -17,7 +17,7 @@ namespace detail
std::string encode(std::vector<int> &numbers);
std::int32_t decode_polyline_integer(std::string::const_iterator &first,
std::string::const_iterator last);
}
} // namespace detail
using CoordVectorForwardIter = std::vector<util::Coordinate>::const_iterator;
// Encodes geometry into polyline format.
// See: https://developers.google.com/maps/documentation/utilities/polylinealgorithm
@@ -80,7 +80,7 @@ std::vector<util::Coordinate> decodePolyline(const std::string &polyline)
}
return coordinates;
}
}
}
} // namespace engine
} // namespace osrm
#endif /* POLYLINECOMPRESSOR_H_ */
+2 -2
View File
@@ -230,7 +230,7 @@ inline std::vector<routing_algorithms::TurnData> RoutingAlgorithms<Algorithm>::G
return routing_algorithms::getTileTurns(*facade, edges, sorted_edge_indexes);
}
} // ns engine
} // ns osrm
} // namespace engine
} // namespace osrm
#endif
@@ -24,11 +24,10 @@ namespace ch
// Stalling
template <bool DIRECTION, typename HeapT>
bool stallAtNode(const DataFacade<Algorithm> &facade,
const NodeID node,
const EdgeWeight weight,
const typename HeapT::HeapNode &heapNode,
const HeapT &query_heap)
{
for (auto edge : facade.GetAdjacentEdgeRange(node))
for (auto edge : facade.GetAdjacentEdgeRange(heapNode.node))
{
const auto &data = facade.GetEdgeData(edge);
if (DIRECTION == REVERSE_DIRECTION ? data.forward : data.backward)
@@ -36,9 +35,10 @@ bool stallAtNode(const DataFacade<Algorithm> &facade,
const NodeID to = facade.GetTarget(edge);
const EdgeWeight edge_weight = data.weight;
BOOST_ASSERT_MSG(edge_weight > 0, "edge_weight invalid");
if (query_heap.WasInserted(to))
const auto toHeapNode = query_heap.GetHeapNodeIfWasInserted(to);
if (toHeapNode)
{
if (query_heap.GetKey(to) + edge_weight < weight)
if (toHeapNode->weight + edge_weight < heapNode.weight)
{
return true;
}
@@ -50,11 +50,10 @@ bool stallAtNode(const DataFacade<Algorithm> &facade,
template <bool DIRECTION>
void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
const NodeID node,
const EdgeWeight weight,
const SearchEngineData<Algorithm>::QueryHeap::HeapNode &heapNode,
SearchEngineData<Algorithm>::QueryHeap &heap)
{
for (const auto edge : facade.GetAdjacentEdgeRange(node))
for (const auto edge : facade.GetAdjacentEdgeRange(heapNode.node))
{
const auto &data = facade.GetEdgeData(edge);
if (DIRECTION == FORWARD_DIRECTION ? data.forward : data.backward)
@@ -63,19 +62,21 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
const EdgeWeight edge_weight = data.weight;
BOOST_ASSERT_MSG(edge_weight > 0, "edge_weight invalid");
const EdgeWeight to_weight = weight + edge_weight;
const EdgeWeight to_weight = heapNode.weight + edge_weight;
const auto toHeapNode = heap.GetHeapNodeIfWasInserted(to);
// New Node discovered -> Add to Heap + Node Info Storage
if (!heap.WasInserted(to))
if (!toHeapNode)
{
heap.Insert(to, to_weight, node);
heap.Insert(to, to_weight, heapNode.node);
}
// Found a shorter Path -> Update weight
else if (to_weight < heap.GetKey(to))
else if (to_weight < toHeapNode->weight)
{
// new parent
heap.GetData(to).parent = node;
heap.DecreaseKey(to, to_weight);
toHeapNode->data.parent = heapNode.node;
toHeapNode->weight = to_weight;
heap.DecreaseKey(*toHeapNode);
}
}
}
@@ -122,35 +123,35 @@ void routingStep(const DataFacade<Algorithm> &facade,
const bool force_loop_forward,
const bool force_loop_reverse)
{
const NodeID node = forward_heap.DeleteMin();
const EdgeWeight weight = forward_heap.GetKey(node);
auto heapNode = forward_heap.DeleteMinGetHeapNode();
const auto reverseHeapNode = reverse_heap.GetHeapNodeIfWasInserted(heapNode.node);
if (reverse_heap.WasInserted(node))
if (reverseHeapNode)
{
const EdgeWeight new_weight = reverse_heap.GetKey(node) + weight;
const EdgeWeight new_weight = reverseHeapNode->weight + heapNode.weight;
if (new_weight < 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) ||
if ((force_loop_forward && heapNode.data.parent == heapNode.node) ||
(force_loop_reverse && reverseHeapNode->data.parent == heapNode.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_weight < 0)
{
// check whether there is a loop present at the node
for (const auto edge : facade.GetAdjacentEdgeRange(node))
for (const auto edge : facade.GetAdjacentEdgeRange(heapNode.node))
{
const auto &data = facade.GetEdgeData(edge);
if (DIRECTION == FORWARD_DIRECTION ? data.forward : data.backward)
{
const NodeID to = facade.GetTarget(edge);
if (to == node)
if (to == heapNode.node)
{
const EdgeWeight edge_weight = data.weight;
const EdgeWeight loop_weight = new_weight + edge_weight;
if (loop_weight >= 0 && loop_weight < upper_bound)
{
middle_node_id = node;
middle_node_id = heapNode.node;
upper_bound = loop_weight;
}
}
@@ -161,7 +162,7 @@ void routingStep(const DataFacade<Algorithm> &facade,
{
BOOST_ASSERT(new_weight >= 0);
middle_node_id = node;
middle_node_id = heapNode.node;
upper_bound = new_weight;
}
}
@@ -170,19 +171,19 @@ void routingStep(const DataFacade<Algorithm> &facade,
// make sure we don't terminate too early if we initialize the weight
// for the nodes in the forward heap with the forward/reverse offset
BOOST_ASSERT(min_edge_offset <= 0);
if (weight + min_edge_offset > upper_bound)
if (heapNode.weight + min_edge_offset > upper_bound)
{
forward_heap.DeleteAll();
return;
}
// Stalling
if (STALLING && stallAtNode<DIRECTION>(facade, node, weight, forward_heap))
if (STALLING && stallAtNode<DIRECTION>(facade, heapNode, forward_heap))
{
return;
}
relaxOutgoingEdges<DIRECTION>(facade, node, weight, forward_heap);
relaxOutgoingEdges<DIRECTION>(facade, heapNode, forward_heap);
}
template <bool UseDuration>
@@ -97,7 +97,6 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
const std::vector<std::size_t> &phantom_indices)
{
auto min_level = [&partition, node](const PhantomNode &phantom_node) {
const auto &forward_segment = phantom_node.forward_segment_id;
const auto forward_level =
forward_segment.enabled ? partition.GetHighestDifferentLevel(node, forward_segment.id)
@@ -120,7 +119,7 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
}
return result;
}
}
} // namespace
// Heaps only record for each node its predecessor ("parent") on the shortest path.
// For re-constructing the actual path we need to trace back all parent "pointers".
@@ -229,40 +228,42 @@ retrievePackedPathFromHeap(const SearchEngineData<Algorithm>::QueryHeap &forward
template <bool DIRECTION, typename Algorithm, typename... Args>
void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
typename SearchEngineData<Algorithm>::QueryHeap &forward_heap,
const NodeID node,
const EdgeWeight weight,
const typename SearchEngineData<Algorithm>::QueryHeap::HeapNode &heapNode,
Args... args)
{
const auto &partition = facade.GetMultiLevelPartition();
const auto &cells = facade.GetCellStorage();
const auto &metric = facade.GetCellMetric();
const auto level = getNodeQueryLevel(partition, node, args...);
const auto level = getNodeQueryLevel(partition, heapNode.node, args...);
if (level >= 1 && !forward_heap.GetData(node).from_clique_arc)
if (level >= 1 && !heapNode.data.from_clique_arc)
{
if (DIRECTION == FORWARD_DIRECTION)
{
// Shortcuts in forward direction
const auto &cell = cells.GetCell(metric, level, partition.GetCell(level, node));
const auto &cell =
cells.GetCell(metric, level, partition.GetCell(level, heapNode.node));
auto destination = cell.GetDestinationNodes().begin();
for (auto shortcut_weight : cell.GetOutWeight(node))
for (auto shortcut_weight : cell.GetOutWeight(heapNode.node))
{
BOOST_ASSERT(destination != cell.GetDestinationNodes().end());
const NodeID to = *destination;
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
if (shortcut_weight != INVALID_EDGE_WEIGHT && heapNode.node != to)
{
const EdgeWeight to_weight = weight + shortcut_weight;
BOOST_ASSERT(to_weight >= weight);
if (!forward_heap.WasInserted(to))
const EdgeWeight to_weight = heapNode.weight + shortcut_weight;
BOOST_ASSERT(to_weight >= heapNode.weight);
const auto toHeapNode = forward_heap.GetHeapNodeIfWasInserted(to);
if (!toHeapNode)
{
forward_heap.Insert(to, to_weight, {node, true});
forward_heap.Insert(to, to_weight, {heapNode.node, true});
}
else if (to_weight < forward_heap.GetKey(to))
else if (to_weight < toHeapNode->weight)
{
forward_heap.GetData(to) = {node, true};
forward_heap.DecreaseKey(to, to_weight);
toHeapNode->data = {heapNode.node, true};
toHeapNode->weight = to_weight;
forward_heap.DecreaseKey(*toHeapNode);
}
}
++destination;
@@ -271,25 +272,28 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
else
{
// Shortcuts in backward direction
const auto &cell = cells.GetCell(metric, level, partition.GetCell(level, node));
const auto &cell =
cells.GetCell(metric, level, partition.GetCell(level, heapNode.node));
auto source = cell.GetSourceNodes().begin();
for (auto shortcut_weight : cell.GetInWeight(node))
for (auto shortcut_weight : cell.GetInWeight(heapNode.node))
{
BOOST_ASSERT(source != cell.GetSourceNodes().end());
const NodeID to = *source;
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
if (shortcut_weight != INVALID_EDGE_WEIGHT && heapNode.node != to)
{
const EdgeWeight to_weight = weight + shortcut_weight;
BOOST_ASSERT(to_weight >= weight);
if (!forward_heap.WasInserted(to))
const EdgeWeight to_weight = heapNode.weight + shortcut_weight;
BOOST_ASSERT(to_weight >= heapNode.weight);
const auto toHeapNode = forward_heap.GetHeapNodeIfWasInserted(to);
if (!toHeapNode)
{
forward_heap.Insert(to, to_weight, {node, true});
forward_heap.Insert(to, to_weight, {heapNode.node, true});
}
else if (to_weight < forward_heap.GetKey(to))
else if (to_weight < toHeapNode->weight)
{
forward_heap.GetData(to) = {node, true};
forward_heap.DecreaseKey(to, to_weight);
toHeapNode->data = {heapNode.node, true};
toHeapNode->weight = to_weight;
forward_heap.DecreaseKey(*toHeapNode);
}
}
++source;
@@ -298,7 +302,7 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
}
// Boundary edges
for (const auto edge : facade.GetBorderEdgeRange(level, node))
for (const auto edge : facade.GetBorderEdgeRange(level, heapNode.node))
{
const auto &edge_data = facade.GetEdgeData(edge);
@@ -311,21 +315,23 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
checkParentCellRestriction(partition.GetCell(level + 1, to), args...))
{
const auto node_weight =
facade.GetNodeWeight(DIRECTION == FORWARD_DIRECTION ? node : to);
facade.GetNodeWeight(DIRECTION == FORWARD_DIRECTION ? heapNode.node : to);
const auto turn_penalty = facade.GetWeightPenaltyForEdgeID(edge_data.turn_id);
// TODO: BOOST_ASSERT(edge_data.weight == node_weight + turn_penalty);
const EdgeWeight to_weight = weight + node_weight + turn_penalty;
const EdgeWeight to_weight = heapNode.weight + node_weight + turn_penalty;
if (!forward_heap.WasInserted(to))
const auto toHeapNode = forward_heap.GetHeapNodeIfWasInserted(to);
if (!toHeapNode)
{
forward_heap.Insert(to, to_weight, {node, false});
forward_heap.Insert(to, to_weight, {heapNode.node, false});
}
else if (to_weight < forward_heap.GetKey(to))
else if (to_weight < toHeapNode->weight)
{
forward_heap.GetData(to) = {node, false};
forward_heap.DecreaseKey(to, to_weight);
toHeapNode->data = {heapNode.node, false};
toHeapNode->weight = to_weight;
forward_heap.DecreaseKey(*toHeapNode);
}
}
}
@@ -342,34 +348,35 @@ void routingStep(const DataFacade<Algorithm> &facade,
const bool force_loop_reverse,
Args... args)
{
const auto node = forward_heap.DeleteMin();
const auto weight = forward_heap.GetKey(node);
const auto heapNode = forward_heap.DeleteMinGetHeapNode();
const auto weight = heapNode.weight;
BOOST_ASSERT(!facade.ExcludeNode(node));
BOOST_ASSERT(!facade.ExcludeNode(heapNode.node));
// Upper bound for the path source -> target with
// weight(source -> node) = weight weight(to -> target) ≤ reverse_weight
// is weight + reverse_weight
// More tighter upper bound requires additional condition reverse_heap.WasRemoved(to)
// with weight(to -> target) = reverse_weight and all weights ≥ 0
if (reverse_heap.WasInserted(node))
const auto reverseHeapNode = reverse_heap.GetHeapNodeIfWasInserted(heapNode.node);
if (reverseHeapNode)
{
auto reverse_weight = reverse_heap.GetKey(node);
auto reverse_weight = reverseHeapNode->weight;
auto path_weight = weight + reverse_weight;
// MLD uses loops forcing only to prune single node paths in forward and/or
// backward direction (there is no need to force loops in MLD but in CH)
if (!(force_loop_forward && forward_heap.GetData(node).parent == node) &&
!(force_loop_reverse && reverse_heap.GetData(node).parent == node) &&
if (!(force_loop_forward && heapNode.data.parent == heapNode.node) &&
!(force_loop_reverse && reverseHeapNode->data.parent == heapNode.node) &&
(path_weight >= 0) && (path_weight < path_upper_bound))
{
middle_node = node;
middle_node = heapNode.node;
path_upper_bound = path_weight;
}
}
// Relax outgoing edges from node
relaxOutgoingEdges<DIRECTION>(facade, forward_heap, node, weight, args...);
relaxOutgoingEdges<DIRECTION>(facade, forward_heap, heapNode, args...);
}
// With (s, middle, t) we trace back the paths middle -> s and middle -> t.
@@ -226,7 +226,7 @@ inline void initializeHeap<mld::Algorithm>(SearchEngineData<mld::Algorithm> &eng
const auto border_nodes_number = facade.GetMaxBorderNodeID() + 1;
engine_working_data.InitializeOrClearFirstThreadLocalStorage(nodes_number, border_nodes_number);
}
}
} // namespace
template <typename Algorithm>
InternalRouteResult shortestPathSearch(SearchEngineData<Algorithm> &engine_working_data,
+2 -2
View File
@@ -120,7 +120,7 @@ template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes,
unsigned number_of_boundary_nodes);
};
}
}
} // namespace engine
} // namespace osrm
#endif // SEARCH_ENGINE_DATA_HPP
+2 -2
View File
@@ -42,7 +42,7 @@ enum class Status
Ok,
Error
};
}
}
} // namespace engine
} // namespace osrm
#endif
@@ -92,8 +92,8 @@ std::vector<NodeID> NearestNeighbourTrip(const NodeIDIterator &start,
}
return route;
}
}
}
}
} // namespace trip
} // namespace engine
} // namespace osrm
#endif // TRIP_NEAREST_NEIGHBOUR_HPP
+2 -2
View File
@@ -33,7 +33,7 @@ inline bool isValidClassName(const std::string &name)
return std::isalnum(c);
}) == name.end();
}
}
}
} // namespace extractor
} // namespace osrm
#endif
@@ -82,7 +82,7 @@ class CompressedEdgeContainer
std::unordered_map<EdgeID, unsigned> m_reverse_edge_id_to_zipped_index_map;
std::unique_ptr<SegmentDataContainer> segment_data;
};
}
}
} // namespace extractor
} // namespace osrm
#endif // GEOMETRY_COMPRESSOR_HPP_
@@ -14,7 +14,7 @@ struct CompressedNodeBasedGraphEdge
NodeID source;
NodeID target;
};
}
}
} // namespace extractor
} // namespace osrm
#endif // OSRM_EXTRACTOR_COMPRESSED_NODE_BASED_GRAPH_EDGE_HPP
+2 -2
View File
@@ -42,7 +42,7 @@ class Datasources
std::array<std::uint32_t, MAX_NUM_SOURES> lengths;
std::array<char, MAX_LENGTH_NAME * MAX_NUM_SOURES> sources;
};
}
}
} // namespace extractor
} // namespace osrm
#endif
+2 -2
View File
@@ -96,7 +96,7 @@ inline bool EdgeBasedEdge::operator<(const EdgeBasedEdge &other) const
return std::tie(source, target, data.weight, unidirectional) <
std::tie(other.source, other.target, other.data.weight, other_is_unidirectional);
}
} // ns extractor
} // ns osrm
} // namespace extractor
} // namespace osrm
#endif /* EDGE_BASED_EDGE_HPP */
@@ -12,8 +12,8 @@
#include "extractor/name_table.hpp"
#include "extractor/nbg_to_ebg.hpp"
#include "extractor/node_data_container.hpp"
#include "extractor/node_restriction_map.hpp"
#include "extractor/query_node.hpp"
#include "extractor/restriction_index.hpp"
#include "extractor/turn_lane_types.hpp"
#include "extractor/way_restriction_map.hpp"
@@ -54,7 +54,7 @@ struct TurnIndexBlock
#pragma pack(pop)
static_assert(std::is_trivial<TurnIndexBlock>::value, "TurnIndexBlock is not trivial");
static_assert(sizeof(TurnIndexBlock) == 12, "TurnIndexBlock is not packed correctly");
} // ns lookup
} // namespace lookup
struct NodeBasedGraphToEdgeBasedGraphMappingWriter; // fwd. decl
@@ -20,8 +20,9 @@ namespace extractor
struct EdgeBasedNodeSegment
{
EdgeBasedNodeSegment()
: forward_segment_id{SPECIAL_SEGMENTID, false},
reverse_segment_id{SPECIAL_SEGMENTID, false}, u(SPECIAL_NODEID), v(SPECIAL_NODEID),
: forward_segment_id{SPECIAL_SEGMENTID, false}, reverse_segment_id{SPECIAL_SEGMENTID,
false},
u(SPECIAL_NODEID), v(SPECIAL_NODEID),
fwd_segment_position(std::numeric_limits<unsigned short>::max() >>
1), // >> 1 because we've only got 15 bits
is_startpoint(false)
@@ -47,7 +48,7 @@ struct EdgeBasedNodeSegment
unsigned short fwd_segment_position : 15; // segment id in a compressed geometry
bool is_startpoint : 1;
};
}
}
} // namespace extractor
} // namespace osrm
#endif // OSRM_EXTRACT_EDGE_BASED_NODE_SEGMENT_HPP
+26 -18
View File
@@ -1,14 +1,16 @@
#ifndef EXTRACTION_CONTAINERS_HPP
#define EXTRACTION_CONTAINERS_HPP
#include "extractor/first_and_last_segment_of_way.hpp"
#include "extractor/internal_extractor_edge.hpp"
#include "extractor/nodes_of_way.hpp"
#include "extractor/query_node.hpp"
#include "extractor/restriction.hpp"
#include "extractor/scripting_environment.hpp"
#include "storage/tar_fwd.hpp"
#include <unordered_map>
namespace osrm
{
namespace extractor
@@ -22,9 +24,16 @@ namespace extractor
*/
class ExtractionContainers
{
using ReferencedWays = std::unordered_map<OSMWayID, NodesOfWay>;
// The relationship between way and nodes is lost during node preparation.
// We identify the ways and nodes relevant to restrictions/overrides prior to
// node processing so that they can be referenced in the preparation phase.
ReferencedWays IdentifyRestrictionWays();
ReferencedWays IdentifyManeuverOverrideWays();
void PrepareNodes();
void PrepareManeuverOverrides();
void PrepareRestrictions();
void PrepareManeuverOverrides(const ReferencedWays &maneuver_override_ways);
void PrepareRestrictions(const ReferencedWays &restriction_ways);
void PrepareEdges(ScriptingEnvironment &scripting_environment);
void WriteNodes(storage::tar::FileWriter &file_out) const;
@@ -37,9 +46,10 @@ class ExtractionContainers
using NodeVector = std::vector<QueryNode>;
using EdgeVector = std::vector<InternalExtractorEdge>;
using AnnotationDataVector = std::vector<NodeBasedEdgeAnnotation>;
using WayIDStartEndVector = std::vector<FirstAndLastSegmentOfWay>;
using NameCharData = std::vector<unsigned char>;
using NameOffsets = std::vector<unsigned>;
using NameOffsets = std::vector<size_t>;
using WayIDVector = std::vector<OSMWayID>;
using WayNodeIDOffsets = std::vector<size_t>;
std::vector<OSMNodeID> barrier_nodes;
std::vector<OSMNodeID> traffic_signals;
@@ -49,20 +59,18 @@ class ExtractionContainers
AnnotationDataVector all_edges_annotation_data_list;
NameCharData name_char_data;
NameOffsets name_offsets;
// an adjacency array containing all turn lane masks
WayIDStartEndVector way_start_end_id_list;
WayIDVector ways_list;
// Offsets into used nodes for each way_list entry
WayNodeIDOffsets way_node_id_offsets;
unsigned max_internal_node_id;
// list of restrictions before we transform them into the output types. Input containers
// reference OSMNodeIDs. We can only transform them to the correct internal IDs after we've read
// everything. Without a multi-parse approach, we have to remember the output restrictions
// before converting them to the internal formats
std::vector<InputConditionalTurnRestriction> restrictions_list;
// turn restrictions split into conditional and unconditional turn restrictions
std::vector<ConditionalTurnRestriction> conditional_turn_restrictions;
std::vector<TurnRestriction> unconditional_turn_restrictions;
// List of restrictions (conditional and unconditional) before we transform them into the
// output types. Input containers reference OSMNodeIDs. We can only transform them to the
// correct internal IDs after we've read everything. Without a multi-parse approach,
// we have to remember the output restrictions before converting them to the internal formats
std::vector<InputTurnRestriction> restrictions_list;
std::vector<TurnRestriction> turn_restrictions;
std::vector<InputManeuverOverride> external_maneuver_overrides_list;
std::vector<UnresolvedManeuverOverride> internal_maneuver_overrides;
@@ -73,7 +81,7 @@ class ExtractionContainers
const std::string &osrm_path,
const std::string &names_data_path);
};
}
}
} // namespace extractor
} // namespace osrm
#endif /* EXTRACTION_CONTAINERS_HPP */
@@ -82,7 +82,7 @@ template <typename Iterator> struct iso_8601_grammar : qi::grammar<Iterator, uns
qi::uint_parser<unsigned, 10, 1, 2> uint_p;
qi::uint_parser<unsigned, 10, 2, 2> uint2_p;
};
}
} // namespace detail
inline bool durationIsValid(const std::string &s)
{
@@ -127,14 +127,16 @@ inline std::string canonicalizeStringList(std::string strlist, const std::string
// collapse spaces; this is needed in case we expand "; X" => "; X" above
// but also makes sense to do irregardless of the fact - canonicalizing strings.
const auto spaces = [](auto lhs, auto rhs) { return ::isspace(lhs) && ::isspace(rhs); };
const auto spaces = [](unsigned char lhs, unsigned char rhs) {
return ::isspace(lhs) && ::isspace(rhs);
};
auto it = std::unique(begin(strlist), end(strlist), spaces);
strlist.erase(it, end(strlist));
return strlist;
}
} // extractor
} // osrm
} // namespace extractor
} // namespace osrm
#endif // EXTRACTION_HELPER_FUNCTIONS_HPP
+2 -2
View File
@@ -13,7 +13,7 @@ struct ExtractionNode
bool traffic_lights;
bool barrier;
};
}
}
} // namespace extractor
} // namespace osrm
#endif // EXTRACTION_NODE_HPP
+2 -2
View File
@@ -26,7 +26,7 @@ struct ExtractionSegment
double weight;
double duration;
};
}
}
} // namespace extractor
} // namespace osrm
#endif
+12 -12
View File
@@ -33,16 +33,16 @@ struct ExtractionTurnLeg
{
}
const bool is_restricted;
const bool is_motorway;
const bool is_link;
const int number_of_lanes;
const int highway_turn_classification;
const int access_turn_classification;
const int speed;
const RoadPriorityClass::Enum priority_class;
const bool is_incoming;
const bool is_outgoing;
bool is_restricted;
bool is_motorway;
bool is_link;
int number_of_lanes;
int highway_turn_classification;
int access_turn_classification;
int speed;
RoadPriorityClass::Enum priority_class;
bool is_incoming;
bool is_outgoing;
};
struct ExtractionTurn
@@ -130,7 +130,7 @@ struct ExtractionTurn
double weight;
double duration;
};
}
}
} // namespace extractor
} // namespace osrm
#endif
+3 -3
View File
@@ -26,7 +26,7 @@ inline void maybeSetString(std::string &str, const char *value)
str = std::string(value);
}
}
}
} // namespace detail
/**
* This struct is the direct result of the call to ```way_function```
@@ -130,7 +130,7 @@ struct ExtractionWay
std::uint8_t highway_turn_classification : 4;
std::uint8_t access_turn_classification : 4;
};
}
}
} // namespace extractor
} // namespace osrm
#endif // EXTRACTION_WAY_HPP
+13 -21
View File
@@ -42,6 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "util/guidance/entry_class.hpp"
#include "util/guidance/turn_lanes.hpp"
#include "restriction_graph.hpp"
#include "util/typedefs.hpp"
namespace osrm
@@ -63,7 +64,6 @@ class Extractor
std::tuple<LaneDescriptionMap,
std::vector<TurnRestriction>,
std::vector<ConditionalTurnRestriction>,
std::vector<UnresolvedManeuverOverride>>
ParseOSMData(ScriptingEnvironment &scripting_environment, const unsigned number_of_threads);
@@ -74,8 +74,7 @@ class Extractor
const CompressedEdgeContainer &compressed_edge_container,
const std::unordered_set<NodeID> &barrier_nodes,
const std::unordered_set<NodeID> &traffic_lights,
const std::vector<TurnRestriction> &turn_restrictions,
const std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
const RestrictionGraph &restriction_graph,
const std::unordered_set<EdgeID> &segregated_edges,
const NameTable &name_table,
const std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
@@ -97,25 +96,18 @@ class Extractor
EdgeBasedNodeDataContainer &nodes_container) const;
void BuildRTree(std::vector<EdgeBasedNodeSegment> edge_based_node_segments,
const std::vector<util::Coordinate> &coordinates);
std::shared_ptr<RestrictionMap> LoadRestrictionMap();
void WriteConditionalRestrictions(
const std::string &path,
std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions);
void ProcessGuidanceTurns(
const util::NodeBasedDynamicGraph &node_based_graph,
const EdgeBasedNodeDataContainer &edge_based_node_container,
const std::vector<util::Coordinate> &node_coordinates,
const CompressedEdgeContainer &compressed_edge_container,
const std::unordered_set<NodeID> &barrier_nodes,
const std::vector<TurnRestriction> &turn_restrictions,
const std::vector<ConditionalTurnRestriction> &conditional_turn_restrictions,
const NameTable &name_table,
LaneDescriptionMap lane_description_map,
ScriptingEnvironment &scripting_environment);
void ProcessGuidanceTurns(const util::NodeBasedDynamicGraph &node_based_graph,
const EdgeBasedNodeDataContainer &edge_based_node_container,
const std::vector<util::Coordinate> &node_coordinates,
const CompressedEdgeContainer &compressed_edge_container,
const std::unordered_set<NodeID> &barrier_nodes,
const RestrictionGraph &restriction_graph,
const NameTable &name_table,
LaneDescriptionMap lane_description_map,
ScriptingEnvironment &scripting_environment);
};
}
}
} // namespace extractor
} // namespace osrm
#endif /* EXTRACTOR_HPP */

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