Commit Graph

166 Commits

Author SHA1 Message Date
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
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
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
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
Patrick Niklaus
f3e72623e9 Add viaroute suport for new API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c70d138eb9 Spelling: Hierachy vs Hierarchy 2016-04-04 13:58:55 +02:00
bergwerkgis
d0636a9f6d make AppVeyor work again 2016-03-31 16:49:30 +02: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
Daniel J. Hofmann
a6aa0a4cb0 Adapts routed to always print port and ip it listens on, fixed #2097 2016-03-16 11:21:20 +01:00
Daniel J. Hofmann
a013da860e Fixes unneeded includes in contractor header and self-include 2016-03-15 10:44:33 +01:00
akaiser
2cf8309987 Bugfix: set initial uturn indicators 2016-03-14 17:14:01 +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
Patrick Niklaus
ae4161b780 Fix extraction in case of ways referencing invalid node ids 2016-03-08 20:59:11 +01:00
Daniel Patterson
13378a4b55 Only attempt to return PBF if the call to the tile plugin actually returned PBF data. This may occur if bad parameters are passed (e.g. zoom level is < 12)) 2016-03-04 17:49:20 -08:00
Patrick Niklaus
ac6218eef2 Simplify EBGF code 2016-03-04 16:37:25 +01:00
Patrick Niklaus
a98cc51ac2 Fix up some PR comments 2016-03-04 16:13:30 +01:00
Daniel Patterson
e595bdb20a More cleanup. 2016-03-03 19:28:48 -08:00
Daniel Patterson
9bd2446901 Cleanup. 2016-03-03 19:27:36 -08:00
Daniel Patterson
27babfec3d Add the uncompressible edges to the compressed edge container during the graph compressor run, rather than in the EdgeBasedGraphFactory. This keeps the logic a lot simpler to follow, although it's not quite as fast. 2016-03-03 18:48:39 -08:00
Daniel Patterson
017ff53702 Code review updates. 2016-03-03 13:25:01 -08: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 Patterson
53542abbb7 Disable compression across traffic lights. Previously, we merged the traffic light penalty into the edge weight. When later considering traffic data, we need to be able to update just the edge weight, and it was impossible to extricate the traffic penalty. This increases the number of edge-based-nodes a little bit, but some quick tests show it should only be about 0.1% overall (only affects traffic signals on edges with no intersections (i.e. degree=2)) 2016-03-02 18:00:31 -08:00
Daniel Patterson
fc908d4687 Fix naming of variable so it's a lot less confusing. 2016-03-02 18:00:31 -08:00
Patrick Niklaus
0eaa393065 Limit tile zoomlevel to 12+ 2016-03-02 19:59:49 +01:00
Daniel J. Hofmann
aeee565115 Formats all the files we touch.. 2016-03-01 23:51:25 +01:00
Daniel Patterson
22bf0ead18 We don't need this header. 2016-03-01 23:51:25 +01:00
Daniel Patterson
b9dd6369d4 Remove draft tiler tool, we moved everything into 2016-03-01 23:51:25 +01:00
Daniel Patterson
3d6c0ac512 Remove some commented out code that's not used any more. 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
3869ab6345 Use the correct type when pulling object from variant 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
51ae14ec23 Extra ; 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
da88cb6a43 Extractor comments wrt. osrm-contract 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
96a5e594b3 Removes profiles from osrm-prepare, only needed in osrm-extract. Fixes #1950. 2016-03-01 16:43:34 +01:00
bergwerkgis
d38575a011 include lock_types.hpp 2016-02-17 22:54:45 +01:00
karenzshea
6ac3d902c9 update help output test 2016-02-16 18:43:06 +01:00
karenzshea
3beb8c825b cf 2016-02-16 18:43:06 +01:00
karenzshea
b80e96547e remove ini parsing 2016-02-16 18:43:06 +01:00
Moritz Kobitzsch
2679c1cf0a correct handling of travel modes 2016-02-16 01:35:04 +01:00
Moritz Kobitzsch
f14352f494 modify turn angles and instructions 2016-02-15 20:13:55 +01: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
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
Daniel J. Hofmann
d1c4a26791 Remove .restriction reference 2016-02-11 19:19:28 -08:00
Daniel J. Hofmann
bb06bfbbd7 Same undefined behavior from shifting into the sign bit in Storage 2016-02-08 11:47:44 -08:00
Bas Couwenberg
5e15bceaae Fix 'egdes' typo, replace with 'edges'. 2016-02-07 02:59:44 +01:00
karenzshea
f5c12ec433 comments 2016-01-29 23:49:09 +01: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
Daniel J. Hofmann
d189339495 Makes the extractor no longer depend on the crc32 computation 2016-01-27 17:18:04 +01:00
Patrick Niklaus
d9c281cd7c Remove boost fusion dependency in RouteParameters 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
7a115e93c0 Removes check-hsgr 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
0fcca04150 TU-local STXXL comparator for OSMNodeIDs, needs {min,max}_value
Can not use std::less<>{} because of this.
2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
54a9173107 Make public RouteParameters header no longer depend on Spirit
And includes the optional header that was transitively included by the
spirit header before. Hopefully this will speed up compile times, as the
RouteParameters header is used in a lot of translation units.
2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
04e26ba6b8 Adds missing cstdlib header for std::llabs 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
0fbdd57835 Quickfixes polyline encoder's undefined behavior via left-shifting negative numbers 2016-01-26 17:54:08 +01:00
Mathias Gug
40a3008318 Send the Connection: close response header
so that proxy server don't try to reuse the connection. Given that
osrm-routed does *not* support keepalive the Connection: close response
header should be set.
2016-01-25 15:03:37 -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
17f8e65808 Fail hard if node weights are not there 2016-01-21 06:47:34 +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 Patterson
e21eaa4b9e 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 17:44:29 +01:00
Daniel J. Hofmann
4b0e1a4b19 Run modernizer 2016-01-18 16:54:30 +01:00
Patrick Niklaus
22e83013e3 Fix uturns at dead-end streets 2016-01-15 16:24:21 +01:00
Daniel J. Hofmann
e7d9e42a16 Fix race condition in osrm-routed HTTP server
We had a similar issue a few month ago. Stumbled upon this by accident.

