Compare commits

...

871 Commits

Author SHA1 Message Date
Daniel Patterson d5fa963d48 Fix tests. 2019-02-02 22:47:42 -08:00
Daniel Patterson e67d26846f Fix tests. 2019-02-02 22:47:22 -08:00
Daniel Patterson 1d435266aa Fix typo. 2019-02-02 22:25:05 -08:00
Daniel Patterson 9b414a17e8 Build tags with semver metadata. 2019-02-02 22:19:15 -08:00
Daniel Patterson 54a8a8c494 Update version for custom build. 2019-02-02 22:15:41 -08:00
Daniel Patterson 469c3331e4 Fix formatting. 2019-02-02 22:15:16 -08:00
Daniel Patterson 2aa9e2859a Prototype configurable snapping. 2019-02-02 22:12:05 -08:00
Lev Dragunov 8b45ff7a18 Store metadata about original OSM data, and return it in the API response, if available. 2019-01-30 15:31:56 -08:00
Daniel Patterson 4c665b24d9 Add optional builds for lts and node version aliases. This will give us a heads up when new Node (#5347)
versions break bindings, and might automagically get us support for new versions if it "just works".
2019-01-30 12:17:04 -08:00
Daniel Patterson 381d492a8f Add waypoints parameter to viaroute API (#5345)
* Add silent waypoints to viaroute API.
2019-01-24 16:19:59 -08:00
Daniel Patterson e250c83c21 Add BUILD_CONCURRENCY argument so that we can limit concurrency on Docker Hub (and thus reduce peak memory need for build) 2019-01-17 16:16:44 -08:00
Andrii Dmytrenko e2e326d15e Fix cpack config by pointing to a correct LICENSE file 2019-01-17 09:45:11 -08:00
Daniel Patterson 4abca85474 Downgrade to debian:stretch-slim to ensure stable environment for building. 2019-01-11 16:46:28 -08:00
Daniel Patterson 2c78d862a3 Reset master for next release. 2018-12-18 16:25:51 -07:00
Daniel Patterson b1451a7421 Release 5.21.0 2018-12-18 16:17:34 -07:00
Daniel Patterson da1c251144 Prep 5.21.0-rc.1 2018-12-15 21:43:10 -07:00
Daniel Patterson 1eab7b41d1 Update CHANGELOG. 2018-12-15 21:07:06 -07:00
Daniel Patterson 1dca8ae76a Correct invalid tests - these captured the incorrect behaviour, the matrices should've been symmetrical (a->o == o->a for these cases) 2018-12-15 21:07:06 -07:00
Daniel Patterson 002e86863d Add test to ensure forward/reverse snapping distances are correct, and fix some tests that were incorrect due to the bug. 2018-12-15 21:07:06 -07:00
Daniel Patterson 1d82b01816 Count reverse offset from the back of the geometry, not the front. 2018-12-15 21:07:06 -07:00
Frédéric Rodrigo 714719c377 Lua maxspeed parsing refactoring (#5144)
* Lua maxspeed parsing refactoring
2018-12-14 21:58:07 -07:00
Huyen Chau Nguyen 77b4fbb69c Fix maxspeed to consider source:maxspeed tags (#5217)
* In Belgium the maximum speed in rural areas is 70 in the region Flanders
* parse maxspeed using source:maxspeed and maxspeed:type tags
* add changelog
* make maxspeed:advisory more important than maxspeed
* add test for source:maxspeed
2018-12-14 21:42:44 -07:00
Matt Riggott 11fde865f7 Document switch to Debian base images (#5281)
* Document switch to Debian base images
2018-12-14 21:36:09 -07:00
Salim KAYABASI 717406043a Remove unused Node binary publishing, and upgrade build environment.
Upgrades the build environment to Node 10, which let's us pull down some security fixes in package dependencies that were unfixed in Node 4.

Also removes Node 4 and 6 binary publishing which were almost never used (20 downloads out of 50,000).

Fixes https://github.com/Project-OSRM/osrm-backend/issues/5312
2018-12-14 21:34:48 -07:00
Daniel Patterson 1ef85c57cc Upgrade CI environment to Node 10, remove builds for < Node 8
Remove yarn, npm is fast now, and comes with node.
Synchronize package-lock.json and package.json
2018-12-14 14:56:21 -07:00
Daniel Patterson d0180517a8 Merge branch 'master' of github.com:Project-OSRM/osrm-backend 2018-12-14 11:54:00 -07:00
Daniel Patterson 520b7ebbb6 Remove 5.20 build trigger from master branch - should only exist on release branches. 2018-12-14 11:53:48 -07:00
Dinesh Weerapurage 2caba96076 using libboost 1.67 in both build and run stages (#5311)
* using libboost 1.67 in both build and run stages, added execution permision for /opt
2018-12-14 11:51:05 -07:00
Daniel Patterson 81bc2f41a6 When matching, ignore 'is_startpoint' propert, snap to any edge (#5297)
Includes all edges in the rtree, but adds an `is_startpoint` flag to each.  Most plugin behaviour remains unchanged (non-startpoint edges aren't used as snapping candidates), but for map matching, we allow snapping to any edge.  This fixes map-matching across previously non-is_startpoint edges, like ferries, private service roads, and a few others.
2018-12-13 17:10:32 -07:00
Daniel Patterson 06e010b4d0 Include information on estimates in table response (#5259)
* Revert "Remove estimated_cells value in the response."

This reverts commit 364e35af06.

* Update changelog.

* fix linting

* adjust fallback_speed check

* change [].includes to [].indexOf !== -1 for compatibility with node 4

* change param name

* more cuke tests

* fix formatting
2018-12-11 12:21:57 -05:00
Kajari Ghosh 92d3ce789b Fix scale_factor bug (#5303)
* check for scale_factor != 1

* changelog
2018-12-10 17:11:08 -05:00
Kajari Ghosh 01ca32c81c Fix fallback speed validity checks (#5300)
* fix fallback_speeds check to only accept values > 0

* add invalid_fallback_speed
2018-12-10 14:53:30 -05:00
Kajari Ghosh 2e17f3010a Add a multiplier to the matrix (#5298)
* add a multiplier to the matrix

* add rounding

* remove scale_factor restrictions

* clamp for overflow error

* update check to match error message

* enforce clamping on < 0 and increase test coverage

* add an invalid scale_factor value to node tests

* increase test coverage

* changelog
2018-12-10 13:41:44 -05:00
Kajari Ghosh c4238c4ed6 Backport-v5.20.0 (#5301)
* Prepare RC.1

* Bump version.

* remove destination/sources length <= coordinates length check (#5289)

* Add node 10 builds to travis (#5246)

* Add node 10 builds to travis

* Add changelog

* bump version to rc5

* Fix fallback_speed vector access (#5291)

* add failing cuke test

* correctly access durations vector

* changelog

* one more cuke test

* bump rc version

* 5.20.0

* remove line from changelog about commit that isn't actually in here

* update CHANGELOG and osrm version in package.json for v5.20.0

* bump to restart appveyor
2018-12-10 11:27:13 -05:00
Kajari Ghosh 3d781e6f28 Fix fallback_speed vector access (#5291)
* add failing cuke test

* correctly access durations vector

* changelog

* one more cuke test
2018-12-05 00:41:06 -05:00
Daniel Paz-Soldan 4976233cff Add node 10 builds to travis (#5246)
* Add node 10 builds to travis

* Add changelog
2018-12-04 14:13:49 -05:00
Kajari Ghosh 98ea2a0b09 remove destination/sources length <= coordinates length check (#5289) 2018-12-04 13:35:26 -05:00
Dinesh Weerapurage f978900ab0 adding a debian based docker image 2018-11-08 12:03:35 +01:00
Daniel Patterson 8b6580128b Merge pull request #5255 from Project-OSRM/danpat_snapped_distance_everywhere
Return 'distance' in all waypoints for all APIs
2018-11-02 15:36:27 -07:00
Daniel Patterson 4dde9c7bbe Include distance from input to snapped for all waypoints, not just on the nearest service. 2018-11-02 15:30:52 -07:00
Daniel Patterson 973837207b Merge pull request #5257 from Project-OSRM/danpat_table_noroute_estimate
Use estimates for NoRoute in table requests
2018-11-02 01:41:50 -07:00
Daniel Patterson 364e35af06 Remove estimated_cells value in the response. 2018-11-02 01:08:59 -07:00
Daniel Patterson 985ab58f45 Add feature to fill null table entries with as-the-crow-flies estimates. 2018-11-02 01:07:24 -07:00
Daniel Patterson cb1db646f2 Merge pull request #5251 from Project-OSRM/danpat_cache_distances
Pre-calculate distance values
2018-10-30 16:14:47 -07:00
Daniel Patterson a67c4bf84d Calculating durations is unavoidable due to tie-breaking minimums, but we can avoid accumulating distances if they're not requested. 2018-10-30 15:41:06 -07:00
Daniel Patterson 498259b220 Replace dynamic distance calculation for table plugin with pre-calculated distances on shortcuts, avoiding unpacking cost.
Adds approx 10% to total data size.  Speeds up large table requests by 2 orders of magnitude.

Co-authored-by: Kajari Ghosh <ghoshkaj@gmail.com>
2018-10-30 15:41:06 -07:00
Daniel Patterson 5327f8da4e Timer script should error properly if something goes wrong, and print out what happened. 2018-10-30 15:41:06 -07:00
Daniel Patterson 802ccfb497 Merge pull request #5252 from Project-OSRM/danpat_pin_yarn
Pin Yarn to 1.11.1 so it works with Node4
2018-10-30 15:40:19 -07:00
Daniel Patterson ec369d560a Pin Yarn to 1.11.1 so it works with Node4 (https://github.com/yarnpkg/yarn/pull/6409#issuecomment-429181371) 2018-10-30 15:38:55 -07:00
Daniel Patterson 535647e439 Merge pull request #5242 from Project-OSRM/ghoshkaj_mmaperize
Support directly mmap-ing datafiles
2018-10-29 11:58:26 -07:00
Daniel Patterson 954121634f Merge branch 'master' into ghoshkaj_mmaperize 2018-10-29 09:52:50 -07:00
Daniel Patterson 594a45e7e0 Re-use msinttypes bundled with RapidJSON when compiling on Windows. (#5249) 2018-10-29 09:51:56 -07:00
Daniel Patterson 96c7b47afe Document new mmap_memory option in NodeJS API 2018-10-27 00:12:17 -07:00
Daniel Patterson b7e7d32361 Expose new --mmap switch (mmap_memory: true in NodeJS), and run test suite in this mode, as well as shared memory mode. 2018-10-26 23:54:00 -07:00
Daniel Patterson 2f9cb44368 mmap tarfiles directly when mmapping is enabled, instead of copying data into separate mmapped block
Co-authored-by: Kajari Ghosh <ghoshkaj@gmail.com>
2018-10-26 23:53:59 -07:00
Daniel Patterson d80318f8ea Match serialized bit-packing for vector<bool> to match in-memory layout for vector_view<bool> so that data can be directly mmapped. 2018-10-26 23:53:50 -07:00
Daniel Paz-Soldan b1791d1ab3 Fix anchor links in api docs (#5235) 2018-10-16 09:23:29 -07:00
Yota Toyama a53da9095a Fix table node API docs (#5204) 2018-10-01 16:45:05 +03:00
Kajari Ghosh 72e03f9af9 update changelog after 5.19 release (#5203) 2018-09-11 00:34:40 -04:00
Kajari Ghosh 5597415f28 Revert "Improve speed of Map Matching" (#5196)
* Revert "Update changelog"

This reverts commit 9b779c704f.

* Revert "Fix formating"

This reverts commit 5bd7d04fe3.

* Revert "Fix bug in computation of distance offset for phantom node"

This reverts commit 0f78f7b2cc.

* Revert "Adjust text cases for flightly different matching due to rounding"

This reverts commit 8473be69d2.

* Revert "Round network distance to deci-meter to retain previous behavior"

This reverts commit c0124f7d77.

* Revert "Preserve heap state in map matching"

This reverts commit b630b4e32a.

* Revert "Use distance functions from many to many"

This reverts commit 89fabc1b9c.

* Revert "Use FCC algorithm for map matching distance calculation"

This reverts commit a649a8a5cf.
2018-09-06 12:05:28 -04:00
Jie 5476f6ab27 Fix GDB not work for osrm-routed on Linux (#5157)
As I mentioned in the issue #5156, I met below issue on my Win10+WSL(Ubuntu) env:
The remote debugger (VSCode on Win10, gdb on Ubuntu 18.04 LTS) works well from the beginning of the main() function. But when I step over the code pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask); (src/tools/routed.cpp(289)), below breakpoints can not work and displayed unverified breakpoint.

Then I found that gdb breakpoint need at least SIGTRAP, SIGSTOP to work (Please refer to [how debugger works](http://www.alexonlinux.com/how-debugger-works) for more details), but all signals are blocked in the source code until server initialized done.

In my understanding, block all signals DO NOT make sense for this osrm-routed process. Only several signals (SIGINT, SIGQUIT, SIGTERM) are expected to wait. So I made the change and it works well for me then.
2018-09-05 16:23:48 -07:00
Daniel Patterson 0971f06193 Add option to node bindings to return result as a pre-generated JSON string (this avoids a lot of overhead, and moves JSON string rendering out of the main event loop). 2018-09-05 15:09:13 -07:00
Daniel Patterson 85515f063a Render floating point numbers to string using Grisu2 algorithmt instead of stdlib to speed up JSON generation. 2018-09-05 14:20:47 -07:00
Daniel Patterson 69d7825542 Increase allowed shared memory regions to 512 from ~120 2018-09-05 11:48:02 -07:00
Patrick Niklaus 9b779c704f Update changelog 2018-08-02 12:19:24 +02:00
Patrick Niklaus 5bd7d04fe3 Fix formating 2018-08-02 12:19:24 +02:00
Patrick Niklaus 0f78f7b2cc Fix bug in computation of distance offset for phantom node 2018-08-02 12:19:24 +02:00
Patrick Niklaus 8473be69d2 Adjust text cases for flightly different matching due to rounding 2018-08-02 12:19:24 +02:00
Patrick Niklaus c0124f7d77 Round network distance to deci-meter to retain previous behavior 2018-08-02 12:19:24 +02:00
Patrick Niklaus b630b4e32a Preserve heap state in map matching 2018-08-02 12:19:24 +02:00
Patrick Niklaus 89fabc1b9c Use distance functions from many to many 2018-08-02 12:19:24 +02:00
Patrick Niklaus a649a8a5cf Use FCC algorithm for map matching distance calculation 2018-08-02 12:19:24 +02:00
Frédéric Rodrigo f928956584 Support maxlength and maxweight in car profile 2018-07-11 18:33:30 +02:00
Frédéric Rodrigo 7ff68792d7 Add helper for maxlength into measure.lua 2018-07-11 18:33:30 +02:00
Frédéric Rodrigo 3088dd0342 Better and flexible weight parsing in measure.lua 2018-07-11 18:33:30 +02:00
Frédéric Rodrigo d2590989f5 Default maxspeed for fr:rural is now 80km/h 2018-07-11 17:54:46 +02:00
Antoine Giret 3a7b377586 Update profiles.md 2018-06-27 14:27:17 +02:00
Michael Krasnyk 82b5648c97 Don't collapse segregated intersections at roundabout exits, #5114 2018-06-21 15:24:03 +02:00
Antoine Giret 1628a3c4d5 Update profiles.md 2018-06-07 15:43:06 +02:00
Matthias Gilch e5d8319c43 Removed unused variable
The variable name_data_mutex is declared in a block but never used
within this block. So I've removed the variable.
2018-06-02 22:49:30 +02:00
MichalPP 06699132eb allow routing over barrier=some_tag 2018-05-29 16:56:15 +02:00
MichalPP 918e794d6a change barrier_whitelist to barrier blacklist
change barrier_whitelist to barrier blacklist  in foot profile
fix #5067 and #3890 and #4823
2018-05-29 16:56:15 +02:00
MichalPP 8dd8ee1fc2 blacklisting barriers allow routing
blacklisting barriers allow routing over barrier=some_tag
2018-05-28 17:21:08 +02:00
MichalPP c3d0efda93 change barrier_whitelist to barrier_blacklist 2018-05-28 17:21:08 +02:00
Patrick Niklaus 3b4e2e83ef Fix excluding nodes for one to all query 2018-05-08 15:50:25 +00:00
Patrick Niklaus c459530cb6 Address PR comments 2018-05-08 15:50:25 +00:00
Kajari Ghosh 2a15e6dec8 Add support for annotations=distances in MLD
This commit brings feature parity with CH for the `table` pluging.
2018-05-08 15:50:25 +00:00
Huyen Chau Nguyen 1a1293608d fix example requests for distance tables 2018-05-02 17:25:01 +02:00
Michael Krasnyk 318df9deaa Adjust ebn_weight assertion to new node weights 2018-05-01 18:53:04 +02:00
Michael Krasnyk cacb162520 Review and rebase updates 2018-04-28 08:59:18 +02:00
Michael Krasnyk 105709cb43 Don't handle response errors separately in osrm-runner 2018-04-28 08:59:18 +02:00
Michael Krasnyk 9695fa7941 Remove weight and duration from customizer::EdgeBasedGraphEdgeData 2018-04-28 08:59:18 +02:00
Michael Krasnyk fd9bebbfa7 Add EBG node durations 2018-04-28 08:59:18 +02:00
Michael Krasnyk db18e8669f Always read .osrm.enw file in updater 2018-04-28 08:59:18 +02:00
Michael Krasnyk 9b4a4fdd82 Add customizer::MultiLevelGraph 2018-04-28 08:59:18 +02:00
Michael Krasnyk cdc7e5f021 Fix for updating node weights in contraction hierarchy 2018-04-28 08:59:18 +02:00
Michael Krasnyk adc87149e2 List dataset blocks 2018-04-28 08:59:18 +02:00
Michael Krasnyk 8adbfe06ed Throw an exception if a shared region is not found 2018-04-28 08:59:18 +02:00
Patrick Niklaus ae805f9ec8 Make cheap rulers static 2018-04-27 05:21:08 +02:00
Patrick Niklaus be24689b0f Optimize distance calculation by getting rid of rounding 2018-04-27 05:21:08 +02:00
Michael Krasnyk 41c31a2388 Use mapbox::util::optional instead of std::experimental::optional 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen 8b866502d1 make eslint happy 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen 7837cd61df clang format 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen b573485c31 only use half of rulers because earth is symmetric 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen 4e68f3a7e1 change haversine computation to cheap ruler in distance tables 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen 5ba26d3d6d refactor cheap ruler cache 2018-04-27 05:21:08 +02:00
Daniel Patterson a6cf2eee7e Use faster method for calculating distances.
fix cmakelist
2018-04-27 05:21:08 +02:00
Patrick Niklaus 6843eb1479 Add changelog entries for profile changtes 2018-04-26 21:46:20 +02:00
Patrick Niklaus b331885d3c Add test fo excluding ferries on bikes 2018-04-26 21:46:20 +02:00
Patrick Niklaus 73716bd651 Add support for classes on bicycle profile 2018-04-26 21:46:20 +02:00
Michael Krasnyk 9edd161da3 Test for "No turn issued for right turn on un-named roads", #4414
The issue is fixed by d166fc6a75
2018-04-26 18:53:47 +02:00
Kajari Ghosh 1bc3ff6491 fix the ascii art to make sense 2018-04-25 23:51:27 +02:00
Kajari Ghosh b0f2ef287e fix the offset case when there is no packed path to unpack 2018-04-25 23:51:27 +02:00
Patrick Niklaus 16f53ff81a Sort unpacked paths by sharing 2018-04-25 16:07:31 +02:00
Patrick Niklaus 7a260dc2ba More parameter tuning 2018-04-25 16:07:31 +02:00
Patrick Niklaus 1c0d951f5e Adjust to PR comments 2018-04-25 16:07:31 +02:00
Patrick Niklaus 77a740c0fb Parameter tuning for different route lengths 2018-04-25 16:07:31 +02:00
Patrick Niklaus 61101db8cf Use duration and not weight for sharing 2018-04-25 16:07:31 +02:00
Patrick Niklaus b51632a2fb Chose alternatives parameters based on coordinate distance 2018-04-25 16:07:31 +02:00
Patrick Niklaus 9d10503a9c Replace step function with contious scaling 2018-04-25 16:07:31 +02:00
Patrick Niklaus 7d50e5afe0 Refactor parameters to be selected at runtime 2018-04-25 16:07:31 +02:00
Patrick Niklaus 549216c792 Compute sharing weighted by edge weight
This ensures that small insignificat turns don't affect the overall
sharing metric too much.
2018-04-25 16:07:31 +02:00
Patrick Niklaus 1990de7dcc Fix inserting edges of shortest path for sharing check
This caused very sub-optimal routes to be selected.
2018-04-25 16:07:31 +02:00
Kajari Ghosh 89f6e2d55b Parse table annotations param correctly (#5050)
* fix incorrect parameter parsing for node osrm and add tests

* fix boost spirit grammar parsing for annotations

* return NotImplemented when distance annotation is requested for MLD in table plugin

* update docs
2018-04-24 11:05:35 -04:00
Michael Krasnyk c628ecbf24 Update tile unit tests 2018-04-24 15:40:57 +02:00
Jochen Topf b6f19cd544 Use vtzero in tile plugin.
This uses the new vtzero library (https://github.com/mapbox/vtzero)
instead of using protozero directly.
2018-04-24 15:40:57 +02:00
Kajari Ghosh 14860b62e9 Unpack paths and return total distance in matrix plugin for CH (#4990) 2018-04-20 18:18:55 -04:00
Patrick Niklaus 9970b7d580 Merge pull request #5037 from Project-OSRM/subtrees-protozero-vtzero
Update libosmium and add protozero and vtzero libraries
2018-04-20 20:44:36 +02:00
Patrick Niklaus 7feb79ef91 Merge branch 'master' into subtrees-protozero-vtzero 2018-04-20 13:32:49 +00:00
Antoine Giret 6f84812903 Update profiles.md 2018-04-20 15:29:16 +02:00
Karen Shea 8085e86170 Change emoji 2018-04-20 13:19:48 +02:00
Karen Shea 35973576d9 Update releasing.md 2018-04-20 13:19:06 +02:00
Duane Gearhart 7740d5d7c0 Do not combine a segregated edge with a roundabout (#5040)
* Do not combine a segregated edge with a roundabout, add test
2018-04-20 11:41:53 +02:00
Patrick Niklaus c4eff6cd65 Add option to osrm-runner to limit the distance 2018-04-20 08:14:03 +03:00
Michael Krasnyk 5c4353b46e Removing submodules 2018-04-19 22:13:07 +03:00
Michael Krasnyk 05a5918909 Update CMakeLists.txt file 2018-04-19 22:13:06 +03:00
Michael Krasnyk 80ad38bbc6 Merge commit '6bee8866de99a602039feef463c22c972f0f86aa' as 'third_party/vtzero' 2018-04-19 22:03:52 +03:00
Michael Krasnyk 6bee8866de Squashed 'third_party/vtzero/' content from commit 2b43c8f5c
git-subtree-dir: third_party/vtzero
git-subtree-split: 2b43c8f5c7cc461a874a657673dfc15f8fb21d1d
2018-04-19 22:03:52 +03:00
Michael Krasnyk ba92674c6e Merge commit '68019a1fb20928beaa7b0cb2d8310af29ffe789e' as 'third_party/protozero' 2018-04-19 22:03:49 +03:00
Michael Krasnyk 68019a1fb2 Squashed 'third_party/protozero/' content from commit d5d8debf1
git-subtree-dir: third_party/protozero
git-subtree-split: d5d8debf1b17c6bb652395957b76cde7787e5377
2018-04-19 22:03:49 +03:00
Michael Krasnyk 3a9acde2c3 Merge commit 'a3a7a822e136d2357660d85124d8e7bb26ea6f7c' into subtrees-protozero-vtzero 2018-04-19 22:03:25 +03:00
Michael Krasnyk a3a7a822e1 Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b
d2c1d872b Release v2.14.0
9c9aedd50 Update embedded catch.hpp to version 1.12.1.
f94e70d32 Change comment on namespace closing brace to make clang-tidy happy.
ad9f03afc Prefer prefix increment operator.
a141b9c0c Update change log.
363fc7a15 Add more XML tests.
303a3090f Refactor XML tests.
a1ee5dd56 Make util namespace inline.
6f1709a83 Cleanup progress bar code.
1b02b65e0 Use Location setters taking a string in osmium_tiles example.
7ffdc7618 Disable clang-tidy warning.
882631085 Better implementation of str_to_int.
4cbf53725 Fix another bitwise op on signed integer.
903bfac9d Disable clang-tidy warning.
01de3f518 Don't change location if set_lon() or set_lat() functions throw.
9a27e899d Fix bitwise operation on signed integer.
61650224f Disable some clang-tidy warnings.
9dfa8437e Provide a way to better mock the getenv function in tests.
ae2c172a2 Explicitly set integer type for integers in test code.
878850068 Simpler implementation. We don't need to look at errno at all.
8f9b886f5 Formatting
cf4760cb0 Use bit operations on unsigned where possible.
c7cb4cde8 No conversion needed later if we declare it this way.
01357a540 Add missing inline for free function.
3feef81ee Disable clang-tidy warning in place we can't do anything about.
bf083b8ee Avoid binary bitwise operations on signed integers.
f70b1c803 Move content of osmium::util::detail namespace into osmium::detail.
caf2f0033 Remove use of atoi and atol from code.
f564cef07 Formatting.
f0885fc73 Disable travis build with sanitizers.
858c58444 Use explicit asserts and then casts, not static_cast_with_assert.
a613b1b0a Disable clang-tidy warning.
50e327677 Always build and run data tests on travis.
20d7a09b0 Update submodule to add more XML tests.
6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp
38ea437c0 Make XML parser more strict.
7788f5108 Remove object_order_type_id_reverse_version_without_timestamp
fe2223d25 Ignore timestamps if only one object has a valid timestamp
a4515161a Code cleanup.
eb5ea1a0e Use explicit conversions.
105905c45 Only disable warning on non-MSVC compilers.
80fc1b35d Change the way IDs are parsed from strings.
78aedf91e More tests for StringMatcher and disable a clang-tidy warning.
644a00752 Move catch.hpp into its own directory.
19842756c Update to newest osm-testdata submodule.
0402f64d7 Fix the problem with "git submodule" in appveyor.
ec4095d32 Cleanup metadata_options code.
d7390741e Add static_cast to avoid conversion warning.
dd16be1c3 Remove else after throw.
ef4d618de Remove unused variable.
0fdb58d13 Check out submodule in appveyor builds.
6406282d3 Merge pull request #248 from Nakaner/metadata-options-more
eb138a902 make clang < 3.9 work
e703b0d1d make sections their own independent test cases
f68888006 detect_available_metadata must be inline
b53224588 move metadata_options into osmium namespace
edd363cfa make const what could be const
302a485e5 remove unnecessary include, add missing include
93a76e07e give osmium::io::metadata_from_object a better name
91dfbc427 update documentation
453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo)
247c3b021 replace friend function by setter methods
0a62e589c performance improvement: check first character instead using std::strlen()
73568bbff move ctor of metadata_options which taks an OSMObject out of class
1879c9e47 restore metadata_options::to_string
71a303608 add more unit tests for osmium::io::metadata_options
843cdc89c replace osmium::io::metdata_options::to_string fully by operator<<
6402a8793 Fix bug in code which determines if an OSM object has a valid user.
a6d8143ae Move metadata_options out of "detail" subnamespace
61e32df10 add metadata_options::operator|=
d5f7cc0ab Use newest osm-testdata submodule.
31e34f10c add operator&=, operator<< and a to_string method to metadata_options
77d507172 Formatting fixes.
1c38b2a61 Update some URLs. Use https where possible.
10066cb3e Merge pull request #247 from Nakaner/issue-245
3c938ce82 Allow version=-1 and changeset=-1 for PBF input.
9a542c133 Add ReaderWithProgressBar class.
49839a1ce Replace strftime by our own implementation.
b32b90942 Update osm-testdata version used.
f88b6e548 Add more tests.
cb7e778f6 Handle NULL geometries in test cases.
1961a9c95 Clean up some test cases.
d7f45e071 Update osm-testdata submodule.
73a2ef18f Remove check for lost ways in multipolygon assembler.
1244e498a Update submodule also in msys2 build.
229fc2453 Revert "Make util namespace inline."
9f942d2e9 Revert "Add inline declaration to one util namespace we forgot."
40d4835ea Really fix appveyor build (I hope).
5ae071135 Add inline declaration to one util namespace we forgot.
e0916257c Clean up debug message.
2ddc474cc Make util namespace inline.
4b4e25f87 Travis config: Do not install clang-tidy, we are not using it.
5a608fba1 Fix travis build.
a075cc323 Fix appveyor build.
41ee9920b Add submodule with osm-testdata repository.
4d42245c0 Revert "Add clang-tidy build to travis."
9df355b64 Fix issue on some compilers.
c8a3c00d6 Add clang-tidy build to travis.
2fc80ad17 Fixed clang-tidy config file order.
2adf05267 Fix various clang-tidy warnings
1dca92459 Use the right syntax to override clang-tidy settings in the code.
25baecb46 Fix some issues found by clang-tidy.
54a8de6c0 Disable more clang-tidy tests.
de46d562e Also look for clang-tidy-6.0 in CMake config.
2172553d8 Add build with sanitizers on travis.
7e4e45562 Add object comparators ignoring the timestamp.
92fb231a1 Fix test code.
e541df0fc Cleanup test code.
5640269da Add comment in appveyor script about unusual parameter.
acb872376 Workaround for failing appveyor MSYS2 build.
0634bcf70 Set default value for m_file_size member.
3a2fe5781 Set default values on output options.
43d289fda Make metadata_options constructor explicit.
6e54992b4 Update change log.
e54b955cf Update included `catch.hpp` to version 1.12.0.
e50b40d53 Update copyright date.
0d8b401b6 Merge branch 'metadata'
c7da3a3b6 Remove superfluous has_visibles boolean.
7f74d33d3 Some cleanups of metadata code and fixes test.
5b3c34990 Output XML attributes uid and user independently of each other.
384167334 Merge pull request #243 from Nakaner/metadata_other
733f1916c Change path of nuget installs in appveyor config.
e48672999 Debug output from FindOsmium.cmake script is better formatted now.
79663be5d Change appveyor scripts to work without deprecated prebuilt libs.
443f7a9e4 Remove dependency on (win)getopt completely.
c133b8b14 Fix osmium_convert: Long options with = syntax.
b55daf00a Remove dependency on (win)getopt from area_test and convert examples.
92f7275a9 output visibility directly after the object ID in debug format
a771279f0 deprecate format option pbf_add_metadata
18e3f6005 The value "no" should be treated as "none" by metadata_options
c8b0b2e28 re-assign metadata_options instead of calling a public method of it
15bc4a200 Add more flexible metadata handling to PBF output
b085632b7 add more flexible metadata handling to OPL and debug output
a12c65974 Remove now wrong check.
767ad883a Allow PBF DenseNodes with only some attributes to be read.
fd5a7eb6c More flexible metadata encoding in OSM files.
d16c18581 Add instructions for bug reporting.
db52591ab Use __COUNTER__ instead of name for internal dummy name.
89e634dfc Cleanup.
931ec30ca Marks some false positives for clang-tidy google-runtime-int warning.
b59ef02a2 More rule of zero/rule of five fixes.
1b72b3386 Pass by value and use std::move.
b7d7017cc Handle some clang-tidy google-runtime-int warnings.
c043ca016 Fix special functions.
41d9f0795 Use fixed sized ints where possible.
0899a66a7 Revert some changes older compilers don't like.
41e05989a Fix several rule of zero/rule of five issues.
4e78a828f Various fixes based on clang-tidy reports.
636bda372 Default initialize arrays.
466e5aa6a Handle various clang-tidy warnings.
9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning.
5e97bf29f Mark Reader and Writer non-movable.
3a2221b27 Add minimal tests for thread-safe queue class.
affdeed6f Add some tests.
5ed055d50 Handle some warnings regarding "explicit".
b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning.
254c25349 Make ADL work for begin()/end() of InputIterator<Reader>.
b64cb32ae Disable clang-tidy android-cloexec-* warnings.
6d6934ffc Fix various warnings reported by clang-tidy.
30dcabaed Another travis build fix.
88c59e669 Fix travis build.
2facb461f Fix travis and appveyor builds.
bba631a51 Remove protozero from repository.
aebe4a914 Use pass by value and std::move in some constructors.
c8c24c8fd Name unused parameters in comments.
9c2e321f9 Make deleted special functions public.
265c16284 Fix some problems with older compilers.
174e95211 Modernize class initialization code for some classes.
4e3e584f8 Disable more clang-tidy warnings.
6b53981bb Fix some class initializations.
fe1405ef8 Add/remove special functions for some classes.
c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning.
0d09210ec Disable misc-unused-parameters warning in clang-tidy.
1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning.
91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons
438076b09 Cleanup: Avoid else after return/break.
e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check.
c822888fc Mark C style cast in macro from a library as NOLINT.
662d4a641 Moving a TypedMemoryMapping is noexcept.
aec1c4526 Use auto (clang-tidy check modernize-use-auto).
64857589d Consistent include order.
d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check.
0d3902420 Refactor test without SECTION.
32e9e9e1e Rewrite test avoiding nested sections.
eeb532902 Reorder includes according to best practice.
249e7b553 Revert "Add build with sanitizers to travis."
362cb419a Set CC env var in travis config.
9f520eca3 Add build with sanitizers to travis.
cfc18fef0 Travis config cleanup.
212c6cd42 Remove tests that triggers undefined behaviour in the std lib.
f30985884 Bugfix: Avoid undefined behaviour.
90191619a Make test work even if unused memory isn't returned to OS.
876867e68 Make older compilers happy.
925d1a797 Add names for unused parameters.
014b3a056 Avoid repeating the return type from the declaration
c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings.
8c03b3827 Disable some warnings.
c49962ffe Refactor test to avoid spurious use-after-move warning.
04a0afbba Sort includes.
2aaab9a89 Use auto where possible.
e2d84109b More changes for old compilers.
5364ca2a8 Changes for old compilers.
098fc1fa2 Move initializations of class members to the declaration.
eea463026 Fix buffer overflow in o5m parser.
5dc74f2d5 Remove check from static cast (and document why).
7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr.
01fa05f1e Clang-tidy config cleanup.
5e8f8df3f Order includes.
6b78d9b24 Various small fixes for problems detected by clang-tidy.
b815f71b7 Fix gdal check in CMake config.
d47487093 Fix integer type error.
dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep.
85e37723b Various small cleanups.
5f40d726a Additional checks in o5m parser.
b59b4b6a6 Check before static cast and throw.
e57b15700 Disable compiling some header files if gdal lib is not available.
1d3056646 Better checking that PBF data is in range.
c586521d3 Add some consts to the code.
df17e8189 Trying to get the types right...
8e9b759e0 Check read and write system call for EINTR.
28c676054 Rename license file so that Github finds it.
be29e9a52 Remove duplicate space character.
36c14136f Update protozero to newest version (1.6.0).
a19181998 Make libosmium work with different protozero versions.
5c5d9fb36 Use tag and type from protozero to make PBF parser more robust.
03f894400 Add repology.org badge to README.md.
1840739dd Merge pull request #234 from AMDmi3/patch-1
d8e737196 Add support for DragonFly BSD
8de181c8d Revert "Return const object from postfix ++ operator."
0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories
150e05aea Fix indentation.
6fdee974a Merge pull request #229 from alex85k/no-winsock
f302f08ce Merge pull request #228 from alex85k/fix-test-win
bfb60c888 remove ws2_32 from needed libraries
ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace
9343f8453 Fix testdata-multipolygon test on Windows (executable path differs)
381cf9272 Do not return const from postfix increment operator.
46ec985e9 Add const version of OutputIterator::operator*.
c67de374f Disable clang-tidy test for const params.
f5eda165f Make functions noexcept and return const value from post increment op.
1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings.
8893d16be Mark some tests using size() with NOLINT.
f8a74a8aa Make functions noexcept.
45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability.
fc173dae7 Merge pull request #227 from alex85k/msys2-appveor
0a281c064 Add MSYS2 building to Appveyor
c93f73120 fix FindGem for Windows Ruby distributions
8bf6702b3 Merge pull request #226 from alex85k/master
e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64
d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body
6830ee9bd ftruncate is not available only on MSVC (MinGW has it)
c0597584f Disable some clang-tidy checks.
578db8e4a Use empty() instead of size() or == "" to check for empty collections.
53c8f3a21 Return const object from postfix ++ operator.
bd5e4d109 Use emplace_back() instead of push_back().
0a0a4f24c Use correct C++ header.
35226ea86 Remove unused move.
df843a9cf Fix header guard.
759e76131 Avoid default argument on virtual function.
db4f1bdb9 Update included catch.hpp to version 1.10.0.
59e70e5c6 Pass constructor arguments by value and std::move() into members.
ee9b598ed Add tests for thread_handler.
ac661209a CMake config: Update list of clang-tidy versions we look for.
d7281215c Add comment to unusual code.
cbb4c09fb Split up some overlong test functions.
9870a6b90 Fix noexcept specification.
5e27c37d0 Use array instead of map to store input/output format creators.
987d12922 Mark some constructors noexcept.
17f4d8b7e Avoid static variable only needed as constant value.
fe705cef0 Avoid else after return in several cases.
d4a85878e Beautifying travis config.
f07d1e375 Make some special functions noexcept.
4bb0f7f22 Do not declare special functions on some classes.
bc6c5943d Disable some clang-tidy checks that produce false positives.
6b6598a5b Remove superfluous std::move() of POD type.
71c3f5e16 Make some special functions noexcept.
1cb32778c Remove explicit true/false in tests.
929ba89cf Always catch by const ref.
a9a255820 Code readability: No else clause after return.
f14364bd3 Code formatting fixes.
f41feb6a5 Simplify code.
727f6eff4 Mark dummy includes for IWYU.
72d20f835 Switch travis build to 'trusty'.
c480e6808 Do not run gcov from codecov script.
d16c6e90a Clean up lambda captures in xml_input_format.hpp.

git-subtree-dir: third_party/libosmium
git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 22:03:25 +03:00
Michael Krasnyk c7d22c2b92 Update dependencies script 2018-04-19 22:03:20 +03:00
Michael Krasnyk b2aeb47630 Remove dummy edges before inplace permutation 2018-04-19 12:18:48 +02:00
Patrick Niklaus 0a1d1901cc Fix help text and banner 2018-04-17 18:02:28 +02:00
Patrick Niklaus 29db0c80d9 Use CSV stringify to properly escape data in CSV 2018-04-17 18:02:28 +02:00
Huyen Chau Nguyen 4654751872 add dev dependencies for osrm runner 2018-04-17 18:02:28 +02:00
Marcel Radischat b5b18d8afc Update profiles.md
Add api-version 4 for lua profiles as latest api-version
2018-04-17 17:23:08 +02:00
Huyen Chau Nguyen 15139c934f add changelog entry 2018-04-16 11:39:44 +02:00
Huyen Chau Nguyen 7b8619e37c adjust tests to changes 2018-04-16 11:39:44 +02:00
Huyen Chau Nguyen f52b5c31b6 refactor bike profile 2018-04-16 11:39:44 +02:00
Huyen Chau Nguyen e98859e4c0 make primaries and secondaries more dangerous
only apply oneway safety considerations on primaries

re-adjust primary and secondary safeties
2018-04-16 11:39:44 +02:00
Patrick Niklaus c5cc4c5a74 Remove double log printing 2018-04-13 10:13:57 +00:00
karenzshea e3b831364f empty list of shmem regions if none found 2018-04-13 12:07:10 +02:00
karenzshea 730d2b5ef2 log err instead of throwing when no shmem regions found 2018-04-13 12:07:10 +02:00
Michael Krasnyk 16abee1022 Avoid using signed integers for edge IDs 2018-04-12 10:03:37 +02:00
Patrick Niklaus 69fa52a010 Use byte based tar size encoding above 8GB 2018-04-10 21:12:39 +02:00
Patrick Niklaus e1efa4c6ab Add test case for writing and reading huge tar file
This test case is disabled by default because it needs too much storage,
but serves as documentation for the future.
2018-04-10 21:12:39 +02:00
Michael Krasnyk 17cd1575f6 Use base-256 encoding for files larger 68G
Reference:
http://lists.busybox.net/pipermail/busybox/2011-May/075596.html
2018-04-10 21:12:39 +02:00
Michael Krasnyk 3cd8e0fef8 Use 12 octal digits in mtar_raw_header_t::size 2018-04-10 21:12:39 +02:00
Michael Krasnyk 397bb694fd Fix mtar file size truncation to 4G 2018-04-10 21:12:39 +02:00
Patrick Niklaus 473ebfcbf6 Fix debug printing for coordinates 2018-04-10 18:08:18 +02:00
Patrick Niklaus a06171438e Fix hard-coded hint strings in unit-tests 2018-04-10 18:08:18 +02:00
Patrick Niklaus ea0881553e [skip ci] Bump master to 5.18 2018-04-09 13:14:43 +00:00
Michael Krasnyk c4bf450fc6 Restore storage constructors with one arguments 2018-04-09 15:08:00 +02:00
Patrick Niklaus bf2b45120a Use ArrayStorage for boundary nodes to optimize MLD
For the MLD algorithm we can partition the NodeID range into boundary
and non-boundary nodes. Since there are only we boundary nodes we can
use the ArrayStorage for those yielding much faster query times.
2018-04-09 15:08:00 +02:00
Patrick Niklaus 7edf0f218c Better statistics for osrm-partition and osrm-custimize 2018-04-09 13:39:39 +02:00
Patrick Niklaus 600ca06166 Simplify toEdges and make it more robust against accidental memory allocations 2018-04-09 13:03:28 +02:00
Michael Krasnyk 8d8042ebae Use ranges with fixed types 2018-04-09 11:05:01 +02:00
Kajari Ghosh be123cd72f Use ranges in datafacade instead of vectors
Range type must use immutable references due to a
regression in `boost::any_range`.
References:
https://svn.boost.org/trac10/ticket/10493
https://stackoverflow.com/questions/42427395/boostany-range-with-optimization-level-o2-causes-crash/42427662
2018-04-09 11:05:01 +02:00
Daniel Patterson 282415bbc1 Honour British spelling of manoeuvre relation (#5004)
* Support British spelling of manoeuvre to comply with OSM standards.
2018-04-06 17:08:30 -07:00
Patrick Niklaus b08191b2c4 Add changelog entry for osrm-datastore 2018-04-07 00:22:29 +02:00
Patrick Niklaus 39dd484f45 Restore the connectivity checksum check 2018-04-07 00:22:29 +02:00
Patrick Niklaus 5450574d63 Better test coverage for datastore options 2018-04-07 00:22:29 +02:00
Patrick Niklaus 29d1b34140 Fix formating 2018-04-07 00:22:29 +02:00
Patrick Niklaus a915542916 Add option to only update the metric dependent data 2018-04-07 00:22:29 +02:00
Patrick Niklaus fea07f343b Load data in two separate data regions 2018-04-07 00:22:29 +02:00
Patrick Niklaus c7daa521ad Address PR comments 2018-04-05 15:12:47 +02:00
Patrick Niklaus c2532b1589 Add test case from @oxidase for datastore parameters 2018-04-05 15:12:47 +02:00
Patrick Niklaus 4610fd9ff1 Fix formating 2018-04-05 15:12:47 +02:00
Patrick Niklaus c4b90f52c0 Run cucumber in its own dataset namespace so it does not interfere 2018-04-05 15:12:47 +02:00
Patrick Niklaus 0e8b8b4901 Add nodejs test for dataset name 2018-04-05 15:12:47 +02:00
Patrick Niklaus 2c80f76004 Add support for naming the dataset 2018-04-05 15:12:47 +02:00
Patrick Niklaus 666ce46d36 Refactor shared memory storage to allow for multiple named datasets 2018-04-05 15:12:47 +02:00
Michael Krasnyk bc120776f0 Don't apply unimplemented SH and PH conditions 2018-04-05 13:31:48 +02:00
Daniel Patterson 5693ffd2cf Validate format of changelog entries. 2018-04-05 10:56:28 +02:00
Patrick Niklaus 51fe0dd5a0 Add missing check of a tar writing function 2018-04-05 00:54:50 +02:00
Michael Krasnyk 14d2199cd8 Always create a new kv pair to avoid using shared strings 2018-04-04 12:38:40 +02:00
Patrick Niklaus 9889a454ce Fix test compilation 2018-04-04 12:38:40 +02:00
Patrick Niklaus cb4586ebee Make use of the view factory in the data facade 2018-04-04 12:38:40 +02:00
Patrick Niklaus 44924b4bb4 Refactor view creation to own header file 2018-04-04 12:38:40 +02:00
Patrick Niklaus 3af3e06e75 Remove canary to get a consistent interface for getting a block pointer 2018-04-04 12:38:40 +02:00
Patrick Niklaus 39effb8f7e Fix checking for non-empty string in prefix check 2018-04-04 12:38:40 +02:00
Patrick Niklaus 5a68f4c214 Refactor setting up vector_view 2018-04-04 12:38:40 +02:00
Patrick Niklaus f558b16147 First step for better vector encapsulation 2018-04-04 12:38:40 +02:00
Patrick Niklaus 4c2d578561 Fix unit-test compilation due to broken readGraph 2018-04-04 12:38:40 +02:00
Patrick Niklaus 81a4747acb Fix formating 2018-04-04 12:38:40 +02:00
Patrick Niklaus 9fc2c32408 Fix errors when loading an incompatible dataset. 2018-04-04 12:38:40 +02:00
Patrick Niklaus 24e0028afb Remove CheckCompability because it now duplicates logic in the datafacade 2018-04-04 12:38:40 +02:00
Patrick Niklaus c334d11e95 Refactor metric storage 2018-04-04 12:38:40 +02:00
Patrick Niklaus aec9b6a178 Fixed reading DataLayout from shared memory 2018-04-04 12:38:40 +02:00
Patrick Niklaus 81929c984b Use boost array sink to avoid copying buffer for BufferReader 2018-04-04 12:38:40 +02:00
Patrick Niklaus 5395290fd5 Add directory listing 2018-04-04 12:38:40 +02:00
Patrick Niklaus b3ef2a0383 More refactor 2018-04-04 12:38:40 +02:00
Patrick Niklaus 9e97748700 Add datalayout tests 2018-04-04 12:38:40 +02:00
Patrick Niklaus 4a9fdca7b2 Remove fixed block identifiers 2018-04-04 12:38:40 +02:00
Daniel Patterson f3b7ab92ff Fix typo. 2018-04-04 12:24:09 +02:00
Daniel Patterson eae9e7fab6 Only listen on 127.0.0.1 (unless overriden by environment) during test runs by default. 2018-04-04 12:24:09 +02:00
Daniel Patterson 649d4ee512 Add support for the 'straight' maneuver direction (#4995)
Add support for the 'straight' maneuver direction
2018-04-03 17:20:18 -07:00
Daniel Patterson b5a4ffed96 Return datasource names along with datasource annotation (#4973)
* Add new `datasource_names` annotation that returns the string version of the `datasources` annotation
2018-04-03 15:13:25 -07:00
Duane Gearhart 8a63ad9b4b Added post process logic to collapse segregated turn instructions (#4925)
* Added post process logic to collapse segregated turn instructions

* format updates

* Fixed coordinates to reflect reality
Updated left turn road name

* fixed coordinates to fix test

* Skip last step when processing segregated steps

* updated segregated turn test

* Updated segregated test

* Updated test: Segregated Intersection, Cross Belonging to Correct Street - features/guidance/collapse.feature:79

* Fixed all but one for features/guidance/collapse.feature:124

* Fixed Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second - features/guidance/collapse.feature:219

* Fixed 7 of th 9 failures for Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second - features/guidance/collapse.feature:219

* Fixed 7 of the 9 failures for Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2) - features/guidance/collapse.feature:318

* Fixed Scenario: Segregated Intersection into Slight Turn - features/guidance/collapse.feature:581

* Updated Scenario: U-turn after a traffic light - features/guidance/turn-lanes.feature:1220

* Updated how we combine segregated steps

* Added test to Verify end of road left turn across divided roads

* Fixed divided highwat tests

* Fixed test failure

* fixed Scenario: Partitioned turn, Slight Curve - maxspeed - features/guidance/turn-lanes.feature:936

* Fixed Scenario: Partitioned turn, Slight Curve - features/guidance/turn-lanes.feature:961

* Added strategies to combine segrgated intersections

* Added setModifier alias for readability

* Added strategies to combine segrgated intersections

* Format updates

* Fixes segregated indentification to not mark `circular` edge as segregated

* Added intersection prior to turn so we still call out end of road

* updated expectation to be turn instead of continue

* Confirmed with @oxidase that the lane information if correct - updated the expectation

* Added logic to handle wider straights
Fixed tests

* Update CHANGELOG.md

Added #4925

* Removed TODO

* Process straight step prior to wider straight step
2018-03-30 07:43:56 -04:00
karenzshea 0d9f18fe1f add microtar to executables 2018-03-27 20:50:34 +02:00
Patrick Niklaus 2690dd0621 Merge pull request #4960 from Project-OSRM/refactor/tar_files
Use tar-format to encapsulate data
2018-03-27 14:34:08 +02:00
Patrick Niklaus 4ef331db1f Use read-only mmap as member in StaticRTree 2018-03-27 10:20:33 +00:00
Michael Krasnyk e572d6c340 msvc fixes 2018-03-26 21:45:27 -04:00
Patrick Niklaus 0c48f5fe2f Make sure to return const char* paths for mtar 2018-03-26 13:13:17 +00:00
Patrick Niklaus 3ee8a963cb Fix formating again 2018-03-26 12:13:07 +00:00
Patrick Niklaus c322d93435 Make the block size of vector<bool> consistent 2018-03-26 12:12:41 +00:00
Patrick Niklaus c0dd5d7c76 Fix formating 2018-03-26 11:02:34 +00:00
Patrick Niklaus 993f5badf1 Use OSRM runtime error for tar reader as well 2018-03-26 11:02:34 +00:00
Patrick Niklaus a542da3678 Remove old io::FileWrite serialization code 2018-03-26 11:02:34 +00:00
Patrick Niklaus f1a392c4df Fix test include path 2018-03-26 11:02:33 +00:00
Patrick Niklaus f2bace6c1f Wrap lambda in std::function because of boost version issues 2018-03-26 11:02:33 +00:00
Patrick Niklaus 921235b2dc Use pair instead of tuple for implicit construction 2018-03-26 11:02:33 +00:00
Patrick Niklaus bde51a9ef5 Add tar file mmaping 2018-03-26 11:02:33 +00:00
Patrick Niklaus a52213c885 Get offset of data inside tar file 2018-03-26 11:02:33 +00:00
Patrick Niklaus 8e800c48bc Add function to stop and continue writing to a tar file 2018-03-26 11:02:33 +00:00
Patrick Niklaus e25654c210 MICROTAR: Patch microtar to allow reading from files we are writing to. 2018-03-26 11:02:33 +00:00
Patrick Niklaus ee447afd72 Fix DealloctingVector from initializer list constructor
It was not setting the number of elements.
2018-03-26 11:02:33 +00:00
Patrick Niklaus c410c200bd Port .cnbg file to tar format 2018-03-26 11:02:33 +00:00
Patrick Niklaus 8152dcfb4c Port .ramIndex to tar file and mmap .fileIndex directly 2018-03-26 11:02:33 +00:00
Patrick Niklaus 86ffce3a50 Fix missing removal of timestamp in offline facade 2018-03-26 11:02:33 +00:00
Patrick Niklaus bed53f5fd5 Remove timestamp file 2018-03-26 11:02:31 +00:00
Patrick Niklaus 2b010fc6f3 Port .enw file to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus b8260e44fa Port .names file to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus a594008e57 Port .edges file to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus f407afa694 Move .osrm file to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus 06f28ffd34 Add BufferWriter/BufferReader and simplify interface for ConditionalRestrictions 2018-03-26 11:02:04 +00:00
Patrick Niklaus 4f454a3761 Add buffer reader/writer for per-element serialization 2018-03-26 11:02:04 +00:00
Patrick Niklaus d4300e73f3 Remove line reading interface from FileReader 2018-03-26 11:02:04 +00:00
Patrick Niklaus 990e411361 Port turn duration penalties to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus 73b3d37837 Port maneuver overrides to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus 5d7d5fceba Port .tld and .tls data 2018-03-26 11:02:04 +00:00
Patrick Niklaus b1dfbce675 Port .ebg_nodes to tar file 2018-03-26 11:02:04 +00:00
Patrick Niklaus da5aebaef3 Port .geometry file to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus bced9a5a6d Port .datasource_names to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus 2c5e4e6c02 Add test cases for range table and packed vector serialization 2018-03-26 11:02:04 +00:00
Patrick Niklaus 6ea296fb5c Port .nbg_nodes file to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus cf5f6be472 Swtich EBG to tar file 2018-03-26 11:02:04 +00:00
Patrick Niklaus c61198b26b Port over profile properties 2018-03-26 11:02:04 +00:00
Patrick Niklaus 5d1b4ce71d Port .osrm.icd file over to tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus c664d0392a Add test cases for int and unsigned vector for tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus aaf39162a8 Fix vector<bool> serialization for tar files and add unit tests 2018-03-26 11:02:03 +00:00
Patrick Niklaus cb31f9ec29 Port hsgr file to tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus fed77c4066 Port cell metrics to tar files 2018-03-26 11:02:03 +00:00
Patrick Niklaus 6a09d2aa9b Remove file size checks from compability logic 2018-03-26 11:02:03 +00:00
Patrick Niklaus 15b53de056 Switch over partition/ files to tar format 2018-03-26 11:02:03 +00:00
Patrick Niklaus 6d96a9a2e3 Serialize mldgr using the new tar writer 2018-03-26 11:02:03 +00:00
Patrick Niklaus 653f647fee Use static alignment for DataLayout 2018-03-26 11:02:03 +00:00
Patrick Niklaus f7b7335d75 Write/read tar for mldgr 2018-03-26 11:02:03 +00:00
Patrick Niklaus 495131efd7 Add vector serialization 2018-03-26 11:02:03 +00:00
Patrick Niklaus 2eb633bc41 Add unit tests for tar reading 2018-03-26 11:02:03 +00:00
Patrick Niklaus 86bfe1ede1 First step towards reading/writing tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus c04e1b2ded Merge commit '098d77c658fa846aff55a35c0ad42955e9f736ee' as 'third_party/microtar' 2018-03-26 11:01:50 +00:00
Patrick Niklaus 098d77c658 Squashed 'third_party/microtar/' content from commit 956791770
git-subtree-dir: third_party/microtar
git-subtree-split: 956791770defa4d06696b30db276e88a09ad3538
2018-03-26 11:01:50 +00:00
Patrick Niklaus 385bba4949 Add microtar to dependencies 2018-03-26 10:59:55 +00:00
Duane Gearhart bc980e72bf Update CHANGELOG.md
Updated #4968: Updated segregated intersection identification
2018-03-23 11:41:52 +01:00
Duane Gearhart 535bb49893 Fixed segregated identification code to not mark circular edges as segregated 2018-03-21 18:02:26 +01:00
Michael Krasnyk b56a7579a8 Review updates 2018-03-20 16:33:15 +01:00
Michael Krasnyk 8b52c6c7ac Update tests expectations and obvious detection 2018-03-20 16:33:15 +01:00
Michael Krasnyk d166fc6a75 Restructure Obvious Turn Handling, code transfer from #4426 2018-03-20 16:33:15 +01:00
Huyen Chau Nguyen bdb116afe5 Fix wrong one-way identification in the bike profile
* upgrade to api version 4

* set bike pushing speed to 4km/h and add mode change penalty

* set cycleways for two-way and one-way roads according correctly

* add changelog

* adjust tests according to change of the walking speed

* adjust tests according to new behaviour of opposite, track and lane in one-ways

* refactor the cycleway identification

* comment to understand weird counterintuitive testcase

* adjust sliproad test because walking speed is now slower
2018-03-19 16:02:25 +01:00
Michael Krasnyk 873e766d2e Add Github releases step 2018-03-18 15:27:11 +01:00
Huyen Chau Nguyen a84277f246 add tests in left-side-countries 2018-03-18 14:30:40 +01:00
Patrick Niklaus b80764b6b8 Refactor shared memory layout to expose Block as interface 2018-03-14 17:05:55 +01:00
Frédéric Rodrigo 14082d0e00 Fix typo 'Maximum number of classes if' 2018-03-14 03:16:13 +01:00
Daniel Patterson f7775f5e0b Add source phantom weight to first segment when merging legs (#4949)
Fix annotation values for annotations on edges where phantom nodes are snapped.
2018-03-13 11:31:29 -07:00
Michael Krasnyk b7af6eb2a4 Remove correctly the last segment in annotation 2018-03-09 15:59:21 +01:00
Daniel Patterson a4ee2ccb13 Avoid copying json::Value objects a lot when reallocating vector 2018-03-08 16:01:16 +01:00
Manuel Martin c61acaf8be Add documentation about OSM node ids in nearest service response 2018-03-06 16:10:22 +01:00
Michael Krasnyk 0fc8b6289c Merge IntersectionShapeData and IntersectionEdgeGeometry 2018-03-05 13:19:57 +01:00
Michael Krasnyk 0f93a7dd05 Cleanup EBGF code 2018-03-05 13:19:57 +01:00
Michael Krasnyk 4d0fb89489 Adjust Straight direction modifiers of side roads in driveway handler 2018-03-05 13:19:57 +01:00
Michael Krasnyk 6f4af330ed Handle oneways in get_forward_backward_by_key 2018-03-05 13:19:57 +01:00
Michael Krasnyk 7c8c25f7bc Don't use obviousness for links bifurcations 2018-03-05 13:19:57 +01:00
Michael Krasnyk cf56b5ddbf Increase precision of coordinates in OSM links 2018-03-05 13:19:57 +01:00
Lev Dragunov ac23e3b223 clang-format 2018-03-01 11:32:18 +01:00
Lev Dragunov 7922a6172a Bearing calculation on matching short segments fix. 2018-03-01 11:32:18 +01:00
Daniel Patterson e34f2db4db Get OSRM_VERSION_* fields from package.json so we don't have to change things in two places.
No longer need to update CMakeLists.txt version field manually.
2018-03-01 12:05:00 +11:00
Daniel Patterson 5df33e5b90 Make alternative routes tests stable by only being single-threaded 2018-03-01 12:03:18 +11:00
karenzshea db608559f6 avoid testing self-intersecting way 2018-02-28 15:21:47 +01:00
Michael Krasnyk c048a36a4c Use smaller range for U-turn angles in map-matching 2018-02-28 15:21:47 +01:00
Duane Gearhart 33021d37a1 Updated segregated intersection identification (#4845)
* Initial internal intersection updates
paired with @oxidase and @kdiluca
TODO fix tests and add in new ones

* Added Internal Intersection Model

* removed debug info

* updates per PR 4845

* fixing build errors

* fixing all compile errors

* fixed EdgeID param

* Added is_internal_straight lambda
Added/Updated constexpr names and values

* added rejection case turn degree logic

* debug logging

* added turn angle logic to reject if there are incoming edges that have opposite turn degrees than outgoing edges or if the outgoing edges have opposing turn degrees; also merged with master v5.16

* fixed formatting

* fix to decrease tile size based on latest turn angle internal intersection updates

* Removed breaks

Breaks in code were a mistake and caused a change in the internal intersection identification.

* Update segregated_intersection_classification.cpp

* Update CHANGELOG.md

Added CHANGED #4845: Updated segregated intersection identification to Unreleased
2018-02-27 15:11:23 -05:00
Patrick Niklaus 31d6d74f90 Update documentation and changelog 2018-02-26 23:32:34 +01:00
Patrick Niklaus bec57258a4 Add mmap allocator 2018-02-26 23:32:34 +01:00
Karen Shea 43f0723b73 Remove deduplication of unpacked_path_segments in MM collapsing (#4911)
* remove deduplication of unpacked_path_segments
2018-02-24 12:42:11 +11:00
Huyen Chau Nguyen 9b74a47c91 build osx binary for node4 and bump to RC 2 2018-02-24 11:42:08 +11:00
Huyen Chau Nguyen 993a36ea20 update master changelog after version release 2018-02-24 11:42:08 +11:00
Huyen Chau Nguyen 8b5af24eb8 add 5.15.2 to changelog (#4910) 2018-02-23 14:41:02 +01:00
Thomas Brüggemann 5c9a7a0152 Fixed the order of lon/lat in osrm.route() example 2018-02-22 23:41:54 +01:00
Michael Krasnyk 83588fd00f Renumber node IDs in .osrm.maneuver_overrides 2018-02-22 11:42:33 +01:00
Michael Krasnyk 5acf660f37 Check required tags of maneuver relations 2018-02-21 14:49:15 +01:00
Michael Krasnyk de13834c12 Handle motorway forks with links as a normal motorway ...
passing some ramps or mering onto another motorway
2018-02-21 14:19:53 +01:00
Michael Krasnyk 49811e1f46 Test case for a highway fork with a link 2018-02-21 14:19:53 +01:00
Mateusz Loskot 8788b0fae8 Add .editorconfig file
Propose basic settings for controlling EOL encoding and
space-only indentation of CMake and other scripts.
2018-02-20 16:16:26 +01:00
Michael Krasnyk 1cafafc4cd Don't use obvious directions at ramp bifurcations, #4895 2018-02-20 09:02:24 +01:00
Michael Krasnyk e2c1956aa5 Test for a ramp bifurcation obviousness 2018-02-20 09:02:24 +01:00
Huyen Chau Nguyen a8bc2cf8a7 update package.json (#4889) 2018-02-15 16:14:18 +01:00
Huyen Chau Nguyen 975ede4bec Update package.json
add mkdirp and rimraf to bundledependencies in order for node-pre-gyp to properly install with node
2018-02-15 14:34:35 +01:00
Mateusz Loskot faff2c774d [msvc] Fix quoting of OSRM_PROJECT_DIR as preprocessor define
It looks MSVC still special handling, no quotoing as well as
additional quoting like add_definitions(-DFOO="\\"foo\\"")
as per https://cmake.org/pipermail/cmake/2007-June/014611.html
does not seem to handle CMake variables correctly.

This Visual C++ specific fix is based on this solution
https://cmake.org/pipermail/cmake/2006-September/011292.html
2018-02-14 13:54:54 +01:00
Mateusz Loskot d8e3b03ec1 Ignore CMakeSettings.json for CMake integration with VS2017
CMakeSettings.json is an auxiliary file used to customize
CMake configuration while building from within VS2017.

[ci skip]
2018-02-14 13:30:32 +01:00
Mateusz Loskot ae41066fbe Prefer logical punctuators instead of named operator keywords
Some compilers (eg. MSVC) still require inclusion of <ciso646>
in order to import named operator keywords.
It is easier to stick with traditional punctuators.
2018-02-14 13:26:41 +01:00
Fred-Byrd 342da81591 web_mercator to double 2018-02-13 12:54:52 +01:00
Fred-Byrd df9195b939 coordinate_calculation doubles 2018-02-13 12:54:52 +01:00
Michael Krasnyk 519eae63c6 Use links with lower priority in the motorway handler
Ref:
https://wiki.openstreetmap.org/wiki/Highway_link
https://wiki.openstreetmap.org/wiki/Link_roads_between_different_highways_types
2018-02-13 11:20:27 +01:00
Michael Krasnyk 5f598da76d Add OSM node barrier=height_restrictor handling 2018-02-12 11:40:35 +01:00
Patrick Niklaus 0da2029d2d Remove publishing binary artefacts on Windows. 2018-02-09 21:18:39 +01:00
Patrick Niklaus e82b51d0cb Fix default value for matching radius in routed 2018-02-09 21:12:14 +01:00
Daniel Patterson 5531cace7f Support maneuver relations (#4676) 2018-02-10 05:32:09 +11:00
Patrick Niklaus 1aed13500d Remove GCC 4.9 support. Minimum is now 5.0. 2018-02-09 17:51:58 +01:00
Patrick Niklaus f6db8ff3b0 Disabel missing initialization warning on GCC 4.9 2018-02-09 17:51:58 +01:00
Patrick Niklaus 26e5c4eae2 Fix formating 2018-02-09 17:51:58 +01:00
Patrick Niklaus bee3bdb576 Don't throw errors on -Wmaybe-uninitialized because of false-positives 2018-02-09 17:51:58 +01:00
Patrick Niklaus b96d36f482 Try initializing all of ProfileProperties for GCC 4.9 2018-02-09 17:51:58 +01:00
Patrick Niklaus d13d6566f8 Fix infinite recursion warning 2018-02-09 17:51:58 +01:00
Patrick Niklaus aa1048154c Add missing initializer around sub-object 2018-02-09 17:51:58 +01:00
Patrick Niklaus 6c2d26f9bd Make LUA_SOURCE a global for gcc 4.9 2018-02-09 17:51:58 +01:00
Patrick Niklaus 84845ffaa6 Replace optional<EdgeWeight> with constant value 2018-02-09 17:51:58 +01:00
Patrick Niklaus f65958fc14 Disable error on -unused-local-typedef for clang since it has false positives 2018-02-09 17:51:58 +01:00
Patrick Niklaus 3d6b667997 No unused warning for alias benchmark 2018-02-09 17:51:58 +01:00
Patrick Niklaus 97d027a173 Fix unused lambda capture warnings 2018-02-09 17:51:58 +01:00
Patrick Niklaus f48dd665ad Fix error due to GLIBC workaround warning 2018-02-09 17:51:58 +01:00
Patrick Niklaus eb1e83858a Use BOOST_CHECK instead of BOOST_ASSERT to make tests work in release mode 2018-02-09 17:51:58 +01:00
Patrick Niklaus 371dc57dfc Fix uninitialized warning because of boost::optional 2018-02-09 17:51:58 +01:00
Patrick Niklaus 425a46fe78 Fix warnings in unit tests 2018-02-09 17:51:58 +01:00
Patrick Niklaus fa553659de Turn all warnings to errors for GCC and Clang 2018-02-09 17:51:58 +01:00
Patrick Niklaus 03cffd0f56 Ignore unused-variable warnings cause by V8 header
This can be removed after https://github.com/cjntaylor/node-cmake/pull/37
is merged and released.
2018-02-09 17:51:58 +01:00
Patrick Niklaus a06d1782c0 Fix multi-line warning 2018-02-09 17:51:58 +01:00
Karen Shea 05f6b55036 Expose waypoints parameter in match interface (#4859)
* expose waypoints parameter in match interface

* Sync target_traversed_in_reverse with target_phantom
2018-02-07 17:33:54 -05:00
Huyen Chau Nguyen fa8d788bb6 Add road priority class to turn function (#4858)
* expose road priority class to turn function

* update docs
2018-02-07 11:39:02 +01:00
Patrick Niklaus 92b7d581ce Removed unused geojson logging in partitioner 2018-02-06 11:51:33 +01:00
Patrick Niklaus 19651c3d91 Remove unused shapefile/gdal dependencies 2018-02-06 11:51:33 +01:00
Patrick Niklaus b4cfc8d6e0 Fix formating 2018-02-06 11:51:33 +01:00
Patrick Niklaus 71cfb03738 Remove broken check-conditionals tool 2018-02-06 11:51:33 +01:00
Patrick Niklaus e7bb612050 Move debug printer code to own header 2018-02-06 11:51:33 +01:00
Patrick Niklaus 83d7a57b73 Remove OSM link debug printing from public class 2018-02-06 11:51:33 +01:00
Patrick Niklaus cac310123b Remove debug printing code from Rectangle 2018-02-06 11:51:33 +01:00
Patrick Niklaus bb71d9b28a Remove unused code in partitioner 2018-02-06 11:51:33 +01:00
Kushan Joshi ea4d0fa1dd Update README.md
This PR makes the path of host `.osm.pbf` file clearer.
2018-02-06 01:07:09 +01:00
karenzshea 91561992a7 update changelog for 5.15.1 2018-02-05 12:21:49 -05:00
Patrick Niklaus a3ea825a11 Add build job for GCC 6 2018-02-05 13:07:09 +01:00
Patrick Niklaus 7ebbd5cebe Upgrade version of compilers and node on Travis CI
We now build using GCC 7 and Clang 5 and only build
binaries for node 8.x and 4.x.
2018-02-05 13:07:09 +01:00
Michael Krasnyk 9e93f198ae Add CRC checksums to EBG and turns data 2018-02-02 11:33:38 -05:00
Michael Krasnyk 10de243556 Move guidance turn generation out of EBGF 2018-02-02 11:33:38 -05:00
Michael Krasnyk 988b6e3311 Split intersection analysis and guidance code
Intersection analysis occupy in osrm::extractor::intersection namespace
and guidance code osrm::guidance
2018-02-02 11:33:38 -05:00
Michael Krasnyk 36877e4de5 Move guidance pre-processing code into GUIDANCE library 2018-02-02 11:33:38 -05:00
Michael Krasnyk 1794185d43 Refine logging output 2018-02-02 11:33:38 -05:00
Kajari Ghosh de938df560 remove TurnData from generate_edge function 2018-02-02 11:33:38 -05:00
Kajari Ghosh e02c5c3c6d comments 2018-02-02 11:33:38 -05:00
Michael Krasnyk 90ff725125 Duplicate edges and turns generation code 2018-02-02 11:33:38 -05:00
Michael Krasnyk 1cbfbd34cf Remove unnecessary loading of turns data in updater 2018-02-02 11:33:38 -05:00
Mateusz Loskot c6d12e064c Add basic facades for Customizer and Partitioner run methods 2018-02-02 15:52:30 +01:00
Mateusz Loskot 30ed1fae99 Move setting up task_scheduler_init from executables to library
Make entry points of individual pipeline stages responsible for
configuring the task scheduler with requested number of threads
passed in corresponding configuration bundle (ie. follow extractor).
2018-02-02 14:34:20 +01:00
Alain ANDRE 2987292cc0 Add support for non-numerical units in car profile for maxheight #4763 2018-02-02 11:07:43 +01:00
Mateusz Loskot 8114104a43 Rename namespace partition to partitioner
Rename module partition to partitioner.
This cultivates naming used in existing modules like extractor,
customizer, etc. - noun vs verb (word partition is both though).
2018-02-02 11:07:18 +01:00
Patrick Niklaus 03f598b93d [skip ci] Update PR template 2018-02-01 12:06:50 +00:00
Alain ANDRE 5a844f4b7d Addition of left-hand drive countries 2018-02-01 12:48:12 +01:00
Michael Krasnyk 91e6d68604 Increase MAXIMAL_ALLOWED_SEPARATION_WIDTH to 12 meters
the check should cover merging of roads at intersections similar
to https://www.openstreetmap.org/node/53020993#map=18/37.86590/-122.25083
2018-02-01 06:21:08 -05:00
Michael Krasnyk 1119a542d6 Announce reference change if names are empty, #4830 2018-01-29 16:32:59 -05:00
Michael Krasnyk d706696179 Test case for ref changes with empty names, #4830 2018-01-29 16:32:59 -05:00
Karen Shea c154875272 Only run step collapsing based on original waypoints parameter (#4829) 2018-01-29 12:35:55 -08:00
Michael Krasnyk 77f8a4f741 Set type of trivial intersections where classes change to Suppressed
... instead of NoTurn
2018-01-25 11:43:44 -05:00
Huyen Chau Nguyen 61e06fcaba Making the turn function more flexible (#4789)
* set and store highway and access classification for the turn function
* expose highway turn classification and access turn classification and speed to the lua profile turn function
* expose whether connection road at turn is incoming or outgoing
* add lua tests for exposed information to turn function
* update docs about attributes in process_turn
* add turn_classification info to docs
* adding warning if uturn and intersection dont match
* handle u turns that do not turn into intersection[0]
* split OSM link generation in an accessible coordinate function
2018-01-24 15:39:55 -05:00
Kajari Ghosh 13bb997525 Revert "Get actual paths for every entry in a matrix."
This reverts commit 350bc6f756.
2018-01-24 11:52:43 -05:00
Kajari Ghosh 350bc6f756 Get actual paths for every entry in a matrix. 2018-01-24 11:30:26 -05:00
karenzshea 02712cd513 Allow restricted access on highway=service roads for the car profile
We still backlist `access=private` for the car profile though.
2018-01-23 17:40:18 +01:00
Michael Krasnyk a9d94d35a2 [skip ci] Bump OSRM version to 5.16 2018-01-22 17:24:07 +01:00
Kajari Ghosh 155772f01f Refactor isThroughStreet/Intersection options (#4751)
* refactor isThroughStreet 
* refactor HaveIdenticalName
* fix a typo in the unit tests
2018-01-19 13:49:00 -05:00
Michael Krasnyk 341a5345da Ignore no_*_on_red turn restrictions (#4804) 2018-01-19 15:50:54 +01:00
Kajari Ghosh 72de59ac91 add tunnel as a class in lua (#4812) 2018-01-19 09:47:27 -05:00
Michael Krasnyk a7f1cd36fb Fix formatting 2018-01-19 13:55:05 +01:00
Michael Krasnyk 26f0b4dc77 Add assertion and adjust unit test expectations check 2018-01-19 13:55:05 +01:00
karenzshea 181eff29c7 add unit test for split submatch waypoints indices 2018-01-19 13:55:05 +01:00
karenzshea cdad265d49 only adjust waypoint index in tracepoints when waypoints parameter is specified 2018-01-19 13:55:05 +01:00
Patrick Niklaus 6eb4247484 Fix overflow on zero duration segments, fixes #4283.
As a form of smoothing we use the previous speed value instead.
This makes sense because the zero duration segments have to be very
short, potentially also zero length.
2018-01-18 17:29:23 +01:00
Huyen Chau Nguyen 72a23645a8 Remove "can't parse value" log messages (#4810)
* remove log output of measure.lua
* remove unneccessary return
* quick fix of #4794
2018-01-18 17:27:45 +01:00
Raphael Dumas c3e06356d6 Provide more detail on docker commands
Helps with #4253 #4095 #4510
2018-01-17 17:37:50 +01:00
Marcel Radischat 7a8390e68e Move description to first row of table 2018-01-17 17:35:29 +01:00
Patrick Niklaus 168e313f73 Correctly mark edges going to/from core with exclude flags 2018-01-11 12:46:49 +00:00
Patrick Niklaus 30f910e861 Add regression test from @fijemax 2018-01-11 12:46:49 +00:00
Huyen Chau Nguyen e998c1193d Update docs for process_turn in the profile docs (#4786)
* update correct attributes available in process turn

* make travel mode in ExtractedTurn const

* fix mismatch of struct and class
2018-01-10 11:31:24 +01:00
Michael Krasnyk a8f3474996 Use unsigned type in percent_encoding to prevent overflow for %80..%ff
Related fix in Boost.Spirit https://github.com/boostorg/spirit/commit/80414bc68868b27e1fd865cbbbc1a6db229825a5
2018-01-08 12:09:33 +00:00
karenzshea 55cc06fd8b Add waypoints parameter to matching service, returns map matching result
with selective input coordinates as waypoints
2018-01-08 12:28:20 +01:00
Karen Shea 8883d8cc56 Update http.md 2018-01-08 12:21:41 +01:00
Mateusz Loskot 5b2af6ef09 Restore use of user-provided osmium::thread::Pool instance
Pool instance has been removed from Reader ctor parameters
list in PR #4438, presumably unintentionally.
It is required to prevent potential deadlock during
Pool shutdown as explained in PR #4452.
2018-01-07 18:29:43 +01:00
Patrick Niklaus 6d801e7086 Bumped version to latest.4 2018-01-05 17:35:11 +01:00
Michael Krasnyk 17eb7052ba Make distance_between_roads symmetrical 2018-01-05 17:35:11 +01:00
Michael Krasnyk 330f25eddb Reduce extraction distance to 120 meters
For intersection at https://www.openstreetmap.org/node/65299217
`are_parallel` in MergableRoadDetector::HaveSameDirection is false
for South Van Ness Avenue with 150 meters
2018-01-05 17:35:11 +01:00
Michael Krasnyk 08b88bad63 Still use low precision bearings 2018-01-05 17:35:11 +01:00
Michael Krasnyk 153f9b02a5 Add low precision intersection views back 2018-01-05 17:35:11 +01:00
Michael Krasnyk 0568dca4a3 Adjust to review findings 2018-01-05 17:35:11 +01:00
Michael Krasnyk 60ef179d18 Remove handling of U-turns on motorways 2018-01-05 17:35:11 +01:00
Michael Krasnyk c64904f5ea Move roads re-ordering to convertToIntersectionView 2018-01-05 17:35:11 +01:00
Michael Krasnyk 4b9e3a8068 Remove IntersectionGenerator 2018-01-05 17:35:11 +01:00
Michael Krasnyk db7c76d04d Remove GetConnectedRoads from IntersectionGenerator 2018-01-05 17:35:11 +01:00
Michael Krasnyk cc1a5ea78d Remove usage of IntersectionGenerator in EBGF 2018-01-05 17:35:11 +01:00
Michael Krasnyk 9c033ff461 Free functions for guidance intersections analysis 2018-01-05 17:35:11 +01:00
Michael Krasnyk 3c3322173c Allow to specify empty bearings string in input parameters 2018-01-05 17:35:11 +01:00
Michael Krasnyk e805f85407 Print statistics only for allowed turns 2018-01-05 17:35:11 +01:00
Michael Krasnyk 4d54456f66 Don't fail if a registered printer has no name 2018-01-05 17:35:11 +01:00
Daniel J. Hofmann 7359d0542f Updates readme link for demo server wiki page, closes #4773 2018-01-05 15:19:33 +01:00
Mateusz Loskot da4fb13aa3 Tidy up #include-s for Intel TBB headers
Remove unused and add missing headers.
2018-01-05 11:00:31 +01:00
Michael Krasnyk 3649ab4d31 Use default maxspeed value for ua:urban 2018-01-02 20:43:42 +01:00
Michael Krasnyk 9e9e3fb1e4 Change default urban speed in Ukraine to 50kmh
From 1/1/2018 60kmh speed limit changed to 50kmh
http://zakon3.rada.gov.ua/laws/show/883-2017-%D0%BF
2018-01-02 15:34:05 +01:00
Darafei Praliaskouski e73aa01725 Belarus speed limits (#4764)
* Belarus speed limits

https://en.wikipedia.org/wiki/Speed_limits_in_Belarus

* taginfo.json update

* Update CHANGELOG.md
2018-01-02 14:49:36 +01:00
Michael Krasnyk a5353c7179 Use consistent EBG node weights in duplicated via nodes 2018-01-02 14:26:35 +01:00
Michael Krasnyk a5e0d7011b Update CHANGELOG entry 2017-12-26 16:18:27 +01:00
Michael Krasnyk 742c32d936 Don't use to_string conversion in requiresNameAnnounced 2017-12-26 16:18:27 +01:00
Michael Krasnyk 3dec680058 Remove check unnamed check in sliproad handler 2017-12-26 16:18:27 +01:00
Michael Krasnyk 9237430be2 Test for sliproads to roads with empty names 2017-12-26 16:18:27 +01:00
Patrick Niklaus 12d1d84b11 Add test case for sliproads converted from forks 2017-12-26 16:18:27 +01:00
Patrick Niklaus 6dd029e6ea Restore original intend of roundabout test
When doing the new Lua version refactor we changed the expectation to
use `continue uturn` instead of making a whole circle in the roundabout
as the original test case. This was only the shortest path since there
was no roundabout penalty.
2017-12-26 13:28:12 +00:00
Patrick Niklaus e45d44cb8e Make sure we only count turns as UTurns for the turn_function 2017-12-26 13:28:12 +00:00
Kajari Ghosh 84b6ef4340 add osrm-routed and node-osrm flags to configure mapmatching radius limit (#4721) 2017-12-20 16:53:43 +05:30
Frédéric Rodrigo 5af776d963 Car Profile. Route by supporting physical limitation of height and weight 2017-12-19 13:51:33 +00:00
Frédéric Rodrigo ddf11cc2cc Profile: stronger unit parsing 2017-12-19 13:51:33 +00:00
Denis Koronchik c7b1d0c131 Add support of maxweight in profiles 2017-12-19 13:51:33 +00:00
Denis Koronchik 423a4ef326 Add maxheight/maxwidth support into profiles 2017-12-19 13:51:33 +00:00
Patrick Niklaus ccfbce5300 Remove superflous sentinel in DynamicGraph, fixes #4738 2017-12-18 10:23:29 +00:00
Marcel Radischat b99d3a0a69 Avoid all highways listed in the avoid set
Even though the speeds are defined for a certain road class, routing should
be avoided as it is listed in the `avoid set`.
2017-12-16 23:45:04 +00:00
Marcel Radischat 659b470320 Add failing test
The avoid set should take precedence over the speed limits.
2017-12-16 23:45:04 +00:00
karenzshea 9a8ed30e95 add assert for untested sliproad cases, removed redundant empty_nameid checks 2017-12-11 15:37:56 +00:00
karenzshea 4166b1ebbf check for empty on string_ref, rather than string itself 2017-12-11 15:37:56 +00:00
karenzshea 89080fb2b0 check for empty name_id before getting data 2017-12-11 15:37:56 +00:00
karenzshea 56459d37d1 access way names through RouteStep in post processing 2017-12-11 15:37:56 +00:00
karenzshea d5232d5f5c check empty name string in roundabout handler 2017-12-11 15:37:56 +00:00
karenzshea 3f7b5da683 check empty name string in turn collapsing 2017-12-11 15:37:56 +00:00
karenzshea 24562acd30 check empty name string in turn handler 2017-12-11 15:37:56 +00:00
karenzshea 8bce061691 check empty name string in sliproad handler 2017-12-11 15:37:56 +00:00
karenzshea 701c5f853d check empty name string in motorway handler 2017-12-11 15:37:56 +00:00
karenzshea d1e4ba373a check empty string name in mergable road detector 2017-12-11 15:37:56 +00:00
karenzshea 8cf8f0d7d6 check empty name string in findBasicTurnType 2017-12-11 15:37:56 +00:00
Daniel J. Hofmann 978350c388 Adds cucumber test for continue not taking ref into account when name is empty 2017-12-11 15:37:56 +00:00
Patrick Niklaus 2e97c78181 Remove code for checking the .core file, since we do not create it anymore 2017-12-08 11:28:34 +00:00
Minh Nguyễn 979ec7fa78 Merge pull request #4726 from Project-OSRM/1ec5-pronunciation-doc
Clarify pronunciation property
2017-12-07 11:02:46 -08:00
Minh Nguyễn 1d7f179374 Clarified pronunciation property 2017-12-06 13:13:17 -08:00
Patrick Niklaus 994fae0ef6 Fix formating 2017-12-05 19:09:06 +00:00
Patrick Niklaus 88ee51ba2e const-correctness 2017-12-05 19:09:06 +00:00
Patrick Niklaus 25ee26de3b Refactor segregated intersection classification to right module 2017-12-05 19:09:06 +00:00
Daniel Patterson 353829a4cc This test now passes, including in the test suite. (#4712) 2017-11-29 13:16:07 -08:00
Michael Krasnyk 6fd0b56e32 Don't use removed alternative paths in filterPackedPathsByCellSharing 2017-11-29 13:17:24 +01:00
Daniel Patterson c1efefae27 Use the correct driving_side property on the arrive step. (#4708)
Use the correct driving_side property on the arrive step.
2017-11-27 13:16:33 -08:00
Daniel Patterson 0c96f093ff Add Macau and Hong Kong to the left-side driving polygon file. 2017-11-27 11:43:34 -08:00
Daniel Patterson 6f835d57b4 Add checkbox for changelogs to all PRs. 2017-11-27 10:30:46 -08:00
Daniel J. Hofmann e1e53d274b Makes MLD default algorithm in example to avoid confusion, see #4702 2017-11-27 12:12:49 +01:00
brian lewis d9a03f8365 Refer to Lua scripting language by its correct name 2017-11-27 12:10:49 +01:00
brian lewis ce5f284ec6 Fix typos in profiles documentation 2017-11-27 12:10:49 +01:00
Daniel Patterson 02a2d25a3f Reset versions/changelog for next release - 5.14 work happens on the 5.14 release branch. 2017-11-22 12:37:34 -08:00
Daniel Patterson 9fca6987c9 Update CHANGELOG for 5.14 release prep 2017-11-22 12:34:03 -08:00
Michael Krasnyk 7361558c19 Allow single edge paths in MLD alternatives, #4691 2017-11-21 12:28:44 +01:00
karenzshea 834890cf0b construct extract/contract configs to disable conditional restriction parsing by default 2017-11-20 16:55:17 +00:00
vng a53794f864 Code review fixes. 2017-11-16 15:08:30 +01:00
vng 8fa98ed27d Increase max segregated distances. 2017-11-16 15:08:30 +01:00
vng 111030864c Use segregated flag as a bit in EdgeBasedNode. 2017-11-16 15:08:30 +01:00
vng 90e361c3dc Use immutable node-based-graph for segregated edges. 2017-11-16 15:08:30 +01:00
vng 32e6ccb037 Code review fixes. 2017-11-16 15:08:30 +01:00
vng 258fcd8626 Fixed test tile test according to new algorithm output. 2017-11-16 15:08:30 +01:00
vng 92c4a228e1 Revert suppressSegregated routing. 2017-11-16 15:08:30 +01:00
vng 9eae1de9bc Fixes for segregated length threshold. 2017-11-16 15:08:30 +01:00
vng 76f793533a Use copressed node-based graph for segregated edges check. 2017-11-16 15:08:30 +01:00
vng ec7e58e10e Pass edge-based node segregated flag to the post processing routine. 2017-11-16 15:08:30 +01:00
vng ac5e095d17 Store and pass segregated flag to the data facade. 2017-11-16 15:08:30 +01:00
vng ee7912f882 Calculating segregated node-based edges. 2017-11-16 15:08:30 +01:00
Denis Koronchik f460a9f17e Add code to draw segregated nodes in a tile layer 2017-11-16 15:08:30 +01:00
vng 37685dae73 Added segregated test #4273. 2017-11-16 15:08:30 +01:00
Daniel Patterson 5b58445535 Expose driving_side as a property on RouteStep 2017-11-09 10:08:11 -05:00
Michael Krasnyk 5b79640b44 Don't compute new modifier for merge instructions in collapsing 2017-11-08 11:26:47 -05:00
Michael Krasnyk 921471a153 Test of merging onto a motorway with junction references 2017-11-08 11:26:47 -05:00
Daniel J. Hofmann 3a1bf2c85d Slightly decreases roundabout turn radius from 25m to 15m 2017-11-07 13:45:57 -05:00
Daniel J. Hofmann 9b83649a03 Fixes AppVeyor tests 2017-11-06 14:38:21 -05:00
Daniel J. Hofmann 2224389fb3 Filters zero value histograms, formats numbers 2017-11-06 14:38:21 -05:00
Daniel J. Hofmann aed7bd852d Prints turn types and modifiers as strings 2017-11-06 14:38:21 -05:00
Daniel J. Hofmann c5b48e3506 Adds a statistics handler for turn types and modifiers 2017-11-06 14:38:21 -05:00
Kajari Ghosh 73f4e1d45a update changelog 2017-11-06 13:34:02 -05:00
Kajari Ghosh 002da129c8 update tests 2017-11-06 13:34:02 -05:00
Kajari Ghosh 1b545fee8a update lua profile to use new process_turn 2017-11-06 13:34:02 -05:00
Kajari Ghosh cbc96ec492 refactor ExtractionTurn and ProcessTurn c++ code 2017-11-06 13:34:02 -05:00
Daniel J. Hofmann c95d845876 Adds Node 8 jobs to Travis, resolves #4657 2017-11-02 20:17:17 +00:00
Daniel Patterson ac7705e9a0 Ensure .pc installation to the same heirarchy as the actual libraries (usually /usr/local/lib) 2017-11-01 19:40:31 +00:00
Patrick Niklaus 0b6eb85106 Fix formating 2017-11-01 14:25:07 +00:00
Moritz Kobitzsch e197dae54d do not consider empty-names + empty-refs a valid name for u-turns 2017-11-01 14:25:07 +00:00
Moritz Kobitzsch 4bf3c97476 add test-case illustrating misuse of names in collapse 2017-11-01 14:25:07 +00:00
Daniel Patterson 19d2e82d15 Reduce docker image size to about 20MB by using a multistage build. 2017-10-31 23:35:01 -04:00
Michael Krasnyk eb48945807 Add use of LUA_LIBRARY_DIRS, #4646 2017-10-31 23:35:01 -04:00
Patrick Niklaus a68db86dc8 [skip ci] Bump OSRM version to 5.14 2017-10-31 16:17:07 +00:00
Daniel J. H 948025440f Clarifies docs for roundabout exits (#4640) 2017-10-26 14:44:06 -07:00
Daniel J. Hofmann 8365e20d4f Adds cardinal_directions flag to profiles and disables ref-rewriting by default 2017-10-26 20:38:41 +01:00
Denis Koronchik 0fc6903d7e Fix issue #4585 2017-10-25 14:11:33 +02:00
Moritz Kobitzsch 23fd27422b normalise angles only if an improvement 2017-10-25 10:17:14 +02:00
Moritz Kobitzsch e965cf12f8 add testcase illustrating changes to angle adjustments 2017-10-25 10:17:14 +02:00
Michael Krasnyk 523be8f7e5 Add unclassified roads to restricted_highway_whitelist, #4631 2017-10-24 09:59:07 +02:00
Patrick Niklaus c2a605a70d Contract the exclude-flag sub-graphs as well 2017-10-24 09:46:44 +02:00
Moritz Kobitzsch 910ee0829f make circular detection covered again 2017-10-23 09:06:59 +02:00
Moritz Kobitzsch 704cf314d4 explicitly check for 90 degree turns / turning onto segregated roads 2017-10-23 09:06:59 +02:00
Moritz Kobitzsch b8651bfac9 do not merge segregated highways in if there is actual turns involved 2017-10-23 09:06:59 +02:00
Moritz Kobitzsch bf28e40ba6 add further tests for segregated roads 2017-10-23 09:06:59 +02:00
Patrick Niklaus a8de007d98 Rename locations-cache -> location-cache 2017-10-20 15:55:23 +01:00
Patrick Niklaus 4684d2e35c Add changelog entry for changed behavior 2017-10-20 15:55:23 +01:00
Patrick Niklaus 27a9603b98 Change --use-location-cache=false to --disbale-location-cache 2017-10-20 15:55:23 +01:00
Patrick Niklaus 1610ea8dee Fix tests 2017-10-20 15:55:23 +01:00
Patrick Niklaus 171ff1191f Replace use of implicit_value since that broke with boost 1.65 2017-10-20 15:55:23 +01:00
karenzshea b5f9ba63d5 add code of conduct 2017-10-20 15:55:05 +01:00
Daniel J. Hofmann a3c0f6a4e2 Adds exception for barrier=lift_gate (bike, walk), resolves #4490 2017-10-19 15:27:35 +01:00
David Audrain 963c042b2a Run scripts/format.sh 2017-10-19 15:26:37 +01:00
David Audrain 1be7dedda7 Set missing OSM Node ID to zero instead of SPECIAL NODE ID 2017-10-19 15:26:37 +01:00
David Audrain 493a9a1cb2 Add 'to' and 'from' OSM Node Ids in the result of nearest webservice. #2548 2017-10-19 15:26:37 +01:00
Denis Koronchik e1149bd4b7 Review fixes 2017-10-19 15:18:25 +01:00
Denis Koronchik 895f072425 Work on forward/backward ref's support 2017-10-19 15:18:25 +01:00
Moritz Kobitzsch 37774a331a fix collapsing into uturns, that aren't u-turns 2017-10-17 15:08:29 +01:00
Moritz Kobitzsch 8719821363 test-case illustrating changes to collapsing 2017-10-17 15:08:29 +01:00
Patrick Niklaus 0cc4c4380a Fix wrong corefactor warning, fixes #4615 2017-10-17 14:02:10 +00:00
Denis Koronchik 553310fb31 Fix gcc5 compilation error 2017-10-17 14:51:39 +01:00
Patrick Niklaus 404c275101 Add a specilization for contraction without exclude flags
This saves about 10% overhead and avoids contraction changes
to previous releases.
2017-10-17 12:09:00 +01:00
Michael Krasnyk 088d4edc6b Prevent merging of circular-shaped roads 2017-10-17 11:27:09 +02:00
Michael Krasnyk bf03dcd1e6 Test case of merging roundabout-like intersections 2017-10-17 11:27:09 +02:00
Patrick Niklaus 456b198702 Remove unused number of threads option again 2017-10-16 23:08:32 +02:00
Patrick Niklaus dc81c7b926 [skip ci] Changelog polish for release 2017-10-16 13:06:09 +00:00
Patrick Niklaus 90b3be8d10 Fix formating 2017-10-16 13:40:02 +01:00
Patrick Niklaus ba2a2ff5e8 Remove RemoveIterator because its dangerous 2017-10-16 13:40:02 +01:00
Patrick Niklaus 9b87b8b7b1 Replace deallocation vector with std::vector and different merge algorithm 2017-10-16 13:40:02 +01:00
Patrick Niklaus 69db219423 Remove unused definition in contractor 2017-10-16 13:40:02 +01:00
Denis Koronchik 17ac731772 Review fixes 2017-10-16 12:15:12 +01:00
Denis Koronchik b6db39e69c Update documentation 2017-10-16 12:15:12 +01:00
Denis Koronchik d22b37961f Comment some tests of cardinal directions that not supported yet 2017-10-16 12:15:12 +01:00
Denis Koronchik f9c7e1e55e Support route relation tests 2017-10-16 12:15:12 +01:00
Denis Koronchik 4b8daac104 Fix formatting 2017-10-16 12:15:12 +01:00
Denis Koronchik 4e5f74aebe Fix after merge 2017-10-16 12:15:12 +01:00
Daniel Patterson 6b357a7783 Test cases for route relation cardinal directions. 2017-10-16 12:15:12 +01:00
Denis Koronchik fc9a89ea8b Support some cases for supperrelations in car.lua 2017-10-16 12:15:12 +01:00
Denis Koronchik 832cdbf566 Some fixes 2017-10-16 12:15:12 +01:00
Denis Koronchik 0dfec13c0a Fix some problems 2017-10-16 12:15:12 +01:00
Denis Koronchik a2b8698bca Restore route relations support 2017-10-16 12:15:12 +01:00
Denis Koronchik c42e247d87 Work on relation extract refactoring to support recursive relations (superrelations) 2017-10-16 12:15:12 +01:00
Daniel Patterson 7851de9af8 Update changelog. 2017-10-16 12:15:12 +01:00
Denis Koronchik 3fd961a551 Some improvements in code 2017-10-16 12:15:12 +01:00
Denis Koronchik 3634aa9a3c Add test for route relation process in car.lua. Some fixes 2017-10-16 12:15:12 +01:00
Denis Koronchik a05e9c4932 Fix bug with simple refs support (not lists) 2017-10-16 12:15:12 +01:00
Denis Koronchik 5fd77aebb5 Add route relation support for multi ref's 2017-10-16 12:15:12 +01:00
Denis Koronchik 9a660e3c18 Implement route relation parse in car.lua 2017-10-16 12:15:12 +01:00
Michael Krasnyk 1d4c5b2e4d Remove prefix v in pkg-config version string 2017-10-16 10:25:17 +01:00
vng c718f140fa Fixed c/p typo. 2017-10-14 15:05:26 +02:00
karenzshea 1b819bfcc3 add corech deprecation to changelog 2017-10-13 14:53:49 +01:00
karenzshea e385f6352e restore libosrm interface for corech, fallback to ch 2017-10-13 14:53:49 +01:00
karenzshea 4f3414c4cc remove core factor opt from exclude graph 2017-10-13 14:53:49 +01:00
karenzshea df79b5b4cc deprecation notices 2017-10-13 14:53:49 +01:00
karenzshea 2d1ea7a3de template specialization 2017-10-13 14:53:49 +01:00
karenzshea 2a13f9d10b fallback to CH, when coreCH used 2017-10-13 14:53:49 +01:00
karenzshea 7cf7c46939 remove level-cache flags 2017-10-13 14:53:49 +01:00
Denis Koronchik 031ce72db1 Fix issue #4214 2017-10-12 18:00:38 +01:00
Emil Tin fe8a2251cd add missing semicolon 2017-10-12 17:22:00 +01:00
Emil Tin 59f8330db4 update cache mechanism to handle forced profile 2017-10-12 17:22:00 +01:00
Emil Tin 999211ed9c set OSRM_PROFILE to force profile when running cuke tests 2017-10-12 17:22:00 +01:00
Daniel J. Hofmann dba825d829 Fixes readme contract mixup 2017-10-12 17:21:35 +01:00
Daniel J. Hofmann ee6e7dab3b Removes stxxl from installation instruction in readme 2017-10-12 17:21:35 +01:00
Daniel J. Hofmann 2a51ce131b Removes duplicate pipeline explanation from readme 2017-10-12 17:21:35 +01:00
Daniel J. Hofmann 7ce3ffd3cc Explains the MLD pipeline in the readme 2017-10-12 17:21:35 +01:00
Michael Krasnyk 40d9aec71f Show MLD cell IDs via node ID text background color 2017-10-12 14:27:55 +01:00
Michael Krasnyk d405331447 Increase coverage of MLD many-to-many code 2017-10-12 14:27:55 +01:00
Michael Krasnyk e781e06a17 Use -O0 optimization level for coverage builds 2017-10-12 14:27:55 +01:00
Michael Krasnyk 33742532f6 Run lcov before uploading to codecov 2017-10-12 14:27:55 +01:00
Michael Krasnyk f2fbe16979 Use for M*n (m*N) tables queries forward (backward) MLD search 2017-10-11 16:28:16 +01:00
Michael Krasnyk 5af05631c2 Suppress relaxation of edges on the top level during backward steps 2017-10-11 16:28:16 +01:00
Michael Krasnyk 8300a6c57e Prepare phantom nodes indices in ManyToManySearch search 2017-10-11 16:28:16 +01:00
Michael Krasnyk 29d4bca9ba Split algorithm-specific manyToMany implementations 2017-10-11 16:28:16 +01:00
Moritz Kobitzsch fd52c80573 remove workaround, reduce memory consumption in lcs computation 2017-10-11 14:07:35 +02:00
Moritz Kobitzsch 74e1d1c27a fix pedantic warning about additional ; 2017-10-11 14:07:35 +02:00
Moritz Kobitzsch 884ce4025b fix detection of suffix/prefix changes for name-changes 2017-10-11 14:07:35 +02:00
Moritz Kobitzsch 2ddd98ee6d simplify passing annotation data through OSRM pipeline using the node-based datastore
- separates node-based graph creation and compression from edge-based graph creation
 - moves usage of edge-based node data-container to pre-processing as well, unifying access to node-based data
 - single struct instead of separate vectors for annotation data in engine (single place of modification)
2017-10-09 18:44:43 +02:00
Frédéric Rodrigo 9b044aaa42 Add literal maxspeed value for NO, PL and ZA on maxspeed_table in car profile 2017-10-09 15:48:14 +01:00
Frédéric Rodrigo fe88d7fcd1 Sort maxspeed_table in car profile 2017-10-09 15:48:14 +01:00
karenzshea 7923fdcaef error when mld files or data are missing, compability -> compatibility 2017-10-09 16:36:38 +02:00
Michael Krasnyk 837dba2191 Don't use sliproad scenario if two name announcements are required 2017-10-09 15:35:26 +01:00
Michael Krasnyk a7ea6e5327 Allow a single intersection in a cross-road of sliproads, #4348/3 2017-10-09 15:35:26 +01:00
Michael Krasnyk 38ab22ee7c Sliproad case with a single intersection in a cross-road 2017-10-09 15:35:26 +01:00
Michael Krasnyk 7f8e467523 Adjust lower bound for crossroad angle in sliproads handler, #4348/2 2017-10-09 15:35:26 +01:00
Michael Krasnyk fbb2970044 Merge unused 3 bits of PhantomNode into bearing
to prevent memcheck  reports
==23434== Use of uninitialised value of size 8
==23434==    at 0x15CAFB5: boost::archive::iterators::detail::from_6_bit<char>::operator()(char) const (base64_from_binary.hpp:50)
==23434==    by 0x15CB6BE: boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>::dereference() const (transform_iterator.hpp:126)
==23434==    by 0x15CB6CE: boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>::reference boost::iterators::iterator_core_access::dereference<boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default> >(boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default> const&) (iterator_facade.hpp:550)
==23434==    by 0x15CB6E2: boost::iterators::detail::iterator_facade_base<boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>, char, boost::iterators::single_pass_traversal_tag, char, long, false, false>::operator*() const (iterator_facade.hpp:656)
==23434==    by 0x15CB7F4: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::input_iterator_tag) (basic_string.tcc:190)
==23434==    by 0x15CB89F: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct_aux<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::__false_type) (basic_string.h:196)
==23434==    by 0x15CB91B: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>) (basic_string.h:215)
==23434==    by 0x15CB9AA: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, void>(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::allocator<char> const&) (basic_string.h:552)
==23434==    by 0x15CBB0F: osrm::engine::encodeBase64[abi:cxx11](unsigned char const*, unsigned long) (base64.hpp:65)
==23434==    by 0x15CBC01: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > osrm::engine::encodeBase64Bytewise<osrm::engine::Hint>(osrm::engine::Hint const&) (base64.hpp:94)
==23434==    by 0x15CBC45: osrm::engine::Hint::ToBase64[abi:cxx11]() const (hint.cpp:30)
==23434==    by 0x16596DC: osrm::engine::api::json::makeWaypoint(osrm::util::Coordinate, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osrm::engine::Hint const&) (json_factory.cpp:359)
2017-10-09 15:31:59 +01:00
Patrick Niklaus d23a5fcfc4 Update package-lock and yarn.lock 2017-10-05 17:14:17 +01:00
Patrick Niklaus db83b186cf Bump version number post-release 2017-10-05 17:14:17 +01:00
Daniel Patterson 7d9b17fd41 Build against libstdc++-4.9 and supress one libstdc++ symbol so that we can run inside
old environments (CentOS, AWS Linux, AWS Lambda, etc)
2017-10-05 17:13:40 +01:00
Michael Krasnyk a900f5229e Fix case for sliproads from link via link to primary, #4348/4 2017-10-04 23:23:55 +02:00
Michael Krasnyk de72a8adb6 Test case for sliproads from link via link to primary, #4348/4 2017-10-04 23:23:55 +02:00
Michael Krasnyk 5010084fb0 [skip ci] Update CHANGELOG.md 2017-10-04 15:02:03 +02:00
Michael Krasnyk 11e7b6e911 Add last location memoization in Lua context 2017-10-04 10:03:42 +02:00
Michael Krasnyk 545097cf06 Don't use location cache if not needed 2017-10-04 10:03:42 +02:00
Michael Krasnyk 476bc347b4 Allow multiple GeoJSON files with locations data 2017-10-04 10:03:42 +02:00
Michael Krasnyk 095b345713 Change location data method to way:get_location_tags(key) 2017-10-04 10:03:42 +02:00
Michael Krasnyk 0f498d13f5 Access to location dependent data in Lua via way:get_location_tags() 2017-10-04 10:03:42 +02:00
Michael Krasnyk 2059f7234a Restructure ParseOSMData method 2017-10-04 10:03:42 +02:00
Michael Krasnyk 12b2242ad5 Add osmium locations cache 2017-10-04 10:03:42 +02:00
Michael Krasnyk fec2b602a2 Bump api_version to 3 in car.lua 2017-10-04 10:03:42 +02:00
Michael Krasnyk a7c1967ca0 Use correct bounding box
For some reason
envelop = make_inverse<box_t>();
boost::geometry::expand(envelop, next);
normalizes longitude to [-180,180]
2017-10-04 10:03:42 +02:00
Michael Krasnyk 20ff138f08 Remove polygon copying overhead 2017-10-04 10:03:42 +02:00
Michael Krasnyk 421115200b Port osmium point-in-polygon function 2017-10-04 10:03:42 +02:00
Michael Krasnyk b15288e0ea Add location_dependent_data unit tests 2017-10-04 10:03:42 +02:00
Michael Krasnyk 4eac861eae Left-hand driving flag review updates 2017-10-04 10:03:42 +02:00
Michael Krasnyk 7ad9e13f1e Add MultiPolygon support 2017-10-04 10:03:42 +02:00
Michael Krasnyk fc39e0ce1a Allow multiple GeoJSON files 2017-10-04 10:03:42 +02:00
Michael Krasnyk fb02a4c674 Added bit packing for serialization of vector<bool> 2017-10-04 10:03:42 +02:00
Michael Krasnyk 6468f55627 Make class_names default initialized 2017-10-04 10:03:42 +02:00
Michael Krasnyk f40b7975f2 Change from rtree.q{begin,end} to rtree.query (Boost 1.55 support) 2017-10-04 10:03:42 +02:00
Michael Krasnyk 55a38c9e01 Add tests to check local side-dependent turn bias 2017-10-04 10:03:42 +02:00
Michael Krasnyk 3c399e5c28 Propagate is_left_hand_driving from profile to data facade 2017-10-04 10:03:42 +02:00
Michael Krasnyk fca00fa09e Added approaches tests for left-hand driving 2017-10-04 10:03:42 +02:00
Michael Krasnyk de942155bf Add local left_hand_driving flag in API version 2 2017-10-04 10:03:42 +02:00
Michael Krasnyk af3f0a4782 Use driving_side tag of location-dependent data and OSM ways 2017-10-04 10:03:42 +02:00
Michael Krasnyk c9673741de Added location dependent data 2017-10-04 10:03:42 +02:00
Michael Krasnyk 9a482ff828 Show better error messages in options tests 2017-10-04 10:03:42 +02:00
Michael Krasnyk 020c17d19a Remove unused packed path weights in MLD alternatives 2017-10-03 13:09:46 +02:00
Michael Krasnyk d0936dc7fd Don't force loops in MLD
Related commit 0972ec9115
2017-10-03 12:56:50 +02:00
Michael Krasnyk 708b47938d Enable MLD alternatives tests 2017-10-03 12:56:50 +02:00
Jack Danger 79d07ef45c Updating year on all 'Project OSRM' copyrights 2017-10-03 12:03:26 +02:00
Jack Danger 5d33a387e0 Update LICENSE to 2017 and fix typo in filename 2017-10-03 12:03:26 +02:00
Frédéric Rodrigo b3b6e16940 Fix check_taginfo.py test for maxspeed tag in lower case 2017-09-30 22:16:51 +02:00
Frédéric Rodrigo f9fb0b84a8 Fix case of maxspeed tag values into taginfo.json 2017-09-30 22:16:51 +02:00
Frédéric Rodrigo 83acb46390 Add missing maxspeed tags into taginfo.json 2017-09-30 22:16:51 +02:00
Frédéric Rodrigo f36b3fb4bc Add to car profile missing BE:motorway maxspeed_table exceptions osm-fr/osmose-backend#232 2017-09-30 22:16:51 +02:00
Michael Krasnyk e7be271c43 Optimize MLD one-to-many getNodeQueryLevel 2017-09-29 13:38:52 +02:00
Michael Krasnyk 790b574114 unordered_multimap compilation fixes 2017-09-29 13:38:52 +02:00
Michael Krasnyk b3f59ab92c Move duplicated code into insert_node lambda 2017-09-29 13:38:52 +02:00
Michael Krasnyk f2333eb31a Break tie for equal weights but different durations
There is no possibility until multiple-weights are implemented
to break tie in the contraction and the direct shortest path plugin
as duration is not computed during contraction.

This must be fixed after multiple-weights implementation
by using `std::tie(weight, duration)` pairs everywhere.
2017-09-29 13:38:52 +02:00
Michael Krasnyk a862e5fb3a Implement one-to-many unidirectional MLD search 2017-09-29 13:38:52 +02:00
Michael Krasnyk 2715e5758b Split MLD many-to-many method 2017-09-29 13:38:52 +02:00
Michael Krasnyk 454487dd41 Refactor to reuse relaxOutgoingEdges in many-to-many plugin 2017-09-29 13:38:52 +02:00
Michael Krasnyk 2ed4f6eb0c Add suppression of libtbb memory leaks checking 2017-09-28 12:35:27 +02:00
Daniel J. Hofmann d7bcafcb59 Uses parsed len(turn:lanes) to fixup number of lanes, resolves #4472 2017-09-28 00:24:14 +02:00
Marcel Radischat c37a8ddd83 Update README.md with Docker+Node.js example 2017-09-26 09:16:59 +02:00
Michael Krasnyk fc3f96abcb Use pkg-config to find lua in non-standard locations 2017-09-26 09:03:57 +02:00
Michael Krasnyk c37ea441fc Bump osrm-deps package version 2017-09-25 12:26:47 +02:00
Michael Krasnyk fa1a4e8bf6 Relax strict bearings ordering condition to non-strict one, #4331 2017-09-18 21:33:00 +02:00
Michael Krasnyk 2532d56b85 Turn angle calculation needs to respect initial road order, #4331 2017-09-18 21:33:00 +02:00
Michael Krasnyk 00fd869224 Test for turn angle calculation the initial road order breaking, #4331 2017-09-18 21:33:00 +02:00
Michael Krasnyk 5661726e2e Add feature tests for distance weights in foot and bicycle profiles 2017-09-18 16:40:51 +02:00
Michael Krasnyk cfa5d7e172 Add support of distance in foot and bicycle profiles 2017-09-18 16:40:51 +02:00
Michael Krasnyk fd7791a0e2 Fix gcc5 compilation
Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77786
2017-09-15 16:29:40 +02:00
Michael Krasnyk e32b8bae00 Make unbuffered log verbosity aware 2017-09-15 15:01:17 +02:00
Michael Krasnyk 966139cde9 Adjust number of threads in osrm-routed 2017-09-15 10:55:13 +02:00
Michael Krasnyk ee19383f4d Link TBB task_scheduler lifetime with Engine scope 2017-09-15 10:55:13 +02:00
Michael Krasnyk 172a8bdcdb Parallelize ManyToMany plugin 2017-09-15 10:55:13 +02:00
Michael Krasnyk 543048efcc Remove std::unordered_map<NodeID, std::vector<NodeBucket>> 2017-09-15 10:55:13 +02:00
Michael Krasnyk 67c85ffa4c Restructure manyToManySearch for parallelization 2017-09-15 10:55:13 +02:00
Michael Krasnyk c065335882 [skip ci] Moved support relations entry in change log 2017-09-14 20:00:05 +02:00
Michael Krasnyk f6313fcbfb Bump CMake version to 3.9.2 2017-09-14 20:00:05 +02:00
Michael Krasnyk 6a3ea876b5 Fix EOL value in libosmium opl script 2017-09-14 20:00:05 +02:00
Michael Krasnyk 64ad308e9d Small ProcessElements refactoring 2017-09-14 20:00:05 +02:00
Michael Krasnyk 94169a20de Remove RelationsContainerWrap 2017-09-14 20:00:05 +02:00
Michael Krasnyk 5ca38eee3a Remove RelationMemberWrap and avoid data copying 2017-09-14 20:00:05 +02:00
Michael Krasnyk f4f65f62ee Remove Lua 5.1 support 2017-09-14 20:00:05 +02:00
Michael Krasnyk f89ada7f61 Remove ExtractionRelationData wraper 2017-09-14 20:00:05 +02:00
Denis Koronchik ff3b398e23 Review fixes 2017-09-14 20:00:05 +02:00
Denis Koronchik 84cb7865ab Fix different compilers support 2017-09-14 20:00:05 +02:00
Denis Koronchik 75bdf114be Review fixes 2017-09-14 20:00:05 +02:00
Denis Koronchik c2fd64d3cc Apply clang format 2017-09-14 20:00:05 +02:00
Denis Koronchik 580c5e39ae Fix some tests and add new ones 2017-09-14 20:00:05 +02:00
Denis Koronchik 8da6281dcd Update LUA profiles documentation 2017-09-14 20:00:05 +02:00
Denis Koronchik f79bcc6b8d Pass relation data to way and node functions 2017-09-14 20:00:05 +02:00
Denis Koronchik f2b63ba0aa LUA binding for a relation processing 2017-09-14 20:00:05 +02:00
Denis Koronchik a253111cbe Add ExtractionRelation class 2017-09-14 20:00:05 +02:00
Michael Krasnyk a5776288f6 Add dk:rural to taginfo.json 2017-09-14 08:03:18 +02:00
Mateusz Loskot dbcf4cab16 Replace GCC/clang option -std=C++1y with -std=C++14 2017-09-13 13:01:23 +02:00
Frédéric Rodrigo 4ea3f33376 Add to car profile missing DK:rural maxspeed_table exceptions osm-fr/osmose-backend#174 (#4488) 2017-09-08 11:36:06 -07:00
Daniel Patterson e4cdfb50cd Reset changelog for new release cycle. 2017-09-07 22:16:10 -07:00
Moritz Kobitzsch c2dc7e9cd0 use enter + exit for roundabout instructions (#4358)
* Expose roundabout/rotary exit instructions as a new instruction type.
2017-09-05 12:30:34 -07:00
Daniel Patterson 0fc1aa2711 Adds turn instructions to the turns layer in debug tiles. (#4460)
Add turn types and modifiers to turn points in debug tiles.  Also refactor some of the tile code to reduce some repetition.
2017-09-01 15:08:22 -07:00
Patrick Niklaus 89cf6d9e74 Disable alternative loop test since it does not test consistent behavior 2017-09-01 21:26:00 +02:00
Patrick Niklaus 61c430c098 Implement exclude flags on CH using shared core
The core is fully contracted for each exclude flag
and stored in a merged graph data structure.
2017-09-01 21:26:00 +02:00
Patrick Niklaus 4b75cb8b0e Make DynamicGraph copyable 2017-09-01 21:26:00 +02:00
Patrick Niklaus 53f87c08b5 Rename GraphView -> BisectionGraphView to avoid name conflicts 2017-09-01 21:26:00 +02:00
Patrick Niklaus e23dc8977f Refactor contract to be a stateless function 2017-09-01 21:26:00 +02:00
Patrick Niklaus 421dc5b6ec Don't return edge list in contractor but modify graph in-place 2017-09-01 21:26:00 +02:00
Patrick Niklaus 247f1c120f Make renumbering transparent to contraction 2017-09-01 21:26:00 +02:00
Patrick Niklaus e011c60e12 Replace flush in contract with in-place renumbering 2017-09-01 21:26:00 +02:00
Patrick Niklaus 26c909b64b Refactor contractor to pass in graph directly 2017-09-01 21:26:00 +02:00
Daniel Patterson acb7916996 Add test case with valid junk.
Use eps to explicitly match empty string and not consume input
2017-09-01 08:34:58 -07:00
Daniel Patterson 40b5045a0a Update CHANGELOG 2017-09-01 08:34:58 -07:00
Daniel Patterson b17f40862c If traffic CSV has an empty 4th column, preserve the weight on an edge while updating the duration. 2017-09-01 08:34:58 -07:00
Lev Dragunov 7702ebde61 Test fixes 2017-08-31 11:11:05 +02:00
Lev Dragunov 6951eadc18 CI fix 2017-08-31 11:11:05 +02:00
Lev Dragunov cf2573157f clang-format with older version 2017-08-31 11:11:05 +02:00
Lev Dragunov 80c55119d2 Add bearing for the phantom node 2017-08-31 11:11:05 +02:00
Mateusz Loskot 7323221e3b Add --verbosity,-l command line option
Allow to fine-control logging verbosity via command line
and LogPolicy setting (useful when OSRM used as library).

Closes #4299
2017-08-31 00:35:23 +02:00
Mateusz Loskot fb5bd818d9 CanMergeRoad missed test of rhs instance of IntersectionShapeData
Avoids identical sub-expressions road_target(lhs) == intersection_node
2017-08-31 00:34:28 +02:00
Mateusz Loskot 43a4e8db12 Use user-provided osmium::thread::Pool instance
Advantages:
* Allows to use Pool configured with user-preferred number of threads.
* If libosmium used in a shared library, this helps to prevent potential
  deadlock during Pool shutdown at (after) shared library unloading.

See https://github.com/osmcode/libosmium/pull/214

Requires libosmium 2.13.0
2017-08-31 00:34:09 +02:00
Mateusz Loskot 302390696e Remove repeated sub-expression for TurnType::Suppressed test 2017-08-31 00:33:00 +02:00
Michael Krasnyk 2508629d6c Minor fixes in Timezoner 2017-08-30 19:44:52 +02:00
Patrick Niklaus 90c390d7a6 Merge pull request #4455 from mloskot/ml/fix-short-options
Remove superfluous hyphen from short form of --version in tests
2017-08-30 18:30:45 +02:00
Patrick Niklaus 28178b12c7 Merge pull request #4456 from Project-OSRM/update/libosmium
Update libosmium to 2.13
2017-08-30 18:30:25 +02:00
Patrick Niklaus 6eb4f090f9 Squashed 'third_party/libosmium/' content from commit ce865381f
git-subtree-dir: third_party/libosmium
git-subtree-split: ce865381fb752323ff1e66181f5a49b7f500ffa3
2017-08-30 09:30:27 +00:00
Patrick Niklaus 95442d45aa Merge commit '6eb4f090f98f6b17a23c57768c16b7716b6c9cbd' as 'third_party/libosmium' 2017-08-30 09:30:27 +00:00
Patrick Niklaus b4ad6588ed Remove old libosmium 2017-08-30 09:30:18 +00:00
Patrick Niklaus 56282b0e3f Bump libosmium version 2017-08-30 09:28:41 +00:00
Mateusz Loskot 2385602500 Switch to reliable non-existent handle for QueryHeap items.
Default-constructed objects of (boost::heap) handle_type are singular,
including the wrapped handle_type::iterator.
Apparently, MSVC iterator debug facilities strictly require that
one singular instance is compared to another singular instance.
It is not possible to get check-comparabe iterators of non-singular
and singular instances as owning container will always mismatch.
2017-08-30 10:59:43 +02:00
Mateusz Loskot 628a154d7f Remove superfluous hyphen from short form of --version in tests 2017-08-30 10:09:12 +02:00
Daniel J. Hofmann efaed59b9b Whitelists scripts/node_install.sh for from-source compilation, resolves #4431 2017-08-28 19:08:36 -04:00
Daniel Patterson bdee13dea8 We should be using the module-relative @loader_path. @executable_path is relative to the main node process binary 2017-08-25 15:30:49 -07:00
Daniel Patterson c615910874 Don't use Travis' node environment, we create our own. 2017-08-25 13:46:29 -07:00
Daniel Patterson 9e1398c68a Enable OSX binary publishing for both NodeJS 4 and NodeJS 6 2017-08-25 13:46:29 -07:00
Denis Koronchik af10692d2d Fix misprint in documentation 2017-08-23 17:05:24 +02:00
Denis Koronchik e7abe37b10 Prevent linkage errors when load/write extracted graph from external app 2017-08-22 15:46:06 +02:00
Patrick Niklaus bc8617a9f4 Fix remaining PR comments 2017-08-21 13:00:12 +02:00
Patrick Niklaus 00e243b23b Refactor CustomizeCell::RelaxNode to move level check inside function 2017-08-21 13:00:12 +02:00
Patrick Niklaus 27324d0270 Add more tests for exclude validation 2017-08-21 13:00:12 +02:00
Patrick Niklaus 0c838fb60c Fix turnbot profile 2017-08-21 13:00:12 +02:00
Patrick Niklaus 0713ef5862 Add test cases for exclude and table/match service 2017-08-21 13:00:12 +02:00
Patrick Niklaus bee1ba8854 Fix profile docs 2017-08-21 13:00:12 +02:00
Patrick Niklaus da252c7597 Add node binding integration 2017-08-21 13:00:12 +02:00
Patrick Niklaus a4460abc83 Fix another manifestation of the off-by-one 2017-08-21 13:00:12 +02:00
Patrick Niklaus 261636febb Add HTTP docs 2017-08-21 13:00:12 +02:00
Patrick Niklaus 21f15f0a29 Add docs for lua profiles 2017-08-21 13:00:12 +02:00
Patrick Niklaus bd068ff2a6 Add changelog entries for exclude flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus d09f5c0e3a Avoid -> Exclude 2017-08-21 13:00:12 +02:00
Patrick Niklaus 45140ca9f7 Fix off-by-one in avoid search 2017-08-21 13:00:12 +02:00
Patrick Niklaus c6be2e768a Throw an error for invalid classes 2017-08-21 13:00:12 +02:00
Patrick Niklaus 6339395cba Fix clang format 2017-08-21 13:00:12 +02:00
Patrick Niklaus bd6492bb38 Fix compilation after rebase 2017-08-21 13:00:12 +02:00
Patrick Niklaus f93b331817 Add error handling for avoid not implemented 2017-08-21 13:00:12 +02:00
Patrick Niklaus 20e4096c4b Fix stupid vector size bug 2017-08-21 13:00:12 +02:00
Patrick Niklaus 97952a9289 Don't snap to avoided streets 2017-08-21 13:00:12 +02:00
Patrick Niklaus 960a595268 Add test for avoid flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus a3c94ef632 Avoid nodes that are disabled by an avoid flag 2017-08-21 13:00:12 +02:00
Patrick Niklaus 84fd38ac9c Add tests for avoid flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus 303a8fae32 Refactor cell weights and durations to own file and allow for multiple metrics 2017-08-21 13:00:12 +02:00
Patrick Niklaus 21686ee8a9 Add datafacade factory to select avoid flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus c8b142a676 Add placeholders for up to 8 weights 2017-08-21 13:00:12 +02:00
Patrick Niklaus 58061a68c4 Add avoid parameter to the API 2017-08-21 13:00:12 +02:00
Patrick Niklaus 9c11197768 Extract avoidable combinations from profiles into ProfileProperties 2017-08-21 13:00:12 +02:00
Moritz Kobitzsch f347efb006 detect turning onto oneways at the end of the road as non obvious 2017-08-18 16:33:11 +02:00
Moritz Kobitzsch af8ddac2af add test-case illustrating changes to obvious turn discovery 2017-08-18 16:33:11 +02:00
Michael Krasnyk b1358de9bb Use TBB parallel sort of CSV entries, #4418 2017-08-18 14:37:42 +02:00
Daniel Patterson f4dc93ae66 [skip ci] Reset master versions for next release 2017-08-17 15:06:48 -07:00
Frédéric Rodrigo 20a77f6d51 Car Profile. Remove the non common use barrier=checkpoint as the right tag is military=checkpoint and does not need to be whitelisted. #4405 2017-08-17 14:27:04 +02:00
Daniel Patterson c1ad275e71 Empty CSV entries (nodeA,nodeA) can be treated as non-fatal as long as we don't try to update any matching artificial segments. 2017-08-16 12:03:23 -07:00
Daniel J. Hofmann 6bae070091 Fixes changelog wrt. conditional via-way restrictions 2017-08-16 11:15:35 +02:00
Moritz Kobitzsch 3687b6cb4b respect difference between continue/turn on changing end-of-road 2017-08-16 09:19:15 +02:00
Moritz Kobitzsch 196ed9eb46 do not change fork directions when combining turns 2017-08-16 09:17:01 +02:00
Daniel Patterson 37c941dff3 Bump version for 5.11.0-rc.2 2017-08-15 12:14:13 -07:00
Daniel Patterson 40a428d49f Fix changelog - binaries weren't published for 5.10 2017-08-15 12:13:20 -07:00
Daniel Patterson 48eeef2d30 Revert "Publicly expose binaries to Node.js bindings, resolves #4377"
This reverts commit 4686272f87.

Unfortunately, this doesn't work alongside `node-pre-gyp` - in fresh installs, the binary
files are not yet downloaded when npm tries to create symlinks, leading to an error.
2017-08-15 11:55:09 -07:00
Moritz Kobitzsch c34520f3a4 add feature to test naming conventions on divided highways 2017-08-15 09:47:13 +02:00
Daniel Patterson 36db965c39 Update npm version for RC.1 2017-08-14 17:16:45 -07:00
Daniel Patterson 4e81764ce2 Update CHANGELOG for changes since 5.10 2017-08-14 17:16:05 -07:00
Michael Krasnyk 1e9f983289 Add mocked offline datafacade to engine tests 2017-08-14 16:18:36 +02:00
Michael Krasnyk 2e404c60f4 Remove references to external sources 2017-08-14 16:18:36 +02:00
vng 40857aae61 Inject offline compressed data facade with OSRM_EXTERNAL_MEMORY option. 2017-08-14 16:18:36 +02:00
vng a64145b712 Fixed mld algorithm to use template data facade. 2017-08-14 16:18:36 +02:00
vng 945f6da85e Removed useless include. 2017-08-14 16:18:36 +02:00
vng 76d5d054cb Compilation fix. 2017-08-14 16:18:36 +02:00
Michael Krasnyk 20cfa159ec Fix boost::optional construction error 2017-08-11 17:32:35 +02:00
Daniel J. Hofmann 3ff1a4263d Adds releasing docs about bumping to latest, see #4386 2017-08-11 15:53:14 +02:00
Patrick Niklaus 3141eb5dce [skip ci] Update CONTRIBUTING.md to include correct pre-commit hook 2017-08-11 10:06:07 +00:00
Daniel J. Hofmann 75d6f59026 Publicly expose binaries to Node.js bindings, resolves #4377 2017-08-11 12:04:53 +02:00
Daniel J. Hofmann ae42ce7017 [skip ci] Updates lockfile for latest master version 2017-08-11 12:04:53 +02:00
Moritz Kobitzsch e9c9c87bbc adjust geojson logger to changes in extractor 2017-08-11 12:03:40 +02:00
Michael Krasnyk 8a6dba46b1 Change windows time zones in West Africa to WAT zone 2017-08-11 11:53:25 +02:00
Moritz Kobitzsch 93299d6651 handle conditional via-way restrictions
- refactor conditional restriction handling to not use external data (first OSM nodes on ways)
 - BREAKING: changes internal file format of osrm.restrictions
 - add support for general conditional penalties based on edge-based nodes (requires unique edges between nodes)
2017-08-11 11:53:25 +02:00
vng f34320a89b Fixed getting entry bearing for maneuver. 2017-08-11 11:40:58 +02:00
Moritz Kobitzsch a17b07bc4c fix bug in conflict resolution 2017-08-11 11:01:54 +02:00
Moritz Kobitzsch 3a01ba52ef remove a few tests that are simply testing same code paths as others 2017-08-10 12:28:31 +02:00
Mateusz Loskot d796c66990 Prefer implicit expansion of CMake variables
Unify CMAKE_CXX_COMPILER_ID tests without quoting/bracketing
the variable to use implicit expansion.
Replace STREQUAL with MATCHES to avoid policy warning about
attempt to expand "MSVC" variable, where it literal is intended.
2017-08-10 12:26:48 +02:00
Mateusz Loskot 80b705e997 Add workaround for Visual C++ issue with std::array in debug
If Visual C++ _ITERATOR_DEBUG_LEVEL > 0, then
accessing std::array<char[N], M> elements via reference to const
causes compilation error:

...\msvc\14.10.25017\include\array(181): error C2440: 'return': cannot convert from 'const char *' to 'const char (&)[256]'

Alternative workaround is to remove const qualifier from the GetClassName method.
2017-08-10 12:21:42 +02:00
Moritz Kobitzsch 7069af3e20 explicitly use local eslint version for linting 2017-08-09 14:14:44 +02:00
Daniel J. Hofmann 209a926b45 Re-adds .npmignore, resolves #4193 2017-08-08 16:16:35 +02:00
Mateusz Loskot 71e0c7a3cf Add define WIN32_LEAN_AND_MEAN for Visual C++
Helps to avoid compiler C2011 errors due to WinSock types redefinition
from dual #include of winsock.h and winsock2.h
2017-08-08 15:50:47 +02:00
Daniel J. Hofmann b88d96f07d [skip ci] Updates lockfiles 2017-08-08 11:37:20 +02:00
Daniel J. Hofmann 46f75c3d92 [skip ci] Bumps version to 5.11 2017-08-08 11:37:20 +02:00
Mateusz Loskot 3b8e5cec88 Ignore build directories starting with _build
Convenient to manage multiple builds with basic
naming convention (eg. _build.gcc7, _build.vs2017).

[ci skip]
2017-08-08 11:14:39 +02:00
FILLAU Jean-Maxime a420169109 Reintroduce location for NodeRef in luabinding 2017-08-08 10:59:25 +02:00
Michael Krasnyk a8db269fd5 Adjust lower bound for crossroad angle in sliproads handler, #4348/2 2017-08-04 14:37:13 +02:00
Michael Krasnyk a5efcfdede Sliproads test case with acute angle at the main intersection 2017-08-04 14:37:13 +02:00
Michael Krasnyk 1ecc913fc2 Fix sliproad scenario with 4 roads in a target intersection, #4348/1 2017-08-04 14:07:35 +02:00
Michael Krasnyk 08eb3b11bc Test case for sliproad handling with 4 roads at target intersection 2017-08-04 14:07:35 +02:00
Moritz Kobitzsch b59d9a2f27 update test-case for changed turn angles 2017-08-04 12:57:55 +02:00
Moritz Kobitzsch e9a5e32330 fix prevention of copy elision 2017-08-04 12:57:55 +02:00
Moritz Kobitzsch be9bdfa47e adjust constants for changed turn angle 2017-08-04 11:20:31 +02:00
Moritz Kobitzsch 153e934ed4 shift circle angle a bit 2017-08-04 11:20:31 +02:00
Michael Krasnyk 4757c96d9a Add a check for non-empty segments in CSV speed files 2017-08-04 11:19:32 +02:00
Michael Krasnyk 1efc527281 Test with a traffic update on an edge with traffic signal 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch 468b59c53d add changelog entry for compression of traffic signals 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch 15426975b6 deduplicate geometry 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch bbcf343e40 compress traffic signals
- handle penalties within edges (not phantom nodes)
 - changes model from providing penalties on turns to using additional segments
2017-08-04 11:19:32 +02:00
Moritz Kobitzsch f0d3cf4e43 removing duplicated test 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch 4c965b9f44 Add regression test for interaction between via-way and via-node 2017-08-03 14:37:05 +02:00
Moritz Kobitzsch e5143247c2 move babel to dev dependencies, update releasing docs to reflect scripts in package.json 2017-08-03 14:31:41 +02:00
Daniel J. Hofmann 3a676183b2 Updates our node osrm docs and re-runs docs generation, resolves #4043 2017-08-03 14:31:41 +02:00
Daniel J. Hofmann 64265926a4 Adds babel transformation needed for node osrm docs 2017-08-03 14:31:41 +02:00
Michael Krasnyk df2d4daad3 Fix gcc5 internal compilation error 2017-08-02 10:25:38 +02:00
Michael Krasnyk fd0d79e17b Update pre-installed TBB version to 2017_U7 2017-08-02 10:25:38 +02:00
Moritz Kobitzsch 84ce97a31e Bump version to v5.10.0-rc.2 2017-08-01 12:30:31 +02:00
Moritz Kobitzsch 7e0c9f7340 remove accidental addition of debug code 2017-08-01 12:29:56 +02:00
Moritz Kobitzsch 917a36eaee fix pedantic warnings 2017-08-01 12:27:29 +02:00
Moritz Kobitzsch 7620d419c6 fix serialisation of conditional turn restrictions 2017-08-01 12:27:29 +02:00
Moritz Kobitzsch 50c90b29d2 parse conditional turn restriction with via way 2017-08-01 12:27:29 +02:00
Daniel Patterson 0e77cf53f6 Update CHANGELOG with bugfix notes. 2017-07-31 08:33:19 -07:00
Moritz Kobitzsch 9dfbae69cc [skip-ci] Bump version to v5.10.0-rc.1 2017-07-31 16:18:56 +02:00
Michael Krasnyk c1ad4f6b45 Fix a single weekday grammar callback 2017-07-31 14:56:08 +02:00
Moritz Kobitzsch 8135f08958 restructure for review remarks 2017-07-31 09:36:25 +02:00
Moritz Kobitzsch 645b1ffd75 add testcases to highlight limitation of via-way handling 2017-07-31 09:36:25 +02:00
Moritz Kobitzsch 8d0202d240 Add data structure to allow identification of via-way turns during creation of edge-based-graph
initial version of handling via-way turn restrictions (this is dirty)

 - requires update of data structures
 - requires clean-up
 - requires optimisation
2017-07-31 09:36:25 +02:00
Moritz Kobitzsch b1809d1667 pre-filter turn restrictions for validity 2017-07-31 09:36:25 +02:00
Moritz Kobitzsch 2e9a7d9c1a refactor restriction parsing / extraction to actual types
Makes turn restrictions into dedicated structures and diferentiates between them via a variant.
Ensures that we do not accidentally mess up ID types within our application.
In addition this improves the restriction performance by only parsing all edges
once at the cost of (at the time of writing) 22MB in terms of main memory usage.
2017-07-31 09:36:25 +02:00
Moritz Kobitzsch 1f7aa6f812 adding tests to highlight via-way-restriciton development 2017-07-31 09:36:25 +02:00
Patrick Niklaus 032a189440 Merge pull request #4352 from Project-OSRM/fix_reverse_datasources
Save both forward and reverse datasources.
2017-07-28 07:53:17 +00:00
Daniel Patterson be5fc50136 Save both forward and reverse datasources. 2017-07-27 14:45:28 -07:00
Moritz Kobitzsch 0affec8f17 handle throughabouts -- do not announce going through 2017-07-26 10:37:20 +02:00
Daniel Patterson 8c9ae4d3b4 Update CHANGELOG. 2017-07-25 15:14:45 -06:00
Daniel Patterson dac6bb27aa Don't include turn costs when calculation weight/duration/speed annotations. 2017-07-25 15:14:45 -06:00
Daniel J. Hofmann 6c0ab24100 Updates npm and yarn lockfiles 2017-07-24 13:15:15 +02:00
Michael Krasnyk 95c7832c3e Don't use STXXL library by default 2017-07-24 13:05:22 +02:00
Daniel J. Hofmann c2e8d6160f Documents system-wide limit constructor parameters in node bindings, resolves #4317 2017-07-24 13:02:56 +02:00
Emil Tin f609905267 fix profile debugging related to way classes 2017-07-24 13:01:32 +02:00
Daniel J. Hofmann f7c8bac3fd Handles distinction of no-route vs invalid-route in mld alternatives
The viaroute plugin always expects a route to be there potentially
with invalid edge weight to represent no-route-found. By switching
to the many-route-result for the mld alternatives algorithm we might
return an empty many-route-result invalidating the post-condition.
2017-07-22 12:50:54 +02:00
Patrick Niklaus 58811d8f5c Merge pull request #4320 from Project-OSRM/oak-franklin-scenario
Adds lane anticipation Oak St -> Franklin St -> Fell St scenario
2017-07-22 08:08:56 +00:00
Daniel J. Hofmann 54960f9b5d Adds lane anticipation Oak St -> Franklin St -> Fell St scenario 2017-07-21 19:04:55 +02:00
Patrick Niklaus cd45ddda13 Merge pull request #4304 from Project-OSRM/third_party/update_dependencies
Update third party dependencies
2017-07-21 00:00:44 +00:00
Patrick Niklaus 04acd2141b Use sol 2.17.5 instead 2017-07-20 22:01:54 +00:00
Michael Krasnyk 336ec4741c Update TBB mason version to 2017_U7 2017-07-20 13:49:18 +00:00
Pepijn Schoen 8da40419ee Maintain storage_config exposed API 2017-07-20 12:01:05 +02:00
Pepijn Schoen 0b5c7a97a7 Addressed comments 2017-07-20 12:01:05 +02:00
Pepijn Schoen d9e8caf369 Use GetPath with file names over accessing member variables 2017-07-20 12:01:05 +02:00
Pepijn Schoen e208485c17 expose mandatory / optional / output files in io_config; config files to use new io_config constructor 2017-07-20 12:01:05 +02:00
Pepijn Schoen 5a6dee80ac Fix rebase problems 2017-07-20 12:01:05 +02:00
Pepijn Schoen 67fae1d1f0 rename osrm_input_path to osrm_path, clang-format 2017-07-20 12:01:05 +02:00
Pepijn Schoen 1b31099f73 superclass extractor_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen 897518a297 superclass customizer_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen a9b6686725 superclass partition_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen 2c7cb5baba superclass contractor_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen 29160eec9c superclass updater_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen fe00a8a0ca superclass storage_config with io_config 2017-07-20 12:01:05 +02:00
Patrick Niklaus 64574c779f [skip ci] Backport 5.9 changelog 2017-07-19 17:02:29 +00:00
Daniel J. Hofmann 64e4b7eaa0 Introduces a construction whitelist in profiles 2017-07-19 16:24:45 +00:00
Daniel J. Hofmann 48824c4c8a Normalizes spaces in profiles 2017-07-19 16:24:45 +00:00
Daniel J. Hofmann ababeb3a69 Makes construction=minor ways routable again, see #4258 2017-07-19 16:24:45 +00:00
Mateusz Loskot cfa2a63323 Set OSRM_BUILD_DIR based on CMake build dir
For typical local workflow, CMake can auto-configure most
of the environment, for convenience.
2017-07-19 12:57:04 +00:00
Patrick Niklaus 9418f5613a Update sol2 to v2.17.5 2017-07-18 21:11:03 +00:00
Patrick Niklaus 22a3e06e1c Merge commit 'b91c2f0299722e64a6945808d64c3397c35811d0' into third_party/update_dependencies 2017-07-18 21:08:32 +00:00
Patrick Niklaus b91c2f0299 Squashed 'third_party/libosmium/' changes from c1f34c455..9fd2348c6
9fd2348c6 Release v2.11.3
ed708286e Fix namespace.
835df8a7f Fix multipolygon assembler.
0979ab529 Fix areas assembler algorithm.
801f84c62 Bugfix: Invalid use of iterators.
f85653820 Read OPL file correctly even if trailing newline in file missing.
a31571c0f Release v2.11.2
a3903b368 Use minimum size of 64 bytes for buffers.
b86bafefe Release v2.11.1
32ebf736c Updated change log.
632ea5198 Bugfix: Call get_creator_function() in main thread.
ddc79eee7 Add test for not correctly handled unsupported_file_format_error.
86197a14f Bugfix: Terminate called on full buffer.
4340be8ad Fix the Filter::count() method.

git-subtree-dir: third_party/libosmium
git-subtree-split: 9fd2348c6956b6e1b930b50850e99eb31207ed50
2017-07-18 21:08:32 +00:00
Patrick Niklaus 07416c7a46 Bump versions to latest releases 2017-07-18 21:08:05 +00:00
Patrick Niklaus 440dccb81b Move classes to intersection object and don't emit notifications 2017-07-18 16:48:22 +00:00
Emil Tin e413b25cd9 profiles api v2 2017-07-18 10:09:22 +00:00
Daniel J. Hofmann 5ece65cade Trigger lane anticipation based on distance, see discussion in #4260 2017-07-18 11:23:46 +02:00
Moritz Kobitzsch c0c9ec1c7b changelog, consistent deprecated documentation 2017-07-18 11:23:46 +02:00
Moritz Kobitzsch f2f00b99e0 remove usage of use-lane completely 2017-07-18 11:23:46 +02:00
Moritz Kobitzsch 7b755d6f8b deprecate use-lane -- the information can be found in the intersections array 2017-07-18 11:23:46 +02:00
Daniel J. Hofmann 7d63301039 Only enables -fopenmp in case the user wants stxxl 2017-07-17 19:19:10 +02:00
Patrick Niklaus 49f0b1eb59 Add abstraction to change the data facade at compile time 2017-07-17 11:40:55 +00:00
Michael Krasnyk b2ed46efb5 Check activation index of EntryClass and warn if activation failed 2017-07-13 22:14:41 +00:00
Daniel J. Hofmann 58b61c68a3 Exposes EngineConfig system-wide limits in Node.js bindings, resolves #4226 2017-07-13 21:48:48 +00:00
Moritz Kobitzsch 30b8225812 only consider allowed entries when continuing on motorways 2017-07-13 08:59:01 +00:00
Moritz Kobitzsch 54530a14e9 add test indicating missdetection of continuing on motorways 2017-07-13 08:59:01 +00:00
Daniel Patterson ee8ffcf57b Include osrm-customize when doing 'make install' 2017-07-12 22:11:42 +00:00
Daniel J. Hofmann 5e9397fcca Canonicalizes all OSM string list handling in the profiles 2017-07-12 22:09:01 +00:00
Patrick Niklaus 8508834e50 Bump version to 5.10 2017-07-11 08:25:57 +00:00
Michael Krasnyk 924a8a7e38 Remove STXXL from OSM parsing and enable in CMake by default 2017-07-11 08:23:26 +00:00
Michael Krasnyk 960e9178ba Updated ChangeLog 2017-07-11 08:23:26 +00:00
Michael Krasnyk a3257ff651 Added STXXL configuration 2017-07-11 08:23:26 +00:00
Michael Krasnyk 960f9ba29a Don't use stxxl vector in contractor 2017-07-11 08:23:26 +00:00
Michael Krasnyk 3940cc1641 Switch from stxxl::vector to std::vector in extractor 2017-07-11 08:23:26 +00:00
Michael Krasnyk a498ba6537 Removed external_to_internal_node_id_map container 2017-07-11 08:23:26 +00:00
Daniel J. Hofmann 5b5a907023 Makes tile size checks strict, resolves #4177 2017-07-10 12:19:53 +02:00
Daniel J. Hofmann c1cb3ebff7 Fixes Node.js bindings always enabling alternatives when using boolean overload 2017-07-10 10:44:15 +02:00
Daniel J. Hofmann 6a555a477b Discards construction and proposed ways, resolves #4230 2017-07-10 10:34:20 +02:00
Daniel J. Hofmann 175d27691d Fixes line endings, related to #4235 2017-07-10 07:26:17 +00:00
1518 changed files with 141298 additions and 42763 deletions
+1
View File
@@ -1,4 +1,5 @@
{
"plugins": ["transform-class-properties"],
"presets": [
"stage-0",
"es2015",
+2
View File
@@ -0,0 +1,2 @@
test
build
+30
View File
@@ -0,0 +1,30 @@
# 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
+8 -2
View File
@@ -2,12 +2,18 @@
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
- [ ] ADD OWN TASKS HERE
- [ ] 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 regression / cucumber cases (see docs/testing.md)
- [ ] 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?
+6
View File
@@ -46,6 +46,7 @@ Thumbs.db
# build related files #
#######################
/_build*
/build/
/example/build/
/test/data/monaco*
@@ -65,6 +66,11 @@ Thumbs.db
######################################
/.vs*
/*.local.bat
/CMakeSettings.json
# Jetbrains related files #
###########################
.idea/
# stxxl related files #
#######################
+16
View File
@@ -0,0 +1,16 @@
*
!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
+235 -88
View File
@@ -7,10 +7,6 @@ git:
sudo: required
dist: trusty
node_js:
- "4"
- "6"
notifications:
email: false
@@ -18,10 +14,10 @@ branches:
only:
- master
# enable building tags
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
- /^v\d+\.\d+(\.\d+)?(\+[^-]+)?(-\S*)?$/
cache:
yarn: true
npm: true
ccache: true
apt: true
directories:
@@ -38,7 +34,11 @@ env:
- CMAKE_VERSION=3.7.2
- MASON="$(pwd)/scripts/mason.sh"
- ENABLE_NODE_BINDINGS=On
- NODE="4"
- NODE="10"
stages:
- core
- optional
matrix:
fast_finish: true
@@ -47,59 +47,70 @@ matrix:
include:
# Debug Builds
- os: linux
- stage: core
os: linux
compiler: "format-taginfo-docs"
env: NODE=6
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 install --ignore-scripts
- npm link --ignore-scripts
- npm ci --ignore-scripts
script:
- ./scripts/check_taginfo.py taginfo.json profiles/car.lua
- ${MASON} install clang-format 3.8.1
- PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh
- node ./scripts/validate_changelog.js
# See issue 4043
#- npm run docs && ./scripts/error_on_dirty.sh
after_success:
- os: linux
compiler: "gcc-6-debug-cov"
addons: &gcc6
compiler: "gcc-7-debug-cov"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000
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:
- bash <(curl -s https://codecov.io/bash)
# 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"
- os: linux
compiler: "gcc-6-debug-asan"
addons: &gcc6
compiler: "gcc-7-debug-asan"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000
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"
- os: linux
compiler: "clang-4.0-debug"
addons: &clang40
compiler: "clang-5.0-debug"
addons: &clang50
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
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
- os: linux
compiler: "mason-linux-debug-asan"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON
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"
# Release Builds
- os: linux
@@ -107,75 +118,81 @@ matrix:
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
- os: linux
compiler: "gcc-6-release"
addons: &gcc6
compiler: "gcc-7-release"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
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-6-release-i686"
compiler: "gcc-7-release-i686"
env: >
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
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-4.9-release"
compiler: "gcc-7-stxxl"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' ENABLE_STXXL=On
- os: linux
compiler: "gcc-5-release"
addons: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
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'
- os: osx
osx_image: xcode8.2
compiler: "mason-osx-release"
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
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
# Disabled because of CI slowness
#- os: linux
#- compiler: clang
#- addons: &clang40
#- apt:
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
#- packages: ['clang-4.0', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release'
- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-8"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="8"
after_success:
- ./scripts/travis/publish.sh
# Shared Library
- os: linux
compiler: "gcc-6-release-shared"
addons: &gcc6
compiler: "gcc-7-release-shared"
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
# Disabled because CI slowness
#- os: linux
#- compiler: clang
#- addons: &clang40
#- apt:
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
#- packages: ['clang-4.0', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
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-4-mason-linux-release"
compiler: "node-8-mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
install:
- pushd ${OSRM_BUILD_DIR}
- |
@@ -183,7 +200,8 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
@@ -193,12 +211,12 @@ matrix:
- os: linux
sudo: false
compiler: "node-4-mason-linux-release"
compiler: "node-8-mason-linux-debug"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
packages: ['libstdc++-4.9-dev']
env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="8"
install:
- pushd ${OSRM_BUILD_DIR}
- |
@@ -206,7 +224,8 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
@@ -216,12 +235,12 @@ matrix:
- os: linux
sudo: false
compiler: "node-6-mason-linux-release"
compiler: "node-10-mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
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}
- |
@@ -229,7 +248,8 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
@@ -239,12 +259,12 @@ matrix:
- os: linux
sudo: false
compiler: "node-6-mason-linux-release"
compiler: "node-10-mason-linux-debug"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
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}
- |
@@ -252,7 +272,8 @@ matrix:
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
-DENABLE_GLIBC_WORKAROUND=ON
- make --jobs=${JOBS}
- popd
script:
@@ -260,7 +281,135 @@ matrix:
after_success:
- ./scripts/travis/publish.sh
- 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: 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
@@ -278,22 +427,17 @@ before_install:
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
sudo mdutil -i off /
fi
- |
if [[ ! -f $(which yarn) ]]; then
npm install -g yarn
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"
- yarn install --ignore-scripts
- yarn check --ignore-scripts --integrity
- 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_20161128 && export LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_20161128)/lib/:${LD_LIBRARY_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
@@ -323,9 +467,11 @@ install:
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
-DENABLE_STXXL=${ENABLE_STXXL:-OFF} \
-DBUILD_TOOLS=ON \
-DENABLE_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
-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}
@@ -347,19 +493,20 @@ install:
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/ch/monaco.osrm
- ./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/partition-tests
- ./unit_tests/partitioner-tests
- |
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
npm run nodejs-tests
fi
- |
- popd
- yarn test
- npm test
+329 -1
View File
@@ -1,3 +1,324 @@
# Unreleased
- 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:
@@ -7,15 +328,22 @@
- 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
- `RouteStep` now has new parameter `classes` that can be set in the profile on each way.
- `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
+155 -126
View File
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 2.8.11)
# we depend on 2.8.11 introducing target_include_directories
cmake_minimum_required(VERSION 3.1)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed.
@@ -14,6 +13,11 @@ if(BUILD_AS_SUBPROJECT)
message(STATUS "Building libosrm as subproject.")
endif()
# set OSRM_BUILD_DIR location (might be used in various scripts)
if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR})
set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR})
endif()
option(ENABLE_MASON "Use mason for dependencies" OFF)
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
option(BUILD_TOOLS "Build OSRM tools" OFF)
@@ -21,22 +25,23 @@ option(BUILD_PACKAGE "Build OSRM package" OFF)
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
option(ENABLE_STXXL "Use STXXL library" OFF)
option(ENABLE_LTO "Use LTO if available" OFF)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
option(ENABLE_GLIBC_WORKAROUND "Workaround GLIBC symbol exports" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(ENABLE_MASON)
# versions in use
set(MASON_BOOST_VERSION "1.63.0")
set(MASON_BOOST_VERSION "1.65.1")
set(MASON_STXXL_VERSION "1.4.1-1")
set(MASON_EXPAT_VERSION "2.2.0")
set(MASON_LUA_VERSION "5.2.4")
set(MASON_BZIP2_VERSION "1.0.6")
set(MASON_TBB_VERSION "2017_20161128")
set(MASON_LIBSHP_VERSION "1.3.0")
set(MASON_TBB_VERSION "2017_U7")
message(STATUS "Enabling mason")
@@ -53,12 +58,26 @@ if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 9)
set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
include(JSONParser)
file(READ "package.json" packagejsonraw)
sbeParseJson(packagejson packagejsonraw)
if (packagejson.version MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)")
set(OSRM_VERSION_MAJOR ${CMAKE_MATCH_1})
set(OSRM_VERSION_MINOR ${CMAKE_MATCH_2})
set(OSRM_VERSION_PATCH ${CMAKE_MATCH_3})
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
else()
message(FATAL_ERROR "Version from package.json cannot be parsed, expected semver compatible X.Y.Z, but found ${packagejson.version}")
endif()
if (MSVC)
add_definitions("-DOSRM_PROJECT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"")
else()
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
endif()
# these two functions build up custom variables:
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
@@ -95,12 +114,12 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
endif()
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
# Strictly require GCC>=5.0 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(FATAL_ERROR "GCC>=5.0 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
endif()
@@ -119,7 +138,8 @@ configure_file(
)
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
file(GLOB PartitionerGlob src/partition/*.cpp)
file(GLOB GuidanceGlob src/guidance/*.cpp src/extractor/intersection/*.cpp)
file(GLOB PartitionerGlob src/partitioner/*.cpp)
file(GLOB CustomizerGlob src/customize/*.cpp)
file(GLOB ContractorGlob src/contractor/*.cpp)
file(GLOB UpdaterGlob src/updater/*.cpp)
@@ -130,6 +150,7 @@ file(GLOB ErrorcodesGlob src/osrm/errorcodes.cpp)
add_library(UTIL OBJECT ${UtilGlob})
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
add_library(GUIDANCE OBJECT ${GuidanceGlob})
add_library(PARTITIONER OBJECT ${PartitionerGlob})
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
add_library(CONTRACTOR OBJECT ${ContractorGlob})
@@ -145,14 +166,15 @@ add_executable(osrm-partition src/tools/partition.cpp)
add_executable(osrm-customize src/tools/customize.cpp)
add_executable(osrm-contract src/tools/contract.cpp)
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_partition $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_customize $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_guidance $<TARGET_OBJECTS:GUIDANCE> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_partition src/osrm/partitioner.cpp $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
if(ENABLE_GOLD_LINKER)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
@@ -176,7 +198,7 @@ endif()
# Disable LTO when mason+gcc is detected before testing for / setting any flags.
# Mason builds libraries with Clang, mixing does not work in the context of lto.
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND ENABLE_LTO)
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND ENABLE_LTO)
set(ENABLE_LTO OFF)
message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
endif()
@@ -205,19 +227,19 @@ endif()
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring debug mode flags")
set(ENABLE_ASSERTIONS ON)
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline -fno-omit-frame-pointer")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ggdb")
else()
# Don't override the -O parameter for RelWithDebInfo, we want an optimized build
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
endif()
endif()
endif()
endif()
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fno-inline -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -fno-omit-frame-pointer")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -ggdb")
endif()
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring release mode optimizations")
# Check if LTO is available
@@ -226,7 +248,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
if(ENABLE_LTO AND LTO_AVAILABLE)
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# GCC in addition allows parallelizing LTO
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
include(ProcessorCount)
ProcessorCount(NPROC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=${NPROC}")
@@ -249,8 +271,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
endif()
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW)
find_program(GCC_AR gcc-ar)
find_program(GCC_RANLIB gcc-ranlib)
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
@@ -265,7 +286,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
endif()
# Same for clang LTO requires their own toolchain
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
find_program(LLVM_AR llvm-ar)
find_program(LLVM_RANLIB llvm-ranlib)
if ("${LLVM_AR}" STREQUAL "LLVM_AR-NOTFOUND" OR "${LLVM_RANLIB}" STREQUAL "LLVM_RANLIB-NOTFOUND")
@@ -278,12 +299,6 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
set(CMAKE_RANLIB ${LLVM_RANLIB})
endif()
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038")
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
set(ENABLE_LTO Off)
endif()
endif()
endif()
@@ -297,10 +312,11 @@ if (ENABLE_COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build")
endif()
message(INFO "Enabling coverage")
message(STATUS "Enabling coverage")
set(MAYBE_COVERAGE_LIBRARIES "-lgcov")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ftest-coverage -fprofile-arcs")
endif()
if (ENABLE_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
@@ -309,16 +325,18 @@ if (ENABLE_SANITIZER)
endif()
# Configuring compilers
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(OSRM_WARNING_FLAGS "-Werror=all -Werror=extra -Werror=uninitialized -Werror=unreachable-code -Werror=unused-variable -Werror=unreachable-code -Wno-error=cpp -Wpedantic")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=2 -Wno-error=unused-local-typedef -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(COLOR_FLAG "-fdiagnostics-color=auto")
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
if(NOT HAS_COLOR_FLAG)
set(COLOR_FLAG "")
endif()
# using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=1 -Wno-error=maybe-uninitialized -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
if(WIN32) # using mingw
add_dependency_defines(-DWIN32)
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
@@ -331,13 +349,14 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
endif()
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
# using Intel C++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# using Visual Studio C++
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # avoid compiler error C1128 from scripting_environment_lua.cpp
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32_LEAN_AND_MEAN") # avoid compiler error C2011 from dual #include of winsock.h and winsock2.h
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS)
add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation
@@ -353,7 +372,7 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
message(STATUS "Setting linker optimizations")
if(NOT (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
# Tell compiler to put every function in separate section, linker can then match sections and functions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
# Tell linker to do dead code and data eminination during link time discarding sections
@@ -371,9 +390,9 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# Activate C++1y
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++1y")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++14")
endif()
# Configuring other platform dependencies
@@ -397,11 +416,30 @@ if(UNIX AND NOT APPLE)
set(MAYBE_RT_LIBRARY -lrt)
endif()
# Disallow deprecated protozero APIs
add_definitions(-DPROTOZERO_STRICT_API)
find_package(Threads REQUIRED)
# Third-party libraries
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
set(MICROTAR_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src")
include_directories(SYSTEM ${MICROTAR_INCLUDE_DIR})
set(MBXGEOM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/geometry.hpp-0.9.2/include")
include_directories(SYSTEM ${MBXGEOM_INCLUDE_DIR})
set(CHEAPRULER_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cheap-ruler-cpp-2.5.4/include")
include_directories(SYSTEM ${CHEAPRULER_INCLUDE_DIR})
add_library(MICROTAR OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src/microtar.c")
set_property(TARGET MICROTAR PROPERTY POSITION_INDEPENDENT_CODE ON)
set(PROTOZERO_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/protozero/include")
include_directories(SYSTEM ${PROTOZERO_INCLUDE_DIR})
set(VTZERO_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/vtzero/include")
include_directories(SYSTEM ${VTZERO_INCLUDE_DIR})
# if mason is enabled no find_package calls are made
# to ensure that we are only compiling and linking against
# fully portable mason packages
@@ -428,9 +466,12 @@ if(ENABLE_MASON)
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
set(STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
if (ENABLE_STXXL)
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
set(MAYBE_STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
add_definitions(-DUSE_STXXL_LIBRARY)
endif()
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
@@ -458,7 +499,7 @@ if(ENABLE_MASON)
install(FILES ${TBBGlob} DESTINATION lib)
endforeach()
if(APPLE)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@executable_path")
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@loader_path")
elseif(UNIX)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin")
endif()
@@ -473,9 +514,6 @@ if(ENABLE_MASON)
# note: we avoid calling find_package(Osmium ...) here to ensure that the
# expat and bzip2 are used from mason rather than the system
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include)
else()
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
@@ -493,35 +531,24 @@ else()
find_package(EXPAT REQUIRED)
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
find_package(STXXL REQUIRED)
add_dependency_includes(${STXXL_INCLUDE_DIR})
if (ENABLE_STXXL)
find_package(STXXL)
if (STXXL_FOUND)
add_dependency_includes(${STXXL_INCLUDE_DIR})
set(MAYBE_STXXL_LIBRARY ${STXXL_LIBRARY})
add_definitions(-DUSE_STXXL_LIBRARY)
else()
MESSAGE(STATUS "STXXL was requested but not found, default STL will be used")
endif()
endif()
find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})
FIND_PACKAGE(Lua 5.2 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
# Now fall back to a lua verison without exact
# in case this cmake version also forces patch versions
FIND_PACKAGE(Lua 5.2)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
find_package(Lua 5.2 REQUIRED)
if (LUA_FOUND)
message(STATUS "Using Lua ${LUA_VERSION_STRING}")
endif()
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
add_dependency_includes(${LUA_INCLUDE_DIR})
@@ -544,14 +571,10 @@ else()
endif()
find_package(Osmium REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
endif()
# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Using ccache to speed up incremental builds")
@@ -578,11 +601,13 @@ add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
set(OpenMP_FIND_QUIETLY ON)
find_package(OpenMP)
if(OPENMP_FOUND)
message(STATUS "OpenMP support found. Linking just in case for stxxl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
if (ENABLE_STXXL)
set(OpenMP_FIND_QUIETLY ON)
find_package(OpenMP)
if(OPENMP_FOUND)
message(STATUS "OpenMP support found. Linking just in case for stxxl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()
add_definitions(${OSRM_DEFINES})
@@ -617,10 +642,16 @@ set(EXTRACTOR_LIBRARIES
${EXPAT_LIBRARIES}
${USED_LUA_LIBRARIES}
${OSMIUM_LIBRARIES}
${STXXL_LIBRARY}
${MAYBE_STXXL_LIBRARY}
${TBB_LIBRARIES}
${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(GUIDANCE_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${USED_LUA_LIBRARIES}
${TBB_LIBRARIES}
${MAYBE_COVERAGE_LIBRARIES})
set(PARTITIONER_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
@@ -645,7 +676,7 @@ set(CONTRACTOR_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${USED_LUA_LIBRARIES}
${STXXL_LIBRARY}
${MAYBE_STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
@@ -665,21 +696,22 @@ set(STORAGE_LIBRARIES
set(UTIL_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY}
${MAYBE_STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_COVERAGE_LIBRARIES})
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
# Libraries
target_link_libraries(osrm ${ENGINE_LIBRARIES})
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update)
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store)
target_link_libraries(osrm_extract osrm_guidance ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update)
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store)
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# BUILD_COMPONENTS
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_LIBRARIES})
install(TARGETS osrm-components DESTINATION bin)
@@ -689,15 +721,6 @@ if(BUILD_TOOLS)
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
install(TARGETS osrm-io-benchmark DESTINATION bin)
find_package(Shapefile)
if(SHAPEFILE_FOUND AND (Boost_VERSION VERSION_GREATER 106000 OR ENABLE_MASON))
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${UTIL_LIBRARIES} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARY} ${EXPAT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS osrm-extract-conditionals DESTINATION bin)
endif()
endif()
if (ENABLE_ASSERTIONS)
@@ -718,28 +741,30 @@ file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp)
file(GLOB LibraryGlob include/osrm/*.hpp)
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(PartitionerHeader include/partitioner/partitioner.hpp include/partitioner/partitioner_config.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/io_config.hpp include/storage/storage_config.hpp)
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partition)
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partitioner)
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
install(FILES ${LibraryGlob} DESTINATION include/osrm)
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
install(FILES ${VariantGlob} DESTINATION include/mapbox)
install(TARGETS osrm-extract DESTINATION bin)
install(TARGETS osrm-partition DESTINATION bin)
install(TARGETS osrm-customize DESTINATION bin)
install(TARGETS osrm-contract DESTINATION bin)
install(TARGETS osrm-datastore DESTINATION bin)
install(TARGETS osrm-routed DESTINATION bin)
install(TARGETS osrm DESTINATION lib)
install(TARGETS osrm_extract DESTINATION lib)
install(TARGETS osrm_partition DESTINATION lib)
install(TARGETS osrm_customize DESTINATION lib)
install(TARGETS osrm_update DESTINATION lib)
install(TARGETS osrm_contract DESTINATION lib)
install(TARGETS osrm_store DESTINATION lib)
@@ -791,7 +816,7 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${PKGCONFIG_LIBRARY_DIR}/pkgconfig)
# uninstall target
configure_file(
@@ -807,6 +832,10 @@ add_custom_target(uninstall
add_subdirectory(unit_tests)
add_subdirectory(src/benchmarks)
if (ENABLE_GLIBC_WORKAROUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLIBC_WORKAROUND")
endif()
if (ENABLE_NODE_BINDINGS)
add_subdirectory(src/nodejs)
endif()
@@ -844,4 +873,4 @@ if (ENABLE_NODE_BINDINGS)
endforeach()
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
endif()
endif()
+3
View File
@@ -0,0 +1,3 @@
# Code of conduct
Everyone is invited to participate in Project OSRMs 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/).
+6 -2
View File
@@ -1,8 +1,12 @@
# 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 to the issue if you want to express interest in this.
You can add a :+1: emoji reaction to the issue if you want to express interest in this.
# Developer
@@ -18,7 +22,7 @@ if [ x"$remote" = xorigin ] ; then
echo "Rejected push to $remote/master" ; exit 1
fi
./scripts/format.sh
./scripts/format.sh && ./scripts/error_on_dirty.sh
if [ $? -ne 0 ] ; then
echo "Unstaged format changes" ; exit 1
fi
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2016, Project OSRM contributors
Copyright (c) 2017, Project OSRM contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
+25 -29
View File
@@ -9,7 +9,7 @@ High performance routing engine written in C++14 designed to run on OpenStreetMa
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
- Nearest - Snaps coordinates to the street network and returns the nearest matches
- Route - Finds the fastest route between coordinates
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
- 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
@@ -19,7 +19,6 @@ To quickly try OSRM use our [demo server](http://map.project-osrm.org) which com
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/).
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
- [node-osrm](https://www.npmjs.com/package/osrm) - Production-ready NodeJs bindings for the routing engine
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
- [osrm-backend-docker](https://hub.docker.com/r/osrm/osrm-backend/) - Ready to use Docker images
@@ -41,9 +40,17 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
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 Alpine Linux and make sure they are as lightweight as possible.
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/)
@@ -52,9 +59,15 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
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
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-contract /data/berlin-latest.osrm
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed /data/berlin-latest.osrm
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
@@ -90,8 +103,8 @@ Install dependencies
```bash
sudo apt install build-essential git cmake pkg-config \
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
libbz2-dev libxml2-dev libzip-dev libboost-all-dev \
lua5.2 liblua5.2-dev libtbb-dev
```
Compile and install OSRM binaries
@@ -104,29 +117,10 @@ cmake --build .
sudo cmake --build . --target install
```
Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
```bash
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
```
Pre-process the extract and start the HTTP server
```
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm
```
Running Queries
```
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
```
### Request Against the Demo Server
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Demo-server).
Simple query with instructions and alternatives on Berlin:
```
@@ -157,7 +151,9 @@ which will check and use pre-built binaries if they're available for this releas
to always force building the Node.js bindings from source.
For usage details have a look [these API docs](docs/nodejs/api.md).
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).
## References in publications
+8 -28
View File
@@ -7,19 +7,22 @@ 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.9.2
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:"3.7.1" && GOTO CMAKE_OK
cmake --version | findstr /C:%CMAKE_VERSION% && GOTO CMAKE_OK
:CMAKE_NOT_OK
SET CMAKE_VERSION=3.7.1
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
powershell Invoke-WebRequest https://cmake.org/files/v3.9/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
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
:CMAKE_OK
ECHO CMAKE_OK
@@ -37,7 +40,7 @@ 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.0.7z
SET DEPSPKG=osrm-deps-win-x64-14.0-2017.09.7z
:: local development
ECHO.
@@ -158,29 +161,6 @@ XCOPY /Y corech\*.* ..\test\data\corech\
XCOPY /Y mld\*.* ..\test\data\mld\
unit_tests\%Configuration%\library-tests.exe
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
ECHO ========= CREATING PACKAGES ==========
CD %PROJECT_DIR%\build\%Configuration%
IF %ERRORLEVEL% NEQ 0 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
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
-17
View File
@@ -29,24 +29,7 @@ before_test:
- SET OSRM_BUILD_DIR=build\%Configuration%
- npm test
artifacts:
- path: osrm_Release.zip
name: osrm_Release.zip
# - path: osrm_Debug.zip
# name: osrm_Debug.zip
branches:
only:
- master
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
+1 -1
View File
@@ -11,7 +11,7 @@ SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.TXT")
SET(CPACK_STRIP_FILES "TRUE")
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
+8
View File
@@ -36,6 +36,8 @@
# 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)
@@ -81,11 +83,16 @@ function(_lua_set_version_vars)
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)
@@ -158,6 +165,7 @@ find_library(LUA_LIBRARY
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
${_lua_library_dirs}
~/Library/Frameworks
/Library/Frameworks
/sw
-21
View File
@@ -1,21 +0,0 @@
# - Try to find Shapefile C Library
# http://shapelib.maptools.org/
#
# Exports:
# Shapefile_FOUND
# LIBSHAPEFILE_INCLUDE_DIR
# LIBSHAPEFILE_LIBRARY
# Hints:
# LIBSHAPEFILE_LIBRARY_DIR
find_path(LIBSHAPEFILE_INCLUDE_DIR
shapefil.h)
find_library(LIBSHAPEFILE_LIBRARY
NAMES shp
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Shapefile DEFAULT_MSG
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
+286 -286
View File
@@ -1,286 +1,286 @@
# 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")
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)
+290
View File
@@ -0,0 +1,290 @@
# 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()
+1 -1
View File
@@ -4,7 +4,7 @@ libdir=@PKGCONFIG_LIBRARY_DIR@
Name: libOSRM
Description: Project OSRM library
Version: v@OSRM_VERSION@
Version: @OSRM_VERSION@
Requires:
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
+4 -4
View File
@@ -1,7 +1,7 @@
module.exports = {
default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions',
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
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 ~@alternative --require features/support --require features/step_definitions -f progress'
}
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
+28 -32
View File
@@ -1,34 +1,18 @@
FROM alpine:3.5
RUN mkdir /opt
WORKDIR /opt
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.1-dev libtbb@testing libtbb-dev@testing && \
\
echo "Building libstxxl" && \
cd /opt && \
git clone --depth 1 --branch 1.4.1 https://github.com/stxxl/stxxl.git && \
cd stxxl && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j${NPROC} && \
make install
FROM debian:stretch-slim as builder
ARG DOCKER_TAG
RUN mkdir /src
ARG BUILD_CONCURRENCY
RUN mkdir -p /src && mkdir -p /opt
COPY . /src
WORKDIR /src
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
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 build && \
mkdir -p build && \
cd build && \
BUILD_TYPE="Release" && \
ENABLE_ASSERTIONS="Off" && \
@@ -40,14 +24,26 @@ RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
make -j${NPROC} install && \
cd ../profiles && \
cp -r * /opt && \
\
echo "Cleaning up" && \
strip /usr/local/bin/* && \
rm /usr/local/lib/libstxxl* && \
cd /opt && \
apk del boost-dev && \
apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.1-dev git make gcc && \
apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.1 expat && \
rm -rf /src /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm*
rm -rf /src /usr/local/lib/libosrm*
# 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
EXPOSE 5000
+1 -1
View File
@@ -6,4 +6,4 @@
# 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 DOCKER_TAG=${DOCKER_TAG} -t $IMAGE_NAME -f Dockerfile ..
docker build --build-arg BUILD_CONCURRENCY=${CONCURRENCY:-1} --build-arg DOCKER_TAG=${DOCKER_TAG} -t $IMAGE_NAME -f Dockerfile ..
+1 -1
View File
@@ -20,7 +20,7 @@ A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we pro
The initialisation to do so looks like this:
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
Make sure to give the guar a name, so it actually gets a lifetime.
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`).
+176 -23
View File
@@ -31,6 +31,7 @@ To pass parameters to each location some options support an array like encoding:
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
|approaches |`{approach};{approach}[;{approach} ...]` |Keep waypoints on curb side. |
|exclude |`{class}[,{class}]` |Additive list of classes to avoid, order does not matter. |
Where the elements follow the following format:
@@ -40,12 +41,13 @@ Where the elements follow the following format:
|radius |`double >= 0` or `unlimited` (default) |
|hint |Base64 `string` |
|approach |`curb` or `unrestricted` (default) |
|class |A class name determined by the profile or `none`. |
```
{option}={element};{element}[;{element} ... ]
```
The number of elements must match exactly the number of locations. If you don't want to pass a value but instead use the default you can pass an empty `element`.
The number of elements must match exactly the number of locations (except for `generate_hints` and `exclude`). If you don't want to pass a value but instead use the default you can pass an empty `element`.
Example: 2nd location use the default value for `option`:
@@ -59,12 +61,17 @@ Example: 2nd location use the default value for `option`:
# Query on Berlin with three coordinates:
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
# Query on Berlin excluding the usage of motorways:
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407?exclude=motorway'
# Using polyline:
curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'
```
### Responses
#### Code
Every response object has a `code` property containing one of the strings below or a service dependent code:
| Type | Description |
@@ -82,12 +89,17 @@ Every response object has a `code` property containing one of the strings below
- `message` is a **optional** human-readable error message. All other status types are service dependent.
- In case of an error the HTTP status code will be `400`. Otherwise the HTTP status code will be `200` and `code` will be `Ok`.
#### Data version
Every response object has a `data_version` propetry containing timestamp from the original OpenStreetMap file. This field is optional. It can be ommited if data_version parametr was not set on osrm-extract stage or OSM file has not `osmosis_replication_timestamp` section.
#### Example response
```json
{
"code": "Ok",
"message": "Everything worked"
"message": "Everything worked",
"data_version": "2017-11-17T21:43:02Z"
}
```
@@ -114,7 +126,7 @@ In addition to the [general options](#general-options) the following options are
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
- `distance`: Distance in meters to the supplied input coordinate.
- `nodes`: Array of OpenStreetMap node ids.
#### Example Requests
@@ -129,6 +141,10 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
{
"waypoints" : [
{
"nodes": [
2264199819,
0
],
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
"distance" : 4.152629,
"name" : "Friedrichstraße",
@@ -138,6 +154,10 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
]
},
{
"nodes": [
2045820592,
0
],
"hint" : "KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g",
"distance" : 11.811961,
"name" : "Friedrichstraße",
@@ -147,6 +167,10 @@ curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?numb
]
},
{
"nodes": [
0,
21487242
],
"hint" : "KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g",
"distance" : 15.872438,
"name" : "Friedrichstraße",
@@ -178,6 +202,7 @@ In addition to the [general options](#general-options) the following options are
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|waypoints | `{index};{index};{index}...` |Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. |
\* Please note that even if alternative routes are requested, a result cannot be guaranteed.
@@ -204,13 +229,13 @@ curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397
### Table service
Computes the duration of the fastest route between all pairs of supplied coordinates.
Computes the duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes. Duration is in seconds and distances is in meters.
```endpoint
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&destinations=[{elem}...]
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&{destinations}=[{elem}...]&annotations={duration|distance|duration,distance}
```
**Coordinates**
**Options**
In addition to the [general options](#general-options) the following options are supported for this service:
@@ -218,6 +243,10 @@ In addition to the [general options](#general-options) the following options are
|------------|--------------------------------------------------|---------------------------------------------|
|sources |`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as source. |
|destinations|`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as destination.|
|annotations |`duration` (default), `distance`, or `duration,distance`|Return the requested table or tables in response. |
|fallback_speed|`double > 0`| If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration.|
|fallback_coordinate|`input` (default), or `snapped`| When using a `fallback_speed`, use the user-supplied coordinate (`input`), or the snapped location (`snapped`) for calculating distances.|
|scale_factor|`double > 0`| Use in conjunction with `annotations=durations`. Scales the table `duration` values by this number.|
Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
to number of input locations;
@@ -235,14 +264,23 @@ sources=0;5;7&destinations=5;1;4;2;3;6
#### Example Request
```curl
# Returns a 3x3 matrix:
# Returns a 3x3 duration matrix:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
# Returns a 1x3 matrix
# Returns a 1x3 duration matrix
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?sources=0'
# Returns a asymmetric 3x2 matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:
# Returns a asymmetric 3x2 duration matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:
curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHulFzeMe`EuvKpnCglA)?sources=0;1;3&destinations=2;4'
# Returns a 3x3 duration matrix:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?annotations=duration'
# Returns a 3x3 distance matrix for CH:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?annotations=distance'
# Returns a 3x3 duration matrix and a 3x3 distance matrix for CH:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?annotations=distance,duration'
```
**Response**
@@ -250,17 +288,120 @@ curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHu
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
- `distances` array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel distance from
the i-th waypoint to the j-th waypoint. Values are given in meters. Can be `null` if no route between `i` and `j` can be found. Note that computing the `distances` table is currently only implemented for CH. If `annotations=distance` or `annotations=duration,distance` is requested when running a MLD router, a `NotImplemented` error will be returned.
- `sources` array of `Waypoint` objects describing all sources in order
- `destinations` array of `Waypoint` objects describing all destinations in order
- `fallback_speed_cells` (optional) array of arrays containing `i,j` pairs indicating which cells contain estimated values based on `fallback_speed`. Will be absent if `fallback_speed` is not used.
In case of error the following `code`s are supported in addition to the general ones:
| Type | Description |
|-------------------|-----------------|
| Type | Description |
|------------------|-----------------|
| `NoTable` | No route found. |
| `NotImplemented` | This request is not supported |
All other properties might be undefined.
#### Example Response
```json
{
"sources": [
{
"location": [
13.3888,
52.517033
],
"hint": "PAMAgEVJAoAUAAAAIAAAAAcAAAAAAAAArss0Qa7LNEHiVIRA4lSEQAoAAAAQAAAABAAAAAAAAADMAAAAAEzMAKlYIQM8TMwArVghAwEA3wps52D3",
"name": "Friedrichstraße"
},
{
"location": [
13.397631,
52.529432
],
"hint": "WIQBgL6mAoAEAAAABgAAAAAAAAA7AAAAhU6PQHvHj0IAAAAAQbyYQgQAAAAGAAAAAAAAADsAAADMAAAAf27MABiJIQOCbswA_4ghAwAAXwVs52D3",
"name": "Torstraße"
},
{
"location": [
13.428554,
52.523239
],
"hint": "7UcAgP___38fAAAAUQAAACYAAABTAAAAhSQKQrXq5kKRbiZCWJo_Qx8AAABRAAAAJgAAAFMAAADMAAAASufMAOdwIQNL58wA03AhAwMAvxBs52D3",
"name": "Platz der Vereinten Nationen"
}
],
"durations": [
[
0,
192.6,
382.8
],
[
199,
0,
283.9
],
[
344.7,
222.3,
0
]
],
"destinations": [
{
"location": [
13.3888,
52.517033
],
"hint": "PAMAgEVJAoAUAAAAIAAAAAcAAAAAAAAArss0Qa7LNEHiVIRA4lSEQAoAAAAQAAAABAAAAAAAAADMAAAAAEzMAKlYIQM8TMwArVghAwEA3wps52D3",
"name": "Friedrichstraße"
},
{
"location": [
13.397631,
52.529432
],
"hint": "WIQBgL6mAoAEAAAABgAAAAAAAAA7AAAAhU6PQHvHj0IAAAAAQbyYQgQAAAAGAAAAAAAAADsAAADMAAAAf27MABiJIQOCbswA_4ghAwAAXwVs52D3",
"name": "Torstraße"
},
{
"location": [
13.428554,
52.523239
],
"hint": "7UcAgP___38fAAAAUQAAACYAAABTAAAAhSQKQrXq5kKRbiZCWJo_Qx8AAABRAAAAJgAAAFMAAADMAAAASufMAOdwIQNL58wA03AhAwMAvxBs52D3",
"name": "Platz der Vereinten Nationen"
}
],
"code": "Ok",
"distances": [
[
0,
1886.89,
3791.3
],
[
1824,
0,
2838.09
],
[
3275.36,
2361.73,
0
]
],
"fallback_speed_cells": [
[ 0, 1 ],
[ 1, 0 ]
]
}
```
### Match service
Map matching matches/snaps given GPS points to the road network in the most plausible way.
@@ -283,6 +424,7 @@ In addition to the [general options](#general-options) the following options are
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|gaps |`split` (default), `ignore` |Allows the input track splitting based on huge timestamp gaps between points. |
|tidy |`true`, `false` (default) |Allows the input track modification to obtain better matching quality for noisy tracks. |
|waypoints | `{index};{index};{index}...` |Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. |
|Parameter |Values |
|------------|-----------------------------------|
@@ -423,6 +565,7 @@ Vector tiles contain two layers:
| `weight ` | `integer` | how long this segment takes to traverse, in units (may differ from `duration` when artificial biasing is applied in the Lua profiles). ACTUAL ROUTING USES THIS VALUE. |
| `name` | `string` | the name of the road this segment belongs to |
| `rate` | `float` | the value of `length/weight` - analagous to `speed`, but using the `weight` value rather than `duration`, rounded to the nearest integer |
| `is_startpoint` | `boolean` | whether this segment can be used as a start/endpoint for routes |
`turns` layer:
@@ -432,6 +575,8 @@ Vector tiles contain two layers:
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
| `cost` | `float` | the time we think it takes to make that turn, in seconds. May be negative, depending on how the data model is constructed (some turns get a "bonus"). |
| `weight` | `float` | the weight we think it takes to make that turn. May be negative, depending on how the data model is constructed (some turns get a "bonus"). ACTUAL ROUTING USES THIS VALUE |
| `type` | `string` | the type of this turn - values like `turn`, `continue`, etc. See the `StepManeuver` for a partial list, this field also exposes internal turn types that are never returned with an API response |
| `modifier` | `string` | the direction modifier of the turn (`left`, `sharp left`, etc) |
## Result objects
@@ -507,10 +652,10 @@ Represents a route between two waypoints.
- `annotation`: Additional details about each coordinate along the route geometry:
| annotations | |
|--------------|-----------------------------------------------------------------------|
| true | An `Annotation` object containing node ids, durations distances and |
| false | weights `undefined` |
| annotations | |
|--------------|-------------------------------------------------------------------------------|
| true | An `Annotation` object containing node ids, durations, distances and weights. |
| false | `undefined` |
#### Example
@@ -526,6 +671,7 @@ With `steps=false` and `annotations=true`:
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"metadata": { "datasource_names": ["traffic","lua profile","lua profile","lua profile","traffic"] },
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
}
@@ -539,11 +685,13 @@ Annotation of the whole route leg with fine-grained information about each segme
**Properties**
- `distance`: The distance, in metres, between each pair of coordinates
- `duration`: The duration between each pair of coordinates, in seconds
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
- `duration`: The duration between each pair of coordinates, in seconds. Does not include the duration of any turns.
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract` or `osrm-customize`. String-like names are in the `metadata.datasource_names` array.
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
- `weight`: The weights between each pair of coordinates
- `weight`: The weights between each pair of coordinates. Does not include any turn costs.
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
- `metadata`: Metadata related to other annotations
- `datasource_names`: The names of the datasources used for the speed between each pair of coordinates. `lua profile` is the default profile, other values arethe filenames supplied via `--segment-speed-file` to `osrm-contract` or `osrm-customize`
#### Example
@@ -552,6 +700,7 @@ Annotation of the whole route leg with fine-grained information about each segme
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"metadata": { "datasource_names": ["traffic","lua profile","lua profile","lua profile","traffic"] },
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"weight": [15,15,40,15,15]
}
@@ -579,15 +728,15 @@ step.
- `name`: The name of the way along which travel proceeds.
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
- `pronunciation`: A string containing an [IPA](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) phonetic transcription indicating how to pronounce the name in the `name` property. This property is omitted if pronunciation data is unavailable for the step.
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
- `exits`: The exit numbers or names of the way. Will be `undefined` if there are no exit numbers or names.
- `mode`: A string signifying the mode of transportation.
- `classes`: An array of strings signifying the classes of the road as specified in the profile.
- `maneuver`: A `StepManeuver` object representing the maneuver.
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
- `rotary_name`: The name for the rotary. Optionally included, if the step is a rotary and a rotary name is available.
- `rotary_pronunciation`: The pronunciation hint of the rotary name. Optionally included, if the step is a rotary and a rotary pronunciation is available.
- `driving_side`: The legal driving side at the location for this step. Either `left` or `right`.
#### Example
@@ -597,7 +746,6 @@ step.
"mode" : "driving",
"duration" : 15.6,
"weight" : 15.6,
"classes": ["toll", "restricted"],
"intersections" : [
{ "bearings" : [ 10, 92, 184, 270 ],
"lanes" : [
@@ -657,12 +805,14 @@ step.
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
| `fork` | take the left/right side at a fork depending on `modifier` |
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
| `use lane` | going straight on a specific lane |
| `use lane` | **Deprecated** replaced by lanes on all intersection entries |
| `continue` | Turn in direction of `modifier` to stay on the same road |
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
| `roundabout` | traverse roundabout, if the route leaves the roundabout there will be an additional property `exit` for exit counting. The modifier specifies the direction of entering the roundabout. |
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode or classes. If the road takes a turn itself, the `modifier` describes the direction |
| `exit roundabout`| Describes a maneuver exiting a roundabout (usually preceeded by a `roundabout` instruction) |
| `exit rotary` | Describes the maneuver exiting a rotary (large named roundabout) |
Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change
between all instructions. They only offer a fallback in case nothing else is to report.
@@ -735,6 +885,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
- `classes`: An array of strings signifying the classes (as specified in the profile) of the road exiting the intersection.
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
`false` indicates that the turn onto the respective road would violate a restriction.
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
@@ -753,6 +904,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
"out":2,
"bearings":[60,150,240,330],
"entry":["false","true","true","true"],
"classes": ["toll", "restricted"],
"lanes":{
"indications": ["left", "straight"],
"valid": "false"
@@ -768,6 +920,7 @@ Object used to describe waypoint on a route.
- `name` Name of the street the coordinate snapped to
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
- `distance` The distance, in metres, from the input coordinate to the snapped coordinate
- `hint` Unique internal identifier of the segment (ephemeral, not constant over data updates)
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
+83 -46
View File
@@ -25,7 +25,16 @@ var osrm = new OSRM('network.osrm');
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.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
@@ -39,22 +48,24 @@ Returns the fastest route between two or more coordinates while visiting the way
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.alternatives` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes and return as well.
_Please note that even if an alternative route is requested, a result cannot be guaranteed._ (optional, default `false`)
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returned route steps for each route leg. (optional, default `false`)
- `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.
`null`/`true`/`false`
- `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`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
- `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`
- `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: [[52.519930,13.438640], [52.513191,13.415852]]}, function(err, result) {
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
@@ -80,7 +91,7 @@ Note: `coordinates` in the general options only supports a single `{longitude},{
- `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`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
@@ -102,8 +113,8 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
### table
Computes duration tables for the given locations. Allows for both symmetric and asymmetric
tables.
Computes duration table for the given locations. Allows for both symmetric and asymmetric
tables. Optionally returns distance table.
**Parameters**
@@ -119,7 +130,10 @@ tables.
- `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`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
- `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.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
@@ -144,6 +158,7 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
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
@@ -159,7 +174,7 @@ and what weights they have applied.
- `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)**
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
@@ -188,15 +203,16 @@ if they can not be matched successfully.
- `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.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returned route steps for each route. (optional, default `false`)
- `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)&lt;[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`)
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
- `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.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
@@ -229,25 +245,7 @@ The trip plugin solves the Traveling Salesman Problem using a greedy heuristic
waypoints. The returned path does not have to be the shortest path, _ as TSP is NP-hard it is
only an approximation.
**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.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returned 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)** Returned route is a roundtrip (route returns to first location). (optional, default `true`)
- `options.source` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned 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)** Returned 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`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
A requirement for computing trips is that all input coordinates are connected.
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:
@@ -262,6 +260,24 @@ Right now, the following combinations are possible:
| 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.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`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
**Examples**
```javascript
@@ -289,9 +305,30 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
2) `waypoint_index`: index of the point in the trip.
**`trips`**: an array of [`Route`](#route) objects that assemble the trace.
## Responses
## Plugin behaviour
Responses
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
@@ -299,8 +336,8 @@ Represents a route through (potentially multiple) waypoints.
**Parameters**
- `exteral` **documentation** in
[`osrm-backend`](../http.md#route)
- **documentation** in
[`osrm-backend`](../http.md#route-object)
### RouteLeg
@@ -308,8 +345,8 @@ Represents a route between two waypoints.
**Parameters**
- `exteral` **documentation** in
[`osrm-backend`](../http.md#routeleg)
- **documentation** in
[`osrm-backend`](../http.md#routeleg-object)
### RouteStep
@@ -318,15 +355,15 @@ single way to the subsequent step.
**Parameters**
- `exteral` **documentation** in
[`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#routestep)
- **documentation** in
[`osrm-backend`](../http.md#routestep-object)
### StepManeuver
**Parameters**
- `exteral` **documentation** in
[`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#stepmaneuver)
- **documentation** in
[`osrm-backend`](../http.md#stepmaneuver-object)
### Waypoint
@@ -334,5 +371,5 @@ Object used to describe waypoint on a route.
**Parameters**
- `exteral` **documentation** in
[`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#waypoint)
- **documentation** in
[`osrm-backend`](../http.md#waypoint-object)
+308 -59
View File
@@ -1,31 +1,97 @@
OSRM supports "profiles". Configurations representing different routing behaviours for (typically) different transport modes. A profile describes whether or not we route along a particular type of way, or over a particular node in the OpenStreetMap data, and also how quickly we'll be travelling when we do. This feeds into the way the routing graph is created and thus influences the output routes.
# 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.
Out-of-the-box OSRM comes with several different profiles, including car, bicycle and foot.
Profiles have a 'lua' extension, and are placed in 'profiles' directory.
Profile configuration files have a 'lua' extension, and are found under the 'profiles' subdirectory.
Alternatively commands will take a lua profile specified with an explicit -p param, for example:
When running OSRM preprocessing commands you specify the profile with the --profile (or the shorthand -p) option, for example:
`osrm-extract -p ../profiles/car.lua planet-latest.osm.pbf`
`osrm-extract --profile ../profiles/car.lua planet-latest.osm.pbf`
And then **you will need to extract and contract again** (A change to the profile will typically affect the extract step as well as the contract step. See [Processing Flow](https://github.com/Project-OSRM/osrm-backend/wiki/Processing-Flow))
## Processing flow
It's important to understand that profiles are used when preprocessing the OSM data, NOT at query time when routes are computed.
## lua scripts?
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 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 not sufficiently straightforward, to simply define tag mappings. Lua scripting offers a powerful way of coping with the complexity of different node,way,relation,tag combinations found within OpenStreetMap data.
## 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 a profile
## 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.
You can understand these lua scripts enough to make interesting modifications, without needing to get to grips with how they work completely.
A profile will typically:
Towards the top of the file, a profile (such as [car.lua](../profiles/car.lua)) will typically define various configurations as global variables. A lot of these are look-up hashes of one sort or another.
- Define api version (required)
- Require library files (optional)
- Define setup function (required)
- Define process functions (some are required)
- Return functions table (required)
As you scroll down the file you'll see local variables, and then local functions, and finally...
A profile can also define various local functions it needs.
`way_function` and `node_function` are the important functions which are called when extracting OpenStreetMap data with `osrm-extract`.
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.
The following global properties can be set in your profile:
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 iinterpreter 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
-------------------------------------|----------|----------------------------------------------------------------------------
@@ -36,39 +102,77 @@ use_turn_restrictions | Boolean | Are turn instructions followed
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 `segment_function` will be called for all segments (default `false`)
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`)
## way_function
Given an OpenStreetMap way, the `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 to be returned. The most important thing it will do is set the value of `result.forward_speed` and `result.backward_speed` as a suitable integer value representing the speed for traversing the way.
The following additional global properties can be set in the hash you return in the `setup` function:
All other calculations stem from that, including the returned timings in driving directions, but also, less directly, it feeds into the actual routing decisions the engine will take (a way with a slow traversal speed, may be less favoured than a way with fast traversal speed, but it depends how long it is, and... what it connects to in the rest of the network graph)
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
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the `way_function`. Instead a `way_function` will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, before arriving at the result.
### 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.
The following attributes can be set on the result in `way_function`:
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 | " "
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 | " "
backward_rate | Float | ""
forward_mode | Enum | Mode of travel (e.g. `car`, `ferry`). Mandatory. Defined in `include/extractor/travel_mode.hpp`.
backward_mode | Enum | " "
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 | " "
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 (normalised OSM `turn:lanes` value)
turn_lanes_backward | String | " "
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 | " "
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
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
@@ -78,51 +182,196 @@ road_classification.road_priority_class | Enum | Guidance: order in priority
road_classification.may_be_ignored | Boolean | Guidance: way is non-highway
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
### Guidance
### 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/guidance/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/guidance/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/guidance/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 omittted in considerations (is considered purely for connectivity).
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.
## node_function
### 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.
The following attributes can be set on the result in `node_function`:
Use `raster:load()` in your `setup` function to load data and store the source in your configuration hash:
Attribute | Type | Notes
----------------|---------|-------------------------------------------------------
barrier | Boolean | Is it an impassable barrier?
traffic_lights | Boolean | Is it a traffic light (incurs delay in `turn_function`)?
```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
```
## segment_function
The input data must an ASCII file with rows of integers. e.g.:
The following attributes can be read and set on the result in `segment_function`:
```
0 0 0 0
0 0 0 250
0 0 250 500
0 0 0 250
0 0 0 0
```
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 | " "
target.distance | Read | Float | Length of segment
weight | Read/write | Float | Routing weight for this segment
duration | Read/write | Float | Duration for this segment
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.
## turn_function
You must check whether the result is valid before use it.
The following attributes can be read and set on the result in `turn_function`:
Example:
Attribute | Read/write? | Type | Notes
-------------------|-------------|---------|------------------------------------------------------
direction_modifier | Read | Enum | Geometry of turn. Defined in `include/extractor/guidance/turn_instruction.hpp`
turn_type | Read | Enum | Priority of turn. Defined in `include/extractor/guidance/turn_instruction.hpp`
has_traffic_light | Read | Boolean | Is a traffic light present at this turn?
source_restricted | Read | Boolean | Is it from a restricted access road? (See definition in `way_function`)
target_restricted | Read | Boolean | Is it to a restricted access road? (See definition in `way_function`)
angle | Read | Float | Angle of turn in degrees (`0-360`: `0`=u-turn, `180`=straight on)
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
```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`
+9 -7
View File
@@ -43,14 +43,16 @@ We may introduce forward-compatible changes: query parameters and response prope
1. Check out the appropriate release branch `x.y`
2. Make sure `CHANGELOG.md` is up to date.
3. Make sure the OSRM version in `CMakeLists.txt` is up to date
4. Make sure the `package.json` is up to date.
5. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
6. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
7. Use `npm run build-api-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
8. Push tags and commits: `git push; git push --tags`
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.
+283 -283
View File
@@ -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)
+8
View File
@@ -30,9 +30,17 @@ int main(int argc, const char *argv[])
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
EngineConfig config;
config.storage_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};
+2 -3
View File
@@ -2,10 +2,9 @@
Feature: Bicycle - Route around alleys
Background:
Given the profile file
Given the profile file "bicycle" initialized with
"""
require 'bicycle'
properties.weight_name = 'cyclability'
profile.properties.weight_name = 'cyclability'
"""
Scenario: Bicycle - Avoid taking alleys
+2 -1
View File
@@ -10,6 +10,7 @@ Feature: Barriers
| | x |
| bollard | x |
| gate | x |
| lift_gate | x |
| cycle_barrier | x |
| cattle_grid | x |
| border_control | x |
@@ -18,7 +19,7 @@ Feature: Barriers
| entrance | x |
| wall | |
| fence | |
| some_tag | |
| some_tag | x |
| block | x |
Scenario: Bike - Access tag trumphs barriers
+1 -8
View File
@@ -4,7 +4,7 @@ Feature: Bicycle - Handle cycling
Background:
Given the profile "bicycle"
Scenario: Bicycle - Use a ferry route
Scenario: Bicycle - Use a movable bridge
Given the node map
"""
a b c
@@ -21,13 +21,6 @@ Feature: Bicycle - Handle cycling
When I route I should get
| from | to | route | modes |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| e | c | cde,cde | cycling,cycling |
| e | b | cde,abc,abc | cycling,cycling,cycling |
| e | a | cde,abc,abc | cycling,cycling,cycling |
| c | e | cde,cde | cycling,cycling |
| c | f | cde,efg,efg | cycling,cycling,cycling |
| c | g | cde,efg,efg | cycling,cycling,cycling |
Scenario: Bicycle - Properly handle durations
Given the node map
+92
View File
@@ -0,0 +1,92 @@
@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)],[()],[()] |
+10 -8
View File
@@ -46,12 +46,14 @@ Feature: Bike - Cycle tracks/lanes
| primary | | | | x | x |
| motorway | | | | | |
| motorway | track | | | x | |
| motorway | opposite | | | | x |
| motorway | | track | | | x |
| motorway | | opposite | | | x |
| motorway | opposite | | | x | x |
| motorway | | track | | x | |
| motorway | | opposite | | x | x |
| motorway | | | track | x | |
| motorway | | | opposite | x | |
| motorway | | track | track | x | 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 | opposite | x | x |
| motorway | | track | opposite | x | x |
| motorway | | opposite | track | x | x |
@@ -92,6 +94,6 @@ Feature: Bike - Cycle tracks/lanes
Then routability should be
| highway | cycleway | oneway | forw | backw |
| motorway | track | yes | 15 km/h | |
| residential | track | yes | 15 km/h | 6 km/h +-1 |
| cycleway | track | yes | 15 km/h | 6 km/h +-1 |
| footway | track | yes | 15 km/h | 6 km/h +-1 |
| 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 |
+23 -23
View File
@@ -21,15 +21,15 @@ 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,bcd |
| a | d | ab,bcd,bcd |
| a | e | axye,axye |
| e | d | de,de |
| e | c | de,bcd,bcd |
| e | b | de,bcd,bcd |
| e | a | axye,axye |
| 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 |
Scenario: Bike - Destination only street
Given the node map
@@ -49,15 +49,15 @@ 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,bc |
| a | d | ab,bc,cd,cd |
| a | e | axye,axye |
| e | d | de,de |
| e | c | de,cd,cd |
| e | b | de,cd,bc,bc |
| e | a | axye,axye |
| 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 |
Scenario: Bike - Routing inside a destination only area
Given the node map
@@ -76,8 +76,8 @@ Feature: Bike - Destination only, no passing through
| axye | |
When I route I should get
| from | to | route |
| a | e | ab,bc,cd,de,de |
| e | a | de,cd,bc,ab,ab |
| b | d | bc,cd,cd |
| d | b | cd,bc,bc |
| from | to | route |
| a | e | ab,bc,cd,de |
| e | a | de,cd,bc,ab |
| b | d | bc,cd |
| d | b | cd,bc |
+35
View File
@@ -0,0 +1,35 @@
@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 |
+55
View File
@@ -0,0 +1,55 @@
@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 |
-5
View File
@@ -21,12 +21,7 @@ Feature: Bike - Handle ferry routes
When I route I should get
| from | to | route |
| a | g | abc,cde,efg,efg |
| b | f | abc,cde,efg,efg |
| e | c | cde,cde |
| e | b | cde,abc,abc |
| e | a | cde,abc,abc |
| c | e | cde,cde |
| c | f | cde,efg,efg |
| c | g | cde,efg,efg |
Scenario: Bike - Ferry duration, single node
+1 -96
View File
@@ -20,11 +20,8 @@ Feature: Bike - Mode flag
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,ferry,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,ferry,cycling,cycling |
| c | a | bc,ab,ab | ferry,cycling,cycling |
| d | b | cd,bc,bc | cycling,ferry,ferry |
| a | c | ab,bc,bc | cycling,ferry,ferry |
| b | d | bc,cd,cd | ferry,cycling,cycling |
Scenario: Bike - Mode when using a train
Given the node map
@@ -42,12 +39,10 @@ Feature: Bike - Mode flag
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,train,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,train,cycling,cycling |
| c | a | bc,ab,ab | train,cycling,cycling |
| d | b | cd,bc,bc | cycling,train,train |
| a | c | ab,bc,bc | cycling,train,train |
| b | d | bc,cd,cd | train,cycling,cycling |
#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
"""
@@ -70,96 +65,6 @@ Feature: Bike - Mode flag
| 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 |
| a | c | ab,bc,bc | cycling,cycling,cycling |
| b | d | bc,cd,cd | cycling,cycling,cycling |
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 | 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 |
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
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,df | cycling,pushing bike,cycling,cycling |
| f | a | df,bcd,ab,ab | cycling,pushing bike,cycling,cycling |
| d | a | bcd,ab,ab | pushing bike,cycling,cycling |
| f | b | df,bcd,bcd | cycling,pushing bike,pushing bike |
| a | d | ab,bcd,bcd | cycling,pushing bike,pushing bike |
| b | f | bcd,df,df | pushing bike,cycling,cycling |
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 | 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 |
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
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 | 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 |
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
Scenario: Bicycle - Modes when starting on forward oneway
Given the node map
+9 -2
View File
@@ -141,5 +141,12 @@ Feature: Bike - Oneway streets
| highway | oneway | cycleway:left | cycleway:right | forw | backw |
| primary | yes | | | cycling | pushing bike |
| primary | yes | | track | cycling | pushing bike |
| primary | yes | track | | cycling | cycling |
| primary | yes | track | track | cycling | cycling |
| 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 |
-47
View File
@@ -1,47 +0,0 @@
@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 | ref |
| a | b | Utopia Drive,Utopia Drive | E7,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 | ref |
| a | b | , | E7,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,Utopia Drive |
+3 -182
View File
@@ -7,6 +7,8 @@ Feature: Bike - Turn restrictions
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
@@ -33,188 +35,7 @@ Feature: Bike - Turn restrictions
| s | n | sj,nj,nj |
| s | e | sj,ej,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,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,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,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,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,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,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,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,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,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,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,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,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,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,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
+33 -34
View File
@@ -2,25 +2,24 @@
Feature: Bicycle - Adds penalties to unsafe roads
Background:
Given the profile file
Given the profile file "bicycle" initialized with
"""
require 'bicycle'
properties.weight_name = 'cyclability'
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.9 | 2.9 |
| secondary | | 15 km/h | 15 km/h | 3.1 | 3.1 |
| 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.9 | 2.9 |
| secondary_link | | 15 km/h | 15 km/h | 3.1 | 3.1 |
| 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 | | 6 km/h +-1 | 6 km/h +-1 | 1.7 | 1.7 |
| 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
@@ -52,49 +51,49 @@ Feature: Bicycle - Adds penalties to unsafe roads
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.9 |
| secondary | track | | 15 km/h | 15 km/h | 4.2 | 3.1 |
| 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.9 |
| secondary_link | track | | 15 km/h | 15 km/h | 4.2 | 3.1 |
| 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 | 6 km/h +-1 | 4.2 | 1.7 |
| motorway | | track | | 15 km/h | | 4.2 |
| primary | | track | 15 km/h | 15 km/h | 2.9 | 4.2 |
| secondary | | track | 15 km/h | 15 km/h | 3.1 | 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.9 | 4.2 |
| secondary_link | | track | 15 km/h | 15 km/h | 3.1 | 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 | 6 km/h +-1 | 15 km/h | 1.7 | 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.9 |
| secondary | lane | | 15 km/h | 15 km/h | 4.2 | 3.1 |
| 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.9 |
| secondary_link | lane | | 15 km/h | 15 km/h | 4.2 | 3.1 |
| 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 | 6 km/h +-1 | 4.2 | 1.7 |
| motorway | | lane | | 15 km/h | | 4.2 |
| primary | | lane | 15 km/h | 15 km/h | 2.9 | 4.2 |
| secondary | | lane | 15 km/h +-1 | 15 km/h +-1 | 3.1 | 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.9 | 4.2 |
| secondary_link | | lane | 15 km/h | 15 km/h | 3.1 | 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 | 6 km/h +-1 | 15 km/h | 1.7 | 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.9 |
| motorway | | shared_lane | | 15 km/h | | 4.2 |
| primary | | shared_lane | 15 km/h | 15 km/h | 2.9 | 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
@@ -102,4 +101,4 @@ Feature: Bicycle - Adds penalties to unsafe roads
| 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 | 4.2 |
| tertiary | opposite | 15 km/h | 15 km/h | 3.3 | 3.3 |
+3 -3
View File
@@ -54,6 +54,6 @@ Feature: Bike - Surfaces
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 | 6 km/h |
| c | d | cd,cd | pushing bike,pushing bike | 6 km/h |
| d | c | cd,cd | pushing bike,pushing bike | 6 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 |
+2 -3
View File
@@ -7,10 +7,9 @@ Feature: Turn Penalties
Scenario: Bicycle - Turn penalties on cyclability
Given the profile file
Given the profile file "bicycle" initialized with
"""
require 'bicycle'
properties.weight_name = 'cyclability'
profile.properties.weight_name = 'cyclability'
"""
Given the node map
+10 -9
View File
@@ -157,15 +157,16 @@ Feature: Car - Restricted access
Scenario: Car - Access combinations
Then routability should be
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
| runway | private | | | permissive | x | x | |
| primary | forestry | | yes | | x | x | |
| cycleway | | | designated | | x | x | |
| residential | | yes | no | | | | |
| motorway | yes | permissive | | private | x | | implied oneway |
| trunk | agricultural | designated | permissive | no | | | |
| pedestrian | | | | | | | |
| pedestrian | | | | destination | | | temporary disabled #3773 |
| highway | 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 |
Scenario: Car - Ignore access tags for other modes
Then routability should be
+23
View File
@@ -0,0 +1,23 @@
@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 |
+8
View File
@@ -45,3 +45,11 @@ 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 |
+10 -19
View File
@@ -20,15 +20,9 @@ Feature: Car - Handle driving
| efg | primary | | |
When I route I should get
| from | to | route | modes |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving |
| e | c | cde,cde | driving,driving |
| e | b | cde,abc,abc | driving,driving,driving |
| e | a | cde,abc,abc | driving,driving,driving |
| c | e | cde,cde | driving,driving |
| c | f | cde,efg,efg | driving,driving,driving |
| c | g | cde,efg,efg | driving,driving,driving |
| from | to | route | modes | turns |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | depart,new name right,new name left,arrive |
| e | a | cde,abc,abc | driving,driving,driving | depart,new name left,arrive |
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
Given the node map
@@ -45,11 +39,9 @@ Feature: Car - Handle driving
| efg | primary | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 13 km/h | 340s +-1 |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 318s +-1 |
| c | e | cde,cde | driving,driving | 5 km/h | 295s +-1 |
| e | c | cde,cde | driving,driving | 5 km/h | 295s +-1 |
| from | to | route | modes | speed | time | turns |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 13 km/h | 332s +-1 | depart,new name right,new name left,arrive |
| e | c | cde,cde | driving,driving | 5 km/h | 288s +-1 | depart,arrive |
Scenario: Car - Properly handle durations
Given the node map
@@ -66,8 +58,7 @@ Feature: Car - Handle driving
| efg | primary | | |
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 7 km/h |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 5 km/h |
| c | e | cde,cde | driving,driving | 2 km/h |
| e | c | cde,cde | driving,driving | 2 km/h |
| from | to | route | modes | speed | turns |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 7 km/h | depart,new name right,new name left,arrive |
| c | e | cde,cde | driving,driving | 2 km/h | depart,arrive |
| e | c | cde,cde | driving,driving | 2 km/h | depart,arrive |
+84 -20
View File
@@ -17,13 +17,13 @@ Feature: Car - Mode flag
| 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,ferry |
| a | c | ab,bc,bc | depart,notification right,arrive | ,ferry,ferry |
| b | d | bc,cd,cd | depart,notification left,arrive | ferry,, |
| 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: Car - We tag motorways with a class
@@ -40,10 +40,10 @@ Feature: Car - Mode flag
| cd | primary |
When I route I should get
| from | to | route | turns | classes | # |
| a | d | ab,bc,cd | depart,notification right,arrive | ,motorway, | |
| a | c | ab,bc,bc | depart,notification right,arrive | ,motorway,motorway | |
| b | d | bc,cd | depart,arrive | motorway, | we don't announce when we leave the highway |
| from | to | route | turns | classes |
| a | d | ab,cd | depart,arrive | [(),(motorway),()],[()] |
| a | c | ab,bc | depart,arrive | [(),(motorway)],[()] |
| b | d | bc,cd | depart,arrive | [(motorway),()],[()] |
Scenario: Car - We tag motorway_link with a class
Given the node map
@@ -59,10 +59,10 @@ Feature: Car - Mode flag
| cd | primary |
When I route I should get
| from | to | route | turns | classes | # |
| a | d | ab,bc,cd | depart,on ramp right,arrive | ,motorway, | notification replaced by on-ramp |
| a | c | ab,bc,bc | depart,on ramp right,arrive | ,motorway,motorway | " " |
| b | d | bc,cd | depart,arrive | motorway, | no announcement |
| from | to | route | turns | classes | # |
| a | d | ab,bc,cd | depart,on ramp right,arrive | [()],[(motorway),()],[()] | on-ramp at class change |
| a | c | ab,bc,bc | depart,on ramp right,arrive | [()],[(motorway)],[()] | " " |
| b | d | bc,cd | depart,arrive | [(motorway),()],[()] | no announcement |
Scenario: Car - We tag restricted with a class
@@ -79,10 +79,10 @@ Feature: Car - Mode flag
| cd | primary | |
When I route I should get
| from | to | route | turns | classes |
| a | d | ab,bc,cd | depart,notification right,arrive| restricted,motorway;restricted, |
| from | to | route | turns | classes |
| a | d | ab,cd | depart,arrive| [(restricted),(motorway,restricted),()],[()] |
Scenario: Car - We toll restricted with a class
Scenario: Car - We tag toll with a class
Given the node map
"""
a b
@@ -96,6 +96,70 @@ Feature: Car - Mode flag
| cd | primary | |
When I route I should get
| from | to | route | turns | classes |
| a | d | ab,bc,cd | depart,notification right,arrive | toll,motorway;toll, |
| from | to | route | turns | classes |
| a | d | ab,cd | depart,arrive | [(toll),(motorway,toll),()],[()] |
Scenario: Car - 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: Car - 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: Car - From roundabout on toll road
Given the node map
"""
c
/ \
a---b d---f
\ /
e
|
g
"""
And the ways
| nodes | oneway | highway | junction | toll |
| ab | yes | primary | | |
| cb | yes | primary | roundabout | |
| dc | yes | primary | roundabout | |
| be | yes | primary | roundabout | |
| ed | yes | motorway| roundabout | |
| eg | yes | primary | | |
| df | yes | motorway| | yes |
When I route I should get
| from | to | route | turns | classes |
| a | f | ab,df,df,df | depart,roundabout-exit-2,exit roundabout slight right,arrive | [()],[(),(motorway)],[(toll,motorway)],[()] |
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
@routing @car @construction
Feature: Car - all construction tags the OpenStreetMap community could think of and then some
Background:
Given the profile "car"
Scenario: Various ways to tag construction and proposed roads
Then routability should be
| highway | construction | proposed | bothw |
| primary | | | x |
| construction | | | |
| proposed | | | |
| primary | yes | | |
| primary | | yes | |
| primary | no | | x |
| primary | widening | | x |
| primary | minor | | x |
+61 -6
View File
@@ -23,11 +23,11 @@ Feature: Car - Destination only, no passing through
When I route I should get
| from | to | route |
| a | b | ab,ab |
| a | c | ab,bcd,bcd |
| a | c | ab,bcd |
| a | d | ab,bcd,bcd |
| a | e | axye,axye |
| e | d | de,de |
| e | c | de,bcd,bcd |
| e | c | de,bcd |
| e | b | de,bcd,bcd |
| e | a | axye,axye |
@@ -51,12 +51,12 @@ Feature: Car - Destination only, no passing through
When I route I should get
| from | to | route |
| a | b | ab,ab |
| a | c | ab,bc,bc |
| a | d | ab,bc,cd |
| a | c | ab,bc |
| a | d | ab,cd |
| a | e | axye,axye |
| e | d | de,de |
| e | c | de,cd,cd |
| e | b | de,cd,bc |
| e | c | de,cd |
| e | b | de,bc |
| e | a | axye,axye |
Scenario: Car - Routing inside a destination only area
@@ -131,3 +131,58 @@ Feature: Car - Destination only, no passing through
| e | a | acbe,acbe |
| d | a | de,acbe,acbe |
| c | d | cd,cd |
Scenario: Car - Routing through a parking lot tagged access=destination,service
Given the node map
"""
a----c++++b+++g------h---i
| + + + /
| + + + /
| + + + /
| d++++e+f /
z--------------y
"""
And the ways
| nodes | access | highway |
| ac | | secondary |
| ghi | | secondary |
| azyhi | | secondary |
| cd | destination | service |
| def | destination | service |
| cbg | destination | service |
| be | destination | service |
| gf | destination | service |
When I route I should get
| from | to | route |
| a | i | azyhi,azyhi |
| b | f | be,def,def |
| b | i | cbg,ghi,azyhi,azyhi |
Scenario: Car - Disallow snapping to access=private,highway=service
Given a grid size of 20 meters
Given the node map
"""
a---c---b
:
x
:
d
\__e
"""
And the ways
| nodes | access | highway |
| acb | | primary |
| cx | private | service |
| xd | private | service |
| de | | primary |
When I route I should get
| from | to | route |
| a | x | acb,xd,xd |
| a | d | acb,xd,xd |
| a | e | acb,xd,de |
| x | e | de,de |
# do not snap to access=private,highway=service roads when routing over them is not necessary
+27
View File
@@ -50,6 +50,7 @@ Feature: Car - Handle ferry routes
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
Scenario: Car - Properly handle simple durations
Given the node map
"""
@@ -91,3 +92,29 @@ Feature: Car - Handle ferry routes
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
@snapping
Scenario: Car - Snapping when using a ferry
Given the node map
"""
a b c d e f
"""
And the ways
| nodes | highway | route | duration |
| ab | primary | | |
| bcde | | ferry | 0:10 |
| ef | primary | | |
When I route I should get
| from | to | route | modes | time |
| c | d | bcde,bcde | ferry,ferry | 600s |
Given the query options
| geometries | geojson |
| overview | full |
# Note that matching *should* work across unsnappable ferries
When I match I should get
| trace | geometry | duration |
| abcdef| 1,1,1.000899,1,1.000899,1,1.002697,1,1.002697,1,1.003596,1,1.003596,1,1.005394,1,1.005394,1,1.006293,1 | 610.9 |
+25
View File
@@ -137,3 +137,28 @@ OSRM will use 4/5 of the projected free-flow speed.
| primary | | | 30 | -1 | | 23 km/h | | 6.7 |
| primary | 20 | 30 | | -1 | | 15 km/h | | 4.4 |
| primary | 20 | | 30 | -1 | | 23 km/h | | 6.7 |
Scenario: Car - Respect source:maxspeed
Given the node map
"""
a b c d e f g
"""
And the ways
| nodes | highway | source:maxspeed | maxspeed |
| ab | trunk | | |
| bc | trunk | | 60 |
| cd | trunk | FR:urban | |
| de | trunk | CH:rural | |
| ef | trunk | CH:trunk | |
| fg | trunk | CH:motorway | |
When I route I should get
| from | to | route | speed |
| a | b | ab,ab | 85 km/h |
| b | c | bc,bc | 48 km/h |
| c | d | cd,cd | 40 km/h |
| d | e | de,de | 64 km/h |
| e | f | ef,ef | 80 km/h |
| f | g | fg,fg | 96 km/h |
-44
View File
@@ -1,44 +0,0 @@
@routing @car @mode
Feature: Car - Mode flag
Background:
Given the profile "car"
Scenario: Car - Mode when using a ferry
Given the node map
"""
a b
c d
"""
And the ways
| nodes | highway | route | duration |
| ab | primary | | |
| bc | | ferry | 0:01 |
| cd | primary | | |
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | driving,ferry,driving,driving |
| d | a | cd,bc,ab,ab | driving,ferry,driving,driving |
| c | a | bc,ab,ab | ferry,driving,driving |
| d | b | cd,bc,bc | driving,ferry,ferry |
| a | c | ab,bc,bc | driving,ferry,ferry |
| b | d | bc,cd,cd | ferry,driving,driving |
Scenario: Car - Snapping when using a ferry
Given the node map
"""
a b c d e f
"""
And the ways
| nodes | highway | route | duration |
| ab | primary | | |
| bcde | | ferry | 0:10 |
| ef | primary | | |
When I route I should get
| from | to | route | modes | time |
| c | d | bcde,bcde | ferry,ferry | 600s |
-16
View File
@@ -5,22 +5,6 @@ Feature: Car - Street names in instructions
Given the profile "car"
Given a grid size of 5 meters
Scenario: Car - A named street
Given the node map
"""
a b
c
"""
And the ways
| nodes | name | ref |
| ab | My Way | |
| bc | Your Way | A1 |
When I route I should get
| from | to | route | ref |
| a | c | My Way,Your Way | ,A1|
Scenario: Car - A named street with pronunciation
Given the node map
"""
+69
View File
@@ -0,0 +1,69 @@
@routing @car
Feature: Car - Handle physical limitation
Background:
Given the profile "car"
Scenario: Car - Use a narrow way
Then routability should be
| highway | width | narrow | bothw |
| primary | | | x |
| primary | narrow | | x |
| primary | | yes | x |
| primary | 1.8 | | |
| primary | 1.9 | | |
| primary | 2.0 | | x |
| primary | 2.1 | | x |
| primary | 1m | | |
| primary | 1 m | | |
| primary | 3 m | | x |
| primary | 6' | | |
| primary | 6'0" | | |
| primary | 6'2" | | |
| primary | 6'3" | | x |
| primary | 7' | | x |
| primary | 7'0" | | x |
Scenario: Car - Limited by width
Then routability should be
| highway | maxwidth:physical | maxwidth | width | est_width | bothw |
| primary | 1 | | | | |
| primary | 3 | | | | x |
| primary | | 1 | | | |
| primary | | 3 | | | x |
| primary | | | 1 | | |
| primary | | | 3 | | x |
| primary | | | | 1 | |
| primary | | | | 3 | x |
Scenario: Car - Limited by height
Then routability should be
| highway | maxheight:physical | maxheight | bothw |
| primary | | | x |
| primary | 1 | | |
| primary | 3 | | x |
| primary | | 1 | |
| primary | | 3 | x |
| primary | | default | x |
| primary | | none | x |
| primary | | no-sign | x |
| primary | | unsigned | x |
Scenario: Car - Limited by length
Then routability should be
| highway | maxlength | bothw |
| primary | | x |
| primary | 1 | |
| primary | 5 | x |
| primary | unsigned | x |
Scenario: Car - Limited by weight
Then routability should be
| highway | maxweight | bothw |
| primary | | x |
| primary | 1 | |
| primary | 3.5 | x |
| primary | 35000 kg | x |
| primary | 8.9t | x |
| primary | 0.1 lbs | |
| primary | unsigned | x |
File diff suppressed because it is too large Load Diff
+329
View File
@@ -0,0 +1,329 @@
@routing @car @relations
Feature: Car - route relations
Background:
Given the profile "car"
Scenario: Assignment using relation membership roles
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | way:east | way:west | route | ref | network |
| route | cd | ba | road | 80 | US:I |
| route | cd | ba | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80 $west,I 80 $west |
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
Scenario: No cardinal directions by default
Given the profile file "car" initialized with
"""
profile.cardinal_directions = false
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | way:east | way:west | route | ref | network |
| route | cd | ba | road | 80 | US:I |
| route | cd | ba | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80,I 80 |
| c,d | eastbound,eastbound | I 80; CO 93,I 80; CO 93 |
Scenario: No cardinal directions by default
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | way:east | way:west | route | ref | network |
| route | cd | ba | road | 80 | US:I |
| route | cd | ba | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80,I 80 |
| c,d | eastbound,eastbound | I 80; CO 93,I 80; CO 93 |
Scenario: Assignment using relation direction property (no role on members)
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | direction | way | route | ref | network |
| route | west | ba | road | 80 | US:I |
| route | east | cd | road | 80 | US:I |
| route | east | cd | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80 $west,I 80 $west |
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
Scenario: Forward assignment on one-way roads using relation direction property
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
c----------------d
"""
And the ways
| nodes | name | highway | ref |
| ba | westbound | motorway | I 80 |
| cd | eastbound | motorway | I 80;CO 93 |
And the relations
| type | direction | way:forward | route | ref | network |
| route | west | ba | road | 80 | US:I |
| route | east | cd | road | 80 | US:I |
| route | east | cd | road | 93 | US:CO |
When I route I should get
| waypoints | route | ref |
| b,a | westbound,westbound | I 80 $west,I 80 $west |
| c,d | eastbound,eastbound | I 80 $east; CO 93 $east,I 80 $east; CO 93 $east |
Scenario: Forward/backward assignment on non-divided roads with role direction tag
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref | oneway |
| ab | mainroad | motorway | I 80 | no |
And the relations
| type | direction | way:forward | route | ref | network |
| route | west | ab | road | 80 | US:I |
And the relations
| type | direction | way:backward | route | ref | network |
| route | east | ab | road | 80 | US:I |
When I route I should get
| waypoints | route | ref |
| a,b | mainroad,mainroad | I 80 $west,I 80 $west |
| b,a | mainroad,mainroad | I 80 $east,I 80 $east |
Scenario: Conflict between role and direction
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | direction | way:east | route | ref | network |
| route | west | ab | road | 80 | US:I |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80,I 80 |
Scenario: Conflict between role and superrelation direction
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:east | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | direction | relation | route | ref | network | name |
| route | west | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80,I 80 |
Scenario: Conflict between role and superrelation role
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:east | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | relation:west | route | ref | network | name |
| route | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80,I 80 |
Scenario: Direction only available via superrelation role
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:forward | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | relation:east | route | ref | network | name |
| route | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80 $east,I 80 $east |
Scenario: Direction only available via superrelation direction
Given the profile file "car" initialized with
"""
profile.cardinal_directions = true
"""
Given the node map
"""
a----------------b
"""
And the ways
| nodes | name | highway | ref |
| ab | eastbound | motorway | I 80 |
And the relations
| type | way:forward | route | ref | network | name |
| route | ab | road | 80 | US:I | baserelation |
And the relations
| type | direction | relation | route | ref | network | name |
| route | east | baserelation | road | 80 | US:I | superrelation |
When I route I should get
| waypoints | route | ref |
| a,b | eastbound,eastbound | I 80 $east,I 80 $east |
# Scenario: Three levels of indirection
# Given the node map
# """
# a----------------b
# """
#
# And the ways
# | nodes | name | highway | ref |
# | ab | eastbound | motorway | I 80 |
#
# And the relations
# | type | way:forward | route | ref | network | name |
# | route | ab | road | 80 | US:I | baserelation |
#
# And the relations
# | type | relation | route | ref | network | name |
# | route | baserelation | road | 80 | US:I | superrelation1 |
#
# And the relations
# | type | direction | relation | route | ref | network | name |
# | route | east | superrelation1 | road | 80 | US:I | superrelation2 |
#
# When I route I should get
# | waypoints | route | ref |
# | a,b | eastbound,eastbound | I 80 $east,I 80 $east |
+105 -42
View File
@@ -1,41 +1,11 @@
@routing @testbot @sidebias
Feature: Testbot - side bias
Background:
Given the profile file
Scenario: Left-hand bias
Given the profile file "car" initialized with
"""
require 'testbot'
properties.left_hand_driving = true
"""
Scenario: Left hand bias
Given the profile file "car" extended with
"""
properties.left_hand_driving = true
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
"""
Given the node map
"""
a b c
d
"""
And the ways
| nodes |
| ab |
| bc |
| bd |
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 24s +-1 |
| d | c | bd,bc,bc | 27s +-1 |
Scenario: Right hand bias
Given the profile file "car" extended with
"""
properties.left_hand_driving = false
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
profile.properties.left_hand_driving = true
profile.turn_bias = 1.075
"""
And the node map
"""
@@ -50,12 +20,38 @@ Feature: Testbot - side bias
| bd |
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 27s +-1 |
# should be inverse of left hand bias
| d | c | bd,bc,bc | 24s +-1 |
| from | to | route | time | driving_side |
| d | a | bd,ab,ab | 24s +-1 | left,left,left |
| d | c | bd,bc,bc | 27s +-1 | left,left,left |
Scenario: Right-hand bias
Given the profile file "car" initialized with
"""
profile.properties.left_hand_driving = true
profile.turn_bias = 1 / 1.075
"""
And the node map
"""
a b c
d
"""
And the ways
| nodes |
| ab |
| bc |
| bd |
When I route I should get
| from | to | route | time | driving_side | # |
| d | a | bd,ab,ab | 27s +-1 | left,left,left | should be inverse of left hand bias |
| d | c | bd,bc,bc | 24s +-1 | left,left,left | |
Scenario: Roundabout exit counting for left sided driving
Given the profile file "car" initialized with
"""
profile.properties.left_hand_driving = true
"""
And a grid size of 10 meters
And the node map
"""
@@ -74,7 +70,74 @@ Feature: Testbot - side bias
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
| waypoints | route | driving_side | turns |
| a,d | ab,cd,cd | left,left,left | depart,roundabout turn left exit-1,arrive |
| a,f | ab,ef,ef | left,left,left | depart,roundabout turn straight exit-2,arrive |
| a,h | ab,gh,gh | left,left,left | depart,roundabout turn right exit-3,arrive |
Scenario: Left-hand bias via location-dependent tags
Given the profile "car"
And the node map
"""
a b c
d
"""
And the ways with locations
| nodes |
| ab |
| bc |
| bd |
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
When I route I should get
| from | to | route | driving_side | time |
| d | a | bd,ab,ab | left,left,left | 24s +-1 |
| d | c | bd,bc,bc | left,left,left | 27s +-1 |
Scenario: Left-hand bias via OSM tags
Given the profile "car"
And the node map
"""
a b c
d
"""
And the ways with locations
| nodes | driving_side |
| ab | right |
| bc | right |
| bd | right |
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
When I route I should get
| from | to | route | driving_side | time |
| d | a | bd,ab,ab | right,right,right | 27s +-1 |
| d | c | bd,bc,bc | right,right,right | 24s +-1 |
Scenario: changing sides
Given the profile "car"
# Note - the boundary in null-island.geojson is at lon = 2.0,
# and we use the "last node of the way" as the heuristic to detect
# whether the way is in our out of the driving_side polygon
And the node locations
| node | lat | lon |
| a | 0 | 0.5 |
| b | 0 | 1.5 |
| c | 0 | 2.5 |
| d | 0 | 3.5 |
And the ways
| nodes |
| ab |
| bc |
| cd |
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
When I route I should get
| from | to | route | driving_side |
| d | a | cd,bc,ab,ab | right,right,left,left |
| a | d | ab,bc,cd,cd | left,right,right,right |
+20
View File
@@ -35,3 +35,23 @@ Feature: Car - Allowed start/end modes
| from | to | route | modes |
| 1 | 2 | ab,ab | driving,driving |
| 2 | 1 | ab,ab | driving,driving |
Scenario: Car - URL override of non-startpoints
Given the node map
"""
a 1 b c 2 d
"""
Given the query options
| snapping | any |
And the ways
| nodes | highway | access |
| ab | service | private |
| bc | primary | |
| cd | service | private |
When I route I should get
| from | to | route |
| 1 | 2 | ab,bc,cd |
| 2 | 1 | cd,bc,ab |
+1 -1
View File
@@ -76,7 +76,7 @@ Feature: Basic Routing
When I route I should get
| waypoints | route | summary |
| a,c | , | 100, 101 |
| a,c | ,, | 100, 101 |
Scenario: Single Ref
Given the node map
@@ -37,3 +37,57 @@ Feature: Car - Handle traffic lights
| 3 | 4 | 13.1s | no turn with traffic light |
| g | j | 18.7s | turn with no traffic light |
| k | n | 20.7s | turn with traffic light |
Scenario: Tarrif Signal Geometry
Given the query options
| overview | full |
| geometries | polyline |
Given the node map
"""
a - b - c
"""
And the ways
| nodes | highway |
| abc | primary |
And the nodes
| node | highway |
| b | traffic_signals |
When I route I should get
| from | to | route | geometry |
| a | c | abc,abc | _ibE_ibE?gJ?gJ |
@traffic
Scenario: Traffic update on the edge with a traffic signal
Given the node map
"""
a - b - c
"""
And the ways
| nodes | highway |
| abc | primary |
And the nodes
| node | highway |
| b | traffic_signals |
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the customize extra arguments "--segment-speed-file {speeds_file}"
And the speed file
"""
1,2,65
2,1,65
"""
And the query options
| annotations | datasources,nodes,speed,duration,weight |
When I route I should get
| from | to | route | speed | weights | time | distances | a:datasources | a:nodes | a:speed | a:duration | a:weight |
| a | c | abc,abc | 59 km/h | 24.2,0 | 24.2s | 399.9m,0m | 1:0 | 1:2:3 | 18:18 | 11.1:11.1 | 11.1:11.1 |
| c | a | abc,abc | 59 km/h | 24.2,0 | 24.2s | 399.9m,0m | 0:1 | 3:2:1 | 18:18 | 11.1:11.1 | 11.1:11.1 |
+11 -13
View File
@@ -1,16 +1,14 @@
@routing @car @weight
Feature: Car - weights
Background: Use specific speeds
Given the profile "car"
Scenario: Only routes down service road when that's the destination
Given the node map
Given the profile "car"
And the node map
"""
a--b--c
|
d
|
| |
d |
| |
e--f--g
"""
And the ways
@@ -21,11 +19,12 @@ Feature: Car - weights
| bdf | service |
When I route I should get
| from | to | route | speed | weight |
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
| a | e | abc,cg,efg,efg | 29 km/h | 122.4 |
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
Scenario: Does not jump off the highway to go down service road
Given the node map
Given the profile "car"
And the node map
"""
a
|
@@ -60,13 +59,12 @@ Feature: Car - weights
When I route I should get
| from | to | route | speed | weight |
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
| a | e | ab,be,be | 14 km/h | 112 |
| a | e | ab,be,be | 14 km/h | 111.8 |
Scenario: Distance weights
Given the profile file "car" extended with
Given the profile file "car" initialized with
"""
api_version = 1
properties.weight_name = 'distance'
profile.properties.weight_name = 'distance'
"""
Given the node map
+2 -1
View File
@@ -10,6 +10,7 @@ Feature: Barriers
| | x |
| bollard | x |
| gate | x |
| lift_gate | x |
| cycle_barrier | x |
| cattle_grid | x |
| border_control | x |
@@ -18,7 +19,7 @@ Feature: Barriers
| entrance | x |
| wall | |
| fence | |
| some_tag | |
| some_tag | x |
| block | x |
Scenario: Foot - Access tag trumphs barriers
+35
View File
@@ -0,0 +1,35 @@
@routing @foot
Feature: Foot - Use distance weight
Background:
Given a grid size of 200 meters
Scenario: Foot - Check distance weight
Given the profile file
"""
local functions = require('foot')
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 | 144s | 200m +-1 |
| a | c | abc,abc | 400 | 288s | 400m +-1 |
-6
View File
@@ -21,13 +21,7 @@ Feature: Foot - Handle ferry routes
When I route I should get
| from | to | route | modes |
| a | g | abc,cde,efg,efg | walking,ferry,walking,walking |
| b | f | abc,cde,efg,efg | walking,ferry,walking,walking |
| e | c | cde,cde | ferry,ferry |
| e | b | cde,abc,abc | ferry,walking,walking |
| e | a | cde,abc,abc | ferry,walking,walking |
| c | e | cde,cde | ferry,ferry |
| c | f | cde,efg,efg | ferry,walking,walking |
| c | g | cde,efg,efg | ferry,walking,walking |
Scenario: Foot - Ferry duration, single node
Given the node map
+4 -20
View File
@@ -14,25 +14,9 @@ Feature: Foot - Street names in instructions
And the ways
| nodes | name | ref |
| ab | My Way | A6 |
| bc | Your Way | B7 |
| ab | My Way | |
| bc | | A7 |
When I route I should get
| from | to | route |
| a | c | My Way,Your Way,Your Way |
@unnamed
Scenario: Foot - No longer use way type to describe unnamed ways, see #3231
Given the node map
"""
a b c d
"""
And the ways
| nodes | highway | name |
| ab | footway | |
| bcd | track | |
When I route I should get
| from | to | route |
| a | d | , |
| from | to | route | ref |
| a | c | My Way,, | ,A7,A7 |
-47
View File
@@ -1,47 +0,0 @@
@routing @foot @ref @name
Feature: Foot - Way ref
Background:
Given the profile "foot"
Scenario: Foot - 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 | ref |
| a | b | Utopia Drive,Utopia Drive | E7,E7 |
Scenario: Foot - 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 | ref |
| a | b | , | E7,E7 |
Scenario: Foot - 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,Utopia Drive |
-180
View File
@@ -32,84 +32,6 @@ Feature: Foot - Turn restrictions
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Foot - No right turn
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | ej | j | no_right_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 |
@no_turning
Scenario: Foot - No u-turn
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | wj | j | no_u_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 |
@no_turning
Scenario: Foot - Handle any no_* relation
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | wj | j | no_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Foot - Only left turn
Given the node map
@@ -136,84 +58,6 @@ Feature: Foot - Turn restrictions
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Foot - Only right turn
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | ej | j | only_right_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 |
@only_turning
Scenario: Foot - Only straight on
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | nj | j | only_straight_on |
When I route I should get
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Foot - Handle any only_* restriction
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | nj | j | only_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@except
Scenario: Foot - Except tag and on no_ restrictions
Given the node map
@@ -246,30 +90,6 @@ Feature: Foot - Turn restrictions
| s | c | sj,cj,cj |
| s | d | sj,dj,dj |
@except
Scenario: Foot - Except tag and on only_ restrictions
Given the node map
"""
a b
j
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| aj | no |
| bj | no |
And the relations
| type | way:from | way:to | node:via | restriction | except |
| restriction | sj | aj | j | only_straight_on | foot |
When I route I should get
| from | to | route |
| s | a | sj,aj,aj |
| s | b | sj,bj,bj |
@except
Scenario: Foot - Multiple except tag values
Given the node map
+2 -3
View File
@@ -1,10 +1,9 @@
@routing @foot @roundabout @instruction
@routing @foot @roundabout @instruction @todo
Feature: Roundabout Instructions
Background:
Given the profile "foot"
@todo
Scenario: Foot - Roundabout instructions
# You can walk in both directions on a roundabout, bu the normal roundabout instructions don't
# make sense when you're going the opposite way around the roundabout.
@@ -27,7 +26,7 @@ Feature: Roundabout Instructions
| abcda | roundabout |
When I route I should get
| from | to | route | turns |
| from | to | route | turns |
| s | t | sa,tb | depart,roundabout-exit-1,arrive |
| s | u | sa,uc | depart,roundabout-exit-2,arrive |
| s | v | sa,vd | depart,roundabout-exit-3,arrive |
+15 -15
View File
@@ -35,10 +35,10 @@ Feature: Turn Lane Guidance
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true, |
| a,f | in,cross,cross | depart,continue right,arrive | ,, |
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ;,left:false straight:true, |
| a,f | in,cross,cross | depart,continue right,arrive | ,;right:true, |
@sliproads
Scenario: Separate Turn Lanes
@@ -47,7 +47,7 @@ Feature: Turn Lane Guidance
e
a . . b . . . c g
` .
` .
` .
` d
f
"""
@@ -68,10 +68,10 @@ Feature: Turn Lane Guidance
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ;,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true;left:false straight:false right:true, |
@sliproads
@@ -109,12 +109,12 @@ Feature: Turn Lane Guidance
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ;,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true;left:false straight:false right:true, |
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
@todo @2654 @none
+96 -105
View File
@@ -3,7 +3,7 @@ Feature: Turn Lane Guidance
Background:
Given the profile "car"
Given a grid size of 20 meters
Given a grid size of 100 meters
@anticipate
Scenario: Anticipate Lane Change for subsequent multi-lane intersections
@@ -52,9 +52,9 @@ Feature: Turn Lane Guidance
| dy | | | YSt |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false right:false right:true,left:false right:true, |
| e,a | MySt,MySt,MySt,MySt | depart,continue left,turn left,arrive | ,left:true left:false straight:false,left:true right:false, |
| waypoints | route | turns | lanes |
| a,e | MySt,MySt,MySt,MySt | depart,continue right,continue right,arrive | ,straight:false right:false right:true,left:false right:true, |
| e,a | MySt,MySt,MySt,MySt | depart,continue left,continue left,arrive | ,left:true left:false straight:false,left:true right:false, |
@anticipate
Scenario: Anticipate Lane Change for quick same direction turns, changing between streets
@@ -151,9 +151,9 @@ Feature: Turn Lane Guidance
| cj | | 1 | motorway_link | yes | xbcj |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | ab,ci,ci | depart,turn slight right,arrive | ,none:false slight right:true, |
| a,j | ab,xbcj | depart,arrive | , |
| waypoints | route | turns | lanes |
| a,i | ab,ci,ci | depart,turn slight right,arrive | ;,none:false slight right:true, |
| a,j | ab,xbcj | depart,arrive | ;;none:true slight right:false, |
@anticipate
@@ -308,8 +308,8 @@ Feature: Turn Lane Guidance
| di | | off | | yes |
When I route I should get
| waypoints | route | turns | destinations | lanes | locations |
| a,e | main,main,main | depart,use lane straight,arrive | One,Two,Three | ,left:false straight:false straight:true straight:false right:false, | a,c,e |
| waypoints | route | turns | destinations | locations | lanes |
| a,e | main,main | depart,arrive | One,Three | a,e | ;left:false straight:false straight:true straight:false right:false;left:false straight:true right:false, |
@anticipate
Scenario: Anticipate Lanes for through and collapse multiple use lanes
@@ -335,9 +335,9 @@ Feature: Turn Lane Guidance
| dj | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,c | main,main | depart,arrive | , |
| a,d | main,main | depart,arrive | , |
| waypoints | route | turns | lanes |
| a,c | main,main | depart,arrive | ;left:false straight:true straight:true right:false, |
| a,d | main,main | depart,arrive | ;left:false straight:true straight:true right:false;left:false straight:true straight:true right:false, |
@anticipate
Scenario: Anticipate Lanes for through followed by left/right
@@ -363,17 +363,17 @@ Feature: Turn Lane Guidance
| ci | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,d | main,main,main,left,left | depart,use lane straight,use lane straight,turn left,arrive | ,left:false straight:false straight:true straight:false straight:false right:false,left:false straight:true straight:false right:false,left:true right:false, |
| a,e | main,main,main,right,right | depart,use lane straight,use lane straight,turn right,arrive | ,left:false straight:false straight:false straight:true straight:false right:false,left:false straight:false straight:true right:false,left:false right:true, |
| waypoints | route | turns | lanes |
| a,d | main,left,left | depart,end of road left,arrive | ;left:false straight:false straight:true straight:false straight:false right:false;left:false straight:true straight:false right:false,left:true right:false, |
| a,e | main,right,right | depart,end of road right,arrive | ;left:false straight:false straight:false straight:true straight:false right:false;left:false straight:false straight:true right:false,left:false right:true, |
@anticipate
Scenario: Anticipate Lanes for through with turn before / after
Given the node map
"""
c g l
b d e h - i
a f j
c g l
b d e h i
a f j
"""
And the ways
@@ -390,15 +390,15 @@ Feature: Turn Lane Guidance
| il | | il | |
When I route I should get
| waypoints | route | turns | lanes | # |
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| a,j | ab,bdehi,bdehi,ij,ij | depart,turn right,use lane straight,turn right,arrive | ,right:true right:true right:false right:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
| a,l | ab,bdehi,bdehi,il,il | depart,turn right,use lane straight,turn left,arrive | ,right:false right:false right:true right:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| c,l | cb,bdehi,bdehi,il,il | depart,turn left,use lane straight,turn left,arrive | ,left:false left:false left:true left:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
| c,j | cb,bdehi,bdehi,ij,ij | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false left:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
| waypoints | route | turns | lanes | # |
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| a,j | ab,bdehi,ij,ij | depart,turn right,end of road right,arrive | ,right:true right:true right:false right:false;left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
| a,l | ab,bdehi,il,il | depart,turn right,end of road left,arrive | ,right:false right:false right:true right:true;left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| c,l | cb,bdehi,il,il | depart,turn left,end of road left,arrive | ,left:false left:false left:true left:true;left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
| c,j | cb,bdehi,ij,ij | depart,turn left,end of road right,arrive | ,left:true left:true left:false left:false;left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
@anticipate
Scenario: Anticipate Lanes for turns with through before and after
@@ -431,11 +431,11 @@ Feature: Turn Lane Guidance
| jk | | bot | primary | yes |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | top,main,main,top,top | depart,turn right,use lane straight,turn left,arrive | ,straight:false right:false right:true right:true,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| a,k | top,main,main,bot,bot | depart,turn right,use lane straight,turn right,arrive | ,straight:false right:true right:true right:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
| c,i | bot,main,main,top,top | depart,turn left,use lane straight,turn left,arrive | ,left:false left:true left:true straight:false,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| c,k | bot,main,main,bot,bot | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false straight:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
| waypoints | route | turns | lanes |
| a,i | top,main,top,top | depart,turn right,turn left,arrive | ,straight:false right:true right:true right:true;;left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| a,k | top,main,bot,bot | depart,turn right,turn right,arrive | ,straight:false right:true right:true right:true;;left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
| c,i | bot,main,top,top | depart,turn left,turn left,arrive | ,left:true left:true left:true straight:false;;left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| c,k | bot,main,bot,bot | depart,turn left,turn right,arrive | ,left:true left:true left:true straight:false;;left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
@anticipate
Scenario: Anticipate Lanes for turn between throughs
@@ -462,8 +462,8 @@ Feature: Turn Lane Guidance
| dt | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | main,main,main,main | depart,use lane straight,continue right,arrive | ,left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true, |
| waypoints | route | turns | lanes |
| a,e | main,main,main | depart,continue right,arrive | ;left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true;left:false straight:true straight:true, |
@anticipate @todo @2661
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
@@ -520,8 +520,8 @@ Feature: Turn Lane Guidance
| df | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
| waypoints | route | turns | lanes | intersection_lanes |
| a,f | ab,df,df | depart,roundabout-exit-1,arrive | ,, | |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
@@ -553,8 +553,8 @@ Feature: Turn Lane Guidance
| fy | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,, |
| waypoints | route | turns | lanes |
| a,h | ab,gh,gh,gh | depart,roundabout-exit-5,exit roundabout right,arrive | ,;;;;,, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
@@ -569,22 +569,22 @@ Feature: Turn Lane Guidance
| nodes | turn:lanes:forward | highway | junction | name |
| xb | slight_right\|slight_right | primary | | xb |
| dy | | primary | | dy |
| ab | | primary | roundabout | roundabout |
| bc | | primary | roundabout | roundabout |
| cd | left\|slight_right | primary | roundabout | roundabout |
| da | | primary | roundabout | roundabout |
| ab | | primary | roundabout | rotary |
| bc | | primary | roundabout | rotary |
| cd | left\|slight_right | primary | roundabout | rotary |
| da | | primary | roundabout | rotary |
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy,dy | depart,rotary-exit-1,exit rotary right,arrive | ,,, |
| x,c | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,, |
| x,a | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,;, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
Given the profile file "car" extended with
Given the profile file "car" initialized with
"""
properties.left_hand_driving = true
profile.left_hand_driving = true
"""
And the node map
"""
@@ -614,8 +614,8 @@ Feature: Turn Lane Guidance
| fy | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ab,ch,ch | depart,roundabout-exit-5,arrive | ,, |
| waypoints | route | turns | lanes |
| a,h | ab,ch,ch,ch | depart,roundabout-exit-5,exit roundabout left,arrive | ,;;;;,, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
@@ -623,40 +623,11 @@ Feature: Turn Lane Guidance
"""
/a\
x b d y
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
|
|
|
|
|
|
|
|
\ /
c
"""
@@ -664,16 +635,16 @@ Feature: Turn Lane Guidance
| nodes | turn:lanes:forward | highway | junction | name |
| xb | slight_right\|slight_right | primary | | xb |
| dy | | primary | | dy |
| ab | | primary | roundabout | roundabout |
| bc | | primary | roundabout | roundabout |
| cd | left\|slight_right | primary | roundabout | roundabout |
| da | | primary | roundabout | roundabout |
| ab | | primary | roundabout | rotary |
| bc | | primary | roundabout | rotary |
| cd | left\|slight_right | primary | roundabout | rotary |
| da | | primary | roundabout | rotary |
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy,dy | depart,rotary-exit-1,exit rotary right,arrive | ,,, |
| x,c | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,, |
| x,a | xb,rotary,rotary | depart,rotary-exit-undefined,arrive | ,;, |
@anticipate @todo @2032
Scenario: No Lanes for Roundabouts, see #2626
@@ -789,13 +760,6 @@ Feature: Turn Lane Guidance
Given the node map
"""
a b x
|
|
|
|
|
|
|
|
|
|
@@ -816,18 +780,16 @@ Feature: Turn Lane Guidance
| dy | | YSt |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
| waypoints | route | turns | lanes |
| a,e | MySt,MySt,MySt,MySt | depart,continue right,continue right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
@anticipate
Scenario: Don't Overdo It
Given the node map
"""
q r s t u v
| | | | | |
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
| | | | | | |
p o n m l k j
q r s t u v
a - - b - - c - - d - - e - - f - g - h - i
p o n m l k j
"""
And the ways
@@ -849,6 +811,35 @@ Feature: Turn Lane Guidance
| hj | 7th | | no |
When I route I should get
| waypoints | route | turns | locations | lanes |
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
| waypoints | route | turns | locations | lanes |
| a,i | road,road | depart,arrive | a,i | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:false;none:true none:true right:false, |
| a,j | road,7th,7th | depart,turn right,arrive | a,h,j | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:false none:false none:true;left:false none:false none:false none:true,none:false none:false right:true, |
@anticipate
Scenario: Oak St, Franklin St
Given a grid size of 10 meters
Given the node map
"""
g
. . f
. d `
e ` .
.
.
. . c
. b `
a `
"""
And the ways
| nodes | name | turn:lanes | oneway | highway |
| ab | Oak St | left\|left\|left | yes | secondary |
| cb | Oak St | right | yes | tertiary |
| bd | Franklin St | left;through\|through\|through;right\|right | yes | secondary |
| dg | Franklin St | | yes | secondary |
| edf | Fell St | | | secondary |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | Oak St,Franklin St,Fell St,Fell St | depart,turn left,turn right,arrive | ,left:false left:true left:true,straight;left:false straight:false straight;right:true right:true, |
+5 -5
View File
@@ -22,11 +22,11 @@ Feature: Bike - Mode flag
| c | traffic_signals |
And the ways
| nodes | highway | name | oneway:bicycle |
| abcd | cycleway | street | |
| eb | path | | yes |
| icef | tertiary | road | |
| geh | secondary | street | |
| nodes | highway | name | oneway:bicycle | maxspeed:forward |
| abcd | cycleway | street | | 4 km/h |
| eb | path | | yes | |
| icef | tertiary | road | | 4 km/h |
| geh | secondary | street | | |
When I route I should get
| waypoints | route | turns |
@@ -98,11 +98,11 @@ Feature: Car - Guidance - Bridges and Tunnels
| dce | primary | | Nebenstraße |
When I route I should get
| from | to | route | turns |
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,arrive |
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,arrive |
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
| from | to | route | turns |
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road left,arrive |
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road right,arrive |
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
Scenario: Tunnel with Immediate Turn Front and Back
Given the node map
@@ -129,4 +129,3 @@ Feature: Car - Guidance - Bridges and Tunnels
| e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn left,arrive |
| d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn right,arrive |
| d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn left,arrive |
+17 -257
View File
@@ -1,5 +1,8 @@
@routing @guidance
Feature: Rotary
Feature: Circular
# Circular tags are treated just as rotaries. We can rely on the rotary tests for their handling on special cases.
# Here we only ensure that the `circular` tag is handled and assigned a rotary type
Background:
Given the profile "car"
@@ -24,259 +27,16 @@ Feature: Rotary
| bgecb | circular |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
Scenario: Only Enter
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
Scenario: Only Exit
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | circular |
When I route I should get
| waypoints | route | turns |
| b,c | bcegb,bcegb | depart,arrive |
| b,e | bcegb,bcegb | depart,arrive |
| b,g | bcegb,bcegb | depart,arrive |
| c,e | bcegb,bcegb | depart,arrive |
| c,g | bcegb,bcegb | depart,arrive |
| c,b | bcegb,bcegb | depart,arrive |
| e,g | bcegb,bcegb | depart,arrive |
| e,b | bcegb,bcegb | depart,arrive |
| e,c | bcegb,bcegb | depart,arrive |
| g,b | bcegb,bcegb | depart,arrive |
| g,c | bcegb,bcegb | depart,arrive |
| g,e | bcegb,bcegb | depart,arrive |
#needs to be adjusted when name-discovery works for entrys
Scenario: Mixed Entry and Exit
Given the node map
"""
c a
j b f
k e
l h d
g i
"""
And the ways
| nodes | junction | oneway |
| abc | | yes |
| def | | yes |
| ghi | | yes |
| jkl | | yes |
| bkheb | circular | yes |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
| d,f | def,def,def | depart,rotary-exit-1,arrive |
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
b
c d f
e
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
d
b c f
e
"""
And the ways
| nodes | junction |
| ad | |
| bcdb | circular |
| be | |
| cf | |
When I route I should get
| waypoints | route | turns |
| a,e | ad,be,be | depart,bcdb-exit-1,arrive |
| a,f | ad,cf,cf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
a
c
d b f
e
"""
And the ways
| nodes | junction |
| ac | |
| bcdb | circular |
| de | |
| bf | |
When I route I should get
| waypoints | route | turns |
| a,e | ac,de,de | depart,bcdb-exit-1,arrive |
| a,f | ac,bf,bf | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
f
d c e
b
a
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
"""
f
d c e
b
a
"""
And the ways
| nodes | junction |
| ab | |
| bcdb | circular |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,bcdb-exit-1,arrive |
| a,f | ab,df,df | depart,bcdb-exit-2,arrive |
| waypoints | route | turns |
| a,d | ab,cd,cd,cd | depart,bgecb-exit-3,exit rotary right,arrive |
| a,f | ab,ef,ef,ef | depart,bgecb-exit-2,exit rotary right,arrive |
| a,h | ab,gh,gh,gh | depart,bgecb-exit-1,exit rotary right,arrive |
| d,f | cd,ef,ef,ef | depart,bgecb-exit-3,exit rotary right,arrive |
| d,h | cd,gh,gh,gh | depart,bgecb-exit-2,exit rotary right,arrive |
| d,a | cd,ab,ab,ab | depart,bgecb-exit-1,exit rotary right,arrive |
| f,h | ef,gh,gh,gh | depart,bgecb-exit-3,exit rotary right,arrive |
| f,a | ef,ab,ab,ab | depart,bgecb-exit-2,exit rotary right,arrive |
| f,d | ef,cd,cd,cd | depart,bgecb-exit-1,exit rotary right,arrive |
| h,a | gh,ab,ab,ab | depart,bgecb-exit-3,exit rotary right,arrive |
| h,d | gh,cd,cd,cd | depart,bgecb-exit-2,exit rotary right,arrive |
| h,f | gh,ef,ef,ef | depart,bgecb-exit-1,exit rotary right,arrive |
+29
View File
@@ -147,3 +147,32 @@ Feature: Collapse
| waypoints | route | turns |
| a,d | road,left,left | depart,turn left,arrive |
| a,e | road,right,right | depart,turn right,arrive |
# https://www.openstreetmap.org/#map=18/53.89755/27.54306
Scenario: Wide turn into invalid u-turn
Given the node map
"""
g
|
|
f - - - - e
|
|
|
h - - d
|
|
|
a - - - - b - - - - c
"""
And the ways
| nodes | highway | name |
| abc | secondary | road |
| bdfg | service | |
| hd | service | |
| fe | service | |
When I route I should get
| waypoints | route | turns |
| c,e | road,,, | depart,turn right,turn right,arrive |
+109 -57
View File
@@ -35,20 +35,46 @@ Feature: Collapse
| waypoints | route | turns | locations |
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
| a,d | first,first | depart,arrive | a,d |
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
| e,h | first,first | depart,arrive | e,h |
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
| k,l | second,second | depart,arrive | k,l |
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
| i,j | second,second | depart,arrive | i,j |
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
Scenario: Segregated Intersection, Cross Belonging to Single Street
Given the node map
"""
g
c b a
d e f
h i
"""
And the ways
| nodes | highway | name | oneway |
| ab | primary | first | yes |
| bc | primary | first | yes |
| de | primary | first | yes |
| ef | primary | first | yes |
| gb | primary | second | no |
| be | primary | second | no |
| eh | primary | second | yes |
| ei | primary | third | yes |
When I route I should get
| waypoints | route | turns | locations |
| a,i | first,third,third | depart,turn sharp left,arrive | a,b,i |
Scenario: Segregated Intersection, Cross Belonging to Correct Street
Given the node map
@@ -80,20 +106,20 @@ Feature: Collapse
| waypoints | route | turns | locations |
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
| a,d | first,first | depart,arrive | a,d |
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
| e,h | first,first | depart,arrive | e,h |
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
| k,l | second,second | depart,arrive | k,l |
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
| i,j | second,second | depart,arrive | i,j |
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets
Given the node map
@@ -125,20 +151,20 @@ Feature: Collapse
| waypoints | route | turns | locations |
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
| a,d | first,first | depart,arrive | a,d |
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
| e,h | first,first | depart,arrive | e,h |
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
| k,l | second,second | depart,arrive | k,l |
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
| i,j | second,second | depart,arrive | i,j |
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
Scenario: Partly Segregated Intersection, Two Segregated Roads
Given the node map
@@ -183,11 +209,11 @@ Feature: Collapse
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
| g,j | second,second | depart,arrive | g,j |
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
| g,f | second,first,first | depart,turn left,arrive | g,b,f |
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
| i,h | second,second | depart,arrive | i,h |
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
| i,c | second,first,first | depart,turn left,arrive | i,e,c |
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
@@ -237,11 +263,11 @@ Feature: Collapse
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
| g,j | second,second | depart,arrive | g,j |
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
| g,f | second,first,first | depart,turn left,arrive | g,b,f |
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
| i,h | second,second | depart,arrive | i,h |
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
| i,c | second,first,first | depart,turn left,arrive | i,e,c |
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles
@@ -274,20 +300,20 @@ Feature: Collapse
| waypoints | route | turns | locations |
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
| a,d | first,first | depart,arrive | a,d |
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
| e,h | first,first | depart,arrive | e,h |
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
| k,l | second,second | depart,arrive | k,l |
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
| i,j | second,second | depart,arrive | i,j |
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2)
Given the node map
@@ -319,28 +345,29 @@ Feature: Collapse
| waypoints | route | turns | locations |
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
| a,d | first,first | depart,arrive | a,d |
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
| a,h | first,first,first | depart,continue uturn,arrive | a,b,h |
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
| e,h | first,first | depart,arrive | e,h |
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
| e,l | first,second,second | depart,turn left,arrive | e,f,l |
| e,d | first,first,first | depart,continue uturn,arrive | e,f,d |
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
| k,l | second,second | depart,arrive | k,l |
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
| k,d | second,first,first | depart,turn left,arrive | k,g,d |
| k,j | second,second,second | depart,continue uturn,arrive | k,g,j |
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
| i,j | second,second | depart,arrive | i,j |
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
| i,h | second,first,first | depart,turn left,arrive | i,c,h |
| i,l | second,second,second | depart,continue uturn,arrive | i,c,l |
Scenario: Entering a segregated road
Given the node map
"""
a f g
| | . '
b-e '
/ /
h
a f | g
| | i '
b-e ' |
/ / j
/ /
c d
"""
@@ -350,7 +377,8 @@ Feature: Collapse
| abc | primary | first | yes |
| def | primary | first | yes |
| be | primary | first | no |
| ge | primary | second | no |
| gie | primary | second | no |
| hij | primary | maple | no |
When I route I should get
| waypoints | route | turns | locations |
@@ -359,7 +387,7 @@ Feature: Collapse
| a,g | first,second,second | depart,turn left,arrive | a,b,g |
| d,g | first,second,second | depart,turn right,arrive | d,e,g |
| g,f | second,first,first | depart,turn right,arrive | g,e,f |
| g,c | second,first,first | depart,turn left,arrive | g,e,c |
| g,c | second,first,first | depart,end of road left,arrive | g,e,c |
Scenario: Do not collapse turning roads
Given the node map
@@ -577,7 +605,7 @@ Feature: Collapse
When I route I should get
| waypoints | route | turns | locations |
| i,h | in,road,road | depart,turn left,arrive | i,f,h |
| i,h | in,road,road | depart,turn slight left,arrive | i,c,h |
| a,d | road,road | depart,arrive | a,d |
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j |
@@ -628,9 +656,9 @@ Feature: Collapse
| cf | secondary | bottom |
When I route I should get
| waypoints | turns | route | locations |
| a,d | depart,continue right,turn right,arrive | road,road,road,road | a,b,c,d |
| d,a | depart,continue left,turn left,arrive | road,road,road,road | d,c,b,a |
| waypoints | turns | route | locations |
| a,d | depart,continue right,continue right,arrive | road,road,road,road | a,b,c,d |
| d,a | depart,continue left,continue left,arrive | road,road,road,road | d,c,b,a |
Scenario: Forking before a turn
Given the node map
@@ -807,8 +835,8 @@ Feature: Collapse
| di | | off |
When I route I should get
| waypoints | route | turns | locations |
| a,e | main,main,main | depart,use lane straight,arrive | a,c,e |
| waypoints | route | turns | locations | lanes |
| a,e | main,main | depart,arrive | a,e | ;left:false straight:false straight:true straight:false right:false;left:false straight:true right:false, |
Scenario: But _do_ collapse UseLane step when lanes stay the same
Given the node map
@@ -984,7 +1012,7 @@ Feature: Collapse
| f,j | hohe,hohe | depart,arrive | f,j |
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
| f,e | | | |
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j |
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,i,j |
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
Scenario: Forking before a turn (forky)
@@ -1074,3 +1102,27 @@ Feature: Collapse
When I route I should get
| waypoints | bearings | route | turns | locations |
| 1,2 | 90 270 | ab,bd,bd,ab,ab | depart,turn left,continue uturn,turn right,arrive | _,b,d,b,_ |
# https://www.openstreetmap.org/#map=18/37.74844/-122.40275
Scenario: Don't use destinations as names
Given the node map
"""
f - - - - e - - - - d
|
|
|
|
|
a - - - - b - - - - c
"""
And the ways
| nodes | highway | name | oneway | destination:ref |
| abc | residential | road | yes | |
| def | motorway_link | | yes | US 101 |
| be | residential | cross | no | |
When I route I should get
| waypoints | route | turns |
| a,f | road,cross,, | depart,turn left,on ramp left,arrive |
+55
View File
@@ -22,6 +22,40 @@ Feature: Continue Instructions
| a,c | abc,abc,abc | depart,continue left,arrive |
| a,d | abc,bd,bd | depart,turn straight,arrive |
Scenario: Road turning left, Suffix changes
Given the node map
"""
c
a - b-d
"""
And the ways
| nodes | highway | name |
| ab | primary | North Capitol Northeast |
| bc | primary | North Capitol Northwest |
| bd | primary | some random street |
When I route I should get
| waypoints | route | turns |
| a,c | North Capitol Northeast,North Capitol Northwest,North Capitol Northwest | depart,continue left,arrive |
Scenario: Road turning left, Suffix changes, no-spaces
Given the node map
"""
c
a - b-d
"""
And the ways
| nodes | highway | name |
| ab | primary | North CapitolNortheast |
| bc | primary | North CapitolNorthwest |
| bd | primary | some random street |
When I route I should get
| waypoints | route | turns |
| a,c | North CapitolNortheast,North CapitolNorthwest,North CapitolNorthwest | depart,continue left,arrive |
Scenario: Road turning left and straight
Given the node map
"""
@@ -136,3 +170,24 @@ Feature: Continue Instructions
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
# continuing right here, since the turn to the left is more expensive
| a,e | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
Scenario: End-Of-Road Continue
Given the node map
"""
a - b - c
|
d - e
|
f
"""
And the ways
| nodes | highway | name |
| abc | primary | road |
| bdf | primary | road |
| ed | primary | turn |
When I route I should get
| waypoints | route | turns |
| e,a | turn,road,road,road | depart,turn right,continue left,arrive |
+160 -7
View File
@@ -687,7 +687,7 @@ Feature: Slipways and Dedicated Turn Lanes
When I route I should get
| waypoints | route | turns | locations |
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive | s,a,e,f |
| s,f | sabc,ae,dbef,dbef | depart,fork slight right,turn right,arrive | s,a,e,f |
@sliproads
Scenario: Traffic Signal on Sliproad
@@ -863,8 +863,8 @@ Feature: Slipways and Dedicated Turn Lanes
| af | primary | sliproad | yes |
When I route I should get
| waypoints | route | turns | locations |
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive | s,a,f,g |
| waypoints | route | turns | locations |
| s,g | main,sliproad,another,another | depart,turn right,turn slight left,arrive | s,a,f,g |
@sliproads:
Scenario: Throughabout-Sliproad
@@ -905,8 +905,8 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | yb | be | b | only_straight |
When I route I should get
| waypoints | route | turns | locations |
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
| waypoints | route | turns | locations |
| z,t | through,,out,out,out | depart,off ramp slight right,round-exit-3,exit rotary right,arrive | z,s,c,e,t |
Scenario: Sliproad before a roundabout
Given the node map
@@ -942,5 +942,158 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | bc | cd | c | only_straight |
When I route I should get
| waypoints | route | turns | locations |
| a,k | road,,, | depart,turn right,roundabout turn right exit-1,arrive | a,b,h,k |
| waypoints | route | turns | locations |
| a,k | road,,, | depart,turn right,roundabout turn right exit-1,arrive | a,b,h,k |
@sliproads
Scenario: Sliproad with 4 roads at target
Given the node map
"""
d
.
s . a . b . c . t
` . '
` . '
'.'
e
.
f
"""
And the ways
| nodes | highway | name | oneway |
| sabct | primary | sabct | |
| dbef | primary | dbef | |
| ae | primary_link | ae | yes |
| ec | primary_link | ec | yes |
When I route I should get
| waypoints | route | turns | locations |
| s,f | sabct,dbef,dbef | depart,turn right,arrive | s,a,f |
| f,t | dbef,sabct,sabct | depart,turn right,arrive | f,e,t |
@sliproads
Scenario: Sliproad and acute angle (50°) at the main intersection
Given the node map
"""
d
/
s . a . . b . c
` /
' /
e
/
f
"""
And the ways
| nodes | highway | name | oneway |
| sabc | primary | sabc | |
| dbef | primary | dbef | |
| ae | primary_link | ae | yes |
When I route I should get
| waypoints | route | turns | locations |
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
@sliproads
Scenario: Sliproad from link via link to primary
Given the node map
"""
d
.
s . a . b
` .
` .
'.
c
.
f
"""
And the ways
| nodes | highway | name | oneway |
| sab | primary_link | sab | |
| dbcf | primary | dbcf | |
| ac | primary_link | ae | yes |
When I route I should get
| waypoints | route | turns | locations |
| s,f | sab,dbcf,dbcf | depart,turn right,arrive | s,a,f |
@sliproads
Scenario: Sliproad with a single intersection in a cross-road
Given the node map
"""
d
.
s . a . b
` .
' c . g
..
e
.
f
"""
And the ways
| nodes | highway | name | oneway |
| sab | primary | sab | |
| dbcef | primary | dbcef | |
| ae | primary_link | sab | yes |
| cg | primary | cg | |
When I route I should get
| waypoints | route | turns | locations |
| s,f | sab,dbcef,dbcef | depart,turn right,arrive | s,a,f |
@sliproads
Scenario: Sliproad converted from a fork
Given the node map
"""
d
.
b
s . a '.
`c
.
f
"""
And the ways
| nodes | highway | name | ref | oneway |
| sa | tertiary | | D 60A | yes |
| ab | tertiary | ab | D 60A | yes |
| ac | tertiary | | D 60A | yes |
| dbcf | tertiary | dbcf | D 543 | yes |
When I route I should get
| waypoints | route | turns | locations |
| s,f | ,dbcf,dbcf | depart,turn right,arrive | s,a,f |
@sliproads
Scenario: Sliproad to a road with a reference only
Given the node map
"""
s . a . b . d
` .
' .
..
c
.
f
"""
And the ways
| nodes | highway | name | ref | oneway |
| sabd | primary | road | | |
| bcf | primary | | K108 | |
| ac | primary_link | | | yes |
When I route I should get
| waypoints | route | turns | locations |
| s,f | road,, | depart,turn right,arrive | s,a,f |
+139
View File
@@ -0,0 +1,139 @@
@routing @guidance
Feature: Divided road entry
Background:
Given the profile "car"
Given a grid size of 5 meters
Scenario: Join on a divided road named after the main road
Given the node map
"""
a-------b-----c
|
d-------e-----f
|
|
i---g---j
|
|
h
"""
And the ways
| nodes | name | highway | oneway |
| abc | main st | residential | -1 |
| def | main st | residential | yes |
| be | main st | residential | |
| egh | side st | residential | |
| igj | maple st | residential | |
When I route I should get
| waypoints | route | turns |
| h,a | side st,main st,main st| depart,end of road left,arrive |
# Similar to previous one, but the joining way is tagged with the side-street name
Scenario: Join on a divided road, named after the side street
Given the node map
"""
a-------b-----c
|
d-------e-----f
|
|
i---g---j
|
|
h
"""
And the ways
| nodes | name | highway | oneway |
| abc | main st | residential | -1 |
| def | main st | residential | yes |
| begh | side st | residential | |
| igj | maple st | residential | |
When I route I should get
| waypoints | route | turns |
| h,a | side st,main st,main st| depart,end of road left,arrive |
# Center join named after crossroad
Scenario: Crossing a divided road, named after side-street
Given the node map
"""
h
|
a-------b-----c
|
d-------e-----f
|
|
g
"""
And the ways
| nodes | name | highway | oneway |
| abc | main st | residential | -1 |
| def | main st | residential | yes |
| hbeg | side st | residential | |
When I route I should get
| waypoints | route | turns |
| g,a | side st,main st,main st| depart,turn left,arrive |
# Join named after divided road
Scenario: Crossing a divided road, named after main street
Given the node map
"""
h
|
a-------b-----c
|
d-------e-----f
|
|
g
"""
And the ways
| nodes | name | highway | oneway |
| abc | main st | residential | -1 |
| def | main st | residential | yes |
| be | main st | residential | |
| hb | side st | residential | |
| eg | side st | residential | |
When I route I should get
| waypoints | route | turns |
| g,a | side st,main st,main st| depart,turn left,arrive |
# Verify end of road left turn across divided roads
Scenario: Join on a divided road, named after the side street
Given the node map
"""
a-----h--b-----c
| |
d-----i--e-----f
| |
| |
m---j--g---n
| |
| |
k l
"""
And the ways
| nodes | name | highway | oneway |
| ahbc | main st | residential | -1 |
| dief | main st | residential | yes |
| begl | side st | residential | -1 |
| hijk | side st | residential | yes |
| mjgn | maple st| residential | no |
When I route I should get
| waypoints | route | turns |
| l,a | side st,main st,main st| depart,end of road left,arrive |
+20
View File
@@ -46,3 +46,23 @@ Feature: Driveways intersections
When I route I should get
| waypoints | route | turns | locations |
| a,d | ,second | depart,arrive | a,d |
Scenario: Road with a turn to service road
Given the node map
"""
/-----------------e
a---b------------------c
`-----------------d
"""
And the ways
| nodes | highway | name | oneway |
| abc | trunk | road | yes |
| bd | service | serv | yes |
| be | service | serv | yes |
When I route I should get
| waypoints | route | turns | locations |
| a,d | road,serv,serv | depart,turn slight right,arrive | a,b,d |
| a,e | road,serv,serv | depart,turn slight left,arrive | a,b,e |
+19
View File
@@ -24,6 +24,25 @@ Feature: End Of Road Instructions
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
# http://map.project-osrm.org/?z=18&center=38.906632%2C-77.008265&loc=38.906463%2C-77.007621&loc=38.906822%2C-77.008860&hl=en&alt=0
Scenario: End of Road, unnamed oneway
Given the node map
"""
c
a e b
f d
"""
And the ways
| nodes | highway | name | oneway |
| aeb | primary | road | yes |
| cbd | primary | | yes |
| ef | primary | turn | yes |
When I route I should get
| waypoints | route | turns |
| a,d | road,, | depart,end of road right,arrive |
@3605
Scenario: End of Road with oneway through street
Given the node map
+2 -2
View File
@@ -41,8 +41,8 @@ Feature: Exit Numbers and Names
| ef | motorway_link | ExitRamp | |
When I route I should get
| waypoints | route | turns | exits |
| a,f | MainRoad,ExitRamp,ExitRamp | depart,off ramp slight right,arrive | ,10;12, |
| waypoints | route | turns | exits |
| a,f | MainRoad,ExitRamp,ExitRamp | depart,off ramp slight right,arrive | ,10; 12, |
Scenario: Exit number on the ways after the motorway junction, multiple exits
@@ -0,0 +1,46 @@
@guidance
Feature: Internal Intersection Model
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Dual-carriage way intersection
Given the node map
"""
a b
| |
c--d--e--f
| |
g--h--i--j
| |
k l
"""
And the ways
| nodes | oneway | name |
| adhk | yes | Broken Land Parkway |
| lieb | yes | Broken Land Parkway |
| fed | yes | Snowden River Parkway |
| dc | yes | Patuxent Woods Drive |
| gh | yes | Patuxent Woods Drive |
| hij | yes | Snowden River Parkway |
When I route I should get
| waypoints | route | turns | # |
| a,k | Broken Land Parkway,Broken Land Parkway | depart,arrive ||
| l,b | Broken Land Parkway,Broken Land Parkway | depart,arrive ||
# | g,j | Patuxent Woods Drive,Snowden River Parkway,Snowden River Parkway | depart,continue,arrive | did not work as expected - might be another issue to handle in post process? |
# | f,c | Snowden River Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,continue,arrive | did not work as expected - might be another issue to handle in post process? |
| a,c | Broken Land Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,turn right,arrive ||
| g,k | Patuxent Woods Drive,Broken Land Parkway,Broken Land Parkway | depart,turn right,arrive ||
| l,j | Broken Land Parkway,Snowden River Parkway,Snowden River Parkway | depart,turn right,arrive ||
| f,b | Snowden River Parkway,Broken Land Parkway,Broken Land Parkway | depart,turn right,arrive ||
| a,j | Broken Land Parkway,Snowden River Parkway,Snowden River Parkway | depart,turn left,arrive ||
| g,b | Patuxent Woods Drive,Broken Land Parkway,Broken Land Parkway | depart,turn left,arrive ||
| l,c | Broken Land Parkway,Patuxent Woods Drive,Patuxent Woods Drive | depart,turn left,arrive ||
| f,k | Snowden River Parkway,Broken Land Parkway,Broken Land Parkway | depart,turn left,arrive ||
| a,b | Broken Land Parkway,Broken Land Parkway,Broken Land Parkway | depart,continue uturn,arrive ||
| g,c | Patuxent Woods Drive,Patuxent Woods Drive,Patuxent Woods Drive | depart,continue uturn,arrive ||
| l,k | Broken Land Parkway,Broken Land Parkway,Broken Land Parkway | depart,continue uturn,arrive ||
| f,j | Snowden River Parkway,Snowden River Parkway,Snowden River Parkway | depart,continue uturn,arrive ||
+4 -4
View File
@@ -140,9 +140,9 @@ Feature: Intersections Data
When I route I should get
| waypoints | route | intersections |
| e,f | ea,fb,fb | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:90 |
| e,g | ea,gc,gc | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:0 |
| e,h | ea,hd,hd | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330,true:90 false:210 true:330;true:270 |
| e,f | ea,fb,fb,fb | true:180;false:0 false:150 true:210;false:30 true:150 true:270;true:90 |
| e,g | ea,gc,gc,gc | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:30 true:180 false:330;true:0 |
| e,h | ea,hd,hd,hd | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:90 false:210 true:330;true:270 |
| e,2 | ea,abcda,abcda | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:327 +-1 |
| 1,g | abcda,gc,gc | true:214;false:30 true:150 true:270,true:30 true:180 false:330;true:0 |
| 1,g | abcda,gc,gc | true:214,false:30 true:150 true:270;true:30 true:180 false:330;true:0 |
| 1,3 | abcda,abcda | true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:214 |
+3 -3
View File
@@ -64,9 +64,9 @@ Feature: Exceptions for routing onto low-priority roads
| bc | service | |
When I route I should get
| waypoints | route | turns |
| e,c | service, | depart,arrive |
| c,e | ,service,service | depart,turn straight,arrive |
| waypoints | route | turns |
| e,c | service, | depart,arrive |
| c,e | ,service | depart,arrive |
Scenario: Straight onto low-priority
Given the node map
+232
View File
@@ -0,0 +1,232 @@
# The route results with #original are what the result should be if the maneuver tag is removed
@routing @guidance @maneuver
Feature: Maneuver tag support
Background:
Given the profile "car"
Given a grid size of 5 meters
Scenario: simple override #1
Given the node map
"""
a--b---c----d---e
|
g
|
h------i--------j
"""
And the ways
| nodes | name | oneway |
| abc | A Street | no |
| cde | B Street | no |
| cgi | C Street | no |
| hij | J Street | no |
And the relations
| type | way:from | node:via | way:to | maneuver | direction |
| maneuver | abc | c | cgi | turn | sharp_right |
| maneuver | hij | i | cde | turn | sharp_left |
| maneuver | abc | c | cde | turn | slight_left |
| maneuver | cde | c | cgi | turn | straight |
| manoeuvre| cgi | c | abc | turn | right |
And the relations
| type | way:from | node:via | way:to | manoeuvre | maneuver | direction |
| maneuver | cgi | c | cde | fork | turn | slight_right |
When I route I should get
| waypoints | route | turns |
# Testing directly connected from/to
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,turn left,arrive |
| b,g | A Street,C Street,C Street | depart,turn sharp right,arrive |
# Testing re-awakening suppressed turns
| a,e | A Street,B Street,B Street | depart,turn slight left,arrive |
| e,i | B Street,C Street,C Street | depart,turn straight,arrive |
| i,e | C Street,B Street,B Street | depart,fork slight right,arrive |
| i,a | C Street,A Street,A Street | depart,turn right,arrive |
Scenario: single via-way
Given the node map
""""
a--b---c----d---e
|
g
|
h------i--------j
"""
And the ways
| nodes | name | oneway |
| abc | A Street | no |
| cde | B Street | no |
| cgi | C Street | no |
| hi | J Street | no |
| ij | J Street | no |
And the relations
| type | way:from | way:via | way:to | node:via | maneuver | direction |
| maneuver | abc | cgi | ij | c | turn | sharp_right |
When I route I should get
| waypoints | route | turns |
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,turn left,arrive |
Scenario: multiple via-way
Given the node map
""""
a--b---c----d---e
|
g-----k
|
h------i--------j
"""
And the ways
| nodes | name | oneway |
| abc | A Street | no |
| cde | B Street | no |
| cg | C Street | no |
| gi | C Street | no |
| hi | J Street | no |
| ij | J Street | no |
| gk | G Street | no |
And the relations
| type | way:from | way:via | way:via | way:to | node:via | maneuver | direction |
| maneuver | abc | cg | gi | ij | c | turn | sharp_right |
When I route I should get
| waypoints | route | turns |
| a,j | A Street,C Street,J Street,J Street | depart,turn sharp right,end of road left,arrive |
Scenario: Use maneuver tag to announce a particular turn type
Given the node map
"""
f
*
*
*
*
*
*
*
*
*
t. .. * h
.. ....m** *
/ * *
/ * * *
/
/
|
|
\
\
o
"""
And the ways
| nodes | name | oneway | highway |
| fm | CA-120 | no | secondary |
| mh | CA-120 | no | secondary |
| mt | Priest Rd | no | unclassified |
| mo | | no | service |
And the relations
| type | way:from | node:via | way:to | maneuver | direction |
| maneuver | mh | m | mt | turn | left |
When I route I should get
| waypoints | route | turns |
| h,t | CA-120,Priest Rd,Priest Rd | depart,turn left,arrive |
#original | h,t | CA-120,Priest Rd,Priest Rd | depart,turn straight,arrive |
Scenario: Use maneuver tag to announce lane guidance
Given a grid size of 10 meters
Given the node map
"""
ad
/ \
/ \
/ \
| |
| |
| |
b-----c------e
| |
| |
| |
| |
r w
"""
And the ways
| nodes | name | oneway | highway |
| ab | Marsh Rd | yes | secondary |
| br | Marsh Rd | yes | secondary |
| cd | Marsh Rd | yes | secondary |
| cw | Marsh Rd | yes | secondary |
| bc | service | no | service |
| ce | service | no | service |
And the relations
| type | way:from | node:via | way:via | way:to | maneuver |
| maneuver | ab | c | bc | cd | uturn |
| maneuver | ab | b | bc | cd | suppress |
When I route I should get
| waypoints | route | turns |
| a,d | Marsh Rd,Marsh Rd,Marsh Rd | depart,turn uturn,arrive |
#original | a,d | Marsh Rd,service,Marsh Rd,Marsh Rd | depart,turn left,turn left,arrive |
Scenario: Use maneuver tag to suppress a turn
Given the node map
"""
c
|
|
v---y----------z
|
n---p----------k
|\
| \
b t
"""
And the ways
| nodes | name | oneway | highway |
| zy | NY Ave | yes | primary |
| yv | NY Ave | yes | primary |
| np | NY Ave | yes | primary |
| pk | NY Ave | yes | primary |
| cp | 4th St | no | tertiary |
| yp | | no | motorway_link |
| pb | 4th St | no | primary |
| pt | 395 | no | primary |
And the relations
| type | way:from | node:via | way:via | way:to | maneuver | # |
| maneuver | zy | p | yp | pt | suppress | original: depart,on ramp left,fork slight left,arrive |
And the relations
| type | way:from | way:via | way:to | maneuver | # |
| maneuver | zy | yp | pb | suppress | invalid relation: missing node:via |
And the relations
| type | node:via | way:via | way:to | maneuver | # |
| maneuver | p | yp | pb | suppress | invalid relation: missing way:from |
And the relations
| type | way:from | node:via | way:via | maneuver | # |
| maneuver | zy | p | yp | suppress | invalid relation: missing way:to |
And the relations
| type | way:from | node:via | way:via | way:to | maneuver | # |
| maneuver | zy | y, p | yp | pb | suppress | invalid relation: multiple node:via |
When I route I should get
| waypoints | route | turns |
| z,t | NY Ave,395,395 | depart,on ramp left,arrive |
| z,b | NY Ave,,4th St,4th St | depart,on ramp left,fork slight right,arrive |
+207 -19
View File
@@ -354,9 +354,9 @@ Feature: Merge Segregated Roads
| hb | road | yes |
When I route I should get
| waypoints | turns | route | intersections |
| waypoints | turns | route | intersections |
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
| c,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
| c,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
| 1,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
| g,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
@@ -384,40 +384,53 @@ Feature: Merge Segregated Roads
| cd | right | no |
When I route I should get
| waypoints | route | intersections |
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
| waypoints | route | intersections |
| a,d | left,circle,right,right | true:90,false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
Scenario: Middle Island
Given the node map
"""
a
|
b
b-----z
/ \
c h
| |
| |
| |
| |
| |
| |
| |
| |
| |
d g
\ /
e
|
f
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bcde | road | yes |
| eghb | road | yes |
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bcde | road | yes |
| eghb | road | yes |
| bz | cross | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bz | bcde | b | no_left_turn |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | road,road |
| c,f | depart,arrive | road,road |
| f,a | depart,arrive | road,road |
| g,a | depart,arrive | road,road |
| waypoints | turns | route |
| a,f | depart,arrive | road,road |
| c,f | depart,arrive | road,road |
| f,a | depart,arrive | road,road |
| g,a | depart,arrive | road,road |
| z,a | depart,turn right,arrive | cross,road,road |
Scenario: Traffic Island
Given the node map
@@ -518,8 +531,183 @@ Feature: Merge Segregated Roads
# the goal here should be not to mention the intersection in the middle at all and also suppress the segregated parts
When I route I should get
| waypoints | route | intersections |
| waypoints | route | intersections |
| a,l | horiz,vert,vert | true:90;false:0 true:60 true:90 true:180 false:270,true:60 false:120 false:240 false:300,true:0 false:90 false:180 false:240 true:270;true:180 |
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,false:60 false:120 false:240 true:300,false:0 false:90 false:120 true:180 true:270;true:90 |
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
Scenario: Square Area - Don't merge almost circular roads
Given a grid size of 2 meters
Given the node map
"""
i
b `
` ` p .
a ` g` ` \ f
\ / o /
\ / \ /
h - - c n /
\ \/
k e
\ /
l /
\ /
m . d
/
j
"""
And the ways
| nodes | name | oneway |
| ac | Halenseestraße | yes |
| gb | Halenseestraße | yes |
| cklmdenopgc | Rathenauplatz | yes |
| ig | Kurfürstendamm | yes |
| ef | Kurfürstendamm | yes |
| ch | Hubertusallee | yes |
| jd | Hubertusallee | yes |
When I route I should get
| waypoints | route | turns |
| i,h | Kurfürstendamm,Rathenauplatz,Hubertusallee,Hubertusallee | depart,turn right,turn right,arrive |
# https://www.openstreetmap.org/#map=19/52.46339/13.40272
Scenario: Do not merge links between segregated roads
Given the node map
"""
f
`````````` ..............
` ` ` ` e - - - - - - - d
a 1
```````````.............. |
`````````` b - - - - - - - c
|
|
|
|
g
"""
And the ways
| nodes | name | oneway |
| ab | germ | yes |
| bc | ober | yes |
| de | ober | yes |
| ef | germ | yes |
| eb | germ | no |
| gb | germ | no |
When I route I should get
| waypoints | route | turns |
| a,c | germ,ober | depart,arrive |
| a,g | germ,germ,germ | depart,continue right,arrive |
| a,1 | germ,germ,germ | depart,continue left,arrive |
| d,g | ober,germ,germ | depart,turn left,arrive |
# https://www.openstreetmap.org/#map=19/51.32888/6.57059
Scenario: Places in presence of oneways
Given the node map
"""
i l
| |
| |
g - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - f
| |
| |
a - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - c - - - d
| |
| |
j k
"""
And the ways
| nodes | name | oneway |
| ab | schwert | yes |
| cd | schwert | yes |
| ig | luise | yes |
| bj | luise | yes |
| kc | marianne | yes |
| fl | marianne | yes |
| bc | albrecht | no |
| fg | albrecht | no |
| gb | albrecht | yes |
| cf | albrecht | yes |
When I route I should get
| waypoints | route | turns |
| a,l | schwert,albrecht,marianne,marianne | depart,new name straight,turn left,arrive |
| a,j | schwert,luise,luise | depart,turn right,arrive |
| a,1 | schwert,albrecht,albrecht,albrecht | depart,new name straight,continue uturn,arrive |
| k,l | marianne,marianne | depart,arrive |
| k,j | marianne,albrecht,luise,luise | depart,turn left,turn left,arrive |
| k,d | marianne,schwert,schwert | depart,turn right,arrive |
| i,j | luise,luise | depart,arrive |
| i,d | luise,albrecht,schwert | depart,turn left,arrive |
| i,l | luise,albrecht,marianne,marianne | depart,turn left,turn left,arrive |
# https://www.openstreetmap.org/#map=19/52.46339/13.40272
Scenario: Do not merge links between segregated roads
Given the node map
"""
d
f............... |
`````````` .............. |
a............... ` ` ` ` e
``````````.............. 1
`````````` b
- - - - - - - c
"""
And the ways
| nodes | name | oneway |
| ab | otto | yes |
| bc | otto | no |
| de | neu | no |
| ef | otto | yes |
| eb | otto | no |
When I route I should get
| waypoints | route | turns | # |
| a,c | otto,otto | depart,arrive | |
| a,f | otto,otto,otto | depart,continue uturn,arrive | |
| a,1 | otto,otto,otto | depart,continue left,arrive | |
| a,d | otto,neu,neu | depart,turn left,arrive | |
| c,1 | otto,otto | depart,arrive | |
| c,f | otto,otto,otto | depart,continue left,arrive | Ideally, this would be depart,arrive, but the obvious discovery making the turn onto `1` from `c` obvious interferes here |
# https://www.openstreetmap.org/#map=18/50.94608/7.02030
Scenario: Do not merge oneway places
Given the node map
"""
j
|
|
g - f - - - - - - - e
| |
| |
| d
| \
| .c.
a - - - - - - b` `
| `
| ` h
|
|
i
"""
And the ways
| nodes | name | oneway |
| efabc | kobe | yes |
| edc | kobe | no |
| fg | arn | no |
| ia | kobu | yes |
| hc | wei | no |
| ej | wei | no |
When I route I should get
| waypoints | route | turns |
| j,h | wei,wei | depart,arrive |
| a,d | kobe,kobe,kobe | depart,continue left,arrive |
+21
View File
@@ -126,3 +126,24 @@ Feature: Merging
When I route I should get
| waypoints | route | turns |
| d,c | ,A100,A100 | depart,merge slight right,arrive |
# https://www.openstreetmap.org/way/254299122
@merge
Scenario: Merge onto a motorway with junction references
Given the node map
"""
a b c d
e f
"""
And the ways
| nodes | name | junction:ref | highway | oneway |
| abc | A100 | | motorway | yes |
| cd | A100 | 1A | motorway | yes |
| eb | | | motorway_link | yes |
| cf | | 1B | motorway_link | yes |
When I route I should get
| waypoints | route | turns |
| e,d | ,A100,A100 | depart,merge slight left,arrive |
+87 -3
View File
@@ -81,7 +81,7 @@ Feature: Motorway Guidance
"""
,g,e
,f,d
a-b-c
a-b-c
"""
And the ways
@@ -201,7 +201,7 @@ Feature: Motorway Guidance
| a,e | abcde,abcde | depart,arrive |
| f,e | fgc,abcde,abcde | depart,merge slight left,arrive |
| a,i | abcde,chi,chi | depart,off ramp slight right,arrive |
| f,i | fgc,chi,chi | depart,off ramp right,arrive |
| f,i | fgc,chi,chi | depart,off ramp slight right,arrive |
Scenario: On And Off Ramp Left
Given the node map
@@ -221,7 +221,7 @@ Feature: Motorway Guidance
| a,e | abcde,abcde | depart,arrive |
| f,e | fgc,abcde,abcde | depart,merge slight right,arrive |
| a,i | abcde,chi,chi | depart,off ramp slight left,arrive |
| f,i | fgc,chi,chi | depart,off ramp left,arrive |
| f,i | fgc,chi,chi | depart,off ramp slight left,arrive |
Scenario: Merging Motorways
Given the node map
@@ -261,3 +261,87 @@ Feature: Motorway Guidance
When I route I should get
| waypoints | route | turns |
| a,d | On,Hwy,Off,Off | depart,merge slight right,off ramp right,arrive |
#http://0.0.0.0:9966/?z=18&center=38.893323%2C-77.055117&loc=38.893551%2C-77.054833&loc=38.893112%2C-77.055536&hl=en&alt=0
Scenario: Merging with same name
Given the node map
"""
a - - -
> c - d
b
"""
And the ways
| nodes | name | ref | highway | oneway |
| ac | | US 50 | motorway | yes |
| bc | | I 66 | motorway | yes |
| cd | | US 50; I 66 | motorway | yes |
When I route I should get
| waypoints | route | turns |
| a,d | , | depart,arrive |
| b,d | , | depart,arrive |
Scenario: Ramp Exit with Lower Priority
Given the node map
"""
a-b-c-d-e
`--f-g
"""
And the ways
| nodes | highway | oneway |
| abcde | trunk | |
| bfg | primary_link | yes |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,bfg,bfg | depart,off ramp slight right,arrive |
# https://www.openstreetmap.org/node/67366428#map=18/33.64613/-84.44425
Scenario: Ramp Bifurcations should not be suppressed
Given the node map
"""
/-----------c /-----------e
a---b------------------d------------f
"""
And the ways
| nodes | highway | name | destination |
| ab | motorway | | |
| bc | motorway_link | | City 17 |
| bd | motorway_link | | |
| de | motorway_link | | Domestic Terminal;Camp Creek Parkway;Riverdale Road |
| df | motorway_link | | Montgomery |
When I route I should get
| waypoints | route | turns |
| a,c | ,, | depart,fork slight left,arrive |
| a,e | ,,, | depart,fork slight right,fork slight left,arrive |
| a,f | ,,, | depart,fork slight right,fork slight right,arrive |
# https://www.openstreetmap.org/#map=19/53.46186/-2.24509
Scenario: Highway Fork with a Link
Given the node map
"""
/-----------d
a-b-c------------e
\-----------f
"""
And the ways
| nodes | highway |
| abce | motorway |
| cf | motorway |
| cd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abce,cd,cd | depart,off ramp slight left,arrive |
| a,e | abce,abce | depart,arrive |
| a,f | abce,cf,cf | depart,turn slight right,arrive |
+19 -4
View File
@@ -274,8 +274,8 @@ Feature: New-Name Instructions
| bc | Central Expressway | US 75 | motorway |
When I route I should get
| waypoints | route | turns |
| a,c | North Central Expressway,Central Expressway,Central Expressway | depart,new name straight,arrive |
| waypoints | route | turns |
| a,c | North Central Expressway,Central Expressway | depart,arrive |
Scenario: Prefix Change
Given the node map
@@ -289,8 +289,8 @@ Feature: New-Name Instructions
| cb | Central Expressway | US 75 | motorway |
When I route I should get
| waypoints | route | turns |
| c,a | Central Expressway,North Central Expressway,North Central Expressway | depart,new name straight,arrive |
| waypoints | route | turns |
| c,a | Central Expressway,North Central Expressway | depart,arrive |
Scenario: No Name, Same Reference
Given the node map
@@ -382,6 +382,21 @@ Feature: New-Name Instructions
| waypoints | route | turns |
| a,c | , | depart,arrive |
Scenario: No Name, Reference changed
Given the node map
"""
a ----- b ----- c
"""
And the ways
| nodes | name | ref | highway |
| ab | | US 322 | motorway |
| bc | | US 422 | motorway |
When I route I should get
| waypoints | route | turns |
| a,c | ,, | depart,new name straight,arrive |
Scenario: Spaces in refs for containment check, #3086
Given the node map
"""
File diff suppressed because it is too large Load Diff
+34 -2
View File
@@ -36,6 +36,36 @@ Feature: Simple Turns
| f,a | depart,arrive | road,road | true:0,true:0 false:150 false:180;true:180 |
| e,a | depart,turn slight right,arrive | turn,road,road | true:333;true:0 false:150 false:180;true:180 |
Scenario: Turning into splitting road - no improvement
Given the node map
"""
a
b
/ |
c d - e
| |
| |
| |
| |
| |
| |
| |
| |
g f
"""
And the ways
| nodes | name | highway | oneway |
| ab | road | primary | no |
| bcg | road | primary | yes |
| fdb | road | primary | yes |
| ed | turn | primary | yes |
When I route I should get
| waypoints | turns | route | intersections |
| f,a | depart,arrive | road,road | true:0,true:0 false:90 false:180;true:180 |
| e,a | depart,turn right,arrive | turn,road,road | true:270;true:0 false:90 false:180;true:180 |
Scenario: Turning into splitting road
Given the node map
"""
@@ -97,5 +127,7 @@ Feature: Simple Turns
| ei | left | yes |
When I route I should get
| waypoints | route | turns |
| g,a | in,road,road | depart,fork right,arrive |
| waypoints | route | turns |
| g,a | in,road,road | depart,fork slight right,arrive |
| g,h | in,right,right | depart,fork straight,arrive |
| g,i | in,left,left | depart,fork slight left,arrive |
-177
View File
@@ -1,177 +0,0 @@
@routing @guidance
Feature: Rotary
Background:
Given the profile "bicycle"
Given a grid size of 30 meters
Scenario: Enter and Exit
Given the node map
"""
a
b
h g c d
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bgecb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,bgecb-exit-3,arrive |
| a,f | ab,ef,ef | depart,bgecb-exit-2,arrive |
| a,h | ab,gh,gh | depart,bgecb-exit-1,arrive |
| d,f | cd,ef,ef | depart,bgecb-exit-3,arrive |
| d,h | cd,gh,gh | depart,bgecb-exit-2,arrive |
| d,a | cd,ab,ab | depart,bgecb-exit-1,arrive |
| f,h | ef,gh,gh | depart,bgecb-exit-3,arrive |
| f,a | ef,ab,ab | depart,bgecb-exit-2,arrive |
| f,d | ef,cd,cd | depart,bgecb-exit-1,arrive |
| h,a | gh,ab,ab | depart,bgecb-exit-3,arrive |
| h,d | gh,cd,cd | depart,bgecb-exit-2,arrive |
| h,f | gh,ef,ef | depart,bgecb-exit-1,arrive |
Scenario: Only Enter
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,bcegb-exit-undefined,arrive |
Scenario: Only Exit
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| b,d | bcegb,cd,cd | depart,bcegb-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,bcegb-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,bcegb-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,bcegb-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,bcegb-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,bcegb-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,bcegb-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,bcegb-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,bcegb-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,bcegb-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,bcegb-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,bcegb-exit-3,arrive |
#phantom node snapping can result in a full round-trip here, therefore we cannot test b->a and the other direct exits
Scenario: Drive Around
Given the node map
"""
a
b
d c g h
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| b,c | bcegb,bcegb | depart,arrive |
| b,e | bcegb,bcegb | depart,arrive |
| b,g | bcegb,bcegb | depart,arrive |
| c,e | bcegb,bcegb | depart,arrive |
| c,g | bcegb,bcegb | depart,arrive |
| c,b | bcegb,bcegb | depart,arrive |
| e,g | bcegb,bcegb | depart,arrive |
| e,b | bcegb,bcegb | depart,arrive |
| e,c | bcegb,bcegb | depart,arrive |
| g,b | bcegb,bcegb | depart,arrive |
| g,c | bcegb,bcegb | depart,arrive |
| g,e | bcegb,bcegb | depart,arrive |
#needs to be adjusted when name-discovery works for entrys
Scenario: Mixed Entry and Exit
Given the node map
"""
c a
j b f
k e
l h d
g i
"""
And the ways
| nodes | junction | oneway |
| abc | | yes |
| def | | yes |
| ghi | | yes |
| jkl | | yes |
| bkheb | roundabout | yes |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,rotary-exit-1,arrive |
| a,l | abc,jkl,jkl | depart,bkheb-exit-2,arrive |
| a,i | abc,ghi,ghi | depart,bkheb-exit-3,arrive |
| a,f | abc,def,def | depart,bkheb-exit-4,arrive |
| d,f | def,def,def | depart,rotary-exit-1,arrive |
| d,c | def,abc,abc | depart,bkheb-exit-2,arrive |
| d,l | def,jkl,jkl | depart,bkheb-exit-3,arrive |
| d,i | def,ghi,ghi | depart,bkheb-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,rotary-exit-1,arrive |
| g,f | ghi,def,def | depart,bkheb-exit-2,arrive |
| g,c | ghi,abc,abc | depart,bkheb-exit-3,arrive |
| g,l | ghi,jkl,jkl | depart,bkheb-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,rotary-exit-1,arrive |
| j,i | jkl,ghi,ghi | depart,bkheb-exit-2,arrive |
| j,f | jkl,def,def | depart,bkheb-exit-3,arrive |
| j,c | jkl,abc,abc | depart,bkheb-exit-4,arrive |

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