Compare commits
150 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db0db58bf8 | |||
| 1751fedfd0 | |||
| b3599ea249 | |||
| 2927d149db | |||
| 0d628da3ba | |||
| 497e4154a7 | |||
| 88db0ba90c | |||
| 44e1e57790 | |||
| 1a4f6cba7a | |||
| ee5020baf3 | |||
| 7b755eea54 | |||
| fbdafca4f2 | |||
| 873950ee86 | |||
| 50fcc65431 | |||
| 343011c3da | |||
| 4c66fcafaa | |||
| 513fd09780 | |||
| f6de8f3444 | |||
| 082eac68f7 | |||
| 7091331b55 | |||
| 7149e25636 | |||
| f76fc7fd83 | |||
| 6a0db71e34 | |||
| d6776b3e81 | |||
| f9eb22093b | |||
| 9fb86bcac5 | |||
| 17d775588d | |||
| 810c0f3b3e | |||
| fe3005f630 | |||
| ab7ded02c1 | |||
| bad4d4d6c7 | |||
| 8485a99349 | |||
| af6b84a432 | |||
| 1dc26585d2 | |||
| a95f4a8816 | |||
| 94a2072533 | |||
| a5568f8be4 | |||
| dafd724923 | |||
| 807f5c0014 | |||
| 956b264ece | |||
| 8967cebd10 | |||
| 431a8cb5c1 | |||
| 1675ff1748 | |||
| c8cd89355c | |||
| e50bf1062f | |||
| 50cf0cf84f | |||
| da298f0f28 | |||
| d5a3d817aa | |||
| 5f4424482e | |||
| 9d0da926e5 | |||
| 512dd9a5e2 | |||
| bba7e49d15 | |||
| 70066c3ed0 | |||
| 5661628f2c | |||
| 2ff9386368 | |||
| 37e93cf96a | |||
| a7b99b1549 | |||
| 3443baa311 | |||
| d88ce65385 | |||
| 7865bd8815 | |||
| 6856f00074 | |||
| bc67488f25 | |||
| 6c5822fb45 | |||
| 779ddeeb69 | |||
| 01c4b3f7a3 | |||
| fecd3d27ac | |||
| 0724c4a2d8 | |||
| cba4baf920 | |||
| dda6d49f4a | |||
| 6f9d8a691d | |||
| f713408d46 | |||
| 80843ecc89 | |||
| aced4ebe56 | |||
| df00b99d84 | |||
| 7dfe91bba0 | |||
| 8753590f59 | |||
| 12ff303cf8 | |||
| 70dfe23f0e | |||
| 6ca0afa212 | |||
| 31f735b08e | |||
| b01b7dcbca | |||
| 248a0af761 | |||
| 49fff1d93f | |||
| 29a72a9e1a | |||
| b3a709b98d | |||
| aa3472cc6b | |||
| 3db1509855 | |||
| 53f47458a2 | |||
| f784b85cd6 | |||
| 02c3c3e847 | |||
| 8af3a036a7 | |||
| 7803d6116b | |||
| 07cd80d042 | |||
| fd6abcfde3 | |||
| 690a2a41a4 | |||
| dd1f9e5a6a | |||
| e4ed2f6a2f | |||
| 25f86b68dc | |||
| 5916ddda80 | |||
| 2e214ac222 | |||
| 5acd2ca394 | |||
| ffaf0fc86f | |||
| ef6c62d224 | |||
| fed2a67e42 | |||
| 059ee4e350 | |||
| 53a74ce3e6 | |||
| b18c7d75da | |||
| f3e5ce561a | |||
| 65d56182f2 | |||
| 1c05d8b7ae | |||
| 6223ee887c | |||
| d1528dc4ac | |||
| 7a042e643f | |||
| a129e549eb | |||
| 581b5c2ab6 | |||
| ece2056a13 | |||
| d6e5b79747 | |||
| 2d98bacdd5 | |||
| 8863947e86 | |||
| 27f74432a0 | |||
| 03d88b3df2 | |||
| bdfa072cac | |||
| 65ba774ebc | |||
| d34c215c09 | |||
| c88eeb89c6 | |||
| bde8ec1dbd | |||
| 49a173652b | |||
| e4dace1d51 | |||
| 43d1e40284 | |||
| 139220058e | |||
| 11a92a8e54 | |||
| d3a2c1c41c | |||
| 566505fd0f | |||
| 9dada6b46a | |||
| f9d2440d95 | |||
| a4387f39f1 | |||
| 1902292629 | |||
| bbf2ac23b4 | |||
| 445df08fb4 | |||
| 27a2b061bf | |||
| 944947962b | |||
| fda8f6ecef | |||
| ca6c1d7bb1 | |||
| d88dda1a45 | |||
| 207f1d7732 | |||
| d73600387b | |||
| 9194ab590c | |||
| 68eeb20c5c | |||
| 2f3b4373f9 | |||
| 1b25bebeac |
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"plugins": ["transform-class-properties"],
|
||||
"presets": [
|
||||
"stage-0",
|
||||
"es2015",
|
||||
"react"
|
||||
]
|
||||
}
|
||||
+23
-59
@@ -2,89 +2,53 @@
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AllowShortFunctionsOnASingleLine: true
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: true
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BreakBeforeBinaryOperators: false
|
||||
BreakBeforeBraces: Allman
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BinPackParameters: false
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
DerivePointerBinding: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IncludeCategories:
|
||||
- Regex: '^<'
|
||||
Priority: 3
|
||||
- Regex: '^"(osrm|util|engine|extract|contract)/'
|
||||
Priority: 2
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
NamespaceIndentation: None
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyExcessCharacter: 1000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Right
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
PointerBindsToType: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Cpp11BracedListStyle: true
|
||||
Standard: Cpp11
|
||||
IndentWidth: 4
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
BreakBeforeBraces: Allman
|
||||
IndentFunctionDeclarationAfterType: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInAngles: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
ContinuationIndentWidth: 4
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
SpaceBeforeParens: ControlStatements
|
||||
...
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
test
|
||||
build
|
||||
@@ -1,30 +0,0 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
#
|
||||
# NOTE: Keep settings in sync with the master .clang-format file
|
||||
#
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# CMake configuration files
|
||||
[{CMakeLists.txt,CMakeSettings.json,*.cmake}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# CI configuration files
|
||||
[{.travis.yml,appveyor.yml}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Unix shell scripts
|
||||
[*.sh]
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Windows shell scripts
|
||||
[*.bat]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
@@ -1,2 +0,0 @@
|
||||
features/support/flatbuffers.js
|
||||
features/support/fbresult_generated.js
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"indent": [
|
||||
2,
|
||||
4
|
||||
],
|
||||
"quotes": [
|
||||
1,
|
||||
"single"
|
||||
],
|
||||
"linebreak-style": [
|
||||
2,
|
||||
"unix"
|
||||
],
|
||||
"semi": [
|
||||
2,
|
||||
"always"
|
||||
],
|
||||
"no-console": [
|
||||
1
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended"
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.cpp text
|
||||
*.hpp text
|
||||
|
||||
# Declare files that will always have CRLF line endings on checkout.
|
||||
*.bat text eol=crlf
|
||||
*.cmd text eol=crlf
|
||||
*.ps1 text eol=crlf
|
||||
|
||||
# Declare files that will always have LF line endings on checkout.
|
||||
*.sh text eol=lf
|
||||
@@ -1,19 +0,0 @@
|
||||
# Issue
|
||||
|
||||
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
|
||||
|
||||
Please read our [documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/releasing.md) on release and version management.
|
||||
If your PR is still work in progress please attach the relevant label.
|
||||
|
||||
## Tasklist
|
||||
|
||||
- [ ] CHANGELOG.md entry ([How to write a changelog entry](http://keepachangelog.com/en/1.0.0/#how))
|
||||
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
|
||||
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/testing.md)
|
||||
- [ ] review
|
||||
- [ ] adjust for comments
|
||||
- [ ] cherry pick to release branch
|
||||
|
||||
## Requirements / Relations
|
||||
|
||||
Link any requirements here. Other pull requests this PR is based on?
|
||||
+5
-33
@@ -1,14 +1,7 @@
|
||||
# mason #
|
||||
#########
|
||||
/.mason
|
||||
/mason_packages
|
||||
|
||||
# pre compiled dependencies #
|
||||
#############################
|
||||
osrm-deps
|
||||
|
||||
.ycm_extra_conf.py
|
||||
|
||||
# Compiled source #
|
||||
###################
|
||||
*.com
|
||||
@@ -46,13 +39,8 @@ Thumbs.db
|
||||
|
||||
# build related files #
|
||||
#######################
|
||||
/_build*
|
||||
/build/
|
||||
/example/build/
|
||||
/test/data/monaco.osrm*
|
||||
/test/data/ch
|
||||
/test/data/corech
|
||||
/test/data/mld
|
||||
/cmake/postinst
|
||||
|
||||
# Eclipse related files #
|
||||
@@ -62,15 +50,11 @@ Thumbs.db
|
||||
.cproject
|
||||
.project
|
||||
|
||||
# Visual Studio (Code) related files #
|
||||
######################################
|
||||
/.vs*
|
||||
/*.local.bat
|
||||
/CMakeSettings.json
|
||||
|
||||
# Jetbrains related files #
|
||||
###########################
|
||||
.idea/
|
||||
# stxxl related files #
|
||||
#######################
|
||||
.stxxl
|
||||
stxxl.log
|
||||
stxxl.errlog
|
||||
|
||||
# Compiled Binary Files #
|
||||
####################################
|
||||
@@ -90,22 +74,10 @@ Thumbs.db
|
||||
###################
|
||||
/sandbox/
|
||||
|
||||
# Test related files #
|
||||
######################
|
||||
/test/profile.lua
|
||||
/test/cache
|
||||
/test/speeds.csv
|
||||
/test/penalties.csv
|
||||
node_modules
|
||||
|
||||
# Deprecated config file #
|
||||
##########################
|
||||
/server.ini
|
||||
|
||||
*.swp
|
||||
|
||||
# local lua debugging file
|
||||
debug.lua
|
||||
|
||||
# node-osrm artifacts
|
||||
lib/binding
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
*
|
||||
!README.md
|
||||
!CHANGELOG.md
|
||||
!CONTRIBUTING.MD
|
||||
!LICENCE.TXT
|
||||
!package.json
|
||||
!package-lock.json
|
||||
!yarn.lock
|
||||
!docs
|
||||
!example
|
||||
!taginfo.json
|
||||
!lib/*.js
|
||||
!profiles/*
|
||||
!profiles/lib/*
|
||||
!profiles/examples/*
|
||||
!scripts/node_install.sh
|
||||
+106
-506
@@ -1,7 +1,7 @@
|
||||
language: cpp
|
||||
#language: cpp
|
||||
# This makes travis use the thin image which boots faster
|
||||
language: generic
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
||||
# sudo:required is needed for trusty images
|
||||
sudo: required
|
||||
@@ -13,564 +13,164 @@ notifications:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# enable building tags
|
||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||
|
||||
cache:
|
||||
npm: true
|
||||
ccache: true
|
||||
apt: true
|
||||
directories:
|
||||
- test/cache
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: "hk+32aXXF5t1ApaM2Wjqooz3dx1si907L87WRMkO47WlpJmUUU/Ye+MJk9sViH8MdhOcceocVAmdYl5/WFWOIbDWNlBya9QvXDZyIu2KIre/0QyOCTZbrsif8paBXKIO5O/R4OTvIZ8rvWZsadBdmAT9GSbDhih6FzqXAEgeIYQ="
|
||||
- secure: "VE+cFkseFwW4jK6XwkP0yW3h4DixPJ8+Eb3yKcchGZ5iIJxlZ/8i1vKHYxadgPRwSYwPSB14tF70xj2OmiT2keGzZUfphmPXinBaLEhYk+Bde+GZZkoSl5ND109I/LcyNr0nG9dDgtV6pkvFchgchpyP9JnVOOS0+crEZlAz0RE="
|
||||
- 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
|
||||
- CCACHE_VERSION=3.3.1
|
||||
- CMAKE_VERSION=3.7.2
|
||||
- MASON="$(pwd)/scripts/mason.sh"
|
||||
- ENABLE_NODE_BINDINGS=On
|
||||
- NODE="10"
|
||||
|
||||
stages:
|
||||
- core
|
||||
- optional
|
||||
- develop
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
# We override the compiler names here to yield better ccache behavior, which uses this as key
|
||||
include:
|
||||
|
||||
# Debug Builds
|
||||
- stage: core
|
||||
os: linux
|
||||
compiler: "format-taginfo-docs"
|
||||
env: NODE=10
|
||||
sudo: false
|
||||
before_install:
|
||||
install:
|
||||
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
||||
- source $NVM_DIR/nvm.sh
|
||||
- nvm install $NODE
|
||||
- nvm use $NODE
|
||||
- npm --version
|
||||
- npm ci --ignore-scripts
|
||||
script:
|
||||
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
- ${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
|
||||
after_success:
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-debug-cov"
|
||||
addons: &gcc7
|
||||
compiler: gcc
|
||||
addons: &gcc5
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'lcov']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
|
||||
before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- lcov --directory . --zerocounters # clean cached da files
|
||||
after_success:
|
||||
# Creating report
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- lcov --directory . --capture --output-file coverage.info # capture coverage info
|
||||
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
|
||||
- lcov --list coverage.info #debug info
|
||||
# Uploading report to CodeCov
|
||||
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
||||
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-5' BUILD_TYPE='Debug'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-debug-asan"
|
||||
addons: &gcc7
|
||||
compiler: gcc
|
||||
addons: &gcc48
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-4.8' BUILD_TYPE='Debug'
|
||||
|
||||
- os: linux
|
||||
compiler: "clang-5.0-debug"
|
||||
addons: &clang50
|
||||
compiler: clang
|
||||
addons: &clang38
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "mason-linux-debug-asan"
|
||||
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_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf"
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
compiler: clang
|
||||
env: COMPILER='clang++' BUILD_TYPE='Debug'
|
||||
|
||||
# Release Builds
|
||||
- os: linux
|
||||
compiler: "mason-linux-release"
|
||||
addons:
|
||||
compiler: gcc
|
||||
addons: &gcc5
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-5' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-9-release"
|
||||
addons: &gcc9
|
||||
compiler: gcc
|
||||
addons: &gcc48
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-9' CXXCOMPILER='g++-9' BUILD_TYPE='Release' CXXFLAGS='-Wno-cast-function-type'
|
||||
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-4.8' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-8-release"
|
||||
addons: &gcc8
|
||||
compiler: clang
|
||||
addons: &clang38
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-8', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-8' CXXCOMPILER='g++-8' BUILD_TYPE='Release' CXXFLAGS='-Wno-cast-function-type'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-release"
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-7-release-i686"
|
||||
env: >
|
||||
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-5-release"
|
||||
addons: &gcc49
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release"
|
||||
addons: &gcc49
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-10"
|
||||
# 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="10"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
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="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
|
||||
osx_image: xcode7.3
|
||||
compiler: clang
|
||||
env: COMPILER='clang++' BUILD_TYPE='Release'
|
||||
|
||||
# Shared Library
|
||||
- os: linux
|
||||
compiler: "gcc-7-release-shared"
|
||||
addons: &gcc7
|
||||
compiler: gcc
|
||||
addons: &gcc5
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
# Node build jobs. These skip running the tests.
|
||||
- os: linux
|
||||
sudo: false
|
||||
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="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
|
||||
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-14-mason-linux-debug"
|
||||
addons:
|
||||
compiler: clang
|
||||
addons: &clang38
|
||||
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="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
|
||||
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
|
||||
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: COMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
- 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}
|
||||
- |
|
||||
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
|
||||
# Disabled until tests all pass on OSX:
|
||||
#
|
||||
# 3/ OSX Clang Builds
|
||||
#- os: osx
|
||||
# osx_image: xcode6.4
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Debug'
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-10-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="10"
|
||||
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: osx
|
||||
# osx_image: xcode6.4
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-10-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="10"
|
||||
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: osx
|
||||
# osx_image: xcode6.4
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
- os: osx
|
||||
stage: optional
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-latest"
|
||||
# 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="node"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
#- os: osx
|
||||
# osx_image: xcode7
|
||||
# compiler: clang
|
||||
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-latest-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="node"
|
||||
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-latest-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="node"
|
||||
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: osx
|
||||
osx_image: xcode9.2
|
||||
compiler: "mason-osx-release-node-lts"
|
||||
# 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="--lts"
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-lts-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="--lts"
|
||||
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-lts-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="--lts"
|
||||
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
|
||||
|
||||
allow_failures:
|
||||
- compiler: "mason-osx-release-node-latest"
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="node"
|
||||
- compiler: "node-latest-mason-linux-release"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node"
|
||||
- compiler: "node-latest-mason-linux-debug"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node"
|
||||
- compiler: "mason-osx-release-node-lts"
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="--lts"
|
||||
- compiler: "node-lts-mason-linux-release"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts"
|
||||
- compiler: "node-lts-mason-linux-debug"
|
||||
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts"
|
||||
|
||||
before_install:
|
||||
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
||||
- source $NVM_DIR/nvm.sh
|
||||
- nvm install $NODE
|
||||
- nvm use $NODE
|
||||
- node --version
|
||||
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
|
||||
- |
|
||||
if [[ -z $JOBS ]]; then
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
export JOBS=$((`nproc` + 1))
|
||||
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
||||
fi
|
||||
fi
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
sudo mdutil -i off /
|
||||
fi
|
||||
- export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
|
||||
- export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off")
|
||||
- echo "Using ${JOBS} jobs"
|
||||
- npm ci --ignore-scripts
|
||||
# Bootstrap cmake to be able to run mason
|
||||
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}.tar.gz"
|
||||
- CMAKE_DIR="mason_packages/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}"
|
||||
- mkdir -p ${CMAKE_DIR}
|
||||
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} || travis_terminate 1
|
||||
- export PATH=${CMAKE_DIR}/bin:${PATH}
|
||||
- ${MASON} install tbb 2017_U7 && export LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_U7)/lib/:${LD_LIBRARY_PATH}
|
||||
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
|
||||
- |
|
||||
if [[ ! -z ${CLANG_VERSION} ]]; then
|
||||
export CCOMPILER='clang'
|
||||
export CXXCOMPILER='clang++'
|
||||
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH} || travis_terminate 1
|
||||
# we only enable lto for release builds
|
||||
# and therefore don't need to us ld.gold or llvm tools for linking
|
||||
# for debug builds
|
||||
if [[ ${BUILD_TYPE} == 'Release' ]]; then
|
||||
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH} || travis_terminate 1
|
||||
fi
|
||||
fi
|
||||
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
||||
- export OSRM_INSTALL_DIR="$(pwd)/install-osrm"
|
||||
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
|
||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||
- mkdir ${OSRM_BUILD_DIR}
|
||||
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
||||
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \
|
||||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \
|
||||
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
||||
-DBUILD_TOOLS=ON \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||
-DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF}
|
||||
- echo "travis_fold:start:MAKE"
|
||||
- make --jobs=${JOBS}
|
||||
- make tests --jobs=${JOBS}
|
||||
- make benchmarks --jobs=${JOBS}
|
||||
- echo "travis_fold:end:MAKE"
|
||||
- ccache -s
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
|
||||
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
|
||||
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
|
||||
|
||||
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
|
||||
brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
fi
|
||||
- rvm use 1.9.3
|
||||
- gem install bundler
|
||||
- bundle install
|
||||
- mkdir build && pushd build
|
||||
- export CXX=${COMPILER}
|
||||
- export OSRM_PORT=5000 OSRM_TIMEOUT=60
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
|
||||
|
||||
script:
|
||||
- make --jobs=2
|
||||
- make tests --jobs=2
|
||||
- make benchmarks
|
||||
- sudo make install
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib
|
||||
sudo ldconfig
|
||||
fi
|
||||
- ./extractor-tests
|
||||
- ./engine-tests
|
||||
- ./util-tests
|
||||
- popd
|
||||
- cucumber -p verify
|
||||
- make -C test/data
|
||||
- mkdir example/build && pushd example/build
|
||||
- export PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||
- make --jobs=${JOBS}
|
||||
- cmake ..
|
||||
- make
|
||||
- ./osrm-example ../../test/data/monaco.osrm
|
||||
- popd
|
||||
|
||||
script:
|
||||
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
||||
- make -C test/data benchmark
|
||||
- ./example/build/osrm-example test/data/mld/monaco.osrm
|
||||
# All tests assume to be run from the build directory
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- ./unit_tests/library-tests
|
||||
- ./unit_tests/extractor-tests
|
||||
- ./unit_tests/contractor-tests
|
||||
- ./unit_tests/engine-tests
|
||||
- ./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
|
||||
if [ -n "$RUN_CLANG_FORMAT" ]; then
|
||||
./scripts/format.sh || true # we don't want to fail just yet
|
||||
fi
|
||||
- |
|
||||
- popd
|
||||
- npm test
|
||||
|
||||
-893
@@ -1,896 +1,3 @@
|
||||
# 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:
|
||||
- FIXED: pessimistic calls to std::move [#5560](https://github.com/Project-OSRM/osrm-backend/pull/5561)
|
||||
- Features:
|
||||
- ADDED: new API parameter - `snapping=any|default` to allow snapping to previously unsnappable edges [#5361](https://github.com/Project-OSRM/osrm-backend/pull/5361)
|
||||
- ADDED: keepalive support to the osrm-routed HTTP server [#5518](https://github.com/Project-OSRM/osrm-backend/pull/5518)
|
||||
- ADDED: flatbuffers output format support [#5513](https://github.com/Project-OSRM/osrm-backend/pull/5513)
|
||||
- ADDED: Global 'skip_waypoints' option [#5556](https://github.com/Project-OSRM/osrm-backend/pull/5556)
|
||||
- FIXED: Install the libosrm_guidance library correctly [#5604](https://github.com/Project-OSRM/osrm-backend/pull/5604)
|
||||
- FIXED: Http Handler can now deal witch optional whitespace between header-key and -value [#5606](https://github.com/Project-OSRM/osrm-backend/issues/5606)
|
||||
- Routing:
|
||||
- CHANGED: allow routing past `barrier=arch` [#5352](https://github.com/Project-OSRM/osrm-backend/pull/5352)
|
||||
- CHANGED: default car weight was reduced to 2000 kg. [#5371](https://github.com/Project-OSRM/osrm-backend/pull/5371)
|
||||
- CHANGED: default car height was reduced to 2 meters. [#5389](https://github.com/Project-OSRM/osrm-backend/pull/5389)
|
||||
- FIXED: treat `bicycle=use_sidepath` as no access on the tagged way. [#5622](https://github.com/Project-OSRM/osrm-backend/pull/5622)
|
||||
- FIXED: fix table result when source and destination on same one-way segment. [#5828](https://github.com/Project-OSRM/osrm-backend/pull/5828)
|
||||
- FIXED: fix occasional segfault when swapping data with osrm-datastore and using `exclude=` [#5844](https://github.com/Project-OSRM/osrm-backend/pull/5844)
|
||||
- FIXED: fix crash in MLD alternative search if source or target are invalid [#5851](https://github.com/Project-OSRM/osrm-backend/pull/5851)
|
||||
- Misc:
|
||||
- CHANGED: Reduce memory usage for raster source handling. [#5572](https://github.com/Project-OSRM/osrm-backend/pull/5572)
|
||||
- CHANGED: Add cmake option `ENABLE_DEBUG_LOGGING` to control whether output debug logging. [#3427](https://github.com/Project-OSRM/osrm-backend/issues/3427)
|
||||
- CHANGED: updated extent of Hong Kong as left hand drive country. [#5535](https://github.com/Project-OSRM/osrm-backend/issues/5535)
|
||||
- FIXED: corrected error message when failing to snap input coordinates [#5846](https://github.com/Project-OSRM/osrm-backend/pull/5846)
|
||||
- Infrastructure
|
||||
- REMOVED: STXXL support removed as STXXL became abandonware. [#5760](https://github.com/Project-OSRM/osrm-backend/pull/5760)
|
||||
|
||||
# 5.22.0
|
||||
- Changes from 5.21.0
|
||||
- Build:
|
||||
- ADDED: optionally build Node `lts` and `latest` bindings [#5347](https://github.com/Project-OSRM/osrm-backend/pull/5347)
|
||||
- Features:
|
||||
- ADDED: new waypoints parameter to the `route` plugin, enabling silent waypoints [#5345](https://github.com/Project-OSRM/osrm-backend/pull/5345)
|
||||
- ADDED: data timestamp information in the response (saved in new file `.osrm.timestamp`). [#5115](https://github.com/Project-OSRM/osrm-backend/issues/5115)
|
||||
|
||||
# 5.21.0
|
||||
- Changes from 5.20.0
|
||||
- Features:
|
||||
- ADDED: all waypoints in responses now contain a distance property between the original coordinate and the snapped location. [#5255](https://github.com/Project-OSRM/osrm-backend/pull/5255)
|
||||
- ADDED: if `fallback_speed` is used, a new structure `fallback_speed_cells` will describe which cells contain estimated values [#5259](https://github.com/Project-OSRM/osrm-backend/pull/5259)
|
||||
- REMOVED: we no longer publish Node 4 or 6 binary modules (they are still buildable from source) [#5314](https://github.com/Project-OSRM/osrm-backend/pull/5314)
|
||||
- Table:
|
||||
- ADDED: new parameter `scale_factor` which will scale the cell `duration` values by this factor. [#5298](https://github.com/Project-OSRM/osrm-backend/pull/5298)
|
||||
- FIXED: only trigger `scale_factor` code to scan matrix when necessary. [#5303](https://github.com/Project-OSRM/osrm-backend/pull/5303)
|
||||
- FIXED: fix bug in reverse offset calculation that sometimes lead to negative (and other incorrect) values in distance table results [#5315](https://github.com/Project-OSRM/osrm-backend/pull/5315)
|
||||
- Docker:
|
||||
- FIXED: use consistent boost version between build and runtime [#5311](https://github.com/Project-OSRM/osrm-backend/pull/5311)
|
||||
- FIXED: don't override default permissions on /opt [#5311](https://github.com/Project-OSRM/osrm-backend/pull/5311)
|
||||
- Matching:
|
||||
- CHANGED: matching will now consider edges marked with is_startpoint=false, allowing matching over ferries and other previously non-matchable edge types. [#5297](https://github.com/Project-OSRM/osrm-backend/pull/5297)
|
||||
- Profile:
|
||||
- ADDED: Parse `source:maxspeed` and `maxspeed:type` tags to apply maxspeeds and add belgian flanders rural speed limit. [#5217](https://github.com/Project-OSRM/osrm-backend/pull/5217)
|
||||
- CHANGED: Refactor maxspeed parsing to use common library. [#5144](https://github.com/Project-OSRM/osrm-backend/pull/5144)
|
||||
|
||||
# 5.20.0
|
||||
- Changes from 5.19.0:
|
||||
- Table:
|
||||
- CHANGED: switch to pre-calculated distances for table responses for large speedup and 10% memory increase. [#5251](https://github.com/Project-OSRM/osrm-backend/pull/5251)
|
||||
- ADDED: new parameter `fallback_speed` which will fill `null` cells with estimated value [#5257](https://github.com/Project-OSRM/osrm-backend/pull/5257)
|
||||
- CHANGED: Remove API check for matrix sources/destination length to be less than or equal to coordinates length. [#5298](https://github.com/Project-OSRM/osrm-backend/pull/5289)
|
||||
- FIXED: Fix crashing bug when using fallback_speed parameter with more sources than destinations. [#5291](https://github.com/Project-OSRM/osrm-backend/pull/5291)
|
||||
- Features:
|
||||
- ADDED: direct mmapping of datafiles is now supported via the `--mmap` switch. [#5242](https://github.com/Project-OSRM/osrm-backend/pull/5242)
|
||||
- REMOVED: the previous `--memory_file` switch is now deprecated and will fallback to `--mmap` [#5242](https://github.com/Project-OSRM/osrm-backend/pull/5242)
|
||||
- ADDED: Now publishing Node 10.x LTS binary modules [#5246](https://github.com/Project-OSRM/osrm-backend/pull/5246)
|
||||
- Windows:
|
||||
- FIXED: Windows builds again. [#5249](https://github.com/Project-OSRM/osrm-backend/pull/5249)
|
||||
- Docker:
|
||||
- CHANGED: switch from Alpine Linux to Debian Buster base images [#5281](https://github.com/Project-OSRM/osrm-backend/pull/5281)
|
||||
|
||||
# 5.19.0
|
||||
- Changes from 5.18.0:
|
||||
- Optimizations:
|
||||
- CHANGED: Use Grisu2 for serializing floating point numbers. [#5188](https://github.com/Project-OSRM/osrm-backend/pull/5188)
|
||||
- ADDED: Node bindings can return pre-rendered JSON buffer. [#5189](https://github.com/Project-OSRM/osrm-backend/pull/5189)
|
||||
- Profiles:
|
||||
- CHANGED: Bicycle profile now blacklists barriers instead of whitelisting them [#5076
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5076/)
|
||||
- CHANGED: Foot profile now blacklists barriers instead of whitelisting them [#5077
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5077/)
|
||||
- CHANGED: Support maxlength and maxweight in car profile [#5101](https://github.com/Project-OSRM/osrm-backend/pull/5101]
|
||||
- Bugfixes:
|
||||
- FIXED: collapsing of ExitRoundabout instructions [#5114](https://github.com/Project-OSRM/osrm-backend/issues/5114)
|
||||
- Misc:
|
||||
- CHANGED: Support up to 512 named shared memory regions [#5185](https://github.com/Project-OSRM/osrm-backend/pull/5185)
|
||||
|
||||
# 5.18.0
|
||||
- Changes from 5.17.0:
|
||||
- Features:
|
||||
- ADDED: `table` plugin now optionally returns `distance` matrix as part of response [#4990](https://github.com/Project-OSRM/osrm-backend/pull/4990)
|
||||
- ADDED: New optional parameter `annotations` for `table` that accepts `distance`, `duration`, or both `distance,duration` as values [#4990](https://github.com/Project-OSRM/osrm-backend/pull/4990)
|
||||
- Infrastructure:
|
||||
- ADDED: Updated libosmium and added protozero and vtzero libraries [#5037](https://github.com/Project-OSRM/osrm-backend/pull/5037)
|
||||
- CHANGED: Use vtzero library in tile plugin [#4686](https://github.com/Project-OSRM/osrm-backend/pull/4686)
|
||||
- Profile:
|
||||
- ADDED: Bicycle profile now returns classes for ferry and tunnel routes. [#5054](https://github.com/Project-OSRM/osrm-backend/pull/5054)
|
||||
- ADDED: Bicycle profile allows to exclude ferry routes (default to not enabled) [#5054](https://github.com/Project-OSRM/osrm-backend/pull/5054)
|
||||
|
||||
# 5.17.1
|
||||
- Changes from 5.17.0:
|
||||
- Bugfixes:
|
||||
- FIXED: Do not combine a segregated edge with a roundabout [#5039](https://github.com/Project-OSRM/osrm-backend/issues/5039)
|
||||
|
||||
# 5.17.0
|
||||
- Changes from 5.16.0:
|
||||
- Bugfixes:
|
||||
- FIXED: deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909)
|
||||
- FIXED: Use smaller range for U-turn angles in map-matching [#4920](https://github.com/Project-OSRM/osrm-backend/pull/4920)
|
||||
- FIXED: Remove the last short annotation segment in `trimShortSegments` [#4946](https://github.com/Project-OSRM/osrm-backend/pull/4946)
|
||||
- FIXED: Properly calculate annotations for speeds, durations and distances when waypoints are used with mapmatching [#4949](https://github.com/Project-OSRM/osrm-backend/pull/4949)
|
||||
- FIXED: Don't apply unimplemented SH and PH conditions in OpeningHours and add inversed date ranges [#4992](https://github.com/Project-OSRM/osrm-backend/issues/4992)
|
||||
- FIXED: integer overflow in `DynamicGraph::Renumber` [#5021](https://github.com/Project-OSRM/osrm-backend/pull/5021)
|
||||
- Profile:
|
||||
- CHANGED: Handle oneways in get_forward_backward_by_key [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
||||
- FIXED: Do not route against oneway road if there is a cycleway in the wrong direction; also review bike profile [#4943](https://github.com/Project-OSRM/osrm-backend/issues/4943)
|
||||
- CHANGED: Make cyclability weighting of the bike profile prefer safer routes more strongly [#5015](https://github.com/Project-OSRM/osrm-backend/issues/5015)
|
||||
- Guidance:
|
||||
- CHANGED: Don't use obviousness for links bifurcations [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
||||
- FIXED: Adjust Straight direction modifiers of side roads in driveway handler [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929)
|
||||
- CHANGED: Added post process logic to collapse segregated turn instructions [#4925](https://github.com/Project-OSRM/osrm-backend/pull/4925)
|
||||
- ADDED: Maneuver relation now supports `straight` as a direction [#4995](https://github.com/Project-OSRM/osrm-backend/pull/4995)
|
||||
- FIXED: Support spelling maneuver relation with British spelling [#4950](https://github.com/Project-OSRM/osrm-backend/issues/4950)
|
||||
- Tools:
|
||||
- ADDED: `osrm-routed` accepts a new property `--memory_file` to store memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881)
|
||||
- ADDED: `osrm-datastore` accepts a new parameter `--dataset-name` to select the name of the dataset. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- ADDED: `osrm-datastore` accepts a new parameter `--list` to list all datasets loaded into memory. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- ADDED: `osrm-datastore` accepts a new parameter `--only-metric` to only reload the data that can be updated by a weight update (reduces memory for traffic updates). [#5002](https://github.com/Project-OSRM/osrm-backend/pull/5002)
|
||||
- ADDED: `osrm-routed` accepts a new parameter `--dataset-name` to select the shared-memory dataset to use. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- NodeJS:
|
||||
- ADDED: `OSRM` object accepts a new option `memory_file` that stores the memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881)
|
||||
- ADDED: `OSRM` object accepts a new option `dataset_name` to select the shared-memory dataset. [#4982](https://github.com/Project-OSRM/osrm-backend/pull/4982)
|
||||
- Internals
|
||||
- CHANGED: Updated segregated intersection identification [#4845](https://github.com/Project-OSRM/osrm-backend/pull/4845) [#4968](https://github.com/Project-OSRM/osrm-backend/pull/4968)
|
||||
- REMOVED: Remove `.timestamp` file since it was unused [#4960](https://github.com/Project-OSRM/osrm-backend/pull/4960)
|
||||
- Documentation:
|
||||
- ADDED: Add documentation about OSM node ids in nearest service response [#4436](https://github.com/Project-OSRM/osrm-backend/pull/4436)
|
||||
- Performance
|
||||
- FIXED: Speed up response time when lots of legs exist and geojson is used with `steps=true` [#4936](https://github.com/Project-OSRM/osrm-backend/pull/4936)
|
||||
- FIXED: Return iterators instead of vectors in datafacade_base functions [#4969](https://github.com/Project-OSRM/osrm-backend/issues/4969)
|
||||
- Misc:
|
||||
- ADDED: expose name for datasource annotations as metadata [#4973](https://github.com/Project-OSRM/osrm-backend/pull/4973)
|
||||
|
||||
# 5.16.0
|
||||
- Changes from 5.15.2:
|
||||
- Guidance
|
||||
- ADDED #4676: Support for maneuver override relation, allowing data-driven overrides for turn-by-turn instructions [#4676](https://github.com/Project-OSRM/osrm-backend/pull/4676)
|
||||
- CHANGED #4830: Announce reference change if names are empty
|
||||
- CHANGED #4835: MAXIMAL_ALLOWED_SEPARATION_WIDTH increased to 12 meters
|
||||
- CHANGED #4842: Lower priority links from a motorway now are used as motorway links [#4842](https://github.com/Project-OSRM/osrm-backend/pull/4842)
|
||||
- CHANGED #4895: Use ramp bifurcations as fork intersections [#4895](https://github.com/Project-OSRM/osrm-backend/issues/4895)
|
||||
- CHANGED #4893: Handle motorway forks with links as normal motorway intersections[#4893](https://github.com/Project-OSRM/osrm-backend/issues/4893)
|
||||
- FIXED #4905: Check required tags of `maneuver` relations [#4905](https://github.com/Project-OSRM/osrm-backend/pull/4905)
|
||||
- Profile:
|
||||
- FIXED: `highway=service` will now be used for restricted access, `access=private` is still disabled for snapping.
|
||||
- ADDED #4775: Exposes more information to the turn function, now being able to set turn weights with highway and access information of the turn as well as other roads at the intersection [#4775](https://github.com/Project-OSRM/osrm-backend/issues/4775)
|
||||
- FIXED #4763: Add support for non-numerical units in car profile for maxheight [#4763](https://github.com/Project-OSRM/osrm-backend/issues/4763)
|
||||
- ADDED #4872: Handling of `barrier=height_restrictor` nodes [#4872](https://github.com/Project-OSRM/osrm-backend/pull/4872)
|
||||
|
||||
# 5.15.2
|
||||
- Changes from 5.15.1:
|
||||
- Features:
|
||||
- ADDED: Exposed the waypoints parameter in the node bindings interface
|
||||
- Bugfixes:
|
||||
- FIXED: Segfault causing bug in leg collapsing map matching when traversing edges in reverse
|
||||
|
||||
# 5.15.1
|
||||
- Changes from 5.15.0:
|
||||
- Bugfixes:
|
||||
- FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches
|
||||
- Guidance:
|
||||
- Set type of trivial intersections where classes change to Suppressed instead of NoTurn
|
||||
|
||||
# 5.15.0
|
||||
- Changes from 5.14.3:
|
||||
- Bugfixes:
|
||||
- FIXED #4704: Fixed regression in bearings reordering introduced in 5.13 [#4704](https://github.com/Project-OSRM/osrm-backend/issues/4704)
|
||||
- FIXED #4781: Fixed overflow exceptions in percent-encoding parsing
|
||||
- FIXED #4770: Fixed exclude flags for single toll road scenario
|
||||
- FIXED #4283: Fix overflow on zero duration segments
|
||||
- FIXED #4804: Ignore no_*_on_red turn restrictions
|
||||
- Guidance:
|
||||
- CHANGED #4706: Guidance refactoring step to decouple intersection connectivity analysis and turn instructions generation [#4706](https://github.com/Project-OSRM/osrm-backend/pull/4706)
|
||||
- CHANGED #3491: Refactor `isThroughStreet`/Intersection options
|
||||
- Profile:
|
||||
- ADDED: `tunnel` as a new class in car profile so that sections of the route with tunnel tags will be marked as such
|
||||
|
||||
# 5.14.3
|
||||
- Changes from 5.14.2:
|
||||
- Features:
|
||||
- Added a `waypoints` parameter to the match service plugin that accepts indices to input coordinates and treats only those points as waypoints in the response format.
|
||||
- Bugfixes:
|
||||
- FIXED #4754: U-Turn penalties are applied to straight turns.
|
||||
- FIXED #4756: Removed too restrictive road name check in the sliproad handler
|
||||
- FIXED #4731: Use correct weights for edge-based graph duplicated via nodes.
|
||||
- Profile:
|
||||
- CHANGED: added Belarus speed limits
|
||||
- CHANGED: set default urban speed in Ukraine to 50kmh
|
||||
|
||||
# 5.14.2
|
||||
- Changes from 5.14.1:
|
||||
- Bugfixes:
|
||||
- FIXED #4727: Erroring when a old .core file is present.
|
||||
- FIXED #4642: Update checks for EMPTY_NAMEID to check for empty name strings
|
||||
- FIXED #4738: Fix potential segmentation fault
|
||||
- Node.js Bindings:
|
||||
- ADDED: Exposed new `max_radiuses_map_matching` option from `EngingConfig` options
|
||||
- Tools:
|
||||
- ADDED: New osrm-routed `max_radiuses_map_matching` command line flag to optionally set a maximum radius for map matching
|
||||
|
||||
# 5.14.1
|
||||
- Changes from 5.14.0
|
||||
- Bugfixes:
|
||||
- FIXED: don't use removed alternative candidates in `filterPackedPathsByCellSharing`
|
||||
|
||||
# 5.14.0
|
||||
- Changes from 5.13
|
||||
- API:
|
||||
- ADDED: new RouteStep property `driving_side` that has either "left" or "right" for that step
|
||||
- Misc:
|
||||
- ADDED: Bundles a rough (please improve!) driving-side GeoJSON file for use with `osrm-extract --location-dependent-data data/driving_side.geojson`
|
||||
- CHANGED: Conditional turn parsing is disabled by default now
|
||||
- ADDED: Adds a tool to analyze turn instruction generation in a dataset. Useful for tracking turn-by-turn heuristic changes over time.
|
||||
- CHANGED: Internal refactoring of guidance code as a first step towards a re-runnable guidance pipeline
|
||||
- ADDED: Now publishing Node 8.x LTS binary modules
|
||||
- Profile:
|
||||
- CHANGED: Remove dependency on turn types and turn modifier in the process_turn function in the `car.lua` profile. Guidance instruction types are not used to influence turn penalty anymore so this will break backward compatibility between profile version 3 and 4.
|
||||
- Guidance:
|
||||
- ADDED: New internal flag on "segregated intersections" - in the future, will should allow collapsing of instructions across complex intersection geometry where humans only perceive a single maneuver
|
||||
- CHANGED: Decrease roundabout turn radius threshold from 25m to 15m - adds some "exit the roundabout" instructions for moderately sized roundabouts that were being missed previously
|
||||
- Docker:
|
||||
- CHANGED: switch to alpine 3.6, and use a multistage build to reduce image size
|
||||
- Build:
|
||||
- FIX: use LUA_LIBRARY_DIRS to propertly detect Lua on all platforms
|
||||
- Docs:
|
||||
- FIX: clarify description of roundabout exit instructions
|
||||
- Bugfixes:
|
||||
- FIXED: Fix bug where merge instructions got the wrong direction modifier ([PR #4670](https://github.com/Project-OSRM/osrm-backend/pull/4670))
|
||||
- FIXED: Properly use the `profile.properties.left_hand_driving` property, there was a typo that meant it had no effect
|
||||
- FIXED: undefined behaviour when alternative candidate via node is same as source node ([#4691](https://github.com/Project-OSRM/osrm-backend/issues/4691))
|
||||
- FIXED: ensure libosrm.pc is pushed to the correct location for pkgconfig to find it on all platforms
|
||||
- FIXED: don't consider empty names + empty refs as a valid name for u-turns
|
||||
|
||||
# 5.13.0
|
||||
- Changes from 5.12:
|
||||
- Profile:
|
||||
- Append cardinal directions from route relations to ref fields to improve instructions; off by default see `profile.cardinal_directions`
|
||||
- Support of `distance` weight in foot and bicycle profiles
|
||||
- Support of relations processing
|
||||
- Added `way:get_location_tag(key)` method to get location-dependent tags https://github.com/Project-OSRM/osrm-backend/wiki/Using-location-dependent-data-in-profiles
|
||||
- Added `forward_ref` and `backward_ref` support
|
||||
- Left-side driving mode is specified by a local Boolean flag `is_left_hand_driving` in `ExtractionWay` and `ExtractionTurn`
|
||||
- Support literal values for maxspeeds in NO, PL and ZA
|
||||
- Infrastructure:
|
||||
- Lua 5.1 support is removed due to lack of support in sol2 https://github.com/ThePhD/sol2/issues/302
|
||||
- Fixed pkg-config version of OSRM
|
||||
- Removed `.osrm.core` file since CoreCH is deprecated now.
|
||||
- Tools:
|
||||
- Because of boost/program_options#32 with boost 1.65+ we needed to change the behavior of the following flags to not accept `={true|false}` anymore:
|
||||
- `--use-locations-cache=false` becomes `--disable-location-cache`
|
||||
- `--parse-conditional-restrictions=true` becomes `--parse-conditional-restrictions`
|
||||
- The deprecated options `--use-level-cache` and `--generate-edge-lookup`
|
||||
- Bugfixes:
|
||||
- Fixed #4348: Some cases of sliproads pre-processing were broken
|
||||
- Fixed #4331: Correctly compute left/right modifiers of forks in case the fork is curved.
|
||||
- Fixed #4472: Correctly count the number of lanes using the delimter in `turn:lanes` tag.
|
||||
- Fixed #4214: Multiple runs of `osrm-partition` lead to crash.
|
||||
- Fixed #4348: Fix assorted problems around slip roads.
|
||||
- Fixed #4420: A bug that would result in unnecessary instructions, due to problems in suffix/prefix detection
|
||||
- Algorithm
|
||||
- Deprecate CoreCH functionality. Usage of CoreCH specific options will fall back to using CH with core_factor of 1.0
|
||||
- MLD uses a unidirectional Dijkstra for 1-to-N and N-to-1 matrices which yields speedup.
|
||||
|
||||
# 5.12.0
|
||||
- Changes from 5.11:
|
||||
- Guidance
|
||||
- now announcing turning onto oneways at the end of a road (e.g. onto dual carriageways)
|
||||
- Adds new instruction types at the exit of roundabouts and rotaries `exit roundabout` and `exit rotary`.
|
||||
- HTTP:
|
||||
- New query parameter for route/table/match/trip plugings:
|
||||
`exclude=` that can be used to exclude certain classes (e.g. exclude=motorway, exclude=toll).
|
||||
This is configurable in the profile.
|
||||
- NodeJS:
|
||||
- New query option `exclude` for the route/table/match/trip plugins. (e.g. `exclude: ["motorway", "toll"]`)
|
||||
- Profile:
|
||||
- New property for profile table: `excludable` that can be used to configure which classes are excludable at query time.
|
||||
- New optional property for profile table: `classes` that allows you to specify which classes you expect to be used.
|
||||
We recommend this for better error messages around classes, otherwise the possible class names are infered automatically.
|
||||
- Traffic:
|
||||
- If traffic data files contain an empty 4th column, they will update edge durations but not modify the edge weight. This is useful for
|
||||
updating ETAs returned, without changing route selection (for example, in a distance-based profile with traffic data loaded).
|
||||
- Infrastructure:
|
||||
- New file `.osrm.cell_metrics` created by `osrm-customize`.
|
||||
- Debug tiles:
|
||||
- Added new properties `type` and `modifier` to `turns` layer, useful for viewing guidance calculated turn types on the map
|
||||
|
||||
# 5.11.0
|
||||
- Changes from 5.10:
|
||||
- Features
|
||||
- BREAKING: Added support for conditional via-way restrictions. This features changes the file format of osrm.restrictions and requires re-extraction
|
||||
- Internals
|
||||
- BREAKING: Traffic signals will no longer be represented as turns internally. This requires re-processing of data but enables via-way turn restrictions across highway=traffic_signals
|
||||
- Additional checks for empty segments when loading traffic data files
|
||||
- Tunes the constants for turns in sharp curves just a tiny bit to circumvent a mix-up in fork directions at a specific intersection (https://github.com/Project-OSRM/osrm-backend/issues/4331)
|
||||
- Infrastructure
|
||||
- Refactor datafacade to make implementing additional DataFacades simpler
|
||||
- Bugfixes
|
||||
- API docs are now buildable again
|
||||
- Suppress unnecessary extra turn instruction when exiting a motorway via a motorway_link onto a primary road (https://github.com/Project-OSRM/osrm-backend/issues/4348 scenario 4)
|
||||
- Suppress unnecessary extra turn instruction when taking a tertiary_link road from a teritary onto a residential road (https://github.com/Project-OSRM/osrm-backend/issues/4348 scenario 2)
|
||||
- Various MSVC++ build environment fixes
|
||||
- Avoid a bug that crashes GCC6
|
||||
- Re-include .npmignore to slim down published modules
|
||||
- Fix a pre-processing bug where incorrect directions could be issued when two turns would have similar instructions and we tried to give them distinct values (https://github.com/Project-OSRM/osrm-backend/pull/4375)
|
||||
- The entry bearing for correct the cardinality of a direction value (https://github.com/Project-OSRM/osrm-backend/pull/4353
|
||||
- Change timezones in West Africa to the WAT zone so they're recognized on the Windows platform
|
||||
|
||||
# 5.10.0
|
||||
- Changes from 5.9:
|
||||
- Profiles:
|
||||
- New version 2 profile API which cleans up a number of things and makes it easier to for profiles to include each other. Profiles using the old version 0 and 1 APIs are still supported.
|
||||
- New required `setup()` function that must return a configuration hash. Storing configuration in globals is deprecated.
|
||||
- Passes the config hash returned in `setup()` as an argument to `process_node/way/segment/turn`.
|
||||
- Properties are now set in `.properties` in the config hash returend by setup().
|
||||
- initialize raster sources in `setup()` instead of in a separate callback.
|
||||
- Renames the `sources` helper to `raster`.
|
||||
- Renames `way_functions` to `process_way` (same for node, segment and turn).
|
||||
- Removes `get_restrictions()`. Instead set `.restrictions` in the config hash in `setup()`.
|
||||
- Removes `get_name_suffix_list()`. Instead set `.suffix_list` in the config hash in `setup()`.
|
||||
- Renames `Handlers` to `WayHandlers`.
|
||||
- Pass functions instead of strings to `WayHandlers.run()`, so it's possible to mix in your own functions.
|
||||
- Reorders arguments to `WayHandlers` functions to match `process_way()`.
|
||||
- Profiles must return a hash of profile functions. This makes it easier for profiles to include each other.
|
||||
- Guidance: add support for throughabouts
|
||||
- Bugfixes
|
||||
- Properly save/retrieve datasource annotations for road segments ([#4346](https://github.com/Project-OSRM/osrm-backend/issues/4346)
|
||||
- Fix conditional restriction grammer parsing so it works for single-day-of-week restrictions ([#4357](https://github.com/Project-OSRM/osrm-backend/pull/4357))
|
||||
- Algorithm
|
||||
- BREAKING: the file format requires re-processing due to the changes on via-ways
|
||||
- Added support for via-way restrictions
|
||||
|
||||
# 5.9.2
|
||||
- API:
|
||||
- `annotations=durations,weights,speeds` values no longer include turn penalty values ([#4330](https://github.com/Project-OSRM/osrm-backend/issues/4330))
|
||||
|
||||
# 5.9.1
|
||||
- Infrastructure
|
||||
- STXXL is not required by default
|
||||
|
||||
# 5.9.0
|
||||
- Changes from 5.8:
|
||||
- Algorithm:
|
||||
- Multi-Level Dijkstra:
|
||||
- Plugins supported: `table`
|
||||
- Adds alternative routes support (see [#4047](https://github.com/Project-OSRM/osrm-backend/pull/4047) and [3905](https://github.com/Project-OSRM/osrm-backend/issues/3905)): provides reasonably looking alternative routes (many, if possible) with reasonable query times.
|
||||
- API:
|
||||
- Exposes `alternatives=Number` parameter overload in addition to the boolean flag.
|
||||
- Support for exits numbers and names. New member `exits` in `RouteStep`, based on `junction:ref` on ways
|
||||
- `Intersection` now has new parameter `classes` that can be set in the profile on each way.
|
||||
- Profiles:
|
||||
- `result.exits` allows you to set a way's exit numbers and names, see [`junction:ref`](http://wiki.openstreetmap.org/wiki/Proposed_features/junction_details)
|
||||
- `ExtractionWay` now as new property `forward_classes` and `backward_classes` that can set in the `way_function`.
|
||||
The maximum number of classes is 8.
|
||||
- We now respect the `construction` tag. If the `construction` tag value is not on our whitelist (`minor`, `widening`, `no`) we will exclude the road.
|
||||
- Node.js Bindings:
|
||||
- Exposes `alternatives=Number` parameter overload in addition to the boolean flag
|
||||
- Expose `EngineConfig` options in the node bindings
|
||||
- Tools:
|
||||
- Exposes engine limit on number of alternatives to generate `--max-alternatives` in `osrm-routed` (3 by default)
|
||||
- Infrastructure
|
||||
- STXXL is not required to build OSRM and is an optional dependency for back-compatibility (ENABLE_STXXL=On)
|
||||
- OpenMP is only required when the optional STXXL dependency is used
|
||||
- Bug fixes:
|
||||
- #4278: Remove superflous continious instruction on a motorway.
|
||||
|
||||
# 5.8.0
|
||||
- Changes from 5.7
|
||||
- API:
|
||||
- polyline6 support in request string
|
||||
- new parameter `approaches` for `route`, `table`, `trip` and `nearest` requests. This parameter keep waypoints on the curb side.
|
||||
'approaches' accepts both 'curb' and 'unrestricted' values.
|
||||
Note : the curb side depend on the `ProfileProperties::left_hand_driving`, it's a global property set once by the profile. If you are working with a planet dataset, the api will be wrong in some countries, and right in others.
|
||||
- NodeJs Bindings
|
||||
- new parameter `approaches` for `route`, `table`, `trip` and `nearest` requests.
|
||||
- Tools
|
||||
- `osrm-partition` now ensures it is called before `osrm-contract` and removes inconsitent .hsgr files automatically.
|
||||
- Features
|
||||
- Added conditional restriction support with `parse-conditional-restrictions=true|false` to osrm-extract. This option saves conditional turn restrictions to the .restrictions file for parsing by contract later. Added `parse-conditionals-from-now=utc time stamp` and `--time-zone-file=/path/to/file` to osrm-contract
|
||||
- Command-line tools (osrm-extract, osrm-contract, osrm-routed, etc) now return error codes and legible error messages for common problem scenarios, rather than ugly C++ crashes
|
||||
- Speed up pre-processing by only running the Lua `node_function` for nodes that have tags. Cuts OSM file parsing time in half.
|
||||
- osrm-extract now performs generation of edge-expanded-edges using all available CPUs, which should make osrm-extract significantly faster on multi-CPU machines
|
||||
- Files
|
||||
- .osrm.nodes file was renamed to .nbg_nodes and .ebg_nodes was added
|
||||
- Guidance
|
||||
- #4075 Changed counting of exits on service roundabouts
|
||||
- Debug Tiles
|
||||
- added support for visualising turn penalties to the MLD plugin
|
||||
- added support for showing the rate (reciprocal of weight) on each edge when used
|
||||
- added support for turn weights in addition to turn durations in debug tiles
|
||||
- Bugfixes
|
||||
- Fixed a copy/paste issue assigning wrong directions in similar turns (left over right)
|
||||
- #4074: fixed a bug that would announce entering highway ramps as u-turns
|
||||
- #4122: osrm-routed/libosrm should throw exception when a dataset incompatible with the requested algorithm is loaded
|
||||
- Avoid collapsing u-turns into combined turn instructions
|
||||
|
||||
# 5.7.1
|
||||
- Bugfixes
|
||||
- #4030 Roundabout edge-case crashes post-processing
|
||||
|
||||
# 5.7.0
|
||||
- Changes from 5.6
|
||||
- Algorithm:
|
||||
- OSRM object has new option `algorithm` that allows the selection of a routing algorithm.
|
||||
- New experimental algorithm: Multi-Level Dijkstra with new toolchain:
|
||||
- Allows for fast metric updates in below a minute on continental sized networks (osrm-customize)
|
||||
- Plugins supported: `match` and `route`
|
||||
- Quickstart: `osrm-extract data.osm.pbf`, `osrm-partition data.osrm`, `osrm-customize data.osrm`, `osrm-routed --algorithm=MLD data.osrm`
|
||||
- NodeJs Bindings
|
||||
- Merged https://github.com/Project-OSRM/node-osrm into repository. Build via `cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On`.
|
||||
- `OSRM` object has new option `algorihtm="CH","CoreCH","MLD"`
|
||||
- Internals
|
||||
- Shared memory notification via conditional variables on Linux or semaphore queue on OS X and Windows with a limit of 128 OSRM Engine instances
|
||||
- Files
|
||||
- .osrm.datasource_index file was removed. Data is now part of .osrm.geometries.
|
||||
- .osrm.edge_lookup was removed. The option `--generate-edge-lookup` does nothing now.
|
||||
- `osrm-contract` does not depend on the `.osrm.fileIndex` file anymore
|
||||
- `osrm-extract` creates new file `.osrm.cnbg` and `.cnbg_to_ebg`
|
||||
- `osrm-partition` creates new file `.osrm.partition` and `.osrm.cells`
|
||||
- `osrm-customize` creates new file `.osrm.mldgr`
|
||||
- Profiles
|
||||
- Added `force_split_edges` flag to global properties. True value guarantees that segment_function will be called for all segments, but also could double memory consumption
|
||||
- Map Matching:
|
||||
- new option `gaps=split|ignore` to enable/disbale track splitting
|
||||
- new option `tidy=true|false` to simplify traces automatically
|
||||
|
||||
# 5.6.3
|
||||
- Changes from 5.6.0
|
||||
- Bugfixes
|
||||
- #3790 Fix incorrect speed values in tile plugin
|
||||
|
||||
# 5.6.2
|
||||
- Changes from 5.6.0
|
||||
- Bugfixes
|
||||
- Fix incorrect forward datasources getter in facade
|
||||
|
||||
# 5.6.1
|
||||
- Changes from 5.6.0
|
||||
- Bugfixes
|
||||
- Fix #3754 add restricted penalty on NoTurn turns
|
||||
|
||||
# 5.6.0
|
||||
- Changes from 5.5
|
||||
- Bugfixes
|
||||
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
|
||||
- Fix #3515 adjusted number of `nodes` in `annotation`
|
||||
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
|
||||
- Fix #2844 handle up to 16777215 code units in OSM names
|
||||
- Infrastructure
|
||||
- Support building rpm packages.
|
||||
- Guidance
|
||||
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
|
||||
- Profiles
|
||||
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
|
||||
- `properties` object has a new `weight_name` field, default value is "duration"
|
||||
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
|
||||
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
|
||||
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
|
||||
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
|
||||
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
|
||||
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
|
||||
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
|
||||
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
|
||||
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
|
||||
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
|
||||
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
|
||||
- Infrastructure
|
||||
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
|
||||
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
|
||||
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
|
||||
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
|
||||
- Tools:
|
||||
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
|
||||
- Trip Plugin
|
||||
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
|
||||
|
||||
# 5.5.1
|
||||
- Changes from 5.5.0
|
||||
- API:
|
||||
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
|
||||
- Bugfixes
|
||||
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
|
||||
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
|
||||
|
||||
# 5.5.0
|
||||
- Changes from 5.4.0
|
||||
- API:
|
||||
- `osrm-datastore` now accepts the parameter `--max-wait` that specifies how long it waits before aquiring a shared memory lock by force
|
||||
- Shared memory now allows for multiple clients (multiple instances of libosrm on the same segment)
|
||||
- Polyline geometries can now be requested with precision 5 as well as with precision 6
|
||||
- Profiles
|
||||
- the car profile has been refactored into smaller functions
|
||||
- get_value_by_key() is now guaranteed never to return empty strings, nil is returned instead.
|
||||
- debug.lua was added to make it easier to test/develop profile code.
|
||||
- `car.lua` now depends on lib/set.lua and lib/sequence.lua
|
||||
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
|
||||
- replaced lhs/rhs profiles by using test defined profiles
|
||||
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
|
||||
- Handle `destination:forward`, `destination:backward`, `destination:ref:forward`, `destination:ref:backward` tags
|
||||
- Properly handle destinations on `oneway=-1` roads
|
||||
- Guidance
|
||||
- Notifications are now exposed more prominently, announcing turns onto a ferry/pushing your bike more prominently
|
||||
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
|
||||
- Corrected the bearings returned for intermediate steps - requires reprocessing
|
||||
- Improved turn locations for collapsed turns
|
||||
- Sliproad classification refinements: the situations we detect as Sliproads now resemble more closely the reality
|
||||
- Trip Plugin
|
||||
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
|
||||
- Bugfixes
|
||||
- fixed a bug where polyline decoding on a defective polyline could end up in out-of-bound access on a vector
|
||||
- fixed compile errors in tile unit-test framework
|
||||
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
|
||||
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
|
||||
- fixed a bug in the tile plugin that resulted in discovering invalid edges for connections
|
||||
- improved error messages when missing files during traffic updates (#3114)
|
||||
- For single coordinate geometries the GeoJSON `Point` encoding was broken. We now always emit `LineString`s even in the one-coordinate-case (backwards compatible) (#3425)
|
||||
- Debug Tiles
|
||||
- Added support for turn penalties
|
||||
- Internals
|
||||
- Internal/Shared memory datafacades now share common memory layout and data loading code
|
||||
- File reading now has much better error handling
|
||||
- Misc
|
||||
- Progress indicators now print newlines when stdout is not a TTY
|
||||
- Prettier API documentation now generated via `npm run build-api-docs` output `build/docs`
|
||||
|
||||
# 5.4.3
|
||||
- Changes from 5.4.2
|
||||
- Bugfixes
|
||||
- #3254 Fixed a bug that could end up hiding roundabout instructions
|
||||
- #3260 fixed a bug that provided the wrong location in the arrival instruction
|
||||
|
||||
# 5.4.2
|
||||
- Changes from 5.4.1
|
||||
- Bugfixes
|
||||
- #3032 Fixed a bug that could result in emitting `invalid` as an instruction type on sliproads with mode changes
|
||||
- #3085 Fixed an outdated assertion that could throw without a cause for concern
|
||||
- #3179 Fixed a bug that could trigger an assertion in TurnInstruciton generation
|
||||
|
||||
# 5.4.1
|
||||
- Changes from 5.4.0
|
||||
- Bugfixes
|
||||
- #3016: Fixes shared memory updates while queries are running
|
||||
|
||||
# 5.4.0
|
||||
- Changes from 5.3.0
|
||||
- Profiles
|
||||
- includes library guidance.lua that offers preliminary configuration on guidance.
|
||||
- added left_hand_driving flag in global profile properties
|
||||
- modified turn penalty function for car profile - better fit to real data
|
||||
- return `ref` and `name` as separate fields. Do no use ref or destination as fallback for name value
|
||||
- the default profile for car now ignores HOV only roads
|
||||
- Guidance
|
||||
- Handle Access tags for lanes, only considering valid lanes in lane-guidance (think car | car | bike | car)
|
||||
- Improved the detection of non-noticeable name-changes
|
||||
- Summaries have been improved to consider references as well
|
||||
- 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
|
||||
- Fixed a bug where some roads could be falsly identified as sliproads
|
||||
- Fixed a bug where roundabout intersections could result in breaking assertions when immediately exited
|
||||
- Infrastructure:
|
||||
- Adds a feature to limit results in nearest service with a default of 100 in `osrm-routed`
|
||||
|
||||
# 5.3.0
|
||||
- Changes from 5.3.0-rc.3
|
||||
- Guidance
|
||||
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
||||
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
|
||||
- Bugfixes
|
||||
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
|
||||
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
|
||||
|
||||
- Changes form 5.2.7
|
||||
- API
|
||||
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
|
||||
- Introduces `lanes` to the `Intersection` object. The lane data contains both the markings at the intersection and a flag indicating if they can be chosen for the next turn
|
||||
- Removed unused `-s` from `osrm-datastore`
|
||||
- Guidance
|
||||
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
||||
- Improved detection of obvious turns
|
||||
- Improved turn lane detection
|
||||
- Reduce the number of end-of-road instructions in obvious cases
|
||||
- Profile:
|
||||
- bicycle.lua: Surface speeds never increase the actual speed
|
||||
- Infrastructure
|
||||
- Add 32bit support
|
||||
- Add ARM NEON/VFP support
|
||||
- Fix Windows builds
|
||||
- Optimize speed file updates using mmap
|
||||
- Add option to disable LTO for older compilers
|
||||
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
|
||||
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
|
||||
- Bugfixes:
|
||||
- Fix devide by zero on updating speed data using osrm-contract
|
||||
|
||||
# 5.3.0 RC3
|
||||
- Changes from 5.3.0-rc.2
|
||||
- Guidance
|
||||
- Improved detection of obvious turns
|
||||
- Improved turn lane detection
|
||||
- Bugfixes
|
||||
- Fix bug that didn't chose minimal weights on overlapping edges
|
||||
|
||||
# 5.3.0 RC2
|
||||
- Changes from 5.3.0-rc.1
|
||||
- Bugfixes
|
||||
- Fixes invalid checks in the lane-extraction part of the car profile
|
||||
|
||||
# 5.3.0 RC1
|
||||
- API
|
||||
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
|
||||
- Introduces lanes to the route response. The lane data contains both the markings at the intersection and a flag indicating their involvement in the turn
|
||||
|
||||
- Infrastructure
|
||||
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
|
||||
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
|
||||
|
||||
# 5.2.5
|
||||
- Bugfixes
|
||||
- Fixes a segfault caused by incorrect trimming logic for very short steps.
|
||||
|
||||
# 5.2.4
|
||||
- Bugfixes:
|
||||
- Fixed in issue that arised on roundabouts in combination with intermediate intersections and sliproads
|
||||
|
||||
# 5.2.3
|
||||
- Bugfixes:
|
||||
- Fixed an issue with name changes in roundabouts that could result in crashes
|
||||
|
||||
# 5.2.2
|
||||
Changes from 5.2.1
|
||||
- Bugfixes:
|
||||
- Buffer overrun in tile plugin response handling
|
||||
|
||||
# 5.2.1
|
||||
Changes from 5.2.0
|
||||
- Bugfixes:
|
||||
- Removed debug statement that was spamming the console
|
||||
|
||||
# 5.2.0
|
||||
Changes from 5.2.0 RC2
|
||||
- Bugfixes:
|
||||
- Fixed crash when loading shared memory caused by invalid OSM IDs segment size.
|
||||
- Various small instructions handling fixes
|
||||
|
||||
Changes from 5.1.0
|
||||
- API:
|
||||
- new parameter `annotations` for `route`, `trip` and `match` requests. Returns additional data about each
|
||||
coordinate along the selected/matched route line per `RouteLeg`:
|
||||
- duration of each segment
|
||||
- distance of each segment
|
||||
- OSM node ids of all segment endpoints
|
||||
- Introducing Intersections for Route Steps. This changes the API format in multiple ways.
|
||||
- `bearing_before`/`bearing_after` of `StepManeuver` are now deprecated and will be removed in the next major release
|
||||
- `location` of `StepManeuvers` is now deprecated and will be removed in the next major release
|
||||
- every `RouteStep` now has property `intersections` containing a list of `Intersection` objects.
|
||||
- Support for destination signs. New member `destinations` in `RouteStep`, based on `destination` and `destination:ref`
|
||||
- Support for name pronunciations. New member `pronunciation` in `RouteStep`, based on `name:pronunciation`
|
||||
|
||||
- Profile changes:
|
||||
- duration parser now accepts P[n]DT[n]H[n]M[n]S, P[n]W, PTHHMMSS and PTHH:MM:SS ISO8601 formats.
|
||||
- `result.destinations` allows you to set a way's destinations
|
||||
- `result.pronunciation` allows you to set way name pronunciations
|
||||
- `highway=motorway_link` no longer implies `oneway` as per the OSM Wiki
|
||||
|
||||
- Infrastructure:
|
||||
- BREAKING: Changed the on-disk encoding of the StaticRTree to reduce ramIndex file size. This breaks the **data format**
|
||||
- BREAKING: Intersection Classification adds a new file to the mix (osrm.icd). This breaks the fileformat for older versions.
|
||||
- Better support for osrm-routed binary upgrade on the fly [UNIX specific]:
|
||||
- Open sockets with SO_REUSEPORT to allow multiple osrm-routed processes serving requests from the same port.
|
||||
- Add SIGNAL_PARENT_WHEN_READY environment variable to enable osrm-routed signal its parent with USR1 when it's running and waiting for requests.
|
||||
- Disable http access logging via DISABLE_ACCESS_LOGGING environment variable.
|
||||
|
||||
- Guidance:
|
||||
- BREAKING: modifies the file format with new internal identifiers
|
||||
- improved detection of turning streets, not reporting new-name in wrong situations
|
||||
- improved handling of sliproads (emit turns instead of 'take the ramp')
|
||||
- improved collapsing of instructions. Some 'new name' instructions will be suppressed if they are without alternative and the segment is short
|
||||
|
||||
- Bugfixes
|
||||
- fixed broken summaries for very short routes
|
||||
|
||||
# 5.2.0 RC2
|
||||
Changes from 5.2.0 RC1
|
||||
|
||||
- Guidance:
|
||||
- improved handling of sliproads (emit turns instead of 'take the ramp')
|
||||
- improved collapsing of instructions. Some 'new name' instructions will be suppressed if they are without alternative and the segment is short
|
||||
- BREAKING: modifies the file format with new internal identifiers
|
||||
|
||||
- API:
|
||||
- paramater `annotate` was renamed to `annotations`.
|
||||
- `annotation` as accidentally placed in `Route` instead of `RouteLeg`
|
||||
- Support for destination signs. New member `destinations` in `RouteStep`, based on `destination` and `destination:ref`
|
||||
- Support for name pronunciations. New member `pronunciation` in `RouteStep`, based on `name:pronunciation`
|
||||
- Add `nodes` property to `annotation` in `RouteLeg` containing the ids of nodes covered by the route
|
||||
|
||||
- Profile changes:
|
||||
- `result.destinations` allows you to set a way's destinations
|
||||
- `result.pronunciation` allows you to set way name pronunciations
|
||||
- `highway=motorway_link` no longer implies `oneway` as per the OSM Wiki
|
||||
|
||||
- Infrastructure
|
||||
- BREAKING: Changed the on-disk encoding of the StaticRTree to reduce ramIndex file size. This breaks the **data format**
|
||||
|
||||
- Bugfixes
|
||||
- fixed broken summaries for very short routes
|
||||
|
||||
# 5.2.0 RC1
|
||||
Changes from 5.1.0
|
||||
|
||||
- API:
|
||||
- new parameter `annotate` for `route` and `match` requests. Returns additional data about each
|
||||
coordinate along the selected/matched route line.
|
||||
- Introducing Intersections for Route Steps. This changes the API format in multiple ways.
|
||||
- `bearing_before`/`bearing_after` of `StepManeuver` are now deprecated and will be removed in the next major release
|
||||
- `location` of `StepManeuvers` is now deprecated and will be removed in the next major release
|
||||
- every `RouteStep` now has property `intersections` containing a list of `Intersection` objects.
|
||||
|
||||
- Profile changes:
|
||||
- duration parser now accepts P[n]DT[n]H[n]M[n]S, P[n]W, PTHHMMSS and PTHH:MM:SS ISO8601 formats.
|
||||
|
||||
- Infrastructure:
|
||||
- Better support for osrm-routed binary upgrade on the fly [UNIX specific]:
|
||||
- Open sockets with SO_REUSEPORT to allow multiple osrm-routed processes serving requests from the same port.
|
||||
- Add SIGNAL_PARENT_WHEN_READY environment variable to enable osrm-routed signal its parent with USR1 when it's running and waiting for requests.
|
||||
- BREAKING: Intersection Classification adds a new file to the mix (osrm.icd). This breaks the fileformat for older versions.
|
||||
- Disable http access logging via DISABLE_ACCESS_LOGGING environment
|
||||
variable.
|
||||
|
||||
- Guidance:
|
||||
- improved detection of turning streets, not reporting new-name in wrong situations
|
||||
|
||||
# 5.1.0
|
||||
Changes with regard to 5.0.0
|
||||
|
||||
- API:
|
||||
- added StepManeuver type `roundabout turn`. The type indicates a small roundabout that is treated as an intersection
|
||||
(turn right at the roundabout for first exit, go straight at the roundabout...)
|
||||
- added StepManeuver type `on ramp` and `off ramp` to distinguish between ramps that enter and exit a highway.
|
||||
- reduced new name instructions for trivial changes
|
||||
- combined multiple turns into a single instruction at segregated roads`
|
||||
|
||||
- Profile Changes:
|
||||
- introduced a suffix_list / get_name_suffix_list to specify name suffices to be suppressed in name change announcements
|
||||
- street names are now consistently assembled for the car, bike and walk profile as: "Name (Ref)" as in "Berlin (A5)"
|
||||
- new `car.lua` dependency `lib/destination.lua`
|
||||
- register a way's .nodes() function for use in the profile's way_function.
|
||||
|
||||
- Infrastructure
|
||||
- BREAKING: reordered internal instruction types. This breaks the **data format**
|
||||
- BREAKING: Changed the on-disk encoding of the StaticRTree for better performance. This breaks the **data format**
|
||||
|
||||
- Fixes:
|
||||
- Issue #2310: post-processing for local paths, fixes #2310
|
||||
- Issue #2309: local path looping, fixes #2309
|
||||
- Issue #2356: Make hint values optional
|
||||
- Issue #2349: Segmentation fault in some requests
|
||||
- Issue #2335: map matching was using shortest path with uturns disabled
|
||||
- Issue #2193: Fix syntax error position indicators in parameters queries
|
||||
- Fix search with u-turn
|
||||
- PhantomNode packing in MSVC now the same on other platforms
|
||||
- Summary is now not malformed when including unnamed roads
|
||||
- Emit new-name on when changing fron unanmed road to named road
|
||||
|
||||
# 5.0.0
|
||||
Changes with regard 5.0.0 RC2:
|
||||
- API:
|
||||
- if `geometry=geojson` is passed the resulting geometry can be a LineString or Point
|
||||
depending on how many coordinates are present.
|
||||
- the removal of the summary field was revered. for `steps=flase` the field will always be an empty string.
|
||||
|
||||
Changes with regard to 4.9.1:
|
||||
- API:
|
||||
- BREAKING: Complete rewrite of the HTTP and library API. See detailed documentation in the wiki.
|
||||
- BREAKING: The default coordinate order is now `longitude, latidue`. Exception: Polyline geometry
|
||||
which follow the original Google specification of `latitdue, longitude`.
|
||||
- BREAKING: Polyline geometries now use precision 5, instead of previously 6
|
||||
- BREAKING: Removed GPX support
|
||||
- New service `tile` which serves debug vector tiles of the road network
|
||||
- Completely new engine for guidance generation:
|
||||
- Support for highway ramps
|
||||
- Support for different intersection types (end of street, forks, merges)
|
||||
- Instruction post-processing to merge unimportant instructions
|
||||
- Improved handling of roundabouts
|
||||
|
||||
- Tools:
|
||||
- BREAKING: Renamed osrm-prepare to osrm-contract
|
||||
- BREAKING: Removes profiles from osrm-contract, only needed in osrm-extract.
|
||||
- Abort processing in osrm-extract if there are no snappable edges remaining.
|
||||
- Added .properties file to osrm-extract ouput.
|
||||
- Enables the use of multiple segment-speed-files on the osrm-contract command line
|
||||
|
||||
- Profile changes:
|
||||
- Remove movable bridge mode
|
||||
- Add `maxspeed=none` tag to car profile.
|
||||
- A `side_road` tag support for the OSRM car profile.
|
||||
|
||||
- Fixes:
|
||||
- Issue #2150: Prevents routing over delivery ways and nodes
|
||||
- Issue #1972: Provide uninstall target
|
||||
- Issue #2072: Disable alternatives by default and if core factor < 1.0
|
||||
- Issue #1999: Fix unpacking for self-loop nodes not in core.
|
||||
|
||||
- Infrastructure:
|
||||
- Cucumber test suit is now based on cucumber-js, removes Ruby as dependency
|
||||
- Updated to mapbox/variant v1.1
|
||||
- Updated to libosmium v2.6.1
|
||||
- Remove GeoJSON based debugging output, replaced by debug tiles
|
||||
|
||||
|
||||
# 5.0.0 RC2
|
||||
- Profiles:
|
||||
- `properties.allow_uturns_at_via` -> `properties.continue_straight_at_waypoint` (value is inverted!)
|
||||
- API:
|
||||
- Removed summary from legs property
|
||||
- Disable steps and alternatives by default
|
||||
- Fix `code` field: 'ok' -> 'Ok'
|
||||
- Allow 4.json and 4.3.json format
|
||||
- Conform to v5 spec and support "unlimited" as radiuses value.
|
||||
- `uturns` parameter was replaced by `continue_straight` (value is inverted!)
|
||||
- Features:
|
||||
- Report progress for gennerating edge expanded edges in the edge based graph factory
|
||||
- Add maxspeed=none tag to car profile.
|
||||
- Optimize StaticRTree code: speedup 2x (to RC1)
|
||||
- Optimize DouglasPeucker code: speedup 10x (to RC1)
|
||||
- Optimize WebMercator projection: speedup 2x (to RC1)
|
||||
- Bugs:
|
||||
- #2195: Resolves issues with multiple includedirs in pkg-config file
|
||||
- #2219: Internal server error when using the match plugin
|
||||
- #2027: basename -> filename
|
||||
- #2168: Report correct position where parsing failed
|
||||
- #2036: Add license to storage and storage config exposed in public API
|
||||
- Fix uturn detection in match plugin
|
||||
- Add missing -lz to fix linking of server-tests
|
||||
|
||||
# 5.0.0 RC1
|
||||
- Renamed osrm-prepare into osrm-contract
|
||||
- osrm-contract does not need a profile parameter anymore
|
||||
- New public HTTP API, find documentation [here](https://github.com/Project-OSRM/osrm-backend/wiki/New-Server-api)
|
||||
- POST support is discontinued, please use library bindings for more complex requests
|
||||
- Removed timestamp plugin
|
||||
- Coordinate order is now Longitude,Latitude
|
||||
- Cucumber tests now based on Javascript (run with `npm test`)
|
||||
- Profile API changed:
|
||||
- `forward_mode` and `backward_mode` now need to be selected from a pre-defined list
|
||||
- Global profile properties are now stored in a global `properties` element. This includes:
|
||||
- `properties.traffic_signal_penalty`
|
||||
- `properties.use_turn_restrictions`
|
||||
- `properties.u_turn_penalty`
|
||||
- `properties.allow_u_turn_at_via`
|
||||
|
||||
+262
-680
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
# Code of conduct
|
||||
|
||||
Everyone is invited to participate in Project OSRM’s open source projects and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The [Contributor Covenant](http://contributor-covenant.org) applies to all projects under the Project-OSRM organization and we ask that you please read [the full text](http://contributor-covenant.org/version/1/2/0/).
|
||||
@@ -1,81 +0,0 @@
|
||||
# Everyone
|
||||
|
||||
Please take some time to review our [code of conduct](CODE-OF-CONDUCT.md) to help guide your interactions with others on this project.
|
||||
|
||||
# User
|
||||
|
||||
Before you open a new issue, please search for older ones that cover the same issue.
|
||||
In general "me too" comments/issues are frowned upon.
|
||||
You can add a :+1: emoji reaction to the issue if you want to express interest in this.
|
||||
|
||||
# Developer
|
||||
|
||||
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
||||
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
|
||||
To save development time a local hook `.git/hooks/pre-push`
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
remote="$1"
|
||||
if [ x"$remote" = xorigin ] ; then
|
||||
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
|
||||
echo "Rejected push to $remote/master" ; exit 1
|
||||
fi
|
||||
|
||||
./scripts/format.sh && ./scripts/error_on_dirty.sh
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "Unstaged format changes" ; exit 1
|
||||
fi
|
||||
fi
|
||||
```
|
||||
could check code format, modify a local repository and reject push due to unstaged formatting changes.
|
||||
Also `pre-push` hook rejects direct pushes to `origin/master`.
|
||||
|
||||
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
|
||||
|
||||
|
||||
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
||||
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
||||
|
||||
## Pull Request
|
||||
|
||||
Every pull-request that changes the API needs to update the docs in `docs/http.md` and add an entry to `CHANGELOG.md`.
|
||||
Breaking changes need to have a BREAKING prefix. See the [releasing documentation](docs/releasing.md) on how this affects the version.
|
||||
|
||||
Early feedback is also important.
|
||||
You will see that a lot of the PR have tags like `[not ready]` or `[wip]`.
|
||||
We like to open PRs as soon as we are starting to work on something to make it visible to the rest of the team.
|
||||
If your work is going in entirely the wrong direction, there is a good chance someone will pick up on this before it is too late.
|
||||
Everyone is encouraged to read PRs of other people and give feedback.
|
||||
|
||||
For every significant code change we require a pull request review before it is merged.
|
||||
If your pull request modifies the API this need to be signed of by a team discussion.
|
||||
This means you will need to find another member of the team with commit access and request a review of your pull request.
|
||||
|
||||
Once your pull request is reviewed you can merge it! If you don't have commit access, ping someone that has commit access.
|
||||
If you do have commit access there are in general two accepted styles to merging:
|
||||
|
||||
1. Make sure the branch is up to date with `master`. Run `git rebase master` to find out.
|
||||
2. Once that is ensured you can either:
|
||||
- Click the nice green merge button (for a non-fast-forward merge)
|
||||
- Merge by hand using a fast-forward merge
|
||||
|
||||
Which merge you prefer is up to personal preference. In general it is recommended to use fast-forward merges because it creates a history that is sequential and easier to understand.
|
||||
|
||||
# Maintainer
|
||||
|
||||
## Doing a release
|
||||
|
||||
There is an in-depth guide around how to push out a release once it is ready [here](docs/releasing.md).
|
||||
|
||||
## The API
|
||||
|
||||
Changes to the API need to be discussed and signed off by the team. Breaking changes even more so than additive changes.
|
||||
|
||||
## Milestones
|
||||
|
||||
If a pull request or an issue is applicable for the current or next milestone, depends on the target version number.
|
||||
Since we use semantic versioning we restrict breaking changes to major releases.
|
||||
After a Release Candidate is released we usually don't change the API anymore if it is not critical.
|
||||
Bigger code changes after a RC was released should also be avoided.
|
||||
|
||||
@@ -18,7 +18,6 @@ RECURSIVE = YES
|
||||
|
||||
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/third_party \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/build \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/node_modules \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/unit_tests \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/features
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
source "http://rubygems.org"
|
||||
|
||||
gem "cucumber"
|
||||
gem "rake"
|
||||
gem "osmlib-base"
|
||||
gem "sys-proctable"
|
||||
gem "rspec-expectations"
|
||||
@@ -0,0 +1,35 @@
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
builder (3.2.2)
|
||||
cucumber (2.0.0)
|
||||
builder (>= 2.1.2)
|
||||
cucumber-core (~> 1.1.3)
|
||||
diff-lcs (>= 1.1.3)
|
||||
gherkin (~> 2.12)
|
||||
multi_json (>= 1.7.5, < 2.0)
|
||||
multi_test (>= 0.1.2)
|
||||
cucumber-core (1.1.3)
|
||||
gherkin (~> 2.12.0)
|
||||
diff-lcs (1.2.5)
|
||||
gherkin (2.12.2)
|
||||
multi_json (~> 1.3)
|
||||
multi_json (1.11.0)
|
||||
multi_test (0.1.2)
|
||||
osmlib-base (0.1.4)
|
||||
rake (10.4.2)
|
||||
rspec-expectations (3.2.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.2.0)
|
||||
rspec-support (3.2.2)
|
||||
sys-proctable (0.9.8)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cucumber
|
||||
osmlib-base
|
||||
rake
|
||||
rspec-expectations
|
||||
sys-proctable
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2017, Project OSRM contributors
|
||||
Copyright (c) 2016, Project OSRM contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
@@ -1,160 +1,25 @@
|
||||
## Open Source Routing Machine
|
||||
## About
|
||||
|
||||
| Linux / macOS | Windows | Code Coverage |
|
||||
| ------------- | ------- | ------------- |
|
||||
| [](https://travis-ci.org/Project-OSRM/osrm-backend) | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
|
||||
|
||||
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
|
||||
## Current build status
|
||||
|
||||
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
|
||||
- Nearest - Snaps coordinates to the street network and returns the nearest matches
|
||||
- Route - Finds the fastest route between coordinates
|
||||
- Table - Computes the duration or distances of the fastest route between all pairs of supplied coordinates
|
||||
- Match - Snaps noisy GPS traces to the road network in the most plausible way
|
||||
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
|
||||
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
|
||||
| build config | branch | status |
|
||||
|:-------------|:--------|:------------|
|
||||
| Linux | master | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
||||
| Linux | develop | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
||||
| Windows | master/develop | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||
| LUAbind fork | master | [](https://travis-ci.org/DennisOSRM/luabind) |
|
||||
|
||||
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
|
||||
## Building
|
||||
|
||||
For a quick introduction about how the road network is represented in OpenStreetMap and how to map specific road network features have a look at [this guide about mapping for navigation](https://www.mapbox.com/mapping/mapping-for-navigation/).
|
||||
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).
|
||||
|
||||
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
||||
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
|
||||
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
|
||||
- [osrm-backend-docker](https://hub.docker.com/r/osrm/osrm-backend/) - Ready to use Docker images
|
||||
To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
|
||||
|
||||
## Documentation
|
||||
|
||||
### Full documentation
|
||||
|
||||
- [Hosted documentation](http://project-osrm.org)
|
||||
- [osrm-routed HTTP API documentation](docs/http.md)
|
||||
- [libosrm API documentation](docs/libosrm.md)
|
||||
|
||||
## Contact
|
||||
|
||||
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
|
||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||
|
||||
## Quick Start
|
||||
|
||||
The easiest and quickest way to setup your own routing engine is to use Docker images we provide.
|
||||
|
||||
There are two pre-processing pipelines available:
|
||||
- Contraction Hierarchies (CH)
|
||||
- Multi-Level Dijkstra (MLD)
|
||||
|
||||
we recommend using MLD by default except for special use-cases such as very large distance matrices where CH is still a better fit for the time being.
|
||||
In the following we explain the MLD pipeline.
|
||||
If you want to use the CH pipeline instead replace `osrm-partition` and `osrm-customize` with a single `osrm-contract` and change the algorithm option for `osrm-routed` to `--algorithm ch`.
|
||||
|
||||
### Using Docker
|
||||
|
||||
We base our Docker images ([backend](https://hub.docker.com/r/osrm/osrm-backend/), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Debian and make sure they are as lightweight as possible.
|
||||
|
||||
Download OpenStreetMap extracts for example from [Geofabrik](http://download.geofabrik.de/)
|
||||
|
||||
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
||||
|
||||
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
||||
|
||||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||
|
||||
The flag `-v "${PWD}:/data"` creates the directory `/data` inside the docker container and makes the current working directory `"${PWD}"` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `"${PWD}/berlin-latest.osm.pbf"` on the host.
|
||||
|
||||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
||||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
||||
|
||||
Note that `berlin-latest.osrm` has a different file extension.
|
||||
|
||||
docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
|
||||
|
||||
Make requests against the HTTP server
|
||||
|
||||
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
|
||||
|
||||
Optionally start a user-friendly frontend on port 9966, and open it up in your browser
|
||||
|
||||
docker run -p 9966:9966 osrm/osrm-frontend
|
||||
xdg-open 'http://127.0.0.1:9966'
|
||||
|
||||
In case Docker complains about not being able to connect to the Docker daemon make sure you are in the `docker` group.
|
||||
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
After adding yourself to the `docker` group make sure to log out and back in again with your terminal.
|
||||
|
||||
We support the following images on Docker Cloud:
|
||||
|
||||
Name | Description
|
||||
-----|------
|
||||
`latest` | `master` compiled with release flag
|
||||
`latest-assertions` | `master` compiled with with release flag, assertions enabled and debug symbols
|
||||
`latest-debug` | `master` compiled with debug flag
|
||||
`<tag>` | specific tag compiled with release flag
|
||||
`<tag>-debug` | specific tag compiled with debug flag
|
||||
|
||||
### Building from Source
|
||||
|
||||
The following targets Ubuntu 16.04.
|
||||
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||
|
||||
Install dependencies
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential git cmake pkg-config \
|
||||
libbz2-dev libxml2-dev libzip-dev libboost-all-dev \
|
||||
lua5.2 liblua5.2-dev libtbb-dev
|
||||
```
|
||||
|
||||
Compile and install OSRM binaries
|
||||
|
||||
```bash
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
sudo cmake --build . --target install
|
||||
```
|
||||
|
||||
### Request Against the Demo Server
|
||||
|
||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Demo-server).
|
||||
|
||||
Simple query with instructions and alternatives on Berlin:
|
||||
|
||||
```
|
||||
curl "https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true"
|
||||
```
|
||||
|
||||
### Using the Node.js Bindings
|
||||
|
||||
The Node.js bindings provide read-only access to the routing engine.
|
||||
We provide API documentation and examples [here](docs/nodejs/api.md).
|
||||
|
||||
You will need a modern `libstdc++` toolchain (`>= GLIBCXX_3.4.20`) for binary compatibility if you want to use the pre-built binaries.
|
||||
For older Ubuntu systems you can upgrade your standard library for example with:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y libstdc++-5-dev
|
||||
```
|
||||
|
||||
You can install the Node.js bindings via `npm install osrm` or from this repository either via
|
||||
|
||||
npm install
|
||||
|
||||
which will check and use pre-built binaries if they're available for this release and your Node version, or via
|
||||
|
||||
npm install --build-from-source
|
||||
|
||||
to always force building the Node.js bindings from source.
|
||||
|
||||
For usage details have a look [these API docs](docs/nodejs/api.md).
|
||||
|
||||
An exemplary implementation by a 3rd party with Docker and Node.js can be found [here](https://github.com/door2door-io/osrm-express-server-demo).
|
||||
|
||||
See the Wiki's [server API documentation](https://github.com/Project-OSRM/osrm-backend/wiki/Server-api) as well as the [library API documentation](https://github.com/Project-OSRM/osrm-backend/wiki/Library-api)
|
||||
|
||||
## References in publications
|
||||
|
||||
@@ -178,3 +43,4 @@ When using the code in a (scientific) publication, please cite
|
||||
address = {New York, NY, USA},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
require 'OSM/StreamParser'
|
||||
require 'socket'
|
||||
require 'digest/sha1'
|
||||
require 'cucumber/rake/task'
|
||||
require 'sys/proctable'
|
||||
|
||||
BUILD_FOLDER = 'build'
|
||||
DATA_FOLDER = 'sandbox'
|
||||
PROFILE = 'bicycle'
|
||||
OSRM_PORT = 5000
|
||||
PROFILES_FOLDER = '../profiles'
|
||||
|
||||
Cucumber::Rake::Task.new do |t|
|
||||
t.cucumber_opts = %w{--format pretty}
|
||||
end
|
||||
|
||||
areas = {
|
||||
:kbh => { :country => 'denmark', :bbox => 'top=55.6972 left=12.5222 right=12.624 bottom=55.6376' },
|
||||
:frd => { :country => 'denmark', :bbox => 'top=55.7007 left=12.4765 bottom=55.6576 right=12.5698' },
|
||||
:regh => { :country => 'denmark', :bbox => 'top=56.164 left=11.792 bottom=55.403 right=12.731' },
|
||||
:denmark => { :country => 'denmark', :bbox => nil },
|
||||
:skaane => { :country => 'sweden', :bbox => 'top=56.55 left=12.4 bottom=55.3 right=14.6' }
|
||||
}
|
||||
|
||||
|
||||
|
||||
osm_data_area_name = ARGV[1] ? ARGV[1].to_s.to_sym : :kbh
|
||||
raise "Unknown data area." unless areas[osm_data_area_name]
|
||||
osm_data_country = areas[osm_data_area_name][:country]
|
||||
osm_data_area_bbox = areas[osm_data_area_name][:bbox]
|
||||
|
||||
|
||||
task osm_data_area_name.to_sym {} #define empty task to prevent rake from whining. will break if area has same name as a task
|
||||
|
||||
|
||||
def each_process name, &block
|
||||
Sys::ProcTable.ps do |process|
|
||||
if process.comm.strip == name.strip && process.state != 'zombie'
|
||||
yield process.pid.to_i, process.state.strip
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def up?
|
||||
find_pid('osrm-routed') != nil
|
||||
end
|
||||
|
||||
def find_pid name
|
||||
each_process(name) { |pid,state| return pid.to_i }
|
||||
return nil
|
||||
end
|
||||
|
||||
def wait_for_shutdown name
|
||||
timeout = 10
|
||||
(timeout*10).times do
|
||||
return if find_pid(name) == nil
|
||||
sleep 0.1
|
||||
end
|
||||
raise "*** Could not terminate #{name}."
|
||||
end
|
||||
|
||||
|
||||
desc "Rebuild and run tests."
|
||||
task :default => [:build]
|
||||
|
||||
desc "Build using CMake."
|
||||
task :build do
|
||||
if Dir.exists? BUILD_FOLDER
|
||||
Dir.chdir BUILD_FOLDER do
|
||||
system "make"
|
||||
end
|
||||
else
|
||||
system "mkdir build; cd build; cmake ..; make"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Setup config files."
|
||||
task :setup do
|
||||
end
|
||||
|
||||
desc "Download OSM data."
|
||||
task :download do
|
||||
Dir.mkdir "#{DATA_FOLDER}" unless File.exist? "#{DATA_FOLDER}"
|
||||
puts "Downloading..."
|
||||
puts "curl http://download.geofabrik.de/europe/#{osm_data_country}-latest.osm.pbf -o #{DATA_FOLDER}/#{osm_data_country}.osm.pbf"
|
||||
raise "Error while downloading data." unless system "curl http://download.geofabrik.de/europe/#{osm_data_country}-latest.osm.pbf -o #{DATA_FOLDER}/#{osm_data_country}.osm.pbf"
|
||||
if osm_data_area_bbox
|
||||
puts "Cropping and converting to protobuffer..."
|
||||
raise "Error while cropping data." unless system "osmosis --read-pbf file=#{DATA_FOLDER}/#{osm_data_country}.osm.pbf --bounding-box #{osm_data_area_bbox} --write-pbf file=#{DATA_FOLDER}/#{osm_data_area_name}.osm.pbf omitmetadata=true"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Crop OSM data"
|
||||
task :crop do
|
||||
if osm_data_area_bbox
|
||||
raise "Error while cropping data." unless system "osmosis --read-pbf file=#{DATA_FOLDER}/#{osm_data_country}.osm.pbf --bounding-box #{osm_data_area_bbox} --write-pbf file=#{DATA_FOLDER}/#{osm_data_area_name}.osm.pbf omitmetadata=true"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Reprocess OSM data."
|
||||
task :process => [:extract,:contract] do
|
||||
end
|
||||
|
||||
desc "Extract OSM data."
|
||||
task :extract do
|
||||
Dir.chdir DATA_FOLDER do
|
||||
raise "Error while extracting data." unless system "../#{BUILD_FOLDER}/osrm-extract #{osm_data_area_name}.osm.pbf --profile ../profiles/#{PROFILE}.lua"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Contract OSM data."
|
||||
task :contract do
|
||||
Dir.chdir DATA_FOLDER do
|
||||
raise "Error while contracting data." unless system "../#{BUILD_FOLDER}/osrm-contract #{osm_data_area_name}.osrm"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Delete preprocessing files."
|
||||
task :clean do
|
||||
File.delete *Dir.glob("#{DATA_FOLDER}/*.osrm")
|
||||
File.delete *Dir.glob("#{DATA_FOLDER}/*.osrm.*")
|
||||
end
|
||||
|
||||
desc "Run all cucumber test"
|
||||
task :test do
|
||||
system "cucumber"
|
||||
puts
|
||||
end
|
||||
|
||||
desc "Run the routing server in the terminal. Press Ctrl-C to stop."
|
||||
task :run do
|
||||
Dir.chdir DATA_FOLDER do
|
||||
system "../#{BUILD_FOLDER}/osrm-routed #{osm_data_area_name}.osrm --port #{OSRM_PORT}"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Launch the routing server in the background. Use rake:down to stop it."
|
||||
task :up do
|
||||
Dir.chdir DATA_FOLDER do
|
||||
abort("Already up.") if up?
|
||||
pipe = IO.popen("../#{BUILD_FOLDER}/osrm-routed #{osm_data_area_name}.osrm --port #{OSRM_PORT} 1>>osrm-routed.log 2>>osrm-routed.log")
|
||||
timeout = 5
|
||||
(timeout*10).times do
|
||||
begin
|
||||
socket = TCPSocket.new('localhost', OSRM_PORT)
|
||||
socket.puts 'ping'
|
||||
rescue Errno::ECONNREFUSED
|
||||
sleep 0.1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "Stop the routing server."
|
||||
task :down do
|
||||
pid = find_pid 'osrm-routed'
|
||||
if pid
|
||||
Process.kill 'TERM', pid
|
||||
else
|
||||
puts "Already down."
|
||||
end
|
||||
end
|
||||
|
||||
desc "Kill all osrm-extract, osrm-contract and osrm-routed processes."
|
||||
task :kill do
|
||||
each_process('osrm-routed') { |pid,state| Process.kill 'KILL', pid }
|
||||
each_process('osrm-contract') { |pid,state| Process.kill 'KILL', pid }
|
||||
each_process('osrm-extract') { |pid,state| Process.kill 'KILL', pid }
|
||||
wait_for_shutdown 'osrm-routed'
|
||||
wait_for_shutdown 'osrm-contract'
|
||||
wait_for_shutdown 'osrm-extract'
|
||||
end
|
||||
|
||||
desc "Get PIDs of all osrm-extract, osrm-contract and osrm-routed processes."
|
||||
task :pid do
|
||||
each_process 'osrm-routed' do |pid,state|
|
||||
puts "#{pid}\t#{state}"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Stop, reprocess and restart."
|
||||
task :update => [:down,:process,:up] do
|
||||
end
|
||||
|
||||
|
||||
desc "Remove test cache files."
|
||||
task :sweep do
|
||||
system "rm test/cache/*"
|
||||
end
|
||||
|
||||
+42
-111
@@ -7,43 +7,17 @@ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
SET PROJECT_DIR=%CD%
|
||||
ECHO PROJECT_DIR^: %PROJECT_DIR%
|
||||
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
||||
|
||||
|
||||
:: Check CMake version
|
||||
SET CMAKE_VERSION=3.16.3
|
||||
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
|
||||
ECHO cmake^: && cmake --version
|
||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
||||
|
||||
cmake --version | findstr /C:%CMAKE_VERSION% && GOTO CMAKE_OK
|
||||
|
||||
:CMAKE_NOT_OK
|
||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||
powershell Invoke-WebRequest https://cmake.org/files/v3.16/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
:CMAKE_OK
|
||||
ECHO CMAKE_OK
|
||||
cmake --version
|
||||
|
||||
ECHO activating VS command prompt ...
|
||||
SET PATH=C:\Program Files (x86)\MSBuild\15.0\Bin;%PATH%
|
||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
|
||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
|
||||
ECHO platform^: %platform%
|
||||
|
||||
ECHO cl.exe version
|
||||
cl
|
||||
ECHO msbuild version
|
||||
msbuild /version
|
||||
|
||||
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
||||
SET DEPSPKG=osrm-deps-win-x64-14.2-2019.01.7z
|
||||
SET DEPSPKG=osrm-deps-win-x64-14.0.7z
|
||||
|
||||
:: local development
|
||||
ECHO.
|
||||
ECHO LOCAL_DEV^: %LOCAL_DEV%
|
||||
IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0
|
||||
IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL
|
||||
@@ -52,57 +26,37 @@ IF EXIST %DEPSPKG% DEL %DEPSPKG%
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO downloading %DEPSPKG%
|
||||
powershell Invoke-WebRequest http://project-osrm.wolt.com/windows-build-deps/$env:DEPSPKG -OutFile $env:PROJECT_DIR\$env:DEPSPKG
|
||||
powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/$env:DEPSPKG -OutFile $env:PROJECT_DIR\$env:DEPSPKG
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
:SKIPDL
|
||||
|
||||
IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
IF EXIST build ECHO deleting build dir... && RD /S /Q build
|
||||
IF EXIST build ECHO deletings build dir... && RD /S /Q build
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive"
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
::tree osrm-deps
|
||||
|
||||
MKDIR build
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
cd build
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
SET OSRMDEPSDIR=%PROJECT_DIR%/osrm-deps
|
||||
SET OSRMDEPSDIR=%PROJECT_DIR%\osrm-deps
|
||||
set PREFIX=%OSRMDEPSDIR%/libs
|
||||
set BOOST_ROOT=%OSRMDEPSDIR%
|
||||
set BOOST_LIBRARYDIR=%BOOST_ROOT%/lib
|
||||
set TBB_INSTALL_DIR=%OSRMDEPSDIR%
|
||||
REM set TBB_ARCH_PLATFORM=intel64/vc17
|
||||
|
||||
ECHO OSRMDEPSDIR ^: %OSRMDEPSDIR%
|
||||
ECHO PREFIX ^: %PREFIX%
|
||||
ECHO BOOST_ROOT ^: %BOOST_ROOT%
|
||||
ECHO BOOST_LIBRARYDIR ^: %BOOST_LIBRARYDIR%
|
||||
ECHO TBB_INSTALL_DIR ^: %TBB_INSTALL_DIR%
|
||||
REM ECHO TBB_ARCH_PLATFORM ^: %TBB_ARCH_PLATFORM%
|
||||
|
||||
set BOOST_ROOT=%OSRMDEPSDIR%/boost
|
||||
set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb
|
||||
set TBB_ARCH_PLATFORM=intel64/vc14
|
||||
|
||||
ECHO calling cmake ....
|
||||
cmake .. ^
|
||||
-G "Visual Studio 16 2019" ^
|
||||
-G "Visual Studio 14 2015 Win64" ^
|
||||
-DBOOST_ROOT=%BOOST_ROOT% ^
|
||||
-DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^
|
||||
-DBoost_ADDITIONAL_VERSIONS=1.73.0 ^
|
||||
-DBoost_ADDITIONAL_VERSIONS=1.58 ^
|
||||
-DBoost_USE_MULTITHREADED=ON ^
|
||||
-DBoost_USE_STATIC_LIBS=ON ^
|
||||
-DEXPAT_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DEXPAT_LIBRARY=%OSRMDEPSDIR%/lib/libexpat.lib ^
|
||||
-DBZIP2_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DBZIP2_LIBRARIES=%OSRMDEPSDIR%/lib/libbz2.lib ^
|
||||
-DLUA_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DLUA_LIBRARIES=%OSRMDEPSDIR%/lib/lua5.3.5.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||
-DZLIB_LIBRARY=%OSRMDEPSDIR%/lib/libz.lib ^
|
||||
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
|
||||
-DCMAKE_INSTALL_PREFIX=%PREFIX%
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
@@ -114,74 +68,51 @@ msbuild OSRM.sln ^
|
||||
/t:rebuild ^
|
||||
/p:BuildInParallel=true ^
|
||||
/m:%NUMBER_OF_PROCESSORS% ^
|
||||
/toolsversion:Current ^
|
||||
/p:PlatformToolset=v142 ^
|
||||
/toolsversion:14.0 ^
|
||||
/p:PlatformToolset=v140 ^
|
||||
/clp:Verbosity=normal ^
|
||||
/nologo ^
|
||||
/flp1:logfile=build_errors.txt;errorsonly ^
|
||||
/flp2:logfile=build_warnings.txt;warningsonly
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
CD %PROJECT_DIR%\build
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
SET PATH=%PROJECT_DIR%\osrm-deps\lib;%PATH%
|
||||
|
||||
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
|
||||
SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
||||
|
||||
ECHO running engine-tests.exe ...
|
||||
unit_tests\%Configuration%\engine-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
|
||||
%Configuration%\engine-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
ECHO running extractor-tests.exe ...
|
||||
%Configuration%\extractor-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
ECHO running util-tests.exe ...
|
||||
unit_tests\%Configuration%\util-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
%Configuration%\util-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO running server-tests.exe ...
|
||||
unit_tests\%Configuration%\server-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
|
||||
ECHO ========= CREATING PACKAGES ==========
|
||||
|
||||
ECHO running partitioner-tests.exe ...
|
||||
unit_tests\%Configuration%\partitioner-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
CD %PROJECT_DIR%\build\%Configuration%
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO running customizer-tests.exe ...
|
||||
unit_tests\%Configuration%\customizer-tests.exe
|
||||
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||
SET P=%PROJECT_DIR%
|
||||
SET ZIP= %P%\osrm_%Configuration%.zip
|
||||
IF EXIST %ZIP% ECHO deleting %ZIP% && DEL /F /Q %ZIP%
|
||||
IF %ERRORLEVEL% NEQ 0 ECHO deleting %ZIP% FAILED && 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
|
||||
7z a %ZIP% *.lib *.exe *.pdb %P%/osrm-deps/libs/bin/*.dll -tzip -mx9 | %windir%\system32\FIND "ing archive"
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
CD ..\..\profiles
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO disk=c:\temp\stxxl,10000,wincall > .stxxl.txt
|
||||
7z a %ZIP% * -tzip -mx9 | %windir%\system32\FIND "ing archive"
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
GOTO DONE
|
||||
|
||||
:ERROR
|
||||
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
+26
-13
@@ -3,14 +3,11 @@ environment:
|
||||
- configuration: Release
|
||||
# - configuration: Debug
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 6
|
||||
|
||||
# scripts that are called at very beginning, before repo cloning
|
||||
init:
|
||||
- git config --global core.autocrlf input
|
||||
|
||||
os: Visual Studio 2019
|
||||
os: Visual Studio 2015
|
||||
|
||||
# clone directory
|
||||
clone_folder: c:\projects\osrm
|
||||
@@ -20,17 +17,33 @@ platform: x64
|
||||
build_script:
|
||||
- CALL appveyor-build.bat
|
||||
|
||||
before_test:
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm install --ignore-scripts
|
||||
- npm link --ignore-scripts
|
||||
- SET PATH=%CD%\osrm-deps\lib;%PATH%
|
||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||
# TODO tests fail with "JavaScript heap out of memory", need a better host?
|
||||
# - npm test
|
||||
test: off
|
||||
|
||||
artifacts:
|
||||
- path: osrm_Release.zip
|
||||
name: osrm_Release.zip
|
||||
# - path: osrm_Debug.zip
|
||||
# name: osrm_Debug.zip
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
deploy:
|
||||
provider: FTP
|
||||
server:
|
||||
secure: ef7oiQTTXFGt8NdNiOHm/uRFVrUttzyFbIlnaeHhQvw=
|
||||
username:
|
||||
secure: Bw+Se2GTJxA6+GtRkEc//tQSBHOuFIuJHBjFwR9cD+8=
|
||||
password:
|
||||
secure: eqwESZqxMXC/j5mOCpaXuw==
|
||||
folder: /
|
||||
enable_ssl: true
|
||||
active_mode: false
|
||||
|
||||
# notifications:
|
||||
# - provider: HipChat
|
||||
# auth_token:
|
||||
# secure: boLE7BjcahdIUxv9jkN7U3F8iOASF+MkhtctlVoWJoo=
|
||||
# room: Directions
|
||||
|
||||
@@ -11,6 +11,7 @@ SET CONFIGURATION=Release
|
||||
FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
|
||||
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%
|
||||
|
||||
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.4.0-win32-x86\bin;%PATH%
|
||||
SET PATH=C:\Program Files\7-Zip;%PATH%
|
||||
|
||||
powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
"Description": "user for publishing to s3://mapbox-node-binary/osrm",
|
||||
"Resources": {
|
||||
"User": {
|
||||
"Type": "AWS::IAM::User",
|
||||
"Properties": {
|
||||
"Policies": [
|
||||
{
|
||||
"PolicyName": "list",
|
||||
"PolicyDocument": {
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:ListBucket"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "arn:aws:s3:::mapbox-node-binary",
|
||||
"Condition": {
|
||||
"StringLike": {
|
||||
"s3:prefix": [
|
||||
"osrm/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"PolicyName": "publish",
|
||||
"PolicyDocument": {
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:DeleteObject",
|
||||
"s3:GetObject",
|
||||
"s3:GetObjectAcl",
|
||||
"s3:PutObject",
|
||||
"s3:PutObjectAcl"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "arn:aws:s3:::mapbox-node-binary/osrm/*"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"AccessKey": {
|
||||
"Type": "AWS::IAM::AccessKey",
|
||||
"Properties": {
|
||||
"UserName": {
|
||||
"Ref": "User"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Outputs": {
|
||||
"AccessKeyId": {
|
||||
"Value": {
|
||||
"Ref": "AccessKey"
|
||||
}
|
||||
},
|
||||
"SecretAccessKey": {
|
||||
"Value": {
|
||||
"Fn::GetAtt": [
|
||||
"AccessKey",
|
||||
"SecretAccessKey"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
var cf = require('@mapbox/cloudfriend');
|
||||
var package_json = require('../package.json')
|
||||
|
||||
module.exports = {
|
||||
AWSTemplateFormatVersion: '2010-09-09',
|
||||
Description: 'user for publishing to s3://mapbox-node-binary/' + package_json.name,
|
||||
Resources: {
|
||||
User: {
|
||||
Type: 'AWS::IAM::User',
|
||||
Properties: {
|
||||
Policies: [
|
||||
{
|
||||
PolicyName: 'list',
|
||||
PolicyDocument: {
|
||||
Statement: [
|
||||
{
|
||||
Action: ['s3:ListBucket'],
|
||||
Effect: 'Allow',
|
||||
Resource: 'arn:aws:s3:::mapbox-node-binary',
|
||||
Condition : {
|
||||
StringLike : {
|
||||
"s3:prefix": [ package_json.name + "/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
PolicyName: 'publish',
|
||||
PolicyDocument: {
|
||||
Statement: [
|
||||
{
|
||||
Action: ['s3:DeleteObject', 's3:GetObject', 's3:GetObjectAcl', 's3:PutObject', 's3:PutObjectAcl'],
|
||||
Effect: 'Allow',
|
||||
Resource: 'arn:aws:s3:::mapbox-node-binary/' + package_json.name + '/*'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
AccessKey: {
|
||||
Type: 'AWS::IAM::AccessKey',
|
||||
Properties: {
|
||||
UserName: cf.ref('User')
|
||||
}
|
||||
}
|
||||
},
|
||||
Outputs: {
|
||||
AccessKeyId: {
|
||||
Value: cf.ref('AccessKey')
|
||||
},
|
||||
SecretAccessKey: {
|
||||
Value: cf.getAtt('AccessKey', 'SecretAccessKey')
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,44 +0,0 @@
|
||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
|
||||
ENDIF()
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
|
||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
|
||||
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.TXT")
|
||||
|
||||
SET(CPACK_STRIP_FILES "TRUE")
|
||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
|
||||
|
||||
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
||||
if(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
execute_process(
|
||||
COMMAND ${DPKG_PROGRAM} --print-architecture
|
||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
|
||||
else(DPKG_PROGRAM)
|
||||
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||
if(RPMBUILD_PROGRAM)
|
||||
SET(CPACK_GENERATOR "RPM")
|
||||
execute_process(
|
||||
COMMAND ${RPM_PROGRAM} --eval %{_arch}
|
||||
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
||||
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
|
||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
endif(RPMBUILD_PROGRAM)
|
||||
endif(DPKG_PROGRAM)
|
||||
@@ -0,0 +1,41 @@
|
||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(FindDebArch)
|
||||
|
||||
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
|
||||
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
|
||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
|
||||
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
|
||||
|
||||
# To create a proper Debian/Ubuntu package, the following CMake
|
||||
# options should be used:
|
||||
|
||||
SET(CPACK_STRIP_FILES "TRUE")
|
||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
|
||||
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
|
||||
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
|
||||
)
|
||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
|
||||
|
||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
|
||||
|
||||
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
|
||||
@@ -1,202 +0,0 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindLua
|
||||
# -------
|
||||
#
|
||||
#
|
||||
#
|
||||
# Locate Lua library This module defines
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# LUA_FOUND - if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES - both lua and lualib
|
||||
# LUA_INCLUDE_DIR - where to find lua.h
|
||||
# LUA_VERSION_STRING - the version of Lua found
|
||||
# LUA_VERSION_MAJOR - the major version of Lua
|
||||
# LUA_VERSION_MINOR - the minor version of Lua
|
||||
# LUA_VERSION_PATCH - the patch version of Lua
|
||||
#
|
||||
#
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# #include "lua.h"
|
||||
#
|
||||
# and not
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# #include <lua/lua.h>
|
||||
#
|
||||
# This is because, the lua location is not standardized and may exist in
|
||||
# locations other than lua/
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
unset(_lua_include_subdirs)
|
||||
unset(_lua_library_names)
|
||||
unset(_lua_append_versions)
|
||||
|
||||
# this is a function only to have all the variables inside go away automatically
|
||||
function(_lua_set_version_vars)
|
||||
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
|
||||
|
||||
if (Lua_FIND_VERSION_EXACT)
|
||||
if (Lua_FIND_VERSION_COUNT GREATER 1)
|
||||
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
|
||||
endif ()
|
||||
elseif (Lua_FIND_VERSION)
|
||||
# once there is a different major version supported this should become a loop
|
||||
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
|
||||
if (Lua_FIND_VERSION_COUNT EQUAL 1)
|
||||
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||
else ()
|
||||
foreach (subver IN LISTS LUA_VERSIONS5)
|
||||
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
|
||||
list(APPEND _lua_append_versions ${subver})
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
# once there is a different major version supported this should become a loop
|
||||
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||
endif ()
|
||||
|
||||
list(APPEND _lua_include_subdirs "include/lua" "include")
|
||||
|
||||
foreach (ver IN LISTS _lua_append_versions)
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
|
||||
list(APPEND _lua_include_subdirs
|
||||
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
|
||||
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
)
|
||||
list(APPEND _lua_library_names
|
||||
lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
|
||||
lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
)
|
||||
pkg_check_modules(LUA QUIET "lua${ver}")
|
||||
list(APPEND _lua_include_subdirs ${LUA_INCLUDE_DIRS})
|
||||
list(APPEND _lua_library_names ${LUA_LIBRARIES})
|
||||
list(APPEND _lua_library_dirs ${LUA_LIBRARY_DIRS})
|
||||
endforeach ()
|
||||
|
||||
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
|
||||
set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
|
||||
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
|
||||
set(_lua_library_dirs "${_lua_library_dirs}" PARENT_SCOPE)
|
||||
endfunction(_lua_set_version_vars)
|
||||
|
||||
function(_lua_check_header_version _hdr_file)
|
||||
# At least 5.[012] have different ways to express the version
|
||||
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
|
||||
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
|
||||
file(STRINGS "${_hdr_file}" lua_version_strings
|
||||
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
|
||||
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
|
||||
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
|
||||
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
|
||||
else ()
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||
endif ()
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
|
||||
endif ()
|
||||
foreach (ver IN LISTS _lua_append_versions)
|
||||
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
|
||||
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
|
||||
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
|
||||
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
|
||||
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
|
||||
return()
|
||||
endif ()
|
||||
endforeach ()
|
||||
endfunction(_lua_check_header_version)
|
||||
|
||||
_lua_set_version_vars()
|
||||
|
||||
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
|
||||
endif ()
|
||||
|
||||
if (NOT LUA_VERSION_STRING)
|
||||
foreach (subdir IN LISTS _lua_include_subdirs)
|
||||
unset(LUA_INCLUDE_PREFIX CACHE)
|
||||
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
if (LUA_INCLUDE_PREFIX)
|
||||
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
|
||||
if (LUA_VERSION_STRING)
|
||||
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
|
||||
break()
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
unset(_lua_include_subdirs)
|
||||
unset(_lua_append_versions)
|
||||
|
||||
find_library(LUA_LIBRARY
|
||||
NAMES ${_lua_library_names} lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
PATHS
|
||||
${_lua_library_dirs}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
unset(_lua_library_names)
|
||||
|
||||
if (LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||
|
||||
# include dl library for statically-linked Lua library
|
||||
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
||||
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
||||
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else ()
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||
endif ()
|
||||
endif ()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
@@ -0,0 +1,82 @@
|
||||
# Locate Lua library
|
||||
# This module defines
|
||||
# LUA52_FOUND, if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES
|
||||
# LUA_INCLUDE_DIR, where to find lua.h
|
||||
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
# #include "lua.h"
|
||||
# and not
|
||||
# #include <lua/lua.h>
|
||||
# This is because, the lua location is not standardized and may exist
|
||||
# in locations other than lua/
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
# Copyright 2016 for Project-OSRM, Lua5.1 => Lua5.2
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
find_path(LUA_INCLUDE_DIR lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua-5.2 include/lua include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
|
||||
find_library(LUA_LIBRARY
|
||||
NAMES lua52 lua5.2 lua-5.2 lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
|
||||
if(LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
if(UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else()
|
||||
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||
unset(lua_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# Locate Lua library
|
||||
# This module defines
|
||||
# LUAJIT_FOUND, if false, do not try to link to Lua
|
||||
# LUAJIT_LIBRARIES
|
||||
# LUAJIT_INCLUDE_DIR, where to find lua.h
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
# #include "lua.h"
|
||||
# and not
|
||||
# #include <lua/lua.h>
|
||||
# This is because, the lua location is not standardized and may exist
|
||||
# in locations other than lua/
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
#
|
||||
# ################
|
||||
# 2010 - modified for cronkite to find luajit instead of lua, as it was before.
|
||||
#
|
||||
|
||||
if ( NOT LuaJIT_FIND_VERSION )
|
||||
MESSAGE(FATAL_ERROR "You need to specify a version of libluajit to use")
|
||||
ENDIF()
|
||||
|
||||
IF( NOT LUAJIT_FIND_QUIETLY )
|
||||
MESSAGE(STATUS "Looking for LuaJIT ${LuaJIT_FIND_VERSION}")
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
|
||||
HINTS
|
||||
$ENV{LUAJIT_DIR}
|
||||
PATH_SUFFIXES include/luajit-2.0 include/luajit2.0 include/luajit include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUAJIT_LIBRARY
|
||||
NAMES luajit-${LuaJIT_FIND_VERSION_MAJOR}${LuaJIT_FIND_VERSION_MINOR} luajit-${LuaJIT_FIND_VERSION}
|
||||
HINTS
|
||||
$ENV{LUAJIT_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
|
||||
IF(LUAJIT_LIBRARY)
|
||||
# include the math library for Unix
|
||||
IF(UNIX AND NOT APPLE)
|
||||
FIND_LIBRARY(LUAJIT_MATH_LIBRARY m)
|
||||
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
ELSE(UNIX AND NOT APPLE)
|
||||
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
ENDIF(UNIX AND NOT APPLE)
|
||||
ENDIF(LUAJIT_LIBRARY)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LUAJIT DEFAULT_MSG LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
|
||||
|
||||
IF( NOT LUAJIT_FIND_QUIETLY )
|
||||
IF( LUAJIT_FOUND AND LUAJIT_LIBRARIES)
|
||||
MESSAGE(STATUS "Found LuaJIT: ${LUAJIT_LIBRARY}" )
|
||||
MARK_AS_ADVANCED(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
|
||||
ELSE()
|
||||
SET ( LUAJIT_FOUND FALSE )
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
@@ -0,0 +1,75 @@
|
||||
# Locate Luabind library
|
||||
# This module defines
|
||||
# LUABIND_FOUND, if false, do not try to link to Luabind
|
||||
# LUABIND_LIBRARIES
|
||||
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
# #include <luabind/luabind.hpp>
|
||||
# and not
|
||||
# #include <luabind.hpp>
|
||||
|
||||
IF( NOT LUABIND_FIND_QUIETLY )
|
||||
MESSAGE(STATUS "Looking for Luabind...")
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES luabind include/luabind include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local # DarwinPorts
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY
|
||||
NAMES luabind luabind09
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY_DBG
|
||||
NAMES luabindd
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local
|
||||
/opt
|
||||
)
|
||||
|
||||
IF(LUABIND_LIBRARY)
|
||||
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
|
||||
ENDIF(LUABIND_LIBRARY)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
|
||||
|
||||
IF( NOT LUABIND_FIND_QUIETLY )
|
||||
IF( LUABIND_FOUND )
|
||||
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
|
||||
ENDIF()
|
||||
IF( LUABIND_LIBRARY_DBG )
|
||||
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
|
||||
@@ -0,0 +1,51 @@
|
||||
# Locate STXXL library
|
||||
# This module defines
|
||||
# STXXL_FOUND, if false, do not try to link to libstxxl
|
||||
# STXXL_LIBRARY
|
||||
# STXXL_INCLUDE_DIR, where to find stxxl.h
|
||||
#
|
||||
|
||||
|
||||
IF( NOT STXXL_FIND_QUIETLY )
|
||||
MESSAGE(STATUS "Looking for STXXL...")
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(STXXL_INCLUDE_DIR stxxl.h
|
||||
HINTS
|
||||
$ENV{STXXL_DIR}
|
||||
PATH_SUFFIXES stxxl include/stxxl/stxxl include/stxxl include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local # DarwinPorts
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(STXXL_LIBRARY
|
||||
NAMES stxxl stxxl_debug
|
||||
HINTS
|
||||
$ENV{STXXL_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local
|
||||
/opt
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set STXXL_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(STXXL DEFAULT_MSG STXXL_LIBRARY STXXL_INCLUDE_DIR)
|
||||
|
||||
IF( NOT STXXL_FIND_QUIETLY )
|
||||
IF( STXXL_FOUND )
|
||||
MESSAGE(STATUS "Found STXXL: ${STXXL_LIBRARY}" )
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(STXXL_INCLUDE_DIR STXXL_LIBRARY)
|
||||
+283
-286
@@ -1,286 +1,283 @@
|
||||
# Locate Intel Threading Building Blocks include paths and libraries
|
||||
# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
|
||||
# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
|
||||
# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
|
||||
# Florian Uhlig <F.Uhlig _at_ gsi.de>,
|
||||
# Jiri Marsik <jiri.marsik89 _at_ gmail.com>
|
||||
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (c) 2011 Hannes Hofmann
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
|
||||
# e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
|
||||
# TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
|
||||
# in the TBB installation directory (TBB_INSTALL_DIR).
|
||||
#
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
#
|
||||
# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
|
||||
# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
|
||||
# which architecture to use
|
||||
# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
|
||||
# which compiler to use (detected automatically on Windows)
|
||||
|
||||
# This module respects
|
||||
# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
|
||||
|
||||
# This module defines
|
||||
# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
|
||||
# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
|
||||
# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
|
||||
# TBB_INSTALL_DIR, the base TBB install directory
|
||||
# TBB_LIBRARIES, the libraries to link against to use TBB.
|
||||
# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
|
||||
# TBB_FOUND, If false, don't try to use TBB.
|
||||
# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
|
||||
|
||||
|
||||
if (WIN32)
|
||||
# has em64t/vc8 em64t/vc9
|
||||
# has ia32/vc7.1 ia32/vc8 ia32/vc9
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
if (MSVC71)
|
||||
set (_TBB_COMPILER "vc7.1")
|
||||
endif(MSVC71)
|
||||
if (MSVC80)
|
||||
set(_TBB_COMPILER "vc8")
|
||||
endif(MSVC80)
|
||||
if (MSVC90)
|
||||
set(_TBB_COMPILER "vc9")
|
||||
endif(MSVC90)
|
||||
if(MSVC10)
|
||||
set(_TBB_COMPILER "vc10")
|
||||
endif(MSVC10)
|
||||
# Todo: add other Windows compilers such as ICL.
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (WIN32)
|
||||
|
||||
if (UNIX)
|
||||
if (APPLE)
|
||||
# MAC
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
|
||||
# libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# default flavor on apple: ia32/cc4.0.1_os10.4.9
|
||||
# Jiri: There is no reason to presume there is only one flavor and
|
||||
# that user's setting of variables should be ignored.
|
||||
if(NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER "cc4.0.1_os10.4.9")
|
||||
elseif (NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
endif(NOT TBB_COMPILER)
|
||||
if(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE "ia32")
|
||||
elseif(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif(NOT TBB_ARCHITECTURE)
|
||||
else (APPLE)
|
||||
# LINUX
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/usr")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
|
||||
# has ia32/*
|
||||
# has itanium/*
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (APPLE)
|
||||
endif (UNIX)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
# SUN
|
||||
# not yet supported
|
||||
# has em64t/cc3.4.3_kernel5.10
|
||||
# has ia32/*
|
||||
endif (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
|
||||
|
||||
#-- Clear the public variables
|
||||
set (TBB_FOUND "NO")
|
||||
|
||||
|
||||
#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
|
||||
# first: use CMake variable TBB_INSTALL_DIR
|
||||
if (TBB_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
|
||||
endif (TBB_INSTALL_DIR)
|
||||
# second: use environment variable
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
# Intel recommends setting TBB21_INSTALL_DIR
|
||||
if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# third: try to find path automatically
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (_TBB_DEFAULT_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
|
||||
endif (_TBB_DEFAULT_INSTALL_DIR)
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# sanity check
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
|
||||
else (NOT _TBB_INSTALL_DIR)
|
||||
# finally: set the cached CMake variable TBB_INSTALL_DIR
|
||||
if (NOT TBB_INSTALL_DIR)
|
||||
set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
|
||||
mark_as_advanced(TBB_INSTALL_DIR)
|
||||
endif (NOT TBB_INSTALL_DIR)
|
||||
|
||||
|
||||
#-- A macro to rewrite the paths of the library. This is necessary, because
|
||||
# find_library() always found the em64t/vc9 version of the TBB libs
|
||||
macro(TBB_CORRECT_LIB_DIR var_name)
|
||||
# if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
# endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
endmacro(TBB_CORRECT_LIB_DIR var_content)
|
||||
|
||||
|
||||
#-- Look for include directory and set ${TBB_INCLUDE_DIR}
|
||||
set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
|
||||
# Jiri: tbbvars now sets the CPATH environment variable to the directory
|
||||
# containing the headers.
|
||||
find_path(TBB_INCLUDE_DIR
|
||||
tbb/task_scheduler_init.h
|
||||
HINTS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
||||
)
|
||||
mark_as_advanced(TBB_INCLUDE_DIR)
|
||||
|
||||
#-- Look for libraries
|
||||
# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
|
||||
if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
set (_TBB_LIBRARY_DIR
|
||||
${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
|
||||
${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
|
||||
)
|
||||
endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
# Jiri: This block isn't mutually exclusive with the previous one
|
||||
# (hence no else), instead I test if the user really specified
|
||||
# the variables in question.
|
||||
if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
# HH: deprecated
|
||||
message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
|
||||
# Jiri: It doesn't hurt to look in more places, so I store the hints from
|
||||
# ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
|
||||
# variables and search them both.
|
||||
set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
|
||||
endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
|
||||
|
||||
if(EXISTS ${_TBB_INSTALL_DIR}/build)
|
||||
file(GLOB _TBB_BUILD_DIR_RELEASE ${_TBB_INSTALL_DIR}/build/*_release)
|
||||
file(GLOB _TBB_BUILD_DIR_DEBUG ${_TBB_INSTALL_DIR}/build/*_debug)
|
||||
endif()
|
||||
|
||||
# Jiri: No reason not to check the default paths. From recent versions,
|
||||
# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
|
||||
# variables, which now point to the directories of the lib files.
|
||||
# It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
|
||||
# argument instead of the implicit PATHS as it isn't hard-coded
|
||||
# but computed by system introspection. Searching the LIBRARY_PATH
|
||||
# and LD_LIBRARY_PATH environment variables is now even more important
|
||||
# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
|
||||
# the use of TBB built from sources.
|
||||
find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_BUILD_DIR_RELEASE} ${_TBB_LIBRARY_DIR})
|
||||
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_BUILD_DIR_RELEASE} ${_TBB_LIBRARY_DIR})
|
||||
|
||||
#Extract path from TBB_LIBRARY name
|
||||
get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
|
||||
mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
|
||||
|
||||
#-- Look for debug libraries
|
||||
# Jiri: Changed the same way as for the release libraries.
|
||||
find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_BUILD_DIR_DEBUG} ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_BUILD_DIR_DEBUG} ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
# Extract path from TBB_LIBRARY_DEBUG name
|
||||
get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
|
||||
mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
|
||||
|
||||
|
||||
if (TBB_INCLUDE_DIR)
|
||||
if (TBB_LIBRARY)
|
||||
set (TBB_FOUND "YES")
|
||||
set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
|
||||
set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
|
||||
set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
|
||||
set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
|
||||
mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
|
||||
message(STATUS "Found Intel TBB")
|
||||
endif (TBB_LIBRARY)
|
||||
endif (TBB_INCLUDE_DIR)
|
||||
|
||||
if (NOT TBB_FOUND)
|
||||
message("ERROR: Intel TBB NOT found!")
|
||||
message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
|
||||
# do only throw fatal, if this pkg is REQUIRED
|
||||
if (TBB_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find TBB library.")
|
||||
endif (TBB_FIND_REQUIRED)
|
||||
endif (NOT TBB_FOUND)
|
||||
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
|
||||
if (TBB_FOUND)
|
||||
set(TBB_INTERFACE_VERSION 0)
|
||||
FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
|
||||
STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
|
||||
set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
|
||||
message(STATUS "TBB interface version: ${TBB_INTERFACE_VERSION}")
|
||||
endif (TBB_FOUND)
|
||||
# Locate Intel Threading Building Blocks include paths and libraries
|
||||
# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
|
||||
# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
|
||||
# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
|
||||
# Florian Uhlig <F.Uhlig _at_ gsi.de>,
|
||||
# Jiri Marsik <jiri.marsik89 _at_ gmail.com>
|
||||
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (c) 2011 Hannes Hofmann
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
|
||||
# e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
|
||||
# TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
|
||||
# in the TBB installation directory (TBB_INSTALL_DIR).
|
||||
#
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
#
|
||||
# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
|
||||
# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
|
||||
# which architecture to use
|
||||
# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
|
||||
# which compiler to use (detected automatically on Windows)
|
||||
|
||||
# This module respects
|
||||
# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
|
||||
|
||||
# This module defines
|
||||
# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
|
||||
# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
|
||||
# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
|
||||
# TBB_INSTALL_DIR, the base TBB install directory
|
||||
# TBB_LIBRARIES, the libraries to link against to use TBB.
|
||||
# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
|
||||
# TBB_FOUND, If false, don't try to use TBB.
|
||||
# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
|
||||
|
||||
|
||||
if (WIN32)
|
||||
# has em64t/vc8 em64t/vc9
|
||||
# has ia32/vc7.1 ia32/vc8 ia32/vc9
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
if (MSVC71)
|
||||
set (_TBB_COMPILER "vc7.1")
|
||||
endif(MSVC71)
|
||||
if (MSVC80)
|
||||
set(_TBB_COMPILER "vc8")
|
||||
endif(MSVC80)
|
||||
if (MSVC90)
|
||||
set(_TBB_COMPILER "vc9")
|
||||
endif(MSVC90)
|
||||
if(MSVC10)
|
||||
set(_TBB_COMPILER "vc10")
|
||||
endif(MSVC10)
|
||||
# Todo: add other Windows compilers such as ICL.
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (WIN32)
|
||||
|
||||
if (UNIX)
|
||||
if (APPLE)
|
||||
# MAC
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
|
||||
# libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# default flavor on apple: ia32/cc4.0.1_os10.4.9
|
||||
# Jiri: There is no reason to presume there is only one flavor and
|
||||
# that user's setting of variables should be ignored.
|
||||
if(NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER "cc4.0.1_os10.4.9")
|
||||
elseif (NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
endif(NOT TBB_COMPILER)
|
||||
if(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE "ia32")
|
||||
elseif(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif(NOT TBB_ARCHITECTURE)
|
||||
else (APPLE)
|
||||
# LINUX
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
|
||||
# has ia32/*
|
||||
# has itanium/*
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (APPLE)
|
||||
endif (UNIX)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
# SUN
|
||||
# not yet supported
|
||||
# has em64t/cc3.4.3_kernel5.10
|
||||
# has ia32/*
|
||||
endif (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
|
||||
|
||||
#-- Clear the public variables
|
||||
set (TBB_FOUND "NO")
|
||||
|
||||
|
||||
#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
|
||||
# first: use CMake variable TBB_INSTALL_DIR
|
||||
if (TBB_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
|
||||
endif (TBB_INSTALL_DIR)
|
||||
# second: use environment variable
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
# Intel recommends setting TBB21_INSTALL_DIR
|
||||
if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# third: try to find path automatically
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (_TBB_DEFAULT_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
|
||||
endif (_TBB_DEFAULT_INSTALL_DIR)
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# sanity check
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
|
||||
else (NOT _TBB_INSTALL_DIR)
|
||||
# finally: set the cached CMake variable TBB_INSTALL_DIR
|
||||
if (NOT TBB_INSTALL_DIR)
|
||||
set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
|
||||
mark_as_advanced(TBB_INSTALL_DIR)
|
||||
endif (NOT TBB_INSTALL_DIR)
|
||||
|
||||
|
||||
#-- A macro to rewrite the paths of the library. This is necessary, because
|
||||
# find_library() always found the em64t/vc9 version of the TBB libs
|
||||
macro(TBB_CORRECT_LIB_DIR var_name)
|
||||
# if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
# endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
endmacro(TBB_CORRECT_LIB_DIR var_content)
|
||||
|
||||
|
||||
#-- Look for include directory and set ${TBB_INCLUDE_DIR}
|
||||
set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
|
||||
# Jiri: tbbvars now sets the CPATH environment variable to the directory
|
||||
# containing the headers.
|
||||
find_path(TBB_INCLUDE_DIR
|
||||
tbb/task_scheduler_init.h
|
||||
PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
||||
)
|
||||
mark_as_advanced(TBB_INCLUDE_DIR)
|
||||
|
||||
|
||||
#-- Look for libraries
|
||||
# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
|
||||
if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
set (_TBB_LIBRARY_DIR
|
||||
${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
|
||||
${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
|
||||
)
|
||||
endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
# Jiri: This block isn't mutually exclusive with the previous one
|
||||
# (hence no else), instead I test if the user really specified
|
||||
# the variables in question.
|
||||
if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
# HH: deprecated
|
||||
message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
|
||||
# Jiri: It doesn't hurt to look in more places, so I store the hints from
|
||||
# ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
|
||||
# variables and search them both.
|
||||
set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
|
||||
endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
|
||||
|
||||
# Jiri: No reason not to check the default paths. From recent versions,
|
||||
# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
|
||||
# variables, which now point to the directories of the lib files.
|
||||
# It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
|
||||
# argument instead of the implicit PATHS as it isn't hard-coded
|
||||
# but computed by system introspection. Searching the LIBRARY_PATH
|
||||
# and LD_LIBRARY_PATH environment variables is now even more important
|
||||
# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
|
||||
# the use of TBB built from sources.
|
||||
find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
#Extract path from TBB_LIBRARY name
|
||||
get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
|
||||
mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
|
||||
|
||||
#-- Look for debug libraries
|
||||
# Jiri: Changed the same way as for the release libraries.
|
||||
find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
# Extract path from TBB_LIBRARY_DEBUG name
|
||||
get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
|
||||
mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
|
||||
|
||||
|
||||
if (TBB_INCLUDE_DIR)
|
||||
if (TBB_LIBRARY)
|
||||
set (TBB_FOUND "YES")
|
||||
set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
|
||||
set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
|
||||
set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
|
||||
set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
|
||||
mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
|
||||
message(STATUS "Found Intel TBB")
|
||||
endif (TBB_LIBRARY)
|
||||
endif (TBB_INCLUDE_DIR)
|
||||
|
||||
if (NOT TBB_FOUND)
|
||||
message("ERROR: Intel TBB NOT found!")
|
||||
message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
|
||||
# do only throw fatal, if this pkg is REQUIRED
|
||||
if (TBB_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find TBB library.")
|
||||
endif (TBB_FIND_REQUIRED)
|
||||
endif (NOT TBB_FOUND)
|
||||
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
|
||||
if (TBB_FOUND)
|
||||
set(TBB_INTERFACE_VERSION 0)
|
||||
FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
|
||||
STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
|
||||
set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
|
||||
endif (TBB_FOUND)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
|
||||
set(NEWFILE ${OLDFILE}.tmp)
|
||||
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
|
||||
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
|
||||
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
|
||||
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
|
||||
file(MD5 ${SOURCE_DIR}/include/engine/datafacade/internal_datafacade.hpp MD5OBJECTS)
|
||||
|
||||
CONFIGURE_FILE(${INFILE} ${NEWFILE})
|
||||
|
||||
file(MD5 ${NEWFILE} MD5NEW)
|
||||
|
||||
if (EXISTS ${OLDFILE})
|
||||
file(MD5 ${OLDFILE} MD5OLD)
|
||||
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
|
||||
file(REMOVE_RECURSE ${OLDFILE})
|
||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||
else()
|
||||
file(REMOVE_RECURSE ${NEWFILE})
|
||||
message(STATUS "Fingerprint unchanged, not regenerating")
|
||||
endif()
|
||||
else()
|
||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||
endif()
|
||||
@@ -1,290 +0,0 @@
|
||||
# https://github.com/sbellus/json-cmake/blob/9913da8800b95322d393894d3525d634568f305e/JSONParser.cmake
|
||||
# MIT Licensed - https://github.com/sbellus/json-cmake/blob/master/LICENSE
|
||||
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
if (DEFINED JSonParserGuard)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(JSonParserGuard yes)
|
||||
|
||||
macro(sbeParseJson prefix jsonString)
|
||||
cmake_policy(PUSH)
|
||||
|
||||
set(json_string "${${jsonString}}")
|
||||
string(LENGTH "${json_string}" json_jsonLen)
|
||||
set(json_index 0)
|
||||
set(json_AllVariables ${prefix})
|
||||
set(json_ArrayNestingLevel 0)
|
||||
set(json_MaxArrayNestingLevel 0)
|
||||
|
||||
_sbeParse(${prefix})
|
||||
|
||||
unset(json_index)
|
||||
unset(json_AllVariables)
|
||||
unset(json_jsonLen)
|
||||
unset(json_string)
|
||||
unset(json_value)
|
||||
unset(json_inValue)
|
||||
unset(json_name)
|
||||
unset(json_inName)
|
||||
unset(json_newPrefix)
|
||||
unset(json_reservedWord)
|
||||
unset(json_arrayIndex)
|
||||
unset(json_char)
|
||||
unset(json_end)
|
||||
unset(json_ArrayNestingLevel)
|
||||
foreach(json_nestingLevel RANGE ${json_MaxArrayNestingLevel})
|
||||
unset(json_${json_nestingLevel}_arrayIndex)
|
||||
endforeach()
|
||||
unset(json_nestingLevel)
|
||||
unset(json_MaxArrayNestingLevel)
|
||||
|
||||
cmake_policy(POP)
|
||||
endmacro()
|
||||
|
||||
macro(sbeClearJson prefix)
|
||||
foreach(json_var ${${prefix}})
|
||||
unset(${json_var})
|
||||
endforeach()
|
||||
|
||||
unset(${prefix})
|
||||
unset(json_var)
|
||||
endmacro()
|
||||
|
||||
macro(sbePrintJson prefix)
|
||||
foreach(json_var ${${prefix}})
|
||||
message("${json_var} = ${${json_var}}")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParse prefix)
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("\"" STREQUAL "${json_char}")
|
||||
_sbeParseNameValue(${prefix})
|
||||
elseif("{" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseObject(${prefix})
|
||||
elseif("[" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseArray(${prefix})
|
||||
endif()
|
||||
|
||||
if(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
else()
|
||||
break()
|
||||
endif()
|
||||
|
||||
if ("}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
|
||||
break()
|
||||
endif()
|
||||
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endwhile()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseNameValue prefix)
|
||||
set(json_name "")
|
||||
set(json_inName no)
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
# check if name ends
|
||||
if("\"" STREQUAL "${json_char}" AND json_inName)
|
||||
set(json_inName no)
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
set(json_newPrefix ${prefix}.${json_name})
|
||||
set(json_name "")
|
||||
|
||||
if(":" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("\"" STREQUAL "${json_char}")
|
||||
_sbeParseValue(${json_newPrefix})
|
||||
break()
|
||||
elseif("{" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseObject(${json_newPrefix})
|
||||
break()
|
||||
elseif("[" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
_sbeParseArray(${json_newPrefix})
|
||||
break()
|
||||
else()
|
||||
# reserved word starts
|
||||
_sbeParseReservedWord(${json_newPrefix})
|
||||
break()
|
||||
endif()
|
||||
else()
|
||||
# name without value
|
||||
list(APPEND ${json_AllVariables} ${json_newPrefix})
|
||||
set(${json_newPrefix} "")
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(json_inName)
|
||||
# remove escapes
|
||||
if("\\" STREQUAL "${json_char}")
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
endif()
|
||||
|
||||
set(json_name "${json_name}${json_char}")
|
||||
endif()
|
||||
|
||||
# check if name starts
|
||||
if("\"" STREQUAL "${json_char}" AND NOT json_inName)
|
||||
set(json_inName yes)
|
||||
endif()
|
||||
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endwhile()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseReservedWord prefix)
|
||||
set(json_reservedWord "")
|
||||
set(json_end no)
|
||||
while(${json_index} LESS ${json_jsonLen} AND NOT json_end)
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("," STREQUAL "${json_char}" OR "}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
|
||||
set(json_end yes)
|
||||
else()
|
||||
set(json_reservedWord "${json_reservedWord}${json_char}")
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
endif()
|
||||
endwhile()
|
||||
|
||||
list(APPEND ${json_AllVariables} ${prefix})
|
||||
string(STRIP "${json_reservedWord}" json_reservedWord)
|
||||
set(${prefix} ${json_reservedWord})
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseValue prefix)
|
||||
cmake_policy(SET CMP0054 NEW) # turn off implicit expansions in if statement
|
||||
|
||||
set(json_value "")
|
||||
set(json_inValue no)
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
# check if json_value ends, it is ended by "
|
||||
if("\"" STREQUAL "${json_char}" AND json_inValue)
|
||||
set(json_inValue no)
|
||||
|
||||
set(${prefix} ${json_value})
|
||||
list(APPEND ${json_AllVariables} ${prefix})
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
break()
|
||||
endif()
|
||||
|
||||
if(json_inValue)
|
||||
# if " is escaped consume
|
||||
if("\\" STREQUAL "${json_char}")
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
if(NOT "\"" STREQUAL "${json_char}")
|
||||
# if it is not " then copy also escape character
|
||||
set(json_char "\\${json_char}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
_sbeAddEscapedCharacter("${json_char}")
|
||||
endif()
|
||||
|
||||
# check if value starts
|
||||
if("\"" STREQUAL "${json_char}" AND NOT json_inValue)
|
||||
set(json_inValue yes)
|
||||
endif()
|
||||
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
endwhile()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeAddEscapedCharacter char)
|
||||
string(CONCAT json_value "${json_value}" "${char}")
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseObject prefix)
|
||||
_sbeParse(${prefix})
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endmacro()
|
||||
|
||||
macro(_sbeParseArray prefix)
|
||||
math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} + 1")
|
||||
set(json_${json_ArrayNestingLevel}_arrayIndex 0)
|
||||
|
||||
set(${prefix} "")
|
||||
list(APPEND ${json_AllVariables} ${prefix})
|
||||
|
||||
while(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("\"" STREQUAL "${json_char}")
|
||||
# simple value
|
||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
_sbeParseValue(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
elseif("{" STREQUAL "${json_char}")
|
||||
# object
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
_sbeParseObject(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
else()
|
||||
list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
_sbeParseReservedWord(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
|
||||
endif()
|
||||
|
||||
if(NOT ${json_index} LESS ${json_jsonLen})
|
||||
break()
|
||||
endif()
|
||||
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
|
||||
if("]" STREQUAL "${json_char}")
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
break()
|
||||
elseif("," STREQUAL "${json_char}")
|
||||
math(EXPR json_${json_ArrayNestingLevel}_arrayIndex "${json_${json_ArrayNestingLevel}_arrayIndex} + 1")
|
||||
endif()
|
||||
|
||||
_sbeMoveToNextNonEmptyCharacter()
|
||||
endwhile()
|
||||
|
||||
if(${json_MaxArrayNestingLevel} LESS ${json_ArrayNestingLevel})
|
||||
set(json_MaxArrayNestingLevel ${json_ArrayNestingLevel})
|
||||
endif()
|
||||
math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} - 1")
|
||||
endmacro()
|
||||
|
||||
macro(_sbeMoveToNextNonEmptyCharacter)
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
if(${json_index} LESS ${json_jsonLen})
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
while(${json_char} MATCHES "[ \t\n\r]" AND ${json_index} LESS ${json_jsonLen})
|
||||
math(EXPR json_index "${json_index} + 1")
|
||||
string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
|
||||
endwhile()
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -0,0 +1,40 @@
|
||||
INCLUDE (CheckCXXSourceCompiles)
|
||||
unset(LUABIND_WORKS CACHE)
|
||||
unset(LUABIND51_WORKS CACHE)
|
||||
set (LUABIND_CHECK_SRC "extern \"C\" {\n#include \"lua.h\"\n#include \"lauxlib.h\"\n}\n#include <luabind/open.hpp>\nint main() { lua_State *x = luaL_newstate(); luabind::open(x); }")
|
||||
set (CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
|
||||
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
|
||||
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
|
||||
|
||||
find_package(Lua52)
|
||||
if(NOT APPLE)
|
||||
find_package(LuaJIT 5.2)
|
||||
endif()
|
||||
if(LUA52_FOUND)
|
||||
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
|
||||
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
|
||||
CHECK_CXX_SOURCE_COMPILES("${LUABIND_CHECK_SRC}" LUABIND_WORKS)
|
||||
endif()
|
||||
|
||||
if(LUABIND_WORKS)
|
||||
message(STATUS "Luabind/Lua5.2 combination working with ${LUA_LIBRARY}")
|
||||
else()
|
||||
message(STATUS "Luabind/Lua5.2 not feasible, falling back to Lua 5.1.")
|
||||
unset(LUA_FOUND CACHE)
|
||||
unset(LUA_INCLUDE_DIR CACHE)
|
||||
unset(LUA_LIBRARY CACHE)
|
||||
find_package(Lua51 REQUIRED)
|
||||
if(NOT APPLE)
|
||||
find_package(LuaJIT 5.1)
|
||||
endif()
|
||||
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
|
||||
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("${LUABIND_CHECK_SRC}" LUABIND51_WORKS)
|
||||
|
||||
if(LUABIND51_WORKS)
|
||||
message(STATUS "Luabind works with Lua 5.1 at ${LUA_LIBRARY}")
|
||||
else()
|
||||
message(FATAL_ERROR "Luabind does not work with Lua 5.1 at ${LUA_LIBRARY}, no working Luabind found")
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,215 +0,0 @@
|
||||
# Mason CMake
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
function(mason_detect_platform)
|
||||
# Determine platform
|
||||
if(NOT MASON_PLATFORM)
|
||||
# we call uname -s manually here since
|
||||
# CMAKE_HOST_SYSTEM_NAME will not be defined before the project() call
|
||||
execute_process(
|
||||
COMMAND uname -s
|
||||
OUTPUT_VARIABLE UNAME
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if (UNAME STREQUAL "Darwin")
|
||||
set(MASON_PLATFORM "osx" PARENT_SCOPE)
|
||||
else()
|
||||
set(MASON_PLATFORM "linux" PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Determine platform version string
|
||||
if(NOT MASON_PLATFORM_VERSION)
|
||||
execute_process(
|
||||
COMMAND uname -m
|
||||
OUTPUT_VARIABLE MASON_PLATFORM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(MASON_PLATFORM_VERSION "${MASON_PLATFORM_VERSION}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mason_use _PACKAGE)
|
||||
if(NOT _PACKAGE)
|
||||
message(FATAL_ERROR "[Mason] No package name given")
|
||||
endif()
|
||||
|
||||
cmake_parse_arguments("" "HEADER_ONLY" "VERSION" "" ${ARGN})
|
||||
|
||||
if(_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "[Mason] mason_use() called with unrecognized arguments: ${_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
|
||||
if(NOT _VERSION)
|
||||
message(FATAL_ERROR "[Mason] Specifying a version is required")
|
||||
endif()
|
||||
|
||||
if(MASON_PACKAGE_${_PACKAGE}_INVOCATION STREQUAL "${MASON_INVOCATION}")
|
||||
# Check that the previous invocation of mason_use didn't select another version of this package
|
||||
if(NOT MASON_PACKAGE_${_PACKAGE}_VERSION STREQUAL ${_VERSION})
|
||||
message(FATAL_ERROR "[Mason] Already using ${_PACKAGE} ${MASON_PACKAGE_${_PACKAGE}_VERSION}. Cannot select version ${_VERSION}.")
|
||||
endif()
|
||||
else()
|
||||
if(_HEADER_ONLY)
|
||||
set(_PLATFORM_ID "headers")
|
||||
else()
|
||||
set(_PLATFORM_ID "${MASON_PLATFORM}-${MASON_PLATFORM_VERSION}")
|
||||
endif()
|
||||
|
||||
set(_SLUG "${_PLATFORM_ID}/${_PACKAGE}/${_VERSION}")
|
||||
set(_INSTALL_PATH "${MASON_PACKAGE_DIR}/${_SLUG}")
|
||||
file(RELATIVE_PATH _INSTALL_PATH_RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${_INSTALL_PATH}")
|
||||
|
||||
if(NOT EXISTS "${_INSTALL_PATH}")
|
||||
set(_CACHE_PATH "${MASON_PACKAGE_DIR}/.binaries/${_SLUG}.tar.gz")
|
||||
if (NOT EXISTS "${_CACHE_PATH}")
|
||||
# Download the package
|
||||
set(_URL "${MASON_REPOSITORY}/${_SLUG}.tar.gz")
|
||||
message("[Mason] Downloading package ${_URL}...")
|
||||
|
||||
set(_FAILED)
|
||||
set(_ERROR)
|
||||
# Note: some CMake versions are compiled without SSL support
|
||||
get_filename_component(_CACHE_DIR "${_CACHE_PATH}" DIRECTORY)
|
||||
file(MAKE_DIRECTORY "${_CACHE_DIR}")
|
||||
execute_process(
|
||||
COMMAND curl --retry 3 -s -f -S -L "${_URL}" -o "${_CACHE_PATH}.tmp"
|
||||
RESULT_VARIABLE _FAILED
|
||||
ERROR_VARIABLE _ERROR)
|
||||
if(_FAILED)
|
||||
message(FATAL_ERROR "[Mason] Failed to download ${_URL}: ${_ERROR}")
|
||||
else()
|
||||
# We downloaded to a temporary file to prevent half-finished downloads
|
||||
file(RENAME "${_CACHE_PATH}.tmp" "${_CACHE_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Unpack the package
|
||||
message("[Mason] Unpacking package to ${_INSTALL_PATH_RELATIVE}...")
|
||||
file(MAKE_DIRECTORY "${_INSTALL_PATH}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf "${_CACHE_PATH}"
|
||||
WORKING_DIRECTORY "${_INSTALL_PATH}")
|
||||
endif()
|
||||
|
||||
# Error out if there is no config file.
|
||||
if(NOT EXISTS "${_INSTALL_PATH}/mason.ini")
|
||||
message(FATAL_ERROR "[Mason] Could not find mason.ini for package ${_PACKAGE} ${_VERSION}")
|
||||
endif()
|
||||
|
||||
set(MASON_PACKAGE_${_PACKAGE}_PREFIX "${_INSTALL_PATH}" CACHE STRING "${_PACKAGE} ${_INSTALL_PATH}" FORCE)
|
||||
mark_as_advanced(MASON_PACKAGE_${_PACKAGE}_PREFIX)
|
||||
|
||||
# Load the configuration from the ini file
|
||||
file(STRINGS "${_INSTALL_PATH}/mason.ini" _CONFIG_FILE)
|
||||
foreach(_LINE IN LISTS _CONFIG_FILE)
|
||||
string(REGEX MATCH "^([a-z_]+) *= *" _KEY "${_LINE}")
|
||||
if (_KEY)
|
||||
string(LENGTH "${_KEY}" _KEY_LENGTH)
|
||||
string(SUBSTRING "${_LINE}" ${_KEY_LENGTH} -1 _VALUE)
|
||||
string(REGEX REPLACE ";.*$" "" _VALUE "${_VALUE}") # Trim trailing commas
|
||||
string(REPLACE "{prefix}" "${_INSTALL_PATH}" _VALUE "${_VALUE}")
|
||||
string(STRIP "${_VALUE}" _VALUE)
|
||||
string(REPLACE "=" "" _KEY "${_KEY}")
|
||||
string(STRIP "${_KEY}" _KEY)
|
||||
string(TOUPPER "${_KEY}" _KEY)
|
||||
if(_KEY STREQUAL "INCLUDE_DIRS" OR _KEY STREQUAL "STATIC_LIBS" )
|
||||
separate_arguments(_VALUE)
|
||||
endif()
|
||||
set(MASON_PACKAGE_${_PACKAGE}_${_KEY} "${_VALUE}" CACHE STRING "${_PACKAGE} ${_KEY}" FORCE)
|
||||
mark_as_advanced(MASON_PACKAGE_${_PACKAGE}_${_KEY})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Compare version in the package to catch errors early on
|
||||
if(NOT _VERSION STREQUAL MASON_PACKAGE_${_PACKAGE}_VERSION)
|
||||
message(FATAL_ERROR "[Mason] Package at ${_INSTALL_PATH_RELATIVE} has version '${MASON_PACKAGE_${_PACKAGE}_VERSION}', but required '${_VERSION}'")
|
||||
endif()
|
||||
|
||||
if(NOT _PACKAGE STREQUAL MASON_PACKAGE_${_PACKAGE}_NAME)
|
||||
message(FATAL_ERROR "[Mason] Package at ${_INSTALL_PATH_RELATIVE} has name '${MASON_PACKAGE_${_PACKAGE}_NAME}', but required '${_NAME}'")
|
||||
endif()
|
||||
|
||||
if(NOT _HEADER_ONLY)
|
||||
if(NOT MASON_PLATFORM STREQUAL MASON_PACKAGE_${_PACKAGE}_PLATFORM)
|
||||
message(FATAL_ERROR "[Mason] Package at ${_INSTALL_PATH_RELATIVE} has platform '${MASON_PACKAGE_${_PACKAGE}_PLATFORM}', but required '${MASON_PLATFORM}'")
|
||||
endif()
|
||||
|
||||
if(NOT MASON_PLATFORM_VERSION STREQUAL MASON_PACKAGE_${_PACKAGE}_PLATFORM_VERSION)
|
||||
message(FATAL_ERROR "[Mason] Package at ${_INSTALL_PATH_RELATIVE} has platform version '${MASON_PACKAGE_${_PACKAGE}_PLATFORM_VERSION}', but required '${MASON_PLATFORM_VERSION}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Concatenate the static libs and libraries
|
||||
set(_LIBRARIES)
|
||||
list(APPEND _LIBRARIES ${MASON_PACKAGE_${_PACKAGE}_STATIC_LIBS} ${MASON_PACKAGE_${_PACKAGE}_LDFLAGS})
|
||||
set(MASON_PACKAGE_${_PACKAGE}_LIBRARIES "${_LIBRARIES}" CACHE STRING "${_PACKAGE} _LIBRARIES" FORCE)
|
||||
mark_as_advanced(MASON_PACKAGE_${_PACKAGE}_LIBRARIES)
|
||||
|
||||
if(NOT _HEADER_ONLY)
|
||||
string(REGEX MATCHALL "(^| +)-L *([^ ]+)" MASON_PACKAGE_${_PACKAGE}_LIBRARY_DIRS "${MASON_PACKAGE_${_PACKAGE}_LDFLAGS}")
|
||||
string(REGEX REPLACE "(^| +)-L *" "\\1" MASON_PACKAGE_${_PACKAGE}_LIBRARY_DIRS "${MASON_PACKAGE_${_PACKAGE}_LIBRARY_DIRS}")
|
||||
set(MASON_PACKAGE_${_PACKAGE}_LIBRARY_DIRS "${MASON_PACKAGE_${_PACKAGE}_LIBRARY_DIRS}" CACHE STRING "${_PACKAGE} ${MASON_PACKAGE_${_PACKAGE}_LIBRARY_DIRS}" FORCE)
|
||||
mark_as_advanced(MASON_PACKAGE_${_PACKAGE}_LIBRARY_DIRS)
|
||||
endif()
|
||||
|
||||
# Store invocation ID to prevent different versions of the same package in one invocation
|
||||
set(MASON_PACKAGE_${_PACKAGE}_INVOCATION "${MASON_INVOCATION}" CACHE INTERNAL "${_PACKAGE} invocation ID" FORCE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(target_add_mason_package _TARGET _VISIBILITY _PACKAGE)
|
||||
if (NOT MASON_PACKAGE_${_PACKAGE}_INVOCATION)
|
||||
message(FATAL_ERROR "[Mason] Package ${_PACKAGE} has not been initialized yet")
|
||||
endif()
|
||||
|
||||
target_include_directories(${_TARGET} ${_VISIBILITY} "${MASON_PACKAGE_${_PACKAGE}_INCLUDE_DIRS}")
|
||||
target_compile_definitions(${_TARGET} ${_VISIBILITY} "${MASON_PACKAGE_${_PACKAGE}_DEFINITIONS}")
|
||||
target_compile_options(${_TARGET} ${_VISIBILITY} "${MASON_PACKAGE_${_PACKAGE}_OPTIONS}")
|
||||
target_link_libraries(${_TARGET} ${_VISIBILITY} "${MASON_PACKAGE_${_PACKAGE}_LIBRARIES}")
|
||||
endmacro()
|
||||
|
||||
# Setup
|
||||
|
||||
string(RANDOM LENGTH 16 MASON_INVOCATION)
|
||||
|
||||
# Read environment variables if CMake is run in command mode
|
||||
if (CMAKE_ARGC)
|
||||
set(MASON_PLATFORM "$ENV{MASON_PLATFORM}")
|
||||
set(MASON_PLATFORM_VERSION "$ENV{MASON_PLATFORM_VERSION}")
|
||||
set(MASON_PACKAGE_DIR "$ENV{MASON_PACKAGE_DIR}")
|
||||
set(MASON_REPOSITORY "$ENV{MASON_REPOSITORY}")
|
||||
endif()
|
||||
|
||||
# Directory where Mason packages are located; typically ends with mason_packages
|
||||
if (NOT MASON_PACKAGE_DIR)
|
||||
set(MASON_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/mason_packages")
|
||||
endif()
|
||||
|
||||
# URL prefix of where packages are located.
|
||||
if (NOT MASON_REPOSITORY)
|
||||
set(MASON_REPOSITORY "https://mason-binaries.s3.amazonaws.com")
|
||||
endif()
|
||||
|
||||
mason_detect_platform()
|
||||
|
||||
# Execute commands if CMake is run in command mode
|
||||
if (CMAKE_ARGC)
|
||||
# Collect remaining arguments for passing to mason_use
|
||||
set(_MASON_ARGS)
|
||||
if (${CMAKE_ARGC} LESS 5)
|
||||
message(FATAL_ERROR "Usage: mason.sh [install|prefix] PACKAGE VERSION")
|
||||
endif()
|
||||
|
||||
if (${CMAKE_ARGV3} STREQUAL "install")
|
||||
# Install the package
|
||||
mason_use(${CMAKE_ARGV4} VERSION ${CMAKE_ARGV5})
|
||||
elseif (${CMAKE_ARGV3} STREQUAL "prefix")
|
||||
set(PKG_PREFIX "${MASON_PACKAGE_DIR}/${MASON_PLATFORM}-${MASON_PLATFORM_VERSION}/${CMAKE_ARGV4}/${CMAKE_ARGV5}")
|
||||
# CMake can't write to stdout with message()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${PKG_PREFIX}")
|
||||
else()
|
||||
message(FATAL_ERROR "Usage: mason.sh [install|prefix] PACKAGE VERSION")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
includedir=@PKGCONFIG_INCLUDE_DIR@
|
||||
libdir=@PKGCONFIG_LIBRARY_DIR@
|
||||
includedir=${prefix}/include ${prefix}/include/osrm
|
||||
libdir=${prefix}/lib
|
||||
|
||||
Name: libOSRM
|
||||
Description: Project OSRM library
|
||||
Version: @OSRM_VERSION@
|
||||
Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
|
||||
Requires:
|
||||
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
|
||||
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
|
||||
Cflags: @PKGCONFIG_OSRM_INCLUDE_FLAGS@ @PKGCONFIG_OSRM_CXXFLAGS@
|
||||
Libs: -L${libdir} -losrm
|
||||
Libs.private: @ENGINE_LIBRARY_LISTING@
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
coverage:
|
||||
|
||||
ignore:
|
||||
- third_party/.*
|
||||
|
||||
comment: off
|
||||
@@ -0,0 +1,9 @@
|
||||
# config/cucumber.yml
|
||||
##YAML Template
|
||||
---
|
||||
default: --require features --tags ~@todo --tags ~@bug --tag ~@stress
|
||||
verify: --require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress
|
||||
jenkins: --require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress
|
||||
bugs: --require features --tags @bug
|
||||
todo: --require features --tags @todo
|
||||
all: --require features
|
||||
@@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
default: '--strict --tags ~@stress --tags ~@todo --tags ~@mld-only --require features/support --require features/step_definitions',
|
||||
verify: '--strict --tags ~@stress --tags ~@todo --tags ~@mld-only -f progress --require features/support --require features/step_definitions',
|
||||
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
||||
all: '--strict --require features/support --require features/step_definitions',
|
||||
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions -f progress'
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+15
-45
@@ -1,49 +1,19 @@
|
||||
FROM debian:stretch-slim as builder
|
||||
ARG DOCKER_TAG
|
||||
ARG BUILD_CONCURRENCY
|
||||
RUN mkdir -p /src && mkdir -p /opt
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
FROM ubuntu:14.04
|
||||
|
||||
RUN NPROC=${BUILD_CONCURRENCY:-$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)} && \
|
||||
apt-get update && \
|
||||
apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libxml2-dev \
|
||||
libzip-dev libboost1.62-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 && \
|
||||
echo "Building OSRM ${DOCKER_TAG}" && \
|
||||
git show --format="%H" | head -n1 > /opt/OSRM_GITSHA && \
|
||||
echo "Building OSRM gitsha $(cat /opt/OSRM_GITSHA)" && \
|
||||
mkdir -p build && \
|
||||
cd build && \
|
||||
BUILD_TYPE="Release" && \
|
||||
ENABLE_ASSERTIONS="Off" && \
|
||||
BUILD_TOOLS="Off" && \
|
||||
case ${DOCKER_TAG} in *"-debug"*) BUILD_TYPE="Debug";; esac && \
|
||||
case ${DOCKER_TAG} in *"-assertions"*) BUILD_TYPE="RelWithDebInfo" && ENABLE_ASSERTIONS="On" && BUILD_TOOLS="On";; esac && \
|
||||
echo "Building ${BUILD_TYPE} with ENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} BUILD_TOOLS=${BUILD_TOOLS}" && \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} -DBUILD_TOOLS=${BUILD_TOOLS} -DENABLE_LTO=On && \
|
||||
make -j${NPROC} install && \
|
||||
cd ../profiles && \
|
||||
cp -r * /opt && \
|
||||
strip /usr/local/bin/* && \
|
||||
rm -rf /src /usr/local/lib/libosrm*
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y build-essential git-core python-pip python-software-properties software-properties-common
|
||||
|
||||
RUN apt-get -y install gcc-4.8 g++-4.8 libboost1.55-all-dev llvm-3.4
|
||||
RUN apt-get -y install libbz2-dev libstxxl-dev libstxxl1 libxml2-dev
|
||||
RUN apt-get -y install libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev ruby1.9
|
||||
RUN apt-get -y install curl cmake cmake-curses-gui
|
||||
|
||||
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
|
||||
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
|
||||
FROM debian:stretch-slim as runstage
|
||||
RUN mkdir -p /src && mkdir -p /opt
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends libboost-program-options1.62.0 libboost-regex1.62.0 \
|
||||
libboost-date-time1.62.0 libboost-chrono1.62.0 libboost-filesystem1.62.0 \
|
||||
libboost-iostreams1.62.0 libboost-thread1.62.0 expat liblua5.2-0 libtbb2 &&\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=builder /usr/local /usr/local
|
||||
COPY --from=builder /opt /opt
|
||||
RUN /usr/local/bin/osrm-extract --help && \
|
||||
/usr/local/bin/osrm-routed --help && \
|
||||
/usr/local/bin/osrm-contract --help && \
|
||||
/usr/local/bin/osrm-partition --help && \
|
||||
/usr/local/bin/osrm-customize --help
|
||||
WORKDIR /opt
|
||||
RUN pip install awscli
|
||||
|
||||
EXPOSE 5000
|
||||
# luabind
|
||||
RUN curl https://gist.githubusercontent.com/DennisOSRM/f2eb7b948e6fe1ae319e/raw/install-luabind.sh | sudo bash
|
||||
|
||||
RUN useradd -ms /bin/bash mapbox
|
||||
USER mapbox
|
||||
ENV HOME /home/mapbox
|
||||
WORKDIR /home/mapbox
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Docker based continious integration
|
||||
|
||||
Run ```./docker/build-image.sh``` to build a docker image.
|
||||
The image contains all the build dependencies and the state of the local git repository.
|
||||
|
||||
Run ```./docker/run-gcc.sh``` to build OSRM with g++ and run all tests.
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
docker build \
|
||||
-t mapbox/osrm:linux \
|
||||
docker/
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# We've placed the Dockerfile under docker/ so that the generically named
|
||||
# hooks/ directory doesn't pollute the main directory. Because we need to
|
||||
# COPY the source into the container, we need to use some -f gymnastics to
|
||||
# ensure that "COPY . /src" is referring to the repo root, not the directory
|
||||
# that contains the Dockerfile.
|
||||
# This script gets executed with a pwd of wherever the Dockerfile is.
|
||||
docker build --build-arg BUILD_CONCURRENCY=${CONCURRENCY:-1} --build-arg DOCKER_TAG=${DOCKER_TAG} -t $IMAGE_NAME -f Dockerfile ..
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
docker run \
|
||||
-i \
|
||||
-e "CXX=clang++" \
|
||||
-v `pwd`:/home/mapbox/osrm-backend \
|
||||
-t mapbox/osrm:linux \
|
||||
osrm-backend/docker/test.sh
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
docker run \
|
||||
-i \
|
||||
-e "CXX=g++" \
|
||||
-v `pwd`:/home/mapbox/osrm-backend \
|
||||
-t mapbox/osrm:linux \
|
||||
osrm-backend/docker/test.sh
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
export CMAKEOPTIONS="-DCMAKE_BUILD_TYPE=Release"
|
||||
export PATH=$PATH:/home/mapbox/.gem/ruby/1.9.1/bin:/home/mapbox/osrm-backend/vendor/bundle/ruby/1.9.1/bin
|
||||
|
||||
cd /home/mapbox/osrm-backend
|
||||
gem install --user-install bundler
|
||||
bundle install --path vendor/bundle
|
||||
[ -d build ] && rm -rf build
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. $CMAKEOPTIONS -DBUILD_TOOLS=1
|
||||
|
||||
make -j`nproc`
|
||||
make tests -j`nproc`
|
||||
./datastructure-tests
|
||||
./algorithm-tests
|
||||
cd ..
|
||||
bundle exec cucumber -p verify
|
||||
@@ -1,62 +0,0 @@
|
||||
# Developing / Debugging guidance code
|
||||
|
||||
When changing guidance code, it is easy to introduce problems somewhere in the network.
|
||||
To get a better feeling of how your changes impact the OSRM experience, we offer ways of generating geojson output to inspect (e.g. with Mapbox Studio).
|
||||
When you do changes, make sure to inspect a few areas for the impact of the changes.
|
||||
|
||||
## How to use GeoJson-Debugging
|
||||
|
||||
This is a short guide to describe usage of our GeoJson debug logging mechanism. It is synchronized to guarantee thread-safe logging.
|
||||
|
||||
## Outputting into a single file
|
||||
To use it, the inclusion of `geojson_debug_logger.hpp` `geojson_debug_policies.hpp` from the `util` directory is required.
|
||||
|
||||
Geojson debugging requires a few simple steps to output data into a feature collection.
|
||||
|
||||
- Create a Scoped Guard that lives through the process and provide it with all required datastructures (it needs to span the lifetime of all your logging efforts)
|
||||
- At the location of the output, simply call Write with your own parameters.
|
||||
|
||||
A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we provide a way of printing out node-ids as coordinates.
|
||||
|
||||
The initialisation to do so looks like this:
|
||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
||||
Make sure to give the guard a name, so it actually gets a lifetime.
|
||||
|
||||
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
|
||||
|
||||
The policy itself offers a `operator()` accepting a `vector` of `NodeID`.
|
||||
|
||||
For outputting data into our file (debug.geojson), we simply need to call the matching logging routine of the guard: `util::ScioedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);`
|
||||
(or `guard.Write(list_of_node_ids)` if you created an instance).
|
||||
|
||||
### Possible Scopeguard Location
|
||||
Think of the scopeguard as you would do of any reference. If you wan't to access to logging during a call, the guard object must be alive and valid.
|
||||
|
||||
As an example: a good location to create the a scopeguard to log decisions in the edge-based-graph-factory would be right before we run it ([here](https://github.com/Project-OSRM/osrm-backend/blob/a933b5d94943bf3edaf42c84a614a99650d23cba/src/extractor/extractor.cpp#L497)). If you put `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", node_coordinate_vector);` at that location, you can then print `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);` anywhere within the `edge-based-graph-factory`.
|
||||
|
||||
This location would enable call for all guidance related pre-processing which is called in the edge-based-graph-factory.
|
||||
Logging any turn-handler decisions, for example, would now be possible.
|
||||
|
||||
## Limitations
|
||||
GeoJson debugging requires a single GeoJsonGuard (ScopedGeojsonLoggerGuard) for each desired output file.
|
||||
For each set of template parameters, only the most recent guard will actually produce output.
|
||||
|
||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
||||
|
||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug-2.geojson", data-for-conversion);`
|
||||
|
||||
Will not provide a way to write into two files, but only `debug-2` will actually contain features.
|
||||
|
||||
We cannot nest-these calls.
|
||||
|
||||
If we want to use the same policy for multiple files, we need to use different template parameters both for the logger and the guard.
|
||||
|
||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString,0> geojson_guard( "debug.geojson", data-for-conversion);`
|
||||
|
||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString,1> geojson_guard( "debug-2.geojson", data-for-conversion);`
|
||||
|
||||
as well as,
|
||||
|
||||
`util::ScopedGeojsonLoggerGuardr<util::NodeIdVectorToLineString,0>::Write(list_of_node_ids);`
|
||||
|
||||
`util::ScopedGeojsonLoggerGuardr<util::NodeIdVectorToLineString,1>::Write(list_of_node_ids);`
|
||||
-1124
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 694 KiB |
@@ -1,33 +0,0 @@
|
||||
## Introduction
|
||||
|
||||
OSRM can be used as a library (libosrm) via C++ instead of using it through the HTTP interface and `osrm-routed`. This allows for fine-tuning OSRM and has much less overhead. Here is a quick introduction into how to use `libosrm` in the upcoming v5 release.
|
||||
|
||||
Take a look at the example code that lives in the [example directory](https://github.com/Project-OSRM/osrm-backend/tree/master/example). Here is all you ever wanted to know about `libosrm`, that is a short description of what the types do and where to find documentation on it:
|
||||
|
||||
## Important interface objects
|
||||
|
||||
- [`EngineConfig`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/engine_config.hpp) - for initializing an OSRM instance we can configure certain properties and constraints. E.g. the storage config is the base path such as `france.osm.osrm` from which we derive and load `france.osm.osrm.*` auxiliary files. This also lets you set constraints such as the maximum number of locations allowed for specific services.
|
||||
|
||||
- [`OSRM`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/osrm/osrm.hpp) - this is the main Routing Machine type with functions such as `Route` and `Table`. You initialize it with a `EngineConfig`. It does all the heavy lifting for you. Each function takes its own parameters, e.g. the `Route` function takes `RouteParameters`, and a out-reference to a JSON result that gets filled. The return value is a `Status`, indicating error or success.
|
||||
|
||||
- [`Status`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/status.hpp) - this is a type wrapping `Error` or `Ok` for indicating error or success, respectively.
|
||||
|
||||
- [`TableParameters`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/api/table_parameters.hpp) - this is an example of parameter types the Routing Machine functions expect. In this case `Table` expects its own parameters as `TableParameters`. You can see it wrapping two vectors, sources and destinations --- these are indices into your coordinates for the table service to construct a matrix from (empty sources or destinations means: use all of them). If you ask yourself where coordinates come from, you can see `TableParameters` inheriting from `BaseParameters`.
|
||||
|
||||
- [`BaseParameter`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/api/base_parameters.hpp) - this most importantly holds coordinates (and a few other optional properties that you don't need for basic usage); the specific parameter types inherit from `BaseParameters` to get these member attributes. That means your `TableParameters` type has `coordinates`, `sources` and `destination` member attributes (and a few other that we ignore for now).
|
||||
|
||||
- [`Coordinate`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/coordinate.hpp) - this is a wrapper around a (longitude, latitude) pair. We really don't care about (lon,lat) vs (lat, lon) but we don't want you to accidentally mix them up, so both latitude and longitude are strictly typed wrappers around integers (fixed notation such as `13423240`) and floating points (floating notation such as `13.42324`).
|
||||
|
||||
- [Parameters for other services](https://github.com/Project-OSRM/osrm-backend/tree/master/include/engine/api) - here are all other `*Parameters` you need for other Routing Machine services.
|
||||
|
||||
- [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [HTTP API](#http-api).
|
||||
|
||||
## Example
|
||||
|
||||
See [the example folder](https://github.com/Project-OSRM/osrm-backend/tree/master/example) in the OSRM repository.
|
||||
|
||||
## Workflow
|
||||
|
||||
- Create an `OSRM` instance initialized with a `EngineConfig`
|
||||
- Call the service function on the `OSRM` object providing service specific `*Parameters`
|
||||
- Check the return code and use the JSON result
|
||||
@@ -1,389 +0,0 @@
|
||||
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
||||
|
||||
## OSRM
|
||||
|
||||
The `OSRM` method is the main constructor for creating an OSRM instance.
|
||||
An OSRM instance requires a `.osrm` dataset, which is prepared by the OSRM toolchain.
|
||||
You can create such a `.osrm` file by running the OSRM binaries we ship in `node_modules/osrm/lib/binding/` and default
|
||||
profiles (e.g. for setting speeds and determining road types to route on) in `node_modules/osrm/profiles/`:
|
||||
|
||||
node_modules/osrm/lib/binding/osrm-extract data.osm.pbf -p node_modules/osrm/profiles/car.lua
|
||||
node_modules/osrm/lib/binding/osrm-contract data.osrm
|
||||
|
||||
Consult the [osrm-backend](https://github.com/Project-OSRM/osrm-backend) documentation for further details.
|
||||
|
||||
Once you have a complete `network.osrm` file, you can calculate routes in javascript with this object.
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** Options for creating an OSRM object or string to the `.osrm` file. (optional, default `{shared_memory:true}`)
|
||||
- `options.algorithm` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The algorithm to use for routing. Can be 'CH', 'CoreCH' or 'MLD'. Default is 'CH'.
|
||||
Make sure you prepared the dataset with the correct toolchain.
|
||||
- `options.shared_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Connects to the persistent shared memory datastore.
|
||||
This requires you to run `osrm-datastore` prior to creating an `OSRM` object.
|
||||
- `options.dataset_name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Connects to the persistent shared memory datastore defined by `--dataset_name` option when running `osrm-datastore`
|
||||
This requires you to run `osrm-datastore --dataset_name` prior to creating an `OSRM` object.
|
||||
- `options.memory_file` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** *DEPRECATED*
|
||||
Old behaviour: Path to a file on disk to store the memory using mmap. Current behaviour: setting this value is the same as setting `mmap_memory: true`.
|
||||
- `options.mmap_memory` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Map on-disk files to virtual memory addresses (mmap), rather than loading into RAM.
|
||||
- `options.path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The path to the `.osrm` files. This is mutually exclusive with setting {options.shared_memory} to true.
|
||||
- `options.max_locations_trip` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in trip query (default: unlimited).
|
||||
- `options.max_locations_viaroute` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in viaroute query (default: unlimited).
|
||||
- `options.max_locations_distance_table` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in distance table query (default: unlimited).
|
||||
- `options.max_locations_map_matching` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. locations supported in map-matching query (default: unlimited).
|
||||
- `options.max_results_nearest` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max. results supported in nearest query (default: unlimited).
|
||||
- `options.max_alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Max.number of alternatives supported in alternative routes query (default: 3).
|
||||
|
||||
### route
|
||||
|
||||
Returns the fastest route between two or more coordinates while visiting the waypoints in order.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the route query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.alternatives` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes. (optional, default `false`)
|
||||
- `options.alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Search for up to this many alternative routes.
|
||||
_Please note that even if alternative routes are requested, a result cannot be guaranteed._ (optional, default `0`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route leg. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.continue_straight` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.waypoints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Indices to coordinates to treat as waypoints. If not supplied, all coordinates are waypoints. Must include first and last coordinate index.
|
||||
`null`/`true`/`false`
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM("berlin-latest.osrm");
|
||||
osrm.route({coordinates: [[13.438640,52.519930], [13.415852,52.513191]]}, function(err, result) {
|
||||
if(err) throw err;
|
||||
console.log(result.waypoints); // array of Waypoint objects representing all waypoints in order
|
||||
console.log(result.routes); // array of Route objects ordered by descending recommendation rank
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** An array of [Waypoint](#waypoint) objects representing all waypoints in order AND an array of [`Route`](#route) objects ordered by descending recommendation rank.
|
||||
|
||||
### nearest
|
||||
|
||||
Snaps a coordinate to the street network and returns the nearest n matches.
|
||||
|
||||
Note: `coordinates` in the general options only supports a single `{longitude},{latitude}` entry.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the nearest query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.number` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of nearest segments that should be returned.
|
||||
Must be an integer greater than or equal to `1`. (optional, default `1`)
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [[13.388860,52.517037]],
|
||||
number: 3,
|
||||
bearings: [[0,20]]
|
||||
};
|
||||
osrm.nearest(options, function(err, response) {
|
||||
console.log(response.waypoints); // array of Waypoint objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints`.
|
||||
**`waypoints`**: array of [`Ẁaypoint`](#waypoint) objects sorted by distance to the input coordinate.
|
||||
Each object has an additional `distance` property, which is the distance in meters to the supplied input coordinate.
|
||||
|
||||
### table
|
||||
|
||||
Computes duration table for the given locations. Allows for both symmetric and asymmetric
|
||||
tables. Optionally returns distance table.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the table query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.sources` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer < #coordinates`) to
|
||||
use
|
||||
location with given index as source. Default is to use all.
|
||||
- `options.destinations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer <
|
||||
#coordinates`) to use location with given index as destination. Default is to use all.
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.fallback_speed` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Replace `null` responses in result with as-the-crow-flies estimates based on `fallback_speed`. Value is in metres/second.
|
||||
- `options.fallback_coordinate` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Either `input` (default) or `snapped`. If using a `fallback_speed`, use either the user-supplied coordinate (`input`), or the snapped coordinate (`snapped`) for calculating the as-the-crow-flies diestance between two points.
|
||||
- `options.scale_factor` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Multiply the table duration values in the table by this number for more controlled input into a route optimization solver.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `options.annotations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Return the requested table or tables in response. Can be `['duration']` (return the duration matrix, default) or `['duration', distance']` (return both the duration matrix and the distance matrix).
|
||||
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [
|
||||
[13.388860,52.517037],
|
||||
[13.397634,52.529407],
|
||||
[13.428555,52.523219]
|
||||
]
|
||||
};
|
||||
osrm.table(options, function(err, response) {
|
||||
console.log(response.durations); // array of arrays, matrix in row-major order
|
||||
console.log(response.sources); // array of Waypoint objects
|
||||
console.log(response.destinations); // array of Waypoint objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `durations`, `sources`, and `destinations`.
|
||||
**`durations`**: array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from the i-th waypoint to the j-th waypoint.
|
||||
Values are given in seconds.
|
||||
**`sources`**: array of [`Ẁaypoint`](#waypoint) objects describing all sources in order.
|
||||
**`destinations`**: array of [`Ẁaypoint`](#waypoint) objects describing all destinations in order.
|
||||
**`fallback_speed_cells`**: (optional) if `fallback_speed` is used, will be an array of arrays of `row,column` values, indicating which cells contain estimated values.
|
||||
|
||||
### tile
|
||||
|
||||
This generates [Mapbox Vector Tiles](https://mapbox.com/vector-tiles) that can be viewed with a
|
||||
vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can
|
||||
be used to examine the routing graph. The tiles are generated directly from the data in-memory,
|
||||
so are in sync with actual routing results, and let you examine which roads are actually
|
||||
routable,
|
||||
and what weights they have applied.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `ZXY` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** an array consisting of `x`, `y`, and `z` values representing tile coordinates like
|
||||
[wiki.openstreetmap.org/wiki/Slippy_map_tilenames](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames)
|
||||
and are supported by vector tile viewers like [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/).
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
osrm.tile([0, 0, 0], function(err, response) {
|
||||
if (err) throw err;
|
||||
fs.writeFileSync('./tile.vector.pbf', response); // write the buffer to a file
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Buffer](https://nodejs.org/api/buffer.html)** contains a Protocol Buffer encoded vector tile.
|
||||
|
||||
### match
|
||||
|
||||
Map matching matches given GPS points to the road network in the most plausible way.
|
||||
Please note the request might result multiple sub-traces. Large jumps in the timestamps
|
||||
(>60s) or improbable transitions lead to trace splits if a complete matching could
|
||||
not be found. The algorithm might not be able to match all points. Outliers are removed
|
||||
if they can not be matched successfully.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the match query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.timestamps` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>?** Timestamp of the input location (integers, UNIX-like timestamp).
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy. Can be `null` for default value `5` meters or `double >= 0`.
|
||||
- `options.gaps` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Allows the input track splitting based on huge timestamp gaps between points. Either `split` or `ignore` (optional, default `split`).
|
||||
- `options.tidy` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Allows the input track modification to obtain better matching quality for noisy tracks (optional, default `false`).
|
||||
- `options.waypoints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Indices to coordinates to treat as waypoints. If not supplied, all coordinates are waypoints. Must include first and last coordinate index.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [[13.393252,52.542648],[13.39478,52.543079],[13.397389,52.542107]],
|
||||
timestamps: [1424684612, 1424684616, 1424684620]
|
||||
};
|
||||
osrm.match(options, function(err, response) {
|
||||
if (err) throw err;
|
||||
console.log(response.tracepoints); // array of Waypoint objects
|
||||
console.log(response.matchings); // array of Route objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `tracepoints` and `matchings`.
|
||||
**`tracepoints`** Array of [`Ẁaypoint`](#waypoint) objects representing all points of the trace in order.
|
||||
If the trace point was ommited by map matching because it is an outlier, the entry will be null.
|
||||
Each `Waypoint` object includes two additional properties, 1) `matchings_index`: Index to the
|
||||
[`Route`](#route) object in matchings the sub-trace was matched to, 2) `waypoint_index`: Index of
|
||||
the waypoint inside the matched route.
|
||||
**`matchings`** is an array of [`Route`](#route) objects that assemble the trace. Each `Route` object has an additional `confidence` property,
|
||||
which is the confidence of the matching. float value between `0` and `1`. `1` is very confident that the matching is correct.
|
||||
|
||||
### trip
|
||||
|
||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic
|
||||
(farthest-insertion algorithm) for 10 or _ more waypoints and uses brute force for less than 10
|
||||
waypoints. The returned path does not have to be the shortest path, _ as TSP is NP-hard it is
|
||||
only an approximation.
|
||||
|
||||
Note that all input coordinates have to be connected for the trip service to work.
|
||||
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
|
||||
Right now, the following combinations are possible:
|
||||
|
||||
| roundtrip | source | destination | supported |
|
||||
| :-------- | :----- | :---------- | :-------- |
|
||||
| true | first | last | **yes** |
|
||||
| true | first | any | **yes** |
|
||||
| true | any | last | **yes** |
|
||||
| true | any | any | **yes** |
|
||||
| false | first | last | **yes** |
|
||||
| false | first | any | no |
|
||||
| false | any | last | no |
|
||||
| false | any | any | no |
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||
- `options.coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The coordinates this request will use, coordinates as `[{lon},{lat}]` values, in decimal degrees.
|
||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `double >= 0` or `null` (unlimited, default).
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
|
||||
- `options.roundtrip` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route is a roundtrip. (optional, default `true`)
|
||||
- `options.source` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route starts at `any` or `first` coordinate. (optional, default `any`)
|
||||
- `options.destination` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Return route ends at `any` or `last` coordinate. (optional, default `any`)
|
||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
- `options.snapping` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Which edges can be snapped to, either `default`, or `any`. `default` only snaps to edges marked by the profile as `is_startpoint`, `any` will allow snapping to any edge in the routing graph.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [
|
||||
[13.36761474609375, 52.51663871100423],
|
||||
[13.374481201171875, 52.506191342034576]
|
||||
],
|
||||
source: "first",
|
||||
destination: "last",
|
||||
roundtrip: false
|
||||
}
|
||||
osrm.trip(options, function(err, response) {
|
||||
if (err) throw err;
|
||||
console.log(response.waypoints); // array of Waypoint objects
|
||||
console.log(response.trips); // array of Route objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints` and `trips`.
|
||||
**`waypoints`**: an array of [`Waypoint`](#waypoint) objects representing all waypoints in input order.
|
||||
Each Waypoint object has the following additional properties,
|
||||
1) `trips_index`: index to trips of the sub-trip the point was matched to, and
|
||||
2) `waypoint_index`: index of the point in the trip.
|
||||
**`trips`**: an array of [`Route`](#route) objects that assemble the trace.
|
||||
|
||||
## Plugin behaviour
|
||||
|
||||
All plugins support a second additional object that is available to configure some NodeJS specific behaviours.
|
||||
|
||||
- `plugin_config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||
- `plugin_config.format` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The format of the result object to various API calls. Valid options are `object` (default), which returns a standard Javascript object, as described above, and `json_buffer`, which will return a NodeJS **[Buffer](https://nodejs.org/api/buffer.html)** object, containing a JSON string. The latter has the advantage that it can be immediately serialized to disk/sent over the network, and the generation of the string is performed outside the main NodeJS event loop. This option is ignored by the `tile` plugin.
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [
|
||||
[13.36761474609375, 52.51663871100423],
|
||||
[13.374481201171875, 52.506191342034576]
|
||||
]
|
||||
};
|
||||
osrm.route(options, { format: "json_buffer" }, function(err, response) {
|
||||
if (err) throw err;
|
||||
console.log(response.toString("utf-8"));
|
||||
});
|
||||
```
|
||||
|
||||
## Responses
|
||||
|
||||
### Route
|
||||
|
||||
Represents a route through (potentially multiple) waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#route-object)
|
||||
|
||||
### RouteLeg
|
||||
|
||||
Represents a route between two waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#routeleg-object)
|
||||
|
||||
### RouteStep
|
||||
|
||||
A step consists of a maneuver such as a turn or merge, followed by a distance of travel along a
|
||||
single way to the subsequent step.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#routestep-object)
|
||||
|
||||
### StepManeuver
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#stepmaneuver-object)
|
||||
|
||||
### Waypoint
|
||||
|
||||
Object used to describe waypoint on a route.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **documentation** in
|
||||
[`osrm-backend`](../http.md#waypoint-object)
|
||||
@@ -1,86 +0,0 @@
|
||||
# Releasing
|
||||
|
||||
Releasing a new version of `node-osrm` is mostly automated using Travis CI.
|
||||
|
||||
The version of `node-osrm` is locked to the same version as `osrm-backend`. Every `node-osrm` should have a `osrm-backend` release of the same version. Of course, only release a `node-osrm` after the release has been tagged in `osrm-backend`.
|
||||
|
||||
These steps all happen on `master`. After the release is out, create a branch using the MAJOR.MINOR version of the release to document code changes made for that version.
|
||||
|
||||
### Steps to release
|
||||
|
||||
1. Update the `osrm_release` field in `package.json` to the corresonding git tag in `osrm-backend.`
|
||||
|
||||
Confirm the desired OSRM branch and commit to `master`.
|
||||
|
||||
1. Bump node-osrm version
|
||||
|
||||
Update the `CHANGELOG.md` and the `package.json` version if needed.
|
||||
|
||||
1. Check that Travis CI [builds are passing](https://travis-ci.org/Project-OSRM/node-osrm) for the latest commit on `master`.
|
||||
|
||||
1. Publishing binaries
|
||||
|
||||
If travis builds are passing then it's time to publish binaries by committing with a message containing `[publish binary]`. Use an empty commit for this.
|
||||
|
||||
```
|
||||
git commit --allow-empty -m "[publish binary] vMAJOR.MINOR.PATCH"
|
||||
```
|
||||
|
||||
1. Test
|
||||
|
||||
Locally you can now test binaries. Cleanup, re-install, and run the tests like:
|
||||
|
||||
```
|
||||
make clean
|
||||
npm install # will pull remote binaries
|
||||
npm ls # confirm deps are correct
|
||||
make test
|
||||
```
|
||||
|
||||
1. Tag
|
||||
|
||||
Once binaries are published for Linux and OS X then its time to tag a new release and add the changelog to the tag:
|
||||
|
||||
```
|
||||
git tag vMAJOR.MINOR.PATCH -a
|
||||
git push --tags
|
||||
```
|
||||
|
||||
1. Publish node-osrm. **we only do this for stable releases**
|
||||
|
||||
First ensure your local `node-pre-gyp` is up to date:
|
||||
|
||||
```
|
||||
npm ls
|
||||
```
|
||||
|
||||
This is important because it is bundled during packaging.
|
||||
|
||||
If you see any errors then do:
|
||||
|
||||
```
|
||||
rm -rf node_modules/node-pre-gyp
|
||||
npm install node-pre-gyp
|
||||
```
|
||||
|
||||
Now we're ready to publish `node-osrm` to <https://www.npmjs.org/package/osrm>:
|
||||
|
||||
```
|
||||
npm publish
|
||||
```
|
||||
|
||||
Dependent apps can now pull from the npm registry like:
|
||||
|
||||
```
|
||||
"dependencies": {
|
||||
"osrm": "^MAJOR.MINOR.PATCH"
|
||||
}
|
||||
```
|
||||
|
||||
Or can still pull from the github tag like:
|
||||
|
||||
```
|
||||
"dependencies": {
|
||||
"osrm": "https://github.com/Project-OSRM/node-osrm/archive/vMAJOR.MINOR.PATCH.tar.gz"
|
||||
}
|
||||
```
|
||||
@@ -1,377 +0,0 @@
|
||||
# OSRM profiles
|
||||
OSRM supports "profiles". Profiles representing routing behavior for different transport modes like car, bike and foot. You can also create profiles for variations like a fastest/shortest car profile or fastest/safest/greenest bicycles profile.
|
||||
|
||||
A profile describes whether or not it's possible to route along a particular type of way, whether we can pass a particular node, and how quickly we'll be traveling when we do. This feeds into the way the routing graph is created and thus influences the output routes.
|
||||
|
||||
## Available profiles
|
||||
Out-of-the-box OSRM comes with profiles for car, bicycle and foot. You can easily modify these or create new ones if you like.
|
||||
|
||||
Profiles have a 'lua' extension, and are placed in 'profiles' directory.
|
||||
|
||||
When running OSRM preprocessing commands you specify the profile with the --profile (or the shorthand -p) option, for example:
|
||||
|
||||
`osrm-extract --profile ../profiles/car.lua planet-latest.osm.pbf`
|
||||
|
||||
## Processing flow
|
||||
It's important to understand that profiles are used when preprocessing the OSM data, NOT at query time when routes are computed.
|
||||
|
||||
This means that after modifying a profile **you will need to extract, contract and reload the data again** and to see changes in the routing results. See [Processing Flow](https://github.com/Project-OSRM/osrm-backend/wiki/Processing-Flow) for more.
|
||||
|
||||
## Profiles are written in Lua
|
||||
Profiles are not just configuration files. They are scripts written in the [Lua scripting language](http://www.lua.org). The reason for this is that OpenStreetMap data is complex, and it's not possible to simply define tag mappings. Lua scripting offers a powerful way to handle all the possible tag combinations found in OpenStreetMap nodes and ways.
|
||||
|
||||
## Basic structure of profiles
|
||||
A profile will process every node and way in the OSM input data to determine what ways are routable in which direction, at what speed, etc.
|
||||
|
||||
A profile will typically:
|
||||
|
||||
- Define api version (required)
|
||||
- Require library files (optional)
|
||||
- Define setup function (required)
|
||||
- Define process functions (some are required)
|
||||
- Return functions table (required)
|
||||
|
||||
A profile can also define various local functions it needs.
|
||||
|
||||
Looking at [car.lua](../profiles/car.lua) as an example, at the top of the file the api version is defined and then required library files are included.
|
||||
|
||||
Then follows the `setup` function, which is called once when the profile is loaded. It returns a big hash table of configurations, specifying things like what speed to use for different way types. The configurations are used later in the various processing functions. Many adjustments can be done just by modifying this configuration table.
|
||||
|
||||
The setup function is also where you can do other setup, like loading an elevation data source if you want to consider that when processing ways.
|
||||
|
||||
Then come the `process_node` and `process_way` functions, which are called for each OSM node and way when extracting OpenStreetMap data with `osrm-extract`.
|
||||
|
||||
The `process_turn` function processes every possible turn in the network, and sets a penalty depending on the angle and turn of the movement.
|
||||
|
||||
Profiles can also define a `process_segment` function to handle differences in speed along an OSM way, for example to handle elevation. As you can see, this is not currently used in the car profile.
|
||||
|
||||
At the end of the file, a table is returned with references to the setup and processing functions the profile has defined.
|
||||
|
||||
## Understanding speed, weight and rate
|
||||
When computing a route from A to B there can be different measures of what is the best route. That's why there's a need for different profiles.
|
||||
|
||||
Because speeds vary on different types of roads, the shortest and the fastest route are typically different. But there are many other possible preferences. For example a user might prefer a bicycle route that follow parks or other green areas, even though both duration and distance are a bit longer.
|
||||
|
||||
To handle this, OSRM doesn't simply choose the ways with the highest speed. Instead it uses the concepts of `weight` and `rate`. The rate is an abstract measure that you can assign to ways as you like to make some ways preferable to others. Routing will prefer ways with high rate.
|
||||
|
||||
The weight of a way is normally computed as length / rate. The weight can be thought of as the resistance or cost when passing the way. Routing will prefer ways with low weight.
|
||||
|
||||
You can also set the weight of a way to a fixed value. In this case it's not calculated based on the length or rate, and the rate is ignored.
|
||||
|
||||
You should set the speed to your best estimate of the actual speed that will be used on a particular way. This will result in the best estimated travel times.
|
||||
|
||||
If you want to prefer certain ways due to other factors than the speed, adjust the rate accordingly. If you adjust the speed, the time estimation will be skewed.
|
||||
|
||||
If you set the same rate on all ways, the result will be shortest path routing.
|
||||
If you set rate = speed on all ways, the result will be fastest path routing.
|
||||
If you want to prioritize certain streets, increase the rate on these.
|
||||
|
||||
## Elements
|
||||
### api_version
|
||||
A profile should set `api_version` at the top of your profile. This is done to ensure that older profiles are still supported when the api changes. If `api_version` is not defined, 0 will be assumed. The current api version is 4.
|
||||
|
||||
### Library files
|
||||
The folder [profiles/lib/](../profiles/lib/) contains LUA library files for handling many common processing tasks.
|
||||
|
||||
File | Notes
|
||||
------------------|------------------------------
|
||||
way_handlers.lua | Functions for processing way tags
|
||||
tags.lua | Functions for general parsing of OSM tags
|
||||
set.lua | Defines the Set helper for handling sets of values
|
||||
sequence.lua | Defines the Sequence helper for handling sequences of values
|
||||
access.lua | Function for finding relevant access tags
|
||||
destination.lua | Function for finding relevant destination tags
|
||||
maxspeed.lua | Function for determining maximum speed
|
||||
guidance.lua | Function for processing guidance attributes
|
||||
|
||||
They all return a table of functions when you use `require` to load them. You can either store this table and reference its functions later, or if you need only a single function you can store that directly.
|
||||
|
||||
### setup()
|
||||
The `setup` function is called once when the profile is loaded and must return a table of configurations. It's also where you can do other global setup, like loading data sources that are used during processing.
|
||||
|
||||
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA interpreter will have its own set of globals.
|
||||
|
||||
The following global properties can be set under `properties` in the hash you return in the `setup` function:
|
||||
|
||||
Attribute | Type | Notes
|
||||
-------------------------------------|----------|----------------------------------------------------------------------------
|
||||
weight_name | String | Name used in output for the routing weight property (default `'duration'`)
|
||||
weight_precision | Unsigned | Decimal precision of edge weights (default `1`)
|
||||
left_hand_driving | Boolean | Are vehicles assumed to drive on the left? (used in guidance, default `false`)
|
||||
use_turn_restrictions | Boolean | Are turn restrictions followed? (default `false`)
|
||||
continue_straight_at_waypoint | Boolean | Must the route continue straight on at a via point, or are U-turns allowed? (default `true`)
|
||||
max_speed_for_map_matching | Float | Maximum vehicle speed to be assumed in matching (in m/s)
|
||||
max_turn_weight | Float | Maximum turn penalty weight
|
||||
force_split_edges | Boolean | True value forces a split of forward and backward edges of extracted ways and guarantees that `process_segment` will be called for all segments (default `false`)
|
||||
|
||||
|
||||
The following additional global properties can be set in the hash you return in the `setup` function:
|
||||
|
||||
Attribute | Type | Notes
|
||||
-------------------------------------|------------------|----------------------------------------------------------------------------
|
||||
excludable | Sequence of Sets | Determines which class-combinations are supported by the `exclude` option at query time. E.g. `Sequence{Set{"ferry", "motorway"}, Set{"motorway"}}` will allow you to exclude ferries and motorways, or only motorways.
|
||||
classes | Sequence | Determines the allowed classes that can be referenced using `{forward,backward}_classes` on the way in the `process_way` function.
|
||||
restrictions | Sequence | Determines which turn restrictions will be used for this profile.
|
||||
suffix_list | Set | List of name suffixes needed for determining if "Highway 101 NW" the same road as "Highway 101 ES".
|
||||
relation_types | Sequence | Determines wich relations should be cached for processing in this profile. It contains relations types
|
||||
|
||||
### process_node(profile, node, result, relations)
|
||||
Process an OSM node to determine whether this node is a barrier or can be passed and whether passing it incurs a delay.
|
||||
|
||||
Argument | Description
|
||||
---------|-------------------------------------------------------
|
||||
profile | The configuration table you returned in `setup`.
|
||||
node | The input node to process (read-only).
|
||||
result | The output that you will modify.
|
||||
relations| Storage of relations to access relations, where `node` is a member.
|
||||
|
||||
The following attributes can be set on `result`:
|
||||
|
||||
Attribute | Type | Notes
|
||||
----------------|---------|---------------------------------------------------------
|
||||
barrier | Boolean | Is it an impassable barrier?
|
||||
traffic_lights | Boolean | Is it a traffic light (incurs delay in `process_turn`)?
|
||||
|
||||
### process_way(profile, way, result, relations)
|
||||
Given an OpenStreetMap way, the `process_way` function will either return nothing (meaning we are not going to route over this way at all), or it will set up a result hash.
|
||||
|
||||
Argument | Description
|
||||
---------|-------------------------------------------------------
|
||||
profile | The configuration table you returned in `setup`.
|
||||
way | The input way to process (read-only).
|
||||
result | The output that you will modify.
|
||||
relations| Storage of relations to access relations, where `way` is a member.
|
||||
|
||||
Importantly it will set `result.forward_mode` and `result.backward_mode` to indicate the travel mode in each direction, as well as set `result.forward_speed` and `result.backward_speed` to integer values representing the speed for traversing the way.
|
||||
|
||||
It will also set a number of other attributes on `result`.
|
||||
|
||||
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the `process_way` function. Instead `process_way` will examine the tag set on the way, process this information in various ways, calling other local functions and referencing the configuration in `profile`, etc., before arriving at the result.
|
||||
|
||||
The following attributes can be set on the result in `process_way`:
|
||||
|
||||
Attribute | Type | Notes
|
||||
----------------------------------------|----------|--------------------------------------------------------------------------
|
||||
forward_speed | Float | Speed on this way in km/h. Mandatory.
|
||||
backward_speed | Float | ""
|
||||
forward_rate | Float | Routing weight, expressed as meters/*weight* (e.g. for a fastest-route weighting, you would want this to be meters/second, so set it to forward_speed/3.6)
|
||||
backward_rate | Float | ""
|
||||
forward_mode | Enum | Mode of travel (e.g. `car`, `ferry`). Mandatory. Defined in `include/extractor/travel_mode.hpp`.
|
||||
backward_mode | Enum | ""
|
||||
forward_classes | Table | Mark this way as being of a specific class, e.g. `result.classes["toll"] = true`. This will be exposed in the API as `classes` on each `RouteStep`.
|
||||
backward_classes | Table | ""
|
||||
duration | Float | Alternative setter for duration of the whole way in both directions
|
||||
weight | Float | Alternative setter for weight of the whole way in both directions
|
||||
turn_lanes_forward | String | Directions for individual lanes (normalized OSM `turn:lanes` value)
|
||||
turn_lanes_backward | String | ""
|
||||
forward_restricted | Boolean | Is this a restricted access road? (e.g. private, or deliveries only; used to enable high turn penalty, so that way is only chosen for start/end of route)
|
||||
backward_restricted | Boolean | ""
|
||||
is_startpoint | Boolean | Can a journey start on this way? (e.g. ferry; if `false`, prevents snapping the start point to this way)
|
||||
roundabout | Boolean | Is this part of a roundabout?
|
||||
circular | Boolean | Is this part of a non-roundabout circular junction?
|
||||
name | String | Name of the way
|
||||
ref | String | Road number (equal to set `forward_ref` and `backward_ref` with one value)
|
||||
forward_ref | String | Road number in forward way direction
|
||||
backward_ref | String | Road number in backward way direction
|
||||
destinations | String | The road's destinations
|
||||
exits | String | The ramp's exit numbers or names
|
||||
pronunciation | String | Name pronunciation
|
||||
road_classification.motorway_class | Boolean | Guidance: way is a motorway
|
||||
road_classification.link_class | Boolean | Guidance: way is a slip/link road
|
||||
road_classification.road_priority_class | Enum | Guidance: order in priority list. Defined in `include/extractor/road_classification.hpp`
|
||||
road_classification.may_be_ignored | Boolean | Guidance: way is non-highway
|
||||
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
|
||||
|
||||
### process_segment(profile, segment)
|
||||
The `process_segment` function is called for every segment of OSM ways. A segment is a straight line between two OSM nodes.
|
||||
|
||||
On OpenStreetMap way cannot have different tags on different parts of a way. Instead you would split the way into several smaller ways. However many ways are long. For example, many ways pass hills without any change in tags.
|
||||
|
||||
Processing each segment of an OSM way makes it possible to have different speeds on different parts of a way based on external data like data about elevation, pollution, noise or scenic value and adjust weight and duration of the segment accordingly.
|
||||
|
||||
In the `process_segment` function you don't have access to OSM tags. Instead you use the geographical location of the start and end point of the way to look up information from another data source, like elevation data. See [rasterbot.lua](../profiles/rasterbot.lua) for an example.
|
||||
|
||||
The following attributes can be read and set on the result in `process_segment`:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
-------------------|-------------|---------|----------------------------------------
|
||||
source.lon | Read | Float | Co-ordinates of segment start
|
||||
source.lat | Read | Float | ""
|
||||
target.lon | Read | Float | Co-ordinates of segment end
|
||||
target.lat | Read | Float | ""
|
||||
distance | Read | Float | Length of segment
|
||||
weight | Read/write | Float | Routing weight for this segment
|
||||
duration | Read/write | Float | Duration for this segment
|
||||
|
||||
### process_turn(profile, turn)
|
||||
The `process_turn` function is called for every possible turn in the network. Based on the angle and type of turn you assign the weight and duration of the movement.
|
||||
|
||||
The following attributes can be read and set on the result in `process_turn`:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
--------------------- | ------------- | --------- | ------------------------------------------------------
|
||||
angle | Read | Float | Angle of turn in degrees (`[-179, 180]`: `0`=straight, `180`=u turn, `+x`=x degrees to the right, `-x`= x degrees to the left)
|
||||
number_of_roads | Read | Integer | Number of ways at the intersection of the turn
|
||||
is_u_turn | Read | Boolean | Is the turn a u-turn?
|
||||
has_traffic_light | Read | Boolean | Is a traffic light present at this turn?
|
||||
is_left_hand_driving | Read | Boolean | Is left-hand traffic?
|
||||
source_restricted | Read | Boolean | Is it from a restricted access road? (See definition in `process_way`)
|
||||
source_mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||
source_is_motorway | Read | Boolean | Is the source road a motorway?
|
||||
source_is_link | Read | Boolean | Is the source road a link?
|
||||
source_number_of_lanes | Read | Integer | How many lanes does the source road have? (default when not tagged: 0)
|
||||
source_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
source_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
source_speed | Read | Integer | Speed on this source road in km/h
|
||||
source_priority_class | Read | Enum | The type of road priority class of the source. Defined in `include/extractor/road_classification.hpp`
|
||||
target_restricted | Read | Boolean | Is the target a restricted access road? (See definition in `process_way`)
|
||||
target_mode | Read | Enum | Travel mode after the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||
target_is_motorway | Read | Boolean | Is the target road a motorway?
|
||||
target_is_link | Read | Boolean | Is the target road a link?
|
||||
target_number_of_lanes | Read | Integer | How many lanes does the target road have? (default when not tagged: 0)
|
||||
target_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
target_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||
target_speed | Read | Integer | Speed on this target road in km/h
|
||||
target_priority_class | Read | Enum | The type of road priority class of the target. Defined in `include/extractor/road_classification.hpp`
|
||||
roads_on_the_right | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the right of the turn that are also connected at the intersection
|
||||
roads_on_the_left | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the left of the turn that are also connected at the intersection. If turn is a u turn, this is empty.
|
||||
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
||||
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
|
||||
|
||||
#### `roads_on_the_right` and `roads_on_the_left`
|
||||
|
||||
The information of `roads_on_the_right` and `roads_on_the_left` that can be read are as follows:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
--------------------- | ------------- | --------- | ------------------------------------------------------
|
||||
is_restricted | Read | Boolean | Is it a restricted access road? (See definition in `process_way`)
|
||||
mode | Read | Enum | Travel mode before the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||
is_motorway | Read | Boolean | Is the road a motorway?
|
||||
is_link | Read | Boolean | Is the road a link?
|
||||
number_of_lanes | Read | Integer | How many lanes does the road have? (default when not tagged: 0)
|
||||
highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
||||
access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
||||
speed | Read | Integer | Speed on this road in km/h
|
||||
priority_class | Read | Enum | The type of road priority class of the leg. Defined in `include/extractor/road_classification.hpp`
|
||||
is_incoming | Read | Boolean | Is the road an incoming road of the intersection
|
||||
is_outgoing | Read | Boolean | Is the road an outgoing road of the intersection
|
||||
|
||||
The order of the roads in `roads_on_the_right` and `roads_on_the_left` are *counter clockwise*. If the turn is a u turn, all other connected roads will be in `roads_on_the_right`.
|
||||
|
||||
**Example**
|
||||
|
||||
```
|
||||
c e
|
||||
| /
|
||||
| /
|
||||
a ---- x ---- b
|
||||
/|
|
||||
/ |
|
||||
f d
|
||||
|
||||
|
||||
```
|
||||
When turning from `a` to `b` via `x`,
|
||||
* `roads_on_the_right[1]` is the road `xf`
|
||||
* `roads_on_the_right[2]` is the road `xd`
|
||||
* `roads_on_the_left[1]` is the road `xe`
|
||||
* `roads_on_the_left[2]` is the road `xc`
|
||||
|
||||
Note that indices of arrays in lua are 1-based.
|
||||
|
||||
#### `highway_turn_classification` and `access_turn_classification`
|
||||
When setting appropriate turn weights and duration, information about the highway and access tags of roads that are involved in the turn are necessary. The lua turn function `process_turn` does not have access to the original osrm tags anymore. However, `highway_turn_classification` and `access_turn_classification` can be set during setup. The classification set during setup can be later used in `process_turn`.
|
||||
|
||||
**Example**
|
||||
|
||||
In the following example we use `highway_turn_classification` to set the turn weight to `10` if the turn is on a highway and to `5` if the turn is on a primary.
|
||||
|
||||
```
|
||||
function setup()
|
||||
return {
|
||||
highway_turn_classification = {
|
||||
['motorway'] = 2,
|
||||
['primary'] = 1
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function process_turn(profile, turn) {
|
||||
if turn.source_highway_turn_classification == 2 and turn.target_highway_turn_classification == 2 then
|
||||
turn.weight = 10
|
||||
end
|
||||
if turn.source_highway_turn_classification == 1 and turn.target_highway_turn_classification == 1 then
|
||||
turn.weight = 5
|
||||
end
|
||||
}
|
||||
```
|
||||
|
||||
## 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.
|
||||
|
||||
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 omitted 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.
|
||||
|
||||
### Using raster data
|
||||
OSRM has built-in support for loading an interpolating raster data in ASCII format. This can be used e.g. for factoring in elevation when computing routes.
|
||||
|
||||
Use `raster:load()` in your `setup` function to load data and store the source in your configuration hash:
|
||||
|
||||
```lua
|
||||
function setup()
|
||||
return {
|
||||
raster_source = raster:load(
|
||||
"rastersource.asc", -- file to load
|
||||
0, -- longitude min
|
||||
0.1, -- longitude max
|
||||
0, -- latitude min
|
||||
0.1, -- latitude max
|
||||
5, -- number of rows
|
||||
4 -- number of columns
|
||||
)
|
||||
}
|
||||
end
|
||||
```
|
||||
|
||||
The input data must an ASCII file with rows of integers. e.g.:
|
||||
|
||||
```
|
||||
0 0 0 0
|
||||
0 0 0 250
|
||||
0 0 250 500
|
||||
0 0 0 250
|
||||
0 0 0 0
|
||||
```
|
||||
|
||||
In your `segment_function` you can then access the raster source and use `raster:query()` to query to find the nearest data point, or `raster:interpolate()` to interpolate a value based on nearby data points.
|
||||
|
||||
You must check whether the result is valid before use it.
|
||||
|
||||
Example:
|
||||
|
||||
```lua
|
||||
function process_segment (profile, segment)
|
||||
local sourceData = raster:query(profile.raster_source, segment.source.lon, segment.source.lat)
|
||||
local targetData = raster:query(profile.raster_source, segment.target.lon, segment.target.lat)
|
||||
|
||||
local invalid = sourceData.invalid_data()
|
||||
if sourceData.datum ~= invalid and targetData.datum ~= invalid then
|
||||
-- use values to adjust weight and duration
|
||||
[...]
|
||||
end
|
||||
```
|
||||
|
||||
See [rasterbot.lua](../profiles/rasterbot.lua) and [rasterbotinterp.lua](../profiles/rasterbotinterp.lua) for examples.
|
||||
|
||||
### Helper functions
|
||||
There are a few helper functions defined in the global scope that profiles can use:
|
||||
|
||||
- `durationIsValid`
|
||||
- `parseDuration`
|
||||
- `trimLaneString`
|
||||
- `applyAccessTokens`
|
||||
- `canonicalizeStringList`
|
||||
@@ -1,58 +0,0 @@
|
||||
# Releasing a new OSRM version
|
||||
|
||||
We are using http://semver.org/ for versioning with major, minor and patch versions.
|
||||
|
||||
## Guarantees
|
||||
|
||||
We are giving the following guarantees between versions:
|
||||
|
||||
### Major version change
|
||||
|
||||
- There are no guarantees about compatiblity of APIs or datasets
|
||||
- Breaking changes will be noted as `BREAKING` in the changelog
|
||||
|
||||
### Minor version change
|
||||
|
||||
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.
|
||||
|
||||
- Forward-compatible HTTP API
|
||||
- Forward-compatible C++ library API
|
||||
- Forward-compatible node-osrm API
|
||||
- No compatiblity between OSRM datasets (needs new processing)
|
||||
|
||||
### Patch version change
|
||||
|
||||
- No change of query parameters or response formats
|
||||
- Compatible HTTP API
|
||||
- Compatible C++ library API
|
||||
- Compatible node-osrm API
|
||||
- Compatible OSRM datasets
|
||||
|
||||
## Release and branch management
|
||||
|
||||
- The `master` branch is for the bleeding edge development
|
||||
- We create and maintain release branches `x.y` to control the release flow
|
||||
- We create the release branch once we create release branches once we want to release the first RC
|
||||
- RCs go in the release branch, commits needs to be cherry-picked from master
|
||||
- No minor or major version will be released without a code-equal release candidates
|
||||
- For quality assurance, release candidates need to be staged beforing tagging a final release
|
||||
- Patch versions may be released without a release candidate
|
||||
- We may backport fixes to older versions and release them as patch versions
|
||||
|
||||
## Releasing a version
|
||||
|
||||
1. Check out the appropriate release branch `x.y`
|
||||
2. Make sure `CHANGELOG.md` is up to date.
|
||||
3. Make sure the `package.json` on branch `x.y` has been committed.
|
||||
4. Make sure all tests are passing (e.g. Travis CI gives you a :green_apple:)
|
||||
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. Commit should be one in which the `package.json` version matches the version you want to release.
|
||||
6. Use `npm run docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
||||
7. Push tags and commits: `git push; git push --tags`
|
||||
8. On https://github.com/Project-OSRM/osrm-backend/releases press `Draft a new release`,
|
||||
write the release tag `vx.y.z` in the `Tag version` field, write the changelog entries in the `Describe this release` field
|
||||
and press `Publish release`.
|
||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
|
||||
`rm -rf node_modules && npm install` locally.
|
||||
11. For final releases run `npm publish` or `npm publish --tag next` for release candidates.
|
||||
12. Bump version in `package.json` to `{MAJOR}.{MINOR+1}.0-latest.1` on the `master` branch after the release.
|
||||
@@ -1,14 +0,0 @@
|
||||
## Environment Variables
|
||||
|
||||
### SIGNAL_PARENT_WHEN_READY
|
||||
|
||||
If the SIGNAL_PARENT_WHEN_READY environment variable is set osrm-routed will
|
||||
send the USR1 signal to its parent when it will be running and waiting for
|
||||
requests. This could be used to upgrade osrm-routed to a new binary on the fly
|
||||
without any service downtime - no incoming requests will be lost.
|
||||
|
||||
### DISABLE_ACCESS_LOGGING
|
||||
|
||||
If the DISABLE_ACCESS_LOGGING environment variable is set osrm-routed will
|
||||
**not** log any http requests to standard output. This can be useful in high
|
||||
traffic setup.
|
||||
@@ -1,16 +0,0 @@
|
||||
var fs = require('fs');
|
||||
|
||||
/**
|
||||
* This file exports the content of your website, as a bunch of concatenated
|
||||
* Markdown files. By doing this explicitly, you can control the order
|
||||
* of content without any level of abstraction.
|
||||
*
|
||||
* Using the brfs module, fs.readFileSync calls in this file are translated
|
||||
* into strings of those files' content before the file is delivered to a
|
||||
* browser: the content is read ahead-of-time and included in bundle.js.
|
||||
*/
|
||||
module.exports =
|
||||
'# HTTP API\n' +
|
||||
fs.readFileSync('./content/http.md', 'utf8') + '\n'+
|
||||
'# libosrm C++ API\n' +
|
||||
fs.readFileSync('./content/libosrm.md', 'utf8') + '\n';
|
||||
@@ -1,16 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<meta http-equiv='X-UA-Compatible' content='IE=11' />
|
||||
<title>OSRM API Documentation</title>
|
||||
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
|
||||
<link href='css/base.css' rel='stylesheet' />
|
||||
<link href='css/style.css' rel='stylesheet' />
|
||||
<link href='css/railscasts.css' rel='stylesheet' />
|
||||
</head>
|
||||
<body>
|
||||
<!--START--><div id='app'></div><!--STOP-->
|
||||
<script src='bundle.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,63 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Brand names, in order to decreasing length, for different
|
||||
* media queries.
|
||||
*/
|
||||
module.exports.brandNames = {
|
||||
desktop: 'OSRM API Documentation',
|
||||
tablet: 'OSRM API Docs',
|
||||
mobile: 'OSRM API'
|
||||
};
|
||||
|
||||
/**
|
||||
* Classes that define the top-left brand box.
|
||||
*/
|
||||
module.exports.brandClasses = 'fill-red';
|
||||
|
||||
|
||||
/**
|
||||
* Text for the link back to the linking website.
|
||||
*/
|
||||
module.exports.backLink = 'Back to project-osrm.org';
|
||||
|
||||
/**
|
||||
* Runs after highlighting code samples. You can use this
|
||||
* hook to, for instance, highlight a token and link it
|
||||
* to some canonical part of documentation.
|
||||
*/
|
||||
module.exports.postHighlight = function(html) {
|
||||
return html;
|
||||
};
|
||||
|
||||
/**
|
||||
* Highlight tokens in endpoint URLs, optionally linking to documentation
|
||||
* or adding detail. This is the equivalent of postHighlight but it
|
||||
* operates on endpoint URLs only.
|
||||
*/
|
||||
function highlightTokens(str) {
|
||||
return str.replace(/{[\w_]+}/g,
|
||||
(str) => '<span class="strong">' + str + '</span>');
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform endpoints given as strings in a highlighted block like
|
||||
*
|
||||
* ```endpoint
|
||||
* GET /foo/bar
|
||||
* ```
|
||||
*
|
||||
* Into HTML nodes that format those endpoints in nice ways.
|
||||
*/
|
||||
module.exports.transformURL = function(value) {
|
||||
let parts = value.split(/\s+/);
|
||||
return {
|
||||
type: 'html',
|
||||
value: `<div class='endpoint dark fill-dark round '>
|
||||
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>${parts[0]}</div>
|
||||
<div class='pad0 code small endpoint-url'>${highlightTokens(parts[1])}</div>
|
||||
</div>`
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.remarkPlugins = [];
|
||||
-406
@@ -1,406 +0,0 @@
|
||||
# Testsuite
|
||||
|
||||
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing.
|
||||
|
||||
## Unit Tests
|
||||
|
||||
For a general introduction on Boost.Test have a look at [its docs](http://www.boost.org/doc/libs/1_60_0/libs/test/doc/html/index.html).
|
||||
|
||||
### Separate Test Binaries
|
||||
|
||||
Unit tests should be registered according to the sub-project they're in.
|
||||
If you want to write tests for utility functions, add them to the utility test binary.
|
||||
See `CMakeLists.txt` in the unit test directory for how to register new unit tests.
|
||||
|
||||
### Using Boost.Test Primitives
|
||||
|
||||
There is a difference between only reporting a failed condition and aborting the test right at a failed condition.
|
||||
Have a look at [`BOOST_CHECK` vs `BOOST_REQUIRE`](http://www.boost.org/doc/libs/1_60_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref/assertion_boost_level.html).
|
||||
Instead of manually checking e.g. for equality, less than, if a function throws etc. use their [corresponding Boost.Test primitives](http://www.boost.org/doc/libs/1_60_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref.html).
|
||||
|
||||
If you use `BOOST_CHECK_EQUAL` you have to implement `operator<<` for your type so that Boost.Test can print mismatches.
|
||||
If you do not want to do this, define `BOOST_TEST_DONT_PRINT_LOG_VALUE` (and undef it after the check call) or sidestep it with `BOOST_CHECK(fst == snd);`.
|
||||
|
||||
### Test Fixture
|
||||
|
||||
If you need to test features on a real dataset (think about this twice: prefer cucumber and dataset-independent tests for their reproducibility and minimality), there is a fixed dataset in `test/data`.
|
||||
This dataset is a small extract and may not even contain all tags or edge cases.
|
||||
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
|
||||
See the library tests for how to add new dataset dependent tests.
|
||||
|
||||
To prepare the test data simply `cd test/data/` and then run `make`.
|
||||
|
||||
### Running Tests
|
||||
|
||||
To build the unit tests:
|
||||
|
||||
```
|
||||
cd build
|
||||
cmake ..
|
||||
make tests
|
||||
```
|
||||
|
||||
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
|
||||
|
||||
```
|
||||
./engine-tests
|
||||
```
|
||||
|
||||
## Cucumber
|
||||
|
||||
For a general introduction on cucumber in our testsuite, have a look at [the wiki](https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite).
|
||||
|
||||
This documentation aims to supply a guideline on how to write cucumber tests that test new features introduced into osrm.
|
||||
|
||||
### Test the feature
|
||||
|
||||
It is often tempting to reduce the test to a path and accompanying instructions. Instructions can and will change over the course of improving guidance.
|
||||
|
||||
Instructions should only be used when writing a feature located in `features/guidance`. All other features should avoid using instructions at all.
|
||||
|
||||
### Write Tests to Scale
|
||||
|
||||
OSRM is a navigation engine. Tests should always consider this background.
|
||||
|
||||
An important implication is the grid size. If tests use a very small grid size, you run into the chance of instructions being omitted.
|
||||
For example:
|
||||
|
||||
```
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Testbot - Straight Road
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | primary |
|
||||
| cd | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | ab,bc,cd,cd |
|
||||
|
||||
```
|
||||
|
||||
In a navigation engine, the instructions
|
||||
|
||||
- depart east on ab
|
||||
- in 10 meters the road name changes to bc
|
||||
- in 10 meters the road name changes to cd
|
||||
- you arrived at cd
|
||||
|
||||
would be impossible to announce and not helpful at all.
|
||||
Since no actual choices exist, the route you get could result in `ab,cd` and simply say `depart` and `arrive`.
|
||||
|
||||
To prevent such surprises, always consider the availability of other roads and use grid sizes/road lengths that correspond to actually reasonable scenarios in a road network.
|
||||
|
||||
### Use names
|
||||
|
||||
If you specify many nodes in close succession to present a specific road geometry, consider using `name` to indicate to OSRM that the segment is a single road.
|
||||
|
||||
```
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Testbot - Straight Road
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | road |
|
||||
| bc | primary | road |
|
||||
| cd | primary | road |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | d | road,road | depart,arrive |
|
||||
|
||||
```
|
||||
|
||||
Guidance guarantees only essential maneuvers. You will always see `depart` and `arrive` as well as all turns that are not obvious.
|
||||
|
||||
So the following scenario does not change the instructions
|
||||
|
||||
```
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Testbot - Straight Road
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
d c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | road |
|
||||
| bc | primary | road |
|
||||
| cd | primary | road |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | d | road,road | depart,arrive |
|
||||
```
|
||||
|
||||
but if we modify it to
|
||||
|
||||
```
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 10 meters
|
||||
|
||||
Scenario: Testbot - Straight Road
|
||||
Given the node map
|
||||
"""
|
||||
a b e
|
||||
d c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | primary | road |
|
||||
| bc | primary | road |
|
||||
| cd | primary | road |
|
||||
| be | primary | turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| a | d | road,road,road | depart,continue right,arrive |
|
||||
```
|
||||
|
||||
### Test all directions
|
||||
|
||||
Modelling a road as roundabout has an implied oneway tag associated with it. In the following case, we can route from `a` to `d` but not from `d` to `a`.
|
||||
To discover those errors, make sure to check for all allowed directions.
|
||||
|
||||
```
|
||||
Scenario: Enter and Exit mini roundabout with sharp angle # features/guidance/mini-roundabout.feature:37
|
||||
Given the profile "car" # features/step_definitions/data.js:8
|
||||
Given a grid size of 10 meters # features/step_definitions/data.js:20
|
||||
Given the node map # features/step_definitions/data.js:45
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
And the ways # features/step_definitions/data.js:128
|
||||
| nodes | highway | name |
|
||||
| ab | tertiary | MySt |
|
||||
| bc | roundabout | |
|
||||
| cd | tertiary | MySt |
|
||||
When I route I should get # features/step_definitions/routing.js:4
|
||||
| from | to | route | turns | # |
|
||||
| a | d | MySt,MySt | depart,arrive | # suppress multiple enter/exit mini roundabouts |
|
||||
| d | a | MySt,MySt | depart,arrive | # suppress multiple enter/exit mini roundabouts |
|
||||
Tables were not identical:
|
||||
| from | to | route | turns | #
|
||||
| a | d | MySt,MySt | depart,arrive | # suppress multiple enter/exit mini roundabouts |
|
||||
| (-) d | (-) a | (-) MySt,MySt | (-) depart,arrive | (-) # suppress multiple enter/exit mini roundabouts |
|
||||
| (+) d | (+) a | (+) | (+) | (+) # suppress multiple enter/exit mini roundabouts |
|
||||
```
|
||||
|
||||
### Prevent Randomness
|
||||
|
||||
Some features in OSRM can result in strange experiences during testcases. To prevent some of these issues, follow the guidelines below.
|
||||
|
||||
#### Use Waypoints
|
||||
|
||||
Using grid nodes as waypoints offers the chance of unwanted side effects.
|
||||
OSRM converts the grid into a so called edge-based graph.
|
||||
|
||||
```
|
||||
Scenario: Testbot - Intersection
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
b a d
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | yes |
|
||||
| ac | primary | yes |
|
||||
| ad | primary | yes |
|
||||
| ae | primary | yes |
|
||||
```
|
||||
Selecting `a` as a `waypoint` results in four possible starting locations. Which one of the routes `a,b`, `a,c`, `a,d`, or `a,e` is found is pure chance and depends on the order in the static `r-tree`.
|
||||
|
||||
To guarantee discovery, use:
|
||||
|
||||
```
|
||||
Scenario: Testbot - Intersection
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
4
|
||||
b 1 a 3 d
|
||||
2
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | yes |
|
||||
| ac | primary | yes |
|
||||
| ad | primary | yes |
|
||||
| ae | primary | yes |
|
||||
```
|
||||
And use `1`,`2`,`3`, and `4` as starting waypoints. The routes `1,b`, `2,c`, `3,d`, and `4,e` can all be discovered.
|
||||
|
||||
#### Allow For Small Offsets
|
||||
|
||||
Whenever you are independent of the start location (see use waypoints), the waypoint chosen as start/end location can still influence distances/durations.
|
||||
|
||||
If you are testing for a duration metric, allow for a tiny offset to ensure a passing test in the presence of rounding/snapping issues.
|
||||
|
||||
#### Don't Rely on Alternatives
|
||||
|
||||
Alternative route discovery is a random feature in itself. The discovery of routes depends on the contraction order of roads and cannot be assumed successful, ever.
|
||||
|
||||
### Understanding Turn Restrictions
|
||||
|
||||
Adding turn restrictions requires the restriction to follow a very specific format.
|
||||
|
||||
We specify them in a table with the header `| type | way:from | way:to | node:via | restriction |`.
|
||||
It is important that turn restrictions require micro segmentation.
|
||||
|
||||
Consider the following scenario:
|
||||
```
|
||||
Given the node map:
|
||||
"""
|
||||
e
|
||||
|
|
||||
a - - b - - c
|
||||
|
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abc | yes |
|
||||
| ebd | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | ebd | b | no_right_turn |
|
||||
```
|
||||
|
||||
The setting looks perfectly fine at first glance. However, it is not well defined.
|
||||
The forbidden right turn could be either a superfluous addition, forbidding the turn `cb` to `be`, or actually refer to the turn `ab` to `bd` to say that a turn is forbidden here.
|
||||
|
||||
To model turn-restrictions correctly and unique, we need to split segments that contribute to the restriction into the smallest possible parts.
|
||||
E.g. the above scenario could correctly be expressed as:
|
||||
|
||||
```
|
||||
Given the node map:
|
||||
"""
|
||||
e
|
||||
|
|
||||
a - - b - - c
|
||||
|
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | name |
|
||||
| ab | yes | abc |
|
||||
| bc | yes | abc |
|
||||
| eb | yes | ebd |
|
||||
| bd | yes | ebd |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | ab | bd | b | no_right_turn |
|
||||
```
|
||||
|
||||
Unless this format is used, OSRM will omit the (then ambiguous) turn restrictions and ignore them.
|
||||
|
||||
## My Guidance Tests are Failing - Understanding what you can change
|
||||
|
||||
If you change some stuff in guidance, you will easily see tests change their result. E.g. if you change the angles for which we report `right`, then obviously some tests might not report a `direction modifier` named `right` anymore.
|
||||
|
||||
This small section will try to guide you in making the correct decisions for changing the behaviour of tests.
|
||||
|
||||
The difficulty in guidance tests is that not all items can be translated 1:1 from the ascii art into turn-angles.
|
||||
|
||||
The turn-angle calculation tries to find turn angles that would represent perceived turn angles, not the exact angle at the connection.
|
||||
|
||||
This is necessary, since connections in OSM are always bound by the paradigm that the way is supposed to be in the middle of the actual road.
|
||||
For broad streets, you will see stronger angles than the actual turns.
|
||||
|
||||
### Don't change the test, change the expected behaviour
|
||||
|
||||
If we have a test that looks like this:
|
||||
|
||||
```
|
||||
Given a grid size of 5 m
|
||||
Given the node map
|
||||
"""
|
||||
a - b - - - - - - c
|
||||
\
|
||||
d - - - - - e
|
||||
"""
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abc,bde,bde | depart,turn slight right,arrive|
|
||||
```
|
||||
|
||||
And the test reports `turn right` for the route `a->e`, where before it said `slight right`.
|
||||
|
||||
If you changed the turn angles, obviously you can expect changes in the distinction between `slight right` and `right`.
|
||||
In such a case it is, of course, reasonable to change the expected route to report `right` instead of `slight right`. You should consider inspecting the actual turn angles at `b` to see if you feel that change is justified.
|
||||
|
||||
However, you should never adjust the test itself.
|
||||
If you look at a failure, the other way around
|
||||
|
||||
```
|
||||
Given a grid size of 5 m
|
||||
Given the node map
|
||||
"""
|
||||
a - b - - - - - - c
|
||||
\
|
||||
d - - - - - e
|
||||
"""
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | abc,bde,bde | depart,turn right,arrive|
|
||||
```
|
||||
|
||||
where we see a `slight right`, over the expected `right`.
|
||||
We could be tempted to adjust the grid size (e.g. from `10 m` to `20` meters).
|
||||
|
||||
Such a change would fundamentally alter the tests, though.
|
||||
Since the part `b-d` is a short offset, when we are looking at a grid of size `5 m`, the angle calculation will try and compensate for this offset.
|
||||
|
||||
In this case we would see a very slight turn angle. If your change now reports different turn angles, you can of course change the expected result. But you should not adjust the grid size. The test would be testing turn angles of `180` and `100` degrees, instead of `180` and `160`.
|
||||
|
||||
### Consider Post-Processing Impacts
|
||||
|
||||
Some changes you might see could look completely unrelated. To understand the impact of your changes, you can make use of the debugging utilities you can finde in `util/debug.hpp` (and potentially other related headers).
|
||||
|
||||
If your test is inspecting a series of turns (remember, a turn not necessarily equals an instruction), you could see interaction with post-processing.
|
||||
To see the unprocessed turns, you should print the steps at the end of step assembly (`assembleSteps` in `engine/guidance/assemble_steps.hpp`).
|
||||
|
||||
If you see unexpected changes, you can consider adding the `locations` field to your test to study what location a turn is reported at.
|
||||
|
||||
To study a test without post-processing impacts, you can create a copy of the case on a very large grid (like 2000 meters). In such a grid, `turn collapsing` would be essentially disable.
|
||||
|
||||
Sadly, there is no general guideline.
|
||||
|
||||
### Use Caution
|
||||
|
||||
If in doubt, ask another person. Inspect as much of the data as possible (e.g. print un-collapsed steps, turn angles and so on) and use your best judgement, if the new result seems justified.
|
||||
@@ -1,97 +0,0 @@
|
||||
# Building OSRM for Windows
|
||||
|
||||
## Dependencies
|
||||
|
||||
Get a decent Windows with decent Visual Studio (14 at least for C++11 support). The published binaries are build with
|
||||
VS2019 and Windows SDK8.1.
|
||||
|
||||
In case you are using [prepacked Windows VM with VS2019](https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/), you
|
||||
have to install [Windows SDK 8.1](https://go.microsoft.com/fwlink/p/?LinkId=323507)
|
||||
|
||||
Prepare directories for dependencies, build and target file location.Target directory ($target starting from that moment) should have /include and /lib subdirectories.
|
||||
|
||||
### Bzip2
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/bzip2-1.0.8.tar.gz
|
||||
* https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
|
||||
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Issue `nmake /f makefile.msc`
|
||||
4. Copy bzlib.h to $target\include and libbz2.lib to $target\lib
|
||||
|
||||
### ZLib
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/zlib-1.2.11.tar.gz
|
||||
* https://www.zlib.net/zlib-1.2.11.tar.gz
|
||||
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Switch to `contrib\vstudio\vc14`
|
||||
4. If needed, open `zlibvc.sln` with Visual Studio and retarget to your version of compiler and SDK.
|
||||
5. Issue `msbuild zlibvc.sln /p:BuildInParallel=true /p:Configuration=Release /p:Platform=x64 /m:<Number of cpu cores>`
|
||||
6. Copy x64\ZlibStatRelease\zlibstat.lib to $target\lib\libz.lib, copy zlib.h and zconf.h to $target\include
|
||||
|
||||
### ICU
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://wolt-project.wolt.com/deps/icu4c-66_1-src.zip
|
||||
* https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.zip
|
||||
* https://wolt-project.wolt.com/deps/icu4c-66_1-data.zip
|
||||
* https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-data.zip
|
||||
2. Do retarget if neededby openinig .\source\allinone\allinone.sln and editing projects
|
||||
3. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
4. Run build:
|
||||
msbuild .\source\allinone\allinone.sln /nologo /p:BuildInParallel=true /p:Configuration=Release /p:Platform=x64 /m:<Number of cpu cores>
|
||||
5. Copy lib64\*.lib to $target\lib, copy include contents to $target\include
|
||||
6. Copy bin64\*dll to any dir withing your $PATH. At the same time copy them to $target\lib
|
||||
|
||||
### Boost
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/boost_1_73_0.zip
|
||||
* https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.zip
|
||||
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Build b2:
|
||||
bootstrap.bat --with-toolset=msvc-14.2
|
||||
4. Build boost:
|
||||
b2 -a -d release state --build-type=minimal toolset=msvc-14.2 -q runtime-link=shared link=static address-model=64 --with-iostreams --with-test --with-thread --with-filesystem --with-date_time --with-system --with-program_options --with-regex --disable-filesystem2 -sHAVE_ICU=1 include=<target>\include library-path=<target>\lib -sZLIB_SOURCE=<builddir>/zlib -zBZIP2_BINARY=libbz2 -sBZIP2_INCLUDE=<target>\include -sBZIP2_LIBPATH=<target>\lib -sICU_ICUUC_NAME=icuuc -sICU_ICUDT_NAME=icudt -sICU_ICUIN_NAME=icuin -sBUILD=boost_unit_test_framework -j<number of cpu cores>
|
||||
5. Copy `boost` subdirectory to <target>\include and contents of `stage` to <target>\lib
|
||||
|
||||
### Expat
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/libexpat-2_2_9.zip
|
||||
* https://github.com/libexpat/libexpat/archive/R_2_2_9.zip
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Configure build my calling cmake:
|
||||
mkdir expat\build
|
||||
cd expat\build
|
||||
cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_SHARED_LIBS=OFF ..
|
||||
4. Build expat: `msbuild expat.sln /nologo /p:Configuration=Release /p:Platform=x64`
|
||||
5. Copy `Release\libexpat.*` to <target>/lib. Copy `expat/lib/expat.h` and `expat/lib/expat_external.h` to <target>/include
|
||||
|
||||
### LUA
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/lua-5.3.5.tar.gz
|
||||
* https://www.lua.org/ftp/lua-5.3.5.tar.gz
|
||||
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
3. Lua doesn't have native MSVC support, so you have to compile it by hand:
|
||||
cd src
|
||||
cl /MD /O2 /c /DLUA_COMPAT_5_2 *.c
|
||||
ren lua.obj lua.o
|
||||
ren luac.obj luac.o
|
||||
link /LIB /OUT:lua5.3.5.dll *.obj
|
||||
4. Copy `lua5.3.5.lib` to <target>/lib. Copy `lua.h`,`lauxlib,h`,`lua.hpp`,`lualib.h`,`luaconf.h` to <target>/include
|
||||
|
||||
### TBB
|
||||
|
||||
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||
* https://project-osrm.wolt.com/deps/oneTBB-v2020.2.zip
|
||||
* https://github.com/oneapi-src/oneTBB/archive/v2020.2.zip
|
||||
2. Retarget by opening build\vs2013\makefile.sln
|
||||
3. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||
4. Switch to build\vs2013 and build: `msbuild makefle.sln /nologo /p:Configuration=Release /p:Platform=x64`
|
||||
5. Copy x64/Release/*.{dll,lib} files to <target>/lib and copy contents of include directory to <target>/include
|
||||
+8
-11
@@ -6,31 +6,28 @@ Please create a directory and run cmake from there, passing the path to this sou
|
||||
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
project(osrm-example C CXX)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
|
||||
|
||||
set(bitness 32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(bitness 64)
|
||||
message(STATUS "Building on a 64 bit system")
|
||||
else()
|
||||
message(STATUS "Building on a 32 bit system")
|
||||
message(WARNING "Building on a 32 bit system is unsupported")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||
if(WIN32 AND MSVC_VERSION LESS 1800)
|
||||
message(FATAL_ERROR "Building with Microsoft compiler needs Visual Studio 2013 or later (Express version works too)")
|
||||
endif()
|
||||
|
||||
link_directories(${LibOSRM_LIBRARY_DIRS})
|
||||
add_executable(osrm-example example.cpp)
|
||||
|
||||
find_package(LibOSRM REQUIRED)
|
||||
find_package(Boost 1.49.0 COMPONENTS filesystem system thread REQUIRED)
|
||||
|
||||
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${Boost_LIBRARIES})
|
||||
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
|
||||
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LibOSRM_CXXFLAGS}")
|
||||
|
||||
@@ -1,24 +1,13 @@
|
||||
# - Try to find LibOSRM
|
||||
# Once done this will define
|
||||
# LibOSRM_FOUND - System has LibOSRM
|
||||
# LibOSRM_LIBRARIES - The libraries and ldflags needed to use LibOSRM
|
||||
# LibOSRM_DEPENDENT_LIBRARIES - The libraries and ldflags need to link LibOSRM dependencies
|
||||
# LibOSRM_LIBRARY_DIRS - The libraries paths needed to find LibOSRM
|
||||
# LibOSRM_CXXFLAGS - Compiler switches required for using LibOSRM
|
||||
# LibOSRM_INCLUDE_DIRS - The LibOSRM include directories
|
||||
# LibOSRM_LIBRARIES - The libraries needed to use LibOSRM
|
||||
# LibOSRM_DEFINITIONS - Compiler switches required for using LibOSRM
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_search_module(PC_LibOSRM QUIET libosrm)
|
||||
|
||||
function(JOIN VALUES GLUE OUTPUT)
|
||||
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
|
||||
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
list(REMOVE_ITEM PC_LibOSRM_CFLAGS " ")
|
||||
JOIN("${PC_LibOSRM_CFLAGS}" " " output)
|
||||
|
||||
set(LibOSRM_CXXFLAGS ${output})
|
||||
set(LibOSRM_LIBRARY_DIRS ${PC_LibOSRM_LIBRARY_DIRS})
|
||||
pkg_check_modules(PC_LibOSRM QUIET libosrm)
|
||||
set(LibOSRM_DEFINITIONS ${PC_LibOSRM_CFLAGS_OTHER})
|
||||
|
||||
find_path(LibOSRM_INCLUDE_DIR osrm/osrm.hpp
|
||||
PATH_SUFFIXES osrm include/osrm include
|
||||
@@ -30,6 +19,8 @@ find_path(LibOSRM_INCLUDE_DIR osrm/osrm.hpp
|
||||
/opt/local
|
||||
/opt)
|
||||
|
||||
set(LibOSRM_INCLUDE_DIRS ${LibOSRM_INCLUDE_DIR} ${LibOSRM_INCLUDE_DIR}/osrm)
|
||||
|
||||
find_library(TEST_LibOSRM_STATIC_LIBRARY Names osrm.lib libosrm.a
|
||||
PATH_SUFFIXES osrm lib/osrm lib
|
||||
HINTS ${PC_LibOSRM_LIBDIR} ${PC_LibOSRM_LIBRARY_DIRS}
|
||||
@@ -39,7 +30,7 @@ find_library(TEST_LibOSRM_STATIC_LIBRARY Names osrm.lib libosrm.a
|
||||
/usr
|
||||
/opt/local
|
||||
/opt)
|
||||
find_library(TEST_LibOSRM_DYNAMIC_LIBRARY Names libosrm.dylib libosrm.so
|
||||
find_library(TEST_LibOSRM_DYNAMIC_LIBRARY Names osrm.dynlib libosrm.so
|
||||
PATH_SUFFIXES osrm lib/osrm lib
|
||||
HINTS ${PC_LibOSRM_LIBDIR} ${PC_LibOSRM_LIBRARY_DIRS}
|
||||
~/Library/Frameworks
|
||||
@@ -49,15 +40,26 @@ find_library(TEST_LibOSRM_DYNAMIC_LIBRARY Names libosrm.dylib libosrm.so
|
||||
/opt/local
|
||||
/opt)
|
||||
|
||||
set(LibOSRM_DEPENDENT_LIBRARIES ${PC_LibOSRM_STATIC_LDFLAGS})
|
||||
set(LibOSRM_LIBRARIES ${PC_LibOSRM_LDFLAGS})
|
||||
if (NOT ("${TEST_LibOSRM_STATIC_LIBRARY}" STREQUAL "TEST_LibOSRM_STATIC_LIBRARY-NOTFOUND"))
|
||||
if ("${PC_LibOSRM_STATIC_LIBRARIES}" STREQUAL "")
|
||||
set(LibOSRM_STATIC_LIBRARIES ${TEST_LibOSRM_STATIC_LIBRARY})
|
||||
else()
|
||||
set(LibOSRM_STATIC_LIBRARIES ${PC_LibOSRM_STATIC_LIBRARIES})
|
||||
endif()
|
||||
set(LibOSRM_LIBRARIES ${LibOSRM_STATIC_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if (NOT ("${TEST_LibOSRM_DYNAMIC_LIBRARY}" STREQUAL "TEST_LibOSRM_DYNAMIC_LIBRARY-NOTFOUND"))
|
||||
if ("${PC_LibOSRM_LIBRARIES}" STREQUAL "")
|
||||
set(LibOSRM_DYNAMIC_LIBRARIES ${TEST_LibOSRM_DYNAMIC_LIBRARY})
|
||||
else()
|
||||
set(LibOSRM_DYNAMIC_LIBRARIES ${PC_LibOSRM_LIBRARIES})
|
||||
endif()
|
||||
set(LibOSRM_LIBRARIES ${LibOSRM_DYNAMIC_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LIBOSRM_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
find_package_handle_standard_args(LibOSRM DEFAULT_MSG
|
||||
LibOSRM_LIBRARY_DIRS
|
||||
LibOSRM_CXXFLAGS
|
||||
LibOSRM_LIBRARIES
|
||||
LibOSRM_DEPENDENT_LIBRARIES
|
||||
LibOSRM_INCLUDE_DIR)
|
||||
LibOSRM_LIBRARIES LibOSRM_INCLUDE_DIR)
|
||||
|
||||
+283
-283
@@ -1,283 +1,283 @@
|
||||
# Locate Intel Threading Building Blocks include paths and libraries
|
||||
# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
|
||||
# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
|
||||
# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
|
||||
# Florian Uhlig <F.Uhlig _at_ gsi.de>,
|
||||
# Jiri Marsik <jiri.marsik89 _at_ gmail.com>
|
||||
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (c) 2011 Hannes Hofmann
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
|
||||
# e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
|
||||
# TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
|
||||
# in the TBB installation directory (TBB_INSTALL_DIR).
|
||||
#
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
#
|
||||
# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
|
||||
# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
|
||||
# which architecture to use
|
||||
# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
|
||||
# which compiler to use (detected automatically on Windows)
|
||||
|
||||
# This module respects
|
||||
# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
|
||||
|
||||
# This module defines
|
||||
# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
|
||||
# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
|
||||
# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
|
||||
# TBB_INSTALL_DIR, the base TBB install directory
|
||||
# TBB_LIBRARIES, the libraries to link against to use TBB.
|
||||
# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
|
||||
# TBB_FOUND, If false, don't try to use TBB.
|
||||
# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
|
||||
|
||||
|
||||
if (WIN32)
|
||||
# has em64t/vc8 em64t/vc9
|
||||
# has ia32/vc7.1 ia32/vc8 ia32/vc9
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
if (MSVC71)
|
||||
set (_TBB_COMPILER "vc7.1")
|
||||
endif(MSVC71)
|
||||
if (MSVC80)
|
||||
set(_TBB_COMPILER "vc8")
|
||||
endif(MSVC80)
|
||||
if (MSVC90)
|
||||
set(_TBB_COMPILER "vc9")
|
||||
endif(MSVC90)
|
||||
if(MSVC10)
|
||||
set(_TBB_COMPILER "vc10")
|
||||
endif(MSVC10)
|
||||
# Todo: add other Windows compilers such as ICL.
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (WIN32)
|
||||
|
||||
if (UNIX)
|
||||
if (APPLE)
|
||||
# MAC
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
|
||||
# libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# default flavor on apple: ia32/cc4.0.1_os10.4.9
|
||||
# Jiri: There is no reason to presume there is only one flavor and
|
||||
# that user's setting of variables should be ignored.
|
||||
if(NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER "cc4.0.1_os10.4.9")
|
||||
elseif (NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
endif(NOT TBB_COMPILER)
|
||||
if(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE "ia32")
|
||||
elseif(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif(NOT TBB_ARCHITECTURE)
|
||||
else (APPLE)
|
||||
# LINUX
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
|
||||
# has ia32/*
|
||||
# has itanium/*
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (APPLE)
|
||||
endif (UNIX)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
# SUN
|
||||
# not yet supported
|
||||
# has em64t/cc3.4.3_kernel5.10
|
||||
# has ia32/*
|
||||
endif (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
|
||||
|
||||
#-- Clear the public variables
|
||||
set (TBB_FOUND "NO")
|
||||
|
||||
|
||||
#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
|
||||
# first: use CMake variable TBB_INSTALL_DIR
|
||||
if (TBB_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
|
||||
endif (TBB_INSTALL_DIR)
|
||||
# second: use environment variable
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
# Intel recommends setting TBB21_INSTALL_DIR
|
||||
if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# third: try to find path automatically
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (_TBB_DEFAULT_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
|
||||
endif (_TBB_DEFAULT_INSTALL_DIR)
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# sanity check
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
|
||||
else (NOT _TBB_INSTALL_DIR)
|
||||
# finally: set the cached CMake variable TBB_INSTALL_DIR
|
||||
if (NOT TBB_INSTALL_DIR)
|
||||
set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
|
||||
mark_as_advanced(TBB_INSTALL_DIR)
|
||||
endif (NOT TBB_INSTALL_DIR)
|
||||
|
||||
|
||||
#-- A macro to rewrite the paths of the library. This is necessary, because
|
||||
# find_library() always found the em64t/vc9 version of the TBB libs
|
||||
macro(TBB_CORRECT_LIB_DIR var_name)
|
||||
# if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
# endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
endmacro(TBB_CORRECT_LIB_DIR var_content)
|
||||
|
||||
|
||||
#-- Look for include directory and set ${TBB_INCLUDE_DIR}
|
||||
set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
|
||||
# Jiri: tbbvars now sets the CPATH environment variable to the directory
|
||||
# containing the headers.
|
||||
find_path(TBB_INCLUDE_DIR
|
||||
tbb/task_scheduler_init.h
|
||||
PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
||||
)
|
||||
mark_as_advanced(TBB_INCLUDE_DIR)
|
||||
|
||||
|
||||
#-- Look for libraries
|
||||
# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
|
||||
if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
set (_TBB_LIBRARY_DIR
|
||||
${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
|
||||
${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
|
||||
)
|
||||
endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
# Jiri: This block isn't mutually exclusive with the previous one
|
||||
# (hence no else), instead I test if the user really specified
|
||||
# the variables in question.
|
||||
if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
# HH: deprecated
|
||||
message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
|
||||
# Jiri: It doesn't hurt to look in more places, so I store the hints from
|
||||
# ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
|
||||
# variables and search them both.
|
||||
set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
|
||||
endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
|
||||
|
||||
# Jiri: No reason not to check the default paths. From recent versions,
|
||||
# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
|
||||
# variables, which now point to the directories of the lib files.
|
||||
# It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
|
||||
# argument instead of the implicit PATHS as it isn't hard-coded
|
||||
# but computed by system introspection. Searching the LIBRARY_PATH
|
||||
# and LD_LIBRARY_PATH environment variables is now even more important
|
||||
# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
|
||||
# the use of TBB built from sources.
|
||||
find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
#Extract path from TBB_LIBRARY name
|
||||
get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
|
||||
mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
|
||||
|
||||
#-- Look for debug libraries
|
||||
# Jiri: Changed the same way as for the release libraries.
|
||||
find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
# Extract path from TBB_LIBRARY_DEBUG name
|
||||
get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
|
||||
mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
|
||||
|
||||
|
||||
if (TBB_INCLUDE_DIR)
|
||||
if (TBB_LIBRARY)
|
||||
set (TBB_FOUND "YES")
|
||||
set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
|
||||
set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
|
||||
set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
|
||||
set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
|
||||
mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
|
||||
message(STATUS "Found Intel TBB")
|
||||
endif (TBB_LIBRARY)
|
||||
endif (TBB_INCLUDE_DIR)
|
||||
|
||||
if (NOT TBB_FOUND)
|
||||
message("ERROR: Intel TBB NOT found!")
|
||||
message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
|
||||
# do only throw fatal, if this pkg is REQUIRED
|
||||
if (TBB_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find TBB library.")
|
||||
endif (TBB_FIND_REQUIRED)
|
||||
endif (NOT TBB_FOUND)
|
||||
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
|
||||
if (TBB_FOUND)
|
||||
set(TBB_INTERFACE_VERSION 0)
|
||||
FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
|
||||
STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
|
||||
set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
|
||||
endif (TBB_FOUND)
|
||||
# Locate Intel Threading Building Blocks include paths and libraries
|
||||
# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
|
||||
# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
|
||||
# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
|
||||
# Florian Uhlig <F.Uhlig _at_ gsi.de>,
|
||||
# Jiri Marsik <jiri.marsik89 _at_ gmail.com>
|
||||
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (c) 2011 Hannes Hofmann
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
|
||||
# e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
|
||||
# TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
|
||||
# in the TBB installation directory (TBB_INSTALL_DIR).
|
||||
#
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
#
|
||||
# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
|
||||
# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
|
||||
# which architecture to use
|
||||
# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
|
||||
# which compiler to use (detected automatically on Windows)
|
||||
|
||||
# This module respects
|
||||
# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
|
||||
|
||||
# This module defines
|
||||
# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
|
||||
# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
|
||||
# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
|
||||
# TBB_INSTALL_DIR, the base TBB install directory
|
||||
# TBB_LIBRARIES, the libraries to link against to use TBB.
|
||||
# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
|
||||
# TBB_FOUND, If false, don't try to use TBB.
|
||||
# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
|
||||
|
||||
|
||||
if (WIN32)
|
||||
# has em64t/vc8 em64t/vc9
|
||||
# has ia32/vc7.1 ia32/vc8 ia32/vc9
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
if (MSVC71)
|
||||
set (_TBB_COMPILER "vc7.1")
|
||||
endif(MSVC71)
|
||||
if (MSVC80)
|
||||
set(_TBB_COMPILER "vc8")
|
||||
endif(MSVC80)
|
||||
if (MSVC90)
|
||||
set(_TBB_COMPILER "vc9")
|
||||
endif(MSVC90)
|
||||
if(MSVC10)
|
||||
set(_TBB_COMPILER "vc10")
|
||||
endif(MSVC10)
|
||||
# Todo: add other Windows compilers such as ICL.
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (WIN32)
|
||||
|
||||
if (UNIX)
|
||||
if (APPLE)
|
||||
# MAC
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
|
||||
# libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# default flavor on apple: ia32/cc4.0.1_os10.4.9
|
||||
# Jiri: There is no reason to presume there is only one flavor and
|
||||
# that user's setting of variables should be ignored.
|
||||
if(NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER "cc4.0.1_os10.4.9")
|
||||
elseif (NOT TBB_COMPILER)
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
endif(NOT TBB_COMPILER)
|
||||
if(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE "ia32")
|
||||
elseif(NOT TBB_ARCHITECTURE)
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif(NOT TBB_ARCHITECTURE)
|
||||
else (APPLE)
|
||||
# LINUX
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
|
||||
# has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
|
||||
# has ia32/*
|
||||
# has itanium/*
|
||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
||||
endif (APPLE)
|
||||
endif (UNIX)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
# SUN
|
||||
# not yet supported
|
||||
# has em64t/cc3.4.3_kernel5.10
|
||||
# has ia32/*
|
||||
endif (CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
|
||||
|
||||
#-- Clear the public variables
|
||||
set (TBB_FOUND "NO")
|
||||
|
||||
|
||||
#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
|
||||
# first: use CMake variable TBB_INSTALL_DIR
|
||||
if (TBB_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
|
||||
endif (TBB_INSTALL_DIR)
|
||||
# second: use environment variable
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
||||
# Intel recommends setting TBB21_INSTALL_DIR
|
||||
if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
||||
if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
|
||||
endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# third: try to find path automatically
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
if (_TBB_DEFAULT_INSTALL_DIR)
|
||||
set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
|
||||
endif (_TBB_DEFAULT_INSTALL_DIR)
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
# sanity check
|
||||
if (NOT _TBB_INSTALL_DIR)
|
||||
message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
|
||||
else (NOT _TBB_INSTALL_DIR)
|
||||
# finally: set the cached CMake variable TBB_INSTALL_DIR
|
||||
if (NOT TBB_INSTALL_DIR)
|
||||
set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
|
||||
mark_as_advanced(TBB_INSTALL_DIR)
|
||||
endif (NOT TBB_INSTALL_DIR)
|
||||
|
||||
|
||||
#-- A macro to rewrite the paths of the library. This is necessary, because
|
||||
# find_library() always found the em64t/vc9 version of the TBB libs
|
||||
macro(TBB_CORRECT_LIB_DIR var_name)
|
||||
# if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
# endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
||||
string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
||||
endmacro(TBB_CORRECT_LIB_DIR var_content)
|
||||
|
||||
|
||||
#-- Look for include directory and set ${TBB_INCLUDE_DIR}
|
||||
set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
|
||||
# Jiri: tbbvars now sets the CPATH environment variable to the directory
|
||||
# containing the headers.
|
||||
find_path(TBB_INCLUDE_DIR
|
||||
tbb/task_scheduler_init.h
|
||||
PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
||||
)
|
||||
mark_as_advanced(TBB_INCLUDE_DIR)
|
||||
|
||||
|
||||
#-- Look for libraries
|
||||
# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
|
||||
if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
set (_TBB_LIBRARY_DIR
|
||||
${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
|
||||
${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
|
||||
)
|
||||
endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
# Jiri: This block isn't mutually exclusive with the previous one
|
||||
# (hence no else), instead I test if the user really specified
|
||||
# the variables in question.
|
||||
if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
# HH: deprecated
|
||||
message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
|
||||
# Jiri: It doesn't hurt to look in more places, so I store the hints from
|
||||
# ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
|
||||
# variables and search them both.
|
||||
set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
|
||||
endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
||||
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
|
||||
|
||||
# Jiri: No reason not to check the default paths. From recent versions,
|
||||
# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
|
||||
# variables, which now point to the directories of the lib files.
|
||||
# It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
|
||||
# argument instead of the implicit PATHS as it isn't hard-coded
|
||||
# but computed by system introspection. Searching the LIBRARY_PATH
|
||||
# and LD_LIBRARY_PATH environment variables is now even more important
|
||||
# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
|
||||
# the use of TBB built from sources.
|
||||
find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
#Extract path from TBB_LIBRARY name
|
||||
get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
|
||||
mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
|
||||
|
||||
#-- Look for debug libraries
|
||||
# Jiri: Changed the same way as for the release libraries.
|
||||
find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
# Extract path from TBB_LIBRARY_DEBUG name
|
||||
get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
|
||||
|
||||
#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
|
||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
|
||||
mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
|
||||
|
||||
|
||||
if (TBB_INCLUDE_DIR)
|
||||
if (TBB_LIBRARY)
|
||||
set (TBB_FOUND "YES")
|
||||
set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
|
||||
set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
|
||||
set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
|
||||
set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
|
||||
mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
|
||||
message(STATUS "Found Intel TBB")
|
||||
endif (TBB_LIBRARY)
|
||||
endif (TBB_INCLUDE_DIR)
|
||||
|
||||
if (NOT TBB_FOUND)
|
||||
message("ERROR: Intel TBB NOT found!")
|
||||
message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
|
||||
# do only throw fatal, if this pkg is REQUIRED
|
||||
if (TBB_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find TBB library.")
|
||||
endif (TBB_FIND_REQUIRED)
|
||||
endif (NOT TBB_FOUND)
|
||||
|
||||
endif (NOT _TBB_INSTALL_DIR)
|
||||
|
||||
if (TBB_FOUND)
|
||||
set(TBB_INTERFACE_VERSION 0)
|
||||
FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
|
||||
STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
|
||||
set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
|
||||
endif (TBB_FOUND)
|
||||
|
||||
+21
-27
@@ -1,24 +1,24 @@
|
||||
#include "osrm/match_parameters.hpp"
|
||||
#include "osrm/nearest_parameters.hpp"
|
||||
#include "osrm/route_parameters.hpp"
|
||||
#include "osrm/table_parameters.hpp"
|
||||
#include "osrm/nearest_parameters.hpp"
|
||||
#include "osrm/trip_parameters.hpp"
|
||||
#include "osrm/match_parameters.hpp"
|
||||
|
||||
#include "osrm/coordinate.hpp"
|
||||
#include "osrm/engine_config.hpp"
|
||||
#include "osrm/json_container.hpp"
|
||||
|
||||
#include "osrm/osrm.hpp"
|
||||
#include "osrm/status.hpp"
|
||||
#include "osrm/osrm.hpp"
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
int main(int argc, const char *argv[]) try
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
@@ -29,46 +29,36 @@ int main(int argc, const char *argv[])
|
||||
using namespace osrm;
|
||||
|
||||
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
|
||||
EngineConfig config;
|
||||
|
||||
config.storage_config = {argv[1]};
|
||||
EngineConfig config{argv[1]};
|
||||
config.use_shared_memory = false;
|
||||
|
||||
// We support two routing speed up techniques:
|
||||
// - Contraction Hierarchies (CH): requires extract+contract pre-processing
|
||||
// - Multi-Level Dijkstra (MLD): requires extract+partition+customize pre-processing
|
||||
//
|
||||
// config.algorithm = EngineConfig::Algorithm::CH;
|
||||
config.algorithm = EngineConfig::Algorithm::MLD;
|
||||
|
||||
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
||||
const OSRM osrm{config};
|
||||
OSRM osrm{config};
|
||||
|
||||
// The following shows how to use the Route service; configure this service
|
||||
RouteParameters params;
|
||||
|
||||
// Route in monaco
|
||||
params.coordinates.push_back({util::FloatLongitude{7.419758}, util::FloatLatitude{43.731142}});
|
||||
params.coordinates.push_back({util::FloatLongitude{7.419505}, util::FloatLatitude{43.736825}});
|
||||
params.coordinates.push_back({util::FloatLongitude(7.419758), util::FloatLatitude(43.731142)});
|
||||
params.coordinates.push_back({util::FloatLongitude(7.419505), util::FloatLatitude(43.736825)});
|
||||
|
||||
// Response is in JSON format
|
||||
engine::api::ResultT result = json::Object();
|
||||
json::Object result;
|
||||
|
||||
// Execute routing request, this does the heavy lifting
|
||||
const auto status = osrm.Route(params, result);
|
||||
|
||||
auto &json_result = result.get<json::Object>();
|
||||
if (status == Status::Ok)
|
||||
{
|
||||
auto &routes = json_result.values["routes"].get<json::Array>();
|
||||
auto &routes = result.values["routes"].get<json::Array>();
|
||||
|
||||
// Let's just use the first route
|
||||
auto &route = routes.values.at(0).get<json::Object>();
|
||||
const auto distance = route.values["distance"].get<json::Number>().value;
|
||||
const auto duration = route.values["duration"].get<json::Number>().value;
|
||||
|
||||
// Warn users if extract does not contain the default coordinates from above
|
||||
if (distance == 0 || duration == 0)
|
||||
// Warn users if extract does not contain the default Berlin coordinates from above
|
||||
if (distance == 0 or duration == 0)
|
||||
{
|
||||
std::cout << "Note: distance or duration is zero. ";
|
||||
std::cout << "You are probably doing a query outside of the OSM extract.\n\n";
|
||||
@@ -76,15 +66,19 @@ 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)
|
||||
{
|
||||
const auto code = json_result.values["code"].get<json::String>().value;
|
||||
const auto message = json_result.values["message"].get<json::String>().value;
|
||||
const auto code = result.values["code"].get<json::String>().value;
|
||||
const auto message = result.values["message"].get<json::String>().value;
|
||||
|
||||
std::cout << "Code: " << code << "\n";
|
||||
std::cout << "Message: " << code << "\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << "Error: " << e.what() << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
process.env.UV_THREADPOOL_SIZE = Math.ceil(require('os').cpus().length * 1.5);
|
||||
|
||||
var express = require('express');
|
||||
var OSRM = require('..');
|
||||
var path = require('path');
|
||||
|
||||
var app = express();
|
||||
var osrm = new OSRM(path.join(__dirname,"../test/data/ch/monaco.osrm"));
|
||||
|
||||
// Accepts a query like:
|
||||
// http://localhost:8888?start=13.414307,52.521835&end=13.402290,52.523728
|
||||
app.get('/', function(req, res) {
|
||||
if (!req.query.start || !req.query.end) {
|
||||
return res.json({"error":"invalid start and end query"});
|
||||
}
|
||||
var coordinates = [];
|
||||
var start = req.query.start.split(',');
|
||||
coordinates.push([+start[0],+start[1]]);
|
||||
var end = req.query.end.split(',');
|
||||
coordinates.push([+end[0],+end[1]]);
|
||||
var query = {
|
||||
coordinates: coordinates,
|
||||
alternateRoute: req.query.alternatives !== 'false'
|
||||
};
|
||||
osrm.route(query, function(err, result) {
|
||||
if (err) return res.json({"error":err.message});
|
||||
return res.json(result);
|
||||
});
|
||||
});
|
||||
|
||||
console.log('Listening on port: ' + 8888);
|
||||
app.listen(8888);
|
||||
+142
-155
@@ -5,182 +5,169 @@ Feature: Bike - Access tags on ways
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bike - Access tag hierarchy on ways
|
||||
Scenario: Bike - Access tag hierachy on ways
|
||||
Then routability should be
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| primary | | | | cycling |
|
||||
| primary | yes | | | cycling |
|
||||
| primary | no | | | |
|
||||
| primary | | yes | | cycling |
|
||||
| primary | | no | | |
|
||||
| primary | no | yes | | cycling |
|
||||
| primary | yes | no | | |
|
||||
| primary | | | yes | cycling |
|
||||
| primary | | | no | |
|
||||
| primary | no | | yes | cycling |
|
||||
| primary | yes | | no | |
|
||||
| primary | | no | yes | cycling |
|
||||
| primary | | yes | no | |
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| | | | | x |
|
||||
| | yes | | | x |
|
||||
| | no | | | |
|
||||
| | | yes | | x |
|
||||
| | | no | | |
|
||||
| | no | yes | | x |
|
||||
| | yes | no | | |
|
||||
| | | | yes | x |
|
||||
| | | | no | |
|
||||
| | no | | yes | x |
|
||||
| | yes | | no | |
|
||||
| | | no | yes | x |
|
||||
| | | yes | no | |
|
||||
| runway | | | | |
|
||||
| runway | yes | | | x |
|
||||
| runway | no | | | |
|
||||
| runway | | yes | | x |
|
||||
| runway | | no | | |
|
||||
| runway | no | yes | | x |
|
||||
| runway | yes | no | | |
|
||||
| runway | | | yes | x |
|
||||
| runway | | | no | |
|
||||
| runway | no | | yes | x |
|
||||
| runway | yes | | no | |
|
||||
| runway | | no | yes | x |
|
||||
| runway | | yes | no | |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Access tag in forward direction
|
||||
Then routability should be
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| primary | | | | cycling | |
|
||||
| primary | yes | | | cycling | |
|
||||
| primary | no | | | | |
|
||||
| primary | | yes | | cycling | |
|
||||
| primary | | no | | | |
|
||||
| primary | no | yes | | cycling | |
|
||||
| primary | yes | no | | | |
|
||||
| primary | | | yes | cycling | |
|
||||
| primary | | | no | | |
|
||||
| primary | no | | yes | cycling | |
|
||||
| primary | yes | | no | | |
|
||||
| primary | | no | yes | cycling | |
|
||||
| primary | | yes | no | | |
|
||||
| runway | | | | cycling | |
|
||||
| runway | yes | | | cycling | |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | cycling | |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | cycling | |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | cycling | |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | cycling | |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | cycling | |
|
||||
| runway | | yes | no | | |
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| | | | | x | |
|
||||
| | yes | | | x | |
|
||||
| | no | | | | |
|
||||
| | | yes | | x | |
|
||||
| | | no | | | |
|
||||
| | no | yes | | x | |
|
||||
| | yes | no | | | |
|
||||
| | | | yes | x | |
|
||||
| | | | no | | |
|
||||
| | no | | yes | x | |
|
||||
| | yes | | no | | |
|
||||
| | | no | yes | x | |
|
||||
| | | yes | no | | |
|
||||
| runway | | | | x | |
|
||||
| runway | yes | | | x | |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | x | |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | x | |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | x | |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | x | |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | x | |
|
||||
| runway | | yes | no | | |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Access tag in backward direction
|
||||
Then routability should be
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| primary | | | | | cycling |
|
||||
| primary | yes | | | | cycling |
|
||||
| primary | no | | | | |
|
||||
| primary | | yes | | | cycling |
|
||||
| primary | | no | | | |
|
||||
| primary | no | yes | | | cycling |
|
||||
| primary | yes | no | | | |
|
||||
| primary | | | yes | | cycling |
|
||||
| primary | | | no | | |
|
||||
| primary | no | | yes | | cycling |
|
||||
| primary | yes | | no | | |
|
||||
| primary | | no | yes | | cycling |
|
||||
| primary | | yes | no | | |
|
||||
| runway | | | | | cycling |
|
||||
| runway | yes | | | | cycling |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | | cycling |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | | cycling |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | | cycling |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | | cycling |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | | cycling |
|
||||
| runway | | yes | no | | |
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| | | | | | x |
|
||||
| | yes | | | | x |
|
||||
| | no | | | | |
|
||||
| | | yes | | | x |
|
||||
| | | no | | | |
|
||||
| | no | yes | | | x |
|
||||
| | yes | no | | | |
|
||||
| | | | yes | | x |
|
||||
| | | | no | | |
|
||||
| | no | | yes | | x |
|
||||
| | yes | | no | | |
|
||||
| | | no | yes | | x |
|
||||
| | | yes | no | | |
|
||||
| runway | | | | | x |
|
||||
| runway | yes | | | | x |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | | x |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | | x |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | | x |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | | x |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | | x |
|
||||
| runway | | yes | no | | |
|
||||
|
||||
Scenario: Bike - Overwriting implied acccess on ways
|
||||
Then routability should be
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| cycleway | | | | cycling |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | cycling |
|
||||
| runway | | yes | | cycling |
|
||||
| runway | | | yes | cycling |
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| cycleway | | | | x |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | x |
|
||||
| runway | | yes | | x |
|
||||
| runway | | | yes | x |
|
||||
|
||||
Scenario: Bike - Access tags on ways
|
||||
Then routability should be
|
||||
| access | vehicle | bicycle | bothw |
|
||||
| | | | cycling |
|
||||
| yes | | | cycling |
|
||||
| permissive | | | cycling |
|
||||
| designated | | | cycling |
|
||||
| some_tag | | | cycling |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | cycling |
|
||||
| | permissive | | cycling |
|
||||
| | designated | | cycling |
|
||||
| | some_tag | | cycling |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | cycling |
|
||||
| | | permissive | cycling |
|
||||
| | | designated | cycling |
|
||||
| | | some_tag | cycling |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
| | | use_sidepath | |
|
||||
| access | vehicle | bicycle | bothw |
|
||||
| | | | x |
|
||||
| yes | | | x |
|
||||
| permissive | | | x |
|
||||
| designated | | | x |
|
||||
| some_tag | | | x |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| | yes | | x |
|
||||
| | permissive | | x |
|
||||
| | designated | | x |
|
||||
| | some_tag | | x |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | | yes | x |
|
||||
| | | permissive | x |
|
||||
| | | designated | x |
|
||||
| | | some_tag | x |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
|
||||
Scenario: Bike - Access tags on both node and way
|
||||
Then routability should be
|
||||
| access | node/access | bothw |
|
||||
| yes | yes | cycling |
|
||||
| yes | no | |
|
||||
| yes | some_tag | cycling |
|
||||
| no | yes | |
|
||||
| no | no | |
|
||||
| no | some_tag | |
|
||||
| some_tag | yes | cycling |
|
||||
| some_tag | no | |
|
||||
| some_tag | some_tag | cycling |
|
||||
| access | node/access | bothw |
|
||||
| yes | yes | x |
|
||||
| yes | no | |
|
||||
| yes | some_tag | x |
|
||||
| no | yes | |
|
||||
| no | no | |
|
||||
| no | some_tag | |
|
||||
| some_tag | yes | x |
|
||||
| some_tag | no | |
|
||||
| some_tag | some_tag | x |
|
||||
|
||||
Scenario: Bike - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | vehicle | bicycle | forw | backw |
|
||||
| runway | private | | yes | cycling | cycling |
|
||||
| footway | | no | permissive | cycling | cycling |
|
||||
| motorway | | | yes | cycling | |
|
||||
| track | forestry | | permissive | cycling | cycling |
|
||||
| cycleway | yes | designated | no | | |
|
||||
| primary | | yes | private | | |
|
||||
| residential | permissive | | no | | |
|
||||
| highway | access | vehicle | bicycle | forw | backw |
|
||||
| runway | private | | yes | x | x |
|
||||
| footway | | no | permissive | x | x |
|
||||
| motorway | | | yes | x | |
|
||||
| track | forestry | | permissive | x | x |
|
||||
| cycleway | yes | designated | no | | |
|
||||
| primary | | yes | private | | |
|
||||
| residential | permissive | | no | | |
|
||||
|
||||
Scenario: Bike - Ignore access tags for other modes
|
||||
Then routability should be
|
||||
| highway | boat | motor_vehicle | moped | bothw |
|
||||
| river | yes | | | |
|
||||
| cycleway | no | | | cycling |
|
||||
| runway | | yes | | |
|
||||
| cycleway | | no | | cycling |
|
||||
| runway | | | yes | |
|
||||
| cycleway | | | no | cycling |
|
||||
|
||||
Scenario: Bike - Bridleways when access is explicit
|
||||
Then routability should be
|
||||
| highway | horse | foot | bicycle | bothw |
|
||||
| bridleway | | | yes | cycling |
|
||||
| bridleway | | yes | | pushing bike |
|
||||
| bridleway | designated | | | |
|
||||
| bridleway | | | | |
|
||||
|
||||
Scenario: Bike - Tram with oneway when access is implicit
|
||||
Then routability should be
|
||||
| highway | railway | access | oneway | forw | backw |
|
||||
| residential | tram | | yes | cycling | pushing bike |
|
||||
| service | tram | psv | yes | cycling | pushing bike |
|
||||
|
||||
Scenario: Bike - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | cycling |
|
||||
| steps | permissive | cycling |
|
||||
| footway | permissive | cycling |
|
||||
| garbagetag | permissive | cycling |
|
||||
| highway | boat | motor_vehicle | moped | bothw |
|
||||
| river | yes | | | |
|
||||
| cycleway | no | | | x |
|
||||
| runway | | yes | | |
|
||||
| cycleway | | no | | x |
|
||||
| runway | | | yes | |
|
||||
| cycleway | | | no | x |
|
||||
|
||||
@@ -5,64 +5,61 @@ Feature: Bike - Access tags on nodes
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bike - Access tag hierarchy on nodes
|
||||
Scenario: Bike - Access tag hierachy on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
|
||||
| | | | | cycling |
|
||||
| yes | | | | cycling |
|
||||
| no | | | | |
|
||||
| | yes | | | cycling |
|
||||
| | no | | | |
|
||||
| no | yes | | | cycling |
|
||||
| yes | no | | | |
|
||||
| | | yes | | cycling |
|
||||
| | | no | | |
|
||||
| | | no | crossing | cycling |
|
||||
| no | | yes | | cycling |
|
||||
| yes | | no | | |
|
||||
| | no | yes | | cycling |
|
||||
| | yes | no | | |
|
||||
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
|
||||
| | | | | x |
|
||||
| yes | | | | x |
|
||||
| no | | | | |
|
||||
| | yes | | | x |
|
||||
| | no | | | |
|
||||
| no | yes | | | x |
|
||||
| yes | no | | | |
|
||||
| | | yes | | x |
|
||||
| | | no | | |
|
||||
| | | no | crossing | x |
|
||||
| no | | yes | | x |
|
||||
| yes | | no | | |
|
||||
| | no | yes | | x |
|
||||
| | yes | no | | |
|
||||
|
||||
Scenario: Bike - Overwriting implied acccess on nodes doesn't overwrite way
|
||||
Then routability should be
|
||||
| highway | node/access | node/vehicle | node/bicycle | bothw |
|
||||
| cycleway | | | | cycling |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | |
|
||||
| runway | | yes | | |
|
||||
| runway | | | yes | |
|
||||
| highway | node/access | node/vehicle | node/bicycle | bothw |
|
||||
| cycleway | | | | x |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | |
|
||||
| runway | | yes | | |
|
||||
| runway | | | yes | |
|
||||
|
||||
Scenario: Bike - Access tags on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/bicycle | bothw |
|
||||
| | | | cycling |
|
||||
| yes | | | cycling |
|
||||
| permissive | | | cycling |
|
||||
| designated | | | cycling |
|
||||
| some_tag | | | cycling |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | cycling |
|
||||
| | permissive | | cycling |
|
||||
| | designated | | cycling |
|
||||
| | some_tag | | cycling |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | cycling |
|
||||
| | | permissive | cycling |
|
||||
| | | designated | cycling |
|
||||
| | | some_tag | cycling |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
| node/access | node/vehicle | node/bicycle | bothw |
|
||||
| | | | x |
|
||||
| yes | | | x |
|
||||
| permissive | | | x |
|
||||
| designated | | | x |
|
||||
| some_tag | | | x |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| | yes | | x |
|
||||
| | permissive | | x |
|
||||
| | designated | | x |
|
||||
| | some_tag | | x |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | | yes | x |
|
||||
| | | permissive | x |
|
||||
| | | designated | x |
|
||||
| | | some_tag | x |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
@routing @bicycle @alley
|
||||
Feature: Bicycle - Route around alleys
|
||||
|
||||
Background:
|
||||
Given the profile file "bicycle" initialized with
|
||||
"""
|
||||
profile.properties.weight_name = 'cyclability'
|
||||
"""
|
||||
|
||||
Scenario: Bicycle - Avoid taking alleys
|
||||
Given the query options
|
||||
| annotations | nodes |
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a-----b-----c
|
||||
| : |
|
||||
d.....e.....f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | service |
|
||||
| abc | residential | |
|
||||
| def | service | alley |
|
||||
| ad | residential | |
|
||||
| be | service | alley |
|
||||
| cf | residential | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | a:nodes | weight | # |
|
||||
| a | f | 1:2:3:6 | 200.4 | Avoids d,e,f |
|
||||
| a | e | 1:2:5 | 176.4 | Take the alley b,e if neccessary |
|
||||
| d | f | 4:1:2:3:6 | 252.6 | Avoids the alley d,e,f |
|
||||
|
||||
@@ -7,11 +7,9 @@ Feature: Bike - Squares and other areas
|
||||
@square
|
||||
Scenario: Bike - Route along edge of a squares
|
||||
Given the node map
|
||||
"""
|
||||
x
|
||||
a b
|
||||
d c
|
||||
"""
|
||||
| x | |
|
||||
| a | b |
|
||||
| d | c |
|
||||
|
||||
And the ways
|
||||
| nodes | area | highway |
|
||||
@@ -19,24 +17,22 @@ Feature: Bike - Squares and other areas
|
||||
| abcda | yes | residential |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| from | to | route |
|
||||
| a | b | abcda |
|
||||
| a | d | abcda |
|
||||
| b | c | abcda |
|
||||
| c | b | abcda |
|
||||
| c | d | abcda |
|
||||
| d | c | abcda |
|
||||
| d | a | abcda |
|
||||
| a | d | abcda |
|
||||
|
||||
@building
|
||||
Scenario: Bike - Don't route on buildings
|
||||
Given the node map
|
||||
"""
|
||||
x
|
||||
a b
|
||||
d c
|
||||
"""
|
||||
| x | |
|
||||
| a | b |
|
||||
| d | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | area | building | access |
|
||||
@@ -45,23 +41,21 @@ Feature: Bike - Squares and other areas
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | xa,xa |
|
||||
| a | d | xa,xa |
|
||||
| b | c | xa,xa |
|
||||
| c | b | xa,xa |
|
||||
| c | d | xa,xa |
|
||||
| d | c | xa,xa |
|
||||
| d | a | xa,xa |
|
||||
| a | d | xa,xa |
|
||||
| a | b | xa |
|
||||
| a | d | xa |
|
||||
| b | c | xa |
|
||||
| c | b | xa |
|
||||
| c | d | xa |
|
||||
| d | c | xa |
|
||||
| d | a | xa |
|
||||
| a | d | xa |
|
||||
|
||||
@parking
|
||||
Scenario: Bike - parking areas
|
||||
Given the node map
|
||||
"""
|
||||
e f
|
||||
x a b y
|
||||
d c
|
||||
"""
|
||||
| e | | | f |
|
||||
| x | a | b | y |
|
||||
| | d | c | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | amenity |
|
||||
@@ -74,23 +68,20 @@ Feature: Bike - Squares and other areas
|
||||
| from | to | route |
|
||||
| x | y | xa,abcda,by |
|
||||
| y | x | by,abcda,xa |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
|
||||
| a | b | abcda |
|
||||
| a | d | abcda |
|
||||
| b | c | abcda |
|
||||
| c | b | abcda |
|
||||
| c | d | abcda |
|
||||
| d | c | abcda |
|
||||
| d | a | abcda |
|
||||
| a | d | abcda |
|
||||
|
||||
@train @platform
|
||||
Scenario: Bike - railway platforms
|
||||
Given the node map
|
||||
"""
|
||||
x a b y
|
||||
d c
|
||||
"""
|
||||
| x | a | b | y |
|
||||
| | d | c | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | railway |
|
||||
@@ -102,11 +93,11 @@ Feature: Bike - Squares and other areas
|
||||
| from | to | route |
|
||||
| x | y | xa,abcda,by |
|
||||
| y | x | by,abcda,xa |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| a | b | abcda |
|
||||
| a | d | abcda |
|
||||
| b | c | abcda |
|
||||
| c | b | abcda |
|
||||
| c | d | abcda |
|
||||
| d | c | abcda |
|
||||
| d | a | abcda |
|
||||
| a | d | abcda |
|
||||
|
||||
@@ -10,7 +10,6 @@ Feature: Barriers
|
||||
| | x |
|
||||
| bollard | x |
|
||||
| gate | x |
|
||||
| lift_gate | x |
|
||||
| cycle_barrier | x |
|
||||
| cattle_grid | x |
|
||||
| border_control | x |
|
||||
@@ -19,7 +18,7 @@ Feature: Barriers
|
||||
| entrance | x |
|
||||
| wall | |
|
||||
| fence | |
|
||||
| some_tag | x |
|
||||
| some_tag | |
|
||||
| block | x |
|
||||
|
||||
Scenario: Bike - Access tag trumphs barriers
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
@routing @bicycle @bridge
|
||||
Feature: Bicycle - Handle cycling
|
||||
Feature: Bicycle - Handle movable bridge
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bicycle - Use a movable bridge
|
||||
Scenario: Car - Use a ferry route
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
| a | b | c | | |
|
||||
| | | d | | |
|
||||
| | | e | f | g |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | bridge | bicycle |
|
||||
@@ -19,16 +17,21 @@ Feature: Bicycle - Handle cycling
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | g | abc,cde,efg | 1,5,1 |
|
||||
| b | f | abc,cde,efg | 1,5,1 |
|
||||
| e | c | cde | 5 |
|
||||
| e | b | cde,abc | 5,1 |
|
||||
| e | a | cde,abc | 5,1 |
|
||||
| c | e | cde | 5 |
|
||||
| c | f | cde,efg | 5,1 |
|
||||
| c | g | cde,efg | 5,1 |
|
||||
|
||||
Scenario: Bicycle - Properly handle durations
|
||||
Scenario: Car - Properly handle durations
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
| a | b | c | | |
|
||||
| | | d | | |
|
||||
| | | e | f | g |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | bridge | duration |
|
||||
@@ -37,8 +40,8 @@ Feature: Bicycle - Handle cycling
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 6 km/h |
|
||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg | 1,5,1 | 5 km/h |
|
||||
| b | f | abc,cde,efg | 1,5,1 | 4 km/h |
|
||||
| c | e | cde | 5 | 2 km/h |
|
||||
| e | c | cde | 5 | 2 km/h |
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
@routing @bicycle @mode
|
||||
Feature: Bicycle - Mode flag
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bicycle - We tag ferries with a class
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route |
|
||||
| ab | primary | |
|
||||
| bc | | ferry |
|
||||
| cd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | ab,bc,cd,cd | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] |
|
||||
| d | a | cd,bc,ab,ab | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] |
|
||||
| c | a | bc,ab,ab | depart,notification left,arrive | [(ferry)],[()],[()] |
|
||||
| d | b | cd,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] |
|
||||
| a | c | ab,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] |
|
||||
| b | d | bc,cd,cd | depart,notification left,arrive | [(ferry)],[()],[()] |
|
||||
|
||||
Scenario: Bicycle - We tag tunnel with a class
|
||||
Background:
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | tunnel |
|
||||
| ab | no |
|
||||
| bc | yes |
|
||||
| cd | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] |
|
||||
|
||||
Scenario: Bicycle - We tag classes without intersections
|
||||
Background:
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | tunnel |
|
||||
| ab | road | |
|
||||
| bc | road | yes |
|
||||
| cd | road | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | d | road,road | depart,arrive | [(),(tunnel),()],[()] |
|
||||
|
||||
Scenario: Bicycle - From roundabout on ferry
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
/ \
|
||||
a---b d---f--h
|
||||
\ /
|
||||
e
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | highway | junction | route |
|
||||
| ab | yes | service | | |
|
||||
| cb | yes | service | roundabout | |
|
||||
| dc | yes | service | roundabout | |
|
||||
| be | yes | service | roundabout | |
|
||||
| ed | yes | service | roundabout | |
|
||||
| eg | yes | service | | |
|
||||
| df | | | | ferry |
|
||||
| fh | yes | service | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | classes |
|
||||
| a | h | ab,df,df,fh,fh | depart,roundabout-exit-2,exit roundabout slight right,notification straight,arrive | [()],[(),()],[(ferry)],[()],[()] |
|
||||
@@ -46,14 +46,12 @@ Feature: Bike - Cycle tracks/lanes
|
||||
| primary | | | | x | x |
|
||||
| motorway | | | | | |
|
||||
| motorway | track | | | x | |
|
||||
| motorway | opposite | | | x | x |
|
||||
| motorway | | track | | x | |
|
||||
| motorway | | opposite | | x | x |
|
||||
| motorway | opposite | | | | x |
|
||||
| motorway | | track | | | x |
|
||||
| motorway | | opposite | | | x |
|
||||
| motorway | | | track | x | |
|
||||
| motorway | | | opposite | x | x |
|
||||
# motorways are implicit oneways and cycleway tracks next to oneways always
|
||||
# follow the oneway direction (unless tagged as opposite)
|
||||
| motorway | | track | track | x | |
|
||||
| motorway | | | opposite | x | |
|
||||
| motorway | | track | track | x | x |
|
||||
| motorway | | opposite | opposite | x | x |
|
||||
| motorway | | track | opposite | x | x |
|
||||
| motorway | | opposite | track | x | x |
|
||||
@@ -81,19 +79,3 @@ Feature: Bike - Cycle tracks/lanes
|
||||
| residential | lane | yes | x | x |
|
||||
| footway | lane | yes | x | x |
|
||||
| cycleway | lane | yes | x | x |
|
||||
|
||||
Scenario: Bike - Cycleway on oneways, modes
|
||||
Then routability should be
|
||||
| highway | cycleway | oneway | forw | backw |
|
||||
| motorway | track | yes | cycling | |
|
||||
| residential | track | yes | cycling | pushing bike |
|
||||
| cycleway | track | yes | cycling | pushing bike |
|
||||
| footway | track | yes | cycling | pushing bike |
|
||||
|
||||
Scenario: Bike - Cycleway on oneways, speeds
|
||||
Then routability should be
|
||||
| highway | cycleway | oneway | forw | backw |
|
||||
| motorway | track | yes | 15 km/h | |
|
||||
| residential | track | yes | 15 km/h | 4 km/h +-1 |
|
||||
| cycleway | track | yes | 15 km/h | 4 km/h +-1 |
|
||||
| footway | track | yes | 15 km/h | 4 km/h +-1 |
|
||||
|
||||
@@ -6,12 +6,10 @@ Feature: Bike - Destination only, no passing through
|
||||
|
||||
Scenario: Bike - Destination only street
|
||||
Given the node map
|
||||
"""
|
||||
a e
|
||||
b c d
|
||||
|
||||
x y
|
||||
"""
|
||||
| a | | | | e |
|
||||
| | b | c | d | |
|
||||
| | | | | |
|
||||
| x | | | | y |
|
||||
|
||||
And the ways
|
||||
| nodes | access |
|
||||
@@ -21,24 +19,22 @@ Feature: Bike - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bcd |
|
||||
| a | d | ab,bcd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,bcd |
|
||||
| e | b | de,bcd |
|
||||
| e | a | axye,axye |
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab,bcd |
|
||||
| a | d | ab,bcd |
|
||||
| a | e | axye |
|
||||
| e | d | de |
|
||||
| e | c | de,bcd |
|
||||
| e | b | de,bcd |
|
||||
| e | a | axye |
|
||||
|
||||
Scenario: Bike - Destination only street
|
||||
Given the node map
|
||||
"""
|
||||
a e
|
||||
b c d
|
||||
|
||||
x y
|
||||
"""
|
||||
| a | | | | e |
|
||||
| | b | c | d | |
|
||||
| | | | | |
|
||||
| x | | | | y |
|
||||
|
||||
And the ways
|
||||
| nodes | access |
|
||||
@@ -49,23 +45,21 @@ Feature: Bike - Destination only, no passing through
|
||||
| axye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bc |
|
||||
| a | d | ab,bc,cd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,cd,cd |
|
||||
| e | b | de,cd,bc |
|
||||
| e | a | axye,axye |
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| a | c | ab,bc |
|
||||
| a | d | ab,bc,cd |
|
||||
| a | e | axye |
|
||||
| e | d | de |
|
||||
| e | c | de,dc |
|
||||
| e | b | de,dc,bc |
|
||||
| e | a | axye |
|
||||
|
||||
Scenario: Bike - Routing inside a destination only area
|
||||
Given the node map
|
||||
"""
|
||||
a c e
|
||||
b d
|
||||
x y
|
||||
"""
|
||||
| a | | c | | e |
|
||||
| | b | | d | |
|
||||
| x | | | | y |
|
||||
|
||||
And the ways
|
||||
| nodes | access |
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
@routing @bicycle
|
||||
Feature: Bike - Use distance weight
|
||||
|
||||
Background:
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Scenario: Bike - Check distance weight
|
||||
Given the profile file
|
||||
"""
|
||||
local functions = require('bicycle')
|
||||
functions.setup_testbot = functions.setup
|
||||
|
||||
functions.setup = function()
|
||||
local profile = functions.setup_testbot()
|
||||
profile.properties.weight_name = 'distance'
|
||||
return profile
|
||||
end
|
||||
|
||||
return functions
|
||||
"""
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a-b-c
|
||||
"""
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | residential |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | weight | time | distance |
|
||||
| a | b | abc,abc | 200 | 48s | 200m +-1 |
|
||||
| a | c | abc,abc | 400 | 96s | 400m +-1 |
|
||||
@@ -1,55 +0,0 @@
|
||||
@routing @bicycle @exclude
|
||||
Feature: Bicycle - Exclude flags
|
||||
Background:
|
||||
Given the profile file "bicycle" initialized with
|
||||
"""
|
||||
profile.excludable = Sequence { Set { 'ferry' } }
|
||||
"""
|
||||
Given the node map
|
||||
"""
|
||||
a....b~~~~~c...f
|
||||
: :
|
||||
d.....e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | duration | # |
|
||||
| ab | service | | | always drivable |
|
||||
| bc | | ferry | 00:00:01 | not drivable for exclude=ferry, but fast. |
|
||||
| bd | service | | | always drivable |
|
||||
| de | service | | | always drivable |
|
||||
| ec | service | | | always drivable |
|
||||
| cf | service | | | always drivable |
|
||||
|
||||
Scenario: Bicycle - exclude nothing
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | f | ab,bc,cf,cf |
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | duration |
|
||||
| abcf | abcf | 109 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f |
|
||||
| a | 0 | 109 |
|
||||
| f | 109 | 0 |
|
||||
|
||||
Scenario: Bicycle - exclude ferry
|
||||
Given the query options
|
||||
| exclude | ferry |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | f | ab,bd,de,ec,cf,cf |
|
||||
|
||||
When I match I should get
|
||||
| trace | matchings | duration |
|
||||
| abcf | abcf | 301.2 |
|
||||
|
||||
When I request a travel time matrix I should get
|
||||
| | a | f |
|
||||
| a | 0 | 301 +- 1 |
|
||||
| f | 301.2 +- 1 | 0 |
|
||||
|
||||
|
||||
@@ -6,11 +6,9 @@ Feature: Bike - Handle ferry routes
|
||||
|
||||
Scenario: Bike - Ferry route
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
| a | b | c | | |
|
||||
| | | d | | |
|
||||
| | | e | f | g |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | bicycle |
|
||||
@@ -19,19 +17,22 @@ Feature: Bike - Handle ferry routes
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | g | abc,cde,efg,efg |
|
||||
| c | e | cde,cde |
|
||||
| c | g | cde,efg,efg |
|
||||
| from | to | route |
|
||||
| a | g | abc,cde,efg |
|
||||
| b | f | abc,cde,efg |
|
||||
| e | c | cde |
|
||||
| e | b | cde,abc |
|
||||
| e | a | cde,abc |
|
||||
| c | e | cde |
|
||||
| c | f | cde,efg |
|
||||
| c | g | cde,efg |
|
||||
|
||||
Scenario: Bike - Ferry duration, single node
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
e f
|
||||
g h
|
||||
i j
|
||||
"""
|
||||
| a | b | c | d |
|
||||
| | | e | f |
|
||||
| | | g | h |
|
||||
| | | i | j |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | bicycle | duration |
|
||||
@@ -47,9 +48,8 @@ Feature: Bike - Handle ferry routes
|
||||
|
||||
Scenario: Bike - Ferry duration, multiple nodes
|
||||
Given the node map
|
||||
"""
|
||||
x a b c d y
|
||||
"""
|
||||
| x | | | | | y |
|
||||
| | a | b | c | d | |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | bicycle | duration |
|
||||
@@ -58,6 +58,6 @@ Feature: Bike - Handle ferry routes
|
||||
| abcd | | ferry | yes | 1:00 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s |
|
||||
| d | a | abcd,abcd | 3600s |
|
||||
| from | to | route | time |
|
||||
| a | d | abcd | 3600s +-10 |
|
||||
| d | a | abcd | 3600s +-10 |
|
||||
|
||||
@@ -9,7 +9,7 @@ Feature: Bike - Max speed restrictions
|
||||
Then routability should be
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h |
|
||||
| residential | 10 | 9 km/h |
|
||||
| residential | 10 | 10 km/h |
|
||||
|
||||
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
||||
Then routability should be
|
||||
@@ -40,9 +40,7 @@ Feature: Bike - Max speed restrictions
|
||||
|
||||
Scenario: Bike - Do not use maxspeed when higher that way type speed
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed |
|
||||
@@ -50,9 +48,9 @@ Feature: Bike - Max speed restrictions
|
||||
| bc | residential | 80 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 15 km/h |
|
||||
| b | c | bc,bc | 15 km/h |
|
||||
| from | to | route | speed |
|
||||
| a | b | ab | 15 km/h |
|
||||
| b | c | bc | 15 km/h |
|
||||
|
||||
Scenario: Bike - Forward/backward maxspeed
|
||||
Given the shortcuts
|
||||
@@ -65,12 +63,12 @@ Feature: Bike - Max speed restrictions
|
||||
Then routability should be
|
||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| | | | 15 km/h | 15 km/h |
|
||||
| 10 | | | 9 km/h | 9 km/h |
|
||||
| | 10 | | 9 km/h | 15 km/h |
|
||||
| | | 10 | 14 km/h | 9 km/h |
|
||||
| 2 | 10 | | 9 km/h | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 9 km/h |
|
||||
| 2 | 5 | 10 | 5 km/h | 9 km/h |
|
||||
| 10 | | | 10 km/h | 10 km/h |
|
||||
| | 10 | | 10 km/h | 15 km/h |
|
||||
| | | 10 | 15 km/h | 10 km/h |
|
||||
| 2 | 10 | | 10 km/h | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 10 km/h |
|
||||
| 2 | 5 | 10 | 5 km/h | 10 km/h |
|
||||
|
||||
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
||||
Then routability should be
|
||||
|
||||
+122
-42
@@ -1,15 +1,19 @@
|
||||
@routing @bicycle @mode
|
||||
Feature: Bike - Mode flag
|
||||
|
||||
# bicycle modes:
|
||||
# 1 bike
|
||||
# 2 pushing
|
||||
# 3 ferry
|
||||
# 4 train
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
|
||||
Scenario: Bike - Mode when using a ferry
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | duration |
|
||||
@@ -18,17 +22,18 @@ Feature: Bike - Mode flag
|
||||
| cd | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,ferry,cycling,cycling |
|
||||
| c | a | bc,ab,ab | ferry,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,ferry,ferry |
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd | head,right,left,destination | 1,3,1 |
|
||||
| d | a | cd,bc,ab | head,right,left,destination | 1,3,1 |
|
||||
| c | a | bc,ab | head,left,destination | 3,1 |
|
||||
| d | b | cd,bc | head,right,destination | 1,3 |
|
||||
| a | c | ab,bc | head,right,destination | 1,3 |
|
||||
| b | d | bc,cd | head,left,destination | 3,1 |
|
||||
|
||||
Scenario: Bike - Mode when using a train
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | railway | bicycle |
|
||||
@@ -37,61 +42,136 @@ Feature: Bike - Mode flag
|
||||
| cd | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,train,cycling,cycling |
|
||||
| c | a | bc,ab,ab | train,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,train,train |
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd | head,right,left,destination | 1,4,1 |
|
||||
| d | a | cd,bc,ab | head,right,left,destination | 1,4,1 |
|
||||
| c | a | bc,ab | head,left,destination | 4,1 |
|
||||
| d | b | cd,bc | head,right,destination | 1,4 |
|
||||
| a | c | ab,bc | head,right,destination | 1,4 |
|
||||
| b | d | bc,cd | head,left,destination | 4,1 |
|
||||
|
||||
#representative test for all pushes (and mode changes). Where a bike is pushed is tested over in access.feature
|
||||
Scenario: Bike - Mode when pushing bike against oneways
|
||||
Given the node map
|
||||
"""
|
||||
a b e
|
||||
f c d
|
||||
"""
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | |
|
||||
| bc | primary | yes |
|
||||
| cd | primary | |
|
||||
| be | primary | |
|
||||
| cf | primary | |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd | head,straight,straight,destination | 1,1,1 |
|
||||
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||
| a | c | ab,bc | head,straight,destination | 1,1 |
|
||||
| b | d | bc,cd | head,straight,destination | 1,1 |
|
||||
|
||||
Scenario: Bike - Mode when pushing on pedestrain streets
|
||||
Given the node map
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | pedestrian |
|
||||
| cd | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
|
||||
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||
| a | c | ab,bc | head,right,destination | 1,2 |
|
||||
| b | d | bc,cd | head,left,destination | 2,1 |
|
||||
|
||||
Scenario: Bike - Mode when pushing on pedestrain areas
|
||||
Given the node map
|
||||
| a | b | | |
|
||||
| | c | d | f |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | area |
|
||||
| ab | primary | |
|
||||
| bcd | pedestrian | yes |
|
||||
| df | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | f | ab,bcd,df | 1,2,1 |
|
||||
| f | a | df,bcd,ab | 1,2,1 |
|
||||
| d | a | bcd,ab | 2,1 |
|
||||
| f | b | df,bcd | 1,2 |
|
||||
| a | d | ab,bcd | 1,2 |
|
||||
| b | f | bcd,df | 2,1 |
|
||||
|
||||
Scenario: Bike - Mode when pushing on steps
|
||||
Given the node map
|
||||
| a | b | | |
|
||||
| | c | d | f |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | steps |
|
||||
| cd | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
|
||||
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||
| a | c | ab,bc | head,right,destination | 1,2 |
|
||||
| b | d | bc,cd | head,left,destination | 2,1 |
|
||||
|
||||
Scenario: Bike - Mode when bicycle=dismount
|
||||
Given the node map
|
||||
| a | b | | |
|
||||
| | c | d | f |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | bicycle |
|
||||
| ab | primary | |
|
||||
| bc | primary | dismount |
|
||||
| cd | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | modes |
|
||||
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
|
||||
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
|
||||
| c | a | bc,ab | head,left,destination | 2,1 |
|
||||
| d | b | cd,bc | head,right,destination | 1,2 |
|
||||
| a | c | ab,bc | head,right,destination | 1,2 |
|
||||
| b | d | bc,cd | head,left,destination | 2,1 |
|
||||
|
||||
Scenario: Bicycle - Modes when starting on forward oneway
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
| a | b |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | b | ab,ab | cycling,cycling |
|
||||
| b | a | ab,ab | pushing bike,pushing bike |
|
||||
| from | to | route | modes |
|
||||
| a | b | ab | 1 |
|
||||
| b | a | ab | 2 |
|
||||
|
||||
Scenario: Bicycle - Modes when starting on reverse oneway
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
"""
|
||||
| a | b |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| ab | -1 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | b | ab,ab | pushing bike,pushing bike |
|
||||
| b | a | ab,ab | cycling,cycling |
|
||||
| from | to | route | modes |
|
||||
| a | b | ab | 2 |
|
||||
| b | a | ab | 1 |
|
||||
|
||||
@@ -6,26 +6,22 @@ Feature: Bike - Street names in instructions
|
||||
|
||||
Scenario: Bike - A named street
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c
|
||||
"""
|
||||
| a | b |
|
||||
| | c |
|
||||
|
||||
And the ways
|
||||
| nodes | name | ref |
|
||||
| ab | My Way | A6 |
|
||||
| bc | Your Way | A7 |
|
||||
| nodes | name |
|
||||
| ab | My Way |
|
||||
| bc | Your Way |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,Your Way | A6,A7 |
|
||||
| from | to | route |
|
||||
| a | c | My Way,Your Way |
|
||||
|
||||
@unnamed
|
||||
Scenario: Bike - No longer use way type to describe unnamed ways, see #3231
|
||||
Scenario: Bike - Use way type to describe unnamed ways
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
| a | b | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
@@ -33,5 +29,5 @@ Feature: Bike - Street names in instructions
|
||||
| bcd | track | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | , |
|
||||
| from | to | route |
|
||||
| a | d | {highway:cycleway},{highway:track} |
|
||||
|
||||
@@ -8,22 +8,18 @@ Feature: Bike - Oneway streets
|
||||
|
||||
Scenario: Bike - Simple oneway
|
||||
Then routability should be
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | yes | cycling | |
|
||||
| primary | | yes | cycling | pushing bike |
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | yes | x | |
|
||||
|
||||
Scenario: Simple reverse oneway
|
||||
Then routability should be
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | -1 | | cycling |
|
||||
| primary | | -1 | pushing bike | cycling |
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | -1 | | x |
|
||||
|
||||
Scenario: Bike - Around the Block
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
f d c e
|
||||
"""
|
||||
| a | b |
|
||||
| d | c |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
@@ -31,99 +27,95 @@ Feature: Bike - Oneway streets
|
||||
| bc | | no |
|
||||
| cd | | no |
|
||||
| da | | no |
|
||||
| df | | no |
|
||||
| ce | | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| b | a | bc,cd,da,da |
|
||||
| from | to | route |
|
||||
| a | b | ab |
|
||||
| b | a | bc,cd,da |
|
||||
|
||||
Scenario: Bike - Handle various oneway tag values
|
||||
Then routability should be
|
||||
| foot | oneway | forw | backw |
|
||||
| no | | cycling | cycling |
|
||||
| no | nonsense | cycling | cycling |
|
||||
| no | no | cycling | cycling |
|
||||
| no | false | cycling | cycling |
|
||||
| no | 0 | cycling | cycling |
|
||||
| no | yes | cycling | |
|
||||
| no | true | cycling | |
|
||||
| no | 1 | cycling | |
|
||||
| no | -1 | | cycling |
|
||||
| foot | oneway | forw | backw |
|
||||
| no | | x | x |
|
||||
| no | nonsense | x | x |
|
||||
| no | no | x | x |
|
||||
| no | false | x | x |
|
||||
| no | 0 | x | x |
|
||||
| no | yes | x | |
|
||||
| no | true | x | |
|
||||
| no | 1 | x | |
|
||||
| no | -1 | | x |
|
||||
|
||||
Scenario: Bike - Implied oneways
|
||||
Then routability should be
|
||||
| highway | foot | bicycle | junction | forw | backw | # |
|
||||
| | no | | | cycling | cycling | |
|
||||
| | no | | roundabout | cycling | | |
|
||||
| motorway | no | yes | | cycling | | |
|
||||
| motorway_link | no | yes | | cycling | cycling | does not imply oneway |
|
||||
| motorway | no | yes | roundabout | cycling | | |
|
||||
| motorway_link | no | yes | roundabout | cycling | | |
|
||||
| highway | foot | bicycle | junction | forw | backw |
|
||||
| | no | | | x | x |
|
||||
| | no | | roundabout | x | |
|
||||
| motorway | no | yes | | x | |
|
||||
| motorway_link | no | yes | | x | |
|
||||
| motorway | no | yes | roundabout | x | |
|
||||
| motorway_link | no | yes | roundabout | x | |
|
||||
|
||||
Scenario: Bike - Overriding implied oneways
|
||||
Then routability should be
|
||||
| highway | foot | junction | oneway | forw | backw |
|
||||
| primary | no | roundabout | no | cycling | cycling |
|
||||
| primary | no | roundabout | yes | cycling | |
|
||||
| motorway_link | no | | -1 | | |
|
||||
| trunk_link | no | | -1 | | |
|
||||
| primary | no | roundabout | -1 | | cycling |
|
||||
| highway | foot | junction | oneway | forw | backw |
|
||||
| primary | no | roundabout | no | x | x |
|
||||
| primary | no | roundabout | yes | x | |
|
||||
| motorway_link | no | | -1 | | |
|
||||
| trunk_link | no | | -1 | | |
|
||||
| primary | no | roundabout | -1 | | x |
|
||||
|
||||
Scenario: Bike - Oneway:bicycle should override normal oneways tags
|
||||
Then routability should be
|
||||
| foot | oneway:bicycle | oneway | junction | forw | backw |
|
||||
| no | yes | | | cycling | |
|
||||
| no | yes | yes | | cycling | |
|
||||
| no | yes | no | | cycling | |
|
||||
| no | yes | -1 | | cycling | |
|
||||
| no | yes | | roundabout | cycling | |
|
||||
| no | no | | | cycling | cycling |
|
||||
| no | no | yes | | cycling | cycling |
|
||||
| no | no | no | | cycling | cycling |
|
||||
| no | no | -1 | | cycling | cycling |
|
||||
| no | no | | roundabout | cycling | cycling |
|
||||
| no | -1 | | | | cycling |
|
||||
| no | -1 | yes | | | cycling |
|
||||
| no | -1 | no | | | cycling |
|
||||
| no | -1 | -1 | | | cycling |
|
||||
| no | -1 | | roundabout | | cycling |
|
||||
| foot | oneway:bicycle | oneway | junction | forw | backw |
|
||||
| no | yes | | | x | |
|
||||
| no | yes | yes | | x | |
|
||||
| no | yes | no | | x | |
|
||||
| no | yes | -1 | | x | |
|
||||
| no | yes | | roundabout | x | |
|
||||
| no | no | | | x | x |
|
||||
| no | no | yes | | x | x |
|
||||
| no | no | no | | x | x |
|
||||
| no | no | -1 | | x | x |
|
||||
| no | no | | roundabout | x | x |
|
||||
| no | -1 | | | | x |
|
||||
| no | -1 | yes | | | x |
|
||||
| no | -1 | no | | | x |
|
||||
| no | -1 | -1 | | | x |
|
||||
| no | -1 | | roundabout | | x |
|
||||
|
||||
Scenario: Bike - Contra flow
|
||||
Then routability should be
|
||||
| foot | oneway | cycleway | forw | backw |
|
||||
| no | yes | opposite | cycling | cycling |
|
||||
| no | yes | opposite_track | cycling | cycling |
|
||||
| no | yes | opposite_lane | cycling | cycling |
|
||||
| no | -1 | opposite | cycling | cycling |
|
||||
| no | -1 | opposite_track | cycling | cycling |
|
||||
| no | -1 | opposite_lane | cycling | cycling |
|
||||
| no | no | opposite | cycling | cycling |
|
||||
| no | no | opposite_track | cycling | cycling |
|
||||
| no | no | opposite_lane | cycling | cycling |
|
||||
| foot | oneway | cycleway | forw | backw |
|
||||
| no | yes | opposite | x | x |
|
||||
| no | yes | opposite_track | x | x |
|
||||
| no | yes | opposite_lane | x | x |
|
||||
| no | -1 | opposite | x | x |
|
||||
| no | -1 | opposite_track | x | x |
|
||||
| no | -1 | opposite_lane | x | x |
|
||||
| no | no | opposite | x | x |
|
||||
| no | no | opposite_track | x | x |
|
||||
| no | no | opposite_lane | x | x |
|
||||
|
||||
Scenario: Bike - Should not be affected by car tags
|
||||
Then routability should be
|
||||
| foot | junction | oneway | oneway:car | forw | backw |
|
||||
| no | | yes | yes | cycling | |
|
||||
| no | | yes | no | cycling | |
|
||||
| no | | yes | -1 | cycling | |
|
||||
| no | | no | yes | cycling | cycling |
|
||||
| no | | no | no | cycling | cycling |
|
||||
| no | | no | -1 | cycling | cycling |
|
||||
| no | | -1 | yes | | cycling |
|
||||
| no | | -1 | no | | cycling |
|
||||
| no | | -1 | -1 | | cycling |
|
||||
| no | roundabout | | yes | cycling | |
|
||||
| no | roundabout | | no | cycling | |
|
||||
| no | roundabout | | -1 | cycling | |
|
||||
| foot | junction | oneway | oneway:car | forw | backw |
|
||||
| no | | yes | yes | x | |
|
||||
| no | | yes | no | x | |
|
||||
| no | | yes | -1 | x | |
|
||||
| no | | no | yes | x | x |
|
||||
| no | | no | no | x | x |
|
||||
| no | | no | -1 | x | x |
|
||||
| no | | -1 | yes | | x |
|
||||
| no | | -1 | no | | x |
|
||||
| no | | -1 | -1 | | x |
|
||||
| no | roundabout | | yes | x | |
|
||||
| no | roundabout | | no | x | |
|
||||
| no | roundabout | | -1 | x | |
|
||||
|
||||
Scenario: Bike - Two consecutive oneways
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
@@ -132,21 +124,5 @@ Feature: Bike - Oneway streets
|
||||
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | ab,bc,bc |
|
||||
|
||||
|
||||
Scenario: Bike - Left/right cycleways on oneways
|
||||
Then routability should be
|
||||
| highway | oneway | cycleway:left | cycleway:right | forw | backw |
|
||||
| primary | yes | | | cycling | pushing bike |
|
||||
| primary | yes | | track | cycling | pushing bike |
|
||||
| primary | yes | track | | cycling | pushing bike |
|
||||
| primary | yes | track | track | cycling | pushing bike |
|
||||
|
||||
Scenario: Bike - Left/right cycleways on any oneways
|
||||
Then routability should be
|
||||
| foot | oneway | cycleway:left | cycleway:right | forw | backw |
|
||||
| no | yes | track | | cycling | |
|
||||
| yes | yes | track | | cycling | pushing bike |
|
||||
| yes | -1 | track | | pushing bike | cycling |
|
||||
| from | to | route |
|
||||
| a | c | ab,bc |
|
||||
|
||||
@@ -3,39 +3,41 @@ Feature: Bike - Accessability of different way types
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given the shortcuts
|
||||
| key | value |
|
||||
| bike | 15 km/h ~20% |
|
||||
| foot | 5 km/h ~20% |
|
||||
|
||||
Scenario: Bike - Pushing bikes on pedestrian-only ways
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| cycleway | | cycling | cycling |
|
||||
| primary | | cycling | cycling |
|
||||
| pedestrian | | pushing bike | pushing bike |
|
||||
| cycleway | | cycling | cycling |
|
||||
| primary | yes | cycling | pushing bike |
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| cycleway | | bike | bike |
|
||||
| primary | | bike | bike |
|
||||
| pedestrian | | foot | foot |
|
||||
| footway | | foot | foot |
|
||||
| primary | yes | bike | foot |
|
||||
|
||||
Scenario: Bike - Pushing bikes against normal oneways
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | yes | cycling | pushing bike |
|
||||
| pedestrian | yes | pushing bike | pushing bike |
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | yes | bike | foot |
|
||||
| pedestrian | yes | foot | foot |
|
||||
|
||||
Scenario: Bike - Pushing bikes against reverse oneways
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | -1 | pushing bike | cycling |
|
||||
| pedestrian | -1 | pushing bike | pushing bike |
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | -1 | foot | bike |
|
||||
| pedestrian | -1 | foot | foot |
|
||||
|
||||
@square
|
||||
@square
|
||||
Scenario: Bike - Push bikes on pedestrian areas
|
||||
Given the node map
|
||||
"""
|
||||
x
|
||||
a b
|
||||
d c
|
||||
"""
|
||||
| x | |
|
||||
| a | b |
|
||||
| d | c |
|
||||
|
||||
And the ways
|
||||
| nodes | area | highway |
|
||||
@@ -43,75 +45,70 @@ Feature: Bike - Accessability of different way types
|
||||
| abcda | yes | pedestrian |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| from | to | route |
|
||||
| a | b | abcda |
|
||||
| a | d | abcda |
|
||||
| b | c | abcda |
|
||||
| c | b | abcda |
|
||||
| c | d | abcda |
|
||||
| d | c | abcda |
|
||||
| d | a | abcda |
|
||||
| a | d | abcda |
|
||||
|
||||
Scenario: Bike - Pushing bikes on ways with foot=yes
|
||||
Then routability should be
|
||||
| highway | foot | forw | backw |
|
||||
| motorway | | | |
|
||||
| motorway | yes | pushing bike | |
|
||||
| runway | | | |
|
||||
| runway | yes | pushing bike | pushing bike |
|
||||
|
||||
| highway | foot | forw | backw |
|
||||
| motorway | | | |
|
||||
| motorway | yes | foot | |
|
||||
| runway | | | |
|
||||
| runway | yes | foot | foot |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
|
||||
Then routability should be
|
||||
| highway | foot:forward | foot:backward | forw | backw |
|
||||
| motorway | | | | |
|
||||
| motorway | yes | | pushing bike | |
|
||||
| motorway | | yes | | pushing bike |
|
||||
| highway | foot:forward | foot:backward | forw | backw |
|
||||
| motorway | | | | |
|
||||
| motorway | yes | | foot | |
|
||||
| motorway | | yes | | foot |
|
||||
|
||||
@construction
|
||||
Scenario: Bike - Don't allow routing on ways still under construction
|
||||
Scenario: Bike - Don't allow routing on ways still under construction
|
||||
Then routability should be
|
||||
| highway | foot | bicycle | bothw |
|
||||
| primary | | | x |
|
||||
| construction | | | |
|
||||
| construction | yes | | |
|
||||
| construction | | yes | |
|
||||
|
||||
|
||||
@roundabout
|
||||
Scenario: Bike - Don't push bikes against oneway flow on roundabouts
|
||||
Then routability should be
|
||||
| junction | forw | backw |
|
||||
| roundabout | x | |
|
||||
|
||||
|
||||
Scenario: Bike - Instructions when pushing bike on oneways
|
||||
Given the node map
|
||||
"""
|
||||
a b e
|
||||
f c d
|
||||
"""
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | |
|
||||
| bc | primary | yes |
|
||||
| cd | primary | |
|
||||
| be | primary | |
|
||||
| cf | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| from | to | route | turns |
|
||||
| a | d | ab,bc,cd | head,straight,straight,destination |
|
||||
| d | a | cd,bc,ab | head,right,left,destination |
|
||||
| c | a | bc,ab | head,left,destination |
|
||||
| d | b | cd,bc | head,right,destination |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
| a | b | |
|
||||
| | c | d |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
@@ -120,8 +117,8 @@ Feature: Bike - Accessability of different way types
|
||||
| cd | primary |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| from | to | route | turns |
|
||||
| a | d | ab,bc,cd | head,right,left,destination |
|
||||
| d | a | cd,bc,ab | head,right,left,destination |
|
||||
| c | a | bc,ab | head,left,destination |
|
||||
| d | b | cd,bc | head,right,destination |
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
@routing @bicycle @ref @name
|
||||
Feature: Bike - Way ref
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bike - Way with both name and ref
|
||||
Given the node map
|
||||
| a | b |
|
||||
|
||||
And the ways
|
||||
| nodes | name | ref |
|
||||
| ab | Utopia Drive | E7 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | Utopia Drive / E7 |
|
||||
|
||||
Scenario: Bike - Way with only ref
|
||||
Given the node map
|
||||
| a | b |
|
||||
|
||||
And the ways
|
||||
| nodes | name | ref |
|
||||
| ab | | E7 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | E7 |
|
||||
|
||||
Scenario: Bike - Way with only name
|
||||
Given the node map
|
||||
| a | b |
|
||||
|
||||
And the ways
|
||||
| nodes | name |
|
||||
| ab | Utopia Drive |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | Utopia Drive |
|
||||
@@ -5,18 +5,13 @@ Feature: Bike - Turn restrictions
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given a grid size of 200 meters
|
||||
|
||||
# check to see if bicycle profiles handle relations. The code path is the same as in cars.
|
||||
# If relations are passed, all variants tested in car also work for bike
|
||||
@no_turning
|
||||
Scenario: Bike - No left turn
|
||||
Given the node map
|
||||
"""
|
||||
n
|
||||
w j e
|
||||
s
|
||||
"""
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
@@ -30,20 +25,185 @@ Feature: Bike - Turn restrictions
|
||||
| restriction | sj | wj | j | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj,wj |
|
||||
| s | n | sj,nj,nj |
|
||||
| s | e | sj,ej,ej |
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@no_turning
|
||||
Scenario: Bike - No right turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
| sj | yes | no |
|
||||
| nj | -1 | no |
|
||||
| wj | -1 | no |
|
||||
| ej | -1 | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | ej | j | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@no_turning
|
||||
Scenario: Bike - No u-turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
| sj | yes | no |
|
||||
| nj | -1 | no |
|
||||
| wj | -1 | no |
|
||||
| ej | -1 | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | wj | j | no_u_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@no_turning
|
||||
Scenario: Bike - Handle any no_* relation
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
| sj | yes | no |
|
||||
| nj | -1 | no |
|
||||
| wj | -1 | no |
|
||||
| ej | -1 | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | wj | j | no_weird_zigzags |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@only_turning
|
||||
Scenario: Bike - Only left turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
| sj | yes | no |
|
||||
| nj | -1 | no |
|
||||
| wj | -1 | no |
|
||||
| ej | -1 | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | wj | j | only_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@only_turning
|
||||
Scenario: Bike - Only right turn
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
| sj | yes | no |
|
||||
| nj | -1 | no |
|
||||
| wj | -1 | no |
|
||||
| ej | -1 | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | ej | j | only_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@only_turning
|
||||
Scenario: Bike - Only straight on
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
| sj | yes | no |
|
||||
| nj | -1 | no |
|
||||
| wj | -1 | no |
|
||||
| ej | -1 | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | nj | j | only_straight_on |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
@no_turning
|
||||
Scenario: Bike - Handle any only_* restriction
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
| sj | yes | no |
|
||||
| nj | -1 | no |
|
||||
| wj | -1 | no |
|
||||
| ej | -1 | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | nj | j | only_weird_zigzags |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj |
|
||||
| s | n | sj,nj |
|
||||
| s | e | sj,ej |
|
||||
|
||||
## exceptions are different for bike over car and need to be tested here
|
||||
@except
|
||||
Scenario: Bike - Except tag and on no_ restrictions
|
||||
Given the node map
|
||||
"""
|
||||
b x c
|
||||
a j d
|
||||
s
|
||||
"""
|
||||
| b | x | c |
|
||||
| a | j | d |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
@@ -62,20 +222,18 @@ Feature: Bike - Turn restrictions
|
||||
| restriction | sj | dj | j | no_right_turn | bicycle |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | a | sj,aj,aj |
|
||||
| s | b | sj,bj,bj |
|
||||
| s | c | sj,cj,cj |
|
||||
| s | d | sj,dj,dj |
|
||||
| from | to | route |
|
||||
| s | a | sj,aj |
|
||||
| s | b | sj,bj |
|
||||
| s | c | sj,cj |
|
||||
| s | d | sj,dj |
|
||||
|
||||
@except
|
||||
Scenario: Bike - Except tag and on only_ restrictions
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
j
|
||||
s
|
||||
"""
|
||||
| a | | b |
|
||||
| | j | |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
@@ -88,21 +246,19 @@ Feature: Bike - Turn restrictions
|
||||
| restriction | sj | aj | j | only_straight_on | bicycle |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | a | sj,aj,aj |
|
||||
| s | b | sj,bj,bj |
|
||||
| from | to | route |
|
||||
| s | a | sj,aj |
|
||||
| s | b | sj,bj |
|
||||
|
||||
@except
|
||||
Scenario: Bike - Multiple except tag values
|
||||
Given the node map
|
||||
"""
|
||||
s j a
|
||||
b
|
||||
c
|
||||
d
|
||||
e
|
||||
f
|
||||
"""
|
||||
| s | j | a |
|
||||
| | | b |
|
||||
| | | c |
|
||||
| | | d |
|
||||
| | | e |
|
||||
| | | f |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | foot |
|
||||
@@ -124,10 +280,10 @@ Feature: Bike - Turn restrictions
|
||||
| restriction | sj | jf | j | no_straight_on | bicycle, bus |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | a | sj,ja,ja |
|
||||
| s | b | sj,jb,jb |
|
||||
| s | c | sj,jc,jc |
|
||||
| s | d | sj,jd,jd |
|
||||
| s | e | sj,je,je |
|
||||
| s | f | sj,jf,jf |
|
||||
| from | to | route |
|
||||
| s | a | sj,ja |
|
||||
| s | b | sj,jb |
|
||||
| s | c | sj,jc |
|
||||
| s | d | sj,jd |
|
||||
| s | e | sj,je |
|
||||
| s | f | sj,jf |
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
@routing @bicycle @roundabout @instruction
|
||||
Feature: Roundabout Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bicycle - Roundabout instructions
|
||||
Given the node map
|
||||
| | | v | | |
|
||||
| | | d | | |
|
||||
| s | a | | c | u |
|
||||
| | | b | | |
|
||||
| | | t | | |
|
||||
|
||||
And the ways
|
||||
| nodes | junction |
|
||||
| sa | |
|
||||
| tb | |
|
||||
| uc | |
|
||||
| vd | |
|
||||
| abcda | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns |
|
||||
| s | t | sa,tb | head,enter_roundabout-1,destination |
|
||||
| s | u | sa,uc | head,enter_roundabout-2,destination |
|
||||
| s | v | sa,vd | head,enter_roundabout-3,destination |
|
||||
| u | v | uc,vd | head,enter_roundabout-1,destination |
|
||||
| u | s | uc,sa | head,enter_roundabout-2,destination |
|
||||
| u | t | uc,tb | head,enter_roundabout-3,destination |
|
||||
@@ -1,104 +0,0 @@
|
||||
@routing @bicycle @safety
|
||||
Feature: Bicycle - Adds penalties to unsafe roads
|
||||
|
||||
Background:
|
||||
Given the profile file "bicycle" initialized with
|
||||
"""
|
||||
profile.properties.weight_name = 'cyclability'
|
||||
"""
|
||||
|
||||
Scenario: Bike - Apply penalties to ways without cycleways
|
||||
Then routability should be
|
||||
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||
| motorway | | | | | |
|
||||
| primary | | 15 km/h | 15 km/h | 2.1 | 2.1 |
|
||||
| secondary | | 15 km/h | 15 km/h | 2.7 | 2.7 |
|
||||
| tertiary | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||
| primary_link | | 15 km/h | 15 km/h | 2.1 | 2.1 |
|
||||
| secondary_link | | 15 km/h | 15 km/h | 2.7 | 2.7 |
|
||||
| tertiary_link | | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||
| residential | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | | 4 km/h +-1 | 4 km/h +-1 | 1.1 | 1.1 |
|
||||
|
||||
Scenario: Bike - Apply no penalties to ways with cycleways
|
||||
Then routability should be
|
||||
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||
| motorway | track | 15 km/h | | 4.2 | |
|
||||
| primary | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| secondary | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| primary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| secondary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary_link | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| residential | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| motorway | lane | 15 km/h | | 4.2 | |
|
||||
| primary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| secondary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| primary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| secondary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary_link | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| residential | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| motorway | shared_lane | 15 km/h | | 4.2 | |
|
||||
| primary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
|
||||
Scenario: Bike - Apply no penalties to ways in direction of cycleways
|
||||
Then routability should be
|
||||
| highway | cycleway:right | cycleway:left | forw | backw | forw_rate | backw_rate |
|
||||
| motorway | track | | 15 km/h | | 4.2 | |
|
||||
| primary | track | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary | track | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| primary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary_link | track | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| residential | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | track | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | track | | 15 km/h | 4 km/h +-1 | 4.2 | 1.1 |
|
||||
| motorway | | track | 15 km/h | | 4.2 | |
|
||||
| primary | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary | | track | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| primary_link | | track | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary_link | | track | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary_link | | track | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| residential | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | | track | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | | track | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
||||
| motorway | lane | | 15 km/h | | 4.2 | |
|
||||
| primary | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| primary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| secondary_link | lane | | 15 km/h | 15 km/h | 4.2 | 2.7 |
|
||||
| tertiary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.3 |
|
||||
| residential | lane | | 15 km/h +-1 | 15 km/h +-1 | 4.2 | 4.2 |
|
||||
| cycleway | lane | | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | lane | | 15 km/h | 4 km/h +-1 | 4.2 | 1.1 |
|
||||
| motorway | | lane | 15 km/h | | 4.2 | |
|
||||
| primary | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 2.7 | 4.2 |
|
||||
| tertiary | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| primary_link | | lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
| secondary_link | | lane | 15 km/h | 15 km/h | 2.7 | 4.2 |
|
||||
| tertiary_link | | lane | 15 km/h | 15 km/h | 3.3 | 4.2 |
|
||||
| residential | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| cycleway | | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| footway | | lane | 4 km/h +-1 | 15 km/h | 1.1 | 4.2 |
|
||||
| motorway | shared_lane | | 15 km/h | | 4.2 | |
|
||||
| primary | shared_lane | | 15 km/h | 15 km/h | 4.2 | 2.1 |
|
||||
| motorway | | shared_lane | 15 km/h | | 4.2 | |
|
||||
| primary | | shared_lane | 15 km/h | 15 km/h | 2.1 | 4.2 |
|
||||
|
||||
|
||||
Scenario: Bike - Don't apply penalties for all kind of cycleways
|
||||
Then routability should be
|
||||
| highway | cycleway | forw | backw | forw_rate | backw_rate |
|
||||
| tertiary | shared_lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary | lane | 15 km/h | 15 km/h | 4.2 | 4.2 |
|
||||
| tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 3.3 |
|
||||
@@ -1,53 +0,0 @@
|
||||
@routing @bicycle @startpoint
|
||||
Feature: Bike - Allowed start/end modes
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bike - Don't start/stop on ferries
|
||||
Given the node map
|
||||
"""
|
||||
a 1 b 2 c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | bicycle |
|
||||
| ab | primary | | |
|
||||
| bc | | ferry | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| 1 | 2 | ab,ab | cycling,cycling |
|
||||
| 2 | 1 | ab,ab | cycling,cycling |
|
||||
|
||||
Scenario: Bike - Don't start/stop on trains
|
||||
Given the node map
|
||||
"""
|
||||
a 1 b 2 c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | railway | bicycle |
|
||||
| ab | primary | | |
|
||||
| bc | | train | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| 1 | 2 | ab,ab | cycling,cycling |
|
||||
| 2 | 1 | ab,ab | cycling,cycling |
|
||||
|
||||
Scenario: Bike - OK to start pushing bike
|
||||
Given the node map
|
||||
"""
|
||||
a 1 b 2 c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| bc | steps |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| 1 | 2 | ab,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| 2 | 1 | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
@@ -14,10 +14,8 @@ Feature: Bike - Stop areas for public transport
|
||||
|
||||
Scenario: Bike - railway platforms
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
s t
|
||||
"""
|
||||
| a | b | c | d |
|
||||
| | s | t | |
|
||||
|
||||
And the nodes
|
||||
| node | public_transport |
|
||||
@@ -33,7 +31,7 @@ Feature: Bike - Stop areas for public transport
|
||||
| public_transport | stop_area | c | st |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | d | abcd,abcd |
|
||||
| s | t | st,st |
|
||||
| s | d | /st,.+,abcd/,abcd/ |
|
||||
| from | to | route |
|
||||
| a | d | abcd |
|
||||
| s | t | st |
|
||||
| s | d | /st,.+,abcd/ |
|
||||
|
||||
@@ -6,54 +6,35 @@ Feature: Bike - Surfaces
|
||||
|
||||
Scenario: Bicycle - Slow surfaces
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| cycleway | asphalt | 48 s |
|
||||
| cycleway | cobblestone:flattened | 72 s |
|
||||
| cycleway | paving_stones | 72 s |
|
||||
| cycleway | compacted | 72 s |
|
||||
| cycleway | cobblestone | 120 s |
|
||||
| cycleway | fine_gravel | 120 s |
|
||||
| cycleway | gravel | 120 s |
|
||||
| cycleway | pebblestone | 120.1 s |
|
||||
| cycleway | dirt | 120 s |
|
||||
| cycleway | earth | 120 s |
|
||||
| cycleway | grass | 120 s |
|
||||
| cycleway | mud | 240 s |
|
||||
| cycleway | sand | 240.1 s |
|
||||
| cycleway | sett | 72 s |
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48s |
|
||||
| cycleway | asphalt | 48s |
|
||||
| cycleway | cobblestone:flattened | 72s |
|
||||
| cycleway | paving_stones | 72s |
|
||||
| cycleway | compacted | 72s |
|
||||
| cycleway | cobblestone | 120s |
|
||||
| cycleway | unpaved | 120s |
|
||||
| cycleway | fine_gravel | 120s |
|
||||
| cycleway | gravel | 120s |
|
||||
| cycleway | pebblestone | 120s |
|
||||
| cycleway | dirt | 120s |
|
||||
| cycleway | earth | 120s |
|
||||
| cycleway | grass | 120s |
|
||||
| cycleway | mud | 240s |
|
||||
| cycleway | sand | 240s |
|
||||
|
||||
Scenario: Bicycle - Good surfaces on small paths
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| path | | 60 s |
|
||||
| track | | 60 s |
|
||||
| track | asphalt | 60 s |
|
||||
| path | asphalt | 60 s |
|
||||
| cycleway | | 48s |
|
||||
| path | | 60s |
|
||||
| track | | 60s |
|
||||
| track | asphalt | 48s |
|
||||
| path | asphalt | 48s |
|
||||
|
||||
Scenario: Bicycle - Surfaces should not make unknown ways routable
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| cycleway | | 48s |
|
||||
| nosense | | |
|
||||
| nosense | asphalt | |
|
||||
|
||||
Scenario: Bicycle - Surfaces should not increase speed when pushing bikes
|
||||
Given the node map
|
||||
"""
|
||||
a b
|
||||
c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | surface |
|
||||
| ab | primary | yes | asphalt |
|
||||
| cd | footway | | asphalt |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | b | ab,ab | cycling,cycling | 15 km/h |
|
||||
| b | a | ab,ab | pushing bike,pushing bike | 4 km/h |
|
||||
| c | d | cd,cd | pushing bike,pushing bike | 4 km/h |
|
||||
| d | c | cd,cd | pushing bike,pushing bike | 4 km/h |
|
||||
|
||||
@@ -1,71 +1,39 @@
|
||||
@routing @bicycle @train
|
||||
Feature: Bike - Handle ferry routes
|
||||
# Bringing bikes on trains and subways
|
||||
# We cannot currently use a 'routability' type test, since the bike
|
||||
# profile does not allow starting/stopping on trains, and
|
||||
# it's not possible to modify the bicycle profile table because it's
|
||||
# defined as local.
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
|
||||
Scenario: Bike - Bringing bikes on trains
|
||||
Given the node map
|
||||
"""
|
||||
a 1 b c 2 d e 3 f g 4 h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | railway | bicycle |
|
||||
| ab | primary | | |
|
||||
| cd | primary | | |
|
||||
| ef | primary | | |
|
||||
| gh | primary | | |
|
||||
| bc | | train | |
|
||||
| de | | train | yes |
|
||||
| fg | | train | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| 1 | 2 | |
|
||||
| 2 | 3 | cd,de,ef,ef |
|
||||
| 3 | 4 | |
|
||||
|
||||
Scenario: Bike - Bringing bikes on trains, invalid railway tag is accepted if access specified
|
||||
Given the node map
|
||||
"""
|
||||
a 1 b c 2 d e 3 f g 4 h
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | railway | bicycle |
|
||||
| ab | primary | | |
|
||||
| cd | primary | | |
|
||||
| ef | primary | | |
|
||||
| gh | primary | | |
|
||||
| bc | | invalid_tag | |
|
||||
| de | | invalid_tag | yes |
|
||||
| fg | | invalid_tag | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| 1 | 2 | |
|
||||
| 2 | 3 | cd,de,ef|
|
||||
| 3 | 4 | |
|
||||
Then routability should be
|
||||
| highway | railway | bicycle | bothw |
|
||||
| primary | | | x |
|
||||
| (nil) | train | | |
|
||||
| (nil) | train | no | |
|
||||
| (nil) | train | yes | x |
|
||||
| (nil) | railway | | |
|
||||
| (nil) | railway | no | |
|
||||
| (nil) | railway | yes | x |
|
||||
| (nil) | subway | | |
|
||||
| (nil) | subway | no | |
|
||||
| (nil) | subway | yes | x |
|
||||
| (nil) | tram | | |
|
||||
| (nil) | tram | no | |
|
||||
| (nil) | tram | yes | x |
|
||||
| (nil) | light_rail | | |
|
||||
| (nil) | light_rail | no | |
|
||||
| (nil) | light_rail | yes | x |
|
||||
| (nil) | monorail | | |
|
||||
| (nil) | monorail | no | |
|
||||
| (nil) | monorail | yes | x |
|
||||
| (nil) | some_tag | | |
|
||||
| (nil) | some_tag | no | |
|
||||
| (nil) | some_tag | yes | x |
|
||||
|
||||
@construction
|
||||
Scenario: Bike - Don't route on railways under construction
|
||||
Given the node map
|
||||
"""
|
||||
a 1 b c 2 d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | railway | bicycle |
|
||||
| ab | primary | | |
|
||||
| cd | primary | | |
|
||||
| bc | | construction | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| 1 | 2 | |
|
||||
Then routability should be
|
||||
| highway | railway | bicycle | bothw |
|
||||
| primary | | | x |
|
||||
| (nil) | construction | yes | |
|
||||
|
||||
@@ -2,41 +2,32 @@
|
||||
Feature: Turn Penalties
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given a grid size of 200 meters
|
||||
Given the profile "turnbot"
|
||||
|
||||
|
||||
Scenario: Bicycle - Turn penalties on cyclability
|
||||
Given the profile file "bicycle" initialized with
|
||||
"""
|
||||
profile.properties.weight_name = 'cyclability'
|
||||
"""
|
||||
Scenario: Bike - turns should incur a delay that depend on the angle
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a--b-----c
|
||||
|
|
||||
|
|
||||
d
|
||||
|
||||
e--------f-----------g
|
||||
/
|
||||
/
|
||||
/
|
||||
h
|
||||
"""
|
||||
| c | d | e |
|
||||
| b | j | f |
|
||||
| a | s | g |
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | residential |
|
||||
| bd | residential |
|
||||
| efg | residential |
|
||||
| fh | residential |
|
||||
| nodes |
|
||||
| sj |
|
||||
| ja |
|
||||
| jb |
|
||||
| jc |
|
||||
| jd |
|
||||
| je |
|
||||
| jf |
|
||||
| jg |
|
||||
|
||||
When I route I should get
|
||||
| from | to | distance | weight | # |
|
||||
| a | c | 900m +- 1 | 216 | Going straight has no penalties |
|
||||
| a | d | 900m +- 1 | 220.2 | Turning right had penalties |
|
||||
| e | g | 2100m +- 4| 503.9 | Going straght has no penalties |
|
||||
| e | h | 2100m +- 4| 515.1 | Turn sharp right has even higher penalties|
|
||||
|
||||
| from | to | route | time | distance |
|
||||
| s | a | sj,ja | 39s +-1 | 242m +-1 |
|
||||
| s | b | sj,jb | 30s +-1 | 200m +-1 |
|
||||
| s | c | sj,jc | 29s +-1 | 242m +-1 |
|
||||
| s | d | sj,jd | 20s +-1 | 200m +-1 |
|
||||
| s | e | sj,je | 29s +-1 | 242m +-1 |
|
||||
| s | f | sj,jf | 30s +-1 | 200m +-1 |
|
||||
| s | g | sj,jg | 39s +-1 | 242m +-1 |
|
||||
+13
-172
@@ -5,7 +5,7 @@ Feature: Car - Restricted access
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Access tag hierarchy on ways
|
||||
Scenario: Car - Access tag hierachy on ways
|
||||
Then routability should be
|
||||
| access | vehicle | motor_vehicle | motorcar | bothw |
|
||||
| | | | | x |
|
||||
@@ -30,36 +30,7 @@ Feature: Car - Restricted access
|
||||
| | | no | yes | x |
|
||||
| | | yes | no | |
|
||||
|
||||
Scenario: Car - Access tag hierarchy and forward/backward
|
||||
Then routability should be
|
||||
| access | access:forward | access:backward | motorcar | motorcar:forward | motorcar:backward | forw | backw |
|
||||
| | | | | | | x | x |
|
||||
| yes | | | | | | x | x |
|
||||
| yes | no | | | | | | x |
|
||||
| yes | yes | | no | | | | |
|
||||
| yes | yes | | yes | no | | | x |
|
||||
| yes | | | | | | x | x |
|
||||
| yes | | no | | | | x | |
|
||||
| yes | | yes | no | | | | |
|
||||
| yes | | yes | yes | | no | x | |
|
||||
| no | | | | | | | |
|
||||
| no | yes | | | | | x | |
|
||||
| no | no | | yes | | | x | x |
|
||||
| no | no | | no | yes | | x | |
|
||||
| no | | | | | | | |
|
||||
| no | | yes | | | | | x |
|
||||
| no | | no | yes | | | x | x |
|
||||
| no | | no | no | | yes | | x |
|
||||
| | no | | | no | | | x |
|
||||
| | | no | | | no | x | |
|
||||
| | no | | | | no | | |
|
||||
| | | no | no | | | | |
|
||||
| | no | | | yes | | x | x |
|
||||
| | | no | | | yes | x | x |
|
||||
| | yes | | | no | | | x |
|
||||
| | | yes | | | no | x | |
|
||||
|
||||
Scenario: Car - Access tag hierarchy on nodes
|
||||
Scenario: Car - Access tag hierachy on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
|
||||
| | | | | x |
|
||||
@@ -119,13 +90,11 @@ Feature: Car - Restricted access
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | x |
|
||||
| private | |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | x |
|
||||
| some_tag | x |
|
||||
| destination | x |
|
||||
|
||||
|
||||
Scenario: Car - Access tags on nodes
|
||||
@@ -135,11 +104,10 @@ Feature: Car - Restricted access
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | x |
|
||||
| private | |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | x |
|
||||
| some_tag | x |
|
||||
|
||||
Scenario: Car - Access tags on both node and way
|
||||
@@ -157,16 +125,15 @@ Feature: Car - Restricted access
|
||||
|
||||
Scenario: Car - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
|
||||
| runway | private | | | permissive | x | x | |
|
||||
| primary | forestry | | yes | | x | x | |
|
||||
| cycleway | | | designated | | x | x | |
|
||||
| unclassified | | | destination | destination | x | x | |
|
||||
| residential | | yes | no | | | | |
|
||||
| motorway | yes | permissive | | private | x | | implied oneway |
|
||||
| trunk | agricultural | designated | permissive | no | | | |
|
||||
| pedestrian | | | | | | | |
|
||||
| pedestrian | | | | destination | | | temporary disabled #3773 |
|
||||
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
|
||||
| runway | private | | | permissive | x |
|
||||
| primary | forestry | | yes | | x |
|
||||
| cycleway | | | designated | | x |
|
||||
| residential | | yes | no | | |
|
||||
| motorway | yes | permissive | | private | |
|
||||
| trunk | agricultural | designated | permissive | no | |
|
||||
| pedestrian | | | | | |
|
||||
| pedestrian | | | | destination | x |
|
||||
|
||||
Scenario: Car - Ignore access tags for other modes
|
||||
Then routability should be
|
||||
@@ -179,129 +146,3 @@ Feature: Car - Restricted access
|
||||
| primary | | | no | | x |
|
||||
| runway | | | | yes | |
|
||||
| primary | | | | no | x |
|
||||
|
||||
@hov
|
||||
Scenario: Car - designated HOV ways are rated low
|
||||
Then routability should be
|
||||
| highway | hov | bothw | forw_rate | backw_rate |
|
||||
| primary | designated | x | 18.2 | 18.2 |
|
||||
| primary | yes | x | 18.2 | 18.2 |
|
||||
| primary | no | x | 18.2 | 18.2 |
|
||||
|
||||
# Models:
|
||||
# https://www.openstreetmap.org/way/124891268
|
||||
# https://www.openstreetmap.org/way/237173472
|
||||
@hov
|
||||
Scenario: Car - I-66 use HOV-only roads with heavy penalty
|
||||
Then routability should be
|
||||
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
|
||||
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
|
||||
| motorway | lane | | 3 | designated | yes | x | | 25 |
|
||||
|
||||
@hov
|
||||
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
||||
Then routability should be
|
||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | designated | designated | | | x | x | 18.2 | 18.2 |
|
||||
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
||||
#| primary | | designated | | | x | x | 18.2 | 18.2 |
|
||||
#| primary | designated | | | | x | x | 18.2 | 18.2 |
|
||||
| primary | designated\|designated | designated\|designated | | | x | x | 18.2 | 18.2 |
|
||||
| primary | designated\|no | designated\|no | | | x | x | 18.2 | 18.2 |
|
||||
| primary | yes\|no | yes\|no | | | x | x | 18.2 | 18.2 |
|
||||
| primary | | | | | x | x | 18.2 | 18.2 |
|
||||
| primary | designated | | | -1 | | x | | 18.2 |
|
||||
| primary | | designated | | -1 | | x | | 18.2 |
|
||||
| primary | | | designated | yes | x | | 18.2 | |
|
||||
| primary | | | designated | -1 | | x | | 18.2 |
|
||||
| primary | | | designated\| | yes | x | | 18.2 | |
|
||||
| primary | | | designated\| | -1 | | x | | 18.2 |
|
||||
| primary | | | designated\|designated | yes | x | | 18.2 | |
|
||||
| primary | | | designated\|designated | -1 | | x | | 18.2 |
|
||||
| primary | | | designated\|yes | yes | x | | 18.2 | |
|
||||
| primary | | | designated\|no | -1 | | x | | 18.2 |
|
||||
|
||||
Scenario: Car - these toll roads always work
|
||||
Then routability should be
|
||||
| highway | toll | bothw |
|
||||
| primary | no | x |
|
||||
| primary | snowmobile | x |
|
||||
|
||||
Scenario: Car - toll=yes ways are enabled by default
|
||||
Then routability should be
|
||||
| highway | toll | bothw |
|
||||
| primary | yes | x |
|
||||
|
||||
Scenario: Car - directional access tags
|
||||
Then routability should be
|
||||
| highway | access | access:forward | access:backward | forw | backw |
|
||||
| primary | yes | yes | yes | x | x |
|
||||
| primary | yes | | no | x | |
|
||||
| primary | yes | no | | | x |
|
||||
| primary | yes | no | no | | |
|
||||
| primary | no | no | no | | |
|
||||
| primary | no | | yes | | x |
|
||||
| primary | no | yes | | x | |
|
||||
| primary | no | yes | yes | x | x |
|
||||
|
||||
|
||||
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
|
||||
Then routability should be
|
||||
| node/barrier | access | bothw |
|
||||
| gate | | x |
|
||||
| gate | no | |
|
||||
| gate | yes | x |
|
||||
| gate | permissive | x |
|
||||
| gate | designated | x |
|
||||
| gate | private | x |
|
||||
| gate | garbagetag | x |
|
||||
|
||||
Scenario: Car - a way with conditional access
|
||||
Then routability should be
|
||||
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
|
||||
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
|
||||
|
||||
Scenario: Car - a way with a list of tags
|
||||
Then routability should be
|
||||
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw | # |
|
||||
| primary | | no | destination | | x | |
|
||||
| primary | destination;agricultural | destination | | x | x | |
|
||||
| footway | | | destination | | | temporary #3373 |
|
||||
| track | destination;agricultural | destination | | | x | temporary #3373 |
|
||||
|
||||
Scenario: Car - Don't route over steps even if marked as accessible
|
||||
Then routability should be
|
||||
| highway | access | forw | backw |
|
||||
| steps | yes | | |
|
||||
| steps | no | | |
|
||||
| primary | | x | x |
|
||||
|
||||
Scenario: Car - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | x |
|
||||
| steps | permissive | |
|
||||
| footway | permissive | x |
|
||||
| garbagetag | permissive | x |
|
||||
|
||||
Scenario: Car - Access private blacklist
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| footway | yes | x |
|
||||
| pedestrian | private | |
|
||||
| footway | private | |
|
||||
| service | private | |
|
||||
| cycleway | private | |
|
||||
| track | private | |
|
||||
| footway | customers | |
|
||||
|
||||
Scenario: Car - Access blacklist
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | | x |
|
||||
| primary | emergency | |
|
||||
| primary | forestry | |
|
||||
| primary | agricultural | |
|
||||
| primary | psv | |
|
||||
| primary | no | |
|
||||
| primary | customers | x |
|
||||
|
||||
@@ -8,9 +8,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
|
||||
Scenario: Car - Advisory speed overwrites maxspeed
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed | maxspeed:advisory |
|
||||
@@ -19,14 +17,12 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 36 km/h +- 1 |
|
||||
| b | c | bc,bc | 36 km/h +- 1 |
|
||||
| a | b | ab | 47 km/h +- 1 |
|
||||
| b | c | bc | 47 km/h +- 1 |
|
||||
|
||||
Scenario: Car - Advisory speed overwrites forward maxspeed
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed:forward | maxspeed:advisory:forward |
|
||||
@@ -35,14 +31,12 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 36 km/h +- 1 |
|
||||
| b | c | bc,bc | 36 km/h +- 1 |
|
||||
| a | b | ab | 47 km/h +- 1 |
|
||||
| b | c | bc | 47 km/h +- 1 |
|
||||
|
||||
Scenario: Car - Advisory speed overwrites backwards maxspeed
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed:backward | maxspeed:advisory:backward |
|
||||
@@ -51,31 +45,12 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| b | a | ab,ab | 36 km/h +- 1 |
|
||||
| c | b | bc,bc | 36 km/h +- 1 |
|
||||
|
||||
Scenario: Car - Advisory speed overwrites backwards maxspeed
|
||||
Given the node map
|
||||
"""
|
||||
a b c d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed:backward | maxspeed:advisory:backward |
|
||||
| ab | residential | | 45 |
|
||||
| bc | residential | 90 | 45 |
|
||||
| cd | residential | | 45 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| c | b | bc,bc | 36 km/h +- 1 |
|
||||
| d | c | cd,cd | 36 km/h +- 1 |
|
||||
| b | a | ab | 47 km/h +- 1 |
|
||||
| c | b | bc | 47 km/h +- 1 |
|
||||
|
||||
Scenario: Car - Directional advisory speeds play nice with eachother
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
"""
|
||||
| a | b | c |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed:advisory | maxspeed:advisory:forward | maxspeed:advisory:backward |
|
||||
@@ -84,9 +59,9 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 36 km/h +- 1 |
|
||||
| b | a | ab,ab | 48 km/h +- 1 |
|
||||
| b | c | bc,bc | 48 km/h +- 1 |
|
||||
| c | b | bc,bc | 36 km/h +- 1 |
|
||||
| a | b | ab | 47 km/h +- 1 |
|
||||
| b | a | ab | 59 km/h +- 1 |
|
||||
| b | c | bc | 59 km/h +- 1 |
|
||||
| c | b | bc | 47 km/h +- 1 |
|
||||
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
@routing @car @way
|
||||
Feature: Car - Avoid defined areas
|
||||
|
||||
Background:
|
||||
Given the profile file "car" initialized with
|
||||
"""
|
||||
profile.avoid = Set { 'motorway', 'motorway_link' }
|
||||
profile.speeds = Sequence {
|
||||
highway = {
|
||||
motorway = 90,
|
||||
motorway_link = 45,
|
||||
primary = 50
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
Scenario: Car - Avoid motorways
|
||||
Then routability should be
|
||||
| highway | bothw |
|
||||
| motorway | |
|
||||
| motorway_link | |
|
||||
| primary | x |
|
||||
|
||||
@@ -29,14 +29,14 @@ Feature: Car - Barriers
|
||||
| gate | permissive | x |
|
||||
| gate | designated | x |
|
||||
| gate | no | |
|
||||
| gate | private | x |
|
||||
| gate | private | |
|
||||
| gate | agricultural | |
|
||||
| wall | | |
|
||||
| wall | yes | x |
|
||||
| wall | permissive | x |
|
||||
| wall | designated | x |
|
||||
| wall | no | |
|
||||
| wall | private | x |
|
||||
| wall | private | |
|
||||
| wall | agricultural | |
|
||||
|
||||
Scenario: Car - Rising bollard exception for barriers
|
||||
@@ -45,11 +45,3 @@ Feature: Car - Barriers
|
||||
| bollard | | |
|
||||
| bollard | rising | x |
|
||||
| bollard | removable | |
|
||||
|
||||
Scenario: Car - Height restrictions
|
||||
Then routability should be
|
||||
| node/barrier | node/maxheight | bothw |
|
||||
| height_restrictor | | x |
|
||||
| height_restrictor | 1 | |
|
||||
| height_restrictor | 3 | x |
|
||||
| height_restrictor | default | x |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user