Compare commits

..

308 Commits

Author SHA1 Message Date
Patrick Niklaus c34fff5e7a Filter segments correctly by bounding box 2016-04-03 11:41:46 +02:00
Patrick Niklaus da3b7c86c5 Remove tests from default target until we get proper switchting in place 2016-04-03 10:17:07 +02:00
Patrick Niklaus 4d8a9c7262 Bump osrm version 2016-04-03 01:08:08 +02:00
Patrick Niklaus 5de5dd0906 Update changelog to 5.0.0 RC1 2016-04-03 01:07:32 +02:00
Daniel Patterson 4293997406 Exclude new node_modules folder that might be around if test cases have been run. 2016-04-01 23:59:12 +02:00
Daniel J. Hofmann ef0ef90a19 Initial libosrm API docs 2016-04-01 23:59:12 +02:00
Daniel Patterson b95faabefb Remove leftover debug output. 2016-04-01 12:41:19 -07:00
Daniel Patterson 7f1f044fa0 Fix context returned in JSON error (had null bytes).
Update status test cases to match new API.
2016-04-01 10:42:49 -07:00
Moritz Kobitzsch 7f7d7816e5 fix duration of direct connection 2016-04-01 18:15:11 +02:00
Moritz Kobitzsch 144536a09d fix cucumber tests and issues 2016-04-01 17:13:13 +02:00
Daniel Patterson 6a4abfffda Add missing arrival instruction. 2016-03-31 18:37:08 -07:00
Lauren Budorick 0084f54f0d Add arrival instruction 2016-03-31 17:46:27 -07:00
Daniel Patterson 34337ec3c9 Add missing arrival instruction. 2016-03-31 17:30:47 -07:00
Daniel Patterson 83134c4cbd Add missing arrival instruction. 2016-03-31 17:28:30 -07:00
Daniel Patterson 909d341eb8 Add missing arrival instruction. 2016-03-31 17:27:30 -07:00
Daniel Patterson a5de5451f8 Add missing arrival instruction. 2016-03-31 17:25:37 -07:00
Daniel Patterson 93dd806913 Add missing arrival instruction. This test was incorrect. 2016-03-31 17:23:43 -07:00
Lauren Budorick cab023726c Add missing arrival instructions 2016-03-31 17:23:12 -07:00
Daniel Patterson c75c22e652 Add missing arrive instruction. 2016-03-31 17:20:43 -07:00
Daniel Patterson c7c46d3ff6 Add missing arrive instruction. 2016-03-31 17:20:03 -07:00
Daniel Patterson 55c6bc49d4 Add missing arrive instruction. 2016-03-31 17:17:34 -07:00
Daniel Patterson 6a72e61497 Add missing arrive instruction. 2016-03-31 17:15:56 -07:00
Daniel Patterson a5cdb85d79 Add missing arrive instruction to distance feature. 2016-03-31 17:13:58 -07:00
Daniel Patterson f32a21b02c Fix missing arrive instruction on bearing tests. 2016-03-31 17:08:55 -07:00
Daniel Patterson 0a12aab97b Add missing arrive instructions to time tests. 2016-03-31 16:56:50 -07:00
Lauren Budorick 52af0a615d start updating testbot fixtures (TODO: the rest) 2016-03-31 16:48:06 -07:00
Lauren Budorick 964c002b47 Update raster features to reflect not cutting off arrive instruction 2016-03-31 16:46:47 -07:00
Lauren Budorick d3dea9439a Update foot features to reflect not cutting off arrive instruction 2016-03-31 16:45:03 -07:00
Lauren Budorick 5de8f57549 Update car features to reflect not cutting off arrival instruction 2016-03-31 16:39:31 -07:00
Patrick Niklaus da525eb8dc Fix code of InternalError 2016-04-01 01:30:40 +02:00
Patrick Niklaus 6e2b4d3cc3 Fix some via tests 2016-04-01 01:30:40 +02:00
Daniel Patterson 0a06641c2c Fix bearing param tests. Have not yet fixed the cause of the two failing cases. 2016-03-31 16:29:12 -07:00
Lauren Budorick 9eda7d3845 Update bicycle tests to reflect not cutting off arrive step 2016-03-31 16:25:08 -07:00
Daniel Patterson f87a13f5cf Adjust threshold when trimming steps (needs to be bigger).
Also, when trimming the last step, we need to copy name values from the new next-to-last step, otherwise
we can still end up with an arrive step on a different road to the last maneuver.
2016-03-31 16:09:12 -07:00
Patrick Niklaus b52c8819f5 Fix some of the accidental forced loops in viaroute 2016-04-01 00:19:35 +02:00
Patrick Niklaus af57742307 Remove unused detach parameter 2016-04-01 00:19:35 +02:00
Daniel Patterson 9859808d03 Add 'arrive' step to route descriptions. 2016-03-31 14:32:00 -07:00
Daniel Patterson 1f18dc300f Colorize test result diff output. 2016-03-31 13:29:41 -07:00
Lauren Budorick 23d41d584b unbreak the zombiekilling 2016-03-31 13:27:29 -07:00
Lauren Budorick 335be174d2 Fix routability now that we don't chop off a step 2016-03-31 13:21:14 -07:00
Patrick Niklaus b3aca211d6 Remove arrive filter 2016-03-31 22:03:31 +02:00
Patrick Niklaus d1b9c09c23 Remove leftover hello_world and timestamp plugins 2016-03-31 21:35:48 +02:00
Patrick Niklaus fad3fc116e There is no timestamp service anymore 2016-03-31 21:35:48 +02:00
Lauren Budorick eeefb24a8e Remove one more compass column; update polyline encoding tests 2016-03-31 12:33:48 -07:00
Patrick Niklaus dfce2a64f4 .json hotfix 2016-03-31 21:32:44 +02:00
Patrick Niklaus 2a103c4362 Fix mathematical assumptions in StaticRTree
StaticRTree now uses projected coordinates internally. That means we can
use a euclidean distance measure (squared distance) for sorting the
query queue.
2016-03-31 19:03:57 +02:00
Moritz Kobitzsch 76d64f27cc fix same segment routes 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 3d9f1e5c66 Removed debug code 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch c7b0e5abc3 correctly handle roundabouts in a wide set of special cases 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 166aebbff4 Removes server-side support for POST requests. 2016-03-31 18:58:52 +02:00
Lauren Budorick 6ec5622ec5 Rm unnecessary io.write 2016-03-31 18:58:52 +02:00
Lauren Budorick c36e8cc9ea Fix raster_source + tests 2016-03-31 18:58:52 +02:00
Lauren Budorick 7f3f98a264 return geometry from new API 2016-03-31 18:58:52 +02:00
Lauren Budorick 4fd68e3970 Fix route/bearing param 2016-03-31 18:58:52 +02:00
Lauren Budorick 94d3340d63 Fix double shutdown 2016-03-31 18:58:52 +02:00
Lauren Budorick ee96cbfd00 Fix alternatives option test, chdirs on fail, spacing 2016-03-31 18:58:52 +02:00
Lauren Budorick edb4b1366f Update pushing test to reflect better guidance 2016-03-31 18:58:52 +02:00
Patrick Niklaus f29e92c776 Move osrm-components to BUILD_COMPONENTS flag 2016-03-31 18:58:52 +02:00
Patrick Niklaus 888f2e10e3 Fix staticrtree benchmark 2016-03-31 18:58:52 +02:00
Lauren Budorick 28a8079eef Fix trips + matchLocation 2016-03-31 18:58:52 +02:00
Jeff Miccolis c630128281 make eslint happy 2016-03-31 18:58:52 +02:00
Jeff Miccolis 990ed90a2d Fix timestamp handling, restores testbot/matching test 2016-03-31 18:58:52 +02:00
Lauren Budorick 467d93ffff Status fixes 2016-03-31 18:58:52 +02:00
Lauren Budorick d4e2b5a3b8 Distance matrix fixes 2016-03-31 18:58:52 +02:00
Lauren Budorick e9369293dc rm console.log my bad 2016-03-31 18:58:52 +02:00
Lauren Budorick e94384a5d9 Fix guidance/roundabout spacing 2016-03-31 18:58:52 +02:00
Lauren Budorick d820ef0796 enter_roundabout -> roundabout-exit (these are still off by one @mokob ?) 2016-03-31 18:58:52 +02:00
karenzshea b61beee95c parse for the right nearest output coordinate 2016-03-31 18:58:52 +02:00
Jeff Miccolis dcb7651f40 Fix testbot turns 2016-03-31 18:58:52 +02:00
karenzshea c6c7e1a478 console error which files are missing for osrm-routed 2016-03-31 18:58:52 +02:00
Jeff Miccolis 909be09ebf Matrix times are on seconds now. Removing POST matrix tests 2016-03-31 18:58:52 +02:00
Lauren Budorick de2205cac7 head/destination -> depart/arrive to reflect guidance API changes; minor fixes for roundabout tests 2016-03-31 18:58:52 +02:00
karenzshea 73050c0503 update osrm-routed options menu 2016-03-31 18:58:52 +02:00
Jeff Miccolis f54419d4dd Return first alternative in tests 2016-03-31 18:58:52 +02:00
Jeff Miccolis 99c8c4e7cb Remove compass direction test handling 2016-03-31 18:58:52 +02:00
Lauren Budorick 78bcaada6b #2155 is fixed 2016-03-31 18:58:52 +02:00
Jeff Miccolis ee12704133 eslinting 2016-03-31 18:58:52 +02:00
Jeff Miccolis 848b3815bd Update alternatives flag 2016-03-31 18:58:52 +02:00
Jeff Miccolis 0fcdb4b8e6 test query params are an object 2016-03-31 18:58:52 +02:00
Jeff Miccolis 88a1a69c1b Removing unneeded stopgap 2016-03-31 18:58:52 +02:00
Jeff Miccolis 222d06850c Allow for different rounding in car-maxspeed fixture 2016-03-31 18:58:52 +02:00
Jeff Miccolis a2612a1ebe Add stopgap for https://github.com/Project-OSRM/osrm-backend/pull/2159 2016-03-31 18:58:52 +02:00
Lauren Budorick 598c78200f Mode changes, guidance comments, fix turns 2016-03-31 18:58:52 +02:00
Lauren Budorick bf8e4e8270 Fixes: double callbacks and untested headers 2016-03-31 18:58:52 +02:00
Jeff Miccolis 1bcdc0fa75 Better handling of test response payloads 2016-03-31 18:58:52 +02:00
Lauren Budorick 3ed46aa4c5 ensure all nodes are written as decimals 2016-03-31 18:58:52 +02:00
Lauren Budorick 4d2be0b44c WIP: race conditions and stalling server 2016-03-31 18:58:52 +02:00
Lauren Budorick 3135bb34b3 start fixing URLs 2016-03-31 18:58:52 +02:00
Lauren Budorick ceb46b8da4 Add more files to be renamed; fix launch error 2016-03-31 18:58:52 +02:00
Lauren Budorick bc0222c204 Bind use_turn_restrictions to ProfileProperties in scripting environment 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch d40f777a87 perform zero-length segment removal 2016-03-31 18:58:52 +02:00
Daniel Patterson 290101b8ce Use simpler coordinates for tests. 2016-03-31 18:58:52 +02:00
Daniel Patterson a548155f65 Use correct perpendicular distance measure when simplifying line geometries. 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 0a4015690f fixes missing overrides in mock data facade 2016-03-31 18:58:52 +02:00
Daniel Patterson 5553dad423 Fixes #2152 - weight vector needed to be reversed, and start index was wrong. 2016-03-31 18:58:52 +02:00
Patrick Niklaus 991a0b38c5 Implement re-enabling of PhantomNode directions after bearing filtering 2016-03-31 18:58:52 +02:00
Patrick Niklaus c9e2a8d24a Move Centroid to coordinate_calculation 2016-03-31 18:58:52 +02:00
Patrick Niklaus ebd8bf7c7c Round integers to remove fake precision 2016-03-31 18:58:52 +02:00
Patrick Niklaus 156b01ae93 Fix problem with uturns=true 2016-03-31 18:58:52 +02:00
Patrick Niklaus 306b0610a2 Add route fixture test 2016-03-31 18:58:52 +02:00
Patrick Niklaus 7e5274e6e6 Adapt get_osrm to EngineConfig changes 2016-03-31 18:58:52 +02:00
Patrick Niklaus f998cb8c54 Make tests build by default 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 324cfaac83 Make extractor unit tests work again after global uturn changeset 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann dbcc86c59d Number of waypoints equals number of input coordinates 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 22cd9505ef Make test assumption failure output violation in Route unit tests 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 3e1b7ad6d5 Hook up small component locations for Nearest response test 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 1c41a6b1e8 Provide dummy locations from our fixed monaco dataset 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 776c0d0ae2 Fixes integer overflow due to fixed / floating mismatch in coordinate interpolation 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann a86f09a1f7 Makes switching between floating and fixed coordinates safe wrt. overflows 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann cecb0c547b Makes viewport immune to inf and nans 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann f8bd22dc6f Fix base64 test wrt. Hint no longer taking coordinate in ctor 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann a4ccc59833 Adapt mock facade implementation to renamed base facade symbols 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann d774a875cd Provide implementation for all pure virtual base member functions in mock facade 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann bfde117ff5 Mismatched tag in fwd decl 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 4bb7e734f9 Make unit tests compile again after rebasing 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann f16a865420 Make Tile plugin validate its parameters, fixes #2109 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann c087a11659 Make Route plugin validate its parameters 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann de1f1b8ab3 Makes Nearest plugin adhere to v5 spec for precondition violations, fixes #2108 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 665f93c92f Unit test for Route service; some failing where v5 spec is unclear 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann e1d9d9c218 Unit tests for Tile service; plugin needs improvements: see #2109 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 09c40db4ad Unit tests for Nearest service; one test failing: see #2108 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann cb212a7315 Makes table plugin adhere to v5 spec for limit violations, fixes #2100 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 9dbd437233 Adapts our Travis config to continuously run the library unit tests 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann fea6c2731a Tests for config level constraints; table failing: see #2100 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 1d11701034 Initial unit tests setup for typed libosrm services 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 28fe1600ae Puts auto-generated monaco test files on gitignore 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 7ccb3a6327 Library tests build system integration 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 5edc332e49 Add guidance assembly unit test stub 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann e68c057139 Sentinel spelling 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 943a2d4ab7 Explicitely construct coordinate and phantom node 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 5b00bb81e3 Adapts all unit tests and benchmarks to compile under v5 again 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann e050f15cf8 Provide correct Base64 implementation.
Phew, this was painful. Turns out most hints out there on how to use the
Boost serialization iterators are wrong. Here's why:

    transform_width<6, 8>

needs an input stream of length: common multiple of 6 and 8.

That is, the padding needs to happen _before_ using the provided
iterators, otherwise the behavior is undefined!

See: http://www.boost.org/doc/libs/1_60_0/boost/archive/iterators/transform_width.hpp

Thanks @mokob for pointing that out to me!

We also need to manually add as many padding chars "=" to the encoded
result as many bytes we had to append to the input to conform to the
rule above.

Decoding then knows the number of padding chars by counting for "=" and
then using it in order to split off the last bytes from the decoded
result.
2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 0acf7f7400 Adds round trip tests for RFC 4648 Test Vectors and equality checks 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 9abfb7ea3b Makes hint Equatable and Printable for tests 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 8a4551500d Make Hint encoding safe for passing them as GET parameter in URLs
Thanks @TheMarex for flagging this!
2016-03-31 18:58:52 +02:00
Daniel J. Hofmann d0c534e5fa Completely re-write base64 logic, make API suck less in doing so 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 822bb97a5f RFC 4648 Test Vectors 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 6cd3b8bc00 Object Encoder -> Base64, kill false dependencies while doing so 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann a145520b5b Adapts Hint encoding and decoding to new fixed data facade 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 3d75d15361 Formats parameter parser unit tests 2016-03-31 18:58:52 +02:00
Patrick Niklaus 8dd3fe3173 Fix hint size 2016-03-31 18:58:52 +02:00
Patrick Niklaus 0bb1b04170 Always safe the absolute path to .fileIndex 2016-03-31 18:58:52 +02:00
Patrick Niklaus 11629e0538 Install storage_config.hpp 2016-03-31 18:58:52 +02:00
Aleksei Potov 6462ea14a2 compilation error on debian jessie with boost 1.54 2016-03-31 18:58:52 +02:00
Daniel Patterson 993c4796c1 Fix boost geometry constructor.
Versions older than 1.58 don't support the initializer-list form.
2016-03-31 18:58:52 +02:00
Moritz Kobitzsch b11d3ad1ba syncronize geometry and steps after post-processing 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 9681d662cb added list of intersections to the step-maneuver, not in api so far 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 6a5ffc126a fix initial maneuvers 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 7bf2cb1917 post processing moved onto route-steps, looses sync with geometry segments 2016-03-31 18:58:52 +02:00
Patrick Niklaus 2b0a1bbb63 Simplify the timestamp handling 2016-03-31 18:58:52 +02:00
Patrick Niklaus 31297d1c9f Check all streams 2016-03-31 18:58:52 +02:00
Patrick Niklaus 4e854399b6 std::string -> boost::filesystem::path 2016-03-31 18:58:52 +02:00
Patrick Niklaus 17adeaf3e2 Only allow to specify the common base path 2016-03-31 18:58:52 +02:00
Patrick Niklaus cf92e52b86 print -> io.write 2016-03-31 18:58:52 +02:00
Patrick Niklaus 250acf6a2a Address PR comments
Renamed lua_function_exists and removes unused print function
2016-03-31 18:58:52 +02:00
Patrick Niklaus 49c852917f Use uturn default from .properties file 2016-03-31 18:58:52 +02:00
Patrick Niklaus 3467696f8a Adds .properties file to osrm-extract ouput
This file contains global properties set by the lua
profile, such as enabling uturns at vias and penalties.
This file will be consumed by the server.
2016-03-31 18:58:52 +02:00
Patrick Niklaus a6a4fb0d49 Use global uturns parameter.
Instead of previously per-via settings like uturns=true;false;true;; it
now only supports a global setting uturns=true.
2016-03-31 18:58:52 +02:00
Moritz Kobitzsch d3888942e8 improves consistency of fork handling 2016-03-31 18:58:52 +02:00
Patrick Niklaus 1f853385d5 Make gcc 4.8 happy and disable protected because of lambdas 2016-03-31 18:58:52 +02:00
Daniel Patterson 08e56956d6 Properly clip lines so that we don't get crazy coords with long linestrings (relative to tile coords) 2016-03-31 18:58:52 +02:00
Daniel Patterson fc027417d8 Include edge duration information. 2016-03-31 18:58:52 +02:00
Patrick Niklaus f07da00dfe Implement viewport code to fix simplification
This fixes #2083
2016-03-31 18:58:52 +02:00
Patrick Niklaus 5bd874aab6 Add tests for coordinate transformation 2016-03-31 18:58:52 +02:00
Patrick Niklaus 6904851eb6 Consolidate math functions 2016-03-31 18:58:52 +02:00
Patrick Niklaus 6d70e1d47d get_name_for_id -> GetNameForID 2016-03-31 18:58:52 +02:00
Patrick Niklaus 7a55b46848 Simplfy name change announcement 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 989b374d86 fix division by zero 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 9034d0c521 restructured to only return valid turns to the outside + cleanup 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 064eb8bca7 less new names, forks consider road classes, api clean-up 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch b63f3cc247 implement basic turn handling 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 4f1503c4a1 implements relative position feature based on coordinates 2016-03-31 18:58:52 +02:00
Patrick Niklaus 64ace032f6 Don't sum up durations of merged steps since we do that in a different place now 2016-03-31 18:58:52 +02:00
Patrick Niklaus 2d4fc9a0b7 Fix foward/backwad swap 2016-03-31 18:58:52 +02:00
Patrick Niklaus 0c4cb9fb1b Limit zoomlevel to 18 2016-03-31 18:58:52 +02:00
Patrick Niklaus d2bd2c7ec6 Fix shared memory 2016-03-31 18:58:52 +02:00
Patrick Niklaus 10f8bf53b4 Fixup for last commit 2016-03-31 18:58:52 +02:00
Daniel Patterson 3058135f55 Enables the use of multiple segment-speed-files on the osrm-contract
command line, and exposes the file name used for each edge in the debug
tiles.
2016-03-31 18:58:52 +02:00
Patrick Niklaus ba00871793 Fix ingestion fixed duration values from UnpackPath 2016-03-31 18:58:52 +02:00
Patrick Niklaus bd66ba9eee Fix durations in UnpackPath 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch dacd3b4833 fixes a broken assertion 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 94c465aeb9 fix merging of turn instructions 2016-03-31 18:58:52 +02:00
Patrick Niklaus 1b1bb780fe Include reverse edges again 2016-03-31 18:58:52 +02:00
Patrick Niklaus 0ce18f1658 Formating and logging changes for turn classification 2016-03-31 18:58:52 +02:00
Patrick Niklaus 811372fca8 Handle case of dead-end edges by inserting an invalid turn 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 21a1a2da93 report depart/arrive in addition to waypoint 2016-03-31 18:58:52 +02:00
Patrick Niklaus 43b0638074 Only install necessary headers 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 146f20191a Adds the license preamble for all publicly installed eaders, closes #2036 2016-03-31 18:58:52 +02:00
Patrick Niklaus 0be7ce2c0f Remove the encoder/decoder dependecy from Hint 2016-03-31 18:58:52 +02:00
Patrick Niklaus 1109b8de16 Rename alternative -> alternatives 2016-03-31 18:58:52 +02:00
Patrick Niklaus 86a2b6eb07 Remove obsolete debug information 2016-03-31 18:58:52 +02:00
Patrick Niklaus 1af59e874d Just return NoSegment in map matching if all candidates are empty 2016-03-31 18:58:52 +02:00
Patrick Niklaus 09a9d6c417 Add failing test for map matching of outlier 2016-03-31 18:58:52 +02:00
Patrick Niklaus 44c12afc3f Fix missing capitalization of error codes 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch b01c2bc8b8 encapsulated into class 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 770d9833d1 improving fork handling on three-way turns 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch b6c2e86443 fix comparison for ramps on three-way turns 2016-03-31 18:58:52 +02:00
Patrick Niklaus a4134db847 Minor auto iterator cleanup 2016-03-31 18:58:52 +02:00
Patrick Niklaus fa56abcd58 Don't pass down unsnapped coordinates. All information is already there 2016-03-31 18:58:52 +02:00
Patrick Niklaus 611eafb4c6 Fix camMergeTrivially 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch afa62064fd fixes roundabout counting 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 64933389ae fixes assignment for basic turn types / invalid ramp assignment 2016-03-31 18:58:52 +02:00
Patrick Niklaus cb84e6009d Add edge id assertions 2016-03-31 18:58:52 +02:00
Patrick Niklaus 6b0b160f37 Don't pass shared_ptr down to functions
"Don’t pass a smart pointer as a function parameter unless you want to
use or manipulate the smart pointer itself, such as to share or transfer
ownership."

