Commit Graph

163 Commits

Author SHA1 Message Date
Patrick Niklaus
64307ea882
Add missing headers and remove dead code 2016-04-29 20:02:08 +02:00
Moritz Kobitzsch
1544a08ea2 introduce roundabout-turns into instruction set 2016-04-27 12:13:42 +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
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
Daniel J. Hofmann
bf2ab3d8af One-Definition-Rule violation in viewport 2016-04-12 12:17:52 +02:00
Patrick Niklaus
5052c4ae3a Move projection function into own header and inline 2016-04-09 17:31:36 +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
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
Moritz Kobitzsch
f2443c64db adds distinction between rotaries/rounabouts 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
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
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
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
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
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
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
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
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
6c00ccca9a Remove obsolete debug information 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
b08b360f38 Big Restructuring / Cleanup 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
ef1e0e14ec advanced guidance on 5.0 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
72094acf74 Change stream operator of strong typedef 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
d9d4742130 First round of lat,lng -> lng,lat switcheroo 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
35b098e656 First compiling version of map_match plugin 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
bergwerkgis
d0636a9f6d make AppVeyor work again 2016-03-31 16:49:30 +02:00
Daniel J. Hofmann
655dd2277c Eliminate extra semicola 2016-03-15 11:47:57 +01:00
Daniel J. Hofmann
ac0279aa83 RAII for auto-closing file streams
Small fixes I didn't want to include in unrelated PRs.

There are a few left in `storage.cpp` but since it's a single function
in 600 lines of code, I didn't want to touch the mess. The others are
safe to remove, cucumber and test run on Finland gives 👍.
2016-03-09 17:46:02 +01:00
Daniel Patterson
49441fe204 Make forward/reverse weight/offset calculated at query time,
rather than being cached in the StaticRTree.  This means we
can freely apply traffic data and not have stale values lying
around.  It reduces the size of the RTree on disk, at the expense
of some additional data in RAM.
2016-03-03 10:49:12 -08:00
Daniel J. Hofmann
66cadac6b6 Explicitly std:: prefix fixed integral types in static rtree header 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
c237c5353b Explicitly std:: prefix fixed integral types in rectangle header 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
c27a7e087f Fixes rectangle header includes 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
0894590a96 Fixes default declared ctor in Buffer 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
aeee565115 Formats all the files we touch.. 2016-03-01 23:51:25 +01:00
Daniel Patterson
56e35e8ef2 Remove GeoJSON based debugging output, we can now generate vector tiles with roughly the same data on-the-fly. 2016-03-01 23:51:25 +01:00
Daniel Patterson
26453af1b9 Add a distinct Buffer type for encoding binary data in JSON responses. Treated like a string, but allows other consumers (a-la node-osrm) to recognize and not break string encodings. 2016-03-01 23:51:25 +01:00
Daniel Patterson
5dc7b79bb6 Implements a vector tileserver so you can see what's going on inside
OSRM.
2016-03-01 23:51:25 +01:00
Patrick Niklaus
a0b4fcc05a Remove last bits of GPX support code 2016-03-01 23:44:07 +01:00
Daniel J. Hofmann
47d56676f1 Don't bounds check by default in static rtree; fixes #1988 2016-02-17 18:20:27 -08:00
karenzshea
b80e96547e remove ini parsing 2016-02-16 18:43:06 +01:00
Daniel Patterson
65183e94c6 Use \n instead of std::endl to avoid unnecessary flushing. Cleanup some newlines to avoid blank lines in debug output. 2016-02-15 14:21:18 -08:00
Daniel Patterson
6b0fe683c9 Expose the base type. Going via the operator<< leaves us with invalid geojson. 2016-02-15 13:25:55 -08:00
Daniel J. Hofmann
a6d406d2c3 Fix headers for JSON abstractions 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
4b8c0ac143 Revert "Folds json_* utilities into json subfolder and adapts includes"
This reverts commit cd039c69c0a92a35889e3c875b8eb53cf07377bb.
2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
ec01c2a119 Folds json_* utilities into json subfolder and adapts includes 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
fbef77a942 Documents why not to use boost::irange in favor of our hand-written irange 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
f207d988f4 Removes floating point epsilon comparator 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
60fc486cea Prefix exception header guard with osrm prefix 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
ef171f3acd Properly use typed math constants instead of impl. specific hacks
PI is not in the stdlib, neither is 1/pi, pi*2 and so on. Instead
of relying on implementations providing these, use properly typed
math constants.

Main benefits:
- portable and
- returns constexpr, for compile-time computation

References:
- http://www.boost.org/doc/libs/1_60_0/libs/math/doc/html/math_toolkit/constants_intro.html
- http://www.boost.org/doc/libs/1_60_0/libs/math/doc/html/math_toolkit/constants.html
2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
64b36807d3 Transforms osrm_exception to exception 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
5de8f1803c Folds mercator projections into coordinate_calculation 2016-02-12 15:46:24 -08:00
karenzshea
7398bed974 Include real coordinates in debug geojson mode 2016-02-11 17:09:20 -05:00
Dane Springmeyer
2949a52a11 remove uneeded and deprecated usage of mapbox::util::static_visitor 2016-02-10 12:58:36 -08:00
Daniel J. Hofmann
b8d20dfe99 Prevent undefined behavior from left shifting into sign bit when offset is 31 2016-02-08 11:47:44 -08:00
Daniel J. Hofmann
fa8529949b Make swap noexcept (as it has to be!) and fix swap misuses 2016-02-08 11:47:44 -08:00
Daniel J. Hofmann
7b37c847bd Fixes shared memory wrapper includes 2016-02-08 11:47:02 -08:00
Kerrick Staley
8804330d83 Add operator<< to OSRM_STRONG_TYPEDEF
Useful for debugging.
2016-02-01 12:32:30 -08:00
karenzshea
262cdd7bc0 move tribool obj into request_parser 2016-01-29 23:49:09 +01:00
Daniel J. Hofmann
a48f02e0da Takes care of proper special member generation globally, fixes #1689
Phew, a lot of classes were affected by this. The rationale for the
changes are as follows:

