Commit Graph

524 Commits

Author SHA1 Message Date
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
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
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
1bb88b374e
Make hint values optional, fixes issue 2356 2016-05-04 15:24:48 +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
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
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
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
e341d367d8
Move detail:: to osrm::detail:: 2016-05-02 18:36:32 +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
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
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
e88106e990
Revert "switched to space separated suffix/prefix only"
This reverts commit e9e935303c.
2016-04-27 23:20:10 +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
62a1290043
remove invalid assertion 2016-04-26 13:16:44 +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
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
82df0ca766
Fix parser tests and destinations=all / sources=all 2016-04-22 11:01:15 +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
58c13d2c07 remove movable bridge travel mode references 2016-04-19 12:59:33 -04:00
Patrick Niklaus
6979763292 Refactor the vector tile constants 2016-04-15 14:48:21 +02:00
Moritz Kobitzsch
ae45ad1ad2 fix r-tree abort location 2016-04-14 11:40:36 +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:
- 8ff8dc7200
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
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
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
Daniel J. Hofmann
bf2ab3d8af One-Definition-Rule violation in viewport 2016-04-12 12:17:52 +02:00
Daniel Patterson
43725bae89 Fix Radius Calculation for points collinear in latidue 2016-04-12 11:25:59 +02:00
Patrick Niklaus
5052c4ae3a Move projection function into own header and inline 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
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
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
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
891ff7dd80 Do not modify the end iterator, make const 2016-04-08 21:03:50 +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
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
Moritz Kobitzsch
f2443c64db adds distinction between rotaries/rounabouts 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
Daniel J. Hofmann
97401ad99a Disable steps and alternatives by default 2016-04-05 22:59:14 +02:00
Patrick Niklaus
12608889e2 Fix 'ok' -> 'Ok' 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
Daniel J. Hofmann
c6c25e609b Initial libosrm API docs 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
Patrick Niklaus
006a8833d3 Fix some of the accidental forced loops in viaroute 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
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
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
49e2cb6c36 Fix raster_source + tests 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
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
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
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
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
803fbf2541 Sentinel spelling 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
3c5f6bd8ac Makes hint Equatable and Printable for tests 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
Patrick Niklaus
d67ce81438 Fix hint size 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
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
Patrick Niklaus
30a3ab68c0 Make gcc 4.8 happy and disable protected because of lambdas 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
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
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