Source:
http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
2016-03-31 18:58:52 +02:00
Patrick Niklaus 7cc689af7d Move bearing to public namespace 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 25bd7d6d30 Properly includes needed headers in turn analysis interface 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 5c6cbd2b10 Const-correctnes for compressed geometry iterator 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 32d5b6b1b7 Use stdint and using type-alias for discrete angle 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 458a1c8157 Hide functional road classification based on tags in implementation file 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann b45efeb4bd Inline initialize functional road classification hash table 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann b5619e89c8 256 functional road classes should be enough 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann e1da384b62 Moves route assembly into implementation file 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann b250fce92c Fixes remaining engine/guidance includes 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 11da796a70 Fixes accumulate living in <numeric> and not <algorithm> 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 2985e73938 Puts step maneuver handling into implementation file 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann b5a67003fe Removes penalizing move 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 4797d6f1e1 Uses static_casts for underlying type in post processing 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 426f773cb7 Fix asymmetry in min/max from using -max 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 5c39449263 Adapts MakeResponse to not pass vector by pointer 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 1062007e67 Fixes multi-line comment 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann ea81866e28 Runs scripts/format.sh 2016-03-31 18:58:52 +02:00
Patrick Niklaus 3b9c772d14 Fix coodinate include and unused warnings 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 9d1032a742 start of four way turns 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch a27f7326bd improved fork handling 2016-03-31 18:58:52 +02:00
Patrick Niklaus ba3f167b99 Fix crash on extracting Berlin in guidance 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 8322a7ccaf bugfixing/classification 2016-03-31 18:58:52 +02:00
Patrick Niklaus 8c71239e48 Big Restructuring / Cleanup 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch ffb3578180 starting on conflict resolution 2016-03-31 18:58:52 +02:00
Lauren Budorick c918d68b3e Fixes for gcc compiling, temporary hacks to remove later 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch ebdae7591b handle segregated roads (merge for turn analysis) 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 0ba70bcbf9 structural changes, motorway handling 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 3cdd282e0f enter and exit roundabout feature - currently not showing turn 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 72202b7e4a migrated out of edge based graph factory 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch 9f9040eaf6 relative waypoint locations 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch bc252ea110 handling of roundabouts (simple version) 2016-03-31 18:58:52 +02:00
Moritz Kobitzsch bcf7741f95 advanced guidance on 5.0 2016-03-31 18:58:52 +02:00
Patrick Niklaus 70afe209d5 Fix numerical problems with polyline 2016-03-31 18:58:52 +02:00
Patrick Niklaus 4e9709d038 Fix table response format to return null + double in seconds 2016-03-31 18:58:52 +02:00
Patrick Niklaus 8b50f48d8e Return NoMatch 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 09d70f7342 Provides ctor from base path for EngineConfig, fixes #2030 2016-03-31 18:58:52 +02:00
Patrick Niklaus 6f89ce516f Add support for tile plugin 2016-03-31 18:58:52 +02:00
Patrick Niklaus 666d363c93 Preliminary integration of the tile plugin 2016-03-31 18:58:52 +02:00
Patrick Niklaus 0182b9a584 sources and destinations can be empty actually 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann cc93ed15c0 Fixes coordinate, source and destination validation by means of backporting #2041 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann b0a83191cd Fixes ownership semantics and forwarding references misplacements in the JSON factory 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann b8f6d3ca97 Unwrap function call from identity lambda 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 5a0ee6d1d8 Uses JSON's String constructor for polyline encoding 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 4e02e8e1a0 Passes coordinates by value 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 407509d1af Asserts on unknown TurnInstruction 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann c1bea5c22d Fixes header includes in the JSON factory 2016-03-31 18:58:52 +02:00
Dane Springmeyer cf63399c9f fix compile of osrm-components 2016-03-31 18:58:52 +02:00
Patrick Niklaus 17382b2a28 Fix if the last coordinate is not found 2016-03-31 18:58:52 +02:00
Patrick Niklaus c2423ef20f Allocate correct table size 2016-03-31 18:58:52 +02:00
Patrick Niklaus e6782fd30b Fix travel mode passing from profiles up to the API 2016-03-31 18:58:52 +02:00
Patrick Niklaus 77a4530433 Fix geometries type in steps 2016-03-31 18:58:52 +02:00
Patrick Niklaus ee8302bf27 Fix table parameter parsing 2016-03-31 18:58:52 +02:00
Patrick Niklaus 5e1a8d82d6 Fix behaviour of table if sources/destinations arrays are empty 2016-03-31 18:58:52 +02:00
Patrick Niklaus cf1274de21 Fuck. this. shit. 2016-03-31 18:58:52 +02:00
Patrick Niklaus 4ce786b357 Change stream operator of strong typedef 2016-03-31 18:58:52 +02:00
Patrick Niklaus e5efee2dd8 Fix stream operator for coordinate 2016-03-31 18:58:52 +02:00
Patrick Niklaus 20ace659b6 Add stream operator to Rectangle 2016-03-31 18:58:52 +02:00
Patrick Niklaus 1d026882f9 Add euclideanDistance to coordinate_calculation 2016-03-31 18:58:52 +02:00
Patrick Niklaus 48000008d7 Simplify static_rtree tests 2016-03-31 18:58:52 +02:00
Patrick Niklaus 60d83ccf53 First round of lat,lng -> lng,lat switcheroo 2016-03-31 18:58:52 +02:00
Patrick Niklaus dcab2b19c2 Add rectangle unit test 2016-03-31 18:58:52 +02:00
Patrick Niklaus ce2c0ba160 Fix match and trip API response 2016-03-31 18:58:52 +02:00
Patrick Niklaus 776add7ea2 Fix out-of-bounds write in map_matching 2016-03-31 18:58:52 +02:00
Dane Springmeyer dab8f76516 Fix compile on OS X 2016-03-31 18:58:52 +02:00
Patrick Niklaus db170d006a Finish the nearest plugin 2016-03-31 18:58:52 +02:00
Patrick Niklaus 84d79f789c Initialize NearestParameters correctly 2016-03-31 18:58:52 +02:00
Patrick Niklaus b1d70b8a8c Adapt to feedback in #519 2016-03-31 18:58:52 +02:00
Patrick Niklaus 1b1211092b Add trip plugin 2016-03-31 18:58:52 +02:00
Patrick Niklaus 4e0f2e13bd Hook up map matching 2016-03-31 18:58:52 +02:00
Patrick Niklaus 28961ed593 First compiling version of map_match plugin 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann c32900091c Adapts example/example.cpp to new osrm api 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 283926dbc9 Install _all_ transitively from public headers included header 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 40bf5c6092 Fix missing headers in hint.hpp 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 2a88477178 Adds $prefix/include/osrm to include dirs so that transitive header includes without osrm prefix can be found 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann f8d8289c84 Adapt the example to include all osrm public headers 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 030682fc62 Fixes missing public header installations 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 1e891e6ec5 Fix forward declarations in publicly facing osrm header 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 6a77ac442e Enable all plugins with aStatus::Error return code fallback for not implemented ones 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 9578b9a045 Adds publicly facing alias headers for parameters 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 130c88bd0c Temporarily comment out match.cpp as to not break the build process 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 2617960d6c We don't need templates at all, this is not CRTP? 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann f10da205bb Fix classes for service member function definitions 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 247d0d5290 Service skeletons for nearest, trip, match 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann bb5ca42114 Fix grammar constraint and enable all plugin links 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 66cb69d1d2 Plugin grammar skeletons 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 48008cdc6e Enforce parameter and grammar type to catch subtle bugs 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 3ff86c4536 Link parameters to grammars 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann ce82242004 Require a BaseParameters type at compile time via enable_if 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann d989714007 Adapts Nearest plugin to new API 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 9704ca7a8b Fix deleting incomplete type and make Engine moveable only 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann ec79d1e933 Adapts publicly facing new API 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 94f6005358 Adapts NearestParameters to new API 2016-03-31 18:58:52 +02:00
Patrick Niklaus 7d51a76e79 Initial non-building match plugin 2016-03-31 18:58:52 +02:00
Lauren Budorick 5b18278ee5 Include numeric in assemble_overview.cpp (needed on OSX for std::accumulate) 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann 1d312f212a Semantic action handler requires passing optional by value and fusion::vector2 2016-03-31 18:58:52 +02:00
Patrick Niklaus 1258a64b3e Add tests for bearing parsing 2016-03-31 18:58:52 +02:00
Patrick Niklaus c57e85f391 Add table service 2016-03-31 18:58:52 +02:00
Patrick Niklaus 59b4a142ec Add table API 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann bcea53460c Optional<T> semantic action handler takes T argument 2016-03-31 18:58:52 +02:00
Patrick Niklaus 72ebb3acb8 Fix parameter parsing tests 2016-03-31 18:58:52 +02:00
Patrick Niklaus 9e5a300cbb Fix table plugin 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann bf9824502a First take at distance table API re-write 2016-03-31 18:58:52 +02:00
Daniel J. Hofmann d69bad9cb2 Adapts TableParameters and its validation to new API 2016-03-31 18:58:52 +02:00
Patrick Niklaus 66d241a2d8 Add viaroute suport for new API 2016-03-31 18:58:52 +02:00
171 changed files with 4368 additions and 8551 deletions
-1
View File
@@ -80,7 +80,6 @@ stxxl.errlog
/test/profile.lua
/test/cache
/test/speeds.csv
/test/data/monaco.*
node_modules
# Deprecated config file #
+48 -37
View File
@@ -13,7 +13,7 @@ notifications:
branches:
only:
- master
- "5.0"
- develop
matrix:
fast_finish: true
@@ -26,8 +26,8 @@ matrix:
addons: &gcc5
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'pip']
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='g++-5' BUILD_TYPE='Debug'
- os: linux
compiler: gcc
@@ -35,20 +35,20 @@ matrix:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Debug'
env: COMPILER='g++-4.8' BUILD_TYPE='Debug'
- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
- os: osx
osx_image: xcode7.3
compiler: clang
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Debug'
env: COMPILER='clang++' BUILD_TYPE='Debug'
# Release Builds
- os: linux
@@ -57,7 +57,7 @@ matrix:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release'
env: COMPILER='g++-5' BUILD_TYPE='Release'
- os: linux
compiler: gcc
@@ -65,20 +65,20 @@ matrix:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-4.8' CXXCOMPILER='g++-4.8' BUILD_TYPE='Release'
env: COMPILER='g++-4.8' BUILD_TYPE='Release'
- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
- os: osx
osx_image: xcode7.3
compiler: clang
env: CCOMPILER='clang' CXXCOMPILER='clang++' BUILD_TYPE='Release'
env: COMPILER='clang++' BUILD_TYPE='Release'
# Shared Library
- os: linux
@@ -87,15 +87,39 @@ matrix:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
env: COMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
env: COMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
# Disabled until tests all pass on OSX:
#
# 3/ OSX Clang Builds
#- os: osx
# osx_image: xcode6.4
# compiler: clang
# env: COMPILER='clang++' BUILD_TYPE='Debug'
#- os: osx
# osx_image: xcode6.4
# compiler: clang
# env: COMPILER='clang++' BUILD_TYPE='Release'
#- os: osx
# osx_image: xcode6.4
# compiler: clang
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
#- os: osx
# osx_image: xcode7
# compiler: clang
# env: COMPILER='clang++' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
before_install:
- source ./scripts/install_node.sh 4
@@ -104,15 +128,12 @@ install:
- npm install
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- |
if [[ -n "${COVERAGE}" ]]; then
pip install --user cpp-coveralls
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum
@@ -125,9 +146,9 @@ before_script:
./scripts/check_taginfo.py taginfo.json profiles/car.lua
fi
- mkdir build && pushd build
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
- export CXX=${COMPILER}
- export OSRM_PORT=5000 OSRM_TIMEOUT=6000
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
script:
- make --jobs=2
@@ -138,29 +159,19 @@ script:
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo ldconfig
fi
- echo "travis_fold:start:UNIT_TESTS"
- ./unit_tests/extractor-tests
- ./unit_tests/engine-tests
- ./unit_tests/util-tests
- ./unit_tests/server-tests
- echo "travis_fold:end:UNIT_TESTS"
- ./extractor-tests
- ./engine-tests
- ./util-tests
- popd
- echo "travis_fold:start:CUCUMBER"
- npm test
- echo "travis_fold:end:CUCUMBER"
- echo "travis_fold:start:BENCHMARK"
- make -C test/data benchmark
- echo "travis_fold:end:BENCHMARK"
- ./build/unit_tests/library-tests test/data/monaco.osrm
- make -C test/data
- ./build/library-tests test/data/monaco.osrm
- mkdir example/build && pushd example/build
- cmake ..
- make
- ./osrm-example ../../test/data/monaco.osrm
- popd
after_success:
- |
if [ -n "$RUN_CLANG_FORMAT" ]; then
./scripts/format.sh || true # we don't want to fail just yet
fi
- coveralls --build-root build --exclude unit_tests --exclude third_party --exclude node_modules --gcov-options '\-lp'
-77
View File
@@ -1,80 +1,3 @@
# 5.0.1
- Fixes:
- Issue #2309: Fixes local path looping, same coordinates crash
- Issue #2311: Fixes invalid assertion in loop unpacking
- Issue #2310: Local paths could falsely end up trying to remove the start step
# 5.0.0
Changes with regard 5.0.0 RC2:
- API:
- if `geometry=geojson` is passed the resulting geometry can be a LineString or Point
depending on how many coordinates are present.
- the removal of the summary field was revered. for `steps=flase` the field will always be an empty string.
Changes with regard to 4.9.1:
- API:
- BREAKING: Complete rewrite of the HTTP and library API. See detailed documentation in the wiki.
- BREAKING: The default coordinate order is now `longitude, latidue`. Exception: Polyline geometry
which follow the original Google specification of `latitdue, longitude`.
- BREAKING: Polyline geometries now use precision 5, instead of previously 6
- BREAKING: Removed GPX support
- New service `tile` which serves debug vector tiles of the road network
- Completely new engine for guidance generation:
- Support for highway ramps
- Support for different intersection types (end of street, forks, merges)
- Instruction post-processing to merge unimportant instructions
- Improved handling of roundabouts
- Tools:
- BREAKING: Renamed osrm-prepare to osrm-contract
- BREAKING: Removes profiles from osrm-contract, only needed in osrm-extract.
- Abort processing in osrm-extract if there are no snappable edges remaining.
- Added .properties file to osrm-extract ouput.
- Enables the use of multiple segment-speed-files on the osrm-contract command line
- Profile changes:
- Remove movable bridge mode
- Add `maxspeed=none` tag to car profile.
- A `side_road` tag support for the OSRM car profile.
- Fixes:
- Issue #2150: Prevents routing over delivery ways and nodes
- Issue #1972: Provide uninstall target
- Issue #2072: Disable alternatives by default and if core factor < 1.0
- Issue #1999: Fix unpacking for self-loop nodes not in core.
- Infrastructure:
- Cucumber test suit is now based on cucumber-js, removes Ruby as dependency
- Updated to mapbox/variant v1.1
- Updated to libosmium v2.6.1
- Remove GeoJSON based debugging output, replaced by debug tiles
# 5.0.0 RC2
- Profiles:
- `properties.allow_uturns_at_via` -> `properties.continue_straight_at_waypoint` (value is inverted!)
- API:
- Removed summary from legs property
- Disable steps and alternatives by default
- Fix `code` field: 'ok' -> 'Ok'
- Allow 4.json and 4.3.json format
- Conform to v5 spec and support "unlimited" as radiuses value.
- `uturns` parameter was replaced by `continue_straight` (value is inverted!)
- Features:
- Report progress for gennerating edge expanded edges in the edge based graph factory
- Add maxspeed=none tag to car profile.
- Optimize StaticRTree code: speedup 2x (to RC1)
- Optimize DouglasPeucker code: speedup 10x (to RC1)
- Optimize WebMercator projection: speedup 2x (to RC1)
- Bugs:
- #2195: Resolves issues with multiple includedirs in pkg-config file
- #2219: Internal server error when using the match plugin
- #2027: basename -> filename
- #2168: Report correct position where parsing failed
- #2036: Add license to storage and storage config exposed in public API
- Fix uturn detection in match plugin
- Add missing -lz to fix linking of server-tests
# 5.0.0 RC1
- Renamed osrm-prepare into osrm-contract
- osrm-contract does not need a profile parameter anymore
+43 -37
View File
@@ -32,10 +32,8 @@ endif()
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
option(ENABLE_JSON_LOGGING "Adds additional JSON debug logging to the response" OFF)
option(BUILD_TOOLS "Build OSRM tools" OFF)
option(BUILD_COMPONENTS "Build osrm-components" ON)
option(BUILD_COMPONENTS "Build OSRM tools" ON)
option(ENABLE_ASSERTIONS OFF)
option(COVERAGE OFF)
option(SANITIZER OFF)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
@@ -48,7 +46,10 @@ add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
COMMENT "Configuring revision fingerprint"
VERBATIM)
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread)
add_custom_target(tests DEPENDS engine-tests extractor-tests util-tests server-tests library-tests)
add_custom_target(benchmarks DEPENDS rtree-bench)
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread unit_test_framework)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
@@ -60,6 +61,12 @@ file(GLOB ContractorGlob src/contractor/*.cpp)
file(GLOB StorageGlob src/storage/*.cpp)
file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
file(GLOB ExtractorTestsGlob unit_tests/extractor/*.cpp)
file(GLOB EngineTestsGlob unit_tests/engine/*.cpp)
file(GLOB UtilTestsGlob unit_tests/util/*.cpp)
file(GLOB ServerTestsGlob unit_tests/server/*.cpp)
file(GLOB LibraryTestsGlob unit_tests/library/*.cpp)
file(GLOB IOTestsGlob unit_tests/io/*.cpp)
add_library(UTIL OBJECT ${UtilGlob})
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
@@ -80,6 +87,21 @@ add_library(osrm_extract $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
# Unit tests
add_executable(engine-tests EXCLUDE_FROM_ALL unit_tests/engine_tests.cpp ${EngineTestsGlob} $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
add_executable(extractor-tests EXCLUDE_FROM_ALL unit_tests/extractor_tests.cpp ${ExtractorTestsGlob} $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_executable(util-tests EXCLUDE_FROM_ALL unit_tests/util_tests.cpp ${UtilTestsGlob} $<TARGET_OBJECTS:UTIL>)
add_executable(server-tests EXCLUDE_FROM_ALL unit_tests/server_tests.cpp ${ServerTestsGlob} $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:SERVER>)
add_executable(library-tests EXCLUDE_FROM_ALL unit_tests/library_tests.cpp ${LibraryTestsGlob})
# Benchmarks
add_executable(rtree-bench EXCLUDE_FROM_ALL src/benchmarks/static_rtree.cpp $<TARGET_OBJECTS:UTIL>)
target_include_directories(engine-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
target_include_directories(util-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
target_include_directories(library-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/)
target_include_directories(rtree-bench PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
# Check the release mode
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_BUILD_TYPE Release)
@@ -135,19 +157,8 @@ if(CMAKE_BUILD_TYPE MATCHES Release)
endif()
endif()
set(MAYBE_COVERAGE_LIBRARIES "")
if (COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "COVERAGE=ON only make sense with a Debug build")
endif()
set(MAYBE_COVERAGE_LIBRARIES "gcov")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
endif()
if (SANITIZER)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "SANITIZER=ON only make sense with a Debug build")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
if(NOT WIN32)
add_definitions(-DBOOST_TEST_DYN_LINK)
endif()
# Configuring compilers
@@ -231,13 +242,11 @@ find_package(Osmium REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
find_package(Boost 1.49.0 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
if(NOT WIN32)
add_definitions(-DBOOST_TEST_DYN_LINK)
endif()
add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE)
add_definitions(-DBOOST_FILESYSTEM_NO_DEPRECATED)
add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3 -DBOOST_RESULT_OF_USE_DECLTYPE)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
find_package(Threads REQUIRED)
@@ -248,7 +257,7 @@ if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
endif()
find_package(Luabind REQUIRED)
find_package( Luabind REQUIRED )
include(check_luabind)
include_directories(SYSTEM ${LUABIND_INCLUDE_DIR})
@@ -298,8 +307,7 @@ set(EXTRACTOR_LIBRARIES
${OSMIUM_LIBRARIES}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
${ZLIB_LIBRARY})
set(CONTRACTOR_LIBRARIES
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
@@ -307,32 +315,35 @@ set(CONTRACTOR_LIBRARIES
${USED_LUA_LIBRARIES}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
${MAYBE_RT_LIBRARY})
set(ENGINE_LIBRARIES
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
${MAYBE_RT_LIBRARY})
set(STORAGE_LIBRARIES
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
${MAYBE_RT_LIBRARY})
set(UTIL_LIBRARIES
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_COVERAGE_LIBRARIES})
${TBB_LIBRARIES})
# Libraries
target_link_libraries(osrm ${ENGINE_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# Tests
target_link_libraries(engine-tests ${ENGINE_LIBRARIES})
target_link_libraries(server-tests osrm ${Boost_LIBRARIES})
target_link_libraries(extractor-tests ${EXTRACTOR_LIBRARIES})
target_link_libraries(rtree-bench ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES})
target_link_libraries(util-tests ${UTIL_LIBRARIES})
target_link_libraries(library-tests osrm ${Boost_LIBRARIES})
if(BUILD_COMPONENTS)
find_package(GDAL)
@@ -449,8 +460,3 @@ configure_file(
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
# Modular build system: each directory registered here provides its own CMakeLists.txt
add_subdirectory(unit_tests)
add_subdirectory(src/benchmarks)
-1
View File
@@ -10,7 +10,6 @@ The Open Source Routing Machine is a high performance routing engine written in
| Linux | develop | [![Build Status](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=develop)](https://travis-ci.org/Project-OSRM/osrm-backend) |
| Windows | master/develop | [![Build status](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
| LUAbind fork | master | [![Build Status](https://travis-ci.org/DennisOSRM/luabind.png?branch=master)](https://travis-ci.org/DennisOSRM/luabind) |
| Coverage | develop | [![Coverage Status](https://coveralls.io/repos/github/Project-OSRM/osrm-backend/badge.svg?branch=develop)](https://coveralls.io/github/Project-OSRM/osrm-backend?branch=develop) |
## Building
+5 -8
View File
@@ -116,17 +116,14 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
ECHO running extractor-tests.exe ...
unit_tests\%Configuration%\extractor-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running engine-tests.exe ...
unit_tests\%Configuration%\engine-tests.exe
%Configuration%\engine-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running extractor-tests.exe ...
%Configuration%\extractor-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running util-tests.exe ...
unit_tests\%Configuration%\util-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running server-tests.exe ...
unit_tests\%Configuration%\server-tests.exe
%Configuration%\util-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
+2 -2
View File
@@ -1,5 +1,5 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/include
includedir=${prefix}/include ${prefix}/include/osrm
libdir=${prefix}/lib
Name: libOSRM
@@ -8,4 +8,4 @@ Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
Requires:
Libs: -L${libdir} -losrm
Libs.private: @ENGINE_LIBRARY_LISTING@
Cflags: -I${includedir} -I${includedir}/osrm
Cflags: -I${includedir}
+2 -2
View File
@@ -1,6 +1,6 @@
module.exports = {
default: '--require features --tags ~@stress --tags ~@todo',
verify: '--require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress',
default: '--require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@guidance',
verify: '--require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress --tags ~@guidance',
jenkins: '--require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress',
bugs: '--require features --tags @bug',
todo: '--require features --tags @todo',
+1 -4
View File
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on ways
Background:
Given the profile "bicycle"
Scenario: Bike - Access tag hierarchy on ways
Scenario: Bike - Access tag hierachy on ways
Then routability should be
| highway | access | vehicle | bicycle | bothw |
| | | | | x |
@@ -121,7 +121,6 @@ Feature: Bike - Access tags on ways
| private | | | |
| agricultural | | | |
| forestry | | | |
| delivery | | | |
| | yes | | x |
| | permissive | | x |
| | designated | | x |
@@ -130,7 +129,6 @@ Feature: Bike - Access tags on ways
| | private | | |
| | agricultural | | |
| | forestry | | |
| | delivery | | |
| | | yes | x |
| | | permissive | x |
| | | designated | x |
@@ -139,7 +137,6 @@ Feature: Bike - Access tags on ways
| | | private | |
| | | agricultural | |
| | | forestry | |
| | | delivery | |
Scenario: Bike - Access tags on both node and way
Then routability should be
+1 -4
View File
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on nodes
Background:
Given the profile "bicycle"
Scenario: Bike - Access tag hierarchy on nodes
Scenario: Bike - Access tag hierachy on nodes
Then routability should be
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
| | | | | x |
@@ -47,7 +47,6 @@ Feature: Bike - Access tags on nodes
| private | | | |
| agricultural | | | |
| forestry | | | |
| delivery | | | |
| | yes | | x |
| | permissive | | x |
| | designated | | x |
@@ -56,7 +55,6 @@ Feature: Bike - Access tags on nodes
| | private | | |
| | agricultural | | |
| | forestry | | |
| | delivery | | |
| | | yes | x |
| | | permissive | x |
| | | designated | x |
@@ -65,4 +63,3 @@ Feature: Bike - Access tags on nodes
| | | private | |
| | | agricultural | |
| | | forestry | |
| | | delivery | |
+3 -3
View File
@@ -4,7 +4,7 @@ Feature: Bike - Squares and other areas
Background:
Given the profile "bicycle"
@square
@square @mokob @2154
Scenario: Bike - Route along edge of a squares
Given the node map
| x | |
@@ -50,7 +50,7 @@ Feature: Bike - Squares and other areas
| d | a | xa,xa |
| a | d | xa,xa |
@parking
@parking @mokob @2154
Scenario: Bike - parking areas
Given the node map
| e | | | f |
@@ -78,7 +78,7 @@ Feature: Bike - Squares and other areas
| a | d | abcda,abcda |
@train @platform
@train @platform @mokob @2154
Scenario: Bike - railway platforms
Given the node map
| x | a | b | y |
+13 -13
View File
@@ -1,5 +1,5 @@
@routing @bicycle @bridge
Feature: Bicycle - Handle cycling
Feature: Bicycle - Handle movable bridge
Background:
Given the profile "bicycle"
@@ -18,14 +18,14 @@ 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 |
| a | g | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling |
| b | f | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling |
| e | c | cde,cde | movable bridge,movable bridge |
| e | b | cde,abc,abc | movable bridge,cycling,cycling |
| e | a | cde,abc,abc | movable bridge,cycling,cycling |
| c | e | cde,cde | movable bridge,movable bridge |
| c | f | cde,efg,efg | movable bridge,cycling,cycling |
| c | g | cde,efg,efg | movable bridge,cycling,cycling |
Scenario: Bicycle - Properly handle durations
Given the node map
@@ -41,7 +41,7 @@ Feature: Bicycle - Handle cycling
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
| c | e | cde,cde | cycling,cycling | 2 km/h |
| e | c | cde,cde | cycling,cycling | 2 km/h |
| a | g | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling | 5 km/h |
| b | f | abc,cde,efg,efg | cycling,movable bridge,cycling,cycling | 4 km/h |
| c | e | cde,cde | movable bridge,movable bridge | 2 km/h |
| e | c | cde,cde | movable bridge,movable bridge | 2 km/h |
+23 -23
View File
@@ -19,15 +19,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 |
| a | c | ab,bcd |
| a | d | ab,bcd |
| a | e | axye |
| e | d | de |
| e | c | de,bcd |
| e | b | de,bcd |
| e | a | axye |
Scenario: Bike - Destination only street
Given the node map
@@ -45,15 +45,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 |
| a | c | ab,bc |
| a | d | ab,bc,cd |
| a | e | axye |
| e | d | de |
| e | c | de,dc |
| e | b | de,dc,bc |
| e | a | axye |
Scenario: Bike - Routing inside a destination only area
Given the node map
@@ -70,8 +70,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 |
+42 -42
View File
@@ -16,13 +16,13 @@ Feature: Bike - Mode flag
| cd | primary | | |
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,ferry,cycling,cycling |
| 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 |
| from | to | route | turns | modes |
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,ferry,cycling,cycling |
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,ferry,cycling,cycling |
| c | a | bc,ab,ab | depart,left,arrive | ferry,cycling,cycling |
| d | b | cd,bc,bc | depart,right,arrive | cycling,ferry,ferry |
| a | c | ab,bc,bc | depart,right,arrive | cycling,ferry,ferry |
| b | d | bc,cd,cd | depart,left,arrive | ferry,cycling,cycling |
Scenario: Bike - Mode when using a train
Given the node map
@@ -36,13 +36,13 @@ Feature: Bike - Mode flag
| cd | primary | | |
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,train,cycling,cycling |
| 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 |
| from | to | route | turns | modes |
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,train,cycling,cycling |
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,train,cycling,cycling |
| c | a | bc,ab,ab | depart,left,arrive | train,cycling,cycling |
| d | b | cd,bc,bc | depart,right,arrive | cycling,train,train |
| a | c | ab,bc,bc | depart,right,arrive | cycling,train,train |
| b | d | bc,cd,cd | depart,left,arrive | train,cycling,cycling |
Scenario: Bike - Mode when pushing bike against oneways
Given the node map
@@ -56,13 +56,13 @@ Feature: Bike - Mode flag
| cd | primary | |
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | cycling,cycling,cycling |
| b | d | bc,cd,cd | cycling,cycling,cycling |
| from | to | route | turns | modes |
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,cycling,cycling,cycling |
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | depart,right,arrive | cycling,cycling,cycling |
| b | d | bc,cd,cd | depart,left,arrive | cycling,cycling,cycling |
Scenario: Bike - Mode when pushing on pedestrain streets
Given the node map
@@ -76,13 +76,13 @@ Feature: Bike - Mode flag
| 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 |
| from | to | route | turns | modes |
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | depart,left,arrive | pushing bike,cycling,cycling |
Scenario: Bike - Mode when pushing on pedestrain areas
Given the node map
@@ -116,13 +116,13 @@ Feature: Bike - Mode flag
| 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 |
| from | to | route | turns | modes |
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | depart,left,arrive | pushing bike,cycling,cycling |
Scenario: Bike - Mode when bicycle=dismount
Given the node map
@@ -136,13 +136,13 @@ Feature: Bike - Mode flag
| 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 |
| from | to | route | turns | modes |
| a | d | ab,bc,cd,cd | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
| d | a | cd,bc,ab,ab | depart,right,left,arrive | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | depart,left,arrive | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | depart,right,arrive | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | depart,left,arrive | pushing bike,cycling,cycling |
Scenario: Bicycle - Modes when starting on forward oneway
Given the node map
+12 -10
View File
@@ -63,6 +63,7 @@ Feature: Bike - Accessability of different way types
| runway | | | |
| runway | yes | foot | foot |
@todo
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
Then routability should be
| highway | foot:forward | foot:backward | forw | backw |
@@ -97,12 +98,13 @@ Feature: Bike - Accessability of different way types
| cd | primary | |
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
| from | to | route | turns |
| a | d | ab,bc,cd,cd | depart,right,left,arrive |
| d | a | cd,bc,ab,ab | depart,right,left,arrive |
| c | a | bc,ab,ab | depart,left,arrive |
| d | b | cd,bc,bc | depart,right,arrive |
@todo
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
Given the node map
| a | b | |
@@ -115,8 +117,8 @@ Feature: Bike - Accessability of different way types
| cd | primary |
When I route I should get
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
| from | to | route | turns |
| a | d | ab,bc,cd,cd | depart,right,left,arrive |
| d | a | cd,bc,ab,ab | depart,right,left,arrive |
| c | a | bc,ab,ab | depart,left,arrive |
| d | b | cd,bc,bc | depart,right,arrive |
+30
View File
@@ -0,0 +1,30 @@
@routing @bicycle @roundabout @instruction
Feature: Roundabout Instructions
Background:
Given the profile "bicycle"
Scenario: Bicycle - Roundabout instructions
Given the node map
| | | v | | |
| | | d | | |
| s | a | | c | u |
| | | b | | |
| | | t | | |
And the ways
| nodes | junction |
| sa | |
| tb | |
| uc | |
| vd | |
| abcda | roundabout |
When I route I should get
| from | to | route | turns |
| s | t | sa,tb,tb | depart,roundabout-exit-1,arrive |
| s | u | sa,uc,uc | depart,roundabout-exit-2,arrive |
| s | v | sa,vd,vd | depart,roundabout-exit-3,arrive |
| u | v | uc,vd,vd | depart,roundabout-exit-1,arrive |
| u | s | uc,sa,sa | depart,roundabout-exit-2,arrive |
| u | t | uc,tb,tb | depart,roundabout-exit-3,arrive |
+2 -4
View File
@@ -5,7 +5,7 @@ Feature: Car - Restricted access
Background:
Given the profile "car"
Scenario: Car - Access tag hierarchy on ways
Scenario: Car - Access tag hierachy on ways
Then routability should be
| access | vehicle | motor_vehicle | motorcar | bothw |
| | | | | x |
@@ -30,7 +30,7 @@ Feature: Car - Restricted access
| | | no | yes | x |
| | | yes | no | |
Scenario: Car - Access tag hierarchy on nodes
Scenario: Car - Access tag hierachy on nodes
Then routability should be
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
| | | | | x |
@@ -94,7 +94,6 @@ Feature: Car - Restricted access
| agricultural | |
| forestry | |
| psv | |
| delivery | |
| some_tag | x |
@@ -109,7 +108,6 @@ Feature: Car - Restricted access
| agricultural | |
| forestry | |
| psv | |
| delivery | |
| some_tag | x |
Scenario: Car - Access tags on both node and way
+3
View File
@@ -34,6 +34,7 @@ OSRM will use 4/5 of the projected free-flow speed.
| a | b | ab,ab | 47 km/h +- 1 |
| b | c | bc,bc | 47 km/h +- 1 |
@mokob @2162
Scenario: Car - Advisory speed overwrites backwards maxspeed
Given the node map
| a | b | c |
@@ -48,6 +49,7 @@ OSRM will use 4/5 of the projected free-flow speed.
| b | a | ab,ab | 47 km/h +- 1 |
| c | b | bc,bc | 47 km/h +- 1 |
@mokob @2162 @deleteme
Scenario: Car - Advisory speed overwrites backwards maxspeed
Given the node map
| a | b | c | d |
@@ -63,6 +65,7 @@ OSRM will use 4/5 of the projected free-flow speed.
| c | b | bc,bc | 47 km/h +- 1 |
| d | c | cd,cd | 47 km/h +- 1 |
@mokob @2162
Scenario: Car - Directional advisory speeds play nice with eachother
Given the node map
| a | b | c |
+13 -13
View File
@@ -1,5 +1,5 @@
@routing @car @bridge
Feature: Car - Handle driving
Feature: Car - Handle movable bridge
Background:
Given the profile "car"
@@ -18,14 +18,14 @@ Feature: Car - Handle driving
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 |
| a | g | abc,cde,efg,efg | driving,movable bridge,driving,driving |
| b | f | abc,cde,efg,efg | driving,movable bridge,driving,driving |
| e | c | cde,cde | movable bridge,movable bridge |
| e | b | cde,abc,abc | movable bridge,driving,driving |
| e | a | cde,abc,abc | movable bridge,driving,driving |
| c | e | cde,cde | movable bridge,movable bridge |
| c | f | cde,efg,efg | movable bridge,driving,driving |
| c | g | cde,efg,efg | movable bridge,driving,driving |
Scenario: Car - Properly handle durations
Given the node map
@@ -41,7 +41,7 @@ Feature: Car - Handle driving
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 |
| a | g | abc,cde,efg,efg | driving,movable bridge,driving,driving | 7 km/h |
| b | f | abc,cde,efg,efg | driving,movable bridge,driving,driving | 5 km/h |
| c | e | cde,cde | movable bridge,movable bridge | 2 km/h |
| e | c | cde,cde | movable bridge,movable bridge | 2 km/h |
+23 -23
View File
@@ -19,15 +19,15 @@ Feature: Car - 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 |
| a | c | ab,bcd |
| a | d | ab,bcd |
| a | e | axye |
| e | d | de |
| e | c | de,bcd |
| e | b | de,bcd |
| e | a | axye |
Scenario: Car - Destination only street
Given the node map
@@ -45,15 +45,15 @@ Feature: Car - 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 |
| a | c | ab,bc |
| a | d | ab,bc,cd |
| a | e | axye |
| e | d | de |
| e | c | de,dc |
| e | b | de,dc,bc |
| e | a | axye |
Scenario: Car - Routing inside a destination only area
Given the node map
@@ -70,8 +70,8 @@ Feature: Car - 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 |
+9 -9
View File
@@ -15,13 +15,13 @@ Feature: Car - Mode flag
| 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 |
| from | to | route | turns | modes |
| a | d | ab,bc,cd,cd | depart,right,left,arrive | driving,ferry,driving,driving |
| d | a | cd,bc,ab,ab | depart,right,left,arrive | driving,ferry,driving,driving |
| c | a | bc,ab,ab | depart,left,arrive | ferry,driving,driving |
| d | b | cd,bc,bc | depart,right,arrive | driving,ferry,ferry |
| a | c | ab,bc,bc | depart,right,arrive | driving,ferry,ferry |
| b | d | bc,cd,cd | depart,left,arrive | ferry,driving,driving |
Scenario: Car - Snapping when using a ferry
Given the node map
@@ -34,7 +34,7 @@ Feature: Car - Mode flag
| ef | primary | | |
When I route I should get
| from | to | route | modes | time |
| c | d | bcde,bcde | ferry,ferry | 600s |
| from | to | route | turns | modes | time |
| c | d | bcde,bcde | depart,arrive | ferry,ferry | 600s |
+30
View File
@@ -0,0 +1,30 @@
@routing @car @roundabout @instruction
Feature: Roundabout Instructions
Background:
Given the profile "car"
Scenario: Car - Roundabout instructions
Given the node map
| | | v | | |
| | | d | | |
| s | a | | c | u |
| | | b | | |
| | | t | | |
And the ways
| nodes | junction |
| sa | |
| tb | |
| uc | |
| vd | |
| abcda | roundabout |
When I route I should get
| from | to | route | turns |
| s | t | sa,tb,tb | depart,roundabout-exit-1,arrive |
| s | u | sa,uc,uc | depart,roundabout-exit-2,arrive |
| s | v | sa,vd,vd | depart,roundabout-exit-3,arrive |
| u | v | uc,vd,vd | depart,roundabout-exit-1,arrive |
| u | s | uc,sa,sa | depart,roundabout-exit-2,arrive |
| u | t | uc,tb,tb | depart,roundabout-exit-3,arrive |
+1 -3
View File
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on ways
Background:
Given the profile "foot"
Scenario: Foot - Access tag hierarchy on ways
Scenario: Foot - Access tag hierachy on ways
Then routability should be
| highway | access | foot | bothw |
| footway | | | x |
@@ -52,7 +52,6 @@ Feature: Foot - Access tags on ways
| private | | |
| agricultural | | |
| forestry | | |
| delivery | | |
| | yes | x |
| | permissive | x |
| | designated | x |
@@ -61,7 +60,6 @@ Feature: Foot - Access tags on ways
| | private | |
| | agricultural | |
| | forestry | |
| | delivery | |
Scenario: Foot - Access tags on both node and way
Then routability should be
+1 -3
View File
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on nodes
Background:
Given the profile "foot"
Scenario: Foot - Access tag hierarchy on nodes
Scenario: Foot - Access tag hierachy on nodes
Then routability should be
| node/access | node/foot | bothw |
| | | x |
@@ -40,7 +40,6 @@ Feature: Foot - Access tags on nodes
| private | | |
| agricultural | | |
| forestry | | |
| delivery | | |
| no | yes | x |
| no | permissive | x |
| no | designated | x |
@@ -49,4 +48,3 @@ Feature: Foot - Access tags on nodes
| yes | private | |
| yes | agricultural | |
| yes | forestry | |
| yes | delivery | |
-90
View File
@@ -1,90 +0,0 @@
@routing @guidance
Feature: Continue Instructions
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Road turning left
Given the node map
| | | c | |
| a | | b | d |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue left,arrive |
| a,d | abc,bd,bd | depart,new name straight,arrive |
Scenario: Road turning right
Given the node map
| a | | b | d |
| | | c | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue right,arrive |
| a,d | abc,bd,bd | depart,new name straight,arrive |
Scenario: Road turning slight left
Given the node map
| | | | | c |
| | | | | |
| a | | b | | |
| | | | d | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue left,arrive |
| a,d | abc,bd,bd | depart,turn right,arrive |
Scenario: Road turning slight right
Given the node map
| | | | d | |
| a | | b | | |
| | | | | |
| | | | | c |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue right,arrive |
| a,d | abc,bd,bd | depart,turn left,arrive |
Scenario: Road Loop
Given the node map
| | | f | | e |
| | | | | |
| a | | b | g | |
| | | | | |
| | | c | | d |
And the ways
| nodes | highway |
| abcdefb | primary |
| bg | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
| a,f | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
| a,e | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
-123
View File
@@ -1,123 +0,0 @@
@routing @guidance
Feature: End Of Road Instructions
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: End of Road with through street
Given the node map
| | | c |
| a | | b |
| | | d |
And the ways
| nodes | highway |
| ab | primary |
| cbd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
Scenario: End of Road with three streets
Given the node map
| | | c |
| a | | b |
| | | d |
And the ways
| nodes | highway |
| ab | primary |
| cb | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cb,cb | depart,end of road left,arrive |
| a,d | ab,bd,bd | depart,end of road right,arrive |
Scenario: End of Road with three streets, slightly angled
Given the node map
| a | | | | | c |
| | | | | | b |
| | | | | | d |
And the ways
| nodes | highway |
| ab | primary |
| cb | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cb,cb | depart,end of road left,arrive |
| a,d | ab,bd,bd | depart,end of road right,arrive |
Scenario: End of Road with three streets, slightly angled
Given the node map
| | | | | | c |
| | | | | | b |
| a | | | | | d |
And the ways
| nodes | highway |
| ab | primary |
| cb | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cb,cb | depart,end of road left,arrive |
| a,d | ab,bd,bd | depart,end of road right,arrive |
Scenario: End of Road with through street, slightly angled
Given the node map
| a | | | | | c |
| | | | | | b |
| | | | | | d |
And the ways
| nodes | highway |
| ab | primary |
| cbd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
Scenario: End of Road with through street, slightly angled
Given the node map
| | | | | | c |
| | | | | | b |
| a | | | | | d |
And the ways
| nodes | highway |
| ab | primary |
| cbd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cbd,cbd | depart,end of road left,arrive |
| a,d | ab,cbd,cbd | depart,end of road right,arrive |
Scenario: End of Road with two ramps - prefer ramp over end of road
Given the node map
| | | c |
| a | | b |
| | | d |
And the ways
| nodes | highway |
| ab | primary |
| bc | motorway_link |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,ramp left,arrive |
| a,d | ab,bd,bd | depart,ramp right,arrive |
-284
View File
@@ -1,284 +0,0 @@
@routing @guidance
Feature: Fork Instructions
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Fork Same Road Class
Given the node map
| | | | | c |
| a | | b | | |
| | | | | d |
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork slight right,arrive |
Scenario: Do not fork on link type
Given the node map
| | | | | c |
| a | | b | | |
| | | | | d |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary_link |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| a,d | abc,bd,bd | depart,turn slight right,arrive |
Scenario: Fork in presence of other roads
Given the node map
| | | | | c |
| a | | b | | |
| | e | | | d |
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| bd | primary |
| eb | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork slight right,arrive |
Scenario: Fork Turning Slight Left
Given the node map
| | | | | | c |
| | | | | | |
| a | | b | | | |
| | | | | d | |
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork slight right,arrive |
Scenario: Fork Turning Slight Right
Given the node map
| | | | | c | |
| a | | b | | | |
| | | | | | |
| | | | | | d |
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork slight right,arrive |
Scenario: Do not fork on service
Given the node map
| | | | | c |
| a | | b | | |
| | | | | d |
And the ways
| nodes | highway |
| abc | residential |
| bd | service |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| a,d | abc,bd,bd | depart,turn slight right,arrive |
Scenario: Fork Both Turning Slight Right
Given the node map
| a | | b | | | |
| | | | | | c |
| | | | | | d |
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork slight right,arrive |
Scenario: Fork Both Turning Slight Left
Given the node map
| | | | | | c |
| | | | | | d |
| a | | b | | | |
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork slight right,arrive |
Scenario: Fork Both Turning Slight Right - Unnamed
Given the node map
| a | | b | | | |
| | | | | | c |
| | | | | | d |
And the ways
| nodes | highway | name |
| ab | primary | |
| bc | primary | |
| bd | primary | |
When I route I should get
| waypoints | route | turns |
| a,c | ,, | depart,fork slight left,arrive |
| a,d | ,, | depart,fork slight right,arrive |
Scenario: Fork Both Turning Slight Left - Unnamed
Given the node map
| | | | | | c |
| | | | | | d |
| a | | b | | | |
And the ways
| nodes | highway | name |
| ab | primary | |
| bc | primary | |
| bd | primary | |
When I route I should get
| waypoints | route | turns |
| a,c | ,, | depart,fork slight left,arrive |
| a,d | ,, | depart,fork slight right,arrive |
Scenario: Fork Both Turning Very Slightly Right - Unnamed
Given the node map
| a | | b | | | | | | | | | | | | | | | |
| | | | | | | | | | | | c | | | | | | |
| | | | | | | | | | | | | | | | | | d |
And the ways
| nodes | highway | name |
| ab | primary | |
| bc | primary | |
| bd | primary | |
When I route I should get
| waypoints | route | turns |
| a,c | ,, | depart,fork slight left,arrive |
| a,d | ,, | depart,fork slight right,arrive |
Scenario: Fork Both Turning Very Slightly Right - Unnamed Ramps
Given the node map
| a | | b | | | | | | | | | | | | | | | |
| | | | | | | | | | | | c | | | | | | |
| | | | | | | | | | | | | | | | | | d |
And the ways
| nodes | highway | name |
| ab | motorway_link | |
| bc | motorway_link | |
| bd | motorway_link | |
When I route I should get
| waypoints | route | turns |
| a,c | ,, | depart,fork slight left,arrive |
| a,d | ,, | depart,fork slight right,arrive |
Scenario: Non-Fork on complex intersection - left
Given the node map
| | | | | c |
| a | | b | | |
| | e | | | d |
And the ways
| nodes | highway |
| abc | secondary |
| bd | tertiary |
| eb | tertiary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| a,d | abc,bd,bd | depart,turn slight right,arrive |
Scenario: Non-Fork on complex intersection - right
Given the node map
| | e | | | c |
| a | | b | | |
| | | | | d |
And the ways
| nodes | highway |
| abd | secondary |
| bc | tertiary |
| eb | tertiary |
When I route I should get
| waypoints | route | turns |
| a,c | abd,bc,bc | depart,turn slight left,arrive |
| a,d | abd,abd | depart,arrive |
@pr2275 @bug
Scenario: Tripple fork
Given the node map
| | | | | | | | | c |
| a | | b | | d | | | | |
| | | | | | | | | e |
And the ways
| nodes | highway |
| ab | secondary |
| bc | secondary |
| bd | secondary |
| be | secondary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,fork slight left,arrive |
| a,d | ab,bd,bd | depart,fork straight,arrive |
| a,e | ab,be,be | depart,fork slight right,arrive |
Scenario: Tripple fork -- middle obvious
Given the node map
| | | | | c |
| a | | b | | d |
| | | | | e |
And the ways
| nodes | highway |
| abd | secondary |
| bc | secondary |
| be | secondary |
When I route I should get
| waypoints | route | turns |
| a,c | abd,bc,bc | depart,turn slight left,arrive |
| a,d | abd,abd | depart,arrive |
| a,e | abd,be,be | depart,turn slight right,arrive |
-52
View File
@@ -1,52 +0,0 @@
@routing @guidance
Feature: Merging
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Merge on Four Way Intersection
Given the node map
| d | | |
| a | b | c |
| e | | |
And the ways
| nodes | highway |
| abc | primary |
| db | primary |
| eb | primary |
When I route I should get
| waypoints | route | turns |
| d,c | db,abc,abc | depart,merge slight right,arrive |
| e,c | eb,abc,abc | depart,merge slight left,arrive |
Scenario: Merge on Three Way Intersection Right
Given the node map
| d | | |
| a | b | c |
And the ways
| nodes | highway |
| abc | primary |
| db | primary |
When I route I should get
| waypoints | route | turns |
| d,c | db,abc,abc | depart,merge slight right,arrive |
Scenario: Merge on Three Way Intersection Right
Given the node map
| a | b | c |
| d | | |
And the ways
| nodes | highway |
| abc | primary |
| db | primary |
When I route I should get
| waypoints | route | turns |
| d,c | db,abc,abc | depart,merge slight left,arrive |
+42 -58
View File
@@ -1,8 +1,8 @@
@routing @guidance
Feature: Motorway Guidance
Feature: Basic Roundabout
Background:
Given the profile "car"
Given the profile "testbot"
Given a grid size of 10 meters
Scenario: Ramp Exit Right
@@ -16,9 +16,9 @@ Feature: Motorway Guidance
| bfg | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,bfg,bfg | depart,ramp slight right,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| a,g | abcde, bfg, bfg | depart, ramp-slight-right, arrive |
Scenario: Ramp Exit Right Curved Right
Given the node map
@@ -32,9 +32,9 @@ Feature: Motorway Guidance
| bfg | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,bfg,bfg | depart,ramp right,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| a,g | abcde, bfg, bfg | depart, ramp-slight-right, arrive |
Scenario: Ramp Exit Right Curved Left
Given the node map
@@ -49,9 +49,9 @@ Feature: Motorway Guidance
| cfg | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,cfg,cfg | depart,ramp slight right,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| a,g | abcde, cfg, cfg | depart, ramp-slight-right, arrive |
Scenario: Ramp Exit Left
@@ -65,9 +65,9 @@ Feature: Motorway Guidance
| bfg | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,bfg,bfg | depart,ramp slight left,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| a,g | abcde, bfg, bfg | depart, ramp-slight-left, arrive |
Scenario: Ramp Exit Left Curved Left
Given the node map
@@ -81,9 +81,9 @@ Feature: Motorway Guidance
| bfg | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,bfg,bfg | depart,ramp left,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| a,g | abcde, bfg, bfg | depart, ramp-slight-left, arrive |
Scenario: Ramp Exit Left Curved Right
Given the node map
@@ -97,9 +97,9 @@ Feature: Motorway Guidance
| cfg | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,cfg,cfg | depart,ramp slight left,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| a,g | abcde, cfg, cfg | depart, ramp-slight-left, arrive |
Scenario: On Ramp Right
Given the node map
@@ -112,9 +112,9 @@ Feature: Motorway Guidance
| fgd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| f,e | fgd,abcde,abcde | depart,merge slight left,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| f,e | abcde, fgd, fgd | depart, merge-slight-left, arrive |
Scenario: On Ramp Left
Given the node map
@@ -127,9 +127,9 @@ Feature: Motorway Guidance
| fgd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| f,e | fgd,abcde,abcde | depart,merge slight right,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| f,e | abcde, fgd, fgd | depart, merge-slight-right, arrive |
Scenario: Highway Fork
Given the node map
@@ -143,9 +143,9 @@ Feature: Motorway Guidance
| cfg | motorway |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde,abcde | depart,fork slight left,arrive |
| a,g | abcde,cfg,cfg | depart,fork slight right,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde, abcde | depart, fork-left, arrive |
| a,g | abcde, cfg, cfg | depart, fork-right, arrive |
Scenario: Fork After Ramp
Given the node map
@@ -160,9 +160,9 @@ Feature: Motorway Guidance
| cfg | motorway |
When I route I should get
| waypoints | route | turns |
| a,e | abc,cde,cde | depart,fork slight left,arrive |
| a,g | abc,cfg,cfg | depart,fork slight right,arrive |
| waypoints | route | turns |
| a,e | abc, cde, cde | depart, fork-left, arrive |
| a,g | abc, cfg, cfg | depart, fork-right, arrive |
Scenario: On And Off Ramp Right
Given the node map
@@ -176,11 +176,11 @@ Feature: Motorway Guidance
| chi | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| f,e | fgc,abcde,abcde | depart,merge slight left,arrive |
| a,i | abcde,chi,chi | depart,ramp slight right,arrive |
| f,i | fgc,chi,chi | depart,ramp right,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| f,e | fgc, abcde, abcde | depart, merge-slight-left, arrive |
| a,i | abcde, chi, chi | depart, ramp-slight-right, arrive |
| f,i | fgc, chi, chi | depart, turn-slight-right, arrive |
Scenario: On And Off Ramp Left
Given the node map
@@ -194,25 +194,9 @@ Feature: Motorway Guidance
| chi | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| f,e | fgc,abcde,abcde | depart,merge slight right,arrive |
| a,i | abcde,chi,chi | depart,ramp slight left,arrive |
| f,i | fgc,chi,chi | depart,ramp left,arrive |
| waypoints | route | turns |
| a,e | abcde, abcde | depart, arrive |
| f,e | fgc, abcde, abcde | depart, merge-slight-right, arrive |
| a,i | abcde, chi, chi | depart, ramp-slight-left, arrive |
| f,i | fgc, chi, chi | depart, turn-slight-left, arrive |
Scenario: Merging Motorways
Given the node map
| e | | |
| a | b | c |
| d | | |
And the ways
| nodes | highway |
| abc | motorway |
| db | motorway |
| eb | motorway |
When I route I should get
| waypoints | route | turns |
| d,c | db,abc,abc | depart,merge slight left,arrive |
| e,c | eb,abc,abc | depart,merge slight right,arrive |
-135
View File
@@ -1,135 +0,0 @@
@routing @guidance
Feature: New-Name Instructions
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Undisturbed name Change
Given the node map
| a | | b | | c |
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name straight,arrive |
Scenario: Undisturbed Name Change with unannounced Turn Right
Given the node map
| a | | b | | |
| | | | | c |
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name slight right,arrive |
Scenario: Undisturbed Name Change with unannounced Turn Left
Given the node map
| | | | | c |
| a | | b | | |
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name slight left,arrive |
Scenario: Disturbed Name Change with Turn
Given the node map
| a | | b | | |
| | d | | | c |
And the ways
| nodes |
| ab |
| bc |
| db |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name slight right,arrive |
Scenario: Undisturbed Name Change with announced Turn Left
Given the node map
| | | c |
| a | | b |
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name left,arrive |
Scenario: Undisturbed Name Change with announced Turn Sharp Left
Given the node map
| c | | |
| a | | b |
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name sharp left,arrive |
Scenario: Undisturbed Name Change with announced Turn Right
Given the node map
| a | | b |
| | | c |
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name right,arrive |
Scenario: Undisturbed Name Change with announced Turn Sharp Right
Given the node map
| a | | b |
| c | | |
And the ways
| nodes |
| ab |
| bc |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name sharp right,arrive |
Scenario: Disturbed Name Change with minor road class
Given the node map
| a | | b | | d |
| | | | | c |
And the ways
| nodes | highway |
| ab | residential |
| bc | residential |
| bd | service |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,new name slight right,arrive |
-229
View File
@@ -1,229 +0,0 @@
@routing @guidance
Feature: Ramp Guidance
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Ramp On Through Street Right
Given the node map
| a | b | c |
| | d | |
And the ways
| nodes | highway |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp right,arrive |
Scenario: Ramp On Through Street Left
Given the node map
| | d | |
| a | b | c |
And the ways
| nodes | highway |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp left,arrive |
Scenario: Ramp On Through Street Left and Right
Given the node map
| | e | |
| a | b | c |
| | d | |
And the ways
| nodes | highway |
| be | motorway_link |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp right,arrive |
| a,e | abc,be,be | depart,ramp left,arrive |
Scenario: Ramp On Three Way Intersection Right
Given the node map
| a | b | c |
| | d | |
And the ways
| nodes | highway |
| ab | tertiary |
| bc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | ab,bd,bd | depart,ramp right,arrive |
Scenario: Ramp On Three Way Intersection Right
Given the node map
| | | c |
| a | b | |
| | d | |
And the ways
| nodes | highway |
| ab | tertiary |
| bc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | ab,bd,bd | depart,ramp right,arrive |
Scenario: Ramp Off Though Street
Given the node map
| | | c |
| a | b | |
| | d | |
And the ways
| nodes | highway |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp right,arrive |
| a,c | abc,abc | depart,arrive |
Scenario: Straight Ramp Off Turning Though Street
Given the node map
| | | c |
| a | b | d |
And the ways
| nodes | highway |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp straight,arrive |
| a,c | abc,abc,abc | depart,continue left,arrive |
Scenario: Fork Ramp Off Turning Though Street
Given the node map
| | | c |
| a | b | |
| | | d |
And the ways
| nodes | highway |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp right,arrive |
| a,c | abc,abc,abc | depart,continue left,arrive |
Scenario: Fork Ramp
Given the node map
| | | c |
| a | b | |
| | | d |
And the ways
| nodes | highway |
| ab | tertiary |
| bc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | ab,bd,bd | depart,ramp right,arrive |
| a,c | ab,bc,bc | depart,turn left,arrive |
Scenario: Fork Slight Ramp
Given the node map
| | | | c |
| a | b | | |
| | | | d |
And the ways
| nodes | highway |
| ab | tertiary |
| bc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | ab,bd,bd | depart,ramp slight right,arrive |
| a,c | ab,bc,bc | depart,turn slight left,arrive |
Scenario: Fork Slight Ramp on Through Street
Given the node map
| | | | c |
| a | b | | |
| | | | d |
And the ways
| nodes | highway |
| abc | tertiary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp slight right,arrive |
| a,c | abc,abc,abc | depart,continue slight left,arrive |
Scenario: Fork Slight Ramp on Obvious Through Street
Given the node map
| | | | c |
| a | b | | |
| | | | d |
And the ways
| nodes | highway |
| abc | primary |
| bd | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,ramp slight right,arrive |
| a,c | abc,abc | depart,arrive |
Scenario: Two Ramps Joining into common Motorway
Given the node map
| a | | | |
| | | c | d |
| b | | | |
And the ways
| nodes | highway |
| ac | motorway_link |
| bc | motorway_link |
| cd | motorway |
When I route I should get
| waypoints | route | turns |
| a,d | ac,cd,cd | depart,new name slight left,arrive |
| b,d | bc,cd,cd | depart,new name slight right,arrive |
Scenario: Two Ramps Joining into common Motorway Unnamed
Given the node map
| a | | | |
| | | c | d |
| b | | | |
And the ways
| nodes | highway | name |
| ac | motorway_link | |
| bc | motorway_link | |
| cd | motorway | |
When I route I should get
| waypoints | route | turns |
| a,d | , | depart,arrive |
| b,d | , | depart,arrive |
-167
View File
@@ -1,167 +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 |
-262
View File
@@ -1,262 +0,0 @@
@routing @guidance
Feature: Rotary
Background:
Given the profile "car"
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 |
Scenario: Collinear in X,Y
Given the node map
| a | | |
| b | | |
| c | d | f |
| e | | |
And the ways
| nodes | junction |
| ab | |
| bcdb | roundabout |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,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 |
| ab | |
| bcdb | roundabout |
| 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 | | |
| c | | |
| d | b | f |
| e | | |
And the ways
| nodes | junction |
| ab | |
| bcdb | roundabout |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,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 | roundabout |
| 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 | roundabout |
| 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 |
-166
View File
@@ -1,166 +0,0 @@
@routing @guidance
Feature: Basic Roundabout
Background:
Given the profile "bicycle"
Given a grid size of 10 meters
Scenario: Enter and Exit
Given the node map
| | | a | | |
| | | b | | |
| h | g | | c | d |
| | | e | | |
| | | f | | |
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bgecb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
Scenario: Only Enter
Given the node map
| | | a | | |
| | | 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,roundabout-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
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,roundabout-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
| c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
| e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
| g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,roundabout-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 |
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,roundabout-exit-1,arrive |
| a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
| a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
| a,f | abc,def,def | depart,roundabout-exit-4,arrive |
| d,f | def,def,def | depart,roundabout-exit-1,arrive |
| d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
| d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
| d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
| g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
| g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
| g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
| j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
| j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
| j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
+47 -135
View File
@@ -2,7 +2,7 @@
Feature: Basic Roundabout
Background:
Given the profile "car"
Given the profile "testbot"
Given a grid size of 10 meters
Scenario: Enter and Exit
@@ -19,28 +19,28 @@ Feature: Basic Roundabout
| cd | |
| ef | |
| gh | |
| bgecb | roundabout |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
| a,d | ab,cd,cd | depart,roundabout-exit-1,arrive |
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
| a,h | ab,gh,gh | depart,roundabout-exit-3,arrive |
| d,f | cd,ef,ef | depart,roundabout-exit-1,arrive |
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
| d,a | cd,ab,ab | depart,roundabout-exit-3,arrive |
| f,h | ef,gh,gh | depart,roundabout-exit-1,arrive |
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
| f,d | ef,cd,cd | depart,roundabout-exit-3,arrive |
| h,a | gh,ab,ab | depart,roundabout-exit-1,arrive |
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
| h,f | gh,ef,ef | depart,roundabout-exit-3,arrive |
Scenario: Only Enter
Given the node map
| | | a | | |
| | | b | | |
| d | c | | g | h |
| h | g | | c | d |
| | | e | | |
| | | f | | |
@@ -53,25 +53,29 @@ Feature: Basic Roundabout
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| a,e | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| a,g | ab,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,e | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,g | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| d,b | cd,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,g | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,b | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| f,c | ef,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,b | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,c | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| h,e | gh,bcegb,bcegb | depart,roundabout-exit-undefined,arrive |
| waypoints | route | turns |
| a,b | ab,ab | depart,arrive |
| a,c | ab,bcegb | depart,roundabout-enter,arrive |
| a,e | ab,bcegb | depart,roundabout-enter,arrive |
| a,g | ab,bcegb | depart,roundabout-enter,arrive |
| d,c | cd,cd | depart,arrive |
| d,e | cd,bcegb | depart,roundabout-enter,arrive |
| d,g | cd,bcegb | depart,roundabout-enter,arrive |
| d,b | cd,bcegb | depart,roundabout-enter,arrive |
| f,e | ef,ef | depart,arrive |
| f,g | ef,bcegb | depart,roundabout-enter,arrive |
| f,b | ef,bcegb | depart,roundabout-enter,arrive |
| f,c | ef,bcegb | depart,roundabout-enter,arrive |
| h,g | gh,gh | depart,arrive |
| h,b | gh,bcegb | depart,roundabout-enter,arrive |
| h,c | gh,bcegb | depart,roundabout-enter,arrive |
| h,e | gh,bcegb | depart,roundabout-enter,arrive |
Scenario: Only Exit
Given the node map
| | | a | | |
| | | b | | |
| d | c | | g | h |
| h | g | | c | d |
| | | e | | |
| | | f | | |
@@ -85,25 +89,28 @@ Feature: Basic Roundabout
When I route I should get
| waypoints | route | turns |
| b,a | ab,ab | depart,arrive |
| b,d | bcegb,cd,cd | depart,roundabout-exit-1,arrive |
| b,f | bcegb,ef,ef | depart,roundabout-exit-2,arrive |
| b,h | bcegb,gh,gh | depart,roundabout-exit-3,arrive |
| c,d | cd,cd | depart,arrive |
| c,f | bcegb,ef,ef | depart,roundabout-exit-1,arrive |
| c,h | bcegb,gh,gh | depart,roundabout-exit-2,arrive |
| c,a | bcegb,ab,ab | depart,roundabout-exit-3,arrive |
| e,f | ef,ef | depart,arrive |
| e,h | bcegb,gh,gh | depart,roundabout-exit-1,arrive |
| e,a | bcegb,ab,ab | depart,roundabout-exit-2,arrive |
| e,d | bcegb,cd,cd | depart,roundabout-exit-3,arrive |
| g,h | gh,gh | depart,arrive |
| g,a | bcegb,ab,ab | depart,roundabout-exit-1,arrive |
| g,d | bcegb,cd,cd | depart,roundabout-exit-2,arrive |
| g,f | bcegb,ef,ef | depart,roundabout-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 |
| h | g | | c | d |
| | | e | | |
| | | f | | |
@@ -132,11 +139,11 @@ Feature: Basic Roundabout
Scenario: Mixed Entry and Exit
Given the node map
| | c | | a | |
| j | | b | | f |
| | a | | c | |
| l | | b | | d |
| | k | | e | |
| l | | h | | d |
| | g | | i | |
| j | | h | | f |
| | i | | g | |
And the ways
| nodes | junction | oneway |
@@ -144,118 +151,23 @@ Feature: Basic Roundabout
| def | | yes |
| ghi | | yes |
| jkl | | yes |
| bkheb | roundabout | yes |
| behkb | roundabout | yes |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,roundabout-exit-1,arrive |
| a,l | abc,jkl,jkl | depart,roundabout-exit-2,arrive |
| a,f | abc,def,def | depart,roundabout-exit-2,arrive |
| a,i | abc,ghi,ghi | depart,roundabout-exit-3,arrive |
| a,f | abc,def,def | depart,roundabout-exit-4,arrive |
| a,l | abc,jkl,jkl | depart,roundabout-exit-4,arrive |
| d,f | def,def,def | depart,roundabout-exit-1,arrive |
| d,c | def,abc,abc | depart,roundabout-exit-2,arrive |
| d,i | def,ghi,ghi | depart,roundabout-exit-2,arrive |
| d,l | def,jkl,jkl | depart,roundabout-exit-3,arrive |
| d,i | def,ghi,ghi | depart,roundabout-exit-4,arrive |
| d,c | def,abc,abc | depart,roundabout-exit-4,arrive |
| g,i | ghi,ghi,ghi | depart,roundabout-exit-1,arrive |
| g,f | ghi,def,def | depart,roundabout-exit-2,arrive |
| g,l | ghi,jkl,jkl | depart,roundabout-exit-2,arrive |
| g,c | ghi,abc,abc | depart,roundabout-exit-3,arrive |
| g,l | ghi,jkl,jkl | depart,roundabout-exit-4,arrive |
| g,f | ghi,edf,edf | depart,roundabout-exit-4,arrive |
| j,l | jkl,jkl,jkl | depart,roundabout-exit-1,arrive |
| j,i | jkl,ghi,ghi | depart,roundabout-exit-2,arrive |
| j,c | jkl,abc,abc | depart,roundabout-exit-2,arrive |
| j,f | jkl,def,def | depart,roundabout-exit-3,arrive |
| j,c | jkl,abc,abc | depart,roundabout-exit-4,arrive |
Scenario: Collinear in X
Given the node map
| a | b | c | d | f |
| | | e | | |
And the ways
| nodes | junction |
| ab | |
| bcdb | roundabout |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
Scenario: Collinear in Y
Given the node map
| a | |
| b | |
| c | e |
| d | |
| f | |
And the ways
| nodes | junction |
| ab | |
| bcdb | roundabout |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
| a | | |
| b | | |
| c | d | f |
| e | | |
And the ways
| nodes | junction |
| ab | |
| bcdb | roundabout |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
| a | | |
| d | | |
| b | c | f |
| e | | |
And the ways
| nodes | junction |
| ab | |
| bcdb | roundabout |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
Scenario: Collinear in X,Y
Given the node map
| a | | |
| c | | |
| d | b | f |
| e | | |
And the ways
| nodes | junction |
| ab | |
| bcdb | roundabout |
| ce | |
| df | |
When I route I should get
| waypoints | route | turns |
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
| j,i | jkl,ghi,ghi | depart,roundabout-exit-4,arrive |
-66
View File
@@ -1,66 +0,0 @@
@routing @guidance
Feature: Suppressed Turns
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Do not announce passing a exit ramp
Given the node map
| a | b | c | d | e |
| | | | f | g |
And the ways
| nodes | highway |
| abcde | motorway |
| bfg | motorway_link |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
Scenario: Do not announce reference changes
Given the node map
| a | b | c | d | e | f |
And the ways
| nodes | highway | name | ref |
| ab | motorway | highway | A1 |
| bc | motorway | highway | A1,A2 |
| cd | motorway | highway | A2 |
| de | motorway | highway | |
| ef | motorway | highway | A1 |
When I route I should get
| waypoints | route | turns |
| a,f | highway (A1),highway (A1) | depart,arrive |
Scenario: Don't Announce Turn on following major road class -- service
Given the node map
| a | b | d |
| | | c |
And the ways
| nodes | highway |
| abc | primary |
| bd | service |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
Scenario: Don't Announce Turn on following major road class -- residential
Given the node map
| a | b | d |
| | | c |
And the ways
| nodes | highway |
| abc | primary |
| bd | residential |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| a,d | abc,bd,bd | depart,turn straight,arrive |
-813
View File
@@ -1,813 +0,0 @@
@routing @guidance
Feature: Simple Turns
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Four Way Intersection
Given the node map
| | c | |
| a | b | e |
| | d | |
And the ways
| nodes | highway |
| ab | primary |
| cb | primary |
| db | primary |
| eb | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cb,cb | depart,turn left,arrive |
| a,e | ab,eb,eb | depart,new name straight,arrive |
| a,d | ab,db,db | depart,turn right,arrive |
| c,a | cb,ab,ab | depart,turn right,arrive |
| c,d | cb,db,db | depart,new name straight,arrive |
| c,e | cb,eb,eb | depart,turn left,arrive |
| d,a | db,ab,ab | depart,turn left,arrive |
| d,c | db,cb,cb | depart,new name straight,arrive |
| d,e | db,eb,eb | depart,turn right,arrive |
| e,a | eb,ab,ab | depart,new name straight,arrive |
| e,c | eb,cb,cb | depart,turn right,arrive |
| e,d | eb,db,db | depart,turn left,arrive |
Scenario: Rotated Four Way Intersection
Given the node map
| a | | c |
| | b | |
| d | | e |
And the ways
| nodes | highway |
| ab | primary |
| cb | primary |
| db | primary |
| eb | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cb,cb | depart,turn left,arrive |
| a,e | ab,eb,eb | depart,new name straight,arrive |
| a,d | ab,db,db | depart,turn right,arrive |
| c,a | cb,ab,ab | depart,turn right,arrive |
| c,d | cb,db,db | depart,new name straight,arrive |
| c,e | cb,eb,eb | depart,turn left,arrive |
| d,a | db,ab,ab | depart,turn left,arrive |
| d,c | db,cb,cb | depart,new name straight,arrive |
| d,e | db,eb,eb | depart,turn right,arrive |
| e,a | eb,ab,ab | depart,new name straight,arrive |
| e,c | eb,cb,cb | depart,turn right,arrive |
| e,d | eb,db,db | depart,turn left,arrive |
Scenario: Four Way Intersection Through Street
Given the node map
| | c | |
| a | b | e |
| | d | |
And the ways
| nodes | highway |
| abe | primary |
| cb | primary |
| db | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abe,cb,cb | depart,turn left,arrive |
| a,e | abe,abe | depart,arrive |
| a,d | abe,db,db | depart,turn right,arrive |
| c,a | cb,abe,abe | depart,turn right,arrive |
| c,d | cb,db,db | depart,new name straight,arrive |
| c,e | cb,abe,abe | depart,turn left,arrive |
| d,a | db,abe,abe | depart,turn left,arrive |
| d,c | db,cb,cb | depart,new name straight,arrive |
| d,e | db,abe,abe | depart,turn right,arrive |
| e,a | abe,abe | depart,arrive |
| e,c | abe,cb,cb | depart,turn right,arrive |
| e,d | abe,db,db | depart,turn left,arrive |
Scenario: Four Way Intersection Double Through Street
Given the node map
| | c | |
| a | b | e |
| | d | |
And the ways
| nodes | highway |
| abe | primary |
| cbd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abe,cbd,cbd | depart,turn left,arrive |
| a,e | abe,abe | depart,arrive |
| a,d | abe,cbd,cbd | depart,turn right,arrive |
| c,a | cbd,abe,abe | depart,turn right,arrive |
| c,d | cbd,cbd | depart,arrive |
| c,e | cbd,abe,abe | depart,turn left,arrive |
| d,a | cbd,abe,abe | depart,turn left,arrive |
| d,c | cbd,cbd | depart,arrive |
| d,e | cbd,abe,abe | depart,turn right,arrive |
| e,a | abe,abe | depart,arrive |
| e,c | abe,cbd,cbd | depart,turn right,arrive |
| e,d | abe,cbd,cbd | depart,turn left,arrive |
Scenario: Three Way Intersection
Given the node map
| | c | |
| a | b | d |
And the ways
| nodes | highway |
| ab | primary |
| cb | primary |
| db | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,cb,cb | depart,turn left,arrive |
| a,d | ab,db,db | depart,new name straight,arrive |
| d,c | db,cb,cb | depart,turn right,arrive |
| d,a | db,ab,ab | depart,new name straight,arrive |
Scenario: Three Way Intersection on Through Street
Given the node map
| | d | |
| a | b | c |
And the ways
| nodes | highway |
| abc | primary |
| db | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| a,d | abc,db,db | depart,turn left,arrive |
| c,a | abc,abc | depart,arrive |
| c,d | abc,db,db | depart,turn right,arrive |
Scenario: High Degree Intersection
Given the node map
| i | | b | | c |
| | | | | |
| | | | | |
| h | | a | | d |
| | | | | |
| | | | | |
| g | | f | | e |
And the ways
| nodes | highway |
| ab | primary |
| ac | primary |
| ad | primary |
| ae | primary |
| af | primary |
| ag | primary |
| ah | primary |
| ai | primary |
When I route I should get
| waypoints | route | turns |
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
| b,d | ab,ad,ad | depart,turn left,arrive |
| b,e | ab,ae,ae | depart,turn slight left,arrive |
| b,f | ab,af,af | depart,new name straight,arrive |
| b,g | ab,ag,ag | depart,turn slight right,arrive |
| b,h | ab,ah,ah | depart,turn right,arrive |
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
Scenario: Disturbed High Degree Intersection
Given the node map
| | | b | | |
| i | | | | c |
| | | | | |
| h | | a | | d |
| | | | | |
| g | | | | e |
| | | f | | |
And the ways
| nodes | highway |
| ab | primary |
| ac | primary |
| ad | primary |
| ae | primary |
| af | primary |
| ag | primary |
| ah | primary |
| ai | primary |
When I route I should get
| waypoints | route | turns |
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
| b,d | ab,ad,ad | depart,turn left,arrive |
| b,e | ab,ae,ae | depart,turn slight left,arrive |
| b,f | ab,af,af | depart,new name straight,arrive |
| b,g | ab,ag,ag | depart,turn slight right,arrive |
| b,h | ab,ah,ah | depart,turn right,arrive |
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
Scenario: Turn instructions at high latitude
Given the node locations
| node | lat | lon |
| a | 55.68740 | 12.52430 |
| b | 55.68745 | 12.52409 |
| c | 55.68711 | 12.52383 |
| d | 55.68745 | 12.52450 |
| e | 55.68755 | 12.52450 |
| x | -55.68740 | 12.52430 |
| y | -55.68745 | 12.52409 |
| z | -55.68711 | 12.52383 |
| v | -55.68745 | 12.52450 |
| w | -55.68755 | 12.52450 |
And the ways
| nodes |
| ab |
| bc |
| bd |
| be |
| xy |
| yz |
| vy |
| wy |
When I route I should get
| from | to | route | turns |
| a | c | ab,bc,bc | depart,turn left,arrive |
| c | a | bc,ab,ab | depart,turn right,arrive |
| x | z | xy,yz,yz | depart,turn right,arrive |
| z | x | yz,xy,xy | depart,turn left,arrive |
Scenario: Four Way Intersection Double Through Street Segregated
Given the node map
| | b | | c | |
| i | | | | d |
| | | a | | |
| h | | | | e |
| | g | | f | |
And the ways
| nodes | highway | oneway | name |
| ha | primary | yes | first |
| ai | primary | yes | first |
| ae | primary | yes | first |
| da | primary | yes | first |
| ba | primary | yes | second |
| ac | primary | yes | second |
| fa | primary | yes | second |
| ag | primary | yes | second |
When I route I should get
| waypoints | route | turns |
| f,e | second,first,first | depart,turn right,arrive |
| f,c | second,second | depart,arrive |
| f,i | second,first,first | depart,turn left,arrive |
| f,g | second,second,second | depart,continue uturn,arrive |
| d,c | first,second,second | depart,turn right,arrive |
| d,i | first,first | depart,arrive |
| d,g | first,second,second | depart,turn left,arrive |
| d,e | first,first,first | depart,continue uturn,arrive |
| b,i | second,first,first | depart,turn right,arrive |
| b,g | second,second | depart,arrive |
| b,e | second,first,first | depart,turn left,arrive |
| b,c | second,second,second | depart,continue uturn,arrive |
| h,g | first,second,second | depart,turn right,arrive |
| h,e | first,first | depart,arrive |
| h,c | first,second,second | depart,turn left,arrive |
| h,i | first,first,first | depart,continue uturn,arrive |
Scenario: Three Way Similar Sharp Turns
Given the node map
| a | | | | b |
| c | | | | |
| | d | | | |
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | ab,bc,bc | depart,turn sharp right,arrive |
| a,d | ab,bd,bd | depart,turn sharp right,arrive |
| d,c | bd,bc,bc | depart,turn sharp left,arrive |
| d,a | bd,ab,ab | depart,turn sharp left,arrive |
Scenario: Left Turn Assignment (1)
Given the node map
| | | | | d |
| a | | b | | c |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn slight left,arrive |
Scenario: Left Turn Assignment (2)
Given the node map
| | | | | d |
| | | | | |
| a | | b | | c |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn left,arrive |
Scenario: Left Turn Assignment (3)
Given the node map
| | | | d | |
| | | | | |
| | | | | |
| a | | b | | c |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn left,arrive |
Scenario: Left Turn Assignment (4)
Given the node map
| | | d | | |
| | | | | |
| | | | | |
| | | | | |
| a | | b | | c |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn left,arrive |
Scenario: Left Turn Assignment (5)
Given the node map
| | d | | | |
| | | | | |
| | | | | |
| a | | b | | c |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn left,arrive |
@bug @pr2275
Scenario: Left Turn Assignment (6)
Given the node map
| d | | | | |
| | | | | |
| a | | b | | c |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn sharp left,arrive |
Scenario: Left Turn Assignment (7)
Given the node map
| d | | | | |
| a | | b | | c |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn sharp left,arrive |
Scenario: Right Turn Assignment (1)
Given the node map
| | | e | | |
| a | | b | | c |
| | | | | d |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn slight right,arrive |
Scenario: Right Turn Assignment (2)
Given the node map
| | | e | | |
| a | | b | | c |
| | | | | |
| | | | | d |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn right,arrive |
Scenario: Right Turn Assignment (3)
Given the node map
| | | e | | |
| a | | b | | c |
| | | | | |
| | | | | |
| | | | d | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn right,arrive |
Scenario: Right Turn Assignment (4)
Given the node map
| | | e | | |
| a | | b | | c |
| | | | | |
| | | | | |
| | | | | |
| | | d | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn right,arrive |
Scenario: Right Turn Assignment (5)
Given the node map
| | | e | | |
| a | | b | | c |
| | | | | |
| | | | | |
| | d | | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn right,arrive |
@bug @pr2275
Scenario: Right Turn Assignment (6)
Given the node map
| | | e | | |
| a | | b | | c |
| | | | | |
| d | | | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
Scenario: Right Turn Assignment (7)
Given the node map
| | | e | | |
| a | | b | | c |
| d | | | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
Scenario: Right Turn Assignment Two Turns
Given the node map
| | | f | | |
| a | | b | | c |
| | | | | |
| d | e | | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
| bf | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
| a,e | abc,be,be | depart,turn right,arrive |
Scenario: Right Turn Assignment Two Turns (2)
Given the node map
| | | f | c | |
| a | | b | | |
| | | | | e |
| | | | d | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
| bf | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn right,arrive |
| a,e | abc,be,be | depart,turn slight right,arrive |
Scenario: Right Turn Assignment Two Turns (3)
Given the node map
| | | f | | |
| a | | b | | c |
| | | | | e |
| | | | d | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
| bf | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn right,arrive |
| a,e | abc,be,be | depart,turn slight right,arrive |
Scenario: Right Turn Assignment Two Turns (4)
Given the node map
| | | f | | |
| a | | b | | c |
| | | | | |
| | | d | | e |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
| bf | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn right,arrive |
| a,e | abc,be,be | depart,turn slight right,arrive |
Scenario: Right Turn Assignment Three Turns
Given the node map
| | | g | | |
| a | | b | | c |
| | d | | f | |
| | | e | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
| bf | primary |
| bg | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
| a,e | abc,be,be | depart,turn right,arrive |
| a,f | abc,bf,bf | depart,turn slight right,arrive |
Scenario: Slight Turn involving Oneways
Given the node map
| | | a | | |
| | | | | |
| | | b | | e |
| d | | | | |
| | | c | | |
And the ways
| nodes | highway | oneway |
| abc | primary | yes |
| dbe | primary | no |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| d,e | dbe,dbe | depart,arrive |
| e,d | dbe,dbe | depart,arrive |
@bug @pr2275
Scenario: Slight Turn involving Oneways
Given the node map
| | | | a | |
| | | | | |
| | | | | |
| | | b | | e |
| d | | | | |
| | | c | | |
And the ways
| nodes | highway | oneway |
| abc | primary | yes |
| dbe | primary | no |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| d,e | dbe,dbe | depart,arrive |
| e,d | dbe,dbe | depart,arrive |
Scenario: Slight Turn involving Oneways - Name Change
Given the node map
| | | a | | |
| | | | | |
| | | b | | e |
| d | | | | |
| | | c | | |
And the ways
| nodes | highway | oneway |
| abc | primary | yes |
| db | primary | no |
| be | primary | no |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc | depart,arrive |
| d,e | db,be,be | depart,new name slight right,arrive |
| e,d | be,db,db | depart,new name slight left,arrive |
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 1
Given the node map
| | | g | | |
| a | | b | | c |
| | | | | |
| | d | e | f | |
And the ways
| nodes | highway | oneway |
| abc | primary | no |
| db | primary | yes |
| eb | primary | no |
| fb | primary | no |
| bg | primary | no |
When I route I should get
| waypoints | route | turns |
| a,e | abc,eb,eb | depart,turn right,arrive |
| a,f | abc,fb,fb | depart,turn slight right,arrive |
@bug @pr2275
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 2
Given the node map
| | | g | | |
| a | | b | | c |
| | | | | |
| | d | e | f | |
And the ways
| nodes | highway | oneway |
| abc | primary | no |
| db | primary | no |
| eb | primary | yes |
| fb | primary | no |
| bg | primary | no |
When I route I should get
| waypoints | route | turns |
| a,d | abc,db,db | depart,turn sharp right,arrive |
| a,f | abc,fb,fb | depart,turn right,arrive |
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 3
Given the node map
| | | g | | |
| a | | b | | c |
| | | | | |
| | d | e | f | |
And the ways
| nodes | highway | oneway |
| abc | primary | no |
| db | primary | no |
| be | primary | no |
| fb | primary | yes |
| bg | primary | no |
When I route I should get
| waypoints | route | turns |
| a,d | abc,db,db | depart,turn sharp right,arrive |
| a,e | abc,be,be | depart,turn right,arrive |
Scenario: Conflicting Turns with well distinguished turn
Given the node map
| a | | | b | | | c |
| | | | | | | |
| f | | | | | | d |
| | | | | | | e |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
| bf | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn slight right,arrive |
| a,e | abc,be,be | depart,turn right,arrive |
| a,f | abc,bf,bf | depart,turn sharp right,arrive |
@bug @pr2275
Scenario: Conflicting Turns with well distinguished turn (back)
Given the node map
| a | | | b | | | c |
| | | | | | | |
| d | | | | | | f |
| | e | | | | | |
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
| be | primary |
| bf | primary |
When I route I should get
| waypoints | route | turns |
| a,d | abc,bd,bd | depart,turn sharp right,arrive |
| a,e | abc,be,be | depart,turn right,arrive |
| a,f | abc,bf,bf | depart,turn slight right,arrive |
+6 -3
View File
@@ -44,9 +44,12 @@ module.exports = function () {
this.Then(/^response should be a well-formed route$/, () => {
this.ShouldBeWellFormed();
assert.equal(this.json.code, 'ok');
assert.ok(Array.isArray(this.json.routes));
assert.ok(Array.isArray(this.json.waypoints));
assert.equal(typeof this.json.status_message, 'string');
assert.equal(typeof this.json.route_summary, 'object');
assert.equal(typeof this.json.route_geometry, 'string');
assert.ok(Array.isArray(this.json.route_instructions));
assert.ok(Array.isArray(this.json.via_points));
assert.ok(Array.isArray(this.json.via_indices));
});
this.Then(/^"([^"]*)" should return code (\d+)$/, (binary, code) => {
-1
View File
@@ -110,7 +110,6 @@ module.exports = function () {
} else {
var params = this.queryParams,
waypoints = [];
params['steps'] = 'true';
if (row.from && row.to) {
var fromNode = this.findNodeByName(row.from);
if (!fromNode) throw new Error(util.format('*** unknown from-node "%s"', row.from));
+1 -2
View File
@@ -7,8 +7,7 @@ var d3 = require('d3-queue');
module.exports = function () {
this.initializeEnv = (callback) => {
this.DEFAULT_PORT = 5000;
// OSX builds on Travis hit a timeout of ~2000 from time to time
this.DEFAULT_TIMEOUT = 5000;
this.DEFAULT_TIMEOUT = 2000;
this.setDefaultTimeout(this.DEFAULT_TIMEOUT);
this.ROOT_FOLDER = process.cwd();
this.OSM_USER = 'osrm';
+1 -6
View File
@@ -144,14 +144,9 @@ module.exports = function () {
return v.maneuver.type;
case 'roundabout':
return 'roundabout-exit-' + v.maneuver.exit;
case 'rotary':
if( 'rotary_name' in v )
return v.rotary_name + '-exit-' + v.maneuver.exit;
else
return 'rotary-exit-' + v.maneuver.exit;
// FIXME this is a little bit over-simplistic for merge/fork instructions
default:
return v.maneuver.type + ' ' + v.maneuver.modifier;
return v.maneuver.modifier;
}
})
.join(',');
+9 -1
View File
@@ -35,7 +35,7 @@ module.exports = function () {
var json = JSON.parse(body);
var hasRoute = json.code === 'Ok';
var hasRoute = json.code === 'ok';
if (hasRoute) {
instructions = this.wayList(json.routes[0]);
@@ -59,6 +59,14 @@ module.exports = function () {
got['#'] = row['#'];
}
if (headers.has('start')) {
got.start = instructions ? json.route_summary.start_point : null;
}
if (headers.has('end')) {
got.end = instructions ? json.route_summary.end_point : null;
}
if (headers.has('geometry')) {
got.geometry = json.routes[0].geometry;
}
+2 -2
View File
@@ -36,5 +36,5 @@ Feature: Basic Routing
| fy | last |
When I route I should get
| from | to | route |
| x | y | first,compr,last,last |
| from | to | route | turns |
| x | y | first,compr,last,last | depart,right,left,arrive |
-19
View File
@@ -85,22 +85,3 @@ Feature: Basic Map Matching
| trace | matchings |
| dcba | hgfe |
Scenario: Testbot - Matching with oneway streets
Given a grid size of 10 meters
Given the node map
| a | b | c | d |
| e | f | g | h |
And the ways
| nodes | oneway |
| ab | yes |
| bc | yes |
| cd | yes |
| hg | yes |
| gf | yes |
| fe | yes |
When I match I should get
| trace | matchings |
| dcba | hg,gf,fe |
| efgh | ab,bc,cd |
+10 -3
View File
@@ -12,6 +12,7 @@ Feature: Testbot - Travel mode
Background:
Given the profile "testbot"
@mokob @2166
Scenario: Testbot - Always announce mode change
Given the node map
| a | b | c | d |
@@ -27,6 +28,7 @@ Feature: Testbot - Travel mode
| a | d | foo,foo,foo,foo | driving,river downstream,driving,driving |
| b | d | foo,foo,foo | river downstream,driving,driving |
@mokob @2166
Scenario: Testbot - Compressed Modes
Given the node map
| a | b | c | d | e | f | g |
@@ -42,6 +44,7 @@ Feature: Testbot - Travel mode
| a | g | road,liquid,solid,solid | driving,river downstream,driving,driving |
| c | g | liquid,solid,solid | river downstream,driving,driving |
@mokob @2166
Scenario: Testbot - Modes in each direction, different forward/backward speeds
Given the node map
| | 0 | 1 | |
@@ -76,7 +79,7 @@ Feature: Testbot - Travel mode
| 0 | 1 | ab,ab | steps down,steps down | 60s +-1 |
| 1 | 0 | ab,ab | steps up,steps up | 60s +-1 |
@oneway
@oneway @mokob @2166
Scenario: Testbot - Modes for oneway, different forward/backward speeds
Given the node map
| a | b |
@@ -104,7 +107,7 @@ Feature: Testbot - Travel mode
| a | b | ab,ab | steps down,steps down |
| b | a | | |
@oneway
@oneway @mokob @2166
Scenario: Testbot - Modes for reverse oneway, different forward/backward speeds
Given the node map
| a | b |
@@ -132,7 +135,7 @@ Feature: Testbot - Travel mode
| a | b | | |
| b | a | ab,ab | steps up,steps up |
@via
@via @mokob @2166
Scenario: Testbot - Mode should be set at via points
Given the node map
| a | 1 | b |
@@ -146,6 +149,7 @@ Feature: Testbot - Travel mode
| a,1,b | ab,ab,ab,ab | river downstream,river downstream,river downstream,river downstream |
| b,1,a | ab,ab,ab,ab | river upstream,river upstream,river upstream,river upstream |
@mokob @2166
Scenario: Testbot - Starting at a tricky node
Given the node map
| | a | | | |
@@ -160,6 +164,7 @@ Feature: Testbot - Travel mode
| from | to | route | modes |
| b | a | ab,ab | river upstream,river upstream |
@mokob @2166
Scenario: Testbot - Mode changes on straight way without name change
Given the node map
| a | 1 | b | 2 | c |
@@ -199,6 +204,7 @@ Feature: Testbot - Travel mode
| b | d | bc,cd,cd | route,driving,driving |
| a | f | ab,bc,cd,de,ef,ef | driving,route,driving,driving,driving,driving |
@mokob @2166
Scenario: Testbot - Modes, triangle map
Given the node map
| | | | | | | d |
@@ -233,6 +239,7 @@ Feature: Testbot - Travel mode
| a | d | abc,cd,cd | driving,driving,driving |
| d | a | de,ce,abc,abc | driving,river upstream,driving,driving |
@mokob @2166
Scenario: Testbot - River in the middle
Given the node map
| a | b | c | | |
+11 -9
View File
@@ -1,9 +1,10 @@
@routing @testbot @overlap @todo
@routing @testbot @overlap
Feature: Testbot - overlapping ways
Background:
Given the profile "testbot"
@bug @610
Scenario: Testbot - multiple way between same nodes
Note that cb is connecting the same two nodes as bc
Given the node map
@@ -17,10 +18,11 @@ Feature: Testbot - overlapping ways
| cb | secondary |
When I route I should get
| from | to | route |
| a | d | ab,bc,cd,cd |
| d | a | cd,bc,ab,ab |
| from | to | route |
| a | d | ab,bc,cd |
| d | a | cd,bc,ab |
@bug @610
Scenario: Testbot - area on top of way
Given the node map
| x | a | b | y |
@@ -32,6 +34,6 @@ Feature: Testbot - overlapping ways
| abcda | secondary | yes |
When I route I should get
| from | to | route |
| x | y | xaby,xaby |
| y | x | xaby,xaby |
| from | to | route |
| x | y | xaby |
| y | x | xaby |
+76
View File
@@ -0,0 +1,76 @@
@routing @testbot @roundabout @instruction
Feature: Roundabout Instructions
Background:
Given the profile "testbot"
Scenario: Testbot - Roundabout
Given the node map
| | | v | | |
| | | d | | |
| s | a | | c | u |
| | | b | | |
| | | t | | |
And the ways
| nodes | junction |
| sa | |
| tb | |
| uc | |
| vd | |
| abcda | roundabout |
When I route I should get
| from | to | route | turns |
| s | t | sa,tb,tb | depart,roundabout-exit-1,arrive |
| s | u | sa,uc,uc | depart,roundabout-exit-2,arrive |
| s | v | sa,vd,vd | depart,roundabout-exit-3,arrive |
| t | u | tb,uc,uc | depart,roundabout-exit-1,arrive |
| t | v | tb,vd,vd | depart,roundabout-exit-2,arrive |
| t | s | tb,sa,sa | depart,roundabout-exit-3,arrive |
| u | v | uc,vd,vd | depart,roundabout-exit-1,arrive |
| u | s | uc,sa,sa | depart,roundabout-exit-2,arrive |
| u | t | uc,tb,tb | depart,roundabout-exit-3,arrive |
| v | s | vd,sa,sa | depart,roundabout-exit-1,arrive |
| v | t | vd,tb,tb | depart,roundabout-exit-2,arrive |
| v | u | vd,uc,uc | depart,roundabout-exit-3,arrive |
Scenario: Testbot - Roundabout with oneway links
Given the node map
| | | p | o | | |
| | | h | g | | |
| i | a | | | f | n |
| j | b | | | e | m |
| | | c | d | | |
| | | k | l | | |
And the ways
| nodes | junction | oneway |
| ai | | yes |
| jb | | yes |
| ck | | yes |
| ld | | yes |
| em | | yes |
| nf | | yes |
| go | | yes |
| ph | | yes |
| abcdefgha | roundabout | |
When I route I should get
| from | to | route | turns |
| j | k | jb,ck,ck | depart,roundabout-exit-1,arrive |
| j | m | jb,em,em | depart,roundabout-exit-2,arrive |
| j | o | jb,go,go | depart,roundabout-exit-3,arrive |
| j | i | jb,ai,ai | depart,roundabout-exit-4,arrive |
| l | m | ld,em,em | depart,roundabout-exit-1,arrive |
| l | o | ld,go,go | depart,roundabout-exit-2,arrive |
| l | i | ld,ai,ai | depart,roundabout-exit-3,arrive |
| l | k | ld,ck,ck | depart,roundabout-exit-4,arrive |
| n | o | nf,go,go | depart,roundabout-exit-1,arrive |
| n | i | nf,ai,ai | depart,roundabout-exit-2,arrive |
| n | k | nf,ck,ck | depart,roundabout-exit-3,arrive |
| n | m | nf,em,em | depart,roundabout-exit-4,arrive |
| p | i | ph,ai,ai | depart,roundabout-exit-1,arrive |
| p | k | ph,ck,ck | depart,roundabout-exit-2,arrive |
| p | m | ph,em,em | depart,roundabout-exit-3,arrive |
| p | o | ph,go,go | depart,roundabout-exit-4,arrive |
+19 -19
View File
@@ -46,22 +46,22 @@ Feature: Status messages
| ab |
When I route I should get
| request | status | message |
| route/v1/driving/1,1;1,2 | 200 | |
| nonsense | 400 | URL string malformed close to position 9: "nse" |
| nonsense/v1/driving/1,1;1,2 | 400 | Service nonsense not found! |
| | 400 | URL string malformed close to position 1: "/" |
| / | 400 | URL string malformed close to position 1: "//" |
| ? | 400 | URL string malformed close to position 1: "/?" |
| route/v1/driving | 400 | URL string malformed close to position 17: "ing" |
| route/v1/driving/ | 400 | URL string malformed close to position 18: "ng/" |
| route/v1/driving/1 | 400 | Query string malformed close to position 1 |
| route/v1/driving/1,1 | 400 | Number of coordinates needs to be at least two. |
| route/v1/driving/1,1,1 | 400 | Query string malformed close to position 3 |
| route/v1/driving/x | 400 | Query string malformed close to position 0 |
| route/v1/driving/x,y | 400 | Query string malformed close to position 0 |
| route/v1/driving/1,1; | 400 | Query string malformed close to position 3 |
| route/v1/driving/1,1;1 | 400 | Query string malformed close to position 5 |
| route/v1/driving/1,1;1,1,1 | 400 | Query string malformed close to position 7 |
| route/v1/driving/1,1;x | 400 | Query string malformed close to position 3 |
| route/v1/driving/1,1;x,y | 400 | Query string malformed close to position 3 |
| request | status | message |
| route/v1/driving/1,1;1,2 | 200 | |
| nonsense | 400 | URL string malformed close to position 0: "/no" |
| nonsense/v1/driving/1,1;1,2 | 400 | Service nonsense not found! |
| | 400 | URL string malformed close to position 0: "/" |
| / | 400 | URL string malformed close to position 0: "//" |
| ? | 400 | URL string malformed close to position 0: "/?" |
| route/v1/driving | 400 | URL string malformed close to position 0: "/ro" |
| route/v1/driving/ | 400 | URL string malformed close to position 0: "/ro" |
| route/v1/driving/1 | 400 | Query string malformed close to position 0 |
| route/v1/driving/1,1 | 400 | Number of coordinates needs to be at least two. |
| route/v1/driving/1,1,1 | 400 | Query string malformed close to position 3 |
| route/v1/driving/x | 400 | Query string malformed close to position 0 |
| route/v1/driving/x,y | 400 | Query string malformed close to position 0 |
| route/v1/driving/1,1; | 400 | Query string malformed close to position 3 |
| route/v1/driving/1,1;1 | 400 | Query string malformed close to position 3 |
| route/v1/driving/1,1;1,1,1 | 400 | Query string malformed close to position 7 |
| route/v1/driving/1,1;x | 400 | Query string malformed close to position 3 |
| route/v1/driving/1,1;x,y | 400 | Query string malformed close to position 3 |
+74
View File
@@ -0,0 +1,74 @@
@routing @testbot @via
Feature: Via points
Background:
Given the profile "testbot"
And a grid size of 4 meters
Scenario: Basic Right Turn
Given the node map
| a | b | c | d | e | f | g |
| | | | | | h | |
| | | | | | i | |
| | | | | | j | |
| | | | | | k | |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 34m +-1 | depart,right,arrive |
Scenario: Slight Turn
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | i | |
| | | | | | | | j |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 35m +-1 | depart,slight right,arrive |
Scenario: Nearly Slight Turn
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | | |
| | | | | | | i | |
| | | | | | | | j |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 37m +-1 | depart,right,arrive |
Scenario: Nearly Slight Turn (Variation)
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | | |
| | | | | | | i | |
| | | | | | | j | |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 37m +-1 | depart,right,arrive |
+115
View File
@@ -0,0 +1,115 @@
@routing @turns @testbot
Feature: Turn directions/codes
Background:
Given the profile "testbot"
Scenario: Turn directions
Given the node map
| o | p | a | b | c |
| n | | | | d |
| m | | x | | e |
| l | | | | f |
| k | j | i | h | g |
And the ways
| nodes |
| xi |
| xk |
| xm |
| xo |
| xa |
| xc |
| xe |
| xg |
When I route I should get
| from | to | route | turns |
| i | k | xi,xk,xk | depart,sharp left,arrive |
| i | m | xi,xm,xm | depart,left,arrive |
| i | o | xi,xo,xo | depart,slight left,arrive |
| i | a | xi,xa,xa | depart,straight,arrive |
| i | c | xi,xc,xc | depart,slight right,arrive |
| i | e | xi,xe,xe | depart,right,arrive |
| i | g | xi,xg,xg | depart,sharp right,arrive |
| k | m | xk,xm,xm | depart,sharp left,arrive |
| k | o | xk,xo,xo | depart,left,arrive |
| k | a | xk,xa,xa | depart,slight left,arrive |
| k | c | xk,xc,xc | depart,straight,arrive |
| k | e | xk,xe,xe | depart,slight right,arrive |
| k | g | xk,xg,xg | depart,right,arrive |
| k | i | xk,xi,xi | depart,sharp right,arrive |
| m | o | xm,xo,xo | depart,sharp left,arrive |
| m | a | xm,xa,xa | depart,left,arrive |
| m | c | xm,xc,xc | depart,slight left,arrive |
| m | e | xm,xe,xe | depart,straight,arrive |
| m | g | xm,xg,xg | depart,slight right,arrive |
| m | i | xm,xi,xi | depart,right,arrive |
| m | k | xm,xk,xk | depart,sharp right,arrive |
| o | a | xo,xa,xa | depart,sharp left,arrive |
| o | c | xo,xc,xc | depart,left,arrive |
| o | e | xo,xe,xe | depart,slight left,arrive |
| o | g | xo,xg,xg | depart,straight,arrive |
| o | i | xo,xi,xi | depart,slight right,arrive |
| o | k | xo,xk,xk | depart,right,arrive |
| o | m | xo,xm,xm | depart,sharp right,arrive |
| a | c | xa,xc,xc | depart,sharp left,arrive |
| a | e | xa,xe,xe | depart,left,arrive |
| a | g | xa,xg,xg | depart,slight left,arrive |
| a | i | xa,xi,xi | depart,straight,arrive |
| a | k | xa,xk,xk | depart,slight right,arrive |
| a | m | xa,xm,xm | depart,right,arrive |
| a | o | xa,xo,xo | depart,sharp right,arrive |
| c | e | xc,xe,xe | depart,sharp left,arrive |
| c | g | xc,xg,xg | depart,left,arrive |
| c | i | xc,xi,xi | depart,slight left,arrive |
| c | k | xc,xk,xk | depart,straight,arrive |
| c | m | xc,xm,xm | depart,slight right,arrive |
| c | o | xc,xo,xo | depart,right,arrive |
| c | a | xc,xa,xa | depart,sharp right,arrive |
| e | g | xe,xg,xg | depart,sharp left,arrive |
| e | i | xe,xi,xi | depart,left,arrive |
| e | k | xe,xk,xk | depart,slight left,arrive |
| e | m | xe,xm,xm | depart,straight,arrive |
| e | o | xe,xo,xo | depart,slight right,arrive |
| e | a | xe,xa,xa | depart,right,arrive |
| e | c | xe,xc,xc | depart,sharp right,arrive |
| g | i | xg,xi,xi | depart,sharp left,arrive |
| g | k | xg,xk,xk | depart,left,arrive |
| g | m | xg,xm,xm | depart,slight left,arrive |
| g | o | xg,xo,xo | depart,straight,arrive |
| g | a | xg,xa,xa | depart,slight right,arrive |
| g | c | xg,xc,xc | depart,right,arrive |
| g | e | xg,xe,xe | depart,sharp right,arrive |
Scenario: Turn instructions at high latitude
# https://github.com/DennisOSRM/Project-OSRM/issues/532
Given the node locations
| node | lat | lon |
| a | 55.68740 | 12.52430 |
| b | 55.68745 | 12.52409 |
| c | 55.68711 | 12.52383 |
| x | -55.68740 | 12.52430 |
| y | -55.68745 | 12.52409 |
| z | -55.68711 | 12.52383 |
And the ways
| nodes |
| ab |
| bc |
| xy |
| yz |
When I route I should get
| from | to | route | turns |
| a | c | ab,bc,bc | depart,left,arrive |
| c | a | bc,ab,ab | depart,right,arrive |
| x | z | xy,yz,yz | depart,right,arrive |
| z | x | yz,xy,xy | depart,left,arrive |
@@ -1,10 +1,10 @@
@routing @continue_straight @via @testbot
@routing @uturn @via @testbot
Feature: U-turns at via points
Background:
Given the profile "testbot"
Scenario: Continue straight at waypoints enabled by default
Scenario: U-turns at via points disabled by default
Given the node map
| a | b | c | d |
| | e | f | g |
@@ -20,16 +20,16 @@ Feature: U-turns at via points
| fg |
When I route I should get
| waypoints | route |
| a,e,c | ab,be,be,ef,fg,dg,cd,cd |
| waypoints | route | turns |
| a,e,c | ab,be,be,ef,fg,dg,cd,cd | depart,right,arrive,depart,straight,left,left,arrive |
Scenario: Query parameter to disallow changing direction at all waypoints
Scenario: Query param to allow U-turns at all via points
Given the node map
| a | b | c | d |
| | e | f | g |
And the query options
| continue_straight | false |
| uturns | true |
And the ways
| nodes |
@@ -45,13 +45,14 @@ Feature: U-turns at via points
| waypoints | route |
| a,e,c | ab,be,be,be,bc,bc |
Scenario: Instructions at waypoints at u-turns
@todo
Scenario: Instructions at via points at u-turns
Given the node map
| a | b | c | d |
| | e | f | g |
And the query options
| continue_straight | false |
| uturns | true |
And the ways
| nodes |
@@ -64,8 +65,8 @@ Feature: U-turns at via points
| fg |
When I route I should get
| waypoints | route |
| a,e,c | ab,be,be,be,bc,bc |
| waypoints | route | turns |
| a,e,c | ab,be,be,bc,bc | depart,right,uturn,right,arrive |
Scenario: u-turn mixed with non-uturn vias
Given the node map
@@ -74,19 +75,19 @@ Feature: U-turns at via points
| | | e | | f | | g |
And the query options
| continue_straight | false |
| uturns | true |
And the ways
| nodes | oneway |
| ab | no |
| bc | no |
| cd | no |
| be | yes |
| dg | no |
| ef | no |
| fg | no |
| nodes |
| ab |
| bc |
| cd |
| be |
| dg |
| ef |
| fg |
When I route I should get
| waypoints | route |
| 1,2,3,4,5 | ab,be,be,be,ef,fg,dg,cd,bc,bc,bc,cd,dg,dg,dg,cd,cd |
| waypoints | route |
| 1,2,3,4,5 | ab,be,be,be,bc,bc,bc,be,ef,fg,dg,dg,dg,cd,cd |
+1
View File
@@ -46,6 +46,7 @@ Feature: Via points
| a,d,c | abc,bd,bd,bd,abc,abc |
| c,d,a | abc,bd,bd,bd,abc,abc |
@mokob
Scenario: Multiple via points
Given the node map
| a | | | | e | f | g | |
+3 -3
View File
@@ -342,7 +342,7 @@ class GraphContractor
// remaining graph
std::vector<NodeID> new_node_id_from_orig_id_map(number_of_nodes, SPECIAL_NODEID);
for (const auto new_node_id : util::irange<std::size_t>(0UL, remaining_nodes.size()))
for (const auto new_node_id : util::irange<std::size_t>(0, remaining_nodes.size()))
{
auto &node = remaining_nodes[new_node_id];
BOOST_ASSERT(node_priorities.size() > node.id);
@@ -352,7 +352,7 @@ class GraphContractor
}
// build forward and backward renumbering map and remap ids in remaining_nodes
for (const auto new_node_id : util::irange<std::size_t>(0UL, remaining_nodes.size()))
for (const auto new_node_id : util::irange<std::size_t>(0, remaining_nodes.size()))
{
auto &node = remaining_nodes[new_node_id];
// create renumbering maps in both directions
@@ -362,7 +362,7 @@ class GraphContractor
}
// walk over all nodes
for (const auto source :
util::irange<NodeID>(0UL, contractor_graph->GetNumberOfNodes()))
util::irange<NodeID>(0, contractor_graph->GetNumberOfNodes()))
{
for (auto current_edge : contractor_graph->GetAdjacentEdgeRange(source))
{
+6 -19
View File
@@ -14,9 +14,8 @@
#include <boost/optional.hpp>
#include <algorithm>
#include <iterator>
#include <string>
#include <algorithm>
#include <vector>
namespace osrm
@@ -48,25 +47,13 @@ template <typename ForwardIter> util::json::String makePolyline(ForwardIter begi
}
template <typename ForwardIter>
util::json::Object makeGeoJSONGeometry(ForwardIter begin, ForwardIter end)
util::json::Object makeGeoJSONLineString(ForwardIter begin, ForwardIter end)
{
auto num_coordinates = std::distance(begin, end);
BOOST_ASSERT(num_coordinates != 0);
util::json::Object geojson;
if (num_coordinates > 1)
{
geojson.values["type"] = "LineString";
util::json::Array coordinates;
std::transform(begin, end, std::back_inserter(coordinates.values), &detail::coordinateToLonLat);
geojson.values["coordinates"] = std::move(coordinates);
}
else if (num_coordinates > 0)
{
geojson.values["type"] = "Point";
util::json::Array coordinates;
coordinates.values.push_back(detail::coordinateToLonLat(*begin));
geojson.values["coordinates"] = std::move(coordinates);
}
geojson.values["type"] = "LineString";
util::json::Array coordinates;
std::transform(begin, end, std::back_inserter(coordinates.values), &detail::coordinateToLonLat);
geojson.values["coordinates"] = std::move(coordinates);
return geojson;
}
+2 -2
View File
@@ -45,7 +45,7 @@ class MatchAPI final : public RouteAPI
}
response.values["tracepoints"] = MakeTracepoints(sub_matchings);
response.values["matchings"] = std::move(routes);
response.values["code"] = "Ok";
response.values["code"] = "ok";
}
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
@@ -90,7 +90,7 @@ class MatchAPI final : public RouteAPI
}
}
for (auto trace_index : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
for (auto trace_index : util::irange(0UL, parameters.coordinates.size()))
{
auto matching_index = trace_idx_to_matching_idx[trace_index];
if (matching_index.NotMatched())
+1 -1
View File
@@ -43,7 +43,7 @@ class NearestAPI final : public BaseAPI
return waypoint;
});
response.values["code"] = "Ok";
response.values["code"] = "ok";
response.values["waypoints"] = std::move(waypoints);
}
+12 -12
View File
@@ -2,15 +2,15 @@
#define ENGINE_API_ROUTE_HPP
#include "engine/api/base_api.hpp"
#include "engine/api/json_factory.hpp"
#include "engine/api/route_parameters.hpp"
#include "engine/api/json_factory.hpp"
#include "engine/datafacade/datafacade_base.hpp"
#include "engine/guidance/assemble_geometry.hpp"
#include "engine/guidance/assemble_leg.hpp"
#include "engine/guidance/assemble_overview.hpp"
#include "engine/guidance/assemble_route.hpp"
#include "engine/guidance/assemble_geometry.hpp"
#include "engine/guidance/assemble_overview.hpp"
#include "engine/guidance/assemble_steps.hpp"
#include "engine/guidance/post_processing.hpp"
@@ -19,7 +19,6 @@
#include "util/coordinate.hpp"
#include "util/integer_range.hpp"
#include <iterator>
#include <vector>
namespace osrm
@@ -55,7 +54,7 @@ class RouteAPI : public BaseAPI
}
response.values["waypoints"] = BaseAPI::MakeWaypoints(raw_route.segment_end_coordinates);
response.values["routes"] = std::move(routes);
response.values["code"] = "Ok";
response.values["code"] = "ok";
}
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
@@ -69,7 +68,7 @@ class RouteAPI : public BaseAPI
}
BOOST_ASSERT(parameters.geometries == RouteParameters::GeometriesType::GeoJSON);
return json::makeGeoJSONGeometry(begin, end);
return json::makeGeoJSONLineString(begin, end);
}
util::json::Object MakeRoute(const std::vector<PhantomNodes> &segment_end_coordinates,
@@ -83,7 +82,7 @@ class RouteAPI : public BaseAPI
legs.reserve(number_of_legs);
leg_geometries.reserve(number_of_legs);
for (auto idx : util::irange<std::size_t>(0UL, number_of_legs))
for (auto idx : util::irange(0UL, number_of_legs))
{
const auto &phantoms = segment_end_coordinates[idx];
const auto &path_data = unpacked_path_segments[idx];
@@ -93,8 +92,8 @@ class RouteAPI : public BaseAPI
auto leg_geometry = guidance::assembleGeometry(
BaseAPI::facade, path_data, phantoms.source_phantom, phantoms.target_phantom);
auto leg = guidance::assembleLeg(facade, path_data, leg_geometry, phantoms.source_phantom,
phantoms.target_phantom, reversed_target, parameters.steps);
auto leg = guidance::assembleLeg(BaseAPI::facade, path_data, leg_geometry,
phantoms.source_phantom, phantoms.target_phantom, reversed_target);
if (parameters.steps)
{
@@ -156,12 +155,13 @@ class RouteAPI : public BaseAPI
}
std::vector<util::json::Value> step_geometries;
for (const auto idx : util::irange<std::size_t>(0UL, legs.size()))
for (const auto idx : util::irange(0UL, legs.size()))
{
auto &leg_geometry = leg_geometries[idx];
std::transform(
legs[idx].steps.begin(), legs[idx].steps.end(), std::back_inserter(step_geometries),
[this, &leg_geometry](const guidance::RouteStep &step) {
[this, &leg_geometry](const guidance::RouteStep &step)
{
if (parameters.geometries == RouteParameters::GeometriesType::Polyline)
{
return static_cast<util::json::Value>(
@@ -169,7 +169,7 @@ class RouteAPI : public BaseAPI
leg_geometry.locations.begin() + step.geometry_end));
}
BOOST_ASSERT(parameters.geometries == RouteParameters::GeometriesType::GeoJSON);
return static_cast<util::json::Value>(json::makeGeoJSONGeometry(
return static_cast<util::json::Value>(json::makeGeoJSONLineString(
leg_geometry.locations.begin() + step.geometry_begin,
leg_geometry.locations.begin() + step.geometry_end));
});
+6 -6
View File
@@ -48,7 +48,7 @@ namespace api
* - geometries: route geometry encoded in Polyline or GeoJSON
* - overview: adds overview geometry either Full, Simplified (according to highest zoom level) or
* False (not at all)
* - continue_straight: enable or disable continue_straight (disabled by default)
* - uturns: enable or disable uturns (disabled by default)
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
@@ -74,18 +74,18 @@ struct RouteParameters : public BaseParameters
const bool alternatives_,
const GeometriesType geometries_,
const OverviewType overview_,
const boost::optional<bool> continue_straight_,
const boost::optional<bool> uturns_,
Args... args_)
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_}
geometries{geometries_}, overview{overview_}, uturns{uturns_}
{
}
bool steps = false;
bool alternatives = false;
bool steps = true;
bool alternatives = true;
GeometriesType geometries = GeometriesType::Polyline;
OverviewType overview = OverviewType::Simplified;
boost::optional<bool> continue_straight;
boost::optional<bool> uturns;
bool IsValid() const { return coordinates.size() >= 2 && BaseParameters::IsValid(); }
};
+2 -4
View File
@@ -19,8 +19,6 @@
#include <boost/range/algorithm/transform.hpp>
#include <iterator>
namespace osrm
{
namespace engine
@@ -67,7 +65,7 @@ class TableAPI final : public BaseAPI
response.values["durations"] =
MakeTable(durations, number_of_sources, number_of_destinations);
response.values["code"] = "Ok";
response.values["code"] = "ok";
}
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
@@ -105,7 +103,7 @@ class TableAPI final : public BaseAPI
std::size_t number_of_columns) const
{
util::json::Array json_table;
for (const auto row : util::irange<std::size_t>(0UL, number_of_rows))
for (const auto row : util::irange<std::size_t>(0, number_of_rows))
{
util::json::Array json_row;
auto row_begin_iterator = values.begin() + (row * number_of_columns);
+4 -4
View File
@@ -44,7 +44,7 @@ class TripAPI final : public RouteAPI
}
response.values["waypoints"] = MakeWaypoints(sub_trips, phantoms);
response.values["trips"] = std::move(routes);
response.values["code"] = "Ok";
response.values["code"] = "ok";
}
// FIXME gcc 4.8 doesn't support for lambdas to call protected member functions
@@ -77,17 +77,17 @@ class TripAPI final : public RouteAPI
};
std::vector<TripIndex> input_idx_to_trip_idx(parameters.coordinates.size());
for (auto sub_trip_index : util::irange<unsigned>(0u, sub_trips.size()))
for (auto sub_trip_index : util::irange(0u, static_cast<unsigned>(sub_trips.size())))
{
for (auto point_index :
util::irange<unsigned>(0u, sub_trips[sub_trip_index].size()))
util::irange(0u, static_cast<unsigned>(sub_trips[sub_trip_index].size())))
{
input_idx_to_trip_idx[sub_trips[sub_trip_index][point_index]] =
TripIndex{sub_trip_index, point_index};
}
}
for (auto input_index : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
for (auto input_index : util::irange(0UL, parameters.coordinates.size()))
{
auto trip_index = input_idx_to_trip_idx[input_index];
BOOST_ASSERT(!trip_index.NotUsed());
@@ -144,7 +144,7 @@ class BaseDataFacade
virtual std::string GetTimestamp() const = 0;
virtual bool GetContinueStraightDefault() const = 0;
virtual bool GetUTurnsDefault() const = 0;
};
}
}
@@ -649,7 +649,7 @@ class InternalDataFacade final : public BaseDataFacade
std::string GetTimestamp() const override final { return m_timestamp; }
bool GetContinueStraightDefault() const override final { return m_profile_properties.continue_straight_at_waypoint; }
bool GetUTurnsDefault() const override final { return m_profile_properties.allow_u_turn_at_via; }
};
}
}
@@ -21,7 +21,6 @@
#include <cstddef>
#include <algorithm>
#include <iterator>
#include <limits>
#include <memory>
#include <string>
@@ -709,7 +708,7 @@ class SharedDataFacade final : public BaseDataFacade
std::string GetTimestamp() const override final { return m_timestamp; }
bool GetContinueStraightDefault() const override final { return m_profile_properties->continue_straight_at_waypoint; }
bool GetUTurnsDefault() const override final { return m_profile_properties->allow_u_turn_at_via; }
};
}
}
+20 -41
View File
@@ -12,47 +12,26 @@ namespace engine
{
namespace detail
{
// This is derived from the following formular:
// x = b * (1 + lon/180) => dx = b * dlon/180
// y = b * (1 - lat/180) => dy = b * dlat/180
// dx^2 + dy^2 < min_pixel^2
// => dlon^2 + dlat^2 < min_pixel^2 / b^2 * 180^2
inline std::vector<std::uint64_t> generateThreshold(double min_pixel, unsigned number_of_zoomlevels)
{
std::vector<std::uint64_t> thresholds(number_of_zoomlevels);
for (unsigned zoom = 0; zoom < number_of_zoomlevels; ++zoom)
{
const double shift = (1u << zoom) * 256;
const double b = shift / 2.0;
const double pixel_to_deg = 180. / b;
const std::uint64_t min_deg = min_pixel * pixel_to_deg * COORDINATE_PRECISION;
thresholds[zoom] = min_deg * min_deg;
}
return thresholds;
}
const constexpr std::uint64_t DOUGLAS_PEUCKER_THRESHOLDS[19] = {
49438476562500, // z0
12359619140625, // z1
3089903027344, // z2
772475756836, // z3
193118939209, // z4
48279515076, // z5
12069878769, // z6
3017414761, // z7
754326225, // z8
188567824, // z9
47141956, // z10
11785489, // z11
2944656, // z12
736164, // z13
184041, // z14
45796, // z15
11449, // z16
2809, // z17
676, // z18
const constexpr int DOUGLAS_PEUCKER_THRESHOLDS[19] = {
512440, // z0
256720, // z1
122560, // z2
56780, // z3
28800, // z4
14400, // z5
7200, // z6
3200, // z7
2400, // z8
1000, // z9
600, // z10
120, // z11
60, // z12
45, // z13
36, // z14
20, // z15
8, // z16
6, // z17
4, // z18
};
const constexpr auto DOUGLAS_PEUCKER_THRESHOLDS_SIZE =
+3 -5
View File
@@ -6,7 +6,6 @@
#include "engine/phantom_node.hpp"
#include "util/bearing.hpp"
#include "util/rectangle.hpp"
#include "util/web_mercator.hpp"
#include "osrm/coordinate.hpp"
@@ -425,11 +424,10 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
BOOST_ASSERT(segment.data.reverse_segment_id.id != SPECIAL_SEGMENTID ||
!segment.data.reverse_segment_id.enabled);
Coordinate wsg84_coordinate =
util::web_mercator::toWGS84(segment.fixed_projected_coordinate);
Coordinate wsg84_coordinate = util::coordinate_calculation::mercator::toWGS84(
segment.fixed_projected_coordinate);
return util::coordinate_calculation::haversineDistance(input_coordinate, wsg84_coordinate) >
max_distance;
return util::coordinate_calculation::haversineDistance(input_coordinate, wsg84_coordinate) > max_distance;
}
std::pair<bool, bool> checkSegmentBearing(const CandidateSegment &segment,
+31 -36
View File
@@ -1,21 +1,20 @@
#ifndef ENGINE_GUIDANCE_ASSEMBLE_LEG_HPP_
#define ENGINE_GUIDANCE_ASSEMBLE_LEG_HPP_
#include "engine/datafacade/datafacade_base.hpp"
#include "engine/guidance/leg_geometry.hpp"
#include "engine/guidance/route_leg.hpp"
#include "engine/guidance/route_step.hpp"
#include "engine/guidance/leg_geometry.hpp"
#include "engine/internal_route_result.hpp"
#include <cstddef>
#include <cstdint>
#include <algorithm>
#include <vector>
#include <array>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
#include <numeric>
#include <algorithm>
namespace osrm
{
@@ -28,7 +27,7 @@ namespace detail
const constexpr std::size_t MAX_USED_SEGMENTS = 2;
struct NamedSegment
{
EdgeWeight duration;
double duration;
std::uint32_t position;
std::uint32_t name_id;
};
@@ -62,7 +61,7 @@ std::array<std::uint32_t, SegmentNumber> summarizeRoute(const std::vector<PathDa
std::transform(
route_data.begin(), route_data.end(), segments.begin(), [&index](const PathData &point)
{
return NamedSegment{point.duration_until_turn, index++, point.name_id};
return NamedSegment{point.duration_until_turn / 10.0, index++, point.name_id};
});
// this makes sure that the segment with the lowest position comes first
std::sort(segments.begin(), segments.end(), [](const NamedSegment &lhs, const NamedSegment &rhs)
@@ -96,13 +95,13 @@ std::array<std::uint32_t, SegmentNumber> summarizeRoute(const std::vector<PathDa
}
}
inline RouteLeg assembleLeg(const datafacade::BaseDataFacade &facade,
const std::vector<PathData> &route_data,
const LegGeometry &leg_geometry,
const PhantomNode &source_node,
const PhantomNode &target_node,
const bool target_traversed_in_reverse,
const bool needs_summary)
template <typename DataFacadeT>
RouteLeg assembleLeg(const DataFacadeT &facade,
const std::vector<PathData> &route_data,
const LegGeometry &leg_geometry,
const PhantomNode &source_node,
const PhantomNode &target_node,
const bool target_traversed_in_reverse)
{
const auto target_duration =
(target_traversed_in_reverse ? target_node.reverse_weight : target_node.forward_weight) /
@@ -111,7 +110,8 @@ inline RouteLeg assembleLeg(const datafacade::BaseDataFacade &facade,
auto distance = std::accumulate(leg_geometry.segment_distances.begin(),
leg_geometry.segment_distances.end(), 0.);
auto duration = std::accumulate(route_data.begin(), route_data.end(), 0.,
[](const double sum, const PathData &data) {
[](const double sum, const PathData &data)
{
return sum + data.duration_until_turn;
}) /
10.;
@@ -140,29 +140,24 @@ inline RouteLeg assembleLeg(const datafacade::BaseDataFacade &facade,
duration = duration + target_duration;
if (route_data.empty())
{
duration -= (target_traversed_in_reverse ? source_node.reverse_weight
: source_node.forward_weight) /
10.0;
duration -=
(target_traversed_in_reverse ? source_node.reverse_weight : source_node.forward_weight) / 10;
}
auto summary_array = detail::summarizeRoute<detail::MAX_USED_SEGMENTS>(route_data);
std::string summary;
if (needs_summary)
{
auto summary_array = detail::summarizeRoute<detail::MAX_USED_SEGMENTS>(route_data);
BOOST_ASSERT(detail::MAX_USED_SEGMENTS > 0);
BOOST_ASSERT(summary_array.begin() != summary_array.end());
summary = std::accumulate(std::next(summary_array.begin()), summary_array.end(),
facade.GetNameForID(summary_array.front()),
[&facade](std::string previous, const std::uint32_t name_id)
{
if (name_id != 0)
{
previous += ", " + facade.GetNameForID(name_id);
}
return previous;
});
}
BOOST_ASSERT(detail::MAX_USED_SEGMENTS > 0);
BOOST_ASSERT(summary_array.begin() != summary_array.end());
std::string summary =
std::accumulate(std::next(summary_array.begin()), summary_array.end(),
facade.GetNameForID(summary_array.front()),
[&facade](std::string previous, const std::uint32_t name_id)
{
if (name_id != 0)
{
previous += ", " + facade.GetNameForID(name_id);
}
return previous;
});
return RouteLeg{duration, distance, summary, {}};
}
+33 -21
View File
@@ -1,20 +1,20 @@
#ifndef ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
#define ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
#include "engine/guidance/leg_geometry.hpp"
#include "engine/guidance/route_step.hpp"
#include "engine/guidance/step_maneuver.hpp"
#include "engine/guidance/leg_geometry.hpp"
#include "engine/guidance/toolkit.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include "engine/internal_route_result.hpp"
#include "engine/phantom_node.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include "extractor/travel_mode.hpp"
#include "util/bearing.hpp"
#include "util/coordinate.hpp"
#include "util/coordinate_calculation.hpp"
#include "util/coordinate.hpp"
#include "util/bearing.hpp"
#include "extractor/travel_mode.hpp"
#include <boost/optional.hpp>
#include <vector>
#include <boost/optional.hpp>
namespace osrm
{
@@ -44,7 +44,6 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
const bool target_traversed_in_reverse)
{
const double constexpr ZERO_DURATION = 0., ZERO_DISTANCE = 0.;
const constexpr char *NO_ROTARY_NAME = "";
const EdgeWeight source_duration =
source_traversed_in_reverse ? source_node.reverse_weight : source_node.forward_weight;
const auto source_mode = source_traversed_in_reverse ? source_node.backward_travel_mode
@@ -85,9 +84,13 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
BOOST_ASSERT(segment_duration >= 0);
const auto name = facade.GetNameForID(path_point.name_id);
const auto distance = leg_geometry.segment_distances[segment_index];
steps.push_back(RouteStep{path_point.name_id, name, NO_ROTARY_NAME,
segment_duration / 10.0, distance, path_point.travel_mode,
maneuver, leg_geometry.FrontIndex(segment_index),
steps.push_back(RouteStep{path_point.name_id,
name,
segment_duration / 10.0,
distance,
path_point.travel_mode,
maneuver,
leg_geometry.FrontIndex(segment_index),
leg_geometry.BackIndex(segment_index) + 1});
maneuver = detail::stepManeuverFromGeometry(path_point.turn_instruction,
leg_geometry, segment_index);
@@ -98,8 +101,12 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
const auto distance = leg_geometry.segment_distances[segment_index];
const int duration = segment_duration + target_duration;
BOOST_ASSERT(duration >= 0);
steps.push_back(RouteStep{target_node.name_id, facade.GetNameForID(target_node.name_id),
NO_ROTARY_NAME, duration / 10., distance, target_mode, maneuver,
steps.push_back(RouteStep{target_node.name_id,
facade.GetNameForID(target_node.name_id),
duration / 10.,
distance,
target_mode,
maneuver,
leg_geometry.FrontIndex(segment_index),
leg_geometry.BackIndex(segment_index) + 1});
}
@@ -117,10 +124,13 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
int duration = target_duration - source_duration;
BOOST_ASSERT(duration >= 0);
steps.push_back(RouteStep{source_node.name_id, facade.GetNameForID(source_node.name_id),
NO_ROTARY_NAME, duration / 10.,
leg_geometry.segment_distances[segment_index], source_mode,
std::move(maneuver), leg_geometry.FrontIndex(segment_index),
steps.push_back(RouteStep{source_node.name_id,
facade.GetNameForID(source_node.name_id),
duration / 10.,
leg_geometry.segment_distances[segment_index],
source_mode,
std::move(maneuver),
leg_geometry.FrontIndex(segment_index),
leg_geometry.BackIndex(segment_index) + 1});
}
@@ -128,11 +138,13 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
// This step has length zero, the only reason we need it is the target location
auto final_maneuver = detail::stepManeuverFromGeometry(
extractor::guidance::TurnInstruction::NO_TURN(), WaypointType::Arrive, leg_geometry);
BOOST_ASSERT(!leg_geometry.locations.empty());
steps.push_back(RouteStep{target_node.name_id, facade.GetNameForID(target_node.name_id),
NO_ROTARY_NAME, ZERO_DURATION, ZERO_DISTANCE, target_mode,
final_maneuver, leg_geometry.locations.size()-1,
steps.push_back(RouteStep{target_node.name_id,
facade.GetNameForID(target_node.name_id),
ZERO_DURATION,
ZERO_DISTANCE,
target_mode,
final_maneuver,
leg_geometry.locations.size(),
leg_geometry.locations.size()});
return steps;
+1 -2
View File
@@ -1,8 +1,8 @@
#ifndef ROUTE_STEP_HPP
#define ROUTE_STEP_HPP
#include "engine/guidance/step_maneuver.hpp"
#include "extractor/travel_mode.hpp"
#include "engine/guidance/step_maneuver.hpp"
#include <cstddef>
@@ -25,7 +25,6 @@ struct RouteStep
{
unsigned name_id;
std::string name;
std::string rotary_name;
double duration;
double distance;
extractor::TravelMode mode;
+2 -2
View File
@@ -70,8 +70,8 @@ static_assert(ENCODED_HINT_SIZE / 4 * 3 >= sizeof(Hint),
"ENCODED_HINT_SIZE does not match size of Hint");
#else
// PhantomNode is bigger under windows because MSVC does not support bit packing
static_assert(sizeof(Hint) == 72 + 4, "Hint is bigger than expected");
constexpr std::size_t ENCODED_HINT_SIZE = 104;
static_assert(sizeof(Hint) == 64 + 4, "Hint is bigger than expected");
constexpr std::size_t ENCODED_HINT_SIZE = 92;
static_assert(ENCODED_HINT_SIZE / 4 * 3 >= sizeof(Hint),
"ENCODED_HINT_SIZE does not match size of Hint");
#endif
@@ -69,7 +69,7 @@ template <class CandidateLists> struct HiddenMarkovModel
path_distances.resize(candidates_list.size());
pruned.resize(candidates_list.size());
breakage.resize(candidates_list.size());
for (const auto i : util::irange<std::size_t>(0UL, candidates_list.size()))
for (const auto i : util::irange<std::size_t>(0u, candidates_list.size()))
{
const auto &num_candidates = candidates_list[i].size();
// add empty vectors
@@ -107,7 +107,7 @@ template <class CandidateLists> struct HiddenMarkovModel
{
BOOST_ASSERT(initial_timestamp < num_points);
for (const auto s : util::irange<std::size_t>(0UL, viterbi[initial_timestamp].size()))
for (const auto s : util::irange<std::size_t>(0u, viterbi[initial_timestamp].size()))
{
viterbi[initial_timestamp][s] = emission_log_probabilities[initial_timestamp][s];
parents[initial_timestamp][s] = std::make_pair(initial_timestamp, s);
+1 -1
View File
@@ -168,7 +168,7 @@ struct PhantomNode
#ifndef _MSC_VER
static_assert(sizeof(PhantomNode) == 60, "PhantomNode has more padding then expected");
#else
static_assert(sizeof(PhantomNode) == 72, "PhantomNode has more padding then expected");
static_assert(sizeof(PhantomNode) == 64, "PhantomNode has more padding then expected");
#endif
using PhantomNodePair = std::pair<PhantomNode, PhantomNode>;
+3 -4
View File
@@ -12,7 +12,6 @@
#include "util/integer_range.hpp"
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
@@ -123,7 +122,7 @@ class BasePlugin
const bool use_hints = !parameters.hints.empty();
const bool use_bearings = !parameters.bearings.empty();
for (const auto i : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
for (const auto i : util::irange<std::size_t>(0, parameters.coordinates.size()))
{
if (use_hints && parameters.hints[i] &&
parameters.hints[i]->IsValid(parameters.coordinates[i], facade))
@@ -162,7 +161,7 @@ class BasePlugin
const bool use_radiuses = !parameters.radiuses.empty();
BOOST_ASSERT(parameters.IsValid());
for (const auto i : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
for (const auto i : util::irange<std::size_t>(0, parameters.coordinates.size()))
{
if (use_hints && parameters.hints[i] &&
parameters.hints[i]->IsValid(parameters.coordinates[i], facade))
@@ -222,7 +221,7 @@ class BasePlugin
const bool use_radiuses = !parameters.radiuses.empty();
BOOST_ASSERT(parameters.IsValid());
for (const auto i : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
for (const auto i : util::irange<std::size_t>(0, parameters.coordinates.size()))
{
if (use_hints && parameters.hints[i] &&
parameters.hints[i]->IsValid(parameters.coordinates[i], facade))
@@ -84,25 +84,19 @@ class AlternativeRouting final
int upper_bound_to_shortest_path_distance = INVALID_EDGE_WEIGHT;
NodeID middle_node = SPECIAL_NODEID;
const EdgeWeight min_edge_offset =
std::min(phantom_node_pair.source_phantom.forward_segment_id.enabled
? -phantom_node_pair.source_phantom.GetForwardWeightPlusOffset()
: 0,
phantom_node_pair.source_phantom.reverse_segment_id.enabled
? -phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()
: 0);
std::min(phantom_node_pair.source_phantom.forward_segment_id.enabled ? -phantom_node_pair.source_phantom.GetForwardWeightPlusOffset() : 0,
phantom_node_pair.source_phantom.reverse_segment_id.enabled ? -phantom_node_pair.source_phantom.GetReverseWeightPlusOffset() : 0);
if (phantom_node_pair.source_phantom.forward_segment_id.enabled)
{
BOOST_ASSERT(phantom_node_pair.source_phantom.forward_segment_id.id !=
SPECIAL_SEGMENTID);
BOOST_ASSERT(phantom_node_pair.source_phantom.forward_segment_id.id != SPECIAL_SEGMENTID);
forward_heap1.Insert(phantom_node_pair.source_phantom.forward_segment_id.id,
-phantom_node_pair.source_phantom.GetForwardWeightPlusOffset(),
phantom_node_pair.source_phantom.forward_segment_id.id);
}
if (phantom_node_pair.source_phantom.reverse_segment_id.enabled)
{
BOOST_ASSERT(phantom_node_pair.source_phantom.reverse_segment_id.id !=
SPECIAL_SEGMENTID);
BOOST_ASSERT(phantom_node_pair.source_phantom.reverse_segment_id.id != SPECIAL_SEGMENTID);
forward_heap1.Insert(phantom_node_pair.source_phantom.reverse_segment_id.id,
-phantom_node_pair.source_phantom.GetReverseWeightPlusOffset(),
phantom_node_pair.source_phantom.reverse_segment_id.id);
@@ -110,16 +104,14 @@ class AlternativeRouting final
if (phantom_node_pair.target_phantom.forward_segment_id.enabled)
{
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_segment_id.id !=
SPECIAL_SEGMENTID);
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_segment_id.id != SPECIAL_SEGMENTID);
reverse_heap1.Insert(phantom_node_pair.target_phantom.forward_segment_id.id,
phantom_node_pair.target_phantom.GetForwardWeightPlusOffset(),
phantom_node_pair.target_phantom.forward_segment_id.id);
}
if (phantom_node_pair.target_phantom.reverse_segment_id.enabled)
{
BOOST_ASSERT(phantom_node_pair.target_phantom.reverse_segment_id.id !=
SPECIAL_SEGMENTID);
BOOST_ASSERT(phantom_node_pair.target_phantom.reverse_segment_id.id != SPECIAL_SEGMENTID);
reverse_heap1.Insert(phantom_node_pair.target_phantom.reverse_segment_id.id,
phantom_node_pair.target_phantom.GetReverseWeightPlusOffset(),
phantom_node_pair.target_phantom.reverse_segment_id.id);
@@ -316,11 +308,9 @@ class AlternativeRouting final
BOOST_ASSERT(!packed_shortest_path.empty());
raw_route_data.unpacked_path_segments.resize(1);
raw_route_data.source_traversed_in_reverse.push_back(
(packed_shortest_path.front() !=
phantom_node_pair.source_phantom.forward_segment_id.id));
(packed_shortest_path.front() != phantom_node_pair.source_phantom.forward_segment_id.id));
raw_route_data.target_traversed_in_reverse.push_back(
(packed_shortest_path.back() !=
phantom_node_pair.target_phantom.forward_segment_id.id));
(packed_shortest_path.back() != phantom_node_pair.target_phantom.forward_segment_id.id));
super::UnpackPath(
// -- packed input
@@ -339,12 +329,10 @@ class AlternativeRouting final
RetrievePackedAlternatePath(forward_heap1, reverse_heap1, forward_heap2, reverse_heap2,
s_v_middle, v_t_middle, packed_alternate_path);
raw_route_data.alt_source_traversed_in_reverse.push_back(
(packed_alternate_path.front() !=
phantom_node_pair.source_phantom.forward_segment_id.id));
raw_route_data.alt_source_traversed_in_reverse.push_back((
packed_alternate_path.front() != phantom_node_pair.source_phantom.forward_segment_id.id));
raw_route_data.alt_target_traversed_in_reverse.push_back(
(packed_alternate_path.back() !=
phantom_node_pair.target_phantom.forward_segment_id.id));
(packed_alternate_path.back() != phantom_node_pair.target_phantom.forward_segment_id.id));
// unpack the alternate path
super::UnpackPath(packed_alternate_path.begin(), packed_alternate_path.end(),
@@ -441,9 +429,9 @@ class AlternativeRouting final
// partial unpacking, compute sharing
// First partially unpack s-->v until paths deviate, note length of common path.
const auto s_v_min_path_size =
std::min(packed_s_v_path.size(), packed_shortest_path.size()) - 1;
for (const auto current_node : util::irange<std::size_t>(0UL, s_v_min_path_size))
const int64_t s_v_min_path_size =
static_cast<int64_t>(std::min(packed_s_v_path.size(), packed_shortest_path.size())) - 1;
for (const int64_t current_node : util::irange<int64_t>(0, s_v_min_path_size))
{
if (packed_s_v_path[current_node] == packed_shortest_path[current_node] &&
packed_s_v_path[current_node + 1] == packed_shortest_path[current_node + 1])
@@ -244,14 +244,14 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
((haversine_distance + max_distance_delta) * 0.25) * 10;
// compute d_t for this timestamp and the next one
for (const auto s : util::irange<std::size_t>(0UL, prev_viterbi.size()))
for (const auto s : util::irange<std::size_t>(0u, prev_viterbi.size()))
{
if (prev_pruned[s])
{
continue;
}
for (const auto s_prime : util::irange<std::size_t>(0UL, current_viterbi.size()))
for (const auto s_prime : util::irange<std::size_t>(0u, current_viterbi.size()))
{
const double emission_pr = emission_log_probabilities[t][s_prime];
double new_value = prev_viterbi[s] + emission_pr;
@@ -373,7 +373,8 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
// t: fwd_segment 3
// -> (U, v), (v, w), (w, x)
// note that (x, t) is _not_ included but needs to be added later.
for (std::size_t i = start_index; i != end_index; (start_index < end_index ? ++i : --i))
BOOST_ASSERT(start_index <= end_index);
for (std::size_t i = start_index; i != end_index; ++i)
{
BOOST_ASSERT(i < id_vector.size());
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_travel_mode > 0);
@@ -558,7 +559,9 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
// make sure to correctly unpack loops
if (distance != forward_heap.GetKey(middle) + reverse_heap.GetKey(middle))
{
// self loop makes up the full path
// self loop
BOOST_ASSERT(forward_heap.GetData(middle).parent == middle &&
reverse_heap.GetData(middle).parent == middle);
packed_leg.push_back(middle);
packed_leg.push_back(middle);
}
@@ -227,7 +227,7 @@ class ShortestPathRouting final
raw_route_data.shortest_path_length = shortest_path_length;
for (const auto current_leg : util::irange<std::size_t>(0UL, packed_leg_begin.size() - 1))
for (const auto current_leg : util::irange<std::size_t>(0, packed_leg_begin.size() - 1))
{
auto leg_begin = total_packed_path.begin() + packed_leg_begin[current_leg];
auto leg_end = total_packed_path.begin() + packed_leg_begin[current_leg + 1];
@@ -245,10 +245,10 @@ class ShortestPathRouting final
}
void operator()(const std::vector<PhantomNodes> &phantom_nodes_vector,
const boost::optional<bool> continue_straight_at_waypoint,
const boost::optional<bool> uturns,
InternalRouteResult &raw_route_data) const
{
const bool allow_uturn_at_waypoint = !(continue_straight_at_waypoint ? *continue_straight_at_waypoint : super::facade->GetContinueStraightDefault());
const bool allow_u_turn_at_via = uturns ? *uturns : super::facade->GetUTurnsDefault();
engine_working_data.InitializeOrClearFirstThreadLocalStorage(
super::facade->GetNumberOfNodes());
@@ -299,7 +299,7 @@ class ShortestPathRouting final
if (search_to_reverse_node || search_to_forward_node)
{
if (allow_uturn_at_waypoint)
if (allow_u_turn_at_via)
{
SearchWithUTurn(forward_heap, reverse_heap, forward_core_heap,
reverse_core_heap, search_from_forward_node,
@@ -309,7 +309,7 @@ class ShortestPathRouting final
new_total_distance_to_forward, packed_leg_to_forward);
// if only the reverse node is valid (e.g. when using the match plugin) we
// actually need to move
if (!target_phantom.forward_segment_id.enabled)
if (target_phantom.forward_segment_id.enabled)
{
BOOST_ASSERT(target_phantom.reverse_segment_id.enabled);
new_total_distance_to_reverse = new_total_distance_to_forward;
-32
View File
@@ -1,32 +0,0 @@
#ifndef OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
namespace osrm
{
namespace extractor
{
namespace guidance
{
const bool constexpr INVERT = true;
// what angle is interpreted as going straight
const double constexpr STRAIGHT_ANGLE = 180.;
// if a turn deviates this much from going straight, it will be kept straight
const double constexpr MAXIMAL_ALLOWED_NO_TURN_DEVIATION = 3.;
// angle that lies between two nearly indistinguishable roads
const double constexpr NARROW_TURN_ANGLE = 40.;
const double constexpr GROUP_ANGLE = 90;
// angle difference that can be classified as straight, if its the only narrow turn
const double constexpr FUZZY_ANGLE_DIFFERENCE = 15.;
const double constexpr DISTINCTION_RATIO = 2;
const unsigned constexpr INVALID_NAME_ID = 0;
const double constexpr MAX_ROUNDABOUT_RADIUS = 15; // 30 m diameter as final distinction
const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif // OSRM_EXTRACTOR_GUIDANCE_CONSTANTS_HPP_
@@ -1,66 +0,0 @@
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_
#include <string>
#include <vector>
#include "extractor/guidance/turn_instruction.hpp"
#include "util/typedefs.hpp" // EdgeID
namespace osrm
{
namespace extractor
{
namespace guidance
{
// Every Turn Operation describes a way of switching onto a segment, indicated by an EdgeID. The
// associated turn is described by an angle and an instruction that is used to announce it.
// The Turn Operation indicates what is exposed to the outside of the turn analysis.
struct TurnOperation final
{
EdgeID eid;
double angle;
TurnInstruction instruction;
};
// A Connected Road is the internal representation of a potential turn. Internally, we require
// full list of all connected roads to determine the outcome.
// The reasoning behind is that even invalid turns can influence the perceived angles, or even
// instructions themselves. An pososible example can be described like this:
//
// aaa(2)aa
// a - bbbbb
// aaa(1)aa
//
// will not be perceived as a turn from (1) -> b, and as a U-turn from (1) -> (2).
// In addition, they can influence whether a turn is obvious or not. b->(2) would also be no
// turn-operation,
// but rather a name change.
//
// If this were a normal intersection with
//
// cccccccc
// o bbbbb
// aaaaaaaa
//
// We would perceive a->c as a sharp turn, a->b as a slight turn, and b->c as a slight turn.
struct ConnectedRoad final
{
ConnectedRoad(const TurnOperation turn, const bool entry_allowed = false);
// a turn may be relevant to good instructions, even if we cannot enter the road
bool entry_allowed;
TurnOperation turn;
};
// small helper function to print the content of a connected road
std::string toString(const ConnectedRoad &road);
typedef std::vector<ConnectedRoad> Intersection;
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif /*OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HPP_*/
@@ -1,68 +0,0 @@
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_GENERATOR_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_GENERATOR_HPP_
#include "extractor/compressed_edge_container.hpp"
#include "extractor/guidance/intersection.hpp"
#include "extractor/query_node.hpp"
#include "extractor/restriction_map.hpp"
#include "util/node_based_graph.hpp"
#include "util/typedefs.hpp"
#include <unordered_set>
#include <vector>
namespace osrm
{
namespace extractor
{
namespace guidance
{
// The Intersection Generator is given a turn location and generates an intersection representation
// from it. For this all turn possibilities are analysed.
// We consider turn restrictions to indicate possible turns. U-turns are generated based on profile
// decisions.
class IntersectionGenerator
{
public:
IntersectionGenerator(const util::NodeBasedDynamicGraph &node_based_graph,
const RestrictionMap &restriction_map,
const std::unordered_set<NodeID> &barrier_nodes,
const std::vector<QueryNode> &node_info_list,
const CompressedEdgeContainer &compressed_edge_container);
Intersection operator()(const NodeID nid, const EdgeID via_eid) const;
private:
const util::NodeBasedDynamicGraph &node_based_graph;
const RestrictionMap &restriction_map;
const std::unordered_set<NodeID> &barrier_nodes;
const std::vector<QueryNode> &node_info_list;
const CompressedEdgeContainer &compressed_edge_container;
// Check for restrictions/barriers and generate a list of valid and invalid turns present at
// the
// node reached
// from `from_node` via `via_eid`
// The resulting candidates have to be analysed for their actual instructions later on.
Intersection getConnectedRoads(const NodeID from_node, const EdgeID via_eid) const;
// Merge segregated roads to omit invalid turns in favor of treating segregated roads as
// one.
// This function combines roads the following way:
//
// * *
// * is converted to *
// v ^ +
// v ^ +
//
// The treatment results in a straight turn angle of 180º rather than a turn angle of approx
// 160
Intersection mergeSegregatedRoads(Intersection intersection) const;
};
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif /* OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_GENERATOR_HPP_ */
@@ -1,71 +0,0 @@
#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_
#include "extractor/guidance/intersection.hpp"
#include "extractor/query_node.hpp"
#include "util/name_table.hpp"
#include "util/node_based_graph.hpp"
#include <cstddef>
#include <vector>
namespace osrm
{
namespace extractor
{
namespace guidance
{
// Intersection handlers deal with all issues related to intersections.
// They assign appropriate turn operations to the TurnOperations.
// This base class provides both the interface and implementations for
// common functions.
class IntersectionHandler
{
public:
IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<QueryNode> &node_info_list,
const util::NameTable &name_table);
virtual ~IntersectionHandler();
// check whether the handler can actually handle the intersection
virtual bool
canProcess(const NodeID nid, const EdgeID via_eid, const Intersection &intersection) const = 0;
// process the intersection
virtual Intersection
operator()(const NodeID nid, const EdgeID via_eid, Intersection intersection) const = 0;
protected:
const util::NodeBasedDynamicGraph &node_based_graph;
const std::vector<QueryNode> &node_info_list;
const util::NameTable &name_table;
// counts the number on allowed entry roads
std::size_t countValid(const Intersection &intersection) const;
// Decide on a basic turn types
TurnType findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
// Get the Instruction for an obvious turn
TurnInstruction getInstructionForObvious(const std::size_t number_of_candidates,
const EdgeID via_edge,
const bool through_street,
const ConnectedRoad &candidate) const;
// Treating potential forks
void assignFork(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
void assignFork(const EdgeID via_edge,
ConnectedRoad &left,
ConnectedRoad &center,
ConnectedRoad &right) const;
bool isThroughStreet(const std::size_t index, const Intersection &intersection) const;
};
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif /*OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_HANDLER_HPP_*/
@@ -1,51 +0,0 @@
#ifndef OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_
#include "extractor/guidance/intersection_handler.hpp"
#include "extractor/guidance/intersection.hpp"
#include "extractor/query_node.hpp"
#include "util/name_table.hpp"
#include "util/node_based_graph.hpp"
#include <vector>
namespace osrm
{
namespace extractor
{
namespace guidance
{
// Intersection handlers deal with all issues related to intersections.
// They assign appropriate turn operations to the TurnOperations.
class MotorwayHandler : public IntersectionHandler
{
public:
MotorwayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<QueryNode> &node_info_list,
const util::NameTable &name_table);
~MotorwayHandler() override final;
// check whether the handler can actually handle the intersection
bool canProcess(const NodeID nid,
const EdgeID via_eid,
const Intersection &intersection) const override final;
// process the intersection
Intersection operator()(const NodeID nid,
const EdgeID via_eid,
Intersection intersection) const override final;
private:
Intersection fromMotorway(const EdgeID via_edge, Intersection intersection) const;
Intersection fromRamp(const EdgeID via_edge, Intersection intersection) const;
Intersection fallback(Intersection intersection) const;
};
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif /*OSRM_EXTRACTOR_GUIDANCE_MOTORWAY_HANDLER_HPP_*/
@@ -1,71 +0,0 @@
#ifndef OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_
#include "extractor/guidance/intersection.hpp"
#include "extractor/guidance/intersection_handler.hpp"
#include "extractor/query_node.hpp"
#include "util/name_table.hpp"
#include "util/node_based_graph.hpp"
#include "util/typedefs.hpp"
#include <utility>
#include <vector>
namespace osrm
{
namespace extractor
{
namespace guidance
{
namespace detail
{
struct RoundaboutFlags
{
bool on_roundabout;
bool can_enter;
bool can_exit_separately;
};
} // namespace detail
// The roundabout handler processes all roundabout related instructions.
// It performs both the distinction between rotaries and roundabouts and
// assigns appropriate entry/exit instructions.
class RoundaboutHandler : public IntersectionHandler
{
public:
RoundaboutHandler(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<QueryNode> &node_info_list,
const util::NameTable &name_table);
~RoundaboutHandler() override final;
// check whether the handler can actually handle the intersection
bool canProcess(const NodeID from_nid, const EdgeID via_eid, const Intersection &intersection) const override final;
// process the intersection
Intersection operator()(const NodeID from_nid, const EdgeID via_eid, Intersection intersection) const override final;
private:
detail::RoundaboutFlags getRoundaboutFlags(const NodeID from_nid, const EdgeID via_eid, const Intersection &intersection) const;
// decide whether we lookk at a roundabout or a rotary
bool isRotary(const NodeID nid) const;
// TODO handle bike/walk cases that allow crossing a roundabout!
// Processing of roundabouts
// Produces instructions to enter/exit a roundabout or to stay on it.
// Performs the distinction between roundabout and rotaries.
Intersection handleRoundabouts(const bool is_rotary,
const EdgeID via_edge,
const bool on_roundabout,
const bool can_exit_roundabout,
Intersection intersection) const;
};
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif /*OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_HANDLER_HPP_*/
+37 -37
View File
@@ -8,14 +8,14 @@
#include "extractor/compressed_edge_container.hpp"
#include "extractor/query_node.hpp"
#include "extractor/guidance/classification_data.hpp"
#include "extractor/guidance/discrete_angle.hpp"
#include "extractor/guidance/classification_data.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include <algorithm>
#include <map>
#include <cmath>
#include <cstdint>
#include <map>
#include <string>
namespace osrm
@@ -42,21 +42,22 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
const util::Coordinate final_coordinate,
const std::vector<extractor::QueryNode> &query_nodes)
{
const auto extractCoordinateFromNode =
[](const extractor::QueryNode &node) -> util::Coordinate {
const auto extractCoordinateFromNode = [](const extractor::QueryNode &node) -> util::Coordinate
{
return {node.lon, node.lat};
};
double distance_to_current_coordinate = 0;
double distance_to_next_coordinate = 0;
// get the length that is missing from the current segment to reach DESIRED_SEGMENT_LENGTH
const auto getFactor = [](const double first_distance, const double second_distance) {
const auto getFactor = [](const double first_distance, const double second_distance)
{
BOOST_ASSERT(first_distance < detail::DESIRED_SEGMENT_LENGTH);
double segment_length = second_distance - first_distance;
BOOST_ASSERT(segment_length > 0);
BOOST_ASSERT(second_distance >= detail::DESIRED_SEGMENT_LENGTH);
double missing_distance = detail::DESIRED_SEGMENT_LENGTH - first_distance;
return std::max(0., std::min(missing_distance / segment_length, 1.0));
return missing_distance / segment_length;
};
for (auto compressed_geometry_itr = compressed_geometry_begin;
@@ -84,8 +85,7 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
util::coordinate_calculation::haversineDistance(current_coordinate, final_coordinate);
// reached point where coordinates switch between
if (distance_to_current_coordinate < detail::DESIRED_SEGMENT_LENGTH &&
distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
if (distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
return util::coordinate_calculation::interpolateLinear(
getFactor(distance_to_current_coordinate, distance_to_next_coordinate),
current_coordinate, final_coordinate);
@@ -104,8 +104,8 @@ getRepresentativeCoordinate(const NodeID from_node,
const extractor::CompressedEdgeContainer &compressed_geometries,
const std::vector<extractor::QueryNode> &query_nodes)
{
const auto extractCoordinateFromNode =
[](const extractor::QueryNode &node) -> util::Coordinate {
const auto extractCoordinateFromNode = [](const extractor::QueryNode &node) -> util::Coordinate
{
return {node.lon, node.lat};
};
@@ -298,10 +298,14 @@ inline DirectionModifier getTurnDirection(const double angle)
// swaps left <-> right modifier types
inline DirectionModifier mirrorDirectionModifier(const DirectionModifier modifier)
{
const constexpr DirectionModifier results[] = {
DirectionModifier::UTurn, DirectionModifier::SharpLeft, DirectionModifier::Left,
DirectionModifier::SlightLeft, DirectionModifier::Straight, DirectionModifier::SlightRight,
DirectionModifier::Right, DirectionModifier::SharpRight};
const constexpr DirectionModifier results[] = {DirectionModifier::UTurn,
DirectionModifier::SharpLeft,
DirectionModifier::Left,
DirectionModifier::SlightLeft,
DirectionModifier::Straight,
DirectionModifier::SlightRight,
DirectionModifier::Right,
DirectionModifier::SharpRight};
return results[modifier];
}
@@ -341,14 +345,13 @@ inline bool requiresNameAnnounced(const std::string &from, const std::string &to
std::string to_ref;
// Split from the format "{name} ({ref})" -> name, ref
auto split = [](const std::string &name, std::string &out_name, std::string &out_ref) {
auto split = [](const std::string &name, std::string &out_name, std::string &out_ref)
{
const auto ref_begin = name.find_first_of('(');
if (ref_begin != std::string::npos)
{
if (ref_begin != 0)
out_name = name.substr(0, ref_begin - 1);
const auto ref_end = name.find_first_of(')');
out_ref = name.substr(ref_begin + 1, ref_end - ref_begin - 1);
out_name = name.substr(0, ref_begin);
out_ref = name.substr(ref_begin + 1, name.find_first_of(')') - 1);
}
else
{
@@ -360,38 +363,35 @@ inline bool requiresNameAnnounced(const std::string &from, const std::string &to
split(to, to_name, to_ref);
// check similarity of names
const auto names_are_empty = from_name.empty() && to_name.empty();
const auto names_are_equal = from_name == to_name;
const auto name_is_removed = !from_name.empty() && to_name.empty();
auto names_are_empty = from_name.empty() && to_name.empty();
auto names_are_equal = from_name == to_name;
auto name_is_removed = !from_name.empty() && to_name.empty();
// references are contained in one another
const auto refs_are_empty = from_ref.empty() && to_ref.empty();
const auto ref_is_contained =
from_ref.empty() || to_ref.empty() ||
auto refs_are_empty = from_ref.empty() && to_ref.empty();
auto ref_is_contained =
!from_ref.empty() && !to_ref.empty() &&
(from_ref.find(to_ref) != std::string::npos || to_ref.find(from_ref) != std::string::npos);
const auto ref_is_removed = !from_ref.empty() && to_ref.empty();
auto ref_is_removed = !from_ref.empty() && to_ref.empty();
const auto obvious_change =
(names_are_empty && refs_are_empty) || (names_are_equal && ref_is_contained) ||
(names_are_equal && refs_are_empty) || name_is_removed || ref_is_removed;
auto obvious_change = ref_is_contained || names_are_equal ||
(names_are_empty && refs_are_empty) || name_is_removed || ref_is_removed;
return !obvious_change;
}
inline int getPriority(const FunctionalRoadClass road_class)
inline int getPriority( const FunctionalRoadClass road_class )
{
// The road priorities indicate which roads can bee seen as more or less equal.
// They are used in Fork-Discovery. Possibly should be moved to profiles post v5?
// A fork can happen between road types that are at most 1 priority apart from each other
const constexpr int road_priority[] = {10, 0, 10, 2, 10, 4, 10, 6,
10, 8, 10, 11, 10, 12, 10, 14};
//The road priorities indicate which roads can bee seen as more or less equal.
//They are used in Fork-Discovery. Possibly should be moved to profiles post v5?
//A fork can happen between road types that are at most 1 priority apart from each other
const constexpr int road_priority[] = {10, 0, 10, 2, 10, 4, 10, 6, 10, 8, 10, 11, 10, 12, 10, 14};
return road_priority[static_cast<int>(road_class)];
}
inline bool canBeSeenAsFork(const FunctionalRoadClass first, const FunctionalRoadClass second)
{
// forks require similar road categories
// Based on the priorities assigned above, we can set forks only if the road priorities match
// closely.
// Based on the priorities assigned above, we can set forks only if the road priorities match closely.
// Potentially we could include features like number of lanes here and others?
// Should also be moved to profiles
return std::abs(getPriority(first) - getPriority(second)) <= 1;
+157 -18
View File
@@ -1,27 +1,20 @@
#ifndef OSRM_EXTRACTOR_TURN_ANALYSIS
#define OSRM_EXTRACTOR_TURN_ANALYSIS
#include "extractor/compressed_edge_container.hpp"
#include "extractor/guidance/intersection.hpp"
#include "extractor/guidance/intersection_generator.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "extractor/guidance/turn_classification.hpp"
#include "extractor/guidance/roundabout_handler.hpp"
#include "extractor/guidance/motorway_handler.hpp"
#include "extractor/guidance/turn_handler.hpp"
#include "extractor/query_node.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "extractor/restriction_map.hpp"
#include "extractor/compressed_edge_container.hpp"
#include "util/name_table.hpp"
#include "util/node_based_graph.hpp"
#include <cstdint>
#include <memory>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include <memory>
#include <utility>
#include <unordered_set>
namespace osrm
{
@@ -30,6 +23,46 @@ namespace extractor
namespace guidance
{
// What is exposed to the outside
struct TurnOperation final
{
EdgeID eid;
double angle;
TurnInstruction instruction;
};
// For the turn analysis, we require a full list of all connected roads to determine the outcome.
// Invalid turns can influence the perceived angles
//
// aaa(2)aa
// a - bbbbb
// aaa(1)aa
//
// will not be perceived as a turn from (1) -> b, and as a U-turn from (1) -> (2).
// In addition, they can influence whether a turn is obvious or not.
struct ConnectedRoad final
{
ConnectedRoad(const TurnOperation turn, const bool entry_allowed = false);
TurnOperation turn;
bool entry_allowed; // a turn may be relevant to good instructions, even if we cannot take
// the road
std::string toString() const
{
std::string result = "[connection] ";
result += std::to_string(turn.eid);
result += " allows entry: ";
result += std::to_string(entry_allowed);
result += " angle: ";
result += std::to_string(turn.angle);
result += " instruction: ";
result += std::to_string(static_cast<std::int32_t>(turn.instruction.type)) + " " +
std::to_string(static_cast<std::int32_t>(turn.instruction.direction_modifier));
return result;
}
};
class TurnAnalysis
{
@@ -46,14 +79,120 @@ class TurnAnalysis
private:
const util::NodeBasedDynamicGraph &node_based_graph;
const IntersectionGenerator intersection_generator;
const RoundaboutHandler roundabout_handler;
const MotorwayHandler motorway_handler;
const TurnHandler turn_handler;
const std::vector<QueryNode> &node_info_list;
const RestrictionMap &restriction_map;
const std::unordered_set<NodeID> &barrier_nodes;
const CompressedEdgeContainer &compressed_edge_container;
const util::NameTable &name_table;
// Check for restrictions/barriers and generate a list of valid and invalid turns present at
// the
// node reached
// from `from_node` via `via_eid`
// The resulting candidates have to be analysed for their actual instructions later on.
std::vector<ConnectedRoad> getConnectedRoads(const NodeID from_node,
const EdgeID via_eid) const;
// Merge segregated roads to omit invalid turns in favor of treating segregated roads as
// one.
// This function combines roads the following way:
//
// * *
// * is converted to *
// v ^ +
// v ^ +
//
// The treatment results in a straight turn angle of 180º rather than a turn angle of approx
// 160
std::vector<ConnectedRoad> mergeSegregatedRoads(std::vector<ConnectedRoad> intersection) const;
// TODO distinguish roundabouts and rotaries
// TODO handle bike/walk cases that allow crossing a roundabout!
// Processing of roundabouts
// Produces instructions to enter/exit a roundabout or to stay on it.
// Performs the distinction between roundabout and rotaries.
std::vector<ConnectedRoad> handleRoundabouts(const EdgeID via_edge,
const bool on_roundabout,
const bool can_exit_roundabout,
std::vector<ConnectedRoad> intersection) const;
// Indicates a Junction containing a motoryway
bool isMotorwayJunction(const EdgeID via_edge,
const std::vector<ConnectedRoad> &intersection) const;
// Decide whether a turn is a turn or a ramp access
TurnType findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
// Get the Instruction for an obvious turn
// Instruction will be a silent instruction
TurnInstruction getInstructionForObvious(const std::size_t number_of_candidates,
const EdgeID via_edge,
const ConnectedRoad &candidate) const;
// Helper Function that decides between NoTurn or NewName
TurnInstruction
noTurnOrNewName(const NodeID from, const EdgeID via_edge, const ConnectedRoad &candidate) const;
// Basic Turn Handling
// Dead end.
std::vector<ConnectedRoad> handleOneWayTurn(std::vector<ConnectedRoad> intersection) const;
// Mode Changes, new names...
std::vector<ConnectedRoad> handleTwoWayTurn(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection) const;
// Forks, T intersections and similar
std::vector<ConnectedRoad> handleThreeWayTurn(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection) const;
// Handling of turns larger then degree three
std::vector<ConnectedRoad> handleComplexTurn(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection) const;
// Any Junction containing motorways
std::vector<ConnectedRoad> handleMotorwayJunction(
const EdgeID via_edge, std::vector<ConnectedRoad> intersection) const;
std::vector<ConnectedRoad> handleFromMotorway(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection) const;
std::vector<ConnectedRoad> handleMotorwayRamp(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection) const;
// Utility function, setting basic turn types. Prepares for normal turn handling.
Intersection
setTurnTypes(const NodeID from, const EdgeID via_edge, Intersection intersection) const;
std::vector<ConnectedRoad> setTurnTypes(const NodeID from,
const EdgeID via_edge,
std::vector<ConnectedRoad> intersection) const;
// Assignment of specific turn types
void assignFork(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
void assignFork(const EdgeID via_edge,
ConnectedRoad &left,
ConnectedRoad &center,
ConnectedRoad &right) const;
void
handleDistinctConflict(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
// Type specific fallbacks
std::vector<ConnectedRoad>
fallbackTurnAssignmentMotorway(std::vector<ConnectedRoad> intersection) const;
// Classification
std::size_t findObviousTurn(const EdgeID via_edge,
const std::vector<ConnectedRoad> &intersection) const;
std::pair<std::size_t, std::size_t>
findFork(const std::vector<ConnectedRoad> &intersection) const;
std::vector<ConnectedRoad> assignLeftTurns(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection,
const std::size_t starting_at) const;
std::vector<ConnectedRoad> assignRightTurns(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection,
const std::size_t up_to) const;
}; // class TurnAnalysis
} // namespace guidance
@@ -1,74 +0,0 @@
#ifndef OSRM_EXTRACTOR_GUIDANCE_TURN_HANDLER_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_TURN_HANDLER_HPP_
#include "extractor/guidance/intersection_handler.hpp"
#include "extractor/guidance/intersection.hpp"
#include "extractor/query_node.hpp"
#include "util/name_table.hpp"
#include "util/node_based_graph.hpp"
#include <cstddef>
#include <vector>
#include <utility>
namespace osrm
{
namespace extractor
{
namespace guidance
{
// Intersection handlers deal with all issues related to intersections.
// They assign appropriate turn operations to the TurnOperations.
class TurnHandler : public IntersectionHandler
{
public:
TurnHandler(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<QueryNode> &node_info_list,
const util::NameTable &name_table);
~TurnHandler() override final;
// check whether the handler can actually handle the intersection
bool canProcess(const NodeID nid,
const EdgeID via_eid,
const Intersection &intersection) const override final;
// process the intersection
Intersection operator()(const NodeID nid,
const EdgeID via_eid,
Intersection intersection) const override final;
private:
// Dead end.
Intersection handleOneWayTurn(Intersection intersection) const;
// Mode Changes, new names...
Intersection handleTwoWayTurn(const EdgeID via_edge, Intersection intersection) const;
// Forks, T intersections and similar
Intersection handleThreeWayTurn(const EdgeID via_edge, Intersection intersection) const;
// Handling of turns larger then degree three
Intersection handleComplexTurn(const EdgeID via_edge, Intersection intersection) const;
void
handleDistinctConflict(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
// Classification
std::size_t findObviousTurn(const EdgeID via_edge, const Intersection &intersection) const;
std::pair<std::size_t, std::size_t> findFork(const Intersection &intersection) const;
Intersection assignLeftTurns(const EdgeID via_edge,
Intersection intersection,
const std::size_t starting_at) const;
Intersection assignRightTurns(const EdgeID via_edge,
Intersection intersection,
const std::size_t up_to) const;
};
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif /*OSRM_EXTRACTOR_GUIDANCE_TURN_HANDLER_HPP_*/
@@ -89,32 +89,24 @@ struct TurnInstruction
return TurnInstruction(TurnType::NoTurn, DirectionModifier::UTurn);
}
static TurnInstruction REMAIN_ROUNDABOUT(bool is_rotary, const DirectionModifier modifier)
static TurnInstruction REMAIN_ROUNDABOUT(const DirectionModifier modifier)
{
(void)is_rotary; // staying does not require a different instruction at the moment
return TurnInstruction(TurnType::StayOnRoundabout, modifier);
}
static TurnInstruction ENTER_ROUNDABOUT(bool is_rotary, const DirectionModifier modifier)
static TurnInstruction ENTER_ROUNDABOUT(const DirectionModifier modifier)
{
return {is_rotary ? TurnType::EnterRotary : TurnType::EnterRoundabout, modifier};
return TurnInstruction(TurnType::EnterRoundabout, modifier);
}
static TurnInstruction EXIT_ROUNDABOUT(bool is_rotary, const DirectionModifier modifier)
static TurnInstruction EXIT_ROUNDABOUT(const DirectionModifier modifier)
{
return {is_rotary ? TurnType::ExitRotary : TurnType::ExitRoundabout, modifier};
}
static TurnInstruction ENTER_AND_EXIT_ROUNDABOUT(bool is_rotary,
const DirectionModifier modifier)
{
return {is_rotary ? TurnType::EnterAndExitRotary : TurnType::EnterAndExitRoundabout,
modifier};
return TurnInstruction(TurnType::ExitRoundabout, modifier);
}
static TurnInstruction SUPPRESSED(const DirectionModifier modifier)
{
return {TurnType::Suppressed, modifier};
return TurnInstruction{TurnType::Suppressed, modifier};
}
};
+2 -2
View File
@@ -11,7 +11,7 @@ namespace extractor
struct ProfileProperties
{
ProfileProperties()
: traffic_signal_penalty(0), u_turn_penalty(0), continue_straight_at_waypoint(true), use_turn_restrictions(false)
: traffic_signal_penalty(0), u_turn_penalty(0), allow_u_turn_at_via(false), use_turn_restrictions(false)
{
}
@@ -39,7 +39,7 @@ struct ProfileProperties
int traffic_signal_penalty;
//! penalty to do a uturn in deci-seconds
int u_turn_penalty;
bool continue_straight_at_waypoint;
bool allow_u_turn_at_via;
bool use_turn_restrictions;
};
}
+1 -1
View File
@@ -19,7 +19,7 @@ namespace osrm
namespace extractor
{
struct ProfileProperties;
class ProfileProperties;
/**
* Parses the relations that represents turn restrictions.
+1
View File
@@ -46,6 +46,7 @@ const constexpr osrm::extractor::TravelMode TRAVEL_MODE_WALKING = 3;
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_FERRY = 4;
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_TRAIN = 5;
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_PUSHING_BIKE = 6;
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_MOVABLE_BRIDGE = 7;
// FIXME only for testbot.lua
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_STEPS_UP = 8;
const constexpr osrm::extractor::TravelMode TRAVEL_MODE_STEPS_DOWN = 9;
+38 -72
View File
@@ -3,15 +3,22 @@
#include "engine/api/base_parameters.hpp"
#include "engine/bearing.hpp"
#include "engine/hint.hpp"
#include "engine/polyline_compressor.hpp"
#include "engine/hint.hpp"
#include "engine/bearing.hpp"
#include <boost/optional.hpp>
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_lit.hpp>
#include <boost/spirit/include/qi_char_.hpp>
#include <boost/spirit/include/qi_int.hpp>
#include <boost/spirit/include/qi_real.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi_action.hpp>
#include <boost/spirit/include/qi_optional.hpp>
#include <boost/spirit/include/qi_attr_cast.hpp>
#include <boost/spirit/include/qi_operator.hpp>
#include <boost/spirit/include/qi_repeat.hpp>
#include <boost/spirit/include/qi_as_string.hpp>
#include <limits>
#include <string>
namespace osrm
@@ -22,99 +29,60 @@ namespace api
{
namespace qi = boost::spirit::qi;
template <typename T, char... Fmt> struct no_trailing_dot_policy : qi::real_policies<T>
{
template <typename Iterator> static bool parse_dot(Iterator &first, Iterator const &last)
{
if (first == last || *first != '.')
return false;
static const constexpr char fmt[sizeof...(Fmt)] = {Fmt...};
if (first + sizeof(fmt) < last && std::equal(fmt, fmt + sizeof(fmt), first + 1u))
return false;
++first;
return true;
}
template <typename Iterator> static bool parse_exp(Iterator &, const Iterator &)
{
return false;
}
template <typename Iterator, typename Attribute>
static bool parse_exp_n(Iterator &, const Iterator &, Attribute &)
{
return false;
}
template <typename Iterator, typename Attribute>
static bool parse_nan(Iterator &, const Iterator &, Attribute &)
{
return false;
}
template <typename Iterator, typename Attribute>
static bool parse_inf(Iterator &, const Iterator &, Attribute &)
{
return false;
}
};
struct BaseParametersGrammar : boost::spirit::qi::grammar<std::string::iterator>
{
using Iterator = std::string::iterator;
using RadiusesT = std::vector<boost::optional<double>>;
using json_policy = no_trailing_dot_policy<double, 'j', 's', 'o', 'n'>;
BaseParametersGrammar(qi::rule<Iterator> &root_rule_, engine::api::BaseParameters &parameters_)
: BaseParametersGrammar::base_type(root_rule_), base_parameters(parameters_)
{
const auto add_bearing =
[this](boost::optional<boost::fusion::vector2<short, short>> bearing_range) {
boost::optional<engine::Bearing> bearing;
if (bearing_range)
{
bearing = engine::Bearing{boost::fusion::at_c<0>(*bearing_range),
boost::fusion::at_c<1>(*bearing_range)};
}
base_parameters.bearings.push_back(std::move(bearing));
};
const auto set_radiuses = [this](RadiusesT radiuses) {
[this](boost::optional<boost::fusion::vector2<short, short>> bearing_range)
{
boost::optional<engine::Bearing> bearing;
if (bearing_range)
{
bearing = engine::Bearing{boost::fusion::at_c<0>(*bearing_range),
boost::fusion::at_c<1>(*bearing_range)};
}
base_parameters.bearings.push_back(std::move(bearing));
};
const auto set_radiuses = [this](RadiusesT &radiuses)
{
base_parameters.radiuses = std::move(radiuses);
};
const auto add_hint = [this](const std::string &hint_string) {
const auto add_hint = [this](const std::string &hint_string)
{
if (hint_string.size() > 0)
{
base_parameters.hints.push_back(engine::Hint::FromBase64(hint_string));
}
};
const auto add_coordinate = [this](const boost::fusion::vector<double, double> &lonLat) {
const auto add_coordinate = [this](const boost::fusion::vector<double, double> &lonLat)
{
base_parameters.coordinates.emplace_back(util::Coordinate(
util::FixedLongitude(boost::fusion::at_c<0>(lonLat) * COORDINATE_PRECISION),
util::FixedLatitude(boost::fusion::at_c<1>(lonLat) * COORDINATE_PRECISION)));
};
const auto polyline_to_coordinates = [this](const std::string &polyline) {
const auto polyline_to_coordinates = [this](const std::string &polyline)
{
base_parameters.coordinates = engine::decodePolyline(polyline);
};
alpha_numeral = +qi::char_("a-zA-Z0-9");
polyline_chars = qi::char_("a-zA-Z0-9_.--[]{}@?|\\%~`^");
base64_char = qi::char_("a-zA-Z0-9--_=");
base64_char = qi::char_("a-zA-Z0-9--_");
unlimited.add("unlimited", std::numeric_limits<double>::infinity());
radiuses_rule = qi::lit("radiuses=") > -(unlimited | qi::double_) % ";";
radiuses_rule = qi::lit("radiuses=") >> -qi::double_ % ";";
hints_rule =
qi::lit("hints=") >
qi::lit("hints=") >>
qi::as_string[qi::repeat(engine::ENCODED_HINT_SIZE)[base64_char]][add_hint] % ";";
bearings_rule =
qi::lit("bearings=") > (-(qi::short_ > ',' > qi::short_))[add_bearing] % ";";
polyline_rule = qi::as_string[qi::lit("polyline(") > +polyline_chars > qi::lit(")")]
[polyline_to_coordinates];
location_rule = (double_ > qi::lit(',') > double_)[add_coordinate];
qi::lit("bearings=") >> (-(qi::short_ >> ',' >> qi::short_))[add_bearing] % ";";
polyline_rule = qi::as_string[qi::lit("polyline(") >> +polyline_chars >>
qi::lit(")")][polyline_to_coordinates];
location_rule = (qi::double_ >> qi::lit(',') >> qi::double_)[add_coordinate];
query_rule = (location_rule % ';') | polyline_rule;
base_rule = bearings_rule | radiuses_rule[set_radiuses] | hints_rule;
@@ -129,11 +97,9 @@ struct BaseParametersGrammar : boost::spirit::qi::grammar<std::string::iterator>
qi::rule<Iterator> bearings_rule;
qi::rule<Iterator> hints_rule;
qi::rule<Iterator> polyline_rule, location_rule;
qi::symbols<char, double> unlimited;
qi::rule<Iterator, RadiusesT()> radiuses_rule;
qi::rule<Iterator, unsigned char()> base64_char;
qi::rule<Iterator, std::string()> alpha_numeral, polyline_chars;
qi::real_parser<double, json_policy> double_;
};
}
}
+26 -12
View File
@@ -2,10 +2,15 @@
#define MATCH_PARAMETERS_GRAMMAR_HPP
#include "engine/api/match_parameters.hpp"
#include "server/api/base_parameters_grammar.hpp"
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_lit.hpp>
#include <boost/spirit/include/qi_uint.hpp>
#include <boost/spirit/include/qi_bool.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi_action.hpp>
#include <boost/spirit/include/qi_optional.hpp>
namespace osrm
{
@@ -26,38 +31,47 @@ struct MatchParametersGrammar final : public BaseParametersGrammar
MatchParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
{
const auto set_geojson_type = [this] {
const auto set_geojson_type = [this]()
{
parameters.geometries = engine::api::RouteParameters::GeometriesType::GeoJSON;
};
const auto set_polyline_type = [this] {
const auto set_polyline_type = [this]()
{
parameters.geometries = engine::api::RouteParameters::GeometriesType::Polyline;
};
const auto set_simplified_type = [this] {
const auto set_simplified_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::Simplified;
};
const auto set_full_type = [this] {
const auto set_full_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::Full;
};
const auto set_false_type = [this] {
const auto set_false_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::False;
};
const auto set_steps = [this](const StepsT steps) { parameters.steps = steps; };
const auto set_timestamps = [this](TimestampsT timestamps) {
const auto set_steps = [this](const StepsT steps)
{
parameters.steps = steps;
};
const auto set_timestamps = [this](TimestampsT &timestamps)
{
parameters.timestamps = std::move(timestamps);
};
steps_rule = qi::lit("steps=") > qi::bool_;
steps_rule = qi::lit("steps=") >> qi::bool_;
geometries_rule = qi::lit("geometries=geojson")[set_geojson_type] |
qi::lit("geometries=polyline")[set_polyline_type];
overview_rule = qi::lit("overview=simplified")[set_simplified_type] |
qi::lit("overview=full")[set_full_type] |
qi::lit("overview=false")[set_false_type];
timestamps_rule = qi::lit("timestamps=") > qi::uint_ % ";";
timestamps_rule = qi::lit("timestamps=") >> qi::uint_ % ";";
match_rule = steps_rule[set_steps] | geometries_rule | overview_rule |
timestamps_rule[set_timestamps];
root_rule =
query_rule > -qi::lit(".json") > -(qi::lit("?") > (match_rule | base_rule) % '&');
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (match_rule | base_rule) % '&');
}
engine::api::MatchParameters parameters;
@@ -2,10 +2,14 @@
#define NEAREST_PARAMETERS_GRAMMAR_HPP
#include "engine/api/nearest_parameters.hpp"
#include "server/api/base_parameters_grammar.hpp"
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_lit.hpp>
#include <boost/spirit/include/qi_uint.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi_action.hpp>
#include <boost/spirit/include/qi_optional.hpp>
namespace osrm
{
@@ -22,12 +26,13 @@ struct NearestParametersGrammar final : public BaseParametersGrammar
NearestParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
{
const auto set_number = [this](const unsigned number) {
const auto set_number = [this](const unsigned number)
{
parameters.number_of_results = number;
};
nearest_rule = (qi::lit("number=") > qi::uint_)[set_number];
nearest_rule = (qi::lit("number=") >> qi::uint_)[set_number];
root_rule =
query_rule > -qi::lit(".json") > -(qi::lit("?") > (nearest_rule | base_rule) % '&');
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (nearest_rule | base_rule) % '&');
}
engine::api::NearestParameters parameters;
+1 -1
View File
@@ -30,7 +30,7 @@ using is_parameter_t =
// Starts parsing and iter and modifies it until iter == end or parsing failed
template <typename ParameterT,
typename std::enable_if<detail::is_parameter_t<ParameterT>::value, int>::type = 0>
boost::optional<ParameterT> parseParameters(std::string::iterator &iter, const std::string::iterator end);
boost::optional<ParameterT> parseParameters(std::string::iterator &iter, std::string::iterator end);
// Copy on purpose because we need mutability
template <typename ParameterT,
+4 -14
View File
@@ -3,8 +3,6 @@
#include "util/coordinate.hpp"
#include <boost/fusion/include/adapt_struct.hpp>
#include <string>
#include <vector>
@@ -15,23 +13,15 @@ namespace server
namespace api
{
struct ParsedURL final
struct ParsedURL
{
std::string service;
unsigned version;
std::string profile;
std::string query;
};
} // api
} // server
} // osrm
BOOST_FUSION_ADAPT_STRUCT(osrm::server::api::ParsedURL,
(std::string, service)
(unsigned, version)
(std::string, profile)
(std::string, query)
)
}
}
}
#endif
+32 -16
View File
@@ -2,10 +2,14 @@
#define ROUTE_PARAMETERS_GRAMMAR_HPP
#include "engine/api/route_parameters.hpp"
#include "server/api/base_parameters_grammar.hpp"
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_lit.hpp>
#include <boost/spirit/include/qi_bool.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi_action.hpp>
#include <boost/spirit/include/qi_optional.hpp>
namespace osrm
{
@@ -27,41 +31,53 @@ struct RouteParametersGrammar : public BaseParametersGrammar
RouteParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
{
const auto set_geojson_type = [this] {
const auto set_geojson_type = [this]()
{
parameters.geometries = engine::api::RouteParameters::GeometriesType::GeoJSON;
};
const auto set_polyline_type = [this] {
const auto set_polyline_type = [this]()
{
parameters.geometries = engine::api::RouteParameters::GeometriesType::Polyline;
};
const auto set_simplified_type = [this] {
const auto set_simplified_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::Simplified;
};
const auto set_full_type = [this] {
const auto set_full_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::Full;
};
const auto set_false_type = [this] {
const auto set_false_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::False;
};
const auto set_steps = [this](const StepsT steps) { parameters.steps = steps; };
const auto set_alternatives = [this](const AlternativeT alternatives) {
const auto set_steps = [this](const StepsT steps)
{
parameters.steps = steps;
};
const auto set_alternatives = [this](const AlternativeT alternatives)
{
parameters.alternatives = alternatives;
};
const auto set_continue_straight = [this](UturnsT continue_straight) { parameters.continue_straight = std::move(continue_straight); };
const auto set_uturns = [this](UturnsT &uturns)
{
parameters.uturns = std::move(uturns);
};
alternatives_rule = qi::lit("alternatives=") > qi::bool_;
steps_rule = qi::lit("steps=") > qi::bool_;
alternatives_rule = qi::lit("alternatives=") >> qi::bool_;
steps_rule = qi::lit("steps=") >> qi::bool_;
geometries_rule = qi::lit("geometries=geojson")[set_geojson_type] |
qi::lit("geometries=polyline")[set_polyline_type];
overview_rule = qi::lit("overview=simplified")[set_simplified_type] |
qi::lit("overview=full")[set_full_type] |
qi::lit("overview=false")[set_false_type];
continue_straight_rule = qi::lit("continue_straight=default") | (qi::lit("continue_straight=") > qi::bool_)[set_continue_straight];
uturns_rule = qi::lit("uturns=default") | (qi::lit("uturns=") >> qi::bool_)[set_uturns];
route_rule = steps_rule[set_steps] | alternatives_rule[set_alternatives] | geometries_rule |
overview_rule | continue_straight_rule;
overview_rule | uturns_rule;
root_rule =
query_rule > -qi::lit(".json") > -(qi::lit("?") > (route_rule | base_rule) % '&');
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (route_rule | base_rule) % '&');
}
engine::api::RouteParameters parameters;
@@ -69,7 +85,7 @@ struct RouteParametersGrammar : public BaseParametersGrammar
private:
qi::rule<Iterator> root_rule;
qi::rule<Iterator> route_rule, geometries_rule, overview_rule;
qi::rule<Iterator, UturnsT()> continue_straight_rule;
qi::rule<Iterator, UturnsT()> uturns_rule;
qi::rule<Iterator, StepsT()> steps_rule;
qi::rule<Iterator, AlternativeT()> alternatives_rule;
};
+15 -13
View File
@@ -2,10 +2,14 @@
#define TABLE_PARAMETERS_GRAMMAR_HPP
#include "engine/api/table_parameters.hpp"
#include "server/api/base_parameters_grammar.hpp"
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_lit.hpp>
#include <boost/spirit/include/qi_uint.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi_action.hpp>
#include <boost/spirit/include/qi_optional.hpp>
namespace osrm
{
@@ -24,24 +28,22 @@ struct TableParametersGrammar final : public BaseParametersGrammar
TableParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
{
const auto set_destiantions = [this](DestinationsT dests) {
const auto set_destiantions = [this](DestinationsT &dests)
{
parameters.destinations = std::move(dests);
};
const auto set_sources = [this](SourcesT sources) {
const auto set_sources = [this](SourcesT &sources)
{
parameters.sources = std::move(sources);
};
// TODO: ulonglong -> size_t not only on Windows but on all 32 bit platforms; unsupported anyway as of now
#ifdef WIN32
destinations_rule = qi::lit("destinations=all") | (qi::lit("destinations=") > (qi::ulong_long % ";")[set_destiantions]);
sources_rule = qi::lit("sources=all") | (qi::lit("sources=") > (qi::ulong_long % ";")[set_sources]);
#else
destinations_rule = qi::lit("destinations=all") | (qi::lit("destinations=") > (qi::ulong_ % ";")[set_destiantions]);
sources_rule = qi::lit("sources=all") | (qi::lit("sources=") > (qi::ulong_ % ";")[set_sources]);
#endif
destinations_rule = (qi::lit("destinations=") >> (qi::ulong_ % ";")[set_destiantions]) |
qi::lit("destinations=all");
sources_rule =
(qi::lit("sources=") >> (qi::ulong_ % ";")[set_sources]) | qi::lit("sources=all");
table_rule = destinations_rule | sources_rule;
root_rule =
query_rule > -qi::lit(".json") > -(qi::lit("?") > (table_rule | base_rule) % '&');
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (table_rule | base_rule) % '&');
}
engine::api::TableParameters parameters;
+21 -10
View File
@@ -3,11 +3,14 @@
#include "engine/api/tile_parameters.hpp"
#include "engine/hint.hpp"
#include "engine/polyline_compressor.hpp"
#include "engine/hint.hpp"
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_lit.hpp>
#include <boost/spirit/include/qi_uint.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi_action.hpp>
#include <boost/spirit/include/qi_operator.hpp>
#include <string>
@@ -25,15 +28,23 @@ struct TileParametersGrammar final : boost::spirit::qi::grammar<std::string::ite
TileParametersGrammar() : TileParametersGrammar::base_type(root_rule)
{
const auto set_x = [this](const unsigned x_) { parameters.x = x_; };
const auto set_y = [this](const unsigned y_) { parameters.y = y_; };
const auto set_z = [this](const unsigned z_) { parameters.z = z_; };
const auto set_x = [this](const unsigned x_)
{
parameters.x = x_;
};
const auto set_y = [this](const unsigned y_)
{
parameters.y = y_;
};
const auto set_z = [this](const unsigned z_)
{
parameters.z = z_;
};
query_rule = qi::lit("tile(") > qi::uint_[set_x] //
> qi::lit(",") > qi::uint_[set_y] > //
qi::lit(",") > qi::uint_[set_z] > qi::lit(")"); //
query_rule = qi::lit("tile(") >> qi::uint_[set_x] >> qi::lit(",") >> qi::uint_[set_y] >>
qi::lit(",") >> qi::uint_[set_z] >> qi::lit(")");
root_rule = query_rule > qi::lit(".mvt");
root_rule = query_rule >> qi::lit(".mvt");
}
engine::api::TileParameters parameters;
+23 -10
View File
@@ -2,10 +2,15 @@
#define TRIP_PARAMETERS_GRAMMAR_HPP
#include "engine/api/trip_parameters.hpp"
#include "server/api/base_parameters_grammar.hpp"
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_lit.hpp>
#include <boost/spirit/include/qi_uint.hpp>
#include <boost/spirit/include/qi_bool.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/qi_action.hpp>
#include <boost/spirit/include/qi_optional.hpp>
namespace osrm
{
@@ -25,25 +30,33 @@ struct TripParametersGrammar final : public BaseParametersGrammar
TripParametersGrammar() : BaseParametersGrammar(root_rule, parameters)
{
const auto set_geojson_type = [this] {
const auto set_geojson_type = [this]()
{
parameters.geometries = engine::api::RouteParameters::GeometriesType::GeoJSON;
};
const auto set_polyline_type = [this] {
const auto set_polyline_type = [this]()
{
parameters.geometries = engine::api::RouteParameters::GeometriesType::Polyline;
};
const auto set_simplified_type = [this] {
const auto set_simplified_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::Simplified;
};
const auto set_full_type = [this] {
const auto set_full_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::Full;
};
const auto set_false_type = [this] {
const auto set_false_type = [this]()
{
parameters.overview = engine::api::RouteParameters::OverviewType::False;
};
const auto set_steps = [this](const StepsT steps) { parameters.steps = steps; };
const auto set_steps = [this](const StepsT steps)
{
parameters.steps = steps;
};
steps_rule = qi::lit("steps=") > qi::bool_;
steps_rule = qi::lit("steps=") >> qi::bool_;
geometries_rule = qi::lit("geometries=geojson")[set_geojson_type] |
qi::lit("geometries=polyline")[set_polyline_type];
overview_rule = qi::lit("overview=simplified")[set_simplified_type] |
@@ -52,7 +65,7 @@ struct TripParametersGrammar final : public BaseParametersGrammar
trip_rule = steps_rule[set_steps] | geometries_rule | overview_rule;
root_rule =
query_rule > -qi::lit(".json") > -(qi::lit("?") > (trip_rule | base_rule) % '&');
query_rule >> -qi::lit(".json") >> -(qi::lit("?") >> (trip_rule | base_rule) % '&');
}
engine::api::TripParameters parameters;
+2 -2
View File
@@ -15,8 +15,8 @@ namespace api
{
// Starts parsing and iter and modifies it until iter == end or parsing failed
boost::optional<ParsedURL> parseURL(std::string::iterator &iter, const std::string::iterator end);
boost::optional<ParsedURL> parseURL(std::string::iterator &iter, std::string::iterator end);
// copy on purpose because we need mutability
inline boost::optional<ParsedURL> parseURL(std::string url_string)
{
auto iter = url_string.begin();
-27
View File
@@ -1,30 +1,3 @@
/*
Copyright (c) 2016, Project OSRM contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STORAGE_HPP
#define STORAGE_HPP

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