- When a type X declares any constructor, the default constructor is
  not declared, so there is no need for X() = delete there. In fact,
  there is brutal difference between those two: deleted members
  participate in overload resolution, but not-declared members do not!

- When a type X wants to be non-copyable (e.g. to be only movable, like
  threads, unique_ptrs, and so on), you can either do it by inheriting
  from boost::noncopyable (the old way), or better declare both (!) the
  copy constructor _and_ the copy assignment operator as deleted:

      X(X const&) = delete;
      X& operator=(X const&) = delete;

  We had tons of types with deleted copy constructors that were lacking
  a corresponding deleted copy assignment operator, making them still
  copyable and you wouldn't even notice (read: scary)!

References:

- http://accu.org/content/conf2014/Howard_Hinnant_Accu_2014.pdf
- http://www.boost.org/doc/libs/master/libs/core/doc/html/core/noncopyable.html

Note: I know, I'm quoting Hinnant's extraordinary slides a lot, but
getting the sematic right here is so incredibly important.
2016-01-27 17:25:30 +01:00
Patrick Niklaus
0802804677 Fix PR comments 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
38e8a90f4e Make HilbertCode a free standing function 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
d391df52ba Be kind to the optimizer, pass coordinates by value (just two ints) 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
46fc6f8da4 Collapse computeAngle into coordinate calculation 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
312b414d8f Adapts XORFastHashStorage to XORFastHash compile time limits 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
a6e7954128 Make XORFastHash's number of hashable elements compile time constant
Still constraint by the usage of uint32_t and subsequent splitting into
two uint16_t we use for indexing into the tables.
2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
1417d43430 Cut down memory usage for tables in XORFastHash by factor of four
`pow(2, 16)` is not `2 << 16` but rather `1 << 16`.

With this change we cut memory usage in half for the XORFastHash's two
tables. Adapts XORFastHashStorage, memory usage reduction by factor two.
2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
60ef6070b0 Simplify uint32_t splitting in XORFastHash 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
2f42196fca Explicitely type XORFastHash 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
f8b5e7e2c9 Removes XORMiniHash, unused 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
2c0547bb0e Make XORFastHash great again 2016-01-26 17:54:08 +01:00
Mortada Mehyar
b48022be22 make it possible to disable max_locations in map_matching 2016-01-25 14:53:44 -08:00
Daniel J. Hofmann
502aedb33e Provide a way to selectively enable assertions in release mode
- Throwing an assertion exception for proper stack unwinding, making
  sure destructors are called

- On in Debug mode, in Release, enable via:

      cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_ASSERTIONS=ON

Current problem that I'm seeing is that some code is not catching
exceptions or worse silently swallowing them. Would like to check the
whole pipeline before merging this in.
2016-01-21 15:37:25 +01:00
Patrick Niklaus
439eb9da3d Create public facing libraries for extractor, contractor and datastore
New libraries libosrm_extract, libosrm_contract, libosrm_store
2016-01-21 06:47:34 +01:00
Moritz Kobitzsch
1c1bfd7541 Fix routing when start and target are on the same segment
Fixes issue #1864. Given the simple set-up:

a --> b --> c
^-----------|

This would translate into an edge based graph (ab) -> (bc),
(bc) -> (ca), (ca) -> (ab).

Starting at the end of the one-way street (ab) and going to
the beginning, the query has to find a self-loop within the
graph (ab) -> (bc) -> (ca) -> (ab), as both nodes map to the
same segment (ab).
2016-01-19 23:26:19 +01:00
Daniel J. Hofmann
e20f92bbbb Anonymous namespaces in header files are bad
They duplicate the code across translation units.
2016-01-19 17:42:49 +01:00
Daniel J. Hofmann
491b1d9c96 Remove headers with no reverse dependencies
Found with

```
daniel@x1c /t/o/i/util> for header in *.hpp
                            echo -n $header:
                            ag -iQ $header ../../ --noheading | wc -l
                        end
...
fixed_point_number.hpp:0
range_algorithms.hpp:0
...
```

Only two. Surprises me to be honest.
But we're cleaning up for quite a bit now.
2016-01-18 16:05:39 +01:00
Daniel J. Hofmann
466251287f Define compile-time constants for coordinate calculation only once
Closes #1327.
2016-01-12 19:59:02 +01:00
Daniel J. Hofmann
c93ca02fb8 Rips out dead code from the container.hpp and creates for_each_pai.hpp
I added two TODOs that I would like to address in the future.
2016-01-11 20:14:35 +01:00
Daniel J. Hofmann
4813488f84 Split import_edge.hpp: node_based_edge.hpp, edge_based_edge.hpp closes #1604 2016-01-11 20:11:44 +01:00