Commit Graph

490 Commits

Author SHA1 Message Date
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
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
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
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
Patrick Niklaus
5e5f72ae57 Don't pass down unsnapped coordinates. All information is already there 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
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
6e7cf68164 Adapts MakeResponse to not pass vector by pointer 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
7c30ea32bf Runs scripts/format.sh 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
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
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
bcfbc0cf6c Fix table response format to return null + double in seconds 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
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
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
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
3d6e9da115 Fix missing headers in hint.hpp 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
f3c4a7dd16 We don't need templates at all, this is not CRTP? 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
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
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
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
b1c84b598f Print the _local_ endpoint Boost ASIO assigns a port to, fixes #2097 2016-03-18 12:09:28 +01:00
Daniel J. Hofmann
8640129835 Ampersand binds to variable name 2016-03-15 11:47:57 +01:00
Daniel J. Hofmann
655dd2277c Eliminate extra semicola 2016-03-15 11:47:57 +01:00
Daniel J. Hofmann
40f95191a0 Do not copy pairs in loop 2016-03-15 11:47:57 +01:00
Daniel J. Hofmann
a013da860e Fixes unneeded includes in contractor header and self-include 2016-03-15 10:44:33 +01:00
Moritz Kobitzsch
4150c804df Improve the core search stopping criterion 2016-03-15 09:33:10 +01:00
Patrick Niklaus
8912928581 Disable alternatives by defaul fixes #2072 2016-03-10 21:01:30 +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
adc3bacea9 Add pruning based on @MoKob's idea in #1921 2016-03-08 00:43:45 +01:00
Patrick Niklaus
f86b5a44bc Adapt shortest_path and viaroute to core search 2016-03-07 21:26:12 +01:00
Patrick Niklaus
a98cc51ac2 Fix up some PR comments 2016-03-04 16:13:30 +01: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 J. Hofmann
e90b1bbead Allow no sources and no destinations for full table query 2016-03-03 02:00:39 +01:00
Daniel J. Hofmann
ce1ca1b625 Fixes critical error in table plugin accessing uninitialized memory
Although we check for valid coordinates in the table plugin via
`check_all_coordinates`, we do not check for #srcs > 0 and #dsts > 0.

This would be fine as the grammar parser combines adding coordinates and
setting their `is_source` and `is_destination` property, which makes
adding coordinates without specifying source or destination impossible.

See: route_parameters.cpp, AddSource, AddDestination, and api_grammar.hpp

In contract, the Polyline codepath does not do this! In fact, it only lets
you set coordinates, but not their `is_source` or `is_destination` property.

See: route_parameters.cpp, SetCoordinatesFromGeometry

Therefore, the following queries only set coordinates:

    http 'http://localhost:5000/table?locs=s_hhFg{arEgEfEgEfEgEfEgEfEgEfEgEfEgEfEgEfEgEfE'
    http 'http://localhost:5000/table?locs=_p~iF~ps|U_ulLnnqC_mqNvxq`@'

but fail to specify sources and targets!

The distance table plugin now assumes `is_course` and `is_destination`
is the same size as `coordinates`.

