Compare commits

...

1631 Commits

Author SHA1 Message Date
Patrick Niklaus cc0c28f366 Fix formating for cherry-picked commit 2017-03-09 12:05:01 +00:00
Michael Krasnyk 66cc99703c Compute correct speed values in tile plugin 2017-03-09 11:49:10 +00:00
Patrick Niklaus f7fbca3e5e Update changelog 2017-03-03 17:27:28 +00:00
Patrick Niklaus 9695eaa28a Fix tile datasize check 2017-03-03 16:03:47 +00:00
Patrick Niklaus 0d7546a510 Only allow restricted access for road of certain highway type 2017-03-03 16:03:36 +00:00
Michael Krasnyk 9dc8136240 Fix incorrect forward datasources getter in facade 2017-03-03 10:52:53 +00:00
Patrick Niklaus a02a83f8bd Other flakey test 2017-03-02 15:24:38 +00:00
Patrick Niklaus 9b18f55d29 Update changelog 2017-03-02 15:00:49 +00:00
Patrick Niklaus a3434e7ae9 Mark test as flaky and track in own issue. 2017-03-02 14:59:10 +00:00
Patrick Niklaus 64b15028e4 Print 0 rate 2017-03-02 14:58:14 +00:00
karenzshea d8e466fdaa simplify test, add intersection turn test 2017-03-02 14:58:01 +00:00
karenzshea 43bbe8f2ae add restricted penalty on NoTurn turns 2017-03-02 14:57:49 +00:00
karenzshea b5c10b1fbf clamp speed value to js max 2017-02-22 16:13:01 +00:00
Daniel J. Hofmann 57d93fc5dc Updates TBB to latest stable version for 5.6 release 2017-02-20 13:55:42 +00:00
karenzshea 3aba2bc2d0 expose data about turning onto restricted roads to turn function 2017-02-20 13:55:19 +00:00
Daniel J. Hofmann c42478f0ee Updates sol2 to v2.15.8, resolves #3733 2017-02-20 10:14:17 +00:00
Moritz Kobitzsch ea583a77ff reduce verbosity of use-lane in combination with lane-anticipation 2017-02-15 21:57:58 +00:00
Kajari Ghosh dd999e112e Update http.md
Clarify where optional rotary properties will be added
2017-02-15 21:56:30 +00:00
Daniel Patterson 69c54bef72 Allow routing on toll roads by default (#3712) 2017-02-14 20:02:15 -08:00
karenzshea cfee0f1109 add unit test for annotations=true returning all annotations 2017-02-13 18:11:47 +00:00
karenzshea c7ce758e1c parse parameters.annotations into AnnotationsType::All 2017-02-13 18:11:03 +00:00
Karen Shea 3ac4fb5933 add error logging for missing osrm file to library tests (#3704) 2017-02-13 17:22:42 +00:00
karenzshea 2afe5e971b use qi - parser to work with 0 speed file lines 2017-02-13 17:22:42 +00:00
karenzshea 519b744502 clang format 2017-02-13 17:22:42 +00:00
karenzshea d3c2ac671f round speed to 1 decimal place 2017-02-13 17:22:42 +00:00
karenzshea 07a1a907f8 add unit test to check that speeds are equal to distance/duration 2017-02-13 17:22:42 +00:00
karenzshea 062cae82a0 return speed annotations 2017-02-13 17:22:42 +00:00
Quinn Chrzan 316c7781a3 Unit testing docs (#3698)
* Updating library-tests and associated documentation to be more informative

* Fixing heading markup for updated unit testing docs
2017-02-13 17:22:42 +00:00
Karen Shea e11bcfece5 Update http.md 2017-02-13 17:22:42 +00:00
Moritz Kobitzsch cb8dee3e60 comments 2017-02-13 17:22:42 +00:00
Moritz Kobitzsch a1abe71d9f fix handling none-tags in presence of multiple turns within 2017-02-13 17:22:42 +00:00
Moritz Kobitzsch d54c837e51 add failing test 2017-02-13 17:22:42 +00:00
Patrick Niklaus 106d17541d Fix side road penalties and add test 2017-02-13 17:22:42 +00:00
Michael Krasnyk ad29b237e3 make annotations={true|false|(values)+} grammar 2017-02-13 17:22:42 +00:00
Patrick Niklaus febefb4684 Enable 5.6 travis builds 2017-02-10 14:40:33 +00:00
Patrick Niklaus d28713b845 Make rate support code a little bit more obvious 2017-02-10 14:27:28 +00:00
Patrick Niklaus 2e6428e917 Fix HOV lane support with penalties 2017-02-10 14:27:28 +00:00
karenzshea 1f3a8d4538 remove units from rate columns in routability testing 2017-02-10 14:27:28 +00:00
karenzshea 140f1ad923 convert speed to meters per second when used to set rate 2017-02-10 14:27:28 +00:00
karenzshea 1c25070572 provide rate and weight headers for checking in routability tests 2017-02-10 14:27:28 +00:00
karenzshea 24fe881d03 hov_penalty, use min penalty rather than aggregate 2017-02-10 14:27:28 +00:00
karenzshea 25ab51f4f0 remove calls to handlers now in handle_penalties 2017-02-10 14:27:28 +00:00
karenzshea 46f96af360 fix merge conflicts 2017-02-10 14:27:28 +00:00
Michael Krasnyk ce685da92c use weight_multiplier to convert fallback durations to weights 2017-02-10 13:24:01 +00:00
Kajari Ghosh 2218658969 Trip with Fixed Start and End points (TFSE) (#3408)
* fixed start and end trip feature to trip service
2017-02-10 05:13:20 -05:00
Michael Krasnyk 3e2db47cc8 cleanup in facade GetUncompressed members 2017-02-10 09:22:24 +00:00
Michael Krasnyk 28a8154cee check weights consistency after updates 2017-02-10 09:22:24 +00:00
Jonathon Rossi 005124fe1c Fix JSON syntax error in HTTP API docs (#3679) 2017-02-09 20:24:21 +01:00
Patrick Niklaus 1e4c8eeeb6 Only use trains when they are marked for bringing bikes 2017-02-08 14:29:28 +00:00
Patrick Niklaus 72455a2733 Don't check access tags of bike against railway 2017-02-08 14:29:28 +00:00
Michael Krasnyk 112cf55aae use white list as a set complement of blacklist for bicycle profile
http://www.openstreetmap.org/way/4788559
2017-02-08 14:29:28 +00:00
Patrick Niklaus aa3f208032 Add access=permissive check for all profiles 2017-02-08 14:27:55 +00:00
Daniel J. Hofmann 919386bdaf Adds access=permissive routability scenarios, see #3435. 2017-02-08 14:27:55 +00:00
Patrick Niklaus ae835cc04f Blacklist steps from the car profile 2017-02-08 14:27:55 +00:00
Emil Tin ef4d32a492 improve diff table output 2017-02-08 11:32:33 +00:00
Daniel J. Hofmann 2a5ebf84bc Installs profiles to /usr/local/share/osrm/profiles by default, resolves #3670 2017-02-08 12:02:20 +01:00
Patrick Niklaus 768dc8d817 Merge pull request #3669 from Project-OSRM/seemoritz-minor_fixes
Port Seemoritz minor fixes to master
2017-02-08 09:34:36 +00:00
Patrick Niklaus 0c04c6cafb Address PR comments 2017-02-07 18:12:49 +00:00
Patrick Niklaus bf690df97a Merge branch 'minor_fixes' of https://github.com/seemoritz/osrm-backend into seemoritz-minor_fixes 2017-02-07 12:48:29 +00:00
Daniel J. Hofmann 880b982eeb Removes exit field for intersection counting; only used for roundabouts
- https://github.com/Project-OSRM/osrm-backend/blob/f3ebba7a79a3e499584ccd11d1f9381f16a2c0f4/src/engine/api/json_factory.cpp#L197-L198
- https://github.com/Project-OSRM/osrm-backend/blob/f3ebba7a79a3e499584ccd11d1f9381f16a2c0f4/src/engine/guidance/post_processing.cpp#L153
2017-02-07 11:42:57 +00:00
Daniel J. Hofmann 53011755a2 Removes distance field from Waypoint docs
Waypoint objects have
- name
- location
- hint

fields. The only API adding `distance` to waypoints is the Nearest
plugin. And it documents this behavior independently.

The docs are wrong here from what I can tell. See:
- https://github.com/Project-OSRM/osrm-backend/blob/5.5/src/engine/api/json_factory.cpp#L290-L297
- https://github.com/Project-OSRM/osrm-backend/blob/5.5/include/engine/api/nearest_api.hpp#L37-L44
2017-02-07 11:42:57 +00:00
Emil Tin ddb60c34e6 align cucumber diff tables 2017-02-07 11:42:20 +00:00
Moritz Kobitzsch 543f0e5e44 fix order of parameter initialisation for route parameters 2017-02-07 11:34:29 +01:00
karenzshea 1e9e420d91 clang format 2017-02-07 09:15:16 +00:00
karenzshea c885d03830 use lambda instead of bindy 2017-02-07 09:15:16 +00:00
karenzshea ab91a05680 update cucumber suport code to return separate annotations headers 2017-02-07 09:15:16 +00:00
karenzshea 84261fd214 GetAnnotations function 2017-02-07 09:15:16 +00:00
karenzshea 734df348cb a few more parameter tests 2017-02-07 09:15:16 +00:00
karenzshea 41064e2d7b revert 2017-02-07 09:15:16 +00:00
karenzshea 8d7aae8687 fix cucumber outputs 2017-02-07 09:15:16 +00:00
karenzshea 7256b6d0d4 update support code to handle variable annotations fields 2017-02-07 09:15:16 +00:00
karenzshea 3106b5dd9e set RouteParameters annotations member, when constructor only specifies annotations_type, add unit_tests 2017-02-07 09:15:16 +00:00
karenzshea f1427a834d fix bitwise operators, selectively add annotations to response obj 2017-02-07 09:15:16 +00:00
karenzshea 04954de9c6 implement bitwise and operator 2017-02-07 09:15:16 +00:00
karenzshea a6cd0863bc store/accept individual annotations parameters in addition to bool 2017-02-07 09:15:16 +00:00
Michael Krasnyk 9f28873cb1 add empty {tracktype,smoothness}_speeds in bicycle profile 2017-02-07 09:06:04 +00:00
Emil Tin 10c5d76909 use data.highway 2017-02-07 09:06:04 +00:00
Emil Tin d81ef3f4db first round of handlers 2017-02-07 09:06:04 +00:00
Emil Tin 3abab16bf3 move settings to profile table 2017-02-07 09:06:04 +00:00
Michael Krasnyk 6e1c4bfecd Added indexed array data type with variable and fixed group blocks 2017-02-07 07:41:12 +00:00
Daniel J. Hofmann cedeb15ade Adds surface=sett to bicycle profile, resolves #3649
References:
- http://taginfo.openstreetmap.org/keys/surface#values
- http://wiki.openstreetmap.org/wiki/Key:surface
2017-02-06 10:54:56 +01:00
Michael Krasnyk f2663acfc6 remove 4 bytes packing of NodeBasedEdgeWithOSM due to alignment fails 2017-02-05 12:54:26 +01:00
Michael Krasnyk c48fc58eb2 reduce size of InternalExtractorEdge by using single-precision values 2017-02-03 21:52:39 +00:00
Michael Krasnyk 5f1c7efd41 assertion for correct weight data 2017-02-03 18:59:00 +00:00
Michael Krasnyk 9e5d45d86a Added 'distance' weight to car profile 2017-02-03 18:59:00 +00:00
Michael Krasnyk 5fd6355829 add empty speed tables to foot.lua 2017-02-03 12:41:26 +00:00
Michael Krasnyk 6da4d918d0 Allow bicycle routing without access tag for railways with highway tag
http://www.openstreetmap.org/way/24455356
2017-02-03 12:41:26 +00:00
Michael Krasnyk 1628ebb871 Fix assertions in car profile, resolves #3629
restrict direction if access tag is missing and can not be derived
from highway tag

http://www.openstreetmap.org/way/4282676
http://www.openstreetmap.org/way/4621857
http://www.openstreetmap.org/way/4898368
2017-02-03 12:41:26 +00:00
Patrick Niklaus eaed5c7a8e Split if in ProcessWay to comform to old behavior 2017-02-03 12:41:26 +00:00
Pepijn Schoen 9d2628b74f Don't use bool return values on successful write, instead rely on exception throwing 2017-02-02 10:31:32 +01:00
Emil Tin 11ee632cfe car: add tests oneway:<mode> tags 2017-02-01 16:50:18 +01:00
Emil Tin 97c0a74c04 factor out common lua code to helper files 2017-02-01 16:50:18 +01:00
Michael Krasnyk b3ef27d104 Make watchdog a singleton instance
References:
https://github.com/Project-OSRM/osrm-backend/issues/3619
https://github.com/Project-OSRM/osrm-backend/pull/3627#issuecomment-276288138
2017-01-31 13:25:59 +01:00
Michael Krasnyk c22ce3ae1f Use shared memory region mapping at fixed address for OSX 2017-01-31 13:25:59 +01:00
Daniel Patterson 36c944ef53 No need to log the exception stack when it's just a test table difference - this should be a clean error. 2017-01-31 12:05:19 +01:00
Kajari Ghosh 5b24758742 Make docs more consistent.
Change the word `field` to `property` for accuracy.
2017-01-27 16:41:34 -08:00
Patrick Niklaus a572719484 Smaller grammar and formating fixes for the changelog 2017-01-27 11:19:37 +01:00
Michael Krasnyk ad594cb2e4 Update review findings 2017-01-27 11:19:37 +01:00
Michael Krasnyk 6b143c5e1d Use duration in SegmentBlock for duration updates 2017-01-27 11:19:37 +01:00
Michael Krasnyk 25baf51a2c Add duration to edges and use it in table plugin 2017-01-27 11:19:37 +01:00
Michael Krasnyk c059d15cb9 Added weight multipliers for speed and turn updates 2017-01-27 11:19:37 +01:00
Patrick Niklaus 279f8aabfb Allow specifing a weight for routing that is independent of duration 2017-01-27 11:19:37 +01:00
Michael Krasnyk e463733138 Limit test names to 64 chars to avoid hitting windows MAX_PATH limit
also in the change this.child is reset to null in case of error.
2017-01-27 11:19:37 +01:00
Michael Krasnyk 7deff5837c Throw IO error if the number of read bytes does not match count
and the stream is in failed state
2017-01-27 11:19:37 +01:00
Emil Tin 46ac9d05d9 foot profile: fix missing tracktype/smothness settings 2017-01-27 09:45:02 +01:00
Moritz Kobitzsch c7640903c3 don't emit invalid turns when having u-turns on ferries 2017-01-26 13:08:00 +01:00
Emil Tin 445225bf6d clean up lua debugging 2017-01-25 16:37:41 +01:00
Emil Tin 47b1a56b12 refactor foot profile (as was done for car) 2017-01-25 11:23:49 +01:00
Moritz Kobitzsch b5e289adc3 3605 - fix error in treating end-of-road as choiceless (#3607) 2017-01-24 11:23:54 -08:00
Michael Krasnyk e0a1a43449 Added maxspeed:conditional checker 2017-01-24 10:31:59 +01:00
Michael Krasnyk 337ecefa45 Added osrm-extract-conditionals tool 2017-01-24 10:31:59 +01:00
Michael Krasnyk 7961fa8863 Added conditional restrictions grammar 2017-01-24 10:31:59 +01:00
Michael Krasnyk 88eb9e5499 Added opening_hours grammar 2017-01-24 10:31:59 +01:00
Patrick Niklaus df449d3b5c Merge pull request #3604 from Project-OSRM/update-boost-1.63
Updates Boost to 1.63 for Mason Build
2017-01-24 10:26:16 +01:00
Daniel Patterson d8c54fb815 Merge commit '6f27aae022fd10bf7f709dae3233134cedc6d550' into update-boost-1.63 2017-01-23 17:24:22 -08:00
Daniel Patterson 6f27aae022 Squashed 'third_party/mason/' changes from ed32b1d72..6b4c359bc
git-subtree-dir: third_party/mason
git-subtree-split: 6b4c359bca48b576c4a4732b4117130eaafbf6ad
2017-01-23 17:24:22 -08:00
Daniel J. Hofmann 5c93609142 Updates Boost to 1.63 for Mason Build 2017-01-23 17:59:29 +01:00
Daniel J. Hofmann c277b95f03 Implements Zero-Copy String Views onto Contiguous Memory, resolves #3265.
- http://www.boost.org/doc/libs/1_61_0/libs/utility/doc/html/string_ref.html
- http://en.cppreference.com/w/cpp/string/basic_string_view
2017-01-23 15:22:39 +01:00
Michael Krasnyk b1f1c26703 Remove decltype(Value::source), fixes xcode 7.3 compilation 2017-01-23 15:17:08 +01:00
Daniel J. Hofmann a5d0707dd0 Removes the -DBUILD_COMPONENTS option; on by default now.
Quick follow up for https://github.com/Project-OSRM/osrm-backend/pull/3570:
there is no reason not to build the `osrm-components` tool by defualt.

Backwards compatible. Users still specifying the option will see:

> Manually-specified variables were not used by the project:
>   BUILD_COMPONENTS
2017-01-23 12:15:03 +01:00
Moritz Kobitzsch d129b0ef24 remove templates from routing algorithms 2017-01-21 23:59:15 +01:00
Daniel J. Hofmann f2c3b9859e Rewrites the osrm-components tool to dump GeoJSON, resolves #2176 #1738 #1602
http://bl.ocks.org/d/9d6265b064c0f29a71503e0f6527769d
2017-01-20 17:50:06 +01:00
Michael Krasnyk bb1f4a025a Merge pull request #3592 from Project-OSRM/merge/libosmium-2.11.0
Merge libosmium 2.11.0
2017-01-20 16:27:38 +01:00
Moritz Kobitzsch 8c36012653 remove CRTP leftovers in search algorithms 2017-01-20 14:11:16 +01:00
Michael Krasnyk 66cb75f4a3 Merge commit '0c6dee4befebf823d839d1092bcae79afbf4f12e' into merge/libosmium-2.11.0 2017-01-20 14:05:21 +01:00
Michael Krasnyk 0c6dee4bef Squashed 'third_party/libosmium/' changes from d5ecf4d..c1f34c4
c1f34c4 Release v2.11.0
d3b72e0 Updated change log.
2982b8d Update embedded Protozero to version 1.5.1.
cc1ab2a Add non-const WayNodeList::operator[].
3da372e Add missing example to examples/README.md.
30604ba Add OSMIUM_USE_SLOW_MERCATOR_PROJECTION define.
47a92e0 Clearer CheckOrder handler doc.
f11106d Formatting fixes.
a870737 Use faster implementation of web mercator projection.
041bb42 Test cleanups.
8933bc5 Cleanup *Map::get() functions.
6b989ca Document that (Multipolygon)Collectors only work with unique Ids.
8fb5bd2 Updated included Protozero to version 1.5.0.
76e153d Removed Makefile.
35d7ec9 Update copyright date.
a7f8126 Rename guard define to common scheme.
a923c69 Cleanup I/O tests.
d353993 Add Map::get_noexcept() method for all index maps.
94fa5ac Add const overload for mmap_vector_base::operator[].
3cf9184 Add default constructed "invalid" Coordinates.
358f170 Add Tile constructor from web mercator coordinates.
006aa4c Add index::RelationsMap(Stash|Index) classes.
9cc842e Updated catch to v1.5.9.
bd8c3b6 Use initializer_list trick instead of recursive template.
2c82a6f Merge pull request #183 from daniel-j-h/rvalue-apply
0bf5404 Implements rvalue handler support for apply, resolves #180.
ccaab08 Merge pull request #182 from AMDmi3/freebsd-endianess
bffe626 Handle endianess on FreeBSD properly
7250222 Code formatting and test cleanup.
6652436 Merge pull request #179 from oxidase/add_match_key_std_regex
afadf5b Rename centroid variables and function in example.
8355284 Add envelope() functions to NodeRefList, Way, and Area.
fc83d2e Remove unnecessary include.
9ddd00e Add match_key<std::regex> tag
9c54a53 Update README. Moved some infos to manual.
89a90a6 Update readme and developer docs.
c3446ec Simplify subitem iteration code and made it more flexible.
542b07c Add some static_asserts.
f0fd690 Memory reporting on M68k doesn't work properly.
e8957c6 Compare doubles in test using Approx().
58ae4a6 Add amenity_list example.
53783f8 Fix doxygen config for reproducible builds.
de4e52d Release v2.10.3
0cc42a2 ObjectPointerCollection constructor can't be noexcept.
4472dfb Round out ObjectPointerCollection implementation and test it.
28cb35d Build with XCode 8 and GCC 6 on travis.
03e3e66 Upgrade to new protozero version 1.4.5.
2102c2f Add assertion in queue handling code.

git-subtree-dir: third_party/libosmium
git-subtree-split: c1f34c45507e233a2b9028663906679c610fe179
2017-01-20 14:05:21 +01:00
Michael Krasnyk 49d3467ec7 Update Libosmium Dependency to 2.11.0 2017-01-20 14:02:12 +01:00
Michael Krasnyk a48cf58468 Move IPC tools functionality into osrm-datastore 2017-01-20 12:40:37 +01:00
Michael Krasnyk fbc7189cf8 Added speed round-off error test 2017-01-20 12:31:45 +01:00
Michael Krasnyk e8167b2e4e Use round for float to fixed coordinate transformations 2017-01-20 12:31:45 +01:00
Michael Krasnyk c03aa8a273 Regression test for #3516 2017-01-20 12:31:45 +01:00
Huyen Chau Nguyen a40abacfca Refactors the Turn Handler's Fork Abstraction, resolves #3457. 2017-01-19 19:49:40 +01:00
Moritz Kobitzsch b8beac2d00 unite process/shared_memory datafacades into a single type using an allocator scheme 2017-01-19 17:18:35 +01:00
Michael Krasnyk 75e0b5a5c4 Fix Lua static library linking 2017-01-19 17:06:00 +01:00
Michael Krasnyk c03b230e84 Refactor ShMemIterator, resolves #3458 2017-01-19 15:30:18 +01:00
Moritz Kobitzsch 6b06c5bd32 fix emitting invalid turn types, now surfacing due to changes in obvious detection 2017-01-18 15:56:48 +01:00
Moritz Kobitzsch 226ee62981 refactor graph contractor for readability
move to a dedicated dijkstra, separate code and header
reduce heap size, we don't use more than 2000 nodes, so why allocate 170k?
2017-01-18 15:03:15 +01:00
Daniel J. Hofmann fce3bb180c Provides OSRM_ASSERT_WITH_LOC macros for asserting with location, resolves #3533 2017-01-18 00:43:03 +01:00
Michael Krasnyk 1ae69fe40d Added missing backward_speed for cycleways 2017-01-17 12:51:38 +01:00
Daniel J. Hofmann e4dc2aa45c Removes Base64 Unit Test Dead Code.
- https://github.com/Project-OSRM/osrm-backend/pull/2139
- https://github.com/Project-OSRM/osrm-backend/pull/2139/commits/6c9ddde682f1fe7b6e4f9c6df2864b74d6d8c1a9
2017-01-17 12:50:53 +01:00
Michael Krasnyk d0f1347ff1 Adjusted number of nodes in annotation, resolves #3515 2017-01-16 23:54:00 +01:00
Patrick Niklaus 70e899378d Replace shmctl with waiting on all on-Linux platforms 2017-01-14 01:14:29 +01:00
Patrick Niklaus dbd70d4884 Throw exception with more helpful error message when shmctl fails 2017-01-14 01:14:29 +01:00
Michael Krasnyk 71044e88f3 try to fix npm tests on windows by direct data loading 2017-01-14 01:14:29 +01:00
Michael Krasnyk b8f631f6f6 fake waiting by sleep on windows 2017-01-14 01:14:29 +01:00
Michael Krasnyk 3837f9d015 fix windows build 2017-01-14 01:14:29 +01:00
Patrick Niklaus 763ad0d047 Print warning on Windows that we can't wait for clients 2017-01-14 01:14:29 +01:00
Michael Krasnyk b6f9ec2a33 make facades const to be consistent with const shmem block 2017-01-14 01:14:29 +01:00
Michael Krasnyk 5d3a348b76 removed stale code 2017-01-14 01:14:29 +01:00
Patrick Niklaus 104e23abf3 Restore --max-wait and file_lock for osrm-datastore 2017-01-14 01:14:29 +01:00
Patrick Niklaus a7bb26f2d6 Remove unnecessary includes and rename in Engine 2017-01-14 01:14:29 +01:00
Michael Krasnyk 710ba20acc Add 1ms delay as a workaround for "faster" requests than facade update
in osrm-routed
2017-01-14 01:14:29 +01:00
Michael Krasnyk fce8d72895 Change to condvar signaling if data region swapped 2017-01-14 01:14:29 +01:00
Michael Krasnyk 774b8688ca read_only if shmem size is 0, read_write otherwise 2017-01-14 01:14:29 +01:00
Michael Krasnyk fe2beb6f68 Respect data constness in Write methods 2017-01-13 22:37:46 +01:00
Michael Krasnyk 71e7d6d6b8 Refactor R-Tree updates and edges loading 2017-01-13 22:37:46 +01:00
Michael Krasnyk 29f736f1c8 Make CSV parsing function generalized 2017-01-13 22:37:46 +01:00
Michael Krasnyk bb4f13a47c Use internal logger instead of std stream 2017-01-13 19:55:25 +01:00
Moritz Seemann bb0b03bbce fix: do not check datasource_indexes_path twice
In storage_config.cpp the file paths are validated, but
datasource_indexes_path got validated twice and datasource_names_path
not at all.
2017-01-13 11:12:02 +01:00
Moritz Seemann 59ad7dddb2 make osm_elements a loop variable, not a local variable
The vector osm_elements was created and destroyed in each loop
iteration. It can be kept and cleared instead.
2017-01-13 11:12:02 +01:00
Moritz Seemann f12fdeb23e some comments for dynamic_graph.hpp 2017-01-13 11:12:02 +01:00
Moritz Seemann f896aaf881 fix for DeallocatingVector::back
This method actually returned a reference to the one-past-the-last
element instead of the last element.
2017-01-13 11:12:02 +01:00
Moritz Seemann a2a2cf84d1 fix: do not add duplicate edges
Previously duplicate edges were added if their weight was worse.
2017-01-13 11:12:02 +01:00
Moritz Seemann 4e897aad50 constexpr implies const, no need to state it twice 2017-01-13 11:12:02 +01:00
Moritz Seemann 5e8bdbfa0c fix to prevent (very unlikely) overflow of originalEdges
If originalEdges gets initialized with 1 << 28, it will overflow and
thereby be set to 0.
Which defeats the point of checking for overflows in the first place.
2017-01-13 11:12:02 +01:00
Daniel J. Hofmann fd57c5b48b Supports destination:street, resolves #3541 2017-01-13 11:07:01 +05:30
Michael Krasnyk 1d4d3b80b5 Fix possible division by zero by clamping latitude to 85.05°
Resolves #3530
2017-01-12 16:44:58 +01:00
Daniel J. Hofmann f82740ed93 Logs the current thread's id in assertions and for requests, resolves #3534 2017-01-12 16:43:03 +01:00
Moritz Kobitzsch c1f833c80f fix forks exiting a ferry 2017-01-12 09:58:51 +01:00
Daniel J. Hofmann 813e16b9b4 Fixes default profile symlink not being available
Adaption for b8e13d9b - people are running into this.
2017-01-12 09:34:38 +05:30
Moritz Kobitzsch 06ef3053de fix coordinate assertion for walking profile with steps 2017-01-11 22:44:23 +01:00
Mathias Gug 9fa7e6c74f Add BUILD_PACKAGE option. 2017-01-11 03:09:04 +01:00
Mathias Gug a7d63283ab Update Package Contact information. 2017-01-11 03:09:04 +01:00
Mathias Gug 78a443bfb2 Add changelog entry. 2017-01-11 03:09:04 +01:00
Mathias Gug 84b8d3cfb9 Support rpm packages. 2017-01-11 03:09:04 +01:00
Daniel J. Hofmann b3483f95a7 Fixes Sliproads onto a roundabout to be classified as sliproads, resolves #3540 2017-01-09 17:46:05 +01:00
Moritz Kobitzsch 32f63e5e0c add tests for dedicated turn roads 2017-01-09 17:46:05 +01:00
Daniel J. Hofmann 185e9dc7f3 Removes mlock for osrm-routed, closes #3484 2017-01-09 16:25:28 +01:00
Patrick Niklaus 6794f52cb2 Merge pull request #3526 from Project-OSRM/llvm-391
Upgrades LLVM 3.8.1 -> LLVM 3.9.1 on Travis
2017-01-09 16:23:10 +01:00
Daniel J. Hofmann 06e6b9ea6f Squashed 'third_party/mason/' changes from cf3561b..6b4c359
git-subtree-dir: third_party/mason
git-subtree-split: 6b4c359bca48b576c4a4732b4117130eaafbf6ad
2017-01-09 14:26:44 +05:30
Daniel J. Hofmann 93d89ad686 Updates vendored mason to v0.4 for LLVM 3.9.1 2017-01-09 14:26:44 +05:30
Daniel J. Hofmann 7c8176b077 Updates mason to v0.4 in dependency script 2017-01-09 14:26:26 +05:30
Daniel J. Hofmann 7ef95e9918 Upgrades LLVM 3.8.1 -> LLVM 3.9.1 on Travis
LLVM 3.9.1 is now packaged in mason: https://github.com/mapbox/mason/issues/308
Upgrade our Clang compiler to the latest stable release.

Keeps clang-format at 3.8.1 for consistency.
2017-01-09 14:25:34 +05:30
Huyen Chau Nguyen f313cb9913 Refactor fork handling in guidance (#3264)
refactor fork handler
2017-01-07 14:13:32 +01:00
Moritz Kobitzsch 15c8fd326f Remove assertions that could be triggered by bad data. (#3469)
When two consecutive nodes have identical coordinates, there is no valid
bearing.  For now, make equal nodes have bearing 0.

Full fix still needs to be done via https://github.com/Project-OSRM/osrm-backend/issues/3470.
2017-01-06 17:10:02 -08:00
Daniel Patterson f7e8581a1b Replace fingerprint with semver-based scheme. (#3467) 2017-01-06 13:45:08 -08:00
Daniel J. Hofmann c01ea2ea3e Disables link-time optimization unless -DENABLE_LTO=ON is passed.
This disables the `-flto` LTO flag by default since we're seeing
segfaults in compiler lto plugins, binutils and linker errors again and
again for various clang / gcc / binutils combinations.

Pass `-DNEBALE_LTO` to `cmake` in order to re-enable LTO.

LTO situation in short:
- LTO does not work at all for gcc<4.9
- With gcc>=4.9 the "slim" LTO format is getting used dumping IR
- Older binutils need LTO plugins which know how to read this IR
- Recent binutils handle this format all by themselves
- LLVM is more or less the same with some Clang versions segfaulting

If you need the performance benefit of LTO, make sure your compiler and
binutils are up to date and see for yourself if LTO builds work for you.

References:
- https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ
- https://github.com/Project-OSRM/osrm-backend/pull/3481#issuecomment-270618997
- https://github.com/Project-OSRM/osrm-backend/issues/3501
- https://github.com/Project-OSRM/osrm-backend/issues/3441

(and a ton of other LTO tickets if you search for them)
2017-01-06 16:49:49 +01:00
Daniel J. Hofmann 1153b78c06 Fixes various compiler diagnostics
Found with LLVM 3.9.1 and then fixed the most severe categories.
2017-01-06 16:47:52 +01:00
Daniel J. Hofmann b5d5f309a3 Consider number of lanes to cross, resolves #3025.
Lane Anticipation currently triggers on quick steps with lanes. This
changeset makes the "quick" part more dynamic by taking lanes left and
right of the turn into account. The reasoning for this is as follows.

The user can drive on the leftmost or rightmost lane and has to cross
all lanes left or right of the turn, respecitvely.

We scale our threshold appropriately, which now means the threshold
describes the duration the user needs for crossing _a single lane_.

Note: this is a heuristic and assumes the worst case. Which in my
opinion is fine to do since triggering Lane Anticipation in complex
scenarios is desirable.
2017-01-06 12:44:40 +01:00
Daniel J. Hofmann 5100f2cc7b Guards against no lanes for lanes left and right of turn, resolves #3518 2017-01-06 12:44:02 +01:00
Moritz Kobitzsch f6fef5c166 refactor graph contraction: flush moved into dedicated function 2017-01-05 16:28:38 +01:00
Daniel J. Hofmann 559c88b36d Adds runtime alignment assertions, see #3267 2017-01-05 16:27:53 +01:00
Michael Krasnyk 7dea7476f1 Removed unused structure and fixed "multi-line comment" warning 2017-01-05 12:59:12 +01:00
Michael Krasnyk dc81f581a0 [skip ci] Added info to CONTRIBUTING.md about automatic format checks 2017-01-04 17:31:58 +01:00
FILLAU Jean-Maxime 300283d572 Adding a new command line option osrm-extract --with-osm-metadata
This keep the metadata reader flag disabled by default unless explicitly specified.

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-01-04 14:35:45 +01:00
FILLAU Jean-Maxime aad2124faa Adding nodes's and ways's version access in lua binding.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-01-04 14:35:45 +01:00
Michael Krasnyk aced058c4a Use clang-format from mason 2017-01-04 08:46:16 +01:00
Michael Krasnyk 24ab71a346 Fix c++ formatting 2017-01-04 08:46:16 +01:00
Michael Krasnyk 2640a319c1 Wrap way.nodes() returned reference into sol::as_table 2017-01-04 08:29:27 +01:00
Moritz Kobitzsch e6ff17ab2a refactor merging of segregated roads
adjust to generalFindMaximum function
moved parallel detection to ratio/absolute based regression testing
considerably improved detection quality using normalised regression lines
only follow initial direction/narrow turns for parallel detection
2017-01-03 12:32:51 +01:00
Patrick Niklaus f7ad2e1e26 Don't retain SharedDataFacade between queries (#3485)
* Don't retain SharedDataFacade between queries

* More caching code
2017-01-03 12:06:55 +01:00
Daniel J. Hofmann 2ed6b181c8 Reworks the Readme Landing Page 2017-01-03 11:06:07 +01:00
Michael Krasnyk f48bbb78de Enable npm and library tests on windows 2017-01-03 10:24:48 +01:00
Michael Krasnyk bd2a5ebe10 Don't report error if osrm-routed was killed by js script 2017-01-03 10:24:48 +01:00
Michael Krasnyk f8499957fa Unhandled exceptions lead to error 0xC0000409 on windows 2017-01-03 10:24:48 +01:00
Michael Krasnyk 5db134bbba Help strings may contain windows extensions 2017-01-03 10:24:48 +01:00
Michael Krasnyk 8645d8c7fc Make osrm::util::range a model of SinglePassRangeConcept
References:
- http://www.boost.org/doc/libs/1_63_0/libs/range/doc/html/range/concepts/single_pass_range.html
2017-01-03 10:22:03 +01:00
Daniel J. Hofmann b8e13d9b1b Removes Profile Symlink 2017-01-03 10:14:51 +01:00
Jihyun Yu 421caa1856 Fix copying vector on std::sort comparator (#3504) 2016-12-30 13:57:21 -08:00
Michael Krasnyk ed9d10e96c Tests for profile API version 2016-12-23 15:02:10 +01:00
Patrick Niklaus 0f3a463854 Add api_version gloabal variable to profiles
Currently only `0` is supported (the default).
2016-12-23 15:02:10 +01:00
Moritz Kobitzsch b9b52cb857 clean-up unused headers, use NoTurn for ferries instead of suppressed 2016-12-23 15:01:02 +01:00
Daniel J. Hofmann 9af67c5a9f Refactors Karen's work a bit 2016-12-23 15:01:02 +01:00
karenzshea 8ffe915395 do not emit turns on ferries 2016-12-23 15:01:02 +01:00
Michael Krasnyk b376c97db8 Join LAYOUT and DATA shared memory blocks into REGION 2016-12-23 11:56:22 +01:00
Daniel J. Hofmann 7b11cd3a11 Makes Types in Squared Dist Calculation Explicit, see #3483. 2016-12-22 15:43:04 +01:00
Michael Krasnyk 76de3b6ace Make a hard reset of named barrier mutexes on signal 2016-12-22 15:13:12 +01:00
Moritz Kobitzsch bc081b7132 refactor route step / intermediate intersections
rename intersection (engine version) to IntermediateIntersection
follow coding convention for existing functions, move invalidate into routeStep
moved elongate into route step
move forward-step-signage into route step
replace post-processings `forwardInto` with `RouteStep` functionality. Don't change maneuver in step
separete declaration and implementation
2016-12-22 08:33:27 +01:00
Patrick Niklaus 3cbac0f012 Revert "Smarter search radius formula for map matching"
This reverts commit b73c59088c.
2016-12-21 22:41:48 -08:00
Patrick Niklaus f40b34af9d Revert "Fix capture"
This reverts commit 4f81e31d63.
2016-12-21 22:41:42 -08:00
Patrick Niklaus cc14fb8bff Revert "Hardcode search radius parameters"
This reverts commit 2c9e18d5a9.
2016-12-21 22:41:34 -08:00
Patrick Niklaus c5e3fa916f Revert "Fix call to std::min"
This reverts commit 8bb183bc8c.
2016-12-21 22:41:22 -08:00
Moritz Kobitzsch dff7fe214b don't assign exit in arrive when ending in roundabout 2016-12-21 17:48:23 +01:00
Michael Krasnyk 3b2ca720a8 Revert "Make a hard reset of named barrier mutexes on signal"
This reverts commit df4231341f.
2016-12-21 13:48:16 +01:00
Michael Krasnyk df4231341f Make a hard reset of named barrier mutexes on signal 2016-12-21 13:37:16 +01:00
Moritz Kobitzsch 0a2f934c87 add test for falsely classified obvious turn (#3364) 2016-12-20 11:55:10 -08:00
Moritz Kobitzsch 3721f8c887 test showing failure to unpack route with u-turns at both ends 2016-12-20 17:41:43 +01:00
Moritz Kobitzsch 1ba5ff44cc reduce warnings when compiling tests, add constructor to base parameters, fixes gcc49 unit tests building 2016-12-19 14:24:17 -05:00
Daniel J. Hofmann 5ecd2e4c67 Fixes GCC 4.9's protected keywork issues 2016-12-19 14:22:17 +01:00
Daniel J. Hofmann b1f6797aab Adds generate_hints=true for dropping hints in response, resolves #1789.
Adds an `generate_hints=false` option which lets us skip generating and
emitting hints for Waypoints. This can be used to decrease the response
size when the user does not need hints anyway.

We should think about making `false` the default here in v6.
2016-12-19 12:09:36 +01:00
Moritz Kobitzsch f04d146ca3 improve ascii art reflecting tunnels 2016-12-19 09:57:34 +01:00
Kajari 8c50a42ec4 add ascii art to a set of tests 2016-12-19 09:57:05 +01:00
Patrick Niklaus c4b3cdfd80 Fix changing shared memory in multi-process setup (#3462)
This change fixes two bugs:

1. A dead-lock that occurs between osrm-datastore and libosrm when an
   old dataset is free during a data update. This happened because the
   mutexes where acquired in a different order.

2. A region is deleted eventhough it is still in use. This happens when
   libosrm gets overtaken by osrm-datastore, so the new dataset is in
   the same region the old one was.
2016-12-16 13:50:17 -08:00
FILLAU Jean-Maxime 37051e1583 Adding the location validity access for lua scripting.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2016-12-16 16:02:24 +01:00
Daniel Patterson d3ef993d5f Bump SOL2 to v2.15.5 to fix OSX compilation problems. 2016-12-16 10:13:33 +01:00
Patrick Niklaus 9832825abd Merge pull request #3451 from Project-OSRM/update/mason
Update mason to v0.3.0 and change update script
2016-12-15 14:28:14 +01:00
Moritz Kobitzsch d584bcad11 fix roundabout handling with lanes
instead of artificially removing lanes from a roundabout, we don't assing them in the first place.
this also prevents a problem where we would end up collapsing turns with lanes in a roundabout
2016-12-15 13:07:26 +01:00
Daniel J. Hofmann e48ca65af4 Advanced Roundabouts
These kind of roundabouts came up during Lane Handling for roundabouts.
They're called Turbo-roundabouts or Turbine-roundabouts and are very
popular e.g. in Germany and the UK.

Seems like our roundabout handler sometimes is getting confused.

Trying to figure out why, and codifying some scenarios for cucumber.

References:
- https://github.com/Project-OSRM/osrm-backend/pull/2693
2016-12-15 13:07:26 +01:00
Michael Krasnyk f429e08851 Enforce Boost>=1.62 for MSVC
Reference:
https://github.com/Project-OSRM/osrm-backend/issues/3088#issuecomment-256485167
2016-12-15 12:47:50 +01:00
Daniel J. Hofmann de062d4ca3 Explain Workaround for Broken Setups to Users 2016-12-15 12:47:50 +01:00
Daniel J. Hofmann d83ab9d905 Enforces Boost>=1.54 requirement with CMake 2016-12-15 12:47:50 +01:00
Daniel J. Hofmann 4618b502ac Enforces GCC>=4.9 and Clang>=3.4 requirement with CMake 2016-12-15 12:47:50 +01:00
Daniel J. Hofmann 94854b5c90 Adds barrier=gate regression tests, see #581 2016-12-15 12:03:24 +01:00
Patrick Niklaus f8dd965435 Squashed 'third_party/mason/' content from commit cf3561b
git-subtree-dir: third_party/mason
git-subtree-split: cf3561bf78cb146821dba3d95c308fc44db05f46
2016-12-15 10:31:15 +00:00
Patrick Niklaus 6e29f9889b Merge commit 'f8dd96543542220181c76afb8c084f4908213fb5' as 'third_party/mason' 2016-12-15 10:31:15 +00:00
Patrick Niklaus 48d4e91d98 Change the update script to allow recreation 2016-12-15 10:30:51 +00:00
Patrick Niklaus 708ac04562 Remove old mason 2016-12-15 10:28:43 +00:00
Patrick Niklaus 38b2ad298d Update mason to 0.3.0 2016-12-15 10:28:43 +00:00
Daniel Patterson a51ef67db8 Use common function for clamping logic for all user-visible bearings. 2016-12-15 10:59:17 +01:00
Moritz Kobitzsch 67ce19cb14 fix problem at the source 2016-12-15 10:59:17 +01:00
Daniel Patterson 1b51163b1d Clarify API and ensure bearings returned to users are in the range 0-359 2016-12-15 10:59:17 +01:00
Michael Krasnyk 84b618ed1a Add headers consistency check 2016-12-15 10:58:17 +01:00
Moritz Kobitzsch dc8e6bd8d9 use correct type in graph contractor to avoid overflows in nodes 2016-12-15 10:56:07 +01:00
karenzshea 68e38880df switch back to lua based env naming 2016-12-15 10:55:16 +01:00
karenzshea d5904d5756 increase template depth on clang and gcc builds 2016-12-15 10:55:16 +01:00
Daniel J. Hofmann 0f59b78c02 Rewrite lua bindings using sol interface 2016-12-15 10:55:16 +01:00
Daniel J. Hofmann 6e7fe5feb0 Clean plate: luabind ripped out and sol2 basic integration 2016-12-15 10:55:16 +01:00
Daniel Patterson 3dfbf42e61 Don't mark all lanes as designated when there are blank lane specifiers in the tag. 2016-12-15 10:55:16 +01:00
Daniel Patterson f88f51fd98 Log some memory usage statistics after preprocessing tasks. 2016-12-13 21:59:12 +01:00
Daniel J. Hofmann 98659fb0a0 Adds failing tests for directional access overrides, discovered in #3345 2016-12-13 17:37:42 +01:00
Daniel J. Hofmann 8a1afe456f Works around Unreachable Warning for Debug Build 2016-12-13 12:41:25 +01:00
Patrick Niklaus f1384f5e44 Merge pull request #3434 from Project-OSRM/fix/invalid-assertions
fix invalid assertion in coordinate_extractor
2016-12-12 19:19:47 +01:00
Moritz Kobitzsch 1cd5394a16 fix invalid assertion in coordinate_extractor 2016-12-12 10:12:32 +01:00
Daniel Patterson 8c7f744b1a Update node weights if traffic data is applied. 2016-12-11 16:02:58 +01:00
Patrick Niklaus 896445a337 Fix path to node binaries 2016-12-09 16:43:32 +00:00
Patrick Niklaus 8c21e1267e nvm -> install_node 2016-12-09 16:30:14 +00:00
Patrick Niklaus ad3fd46da5 Try to use mapbox node mirror 2016-12-09 15:28:28 +00:00
Huyen Chau Nguyen 62f0e11bfa assert that there is an open logger file when trying to log geojson output (#3417) 2016-12-09 14:58:20 +01:00
Patrick Niklaus 03d653c0bb Fix removing shared memory segments in a multi-process setup 2016-12-09 12:18:05 +01:00
Daniel J. Hofmann cbfb055f81 Changes Single Coordinate Geoms from Point to LineString, closes #3425. 2016-12-09 11:53:06 +01:00
Moritz Kobitzsch 2288704bb5 don't assign unused name to exception 2016-12-08 13:35:28 +01:00
Daniel J. Hofmann 97dcf4eef9 Fixes Compiler Crashes on Windows 2016-12-08 13:23:21 +01:00
Daniel Patterson 17e15033e1 Log helpful error message if mmap fails. 2016-12-07 22:03:49 +01:00
Daniel J. Hofmann 875f482203 Refactors and improves the Sliproad Handler, resolves #3109 2016-12-07 19:22:03 +01:00
Moritz Kobitzsch df3c39cef5 clean-up guidance code/code in general
removes duplicated includes
removes unused includes
eliminates dedicated toolkits that resulted in circular dependencies
moves functionality close to data, where possible
2016-12-07 12:10:56 +01:00
Moritz Kobitzsch a28a20a1ba fix errors in coordinate extractor due to duplicated coordinates
fix offset calculation in curve detection
2016-12-07 11:33:58 +01:00
Daniel Patterson 17a18b5c7c Revert "Add simple code review checklist to PR template."
This reverts commit 3f07a830e6.
2016-12-06 17:21:38 -08:00
Daniel Patterson 423c083038 Refactor logging, improve error handling workflow, clang-format. (#3385) 2016-12-06 12:31:13 -08:00
Daniel Patterson 468d8c0031 Refactor logging, improve error handling workflow, clang-format. (#3385) 2016-12-06 12:30:46 -08:00
Pepijn Schoen 6f4c6e84ae Handle file output through a FileWriter, align interfaces for FileWriter and FileReader 2016-12-06 15:59:12 +01:00
Michael Krasnyk 4b1aae40af Decoding should not fail for incomplete polyline strings (#3404)
Possible fails in
1) correct lattitude, longitude is missing
2) no end-of-number (0 5th bit) marker in the last character
2016-12-06 14:09:18 +01:00
Daniel J. Hofmann 0e6863aec1 Removes access and service restriction list from bike and foot profile 2016-12-05 14:15:47 +01:00
Daniel J. Hofmann 949d505783 Removes access_restricted flag internally 2016-12-05 14:15:47 +01:00
Emil Tin d11927046f car profile: remove use of is_access_restricted flag 2016-12-05 14:15:47 +01:00
Emil Tin 9461c83511 car profile: handle forward/backward access 2016-12-05 14:15:47 +01:00
Emil Tin 532cbfce13 profiles: Directional helper, some car refactoring 2016-12-05 14:15:47 +01:00
Michael Krasnyk 0fbd18b0dd Make absolute fixtures path 2016-12-04 16:34:42 +01:00
Daniel Patterson 3f07a830e6 Add simple code review checklist to PR template.
Add some checkboxes for common, mechanical parts that we should aim to hit for all PRs.
2016-12-02 23:18:57 -08:00
Moritz Kobitzsch 24b01fae00 fix extraction of coordinate along a way (#3397)
Also fix interpolation when coordinates are duplicated at the end of the vector
2016-12-02 13:11:04 -08:00
Daniel Patterson 0817cd6dfd Enforce iteration order so that tiles are encoded consistently on all platforms (#3393) 2016-12-02 08:59:39 -08:00
Daniel J. Hofmann 9d8b92f418 Abstracts away over differences in IntersectionView and Intersection.
Usage:

    struct MyIntersection : EnableIntersectionOps<MyIntersection> {

    };

Done.

We require MyIntersection having at least the member attributes from
IntersectionViewData but don't enforce a inheritance hierarchy.
2016-12-02 12:32:07 +01:00
Daniel Patterson 928a6f0c7d Variant got re-packaged, need to update search paths. (#3392) 2016-12-01 16:59:29 -08:00
Daniel Patterson 29b3caf529 Upgrade to mapbox/variant 1.1.4 2016-12-01 15:44:27 -08:00
Patrick Niklaus 20c8ac0272 Bump osrm version to 5.5 2016-12-01 22:12:28 +00:00
Patrick Niklaus c99c8bccbc Make the binutil detection work the same for clang and gcc
This uses the cmake internal find_program that will utilize the PATH at
configuration time. This way we don't need to pass CXXFLAGS to clang.
2016-12-01 21:55:17 +01:00
Patrick Niklaus 735191255d No need to set ccache explicitly if its in the path 2016-12-01 21:55:17 +01:00
Dane Springmeyer da6ca640a7 only install/enable binutils gold and llvm-ar when building in Release 2016-12-01 21:55:17 +01:00
Dane Springmeyer f6f7a9290f no need for llvm package 2016-12-01 21:55:17 +01:00
Dane Springmeyer 9687a9325c remove llvm-nm 2016-12-01 21:55:17 +01:00
Dane Springmeyer 43566bfd14 support -flto with clang++ 2016-12-01 21:55:17 +01:00
Michael Krasnyk 110e6c3689 Fix failing on windows io read test (#3390) 2016-12-01 11:44:28 -08:00
Moritz Kobitzsch 561b7cc58e Rember Intersection Shapes
Changes the processing order in the edge based graph factory.
Instead of iterating over all outgoing edges in order, we compute the edge
expanded graph in the order of intersections.
This allows to remember intersection shapes and re-use them for all possible ingoing edges.

Also: use low accuracry mode for intersections degree 2 intersections

We can use lower accuracy here, since the `bearing`
after the turn is not as relevant for off-route detection.
Getting lost is near impossible here.
2016-12-01 15:24:20 +01:00
Moritz Kobitzsch 5775679f64 fix coordinate extraction / errors in offset detector 2016-12-01 12:16:25 +01:00
Daniel Patterson 560d8ffec0 Restructure API docs so that they can be formatted with Docbox. (#3355)
Generate Docbox browseable HTML with `npm run build-api-docs`
2016-11-30 19:38:53 -08:00
Daniel Patterson 2544c3f20e Update changelog for FileReader change. 2016-11-30 19:10:44 -08:00
Daniel Patterson 5a311012af Consolidate file reading through the new FileReader class/interface. (#3321) 2016-11-30 19:08:01 -08:00
Karen Shea ef087f963d Merge pull request #3324 from Project-OSRM/constrain-staggering
Constrain staggered intersection detection by mode change and intermediary intersections
2016-11-30 07:35:17 -05:00
Moritz Kobitzsch a1127c3e09 reduce numbers of intersections in findNextIntersection, don't normalise for turn lanes 2016-11-30 10:21:53 +01:00
Patrick Niklaus 01a57ff1d8 Merge pull request #3367 from Project-OSRM/fix/rpath4all
Rework RPATH and building as subproject
2016-11-29 23:02:57 +01:00
karenzshea 37824e2954 don't staggered intersections on intermediary mode changes 2016-11-29 14:39:16 -05:00
Patrick Niklaus 4489c8dfc2 Expose LibOSRM find_package style variable to work as subproject 2016-11-29 15:38:51 +00:00
Patrick Niklaus ee63e39ff5 Add $ORIGIN and @executable_path to RPATH 2016-11-29 15:37:11 +00:00
karenzshea ce5bcc797b opening typo 2016-11-29 09:39:05 -05:00
Daniel J. Hofmann fe5cc55b0e support junction = circular in all profiles, add additional tests
References:
- https://wiki.openstreetmap.org/wiki/Tag:junction%3Dcircular
- https://lists.openstreetmap.org/pipermail/tagging/2016-November/030520.html
- https://github.com/Project-OSRM/osrm-backend/issues/3361
2016-11-29 13:44:32 +01:00
Moritz Kobitzsch 12d58ace10 add support for junction=circular, allowing named circular junctions to be treated as rotaries 2016-11-29 13:44:32 +01:00
Moritz Kobitzsch 4636aaabfe make can be ignored false by default 2016-11-29 11:47:35 +01:00
Moritz Kobitzsch 186cc8340a handle service roads next to roundabouts - ambiguous exit... :( 2016-11-29 11:47:35 +01:00
Michael Krasnyk e343f71541 Refactor Hilbert values computation 2016-11-28 14:17:12 +01:00
Michael Krasnyk 0df0d31d83 Fix nodes file reading in rtree benchmark 2016-11-28 14:17:12 +01:00
Moritz Kobitzsch aaf42a1caf add a follow-up section on testing to help decide what to do on guidance tests 2016-11-24 10:12:14 +01:00
Moritz Kobitzsch d02dd67e95 fix update to length cache 2016-11-23 11:27:59 +01:00
Moritz Kobitzsch a49bd70985 add low precision intersection_generator mode for faster graph traversal 2016-11-22 18:25:19 +01:00
Dane Springmeyer b2c27fbd25 test xcode8.2 2016-11-22 18:03:51 +01:00
karenzshea 9fe0e91d92 add tests for bridleways 2016-11-22 10:18:55 +01:00
Daniel J. Hofmann 08b7270f5c Fixes accidentally registering types twice to Luabind, closes #2811. 2016-11-22 10:09:08 +01:00
Kajari Ghosh fc52dd85fe refactor graph_loader (#3333)
Refactors the GraphLoader class to use the safer FileReader wrapper for better error handling.
2016-11-21 17:32:00 -08:00
Karen Shea 6d961d4a15 Merge pull request #3217 from Project-OSRM/refactor/obviousness
Refactor find obvious turn handling
2016-11-21 14:50:44 -05:00
karenzshea 0bd08224bf add comments, refactor find obvious turn 2016-11-21 13:16:30 -05:00
Daniel J. Hofmann 2a383efbf6 Makes Throughput Numbers Integral Types 2016-11-21 12:41:25 +01:00
Patrick Niklaus b84d70d305 Add regression test for nil values 2016-11-21 12:17:44 +01:00
Patrick Niklaus 3bade8625f Don't crash on assigning nil to a string in lua 2016-11-21 12:17:44 +01:00
Patrick Niklaus 844300b95a Print number of used jobs 2016-11-19 17:02:31 +01:00
Patrick Niklaus dd811539a3 Remove overriding c++ compiler from cmake on mason build 2016-11-19 17:02:31 +01:00
Patrick Niklaus 79c2ae46d8 Determine number of jobs over ncpu + 1 2016-11-19 17:02:31 +01:00
Patrick Niklaus d023e7c581 Don't use mason clang on OSX 2016-11-19 17:02:31 +01:00
Patrick Niklaus 4ccb08983f Fixed installing clang for mason builds 2016-11-19 17:02:31 +01:00
Patrick Niklaus 8c941d1344 Don't install clang when CLANG_VERSION is not set 2016-11-19 17:02:31 +01:00
Patrick Niklaus 841c032a0d Don't warn in example on 32bit only print message 2016-11-19 17:02:31 +01:00
Patrick Niklaus a764fd1f29 Don't expose all OSRM flags only the ones needed by external code 2016-11-19 17:02:31 +01:00
Patrick Niklaus 3687864cc1 Only run OSX in release 2016-11-18 17:49:05 +01:00
Dane Springmeyer 4b5466629f test with assertions+release on travis 2016-11-18 17:49:05 +01:00
Patrick Niklaus f19bf70b55 Account for imprecision in distance computation 2016-11-18 17:46:32 +01:00
Patrick Niklaus 24fa94af59 Remove obsolete test code 2016-11-18 17:46:32 +01:00
Patrick Niklaus 95a584a30d Make rounding when computing PhantomNode weight symmetric
Resolves a problem where the duration in forward and backward direction
was slightly different.
2016-11-18 17:46:32 +01:00
karenzshea 6ba36a2bc7 test and control for pushing both ways 2016-11-18 10:13:38 -05:00
karenzshea 039989a339 fix overlapping roads 2016-11-18 09:58:03 -05:00
karenzshea a7559077a0 add modes columns to bike tests 2016-11-18 09:21:48 -05:00
Daniel J. Hofmann bbe80192aa Staggered Intersections for Bike 2016-11-18 08:52:48 -05:00
karenzshea 9b16b757a4 halfway staggered intersection test 2016-11-18 08:52:48 -05:00
karenzshea 3680fc9d90 add check/test for intermediary intersections 2016-11-18 08:52:47 -05:00
karenzshea 836e8bdff0 don't collapse with mode changes 2016-11-18 08:52:47 -05:00
Patrick Niklaus 3d4b39be7d Include changed car.lua dependencies in changelog 2016-11-18 00:21:34 +01:00
Emil Tin 193dfd9d8b lua: add changelog item 2016-11-18 00:21:34 +01:00
Emil Tin 305e813489 lua: improve naming 2016-11-18 00:21:34 +01:00
Emil Tin a5756fc764 fix c++ formatting 2016-11-18 00:21:34 +01:00
Emil Tin f5bf788814 lua: simplify destination helper 2016-11-18 00:21:34 +01:00
Emil Tin 00f7d7776d lua: refactor destination helper 2016-11-18 00:21:34 +01:00
Emil Tin dce685c780 ensure we don't pass empty tags to LUA 2016-11-18 00:21:34 +01:00
Emil Tin 173a39fd8b lua: fix typo 2016-11-18 00:21:34 +01:00
Emil Tin 5d564ee510 lua: Set and Sequence 2016-11-18 00:21:34 +01:00
Emil Tin 24c2708d1e lua: eliminte tag cache, simplify tag checks 2016-11-18 00:21:34 +01:00
Emil Tin d87a972c66 don't return empty tags strings to lua 2016-11-18 00:21:34 +01:00
Emil Tin f90736b6b3 lua: handle_hov() 2016-11-18 00:21:34 +01:00
Emil Tin 9aeb3086cb lua: cleanup handle_blocking(), move common cases up early 2016-11-18 00:21:34 +01:00
Emil Tin 9e361a8178 lua: exit earlier when possible 2016-11-18 00:21:34 +01:00
Emil Tin c3aeef4e09 lua: eliminate TagCache.set_tag() 2016-11-18 00:21:34 +01:00
Emil Tin 50090e6447 lua: some cleanup 2016-11-18 00:21:34 +01:00
Emil Tin b9e5d26e3a remove dead code 2016-11-18 00:21:34 +01:00
Emil Tin 184cfab33b increase performance by passing vars instead of a table 2016-11-18 00:21:34 +01:00
Emil Tin fd95b2da76 streamline way_function 2016-11-18 00:21:34 +01:00
Emil Tin ce04a608b8 lua: refactor car.lua into smaller functions 2016-11-18 00:21:34 +01:00
Emil Tin cff69178e8 lua: simple tag cache enabling factoring way_function into smaller functions 2016-11-18 00:21:34 +01:00
Emil Tin 6c682b2258 lua: helpers for debugging 2016-11-18 00:21:34 +01:00
Alex Barth c1087eaecc Update http.md 2016-11-17 23:59:18 +01:00
Kerrick Staley 8bb183bc8c Fix call to std::min 2016-11-17 17:56:23 +01:00
Kerrick Staley 15359befdc Update docs 2016-11-17 17:56:23 +01:00
Kerrick Staley 2c9e18d5a9 Hardcode search radius parameters 2016-11-17 17:56:23 +01:00
Kerrick Staley 4f81e31d63 Fix capture 2016-11-17 17:56:23 +01:00
kerrick-lyft b73c59088c Smarter search radius formula for map matching 2016-11-17 17:56:23 +01:00
Michael Krasnyk 44e4728bde Added gcc 4.9 release build 2016-11-17 16:02:56 +01:00
Michael Krasnyk ba2629456f Added a copy of std::align due to missing implementation in gcc < 5
References:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350
2016-11-17 16:02:56 +01:00
Daniel J. Hofmann 1b4779a58c Avoids Shuffling Data Around for Nothing, closes 3306 2016-11-17 12:51:18 +01:00
Michael Krasnyk 1eaf9f3269 Fix ubsan runtime error: left shift of negative value -9 2016-11-16 12:12:20 -08:00
Daniel J. H 73e365d398 Conditionally checks std::is_trivially_copyable only if available. (#3327) 2016-11-16 12:07:45 -08:00
Michael Krasnyk d5bf508046 Fix alignments in shared facade via alignof/std::align 2016-11-16 18:20:19 +01:00
Moritz Kobitzsch 47b097038a fixes warning due to type only used in debug 2016-11-16 12:20:05 +01:00
Moritz Kobitzsch a4264c7849 fix node-based-graph-walker 2016-11-16 12:03:59 +01:00
Daniel J. H 463228d0bf Merge pull request #3323 from Project-OSRM/libosmium-2.10.2
Osmium 2.10.2, resolves #3303
2016-11-16 12:01:56 +01:00
Daniel J. Hofmann 6f885b5bdb Squashed 'third_party/libosmium/' changes from 40c4a48..d5ecf4d
d5ecf4d Release v2.10.2
7c04564 Update embedded protozero to version 1.4.4.
e209d81 Write code for 64bit systems, so it compiles on 32bit w/o warning.
640217c Fix buffer overflow.
8b4620f Release v2.10.1
38bf3ab Update protozero to 1.4.3.
f81b3c6 Fix IdSet on 32 bit.
5ff4753 Workaround so the test works on 32bit systems.
7542694 Include our endian.hpp before using the endianness test macros.

git-subtree-dir: third_party/libosmium
git-subtree-split: d5ecf4df90e2995c816886d2a002c3d3de7062ee
2016-11-16 11:33:59 +01:00
Daniel J. Hofmann 1dde5d288d Merge commit '6f885b5bdb2d220eb49e7d0fabcd520f56f2b419' into libosmium-2.10.2 2016-11-16 11:33:59 +01:00
Daniel J. Hofmann 820feb3a04 Update Libosmium Dependency Script to 2.10.2 2016-11-16 10:58:52 +01:00
Daniel Patterson 46b00e1378 Update docs for tile plugin. 2016-11-15 18:56:03 -08:00
Daniel Patterson eb12c16fd6 Output newlines for each progress indicator when not on a tty. 2016-11-15 18:14:05 -08:00
Daniel Patterson 17c32f5ce7 Fully revert 04f8b653c94614 2016-11-15 16:55:02 -08:00
Daniel Patterson 53ef2e2955 Use an enum type for the 'should read fingerprint' flag, rather than a mysterious boolean
Fix tests.
2016-11-15 16:55:02 -08:00
Daniel Patterson 7b1131b982 Consolidate vector deserialization. 2016-11-15 16:55:02 -08:00
Daniel Patterson 1fc969e6c8 Fix naming convention, and pass-by-reference for data layout. 2016-11-15 16:55:02 -08:00
Daniel Patterson 49f960064c Partial revert of 04f8b653c94614 - the PackedVector is special. 2016-11-15 16:55:02 -08:00
Daniel Patterson 83a9d0590d Pass-by-reference instead of pointer. 2016-11-15 16:55:02 -08:00
Daniel Patterson d8b016b92a Simplify read error detection. 2016-11-15 16:55:02 -08:00
Daniel Patterson 608044305d Rename the datafacades to more clearly describe what they do. 2016-11-15 16:55:02 -08:00
Daniel Patterson 4760b85930 Add checking assertions for all copy operations. 2016-11-15 16:55:02 -08:00
Daniel Patterson 9e2782d923 Fix undefined behaviour - we were referring to two different temporaries. 2016-11-15 16:55:02 -08:00
Daniel Patterson 2dfeb0cabc Remove unused code. 2016-11-15 16:55:02 -08:00
Daniel Patterson 2f9b5788d0 Destructor should fail hard if an exception is raised. 2016-11-15 16:55:02 -08:00
Daniel Patterson be496eb4e3 Return the type we claim it will return. 2016-11-15 16:55:02 -08:00
Daniel Patterson 97244557b1 Don't need to use new, make_unique<> can do what we need here. 2016-11-15 16:55:02 -08:00
Daniel Patterson e2e5eb0169 Remove use of ShM<>::vector in favour of the boost::iterator_range 2016-11-15 16:55:02 -08:00
Daniel Patterson 6949d7ee5b Remove ownership of block pointers from base class. 2016-11-15 16:55:02 -08:00
Daniel Patterson 02303904b8 Update changelog. 2016-11-15 16:55:02 -08:00
Daniel Patterson 4ad6d88888 Refactor file loading to use a common class that has proper error handling. 2016-11-15 16:55:02 -08:00
Daniel Patterson e226b52f21 const-ify things, use RAII for file closure, and start to use io:: to read some stuff. 2016-11-15 16:55:02 -08:00
Daniel Patterson b1125b7f1f Rename base class to something more in line with it's actual function. 2016-11-15 16:55:02 -08:00
Daniel Patterson 33ff92d27e Remove debugging code. 2016-11-15 16:55:02 -08:00
Daniel Patterson de4fd76d57 Clean up some todo notes. 2016-11-15 16:55:02 -08:00
Daniel Patterson bf6df74d44 Consolidate datafacade file loading logic.
Both datafacades now use a single large memory block and common
file loading logic.
2016-11-15 16:55:02 -08:00
Daniel J. Hofmann 8f6dd805e5 Fixes ODR Violation in Graph Loader, closes #3308 2016-11-15 12:04:13 +01:00
Patrick Niklaus 3235f30a98 [skip ci] clarify release branches 2016-11-14 23:21:48 +00:00
Daniel J. Hofmann 7e4020c010 Allocates memory for the node info list upfront.
Turns out we were not doing this. Huh.

Callstack:
- https://github.com/Project-OSRM/osrm-backend/blob/78583d2c8c639466bdde01c848398b2a48b72f44/include/util/graph_loader.hpp#L65-L68
- https://github.com/Project-OSRM/osrm-backend/blob/538bbd47d1ee169764b66df3ef67ecfe131cdfec/src/extractor/extractor.cpp#L423-L424
- https://github.com/Project-OSRM/osrm-backend/blob/78583d2c8c639466bdde01c848398b2a48b72f44/src/extractor/extractor.cpp#L465-L466
- https://github.com/Project-OSRM/osrm-backend/blob/78583d2c8c639466bdde01c848398b2a48b72f44/src/extractor/extractor.cpp#L254-L261
2016-11-15 00:06:52 +01:00
Moritz Kobitzsch 538bbd47d1 fix length limited graph walker 2016-11-14 18:38:15 +01:00
Moritz Kobitzsch 78583d2c8c fix getTurnDirection, widen straight range, adjust tests accordingly 2016-11-14 11:09:14 +01:00
Dane Springmeyer fa1a0a1325 Ensure pkg-config reports OSRM_LIB_LINKER_FLAGS 2016-11-12 14:35:32 +01:00
Dane Springmeyer 6df1437cfc drop md5sum dependency, depend on node.js script 2016-11-12 02:48:13 +01:00
Dane Springmeyer 15ed53d4a7 install ccache/cmake via consistent method 2016-11-12 02:48:13 +01:00
Dane Springmeyer 63be191775 speed up osx builds by avoiding homebrew 2016-11-12 02:48:13 +01:00
Moritz Kobitzsch 6ec505281e fix edge discovery in tile plugin 2016-11-12 02:15:04 +01:00
Patrick Niklaus 5a293e891b Merge pull request #3296 from Project-OSRM/libosmium-2.10.0
Osmium 2.10
2016-11-12 02:12:49 +01:00
Michael Krasnyk b57169e221 Flush stxxl vectors before using in PrepareData 2016-11-12 02:09:51 +01:00
Lev Dragunov 045d25041f Review fixes. 2016-11-12 02:05:48 +01:00
Lev Dragunov 170923874b Add request duration to routed logs. 2016-11-12 02:05:48 +01:00
Dane Springmeyer 8137e95fbb Merge pull request #3274 from Project-OSRM/customize-tool-root
Improve support for customized build directory
2016-11-11 13:54:11 -08:00
Daniel J. Hofmann 0375af197d Skips OSM object metadata reading, closes #3278 2016-11-11 16:35:57 +01:00
Daniel J. Hofmann babbda98a6 Squashed 'third_party/libosmium/' changes from 80df1d6..40c4a48
40c4a48 Release v2.10.0
6addb2e Search for protozero also in the place where libosmium was found.
9c0d4bb Consistently use lhs and rhs as parameter names in operators etc.
6179759 Update change log.
894eb7d Explicitly use size_t to get no narrowing conversions.
e549e73 Fix CMake config for index_lookup.
ccf0bc2 Fix bug where some compilers deduce the wrong type.
fc3507d Cleaned and documented index example and renamed to osmium_index_lookup.
d3c3036 Rename serdump example to dump_internal and document it.
0e9822e Also forward set_uid_from_signed() function.
29ef95c Rename build_taglist function because it was to similar to build_tag_list.
c088dd0 Move static constant out of class so clang will compile it.
606cdc4 Fix CMake build script: Path for finding libosmium.
65f91fe Removed unused typedef.
07174f5 Use condition_variable to tell producer when thread queue is not full.
b35e957 Some code cleanup in XML parser.
c703dff Fix problem with MemberMeta.
1ccbbef Refactoring CompressionFactory.
6561bd6 Use our own exception type for map factory errors.
56e31fa Throw not_found error directly instead of using helper function.
28230c3 Test empty value for node location store, reorganize tests.
2ba316c Reorganize and fix projection tests.
f949485 Don't run quite as many tests with projections because they are slow.
1bad16d Add information about build environment to benchmark output.
99617bb Change proj_geojson benchmark into mercator benchmark.
553b946 Allow optional parameters on Reader in any order.
dcc3d8f Factor out some common code.
004d8cd Fix forwarding constructor.
9702978 Fix metadata check.
6cfb6c4 Faster implementation of decode_dense_nodes without reading metdata.
4ba4638 Add additional read_metadata parameter to other Reader constructors.
d005937 Optionally ignore metadata when reading file.
63961da Mark all CRC32 update functions as noexcept.
cc4ca75 Refactor set_user() function to speed it up.
38d19dc Update comments with file sizes. OSM has grown...
f7d0824 Add new benchmark that shows performance when main thread is busy.
25070dc Use const ref params.
88e8d96 Mark add_user() as deprecated.
f58d9db Refactor some low-level collection code to clean up code.
4680def Add example showing how to create OSM data out of thin air.
d42fd50 Add an example showing how tags in OSM files can be changed.
49bf5bc Add additional constructors to Builders taking a reference to parent.
7b91d63 Change Builder::add_item() to take a reference instead of pointer.
2957e48 Some cleanup of examples.
d0b458d Calculate size of object at compile time.
3fbb6e7 Use explicit cast.
1851f3d Remove a test that depends on math details.
f6a0802 Various cleanups of example programs.
ba4921f Rename add_user() to set_user().
d7637c9 Various cleanups related to builders.
07827bc Fix add_user().
9a5b395 Also refactor OSMObjectBuilder like ChangesetBuilder before.
b1f423c Use call chaining on the builder.
e49473d Get rid of ObjectBuilder class.
67d70b9 Refactor ChangesetBuilder::add_user().
8199c33 Make ChangesetBuilder derive directly from Builder.
61d1b67 Simplify some code.
d38467a Change derivation hierarchy of some builder classes.
b52f8af Refactor Builder code.
d012bfa Refactored some code setting attributes on objects using builder instead.
6a05f60 Also forward set_removed function from builders.
8d63b7d Return *this from Builder setter functions and test it.
72a1266 Update catch.hpp to newest version.
3424a74 Check GEOS version is <= 3.5.
aee9f9d Cleanup test code.
aef198c Improved asserts in Buffer.
a98b9bf Code cleanup in tests.
a150466 Use GDAL/OGR instead of GEOS to test our WKB implementation.
b04a525 Refactor test.
39aa932 Refactored test_factory_with_projection so it works without GEOS.
648f43a Remove unused dependency on geos from tile test.
f1748ae Add setters to Builder classes forwarding to underlying objects.
8166879 In debug mode check that Builders are correctly called and destructed.
1c4257e Call commit() on buffer only after all builders are destructed.
2618636 Add functions to check availability of relation members.
b45a4d9 Mark RelationMember::set_ref() as deprecated.
7886771 Move "basic" and "buffer" tests to "osm" and "memory", respectively.
b664685 Use functions instead of macros in location test for faster compile.
b4929ac Add more tests for number parser.
02662a7 Merge pull request #171 from lonvia/fix-long-exponentials
5344a6c fix parsing of numbers in e-notiation with many post-comma digits
3aeaff3 Add some typedefs to NodeRefList and memory::Collection.
e750665 Add iterators to IdSetSmall and add docs and tests to IdSet classes.
50ecb2a Add more features to IdSetDense, including unset and iterator.
e3dec78 Make IdSet virtual base class with two implementations.
8ea0153 Use C array instead of std::array in IdSet and clear explicitly.
3ba9905 Deprecate osmium::index::BoolVector in favour of new IdSet.
453d1ca Add osmium::index::IdSet.
c78254e Add function to (temporarily) disable the progress bar.
4d88a9f Better document osmium::io::Header class.
320e3af Look for protozero includes in CMake config.
838d25e Allow optional checking for libosmium version number in CMake config.
6ce60c1 Fix entity_bits static_assert() tests.
f054731 Update change log.
77ac4c2 Make sleep duration for full queues much smaller.
7e39c01 Make some entity_bits functions constexpr.
69ea72f Fix ~ operator on entity_bits and more tests for entity bits.
dafe4cf Update embedded Catch unit test header to version 1.5.7.
a41c832 Fixed parsing of location coordinates starting with decimal dot.
6523bae README cosmetics.
229acac Add tests for some examples.
f1e753d Merge pull request #163 from sebastic/executable-not-elf-or-script
ccea2d5 Remove executable bit from .cpp files.
af77fb4 Changelog formatting fixes.

git-subtree-dir: third_party/libosmium
git-subtree-split: 40c4a48f88d25edace6f0b9e079c306308c7760b
2016-11-11 15:50:02 +01:00
Daniel J. Hofmann 72bfbed1f1 Merge commit 'babbda98a6ea1d53a8bc5015ef5dfb313c47186a' into libosmium-2.10.0 2016-11-11 15:50:02 +01:00
Daniel J. Hofmann feeae05f1c Update Libosmium Dependency Script 2016-11-11 15:16:07 +01:00
Moritz Kobitzsch f88ac989ea reserve when possible 2016-11-11 14:48:50 +01:00
Dane Springmeyer 41f083cded test customized build directory, make test/data/Makefile customizable 2016-11-10 11:56:51 -08:00
Patrick Niklaus 12ded539aa Merge pull request #3235 from Project-OSRM/mason-improvements
Mason improvements
2016-11-10 16:58:18 +01:00
Moritz Kobitzsch 827a1fbd7a separate intersection generation and intersection normalization 2016-11-10 12:56:46 +01:00
Moritz Kobitzsch e84a0ea37c reduce coordinate_extraction overhead. slowdown reduced by 30 percent 2016-11-10 10:44:54 +01:00
Moritz Kobitzsch 88208bfa5d add testscases for mode changes / additional assertions 2016-11-09 12:55:28 +01:00
Moritz Kobitzsch 7073403f1b rip out dedicated file for single function (minor refactor) 2016-11-09 12:52:39 +01:00
Michael Krasnyk 2501882adb Remove duplicated linking of boost and tbb libraries 2016-11-09 12:44:49 +01:00
Michael Krasnyk 4f2bb19b0f Use single precision values in vector<float> initializer list (#3270) 2016-11-08 21:06:55 -08:00
Dane Springmeyer de77befb23 Merge commit 'a5db3d72f1bc9a8253e327a18d535d244a635b6a' into mason-improvements 2016-11-08 15:30:44 -08:00
Dane Springmeyer a5db3d72f1 Squashed 'third_party/mason/' changes from 1b3085e..8df1478
58ae447 bump to v0.1.1
c5ef33f rename llvm 4.x to 4.0.0 [skip ci]
5d5d26b add llvm 4.x based sub-packages
9708680 only set LIBCXX_ENABLE_STATIC_ABI_LIBRARY for linux [skip ci]
6918fb0 install LLVMgold.so on linux [skip ci]
ab20ff7 binutils: using 'all-gold' breaks make install on linux [skip ci]
cb8b15f fix binutils install [skip ci]
df77b02 properly set LLVM_BINUTILS_INCDIR value [skip ci]
295d4db binutils gold fixes [skip ci]
ac85676 enable LLVMgold.so for linux [skip ci]
acc4249 add binutils 2.27
16d4452 add lldb and llvm-cov 3.8.1 packages
757b908 remove patching no longer needed [skip ci]
69415b5 better fix for statically linking/linked libc++ with llvm 3.8.1 [skip ci]
43933ed Added mesa-13.0.0-glx (non-CXX11ABI)
2bb81cc Added mesa-13.0.0-glx
d70e3ef LLVM_EXTERNALIZE_DEBUGINFO is osx specific
ba737bf llvm 3.8.1 linux build fixes
4279f58 Updates for mesa 13.0.0
d544278 Revert typo in mason.sh
03ecb2c Add mesa 13.0.0 (Gallium-OSMesa)
0997905 Add expat 2.2.0
f41eb6d mason.cmake: multiple static libs also need to be split
c9fcd1a add lldb to llvm 3.8.1 [skip ci]
6d8e16c minor llvm/clang++ improvements
b2bdb33 Add note that we need to create a github release [skip ci]

git-subtree-dir: third_party/mason
git-subtree-split: 8df14782dda0c2c7314b5c6dba98e9e36a67eedc
2016-11-08 15:30:44 -08:00
Dane Springmeyer b8898ef410 mason improvements 2016-11-08 15:29:49 -08:00
Daniel Patterson d0543e6c3b Changelog fix. 2016-11-08 14:38:15 -08:00
Daniel Patterson cef53c4b56 Fix key/val offset bug. 2016-11-08 11:45:28 -08:00
Daniel Patterson 481b03baeb Review changes. 2016-11-08 11:45:28 -08:00
Daniel Patterson f96e61ee06 Construct adjacency list and properly traverse it. 2016-11-08 11:45:28 -08:00
Daniel Patterson d21c8e3800 Add simple check for number of turns found in the tile. 2016-11-08 11:45:28 -08:00
Daniel Patterson af7960a796 Fix buffering of query box - it was shrinking in the Y axis, rather than growing. 2016-11-08 11:45:28 -08:00
Daniel Patterson 4c6d6aeaa7 Fix retrieval of forward/reverse data. 2016-11-08 11:45:27 -08:00
Daniel J. Hofmann ef2261661c Remove {highway: type} fallback from bike / walk profile, fixes #3231
References:
- https://github.com/Project-OSRM/osrm-text-instructions/issues/62#issuecomment-257889721
- https://github.com/Project-OSRM/osrm-text-instructions/pull/63
2016-11-08 14:28:56 +01:00
Moritz Kobitzsch 9c11f4231c add locations feature to allow testing turn locations, fix minor bug breaking the arrival location 2016-11-08 13:42:15 +01:00
Moritz Kobitzsch 837ab105ad fix error in ordering arguments for requiresNameAnnounced versions 2016-11-08 12:14:23 +01:00
Daniel J. Hofmann 6ac9617d49 Adapt test to returning ref, Take Pronunciation into Account, Fixes name change heuristic usage in UTurn check 2016-11-08 12:14:23 +01:00
Moritz Kobitzsch ccdebccde1 adjust sliproad handler for empty-name check, illustrate testcase 2016-11-08 12:14:23 +01:00
Daniel J. Hofmann c1651ccb12 Uses Name Change Heuristic Instead of Comparing Name Ids
References:
- https://github.com/Project-OSRM/osrm-backend/issues/2857
- https://github.com/Project-OSRM/osrm-backend/pull/2900
- https://github.com/Project-OSRM/osrm-backend/issues/2909
2016-11-08 12:14:23 +01:00
Kajari Ghosh f33180f092 request polyline with precision of 5 or 6 positions (#3220) 2016-11-07 15:11:21 -05:00
Moritz Kobitzsch 1b03b8df6d raising timeout limit for cucumber on clang 2016-11-07 18:29:49 +01:00
Moritz Kobitzsch 3eeb3cb6c6 fix collapsing of roundabout instructions 2016-11-07 17:16:44 +01:00
Michael Krasnyk 3e18e31bc9 Added percent-encoding to URL parser
Reference:
https://tools.ietf.org/html/rfc1738
2016-11-07 14:16:51 +01:00
Moritz Kobitzsch 2fb40944bf pull in intersection finder accumulator 2016-11-04 13:28:09 +01:00
Michael Krasnyk b108d8ea21 Use explicit std::function for to_lane_count instead of auto 2016-11-04 10:46:24 +00:00
kerrick-lyft 79917d2c8e Fix typo: Ẁaypoint -> Waypoint 2016-11-03 21:25:10 +00:00
Daniel J. Hofmann d2cd4fac2d Fixes Always-Zero Lane Count Introduced in #3237 2016-11-03 15:52:18 +01:00
Moritz Kobitzsch cd03877c90 link ConnectedRoad and TurnOperation via class hierarchy
and empower intersection by adding basic functionality to pod type
refactor extractor/toolkit into intersection
2016-11-03 13:42:29 +01:00
Moritz Kobitzsch 388d84a89e check for compatibility in post-processing (#3227) 2016-11-02 16:59:35 -06:00
Michael Krasnyk 9d24a4422a FindOsmium invoke is required for MSVC build dependencies
The commit is aprtial revert of
87d09f7 | * make adjustments based on PR review from @themarex
because osmium requires ws2_32
2016-11-02 18:40:17 +00:00
Patrick Niklaus 9693f9269b Add regression test 2016-11-02 17:52:41 +00:00
Patrick Niklaus 08a5648e3e Use coorect osm ids for start/target segment 2016-11-02 17:52:41 +00:00
Daniel J. Hofmann ccf5552406 Fixes Cucumber's Unknown Node Error Reporting
Before: `unknown node %s`
After: `unknown node t`

https://nodejs.org/api/util.html#util_util_format_format_args
2016-11-02 16:46:51 +00:00
Patrick Niklaus b749d9bd2f Address PR comments 2016-11-02 16:45:20 +00:00
Patrick Niklaus d342a18324 Add regression test 2016-11-02 16:45:20 +00:00
Patrick Niklaus 8f00936790 Fix non-overlap logic for simplified geometries. 2016-11-02 16:45:20 +00:00
Moritz Kobitzsch 8a3aec301a add a segment on turn restrictions to the cucumber guide 2016-11-02 16:06:37 +01:00
Moritz Kobitzsch faa5185440 add node-based-graph traversal capabilities 2016-11-02 15:38:09 +01:00
Moritz Kobitzsch 4ba8ccfcce add a geojson debugger that allows creating features for easy inspection 2016-11-02 14:54:00 +01:00
Kajari Ghosh c30f43b148 added max_speed to the profiles (#3089) 2016-11-01 17:13:10 -04:00
Denis Koronchik 5da63998d6 Add support of custom ServiceHandler 2016-10-31 15:38:03 +01:00
Kajari Ghosh 6fc0609a62 Map matching test coverage fix (#3201)
* fixed map matching test coverage
2016-10-29 11:22:09 -04:00
Patrick Niklaus f02b7b0910 [skip ci] Fix formating using format.sh 2016-10-28 14:45:05 -07:00
Dane Springmeyer 9435254661 Merge pull request #3119 from Project-OSRM/masonize
Masonize
2016-10-28 13:39:37 -07:00
Dane Springmeyer de14a72931 adjust example build setup to new mason location 2016-10-28 12:48:20 -07:00
Michael Krasnyk 164f4ffc32 Updated cmake version to 3.7.0-rc2 2016-10-28 12:42:36 -07:00
Michael Krasnyk b5c77de923 Fix msvc linking of boost libraries 2016-10-28 12:42:36 -07:00
Dane Springmeyer 6067fdf27f tell mason.cmake where the mason command is 2016-10-28 12:34:34 -07:00
Dane Springmeyer a34a885031 Squashed 'third_party/mason/' content from commit 1b3085e
git-subtree-dir: third_party/mason
git-subtree-split: 1b3085e812b08ef092ba43945e3ab9f802632280
2016-10-28 12:21:21 -07:00
Dane Springmeyer f39eb999e5 Merge commit 'a34a885031fcb1797621e8968497561a4837e06a' as 'third_party/mason' 2016-10-28 12:21:21 -07:00
Dane Springmeyer 87d09f78e6 make adjustments based on PR review from @themarex 2016-10-28 12:18:13 -07:00
Dane Springmeyer 83b7d75121 Add support for building against mason-provided deps 2016-10-27 23:26:33 -07:00
Dane Springmeyer 4598599f52 # This is a combination of 4 commits.
# The first commit's message is:
Add support for building against mason-provided deps

# This is the 2nd commit message:

back to just one travis job: linux/release

# This is the 3rd commit message:

remove pkg-config debugging [skip ci]

# This is the 4th commit message:

use clang++ 3.8.1 for mason builds since 3.8 is what we have been using
2016-10-27 23:26:33 -07:00
Daniel Patterson da77edfc83 Explicitly set minimum OSX version, and detect SDK path.
This fixes situations where XCode is installed with a newer SDK than the current OS. (#3198)
2016-10-27 16:29:27 -06:00
Dane Springmeyer 2917122287 Merge pull request #3196 from Project-OSRM/build-fixes
Minor build fixes
2016-10-27 14:43:36 -07:00
Dane Springmeyer a22e0fa62e minor build fixes
- Travis: Upgrade clang from 3.8.0 to 3.8.1 (provides smaller package for faster downloading)
  - Travis: Makes BUILD_COMPONENTS an option
  - Followup after #3130 (Boost_LIBRARIES variable no longer exists)
2016-10-27 13:39:33 -07:00
Denis Koronchik dc7e61c25d Fix declaration of makeRouteStep function 2016-10-27 20:12:02 +02:00
Moritz Kobitzsch 8dc667f20d fix warnings due to superfluous ; 2016-10-27 20:06:14 +02:00
Moritz Kobitzsch 8ff4bc09ac fix breaking the sorting order by node adjustments 2016-10-27 19:55:56 +02:00
Moritz Kobitzsch 88c3f4c481 Considering multiple small turns, right after each
other can result in a combined turn angle that is
straight instead of turning left and right.
2016-10-27 19:19:23 +02:00
Moritz Kobitzsch 01a2c66472 rip out unused m_node_info_list 2016-10-27 18:51:59 +02:00
Huyen Chau Nguyen cf35bbeb50 refactor function names; consolidate readCount() functions;
remove templated types as much as possible for type safety;
add more comments;
clean up code, add const if possible;
2016-10-26 13:18:52 -07:00
Huyen Chau Nguyen fe94977c9b refactor loading code of .ramIndex files and move to io.hpp 2016-10-26 13:18:52 -07:00
Huyen Chau Nguyen 69a60686dc refactor loading code of .datasource_indexes and .datasource_names files and move to io.hpp 2016-10-26 13:18:52 -07:00
Huyen Chau Nguyen 7b97e1035f refactor loading code of .nodes and .edges files and move to io.hpp 2016-10-26 13:18:52 -07:00
karenzshea c4f010e363 read properties stream to size of properties object, not 1 2016-10-26 13:18:52 -07:00
karenzshea 51ebadfc45 deduplicate code for loading profile properties into io.hpp 2016-10-26 13:18:52 -07:00
Daniel Patterson ceddfada3d Don't mark all lanes as designated when there are blank lane specifiers in the tag. 2016-10-25 14:37:59 -06:00
Daniel J. Hofmann a933b5d949 Prevents the Matching getting confused when users are time-travelling. 2016-10-25 10:42:24 -07:00
Moritz Kobitzsch ba5871cfa1 fix turn scenarios 2016-10-25 10:12:25 -07:00
Moritz Kobitzsch e8b947bca6 fix coordinate extraction with less than 1 meters past lane distance 2016-10-25 10:07:09 -07:00
Michael Krasnyk 7753845f5c Make thread-locked access to stxxl containers
From stxxl FAQ: "you should not share a data structure between
threads (without implementing proper locking yourself)."
The access to name_char_data can be implicitly parallelized
if _GLIBCXX_PARALLEL is defined and invalidate local-thread iterators.
2016-10-25 10:03:26 -07:00
Dane Springmeyer 19eec48207 Merge pull request #3163 from Project-OSRM/pc-fixes
Add -l to rt and gcov
2016-10-24 18:53:49 -07:00
Dane Springmeyer 293856981f add -l to rt and gcov 2016-10-24 17:09:03 -07:00
Michael Krasnyk 86b70f2632 Don't fail on incorrect lane tags '1; 2' 2016-10-24 15:25:46 -07:00
Daniel J. Hofmann 1905a0f473 Documents InvalidValue response code, resolves #3150 2016-10-24 09:54:09 -07:00
Moritz Kobitzsch d05b85c227 fix turn restriction and make route unique 2016-10-22 06:48:49 +02:00
Daniel J. Hofmann 19f00589de Removes constant speed offset from calibration two years ago, resolves #3023.
Our fine-tuned profiles are better in modelling real speed by now. This
constant offset is no longer needed. We still scale maxspeed, though.

https://github.com/Project-OSRM/osrm-backend/issues/3053
2016-10-22 06:48:49 +02:00
Daniel J. Hofmann 7f28a14c76 Fixes Grammar in Github Pull Request Template 2016-10-21 16:52:05 -07:00
karenzshea fead71da54 add comment on find() [skip ci] 2016-10-21 14:23:02 -07:00
karenzshea c26e90cac0 sort/unique turn penalty lookup 2016-10-21 14:23:02 -07:00
karenzshea d4e5710928 parse turn penalties in parallel, add unique and sorting steps 2016-10-21 14:23:02 -07:00
karenzshea 5c2783310a add pr todo for updating wiki [skip ci] 2016-10-21 13:58:51 -07:00
Patrick Niklaus b8795c7341 Rename increasingly inaccuratly named distance member of QueryEdge to weight 2016-10-21 21:00:02 +02:00
Daniel J. Hofmann 1d994da12b Makes Scripts Fail Fast and Loud 2016-10-21 17:56:56 +02:00
Dane Springmeyer 46994e87be Merge pull request #3130 from Project-OSRM/cmake-fixes
cmake fixes
2016-10-20 15:34:24 -07:00
Moritz Kobitzsch 40bfe89d97 add test 2016-10-20 14:28:33 -07:00
Moritz Kobitzsch e3c2d4dddc use-lane can occur in roundabouts as well 2016-10-20 14:28:33 -07:00
Dane Springmeyer 502d9e10c2 cmake fixes:
- Builds up ENGINE_LIBRARY_LISTING correctly to pass to pkg-config
    - Previous behavior had major flaw and would result in paths in libosrm.pc like: "-L-L"
      when the data was "-L/path -lfoo" or just "-lpthread" with no -L/path. It only worked correctly for static libraries
  - Refactors to call find_package for boost in one place (helps prepare for upcoming mason PR)
2016-10-20 12:09:27 -07:00
Daniel J. Hofmann 865c6590fa Limits the object cache size to 256M 2016-10-20 11:33:28 -07:00
jakepruitt c30784895d clang-format and remove debug 2016-10-20 11:32:28 -07:00
jakepruitt fa1fc810ea std::for_each -> std::copy 2016-10-20 11:32:28 -07:00
jakepruitt 052b0e831d Remove debug logging 2016-10-20 11:32:28 -07:00
jakepruitt 42271d99b2 Store node ID's and weights separately in CompressedEdgeContainer
Removes CompressedEdges from the extractor and shared data format by
directly serializing vectors of node ID's, forward weights and reverse
weights for each node-based-edge

Refs #2575
2016-10-20 11:32:28 -07:00
Moritz Kobitzsch ecee13bffa actually calculate distance instead of using .distance which is a timing value 2016-10-20 12:27:02 +02:00
Moritz Kobitzsch 5e167b8745 Turn Angles in OSRM were computed using a lookahead of 10 meters.
This PR adds more advanced coordinate extraction, analysing the road
to detect offsets due to OSM way modelling.

In addition it improves the handling of bearings. Right now OSM reports
bearings simply based on the very first coordinate along a way.
With this PR, we store the bearings for a turn correctly, making the
bearings for turns correct.
2016-10-20 10:47:29 +02:00
Moritz Kobitzsch 1f8ca2879f fix u-turn collapsing onto empty name / in presence of turning use lane 2016-10-20 09:39:38 +02:00
Huyen Chau Nguyen 2d13116487 fix memory leak of char[] initialization 2016-10-19 17:26:21 -07:00
Huyen Chau Nguyen 316ef305de Refactor loading code for timestamp file 2016-10-19 17:26:21 -07:00
Daniel J. Hofmann ab1a9271c8 Canonicalizes Spaces in Semicolon Stringlists, fixes #3086 2016-10-19 14:14:18 -07:00
Daniel J. Hofmann 18bc02f087 Collapses Double OSRM <-> Engine <-> .. PImpl Indirection, Resolves #3019. 2016-10-19 13:42:08 -07:00
Moritz Kobitzsch 2a2abe9e0f remove unused class DiscreteAngle 2016-10-19 21:40:45 +02:00
Patrick Niklaus b7ee38eca7 Refactored loading code for .hsgr file 2016-10-19 19:59:23 +02:00
Moritz Kobitzsch ae157d0b4f fix changelog to not include 5.5.1 ahead of time 2016-10-19 18:37:53 +02:00
Patrick Niklaus 769485cc2f Initilialize tbb task scheduler correctly. Thanks @oxidase! 2016-10-19 18:30:06 +02:00
Patrick Niklaus 983ad3513a Enabled address sanitizer 2016-10-19 18:30:06 +02:00
Patrick Niklaus ca914b8b1f Use newest bintools with gcc 6, thanks @oxidase 2016-10-19 18:30:06 +02:00
Daniel J. Hofmann ca21b8833a Removes Gnu Date Usage 👴
\U+1Fstallman-emoji
2016-10-19 18:26:20 +02:00
Kajari Ghosh 3f0f0e306b Directional Destination Tags (#3061)
* cucumber test scenarios, #3027

* post review comments

* two tests are still failing

* fixed one test

* passing tests

* cleaner code refactor

* possible sceanrios for destination:ref:forward/backward

* added code for direction:ref:forward/backward, tests pass

* changelog

* store direction in variable

* added tags to taginfo

* fixed dumb error

* use boolean flags

* null pointer checks

* hopefully better null pointer checks
2016-10-18 23:09:19 -04:00
Patrick Niklaus f77a2474ea [skip ci] Forgot to add changelog entries 2016-10-18 22:20:42 +02:00
Patrick Niklaus 8205c34abe Fix duplicated code in tile plugin 2016-10-18 22:11:43 +02:00
Daniel J. Hofmann ee4fb89336 Adds missing routable service tags
http://taginfo.openstreetmap.org/keys/service#values
2016-10-18 22:11:13 +02:00
Patrick Niklaus 81c5cba0e5 Recover from stale mutexes with force unlocking and retry 2016-10-18 21:58:50 +02:00
Patrick Niklaus caa7c994a0 Make SharedDataFacade try to cleanup 2016-10-18 21:58:50 +02:00
Patrick Niklaus 847f530c8e Only keep reader lock on shared memory during queries. 2016-10-18 21:58:50 +02:00
Patrick Niklaus c69545c47a Don't block all requests to switch data
This switchtes the data even if there are requests still running on the
old data. osrm-datastore then waits until all of these old requests have
finished before freeing the old regions.

This also means that osrm-datastore will return with an error if there
is a data update currenlty in progress.
2016-10-18 21:58:50 +02:00
Patrick Niklaus 1557ff81bc Simplify the locking logic 2016-10-18 21:58:50 +02:00
Patrick Niklaus ebac9f586b Adapt SharedMemory ownership changes from @oxidase
We don't leak any pointers anymore and make owning the shared memory
explicit.
2016-10-18 21:58:50 +02:00
Patrick Niklaus 2512cf386d Add better debug log output 2016-10-18 21:58:50 +02:00
Patrick Niklaus da04563e26 Added header guards 2016-10-18 21:58:50 +02:00
Patrick Niklaus ceaf362326 Make SharedDataFacade immutable 2016-10-18 21:58:50 +02:00
Johan Uhle 9af00b1925 Docs: Rotaries can have exits as well 2016-10-18 02:20:18 +02:00
karenzshea f540485cb0 Add a speed for driveway to service speeds 2016-10-17 15:45:31 -07:00
karenzshea 5617d3886d Fix cucumber support code for routability testing to actually test
input/output for speed and time values, adjust resulting broken tests
2016-10-17 15:45:11 -07:00
Huyen Chau Nguyen 06d13b6954 run clang-format on edited files 2016-10-17 15:27:14 -07:00
Huyen Chau Nguyen d0c142b9c7 remove util self-written make_unique and use C++14 stdlib make_uniqe 2016-10-17 15:27:14 -07:00
Moritz Kobitzsch ef1f14550f max all trips roundtrips again 2016-10-17 15:26:38 -07:00
Moritz Kobitzsch 5839bf334b fix random feature fail 2016-10-17 15:26:38 -07:00
Moritz Kobitzsch 46c936b48e handle trips with identical coordinates 2016-10-17 15:26:38 -07:00
Daniel J. Hofmann 8ed6bb8a1b Asserts on valid v5 conforming maneuver types, resolves #3035 2016-10-14 15:59:26 +02:00
Daniel Patterson b72dc8c0cf Enable use of other build types than Debug and Release, and properly default to Release. 2016-10-14 12:37:01 +02:00
karenzshea 72fa35da10 add a toolkit function to find lanes to the left/right of turn lanes 2016-10-13 17:59:25 +02:00
Moritz Kobitzsch 17eb664597 don't get disturbed by service roads in obvious discovery 2016-10-13 16:10:59 +02:00
Daniel J. Hofmann 77931ffe24 Changes Lua detection to be less strict 2016-10-12 23:09:59 +02:00
Karen Shea 45df2c991f Merge pull request #3045 from Project-OSRM/fix/tilez-limit
Add max zoom limit of z12 to tile plugin parameters
2016-10-12 19:14:44 +02:00
karenzshea 615e302b8c test for tile that fails IsValid() check 2016-10-12 11:20:01 -04:00
karenzshea 1ed8e7e98c test a z12 tile 2016-10-12 10:20:14 -04:00
karenzshea ee012ae2da valid tiles are >= z12 2016-10-12 10:03:43 -04:00
Daniel J. Hofmann 32dcce88f7 Fixes missing memory include for make_unique; reported in #3018.
https://github.com/Project-OSRM/osrm-backend/issues/3018#issuecomment-253118518
2016-10-12 12:55:05 +02:00
Daniel J. Hofmann a13cf3f2be Route over alternating oneways but not reversible ones, closes #2837.
- alternating: high frequency, route over them with penalty
- reversible: low frequency, do not route over them - time dependence

- http://wiki.openstreetmap.org/wiki/Tag:oneway%3Dreversible
- http://wiki.openstreetmap.org/wiki/Tag:oneway%3Dalternating

This distinction was made at the Elbe-Labe Meetup in Dresden, with
accompanying Wiki pages and tagging scheme. Thanks all involed!

- https://github.com/Project-OSRM/osrm-backend/issues/2837
- http://wiki.openstreetmap.org/wiki/Key:oneway
2016-10-12 12:53:07 +02:00
Moritz Kobitzsch 6cf99c886f don't emit invalid on sliproads with incompatible modes 2016-10-11 10:59:10 +02:00
Emil Tin 7cbb1807e7 cucumber: change syntax of node maps 2016-10-11 09:07:48 +02:00
Patrick Niklaus d47d03c15b Add explicit test for malformed coordinate 2016-10-11 00:04:53 +02:00
Patrick Niklaus 240a7696da Catch boost bad_numeric_cast exception and let parser return an error 2016-10-11 00:04:53 +02:00
Patrick Niklaus 14b024e4dc [skip ci] Document InvalidQuery. Fixes #3026 2016-10-10 17:37:34 +02:00
Patrick Niklaus 339ebe8f81 [skip ci] Update changelog 2016-10-10 13:54:06 +02:00
Patrick Niklaus 9eb7fc03ce Use a shared (!) reader writer lock to protect CURRENT_REGIONS
This fixes issue #3016.
2016-10-10 12:13:45 +02:00
Moritz Kobitzsch 036475afd0 restructure for readability 2016-10-07 09:35:16 +02:00
Moritz Kobitzsch 378322f6e3 don't provide turn-straight next to suppress-straight 2016-10-07 09:35:16 +02:00
Daniel J. Hofmann d964b81308 Silence static visitor upstream deprecation warnings. 2016-10-06 21:08:48 +02:00
jakepruitt 49a28b478c Remove TODO - tiles are tested and seem to work 2016-10-06 10:09:57 -07:00
Lauren Budorick a75e16e26b Deduplicate foward/reverse geometries
Changes the internal representation of compressed geometries to be a
single array shared between forward and reverse geometries that can be
read in either direction. Includes a change on
extractor::OriginalEdgeData to store via_geometry ids that indicate
which direction to read the geometry for that edge based edge.

Closes #2592
2016-10-06 10:09:57 -07:00
Moritz Kobitzsch 73179641b1 clang-format code 2016-10-06 14:06:19 +02:00
Patrick Niklaus 58316c608d Fix verison detection for multiple lua installations
If both lua 5.3 and lua 5.2 are installed the old code threw an error
that 5.2 was not found since FindLua always picks the neweste version.
2016-10-06 13:36:34 +02:00
Patrick Niklaus 1c2ead8fb8 Make DataFacade local to every request
This is the first step to having fine grained locking on data updates,
see issue #2570.
2016-10-06 12:56:38 +02:00
Moritz Kobitzsch 66f2cc5184 fix detection of forks in present of oneways 2016-10-05 17:49:54 +02:00
Daniel J. Hofmann dbd108df8c Reworks how we search for Lua in CMake and constrain to Lua 5.1 5.2
At the moment we have a FindLua52.cmake module that is happy with
Lua52 but also Lua51 and even Lua53. Let's instead pull in the official
one from CMake (since it's not yet in CMake 2.8 which we support).

https://github.com/Kitware/CMake/blob/master/Modules/FindLua.cmake

BSD licenced.

Requires Lua 5.1 or Lua 5.2, since seeing memory issues on 5.3:

https://github.com/Project-OSRM/osrm-backend/issues/2926
2016-10-05 13:23:48 +02:00
Michael Krasnyk ff1ab217ba Debug and i686 builds 2016-10-04 16:37:29 +02:00
Patrick Niklaus 49a9d7f57a Try switching to GCC 6 2016-10-04 16:37:29 +02:00
Michael Krasnyk da15c014f5 Avoid doubled reprocessing for scenarios without caching 2016-10-04 14:35:21 +02:00
Daniel J. Hofmann 9a85a50586 Implements Cucumber shared vs. static library detection, fixes #2999 2016-10-04 14:14:37 +02:00
Daniel J. Hofmann 94ca782816 Bumps version to 5.4.0 2016-10-04 10:46:56 +02:00
Daniel J. Hofmann d17eacc52b Makes the OSRM interface threadsafe.
Technically speaking we're changing the `libosrm` API.

But since we're only lifting restrictions by marking the API threadsafe,
we should be fine here.
2016-10-04 09:32:22 +02:00
Daniel J. Hofmann d86bba3e24 Re-introduces the old RouteParameters ctor for API compatibility, see #2978 2016-10-03 20:00:12 +02:00
karenzshea 7f7b47611d add note about dangers of post subtree merges rebases [skip ci] 2016-10-03 13:51:30 -04:00
Karen Shea 2d4c128ea2 Merge pull request #2994 from Project-OSRM/retry/libosmium
Update to libosmium@2.9.0
2016-10-03 19:43:14 +02:00
karenzshea 5d9fc83db4 adjust test cases that specify coords without leading 0 2016-10-03 13:15:39 -04:00
karenzshea 879f7eb042 Squashed 'third_party/libosmium/' changes from 2282c84..80df1d6
80df1d6 Release v2.9.0
110dc5c Update change log.
6ad5829 Better handling of areas with duplicate segments.
f5985ed Better exception message for invalid areas.
fa09300 Explicit cast to make intent clear.
6f9b522 Fix name of struct stat on Windows.
6b0a47b Clean up code in data tests.
aa1226c Fix progress bar.
3663a19 Extend ProgressBar class so that it works with multiple files.
40c4d5a Add version of file_size() taking a file name.
43a2fac Merge pull request #162 from osmcode/windows-build-scripts
cc2305d [skip travis] 1st iteration of new build scripts
7abe4e1 Clean up disk location cache examples.
48841d5 Update change log.
cf854e9 Change timestamp parser.
01aa8c7 Add examples osmium_pub_names and osmium_road_length.
483c9f2 Benchmark code cleanup.
3ffea2d Cleaned up some test code.
80f0ff7 Explicit conversion from int to bool.
0ba5918 Write space after progress bar to defend against glitches in output.
8584423 Change progress bar to take max_size on construction.
d2c7585 Only call gzoffset when compiling with zlib > 1.2.4.
1b417e5 Add support for a progress report in osmium::io::Reader().
3b4c8c8 Minor cleanup of appveyor config.
d787e25 Fix OPL parser: Relation member without role at end of line.
53ca080 Make lots of variables const.
d776ab2 Add to change log.
eec3b62 Properly initialize m_data field.
cc607e1 Take argument by const ref.
be1e346 Remove unused function.
2a356ee Make lots of one-argument constructors explicit.
adca74f Add comments to and cleanup up examples.
381e535 Simplify WKB code.
b49efd8 Fix opl_parse_changeset_id() return type.
bb52e57 Use uint64_t for line count and column to be on the safe side.
243f6a7 Use parentheses to make sure the right precedence is used.
5a7648e Consistently catch by const ref unless var needs to be non-const.
e3be990 Avoid some warnings.
c436d92 Do not include unistd.h on Windows.
95b228c Add dummy function to avoid warnings.
f276ca3 Fixed includes and changelog update.
8c54bd9 Change timestamp error message.
27e1d5c Add OPL parser.
1d2caab Add more includes to osm.hpp to make usual osmium use simpler.
9d88361 More tests for area CRC.
4f8964d Initialize Item::m_diff member on construction.
f2b648b Parse coordinates in scientific notations ourselves.
b01323f More include fixes.
69f39d4 Fix some includes.
156536d Make padded_length a plain function, not a template function.
65cd1dc Extend functions to set Location lon/lat.
98b7b17 Update to protozero 1.4.2.
a6420cf Add diff indicator to items and use for diff opl and debug output.
0ef02a3 Add workaround for YCM.
3a986f4 Update protozero version.
5245c5b Document osmium_count example program and add memory usage output.
796ca13 Document handler class.
2ba1c1f Add example for mercator projection and tiles.
201f744 Restrict tiles to zoom <= 30.
202291d Add member_type_string class.
494ed6e Cleaned up Tile tests.
af13a8b Add documentation and range checks to Tile struct.
9df5d91 Some small changes to avoid conversion warnings.
afac031 Explicit cast to avoid warning.
8188f66 Better contribution info.
fa89d1d Fixed a problem limiting cache file sizes on Windows to 32 bit.
23a89df Remove obsolete info about versioning from CONTRIBUTING.md file.
115ae23 Release v2.8.0
4174b3c Style fix.
1795dcb Function wait_and_pop_with_timeout() is not needed any more.
4a3a71b Fix for possible threading problem.
cc85925 Updated change log.
67bc8b1 Use unordered_map instead of map in PBF string table code.
18b7b66 Set better default for string table chunk size and document it.
e6d7410 Remove dependency on sparsehash and boost program_options for examples.
14d92d6 Fix regression: Debug output of invalid location works again.
ef91ce1 Bugfix: PBF String table corruption when there are many strings.
649af78 Remove DeltaEncodeIterator completely.
56e5ac2 Function getting queue sizes from environment uses default when getting 0.
bfaab7d Add change log.
d260339 Remove use of PROTOZERO_STRICT_API macro.
c61722d Remove use of DeltaEncodeIterator simplifying code.
f7c60b6 Updates for new protozero.
0bdfb9d Updated change log.
bb56cbb Switch to newest protozero 1.4.0.
9e19a82 Add ccache support to CMake cnfig, better travis builds.
00d8868 Make I/O max queue sizes configurable via environment.
dc7e504 Remove unused debugging code.
13f66a0 Track pop() calls and queue underruns when OSMIUM_DEBUG_QUEUE_SIZE is set.
5c2e367 Add EWKT support.
8f7c7d3 Automatically set correct SRID when creating geometries.
ff11893 Better check of optional components in CMake config.
4562429 Use fallback implementation for coordinates given in scientific notation.
3bdf46e Mark enable_debug_output() as deprecated.
ea1093e Update catch unit test framework.
8623f1e Release v2.7.2
e135dd8 Fix data corruption regression in mmap based indexes.
adbd3b0 Do not output empty discussion tags in changeset XML output.
8126fbb Formatting.
c6970fd Fix coordinate output.
3471b4b Resize output string once in output_int().
0ddf0e7 Use our own function to convert integers to strings instead of printf.
f9a1dd3 Reading and writing coordinates is now independant of locale.
8104294 Use hand-crafted function for hex output (faster than printf).
0bb452a Fix links in change log.
1862d06 Release v2.7.1
8bfe2ba Release v2.7.0
c3604f3 Use 64bit counter in area stats.
9e589b3 Update gdalcpp.hpp from upstream.
fd55d9b Cleanup of OGR-related code.
d0c53e0 Fix bug: Relation wasn't found correctly from member.
24145f9 Use make_iterator helper function.
a8a287d Refactor count_not_removed function. (No template necessary.)
389332a Also print removed flag from member_meta.
5e7c5d0 Remove unnecessary overload of begin() and end() function in iterator_range.
2ec007f Do not add rings to invalid area, even if create_empty_areas is set.
fee8b73 Optionally keep type tag in area assembler. Better doc for config.
c7e1f8a Fix timer output in assembler code.
032ab40 Update change log.
dcfa439 Node location store keeps track of whether node ids are ordered.
54d5eb8 Add tests for new file based index code.
4fe5b30 Use correct empty value when initializing index.
40b5c79 Static or not static, that is the question.
aaa9b46 Open index file with minimum size, because zero-sized mmap is not allowed.
fea2337 Fix for disk-based indexes.
428a413 More tests of corner cases for id to location index.
9d2a31b Add config option to areas assembler for only creating some areas.
d11bf8d Count and report inner rings with the same tags as relation/outer rings.
bde10c4 Speed up copy of tags.
e4c9f87 Revert "Consistently remove some tags from area."
9cd7a03 Set areas assembly config setting create_empty_areas to true by default.
660fb63 Better ordering of OSMObjects.
b4199c2 Use std::strcmp instead of just strcmp.
579c34b Better field width/precision in problem reporter.
a2ebeeb Use field names with 8 characters or less in OGR problem reporter.
ef523fe Switch remaining "typedef"s to "using".
19425f8 Switching from "typedef" to "using" in geom code.
b13c2be More cases of switching from "typedef" to "using".
7f53977 Refactoring iterators: Not derived from std::iterator any more.
1922224 Consistently remove some tags from area.
295495f Fix check for detecting wrong role.
9aa6d46 Report more IDs in problem reporters.
d7a5da7 Remove now unused spike segment reporter.
0666d66 Only report duplicate segments if they belong to the same way.
9e17f89 Improved error reporting for area assembler.
e983a48 More code cleanup and docs.
927eeda Replace awkward std::pair construct by real class.
d0543b9 Various area code refactorings.
0ae8f07 Do not build areas for ways with tag area=no.
d4cabe7 Add some convenience functions to check for tags in TagList.
99f4be9 Add missing include.
a8dda78 Travis: Only run tests if build succeeded.
9db3034 Add missing "nodes" fields.
50e9fcb Report ways that are in multiple rings as errors.
58a3669 Add some paranoia asserts.
3958c1d Use iterator_range to make equal_range results easier to use.
c12c710 Add for_each_member() function to iterate over members of an mp relation.
ca35452 Change argument order in create_area() functions.
4473ae1 Keep stats on multipolygons with no tags on the relation.
12c5335 Bugfix: Check that there is a problem reporter before using it.
ec2afce Update change log.
5af2ec9 Use new area assembler interface in multipolygon collector.
73e3440 Some code cleanup in area code and new interface for calling assembler.
7737479 Add the number of nodes in area to problem reporter.
b4f9343 Use const_iterator where possible.
02372b2 Simplify code that checks for open rings.
8d6099e Pull out location_to_ring_map into details ns and add == and < ops.
1a05042 Mixed code cleanups and added comments.
4b8d1be Ignore empty role when checking inner/outer roles on multipolygons.
e22f573 Now GCC is complaining about the clang pragma...
48000c0 Add some missing includes and forward declarations.
ba9504a Workaround for bug in old libc.
a138265 Completely new algorithm for assembling multipolygons.
74054bd Add specialization of std::hash function for Location.
5ed4c90 Use newest gdalcpp.hpp with implicit transaction support.
676949e Add "locations_on_ways" support for OPL format, too.
ce05c19 Add support for reading/writing XML/PBF files with locations on ways.
62b2ee4 Fix checksum test.
bd512a8 Added "add_crc32" file option for adding CRC32 checksum to debug output.
3a100fa Incorporate locations in NodeRefs into CRC32 checksum.
ac02f86 Update catch.hpp to newest version. Removed outdated info in README.
481f48b When assembling areas ignore ways containing no or only a single node.
a0ae33a Fix unsigned overflow in pool.hpp.
91b8adf Fix undefined behaviour in WKB writer.
697f460 Check results of dynamic casts.
f1e4571 Fix from_item_type() implementation so it also works with undefined type.
65df99b Add future_queue_type alias to simplify code.
4340e4d Removed SortedQueue implementation which was never used.
cdd8f8c Add version.hpp with macros defining version of the library.
ff5d42a Update to newest gdalcpp.hpp.
a184f66 Update change log.
0ea76f7 Add osmium::Area::outer_rings() and inner_rings() functions.
b0404b7 New ItemIteratorRange class for iteration over buffers and subitems.
eff8a7c Add default type to string_to_object_id for IDs without type prefix.
e877a6f Clean up code inner vs. outer ring in geometry factory.
9224be5 Disable use of XML entities in OSM files.
9d9fa08 Output operator of location shows full precision of coordinates.
9a8e7c0 Documentation fixes.

git-subtree-dir: third_party/libosmium
git-subtree-split: 80df1d6850bdfa661587839b77dcea0ab8fc814a
2016-10-03 13:08:59 -04:00
karenzshea 5b4e2950d9 Merge commit '879f7eb04200d7d2c28af565229bf6e3d54274fd' into retry/libosmium 2016-10-03 13:08:59 -04:00
karenzshea 050585bbd9 rename dep update file, bump to osmium@2.9.0 2016-10-03 13:08:45 -04:00
karenzshea 89007ae669 Adapts Tile tests to protozero's strict iterator_range API from @daniel-j-h 2016-10-03 13:07:18 -04:00
Daniel J. Hofmann b821a1dd98 Disables ld.gold on binutils < 2.26, resolves #2984 2016-10-03 15:41:40 +02:00
Moritz Kobitzsch d1f1358e48 adjust for comments by daniel-j-h 2016-09-30 17:27:14 +02:00
Daniel Patterson 805d93912d Construct an adjacency list in order to discover turns. 2016-09-30 17:12:23 +02:00
Daniel Patterson 0b7b16abc0 Include new method in test mock objects. 2016-09-30 17:12:22 +02:00
Daniel Patterson 3dd7732ffc Add code comments and document some magic constants. 2016-09-30 17:12:22 +02:00
Daniel Patterson c8eb2b2d11 Refactor edge unpacking so that it's CH indepenent and we don't repeat ourselves so much. 2016-09-30 17:12:22 +02:00
Lauren Budorick 14e7460465 Include turn information in debug tiles. 2016-09-30 17:12:20 +02:00
Daniel J. Hofmann 6290aeea93 Fixes Tile Unit Test Compilation 2016-09-30 16:58:50 +02:00
Moritz Kobitzsch 10b93c6908 re-introduce space into summaries 2016-09-30 14:36:09 +02:00
Moritz Kobitzsch e4d0d49300 move summaries to car profile, test for references, use boost adaptors 2016-09-30 10:59:23 +02:00
karenzshea cbb96ce7f4 handle empty names in summaries 2016-09-30 10:43:36 +02:00
karenzshea 54aaf574d9 removing caching from edge weight update test, so it runs fresh each time 2016-09-30 00:12:47 +02:00
Moritz Kobitzsch a824e64682 Merge branch 'master' into guido/notification 2016-09-29 16:03:44 +02:00
Moritz Kobitzsch df6186f0f1 fix documentation 2016-09-29 12:05:19 +02:00
Moritz Kobitzsch 78d530ddae fix polyline decoding 2016-09-29 11:56:51 +02:00
Moritz Kobitzsch da15e1fc5e adjust case/add clarification 2016-09-29 10:50:28 +02:00
Ansis Brammanis 7e2663f2ad calculate roundabout radius from circumference, fix #2716 2016-09-29 10:42:42 +02:00
karenzshea 1a96483f7b prefer notification over new-name/suppressed types 2016-09-29 10:26:56 +02:00
karenzshea 3d5a53566c implement flag edge-weight-updates-over-factor, to log edge weight
updates over provided x factor
2016-09-28 15:19:59 +02:00
karenzshea eafe3fa928 remove luajit support 2016-09-28 11:12:11 +02:00
Moritz Kobitzsch 6cfb1d6a85 add changelog for trip-changes 2016-09-28 10:51:21 +02:00
Moritz Kobitzsch 0abd32fca3 prefer first result 2016-09-28 10:32:33 +02:00
Daniel J. Hofmann d1f555dcef Removes unused JSON logger.
References:
- https://github.com/Project-OSRM/osrm-backend/pull/2769
2016-09-28 10:01:56 +02:00
Moritz Kobitzsch 6cfd1c92e1 make changelog readable 2016-09-28 09:40:25 +02:00
Daniel J. Hofmann bbbbacb073 Reworks Restriction Whitelist / Blacklist, resolves #2833
Takes a stricter aproach for whitelisting / blacklisting restrictions:

- uses `restriction=`
- uses more specific `restriction:<type>=`
- uses `except=<type>` to invert

Where `type` is the type of transportation to restrict, e.g. `motorcar`.

https://github.com/Project-OSRM/osrm-backend/issues/2833
2016-09-28 09:35:02 +02:00
Moritz Kobitzsch e7b2f85a20 correct changelog 2016-09-28 09:34:10 +02:00
Moritz Kobitzsch 75de7c8eaf changelog updated 2016-09-28 09:06:44 +02:00
Michael Krasnyk 3f3c85ba72 Added profile files per test generation 2016-09-28 09:04:58 +02:00
Daniel J. Hofmann 89264eb89b Better documents profile request parameter, resolves #2952 2016-09-28 09:03:06 +02:00
Daniel Patterson fa5714ab82 Unset FORTIFY_SOURCE before setting to avoid warnings for compilers where FORTIFY_SOURCE is predefined. (#2946) 2016-09-27 21:32:22 -07:00
Moritz Kobitzsch 8aa93f32cc add changelog entry for reduction of name changes 2016-09-21 12:45:59 +02:00
Daniel J. Hofmann 60010dd998 Reduce NewName Instructructions / Name Changes
With @karenzshea's name / ref split (ref. #2857) in master we want to
make use of it and reduce `NewName` instructions when ever possible.
This is a first step towards #2744 by using the already existing name
change heuristic from the extractor now in post-processing as well.

Limitations: at the moment we don't have the `SuffixTable` in
post-processing; this would require us serializing and subsequently
deserializing the table, passing it through from the profiles to the
API.
2016-09-21 12:42:39 +02:00
Moritz Kobitzsch 7ffe832ff8 add changelog entry for HOV change 2016-09-21 11:48:50 +02:00
Daniel J. Hofmann a63b10972b Handle HOV designated-only Lanes, resolves #2929
In https://github.com/Project-OSRM/osrm-backend/issues/2711 we made
`hov=designated` routability configurable.

We want to handle designated-only lanes in the same way. Example:

    hov:lanes:forward=designated|designated
    hov:lanes:backward=designated

should have more or less the same effects as

    hov=designated

In contrast

    hov:lanes:forward=designated|no|yes hov:lanes:backward=yes

should not be handled. See

    https://github.com/Project-OSRM/osrm-backend/issues/2711

for explanation wrt. tag semantics with the difference that
backward/forward only set the backward/forward mode to inaccessible.

References:
- http://wiki.openstreetmap.org/wiki/Key:hov#hov:lanes.3D.2A
2016-09-21 10:56:42 +02:00
Michael Krasnyk 3eac6effbb Fix "Error: write after end" and removed @bug tags
https://nodejs.org/api/child_process.html#child_process_event_exit
Note that when the 'exit' event is triggered, child process stdio streams might still be open.
2016-09-20 20:40:53 +02:00
Patrick Niklaus 7d124ce54d Close GH-2795: Rewrite cucumber test caching (and support logic). Fixes #2745 2016-09-19 14:13:44 -07:00
Moritz Kobitzsch 8522cddd61 Prevent loops in extraction based on merge 2016-09-19 13:33:52 +02:00
Daniel J. Hofmann bf2b1a64b9 Fixes sign mismatch in Nearest limit comparison 2016-09-16 15:40:05 +02:00
Moritz Kobitzsch 70ee624e5c make changelog reasonable 2016-09-16 08:46:02 +02:00
Moritz Kobitzsch 3a49635eb7 remove dead code 2016-09-16 07:14:44 +02:00
Moritz Kobitzsch aa5f8dce23 fix may be uninitialised warnings 2016-09-15 08:25:17 +02:00
Daniel J. Hofmann c186e51a08 Do Not Copy Lane Strings Into Fn 2016-09-14 20:27:17 +02:00
Moritz Kobitzsch 861314256e fix roundabout-intersection on immediate exit 2016-09-13 19:16:45 +02:00
Moritz Kobitzsch 38f5adbe5c we can count 2016-09-13 16:22:22 +02:00
Moritz Kobitzsch 092e77e89b fix false positives in sliproads 2016-09-13 14:11:29 +02:00
Moritz Kobitzsch 64a72f574d also reserve entry for refs 2016-09-13 13:48:28 +02:00
Daniel Patterson 1b4a52e99c Update changelog for issue #2896 fix. 2016-09-12 15:14:50 -07:00
Michael Krasnyk 1d94eb88f6 Test for PR #2898
Test checks that osrm-extract terminates for
http://www.openstreetmap.org/way/198481519
2016-09-12 22:20:11 +02:00
Moritz Kobitzsch b3c5a9c010 fix looping in sliproad handler for lanes 2016-09-12 18:20:28 +02:00
Daniel J. Hofmann e3c1b133bf Adds a limit for number of results returned in Nearest service, resolves #2872 2016-09-12 11:59:08 +02:00
Daniel J. Hofmann e6fe9d0d67 Fixes issue where two ways with same name but different pronunciation where deduplicated, resolves #2860 2016-09-09 18:28:44 +02:00
Daniel J. Hofmann 05c1fe7f46 We do duration based routing (also see #77); closes #2885 2016-09-09 16:27:00 +02:00
Daniel J. Hofmann e3a38a6b0d Fixes compilation against newer Boost versions; seems like we were lucky before; closes #2889 2016-09-09 16:14:25 +02:00
Moritz Kobitzsch 2b9cf742c5 make sure to reserve enough external memory 2016-09-09 15:38:26 +02:00
Daniel J. Hofmann a289e1cd96 Fixes bearing range of zero exhaustive graph traversal 2016-09-08 17:33:50 +02:00
Moritz Kobitzsch c306a59854 make sure to not-collapse different travel modes 2016-09-08 15:01:25 +02:00
karenzshea dcc1b5ab2b return name and reference separately 2016-09-08 14:28:23 +02:00
Moritz Kobitzsch 938dff011f handle all our new strings correctly, introduce rotary_pronunciation 2016-09-07 16:09:13 +02:00
Moritz Kobitzsch 9123c93a90 fix interaction between sliproads/segregated intersections 2016-09-07 12:36:29 +02:00
Moritz Kobitzsch a551286a8f adjust testscases for collapse of use lane 2016-09-07 12:17:36 +02:00
Daniel J. Hofmann 86fd04e556 Improves lane handling for subsequent going straight, resolves #2625
Before we only worked on subsequent quick turns, as in:
`right, right` keeps the user on the rightmost lanes.

This changeset modifies the logic to work on any subsequent steps
that are "quick" and have lane information we can constrain later.

Because we do not have a from-lane => to-lanes mapping we take the
lanes left and right of the turn lanes into account when heuristically
assigning the leftmost / rightmost lanes.

There are some edge cases where this still does not give us the optimal
solution but it gets close to what is actually possible at the moment
without having a lane mapping in post-processing.

References:
- https://github.com/Project-OSRM/osrm-backend/issues/2625

fix rebase
2016-09-07 12:17:36 +02:00
Moritz Kobitzsch b6dbf81206 don't assign lanes on delayed turns 2016-09-07 12:17:34 +02:00
Daniel J. Hofmann af47252efe Do not collapse away lane information as long as it is necessary 2016-09-07 12:17:00 +02:00
Moritz Kobitzsch 3b81b39998 turn lane handler moved to scenario based handling 2016-09-07 12:16:59 +02:00
Moritz Kobitzsch 802b93fa9a fix testcases, one case only works by turn restriction, needs investigation 2016-09-07 12:04:17 +02:00
Daniel Patterson 7899444135 Add example request to the route API esection 2016-09-06 10:31:08 -07:00
Daniel Patterson 1ab2b87cc0 Update turn penalty function to better fit measured data 2016-09-06 09:07:00 -07:00
Moritz Kobitzsch 97c66c6c82 added some concerns regarding the angles/length of the turns 2016-09-06 09:57:33 +02:00
Daniel J. Hofmann 733207d4a1 Be more strict classifying staggered intersections, resolves #2824 2016-09-06 09:57:33 +02:00
Moritz Kobitzsch a0ed70f0a2 don't detect sliproads at wrong locations, don't emit invalid instructions 2016-09-06 09:01:06 +02:00
Moritz Kobitzsch d3a6b5a77e detect broken roundabout-taggings 2016-09-05 16:49:57 +02:00
Moritz Kobitzsch 7a523713c7 remove broken assertion 2016-09-05 15:06:56 +02:00
Moritz Kobitzsch f7265892ed correctly detect loss of prefix/suffix 2016-09-05 15:03:21 +02:00
Moritz Kobitzsch be266c7c2b fix copy-paste typo in guidance lib 2016-09-05 15:00:42 +02:00
Moritz Kobitzsch b1b41435b6 Revert "make sure collapse only happens on valid indices"
This reverts commit 47a6cd5462.
2016-09-05 14:54:30 +02:00
Moritz Kobitzsch 8f32a80778 changelog entry 2016-09-05 14:52:14 +02:00
Moritz Kobitzsch 5d79e0ac2f catch infinite loops 2016-09-05 14:52:13 +02:00
Moritz Kobitzsch 47a6cd5462 make sure collapse only happens on valid indices 2016-09-05 12:41:33 +02:00
Moritz Kobitzsch 7528b27f99 mark broken case todo 2016-09-05 11:50:36 +02:00
Daniel Patterson a4f9499305 Invalid string values in lanes:psv:backward should result in 0 lanes,
not `nil`.
2016-09-04 14:23:43 -07:00
Daniel J. Hofmann bb244e28bb Adds a failing test case for 255 unicode code points
The OSM spec says "up to 255 full unicode chars", so we should be able
to handle 255 x 🐼 --- but we don't.

The internal limit is on 255 _bytes_ in the `std::string`, but there can
be up to four bytes in a utf8 encoded code point.

References:
- http://wiki.openstreetmap.org/wiki/API_v0.6#Tags
- http://www.fileformat.info/info/unicode/char/1f43c/browsertest.htm
- https://en.wikipedia.org/wiki/UTF-8#Description
2016-09-02 16:10:32 +02:00
Moritz Kobitzsch 6fac14dbd8 ignore invalid only_* restrictions 2016-09-01 09:14:01 +02:00
Daniel J. Hofmann 8b144f22c9 Exposes osrm::exception for client usage, resolves #2813 2016-09-01 09:12:35 +02:00
karenzshea 146eb3a20e add test case for ignoring unknown restrictions 2016-08-31 09:52:05 -04:00
karenzshea d8e444e620 explicitly return false for no_* restrictions 2016-08-31 08:33:56 -04:00
Patrick Niklaus da9d63a384 Always overwrite m_is_core_node on data swap
This fixes a seg fault when swapping between core/no core datasets
2016-08-30 17:31:08 +02:00
Patrick Niklaus c5e85f3d6d Set parent nodes of core entry nodes not to themselves 2016-08-30 17:31:08 +02:00
Patrick Niklaus e05750547c Merge pull request #2800 from oxidase/fix/2785
[ready] Don't use --gc-sections gold option for binutils < 2.25
2016-08-29 15:13:33 +02:00
Patrick Niklaus 315823cce1 Use service tag to penaltize alleys and forbid emergency access 2016-08-29 14:15:22 +02:00
Patrick Niklaus 6ff07f4e82 State all turn penalties in seconds 2016-08-29 13:54:56 +02:00
Michael Krasnyk 41b54cf25d Don't use gold gc-sections for binutils < 2.25
Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
due to https://sourceware.org/bugzilla/show_bug.cgi?id=17639

readelf --debug-dump=frames build/libosrm_extract.so
Contents of the .eh_frame section:
...
readelf: Warning: Invalid length 0xfff01dd8 in FDE at 0x000020
2016-08-25 23:51:25 +02:00
Patrick Niklaus 5ee15ee339 Use webkit code snippet to detect GNU gold 2016-08-25 22:45:49 +02:00
Patrick Niklaus 01b0bce2d5 Use gold linker by default if available 2016-08-25 22:45:49 +02:00
Patrick Niklaus cb57ccacef Merge pull request #2805 from rkcpi/centos-build-fix
Fix build on CentOS
2016-08-25 10:43:43 +02:00
Moritz Kobitzsch 7e0d14b113 make collapse work by better detecting continue/non-continue situations 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch d06eec5e42 improve segregated road detection 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch 9648821a79 handle missing cases, cleaning up 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch 21fb18fe5e identify merges on non-perception cases 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch 6a2518c0df handle stronger merge cases as well 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch 7886d06839 adjust angles pre-merge as well 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch 5a9eb6ef72 prepare solution 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch b6c3d1d5bf Cucumber Scenario for #2725 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch 9b2f6585fb handle non-through case 2016-08-24 10:12:27 +02:00
Moritz Kobitzsch 46fd17a9ff moved obviousness discovery. updated sliproad handler. back to original cases failing 2016-08-24 10:12:27 +02:00
Daniel J. Hofmann da73bae9c6 Scenario for unnecessary slight left onto Stralauer Str 2016-08-24 10:12:27 +02:00
Moritz Kobitzsch 766e2713ab fix segmentation fault for via-routes with invalid intermediate segments 2016-08-23 14:17:32 +02:00
Sandra Thieme 9957254a5a Use c++1y instead of c++14 2016-08-23 13:01:07 +02:00
Patrick Niklaus 9f6859561c Merge pull request #2796 from frodrigo/update_car_profile_from_omim
Add local maxspeed for Netherland
2016-08-22 23:20:17 +02:00
Frédéric Rodrigo 88573a66cd Add local maxspeed for Netherland 2016-08-22 18:53:33 +02:00
Moritz Kobitzsch 3ccbe9842c add a PR template to the repo 2016-08-19 14:21:20 +02:00
Daniel J. Hofmann 5971822f82 Enable data flow guided fuzzing using traces 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann cdf6baba1d Add fuzz testing drivers for json escaping and uri decoding 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann 4b7ddb6826 Add fuzz testing drivers for url and request parser 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann 06b74c1f08 Add fuzz testing drivers for all parameters 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann 3a0eed2ee5 Make sanitizer used for Fuzz testing configurable via FUZZ_SANITIZER 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann 2557bdcf39 Basic Fuzz Testing.
[100%] Fuzzing libosrm
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-0.log 2>&1
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-1.log 2>&1
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-2.log 2>&1
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-3.log 2>&1

References:
- http://llvm.org/docs/LibFuzzer.html
- http://llvm.org/releases/3.8.0/docs/LibFuzzer.html
- https://github.com/Project-OSRM/osrm-backend/issues/1678
2016-08-19 13:59:59 +02:00
Patrick Niklaus 12d478784b Enable toll roads by default again.
Currently we don't route over the Golden Gate bridge by default.
This sets the value to false by default. To test the behavior for
tolls when ignored, we would need issue #2781 implemented.
2016-08-19 13:01:15 +02:00
Moritz Kobitzsch 38fef77d70 additional collapse cases 2016-08-19 12:43:51 +02:00
Moritz Kobitzsch e8bae78749 fix errors introduced in refactor 2016-08-18 11:36:36 +02:00
Moritz Kobitzsch e14bc30428 adjusted for comments 2016-08-18 11:36:36 +02:00
Moritz Kobitzsch 9485c97738 adjusting u-turn handling in lane matching to fully fix 2706 2016-08-18 11:36:36 +02:00
Patrick Niklaus 11aed6c93e Merge pull request #2734 from oxidase/gdb-printers
Added gdb pretty printers
2016-08-18 11:24:16 +02:00
Daniel J. Hofmann d53c267129 Be more aggresive classifying Roundabout Intersections.
Roundabout Intersections are roundabouts with up to four ways and turn
angles which makes the turns obvious, e.g. as in:

```
    *
    *
* *   * *
    *
    *
```

but not

```
     *
    *
* *   *
    * *
     * *
```

For Roundabout Intersections we issue instructions such as
"turn <direction>" instead of "take the <nth> exit".

At the moment we have a limit on the radius for these Roundabout
Intersections of 5 meters. Which fails to classify a wide range of
Roundabout Intersections in the US (with the US-wide streets).

This changeset removes the Roundabout Intersection radius limit:

- if the roundabout is larger than a threshold and is named we classify
  it as a rotary

- if the roundabout matches our criteria for Roundabout Intersections
  we classify it as a Roundabout Intersection

- else fallback to plain old Roundabout

There is a second issue with determining a roundabout's radius.
But that's for another pull request (tracking in #2716).

References:
- https://github.com/Project-OSRM/osrm-backend/issues/2716
2016-08-18 10:50:32 +02:00
Patrick Niklaus 2f6de614c1 Ignore any following columns in a CSV file 2016-08-18 10:19:36 +02:00
Moritz Kobitzsch 087080a6c3 mark via-case todo to prevent known failure to show up in local cucumber 2016-08-15 15:52:47 +02:00
Patrick Niklaus 41b22916f3 Merge pull request #2756 from gojuno/turn_annotation_bugfix
JSON instruction serialization fix.
2016-08-12 19:14:47 +02:00
Lev Dragunov 89f1071947 Static checks for guidance array sizes. 2016-08-12 18:52:54 +03:00
Moritz Kobitzsch 464de785cb fix removal of multiple geometries for first vertex 2016-08-09 12:02:07 +02:00
Lev Dragunov 8986777c58 JSON instruction serialization fix. 2016-08-08 20:32:01 +03:00
Daniel Patterson 65def1a9e2 We should be returning an error if any errors that occur during reprocessing. 2016-08-05 15:11:12 -07:00
Daniel Patterson 176c2244ad Catch and report errors during osrm-contract tests. 2016-08-05 14:19:22 -07:00
Daniel J. Hofmann b161e10b73 No Go To 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann 5bef5dcb04 Disable our added failing cucumber tests for now 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann 46a4c27582 Fall back to generic match finding if not a reverse-lane 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann acc6da86de Skip handling none values for our edge cases for now..
Conflicts:
	src/extractor/guidance/turn_lane_augmentation.cpp
2016-08-05 18:32:42 +02:00
Daniel Patterson 4d84bc0f01 Add a minimal version of the failing test case. 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann c737635a3b Reproducing breaking intersection in cucumber scenario
Conflicts:
	src/extractor/guidance/turn_lane_augmentation.cpp
2016-08-05 18:32:42 +02:00
Daniel J. Hofmann b7eeafb183 Try to come up with a small test case 2016-08-05 18:32:42 +02:00
Patrick Niklaus 677306eeee Merge pull request #2707 from oxidase/left_side_driving
Left side driving
2016-08-05 18:09:10 +02:00
Patrick Niklaus 2284ebaacb [skip ci] Iterate on the release docs 2016-08-05 18:07:28 +02:00
Patrick Niklaus 6b4975b2e4 Fix the release branch 2016-08-05 18:07:28 +02:00
Johan Uhle 94c38d115a Fixing up the release flow docs
- Clarifying guarantees between patch/minor/major versions
- Consolidating version release flow into one flow for patch/minor/major versions
- Add constraint that all minor/major released code needs to have had a release candidate before
2016-08-05 18:07:28 +02:00
Daniel J. Hofmann b1e309b4eb Collapse Staggered Intersections.
Staggered intersection are very short zig-zags of only a few meters.
They are common in rural and exurban areas, especially in the US.

(In addition, these cases could as well be tagging issues)

We do not want to announce these short left-rights or right-lefts:

          * -> b      a -> *
          |       or       |       becomes  a   ->   b
     a -> *                * -> b

Here is one example:

- https://www.openstreetmap.org/edit#map=20/39.26017/-84.25182

And here are two edge-cases that we don't handle at the moment:

- http://www.openstreetmap.org/edit#map=20/38.87900/-76.98519
- http://www.openstreetmap.org/edit#map=19/45.51056/-122.63462

and probably should not handle since the distance in between is
quite long (roughly 7-15 meters). For these we want to announce
two turns to not confuse the user.

Thanks to @1ec5 for raising this issue and @karenzshea for
providing additional US examples and cultural insights.
2016-08-05 14:35:13 +02:00
Patrick Niklaus e8ce119972 Merge pull request #2743 from Project-OSRM/avoid-10m-timeout
Set cacher timeout just under 10 minutes
2016-08-05 10:32:12 +02:00
Dane Springmeyer 8b7cd2931b set cacher timeout just under 10 minutes 2016-08-04 17:16:53 -07:00
Daniel J. Hofmann 8bee57b0b0 Makes toll=yes way's routability configurable in profiles.
The primary use-case is conditionally filtering ways such as:

https://www.openstreetmap.org/edit#map=18/38.94198/-77.28127

which we are guiding the user onto in the route from DC to IAD:

http://map.project-osrm.org/?z=12&center=38.934443%2C-77.167969&loc=38.902656%2C-77.029095&loc=38.952210%2C-77.453424&hl=en&alt=0

This changeset makes `toll=yes` configurable in the profiles, disabling
them by default. Neither do we support time-based fees nor vehicle
category fees at the moment.

References:
- http://wiki.openstreetmap.org/wiki/Key:toll
2016-08-04 14:29:22 +02:00
Patrick Niklaus 6bfe3a2d41 Merge pull request #2733 from gavinsherry/master
Remove unused variable node_info_list
2016-08-04 11:24:33 +02:00
Daniel J. Hofmann 7f71f0ed12 Warn on unused return values in guidance code, resolves #2686.
https://github.com/Project-OSRM/osrm-backend/pull/2685/files

fixes an issue where we did

    elongate(fstStep, sndStep);

instead of

    newStep = elongate(fstStep, sndStep);

we didn't get any warnings.

The only way to trigger a warning here is to use

```cpp
__attribute__((warn_unused_result))
```

This changeset does exactly that: for the new guidance code prone to
these kind of issue we add such an attribute to the declaration.
2016-08-03 12:26:07 +02:00
Daniel J. Hofmann 583aaff286 Makes designated HOV way's routability configurable in profiles.
Why only `hov=designated` and not all access tags, such as `hov:yes`,
`hov=no` and so on? From the Wiki:

- designated: The way is designated to high occupancy vehicles.
- yes: High occupancy vehicles are allowed. This by itself does not imply that other vehicles are restricted from using the way.
- no: High occupancy vehicles are not allowed on the way. This by itself does not imply that other vehicle types are allowed to use it.

The primary use-case is conditionally filtering ways such as:

http://www.openstreetmap.org/way/11198593#map=19/37.82571/-122.30521&layers=D

In addition there is a notion of HOV lanes for lane handling:

http://wiki.openstreetmap.org/wiki/Key:hov#hov:lanes.3D.2A

This changeset does not handle lanes at all, only designated HOV ways.
For HOV lane support, a logic similar to the lane access handling needs
to be implemented. This needs to go hand in hand with the existing lane
handling introduced in:

https://github.com/Project-OSRM/osrm-backend/commit/7d076e93445a4d016422a575f1132b267cd13c29

References:
- #2711
- http://wiki.openstreetmap.org/wiki/Key:access
- http://wiki.openstreetmap.org/wiki/Key:hov#Values
2016-08-03 12:24:43 +02:00
Daniel J. Hofmann b24f5c7c1a Adapt lane dump to lanes at intersection (#2675), resolves #2709 2016-08-03 12:19:14 +02:00
Daniel J. Hofmann 026f71934b Adds Cucumber Scenario for sharp left turn at traffic light 2016-08-03 12:18:31 +02:00
Michael Krasnyk 1353d55880 Added gdb pretty printers 2016-08-02 23:32:42 +02:00
Gavin Sherry b09f637d02 Remove unused variable node_info_list 2016-08-02 14:17:57 -07:00
Michael Krasnyk 979f9cab20 Added test for issue #2706 2016-08-02 19:06:10 +02:00
Michael Krasnyk eb6083daf5 Fix travis build 2016-08-02 12:31:46 +02:00
Daniel J. Hofmann c4718495a0 Add Florida Ave NW scenario for TurnLeft instead of MergeRight 2016-07-30 23:55:39 +02:00
Moritz Kobitzsch 0d36d472c9 change paradigm of merge to only emit on motorway-like roads 2016-07-30 23:55:39 +02:00
Daniel Patterson 35422a0fb5 Clang format. 2016-07-30 23:53:38 +02:00
Daniel Patterson d012b44b7f Filter out edges that have any speed=0 segments.
They become non-snappable and non-routable.  Note that a single segment
of speed=0 will eliminate the entire edge.
2016-07-30 23:53:38 +02:00
Patrick Niklaus eda6d9dc7c Builds components on travis again 2016-07-30 23:49:35 +02:00
Patrick Niklaus 63c86198a3 Fix compilation of components.cpp 2016-07-30 23:49:35 +02:00
Patrick Niklaus 33bdfe9cf9 Merge pull request #2720 from oxidase/issue/2706
Fix #2706 by using correct fallback u-turn
2016-07-30 16:25:26 +02:00
Michael Krasnyk a87c5998a1 Fix #2706 by using correct fallback u-turn
Regression is due to a combination of 08248e3853
and http://www.openstreetmap.org/changeset/40938983
where in ways http://www.openstreetmap.org/way/27292481
and http://www.openstreetmap.org/way/432488408
nodes
4315134884 (part of way 432488408)
4315134891 (part of way 432488408)
4315134886 (part of way 432488408)
form a u-turn that has index 0 after sorting and used as an allowed one
with a reversed edge.
A u-turn that corresponds to the condition uturn_could_be_valid == true has index 1
and ignored.
2016-07-30 12:15:22 +02:00
Michael Krasnyk c918a7957b Updated format and ChangeLog 2016-07-28 22:59:22 +02:00
Michael Krasnyk 61e6afdef0 added a lanes test in clockwise roundabouts 2016-07-28 22:59:22 +02:00
Michael Krasnyk 95dc36e908 addressed comments
Signed-off-by: Lauren Budorick <lauren@mapbox.com>
2016-07-28 22:59:22 +02:00
Lauren Budorick 951a4dc112 commit test file 2016-07-28 22:59:22 +02:00
Lauren Budorick c09b9b4c99 Initial left hand driving implementation 2016-07-28 22:59:22 +02:00
Patrick Niklaus b0873e2aa4 Merge pull request #2712 from Project-OSRM/talk-to-us
Talk to us!
2016-07-28 11:11:00 +02:00
Daniel J. Hofmann 2bdb8fce63 Talk to us! 2016-07-28 11:01:51 +02:00
Konstantin Shalnev d8a692740a Added 'return EXIT_SUCCESS' (#2710) 2016-07-27 16:31:57 -07:00
Patrick Niklaus 14797c421e Reformated the docs for annotations 2016-07-27 15:51:11 -07:00
Daniel Patterson 280b000f07 Include datasources for each segment in route annotation. 2016-07-27 15:51:11 -07:00
Daniel J. Hofmann fb4834458e No longer hard crash datastore on unrecognised options 2016-07-27 11:33:56 +02:00
Patrick Niklaus c7a1576100 Apply clang-format again 2016-07-26 15:00:58 +02:00
Daniel Patterson aebf6fa0b1 [skip ci] Update format script to enforce clang-format version, and work on OSX 2016-07-26 15:00:14 +02:00
Johan Uhle f76e3d4522 Docs: Clarify turn lanes on missing data
After https://github.com/Project-OSRM/osrm-backend/issues/2675#issuecomment-235230198
2016-07-26 13:18:01 +02:00
Daniel J. Hofmann eaf42ba437 Moves invalid id warnings to debug, closes #2630 2016-07-26 13:01:31 +02:00
Patrick Niklaus e83905b783 Fix exception handling around unrecognised options 2016-07-26 11:43:08 +02:00
Daniel Patterson 0b868969be Remove generic std::exception handlers, they don't seem to be adding value, and they hide useful info. 2016-07-26 11:43:08 +02:00
Patrick Niklaus b4710633b1 Rename function to reduce confusion 2016-07-26 11:23:14 +02:00
Moritz Kobitzsch 7d076e9344 handle access flags for lanes 2016-07-25 20:01:58 +02:00
Dane Springmeyer 71d64e8cd9 Default to c++14 / drop g++-4.8 from testing matrix 2016-07-25 19:30:43 +02:00
Daniel J. Hofmann 748fd3efa9 Remove lanes from roundabouts, closes #2626
After half a day of looking at the tagging and the data came to the
following conclusion:

We can't keep the user to the innermost / outermost lanes depending on
the exit the route takes: we found situations where both heuristics were
wrong.

Even on popular roundabouts the tagging is often wrong or in the best
case not present at all.

There are at least two different ways to interpret roundabout
indications: 1/ where e.g. a right arrow on the lane indicates turn
restrictions for the roundabout and the need to take this lane to exit
the roundabout to the right (possibly skipping multiple exits) and 2/
where a right arrow just means this is a lane in a immediate right turn.

Example: Australia marks lanes with arrows that seem to indicate
"angles you can exit the roundabout from", for example, these two ways:
- http://www.openstreetmap.org/way/320941710
- http://www.openstreetmap.org/way/42918021

Whereas Germany marks lanes with "directions you can travel in these
lanes immediately after entering the roundabout":
- http://www.openstreetmap.org/way/52578338

These two different interpretations of how to draw the arrows on the
roads mean we have conflicting solutions to "which lanes can you use to
take exit B from entry A" based on locality.

Continuing to tag ways based on lane markings is no problem, but
unfortunately, we can't reliably resolve good advice for navigation
system users (like "use the inside lane to take the second exit at the
roundabout"), there are too many situations that would generate bad
instructions (instructions that tell users to go into a lane they
shouldn't use).
2016-07-25 19:29:55 +02:00
Moritz Kobitzsch 1fc63e1e72 move hardcoded road priorities into profiles, change road classification 2016-07-25 13:07:54 +02:00
Daniel J. Hofmann fd6bb5ec1f Lane Handling for multiple indications per lane as in left;left|, fixes #2694
Before we asserted on unique lane indications per lane. Turns out the
OSM data contains lane strings such as:

    left;left|right

Which represents two lanes as in:

    <<     >
     ||    |

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

We don't want to crash there, so silently swallow this and
generate a single left|right for it.
2016-07-25 12:17:23 +02:00
Patrick Niklaus 261dbf3edd Fix log output of osrm-extract 2016-07-25 12:03:30 +02:00
Moritz Kobitzsch 9e323d2d42 improve sliproad / fork handling 2016-07-22 15:16:59 +02:00
Konstantin Käfer 1309dd2a0f Switch profiles from Lua to library interface
There's now an abstracted interface and no direct calls to Lua anymore.

fixes #1974
2016-07-22 15:03:57 +02:00
Patrick Niklaus 9b737230d6 Reenable ARM builds 2016-07-22 13:57:57 +02:00
Patrick Niklaus ecbd709535 Update the changelog for 5.3.0 2016-07-22 13:57:28 +02:00
Patrick Niklaus 060ec99678 Fix devide by zero when updating speeds 2016-07-21 18:57:21 +02:00
Dane Springmeyer 3601d1d262 increase travis cacher timeout to ensure large caches are able to be uploaded and downloaded 2016-07-21 17:58:57 +02:00
Moritz Kobitzsch 41ba20ca9a switch api format to new structure 2016-07-21 17:42:10 +02:00
Patrick Niklaus 57e3f173d3 [skip ci] Update docker files to gcc 5 2016-07-21 17:19:35 +02:00
Patrick Niklaus 92c298c7cf [skip ci] Fix example URLs in readme 2016-07-21 17:08:39 +02:00
Moritz Kobitzsch b25011ee60 fix use-lane handling 2016-07-21 16:37:54 +02:00
Moritz Kobitzsch 0e017a6ce5 collapse use-lane instructions if possible 2016-07-20 10:23:26 +02:00
Moritz Kobitzsch 2431e15ffa mark second case as todo, see https://github.com/Project-OSRM/osrm-backend/issues/2661 2016-07-20 09:55:30 +02:00
Moritz Kobitzsch 396add1e9d make roundabout maneuvers continuous with respect to lane changes 2016-07-20 09:55:30 +02:00
Patrick Niklaus 86241a2793 [skip ci] Add docs for contributing 2016-07-19 17:38:03 +02:00
Moritz Kobitzsch ee47afbe17 fix 2672 2016-07-19 17:06:47 +02:00
Moritz Kobitzsch 8831ca2f32 fix roundabouts with traffic lights 2016-07-19 14:49:09 +02:00
Daniel J. Hofmann abde215bc3 Remove semantically wrong ordering for LaneTupel 2016-07-18 12:33:56 +02:00
Daniel J. Hofmann 130d5298fc Fixes Undefined Behavior in LaneTupel (Strict Aliasing), resolves 2665
It's complicated :sigh: read this please:
http://dbp-consulting.com/tutorials/StrictAliasing.html

tl;dr: has to go through a memcpy (in C++) as in:
https://github.com/WebAssembly/binaryen/blob/184cc11cee2a65d30c7696eb3284e132099e4acb/src/support/utilities.h#L29-L40
2016-07-18 12:32:25 +02:00
Moritz Kobitzsch 50cbba1620 adding a todo testscase / regression test-case 2016-07-15 10:35:25 +02:00
Patrick Niklaus 2cc293ad16 [skip ci] Update changelog for RC3 2016-07-13 21:57:07 +02:00
Patrick Niklaus 6ac65a922f Disable ARM builds until sourceforge comes up again 2016-07-13 14:19:33 +02:00
Patrick Niklaus 3d80f989d0 Fix tests after cucumber update and changed escaping. 2016-07-13 11:48:53 +02:00
Patrick Niklaus 4fcb5d28a4 Merge pull request #2624 from oxidase/issues/2617
Fix ambiguous data issues
2016-07-13 11:20:40 +02:00
Patrick Niklaus 3ebdacf369 Merge pull request #2629 from ssuluh/master
Fix windows compilation with regard to struct/class packing
2016-07-13 11:08:34 +02:00
Moritz Kobitzsch 2ddc00c21e update cucumber to 1.2.1 and remove hack 2016-07-13 11:04:35 +02:00
Daniel J. Hofmann e76e39a398 Improves Lane Handling for Multi-Hop Roundabout Instruction
This changeset implements Lane Anticipation on roundabouts, delimited
by enter / leave step pairs. It does not handle lane anticipation
within a roundabout.

Lane anticipation happens on the granularity of a valid roundbaout:

We discard partial roundabout (enter without exit or exit without
enter) or data issues (no roundabout, exit before enter).

Related:

- https://github.com/Project-OSRM/osrm-backend/issues/2626 for lanes
  within a roundabout

- https://github.com/Project-OSRM/osrm-backend/issues/2625 for handling
  going straight in lane anticipation
2016-07-13 10:44:12 +02:00
Patrick Niklaus 04667f1ed8 Log incoming requests before they are processed 2016-07-11 16:50:09 +02:00
Surya Suluh 2091c3443b Fix windows compilation with regard to struct/class packing 2016-07-11 09:47:04 -04:00
Michael Krasnyk 2b466b2fb2 Fix ambiguity in edges by using names lexicographical order 2016-07-11 05:54:30 +02:00
Michael Krasnyk e17b306265 Fix ambiguity in edge weights by using minimal weight 2016-07-08 18:20:55 +02:00
Daniel J. Hofmann b00b15ab98 Manual modernize run with LLVM 3.8
More is blocked by:
- https://github.com/Project-OSRM/osrm-backend/issues/2631
2016-07-07 12:45:24 +02:00
Moritz Kobitzsch f4db79fe9b fix obvious turn collapsing for straight turns 2016-07-06 10:50:47 +02:00
Moritz Kobitzsch 0e4061f858 deduplicate code for roundabout handling 2016-07-01 11:34:44 +02:00
Moritz Kobitzsch 043a1446e1 adjust changelog (mention both files) and update a typo 2016-06-30 10:39:05 +02:00
Moritz Kobitzsch 49221995e8 add documentation on use lane type 2016-06-28 17:53:31 +02:00
Moritz Kobitzsch 247a7488b8 Adjusting Changelog 5.3.0-rc.2 to follow scheme 2016-06-28 13:25:35 +02:00
Moritz Kobitzsch 1806198971 Prepare Update to 5.3.0 RC2 2016-06-28 13:22:33 +02:00
Moritz Kobitzsch 375331b80c fixing lua issue in profile 2016-06-28 12:59:02 +02:00
Patrick Niklaus 8fdbe965cc [skip ci] Fix documentation 2016-06-28 11:08:37 +02:00
Patrick Niklaus dc77d02e8a Change OSRM version to 5.3.0 2016-06-28 10:35:45 +02:00
Moritz Kobitzsch 6265b8fa77 fix broken assertion 2016-06-28 10:30:02 +02:00
Moritz Kobitzsch 311b348d09 handle sliproads at traffic lights 2016-06-28 10:23:22 +02:00
Daniel Patterson ec02cdc4cc Use mmap instead of read - it's a lot faster here.
Also clean up construction of STRONG_TYPEDEF so that it can be
packed properly in structs (this explains all the () -> {}) changes
here.
2016-06-27 17:24:30 -07:00
Moritz Kobitzsch 5905708111 expose lanes as enums, adjusted for comments 2016-06-27 11:12:02 +02:00
Moritz Kobitzsch 5d91b759d1 Implement Turn Lane Api 2016-06-27 10:07:48 +02:00
Daniel J. Hofmann ec0a1a4ab1 Anticipate Lane Changes 2016-06-27 10:07:43 +02:00
Moritz Kobitzsch efa29edf09 basic turn lane handling 2016-06-27 10:07:41 +02:00
Moritz Kobitzsch 2a05b70dfc reduce number of end-of-road instructions in unnecessary cases 2016-06-26 16:40:15 +02:00
Patrick Niklaus 8693e68271 Merge pull request #2588 from Project-OSRM/fix/bike_surface_speeds
bike: surface should never increase speed
2016-06-26 16:37:12 +02:00
Emil Tin d21a9a514d bike: surface should never increase speed 2016-06-25 12:52:54 +02:00
Moritz Kobitzsch e03d132823 fix invalid circle centers 2016-06-24 15:12:51 +02:00
Daniel J. Hofmann 61ba985bc9 Prevent linker from discarding TBB symbols we need, fixes #2557
We build `osrm_contract` (the library) linking in libtbb. We then
build `osrm-contract` (the binary) linking in `osrm_contract` (the
library).

Because we're only using TBB's `parallel_invoke` in the code for the
binary, it seems like the linker discards some symbols in the library.

Therefore we have to link libtbb for the binary again. Even worse, the
order now matters: if we first link in `osrm_contract` and then libtbb,
we're still hitting the issue re. discarded symbols.

Therefore we first link in all dependencies (libtbb, libboost*), and
only then `osrm_contract`.

Strictly speaking, we probably have to do this for all of our binary
targets, or we will hit similar issues in the future.
2016-06-24 12:06:28 +02:00
Moritz Kobitzsch 4629a20fe4 improve handling of obvious for end-of-road situations 2016-06-24 12:05:42 +02:00
Patrick Niklaus a28125ee9a Merge pull request #2577 from noblige/noblige/compile-armv7
option to disable LTO
2016-06-24 12:04:02 +02:00
Daniel J. Hofmann df877aca1b Hard-abort on assertion and show detailed information, solves #2579
From

> [warn} oops

to

> [assert] /tmp/osrm-backend/src/extractor/extractor.cpp:79
> in: int osrm::extractor::Extractor::run(): false
> terminate called without an active exception
2016-06-23 18:57:35 +02:00
Aleksei Potov 05dc415aba option to disable LTO 2016-06-23 09:44:02 -07:00
Daniel Patterson 6dedd9cb72 Fix segfault when route includes very short segments. 2016-06-22 14:48:57 -07:00
Daniel J. Hofmann 256d39b572 Sync OSRM version in CMakeLists, fixes #2576 2016-06-22 17:03:31 +02:00
Patrick Niklaus d186ae1863 Fix semi-colon warnings 2016-06-22 13:20:55 +02:00
Patrick Niklaus fddc19e98d Fix regressed formating 2016-06-21 22:25:48 +02:00
Lauren Budorick 2592cd2e58 Update tests to catch 0-subtraction error 2016-06-21 19:31:46 +02:00
Patrick Niklaus 93b6438cea Fix fromTop and fromLeft calculation 2016-06-21 19:31:46 +02:00
Daniel J. Hofmann f6746d88b7 Removes unused -s from osrm-datastore, use osrm-springclean tool, closes #2561 2016-06-21 18:09:11 +02:00
Daniel J. Hofmann 34ace4dd4b Let Travis fail fast if CMake/Clang download fails, fixes #2433 2016-06-21 18:08:19 +02:00
Daniel J. Hofmann 41d0f42ddf Show user hint on wrong Node.js version, fixes #2435.
This is more of a hack but looks like the best we can do.

The reason for this is the following:

1/ we require strict mode for our v4 script

2/ v0.10 in strict mode marks 'let' as a reserved keyword,
   aborting before execution any code in the script. Thus,
   we can't assert e.g. on process.versions['node'] !== '4'.
2016-06-21 18:07:35 +02:00
Moritz Kobitzsch 2868f702a5 fix issues with roundabouts and intersections and sliproads 2016-06-21 16:56:57 +02:00
Patrick Niklaus ec4dcee8bd Merge pull request #2549 from oxidase/issue/2546
Fix omitting the last point's coordinates in the geometry field
2016-06-21 16:41:35 +02:00
Michael Krasnyk 8c378191df Fix omitting the last point's coordinates in the geometry field 2016-06-21 07:06:43 +02:00
Daniel J. Hofmann b98431e8e6 Use BaseDataFacades in guidance and prevent ODR violations with inline 2016-06-21 00:49:06 +02:00
Moritz Kobitzsch 3c8781855e handle steep off-ramps 2016-06-21 00:47:43 +02:00
Patrick Niklaus 27a94f3ca6 Merge pull request #2504 from oxidase/issue/2502
Fixes for i686 and armhf platforms
2016-06-20 22:01:09 +00:00
Michael Krasnyk 04e334e3e2 Make storage blocks aligned to 4 bytes for ARM NEON/VFP instructions
Aligned blocks prevent bus errors in NEON/VFP instructions.

Block pointers are aligned to 4 bytes, that is guaranteed
by aligned mmaped-pointers, the 4 bytes size of the CANARY block and
aligned sizes of blocks.
2016-06-20 22:45:40 +02:00
Michael Krasnyk 12d4832037 Fix platform-independent data in data files 2016-06-20 22:45:40 +02:00
Michael Krasnyk 6e4f6fec91 Added armhf Travis build 2016-06-20 22:45:40 +02:00
Michael Krasnyk 57c9525e5c Added i686 Travis build 2016-06-20 22:45:40 +02:00
Michael Krasnyk 543e4fb57d Fix rounding issue in query coordinates by using toFixed
that internally uses boost::numeric_cast<std::int32_t>
instead of static_cast<std::int32_t>
2016-06-20 22:45:40 +02:00
Michael Krasnyk 3881ead8e5 Fix rounding issue due to non-associative floating arithmetic
Failing test
features/car/traffic_turn_penalties.feature:33

Tables were not identical:
    from |     to |     route |     speed |     time
|     a |     h |     ad,dhk,dhk |     63 km/h |     11.5s +-1 |
|     i |     g |     fim,fg,fg |     59 km/h |     12s  +-1 |
| (-) a | (-) e | (-) ad,de,de | (-) 57 km/h | (-) 12.5s +-1 |
| (+) a | (+) e | (+) ad,de,de | (+) 58 km/h | (+) 12.5s +-1 |
|     c |     g |     cd,de,ef,fg,fg |     63 km/h |     23s +-1 |
|     p |     g |     mp,fim,fg,fg |     61 km/h |     23.5s +-1 |
|     a |     l |     ad,dhk,kl,kl |     60 km/h |     24s +-1 |
|     l |     e |     kl,dhk,de,de |     59 km/h |     24.5s +-1 |
|     g |     n |     fg,fim,mn,mn |     57 km/h |     25s +-1 |
2016-06-20 22:45:40 +02:00
Michael Krasnyk 911d1e81b6 Make explicit promotion to int64_t
to avoid incorrect promotions for 32 bit size_t
2016-06-20 22:45:40 +02:00
Michael Krasnyk ae06300c17 Fix unused variables warnings in crc32 2016-06-20 22:43:28 +02:00
Michael Krasnyk 26879ca91a Make build directory configurable via OSRM_BUILD_DIR in tests 2016-06-20 22:43:28 +02:00
Moritz Kobitzsch 306744e5cb fix roundabout-handling when name changes 2016-06-17 11:02:14 +02:00
Moritz Kobitzsch 3ca32898a1 move guidance decision into debug header 2016-06-15 11:30:30 +02:00
Patrick Niklaus 532fda267f [skip ci] Update changelog for 5.2.1
Conflicts:
	CHANGELOG.md
2016-06-14 14:32:33 +02:00
Daniel Patterson 494845b160 Copy data to beginning of buffer, not end. (#2542)
Copy data to beginning of buffer, not end.
2016-06-13 12:59:42 -07:00
Patrick Niklaus 0fc823041e Removed debug code 2016-06-13 17:57:33 +02:00
Patrick Niklaus 71eae4137d [skip ci] Update changelog 2016-06-13 17:27:53 +02:00
Moritz Kobitzsch 47b19f209b prefer obvious turn assignment over forks 2016-06-13 15:00:18 +02:00
Moritz Kobitzsch 2b5355edca improve slipway handling to allow multiple styles of turn lanes / turn roads 2016-06-13 11:56:50 +02:00
Patrick Niklaus e9a0beb4e8 Fix shared memory encoding for node-ids 2016-06-12 20:50:57 +02:00
Vladimir Kurchatkin 6bdfe68897 Add feature name to vector tiles (#2488) 2016-06-10 11:15:14 -07:00
Daniel J. Hofmann cf2d2b6763 Boost.Test Testing Docs 2016-06-10 19:03:44 +02:00
Moritz Kobitzsch 95cd44f34f add directions guide 2016-06-10 19:03:44 +02:00
Moritz Kobitzsch d330e60d40 added a guide on writing good cucumber tests for osrm 2016-06-10 19:03:44 +02:00
Moritz Kobitzsch 99004bbec8 add testcase 2016-06-10 10:20:39 +02:00
Emil Tin bbcc728a07 Update http.md
clarify "new name" instruction
2016-06-10 09:42:13 +02:00
Daniel J. Hofmann 033dc0a72d Pre-allocate up-front whenever possible 2016-06-09 16:06:27 +02:00
Patrick Niklaus 1c140a112a Make sure we also reserve space for destination and pronunciation 2016-06-08 10:58:11 +02:00
Moritz Kobitzsch 312e86eb58 handle merge on collapsed instructions 2016-06-06 11:55:14 +02:00
Moritz Kobitzsch 1dfdb38d4a improve collapse-handling 2016-06-06 10:05:18 +02:00
Dane Springmeyer dfafe7dc5f Install clang-3.8 via mason binary 2016-06-04 12:15:29 +02:00
Dane Springmeyer 6ecc123d15 Fix various issues with pkg-config 2016-06-04 12:08:54 +02:00
Daniel J. Hofmann 6f322d2140 Silence multiline comment warning 2016-06-03 14:47:45 +02:00
Daniel J. Hofmann dfa762bccc Pronunciation.
Spelling is hard. Maybe this time. /cc @themarex @systemed
2016-06-02 16:35:21 +02:00
Daniel J. Hofmann 87f00d2c4c Restrict CMake version to 2.8.11+ for target_include_directories 2016-06-02 16:07:29 +02:00
Daniel J. Hofmann 6f94e0dfb8 Update the Changelog for v5.2.0-rc2 2016-06-02 15:22:56 +02:00
Daniel J. Hofmann ad70759f91 Revert "Handle small roundabouts, fixes #516."
This reverts commit 7641b12b08.

Conflicts:
	profiles/bicycle.lua
	profiles/car.lua
2016-06-02 15:08:24 +02:00
Daniel J. Hofmann 27c4e8ddd0 Revert "Adds tag to taginfo"
This reverts commit 14fdf861ca.
2016-06-02 15:00:50 +02:00
Daniel J. Hofmann 805d74b6ae Revert "Fixes roundabout spelling in existing cucumber test"
This reverts commit ef7b36da32.
2016-06-02 15:00:49 +02:00
Daniel J. Hofmann 4ad78309e2 Revert "Set speeds for mini roundabouts in car and bike profile"
This reverts commit a85f39c140.
2016-06-02 15:00:47 +02:00
Daniel J. Hofmann b78207ddd8 Revert "Add implied oneway cucumber tests for mini roundabouts"
This reverts commit bd707b0cfc.

Conflicts:
	features/bicycle/oneway.feature
	features/car/oneway.feature
2016-06-02 15:00:44 +02:00
Daniel J. Hofmann b6834da9a4 Revert "Test guidance instructions for entering and leaving mini roundabouts"
This reverts commit 9cdc9008aa.
2016-06-02 14:57:48 +02:00
Daniel J. Hofmann 801cc72691 Sync with Clang38 Format 2016-06-02 14:43:27 +02:00
Patrick Niklaus e198709643 Add documentation about nodes property 2016-06-02 14:28:33 +02:00
Patrick Niklaus ed8d5e0b0a Add missing semicolon 2016-06-02 14:27:25 +02:00
Lauren Budorick e8fb312703 Update OSM node IDs annotation cucumber code per d6de2ca71c 2016-06-02 14:27:25 +02:00
Lauren Budorick 058b8c3b31 Template vector 2016-06-02 14:27:25 +02:00
Lauren Budorick ae3ccb009e Formatting [ci skip] 2016-06-02 14:27:25 +02:00
Lauren Budorick 0c60a2aef8 Minor cleanups + comments 2016-06-02 14:27:25 +02:00
Lauren Budorick 44fdf86702 IT WORKS 2016-06-02 14:27:25 +02:00
Lauren Budorick 1659bbf7b1 Refining packed_vector.hpp
* Rename to std::vector-like APIs (push_back, at)
* Add size, reserve, capacity methods
2016-06-02 14:27:25 +02:00
Lauren Budorick 46b58fba83 Packed vector cleanups and unit test 2016-06-02 14:27:25 +02:00
Lauren Budorick 84da86ba4a Add packed vector sketch 2016-06-02 14:27:25 +02:00
Lauren Budorick 6777127497 Add cucumber tests for node IDs 2016-06-02 14:27:25 +02:00
Lauren Budorick a4ac07866a Recreate feature/expose_node_ids 2016-06-02 14:27:25 +02:00
Daniel J. Hofmann 448f8377fb Sync with Clang38 Format 2016-06-02 13:14:33 +02:00
Daniel J. Hofmann c490752ca7 highway=motorway_link does not imply oneway, fixes #1662
References:
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway_link#Tagging_oneway
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway_link
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway
2016-06-02 13:05:50 +02:00
Daniel J. Hofmann 6edc565c01 Add destinations API feature 2016-06-02 12:00:23 +02:00
Daniel J. Hofmann bb0c2754d3 With empty summaries no longer the case, update library tests accordingly 2016-06-02 00:26:04 +02:00
Moritz Kobitzsch 58d6e8f4d0 handle short summaries correctly 2016-06-02 00:26:04 +02:00
Moritz Kobitzsch bdc66049a5 fix INVALID_NAME_ID vs INVALID_NAMEID -> EMPTY_NAMEID 2016-06-01 23:19:26 +02:00
Patrick Niklaus 0a53775fb3 Expose pronunciation in RouteStep
Uses name:pronunciation by default for cars.
2016-06-01 23:17:57 +02:00
Daniel J. Hofmann 9cdc9008aa Test guidance instructions for entering and leaving mini roundabouts 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann bd707b0cfc Add implied oneway cucumber tests for mini roundabouts 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann a85f39c140 Set speeds for mini roundabouts in car and bike profile 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann ef7b36da32 Fixes roundabout spelling in existing cucumber test 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann 14fdf861ca Adds tag to taginfo 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann 7641b12b08 Handle small roundabouts, fixes #516.
This gives us ~51k additional roundabout instructions.
Guidance handes sizes internally.

Note: it is highway=mini_roundabout but junction=roundabout

References:
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmini_roundabout
- http://wiki.openstreetmap.org/wiki/Tag:junction=roundabout
- http://taginfo.openstreetmap.org/tags/highway=mini_roundabout
2016-06-01 20:17:48 +02:00
Daniel J. Hofmann e7159adf59 Switching off any LLVM APT references as servers are no longer available
References:
- http://lists.llvm.org/pipermail/llvm-foundation/2016-June/000025.html
2016-06-01 20:04:52 +02:00
Daniel J. Hofmann 51f08f2994 Let's still show the badge although we dropped support for Windows
This reverts commit a03eac8e48.
2016-06-01 19:22:31 +02:00
Daniel J. Hofmann a03eac8e48 Remove Windows Build Badge from Readme 2016-06-01 15:37:16 +02:00
Daniel J. Hofmann 503137221d Let osrm-routed log status code, fixes #512.
Disclaimer: osrm-routed is not recommended for production usage.
Use node-osrm instead: https://github.com/Project-OSRM/node-osrm
2016-05-31 14:44:50 +02:00
Patrick Niklaus fb9205bf81 Merge pull request #2476 from oxidase/refactor/2472
Refactor ramIndex #2472
2016-05-31 03:00:47 -04:00
Michael Krasnyk bfbb313088 Conditional hashing of osrm libraries 2016-05-29 07:39:49 +02:00
Michael Krasnyk 25d3c4b843 Updated change log and adjusted format 2016-05-29 07:39:49 +02:00
Michael Krasnyk 371c06d66d Change size of QueryCandidate from 32 to 24 bytes 2016-05-29 07:39:49 +02:00
Michael Krasnyk 3e5c978719 Reduce ramIndex file size
PR #2472: the bottom-most node of the r-tree contains
only a single index to a leaf node, so out of 532 bytes
only 4 are used.
2016-05-29 07:39:49 +02:00
Michael Krasnyk 843f1a6356 Set LeafNode alignment to LEAF_PAGE_SIZE bytes
References:
- https://github.com/Project-OSRM/osrm-backend/pull/2348#issuecomment-219804408
- http://stackoverflow.com/questions/15523537/alignas-specifier-vs-attribute-aligned-c11
- http://stackoverflow.com/questions/7895869/cross-platform-alignx-macro
2016-05-29 07:39:49 +02:00
Dane Springmeyer a5c5faa21d drop support for using DYLD_LIBRARY_PATH on OS X 2016-05-29 06:01:16 +02:00
Patrick Niklaus 6a1e17c6fa Print TBB version in FindTBB 2016-05-29 00:06:45 +02:00
Patrick Niklaus cd30f370b8 Remove the use of atomics and use thread-local accumulation instead 2016-05-29 00:06:18 +02:00
Dane Springmeyer 4ae8abe6a3 run clang-format [skip ci] 2016-05-27 22:35:17 +02:00
Dane Springmeyer 82bfd4ee40 fix compile with clang-3.5 2016-05-27 22:35:17 +02:00
Patrick Niklaus e08c4cff13 Make PRs fail if they don't adhere to our style format 2016-05-27 21:05:43 +02:00
Patrick Niklaus 6e16eab6ec Format with clang-format 3.8 2016-05-27 21:05:04 +02:00
Patrick Niklaus 21c47514da Update clang-format to 3.8 2016-05-27 17:45:00 +02:00
Patrick Niklaus d6de2ca71c Really place annotations in RouteLeg and not Route 2016-05-27 16:46:28 +02:00
Dane Springmeyer 451a0d9090 try caching test data on travis 2016-05-27 00:40:49 +02:00
Patrick Niklaus 262354f733 Rename annotate to annotations 2016-05-26 23:35:11 +02:00
Daniel J. Hofmann 498370330d String bulk insertion 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann 6865853776 Not everything is a NodeID! 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann 1418c0dbbc Move ExtractionWays and ExtractionNodes into container to avoid copying 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann bbc79dd49f ExtractionContainers already owns its data 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann 8036320d94 Do not bind primitives per ref 2016-05-26 22:50:17 +02:00
Patrick Niklaus c30f69d6e9 Fix breaking test uncovered by this fix 2016-05-26 22:34:39 +02:00
Patrick Niklaus 2e2f34f241 Fix retry code launch classes 2016-05-26 22:34:39 +02:00
Lauren Budorick cbbeef5c46 Prune unnecessary cucumber code 2016-05-26 22:34:39 +02:00
Moritz Kobitzsch 823ee54f22 add turn restrictions to test-cases 2016-05-26 21:31:04 +02:00
Daniel Patterson 3d03797e53 Distinguish between offramps and sliproads. 2016-05-26 21:31:04 +02:00
Patrick Niklaus 089e60fa1e Remove obsolete timer code 2016-05-26 20:25:33 +02:00
Patrick Niklaus baf8e4784b Transfer match benchmark to own binary 2016-05-26 20:25:33 +02:00
Moritz Kobitzsch d53350b263 be more verbose on broken configs 2016-05-26 20:04:24 +02:00
Patrick Niklaus 824afdceca use 5 seconds as cucumber timeout 2016-05-26 20:02:21 +02:00
Patrick Niklaus a8230e976f Merge pull request #2454 from oxidase/reset-force-flags
Remove force flags and update extract/contract hashes with arguments
2016-05-26 13:16:29 -04:00
Michael Krasnyk 6af7e6866c Sort file extensions in rename lists 2016-05-26 17:05:11 +02:00
Michael Krasnyk aaa27333ba Remove force flags and update extractor/contractor hashes
with command line arguments and argument files data.
2016-05-26 16:36:26 +02:00
Moritz Kobitzsch 797f2a196b handle intersection-access for roundabout correctly 2016-05-26 16:25:26 +02:00
Moritz Kobitzsch 51066ff18f fix options in step-definitions 2016-05-26 15:38:55 +02:00
Dane Springmeyer 4de64a92cb fix zlib linking order 2016-05-25 09:32:27 -04:00
Freenerd a21fd2ea18 Contractor: log stats for loaded speed files 2016-05-24 14:35:16 -04:00
Patrick Niklaus 0df0b4305d Merge pull request #2453 from Project-OSRM/cmake-from-mason
[Travis] Install cmake from more reliable s3 endpoint
2016-05-24 14:32:45 -04:00
Dane Springmeyer a5ed53e7aa install cmake from mason / simplify install 2016-05-24 13:35:13 -04:00
Daniel Patterson 0587c5f5c4 Trim datasource names before writing to datafile. 2016-05-24 15:20:14 +02:00
Patrick Niklaus 57dbb18c4c Merge pull request #2451 from Project-OSRM/disable-osx-spotlight
[Travis] Disable spotlight indexing on osx to speed up 'npm test'
2016-05-24 09:10:35 -04:00
Dane Springmeyer 4d92f08424 disable spotlight indexing on osx to speed up 'npm test' 2016-05-23 19:35:22 -04:00
Patrick Niklaus 254ee07942 Add new sanity check assertions to UnpackPath 2016-05-23 23:15:15 +02:00
Patrick Niklaus 0bf8bd2230 Remove invalid assertion.
This ports the matching change from RoutingBase.
2016-05-23 23:15:15 +02:00
Michael Krasnyk b5225f07cb Fix #2413 by converting enums to unsigned char constants 2016-05-23 18:33:24 +02:00
Moritz Kobitzsch abed7690d0 fix continue on obvious 2016-05-23 17:55:30 +02:00
Patrick Niklaus f96174ddbe Merge pull request #2428 from zimathias/disable-access-logging-option
Disable access logging option
2016-05-23 10:12:42 -04:00
Mathias Gug e5b713841a Fix style. 2016-05-20 12:47:47 -07:00
Mathias Gug 3b1b12069f Add changelog entry. 2016-05-20 12:47:47 -07:00
Mathias Gug 1635f7351d Support environment variable to disable http requests logging. 2016-05-20 12:47:47 -07:00
Daniel J. Hofmann ce5ae411c1 Resurrect Flat Map + Binary Search commit from PR 2412 2016-05-20 20:43:45 +02:00
Patrick Niklaus d1bc32fb31 Add comments and debug code 2016-05-20 18:52:29 +02:00
Patrick Niklaus f9f87f25d4 Use elogate() to fixup geometry when merging steps, fixes #2424 2016-05-20 18:52:29 +02:00
Patrick Niklaus 89aa6b7881 Add regression test for #2424 2016-05-20 18:52:29 +02:00
Patrick Niklaus edf9e0c1ed [skip ci] Update changelog and OSRM version 2016-05-20 18:52:00 +02:00
Dane Springmeyer c2e520ad9d Fix linking of osrm-example to boost_iostreams
Fixes linking error seen on OS X:

```
[ 50%] Linking CXX executable osrm-example
/Users/dane/.homebrew/Cellar/cmake/3.5.0/bin/cmake -E cmake_link_script CMakeFiles/osrm-example.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++    -std=c++11  -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/osrm-example.dir/example.cpp.o  -o osrm-example  /Users/dane/projects/osrm-backend/here/lib/libOSRM.a /Users/dane/.homebrew/lib/libboost_filesystem-mt.dylib /Users/dane/.homebrew/lib/libboost_system-mt.dylib /Users/dane/.homebrew/lib/libboost_thread-mt.dylib /Users/dane/.homebrew/lib/libboost_chrono-mt.dylib /Users/dane/.homebrew/lib/libboost_date_time-mt.dylib /Users/dane/.homebrew/lib/libboost_atomic-mt.dylib 
undef: __ZN5boost9iostreams18mapped_file_source9open_implERKNS0_24basic_mapped_file_paramsINS0_6detail4pathEEE
undef: __ZN5boost9iostreams18mapped_file_sourceC1Ev
undef: __ZNK5boost9iostreams18mapped_file_source4sizeEv
undef: __ZNK5boost9iostreams18mapped_file_source4dataEv
Undefined symbols for architecture x86_64:
  "boost::iostreams::mapped_file_source::open_impl(boost::iostreams::basic_mapped_file_params<boost::iostreams::detail::path> const&)", referenced from:
      void boost::iostreams::mapped_file_source::open<boost::filesystem::path>(boost::filesystem::path const&, unsigned long, long) in libOSRM.a(engine.cpp.o)
  "boost::iostreams::mapped_file_source::mapped_file_source()", referenced from:
      osrm::engine::datafacade::SharedDataFacade::CheckAndReloadFacade() in libOSRM.a(engine.cpp.o)
      osrm::engine::datafacade::InternalDataFacade::InternalDataFacade(osrm::storage::StorageConfig const&) in libOSRM.a(engine.cpp.o)
  "boost::iostreams::mapped_file_source::size() const", referenced from:
      osrm::engine::datafacade::SharedDataFacade::CheckAndReloadFacade() in libOSRM.a(engine.cpp.o)
      osrm::engine::datafacade::InternalDataFacade::InternalDataFacade(osrm::storage::StorageConfig const&) in libOSRM.a(engine.cpp.o)
  "boost::iostreams::mapped_file_source::data() const", referenced from:
      osrm::engine::datafacade::SharedDataFacade::CheckAndReloadFacade() in libOSRM.a(engine.cpp.o)
      osrm::engine::datafacade::InternalDataFacade::InternalDataFacade(osrm::storage::StorageConfig const&) in libOSRM.a(engine.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2016-05-20 16:04:18 +02:00
Dane Springmeyer 7649187095 workaround boostorg/numeric_conversion#4 2016-05-20 16:03:19 +02:00
Dane Springmeyer fe39d0fd10 disable BOOST_TEST_DYN_LINK if Boost_USE_STATIC_LIBS 2016-05-20 00:03:37 -04:00
Patrick Niklaus 98b83b7208 Fix library test 2016-05-19 16:44:31 +02:00
Patrick Niklaus 57321979ae Remove leftover debugging code 2016-05-19 16:44:31 +02:00
Patrick Niklaus e3ce0c5887 Add fuzzy matching for bearings and intersections list 2016-05-19 16:44:31 +02:00
Patrick Niklaus 95af72c70c Make intersection backwards compatible
For `depart` and `arrive` `step.intersections[0].{bearings|entry}` will have
only one entry.
2016-05-19 16:44:31 +02:00
Patrick Niklaus 3b37769624 Use bearing_before and bearing_after in the bearings field 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch d150df1c5c format 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch a322e27e05 update changelog/docs 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch 98fe0badbe fix loading in storage 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch 44b841a25d fix storage 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch 9c8bf820de adjusted to in/out. only emit one of them for depart/arrive 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch 4d9aa65e78 intersection classes with variable degree of discretization 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch 0f3942558f version using discrete values stored directly at intersection 2016-05-19 16:43:46 +02:00
Moritz Kobitzsch ba074b0116 initial version of intersection classification 2016-05-19 16:43:46 +02:00
Daniel J. Hofmann 6aa97048df Rip out custom CSV parser code and its third_party dependency 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann d9a5c79ea6 Map leaf nodes to RAM and iterate over them potentially in parallel 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann 9d7714c714 Make looping through all leaf nodes less confusing 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann 8291be375a Expose concurrency in saving files 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann 0a73737f69 Fold parsing and data loading in concurrently executing action 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann 2fd1b6c913 Expose concurrency between intern/external node map and geometries 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann ea38a1d880 Parse multiple files concurrently 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann f576e13c51 Concurrent lookup hashtables 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann ee7bb8731a Expose concurrency between segment speeds and turn penalties 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann da0c3ff394 Refactor edge weight parsing code 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann 6ae559b42b Throw error if edge based graph file could not be loaded 2016-05-19 00:01:54 +02:00
Mathias Gug 95ca6ebdaa Update CHANGELOG entry. 2016-05-18 23:59:52 +02:00
Mathias Gug 0d6964d9c8 Add CHANGELOG entry. 2016-05-18 23:59:52 +02:00
Mathias Gug ba386d4b2c Document environment variable. 2016-05-18 23:59:52 +02:00
Mathias Gug b5ffb51e18 Signal the parent process when we're ready to serve requests.
This can be used for a hot reload of the process binary. The supervising
process can be told when the new process is ready to serve requests.
2016-05-18 23:59:52 +02:00
Moritz Kobitzsch a9f674497a emit turn-straight for obvious turns where the main road continues 2016-05-18 19:54:53 +02:00
Patrick Niklaus 1e8a92ccb4 Add changelog entry 2016-05-18 19:16:44 +02:00
Mathias Gug b9178bb8c7 Fix build on windows. 2016-05-18 19:13:18 +02:00
Mathias Gug 520b29d0d5 Use const for option. Include proper header files. 2016-05-18 19:13:18 +02:00
Mathias Gug fe397e6953 Support SO_REUSEPORT option
so that multiple osrm-routed processes can bind to the same port.
2016-05-18 19:13:18 +02:00
Patrick Niklaus dcb741d827 Merge pull request #2403 from oxidase/refactor/duration-parser
Refactoring of iso_8601_grammar
2016-05-17 12:26:28 -04:00
Michael Krasnyk 508c205d35 Refactoring of iso_8601_grammar
* formats 'hh:mm:ss' and ISO 8601 are merged into one grammar.
* iso_8601_grammar is changed to static const.
* iso_8601_grammar supports formats P[n]DT[n]H[n]M[n]S, P[n]W,
  and part of alternative PTHHMMSS and extended PTHH:MM:SS formats.
2016-05-17 00:39:32 +02:00
Daniel J. Hofmann d5294bb5d0 Silences warnings when running npm test 2016-05-16 14:43:54 -04:00
Patrick Niklaus 6ed9be31ca Merge pull request #2408 from oxidase/master
Remove latitude rounding in yToLat
2016-05-16 17:04:49 +02:00
Michael Krasnyk 3bbd3a8a65 Remove latitude rounding in yToLat 2016-05-16 00:53:33 +02:00
Daniel Patterson 73a608895a Merge pull request #2402 from Project-OSRM/fix_docker
Remove Ruby from docker setup, use Node.
2016-05-13 13:38:10 -07:00
Daniel Patterson 96c73baeb3 Remove Ruby from docker setup, use Node. 2016-05-13 12:32:36 -07:00
Patrick Niklaus 73113f5eb8 Fix codecov.yml 2016-05-12 17:56:40 +02:00
Patrick Niklaus 7b74b86891 Add codecov file 2016-05-12 01:17:16 +02:00
Daniel Patterson 0903b8227f Example of the annotation response value. 2016-05-12 01:11:09 +02:00
Daniel Patterson fa525ad610 Return an array with meta-data for each coordinate.
Currently supports duration and distance for each coordinate.

This is particularly useful in map-matching, comparing how
a trip progresses compared to a real GPS trace that is
map-matched.
2016-05-12 01:11:09 +02:00
Daniel J. Hofmann 0f2bb5dde5 Disable builing components tool by default until GDAL 2 compatibility #1738 lands 2016-05-12 00:25:18 +02:00
Patrick Niklaus 84dc1b6845 [skip ci] Use codecov badge 2016-05-11 22:45:07 +02:00
Patrick Niklaus 4ce1a37772 Limit osrm-extact to 3 jobs because OOM 2016-05-11 22:43:26 +02:00
Patrick Niklaus 8dd4cc5c40 Integrate codecov 2016-05-11 22:43:18 +02:00
Patrick Niklaus 6aed145dae [skip ci] Rephrased the API docs in terms of adding new types 2016-05-09 18:39:30 +02:00
Patrick Niklaus d15cc77b0b Merge pull request #2386 from oxidase/rtree-optimize-addition
Missing two commits in StaticRTree changes
2016-05-08 14:20:59 +02:00
Michael Krasnyk 24a75d37fb Approximate inverse Gudermannian function by a Padé approximant 2016-05-08 06:00:21 +02:00
Michael Krasnyk 7e80dae59b Fix MSVS build. 2016-05-08 06:00:21 +02:00
Patrick Niklaus 7316c48e9f Changelog entry for StaticRTree changes 2016-05-07 23:52:11 +02:00
Patrick Niklaus c520c7a24a Fix rtree benchmark 2016-05-07 23:52:11 +02:00
Patrick Niklaus 7564633045 Update SearchInBox to not copy TreeNode 2016-05-07 23:52:11 +02:00
Patrick Niklaus 7174c5d036 Make StaticRTree and facades const 2016-05-07 23:52:11 +02:00
Patrick Niklaus ddd128ce0e Only use const-ref for coordinate vector 2016-05-07 23:52:11 +02:00
Patrick Niklaus f5aa5c0769 Don't wrap StaticRTree in thread-specfic ptr 2016-05-07 23:52:11 +02:00
Michael Krasnyk 2acde49f0f Make LeafNode aligned to memory pages.
Changes:
* LeafNode is aligned to LEAF_PAGE_SIZE.
  Alignment brings 24 bytes memory overhead for 4096, but reduces
  cache misses rate.
* Unused m_element_count from leaf nodes file.
  The size is computed as m_leaves_region.size() / LEAF_PAGE_SIZE.
* Added try/catch for mmap exceptions messages.
2016-05-07 23:52:11 +02:00
Michael Krasnyk 8849015bbf Fix construct_multiple_levels_test
candidate_cache is removed because of failing test
make util-tests && ./unit_tests/util-tests --run_test=*/construct_multiple_levels_test
first bad commit: [9692be6f50] Add cache for CandidateSegments to reduce heap worke even more

Now SegmentIndex contains leaf index, object index and fixed_projected_coordinate
2016-05-07 23:52:11 +02:00
Michael Krasnyk 70cd7a94ec Fix memory mapping "Invalid argument" exception. 2016-05-07 23:52:11 +02:00
Patrick Niklaus 3984dea34b Use mmap in StaticRTree 2016-05-07 23:52:11 +02:00
Patrick Niklaus b11b471aa4 Move LoadLeafFromDisk to return by value 2016-05-07 23:52:11 +02:00
Patrick Niklaus 63754df4d4 Add cache for CandidateSegments to reduce heap worke even more 2016-05-07 23:52:11 +02:00
Patrick Niklaus e644424508 Only save TreeNode index in search tree x3 speedup 2016-05-07 23:52:11 +02:00
Patrick Niklaus 4f6eef3d16 Merge pull request #2376 from oxidase/fix/addition-to-2356
Addition to fix #2356
2016-05-07 12:47:28 +02:00
Michael Krasnyk e2e8104864 Addition to fix #2356
Updated unit tests for the Hint parser and
added emplacement of empty hints.
2016-05-07 09:47:32 +02:00
Patrick Niklaus 96127c289c Set OSX timeout to a minute 2016-05-06 10:36:40 +02:00
Patrick Niklaus cfed65f7ea Double timeout again 2016-05-05 21:07:38 +02:00
Patrick Niklaus c2263fec9b One TIMEOUT to rule them all 2016-05-05 18:36:30 +02:00
Patrick Niklaus 497720d060 Bump timeout and lower jobs on OSX 2016-05-05 17:12:22 +02:00
Patrick Niklaus 238366e71f Merge pull request #2373 from oxidase/master
Fix #2362 by using generic path strings
2016-05-05 15:57:51 +02:00
Michael Krasnyk 2c8cf26e74 Fix build break in MSVC
fatal error C1189: #error:  "This header can't be used in operating systems without XSI (System V) shared memory support"
2016-05-05 13:24:27 +02:00
Michael Krasnyk c87ae5612a Fix #2362 by using generic path strings
In windows native strings in Lua incorrectly
interpreted because native separators must be escaped.
Use of generic strings prevent use of backslashes and
"Generic paths are portable and independent of the operating system.".
2016-05-05 12:10:45 +02:00
Patrick Niklaus a2d83753bc Install ccmake on OSX 2016-05-05 11:39:15 +02:00
Patrick Niklaus eedf75d951 Correct path to test data 2016-05-04 20:44:05 +02:00
Patrick Niklaus 3f51a1ae2e Run tests from build directory 2016-05-04 19:46:27 +02:00
Patrick Niklaus a000f80705 [skip ci] Use 3 jobs on travis to utilize cores better 2016-05-04 19:39:52 +02:00
Patrick Niklaus 7030bff7f7 Fix typo in compiler name 2016-05-04 19:24:13 +02:00
Patrick Niklaus bb0b7fd2d1 Modify compiler name for ccache key 2016-05-04 19:22:43 +02:00
Patrick Niklaus 71e1f3679e Restructure travis run 2016-05-04 19:12:07 +02:00
Patrick Niklaus b33517b099 Remove pip from dependencies 2016-05-04 18:55:29 +02:00
Patrick Niklaus f3d5336892 Lint .travis.yml 2016-05-04 18:46:08 +02:00
Patrick Niklaus d81f25d54e Enable ccache compression 2016-05-04 18:42:47 +02:00
Patrick Niklaus 44ebdfeb2d [skip ci] Update changelog 2016-05-04 18:05:37 +02:00
Daniel J. Hofmann a5a7a03fa0 Cucumber test for destination:ref and no destination=* 2016-05-04 15:28:34 +02:00
Daniel J. Hofmann 363d2145bd Register a way's .nodes() function for use in the profile's way_function.
Can be used as in:

    function way_function(way, result)
      for node in way:get_nodes() do
        local id = node:id()
        io.write(">>> " .. id .. "\n")
      end

      -- ...
    end

Warning: we do not use libosmium's location cache, therefore .location()
on the nodes will crash at runtime. Once we switch to using libosmium's
cache this should work. Until then, you can use the node id now.
2016-05-04 15:28:34 +02:00
Daniel J. Hofmann c7e19396a4 Guard against mis-tagging: only use destination tag in combination with oneway tag 2016-05-04 15:28:34 +02:00
Daniel J. Hofmann 445e5bed49 Respect ';'-separated list in destination:ref tag 2016-05-04 15:28:34 +02:00
Daniel J. Hofmann 4cf94319df Basic destination sign handling.
This first part in our Exit Sign / Destination Sign quest re-wires
the `destination=` and `destination:ref=` tag to the `ref=` tag (in case
it's the highway does not already have a `ref=` tag).

Doing some analysis on both Berlin and San Francisco it looks like this
will add a couple of thousand `ref=` tags that we will announce in guidance.

References:
- https://github.com/Project-OSRM/osrm-backend/issues/2267#issuecomment-214771682
- http://wiki.openstreetmap.org/wiki/Key:destination
- http://wiki.openstreetmap.org/wiki/Proposed_features/Destination_details
2016-05-04 15:28:34 +02:00
Patrick Niklaus 1bb88b374e Make hint values optional, fixes issue 2356 2016-05-04 15:24:48 +02:00
Patrick Niklaus 35fac07581 Add failing test for empty hint 2016-05-04 15:24:48 +02:00
Patrick Niklaus 9287475b2a ccache needs language: cpp 2016-05-04 15:09:02 +02:00
Patrick Niklaus b4976f89f2 APT seems slow, try explicitly enabling 2016-05-04 14:27:44 +02:00
Patrick Niklaus 93c8674a40 Disable coverage builds since coveralls is broken 2016-05-04 14:02:11 +02:00
Moritz Kobitzsch d5f21fd13a fix test-case 2016-05-04 14:00:34 +02:00
Patrick Niklaus 04eef0463a Fix the second test that breaks because of phantom node 2016-05-04 14:00:34 +02:00
Patrick Niklaus 82c3bc7b0e Adapt tests to desired behaviour 2016-05-04 14:00:34 +02:00
Patrick Niklaus 1d33cb96f5 Fix missing semicolon in cucumber support code 2016-05-04 14:00:34 +02:00
Moritz Kobitzsch 648646068c additional testcase on what I would expect 2016-05-04 14:00:34 +02:00
Daniel Patterson f251f93a11 Fix summary generation when empty strings are present.
Also corrects step ordering when steps have equal durations.
2016-05-04 14:00:34 +02:00
Patrick Niklaus aab1aad8f4 Enable ccache 2016-05-04 13:54:04 +02:00
Patrick Niklaus 65a6dc704e Disable all release builds but one 2016-05-04 13:41:55 +02:00
Moritz Kobitzsch 6018fcf490 Introduce on_ramp and off_ramp, deprecate ramp 2016-05-04 12:09:54 +02:00
Moritz Kobitzsch 1e6888c0d3 fix new-name on empty strings 2016-05-04 10:52:55 +02:00
Patrick Niklaus c7303be33b [skip ci] Add specifics about how we interpret semver 2016-05-03 23:36:27 +02:00
Lauren Budorick d8acf76f2d Fix wrong assertion size in CompressedEdgeContainer::GetLastEdgeSourceID 2016-05-03 21:50:27 +02:00
Moritz Kobitzsch 08248e3853 fix 2349 2016-05-03 21:14:31 +02:00
Moritz Kobitzsch 78acc6f215 fix search with u-turn 2016-05-03 21:13:22 +02:00
Patrick Niklaus a4f1dc536d Trip plugin does not have a continue_straight parameter, use false 2016-05-03 21:13:22 +02:00
jperaltamalvar 57a30dd375 Remove more typename
Needed to compile con Windows
2016-05-03 16:00:44 +02:00
Daniel J. Hofmann 5517ee334f Remove typename prefix from non-dependent type alias
I think VS is predantic but actually right here.

References:
- http://eel.is/c++draft/namespace.udecl#19
2016-05-03 12:00:40 +02:00
Daniel J. Hofmann 30af544919 Changelog for street name assembly 2016-05-03 00:09:17 +02:00
Daniel J. Hofmann f0069d3dcc Makes bicycle and foot profile's name and ref tag handling consistent with car profile 2016-05-03 00:09:17 +02:00
Patrick Niklaus 206bdff9e7 Inline and vectorize haversine for GetPathDistance 2016-05-02 19:53:42 +02:00
Patrick Niklaus c32270b2b8 Make projectOnLine inline-able 2016-05-02 19:53:05 +02:00
Patrick Niklaus cc03402570 Use pass-by-copy for Coordinate 2016-05-02 19:51:32 +02:00
Patrick Niklaus 21a76f1867 Move coordinate constructors to header to enable inlining 2016-05-02 19:50:52 +02:00
Patrick Niklaus 212ad94c90 x2 speedup in Douglas Peucker by projecting all coordinates first 2016-05-02 19:50:33 +02:00
Patrick Niklaus 378d9f4112 Remove debug ouput from post-processing 2016-05-02 19:47:59 +02:00
Patrick Niklaus e341d367d8 Move detail:: to osrm::detail:: 2016-05-02 18:36:32 +02:00
Daniel J. Hofmann 98937b187f We require Visual Studio 2015+
References:
- https://github.com/Project-OSRM/osrm-backend/issues/2341#issuecomment-216231618
2016-05-02 17:50:54 +02:00
Moritz Kobitzsch 59168e21b4 remove unnecessary warnings, initialize correctly 2016-05-02 17:29:37 +02:00
Patrick Niklaus d12a95b4ef Fix naming convention of Percent 2016-05-02 17:25:58 +02:00
Patrick Niklaus 83482afa02 Fix naming conventions of TrajanSCC 2016-05-02 17:25:58 +02:00
Patrick Niklaus e470d1ae1c Fix naming convention in RasterSource 2016-05-02 17:25:58 +02:00
Patrick Niklaus e504128587 Fix naming convention in HiddenMarkovModell 2016-05-02 17:25:58 +02:00
Patrick Niklaus 1ab6c07bad Fix naming convention in BayesClassifier 2016-05-02 17:25:58 +02:00
Patrick Niklaus 5ce465ce23 Remove extra ; in PostProcessing 2016-05-02 17:25:58 +02:00
Patrick Niklaus a8b730576f Fix naming convention in GeospatialQuery 2016-05-02 17:25:58 +02:00
Patrick Niklaus b796033473 Clean up naming conventions in CRC32 code 2016-05-02 17:25:58 +02:00
Patrick Niklaus d078ed67ca Fix naming convention in GraphContractor 2016-05-02 17:25:58 +02:00
Lauren Budorick 346146d834 Address comments from b89164c14e (#2346) 2016-05-02 08:00:27 -07:00
Patrick Niklaus 64307ea882 Add missing headers and remove dead code 2016-04-29 20:02:08 +02:00
Patrick Niklaus 578eda7d28 [skip ci] Add release docs 2016-04-29 14:00:10 +02:00
Patrick Niklaus 505f4cb4a2 [skip ci] Add profile documentation 2016-04-29 13:10:43 +02:00
Patrick Niklaus bac6b729bf Overhault the README 2016-04-29 13:00:27 +02:00
Patrick Niklaus d3a5cadb6c [skip ci] Fix linkt to C++ library 2016-04-29 12:26:04 +02:00
Patrick Niklaus 65351faf83 [skip ci] Move correct docs. 2016-04-29 12:24:21 +02:00
Patrick Niklaus 3aa1c5f13c Link docs from README 2016-04-29 12:20:51 +02:00
Patrick Niklaus 8f3fe410b8 Import docs from the wiki 2016-04-29 12:16:19 +02:00
Patrick Niklaus ff3bf32b11 Merge pull request #2342 from Project-OSRM/publish-win-binaries
make AppVeyor publish binaries again
2016-04-29 11:16:27 +02:00
bergwerkgis 38cb01a30e [skip travis] make AppVeyor publish binaries again 2016-04-29 10:32:29 +02:00
Lauren Budorick b8f7569e93 Implement arbitrary turn penalty file IO and integration (#2306)
Closes #1830
2016-04-29 00:48:13 -07:00
Moritz Kobitzsch cf17bd38eb Revert "Revert "switched to space separated suffix/prefix only"" 2016-04-28 14:59:17 +02:00
Patrick Niklaus 930f6df2cb Fixes #2335, map matching was using shortest path with uturns disabled 2016-04-28 12:02:31 +02:00
Patrick Niklaus e88106e990 Revert "switched to space separated suffix/prefix only"
This reverts commit e9e935303c.
2016-04-27 23:20:10 +02:00
Patrick Niklaus 21f64c75eb Merge pull request #2324 from oxidase/master
Fix syntax error position indicators in parameters queries
2016-04-27 23:15:16 +02:00
Michael Krasnyk 5186b9490d Fix syntax error position indicators in parameters queries
To fix #2193 prefix_length member variable has been added to ParsedURL
that is set to the length of "/service/version/profile/" prefix
when the prefix is accepted by the parser.
Also BOOST_FUSION_ADAPT_STRUCT for osrm::server::api::ParsedURL
has been moved from header to url_parser.cpp to speed up compilation
of CUs that do not use the fusion adaption.
2016-04-27 19:52:23 +02:00
Moritz Kobitzsch e9e935303c switched to space separated suffix/prefix only 2016-04-27 19:12:24 +02:00
Moritz Kobitzsch a154d71841 enable suppression name suffix changes 2016-04-27 18:10:56 +02:00
Moritz Kobitzsch fddb035539 suppress name additions (xxx -> xxxbridge) 2016-04-27 12:13:42 +02:00
Moritz Kobitzsch 1544a08ea2 introduce roundabout-turns into instruction set 2016-04-27 12:13:42 +02:00
Moritz Kobitzsch 8d68d4c050 fix copy-paste errors in guidance tests 2016-04-26 13:43:22 +02:00
Moritz Kobitzsch 62a1290043 remove invalid assertion 2016-04-26 13:16:44 +02:00
Moritz Kobitzsch c5e1742150 fix post-processing for local paths, fixes #2310 2016-04-26 13:15:46 +02:00
Moritz Kobitzsch 754bc2d274 handle combined turns at segregated roads 2016-04-26 13:13:20 +02:00
Moritz Kobitzsch 3ac061c546 fix guidance issues / improve tests 2016-04-26 10:34:39 +02:00
Moritz Kobitzsch e59a7926a2 roundabout for segregated entry roads 2016-04-26 01:01:09 +02:00
Moritz Kobitzsch be5b49e391 Fix local path looping, fixes #2309 2016-04-25 19:37:59 +02:00
Moritz Kobitzsch 7b32d3184c remove unused instruction types 2016-04-25 19:24:59 +02:00
Moritz Kobitzsch d770c35245 refactor guidance 2016-04-25 19:24:59 +02:00
Daniel J. Hofmann e04baef3bb Do not copy geometries in loop 2016-04-25 12:12:32 +02:00
Patrick Niklaus 9d3ad22bc7 Fix path to monaco data 2016-04-25 00:46:36 +02:00
Patrick Niklaus cc35d15b2d More folds and reorder some build instructions 2016-04-25 00:19:48 +02:00
Patrick Niklaus 15e3928906 Merge pull request #2312 from oxidase/stateless-parameters-grammars
Stateless parameters grammars and fix for PhantomNode bitfields packing in MSVC
2016-04-24 23:45:51 +02:00
Michael Krasnyk 4363fd64c4 Fix for PhantomNode packing in MSVC
Changed bool to uint32_t in bit fields to have 4-byte packings for 32 bits:
"c++ compilers will allocate bit-fields in memory as follows:
several consecutive bit-field members of the same type will
be allocated sequentially. As soon as a new type needs to be allocated,
it will be aligned with the beginning of the next logical memory block."

References:
- https://msdn.microsoft.com/en-us/library/ewwyfdbe.aspx
- http://stackoverflow.com/questions/308364/c-bitfield-packing-with-bools/308383#308383
2016-04-24 14:06:48 +02:00
Michael Krasnyk dac2f93383 Refactoring of parameter garammars
* signature changed from void() to void(engine::api::Parameters&)
* performance increase due to use "static const GrammarT" and avoid
  construction and destruction of grammars during parsing
* removed code duplication in inherited grammars
* rule unlimited changed to qi::lit
* added rule size_t_
* parser accepts "&geometries=" and "&overview=" and fails at "foo"
  instead of "&geometries=foo" and &overview=foo
* added expectations checks for derived grammars
* changed rules qi::list(".") to character rules '.'
2016-04-23 21:15:21 +02:00
Patrick Niklaus 82372bb2ab Remove develop branch from appveyor 2016-04-23 17:55:18 +02:00
Patrick Niklaus b0c67c9019 Update coverall badge 2016-04-23 14:19:58 +02:00
Patrick Niklaus d83a34f72b Remove develop branch from travis 2016-04-22 14:51:38 +02:00
Patrick Niklaus a16f156203 Update README to remove develop branch 2016-04-22 14:49:27 +02:00
Patrick Niklaus 807aa71a7c Merge branch 'develop' 2016-04-22 14:35:32 +02:00
Patrick Niklaus 14d9b67b58 Update changelog with regard to 4.9.1 2016-04-22 14:28:45 +02:00
Patrick Niklaus 82df0ca766 Fix parser tests and destinations=all / sources=all 2016-04-22 11:01:15 +02:00
bergwerkgis a6c7529a4e AppVeyor: new path to test executables, add server-tests.exe 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann 202bb6d3e2 Fix accidental rebase issues 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann bc514926bf Unit test for trip across component boundaries.
Daniel's mental model, with updates from Patrick and staring at the code
(plugins/trip.cpp): Trip first snaps coordinates which in the case of
phantoms that are not only in small components with the same id
switches small components to big ones. Therefore we get either only
small or only big components. Only then the Tarjan SCC decomposes this.

Result: multiple subtrips only happen for islands or continents.
2016-04-22 10:40:03 +02:00
Daniel J. Hofmann 9fc16b6a83 Unit test for trip exclusively in big component 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann 2125e0175d Unit tests for special symbols in radiuses, sources, destination 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann 6b5982d389 Table unit test, revealing position_index -> waypoint_index mismatch 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann a4a8aa63d4 Invalid route requests 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann bedf451952 Namespace aliases 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann 93b8f1993c Split off parameters I/O from unit tests 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann c693f4806b Unit tests for routing / snapping across components 2016-04-22 10:40:03 +02:00
Patrick Niklaus b07275694a Add more guidance tests 2016-04-21 23:07:29 +02:00
Patrick Niklaus 82177c101b Add changelog entry for summary 2016-04-21 22:47:05 +02:00
Patrick Niklaus da6dbd2159 Revert "Removes summary from legs property"
This adds the summary back to the RouteLeg, it now depends on if
`steps=true`.
This reverts commit eaf9993dd9.
2016-04-21 22:39:16 +02:00
Patrick Niklaus b3957d87b4 Add changelog entry 2016-04-21 22:14:01 +02:00
Patrick Niklaus 5f9ccadd6c If geometry is only one point, encode as Point not as LineString 2016-04-20 20:49:54 +02:00
karenzshea 6e04da9f8f remove movable bridge refs in bike profile 2016-04-19 14:24:16 -04:00
karenzshea 58c13d2c07 remove movable bridge travel mode references 2016-04-19 12:59:33 -04:00
karenzshea bca8593eef remove movable bridge mode from car profile 2016-04-19 10:21:46 -04:00
Patrick Niklaus 3e2e10a4c3 Add unit test for tile plugin 2016-04-15 14:48:21 +02:00
Patrick Niklaus 6979763292 Refactor the vector tile constants 2016-04-15 14:48:21 +02:00
karenzshea 324f1739e4 more table tests, break waypoint obj check into header file 2016-04-15 14:46:17 +02:00
karenzshea 1489662f57 start tests for table plugin 2016-04-15 14:46:17 +02:00
Daniel Patterson 1c1f407f67 Fix formatting. 2016-04-14 14:39:20 -07:00
Daniel Patterson 8fb631417b Abort processing if there are no snappable edges remaining. 2016-04-14 13:07:23 -07:00
Moritz Kobitzsch ae45ad1ad2 fix r-tree abort location 2016-04-14 11:40:36 +02:00
Patrick Niklaus 6b89803534 Forgot to commit a test 2016-04-13 11:24:14 +02:00
Patrick Niklaus d01b34f501 Forgot changelog entry 2016-04-12 23:17:47 +02:00
Patrick Niklaus fcad2fa471 Update changelog 2016-04-12 23:16:02 +02:00
Patrick Niklaus 589767fe6d uturns -> continue_straight 2016-04-12 23:16:02 +02:00
Daniel J. Hofmann d6407e5095 Fixes regression introduced in 8ff8dc.
References:
- https://github.com/Project-OSRM/osrm-backend/pull/2252/commits/8ff8dc7200c0e1623b66ec950419be233ab37cc3
2016-04-12 21:12:08 +02:00
Patrick Niklaus 8ff8dc7200 Try ulong_long, requires ifdef 2016-04-12 18:11:08 +02:00
Patrick Niklaus 2f7b02c96f Fix std::min 2016-04-12 18:11:08 +02:00
Patrick Niklaus 669e2a767a Another missed irange 2016-04-12 18:11:08 +02:00
Patrick Niklaus 2b4f9feeab Forgot a irange fix 2016-04-12 18:11:08 +02:00
Patrick Niklaus 1554916639 Include <iterator> for back_inserter 2016-04-12 18:11:08 +02:00
Patrick Niklaus 32a3651231 Changed windows encoded size to 104 2016-04-12 18:11:08 +02:00
Patrick Niklaus dbd4ecf89b Remove boost::irange 2016-04-12 18:11:08 +02:00
Patrick Niklaus 7416653874 Force correct type deduction for irange on windows 2016-04-12 18:11:08 +02:00
Patrick Niklaus 621ed970da Fix assertions about hint size for windows 2016-04-12 18:11:08 +02:00
Patrick Niklaus 457ba9ac62 Adapt RC2 changelog 2016-04-12 17:15:16 +02:00
Patrick Niklaus f9da5f2c80 Fix coverall flags 2016-04-12 16:20:45 +02:00
Patrick Niklaus b6a793a1e2 Fix COVERAGE=ON and add SANITIZE=ON/OFF 2016-04-12 15:43:29 +02:00
Daniel J. Hofmann bf2ab3d8af One-Definition-Rule violation in viewport 2016-04-12 12:17:52 +02:00
Daniel J. Hofmann 02f75236cb Increase the Cucumber timeout, as we're hitting it on Travis.
Our OSX Travis builds seem to hit the 2s timeout from time to time,
which is really irritating.

This increases the timeout to 5s, hoping for the best.
2016-04-12 12:17:01 +02:00
Daniel J. Hofmann 5dff83c6e9 Report progress for gennerating edge expanded edges in the edge based graph factory 2016-04-12 12:16:14 +02:00
Daniel Patterson 43725bae89 Fix Radius Calculation for points collinear in latidue 2016-04-12 11:25:59 +02:00
Patrick Niklaus 59c12506cf Update taginfo 2016-04-11 09:38:54 +02:00
Daniel J. Hofmann be15a3b739 Add maxspeed=none tag to car profile.
maxspeed=none means there is no explicit maxspeed limit. Set to
guestimate for driving on the Autobahn.

References:

 - https://github.com/Project-OSRM/osrm-backend/issues/2145
 - http://wiki.openstreetmap.org/wiki/Key:maxspeed
 - http://taginfo.openstreetmap.org/tags/maxspeed=none
 - http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed
2016-04-11 09:38:45 +02:00
Patrick Niklaus 9f515dad09 Fix tests 2016-04-09 23:04:43 +02:00
Patrick Niklaus 5052c4ae3a Move projection function into own header and inline 2016-04-09 17:31:36 +02:00
Patrick Niklaus 9a617f5d41 Make the poly2req script work with 4.9 and 5.0 and add modes 2016-04-09 17:31:36 +02:00
Patrick Niklaus 4886d46d91 Use DouglasPeucker with squaredEuclideanDistance 2016-04-09 17:26:27 +02:00
Patrick Niklaus 67834def5f Switch to uint64 for distance measurements in StaticRTree 2016-04-09 17:26:27 +02:00
Patrick Niklaus c51ffeb65a Switch StaticRTree leaf size to 256 elements per leaf
This increses query performance dramatically for queries with a lot of
coordinates. However it increases the internal memory usage of the
StaticRTree also 4x.
2016-04-09 17:26:27 +02:00
Patrick Niklaus 68ee4eab61 Switch squaredEuclideanDistance to uint64_t 2016-04-09 01:38:22 +02:00
Patrick Niklaus fa6d4ac0bc Add faster version of WGS84 -> Web Mercator 2016-04-09 01:38:22 +02:00
Patrick Niklaus 3fa533d91e Okay include build again since it seems to contain the coverage files 2016-04-09 00:28:04 +02:00
Patrick Niklaus c0db144906 Exclude build and third_party 2016-04-09 00:07:19 +02:00
Patrick Niklaus ea2ec168b0 Cleanup .travis.yml and run coverall from root 2016-04-08 21:40:05 +02:00
Patrick Niklaus cb18c1a54d Adapt status cucumber tests 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 45bcb22270 Fixes unit tests that relied upon wrong behavior in parsers 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 2539fd53dc Enable unit test that should pass with fixes from this branch 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 8a2bd09fd0 Adapts all grammars to use expectation parsers without backtracking.
Sequence parsers using `>>` allow for backtracking, expectation parsers
`>` do not. This allows us to properly report the position where parsing
failed, by catching the expectation_failure exception and adapting the
iterator ourselves.

References:
- https://github.com/Project-OSRM/osrm-backend/pull/2188
- https://github.com/Project-OSRM/osrm-backend/issues/2168
- http://www.boost.org/doc/libs/1_55_0/libs/spirit/doc/html/spirit/qi/reference/operator/expect.html
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann def89ac079 Conform to v5 spec and support "unlimited" as radiuses value.
Supersedes: https://github.com/Project-OSRM/osrm-backend/pull/2231

Thanks to Michael Krasnyk (@oxidase) for figuring out the reason for the
segfault earlier:

> https://github.com/Project-OSRM/osrm-backend/pull/2231#issuecomment-207114226
2016-04-08 21:03:50 +02:00
Michael Krasnyk fe08726387 Fix BOOST_FUSION_ADAPT_STRUCT parameters for ParsedURL
Fix build error: macro "BOOST_FUSION_ADAPT_STRUCT" passed 5 arguments, but takes just 2
https://travis-ci.org/Project-OSRM/osrm-backend/builds/121406444
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 9bb4a68599 Fixes grammar includes and formats them 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 996a27dbd1 Report position where parsing failed; resolves #2168 2016-04-08 21:03:50 +02:00
Michael Krasnyk 58ebadd7b3 Fix #2173 with a no_trailing_dot_policy
no_trailing_dot_policy rejects parsing exp, exp_n, nan, inf
and rejects parsing a fractional part if detects ".Fmt".
For Fmt = 'j', 's', 'o', 'n':
 42.foo    rule parses 42.
 42.json   rule parses 42
 42..json  rule parses 42.

Reference:
- https://github.com/Project-OSRM/osrm-backend/pull/2222#issuecomment-206206239
2016-04-08 21:03:50 +02:00
Michael Krasnyk cae06ba2c1 Fix type "osrm::server::api::ParsedURL ()" 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 0274afa0f7 Allow 4.json and 4.3.json format; needs -lit(".") >> -lit("json") hack^Wworkaround
Rainer Deyke's workaround without the need to do ugly backtracking.

References:
- http://lists.boost.org/boost-users/2016/03/85960.php
- https://github.com/Project-OSRM/osrm-backend/issues/2173#issuecomment-204342785
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 221f70ac7b Synthesize parser only once from DSL: static storage duration 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann d3dbca374d Do not modify the end iterator for parameter parsing, too 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 6f0b6a8158 Re-factor URL parser: make grammar stateless 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann b25cd6aaf2 Moving from references is a bad idea in parameter parsers, too 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann d27025003a Do not move from references in grammar handlers 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 66eb90d9d0 Adapts move(*optional) to *move(optional) to get rvalue operator* overload 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 6a81a9d191 Extra semicolon 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 64cb134113 Align Spirit rules for URL parser 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann 891ff7dd80 Do not modify the end iterator, make const 2016-04-08 21:03:50 +02:00
Patrick Niklaus 6643e7f499 Integrate converage reporting 2016-04-08 20:37:51 +02:00
Moritz Kobitzsch fcbf527ba5 refactor of turn analysis into turn handlers 2016-04-08 18:14:43 +02:00
Moritz Kobitzsch dfd180a292 fixing unit tests 2016-04-08 11:21:14 +02:00
Moritz Kobitzsch fa0a5040e5 adding tests for guidance 2016-04-08 10:43:22 +02:00
Dane Springmeyer 56ba2cb251 Add missing -lz to fix linking of server-tests 2016-04-08 01:52:35 +02:00
Patrick Niklaus dea12779cf basename -> filename, fixes #2027 2016-04-08 01:50:25 +02:00
karenzshea 6033c05ff0 checks for waypoint index and route lengths 2016-04-07 22:11:28 +02:00
karenzshea 407da8bd15 start match test 2016-04-07 22:11:28 +02:00
Daniel J. Hofmann 43413ff980 Add license to storage and storage config exposed in public API, closes #2036 2016-04-07 10:41:32 +02:00
Moritz Kobitzsch 4d864b8267 fix warnings in compilation on clang 2016-04-06 18:44:42 +02:00
Daniel J. Hofmann a516245c94 Modularize benchmarks subproject 2016-04-06 18:36:08 +02:00
Daniel J. Hofmann b1ed268d0e Start modularizing the CMake buildsystem
The main reason for modularizing the unit tests was to split off
libboost_unit_test_framework from the osrm toolchain binaries.

Now only the unit test binaries link against it, unblocking
binary distribution without unit test library dependencies.

I started this on v4 a couple of weeks ago and hit a -llua5 issue on
Travis. By now v5 diverged quite a bit (especially in the code that I
have to stare at for debugging the issues).

https://github.com/Project-OSRM/osrm-backend/pull/2073

Let's bring this to v5+ only.

This is blocking:

- https://github.com/Project-OSRM/osrm-backend/issues/2065
- https://github.com/Project-OSRM/osrm-backend/issues/2197#issuecomment-204864938
2016-04-06 18:36:06 +02:00
Patrick Niklaus 83b86bf092 Fix typo .travis.yml for clang compiler name 2016-04-06 18:08:22 +02:00
Daniel J. Hofmann 954caa6804 The C compiler is used for several CMake tests, match with C++ compiler 2016-04-06 15:25:18 +02:00
Patrick Niklaus 8b6da4d2fe Enable server-tests on travis 2016-04-06 15:20:53 +02:00
Patrick Niklaus f2d70d972d Temporarily enable travis for rewrite/new-api branch 2016-04-06 15:16:28 +02:00
Daniel J. Hofmann b20de76037 Make verbose sections foldable on Travis 2016-04-06 10:58:49 +02:00
Patrick Niklaus a33bd9dfe6 Adapt benchmarking script 2016-04-05 23:40:24 +02:00
Moritz Kobitzsch f2443c64db adds distinction between rotaries/rounabouts 2016-04-05 22:59:14 +02:00
Patrick Niklaus 278ec04f5e Remove left-over summary code 2016-04-05 22:59:14 +02:00
Patrick Niklaus 95787255a1 Fix broken uturns test 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann eaf9993dd9 Removes summary from legs property 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch 470d7600b8 fixes 2219 2016-04-05 22:59:14 +02:00
Patrick Niklaus 849baea544 Fix uturn detection in match plugin 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 4f1ca20dda Do not rely on alternatives being found in unit tests 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 97401ad99a Disable steps and alternatives by default 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 59f5e364c1 Suppress pedantic ISO C++ warning about argv[0] size check 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 29c2a117c0 Adapts tests to case sensitive "Ok" status code. 2016-04-05 22:59:14 +02:00
Patrick Niklaus c209e31ce1 Fix tests for 2016-04-05 22:59:14 +02:00
Patrick Niklaus 12608889e2 Fix 'ok' -> 'Ok' 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 3343882876 Resolves issues with multiple includedirs in pkg-config file; closes #2195. 2016-04-05 22:59:14 +02:00
Patrick Niklaus 6e50b5fc60 Filter segments correctly by bounding box 2016-04-05 22:59:14 +02:00
Patrick Niklaus c540c85cf8 Remove tests from default target until we get proper switchting in place 2016-04-05 22:59:14 +02:00
Patrick Niklaus b17491ebe5 Bump osrm version 2016-04-05 22:59:14 +02:00
Patrick Niklaus 76b410b2ca Update changelog to 5.0.0 RC1 2016-04-05 22:59:14 +02:00
Daniel Patterson 069388eae0 Exclude new node_modules folder that might be around if test cases have been run. 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann c6c25e609b Initial libosrm API docs 2016-04-05 22:59:14 +02:00
Daniel Patterson 9b52dd8bf7 Remove leftover debug output. 2016-04-05 22:59:14 +02:00
Daniel Patterson 2cf19010e3 Fix context returned in JSON error (had null bytes).
Update status test cases to match new API.
2016-04-05 22:59:14 +02:00
Moritz Kobitzsch 89d56e1cd1 fix duration of direct connection 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch ef1fb08723 fix cucumber tests and issues 2016-04-05 22:59:14 +02:00
Daniel Patterson e60ebee3f2 Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Lauren Budorick 4c88fe0fb1 Add arrival instruction 2016-04-05 22:59:14 +02:00
Daniel Patterson 13338414db Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson 96f49f3b53 Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson 75979d7e1c Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson 29a2447906 Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson 2f702f61a4 Add missing arrival instruction. This test was incorrect. 2016-04-05 22:59:14 +02:00
Lauren Budorick 5a71acbe3c Add missing arrival instructions 2016-04-05 22:59:14 +02:00
Daniel Patterson ca3e8ef09e Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson 8c44084af1 Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson d829a390fd Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson 6b6597e453 Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson 97c550d5f6 Add missing arrive instruction to distance feature. 2016-04-05 22:59:14 +02:00
Daniel Patterson acfd6ab141 Fix missing arrive instruction on bearing tests. 2016-04-05 22:59:14 +02:00
Daniel Patterson 7e790c1aa6 Add missing arrive instructions to time tests. 2016-04-05 22:59:14 +02:00
Lauren Budorick d1e2aa57a8 start updating testbot fixtures (TODO: the rest) 2016-04-05 22:59:14 +02:00
Lauren Budorick 2e6e3bf0b0 Update raster features to reflect not cutting off arrive instruction 2016-04-05 22:59:14 +02:00
Lauren Budorick e5025665fc Update foot features to reflect not cutting off arrive instruction 2016-04-05 22:59:14 +02:00
Lauren Budorick 1a8097f810 Update car features to reflect not cutting off arrival instruction 2016-04-05 22:59:14 +02:00
Patrick Niklaus f45daad6ca Fix code of InternalError 2016-04-05 22:59:14 +02:00
Patrick Niklaus e4e85e6f7e Fix some via tests 2016-04-05 22:59:14 +02:00
Daniel Patterson 5beaf695ed Fix bearing param tests. Have not yet fixed the cause of the two failing cases. 2016-04-05 22:59:14 +02:00
Lauren Budorick d09827b501 Update bicycle tests to reflect not cutting off arrive step 2016-04-05 22:59:14 +02:00
Daniel Patterson 97722adbfa 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-04-05 22:59:14 +02:00
Patrick Niklaus 006a8833d3 Fix some of the accidental forced loops in viaroute 2016-04-05 22:59:14 +02:00
Patrick Niklaus 8111baa8f9 Remove unused detach parameter 2016-04-05 22:59:14 +02:00
Daniel Patterson d6e4dc0aa2 Add 'arrive' step to route descriptions. 2016-04-05 22:59:14 +02:00
Daniel Patterson 497da1d29b Colorize test result diff output. 2016-04-05 22:59:14 +02:00
Lauren Budorick cbc8b64854 unbreak the zombiekilling 2016-04-05 22:59:14 +02:00
Lauren Budorick c06f2a50f1 Fix routability now that we don't chop off a step 2016-04-05 22:59:14 +02:00
Patrick Niklaus 825a422721 Remove arrive filter 2016-04-05 22:59:14 +02:00
Patrick Niklaus 2c4ba90abb Remove leftover hello_world and timestamp plugins 2016-04-05 22:59:14 +02:00
Patrick Niklaus 6dda899a60 There is no timestamp service anymore 2016-04-05 22:59:14 +02:00
Lauren Budorick 8725e2f40d Remove one more compass column; update polyline encoding tests 2016-04-05 22:59:14 +02:00
Patrick Niklaus 35c501c203 .json hotfix 2016-04-05 22:59:14 +02:00
Patrick Niklaus 30a9bc3179 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-04-05 22:59:14 +02:00
Moritz Kobitzsch f9350a276c fix same segment routes 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch cd9addf0e2 Removed debug code 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch 2219b6507c correctly handle roundabouts in a wide set of special cases 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 09931d7ad8 Removes server-side support for POST requests. 2016-04-05 22:59:14 +02:00
Lauren Budorick 7ce0c0ef9a Rm unnecessary io.write 2016-04-05 22:59:14 +02:00
Lauren Budorick 49e2cb6c36 Fix raster_source + tests 2016-04-05 22:59:14 +02:00
Lauren Budorick 4b60fc4747 return geometry from new API 2016-04-05 22:59:14 +02:00
Lauren Budorick 164fb09f2c Fix route/bearing param 2016-04-05 22:59:14 +02:00
Lauren Budorick 5647e6c199 Fix double shutdown 2016-04-05 22:59:14 +02:00
Lauren Budorick a4d6544764 Fix alternatives option test, chdirs on fail, spacing 2016-04-05 22:59:14 +02:00
Lauren Budorick e942f6e420 Update pushing test to reflect better guidance 2016-04-05 22:59:14 +02:00
Patrick Niklaus 7174baa91e Move osrm-components to BUILD_COMPONENTS flag 2016-04-05 22:59:14 +02:00
Patrick Niklaus 5c8b7542d0 Fix staticrtree benchmark 2016-04-05 22:59:14 +02:00
Lauren Budorick e8035ced5a Fix trips + matchLocation 2016-04-05 22:59:14 +02:00
Jeff Miccolis 70a086a9e1 make eslint happy 2016-04-05 22:59:14 +02:00
Jeff Miccolis 08cb6d1f63 Fix timestamp handling, restores testbot/matching test 2016-04-05 22:59:14 +02:00
Lauren Budorick c7f3645fe2 Status fixes 2016-04-05 22:59:14 +02:00
Lauren Budorick 4b6a85aae0 Distance matrix fixes 2016-04-05 22:59:14 +02:00
Lauren Budorick c8a8859d2f rm console.log my bad 2016-04-05 22:59:14 +02:00
Lauren Budorick 8c0f47f06c Fix guidance/roundabout spacing 2016-04-05 22:59:14 +02:00
Lauren Budorick 926290dd9c enter_roundabout -> roundabout-exit (these are still off by one @mokob ?) 2016-04-05 22:59:14 +02:00
karenzshea 6ae3315bb9 parse for the right nearest output coordinate 2016-04-05 22:59:14 +02:00
Jeff Miccolis 8621b1890e Fix testbot turns 2016-04-05 22:59:14 +02:00
karenzshea c726001a0e console error which files are missing for osrm-routed 2016-04-05 22:59:14 +02:00
Jeff Miccolis eba5f7d275 Matrix times are on seconds now. Removing POST matrix tests 2016-04-05 22:59:14 +02:00
Lauren Budorick 2f793473cc head/destination -> depart/arrive to reflect guidance API changes; minor fixes for roundabout tests 2016-04-05 22:59:14 +02:00
karenzshea 91567cad9e update osrm-routed options menu 2016-04-05 22:59:14 +02:00
Jeff Miccolis d48ee84ae7 Return first alternative in tests 2016-04-05 22:59:14 +02:00
Jeff Miccolis fd000cad86 Remove compass direction test handling 2016-04-05 22:59:14 +02:00
Lauren Budorick 6244063073 #2155 is fixed 2016-04-05 22:59:14 +02:00
Jeff Miccolis f34de8422e eslinting 2016-04-05 22:59:14 +02:00
Jeff Miccolis a33edd15b4 Update alternatives flag 2016-04-05 22:59:14 +02:00
Jeff Miccolis 6a65261765 test query params are an object 2016-04-05 22:59:14 +02:00
Jeff Miccolis 07f3e2d457 Removing unneeded stopgap 2016-04-05 22:59:14 +02:00
Jeff Miccolis 958199ffef Allow for different rounding in car-maxspeed fixture 2016-04-05 22:59:14 +02:00
Jeff Miccolis e5ebf74d76 Add stopgap for https://github.com/Project-OSRM/osrm-backend/pull/2159 2016-04-05 22:59:14 +02:00
Lauren Budorick 126d2f85ac Mode changes, guidance comments, fix turns 2016-04-05 22:59:14 +02:00
Lauren Budorick 908e3a2af6 Fixes: double callbacks and untested headers 2016-04-05 22:59:14 +02:00
Jeff Miccolis 25e40d723a Better handling of test response payloads 2016-04-05 22:59:14 +02:00
Lauren Budorick 7a764ce78b ensure all nodes are written as decimals 2016-04-05 22:59:14 +02:00
Lauren Budorick 8947c789a9 WIP: race conditions and stalling server 2016-04-05 22:59:14 +02:00
Lauren Budorick 8ac403abb9 start fixing URLs 2016-04-05 22:59:14 +02:00
Lauren Budorick 9752cb8e4d Add more files to be renamed; fix launch error 2016-04-05 22:59:14 +02:00
Lauren Budorick e9be9dd8d0 Bind use_turn_restrictions to ProfileProperties in scripting environment 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch 5e6d638c6f perform zero-length segment removal 2016-04-05 22:59:14 +02:00
Daniel Patterson c47f6e2ca5 Use simpler coordinates for tests. 2016-04-05 22:59:14 +02:00
Daniel Patterson cc09df1961 Use correct perpendicular distance measure when simplifying line geometries. 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch db26d2b2d7 fixes missing overrides in mock data facade 2016-04-05 22:59:14 +02:00
Daniel Patterson 5b33efeecc Fixes #2152 - weight vector needed to be reversed, and start index was wrong. 2016-04-05 22:59:14 +02:00
Patrick Niklaus fda4656630 Implement re-enabling of PhantomNode directions after bearing filtering 2016-04-05 22:59:14 +02:00
Patrick Niklaus 5829bbe22d Move Centroid to coordinate_calculation 2016-04-05 22:59:14 +02:00
Patrick Niklaus f4cfde719d Round integers to remove fake precision 2016-04-05 22:59:14 +02:00
Patrick Niklaus 1fd66f55c1 Fix problem with uturns=true 2016-04-05 22:59:14 +02:00
Patrick Niklaus a964bec0f8 Add route fixture test 2016-04-05 22:59:14 +02:00
Patrick Niklaus b65ba5c394 Adapt get_osrm to EngineConfig changes 2016-04-05 22:59:14 +02:00
Patrick Niklaus d51eefa1c4 Make tests build by default 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 4025cbd555 Make extractor unit tests work again after global uturn changeset 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 3da27c06c3 Number of waypoints equals number of input coordinates 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann bc7824812b Make test assumption failure output violation in Route unit tests 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann baf7822340 Hook up small component locations for Nearest response test 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 82ee08fcaf Provide dummy locations from our fixed monaco dataset 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 51d153a5f7 Fixes integer overflow due to fixed / floating mismatch in coordinate interpolation 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann df608e8b43 Makes switching between floating and fixed coordinates safe wrt. overflows 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 8e477437a6 Makes viewport immune to inf and nans 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann e70f0eea02 Fix base64 test wrt. Hint no longer taking coordinate in ctor 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 8be93a0202 Adapt mock facade implementation to renamed base facade symbols 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann d4f7f19a22 Provide implementation for all pure virtual base member functions in mock facade 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 4441381042 Mismatched tag in fwd decl 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 61c9c69718 Make unit tests compile again after rebasing 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 5beaab97da Make Tile plugin validate its parameters, fixes #2109 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 843a4b8eae Make Route plugin validate its parameters 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 9ec46222e3 Makes Nearest plugin adhere to v5 spec for precondition violations, fixes #2108 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 210da11fbb Unit test for Route service; some failing where v5 spec is unclear 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann ee61ae360d Unit tests for Tile service; plugin needs improvements: see #2109 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 890e0f4995 Unit tests for Nearest service; one test failing: see #2108 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 224c66e0dc Makes table plugin adhere to v5 spec for limit violations, fixes #2100 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann 88052cd194 Adapts our Travis config to continuously run the library unit tests 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann c22453f24a Tests for config level constraints; table failing: see #2100 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 099a805260 Initial unit tests setup for typed libosrm services 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 7ed474af8d Puts auto-generated monaco test files on gitignore 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 9d893d6d4d Library tests build system integration 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann e55af0c274 Add guidance assembly unit test stub 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 803fbf2541 Sentinel spelling 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 061b2b63e9 Explicitely construct coordinate and phantom node 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 1486098065 Adapts all unit tests and benchmarks to compile under v5 again 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 0f0db4c823 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-04-05 22:58:32 +02:00
Daniel J. Hofmann c3e7e96dce Adds round trip tests for RFC 4648 Test Vectors and equality checks 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 3c5f6bd8ac Makes hint Equatable and Printable for tests 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann b6b59e5c08 Make Hint encoding safe for passing them as GET parameter in URLs
Thanks @TheMarex for flagging this!
2016-04-05 22:58:32 +02:00
Daniel J. Hofmann a7aa27c87c Completely re-write base64 logic, make API suck less in doing so 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 735b325d74 RFC 4648 Test Vectors 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann f948380fa2 Object Encoder -> Base64, kill false dependencies while doing so 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 79cf1880fc Adapts Hint encoding and decoding to new fixed data facade 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann ca130e1dc4 Formats parameter parser unit tests 2016-04-05 22:58:32 +02:00
Patrick Niklaus d67ce81438 Fix hint size 2016-04-05 22:58:32 +02:00
Patrick Niklaus ec1a84c57a Always safe the absolute path to .fileIndex 2016-04-05 22:58:32 +02:00
Patrick Niklaus 59163cb2fc Install storage_config.hpp 2016-04-05 22:58:32 +02:00
Aleksei Potov 419cf9e2b0 compilation error on debian jessie with boost 1.54 2016-04-05 22:58:32 +02:00
Daniel Patterson 95c78eac9c Fix boost geometry constructor.
Versions older than 1.58 don't support the initializer-list form.
2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 51a4cf5e46 syncronize geometry and steps after post-processing 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 2472c5d6a1 added list of intersections to the step-maneuver, not in api so far 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 59fbb289b9 fix initial maneuvers 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch e82bc20422 post processing moved onto route-steps, looses sync with geometry segments 2016-04-05 22:58:32 +02:00
Patrick Niklaus 1e753e98ce Simplify the timestamp handling 2016-04-05 22:58:32 +02:00
Patrick Niklaus 39b3cab1da Check all streams 2016-04-05 22:58:32 +02:00
Patrick Niklaus 87fbfc6475 std::string -> boost::filesystem::path 2016-04-05 22:58:32 +02:00
Patrick Niklaus cb8bfa027e Only allow to specify the common base path 2016-04-05 22:58:32 +02:00
Patrick Niklaus 1b1274fd56 print -> io.write 2016-04-05 22:58:32 +02:00
Patrick Niklaus 38db495879 Address PR comments
Renamed lua_function_exists and removes unused print function
2016-04-05 22:58:32 +02:00
Patrick Niklaus a781c36876 Use uturn default from .properties file 2016-04-05 22:58:32 +02:00
Patrick Niklaus 71c336d9dd 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-04-05 22:58:32 +02:00
Patrick Niklaus e10e8910f3 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-04-05 22:58:32 +02:00
Moritz Kobitzsch 253496c7ee improves consistency of fork handling 2016-04-05 22:58:32 +02:00
Patrick Niklaus 30a3ab68c0 Make gcc 4.8 happy and disable protected because of lambdas 2016-04-05 22:58:32 +02:00
Daniel Patterson 663a7c52c7 Properly clip lines so that we don't get crazy coords with long linestrings (relative to tile coords) 2016-04-05 22:58:32 +02:00
Daniel Patterson 4e8ccd6f7d Include edge duration information. 2016-04-05 22:58:32 +02:00
Patrick Niklaus 879ccfc8c2 Implement viewport code to fix simplification
This fixes #2083
2016-04-05 22:58:32 +02:00
Patrick Niklaus a77574b3d7 Add tests for coordinate transformation 2016-04-05 22:58:32 +02:00
Patrick Niklaus 50738f8ce0 Consolidate math functions 2016-04-05 22:58:32 +02:00
Patrick Niklaus 5c01878542 get_name_for_id -> GetNameForID 2016-04-05 22:58:32 +02:00
Patrick Niklaus ea93f6f560 Simplfy name change announcement 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 7bab34eeda fix division by zero 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 0cc23dec6f restructured to only return valid turns to the outside + cleanup 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 71c0d5253d less new names, forks consider road classes, api clean-up 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch a674028c37 implement basic turn handling 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 29fff4f51b implements relative position feature based on coordinates 2016-04-05 22:58:32 +02:00
Patrick Niklaus 4309ccfa02 Don't sum up durations of merged steps since we do that in a different place now 2016-04-05 22:58:32 +02:00
Patrick Niklaus 4e8fe89faa Fix foward/backwad swap 2016-04-05 22:58:32 +02:00
Patrick Niklaus 8218d5a47e Limit zoomlevel to 18 2016-04-05 22:58:32 +02:00
Patrick Niklaus 4bbb587280 Fix shared memory 2016-04-05 22:58:32 +02:00
Patrick Niklaus 0f04fe75bd Fixup for last commit 2016-04-05 22:58:32 +02:00
Daniel Patterson 11b356e55f 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-04-05 22:58:32 +02:00
Patrick Niklaus 80f008684d Fix ingestion fixed duration values from UnpackPath 2016-04-05 22:58:32 +02:00
Patrick Niklaus c9c2d8133c Fix durations in UnpackPath 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch ac9a4d1e0d fixes a broken assertion 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch d7dd6acd9d fix merging of turn instructions 2016-04-05 22:58:32 +02:00
Patrick Niklaus b5739cb3d8 Include reverse edges again 2016-04-05 22:58:32 +02:00
Patrick Niklaus ea93d56ca8 Formating and logging changes for turn classification 2016-04-05 22:58:32 +02:00
Patrick Niklaus 10097a946f Handle case of dead-end edges by inserting an invalid turn 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch c439594403 report depart/arrive in addition to waypoint 2016-04-05 22:58:32 +02:00
Patrick Niklaus 29cf9e05db Only install necessary headers 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 298f68c966 Adds the license preamble for all publicly installed eaders, closes #2036 2016-04-05 22:58:32 +02:00
Patrick Niklaus 0b3289ea37 Remove the encoder/decoder dependecy from Hint 2016-04-05 22:58:32 +02:00
Patrick Niklaus 5f457bff12 Rename alternative -> alternatives 2016-04-05 22:58:32 +02:00
Patrick Niklaus 6c00ccca9a Remove obsolete debug information 2016-04-05 22:58:32 +02:00
Patrick Niklaus 7e679ab252 Just return NoSegment in map matching if all candidates are empty 2016-04-05 22:58:32 +02:00
Patrick Niklaus 0ca21dbc91 Add failing test for map matching of outlier 2016-04-05 22:58:32 +02:00
Patrick Niklaus d2590f1078 Fix missing capitalization of error codes 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch eb3f550e26 encapsulated into class 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 06aa6dedab improving fork handling on three-way turns 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch f769478abe fix comparison for ramps on three-way turns 2016-04-05 22:58:32 +02:00
Patrick Niklaus ba5f0af5a4 Minor auto iterator cleanup 2016-04-05 22:58:32 +02:00
Patrick Niklaus 5e5f72ae57 Don't pass down unsnapped coordinates. All information is already there 2016-04-05 22:58:32 +02:00
Patrick Niklaus f36037ebf2 Fix camMergeTrivially 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 0c276ac71e fixes roundabout counting 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 9e95d1f1fd fixes assignment for basic turn types / invalid ramp assignment 2016-04-05 22:58:32 +02:00
Patrick Niklaus e00bda37a5 Add edge id assertions 2016-04-05 22:58:32 +02:00
Patrick Niklaus e7ea5f500d 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-04-05 22:58:32 +02:00
Patrick Niklaus a8fc95d4e4 Move bearing to public namespace 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 3f598a5121 Properly includes needed headers in turn analysis interface 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 81c5ec0777 Const-correctnes for compressed geometry iterator 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 32bb58b272 Use stdint and using type-alias for discrete angle 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann aa4b786ab3 Hide functional road classification based on tags in implementation file 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 3f5968b60c Inline initialize functional road classification hash table 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 251eeb534a 256 functional road classes should be enough 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 90add9f840 Moves route assembly into implementation file 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 770624d492 Fixes remaining engine/guidance includes 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann c59758ef65 Fixes accumulate living in <numeric> and not <algorithm> 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 15752335f4 Puts step maneuver handling into implementation file 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 3e4b48e206 Removes penalizing move 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 25c685527a Uses static_casts for underlying type in post processing 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann fbabd137c2 Fix asymmetry in min/max from using -max 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 6e7cf68164 Adapts MakeResponse to not pass vector by pointer 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann b47a532eb4 Fixes multi-line comment 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 7c30ea32bf Runs scripts/format.sh 2016-04-05 22:58:32 +02:00
Patrick Niklaus bb06e044f5 Fix coodinate include and unused warnings 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 01318a08b4 start of four way turns 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 119487f1aa improved fork handling 2016-04-05 22:58:32 +02:00
Patrick Niklaus 911427a361 Fix crash on extracting Berlin in guidance 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 58628a4bfc bugfixing/classification 2016-04-05 22:58:32 +02:00
Patrick Niklaus b08b360f38 Big Restructuring / Cleanup 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch adb8d0e845 starting on conflict resolution 2016-04-05 22:58:32 +02:00
Lauren Budorick e0f009b3b9 Fixes for gcc compiling, temporary hacks to remove later 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch f1aa03c360 handle segregated roads (merge for turn analysis) 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 2ba417cf9f structural changes, motorway handling 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch d8af074ff6 enter and exit roundabout feature - currently not showing turn 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch daf2bbf991 migrated out of edge based graph factory 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 6605f293b4 relative waypoint locations 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch 482e18ccdb handling of roundabouts (simple version) 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch ef1e0e14ec advanced guidance on 5.0 2016-04-05 22:58:32 +02:00
Patrick Niklaus 33f083b213 Fix numerical problems with polyline 2016-04-05 22:58:32 +02:00
Patrick Niklaus bcfbc0cf6c Fix table response format to return null + double in seconds 2016-04-05 22:58:32 +02:00
Patrick Niklaus 00d75ece64 Return NoMatch 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann dc1b5d3424 Provides ctor from base path for EngineConfig, fixes #2030 2016-04-05 22:58:32 +02:00
Patrick Niklaus 58fb633df3 Add support for tile plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus 36f9366f3f Preliminary integration of the tile plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus 712f1ca02a sources and destinations can be empty actually 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 285b238f26 Fixes coordinate, source and destination validation by means of backporting #2041 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 70fb12b10e Fixes ownership semantics and forwarding references misplacements in the JSON factory 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 6380a6be05 Unwrap function call from identity lambda 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 548fd92c15 Uses JSON's String constructor for polyline encoding 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 86de53eb9a Passes coordinates by value 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann e1616953db Asserts on unknown TurnInstruction 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann c1dbab50fe Fixes header includes in the JSON factory 2016-04-05 22:58:32 +02:00
Dane Springmeyer b6bb6a92a9 fix compile of osrm-components 2016-04-05 22:58:32 +02:00
Patrick Niklaus 0ab80ad0a7 Fix if the last coordinate is not found 2016-04-05 22:58:32 +02:00
Patrick Niklaus 61744764da Allocate correct table size 2016-04-05 22:58:32 +02:00
Patrick Niklaus 8eb98982f3 Fix travel mode passing from profiles up to the API 2016-04-05 22:58:32 +02:00
Patrick Niklaus 1090339331 Fix geometries type in steps 2016-04-05 22:58:32 +02:00
Patrick Niklaus 804816f014 Fix table parameter parsing 2016-04-05 22:58:32 +02:00
Patrick Niklaus 51e8318224 Fix behaviour of table if sources/destinations arrays are empty 2016-04-05 22:58:32 +02:00
Patrick Niklaus 0d38a50dba Fuck. this. shit. 2016-04-05 22:58:32 +02:00
Patrick Niklaus 72094acf74 Change stream operator of strong typedef 2016-04-05 22:58:32 +02:00
Patrick Niklaus 1bd67943bb Fix stream operator for coordinate 2016-04-05 22:58:32 +02:00
Patrick Niklaus 30101e129f Add stream operator to Rectangle 2016-04-05 22:58:32 +02:00
Patrick Niklaus 9bb31678a6 Add euclideanDistance to coordinate_calculation 2016-04-05 22:58:32 +02:00
Patrick Niklaus 5e5c52ff0a Simplify static_rtree tests 2016-04-05 22:58:32 +02:00
Patrick Niklaus d9d4742130 First round of lat,lng -> lng,lat switcheroo 2016-04-05 22:58:32 +02:00
Patrick Niklaus 0fab6b7cab Add rectangle unit test 2016-04-05 22:58:32 +02:00
Patrick Niklaus f10286de8c Fix match and trip API response 2016-04-05 22:58:32 +02:00
Patrick Niklaus a0e0465704 Fix out-of-bounds write in map_matching 2016-04-05 22:58:32 +02:00
Dane Springmeyer c8457a2619 Fix compile on OS X 2016-04-05 22:58:32 +02:00
Patrick Niklaus 14c36bc405 Finish the nearest plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus 81319228bd Initialize NearestParameters correctly 2016-04-05 22:58:32 +02:00
Patrick Niklaus fcd7b05900 Adapt to feedback in #519 2016-04-05 22:58:32 +02:00
Patrick Niklaus 8378d95588 Add trip plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus b34f9b1795 Hook up map matching 2016-04-05 22:58:32 +02:00
Patrick Niklaus 35b098e656 First compiling version of map_match plugin 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann e05a45b080 Adapts example/example.cpp to new osrm api 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 715ee66b03 Install _all_ transitively from public headers included header 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 3d6e9da115 Fix missing headers in hint.hpp 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 54410988eb Adds $prefix/include/osrm to include dirs so that transitive header includes without osrm prefix can be found 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann dded2c2463 Adapt the example to include all osrm public headers 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann fcf5838019 Fixes missing public header installations 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann beafa18708 Fix forward declarations in publicly facing osrm header 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann bd371a11ad Enable all plugins with aStatus::Error return code fallback for not implemented ones 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 1895fee1c9 Adds publicly facing alias headers for parameters 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 2200d0b678 Temporarily comment out match.cpp as to not break the build process 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann f3c4a7dd16 We don't need templates at all, this is not CRTP? 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 25834b89dd Fix classes for service member function definitions 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 4d20dea271 Service skeletons for nearest, trip, match 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann c59647ad2f Fix grammar constraint and enable all plugin links 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann e466cbe0ce Plugin grammar skeletons 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann a24de2d22a Enforce parameter and grammar type to catch subtle bugs 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann f452a3025d Link parameters to grammars 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 3c58eaf49f Require a BaseParameters type at compile time via enable_if 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann c75b497b2e Adapts Nearest plugin to new API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann d572d77b48 Fix deleting incomplete type and make Engine moveable only 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann a4074332cc Adapts publicly facing new API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann c31ceb6a5b Adapts NearestParameters to new API 2016-04-05 22:58:32 +02:00
Patrick Niklaus b0863d8628 Initial non-building match plugin 2016-04-05 22:58:32 +02:00
Lauren Budorick c38a6d74dd Include numeric in assemble_overview.cpp (needed on OSX for std::accumulate) 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann 7bec75b709 Semantic action handler requires passing optional by value and fusion::vector2 2016-04-05 22:58:32 +02:00
Patrick Niklaus 56ea24b03b Add tests for bearing parsing 2016-04-05 22:58:32 +02:00
Patrick Niklaus 277829c280 Add table service 2016-04-05 22:58:32 +02:00
Patrick Niklaus c127aaae6b Add table API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann c895848061 Optional<T> semantic action handler takes T argument 2016-04-05 22:58:32 +02:00
Patrick Niklaus 64e5ebb55f Fix parameter parsing tests 2016-04-05 22:58:32 +02:00
Patrick Niklaus 83addd6bba Fix table plugin 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann d87a19b2f9 First take at distance table API re-write 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann b58edc980c Adapts TableParameters and its validation to new API 2016-04-05 22:58:32 +02:00
Patrick Niklaus f3e72623e9 Add viaroute suport for new API 2016-04-05 22:58:32 +02:00
Patrick Niklaus 54ee76bcef Add benchmark target to Makefile and save timings 2016-04-05 18:57:31 +02:00
Daniel J. Hofmann efe6faabfd Adds tests for routing over delivery ways and nodes; see #2150. 2016-04-04 14:00:54 +02:00
Daniel J. Hofmann 3ee8b655ea Prevents routing over delivery ways and nodes; closes #2150. 2016-04-04 14:00:54 +02:00
Daniel J. Hofmann c70d138eb9 Spelling: Hierachy vs Hierarchy 2016-04-04 13:58:55 +02:00
Daniel J. Hofmann af2a327310 Removes unused access_tag list from car profile
This is dead code. Using my time machine (which sadly can only go back
in history), I found the introducing commit here:

https://github.com/Project-OSRM/osrm-backend/commit/74cc50f52b79cdb06d5c61fabc1fdc9ca5979fcc#diff-ded22cbfae0ae88f6359ccff1c3355b0R106

Seems like we no longer use it, and it was still left in the car profile.
2016-04-04 13:55:27 +02:00
Daniel J. Hofmann b27e0e2807 Update CMake from 3.3 to 3.5 on Travis 2016-04-04 12:29:15 +02:00
Daniel J. Hofmann 8267ed53f0 Pins LLVM 3.8 (stable) instead of tracking the nightly repository 2016-04-04 12:27:45 +02:00
Patrick Niklaus aa90d7b4b7 Merge pull request #2200 from oxidase/fix/uninitialised_alternative_segment
Fixes using uninitialised values in extractRouteNames
2016-04-03 22:58:04 +02:00
Michael Krasnyk 6b69946b9e Fixes using uninitialised values in extractRouteNames
Conditional jump or move depends on uninitialised value(s)
   at 0x5FEE48: osrm::engine::RouteNames osrm::engine::extractRouteNames<osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData>, osrm::engine::detail::Segment>(std::vector<osrm::engine::detail::Segment, std::allocator<osrm::engine::detail::Segment> >&, std::vector<osrm::engine::detail::Segment, std::allocator<osrm::engine::detail::Segment> >&, osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData> const*) (route_name_extraction.hpp:127)
   by 0x61A1B2: osrm::engine::ApiResponseGenerator<osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData> >::DescribeRoute(osrm::engine::RouteParameters const&, osrm::engine::InternalRouteResult const&, osrm::util::json::Object&) (api_response_generator.hpp:173)
   by 0x61AF47: osrm::engine::plugins::ViaRoutePlugin<osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData> >::HandleRequest(osrm::engine::RouteParameters const&, osrm::util::json::Object&) (viaroute.hpp:144)
   by 0x61EEEC: osrm::engine::Engine::RunQuery(osrm::engine::RouteParameters const&, osrm::util::json::Object&) (engine.cpp:100)
   by 0x5AE585: osrm::OSRM::RunQuery(osrm::engine::RouteParameters const&, osrm::util::json::Object&) (osrm.cpp:19)
   by 0x5A8E07: main (in /home/miha/work/foss/osrm-backend/build.example/osrm-example)
2016-04-03 19:29:35 +02:00
Daniel J. Hofmann a1b87b5236 Handle all distances between coordinates being zero in Farthest Insertion algorithm.
Assertions for additional safety and sanity.

References:
- see https://github.com/Project-OSRM/osrm-backend/issues/2147
2016-03-31 18:57:24 +02:00
bergwerkgis 3044c5ea52 AppVeyor: remove MSBuild logs from artifacts as it interferes with deployment of binary 2016-03-31 15:55:11 +00:00
bergwerkgis d0636a9f6d make AppVeyor work again 2016-03-31 16:49:30 +02:00
Lauren Budorick 0d291cb68e Make cucumber executable via package.json bin field 2016-03-24 17:31:18 -07:00
Lauren Budorick c8bb50497b Rewrite cucumber test suite in JS 2016-03-24 16:01:01 -07:00
Patrick Niklaus ea027a7cc1 Merge commit '62e8601919faca57a0fa4be1a910458390450cc9' as 'third_party/variant' 2016-03-24 21:32:27 +01:00
Patrick Niklaus 62e8601919 Squashed 'third_party/variant/' content from commit b585021
git-subtree-dir: third_party/variant
git-subtree-split: b5850212f16efeb409a112edb1e719d5f5edb604
2016-03-24 21:32:27 +01:00
Patrick Niklaus be2cc7aed9 Remove variant 2016-03-24 21:32:12 +01:00
Patrick Niklaus 17babb22e2 mapbox/variant v1.0 -> v1.1 2016-03-24 21:26:31 +01:00
Patrick Niklaus 21245273b4 Also exclude the compressed flag from the data format 2016-03-24 21:24:08 +01:00
Patrick Niklaus 8d7821c84e Remove geometry indicator 2016-03-24 21:24:08 +01:00
Daniel J. Hofmann c78dff9a15 Write out unsigned with a check for edge counter overflow 2016-03-19 00:27:55 +01:00
Daniel J. Hofmann 25fea558ba Fixes the edge-based-graph factory's edge counter serialization.
The counter for original edges is of type `std::size_t`, but we
serialized `sizeof(unsigned)` number of bytes out to the `.osrm.edges`
file.

We should probably check all writes (analogous for reads) and make the
count parameter dependent on `sizeof(variable)`.

    ag '\.write\((.*), sizeof\((.*)\)\);'
2016-03-19 00:27:55 +01:00
Patrick Niklaus f6116db957 Merge pull request #1902 from Project-OSRM/4.9.1
Bug fix release 4.9.1
2016-01-19 19:00:11 -05:00
Patrick Niklaus c824429458 Include the travel mode in the last instruction by copying it from the previous instruction. 2016-01-19 23:23:32 +01:00
Daniel Patterson 23b2154d98 Adds a shared/exclusive lock around queries and CheckAndReloadFacade.
Without this, it's possible for CheckAndReloadFacade to start working
while a query is still in progress, leading to undefined behaviour.
2016-01-19 21:26:30 +01:00
Daniel J. Hofmann 25c8711aad Fix shared memory non-copyable properties 2016-01-19 20:31:14 +01:00
Daniel Patterson cf30628d4e DataFacade should only remove shared segments if they're actually different from the last time they were checked. 2016-01-19 20:31:03 +01:00
Patrick Niklaus 7675c730b6 Fix wrong assertion and emplace_back bug in trip plugin 2016-01-19 17:38:02 +01:00
Patrick Niklaus 2ce74c05e1 Use a sane gps_precision multipler 2016-01-15 22:15:05 +01:00
Patrick Niklaus 88e6558da3 Fix handling unexpected errors. 2016-01-15 22:08:04 +01:00
Patrick Niklaus f1140ec903 Fix uturns at dead-end streets 2016-01-15 21:48:14 +01:00
Patrick Niklaus a2e114e852 Merge branch 'develop' 2015-12-24 11:22:16 +01:00
Patrick Niklaus 8f6fc0146b Merge branch 'develop' 2015-09-20 13:30:19 +02:00
Patrick Niklaus 6ad1cd3fb5 Merge branch 'develop' 2015-09-16 18:18:54 +02:00
Wilhelm Berg 40443d1e25 appveyor.yml update url to binary deps 2015-08-24 21:23:12 +02:00
Patrick Niklaus 4ec323c5cc Merge commit '9958937fd1c1f9dd60126a56e1c4f25ceefaf70e' 2015-08-15 00:11:31 +02:00
Patrick Niklaus 300d901618 Merge branch 'develop' 2015-06-22 13:06:50 +02:00
Patrick Niklaus fd6daa580a Merge branch 'develop' 2015-04-22 10:34:56 +02:00
Patrick Niklaus c2fc47df34 Merge branch 'develop' 2015-04-17 22:51:40 +02:00
1951 changed files with 155410 additions and 42325 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"presets": [
"stage-0",
"es2015",
"react"
]
}
+59 -23
View File
@@ -2,53 +2,89 @@
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AlwaysBreakTemplateDeclarations: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: true
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerBinding: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<'
Priority: 3
- Regex: '^"(osrm|util|engine|extract|contract)/'
Priority: 2
- Regex: '.*'
Priority: 1
IndentCaseLabels: false
MaxEmptyLinesToKeep: 1
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerBindsToType: false
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
IndentWidth: 4
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Allman
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
...
+28
View File
@@ -0,0 +1,28 @@
{
"rules": {
"indent": [
2,
4
],
"quotes": [
1,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
],
"no-console": [
1
]
},
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended"
}
+13
View File
@@ -0,0 +1,13 @@
# Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
## Tasklist
- [ ] ADD OWN TASKS HERE
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
- [ ] add regression / cucumber cases (see docs/testing.md)
- [ ] review
- [ ] adjust for comments
## Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?
+17
View File
@@ -1,3 +1,8 @@
# mason #
#########
/.mason
/mason_packages
# pre compiled dependencies #
#############################
osrm-deps
@@ -40,6 +45,8 @@ Thumbs.db
# build related files #
#######################
/build/
/example/build/
/test/data/monaco*
/cmake/postinst
# Eclipse related files #
@@ -73,10 +80,20 @@ stxxl.errlog
###################
/sandbox/
# Test related files #
######################
/test/profile.lua
/test/cache
/test/speeds.csv
/test/penalties.csv
/test/data/monaco.*
node_modules
# Deprecated config file #
##########################
/server.ini
*.swp
# local lua debugging file
debug.lua
+138 -111
View File
@@ -1,7 +1,7 @@
#language: cpp
# This makes travis use the thin image which boots faster
language: generic
language: cpp
git:
depth: 10
# sudo:required is needed for trusty images
sudo: required
@@ -13,164 +13,191 @@ notifications:
branches:
only:
- master
- develop
- "5.6"
cache:
ccache: true
apt: true
directories:
- test/cache
env:
global:
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
- CCACHE_VERSION=3.3.1
- CMAKE_VERSION=3.6.2
- MASON="$(pwd)/third_party/mason/mason"
matrix:
fast_finish: true
# We override the compiler names here to yield better ccache behavior, which uses this as key
include:
# Debug Builds
- os: linux
compiler: gcc
addons: &gcc5
compiler: "gcc-6-debug"
addons: &gcc6
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='g++-5' BUILD_TYPE='Debug'
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
- os: linux
compiler: gcc
addons: &gcc48
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='g++-4.8' BUILD_TYPE='Debug'
- os: linux
compiler: clang
compiler: "clang-3.9-debug"
addons: &clang38
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Debug' BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
- os: osx
osx_image: xcode7.3
compiler: clang
env: COMPILER='clang++' BUILD_TYPE='Debug'
osx_image: xcode8.2
compiler: "mason-osx-release"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON
# Release Builds
- os: linux
compiler: gcc
addons: &gcc5
compiler: "mason-linux-release"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='g++-5' BUILD_TYPE='Release'
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON
- os: linux
compiler: gcc
addons: &gcc48
compiler: "gcc-6-release"
addons: &gcc6
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', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='g++-4.8' BUILD_TYPE='Release'
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_COMPONENTS=ON
- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
compiler: "gcc-6-release-i686"
env: >
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
- os: osx
osx_image: xcode7.3
compiler: clang
env: COMPILER='clang++' BUILD_TYPE='Release'
- os: linux
compiler: "gcc-4.9-release"
addons: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
# Disabled because of CI slowness
#- os: linux
#- compiler: clang
#- addons: &clang38
#- apt:
#- sources: ['llvm-toolchain-precise-3.8', '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'
# Shared Library
- os: linux
compiler: gcc
addons: &gcc5
compiler: "gcc-6-release-shared"
addons: &gcc6
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='g++-5' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON BUILD_COMPONENTS=ON
- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'rubygems-integration', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: COMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
# Disabled because CI slowness
#- os: linux
#- compiler: clang
#- addons: &clang38
#- apt:
#- sources: ['llvm-toolchain-precise-3.8', '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
# 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
install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
before_install:
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum
export JOBS=$((`nproc` + 1))
fi
- |
if [ -n "${RUN_CLANG_FORMAT}" ]; then
${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export JOBS=$((`sysctl -n hw.ncpu` + 1))
sudo mdutil -i off /
fi
- echo "Using ${JOBS} jobs"
- source ./scripts/install_node.sh 4
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
- npm install
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
- ${MASON} install cmake ${CMAKE_VERSION} && export PATH=$(${MASON} prefix cmake ${CMAKE_VERSION})/bin:${PATH}
- |
if [[ ! -z ${CLANG_VERSION} ]]; then
export CCOMPILER='clang'
export CXXCOMPILER='clang++'
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH}
# we only enable lto for release builds
# and therefore don't need to us ld.gold or llvm tools for linking
# for debug builds
if [[ ${BUILD_TYPE} == 'Release' ]]; then
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH}
fi
fi
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
before_script:
- cd ${TRAVIS_BUILD_DIR}
install:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
./scripts/check_taginfo.py taginfo.json profiles/car.lua
fi
- rvm use 1.9.3
- gem install bundler
- bundle install
- mkdir build && pushd build
- export CXX=${COMPILER}
- export OSRM_PORT=5000 OSRM_TIMEOUT=60
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
script:
- make --jobs=2
- make tests --jobs=2
- make benchmarks
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
- mkdir ${OSRM_BUILD_DIR} && pushd ${OSRM_BUILD_DIR}
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON
- echo "travis_fold:start:MAKE"
- make --jobs=${JOBS}
- make tests --jobs=${JOBS}
- make benchmarks --jobs=${JOBS}
- echo "travis_fold:end:MAKE"
- ccache -s
- sudo make install
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo ldconfig
fi
- ./extractor-tests
- ./engine-tests
- ./util-tests
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
- popd
- cucumber -p verify
- make -C test/data
- mkdir example/build && pushd example/build
- cmake ..
- make
- ./osrm-example ../../test/data/monaco.osrm
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make --jobs=${JOBS}
- popd
- npm run build-api-docs
script:
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
- echo "travis_fold:start:BENCHMARK"
- make -C test/data benchmark
- echo "travis_fold:end:BENCHMARK"
- ./example/build/osrm-example test/data/monaco.osrm
# All tests assume to be run from the build directory
- pushd ${OSRM_BUILD_DIR}
- ./unit_tests/library-tests ../test/data/monaco.osrm
- ./unit_tests/extractor-tests
- ./unit_tests/engine-tests
- ./unit_tests/util-tests
- ./unit_tests/server-tests
- popd
- npm test
after_success:
- |
if [ -n "$RUN_CLANG_FORMAT" ]; then
./scripts/format.sh || true # we don't want to fail just yet
if [ -n "${ENABLE_COVERAGE}" ]; then
bash <(curl -s https://codecov.io/bash)
fi
+436
View File
@@ -1,3 +1,439 @@
# 5.6.3
- Changes from 5.6.0
- Bugfixes
- #3790 Fix incorrect speed values in tile plugin
# 5.6.2
- Changes from 5.6.0
- Bugfixes
- Fix incorrect forward datasources getter in facade
- Fix include `access=private` non-car roads in the car profile
# 5.6.1
- Changes from 5.6.0
- Bugfixes
- Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
# 5.6.0
- Changes from 5.5
- Bugfixes
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
- Fix #3515 adjusted number of `nodes` in `annotation`
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
- Fix #2844 handle up to 16777215 code units in OSM names
- Infrastructure
- Support building rpm packages.
- Guidance
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
- Profiles
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
- `properties` object has a new `weight_name` field, default value is "duration"
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
- Infrastructure
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
- Tools:
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
- Trip Plugin
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
# 5.5.1
- Changes from 5.5.0
- API:
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
- Bugfixes
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
# 5.5.0
- Changes from 5.4.0
- API:
- `osrm-datastore` now accepts the parameter `--max-wait` that specifies how long it waits before aquiring a shared memory lock by force
- Shared memory now allows for multiple clients (multiple instances of libosrm on the same segment)
- Polyline geometries can now be requested with precision 5 as well as with precision 6
- Profiles
- the car profile has been refactored into smaller functions
- get_value_by_key() is now guaranteed never to return empty strings, nil is returned instead.
- debug.lua was added to make it easier to test/develop profile code.
- `car.lua` now depends on lib/set.lua and lib/sequence.lua
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
- replaced lhs/rhs profiles by using test defined profiles
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
- Handle `destination:forward`, `destination:backward`, `destination:ref:forward`, `destination:ref:backward` tags
- Properly handle destinations on `oneway=-1` roads
- Guidance
- Notifications are now exposed more prominently, announcing turns onto a ferry/pushing your bike more prominently
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
- Corrected the bearings returned for intermediate steps - requires reprocessing
- Improved turn locations for collapsed turns
- Sliproad classification refinements: the situations we detect as Sliproads now resemble more closely the reality
- Trip Plugin
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
- Bugfixes
- fixed a bug where polyline decoding on a defective polyline could end up in out-of-bound access on a vector
- fixed compile errors in tile unit-test framework
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
- fixed a bug in the tile plugin that resulted in discovering invalid edges for connections
- improved error messages when missing files during traffic updates (#3114)
- For single coordinate geometries the GeoJSON `Point` encoding was broken. We now always emit `LineString`s even in the one-coordinate-case (backwards compatible) (#3425)
- Debug Tiles
- Added support for turn penalties
- Internals
- Internal/Shared memory datafacades now share common memory layout and data loading code
- File reading now has much better error handling
- Misc
- Progress indicators now print newlines when stdout is not a TTY
- Prettier API documentation now generated via `npm run build-api-docs` output `build/docs`
# 5.4.3
- Changes from 5.4.2
- Bugfixes
- #3254 Fixed a bug that could end up hiding roundabout instructions
- #3260 fixed a bug that provided the wrong location in the arrival instruction
# 5.4.2
- Changes from 5.4.1
- Bugfixes
- #3032 Fixed a bug that could result in emitting `invalid` as an instruction type on sliproads with mode changes
- #3085 Fixed an outdated assertion that could throw without a cause for concern
- #3179 Fixed a bug that could trigger an assertion in TurnInstruciton generation
# 5.4.1
- Changes from 5.4.0
- Bugfixes
- #3016: Fixes shared memory updates while queries are running
# 5.4.0
- Changes from 5.3.0
- Profiles
- includes library guidance.lua that offers preliminary configuration on guidance.
- added left_hand_driving flag in global profile properties
- modified turn penalty function for car profile - better fit to real data
- return `ref` and `name` as separate fields. Do no use ref or destination as fallback for name value
- the default profile for car now ignores HOV only roads
- Guidance
- Handle Access tags for lanes, only considering valid lanes in lane-guidance (think car | car | bike | car)
- Improved the detection of non-noticeable name-changes
- Summaries have been improved to consider references as well
- API:
- `annotations=true` now returns the data source id for each segment as `datasources`
- Reduced semantic of merge to refer only to merges from a lane onto a motorway-like road
- new `ref` field in the `RouteStep` object. It contains the reference code or name of a way. Previously merged into the `name` property like `name (ref)` and are now separate fields.
- Bugfixes
- Fixed an issue that would result in segfaults for viaroutes with an invalid intermediate segment when u-turns were allowed at the via-location
- Invalid only_* restrictions could result in loss of connectivity. As a fallback, we assume all turns allowed when the restriction is not valid
- Fixed a bug that could result in an infinite loop when finding information about an upcoming intersection
- Fixed a bug that led to not discovering if a road simply looses a considered prefix
- BREAKING: Fixed a bug that could crash postprocessing of instructions on invalid roundabout taggings. This change requires reprocessing datasets with osrm-extract and osrm-contract
- Fixed an issue that could emit `invalid` as instruction when ending on a sliproad after a traffic-light
- Fixed an issue that would detect turning circles as sliproads
- Fixed a bug where post-processing instructions (e.g. left + left -> uturn) could result in false pronunciations
- Fixes a bug where a bearing range of zero would cause exhaustive graph traversals
- Fixes a bug where certain looped geometries could cause an infinite loop during extraction
- Fixed a bug where some roads could be falsly identified as sliproads
- Fixed a bug where roundabout intersections could result in breaking assertions when immediately exited
- Infrastructure:
- Adds a feature to limit results in nearest service with a default of 100 in `osrm-routed`
# 5.3.0
- Changes from 5.3.0-rc.3
- Guidance
- Only announce `use lane` on required turns (not using all lanes to go straight)
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
- Bugfixes
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
- Changes form 5.2.7
- API
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
- Introduces `lanes` to the `Intersection` object. The lane data contains both the markings at the intersection and a flag indicating if they can be chosen for the next turn
- Removed unused `-s` from `osrm-datastore`
- Guidance
- Only announce `use lane` on required turns (not using all lanes to go straight)
- Improved detection of obvious turns
- Improved turn lane detection
- Reduce the number of end-of-road instructions in obvious cases
- Profile:
- bicycle.lua: Surface speeds never increase the actual speed
- Infrastructure
- Add 32bit support
- Add ARM NEON/VFP support
- Fix Windows builds
- Optimize speed file updates using mmap
- Add option to disable LTO for older compilers
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
- Bugfixes:
- Fix devide by zero on updating speed data using osrm-contract
# 5.3.0 RC3
- Changes from 5.3.0-rc.2
- Guidance
- Improved detection of obvious turns
- Improved turn lane detection
- Bugfixes
- Fix bug that didn't chose minimal weights on overlapping edges
# 5.3.0 RC2
- Changes from 5.3.0-rc.1
- Bugfixes
- Fixes invalid checks in the lane-extraction part of the car profile
# 5.3.0 RC1
- API
- Introduces new `TurnType` in the form of `use lane`. The type indicates that you have to stick to a lane without turning
- Introduces lanes to the route response. The lane data contains both the markings at the intersection and a flag indicating their involvement in the turn
- Infrastructure
- BREAKING: The new turn type changes the turn-type order. This breaks the **data format**.
- BREAKING: Turn lane data introduces two new files (osrm.tld,osrm.tls). This breaks the fileformat for older versions.
# 5.2.5
- Bugfixes
- Fixes a segfault caused by incorrect trimming logic for very short steps.
# 5.2.4
- Bugfixes:
- Fixed in issue that arised on roundabouts in combination with intermediate intersections and sliproads
# 5.2.3
- Bugfixes:
- Fixed an issue with name changes in roundabouts that could result in crashes
# 5.2.2
Changes from 5.2.1
- Bugfixes:
- Buffer overrun in tile plugin response handling
# 5.2.1
Changes from 5.2.0
- Bugfixes:
- Removed debug statement that was spamming the console
# 5.2.0
Changes from 5.2.0 RC2
- Bugfixes:
- Fixed crash when loading shared memory caused by invalid OSM IDs segment size.
- Various small instructions handling fixes
Changes from 5.1.0
- API:
- new parameter `annotations` for `route`, `trip` and `match` requests. Returns additional data about each
coordinate along the selected/matched route line per `RouteLeg`:
- duration of each segment
- distance of each segment
- OSM node ids of all segment endpoints
- Introducing Intersections for Route Steps. This changes the API format in multiple ways.
- `bearing_before`/`bearing_after` of `StepManeuver` are now deprecated and will be removed in the next major release
- `location` of `StepManeuvers` is now deprecated and will be removed in the next major release
- every `RouteStep` now has property `intersections` containing a list of `Intersection` objects.
- Support for destination signs. New member `destinations` in `RouteStep`, based on `destination` and `destination:ref`
- Support for name pronunciations. New member `pronunciation` in `RouteStep`, based on `name:pronunciation`
- Profile changes:
- duration parser now accepts P[n]DT[n]H[n]M[n]S, P[n]W, PTHHMMSS and PTHH:MM:SS ISO8601 formats.
- `result.destinations` allows you to set a way's destinations
- `result.pronunciation` allows you to set way name pronunciations
- `highway=motorway_link` no longer implies `oneway` as per the OSM Wiki
- Infrastructure:
- BREAKING: Changed the on-disk encoding of the StaticRTree to reduce ramIndex file size. This breaks the **data format**
- BREAKING: Intersection Classification adds a new file to the mix (osrm.icd). This breaks the fileformat for older versions.
- Better support for osrm-routed binary upgrade on the fly [UNIX specific]:
- Open sockets with SO_REUSEPORT to allow multiple osrm-routed processes serving requests from the same port.
- Add SIGNAL_PARENT_WHEN_READY environment variable to enable osrm-routed signal its parent with USR1 when it's running and waiting for requests.
- Disable http access logging via DISABLE_ACCESS_LOGGING environment variable.
- Guidance:
- BREAKING: modifies the file format with new internal identifiers
- improved detection of turning streets, not reporting new-name in wrong situations
- improved handling of sliproads (emit turns instead of 'take the ramp')
- improved collapsing of instructions. Some 'new name' instructions will be suppressed if they are without alternative and the segment is short
- Bugfixes
- fixed broken summaries for very short routes
# 5.2.0 RC2
Changes from 5.2.0 RC1
- Guidance:
- improved handling of sliproads (emit turns instead of 'take the ramp')
- improved collapsing of instructions. Some 'new name' instructions will be suppressed if they are without alternative and the segment is short
- BREAKING: modifies the file format with new internal identifiers
- API:
- paramater `annotate` was renamed to `annotations`.
- `annotation` as accidentally placed in `Route` instead of `RouteLeg`
- Support for destination signs. New member `destinations` in `RouteStep`, based on `destination` and `destination:ref`
- Support for name pronunciations. New member `pronunciation` in `RouteStep`, based on `name:pronunciation`
- Add `nodes` property to `annotation` in `RouteLeg` containing the ids of nodes covered by the route
- Profile changes:
- `result.destinations` allows you to set a way's destinations
- `result.pronunciation` allows you to set way name pronunciations
- `highway=motorway_link` no longer implies `oneway` as per the OSM Wiki
- Infrastructure
- BREAKING: Changed the on-disk encoding of the StaticRTree to reduce ramIndex file size. This breaks the **data format**
- Bugfixes
- fixed broken summaries for very short routes
# 5.2.0 RC1
Changes from 5.1.0
- API:
- new parameter `annotate` for `route` and `match` requests. Returns additional data about each
coordinate along the selected/matched route line.
- Introducing Intersections for Route Steps. This changes the API format in multiple ways.
- `bearing_before`/`bearing_after` of `StepManeuver` are now deprecated and will be removed in the next major release
- `location` of `StepManeuvers` is now deprecated and will be removed in the next major release
- every `RouteStep` now has property `intersections` containing a list of `Intersection` objects.
- Profile changes:
- duration parser now accepts P[n]DT[n]H[n]M[n]S, P[n]W, PTHHMMSS and PTHH:MM:SS ISO8601 formats.
- Infrastructure:
- Better support for osrm-routed binary upgrade on the fly [UNIX specific]:
- Open sockets with SO_REUSEPORT to allow multiple osrm-routed processes serving requests from the same port.
- Add SIGNAL_PARENT_WHEN_READY environment variable to enable osrm-routed signal its parent with USR1 when it's running and waiting for requests.
- BREAKING: Intersection Classification adds a new file to the mix (osrm.icd). This breaks the fileformat for older versions.
- Disable http access logging via DISABLE_ACCESS_LOGGING environment
variable.
- Guidance:
- improved detection of turning streets, not reporting new-name in wrong situations
# 5.1.0
Changes with regard to 5.0.0
- API:
- added StepManeuver type `roundabout turn`. The type indicates a small roundabout that is treated as an intersection
(turn right at the roundabout for first exit, go straight at the roundabout...)
- added StepManeuver type `on ramp` and `off ramp` to distinguish between ramps that enter and exit a highway.
- reduced new name instructions for trivial changes
- combined multiple turns into a single instruction at segregated roads`
- Profile Changes:
- introduced a suffix_list / get_name_suffix_list to specify name suffices to be suppressed in name change announcements
- street names are now consistently assembled for the car, bike and walk profile as: "Name (Ref)" as in "Berlin (A5)"
- new `car.lua` dependency `lib/destination.lua`
- register a way's .nodes() function for use in the profile's way_function.
- Infrastructure
- BREAKING: reordered internal instruction types. This breaks the **data format**
- BREAKING: Changed the on-disk encoding of the StaticRTree for better performance. This breaks the **data format**
- Fixes:
- Issue #2310: post-processing for local paths, fixes #2310
- Issue #2309: local path looping, fixes #2309
- Issue #2356: Make hint values optional
- Issue #2349: Segmentation fault in some requests
- Issue #2335: map matching was using shortest path with uturns disabled
- Issue #2193: Fix syntax error position indicators in parameters queries
- Fix search with u-turn
- PhantomNode packing in MSVC now the same on other platforms
- Summary is now not malformed when including unnamed roads
- Emit new-name on when changing fron unanmed road to named road
# 5.0.0
Changes with regard 5.0.0 RC2:
- API:
- if `geometry=geojson` is passed the resulting geometry can be a LineString or Point
depending on how many coordinates are present.
- the removal of the summary field was revered. for `steps=flase` the field will always be an empty string.
Changes with regard to 4.9.1:
- API:
- BREAKING: Complete rewrite of the HTTP and library API. See detailed documentation in the wiki.
- BREAKING: The default coordinate order is now `longitude, latidue`. Exception: Polyline geometry
which follow the original Google specification of `latitdue, longitude`.
- BREAKING: Polyline geometries now use precision 5, instead of previously 6
- BREAKING: Removed GPX support
- New service `tile` which serves debug vector tiles of the road network
- Completely new engine for guidance generation:
- Support for highway ramps
- Support for different intersection types (end of street, forks, merges)
- Instruction post-processing to merge unimportant instructions
- Improved handling of roundabouts
- Tools:
- BREAKING: Renamed osrm-prepare to osrm-contract
- BREAKING: Removes profiles from osrm-contract, only needed in osrm-extract.
- Abort processing in osrm-extract if there are no snappable edges remaining.
- Added .properties file to osrm-extract ouput.
- Enables the use of multiple segment-speed-files on the osrm-contract command line
- Profile changes:
- Remove movable bridge mode
- Add `maxspeed=none` tag to car profile.
- A `side_road` tag support for the OSRM car profile.
- Fixes:
- Issue #2150: Prevents routing over delivery ways and nodes
- Issue #1972: Provide uninstall target
- Issue #2072: Disable alternatives by default and if core factor < 1.0
- Issue #1999: Fix unpacking for self-loop nodes not in core.
- Infrastructure:
- Cucumber test suit is now based on cucumber-js, removes Ruby as dependency
- Updated to mapbox/variant v1.1
- Updated to libosmium v2.6.1
- Remove GeoJSON based debugging output, replaced by debug tiles
# 5.0.0 RC2
- Profiles:
- `properties.allow_uturns_at_via` -> `properties.continue_straight_at_waypoint` (value is inverted!)
- API:
- Removed summary from legs property
- Disable steps and alternatives by default
- Fix `code` field: 'ok' -> 'Ok'
- Allow 4.json and 4.3.json format
- Conform to v5 spec and support "unlimited" as radiuses value.
- `uturns` parameter was replaced by `continue_straight` (value is inverted!)
- Features:
- Report progress for gennerating edge expanded edges in the edge based graph factory
- Add maxspeed=none tag to car profile.
- Optimize StaticRTree code: speedup 2x (to RC1)
- Optimize DouglasPeucker code: speedup 10x (to RC1)
- Optimize WebMercator projection: speedup 2x (to RC1)
- Bugs:
- #2195: Resolves issues with multiple includedirs in pkg-config file
- #2219: Internal server error when using the match plugin
- #2027: basename -> filename
- #2168: Report correct position where parsing failed
- #2036: Add license to storage and storage config exposed in public API
- Fix uturn detection in match plugin
- Add missing -lz to fix linking of server-tests
# 5.0.0 RC1
- Renamed osrm-prepare into osrm-contract
- osrm-contract does not need a profile parameter anymore
- New public HTTP API, find documentation [here](https://github.com/Project-OSRM/osrm-backend/wiki/New-Server-api)
- POST support is discontinued, please use library bindings for more complex requests
- Removed timestamp plugin
- Coordinate order is now Longitude,Latitude
- Cucumber tests now based on Javascript (run with `npm test`)
- Profile API changed:
- `forward_mode` and `backward_mode` now need to be selected from a pre-defined list
- Global profile properties are now stored in a global `properties` element. This includes:
- `properties.traffic_signal_penalty`
- `properties.use_turn_restrictions`
- `properties.u_turn_penalty`
- `properties.allow_u_turn_at_via`
+506 -182
View File
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 2.8.8)
cmake_minimum_required(VERSION 2.8.11)
# we depend on 2.8.11 introducing target_include_directories
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed.
@@ -6,14 +7,76 @@ Please create a directory and run cmake from there, passing the path to this sou
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
endif()
# detect if this is included as subproject and if so expose
# some variables to its parent scope
get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY)
if(BUILD_AS_SUBPROJECT)
message(STATUS "Building libosrm as subproject.")
endif()
option(ENABLE_MASON "Use mason for dependencies" OFF)
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
option(BUILD_TOOLS "Build OSRM tools" OFF)
option(BUILD_PACKAGE "Build OSRM package" OFF)
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
option(ENABLE_LTO "Use LTO if available" OFF)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
if(ENABLE_MASON)
# versions in use
set(MASON_BOOST_VERSION "1.63.0")
set(MASON_STXXL_VERSION "1.4.1")
set(MASON_EXPAT_VERSION "2.2.0")
set(MASON_LUA_VERSION "5.2.4")
set(MASON_BZIP2_VERSION "1.0.6")
set(MASON_TBB_VERSION "2017_20161128")
message(STATUS "Enabling mason")
find_program(CURL_FOUND curl)
if(NOT CURL_FOUND)
message(FATAL_ERROR "curl command required with -DENABLE_MASON")
endif()
set(MASON_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason)
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason.cmake)
endif()
# be compatible with version handling before cmake 3.x
if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 4)
set(OSRM_VERSION_MINOR 9)
set(OSRM_VERSION_PATCH 1)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 5)
set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
# these two functions build up custom variables:
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
# These variables we want to pass to
# include_directories and add_definitions for both
# this build and for sharing externally via pkg-config
function(add_dependency_includes includes)
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${includes}")
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
endfunction(add_dependency_includes)
function(add_dependency_defines defines)
list(APPEND OSRM_DEFINES "${defines}")
set(OSRM_DEFINES "${OSRM_DEFINES}" PARENT_SCOPE)
endfunction(add_dependency_defines)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCXXCompilerFlag)
include(FindPackageHandleStandardArgs)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -22,48 +85,41 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bitness 64)
message(STATUS "Building on a 64 bit system")
else()
message(WARNING "Building on a 32 bit system is unsupported")
message(STATUS "Building on a 32 bit system")
endif()
if(WIN32 AND MSVC_VERSION LESS 1800)
message(FATAL_ERROR "Building with Microsoft compiler needs Visual Studio 2013 or later (Express version works too)")
if(WIN32 AND MSVC_VERSION LESS 1900)
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
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(ENABLE_ASSERTIONS OFF)
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
endif()
endif()
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
"-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}"
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FingerPrint-Config.cmake"
COMMENT "Configuring revision fingerprint"
VERBATIM)
add_custom_target(tests DEPENDS engine-tests extractor-tests util-tests)
add_custom_target(benchmarks DEPENDS rtree-bench)
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread unit_test_framework)
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/util/version.hpp
)
file(GLOB UtilGlob src/util/*.cpp)
file(GLOB ExtractorGlob src/extractor/*.cpp)
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
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 IOTestsGlob unit_tests/io/*.cpp)
add_library(UTIL OBJECT ${UtilGlob})
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
@@ -72,51 +128,80 @@ add_library(STORAGE OBJECT ${StorageGlob})
add_library(ENGINE OBJECT ${EngineGlob})
add_library(SERVER OBJECT ${ServerGlob})
add_dependencies(UTIL FingerPrintConfigure)
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
add_executable(osrm-extract src/tools/extract.cpp)
add_executable(osrm-contract src/tools/contract.cpp)
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL>)
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
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: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>)
if(ENABLE_GOLD_LINKER)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
message(STATUS "Using GNU gold as linker.")
# Benchmarks
add_executable(rtree-bench EXCLUDE_FROM_ALL src/benchmarks/static_rtree.cpp $<TARGET_OBJECTS:UTIL>)
# Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
string(REGEX REPLACE ".*\\(GNU Binutils[^\\)0-9]+([0-9]+\\.[0-9]+)[^\\)]*\\).*" "\\1" GOLD_BINUTILS_VERSION "${LD_VERSION}")
if ("${GOLD_BINUTILS_VERSION}" VERSION_LESS "2.26")
message(STATUS "Disabling gc-sections on gold binutils < 2.26, see: https://sourceware.org/bugzilla/show_bug.cgi?id=17639")
set(LD_AVOID_GC_SECTIONS TRUE)
endif()
else()
message(WARNING "GNU gold linker isn't available.")
set(ENABLE_GOLD_LINKER OFF)
endif()
endif()
target_include_directories(util-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
target_include_directories(rtree-bench PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/unit_tests)
# Check the release mode
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
# Explicitly set the build type to Release if no other type is specified
# on the command line. Without this, cmake defaults to an unoptimized,
# non-debug build, which almost nobody wants.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type specified, defaulting to Release")
set(CMAKE_BUILD_TYPE Release)
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Configuring OSRM in debug mode")
elseif(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Configuring OSRM in release mode")
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring OSRM in release mode with debug flags")
elseif(CMAKE_BUILD_TYPE MATCHES MinRelSize)
message(STATUS "Configuring OSRM in release mode with minimized size")
else()
message(STATUS "Unrecognized build type - will use cmake defaults")
endif()
# Additional logic for the different build types
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring debug mode flags")
set(ENABLE_ASSERTIONS ON)
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline -fno-omit-frame-pointer")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ggdb")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline -fno-omit-frame-pointer")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ggdb")
else()
# Don't override the -O parameter for RelWithDebInfo, we want an optimized build
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
endif()
endif()
endif()
endif()
if(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Configuring OSRM in release mode")
if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring release mode optimizations")
# Check if LTO is available
check_cxx_compiler_flag("-flto" LTO_AVAILABLE)
if(LTO_AVAILABLE)
check_cxx_compiler_flag("-Wl,-flto" LTO_AVAILABLE)
if(ENABLE_LTO AND LTO_AVAILABLE)
set(OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# GCC in addition allows parallelizing LTO
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -130,33 +215,78 @@ if(CMAKE_BUILD_TYPE MATCHES Release)
check_cxx_source_compiles("${CHECK_LTO_SRC}" LTO_WORKS)
if(LTO_WORKS)
message(STATUS "LTO working")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -flto")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
else()
message(STATUS "LTO broken")
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
set(ENABLE_LTO Off)
endif()
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
message(STATUS "Using gcc specific binutils for LTO.")
set(CMAKE_AR "/usr/bin/gcc-ar")
set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")
find_program(GCC_AR gcc-ar)
find_program(GCC_RANLIB gcc-ranlib)
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
else()
message(STATUS "Using GCC specific binutils for LTO:")
message(STATUS " ${GCC_AR}")
message(STATUS " ${GCC_RANLIB}")
set(CMAKE_AR ${GCC_AR})
set(CMAKE_RANLIB ${GCC_RANLIB})
endif()
endif()
# Same for clang LTO requires their own toolchain
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
find_program(LLVM_AR llvm-ar)
find_program(LLVM_RANLIB llvm-ranlib)
if ("${LLVM_AR}" STREQUAL "LLVM_AR-NOTFOUND" OR "${LLVM_RANLIB}" STREQUAL "LLVM_RANLIB-NOTFOUND")
message(WARNING "LLVM specific binutils not found.")
else()
message(STATUS "Using LLVM specific binutils for LTO:")
message(STATUS " ${LLVM_AR}")
message(STATUS " ${LLVM_RANLIB}")
set(CMAKE_AR ${LLVM_AR})
set(CMAKE_RANLIB ${LLVM_RANLIB})
endif()
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038")
set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}")
set(ENABLE_LTO Off)
endif()
endif()
endif()
if(NOT WIN32)
add_definitions(-DBOOST_TEST_DYN_LINK)
if(UNIX AND NOT APPLE AND ENABLE_MASON AND (LTO_WORKS OR ENABLE_GOLD_LINKER))
message(WARNING "ENABLE_MASON and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux systems currently")
message(WARNING "For more details see: https://github.com/Project-OSRM/osrm-backend/issues/3202")
endif()
set(MAYBE_COVERAGE_LIBRARIES "")
if (ENABLE_COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "ENABLE_COVERAGE=ON only make sense with a Debug build")
endif()
message(INFO "Enabling coverage")
set(MAYBE_COVERAGE_LIBRARIES "-lgcov")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
endif()
if (ENABLE_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
endif()
# Configuring compilers
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(COLOR_FLAG "-fdiagnostics-color=auto")
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
@@ -164,9 +294,9 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(COLOR_FLAG "")
endif()
# using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
if(WIN32) # using mingw
add_definitions(-DWIN32)
add_dependency_defines(-DWIN32)
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
endif()
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
@@ -174,11 +304,13 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
# using Visual Studio C++
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DNOMINMAX) # avoid min and max macros that can break compilation
add_definitions(-D_WIN32_WINNT=0x0501)
add_definitions(-DXML_STATIC)
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib)
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS)
add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation
add_dependency_defines(-D_USE_MATH_DEFINES) #needed for M_PI with cmath.h
add_dependency_defines(-D_WIN32_WINNT=0x0501)
add_dependency_defines(-DXML_STATIC)
find_library(ws2_32_LIBRARY_PATH ws2_32)
target_link_libraries(osrm-extract wsock32 ws2_32)
endif()
@@ -188,7 +320,7 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ERROR_QUIET OUTPUT
# For ld.gold and ld.bfs (the GNU linkers) we optimize hard
if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld")
message(STATUS "Setting linker optimizations")
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
if(NOT (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" OR "${LD_AVOID_GC_SECTIONS}"))
# Tell compiler to put every function in separate section, linker can then match sections and functions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
# Tell linker to do dead code and data eminination during link time discarding sections
@@ -196,20 +328,25 @@ if("${LINKER_VERSION}" MATCHES "GNU gold" OR "${LINKER_VERSION}" MATCHES "GNU ld
endif()
# Default linker optimization flags
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common")
else()
message(STATUS "Using unknown linker, not setting linker optimizations")
endif ()
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} ${LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# Activate C++11
# Activate C++1y
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -std=c++1y")
endif()
# Configuring other platform dependencies
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
message(STATUS "Set Architecture to x64 on OS X")
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
@@ -224,42 +361,182 @@ if(APPLE)
endif()
if(UNIX AND NOT APPLE)
set(MAYBE_RT_LIBRARY rt)
set(MAYBE_RT_LIBRARY -lrt)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
find_package(Osmium REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
find_package(Boost 1.49.0 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_SPIRIT_USE_PHOENIX_V3 -DBOOST_RESULT_OF_USE_DECLTYPE)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
# Disallow deprecated protozero APIs
add_definitions(-DPROTOZERO_STRICT_API)
find_package(Threads REQUIRED)
find_package(TBB REQUIRED)
include_directories(SYSTEM ${TBB_INCLUDE_DIR})
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
# if mason is enabled no find_package calls are made
# to ensure that we are only compiling and linking against
# fully portable mason packages
if(ENABLE_MASON)
message(STATUS "Installing dependencies via mason")
set(Boost_USE_STATIC_LIBS ON)
mason_use(boost VERSION ${MASON_BOOST_VERSION} HEADER_ONLY)
add_dependency_includes(${MASON_PACKAGE_boost_INCLUDE_DIRS})
mason_use(boost_libfilesystem VERSION ${MASON_BOOST_VERSION})
set(Boost_FILESYSTEM_LIBRARY ${MASON_PACKAGE_boost_libfilesystem_STATIC_LIBS})
mason_use(boost_libiostreams VERSION ${MASON_BOOST_VERSION})
set(Boost_IOSTREAMS_LIBRARY ${MASON_PACKAGE_boost_libiostreams_STATIC_LIBS})
mason_use(boost_libprogram_options VERSION ${MASON_BOOST_VERSION})
set(Boost_PROGRAM_OPTIONS_LIBRARY ${MASON_PACKAGE_boost_libprogram_options_STATIC_LIBS})
mason_use(boost_libregex VERSION ${MASON_BOOST_VERSION})
set(Boost_REGEX_LIBRARY ${MASON_PACKAGE_boost_libregex_STATIC_LIBS})
mason_use(boost_libtest VERSION ${MASON_BOOST_VERSION})
set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY ${MASON_PACKAGE_boost_libtest_STATIC_LIBS})
mason_use(boost_libdate_time VERSION ${MASON_BOOST_VERSION})
set(Boost_DATE_TIME_LIBRARY ${MASON_PACKAGE_boost_libdate_time_STATIC_LIBS})
mason_use(boost_libthread VERSION ${MASON_BOOST_VERSION})
set(Boost_THREAD_LIBRARY ${MASON_PACKAGE_boost_libthread_STATIC_LIBS})
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
set(STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
set(EXPAT_LIBRARIES ${MASON_PACKAGE_expat_STATIC_LIBS})
mason_use(lua VERSION ${MASON_LUA_VERSION})
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
mason_use(tbb VERSION ${MASON_TBB_VERSION})
add_dependency_includes(${MASON_PACKAGE_tbb_INCLUDE_DIRS})
set(TBB_LIBRARIES ${MASON_PACKAGE_tbb_LDFLAGS})
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
endif()
set(TBB_LINKER_RPATHS "")
foreach(libpath ${MASON_PACKAGE_tbb_LIBRARY_DIRS})
set(TBB_LINKER_RPATHS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,${libpath}")
file(GLOB TBBGlob ${libpath}/*.*)
install(FILES ${TBBGlob} DESTINATION lib)
endforeach()
if(APPLE)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} -Wl,-rpath -Wl,@executable_path")
elseif(UNIX)
set(LINKER_FLAGS "${TBB_LINKER_RPATHS} '-Wl,-rpath,$ORIGIN' -Wl,-z,origin")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
# note: we avoid calling find_package(Osmium ...) here to ensure that the
# expat and bzip2 are used from mason rather than the system
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
else()
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
add_dependency_includes(${Boost_INCLUDE_DIRS})
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
endif()
find_package(TBB REQUIRED)
add_dependency_includes(${TBB_INCLUDE_DIR})
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
endif()
find_package(EXPAT REQUIRED)
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
find_package(STXXL REQUIRED)
add_dependency_includes(${STXXL_INCLUDE_DIR})
find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})
FIND_PACKAGE(Lua 5.2 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1 EXACT)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
# Now fall back to a lua verison without exact
# in case this cmake version also forces patch versions
FIND_PACKAGE(Lua 5.2)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
FIND_PACKAGE(Lua 5.1)
IF (LUA_FOUND)
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
ELSE()
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
add_dependency_includes(${LUA_INCLUDE_DIR})
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()
# note libosmium depends on expat and bzip2
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
find_package(Osmium REQUIRED COMPONENTS io)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
endif()
find_package( Luabind REQUIRED )
include(check_luabind)
include_directories(SYSTEM ${LUABIND_INCLUDE_DIR})
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
if(LUAJIT_FOUND)
set(USED_LUA_LIBRARIES, LUAJIT_LIBRARIES)
# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Using ccache to speed up incremental builds")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
set(ENV{CCACHE_CPP2} "true")
endif()
endif()
include_directories(SYSTEM ${LUA_INCLUDE_DIR})
find_package(EXPAT REQUIRED)
include_directories(SYSTEM ${EXPAT_INCLUDE_DIRS})
# even with mason builds we want to link to system zlib
# to ensure that osrm binaries play well with other binaries like nodejs
find_package(ZLIB REQUIRED)
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
find_package(STXXL REQUIRED)
include_directories(SYSTEM ${STXXL_INCLUDE_DIR})
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
endif()
add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
set(OpenMP_FIND_QUIETLY ON)
find_package(OpenMP)
@@ -268,94 +545,92 @@ if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
find_package(BZip2 REQUIRED)
include_directories(SYSTEM ${BZIP_INCLUDE_DIRS})
add_definitions(${OSRM_DEFINES})
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})
find_package(ZLIB REQUIRED)
include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
set(BOOST_BASE_LIBRARIES
${Boost_DATE_TIME_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_SYSTEM_LIBRARY})
if (ENABLE_JSON_LOGGING)
message(STATUS "Enabling json logging")
add_definitions(-DENABLE_JSON_LOGGING)
endif()
set(BOOST_ENGINE_LIBRARIES
${Boost_ZLIB_LIBRARY}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_LIBRARIES})
# Binaries
target_link_libraries(osrm-datastore osrm_store ${Boost_LIBRARIES})
target_link_libraries(osrm-extract osrm_extract ${Boost_LIBRARIES})
target_link_libraries(osrm-contract osrm_contract ${Boost_LIBRARIES})
target_link_libraries(osrm-routed osrm ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
set(EXTRACTOR_LIBRARIES
${BZIP2_LIBRARIES}
${Boost_LIBRARIES}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${EXPAT_LIBRARIES}
${LUABIND_LIBRARY}
${USED_LUA_LIBRARIES}
${OSMIUM_LIBRARIES}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
${ZLIB_LIBRARY})
${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(CONTRACTOR_LIBRARIES
${Boost_LIBRARIES}
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${LUABIND_LIBRARY}
${USED_LUA_LIBRARIES}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY})
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(ENGINE_LIBRARIES
${Boost_LIBRARIES}
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY})
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
set(STORAGE_LIBRARIES
${Boost_LIBRARIES}
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY})
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(UTIL_LIBRARIES
${Boost_LIBRARIES}
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY}
${TBB_LIBRARIES})
${TBB_LIBRARIES}
${MAYBE_COVERAGE_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(extractor-tests ${EXTRACTOR_LIBRARIES})
target_link_libraries(rtree-bench ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES})
target_link_libraries(util-tests ${UTIL_LIBRARIES})
# BUILD_COMPONENTS
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES})
install(TARGETS osrm-components DESTINATION bin)
if(BUILD_TOOLS)
message(STATUS "Activating OSRM internal tools")
find_package(GDAL)
if(GDAL_FOUND)
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES})
include_directories(SYSTEM ${GDAL_INCLUDE_DIR})
target_link_libraries(osrm-components ${GDAL_LIBRARIES} ${Boost_LIBRARIES})
install(TARGETS osrm-components DESTINATION bin)
else()
message(WARNING "libgdal and/or development headers not found")
endif()
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-io-benchmark ${Boost_LIBRARIES})
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-unlock-all ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if(UNIX AND NOT APPLE)
target_link_libraries(osrm-unlock-all rt)
endif()
add_executable(osrm-springclean src/tools/springclean.cpp $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-springclean ${Boost_LIBRARIES})
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
install(TARGETS osrm-io-benchmark DESTINATION bin)
install(TARGETS osrm-unlock-all DESTINATION bin)
install(TARGETS osrm-springclean DESTINATION bin)
find_package(Shapefile) # package libshp-dev
if(Shapefile_FOUND)
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LIBSHAPEFILE_LIBRARY})
install(TARGETS osrm-extract-conditionals DESTINATION bin)
endif()
endif()
if (ENABLE_ASSERTIONS)
@@ -371,19 +646,22 @@ set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
file(GLOB VariantGlob third_party/variant/*.hpp)
file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp)
file(GLOB LibraryGlob include/osrm/*.hpp)
set(EngineHeader include/engine/engine.hpp include/engine/engine_config.hpp include/engine/route_parameters.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp)
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
#set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
install(FILES ${LibraryGlob} DESTINATION include/osrm)
install(FILES ${VariantGlob} DESTINATION include/variant)
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
install(FILES ${VariantGlob} DESTINATION include/mapbox)
install(TARGETS osrm-extract DESTINATION bin)
install(TARGETS osrm-contract DESTINATION bin)
install(TARGETS osrm-datastore DESTINATION bin)
@@ -393,44 +671,54 @@ install(TARGETS osrm_extract DESTINATION lib)
install(TARGETS osrm_contract DESTINATION lib)
install(TARGETS osrm_store DESTINATION lib)
list(GET ENGINE_LIBRARIES 1 ENGINE_LIBRARY_FIRST)
foreach(lib ${ENGINE_LIBRARIES})
get_filename_component(ENGINE_LIBRARY_PATH "${ENGINE_LIBRARY_FIRST}" PATH)
get_filename_component(ENGINE_LIBRARY_NAME "${lib}" NAME_WE)
string(REPLACE "lib" "" ENGINE_LIBRARY_NAME ${ENGINE_LIBRARY_NAME})
string(REPLACE "-l" "" ENGINE_LIBRARY_NAME ${ENGINE_LIBRARY_NAME})
set(ENGINE_LIBRARY_LISTING "${ENGINE_LIBRARY_LISTING} -L${ENGINE_LIBRARY_PATH} -l${ENGINE_LIBRARY_NAME}")
endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)
# Install profiles and support library to /usr/local/share/osrm/profiles by default
set(DefaultProfilesDir profiles)
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
if(BUILD_DEBIAN_PACKAGE)
include(CPackDebianConfig)
# Setup exporting variables for pkgconfig and subproject
#
if(BUILD_PACKAGE)
include(CPackConfig)
include(CPack)
endif()
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
function(JOIN VALUES GLUE OUTPUT)
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()
JOIN("${OSRM_DEFINES}" " " TMP_OSRM_DEFINES)
set(LibOSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${TMP_OSRM_DEFINES}")
set(LibOSRM_LDFLAGS "${OSRM_LDFLAGS}")
if(BUILD_AS_SUBPROJECT)
set(LibOSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(LibOSRM_LIBRARIES "osrm" PARENT_SCOPE)
set(LibOSRM_DEPENDENT_LIBRARIES "${ENGINE_LIBRARIES}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/include/osrm"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party"
"${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIRS "${LibOSRM_LIBRARY_DIR}" PARENT_SCOPE)
endif()
# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Using ccache to speed up incremental builds")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
set(ENV{CCACHE_CPP2} "true")
endif()
endif()
# pkgconfig defines
set(PKGCONFIG_OSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}")
set(PKGCONFIG_OSRM_LDFLAGS "${LibOSRM_LDFLAGS}")
set(PKGCONFIG_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set(PKGCONFIG_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm")
JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
# uninstall target
configure_file(
@@ -440,3 +728,39 @@ 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)
if (ENABLE_FUZZING)
# Requires libosrm being built with sanitizers; make configurable and default to ubsan
set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing")
set_property(CACHE FUZZ_SANITIZER PROPERTY STRINGS "undefined" "integer" "address" "memory" "thread" "leak")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fsanitize=address")
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
add_subdirectory(fuzz)
endif ()
## add headers sanity check target that includes all headers independently
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
file(GLOB_RECURSE headers_to_check
${PROJECT_BINARY_DIR}/*.hpp
${PROJECT_SOURCE_DIR}/include/*.hpp)
foreach(header ${headers_to_check})
get_filename_component(filename ${header} NAME_WE)
set(filename "${check_headers_dir}/${filename}.cpp")
if (NOT EXISTS ${filename})
file(WRITE ${filename} "#include \"${header}\"\n")
endif()
list(APPEND sources ${filename})
endforeach()
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
+77
View File
@@ -0,0 +1,77 @@
# User
Before you open a new issue, please search for older ones that cover the same issue.
In general "me too" comments/issues are frowned upon.
You can add a :+1: emoji to the issue if you want to express interest in this.
# Developer
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
To save development time a local hook `.git/hooks/pre-push`
```
#!/bin/sh
remote="$1"
if [ x"$remote" = xorigin ] ; then
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
echo "Rejected push to $remote/master" ; exit 1
fi
./scripts/format.sh
if [ $? -ne 0 ] ; then
echo "Unstaged format changes" ; exit 1
fi
fi
```
could check code format, modify a local repository and reject push due to unstaged formatting changes.
Also `pre-push` hook rejects direct pushes to `origin/master`.
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
## Pull Request
Every pull-request that changes the API needs to update the docs in `docs/http.md` and add an entry to `CHANGELOG.md`.
Breaking changes need to have a BREAKING prefix. See the [releasing documentation](docs/releasing.md) on how this affects the version.
Early feedback is also important.
You will see that a lot of the PR have tags like `[not ready]` or `[wip]`.
We like to open PRs as soon as we are starting to work on something to make it visible to the rest of the team.
If your work is going in entirely the wrong direction, there is a good chance someone will pick up on this before it is too late.
Everyone is encouraged to read PRs of other people and give feedback.
For every significant code change we require a pull request review before it is merged.
If your pull request modifies the API this need to be signed of by a team discussion.
This means you will need to find another member of the team with commit access and request a review of your pull request.
Once your pull request is reviewed you can merge it! If you don't have commit access, ping someone that has commit access.
If you do have commit access there are in general two accepted styles to merging:
1. Make sure the branch is up to date with `master`. Run `git rebase master` to find out.
2. Once that is ensured you can either:
- Click the nice green merge button (for a non-fast-forward merge)
- Merge by hand using a fast-forward merge
Which merge you prefer is up to personal preference. In general it is recommended to use fast-forward merges because it creates a history that is sequential and easier to understand.
# Maintainer
## Doing a release
There is an in-depth guide around how to push out a release once it is ready [here](docs/releasing.md).
## The API
Changes to the API need to be discussed and signed off by the team. Breaking changes even more so than additive changes.
## Milestones
If a pull request or an issue is applicable for the current or next milestone, depends on the target version number.
Since we use semantic versioning we restrict breaking changes to major releases.
After a Release Candidate is released we usually don't change the API anymore if it is not critical.
Bigger code changes after a RC was released should also be avoided.
+1
View File
@@ -18,6 +18,7 @@ RECURSIVE = YES
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/third_party \
@CMAKE_CURRENT_SOURCE_DIR@/build \
@CMAKE_CURRENT_SOURCE_DIR@/node_modules \
@CMAKE_CURRENT_SOURCE_DIR@/unit_tests \
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
@CMAKE_CURRENT_SOURCE_DIR@/features
-7
View File
@@ -1,7 +0,0 @@
source "http://rubygems.org"
gem "cucumber"
gem "rake"
gem "osmlib-base"
gem "sys-proctable"
gem "rspec-expectations"
-35
View File
@@ -1,35 +0,0 @@
GEM
remote: http://rubygems.org/
specs:
builder (3.2.2)
cucumber (2.0.0)
builder (>= 2.1.2)
cucumber-core (~> 1.1.3)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (1.1.3)
gherkin (~> 2.12.0)
diff-lcs (1.2.5)
gherkin (2.12.2)
multi_json (~> 1.3)
multi_json (1.11.0)
multi_test (0.1.2)
osmlib-base (0.1.4)
rake (10.4.2)
rspec-expectations (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.2)
sys-proctable (0.9.8)
PLATFORMS
ruby
DEPENDENCIES
cucumber
osmlib-base
rake
rspec-expectations
sys-proctable
+79 -14
View File
@@ -1,25 +1,91 @@
## About
## Open Source Routing Machine
The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
| Linux / macOS | Windows | Code Coverage |
| ------------- | ------- | ------------- |
| [![Travis](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=master)](https://travis-ci.org/Project-OSRM/osrm-backend) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [![Codecov](https://codecov.io/gh/Project-OSRM/osrm-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/Project-OSRM/osrm-backend) |
## Current build status
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
| build config | branch | status |
|:-------------|:--------|:------------|
| Linux | master | [![Build Status](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=master)](https://travis-ci.org/Project-OSRM/osrm-backend) |
| 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) |
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
- Nearest - Snaps coordinates to the street network and returns the nearest matches
- Route - Finds the fastest route between coordinates
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
- Match - Snaps noisy GPS traces to the road network in the most plausible way
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
## Building
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
For instructions on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
## Contact
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
## Quick Start
The following targets Ubuntu 16.04.
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
#### Install dependencies
```bash
sudo apt install build-essential git cmake pkg-config \
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
```
#### Compile and install OSRM binaries:
```bash
mkdir -p build
cd build
cmake ..
cmake --build .
sudo cmake --build . --target install
```
#### Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
```bash
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
```
#### Pre-process the extract and start the HTTP server
```
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm
```
#### Running Queries
```
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
```
## Documentation
See the Wiki's [server API documentation](https://github.com/Project-OSRM/osrm-backend/wiki/Server-api) as well as the [library API documentation](https://github.com/Project-OSRM/osrm-backend/wiki/Library-api)
### Full documentation
- [Hosted documentation](http://project-osrm.org)
- [osrm-routed HTTP API documentation](docs/http.md)
- [libosrm API documentation](docs/libosrm.md)
### Running a request against the Demo Server
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
Simple query with instructions and alternatives on Berlin:
```
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
```
## References in publications
@@ -43,4 +109,3 @@ When using the code in a (scientific) publication, please cite
address = {New York, NY, USA},
}
```
-190
View File
@@ -1,190 +0,0 @@
require 'OSM/StreamParser'
require 'socket'
require 'digest/sha1'
require 'cucumber/rake/task'
require 'sys/proctable'
BUILD_FOLDER = 'build'
DATA_FOLDER = 'sandbox'
PROFILE = 'bicycle'
OSRM_PORT = 5000
PROFILES_FOLDER = '../profiles'
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format pretty}
end
areas = {
:kbh => { :country => 'denmark', :bbox => 'top=55.6972 left=12.5222 right=12.624 bottom=55.6376' },
:frd => { :country => 'denmark', :bbox => 'top=55.7007 left=12.4765 bottom=55.6576 right=12.5698' },
:regh => { :country => 'denmark', :bbox => 'top=56.164 left=11.792 bottom=55.403 right=12.731' },
:denmark => { :country => 'denmark', :bbox => nil },
:skaane => { :country => 'sweden', :bbox => 'top=56.55 left=12.4 bottom=55.3 right=14.6' }
}
osm_data_area_name = ARGV[1] ? ARGV[1].to_s.to_sym : :kbh
raise "Unknown data area." unless areas[osm_data_area_name]
osm_data_country = areas[osm_data_area_name][:country]
osm_data_area_bbox = areas[osm_data_area_name][:bbox]
task osm_data_area_name.to_sym {} #define empty task to prevent rake from whining. will break if area has same name as a task
def each_process name, &block
Sys::ProcTable.ps do |process|
if process.comm.strip == name.strip && process.state != 'zombie'
yield process.pid.to_i, process.state.strip
end
end
end
def up?
find_pid('osrm-routed') != nil
end
def find_pid name
each_process(name) { |pid,state| return pid.to_i }
return nil
end
def wait_for_shutdown name
timeout = 10
(timeout*10).times do
return if find_pid(name) == nil
sleep 0.1
end
raise "*** Could not terminate #{name}."
end
desc "Rebuild and run tests."
task :default => [:build]
desc "Build using CMake."
task :build do
if Dir.exists? BUILD_FOLDER
Dir.chdir BUILD_FOLDER do
system "make"
end
else
system "mkdir build; cd build; cmake ..; make"
end
end
desc "Setup config files."
task :setup do
end
desc "Download OSM data."
task :download do
Dir.mkdir "#{DATA_FOLDER}" unless File.exist? "#{DATA_FOLDER}"
puts "Downloading..."
puts "curl http://download.geofabrik.de/europe/#{osm_data_country}-latest.osm.pbf -o #{DATA_FOLDER}/#{osm_data_country}.osm.pbf"
raise "Error while downloading data." unless system "curl http://download.geofabrik.de/europe/#{osm_data_country}-latest.osm.pbf -o #{DATA_FOLDER}/#{osm_data_country}.osm.pbf"
if osm_data_area_bbox
puts "Cropping and converting to protobuffer..."
raise "Error while cropping data." unless system "osmosis --read-pbf file=#{DATA_FOLDER}/#{osm_data_country}.osm.pbf --bounding-box #{osm_data_area_bbox} --write-pbf file=#{DATA_FOLDER}/#{osm_data_area_name}.osm.pbf omitmetadata=true"
end
end
desc "Crop OSM data"
task :crop do
if osm_data_area_bbox
raise "Error while cropping data." unless system "osmosis --read-pbf file=#{DATA_FOLDER}/#{osm_data_country}.osm.pbf --bounding-box #{osm_data_area_bbox} --write-pbf file=#{DATA_FOLDER}/#{osm_data_area_name}.osm.pbf omitmetadata=true"
end
end
desc "Reprocess OSM data."
task :process => [:extract,:contract] do
end
desc "Extract OSM data."
task :extract do
Dir.chdir DATA_FOLDER do
raise "Error while extracting data." unless system "../#{BUILD_FOLDER}/osrm-extract #{osm_data_area_name}.osm.pbf --profile ../profiles/#{PROFILE}.lua"
end
end
desc "Contract OSM data."
task :contract do
Dir.chdir DATA_FOLDER do
raise "Error while contracting data." unless system "../#{BUILD_FOLDER}/osrm-contract #{osm_data_area_name}.osrm"
end
end
desc "Delete preprocessing files."
task :clean do
File.delete *Dir.glob("#{DATA_FOLDER}/*.osrm")
File.delete *Dir.glob("#{DATA_FOLDER}/*.osrm.*")
end
desc "Run all cucumber test"
task :test do
system "cucumber"
puts
end
desc "Run the routing server in the terminal. Press Ctrl-C to stop."
task :run do
Dir.chdir DATA_FOLDER do
system "../#{BUILD_FOLDER}/osrm-routed #{osm_data_area_name}.osrm --port #{OSRM_PORT}"
end
end
desc "Launch the routing server in the background. Use rake:down to stop it."
task :up do
Dir.chdir DATA_FOLDER do
abort("Already up.") if up?
pipe = IO.popen("../#{BUILD_FOLDER}/osrm-routed #{osm_data_area_name}.osrm --port #{OSRM_PORT} 1>>osrm-routed.log 2>>osrm-routed.log")
timeout = 5
(timeout*10).times do
begin
socket = TCPSocket.new('localhost', OSRM_PORT)
socket.puts 'ping'
rescue Errno::ECONNREFUSED
sleep 0.1
end
end
end
end
desc "Stop the routing server."
task :down do
pid = find_pid 'osrm-routed'
if pid
Process.kill 'TERM', pid
else
puts "Already down."
end
end
desc "Kill all osrm-extract, osrm-contract and osrm-routed processes."
task :kill do
each_process('osrm-routed') { |pid,state| Process.kill 'KILL', pid }
each_process('osrm-contract') { |pid,state| Process.kill 'KILL', pid }
each_process('osrm-extract') { |pid,state| Process.kill 'KILL', pid }
wait_for_shutdown 'osrm-routed'
wait_for_shutdown 'osrm-contract'
wait_for_shutdown 'osrm-extract'
end
desc "Get PIDs of all osrm-extract, osrm-contract and osrm-routed processes."
task :pid do
each_process 'osrm-routed' do |pid,state|
puts "#{pid}\t#{state}"
end
end
desc "Stop, reprocess and restart."
task :update => [:down,:process,:up] do
end
desc "Remove test cache files."
task :sweep do
system "rm test/cache/*"
end
+59 -10
View File
@@ -8,16 +8,39 @@ SET PROJECT_DIR=%CD%
ECHO PROJECT_DIR^: %PROJECT_DIR%
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
ECHO cmake^: && cmake --version
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
:CMAKE_NOT_OK
SET CMAKE_VERSION=3.7.1
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
:CMAKE_OK
ECHO CMAKE_OK
cmake --version
ECHO activating VS command prompt ...
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
ECHO platform^: %platform%
ECHO cl.exe version
cl
ECHO msbuild version
msbuild /version
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
SET DEPSPKG=osrm-deps-win-x64-14.0.7z
:: local development
ECHO.
ECHO LOCAL_DEV^: %LOCAL_DEV%
IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0
IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL
@@ -33,27 +56,39 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST build ECHO deletings build dir... && RD /S /Q build
IF EXIST build ECHO deleting build dir... && RD /S /Q build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
::tree osrm-deps
MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cd build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET OSRMDEPSDIR=%PROJECT_DIR%\osrm-deps
SET OSRMDEPSDIR=%PROJECT_DIR%/osrm-deps
set PREFIX=%OSRMDEPSDIR%/libs
set BOOST_ROOT=%OSRMDEPSDIR%/boost
set BOOST_LIBRARYDIR=%BOOST_ROOT%/lib
set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb
set TBB_ARCH_PLATFORM=intel64/vc14
ECHO OSRMDEPSDIR ^: %OSRMDEPSDIR%
ECHO PREFIX ^: %PREFIX%
ECHO BOOST_ROOT ^: %BOOST_ROOT%
ECHO BOOST_LIBRARYDIR ^: %BOOST_LIBRARYDIR%
ECHO TBB_INSTALL_DIR ^: %TBB_INSTALL_DIR%
ECHO TBB_ARCH_PLATFORM ^: %TBB_ARCH_PLATFORM%
ECHO calling cmake ....
cmake .. ^
-G "Visual Studio 14 2015 Win64" ^
-DBOOST_ROOT=%BOOST_ROOT% ^
-DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^
-DBoost_ADDITIONAL_VERSIONS=1.58 ^
-DBoost_USE_MULTITHREADED=ON ^
-DBoost_USE_STATIC_LIBS=ON ^
@@ -81,17 +116,31 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
ECHO running 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 ...
%Configuration%\util-tests.exe
unit_tests\%Configuration%\extractor-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
ECHO running engine-tests.exe ...
unit_tests\%Configuration%\engine-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
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running library-tests.exe ...
SET test_region=monaco
SET test_osm=%test_region%.osm.pbf
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
%Configuration%\osrm-contract.exe %test_region%.osrm
unit_tests\%Configuration%\library-tests.exe %test_region%.osrm
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
ECHO ========= CREATING PACKAGES ==========
CD %PROJECT_DIR%\build\%Configuration%
+11 -8
View File
@@ -3,6 +3,9 @@ environment:
- configuration: Release
# - configuration: Debug
install:
- ps: Install-Product node 6
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
@@ -17,7 +20,14 @@ platform: x64
build_script:
- CALL appveyor-build.bat
test: off
before_test:
- node --version
- npm --version
- npm install
- npm link
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
- SET OSRM_BUILD_DIR=build\%Configuration%
- npm test
artifacts:
- path: osrm_Release.zip
@@ -28,7 +38,6 @@ artifacts:
branches:
only:
- master
- develop
deploy:
provider: FTP
@@ -41,9 +50,3 @@ deploy:
folder: /
enable_ssl: true
active_mode: false
# notifications:
# - provider: HipChat
# auth_token:
# secure: boLE7BjcahdIUxv9jkN7U3F8iOASF+MkhtctlVoWJoo=
# room: Directions
+1 -1
View File
@@ -11,7 +11,7 @@ SET CONFIGURATION=Release
FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.4.0-win32-x86\bin;%PATH%
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.7.0-rc2-win32-x86\bin;%PATH%
SET PATH=C:\Program Files\7-Zip;%PATH%
powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
+44
View File
@@ -0,0 +1,44 @@
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
ENDIF()
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
SET(CPACK_STRIP_FILES "TRUE")
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
if(DPKG_PROGRAM)
SET(CPACK_GENERATOR "DEB")
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
else(DPKG_PROGRAM)
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
if(RPMBUILD_PROGRAM)
SET(CPACK_GENERATOR "RPM")
execute_process(
COMMAND ${RPM_PROGRAM} --eval %{_arch}
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif(RPMBUILD_PROGRAM)
endif(DPKG_PROGRAM)
-41
View File
@@ -1,41 +0,0 @@
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
ENDIF()
INCLUDE(FindDebArch)
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
# To create a proper Debian/Ubuntu package, the following CMake
# options should be used:
SET(CPACK_STRIP_FILES "TRUE")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
+194
View File
@@ -0,0 +1,194 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindLua
# -------
#
#
#
# Locate Lua library This module defines
#
# ::
#
# LUA_FOUND - if false, do not try to link to Lua
# LUA_LIBRARIES - both lua and lualib
# LUA_INCLUDE_DIR - where to find lua.h
# LUA_VERSION_STRING - the version of Lua found
# LUA_VERSION_MAJOR - the major version of Lua
# LUA_VERSION_MINOR - the minor version of Lua
# LUA_VERSION_PATCH - the patch version of Lua
#
#
#
# Note that the expected include convention is
#
# ::
#
# #include "lua.h"
#
# and not
#
# ::
#
# #include <lua/lua.h>
#
# This is because, the lua location is not standardized and may exist in
# locations other than lua/
unset(_lua_include_subdirs)
unset(_lua_library_names)
unset(_lua_append_versions)
# this is a function only to have all the variables inside go away automatically
function(_lua_set_version_vars)
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
if (Lua_FIND_VERSION_EXACT)
if (Lua_FIND_VERSION_COUNT GREATER 1)
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
endif ()
elseif (Lua_FIND_VERSION)
# once there is a different major version supported this should become a loop
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
if (Lua_FIND_VERSION_COUNT EQUAL 1)
set(_lua_append_versions ${LUA_VERSIONS5})
else ()
foreach (subver IN LISTS LUA_VERSIONS5)
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
list(APPEND _lua_append_versions ${subver})
endif ()
endforeach ()
endif ()
endif ()
else ()
# once there is a different major version supported this should become a loop
set(_lua_append_versions ${LUA_VERSIONS5})
endif ()
list(APPEND _lua_include_subdirs "include/lua" "include")
foreach (ver IN LISTS _lua_append_versions)
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
list(APPEND _lua_include_subdirs
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
)
list(APPEND _lua_library_names
lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
)
endforeach ()
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
endfunction(_lua_set_version_vars)
function(_lua_check_header_version _hdr_file)
# At least 5.[012] have different ways to express the version
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
file(STRINGS "${_hdr_file}" lua_version_strings
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
else ()
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
endif ()
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
endif ()
foreach (ver IN LISTS _lua_append_versions)
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
return()
endif ()
endforeach ()
endfunction(_lua_check_header_version)
_lua_set_version_vars()
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
endif ()
if (NOT LUA_VERSION_STRING)
foreach (subdir IN LISTS _lua_include_subdirs)
unset(LUA_INCLUDE_PREFIX CACHE)
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
HINTS
ENV LUA_DIR
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
if (LUA_INCLUDE_PREFIX)
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
if (LUA_VERSION_STRING)
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
break()
endif ()
endif ()
endforeach ()
endif ()
unset(_lua_include_subdirs)
unset(_lua_append_versions)
find_library(LUA_LIBRARY
NAMES ${_lua_library_names} lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
unset(_lua_library_names)
if (LUA_LIBRARY)
# include the math library for Unix
if (UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
# include dl library for statically-linked Lua library
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# For Windows and Mac, don't need to explicitly include the math library
else ()
set(LUA_LIBRARIES "${LUA_LIBRARY}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)
-82
View File
@@ -1,82 +0,0 @@
# Locate Lua library
# This module defines
# LUA52_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
# Copyright 2016 for Project-OSRM, Lua5.1 => Lua5.2
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua-5.2 include/lua include
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
find_library(LUA_LIBRARY
NAMES lua52 lua5.2 lua-5.2 lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
if(LUA_LIBRARY)
# include the math library for Unix
if(UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
else()
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
endif()
endif()
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
unset(lua_version_str)
endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
-93
View File
@@ -1,93 +0,0 @@
# Locate Lua library
# This module defines
# LUAJIT_FOUND, if false, do not try to link to Lua
# LUAJIT_LIBRARIES
# LUAJIT_INCLUDE_DIR, where to find lua.h
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
#
# ################
# 2010 - modified for cronkite to find luajit instead of lua, as it was before.
#
if ( NOT LuaJIT_FIND_VERSION )
MESSAGE(FATAL_ERROR "You need to specify a version of libluajit to use")
ENDIF()
IF( NOT LUAJIT_FIND_QUIETLY )
MESSAGE(STATUS "Looking for LuaJIT ${LuaJIT_FIND_VERSION}")
ENDIF()
FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
HINTS
$ENV{LUAJIT_DIR}
PATH_SUFFIXES include/luajit-2.0 include/luajit2.0 include/luajit include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
FIND_LIBRARY(LUAJIT_LIBRARY
NAMES luajit-${LuaJIT_FIND_VERSION_MAJOR}${LuaJIT_FIND_VERSION_MINOR} luajit-${LuaJIT_FIND_VERSION}
HINTS
$ENV{LUAJIT_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
IF(LUAJIT_LIBRARY)
# include the math library for Unix
IF(UNIX AND NOT APPLE)
FIND_LIBRARY(LUAJIT_MATH_LIBRARY m)
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
ELSE(UNIX AND NOT APPLE)
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
ENDIF(UNIX AND NOT APPLE)
ENDIF(LUAJIT_LIBRARY)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LUAJIT DEFAULT_MSG LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
IF( NOT LUAJIT_FIND_QUIETLY )
IF( LUAJIT_FOUND AND LUAJIT_LIBRARIES)
MESSAGE(STATUS "Found LuaJIT: ${LUAJIT_LIBRARY}" )
MARK_AS_ADVANCED(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
ELSE()
SET ( LUAJIT_FOUND FALSE )
ENDIF()
ENDIF()
-75
View File
@@ -1,75 +0,0 @@
# Locate Luabind library
# This module defines
# LUABIND_FOUND, if false, do not try to link to Luabind
# LUABIND_LIBRARIES
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
#
# Note that the expected include convention is
# #include <luabind/luabind.hpp>
# and not
# #include <luabind.hpp>
IF( NOT LUABIND_FIND_QUIETLY )
MESSAGE(STATUS "Looking for Luabind...")
ENDIF()
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES luabind include/luabind include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local # DarwinPorts
/opt
)
FIND_LIBRARY(LUABIND_LIBRARY
NAMES luabind luabind09
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local
/opt
)
FIND_LIBRARY(LUABIND_LIBRARY_DBG
NAMES luabindd
HINTS
$ENV{LUABIND_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt/local
/opt
)
IF(LUABIND_LIBRARY)
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
ENDIF(LUABIND_LIBRARY)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
IF( NOT LUABIND_FIND_QUIETLY )
IF( LUABIND_FOUND )
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
ENDIF()
IF( LUABIND_LIBRARY_DBG )
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
ENDIF()
ENDIF()
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
+21
View File
@@ -0,0 +1,21 @@
# - Try to find Shapefile C Library
# http://shapelib.maptools.org/
#
# Exports:
# Shapefile_FOUND
# LIBSHAPEFILE_INCLUDE_DIR
# LIBSHAPEFILE_LIBRARY
# Hints:
# LIBSHAPEFILE_LIBRARY_DIR
find_path(LIBSHAPEFILE_INCLUDE_DIR
shapefil.h)
find_library(LIBSHAPEFILE_LIBRARY
NAMES shp
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Shapefile DEFAULT_MSG
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
+1
View File
@@ -280,4 +280,5 @@ if (TBB_FOUND)
FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
message(STATUS "TBB interface version: ${TBB_INTERFACE_VERSION}")
endif (TBB_FOUND)
-24
View File
@@ -1,24 +0,0 @@
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
set(NEWFILE ${OLDFILE}.tmp)
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
file(MD5 ${SOURCE_DIR}/include/engine/datafacade/internal_datafacade.hpp MD5OBJECTS)
CONFIGURE_FILE(${INFILE} ${NEWFILE})
file(MD5 ${NEWFILE} MD5NEW)
if (EXISTS ${OLDFILE})
file(MD5 ${OLDFILE} MD5OLD)
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
file(REMOVE_RECURSE ${OLDFILE})
file(RENAME ${NEWFILE} ${OLDFILE})
else()
file(REMOVE_RECURSE ${NEWFILE})
message(STATUS "Fingerprint unchanged, not regenerating")
endif()
else()
file(RENAME ${NEWFILE} ${OLDFILE})
endif()
-40
View File
@@ -1,40 +0,0 @@
INCLUDE (CheckCXXSourceCompiles)
unset(LUABIND_WORKS CACHE)
unset(LUABIND51_WORKS CACHE)
set (LUABIND_CHECK_SRC "extern \"C\" {\n#include \"lua.h\"\n#include \"lauxlib.h\"\n}\n#include <luabind/open.hpp>\nint main() { lua_State *x = luaL_newstate(); luabind::open(x); }")
set (CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
find_package(Lua52)
if(NOT APPLE)
find_package(LuaJIT 5.2)
endif()
if(LUA52_FOUND)
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
CHECK_CXX_SOURCE_COMPILES("${LUABIND_CHECK_SRC}" LUABIND_WORKS)
endif()
if(LUABIND_WORKS)
message(STATUS "Luabind/Lua5.2 combination working with ${LUA_LIBRARY}")
else()
message(STATUS "Luabind/Lua5.2 not feasible, falling back to Lua 5.1.")
unset(LUA_FOUND CACHE)
unset(LUA_INCLUDE_DIR CACHE)
unset(LUA_LIBRARY CACHE)
find_package(Lua51 REQUIRED)
if(NOT APPLE)
find_package(LuaJIT 5.1)
endif()
set (CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIR};${LUABIND_INCLUDE_DIR};${LUA_INCLUDE_DIR}")
set (CMAKE_REQUIRED_LIBRARIES "${LUABIND_LIBRARY};${LUA_LIBRARY}")
CHECK_CXX_SOURCE_COMPILES("${LUABIND_CHECK_SRC}" LUABIND51_WORKS)
if(LUABIND51_WORKS)
message(STATUS "Luabind works with Lua 5.1 at ${LUA_LIBRARY}")
else()
message(FATAL_ERROR "Luabind does not work with Lua 5.1 at ${LUA_LIBRARY}, no working Luabind found")
endif()
endif()
+6 -6
View File
@@ -1,11 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/include
libdir=${prefix}/lib
includedir=@PKGCONFIG_INCLUDE_DIR@
libdir=@PKGCONFIG_LIBRARY_DIR@
Name: libOSRM
Description: Project OSRM library
Version: v@OSRM_VERSION_MAJOR@.@OSRM_VERSION_MINOR@.@OSRM_VERSION_PATCH@
Version: v@OSRM_VERSION@
Requires:
Libs: -L${libdir} -losrm
Libs.private: @ENGINE_LIBRARY_LISTING@
Cflags: -I${includedir}
Libs: -L${libdir} -losrm @PKGCONFIG_OSRM_LDFLAGS@
Libs.private: @PKGCONFIG_OSRM_DEPENDENT_LIBRARIES@
Cflags: @PKGCONFIG_OSRM_INCLUDE_FLAGS@ @PKGCONFIG_OSRM_CXXFLAGS@
+7
View File
@@ -0,0 +1,7 @@
coverage:
ignore:
- unit_tests/.*
- third_party/.*
comment: off
-9
View File
@@ -1,9 +0,0 @@
# config/cucumber.yml
##YAML Template
---
default: --require features --tags ~@todo --tags ~@bug --tag ~@stress
verify: --require features --tags ~@todo --tags ~@bug --tags ~@stress -f progress
jenkins: --require features --tags ~@todo --tags ~@bug --tags ~@stress --tags ~@options -f progress
bugs: --require features --tags @bug
todo: --require features --tags @todo
all: --require features
+9
View File
@@ -0,0 +1,9 @@
module.exports = {
default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions',
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
all: '--strict --require features/support --require features/step_definitions'
}
+10 -11
View File
@@ -1,19 +1,18 @@
FROM ubuntu:14.04
RUN apt-get update -y
RUN apt-get install -y build-essential git-core python-pip python-software-properties software-properties-common
RUN apt-get update -y && apt-get install -y software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libboost-all-dev ccache
RUN apt-get -y install curl cmake cmake-curses-gui git
RUN apt-get -y install gcc-4.8 g++-4.8 libboost1.55-all-dev llvm-3.4
RUN apt-get -y install libbz2-dev libstxxl-dev libstxxl1 libxml2-dev
RUN apt-get -y install libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev ruby1.9
RUN apt-get -y install curl cmake cmake-curses-gui
RUN pip install awscli
# luabind
RUN curl https://gist.githubusercontent.com/DennisOSRM/f2eb7b948e6fe1ae319e/raw/install-luabind.sh | sudo bash
WORKDIR /opt
RUN git clone --depth 1 --branch v0.31.0 https://github.com/creationix/nvm.git
RUN /bin/bash -c "source /opt/nvm/nvm.sh && nvm install v4"
RUN useradd -ms /bin/bash mapbox
USER mapbox
ENV HOME /home/mapbox
WORKDIR /home/mapbox
RUN echo "source /opt/nvm/nvm.sh" > .bashrc
RUN echo "source /home/mapbox/.bashrc" > .profile
+1 -1
View File
@@ -8,4 +8,4 @@ docker run \
-e "CXX=clang++" \
-v `pwd`:/home/mapbox/osrm-backend \
-t mapbox/osrm:linux \
osrm-backend/docker/test.sh
/bin/bash -lc "osrm-backend/docker/test.sh"
+3 -2
View File
@@ -5,7 +5,8 @@ set -o pipefail
docker run \
-i \
-e "CXX=g++" \
-e "CXX=g++-5" \
-e "CC=gcc-5" \
-v `pwd`:/home/mapbox/osrm-backend \
-t mapbox/osrm:linux \
osrm-backend/docker/test.sh
/bin/bash -lc "osrm-backend/docker/test.sh"
+5 -6
View File
@@ -4,11 +4,8 @@ set -e
set -o pipefail
export CMAKEOPTIONS="-DCMAKE_BUILD_TYPE=Release"
export PATH=$PATH:/home/mapbox/.gem/ruby/1.9.1/bin:/home/mapbox/osrm-backend/vendor/bundle/ruby/1.9.1/bin
cd /home/mapbox/osrm-backend
gem install --user-install bundler
bundle install --path vendor/bundle
[ -d build ] && rm -rf build
mkdir -p build
cd build
@@ -16,7 +13,9 @@ cmake .. $CMAKEOPTIONS -DBUILD_TOOLS=1
make -j`nproc`
make tests -j`nproc`
./datastructure-tests
./algorithm-tests
#./unit_tests/server-tests
#./unit_tests/library-tests
#./unit_tests/extractor-tests
#./unit_tests/util-tests
cd ..
bundle exec cucumber -p verify
npm test
+62
View File
@@ -0,0 +1,62 @@
# Developing / Debugging guidance code
When changing guidance code, it is easy to introduce problems somewhere in the network.
To get a better feeling of how your changes impact the OSRM experience, we offer ways of generating geojson output to inspect (e.g. with Mapbox Studio).
When you do changes, make sure to inspect a few areas for the impact of the changes.
## How to use GeoJson-Debugging
This is a short guide to describe usage of our GeoJson debug logging mechanism. It is synchronized to guarantee thread-safe logging.
## Outputting into a single file
To use it, the inclusion of `geojson_debug_logger.hpp` `geojson_debug_policies.hpp` from the `util` directory is required.
Geojson debugging requires a few simple steps to output data into a feature collection.
- Create a Scoped Guard that lives through the process and provide it with all required datastructures (it needs to span the lifetime of all your logging efforts)
- At the location of the output, simply call Write with your own parameters.
A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we provide a way of printing out node-ids as coordinates.
The initialisation to do so looks like this:
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
Make sure to give the guar a name, so it actually gets a lifetime.
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
The policy itself offers a `operator()` accepting a `vector` of `NodeID`.
For outputting data into our file (debug.geojson), we simply need to call the matching logging routine of the guard: `util::ScioedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);`
(or `guard.Write(list_of_node_ids)` if you created an instance).
### Possible Scopeguard Location
Think of the scopeguard as you would do of any reference. If you wan't to access to logging during a call, the guard object must be alive and valid.
As an example: a good location to create the a scopeguard to log decisions in the edge-based-graph-factory would be right before we run it ([here](https://github.com/Project-OSRM/osrm-backend/blob/a933b5d94943bf3edaf42c84a614a99650d23cba/src/extractor/extractor.cpp#L497)). If you put `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", node_coordinate_vector);` at that location, you can then print `util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString>::Write(list_of_node_ids);` anywhere within the `edge-based-graph-factory`.
This location would enable call for all guidance related pre-processing which is called in the edge-based-graph-factory.
Logging any turn-handler decisions, for example, would now be possible.
## Limitations
GeoJson debugging requires a single GeoJsonGuard (ScopedGeojsonLoggerGuard) for each desired output file.
For each set of template parameters, only the most recent guard will actually produce output.
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug-2.geojson", data-for-conversion);`
Will not provide a way to write into two files, but only `debug-2` will actually contain features.
We cannot nest-these calls.
If we want to use the same policy for multiple files, we need to use different template parameters both for the logger and the guard.
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString,0> geojson_guard( "debug.geojson", data-for-conversion);`
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString,1> geojson_guard( "debug-2.geojson", data-for-conversion);`
as well as,
`util::ScopedGeojsonLoggerGuardr<util::NodeIdVectorToLineString,0>::Write(list_of_node_ids);`
`util::ScopedGeojsonLoggerGuardr<util::NodeIdVectorToLineString,1>::Write(list_of_node_ids);`
+776
View File
@@ -0,0 +1,776 @@
## General options
All OSRM HTTP requests use a common structure.
The following syntax applies to all services, except as noted.
### Requests
```endpoint
GET /{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
```
| Parameter | Description |
| --- | --- |
| `service` | One of the following values: [`route`](#route-service), [`nearest`](#nearest-service), [`table`](#table-service), [`match`](#match-service), [`trip`](#trip-service), [`tile`](#tile-service) |
| `version` | Version of the protocol implemented by the service. `v1` for all OSRM 5.x installations |
| `profile` | Mode of transportation, is determined statically by the Lua profile that is used to prepare the data using `osrm-extract`. Typically `car`, `bike` or `foot` if using one of the supplied profiles. |
| `coordinates`| String of format `{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]` or `polyline({polyline})`. |
| `format`| Only `json` is supported at the moment. This parameter is optional and defaults to `json`. |
Passing any `option=value` is optional. `polyline` follows Google's polyline format with precision 5 by default and can be generated using [this package](https://www.npmjs.com/package/polyline).
To pass parameters to each location some options support an array like encoding:
**Request options**
| Option | Values | Description |
|----------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
Where the elements follow the following format:
| Element | Values |
|------------|--------------------------------------------------------|
|bearing |`{value},{range}` `integer 0 .. 360,integer 0 .. 180` |
|radius |`double >= 0` or `unlimited` (default) |
|hint |Base64 `string` |
```
{option}={element};{element}[;{element} ... ]
```
The number of elements must match exactly the number of locations. If you don't want to pass a value but instead use the default you can pass an empty `element`.
Example: 2nd location use the default value for `option`:
```
{option}={element};;{element}
```
#### Example Requests
```curl
# Query on Berlin with three coordinates:
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
# Using polyline:
curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'
```
### Responses
Every response object has a `code` property containing one of the strings below or a service dependent code:
| Type | Description |
|-------------------|----------------------------------------------------------------------------------|
| `Ok` | Request could be processed as expected. |
| `InvalidUrl` | URL string is invalid. |
| `InvalidService` | Service name is invalid. |
| `InvalidVersion` | Version is not found. |
| `InvalidOptions` | Options are invalid. |
| `InvalidQuery` | The query string is synctactically malformed. |
| `InvalidValue` | The successfully parsed query parameters are invalid. |
| `NoSegment` | One of the supplied input coordinates could not snap to street segment. |
| `TooBig` | The request size violates one of the service specific request size restrictions. |
- `message` is a **optional** human-readable error message. All other status types are service dependent.
- In case of an error the HTTP status code will be `400`. Otherwise the HTTP status code will be `200` and `code` will be `Ok`.
#### Example response
```json
{
"code": "Ok",
"message": "Everything worked"
}
```
## Services
### Nearest service
Snaps a coordinate to the street network and returns the nearest `n` matches.
```endpoint
GET http://{server}/nearest/v1/{profile}/{coordinates}.json?number={number}
```
Where `coordinates` only supports a single `{longitude},{latitude}` entry.
In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description |
|------------|------------------------------|----------------------------------------------------|
|number |`integer >= 1` (default `1`) |Number of nearest segments that should be returned. |
**Response**
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints` array of `Waypoint` objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
- `distance`: Distance in meters to the supplied input coordinate.
#### Example Requests
```curl
# Querying nearest three snapped locations of `13.388860,52.517037` with a bearing between `20° - 340°`.
curl 'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?number=3&bearings=0,20'
```
#### Example Response
```json
{
"waypoints" : [
{
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
"distance" : 4.152629,
"name" : "Friedrichstraße",
"location" : [
13.388799,
52.517033
]
},
{
"hint" : "KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g",
"distance" : 11.811961,
"name" : "Friedrichstraße",
"location" : [
13.388782,
52.517132
]
},
{
"hint" : "KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g",
"distance" : 15.872438,
"name" : "Friedrichstraße",
"location" : [
13.388775,
52.51717
],
}
],
"code" : "Ok"
}
```
### Route service
Finds the fastest route between coordinates in the supplied order.
```endpoint
GET /route/v1/{profile}/{coordinates}?alternatives={true|false}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={full|simplified|false}&annotations={true|false}
```
In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description |
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|steps |`true`, `false` (default) |Return route steps for each route leg |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
**Response**
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints`: Array of `Waypoint` objects representing all waypoints in order:
- `routes`: An array of `Route` objects, ordered by descending recommendation rank.
In case of error the following `code`s are supported in addition to the general ones:
| Type | Description |
|-------------------|-----------------|
| `NoRoute` | No route found. |
All other properties might be undefined.
#### Example Request
```curl
# Query on Berlin with three coordinates and no overview geometry returned:
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
```
### Table service
Computes the duration of the fastest route between all pairs of supplied coordinates.
```endpoint
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&destinations=[{elem}...]
```
**Coordinates**
In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description |
|------------|--------------------------------------------------|---------------------------------------------|
|sources |`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as source. |
|destinations|`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as destination.|
Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
to number of input locations;
**Example:**
```
sources=0;5;7&destinations=5;1;4;2;3;6
```
|Element |Values |
|------------|-----------------------------|
|index |`0 <= integer < #locations` |
#### Example Request
```curl
# Returns a 3x3 matrix:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
# Returns a 1x3 matrix
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?sources=0'
# Returns a asymmetric 3x2 matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:
curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHulFzeMe`EuvKpnCglA)?sources=0;1;3&destinations=2;4'
```
**Response**
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
the i-th waypoint to the j-th waypoint. Values are given in seconds.
- `sources` array of `Waypoint` objects describing all sources in order
- `destinations` array of `Waypoint` objects describing all destinations in order
In case of error the following `code`s are supported in addition to the general ones:
| Type | Description |
|-------------------|-----------------|
| `NoTable` | No route found. |
All other properties might be undefined.
### Match service
Map matching matches/snaps given GPS points to the road network in the most plausible way.
Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found.
The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.
```endpoint
GET /match/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}
```
In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description |
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|steps |`true`, `false` (default) |Return route steps for each route |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|Parameter |Values |
|------------|-----------------------------------|
|timestamp |`integer` seconds since UNIX epoch |
|radius |`double >= 0` (default 5m) |
The radius for each point should be the standard error of the location measured in meters from the true location.
Use `Location.getAccuracy()` on Android or `CLLocation.horizontalAccuracy` on iOS.
This value is used to determine which points should be considered as candidates (larger radius means more candidates) and how likely each candidate is (larger radius means far-away candidates are penalized less).
The area to search is chosen such that the correct candidate should be considered 99.9% of the time (for more details see [this ticket](https://github.com/Project-OSRM/osrm-backend/pull/3184)).
**Response**
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `tracepoints`: Array of `Waypoint` objects representing all points of the trace in order.
If the trace point was ommited by map matching because it is an outlier, the entry will be `null`.
Each `Waypoint` object has the following additional properties:
- `matchings_index`: Index to the `Route` object in `matchings` the sub-trace was matched to.
- `waypoint_index`: Index of the waypoint inside the matched route.
- `matchings`: An array of `Route` objects that assemble the trace. Each `Route` object has the following additional properties:
- `confidence`: Confidence of the matching. `float` value between 0 and 1. 1 is very confident that the matching is correct.
In case of error the following `code`s are supported in addition to the general ones:
| Type | Description |
|-------------------|---------------------|
| `NoMatch` | No matchings found. |
All other properties might be undefined.
### Trip service
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints.
The returned path does not have to be the fastest path. As TSP is NP-hard it only returns an approximation.
Note that all input coordinates have to be connected for the trip service to work.
```endpoint
GET /trip/v1/{profile}/{coordinates}?roundtrip={true|false}&source{any|first}&destination{any|last}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
```
In addition to the [general options](#general-options) the following options are supported for this service:
|Option |Values |Description |
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|roundtrip |`true` (default), `false` |Return route is a roundtrip |
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|steps |`true`, `false` (default) |Return route instructions for each trip |
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
**Fixing Start and End Points**
It is possible to explicitely set the start or end coordinate of the trip.
When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
Right now, the following combinations are possible:
| roundtrip | source | destination | supported |
| :-- | :-- | :-- | :-- |
| true | first | last | **yes** |
| true | first | any | **yes** |
| true | any | last | **yes** |
| true | any | any | **yes** |
| false | first | last | **yes** |
| false | first | any | no |
| false | any | last | no |
| false | any | any | no |
#### Example Requests
```curl
# Round trip in Berlin with three stops:
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
```
```curl
# Round trip in Berlin with four stops, starting at the first stop, ending at the last:
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=last'
```
#### Response
- `code`: if the request was successful `Ok` otherwise see the service dependent and general status codes.
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
- `trips_index`: Index to `trips` of the sub-trip the point was matched to.
- `waypoint_index`: Index of the point in the trip.
- `trips`: An array of `Route` objects that assemble the trace.
In case of error the following `code`s are supported in addition to the general ones:
| Type | Description |
|-------------------|---------------------|
| `NoTrips` | No trips found because input coordinates are not connected.|
| `NotImplemented` | This request is not supported |
All other properties might be undefined.
### Tile service
This service generates [Mapbox Vector Tiles](https://www.mapbox.com/developers/vector-tiles/) that can be viewed with a vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can be used to examine the routing graph. The tiles are generated directly from the data in-memory, so are in sync with actual routing results, and let you examine which roads are actually routable, and what weights they have applied.
```endpoint
GET /tile/v1/{profile}/tile({x},{y},{zoom}).mvt
```
The `x`, `y`, and `zoom` values are the same as described at https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames, and are supported by vector tile viewers like [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/).
#### Example request
```curl
# This fetches a Z=13 tile for downtown San Francisco:
curl 'http://router.project-osrm.org/tile/v1/car/tile(1310,3166,13).mvt'
```
#### Example response
> ![example rendered tile](images/example-tile-response.png)
> http://map.project-osrm.org/debug/#14.33/52.5212/13.3919
The response object is either a binary encoded blob with a `Content-Type` of `application/x-protobuf`, or a `404` error. Note that OSRM is hard-coded to only return tiles from zoom level 12 and higher (to avoid accidentally returning extremely large vector tiles).
Vector tiles contain two layers:
`speeds` layer:
| Property | Type | Description |
| ------------ | --------- | ---------------------------------------- |
| `speed` | `integer` | the speed on that road segment, in km/h |
| `is_small` | `boolean` | whether this segment belongs to a small (< 1000 node) [strongly connected component](https://en.wikipedia.org/wiki/Strongly_connected_component) |
| `datasource` | `string` | the source for the speed value (normally `lua profile` unless you're using the [traffic update feature](https://github.com/Project-OSRM/osrm-backend/wiki/Traffic), in which case it contains the stem of the filename that supplied the speed value for this segment |
| `duration` | `float` | how long this segment takes to traverse, in seconds |
| `name` | `string` | the name of the road this segment belongs to |
`turns` layer:
| Property | Type | Description |
| ------------ | --------- | ---------------------------------------- |
| `bearing_in` | `integer` | the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East |
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
| `cost` | `float` | the time we think it takes to make that turn, in seconds. May be negative, depending on how the data model is constructed (some turns get a "bonus"). |
## Result objects
### Route object
Represents a route through (potentially multiple) waypoints.
**Properties**
- `distance`: The distance traveled by the route, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds.
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` property for a parameter documentation.
- `weight`: The calculated weight of the route.
- `weight_name`: The name of the weight profile used during extraction phase.
| overview | Description |
|------------|-----------------------------|
| simplified | Geometry is simplified according to the highest zoom level it can still be displayed on full. |
| full | Geometry is not simplified. |
| false | Geometry is not added. |
- `legs`: The legs between the given waypoints, an array of `RouteLeg` objects.
#### Example
Three input coordinates, `geometry=geojson`, `steps=false`:
```json
{
"distance": 90.0,
"duration": 300.0,
"weight": 300.0,
"weight_name": "duration",
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
"legs": [
{
"distance": 30.0,
"duration": 100.0,
"steps": []
},
{
"distance": 60.0,
"duration": 200.0,
"steps": []
}
]
}
```
### RouteLeg object
Represents a route between two waypoints.
**Properties**
- `distance`: The distance traveled by this route leg, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds.
- `weight`: The calculated weight of the route leg.
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
| steps | |
|--------------|-----------------------------------------------------------------------|
| true | Names of the two major roads used. Can be empty if route is too short.|
| false | empty `string` |
- `steps`: Depends on the `steps` parameter.
| steps | |
|--------------|-----------------------------------------------------------------------|
| true | array of `RouteStep` objects describing the turn-by-turn instructions |
| false | empty array |
- `annotation`: Additional details about each coordinate along the route geometry:
| annotations | |
|--------------|-----------------------------------------------------------------------|
| true | An `Annotation` object containing node ids, durations distances and |
| false | weights `undefined` |
#### Example
With `steps=false` and `annotations=true`:
```json
{
"distance": 30.0,
"duration": 100.0,
"weight": 100.0,
"steps": [],
"annotation": {
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
}
}
```
### Annotation object
Annotation of the whole route leg with fine-grained information about each segment or node id.
**Properties**
- `distance`: The distance, in metres, between each pair of coordinates
- `duration`: The duration between each pair of coordinates, in seconds
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
- `weight`: The weights between each pair of coordinates
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
#### Example
```json
{
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
"weight": [15,15,40,15,15]
}
```
### RouteStep object
A step consists of a maneuver such as a turn or merge, followed
by a distance of travel along a single way to the subsequent
step.
**Properties**
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds.
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
- `weight`: The calculated weight of the step.
| `geometry` | |
|------------|--------------------------------------------------------------------|
| polyline | [polyline](https://www.npmjs.com/package/polyline) with precision 5 in [latitude,longitude] encoding |
| polyline6 | [polyline](https://www.npmjs.com/package/polyline) with precision 6 in [latitude,longitude] encoding |
| geojson | [GeoJSON `LineString`](http://geojson.org/geojson-spec.html#linestring) |
- `name`: The name of the way along which travel proceeds.
- `ref`: A reference number or code for the way. Optionally included, if ref data is available for the given way.
- `pronunciation`: The pronunciation hint of the way name. Will be `undefined` if there is no pronunciation hit.
- `destinations`: The destinations of the way. Will be `undefined` if there are no destinations.
- `mode`: A string signifying the mode of transportation.
- `maneuver`: A `StepManeuver` object representing the maneuver.
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
- `rotary_name`: The name for the rotary. Optionally included, if the step is a rotary and a rotary name is available.
- `rotary_pronunciation`: The pronunciation hint of the rotary name. Optionally included, if the step is a rotary and a rotary pronunciation is available.
#### Example
```json
{
"geometry" : "{lu_IypwpAVrAvAdI",
"mode" : "driving",
"duration" : 15.6,
"weight" : 15.6,
"intersections" : [
{ "bearings" : [ 10, 92, 184, 270 ],
"lanes" : [
{ "indications" : [ "left", "straight" ],
"valid" : "false" },
{ "valid" : "true",
"indications" : [ "right" ] }
],
"out" : 2,
"in" : 3,
"entry" : [ "true", "true", "true", "false" ],
"location" : [ 13.39677, 52.54366 ]
},
{ "out" : 1,
"lanes" : [
{ "indications" : [ "straight" ],
"valid" : "true" },
{ "indications" : [ "right" ],
"valid" : "false" }
],
"bearings" : [ 60, 240, 330 ],
"in" : 0,
"entry" : [ "false", "true", "true" ],
"location" : [ 13.394718, 52.543096 ]
}
],
"name" : "Lortzingstraße",
"distance" : 152.3,
"maneuver" : {
"modifier" : "right",
"type" : "turn"
}
}
```
### StepManeuver object
**Properties**
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
- `bearing_before`: The clockwise angle from true north to the
direction of travel immediately before the maneuver. Range 0-359.
- `bearing_after`: The clockwise angle from true north to the
direction of travel immediately after the maneuver. Range 0-359.
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
Types unknown to the client should be handled like the `turn` type, the existence of correct `modifier` values is guranteed.
| `type` | Description |
|------------------|--------------------------------------------------------------|
| `turn` | a basic turn into direction of the `modifier` |
| `new name` | no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier`. |
| `depart` | indicates the departure of the leg |
| `arrive` | indicates the destination of the leg |
| `merge` | merge onto a street (e.g. getting on the highway from a ramp, the `modifier specifies the direction of the merge`) |
| `ramp` | **Deprecated**. Replaced by `on_ramp` and `off_ramp`. |
| `on ramp` | take a ramp to enter a highway (direction given my `modifier`) |
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
| `fork` | take the left/right side at a fork depending on `modifier` |
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
| `use lane` | going straight on a specific lane |
| `continue` | Turn in direction of `modifier` to stay on the same road |
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
Please note that even though there are `new name` and `notification` instructions, the `mode` and `name` can change
between all instructions. They only offer a fallback in case nothing else is to report.
- `modifier` An optional `string` indicating the direction change of the maneuver.
| `modifier` | Description |
|-------------------|-------------------------------------------|
| `uturn` | indicates reversal of direction |
| `sharp right` | a sharp right turn |
| `right` | a normal turn to the right |
| `slight right` | a slight turn to the right |
| `straight` | no relevant change in direction |
| `slight left` | a slight turn to the left |
| `left` | a normal turn to the left |
| `sharp left` | a sharp turn to the left |
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
The meaning depends on the `type` property.
| `type` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
- `exit` An optional `integer` indicating number of the exit to take. The property exists for the `roundabout` / `rotary` property:
Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout.
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
### Lane object
A `Lane` represents a turn lane at the corresponding turn location.
**Properties**
- `indications`: a indication (e.g. marking on the road) specifying the turn lane. A road can have multiple indications (e.g. an arrow pointing straight and left). The indications are given in an array, each containing one of the following types. Further indications might be added on without an API version change.
| `value` | Description |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `none` | No dedicated indication is shown. |
| `uturn` | An indication signaling the possibility to reverse (i.e. fully bend arrow). |
| `sharp right` | An indication indicating a sharp right turn (i.e. strongly bend arrow). |
| `right` | An indication indicating a right turn (i.e. bend arrow). |
| `slight right` | An indication indicating a slight right turn (i.e. slightly bend arrow). |
| `straight` | No dedicated indication is shown (i.e. straight arrow). |
| `slight left` | An indication indicating a slight left turn (i.e. slightly bend arrow). |
| `left` | An indication indicating a left turn (i.e. bend arrow). |
| `sharp left` | An indication indicating a sharp left turn (i.e. strongly bend arrow). |
- `valid`: a boolean flag indicating whether the lane is a valid choice in the current maneuver
#### Example
```json
{
"indications": ["left", "straight"],
"valid": "false"
}
```
### Intersection object
An intersection gives a full representation of any cross-way the path passes bay. For every step, the very first intersection (`intersections[0]`) corresponds to the
location of the StepManeuver. Further intersections are listed for every cross-way until the next turn instruction.
**Properties**
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
`false` indicates that the turn onto the respective road would violate a restriction.
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
direction of travel immediately before the maneuver/passing the intersection. Bearings are given relative to the intersection. To get the bearing
in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers.
- `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the
direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers.
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the intersection. If no lane information is available for an intersection, the `lanes` property will not be present.
#### Example
```json
{
"location":[13.394718,52.543096],
"in":0,
"out":2,
"bearings":[60,150,240,330],
"entry":["false","true","true","true"],
"lanes":{
"indications": ["left", "straight"],
"valid": "false"
}
}
```
### Waypoint object
Object used to describe waypoint on a route.
**Properties**
- `name` Name of the street the coordinate snapped to
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
- `hint` Unique internal identifier of the segment (ephemeral, not constant over data updates)
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
#### Example
```json
{
"hint" : "KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g",
"distance" : 4.152629,
"name" : "Friedrichstraße",
"location" : [
13.388799,
52.517033
]
}
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 694 KiB

+33
View File
@@ -0,0 +1,33 @@
## Introduction
OSRM can be used as a library (libosrm) via C++ instead of using it through the HTTP interface and `osrm-routed`. This allows for fine-tuning OSRM and has much less overhead. Here is a quick introduction into how to use `libosrm` in the upcoming v5 release.
Take a look at the example code that lives in the [example directory](https://github.com/Project-OSRM/osrm-backend/tree/master/example). Here is all you ever wanted to know about `libosrm`, that is a short description of what the types do and where to find documentation on it:
## Important interface objects
- [`EngineConfig`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/engine_config.hpp) - for initializing an OSRM instance we can configure certain properties and constraints. E.g. the storage config is the base path such as `france.osm.osrm` from which we derive and load `france.osm.osrm.*` auxiliary files. This also lets you set constraints such as the maximum number of locations allowed for specific services.
- [`OSRM`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/osrm/osrm.hpp) - this is the main Routing Machine type with functions such as `Route` and `Table`. You initialize it with a `EngineConfig`. It does all the heavy lifting for you. Each function takes its own parameters, e.g. the `Route` function takes `RouteParameters`, and a out-reference to a JSON result that gets filled. The return value is a `Status`, indicating error or success.
- [`Status`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/status.hpp) - this is a type wrapping `Error` or `Ok` for indicating error or success, respectively.
- [`TableParameters`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/api/table_parameters.hpp) - this is an example of parameter types the Routing Machine functions expect. In this case `Table` expects its own parameters as `TableParameters`. You can see it wrapping two vectors, sources and destinations --- these are indices into your coordinates for the table service to construct a matrix from (empty sources or destinations means: use all of them). If you ask yourself where coordinates come from, you can see `TableParameters` inheriting from `BaseParameters`.
- [`BaseParameter`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/api/base_parameters.hpp) - this most importantly holds coordinates (and a few other optional properties that you don't need for basic usage); the specific parameter types inherit from `BaseParameters` to get these member attributes. That means your `TableParameters` type has `coordinates`, `sources` and `destination` member attributes (and a few other that we ignore for now).
- [`Coordinate`](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/coordinate.hpp) - this is a wrapper around a (longitude, latitude) pair. We really don't care about (lon,lat) vs (lat, lon) but we don't want you to accidentally mix them up, so both latitude and longitude are strictly typed wrappers around integers (fixed notation such as `13423240`) and floating points (floating notation such as `13.42324`).
- [Parameters for other services](https://github.com/Project-OSRM/osrm-backend/tree/master/include/engine/api) - here are all other `*Parameters` you need for other Routing Machine services.
- [JSON](https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/json_container.hpp) - this is a sum type resembling JSON. The Routing Machine service functions take a out-ref to a JSON result and fill it accordingly. It is currently implemented using [mapbox/variant](https://github.com/mapbox/variant) which is similar to [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html). There are two ways to work with this sum type: either provide a visitor that acts on each type on visitation or use the `get` function in case you're sure about the structure. The JSON structure is written down in the [HTTP API](#http-api).
## Example
See [the example folder](https://github.com/Project-OSRM/osrm-backend/tree/master/example) in the OSRM repository.
## Workflow
- Create an `OSRM` instance initialized with a `EngineConfig`
- Call the service function on the `OSRM` object providing service specific `*Parameters`
- Check the return code and use the JSON result
+47
View File
@@ -0,0 +1,47 @@
OSRM supports "profiles". Configurations representing different routing behaviours for (typically) different transport modes. A profile describes whether or not we route along a particular type of way, or over a particular node in the OpenStreetMap data, and also how quickly we'll be travelling when we do. This feeds into the way the routing graph is created and thus influences the output routes.
## Available profiles
Out-of-the-box OSRM comes with several different profiles, including car, bicycle and foot.
Profile configuration files have a 'lua' extension, and are found under the 'profiles' subdirectory.
Alternatively commands will take a lua profile specified with an explicit -p param, for example:
`osrm-extract -p ../profiles/car.lua planet-latest.osm.pbf`
And then **you will need to extract and contract again** (A change to the profile will typically affect the extract step as well as the contract step. See [Processing Flow](https://github.com/Project-OSRM/osrm-backend/wiki/Processing-Flow))
## lua scripts?
Profiles are not just configuration files. They are scripts written in the "lua" scripting language ( http://www.lua.org ) The reason for this, is that OpenStreetMap data is not sufficiently straightforward, to simply define tag mappings. Lua scripting offers a powerful way of coping with the complexity of different node,way,relation,tag combinations found within OpenStreetMap data.
## Basic structure of a profile
You can understand these lua scripts enough to make interesting modifications, without needing to get to grips with how they work completely.
Towards the top of the file, a profile (such as [car.lua](../profiles/car.lua)) will typically define various configurations as global variables. A lot of these are look-up hashes of one sort or another.
As you scroll down the file you'll see local variables, and then local functions, and finally...
`way_function` and `node_function` are the important functions which are called when extracting OpenStreetMap data with `osrm-extract`.
## way_function
Given an OpenStreetMap way, the way_function will either return nothing (meaning we are not going to route over this way at all), or it will set up a result hash to be returned. The most important thing it will do is set the value of `result.forward_speed` and `result.backward_speed` as a suitable integer value representing the speed for traversing the way.
All other calculations stem from that, including the returned timings in driving directions, but also, less directly, it feeds into the actual routing decisions the engine will take (a way with a slow traversal speed, may be less favoured than a way with fast traversal speed, but it depends how long it is, and... what it connects to in the rest of the network graph)
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the way_function. Instead a way_function will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, before arriving at the result.
## Guidance
The guidance parameters in profiles are currently a work in progress. They can and will change.
Please be aware of this when using guidance configuration possibilities.
### Road Classification
Guidance uses road classes to decide on when/if to emit specific instructions and to discover which road is obvious when following a route.
Classification uses three flags and a priority-category.
The flags indicate whether a road is a motorway (required for on/off ramps), a link type (the ramps itself, if also a motorway) and whether a road may be omittted in considerations (is considered purely for connectivity).
The priority-category influences the decision which road is considered the obvious choice and which roads can be seen as fork.
Forks can be emitted between roads of similar priority category only. Obvious choices follow a major priority road, if the priority difference is large.
+52
View File
@@ -0,0 +1,52 @@
# Releasing a new OSRM version
We are using http://semver.org/ for versioning with major, minor and patch versions.
## Guarantees
We are giving the following guarantees between versions:
### Major version change
- There are no guarantees about compatiblity of APIs or datasets
- Breaking changes will be noted as `BREAKING` in the changelog
### Minor version change
We may introduce forward-compatible changes: query parameters and response properties may be added in responses, but existing properties may not be changed or removed. One exception to this is the addition of new turn types, which we see as forward-compatible changes.
- Forward-compatible HTTP API
- Forward-compatible C++ library API
- Forward-compatible node-osrm API
- No compatiblity between OSRM datasets (needs new processing)
### Patch version change
- No change of query parameters or response formats
- Compatible HTTP API
- Compatible C++ library API
- Compatible node-osrm API
- Compatible OSRM datasets
## Release and branch management
- The `master` branch is for the bleeding edge development
- We create and maintain release branches `x.y` to control the release flow
- We create the release branch once we tagged the final version `x.y.0` version, RCs go on master
- No minor or major version will be released without a code-equal release candidates
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
- Patch versions may be released without a release candidate
- We may backport fixes to older versions and release them as patch versions
## Releasing a version
1. Check out the appropriate release branch `x.y`
2. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
3. Make sure `CHANGELOG.md` is up to date.
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
6. Use `npm run build-api-docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
6. Push tags and commits: `git push; git push --tags`
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
+14
View File
@@ -0,0 +1,14 @@
## Environment Variables
### SIGNAL_PARENT_WHEN_READY
If the SIGNAL_PARENT_WHEN_READY environment variable is set osrm-routed will
send the USR1 signal to its parent when it will be running and waiting for
requests. This could be used to upgrade osrm-routed to a new binary on the fly
without any service downtime - no incoming requests will be lost.
### DISABLE_ACCESS_LOGGING
If the DISABLE_ACCESS_LOGGING environment variable is set osrm-routed will
**not** log any http requests to standard output. This can be useful in high
traffic setup.
+16
View File
@@ -0,0 +1,16 @@
var fs = require('fs');
/**
* This file exports the content of your website, as a bunch of concatenated
* Markdown files. By doing this explicitly, you can control the order
* of content without any level of abstraction.
*
* Using the brfs module, fs.readFileSync calls in this file are translated
* into strings of those files' content before the file is delivered to a
* browser: the content is read ahead-of-time and included in bundle.js.
*/
module.exports =
'# HTTP API\n' +
fs.readFileSync('./content/http.md', 'utf8') + '\n'+
'# libosrm C++ API\n' +
fs.readFileSync('./content/libosrm.md', 'utf8') + '\n';
+16
View File
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=11' />
<title>OSRM API Documentation</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='css/base.css' rel='stylesheet' />
<link href='css/style.css' rel='stylesheet' />
<link href='css/railscasts.css' rel='stylesheet' />
</head>
<body>
<!--START--><div id='app'></div><!--STOP-->
<script src='bundle.js'></script>
</body>
</html>
+63
View File
@@ -0,0 +1,63 @@
'use strict';
/**
* Brand names, in order to decreasing length, for different
* media queries.
*/
module.exports.brandNames = {
desktop: 'OSRM API Documentation',
tablet: 'OSRM API Docs',
mobile: 'OSRM API'
};
/**
* Classes that define the top-left brand box.
*/
module.exports.brandClasses = 'fill-red';
/**
* Text for the link back to the linking website.
*/
module.exports.backLink = 'Back to project-osrm.org';
/**
* Runs after highlighting code samples. You can use this
* hook to, for instance, highlight a token and link it
* to some canonical part of documentation.
*/
module.exports.postHighlight = function(html) {
return html;
};
/**
* Highlight tokens in endpoint URLs, optionally linking to documentation
* or adding detail. This is the equivalent of postHighlight but it
* operates on endpoint URLs only.
*/
function highlightTokens(str) {
return str.replace(/{[\w_]+}/g,
(str) => '<span class="strong">' + str + '</span>');
}
/**
* Transform endpoints given as strings in a highlighted block like
*
* ```endpoint
* GET /foo/bar
* ```
*
* Into HTML nodes that format those endpoints in nice ways.
*/
module.exports.transformURL = function(value) {
let parts = value.split(/\s+/);
return {
type: 'html',
value: `<div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>${parts[0]}</div>
<div class='pad0 code small endpoint-url'>${highlightTokens(parts[1])}</div>
</div>`
};
};
module.exports.remarkPlugins = [];
+412
View File
@@ -0,0 +1,412 @@
# Testsuite
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing.
## Unit Tests
For a general introduction on Boost.Test have a look at [its docs](http://www.boost.org/doc/libs/1_60_0/libs/test/doc/html/index.html).
### Separate Test Binaries
Unit tests should be registered according to the sub-project they're in.
If you want to write tests for utility functions, add them to the utility test binary.
See `CMakeLists.txt` in the unit test directory for how to register new unit tests.
### Using Boost.Test Primitives
There is a difference between only reporting a failed condition and aborting the test right at a failed condition.
Have a look at [`BOOST_CHECK` vs `BOOST_REQUIRE`](http://www.boost.org/doc/libs/1_60_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref/assertion_boost_level.html).
Instead of manually checking e.g. for equality, less than, if a function throws etc. use their [corresponding Boost.Test primitives](http://www.boost.org/doc/libs/1_60_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref.html).
If you use `BOOST_CHECK_EQUAL` you have to implement `operator<<` for your type so that Boost.Test can print mismatches.
If you do not want to do this, define `BOOST_TEST_DONT_PRINT_LOG_VALUE` (and undef it after the check call) or sidestep it with `BOOST_CHECK(fst == snd);`.
### Test Fixture
If you need to test features on a real dataset (think about this twice: prefer cucumber and dataset-independent tests for their reproducibility and minimality), there is a fixed dataset in `test/data`.
This dataset is a small extract and may not even contain all tags or edge cases.
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
See the library tests for how to add new dataset dependent tests.
To prepare the test data simply `cd test/data/` and then run `make`.
### Running Tests
To build the unit tests:
```
cd build
cmake ..
make tests
```
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
```
./engine-tests
```
For `library-tests` you will need to provide a path to the test data:
```
./library-tests ../../test/data/monaco.osrm
```
## Cucumber
For a general introduction on cucumber in our testsuite, have a look at [the wiki](https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite).
This documentation aims to supply a guideline on how to write cucumber tests that test new features introduced into osrm.
### Test the feature
It is often tempting to reduce the test to a path and accompanying instructions. Instructions can and will change over the course of improving guidance.
Instructions should only be used when writing a feature located in `features/guidance`. All other features should avoid using instructions at all.
### Write Tests to Scale
OSRM is a navigation engine. Tests should always consider this background.
An important implication is the grid size. If tests use a very small grid size, you run into the chance of instructions being omitted.
For example:
```
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Testbot - Straight Road
Given the node map
"""
a b c d
"""
And the ways
| nodes | highway |
| ab | primary |
| bc | primary |
| cd | primary |
When I route I should get
| from | to | route |
| a | d | ab,bc,cd,cd |
```
In a navigation engine, the instructions
- depart east on ab
- in 10 meters the road name changes to bc
- in 10 meters the road name changes to cd
- you arrived at cd
would be impossible to announce and not helpful at all.
Since no actual choices exist, the route you get could result in `ab,cd` and simply say `depart` and `arrive`.
To prevent such surprises, always consider the availability of other roads and use grid sizes/road lengths that correspond to actually reasonable scenarios in a road network.
### Use names
If you specify many nodes in close succession to present a specific road geometry, consider using `name` to indicate to OSRM that the segment is a single road.
```
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Testbot - Straight Road
Given the node map
"""
a b c d
"""
And the ways
| nodes | highway | name |
| ab | primary | road |
| bc | primary | road |
| cd | primary | road |
When I route I should get
| from | to | route | turns |
| a | d | road,road | depart,arrive |
```
Guidance guarantees only essential maneuvers. You will always see `depart` and `arrive` as well as all turns that are not obvious.
So the following scenario does not change the instructions
```
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Testbot - Straight Road
Given the node map
"""
a b
d c
"""
And the ways
| nodes | highway | name |
| ab | primary | road |
| bc | primary | road |
| cd | primary | road |
When I route I should get
| from | to | route | turns |
| a | d | road,road | depart,arrive |
```
but if we modify it to
```
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Testbot - Straight Road
Given the node map
"""
a b e
d c
"""
And the ways
| nodes | highway | name |
| ab | primary | road |
| bc | primary | road |
| cd | primary | road |
| be | primary | turn |
When I route I should get
| from | to | route | turns |
| a | d | road,road,road | depart,continue right,arrive |
```
### Test all directions
Modelling a road as roundabout has an implied oneway tag associated with it. In the following case, we can route from `a` to `d` but not from `d` to `a`.
To discover those errors, make sure to check for all allowed directions.
```
Scenario: Enter and Exit mini roundabout with sharp angle # features/guidance/mini-roundabout.feature:37
Given the profile "car" # features/step_definitions/data.js:8
Given a grid size of 10 meters # features/step_definitions/data.js:20
Given the node map # features/step_definitions/data.js:45
"""
a b
c d
"""
And the ways # features/step_definitions/data.js:128
| nodes | highway | name |
| ab | tertiary | MySt |
| bc | roundabout | |
| cd | tertiary | MySt |
When I route I should get # features/step_definitions/routing.js:4
| from | to | route | turns | # |
| a | d | MySt,MySt | depart,arrive | # suppress multiple enter/exit mini roundabouts |
| d | a | MySt,MySt | depart,arrive | # suppress multiple enter/exit mini roundabouts |
Tables were not identical:
| from | to | route | turns | #
| a | d | MySt,MySt | depart,arrive | # suppress multiple enter/exit mini roundabouts |
| (-) d | (-) a | (-) MySt,MySt | (-) depart,arrive | (-) # suppress multiple enter/exit mini roundabouts |
| (+) d | (+) a | (+) | (+) | (+) # suppress multiple enter/exit mini roundabouts |
```
### Prevent Randomness
Some features in OSRM can result in strange experiences during testcases. To prevent some of these issues, follow the guidelines below.
#### Use Waypoints
Using grid nodes as waypoints offers the chance of unwanted side effects.
OSRM converts the grid into a so called edge-based graph.
```
Scenario: Testbot - Intersection
Given the node map
"""
e
b a d
c
"""
And the ways
| nodes | highway | oneway |
| ab | primary | yes |
| ac | primary | yes |
| ad | primary | yes |
| ae | primary | yes |
```
Selecting `a` as a `waypoint` results in four possible starting locations. Which one of the routes `a,b`, `a,c`, `a,d`, or `a,e` is found is pure chance and depends on the order in the static `r-tree`.
To guarantee discovery, use:
```
Scenario: Testbot - Intersection
Given the node map
"""
e
4
b 1 a 3 d
2
c
"""
And the ways
| nodes | highway | oneway |
| ab | primary | yes |
| ac | primary | yes |
| ad | primary | yes |
| ae | primary | yes |
```
And use `1`,`2`,`3`, and `4` as starting waypoints. The routes `1,b`, `2,c`, `3,d`, and `4,e` can all be discovered.
#### Allow For Small Offsets
Whenever you are independent of the start location (see use waypoints), the waypoint chosen as start/end location can still influence distances/durations.
If you are testing for a duration metric, allow for a tiny offset to ensure a passing test in the presence of rounding/snapping issues.
#### Don't Rely on Alternatives
Alternative route discovery is a random feature in itself. The discovery of routes depends on the contraction order of roads and cannot be assumed successful, ever.
### Understanding Turn Restrictions
Adding turn restrictions requires the restriction to follow a very specific format.
We specify them in a table with the header `| type | way:from | way:to | node:via | restriction |`.
It is important that turn restrictions require micro segmentation.
Consider the following scenario:
```
Given the node map:
"""
e
|
a - - b - - c
|
d
"""
And the ways
| nodes | oneway |
| abc | yes |
| ebd | yes |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | ebd | b | no_right_turn |
```
The setting looks perfectly fine at first glance. However, it is not well defined.
The forbidden right turn could be either a superfluous addition, forbidding the turn `cb` to `be`, or actually refer to the turn `ab` to `bd` to say that a turn is forbidden here.
To model turn-restrictions correctly and unique, we need to split segments that contribute to the restriction into the smallest possible parts.
E.g. the above scenario could correctly be expressed as:
```
Given the node map:
"""
e
|
a - - b - - c
|
d
"""
And the ways
| nodes | oneway | name |
| ab | yes | abc |
| bc | yes | abc |
| eb | yes | ebd |
| bd | yes | ebd |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | ab | bd | b | no_right_turn |
```
Unless this format is used, OSRM will omit the (then ambiguous) turn restrictions and ignore them.
## My Guidance Tests are Failing - Understanding what you can change
If you change some stuff in guidance, you will easily see tests change their result. E.g. if you change the angles for which we report `right`, then obviously some tests might not report a `direction modifier` named `right` anymore.
This small section will try to guide you in making the correct decisions for changing the behaviour of tests.
The difficulty in guidance tests is that not all items can be translated 1:1 from the ascii art into turn-angles.
The turn-angle calculation tries to find turn angles that would represent perceived turn angles, not the exact angle at the connection.
This is necessary, since connections in OSM are always bound by the paradigm that the way is supposed to be in the middle of the actual road.
For broad streets, you will see stronger angles than the actual turns.
### Don't change the test, change the expected behaviour
If we have a test that looks like this:
```
Given a grid size of 5 m
Given the node map
"""
a - b - - - - - - c
\
d - - - - - e
"""
When I route I should get
| waypoints | route | turns |
| a,e | abc,bde,bde | depart,turn slight right,arrive|
```
And the test reports `turn right` for the route `a->e`, where before it said `slight right`.
If you changed the turn angles, obviously you can expect changes in the distinction between `slight right` and `right`.
In such a case it is, of course, reasonable to change the expected route to report `right` instead of `slight right`. You should consider inspecting the actual turn angles at `b` to see if you feel that change is justified.
However, you should never adjust the test itself.
If you look at a failure, the other way around
```
Given a grid size of 5 m
Given the node map
"""
a - b - - - - - - c
\
d - - - - - e
"""
When I route I should get
| waypoints | route | turns |
| a,e | abc,bde,bde | depart,turn right,arrive|
```
where we see a `slight right`, over the expected `right`.
We could be tempted to adjust the grid size (e.g. from `10 m` to `20` meters).
Such a change would fundamentally alter the tests, though.
Since the part `b-d` is a short offset, when we are looking at a grid of size `5 m`, the angle calculation will try and compensate for this offset.
In this case we would see a very slight turn angle. If your change now reports different turn angles, you can of course change the expected result. But you should not adjust the grid size. The test would be testing turn angles of `180` and `100` degrees, instead of `180` and `160`.
### Consider Post-Processing Impacts
Some changes you might see could look completely unrelated. To understand the impact of your changes, you can make use of the debugging utilities you can finde in `util/debug.hpp` (and potentially other related headers).
If your test is inspecting a series of turns (remember, a turn not necessarily equals an instruction), you could see interaction with post-processing.
To see the unprocessed turns, you should print the steps at the end of step assembly (`assembleSteps` in `engine/guidance/assemble_steps.hpp`).
If you see unexpected changes, you can consider adding the `locations` field to your test to study what location a turn is reported at.
To study a test without post-processing impacts, you can create a copy of the case on a very large grid (like 2000 meters). In such a grid, `turn collapsing` would be essentially disable.
Sadly, there is no general guideline.
### Use Caution
If in doubt, ask another person. Inspect as much of the data as possible (e.g. print un-collapsed steps, turn angles and so on) and use your best judgement, if the new result seems justified.
+11 -8
View File
@@ -6,28 +6,31 @@ Please create a directory and run cmake from there, passing the path to this sou
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
endif()
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_BUILD_TYPE Release)
endif()
project(osrm-example C CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
set(bitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bitness 64)
message(STATUS "Building on a 64 bit system")
else()
message(WARNING "Building on a 32 bit system is unsupported")
message(STATUS "Building on a 32 bit system")
endif()
if(WIN32 AND MSVC_VERSION LESS 1800)
message(FATAL_ERROR "Building with Microsoft compiler needs Visual Studio 2013 or later (Express version works too)")
if(WIN32 AND MSVC_VERSION LESS 1900)
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
endif()
link_directories(${LibOSRM_LIBRARY_DIRS})
add_executable(osrm-example example.cpp)
find_package(LibOSRM REQUIRED)
find_package(Boost 1.49.0 COMPONENTS filesystem system thread REQUIRED)
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${Boost_LIBRARIES})
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LibOSRM_CXXFLAGS}")
+24 -26
View File
@@ -1,13 +1,24 @@
# - Try to find LibOSRM
# Once done this will define
# LibOSRM_FOUND - System has LibOSRM
# LibOSRM_INCLUDE_DIRS - The LibOSRM include directories
# LibOSRM_LIBRARIES - The libraries needed to use LibOSRM
# LibOSRM_DEFINITIONS - Compiler switches required for using LibOSRM
# LibOSRM_LIBRARIES - The libraries and ldflags needed to use LibOSRM
# LibOSRM_DEPENDENT_LIBRARIES - The libraries and ldflags need to link LibOSRM dependencies
# LibOSRM_LIBRARY_DIRS - The libraries paths needed to find LibOSRM
# LibOSRM_CXXFLAGS - Compiler switches required for using LibOSRM
find_package(PkgConfig)
pkg_check_modules(PC_LibOSRM QUIET libosrm)
set(LibOSRM_DEFINITIONS ${PC_LibOSRM_CFLAGS_OTHER})
pkg_search_module(PC_LibOSRM QUIET libosrm)
function(JOIN VALUES GLUE OUTPUT)
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()
list(REMOVE_ITEM PC_LibOSRM_CFLAGS " ")
JOIN("${PC_LibOSRM_CFLAGS}" " " output)
set(LibOSRM_CXXFLAGS ${output})
set(LibOSRM_LIBRARY_DIRS ${PC_LibOSRM_LIBRARY_DIRS})
find_path(LibOSRM_INCLUDE_DIR osrm/osrm.hpp
PATH_SUFFIXES osrm include/osrm include
@@ -19,8 +30,6 @@ find_path(LibOSRM_INCLUDE_DIR osrm/osrm.hpp
/opt/local
/opt)
set(LibOSRM_INCLUDE_DIRS ${LibOSRM_INCLUDE_DIR})
find_library(TEST_LibOSRM_STATIC_LIBRARY Names osrm.lib libosrm.a
PATH_SUFFIXES osrm lib/osrm lib
HINTS ${PC_LibOSRM_LIBDIR} ${PC_LibOSRM_LIBRARY_DIRS}
@@ -30,7 +39,7 @@ find_library(TEST_LibOSRM_STATIC_LIBRARY Names osrm.lib libosrm.a
/usr
/opt/local
/opt)
find_library(TEST_LibOSRM_DYNAMIC_LIBRARY Names osrm.dynlib libosrm.so
find_library(TEST_LibOSRM_DYNAMIC_LIBRARY Names libosrm.dylib libosrm.so
PATH_SUFFIXES osrm lib/osrm lib
HINTS ${PC_LibOSRM_LIBDIR} ${PC_LibOSRM_LIBRARY_DIRS}
~/Library/Frameworks
@@ -40,26 +49,15 @@ find_library(TEST_LibOSRM_DYNAMIC_LIBRARY Names osrm.dynlib libosrm.so
/opt/local
/opt)
if (NOT ("${TEST_LibOSRM_STATIC_LIBRARY}" STREQUAL "TEST_LibOSRM_STATIC_LIBRARY-NOTFOUND"))
if ("${PC_LibOSRM_STATIC_LIBRARIES}" STREQUAL "")
set(LibOSRM_STATIC_LIBRARIES ${TEST_LibOSRM_STATIC_LIBRARY})
else()
set(LibOSRM_STATIC_LIBRARIES ${PC_LibOSRM_STATIC_LIBRARIES})
endif()
set(LibOSRM_LIBRARIES ${LibOSRM_STATIC_LIBRARIES})
endif()
if (NOT ("${TEST_LibOSRM_DYNAMIC_LIBRARY}" STREQUAL "TEST_LibOSRM_DYNAMIC_LIBRARY-NOTFOUND"))
if ("${PC_LibOSRM_LIBRARIES}" STREQUAL "")
set(LibOSRM_DYNAMIC_LIBRARIES ${TEST_LibOSRM_DYNAMIC_LIBRARY})
else()
set(LibOSRM_DYNAMIC_LIBRARIES ${PC_LibOSRM_LIBRARIES})
endif()
set(LibOSRM_LIBRARIES ${LibOSRM_DYNAMIC_LIBRARIES})
endif()
set(LibOSRM_DEPENDENT_LIBRARIES ${PC_LibOSRM_STATIC_LDFLAGS})
set(LibOSRM_LIBRARIES ${PC_LibOSRM_LDFLAGS})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBOSRM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LibOSRM DEFAULT_MSG
LibOSRM_LIBRARIES LibOSRM_INCLUDE_DIR)
LibOSRM_LIBRARY_DIRS
LibOSRM_CXXFLAGS
LibOSRM_LIBRARIES
LibOSRM_DEPENDENT_LIBRARIES
LibOSRM_INCLUDE_DIR)
+63 -43
View File
@@ -1,61 +1,81 @@
#include "osrm/json_container.hpp"
#include "osrm/engine_config.hpp"
#include "osrm/match_parameters.hpp"
#include "osrm/nearest_parameters.hpp"
#include "osrm/route_parameters.hpp"
#include "osrm/osrm.hpp"
#include "osrm/table_parameters.hpp"
#include "osrm/trip_parameters.hpp"
#include "osrm/coordinate.hpp"
#include "osrm/engine_config.hpp"
#include "osrm/json_container.hpp"
#include "osrm/osrm.hpp"
#include "osrm/status.hpp"
#include <exception>
#include <iostream>
#include <string>
#include <utility>
#include <iostream>
#include <exception>
#include <cstdlib>
int main(int argc, const char *argv[]) try
int main(int argc, const char *argv[])
{
if (argc < 2)
{
std::cerr << "Error: Not enough arguments." << std::endl
<< "Run " << argv[0] << " data.osrm" << std::endl;
std::cerr << "Usage: " << argv[0] << " data.osrm\n";
return EXIT_FAILURE;
}
osrm::EngineConfig engine_config;
std::string base_path(argv[1]);
engine_config.server_paths["ramindex"] = base_path + ".ramIndex";
engine_config.server_paths["fileindex"] = base_path + ".fileIndex";
engine_config.server_paths["hsgrdata"] = base_path + ".hsgr";
engine_config.server_paths["nodesdata"] = base_path + ".nodes";
engine_config.server_paths["edgesdata"] = base_path + ".edges";
engine_config.server_paths["coredata"] = base_path + ".core";
engine_config.server_paths["geometries"] = base_path + ".geometry";
engine_config.server_paths["timestamp"] = base_path + ".timestamp";
engine_config.server_paths["namesdata"] = base_path + ".names";
engine_config.use_shared_memory = false;
using namespace osrm;
osrm::OSRM routing_machine(engine_config);
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
EngineConfig config;
config.storage_config = {argv[1]};
config.use_shared_memory = false;
osrm::RouteParameters route_parameters;
// route is in Monaco
route_parameters.service = "viaroute";
route_parameters.AddCoordinate(43.731142, 7.419758);
route_parameters.AddCoordinate(43.736825, 7.419505);
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
const OSRM osrm{config};
osrm::json::Object json_result;
const int result_code = routing_machine.RunQuery(route_parameters, json_result);
std::cout << "result code: " << result_code << std::endl;
// 2xx code
if (result_code / 100 == 2)
// The following shows how to use the Route service; configure this service
RouteParameters params;
// Route in monaco
params.coordinates.push_back({util::FloatLongitude{7.419758}, util::FloatLatitude{43.731142}});
params.coordinates.push_back({util::FloatLongitude{7.419505}, util::FloatLatitude{43.736825}});
// Response is in JSON format
json::Object result;
// Execute routing request, this does the heavy lifting
const auto status = osrm.Route(params, result);
if (status == Status::Ok)
{
// Extract data out of JSON structure
auto& summary = json_result.values["route_summary"].get<osrm::json::Object>();
auto duration = summary.values["total_time"].get<osrm::json::Number>().value;
auto distance = summary.values["total_distance"].get<osrm::json::Number>().value;
std::cout << "duration: " << duration << std::endl;
std::cout << "distance: " << distance << std::endl;
auto &routes = result.values["routes"].get<json::Array>();
// Let's just use the first route
auto &route = routes.values.at(0).get<json::Object>();
const auto distance = route.values["distance"].get<json::Number>().value;
const auto duration = route.values["duration"].get<json::Number>().value;
// Warn users if extract does not contain the default Berlin coordinates from above
if (distance == 0 or duration == 0)
{
std::cout << "Note: distance or duration is zero. ";
std::cout << "You are probably doing a query outside of the OSM extract.\n\n";
}
std::cout << "Distance: " << distance << " meter\n";
std::cout << "Duration: " << duration << " seconds\n";
return EXIT_SUCCESS;
}
else if (status == Status::Error)
{
const auto code = result.values["code"].get<json::String>().value;
const auto message = result.values["message"].get<json::String>().value;
std::cout << "Code: " << code << "\n";
std::cout << "Message: " << code << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
catch (const std::exception &current_exception)
{
std::cout << "exception: " << current_exception.what();
return EXIT_FAILURE;
}
+27 -1
View File
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on ways
Background:
Given the profile "bicycle"
Scenario: Bike - Access tag hierachy on ways
Scenario: Bike - Access tag hierarchy on ways
Then routability should be
| highway | access | vehicle | bicycle | bothw |
| | | | | x |
@@ -121,6 +121,7 @@ Feature: Bike - Access tags on ways
| private | | | |
| agricultural | | | |
| forestry | | | |
| delivery | | | |
| | yes | | x |
| | permissive | | x |
| | designated | | x |
@@ -129,6 +130,7 @@ Feature: Bike - Access tags on ways
| | private | | |
| | agricultural | | |
| | forestry | | |
| | delivery | | |
| | | yes | x |
| | | permissive | x |
| | | designated | x |
@@ -137,6 +139,7 @@ Feature: Bike - Access tags on ways
| | | private | |
| | | agricultural | |
| | | forestry | |
| | | delivery | |
Scenario: Bike - Access tags on both node and way
Then routability should be
@@ -171,3 +174,26 @@ Feature: Bike - Access tags on ways
| cycleway | | no | | x |
| runway | | | yes | |
| cycleway | | | no | x |
Scenario: Bike - Bridleways when access is explicit
Then routability should be
| highway | horse | foot | bicycle | bothw |
| bridleway | | | yes | x |
| bridleway | | yes | | x |
| bridleway | designated | | | |
| bridleway | | | | |
Scenario: Bike - Tram with oneway when access is implicit
Then routability should be
| highway | railway | access | oneway | bothw |
| residential | tram | | yes | x |
| service | tram | psv | yes | x |
Scenario: Bike - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | x |
| footway | permissive | x |
| garbagetag | permissive | x |
+4 -1
View File
@@ -5,7 +5,7 @@ Feature: Bike - Access tags on nodes
Background:
Given the profile "bicycle"
Scenario: Bike - Access tag hierachy on nodes
Scenario: Bike - Access tag hierarchy on nodes
Then routability should be
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
| | | | | x |
@@ -47,6 +47,7 @@ Feature: Bike - Access tags on nodes
| private | | | |
| agricultural | | | |
| forestry | | | |
| delivery | | | |
| | yes | | x |
| | permissive | | x |
| | designated | | x |
@@ -55,6 +56,7 @@ Feature: Bike - Access tags on nodes
| | private | | |
| | agricultural | | |
| | forestry | | |
| | delivery | | |
| | | yes | x |
| | | permissive | x |
| | | designated | x |
@@ -63,3 +65,4 @@ Feature: Bike - Access tags on nodes
| | | private | |
| | | agricultural | |
| | | forestry | |
| | | delivery | |
+59 -50
View File
@@ -7,9 +7,11 @@ Feature: Bike - Squares and other areas
@square
Scenario: Bike - Route along edge of a squares
Given the node map
| x | |
| a | b |
| d | c |
"""
x
a b
d c
"""
And the ways
| nodes | area | highway |
@@ -17,22 +19,24 @@ Feature: Bike - Squares and other areas
| abcda | yes | residential |
When I route I should get
| from | to | route |
| a | b | abcda |
| a | d | abcda |
| b | c | abcda |
| c | b | abcda |
| c | d | abcda |
| d | c | abcda |
| d | a | abcda |
| a | d | abcda |
| from | to | route |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
@building
Scenario: Bike - Don't route on buildings
Given the node map
| x | |
| a | b |
| d | c |
"""
x
a b
d c
"""
And the ways
| nodes | highway | area | building | access |
@@ -41,21 +45,23 @@ Feature: Bike - Squares and other areas
When I route I should get
| from | to | route |
| a | b | xa |
| a | d | xa |
| b | c | xa |
| c | b | xa |
| c | d | xa |
| d | c | xa |
| d | a | xa |
| a | d | xa |
| a | b | xa,xa |
| a | d | xa,xa |
| b | c | xa,xa |
| c | b | xa,xa |
| c | d | xa,xa |
| d | c | xa,xa |
| d | a | xa,xa |
| a | d | xa,xa |
@parking
Scenario: Bike - parking areas
Given the node map
| e | | | f |
| x | a | b | y |
| | d | c | |
"""
e f
x a b y
d c
"""
And the ways
| nodes | highway | amenity |
@@ -65,23 +71,26 @@ Feature: Bike - Squares and other areas
| abcda | (nil) | parking |
When I route I should get
| from | to | route |
| x | y | xa,abcda,by |
| y | x | by,abcda,xa |
| a | b | abcda |
| a | d | abcda |
| b | c | abcda |
| c | b | abcda |
| c | d | abcda |
| d | c | abcda |
| d | a | abcda |
| a | d | abcda |
| from | to | route |
| x | y | xa,abcda,by,by |
| y | x | by,abcda,xa,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
@train @platform
Scenario: Bike - railway platforms
Given the node map
| x | a | b | y |
| | d | c | |
"""
x a b y
d c
"""
And the ways
| nodes | highway | railway |
@@ -90,14 +99,14 @@ Feature: Bike - Squares and other areas
| abcda | (nil) | platform |
When I route I should get
| from | to | route |
| x | y | xa,abcda,by |
| y | x | by,abcda,xa |
| a | b | abcda |
| a | d | abcda |
| b | c | abcda |
| c | b | abcda |
| c | d | abcda |
| d | c | abcda |
| d | a | abcda |
| a | d | abcda |
| from | to | route |
| x | y | xa,abcda,by,by |
| y | x | by,abcda,xa,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
+27 -23
View File
@@ -1,14 +1,16 @@
@routing @bicycle @bridge
Feature: Bicycle - Handle movable bridge
Feature: Bicycle - Handle cycling
Background:
Given the profile "bicycle"
Scenario: Car - Use a ferry route
Scenario: Bicycle - Use a ferry route
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | bridge | bicycle |
@@ -17,21 +19,23 @@ Feature: Bicycle - Handle movable bridge
| efg | primary | | |
When I route I should get
| from | to | route | modes |
| a | g | abc,cde,efg | 1,5,1 |
| b | f | abc,cde,efg | 1,5,1 |
| e | c | cde | 5 |
| e | b | cde,abc | 5,1 |
| e | a | cde,abc | 5,1 |
| c | e | cde | 5 |
| c | f | cde,efg | 5,1 |
| c | g | cde,efg | 5,1 |
| from | to | route | modes |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| e | c | cde,cde | cycling,cycling |
| e | b | cde,abc,abc | cycling,cycling,cycling |
| e | a | cde,abc,abc | cycling,cycling,cycling |
| c | e | cde,cde | cycling,cycling |
| c | f | cde,efg,efg | cycling,cycling,cycling |
| c | g | cde,efg,efg | cycling,cycling,cycling |
Scenario: Car - Properly handle durations
Scenario: Bicycle - Properly handle durations
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | bridge | duration |
@@ -40,8 +44,8 @@ Feature: Bicycle - Handle movable bridge
| efg | primary | | |
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg | 1,5,1 | 5 km/h |
| b | f | abc,cde,efg | 1,5,1 | 4 km/h |
| c | e | cde | 5 | 2 km/h |
| e | c | cde | 5 | 2 km/h |
| 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 |
+40 -34
View File
@@ -6,10 +6,12 @@ Feature: Bike - Destination only, no passing through
Scenario: Bike - Destination only street
Given the node map
| a | | | | e |
| | b | c | d | |
| | | | | |
| x | | | | y |
"""
a e
b c d
x y
"""
And the ways
| nodes | access |
@@ -19,22 +21,24 @@ Feature: Bike - Destination only, no passing through
| axye | |
When I route I should get
| 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 |
| 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 |
Scenario: Bike - Destination only street
Given the node map
| a | | | | e |
| | b | c | d | |
| | | | | |
| x | | | | y |
"""
a e
b c d
x y
"""
And the ways
| nodes | access |
@@ -45,21 +49,23 @@ Feature: Bike - Destination only, no passing through
| axye | |
When I route I should get
| 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 |
| 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 |
Scenario: Bike - Routing inside a destination only area
Given the node map
| a | | c | | e |
| | b | | d | |
| x | | | | y |
"""
a c e
b d
x y
"""
And the ways
| nodes | access |
@@ -70,8 +76,8 @@ Feature: Bike - Destination only, no passing through
| axye | |
When I route I should get
| from | to | route |
| a | e | ab,bc,cd,de |
| e | a | de,cd,bc,ab |
| b | d | bc,cd |
| d | b | cd,bc |
| 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 |
+27 -21
View File
@@ -6,9 +6,11 @@ Feature: Bike - Handle ferry routes
Scenario: Bike - Ferry route
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route | bicycle |
@@ -17,22 +19,24 @@ Feature: Bike - Handle ferry routes
| efg | primary | | |
When I route I should get
| from | to | route |
| a | g | abc,cde,efg |
| b | f | abc,cde,efg |
| e | c | cde |
| e | b | cde,abc |
| e | a | cde,abc |
| c | e | cde |
| c | f | cde,efg |
| c | g | cde,efg |
| from | to | route |
| a | g | abc,cde,efg,efg |
| b | f | abc,cde,efg,efg |
| e | c | cde,cde |
| e | b | cde,abc,abc |
| e | a | cde,abc,abc |
| c | e | cde,cde |
| c | f | cde,efg,efg |
| c | g | cde,efg,efg |
Scenario: Bike - Ferry duration, single node
Given the node map
| a | b | c | d |
| | | e | f |
| | | g | h |
| | | i | j |
"""
a b c d
e f
g h
i j
"""
And the ways
| nodes | highway | route | bicycle | duration |
@@ -48,8 +52,10 @@ Feature: Bike - Handle ferry routes
Scenario: Bike - Ferry duration, multiple nodes
Given the node map
| x | | | | | y |
| | a | b | c | d | |
"""
x y
a b c d
"""
And the ways
| nodes | highway | route | bicycle | duration |
@@ -58,6 +64,6 @@ Feature: Bike - Handle ferry routes
| abcd | | ferry | yes | 1:00 |
When I route I should get
| from | to | route | time |
| a | d | abcd | 3600s +-10 |
| d | a | abcd | 3600s +-10 |
| from | to | route | time |
| a | d | abcd,abcd | 3600s |
| d | a | abcd,abcd | 3600s |
+13 -11
View File
@@ -9,7 +9,7 @@ Feature: Bike - Max speed restrictions
Then routability should be
| highway | maxspeed | bothw |
| residential | | 15 km/h |
| residential | 10 | 10 km/h |
| residential | 10 | 9 km/h |
Scenario: Bicycle - Ignore maxspeed when higher than way speed
Then routability should be
@@ -40,7 +40,9 @@ Feature: Bike - Max speed restrictions
Scenario: Bike - Do not use maxspeed when higher that way type speed
Given the node map
| a | b | c |
"""
a b c
"""
And the ways
| nodes | highway | maxspeed |
@@ -48,9 +50,9 @@ Feature: Bike - Max speed restrictions
| bc | residential | 80 |
When I route I should get
| from | to | route | speed |
| a | b | ab | 15 km/h |
| b | c | bc | 15 km/h |
| from | to | route | speed |
| a | b | ab,ab | 15 km/h |
| b | c | bc,bc | 15 km/h |
Scenario: Bike - Forward/backward maxspeed
Given the shortcuts
@@ -63,12 +65,12 @@ Feature: Bike - Max speed restrictions
Then routability should be
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
| | | | 15 km/h | 15 km/h |
| 10 | | | 10 km/h | 10 km/h |
| | 10 | | 10 km/h | 15 km/h |
| | | 10 | 15 km/h | 10 km/h |
| 2 | 10 | | 10 km/h | 2 km/h |
| 2 | | 10 | 2 km/h | 10 km/h |
| 2 | 5 | 10 | 5 km/h | 10 km/h |
| 10 | | | 9 km/h | 9 km/h |
| | 10 | | 9 km/h | 15 km/h |
| | | 10 | 14 km/h | 9 km/h |
| 2 | 10 | | 9 km/h | 2 km/h |
| 2 | | 10 | 2 km/h | 9 km/h |
| 2 | 5 | 10 | 5 km/h | 9 km/h |
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
Then routability should be
+93 -78
View File
@@ -1,19 +1,15 @@
@routing @bicycle @mode
Feature: Bike - Mode flag
# bicycle modes:
# 1 bike
# 2 pushing
# 3 ferry
# 4 train
Background:
Given the profile "bicycle"
Scenario: Bike - Mode when using a ferry
Given the node map
| a | b | |
| | c | d |
"""
a b
c d
"""
And the ways
| nodes | highway | route | duration |
@@ -22,18 +18,20 @@ Feature: Bike - Mode flag
| cd | primary | | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,3,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,3,1 |
| c | a | bc,ab | head,left,destination | 3,1 |
| d | b | cd,bc | head,right,destination | 1,3 |
| a | c | ab,bc | head,right,destination | 1,3 |
| b | d | bc,cd | head,left,destination | 3,1 |
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,ferry,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,ferry,cycling,cycling |
| c | a | bc,ab,ab | ferry,cycling,cycling |
| d | b | cd,bc,bc | cycling,ferry,ferry |
| a | c | ab,bc,bc | cycling,ferry,ferry |
| b | d | bc,cd,cd | ferry,cycling,cycling |
Scenario: Bike - Mode when using a train
Given the node map
| a | b | |
| | c | d |
"""
a b
c d
"""
And the ways
| nodes | highway | railway | bicycle |
@@ -42,38 +40,45 @@ Feature: Bike - Mode flag
| cd | primary | | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,4,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,4,1 |
| c | a | bc,ab | head,left,destination | 4,1 |
| d | b | cd,bc | head,right,destination | 1,4 |
| a | c | ab,bc | head,right,destination | 1,4 |
| b | d | bc,cd | head,left,destination | 4,1 |
| 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 |
Scenario: Bike - Mode when pushing bike against oneways
Given the node map
| a | b | |
| | c | d |
"""
a b e
f c d
"""
And the ways
| nodes | highway | oneway |
| ab | primary | |
| bc | primary | yes |
| cd | primary | |
| be | primary | |
| cf | primary | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,straight,straight,destination | 1,1,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,straight,destination | 1,1 |
| b | d | bc,cd | head,straight,destination | 1,1 |
| 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 |
Scenario: Bike - Mode when pushing on pedestrain streets
Given the node map
| a | b | |
| | c | d |
"""
a b
c d
"""
And the ways
| nodes | highway |
@@ -82,18 +87,20 @@ Feature: Bike - Mode flag
| cd | primary |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
Scenario: Bike - Mode when pushing on pedestrain areas
Given the node map
| a | b | | |
| | c | d | f |
"""
a b
c d f
"""
And the ways
| nodes | highway | area |
@@ -102,18 +109,20 @@ Feature: Bike - Mode flag
| df | primary | |
When I route I should get
| from | to | route | modes |
| a | f | ab,bcd,df | 1,2,1 |
| f | a | df,bcd,ab | 1,2,1 |
| d | a | bcd,ab | 2,1 |
| f | b | df,bcd | 1,2 |
| a | d | ab,bcd | 1,2 |
| b | f | bcd,df | 2,1 |
| from | to | route | modes |
| a | f | ab,bcd,df,df | cycling,pushing bike,cycling,cycling |
| f | a | df,bcd,ab,ab | cycling,pushing bike,cycling,cycling |
| d | a | bcd,ab,ab | pushing bike,cycling,cycling |
| f | b | df,bcd,bcd | cycling,pushing bike,pushing bike |
| a | d | ab,bcd,bcd | cycling,pushing bike,pushing bike |
| b | f | bcd,df,df | pushing bike,cycling,cycling |
Scenario: Bike - Mode when pushing on steps
Given the node map
| a | b | | |
| | c | d | f |
"""
a b
c d f
"""
And the ways
| nodes | highway |
@@ -122,18 +131,20 @@ Feature: Bike - Mode flag
| cd | primary |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
Scenario: Bike - Mode when bicycle=dismount
Given the node map
| a | b | | |
| | c | d | f |
"""
a b
c d f
"""
And the ways
| nodes | highway | bicycle |
@@ -142,36 +153,40 @@ Feature: Bike - Mode flag
| cd | primary | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
| from | to | route | modes |
| a | d | ab,bc,cd,cd | cycling,pushing bike,cycling,cycling |
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
Scenario: Bicycle - Modes when starting on forward oneway
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | oneway |
| ab | yes |
When I route I should get
| from | to | route | modes |
| a | b | ab | 1 |
| b | a | ab | 2 |
| from | to | route | modes |
| a | b | ab,ab | cycling,cycling |
| b | a | ab,ab | pushing bike,pushing bike |
Scenario: Bicycle - Modes when starting on reverse oneway
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | oneway |
| ab | -1 |
When I route I should get
| from | to | route | modes |
| a | b | ab | 2 |
| b | a | ab | 1 |
| from | to | route | modes |
| a | b | ab,ab | pushing bike,pushing bike |
| b | a | ab,ab | cycling,cycling |
+15 -11
View File
@@ -6,22 +6,26 @@ Feature: Bike - Street names in instructions
Scenario: Bike - A named street
Given the node map
| a | b |
| | c |
"""
a b
c
"""
And the ways
| nodes | name |
| ab | My Way |
| bc | Your Way |
| nodes | name | ref |
| ab | My Way | A6 |
| bc | Your Way | A7 |
When I route I should get
| from | to | route |
| a | c | My Way,Your Way |
| from | to | route | ref |
| a | c | My Way,Your Way,Your Way | A6,A7,A7 |
@unnamed
Scenario: Bike - Use way type to describe unnamed ways
Scenario: Bike - No longer use way type to describe unnamed ways, see #3231
Given the node map
| a | b | c | d |
"""
a b c d
"""
And the ways
| nodes | highway | name |
@@ -29,5 +33,5 @@ Feature: Bike - Street names in instructions
| bcd | track | |
When I route I should get
| from | to | route |
| a | d | {highway:cycleway},{highway:track} |
| from | to | route |
| a | d | , |
+27 -21
View File
@@ -18,8 +18,10 @@ Feature: Bike - Oneway streets
Scenario: Bike - Around the Block
Given the node map
| a | b |
| d | c |
"""
a b
f d c e
"""
And the ways
| nodes | oneway | foot |
@@ -27,11 +29,13 @@ Feature: Bike - Oneway streets
| bc | | no |
| cd | | no |
| da | | no |
| df | | no |
| ce | | no |
When I route I should get
| from | to | route |
| a | b | ab |
| b | a | bc,cd,da |
| from | to | route |
| a | b | ab,ab |
| b | a | bc,cd,da,da |
Scenario: Bike - Handle various oneway tag values
Then routability should be
@@ -48,22 +52,22 @@ Feature: Bike - Oneway streets
Scenario: Bike - Implied oneways
Then routability should be
| highway | foot | bicycle | junction | forw | backw |
| | no | | | x | x |
| | no | | roundabout | x | |
| motorway | no | yes | | x | |
| motorway_link | no | yes | | x | |
| motorway | no | yes | roundabout | x | |
| motorway_link | no | yes | roundabout | x | |
| highway | foot | bicycle | junction | forw | backw | # |
| | no | | | x | x | |
| | no | | roundabout | x | | |
| motorway | no | yes | | x | | |
| motorway_link | no | yes | | x | x | does not imply oneway |
| motorway | no | yes | roundabout | x | | |
| motorway_link | no | yes | roundabout | x | | |
Scenario: Bike - Overriding implied oneways
Then routability should be
| highway | foot | junction | oneway | forw | backw |
| primary | no | roundabout | no | x | x |
| primary | no | roundabout | yes | x | |
| motorway_link | no | | -1 | | |
| trunk_link | no | | -1 | | |
| primary | no | roundabout | -1 | | x |
| highway | foot | junction | oneway | forw | backw |
| primary | no | roundabout | no | x | x |
| primary | no | roundabout | yes | x | |
| motorway_link | no | | -1 | | |
| trunk_link | no | | -1 | | |
| primary | no | roundabout | -1 | | x |
Scenario: Bike - Oneway:bicycle should override normal oneways tags
Then routability should be
@@ -115,7 +119,9 @@ Feature: Bike - Oneway streets
Scenario: Bike - Two consecutive oneways
Given the node map
| a | b | c |
"""
a b c
"""
And the ways
| nodes | oneway |
@@ -124,5 +130,5 @@ Feature: Bike - Oneway streets
When I route I should get
| from | to | route |
| a | c | ab,bc |
| from | to | route |
| a | c | ab,bc,bc |
+38 -31
View File
@@ -32,12 +32,14 @@ Feature: Bike - Accessability of different way types
| primary | -1 | foot | bike |
| pedestrian | -1 | foot | foot |
@square
@square
Scenario: Bike - Push bikes on pedestrian areas
Given the node map
| x | |
| a | b |
| d | c |
"""
x
a b
d c
"""
And the ways
| nodes | area | highway |
@@ -46,14 +48,14 @@ Feature: Bike - Accessability of different way types
When I route I should get
| from | to | route |
| a | b | abcda |
| a | d | abcda |
| b | c | abcda |
| c | b | abcda |
| c | d | abcda |
| d | c | abcda |
| d | a | abcda |
| a | d | abcda |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
Scenario: Bike - Pushing bikes on ways with foot=yes
Then routability should be
@@ -62,7 +64,7 @@ Feature: Bike - Accessability of different way types
| motorway | yes | foot | |
| runway | | | |
| runway | yes | foot | foot |
@todo
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
Then routability should be
@@ -72,43 +74,48 @@ Feature: Bike - Accessability of different way types
| motorway | | yes | | foot |
@construction
Scenario: Bike - Don't allow routing on ways still under construction
Scenario: Bike - Don't allow routing on ways still under construction
Then routability should be
| highway | foot | bicycle | bothw |
| primary | | | x |
| construction | | | |
| construction | yes | | |
| construction | | yes | |
@roundabout
Scenario: Bike - Don't push bikes against oneway flow on roundabouts
Then routability should be
| junction | forw | backw |
| roundabout | x | |
Scenario: Bike - Instructions when pushing bike on oneways
Given the node map
| a | b | |
| | c | d |
"""
a b e
f c d
"""
And the ways
| nodes | highway | oneway |
| ab | primary | |
| bc | primary | yes |
| cd | primary | |
| be | primary | |
| cf | primary | |
When I route I should get
| from | to | route | turns |
| a | d | ab,bc,cd | head,straight,straight,destination |
| d | a | cd,bc,ab | head,right,left,destination |
| c | a | bc,ab | head,left,destination |
| d | b | cd,bc | head,right,destination |
| 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 |
@todo
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
Given the node map
| a | b | |
| | c | d |
"""
a b
c d
"""
And the ways
| nodes | highway |
@@ -117,8 +124,8 @@ Feature: Bike - Accessability of different way types
| cd | primary |
When I route I should get
| from | to | route | turns |
| a | d | ab,bc,cd | head,right,left,destination |
| d | a | cd,bc,ab | head,right,left,destination |
| c | a | bc,ab | head,left,destination |
| d | b | cd,bc | head,right,destination |
| 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 |
+15 -9
View File
@@ -6,36 +6,42 @@ Feature: Bike - Way ref
Scenario: Bike - Way with both name and ref
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | name | ref |
| ab | Utopia Drive | E7 |
When I route I should get
| from | to | route |
| a | b | Utopia Drive / E7 |
| from | to | route | ref |
| a | b | Utopia Drive,Utopia Drive | E7,E7 |
Scenario: Bike - Way with only ref
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | name | ref |
| ab | | E7 |
When I route I should get
| from | to | route |
| a | b | E7 |
| from | to | route | ref |
| a | b | , | E7,E7 |
Scenario: Bike - Way with only name
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | name |
| ab | Utopia Drive |
When I route I should get
| from | to | route |
| a | b | Utopia Drive |
| from | to | route |
| a | b | Utopia Drive,Utopia Drive |
+105 -83
View File
@@ -9,9 +9,11 @@ Feature: Bike - Turn restrictions
@no_turning
Scenario: Bike - No left turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -25,17 +27,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | wj | j | no_left_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Bike - No right turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -49,17 +53,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | ej | j | no_right_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Bike - No u-turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -73,17 +79,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | wj | j | no_u_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Bike - Handle any no_* relation
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -97,17 +105,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | wj | j | no_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Bike - Only left turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -121,17 +131,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | wj | j | only_left_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Bike - Only right turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -145,17 +157,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | ej | j | only_right_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Bike - Only straight on
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -169,17 +183,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | nj | j | only_straight_on |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Bike - Handle any only_* restriction
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway | foot |
@@ -193,17 +209,19 @@ Feature: Bike - Turn restrictions
| restriction | sj | nj | j | only_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@except
Scenario: Bike - Except tag and on no_ restrictions
Given the node map
| b | x | c |
| a | j | d |
| | s | |
"""
b x c
a j d
s
"""
And the ways
| nodes | oneway | foot |
@@ -222,18 +240,20 @@ Feature: Bike - Turn restrictions
| restriction | sj | dj | j | no_right_turn | bicycle |
When I route I should get
| from | to | route |
| s | a | sj,aj |
| s | b | sj,bj |
| s | c | sj,cj |
| s | d | sj,dj |
| from | to | route |
| s | a | sj,aj,aj |
| s | b | sj,bj,bj |
| s | c | sj,cj,cj |
| s | d | sj,dj,dj |
@except
Scenario: Bike - Except tag and on only_ restrictions
Given the node map
| a | | b |
| | j | |
| | s | |
"""
a b
j
s
"""
And the ways
| nodes | oneway | foot |
@@ -246,19 +266,21 @@ Feature: Bike - Turn restrictions
| restriction | sj | aj | j | only_straight_on | bicycle |
When I route I should get
| from | to | route |
| s | a | sj,aj |
| s | b | sj,bj |
| from | to | route |
| s | a | sj,aj,aj |
| s | b | sj,bj,bj |
@except
Scenario: Bike - Multiple except tag values
Given the node map
| s | j | a |
| | | b |
| | | c |
| | | d |
| | | e |
| | | f |
"""
s j a
b
c
d
e
f
"""
And the ways
| nodes | oneway | foot |
@@ -280,10 +302,10 @@ Feature: Bike - Turn restrictions
| restriction | sj | jf | j | no_straight_on | bicycle, bus |
When I route I should get
| from | to | route |
| s | a | sj,ja |
| s | b | sj,jb |
| s | c | sj,jc |
| s | d | sj,jd |
| s | e | sj,je |
| s | f | sj,jf |
| from | to | route |
| s | a | sj,ja,ja |
| s | b | sj,jb,jb |
| s | c | sj,jc,jc |
| s | d | sj,jd,jd |
| s | e | sj,je,je |
| s | f | sj,jf,jf |
-30
View File
@@ -1,30 +0,0 @@
@routing @bicycle @roundabout @instruction
Feature: Roundabout Instructions
Background:
Given the profile "bicycle"
Scenario: Bicycle - Roundabout instructions
Given the node map
| | | v | | |
| | | d | | |
| s | a | | c | u |
| | | b | | |
| | | t | | |
And the ways
| nodes | junction |
| sa | |
| tb | |
| uc | |
| vd | |
| abcda | roundabout |
When I route I should get
| from | to | route | turns |
| s | t | sa,tb | head,enter_roundabout-1,destination |
| s | u | sa,uc | head,enter_roundabout-2,destination |
| s | v | sa,vd | head,enter_roundabout-3,destination |
| u | v | uc,vd | head,enter_roundabout-1,destination |
| u | s | uc,sa | head,enter_roundabout-2,destination |
| u | t | uc,tb | head,enter_roundabout-3,destination |
+8 -6
View File
@@ -14,8 +14,10 @@ Feature: Bike - Stop areas for public transport
Scenario: Bike - railway platforms
Given the node map
| a | b | c | d |
| | s | t | |
"""
a b c d
s t
"""
And the nodes
| node | public_transport |
@@ -31,7 +33,7 @@ Feature: Bike - Stop areas for public transport
| public_transport | stop_area | c | st |
When I route I should get
| from | to | route |
| a | d | abcd |
| s | t | st |
| s | d | /st,.+,abcd/ |
| from | to | route |
| a | d | abcd,abcd |
| s | t | st,st |
| s | d | /st,.+,abcd/,abcd/ |
+41 -22
View File
@@ -6,35 +6,54 @@ Feature: Bike - Surfaces
Scenario: Bicycle - Slow surfaces
Then routability should be
| highway | surface | bothw |
| cycleway | | 48s |
| cycleway | asphalt | 48s |
| cycleway | cobblestone:flattened | 72s |
| cycleway | paving_stones | 72s |
| cycleway | compacted | 72s |
| cycleway | cobblestone | 120s |
| cycleway | unpaved | 120s |
| cycleway | fine_gravel | 120s |
| cycleway | gravel | 120s |
| cycleway | pebblestone | 120s |
| cycleway | dirt | 120s |
| cycleway | earth | 120s |
| cycleway | grass | 120s |
| cycleway | mud | 240s |
| cycleway | sand | 240s |
| highway | surface | bothw |
| cycleway | | 48 s |
| cycleway | asphalt | 48 s |
| cycleway | cobblestone:flattened | 72 s |
| cycleway | paving_stones | 72 s |
| cycleway | compacted | 72 s |
| cycleway | cobblestone | 120 s |
| cycleway | fine_gravel | 120 s |
| cycleway | gravel | 120 s |
| cycleway | pebblestone | 120.1 s |
| cycleway | dirt | 120 s |
| cycleway | earth | 120 s |
| cycleway | grass | 120 s |
| cycleway | mud | 240 s |
| cycleway | sand | 240.1 s |
| cycleway | sett | 72 s |
Scenario: Bicycle - Good surfaces on small paths
Then routability should be
| highway | surface | bothw |
| cycleway | | 48s |
| path | | 60s |
| track | | 60s |
| track | asphalt | 48s |
| path | asphalt | 48s |
| cycleway | | 48 s |
| path | | 60 s |
| track | | 60 s |
| track | asphalt | 60 s |
| path | asphalt | 60 s |
Scenario: Bicycle - Surfaces should not make unknown ways routable
Then routability should be
| highway | surface | bothw |
| cycleway | | 48s |
| cycleway | | 48 s |
| nosense | | |
| nosense | asphalt | |
Scenario: Bicycle - Surfaces should not increase speed when pushing bikes
Given the node map
"""
a b
c d
"""
And the ways
| nodes | highway | oneway | surface |
| ab | primary | yes | asphalt |
| cd | footway | | asphalt |
When I route I should get
| from | to | route | modes | speed |
| a | b | ab,ab | cycling,cycling | 15 km/h |
| b | a | ab,ab | pushing bike,pushing bike | 6 km/h |
| c | d | cd,cd | pushing bike,pushing bike | 6 km/h |
| d | c | cd,cd | pushing bike,pushing bike | 6 km/h |
+13 -11
View File
@@ -7,9 +7,11 @@ Feature: Turn Penalties
Scenario: Bike - turns should incur a delay that depend on the angle
Given the node map
| c | d | e |
| b | j | f |
| a | s | g |
"""
c d e
b j f
a s g
"""
And the ways
| nodes |
@@ -23,11 +25,11 @@ Feature: Turn Penalties
| jg |
When I route I should get
| from | to | route | time | distance |
| s | a | sj,ja | 39s +-1 | 242m +-1 |
| s | b | sj,jb | 30s +-1 | 200m +-1 |
| s | c | sj,jc | 29s +-1 | 242m +-1 |
| s | d | sj,jd | 20s +-1 | 200m +-1 |
| s | e | sj,je | 29s +-1 | 242m +-1 |
| s | f | sj,jf | 30s +-1 | 200m +-1 |
| s | g | sj,jg | 39s +-1 | 242m +-1 |
| from | to | route | time | distance |
| s | a | sj,ja,ja | 39s +-1 | 242m +-1 |
| s | b | sj,jb,jb | 30s +-1 | 200m +-1 |
| s | c | sj,jc,jc | 29s +-1 | 242m +-1 |
| s | d | sj,jd,jd | 20s +-1 | 200m +-1 |
| s | e | sj,je,je | 29s +-1 | 242m +-1 |
| s | f | sj,jf,jf | 30s +-1 | 200m +-1 |
| s | g | sj,jg,jg | 39s +-1 | 242m +-1 |
+170 -13
View File
@@ -5,7 +5,7 @@ Feature: Car - Restricted access
Background:
Given the profile "car"
Scenario: Car - Access tag hierachy on ways
Scenario: Car - Access tag hierarchy on ways
Then routability should be
| access | vehicle | motor_vehicle | motorcar | bothw |
| | | | | x |
@@ -30,7 +30,36 @@ Feature: Car - Restricted access
| | | no | yes | x |
| | | yes | no | |
Scenario: Car - Access tag hierachy on nodes
Scenario: Car - Access tag hierarchy and forward/backward
Then routability should be
| access | access:forward | access:backward | motorcar | motorcar:forward | motorcar:backward | forw | backw |
| | | | | | | x | x |
| yes | | | | | | x | x |
| yes | no | | | | | | x |
| yes | yes | | no | | | | |
| yes | yes | | yes | no | | | x |
| yes | | | | | | x | x |
| yes | | no | | | | x | |
| yes | | yes | no | | | | |
| yes | | yes | yes | | no | x | |
| no | | | | | | | |
| no | yes | | | | | x | |
| no | no | | yes | | | x | x |
| no | no | | no | yes | | x | |
| no | | | | | | | |
| no | | yes | | | | | x |
| no | | no | yes | | | x | x |
| no | | no | no | | yes | | x |
| | no | | | no | | | x |
| | | no | | | no | x | |
| | no | | | | no | | |
| | | no | no | | | | |
| | no | | | yes | | x | x |
| | | no | | | yes | x | x |
| | yes | | | no | | | x |
| | | yes | | | no | x | |
Scenario: Car - Access tag hierarchy on nodes
Then routability should be
| node/access | node/vehicle | node/motor_vehicle | node/motorcar | bothw |
| | | | | x |
@@ -90,11 +119,13 @@ Feature: Car - Restricted access
| permissive | x |
| designated | x |
| no | |
| private | |
| private | x |
| agricultural | |
| forestry | |
| psv | |
| delivery | x |
| some_tag | x |
| destination | x |
Scenario: Car - Access tags on nodes
@@ -104,10 +135,11 @@ Feature: Car - Restricted access
| permissive | x |
| designated | x |
| no | |
| private | |
| private | x |
| agricultural | |
| forestry | |
| psv | |
| delivery | x |
| some_tag | x |
Scenario: Car - Access tags on both node and way
@@ -125,15 +157,15 @@ Feature: Car - Restricted access
Scenario: Car - Access combinations
Then routability should be
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
| runway | private | | | permissive | x |
| primary | forestry | | yes | | x |
| cycleway | | | designated | | x |
| residential | | yes | no | | |
| motorway | yes | permissive | | private | |
| trunk | agricultural | designated | permissive | no | |
| pedestrian | | | | | |
| pedestrian | | | | destination | x |
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
| runway | private | | | permissive | x | x | |
| primary | forestry | | yes | | x | x | |
| cycleway | | | designated | | x | x | |
| residential | | yes | no | | | | |
| motorway | yes | permissive | | private | x | | implied oneway |
| trunk | agricultural | designated | permissive | no | | | |
| pedestrian | | | | | | | |
| pedestrian | | | | destination | | | temporary disabled #3773 |
Scenario: Car - Ignore access tags for other modes
Then routability should be
@@ -146,3 +178,128 @@ Feature: Car - Restricted access
| primary | | | no | | x |
| runway | | | | yes | |
| primary | | | | no | x |
@hov
Scenario: Car - designated HOV ways are rated low
Then routability should be
| highway | hov | bothw | forw_rate | backw_rate |
| primary | designated | x | 18 | 18 |
| primary | yes | x | 18 | 18 |
| primary | no | x | 18 | 18 |
# Models:
# https://www.openstreetmap.org/way/124891268
# https://www.openstreetmap.org/way/237173472
@hov
Scenario: Car - I-66 use HOV-only roads with heavy penalty
Then routability should be
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
| motorway | lane | | 3 | designated | yes | x | | 25 |
@hov
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
Then routability should be
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
| primary | designated | designated | | | x | x | 18 | 18 |
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
#| primary | | designated | | | x | x | 18 | 18 |
#| primary | designated | | | | x | x | 18 | 18 |
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
| primary | | | | | x | x | 18 | 18 |
| primary | designated | | | -1 | | x | | 18 |
| primary | | designated | | -1 | | x | | 18 |
| primary | | | designated | yes | x | | 18 | |
| primary | | | designated | -1 | | x | | 18 |
| primary | | | designated\| | yes | x | | 18 | |
| primary | | | designated\| | -1 | | x | | 18 |
| primary | | | designated\|designated | yes | x | | 18 | |
| primary | | | designated\|designated | -1 | | x | | 18 |
| primary | | | designated\|yes | yes | x | | 18 | |
| primary | | | designated\|no | -1 | | x | | 18 |
Scenario: Car - these toll roads always work
Then routability should be
| highway | toll | bothw |
| primary | no | x |
| primary | snowmobile | x |
Scenario: Car - toll=yes ways are enabled by default
Then routability should be
| highway | toll | bothw |
| primary | yes | x |
Scenario: Car - directional access tags
Then routability should be
| highway | access | access:forward | access:backward | forw | backw |
| primary | yes | yes | yes | x | x |
| primary | yes | | no | x | |
| primary | yes | no | | | x |
| primary | yes | no | no | | |
| primary | no | no | no | | |
| primary | no | | yes | | x |
| primary | no | yes | | x | |
| primary | no | yes | yes | x | x |
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
Then routability should be
| node/barrier | access | bothw |
| gate | | x |
| gate | no | |
| gate | yes | x |
| gate | permissive | x |
| gate | designated | x |
| gate | private | x |
| gate | garbagetag | x |
Scenario: Car - a way with conditional access
Then routability should be
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
Scenario: Car - a way with a list of tags
Then routability should be
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw | # |
| primary | | no | destination | | x | |
| primary | destination;agricultural | destination | | x | x | |
| footway | | | destination | | | temporary #3373 |
| track | destination;agricultural | destination | | | x | temporary #3373 |
Scenario: Car - Don't route over steps even if marked as accessible
Then routability should be
| highway | access | forw | backw |
| steps | yes | | |
| steps | no | | |
| primary | | x | x |
Scenario: Car - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | |
| footway | permissive | x |
| garbagetag | permissive | x |
Scenario: Car - Access private blacklist
Then routability should be
| highway | access | bothw |
| footway | yes | x |
| pedestrian | private | |
| footway | private | |
| service | private | |
| cycleway | private | |
| track | private | |
Scenario: Car - Access blacklist
Then routability should be
| highway | access | bothw |
| primary | | x |
| primary | customer | |
| primary | emergency | |
| primary | forestry | |
| primary | agricultural | |
| primary | psv | |
| primary | no | |
+39 -14
View File
@@ -8,7 +8,9 @@ OSRM will use 4/5 of the projected free-flow speed.
Scenario: Car - Advisory speed overwrites maxspeed
Given the node map
| a | b | c |
"""
a b c
"""
And the ways
| nodes | highway | maxspeed | maxspeed:advisory |
@@ -17,12 +19,14 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get
| from | to | route | speed |
| a | b | ab | 47 km/h +- 1 |
| b | c | bc | 47 km/h +- 1 |
| a | b | ab,ab | 36 km/h +- 1 |
| b | c | bc,bc | 36 km/h +- 1 |
Scenario: Car - Advisory speed overwrites forward maxspeed
Given the node map
| a | b | c |
"""
a b c
"""
And the ways
| nodes | highway | maxspeed:forward | maxspeed:advisory:forward |
@@ -31,12 +35,14 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get
| from | to | route | speed |
| a | b | ab | 47 km/h +- 1 |
| b | c | bc | 47 km/h +- 1 |
| a | b | ab,ab | 36 km/h +- 1 |
| b | c | bc,bc | 36 km/h +- 1 |
Scenario: Car - Advisory speed overwrites backwards maxspeed
Given the node map
| a | b | c |
"""
a b c
"""
And the ways
| nodes | highway | maxspeed:backward | maxspeed:advisory:backward |
@@ -45,12 +51,31 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get
| from | to | route | speed |
| b | a | ab | 47 km/h +- 1 |
| c | b | bc | 47 km/h +- 1 |
| b | a | ab,ab | 36 km/h +- 1 |
| c | b | bc,bc | 36 km/h +- 1 |
Scenario: Car - Advisory speed overwrites backwards maxspeed
Given the node map
"""
a b c d
"""
And the ways
| nodes | highway | maxspeed:backward | maxspeed:advisory:backward |
| ab | residential | | 45 |
| bc | residential | 90 | 45 |
| cd | residential | | 45 |
When I route I should get
| from | to | route | speed |
| c | b | bc,bc | 36 km/h +- 1 |
| d | c | cd,cd | 36 km/h +- 1 |
Scenario: Car - Directional advisory speeds play nice with eachother
Given the node map
| a | b | c |
"""
a b c
"""
And the ways
| nodes | highway | maxspeed:advisory | maxspeed:advisory:forward | maxspeed:advisory:backward |
@@ -59,9 +84,9 @@ OSRM will use 4/5 of the projected free-flow speed.
When I route I should get
| from | to | route | speed |
| a | b | ab | 47 km/h +- 1 |
| b | a | ab | 59 km/h +- 1 |
| b | c | bc | 59 km/h +- 1 |
| c | b | bc | 47 km/h +- 1 |
| a | b | ab,ab | 36 km/h +- 1 |
| b | a | ab,ab | 48 km/h +- 1 |
| b | c | bc,bc | 48 km/h +- 1 |
| c | b | bc,bc | 36 km/h +- 1 |
+2 -2
View File
@@ -29,14 +29,14 @@ Feature: Car - Barriers
| gate | permissive | x |
| gate | designated | x |
| gate | no | |
| gate | private | |
| gate | private | x |
| gate | agricultural | |
| wall | | |
| wall | yes | x |
| wall | permissive | x |
| wall | designated | x |
| wall | no | |
| wall | private | |
| wall | private | x |
| wall | agricultural | |
Scenario: Car - Rising bollard exception for barriers
+46 -21
View File
@@ -1,14 +1,16 @@
@routing @car @bridge
Feature: Car - Handle movable bridge
Feature: Car - Handle driving
Background:
Given the profile "car"
Scenario: Car - Use a ferry route
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | bridge | bicycle |
@@ -17,21 +19,44 @@ Feature: Car - Handle movable bridge
| efg | primary | | |
When I route I should get
| from | to | route | modes |
| a | g | abc,cde,efg | 1,3,1 |
| b | f | abc,cde,efg | 1,3,1 |
| e | c | cde | 3 |
| e | b | cde,abc | 3,1 |
| e | a | cde,abc | 3,1 |
| c | e | cde | 3 |
| c | f | cde,efg | 3,1 |
| c | g | cde,efg | 3,1 |
| 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 |
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
Given the node map
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | bridge |
| abc | primary | |
| cde | | movable |
| efg | primary | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
| c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
| e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
Scenario: Car - Properly handle durations
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | bridge | duration |
@@ -40,8 +65,8 @@ Feature: Car - Handle movable bridge
| efg | primary | | |
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg | 1,3,1 | 7 km/h |
| b | f | abc,cde,efg | 1,3,1 | 5 km/h |
| c | e | cde | 3 | 2 km/h |
| e | c | cde | 3 | 2 km/h |
| 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 |
+91 -35
View File
@@ -1,4 +1,4 @@
@routing @car @destination @todo
@routing @car @destination
Feature: Car - Destination only, no passing through
Background:
@@ -6,10 +6,12 @@ Feature: Car - Destination only, no passing through
Scenario: Car - Destination only street
Given the node map
| a | | | | e |
| | b | c | d | |
| | | | | |
| x | | | | y |
"""
a e
b c d
x y
"""
And the ways
| nodes | access |
@@ -19,22 +21,24 @@ Feature: Car - Destination only, no passing through
| axye | |
When I route I should get
| 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 |
| 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 |
Scenario: Car - Destination only street
Given the node map
| a | | | | e |
| | b | c | d | |
| | | | | |
| x | | | | y |
"""
a e
b c d
x y
"""
And the ways
| nodes | access |
@@ -45,21 +49,23 @@ Feature: Car - Destination only, no passing through
| axye | |
When I route I should get
| 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 |
| 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 |
Scenario: Car - Routing inside a destination only area
Given the node map
| a | | c | | e |
| | b | | d | |
| x | | | | y |
"""
a c e
b d
x y
"""
And the ways
| nodes | access |
@@ -70,8 +76,58 @@ Feature: Car - Destination only, no passing through
| axye | |
When I route I should get
| from | to | route |
| a | e | ab,bc,cd,de |
| e | a | de,cd,bc,ab |
| b | d | bc,cd |
| d | b | cd,bc |
| 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 |
Scenario: Car - Routing around a way that becomes destination only
Given the node map
"""
b
\
|
e++d++++++c--i
| \
\ h--a
\ |
\___________g
"""
And the ways
| nodes | access | oneway |
| ah | | no |
| ihg | | no |
| eg | | no |
| icde | | no |
| cde | destination | no |
| eb | | no |
When I route I should get
| from | to | route | # |
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
| b | d | eb,cde,cde | # ends in restricted way correctly |
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
Scenario: Car - Routing around a way that becomes destination only
Given the node map
"""
a---c---b
+ \
+ |
d |
\___e
"""
And the ways
| nodes | access | oneway |
| acbe | | no |
| cd | destination | no |
| de | | no |
When I route I should get
| from | to | route |
| e | a | acbe,acbe |
| d | a | de,acbe,acbe |
| c | d | cd,cd |
+55 -28
View File
@@ -6,9 +6,11 @@ Feature: Car - Handle ferry routes
Scenario: Car - Use a ferry route
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route | bicycle |
@@ -17,21 +19,44 @@ Feature: Car - Handle ferry routes
| efg | primary | | |
When I route I should get
| from | to | route | modes |
| a | g | abc,cde,efg | 1,2,1 |
| b | f | abc,cde,efg | 1,2,1 |
| e | c | cde | 2 |
| e | b | cde,abc | 2,1 |
| e | a | cde,abc | 2,1 |
| c | e | cde | 2 |
| c | f | cde,efg | 2,1 |
| c | g | cde,efg | 2,1 |
| from | to | route | modes |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving |
| e | c | cde,cde | ferry,ferry |
| e | b | cde,abc,abc | ferry,driving,driving |
| e | a | cde,abc,abc | ferry,driving,driving |
| c | e | cde,cde | ferry,ferry |
| c | f | cde,efg,efg | ferry,driving,driving |
| c | g | cde,efg,efg | ferry,driving,driving |
Scenario: Car - Use default speeds to calculate duration if no duration given
Given the node map
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route |
| abc | primary | |
| cde | | ferry |
| efg | primary | |
When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.4s |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
Scenario: Car - Properly handle simple durations
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route | duration |
@@ -40,17 +65,19 @@ Feature: Car - Handle ferry routes
| efg | primary | | |
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg | 1,2,1 | 25 km/h |
| b | f | abc,cde,efg | 1,2,1 | 20 km/h |
| c | e | cde | 2 | 12 km/h |
| e | c | cde | 2 | 12 km/h |
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
Scenario: Car - Properly handle ISO 8601 durations
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route | duration |
@@ -59,8 +86,8 @@ Feature: Car - Handle ferry routes
| efg | primary | | |
When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg | 1,2,1 | 25 km/h |
| b | f | abc,cde,efg | 1,2,1 | 20 km/h |
| c | e | cde | 2 | 12 km/h |
| e | c | cde | 2 | 12 km/h |
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
+36
View File
@@ -0,0 +1,36 @@
@routing @car @hov
Feature: Car - Handle driving
Background:
Given the profile "car"
And a grid size of 100 meters
Scenario: Car - Avoid hov when not on hov
Given the node map
"""
b=========c========================e====j
~ ~ ~
a ~ f----m
| i |
| | ----------------l
| | /
g_______________h______k_____n
"""
And the ways
| nodes | highway | hov |
| ab | motorway_link | |
| bcej | motorway | designated |
| ag | primary | |
| ghkn | primary | |
| ih | primary | |
| kl | secondary | |
| lf | secondary | |
| ci | motorway_link | |
| ef | motorway_link | |
| fm | secondary | |
When I route I should get
| from | to | route |
| a | m | ag,ghkn,kl,lf,fm,fm |
| c | m | bcej,ef,fm,fm |
+35 -25
View File
@@ -9,8 +9,10 @@ Feature: Car - Speed on links
Scenario: Car - Use motorway_link when reasonable
Given the node map
| | | e | | | | f | | |
| x | a | b | | | | c | d | y |
"""
e f
x a b c d y
"""
And the ways
| nodes | highway |
@@ -24,14 +26,16 @@ Feature: Car - Speed on links
| dy | unclassified |
When I route I should get
| from | to | route |
| x | y | xa,ae,ef,fd,dy |
| b | c | bc |
| from | to | route |
| x | y | xa,ae,ef,fd,dy,dy |
| b | c | bc,bc |
Scenario: Car - Use trunk_link when reasonable
Given the node map
| | | e | | | | f | | |
| x | a | b | | | | c | d | y |
"""
e f
x a b c d y
"""
And the ways
| nodes | highway |
@@ -44,14 +48,16 @@ Feature: Car - Speed on links
| fd | trunk |
| dy | unclassified |
When I route I should get
| from | to | route |
| x | y | xa,ae,ef,fd,dy |
| b | c | bc |
| from | to | route |
| x | y | xa,ae,ef,fd,dy,dy |
| b | c | bc,bc |
Scenario: Car - Use primary_link when reasonable
Given the node map
| | | e | | | | f | | |
| x | a | b | | | | c | d | y |
"""
e f
x a b c d y
"""
And the ways
| nodes | highway |
@@ -64,14 +70,16 @@ Feature: Car - Speed on links
| fd | primary |
| dy | unclassified |
When I route I should get
| from | to | route |
| x | y | xa,ae,ef,fd,dy |
| b | c | bc |
| from | to | route |
| x | y | xa,ae,ef,fd,dy,dy |
| b | c | bc,bc |
Scenario: Car - Use secondary_link when reasonable
Given the node map
| | | e | | | | f | | |
| x | a | b | | | | c | d | y |
"""
e f
x a b c d y
"""
And the ways
| nodes | highway |
@@ -85,14 +93,16 @@ Feature: Car - Speed on links
| dy | unclassified |
When I route I should get
| from | to | route |
| x | y | xa,ae,ef,fd,dy |
| b | c | bc |
| from | to | route |
| x | y | xa,ae,ef,fd,dy,dy |
| b | c | bc,bc |
Scenario: Car - Use tertiary_link when reasonable
Given the node map
| | | e | | | | f | | |
| x | a | b | | | | c | d | y |
"""
e f
x a b c d y
"""
And the ways
| nodes | highway |
@@ -106,6 +116,6 @@ Feature: Car - Speed on links
| dy | unclassified |
When I route I should get
| from | to | route |
| x | y | xa,ae,ef,fd,dy |
| b | c | bc |
| from | to | route |
| x | y | xa,ae,ef,fd,dy,dy |
| b | c | bc,bc |
+79 -61
View File
@@ -6,9 +6,11 @@ OSRM will use 4/5 of the projected free-flow speed.
Given the profile "car"
Given a grid size of 1000 meters
Scenario: Car - Respect maxspeeds when lower that way type speed
Scenario: Car - Respect maxspeeds when lower than way type speed
Given the node map
| a | b | c | d | e | f | g |
"""
a b c d e f g
"""
And the ways
| nodes | highway | maxspeed |
@@ -20,42 +22,48 @@ OSRM will use 4/5 of the projected free-flow speed.
| fg | trunk | CH:motorway |
When I route I should get
| from | to | route | speed |
| a | b | ab | 78 km/h |
| b | c | bc | 59 km/h +- 1 |
| c | d | cd | 51 km/h |
| d | e | de | 75 km/h |
| e | f | ef | 90 km/h |
| f | g | fg | 106 km/h |
| from | to | route | speed |
| a | b | ab,ab | 85 km/h |
| b | c | bc,bc | 48 km/h |
| c | d | cd,cd | 40 km/h |
| d | e | de,de | 64 km/h |
| e | f | ef,ef | 80 km/h |
| f | g | fg,fg | 96 km/h |
Scenario: Car - Do not ignore maxspeed when higher than way speed
Given the node map
| a | b | c | d |
"""
a b c d
"""
And the ways
| nodes | highway | maxspeed |
| ab | residential | |
| bc | residential | 90 |
| cd | living_street | FR:urban |
| nodes | highway | maxspeed | # |
| ab | residential | | default residential speed is 25 |
| bc | residential | 90 | |
| cd | living_street | FR:urban | |
When I route I should get
| from | to | route | speed |
| a | b | ab | 31 km/h |
| b | c | bc | 83 km/h +- 1 |
| c | d | cd | 51 km/h |
| from | to | route | speed |
| a | b | ab,ab | 25 km/h |
# default residential speed is 25, don't mess with this
| b | c | bc,bc | 72 km/h |
# parsed maxspeeds are scaled by profile's speed_reduction value
| c | d | cd,cd | 40 km/h |
# symbolic posted speeds without explicit exceptions are parsed
# from the profile's maxspeed_table_default table
Scenario: Car - Forward/backward maxspeed
Scenario: Car - Forward/backward maxspeed are scaled by profile's speed_reduction if explicitly set
Given a grid size of 100 meters
Then routability should be
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | 65 km/h | 65 km/h |
| primary | 60 | | | 60 km/h | 60 km/h |
| primary | | 60 | | 60 km/h | 65 km/h |
| primary | | | 60 | 65 km/h | 60 km/h |
| primary | 15 | 60 | | 60 km/h | 23 km/h |
| primary | 15 | | 60 | 23 km/h | 60 km/h |
| primary | 15 | 30 | 60 | 34 km/h | 60 km/h |
| primary | 60 | | | 48 km/h | 48 km/h |
| primary | | 60 | | 48 km/h | 65 km/h |
| primary | | | 60 | 65 km/h | 48 km/h |
| primary | 15 | 60 | | 48 km/h | 12 km/h |
| primary | 15 | | 60 | 12 km/h | 48 km/h |
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
Scenario: Car - Maxspeed should not allow routing on unroutable ways
Then routability should be
@@ -77,45 +85,55 @@ OSRM will use 4/5 of the projected free-flow speed.
Scenario: Car - Too narrow streets should be ignored or incur a penalty
Then routability should be
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | | 63 km/h | 63 km/h |
| primary | | 3 | | | 32 km/h | 32 km/h |
| primary | 60 | | | | 59 km/h | 59 km/h |
| primary | 60 | 3 | | | 30 km/h | 30 km/h |
| primary | | | 60 | | 59 km/h | 63 km/h |
| primary | | 3 | 60 | | 30 km/h | 32 km/h |
| primary | | | | 60 | 63 km/h | 59 km/h |
| primary | | 3 | | 60 | 32 km/h | 30 km/h |
| primary | 15 | | 60 | | 59 km/h | 23 km/h |
| primary | 15 | 3 | 60 | | 30 km/h | 7 km/h |
| primary | 15 | | | 60 | 23 km/h | 59 km/h |
| primary | 15 | 3 | | 60 | 7 km/h | 30 km/h |
| primary | 15 | | 30 | 60 | 34 km/h | 59 km/h |
| primary | 15 | 3 | 30 | 60 | 15 km/h | 30 km/h |
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 |
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
Scenario: Car - Single lane streets be ignored or incur a penalty
Then routability should be
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw |
| primary | | | | | 63 km/h | 63 km/h |
| primary | | 1 | | | 32 km/h | 32 km/h |
| primary | 60 | | | | 59 km/h | 59 km/h |
| primary | 60 | 1 | | | 30 km/h | 30 km/h |
| primary | | | 60 | | 59 km/h | 63 km/h |
| primary | | 1 | 60 | | 30 km/h | 32 km/h |
| primary | | | | 60 | 63 km/h | 59 km/h |
| primary | | 1 | | 60 | 32 km/h | 30 km/h |
| primary | 15 | | 60 | | 59 km/h | 23 km/h |
| primary | 15 | 1 | 60 | | 30 km/h | 7 km/h |
| primary | 15 | | | 60 | 23 km/h | 59 km/h |
| primary | 15 | 1 | | 60 | 7 km/h | 30 km/h |
| primary | 15 | | 30 | 60 | 34 km/h | 59 km/h |
| primary | 15 | 1 | 30 | 60 | 15 km/h | 30 km/h |
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 |
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
Scenario: Car - Single lane streets only incure a penalty for two-way streets
Scenario: Car - Single lane streets only incur a penalty for two-way streets
Then routability should be
| highway | maxspeed | lanes | oneway | forw | backw |
| primary | 30 | 1 | yes | 34 km/h | |
| primary | 30 | 1 | -1 | | 34 km/h |
| primary | 30 | 1 | | 15 km/h | 15 km/h |
| primary | 30 | 2 | | 34 km/h | 34 km/h |
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
| primary | 30 | 1 | yes | 23 km/h | | 7 | |
| primary | 30 | 1 | -1 | | 23 km/h | | 7 |
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 |
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 |
Scenario: Car - Forward/backward maxspeed on reverse oneways
Then routability should be
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
| primary | | | | -1 | | 64 km/h | | 18 |
| primary | 30 | | | -1 | | 23 km/h | | 7 |
| primary | | 30 | | -1 | | 64 km/h | | 18 |
| primary | | | 30 | -1 | | 23 km/h | | 7 |
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
+16 -12
View File
@@ -5,8 +5,10 @@ Feature: Car - Mode flag
Scenario: Car - Mode when using a ferry
Given the node map
| a | b | |
| | c | d |
"""
a b
c d
"""
And the ways
| nodes | highway | route | duration |
@@ -15,17 +17,19 @@ Feature: Car - Mode flag
| cd | primary | | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
| from | to | route | modes |
| a | d | ab,bc,cd,cd | driving,ferry,driving,driving |
| d | a | cd,bc,ab,ab | driving,ferry,driving,driving |
| c | a | bc,ab,ab | ferry,driving,driving |
| d | b | cd,bc,bc | driving,ferry,ferry |
| a | c | ab,bc,bc | driving,ferry,ferry |
| b | d | bc,cd,cd | ferry,driving,driving |
Scenario: Car - Snapping when using a ferry
Given the node map
| a | b | | c | d | | e | f |
"""
a b c d e f
"""
And the ways
| nodes | highway | route | duration |
@@ -34,7 +38,7 @@ Feature: Car - Mode flag
| ef | primary | | |
When I route I should get
| from | to | route | turns | modes | time |
| c | d | bcde | head,destination | 2 | 600s |
| from | to | route | modes | time |
| c | d | bcde,bcde | ferry,ferry | 600s |
+80 -7
View File
@@ -3,11 +3,14 @@ Feature: Car - Street names in instructions
Background:
Given the profile "car"
Given a grid size of 5 meters
Scenario: Car - A named street
Given the node map
| a | b |
| | c |
"""
a b
c
"""
And the ways
| nodes | name | ref |
@@ -15,13 +18,53 @@ Feature: Car - Street names in instructions
| bc | Your Way | A1 |
When I route I should get
| from | to | route |
| a | c | My Way,Your Way (A1) |
| from | to | route | ref |
| a | c | My Way,Your Way,Your Way | ,A1,A1|
Scenario: Car - A named street with pronunciation
Given the node map
"""
a b d
1
c
"""
And the ways
| nodes | name |name:pronunciation | ref |
| ab | My Way | | |
| bd | My Way | meyeway | A1 |
| cd | Your Way | yourewaye | |
When I route I should get
| from | to | route | pronunciations | ref |
| a | d | My Way,My Way,My Way | ,meyeway,meyeway | ,A1,A1 |
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
# See #2860
Scenario: Car - same street name but different pronunciation
Given the node map
"""
a b c
d
e
"""
And the ways
| nodes | name | name:pronunciation |
| abc | Houston St | hew-stun |
| bde | Houston St | how-stun |
When I route I should get
| from | to | route | pronunciations |
| a | c | Houston St,Houston St | hew-stun,hew-stun |
| a | e | Houston St,Houston St,Houston St | hew-stun,how-stun,how-stun |
@todo
Scenario: Car - Use way type to describe unnamed ways
Given the node map
| a | b | c | d |
"""
a b c d
"""
And the ways
| nodes | highway | name |
@@ -29,5 +72,35 @@ Feature: Car - Street names in instructions
| bcd | residential | |
When I route I should get
| from | to | route |
| a | c | tertiary,residential |
| from | to | route |
| a | c | tertiary,residential,residential |
Scenario: Inner city expressway with on road
Given the node map
"""
a b . . . c g
`f .
`
.
.
d
.
.
.
e
"""
And the ways
| nodes | highway | name | name:pronunciation | oneway |
| abc | primary | road | roooaad | |
| cg | primary | road | roooaad | |
| bfd | trunk_link | sliproad | | yes |
| cde | trunk | trunk | truank | yes |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | abc | cde | c | no_right_turn |
When I route I should get
| waypoints | route | turns | pronunciations |
| a,e | road,trunk,trunk | depart,turn right,arrive | roooaad,truank,truank |
+51 -18
View File
@@ -15,26 +15,46 @@ Feature: Car - Oneway streets
| highway | oneway | forw | backw |
| primary | -1 | | x |
Scenario: Car - Mode specific oneway
Then routability should be
| highway | oneway:motorcar | oneway:motor_vehicle | oneway:vehicle | oneway | forw | backw |
| primary | | | | | x | x |
| primary | yes | | | | x | |
| primary | | yes | | | x | |
| primary | | | yes | | x | |
| primary | | | | yes | x | |
| primary | yes | no | | | x | |
| primary | | yes | no | | x | |
| primary | | | yes | no | x | |
| primary | | | | yes | x | |
| primary | no | yes | | | x | x |
| primary | | no | yes | | x | x |
| primary | | | no | yes | x | x |
Scenario: Car - Implied oneways
Then routability should be
| highway | junction | forw | backw |
| motorway | | x | |
| motorway_link | | x | |
| primary | | x | x |
| motorway | roundabout | x | |
| motorway_link | roundabout | x | |
| primary | roundabout | x | |
| highway | junction | forw | backw | # |
| motorway | | x | | |
| motorway_link | | x | x | does not imply oneway |
| primary | | x | x | |
| motorway | roundabout | x | | |
| motorway_link | roundabout | x | | |
| primary | roundabout | x | | |
Scenario: Car - Overrule implied oneway
Then routability should be
| highway | oneway | forw | backw |
| motorway | no | x | x |
| motorway_link | no | x | x |
| highway | oneway | forw | backw | # |
| motorway | no | x | x | |
| motorway_link | no | x | x | |
| motorway_link | yes | x | | |
| motorway_link | | x | x | does not imply onway |
Scenario: Car - Around the Block
Given the node map
| a | b |
| d | c |
"""
a b
f d c e
"""
And the ways
| nodes | oneway |
@@ -42,11 +62,13 @@ Feature: Car - Oneway streets
| bc | |
| cd | |
| da | |
| ce | |
| df | |
When I route I should get
| from | to | route |
| a | b | ab |
| b | a | bc,cd,da |
| from | to | route |
| a | b | ab,ab |
| b | a | bc,cd,da,da |
Scenario: Car - Cars should not be affected by bicycle tags
Then routability should be
@@ -66,7 +88,9 @@ Feature: Car - Oneway streets
Scenario: Car - Two consecutive oneways
Given the node map
| a | b | c |
"""
a b c
"""
And the ways
| nodes | oneway |
@@ -75,5 +99,14 @@ Feature: Car - Oneway streets
When I route I should get
| from | to | route |
| a | c | ab,bc |
| from | to | route |
| a | c | ab,bc,bc |
# Reversible oneways (low frequency) vs alternating oneways (high frequency).
# See: https://github.com/Project-OSRM/osrm-backend/issues/2837
Scenario: Car - Route over alternating but not reversible oneways
Then routability should be
| highway | oneway | forw | backw |
| primary | reversible | | |
| primary | alternating | x | x |
+194 -117
View File
@@ -5,13 +5,16 @@ Feature: Car - Turn restrictions
Background: Use car routing
Given the profile "car"
Given a grid size of 200 meters
@no_turning
Scenario: Car - No left turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -25,17 +28,19 @@ Feature: Car - Turn restrictions
| restriction | sj | wj | j | no_left_turn |
When I route I should get
| from | to | route |
| s | w | |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Car - No straight on
Given the node map
| a | b | j | d | e |
| v | | | | z |
| | w | x | y | |
"""
a b j d e
v z
w x y
"""
And the ways
| nodes | oneway |
@@ -55,15 +60,17 @@ Feature: Car - Turn restrictions
| restriction | bj | jd | j | no_straight_on |
When I route I should get
| from | to | route |
| a | e | av,vw,wx,xy,yz,ze |
| from | to | route |
| a | e | av,vw,wx,xy,yz,ze,ze |
@no_turning
Scenario: Car - No right turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -77,17 +84,19 @@ Feature: Car - Turn restrictions
| restriction | sj | ej | j | no_right_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | |
@no_turning
Scenario: Car - No u-turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -101,17 +110,19 @@ Feature: Car - Turn restrictions
| restriction | sj | wj | j | no_u_turn |
When I route I should get
| from | to | route |
| s | w | |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Car - Handle any no_* relation
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -125,17 +136,19 @@ Feature: Car - Turn restrictions
| restriction | sj | wj | j | no_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Car - Only left turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -148,18 +161,38 @@ Feature: Car - Turn restrictions
| type | way:from | way:to | node:via | restriction |
| restriction | sj | wj | j | only_left_turn |
Scenario: Car - Only right turn, invalid
Given the node map
"""
n
w j e r
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
| re | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | er | j | only_right_on |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | |
| s | e | |
| from | to | route |
| s | r | sj,ej,re,re |
@only_turning
Scenario: Car - Only right turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -173,17 +206,19 @@ Feature: Car - Turn restrictions
| restriction | sj | ej | j | only_right_turn |
When I route I should get
| from | to | route |
| s | w | |
| s | n | |
| s | e | sj,ej |
| from | to | route |
| s | w | |
| s | n | |
| s | e | sj,ej,ej |
@only_turning
Scenario: Car - Only straight on
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -197,17 +232,19 @@ Feature: Car - Turn restrictions
| restriction | sj | nj | j | only_straight_on |
When I route I should get
| from | to | route |
| s | w | |
| s | n | sj,nj |
| s | e | |
| from | to | route |
| s | w | |
| s | n | sj,nj,nj |
| s | e | |
@no_turning
Scenario: Car - Handle any only_* restriction
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -221,17 +258,19 @@ Feature: Car - Turn restrictions
| restriction | sj | nj | j | only_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | |
| s | n | sj,nj |
| s | e | |
| from | to | route |
| s | w | |
| s | n | sj,nj,nj |
| s | e | |
@specific
Scenario: Car - :hgv-qualified on a standard turn restriction
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -245,17 +284,19 @@ Feature: Car - Turn restrictions
| restriction | sj | nj | j | no_straight_on |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@specific
Scenario: Car - :motorcar-qualified on a standard turn restriction
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -269,17 +310,19 @@ Feature: Car - Turn restrictions
| restriction | sj | nj | j | no_straight_on |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | |
| s | e | sj,ej,ej |
@except
Scenario: Car - Except tag and on no_ restrictions
Given the node map
| b | x | c |
| a | j | d |
| | s | |
"""
b x c
a j d
s
"""
And the ways
| nodes | oneway |
@@ -298,18 +341,20 @@ Feature: Car - Turn restrictions
| restriction | sj | dj | j | no_right_turn | motorcar |
When I route I should get
| from | to | route |
| s | a | sj,aj |
| s | b | |
| s | c | |
| s | d | sj,dj |
| from | to | route |
| s | a | sj,aj,aj |
| s | b | |
| s | c | |
| s | d | sj,dj,dj |
@except
Scenario: Car - Except tag and on only_ restrictions
Given the node map
| a | | b |
| | j | |
| | s | |
"""
a b
j
s
"""
And the ways
| nodes | oneway |
@@ -322,17 +367,19 @@ Feature: Car - Turn restrictions
| restriction | sj | aj | j | only_straight_on | motorcar |
When I route I should get
| from | to | route |
| s | a | sj,aj |
| s | b | sj,bj |
| from | to | route |
| s | a | sj,aj,aj |
| s | b | sj,bj,bj |
@except
Scenario: Car - Several only_ restrictions at the same segment
Given the node map
| | | | | y | | | | |
| i | j | f | b | x | a | e | g | h |
| | | | | | | | | |
| | | | c | | d | | | |
"""
y
i j f b x a e g h
c d
"""
And the ways
| nodes | oneway |
@@ -356,21 +403,23 @@ Feature: Car - Turn restrictions
| restriction | da | ae | a | only_right_turn |
When I route I should get
| from | to | route |
| e | f | ae,xa,bx,fb |
| c | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb |
| d | f | da,ae,ge,hg,hg,ge,ae,xa,bx,fb |
| from | to | route |
| e | f | ae,xa,bx,fb,fb |
| c | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
| d | f | da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
@except
Scenario: Car - two only_ restrictions share same to-way
Given the node map
| | | e | | | | f | | |
| | | | | a | | | | |
| | | | | | | | | |
| | | c | | x | | d | | |
| | | | | y | | | | |
| | | | | | | | | |
| | | | | b | | | | |
"""
e f
a
c x d
y
b
"""
And the ways
| nodes | oneway |
@@ -391,20 +440,22 @@ Feature: Car - Turn restrictions
| restriction | by | xy | y | only_straight_on |
When I route I should get
| from | to | route |
| a | b | ax,xy,yb |
| b | a | yb,xy,ax |
| from | to | route |
| a | b | ax,xy,yb,yb |
| b | a | yb,xy,ax,ax |
@except
Scenario: Car - two only_ restrictions share same from-way
Given the node map
| | | e | | | | f | | |
| | | | | a | | | | |
| | | | | | | | | |
| | | c | | x | | d | | |
| | | | | y | | | | |
| | | | | | | | | |
| | | | | b | | | | |
"""
e f
a
c x d
y
b
"""
And the ways
| nodes | oneway |
@@ -425,7 +476,33 @@ Feature: Car - Turn restrictions
| restriction | xy | yb | y | only_straight_on |
When I route I should get
| from | to | route |
| a | b | ax,xy,yb |
| b | a | yb,xy,ax |
| from | to | route |
| a | b | ax,xy,yb,yb |
| b | a | yb,xy,ax,ax |
@specific
Scenario: Car - Ignore unrecognized restriction
Given the node map
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
| sj | yes |
| nj | -1 |
| wj | -1 |
| ej | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | sj | wj | j | yield |
When I route I should get
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
-30
View File
@@ -1,30 +0,0 @@
@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 | head,enter_roundabout-1,destination |
| s | u | sa,uc | head,enter_roundabout-2,destination |
| s | v | sa,vd | head,enter_roundabout-3,destination |
| u | v | uc,vd | head,enter_roundabout-1,destination |
| u | s | uc,sa | head,enter_roundabout-2,destination |
| u | t | uc,tb | head,enter_roundabout-3,destination |
+14
View File
@@ -0,0 +1,14 @@
@routing @car @surface
Feature: Car - Surfaces
Background:
Given the profile "car"
Scenario: Car - Ways tagged service should reduce speed
Then routability should be
| highway | service | forw | backw | forw_rate |
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | emergency_access | | | |
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
+15 -13
View File
@@ -6,9 +6,11 @@ Feature: Car - Handle ferryshuttle train routes
Scenario: Car - Use a ferry route
Given the node map
| a | b | c | | | |
| | | d | | | |
| | | e | f | g | h |
"""
a b c
d
e f g h
"""
And the ways
| nodes | highway | route | bicycle |
@@ -19,13 +21,13 @@ Feature: Car - Handle ferryshuttle train routes
| gh | primary | | no |
When I route I should get
| from | to | route |
| a | f | abc,cde,ef |
| b | f | abc,cde,ef |
| e | c | cde |
| e | b | cde,abc |
| e | a | cde,abc |
| c | e | cde |
| c | f | cde,ef |
| f | g | |
| g | h | gh |
| from | to | route |
| a | f | abc,cde,ef,ef |
| b | f | abc,cde,ef,ef |
| e | c | cde,cde |
| e | b | cde,abc,abc |
| e | a | cde,abc,abc |
| c | e | cde,cde |
| c | f | cde,ef,ef |
| f | g | |
| g | h | gh,gh |
+80
View File
@@ -0,0 +1,80 @@
@routing @testbot @sidebias
Feature: Testbot - side bias
Background:
Given the profile file
"""
require 'testbot'
properties.left_hand_driving = true
"""
Scenario: Left hand bias
Given the profile file "car" extended with
"""
properties.left_hand_driving = true
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
"""
Given the node map
"""
a b c
d
"""
And the ways
| nodes |
| ab |
| bc |
| bd |
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 24s +-1 |
| d | c | bd,bc,bc | 27s +-1 |
Scenario: Right hand bias
Given the profile file "car" extended with
"""
properties.left_hand_driving = false
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
"""
And the node map
"""
a b c
d
"""
And the ways
| nodes |
| ab |
| bc |
| bd |
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 27s +-1 |
# should be inverse of left hand bias
| d | c | bd,bc,bc | 24s +-1 |
Scenario: Roundabout exit counting for left sided driving
And a grid size of 10 meters
And the node map
"""
a
b
h g c d
e
f
"""
And the ways
| nodes | junction |
| ab | |
| cd | |
| ef | |
| gh | |
| bcegb | roundabout |
When I route I should get
| waypoints | route | turns |
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
+44 -15
View File
@@ -5,20 +5,49 @@ Feature: Car - speeds
Given the profile "car"
And a grid size of 1000 meters
# should more or less match default speeds in car profile, but may be different due to rounding errors
Scenario: Car - speed of various way types
Then routability should be
| highway | oneway | bothw |
| motorway | no | 82 km/h |
| motorway_link | no | 47 km/h |
| trunk | no | 79 km/h +- 1 |
| trunk_link | no | 43 km/h +- 1 |
| primary | no | 63 km/h +- 1 |
| primary_link | no | 34 km/h |
| secondary | no | 54 km/h +- 1 |
| secondary_link | no | 31 km/h |
| tertiary | no | 43 km/h |
| tertiary_link | no | 26 km/h |
| unclassified | no | 31 km/h |
| residential | no | 31 km/h |
| living_street | no | 18 km/h |
| service | no | 23 km/h |
| highway | oneway | bothw |
| motorway | no | 89 km/h |
| motorway_link | no | 44 km/h |
| trunk | no | 85 km/h |
| trunk_link | no | 39 km/h |
| primary | no | 64 km/h |
| primary_link | no | 29 km/h |
| secondary | no | 55 km/h |
| secondary_link | no | 24 km/h |
| tertiary | no | 39 km/h |
| tertiary_link | no | 20 km/h |
| unclassified | no | 24 km/h |
| residential | no | 24 km/h |
| living_street | no | 9 km/h |
| service | no | 15 km/h |
# Alternating oneways scale rates but not speeds
Scenario: Car - scaled speeds for oneway=alternating
Then routability should be
| highway | oneway | junction | forw | backw | # |
| tertiary | | | 39 km/h | 39 km/h | |
| tertiary | alternating | | 39 km/h | 39 km/h | |
| motorway | | | 89 km/h | | implied oneway |
| motorway | alternating | | 89 km/h | | implied oneway |
| motorway | reversible | | | | unroutable |
| primary | | roundabout | 64 km/h | | implied oneway |
| primary | alternating | roundabout | 64 km/h | | implied oneway |
| primary | reversible | roundabout | | | unroutable |
Scenario: Car - Check roundoff errors
Then routability should be
| highway | maxspeed | forw | backw |
| primary | | 64 km/h | 64 km/h |
| primary | 60 | 47 km/h | 47 km/h |
| primary | 60 | 47 km/h | 47 km/h |
| primary | 60 | 47 km/h | 47 km/h |
Scenario: Car - Side road penalties
Then routability should be
| highway | side_road | forw | backw | forw_rate | backw_rate |
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
+109
View File
@@ -0,0 +1,109 @@
@routing @basic @car
Feature: Basic Routing
Background:
Given the profile "car"
Given a grid size of 500 meters
@smallest
Scenario: Summaries when routing on a simple network
Given the node map
"""
b f
c d g
a e
"""
And the ways
| nodes | name |
| acb | road |
| de | 1 st |
| cd | |
| dg | blvd |
| df | street |
When I route I should get
| waypoints | route | summary |
| a,e | road,,1 st,1 st | road, 1 st |
# The via node `d` belongs to `cd`, `de`, `df`, `dg` and depending on the edge
# summary can be "road;street", "road, 1 st;1 st, street", "road, blvd;blvd, street"
# The test must be fixed by #2287
#| a,d,f | road,,,street,street | road;street |
| a,e,f | road,,1 st,1 st,1 st,street,street | road, 1 st;1 st, street |
Scenario: Name Empty
Given the node map
"""
a b c
"""
And the ways
| nodes | name |
| ab | road |
| bc | |
When I route I should get
| waypoints | route | summary |
| a,c | road, | road |
Scenario: Name Empty But Ref
Given the node map
"""
a b c
"""
And the ways
| nodes | name | ref |
| ab | road | |
| bc | | 101 |
When I route I should get
| waypoints | route | summary |
| a,c | road, | road, 101 |
Scenario: Only Refs
Given the node map
"""
a b c
"""
And the ways
| nodes | name | ref |
| ab | | 100 |
| bc | | 101 |
When I route I should get
| waypoints | route | summary |
| a,c | , | 100, 101 |
Scenario: Single Ref
Given the node map
"""
a b c
"""
And the ways
| nodes | name | ref |
| ab | | |
| bc | | 101 |
When I route I should get
| waypoints | route | summary |
| a,c | ,, | 101 |
Scenario: Nothing
Given the node map
"""
a b c
"""
And the ways
| nodes | name |
| ab | |
| bc | |
When I route I should get
| waypoints | route | summary |
| a,c | , | |
+49 -49
View File
@@ -4,7 +4,7 @@ Feature: Car - Surfaces
Background:
Given the profile "car"
Scenario: Car - Routeability of tracktype tags
Scenario: Car - Routability of tracktype tags
Then routability should be
| highway | tracktype | bothw |
| trunk | grade1 | x |
@@ -26,8 +26,8 @@ Feature: Car - Surfaces
| trunk | very_horrible | x |
| trunk | impassable | |
| trunk | nonsense | x |
Scenario: Car - Routabiliy of surface tags
Scenario: Car - Routability of surface tags
Then routability should be
| highway | surface | bothw |
| trunk | asphalt | x |
@@ -40,13 +40,13 @@ Feature: Car - Surfaces
| highway | access | tracktype | smoothness | surface | forw | backw |
| motorway | | | | | x | |
| motorway | no | grade1 | excellent | asphalt | | |
| motorway | private | grade1 | excellent | asphalt | | |
| motorway | private | grade1 | excellent | asphalt | x | |
| motorway | agricultural | grade1 | excellent | asphalt | | |
| motorway | forestry | grade1 | excellent | asphalt | | |
| motorway | emergency | grade1 | excellent | asphalt | | |
| primary | | | | | x | x |
| primary | private | grade1 | excellent | asphalt | x | x |
| primary | no | grade1 | excellent | asphalt | | |
| primary | private | grade1 | excellent | asphalt | | |
| primary | agricultural | grade1 | excellent | asphalt | | |
| primary | forestry | grade1 | excellent | asphalt | | |
| primary | emergency | grade1 | excellent | asphalt | | |
@@ -64,64 +64,65 @@ Feature: Car - Surfaces
Scenario: Car - Surface should reduce speed
Then routability should be
| highway | oneway | surface | forw | backw |
| motorway | no | | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | asphalt | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | concrete | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | concrete:plates | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | concrete:lanes | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | paved | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | cement | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | compacted | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | fine_gravel | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | | 90 km/h | 90 km/h |
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 |
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | paved | 90 km/h +-1 | 90 km/h +-1 |
| motorway | no | cement | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | compacted | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | fine_gravel | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | grass | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | wood | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | sett | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | grass_paver | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | gravel | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | unpaved | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | ground | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | dirt | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | pebblestone | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | tartan | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | cobblestone | 34 km/h +-1 | 34 km/h +-1 |
| motorway | no | clay | 34 km/h +-1 | 34 km/h +-1 |
| motorway | no | earth | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | stone | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | rocky | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | sand | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | grass | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | wood | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | sett | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | grass_paver | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | gravel | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | unpaved | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | ground | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | dirt | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | pebblestone | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | tartan | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | cobblestone | 30 km/h +-1 | 30 km/h +-1 |
| motorway | no | clay | 30 km/h +-1 | 30 km/h +-1 |
| motorway | no | earth | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | stone | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
Scenario: Car - Tracktypes should reduce speed
Then routability should be
| highway | oneway | tracktype | forw | backw |
| motorway | no | | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | | 90 km/h | 90 km/h |
| motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 |
| motorway | no | grade2 | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | grade3 | 34 km/h +-1 | 34 km/h +-1 |
| motorway | no | grade4 | 31 km/h +-1 | 31 km/h +-1 |
| motorway | no | grade5 | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | grade2 | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | grade3 | 30 km/h +-1 | 30 km/h +-1 |
| motorway | no | grade4 | 25 km/h +-1 | 25 km/h +-1 |
| motorway | no | grade5 | 20 km/h +-1 | 20 km/h +-1 |
Scenario: Car - Smoothness should reduce speed
Then routability should be
| highway | oneway | smoothness | forw | backw |
| motorway | no | | 80 km/h +-1 | 80 km/h +-1 |
| motorway | no | intermediate | 72 km/h +-1 | 72 km/h +-1 |
| motorway | no | bad | 42 km/h +-1 | 42 km/h +-1 |
| motorway | no | very_bad | 26 km/h +-1 | 26 km/h +-1 |
| motorway | no | horrible | 18 km/h +-1 | 18 km/h +-1 |
| motorway | no | very_horrible | 15 km/h +-1 | 15 km/h +-1 |
| motorway | no | | 90 km/h | 90 km/h |
| motorway | no | intermediate | 80 km/h | 80 km/h |
| motorway | no | bad | 40 km/h +-1 | 40 km/h +-1 |
| motorway | no | very_bad | 20 km/h +-1 | 20 km/h +-1 |
| motorway | no | horrible | 10 km/h +-1 | 10 km/h +-1 |
| motorway | no | very_horrible | 5 km/h +-1 | 5 km/h +-1 |
Scenario: Car - Combination of surface tags should use lowest speed
Then routability should be
| highway | oneway | tracktype | surface | smoothness | backw | forw |
| motorway | no | | | | 80 km/h | 80 km/h |
| service | no | grade1 | asphalt | excellent | 23 km/h | 23 km/h |
| motorway | no | grade5 | asphalt | excellent | 26 km/h | 26 km/h |
| motorway | no | grade1 | mud | excellent | 18 km/h | 18 km/h |
| motorway | no | grade1 | asphalt | very_horrible | 15 km/h | 15 km/h |
| service | no | grade5 | mud | very_horrible | 15 km/h | 15 km/h |
| highway | oneway | tracktype | surface | smoothness | bothw |
| motorway | no | | | | 90 km/h |
| service | no | grade1 | asphalt | excellent | 15 km/h |
| motorway | no | grade5 | asphalt | excellent | 20 km/h |
| motorway | no | grade1 | mud | excellent | 10 km/h |
| motorway | no | grade1 | asphalt | very_horrible | 5 km/h |
| service | no | grade5 | mud | very_horrible | 5 km/h |
Scenario: Car - Surfaces should not affect oneway direction
Then routability should be
@@ -138,4 +139,3 @@ Feature: Car - Surfaces
| primary | -1 | grade1 | excellent | asphalt | | x |
| primary | -1 | grade5 | very_bad | mud | | x |
| primary | -1 | nonsense | nonsense | nonsense | | x |
-47
View File
@@ -1,47 +0,0 @@
@routing @speed @traffic
Feature: Traffic - speeds
Background: Use specific speeds
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | .05 | 0.1 |
| c | 0.0 | 0.1 |
| d | .05 | .03 |
| e | .05 | .066 |
| f | .075 | .066 |
| g | .075 | 0.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
And the speed file
"""
1,2,27
2,1,27
2,3,27
3,2,27
1,4,27
4,1,27
"""
Scenario: Weighting not based on raster sources
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the contract extra arguments "--segment-speed-file speeds.csv"
And I route I should get
| from | to | route | speed |
| a | b | ab | 27 km/h |
| a | c | ab,bc | 27 km/h |
| b | c | bc | 27 km/h |
| a | d | ad | 27 km/h |
| d | c | dc | 36 km/h |
| g | b | ab | 27 km/h |
| a | g | ab | 27 km/h |
+125
View File
@@ -0,0 +1,125 @@
@routing @speed @traffic
Feature: Traffic - turn penalties
Background: Evenly spaced grid with multiple intersections
Given the node map
"""
a b
c d e f g
h i
j k l m n
o p
"""
And the nodes
| node | id |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
| e | 5 |
| f | 6 |
| g | 7 |
| h | 8 |
| i | 9 |
| j | 10 |
| k | 11 |
| l | 12 |
| m | 13 |
| n | 14 |
| o | 15 |
| p | 16 |
And the ways
| nodes | highway |
| ad | primary |
| cd | primary |
| def | primary |
| dhk | primary |
| bf | primary |
| fg | primary |
| fim | primary |
| jk | primary |
| klm | primary |
| ko | primary |
| mn | primary |
| mp | primary |
And the profile "car"
And the extract extra arguments "--generate-edge-lookup"
Scenario: Weighting not based on turn penalty file
When I route I should get
| from | to | route | speed | weight | time |
| a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 |
# straight
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
# right
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
# left
| c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
# straight-right
| a | l | ad,dhk,klm,klm | 53 km/h | 27s +-1 | 27s +-1 |
# straight-left
| l | e | klm,dhk,def,def | 55 km/h | 26s +-1 | 26s +-1 |
# double right
| g | n | fg,fim,mn,mn | 44 km/h | 32s +-1 | 32s +-1 |
# double left
Scenario: Weighting based on turn penalty file
Given the turn penalty file
"""
9,6,7,1.8
9,13,14,24.5
8,4,3,35
12,11,8,9
8,11,12,23
1,4,5,-0.2
"""
# ifg right turn
# imn left turn
# hdc left turn
# lkh right turn
# hkl left turn
# ade left turn
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get
| from | to | route | speed | weight | time |
| a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 |
# straight
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
# right - ifg penalty
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
# left - faster because of negative ade penalty
| c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
# straight-right - ifg penalty
| a | l | ad,def,fim,klm,klm | 58 km/h | 37 | 37s +-1 |
# was straight-left - forced around by hkl penalty
| l | e | klm,fim,def,def | 44 km/h | 32.6 | 32s +-1 |
# double right - forced left by lkh penalty
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
# double left - imn penalty
| j | c | jk,klm,fim,def,cd,cd | 53 km/h | 54.6 | 54s +-1 |
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
Scenario: Too-negative penalty clamps, but does not fail
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
And the profile "testbot"
And the turn penalty file
"""
1,4,5,-10
"""
When I route I should get
| from | to | route | time |
# The target point `d` can be in `ad`, `cd`, `deh` and `dhk`
# The test must be fixed by #2287
#| a | d | ad,ad | 10s +-1 |
| a | e | ad,def,def | 10s +-1 |
| b | f | bf,bf | 10s +-1 |
| b | g | bf,fg,fg | 20s +-1 |
+63
View File
@@ -0,0 +1,63 @@
@routing @car @weight
Feature: Car - weights
Background: Use specific speeds
Given the profile "car"
Scenario: Only routes down service road when that's the destination
Given the node map
"""
a--b--c
|
d
|
e--f--g
"""
And the ways
| nodes | highway |
| abc | residential |
| efg | residential |
| cg | tertiary |
| bdf | service |
When I route I should get
| from | to | route | speed | weight |
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
Scenario: Does not jump off the highway to go down service road
Given the node map
"""
a
|
b
|\
| e
|/
c
|
d
"""
And the nodes
| node | id |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
| e | 5 |
And the ways
| nodes | highway | oneway |
| ab | primary | yes |
| bc | primary | yes |
| cd | primary | yes |
| be | service | yes |
| ec | service | yes |
And the extract extra arguments "--generate-edge-lookup"
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the speed file
"""
2,5,8
"""
When I route I should get
| from | to | route | speed | weight |
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
| a | e | ab,be,be | 14 km/h | 112 |
+25 -1
View File
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on ways
Background:
Given the profile "foot"
Scenario: Foot - Access tag hierachy on ways
Scenario: Foot - Access tag hierarchy on ways
Then routability should be
| highway | access | foot | bothw |
| footway | | | x |
@@ -52,6 +52,7 @@ Feature: Foot - Access tags on ways
| private | | |
| agricultural | | |
| forestry | | |
| delivery | | |
| | yes | x |
| | permissive | x |
| | designated | x |
@@ -60,6 +61,7 @@ Feature: Foot - Access tags on ways
| | private | |
| | agricultural | |
| | forestry | |
| | delivery | |
Scenario: Foot - Access tags on both node and way
Then routability should be
@@ -93,3 +95,25 @@ Feature: Foot - Access tags on ways
| footway | | no | | x |
| motorway | | | yes | |
| footway | | | no | x |
Scenario: Foot - Bridleways when access is explicit
Then routability should be
| highway | horse | bicycle | foot | bothw |
| bridleway | | | yes | x |
| bridleway | | yes | | |
| bridleway | designated | | | |
| bridleway | | | | |
Scenario: Foot - a way with missing :forward tag
Then routability should be
| highway | bicycle:backward | foot:backward | forw | backw |
| cycleway | designated | designated | | x |
Scenario: Foot - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | x |
| steps | permissive | x |
| footway | permissive | x |
| garbagetag | permissive | x |
+3 -1
View File
@@ -5,7 +5,7 @@ Feature: Foot - Access tags on nodes
Background:
Given the profile "foot"
Scenario: Foot - Access tag hierachy on nodes
Scenario: Foot - Access tag hierarchy on nodes
Then routability should be
| node/access | node/foot | bothw |
| | | x |
@@ -40,6 +40,7 @@ Feature: Foot - Access tags on nodes
| private | | |
| agricultural | | |
| forestry | | |
| delivery | | |
| no | yes | x |
| no | permissive | x |
| no | designated | x |
@@ -48,3 +49,4 @@ Feature: Foot - Access tags on nodes
| yes | private | |
| yes | agricultural | |
| yes | forestry | |
| yes | delivery | |
+58 -50
View File
@@ -7,9 +7,11 @@ Feature: Foot - Squares and other areas
@square
Scenario: Foot - Route along edge of a squares
Given the node map
| x | |
| a | b |
| d | c |
"""
x
a b
d c
"""
And the ways
| nodes | area | highway |
@@ -17,22 +19,24 @@ Feature: Foot - Squares and other areas
| abcda | yes | residential |
When I route I should get
| from | to | route |
| a | b | abcda |
| a | d | abcda |
| b | c | abcda |
| c | b | abcda |
| c | d | abcda |
| d | c | abcda |
| d | a | abcda |
| a | d | abcda |
| from | to | route |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
@building
Scenario: Foot - Don't route on buildings
Given the node map
| x | |
| a | b |
| d | c |
"""
x
a b
d c
"""
And the ways
| nodes | highway | area | building | access |
@@ -41,21 +45,23 @@ Feature: Foot - Squares and other areas
When I route I should get
| from | to | route |
| a | b | xa |
| a | d | xa |
| b | c | xa |
| c | b | xa |
| c | d | xa |
| d | c | xa |
| d | a | xa |
| a | d | xa |
| a | b | xa,xa |
| a | d | xa,xa |
| b | c | xa,xa |
| c | b | xa,xa |
| c | d | xa,xa |
| d | c | xa,xa |
| d | a | xa,xa |
| a | d | xa,xa |
@parking
Scenario: Foot - parking areas
Given the node map
| e | | | f |
| x | a | b | y |
| | d | c | |
"""
e f
x a b y
d c
"""
And the ways
| nodes | highway | amenity |
@@ -65,23 +71,25 @@ Feature: Foot - Squares and other areas
| abcda | (nil) | parking |
When I route I should get
| from | to | route |
| x | y | xa,abcda,by |
| y | x | by,abcda,xa |
| a | b | abcda |
| a | d | abcda |
| b | c | abcda |
| c | b | abcda |
| c | d | abcda |
| d | c | abcda |
| d | a | abcda |
| a | d | abcda |
| from | to | route |
| x | y | xa,abcda,by,by |
| y | x | by,abcda,xa,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
@train @platform
Scenario: Foot - railway platforms
Given the node map
| x | a | b | y |
| | d | c | |
"""
x a b y
d c
"""
And the ways
| nodes | highway | railway |
@@ -90,14 +98,14 @@ Feature: Foot - Squares and other areas
| abcda | (nil) | platform |
When I route I should get
| from | to | route |
| x | y | xa,abcda,by |
| y | x | by,abcda,xa |
| a | b | abcda |
| a | d | abcda |
| b | c | abcda |
| c | b | abcda |
| c | d | abcda |
| d | c | abcda |
| d | a | abcda |
| a | d | abcda |
| from | to | route |
| x | y | xa,abcda,by,by |
| y | x | by,abcda,xa,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
+27 -21
View File
@@ -6,9 +6,11 @@ Feature: Foot - Handle ferry routes
Scenario: Foot - Ferry route
Given the node map
| a | b | c | | |
| | | d | | |
| | | e | f | g |
"""
a b c
d
e f g
"""
And the ways
| nodes | highway | route | foot |
@@ -17,22 +19,24 @@ Feature: Foot - Handle ferry routes
| efg | primary | | |
When I route I should get
| from | to | route | modes |
| a | g | abc,cde,efg | 1,2,1 |
| b | f | abc,cde,efg | 1,2,1 |
| e | c | cde | 2 |
| e | b | cde,abc | 2,1 |
| e | a | cde,abc | 2,1 |
| c | e | cde | 2 |
| c | f | cde,efg | 2,1 |
| c | g | cde,efg | 2,1 |
| from | to | route | modes |
| a | g | abc,cde,efg,efg | walking,ferry,walking,walking |
| b | f | abc,cde,efg,efg | walking,ferry,walking,walking |
| e | c | cde,cde | ferry,ferry |
| e | b | cde,abc,abc | ferry,walking,walking |
| e | a | cde,abc,abc | ferry,walking,walking |
| c | e | cde,cde | ferry,ferry |
| c | f | cde,efg,efg | ferry,walking,walking |
| c | g | cde,efg,efg | ferry,walking,walking |
Scenario: Foot - Ferry duration, single node
Given the node map
| a | b | c | d |
| | | e | f |
| | | g | h |
| | | i | j |
"""
a b c d
e f
g h
i j
"""
And the ways
| nodes | highway | route | foot | duration |
@@ -48,8 +52,10 @@ Feature: Foot - Handle ferry routes
Scenario: Foot - Ferry duration, multiple nodes
Given the node map
| x | | | | | y |
| | a | b | c | d | |
"""
x y
a b c d
"""
And the ways
| nodes | highway | route | foot | duration |
@@ -58,6 +64,6 @@ Feature: Foot - Handle ferry routes
| abcd | | ferry | yes | 1:00 |
When I route I should get
| from | to | route | time |
| a | d | abcd | 3600s +-10 |
| d | a | abcd | 3600s +-10 |
| from | to | route | time |
| a | d | abcd,abcd | 3600s |
| d | a | abcd,abcd | 3600s |
+11 -11
View File
@@ -6,14 +6,14 @@ Background: Use specific speeds
Scenario: Foot - Ignore maxspeed
Then routability should be
| highway | maxspeed | bothw |
| residential | | 145s ~10% |
| residential | 1 | 145s ~10% |
| residential | 100 | 145s ~10% |
| residential | 1 | 145s ~10% |
| residential | 1mph | 145s ~10% |
| residential | 1 mph | 145s ~10% |
| residential | 1unknown | 145s ~10% |
| residential | 1 unknown | 145s ~10% |
| residential | none | 145s ~10% |
| residential | signals | 145s ~10% |
| highway | maxspeed | bothw |
| residential | | 145 s ~10% |
| residential | 1 | 145 s ~10% |
| residential | 100 | 145 s ~10% |
| residential | 1 | 145 s ~10% |
| residential | 1mph | 145 s ~10% |
| residential | 1 mph | 145 s ~10% |
| residential | 1unknown | 145 s ~10% |
| residential | 1 unknown | 145 s ~10% |
| residential | none | 145 s ~10% |
| residential | signals | 145 s ~10% |
+15 -11
View File
@@ -6,22 +6,26 @@ Feature: Foot - Street names in instructions
Scenario: Foot - A named street
Given the node map
| a | b |
| | c |
"""
a b
c
"""
And the ways
| nodes | name |
| ab | My Way |
| bc | Your Way |
| nodes | name | ref |
| ab | My Way | A6 |
| bc | Your Way | B7 |
When I route I should get
| from | to | route |
| a | c | My Way,Your Way |
| from | to | route |
| a | c | My Way,Your Way,Your Way |
@unnamed
Scenario: Foot - Use way type to describe unnamed ways
Scenario: Foot - No longer use way type to describe unnamed ways, see #3231
Given the node map
| a | b | c | d |
"""
a b c d
"""
And the ways
| nodes | highway | name |
@@ -29,5 +33,5 @@ Feature: Foot - Street names in instructions
| bcd | track | |
When I route I should get
| from | to | route |
| a | d | {highway:footway},{highway:track} |
| from | to | route |
| a | d | , |
+15 -9
View File
@@ -6,36 +6,42 @@ Feature: Foot - Way ref
Scenario: Foot - Way with both name and ref
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | name | ref |
| ab | Utopia Drive | E7 |
When I route I should get
| from | to | route |
| a | b | Utopia Drive / E7 |
| from | to | route | ref |
| a | b | Utopia Drive,Utopia Drive | E7,E7 |
Scenario: Foot - Way with only ref
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | name | ref |
| ab | | E7 |
When I route I should get
| from | to | route |
| a | b | E7 |
| from | to | route | ref |
| a | b | , | E7,E7 |
Scenario: Foot - Way with only name
Given the node map
| a | b |
"""
a b
"""
And the ways
| nodes | name |
| ab | Utopia Drive |
When I route I should get
| from | to | route |
| a | b | Utopia Drive |
| from | to | route |
| a | b | Utopia Drive,Utopia Drive |
+105 -83
View File
@@ -8,9 +8,11 @@ Feature: Foot - Turn restrictions
@no_turning
Scenario: Foot - No left turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -24,17 +26,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | wj | j | no_left_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Foot - No right turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -48,17 +52,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | ej | j | no_right_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Foot - No u-turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -72,17 +78,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | wj | j | no_u_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Foot - Handle any no_* relation
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -96,17 +104,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | wj | j | no_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Foot - Only left turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -120,17 +130,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | wj | j | only_left_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Foot - Only right turn
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -144,17 +156,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | ej | j | only_right_turn |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@only_turning
Scenario: Foot - Only straight on
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -168,17 +182,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | nj | j | only_straight_on |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@no_turning
Scenario: Foot - Handle any only_* restriction
Given the node map
| | n | |
| w | j | e |
| | s | |
"""
n
w j e
s
"""
And the ways
| nodes | oneway |
@@ -192,17 +208,19 @@ Feature: Foot - Turn restrictions
| restriction | sj | nj | j | only_weird_zigzags |
When I route I should get
| from | to | route |
| s | w | sj,wj |
| s | n | sj,nj |
| s | e | sj,ej |
| from | to | route |
| s | w | sj,wj,wj |
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |
@except
Scenario: Foot - Except tag and on no_ restrictions
Given the node map
| b | x | c |
| a | j | d |
| | s | |
"""
b x c
a j d
s
"""
And the ways
| nodes | oneway |
@@ -221,18 +239,20 @@ Feature: Foot - Turn restrictions
| restriction | sj | dj | j | no_right_turn | foot |
When I route I should get
| from | to | route |
| s | a | sj,aj |
| s | b | sj,bj |
| s | c | sj,cj |
| s | d | sj,dj |
| from | to | route |
| s | a | sj,aj,aj |
| s | b | sj,bj,bj |
| s | c | sj,cj,cj |
| s | d | sj,dj,dj |
@except
Scenario: Foot - Except tag and on only_ restrictions
Given the node map
| a | | b |
| | j | |
| | s | |
"""
a b
j
s
"""
And the ways
| nodes | oneway |
@@ -245,19 +265,21 @@ Feature: Foot - Turn restrictions
| restriction | sj | aj | j | only_straight_on | foot |
When I route I should get
| from | to | route |
| s | a | sj,aj |
| s | b | sj,bj |
| from | to | route |
| s | a | sj,aj,aj |
| s | b | sj,bj,bj |
@except
Scenario: Foot - Multiple except tag values
Given the node map
| s | j | a |
| | | b |
| | | c |
| | | d |
| | | e |
| | | f |
"""
s j a
b
c
d
e
f
"""
And the ways
| nodes | oneway |
@@ -279,10 +301,10 @@ Feature: Foot - Turn restrictions
| restriction | sj | jf | j | no_straight_on | foot, bus |
When I route I should get
| from | to | route |
| s | a | sj,ja |
| s | b | sj,jb |
| s | c | sj,jc |
| s | d | sj,jd |
| s | e | sj,je |
| s | f | sj,jf |
| from | to | route |
| s | a | sj,ja,ja |
| s | b | sj,jb,jb |
| s | c | sj,jc,jc |
| s | d | sj,jd,jd |
| s | e | sj,je,je |
| s | f | sj,jf,jf |
+16 -14
View File
@@ -3,18 +3,20 @@ Feature: Roundabout Instructions
Background:
Given the profile "foot"
@todo
Scenario: Foot - Roundabout instructions
# You can walk in both directions on a roundabout, bu the normal roundabout instructions don't
# make sense when you're going the opposite way around the roundabout.
Given the node map
| | | v | | |
| | | d | | |
| s | a | | c | u |
| | | b | | |
| | | t | | |
"""
v
d
s a c u
b
t
"""
And the ways
| nodes | junction |
@@ -25,10 +27,10 @@ Feature: Roundabout Instructions
| abcda | roundabout |
When I route I should get
| from | to | route | turns |
| s | t | sa,tb | head,enter_roundabout-1,destination |
| s | u | sa,uc | head,enter_roundabout-2,destination |
| s | v | sa,vd | head,enter_roundabout-3,destination |
| u | v | uc,vd | head,enter_roundabout-1,destination |
| u | s | uc,sa | head,enter_roundabout-2,destination |
| u | t | uc,tb | head,enter_roundabout-3,destination |
| from | to | route | turns |
| s | t | sa,tb | depart,roundabout-exit-1,arrive |
| s | u | sa,uc | depart,roundabout-exit-2,arrive |
| s | v | sa,vd | depart,roundabout-exit-3,arrive |
| u | v | uc,vd | depart,roundabout-exit-1,arrive |
| u | s | uc,sa | depart,roundabout-exit-2,arrive |
| u | t | uc,tb | depart,roundabout-exit-3,arrive |
+7 -7
View File
@@ -6,10 +6,10 @@ Feature: Foot - Surfaces
Scenario: Foot - Slow surfaces
Then routability should be
| highway | surface | bothw |
| footway | | 145s ~10% |
| footway | fine_gravel | 193s ~10% |
| footway | gravel | 193s ~10% |
| footway | pebblestone | 193s ~10% |
| footway | mud | 289s ~10% |
| footway | sand | 289s ~10% |
| highway | surface | bothw |
| footway | | 145 s ~10% |
| footway | fine_gravel | 193 s ~10% |
| footway | gravel | 193 s ~10% |
| footway | pebblestone | 193 s ~10% |
| footway | mud | 289 s ~10% |
| footway | sand | 289 s ~10% |
+257
View File
@@ -0,0 +1,257 @@
@routing @guidance @turn-lanes
Feature: Turn Lane Guidance
Background:
Given the profile "car"
Given a grid size of 3 meters
@sliproads
Scenario: Separate Turn Lanes
Given the node map
"""
e
.
a ... b ..... c . g
` .
`... d
.
f
"""
And the ways
| nodes | turn:lanes:forward | name | oneway |
| ab | | in | yes |
| bc | left\|through | in | yes |
| bd | right | in | yes |
| ec | | cross | no |
| cd | | cross | no |
| df | | cross | no |
| cg | | straight | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | cd | d | no_left_turn |
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
@sliproads
Scenario: Separate Turn Lanes
Given the node map
"""
e
a . . b . . . c g
` .
` .
` d
f
"""
And the ways
| nodes | turn:lanes:forward | name | oneway |
| ab | | in | yes |
| bc | left\|through | in | yes |
| bd | right | in | yes |
| ec | | cross | no |
| cd | | cross | no |
| df | | cross | no |
| cg | | straight | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | cd | d | no_left_turn |
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
@sliproads
Scenario: Separate Turn Lanes Next to other turns
Given the node map
"""
. e
a . . b . . . c g
. ` .
. ` .
. d
. f
.
.
.
.
i . . h . . . j
"""
And the ways
| nodes | turn:lanes:forward | name | oneway |
| ab | | in | yes |
| bc | left\|through | in | yes |
| bd | right | in | yes |
| ec | | cross | no |
| cd | | cross | no |
| df | | cross | no |
| cg | | straight | no |
| bh | left\|right | turn | yes |
| ihj | | other | no |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | cd | d | no_left_turn |
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
@todo @2654 @none
#https://github.com/Project-OSRM/osrm-backend/issues/2645
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
Scenario: Kurt-Schuhmacher-Damm
Given the node map
"""
g f
| |
j --- h - e
| |
a --- b - c
i d
"""
And the ways
| nodes | name | highway | oneway | turn:lanes |
| ab | | motorway_link | yes | left\|none\|right |
| bc | | primary_link | yes | |
| cd | ksd | secondary | yes | |
| cef | ksd | primary | yes | |
| hj | | motorway_link | yes | |
| eh | | secondary_link | yes | |
| gh | ksd | primary | yes | |
| hbi | ksd | secondary | yes | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | ,ksd,ksd | depart,turn left,arrive | ,left:true none:true right:false, |
| a,i | ,ksd,ksd | depart,turn right,arrive | ,left:false none:true right:true, |
@todo @2650 @sliproads
#market and haight in SF, restricted turn
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
Scenario: Market/Haight without Through Street
Given the node map
"""
g j
| |
| |
| |
| |
| |
| |,f
|,e
,d |
a --------- b c |
/ | |
/ | |
/ | |
| | |
| | |
| | |
l h i
"""
And the ways
| nodes | name | highway | oneway | turn:lanes:forward |
| ab | ghough | secondary | yes | |
| bc | ghough | secondary | yes | through\|through |
| bd | ghough | secondary | yes | none\|through |
| def | ghough | secondary | yes | |
| gd | market | primary | yes | |
| dc | market | primary | yes | |
| ch | market | primary | yes | |
| iej | market | primary | yes | |
| bl | haight | residential | yes | left\|none |
And the relations
| type | way:from | way:to | node:via | restriction |
| relation | bd | dc | d | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
@todo @2650 @sliproads
#market and haight in SF, unrestricted
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
Scenario: Market/Haight without Through Street
Given the node map
"""
g j
| |
| |
| |
| |
| |
| |,f
|,e
,d |
a --------- b c |
/ | |
/ | |
/ | |
| | |
| | |
| | |
l h i
"""
And the ways
| nodes | name | highway | oneway | turn:lanes:forward |
| ab | ghough | secondary | yes | |
| bc | ghough | secondary | yes | through\|through |
| bd | ghough | secondary | yes | none\|through |
| def | ghough | secondary | yes | |
| gd | market | primary | yes | |
| dc | market | primary | yes | |
| ch | market | primary | yes | |
| iej | market | primary | yes | |
| bl | haight | residential | yes | left\|none |
When I route I should get
| waypoints | route | turns | lanes |
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
Scenario: Check sliproad handler loop's exit condition, Issue #2896
# http://www.openstreetmap.org/way/198481519
Given the node locations
| node | lat | lon |
| a | 7.6125350 | 126.5708309 |
| b | 7.6125156 | 126.5707219 |
| c | 7.6125363 | 126.5708337 |
And the ways
| nodes | name |
| cbac | |
When I route I should get
| from | to | route | turns |
| a | c | , | depart,arrive |

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