It goes like this:

- `output_buffer` is function-local
- we pass it to async_write and leave the scope
- `output_buffers` goes out of scope
- bad things happen, sometimes

The fix is to, again, put it inside the connection that handles itself
via the enable_shared_from_this idiom.

References:

- http://www.boost.org/doc/libs/1_59_0/doc/html/boost_asio/reference/async_write/overload1.html
- https://github.com/Project-OSRM/osrm-backend/pull/1690
2016-01-13 23:21:45 +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
Daniel J. Hofmann
fc292cc2d8 No need for extra translation units (for edge data structures) 2016-01-11 20:11:44 +01:00
Daniel J. Hofmann
f875e26fbf Inline mercator transformations; no need for separate translation unit 2016-01-11 20:10:45 +01:00
Daniel J. Hofmann
f68247673a Make ComputeAngle a free standing function 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
f65dd63210 Make TurnInstructionsClass functions free standing functions 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
0627c3443d Make PolylineFormatter's encodedAsJSON and unencodedAsJSON free standing functions 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
c65dd16460 Make PolylineCompresser's encode and decode free standing functions 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
c590596dbe Make DouglasPeucker a free standing function 2016-01-09 19:55:21 +01:00
Patrick Niklaus
6991a38703 Run clang-format 2016-01-08 01:31:57 +01:00
Patrick Niklaus
6b18e4f7e9 Add namespace around all files 2016-01-08 01:30:52 +01:00
Moritz Kobitzsch
efd33b295a Refactor guidance generation 2016-01-07 22:51:24 +01:00
Patrick Niklaus
1da1fa5a31 Fix naming in PhantomNode 2016-01-05 12:41:16 +01:00
Patrick Niklaus
707931125e Remove unnecceary pre-define 2016-01-05 12:06:34 +01:00
Patrick Niklaus
f4e82a879b Fix naming in static_rtree benchmark 2016-01-05 12:06:34 +01:00
Patrick Niklaus
4f7369ed02 Fix naming in FixedPointCoordinate 2016-01-05 12:06:34 +01:00