And happily accesses uninitialized memory.
2016-03-03 02:00:39 +01:00
Patrick Niklaus
0eaa393065 Limit tile zoomlevel to 12+ 2016-03-02 19:59:49 +01:00
Daniel Patterson
6d749777fc Using bind<T> in this case causes ambiguity with GCC 5.2.1 (see http://www.boost.org/doc/libs/develop/libs/bind/doc/html/bind.html#bind.faq.Q_forms). Remove template and let the type be deduced automatically. 2016-03-02 09:54:08 -08:00
David Low
79e8d1aac3 Minor typo fix 2016-03-02 15:16:28 +08:00
Daniel J. Hofmann
2ce553d661 Math functions are not constexpr since they have side-effects (setting errno) :( 2016-03-01 23:51:26 +01: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
2efef91f1c Fixes const correctnes and explicit types in tile header 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
3feba9a581 Fixes Undefined Behavior in tile header from ODR-violation 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
afae896d05 Makes compile time constants properly ROM-able and deduplicates them across TUs 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
bcbaa21739 Fixes tile header includes 2016-03-01 23:51:25 +01:00
Daniel J. Hofmann
d60bc61d13 Properly constructs objects of type const RectangleInt2D in facades 2016-03-01 23:51:25 +01:00
Daniel J. Hofmann
aeee565115 Formats all the files we touch.. 2016-03-01 23:51:25 +01:00
Daniel Patterson
8126793b18 Don't need to actually create a vector, we just write out all speeds from 0-127 2016-03-01 23:51:25 +01:00
Daniel Patterson
6a2592421c Optimize encoding of speed values. Only store 0-127, so we can efficiently pack into a byte. Speed and is_tiny values are now shared, so tiles should be much smaller. 2016-03-01 23:51:25 +01:00
Daniel Patterson
95bf81f528 Add a bunch of comments. 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
ae802a8a83 No need to send a back to the client, km/h are specific enough. 2016-03-01 23:51:25 +01:00
Daniel Patterson
ee71d2fe5f Don't need to static cast. 2016-03-01 23:51:25 +01:00
Daniel Patterson
8dd2447cc5 Don't round until necessary, this keeps coordinates in much better positions. 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
96a5e594b3 Removes profiles from osrm-prepare, only needed in osrm-extract. Fixes #1950. 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
04765d82ba Fixes undefined behavior via One-Definition-Rule violations
Heuristic

    find . -type f -name '*.hpp' |xargs ag -B 1 '^([^inline][a-zA-Z0-9_&\*::])+ (.*)\((.*)\)$'
2016-02-26 06:39:52 +01:00
Patrick Niklaus
69bc8a8b22 Fix unpacking for self-loop nodes not in core. Fixes #1999 2016-02-21 01:38:06 +01:00
Mortada Mehyar
aae02cd1be fixed minor typos 2016-02-18 23:05:11 -05: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
Moritz Kobitzsch
2679c1cf0a correct handling of travel modes 2016-02-16 01:35:04 +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
Moritz Kobitzsch
f14352f494 modify turn angles and instructions 2016-02-15 20:13:55 +01:00
Moritz Kobitzsch
ab9426e260 fix routing when requiring loop at a core node 2016-02-15 18:26:39 +01:00
Daniel J. Hofmann
27fe85ac8b Dividable-by-three instead of next-dividable-by-three 2016-02-12 18:10:44 -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
c9f0158fdb Ifdef is_trivially_copyable<T> behind gcc >= 5 guard 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
aac21f932b Refactors Base64 encoding and decoding, it's almost beautiful now 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
978b70c998 Adds a comment as to why the char to typed enum class transformation is not possible 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
Daniel J. Hofmann
6cd55e535c Removes potentially dangerous and misleading lat, lon subscript oeprator 2016-02-11 02:37:33 +01: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
Daniel J. Hofmann
3075f6cea7 No need for deferred, non-blocking or timeout acquisition 2016-02-08 11:26:40 -08:00
Daniel J. Hofmann
ff966490bb Fixes datafacade includes 2016-02-08 11:26:40 -08:00
Kerrick Staley
8804330d83 Add operator<< to OSRM_STRONG_TYPEDEF
Useful for debugging.
2016-02-01 12:32:30 -08: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
Patrick Niklaus
efee07e20b Move arrays don't copy 2016-01-29 15:58:48 +01:00
Moritz Kobitzsch
603b83e1c3 Fixes Alternative Routing when including loops 2016-01-28 16:33:07 +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
Patrick Niklaus
d9c281cd7c Remove boost fusion dependency in RouteParameters 2016-01-26 22:57:02 +01:00
Patrick Niklaus
46185fe9e8 Ptr -> auto 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
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
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
Patrick Niklaus
4f792c40b7 Merge pull request #1928 from mortada/max_locations_map_matching
make it possible to disable max_locations in map_matching
2016-01-25 22:31:55 -05:00
Mortada Mehyar
17c3c1d66a improve comments for gps_precision 2016-01-25 15:17:44 -08: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 Patterson
238e77d959 Include the travel mode in the last instruction by copying it from the previous instruction. 2016-01-19 21:28:56 +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
80b897d8cf Fix shared memory non-copyable properties 2016-01-19 17:44:07 +01:00
Daniel Patterson
1ed7bcfb2c DataFacade should only remove shared segments if they're actually different from the last time they were checked. 2016-01-19 17:44:07 +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
6e717bfd30 Switch to const constexpr for header constants (3.5/3 internal linkage) 2016-01-19 17:42:49 +01:00
Patrick Niklaus
9d12de9bce Fix wrong assertion and emplace_back bug in trip plugin 2016-01-19 17:36:29 +01:00
Daniel J. Hofmann
4b0e1a4b19 Run modernizer 2016-01-18 16:54:30 +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
Moritz Kobitzsch
b8e29f5ae3 Add a u-turn instruciton when performing a u-turn at a via-node 2016-01-15 19:56:39 +01:00
Patrick Niklaus
6b15f29d7c Fix handling unexpected errors. 2016-01-14 18:27:36 +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
03f64a6c20 Make RouteNameExtraction a free standing function 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
23cd4d5ed2 not -> ! 2016-01-09 19:42:31 +01:00
Moritz Kobitzsch
4dc6ff9fb8 and another missed not 2016-01-09 19:42:31 +01:00
Moritz Kobitzsch
8638cbf8b2 missed a not 2016-01-09 19:42:31 +01:00
Moritz Kobitzsch
a2555983e6 replaces and/not with &&/! for windows 2016-01-09 19:42:31 +01:00
Daniel J. Hofmann
21804aecdb Prefer inline over static inline for free standing functions
When you mark free standing functions as `static inline` instead
of just `inline` they can not get merged across TUs and therefore
produce code bloat which is bad for the binaries size, the CPUs
instruction cache, and so on.

Please also see the discussion at:

- https://groups.google.com/forum/#!topic/mozilla.dev.platform/Ulw9HoZbSyQ
- http://stackoverflow.com/a/12836392

Note that non-fully specialized templates (i.e. with a kind of at
least `Template :: * -> *`) are `inline` by default.
2016-01-08 23:33:31 +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
Patrick Niklaus
efc9007cbf Remore start_phantom/target_phantom because they are useless here 2016-01-07 22:51:37 +01:00
Moritz Kobitzsch
efd33b295a Refactor guidance generation 2016-01-07 22:51:24 +01:00
Patrick Niklaus
fa4ba42f15 Use a sane gps_precision multipler 2016-01-07 16:30:54 +01:00
Patrick Niklaus
811e29ff1b Add cmath to geospatial_query 2016-01-07 11:35:35 +01:00
Patrick Niklaus
1da1fa5a31 Fix naming in PhantomNode 2016-01-05 12:41:16 +01:00
Patrick Niklaus
4f7369ed02 Fix naming in FixedPointCoordinate 2016-01-05 12:06:34 +01:00