Commit Graph

43 Commits

Author SHA1 Message Date
Dennis Luxen
7f9d591ab7
Upgrade clang-format to version 15 (#6859) 2024-05-06 09:14:46 +02:00
Dennis Luxen
7c06726a35 Fix formatting 2022-12-20 18:00:11 +01:00
Dennis Luxen
a4aa153ba4 Use nested namespace
It's a mechanical change to modernize the code base
2022-12-11 10:17:17 +01:00
Michael Bell
5d468f2897
Make edge metrics strongly typed (#6421)
This change takes the existing typedefs for weight, duration and
distance, and makes them proper types, using the existing Alias
functionality.

Primarily this is to prevent bugs where the metrics are switched,
but it also adds additional documentation. For example, it now
makes it clear (despite the naming of variables) that most of the
trip algorithm is running on the duration metric.

I've not made any changes to the casts performed between metrics
and numeric types, they now just more explicit.
2022-10-28 15:16:12 +01:00
Siarhei Fedartsou
be353630d5
Fix a couple of warnings found by PVS Studio (#6372) 2022-09-22 23:28:12 +02:00
Michael Bell
d74e7b66bd
Support snapping to multiple ways at an input location (#5953)
This PR improves routing results by adding support for snapping to
multiple ways at input locations.

This means all edges at the snapped location can act as source/target
candidates for routing search, ensuring we always find the best route,
and not the one dependent on the edge selected.
2022-08-27 11:36:20 +01:00
Daniel Patterson
50d9632ed7
Upgrade formatting to clang-format 10 (#5895)
* Update formatting tools to clang-format-10

* Reformat using clang-format-10.0.09
2020-11-26 07:21:39 -08:00
Kajari Ghosh
14860b62e9
Unpack paths and return total distance in matrix plugin for CH (#4990) 2018-04-20 18:18:55 -04:00
Patrick Niklaus
b4cfc8d6e0 Fix formating 2018-02-06 11:51:33 +01:00
Patrick Niklaus
e7bb612050 Move debug printer code to own header 2018-02-06 11:51:33 +01:00
Michael Krasnyk
fbb2970044 Merge unused 3 bits of PhantomNode into bearing
to prevent memcheck  reports
==23434== Use of uninitialised value of size 8
==23434==    at 0x15CAFB5: boost::archive::iterators::detail::from_6_bit<char>::operator()(char) const (base64_from_binary.hpp:50)
==23434==    by 0x15CB6BE: boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>::dereference() const (transform_iterator.hpp:126)
==23434==    by 0x15CB6CE: boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>::reference boost::iterators::iterator_core_access::dereference<boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default> >(boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default> const&) (iterator_facade.hpp:550)
==23434==    by 0x15CB6E2: boost::iterators::detail::iterator_facade_base<boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>, char, boost::iterators::single_pass_traversal_tag, char, long, false, false>::operator*() const (iterator_facade.hpp:656)
==23434==    by 0x15CB7F4: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::input_iterator_tag) (basic_string.tcc:190)
==23434==    by 0x15CB89F: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct_aux<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::__false_type) (basic_string.h:196)
==23434==    by 0x15CB91B: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>) (basic_string.h:215)
==23434==    by 0x15CB9AA: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, void>(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::allocator<char> const&) (basic_string.h:552)
==23434==    by 0x15CBB0F: osrm::engine::encodeBase64[abi:cxx11](unsigned char const*, unsigned long) (base64.hpp:65)
==23434==    by 0x15CBC01: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > osrm::engine::encodeBase64Bytewise<osrm::engine::Hint>(osrm::engine::Hint const&) (base64.hpp:94)
==23434==    by 0x15CBC45: osrm::engine::Hint::ToBase64[abi:cxx11]() const (hint.cpp:30)
==23434==    by 0x16596DC: osrm::engine::api::json::makeWaypoint(osrm::util::Coordinate, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osrm::engine::Hint const&) (json_factory.cpp:359)
2017-10-09 15:31:59 +01:00
Jack Danger
79d07ef45c Updating year on all 'Project OSRM' copyrights 2017-10-03 12:03:26 +02:00
Lev Dragunov
cf2573157f clang-format with older version 2017-08-31 11:11:05 +02:00
Lev Dragunov
80c55119d2 Add bearing for the phantom node 2017-08-31 11:11:05 +02:00
Daniel Patterson
25c870dc57 Unused padding doesn't need to be named, removing name silences compiler warnings. 2017-05-26 09:15:34 +00:00
Michael Krasnyk
26702920b4 Move ComponentID to EdgeBasedNodeDataContainer 2017-05-17 15:21:51 +00:00
Michael Krasnyk
373087d74f Initialize unused bits in PhantomNode 2017-05-17 15:21:51 +00:00
Michael Krasnyk
ca6b1b39b7 Remove data duplicates in .node file 2017-05-17 15:21:51 +00:00
Michael Krasnyk
12f47708cd Adjust method and function names 2017-05-11 09:13:42 +00:00
Michael Krasnyk
9358aa1128 Disable nodes with invalid segments 2017-05-11 09:13:42 +00:00
Michael Krasnyk
25baf51a2c Add duration to edges and use it in table plugin 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
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
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
Patrick Niklaus
6e16eab6ec
Format with clang-format 3.8 2016-05-27 21:05:04 +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
621ed970da Fix assertions about hint size for windows 2016-04-12 18:11:08 +02:00
Patrick Niklaus
fda4656630 Implement re-enabling of PhantomNode directions after bearing filtering 2016-04-05 22:59:14 +02:00
Patrick Niklaus
d67ce81438 Fix hint size 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
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
d9d4742130 First round of lat,lng -> lng,lat switcheroo 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 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
d391df52ba Be kind to the optimizer, pass coordinates by value (just two ints) 2016-01-26 22:57:02 +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
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
1da1fa5a31 Fix naming in PhantomNode 2016-01-05 12:41:16 +01:00
Patrick Niklaus
028ca5c9d9 Apply clang-format 2016-01-05 12:04:04 +01:00
Daniel J. Hofmann
685d330ee2 Remove license headers from project source files; global license 2016-01-04 19:06:32 +01:00
Patrick Niklaus
97585bb26a Fix include paths 2016-01-03 18:47:50 +01:00
Patrick Niklaus
bfc6c9b89d Move files in src/ include/ 2016-01-03 16:37:38 +01:00