Commit Graph

567 Commits

Author SHA1 Message Date
Siarhei Fedartsou
48e8382785
Remove unused bearing::get function (#7040)
* Remove unused bearing::get function

* Remove unused bearing::get function

* Remove unused bearing::get function

* Remove unused bearing::get function
2024-10-20 19:46:49 +02:00
Siarhei Fedartsou
c2f877eb9d
Remove unused MapStorage and GenerationArrayStorage (#6990) 2024-07-11 23:10:14 +02:00
Siarhei Fedartsou
57b792c768
Get rid of boost::optional leftovers (#6977) 2024-07-02 22:37:09 +02:00
Siarhei Fedartsou
0e17869e21
Re-use priority queue in StaticRTree (#6952) 2024-06-25 18:58:48 +02:00
Siarhei Fedartsou
7d72dfebf7
Optimise encodePolyline function (#6940) 2024-06-22 20:04:32 +02:00
Siarhei Fedartsou
3d01d96036
Avoid reallocations in base64 encoding (#6951) 2024-06-22 08:50:18 +02:00
Dennis Luxen
f1eabc3ecc
Replace boost::filesystem with std (#6432) 2024-06-20 21:44:28 +02:00
Siarhei Fedartsou
523ee762f0
Upgrade to clang-tidy 18 (#6919) 2024-06-06 22:20:38 +02:00
Dennis Luxen
a9b1bd88d3
Remove all core-CH left-overs (#6920)
* Remove all core-CH left-overs

* Fix formatting

* Update CHANGELOG.md
2024-05-30 17:13:44 +02:00
Dennis Luxen
0ea757ed02
Remove unused header file (#6913) 2024-05-29 09:13:13 +02:00
Siarhei Fedartsou
c1ed73126d
Use std::variant instead of mapbox::util::variant (#6903) 2024-05-28 18:52:49 +02:00
Siarhei Fedartsou
1a6f4c44e7
Fix performance-type-promotion-in-math-fn clang-tidy warning (#6908) 2024-05-27 08:33:05 +02:00
Dennis Luxen
24646aada9
Remove outdated warnings (#6894) 2024-05-23 19:39:00 +02:00
Dennis Luxen
51b74a99aa
Avoid copy of std::function-based callback in path unpacking (#6895)
* Avoid copy of std::function-based callback in path unpacking

* Fix formatting

* Update CHANGELOG.md
2024-05-23 18:51:51 +02:00
Dennis Luxen
46dc660801
Replace boost::hash by std::hash (#6892)
* Replace boost::hash by std::hash

* Fix formatting

* Update CHANGELOG.md
2024-05-23 14:35:56 +02:00
Siarhei Fedartsou
d259848456
Optimise R-tree queries in the case of map matching (#6881) 2024-05-20 12:32:40 +02:00
Michael Bell
ffc39b8ad2
Clarify use of forcing routing steps (#6866)
The change clarifies the conditions for forcing routing steps and
simplifies the codebase to support it.

- Makes explicity  the search runtime condition for forcing a routing
step. Namely, the node is a source of the forward and reverse searches,
and it's one of the pre-identified nodes that requires a step to
be forced.
- Consolidate the two lists of force nodes into one. Not only is there
no algorithmic value in separating the nodes by geometric direction,
the  improvements to via-routes with u-turns mean atleast one of these
lists will be empty for any search.
- Rename 'force loop' to 'force step'. This moves the code away
from the original CH-specific language for checking for self-loops
in the case where this condition is met. MLD does not have loops.

Additional cucumber tests are added to cover the logic related to
negative search weights and forcing routing steps on via-route
paths.
2024-05-10 22:00:24 +01:00
Dennis Luxen
dff76d31d5
Remove dead code branches (#6875) 2024-05-10 20:21:41 +02:00
Dennis Luxen
7f9d591ab7
Upgrade clang-format to version 15 (#6859) 2024-05-06 09:14:46 +02:00
Michael Bell
8ef366e061
Add support for opposite approach request parameter (#6842)
* Added approach on the opposite side of the road.

* Additional test and docs coverage for opposite approach

---------

Co-authored-by: Aleksandrs Saveljevs <Aleksandrs.Saveljevs@gmail.com>
2024-04-03 19:59:15 +01:00
Matthew Wigginton Bhagat-Conway
d6afe91d8f
print tracebacks and line numbers for Lua runtime errors (#6564)
* print tracebacks and line numbers for Lua runtime errors

* revert format changes

* update changelog with lua traceback, #6564

* revert using protected_function for old GetStringListFromFunction and source_function #6564

* add unit test for line numbers in tracebacks, #6564

* apply clang-format (#6564)

* remove unused test helper function, #6564

* suppress leaksanitizer warnings in extract-tests, #6564

When the extractor encounters a lua runtime error, some osmium objects are not freed. In production this doesn't matter because these errors bring down OSRM. In the tests we catch them to ensure they occur, and the leaksanitizer flags them.
2023-03-23 19:18:58 +01:00
zephyr
ebd9ab4548
fix(json_render): json_render is not accurate enough for extremely sm… (#6531) 2023-02-02 18:58:25 +01: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
Dennis Luxen
f4189d9487 Fix formatting 2022-12-10 16:08:22 +01:00
Dennis Luxen
f983d626ac Merge remote-tracking branch 'origin/master' into dl_using_keyword 2022-12-10 16:02:53 +01:00
Siarhei Fedartsou
095b726a92
Use <boost/iterator/function_output_iterator.hpp> instead of deprecated <boost/function_output_iterator.hpp> (#6458) 2022-11-16 21:09:54 +01:00
Dennis Luxen
8bff55cd85 [CPP17] Modernize: Replace typedef with using statements 2022-11-06 13:21:45 +01:00
Dennis Luxen
7149547645 Fix formatting 2022-10-30 20:10:09 +01:00
Dennis Luxen
5c9d0d152c Remove usage of StringView typedef 2022-10-30 19:53:26 +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
fb1bb7a15b
Fix annotations=true handling in NodeJS bindings & libosrm (#6415) 2022-10-19 08:35:18 +02:00
Siarhei Fedartsou
9a4b4648f4
Improve performance of JSON rendering (#6380) 2022-10-03 21:43:51 +02:00
Siarhei Fedartsou
902bfc7806
Refactor CMake code related to compiler warnings, enable some additional warnings (#6355) 2022-09-30 11:42:36 +02:00
Michael Bell
b17cbb4c47
Support OSM traffic signal directions (#6153)
Currently OSRM parses traffic signal nodes without consideration
for the direction in which the signal applies. This can lead
to duplicated routing penalties, especially when a forward and backward
signal are in close proximity on a way.

This commit adds support for directed signals to the extraction and
graph creation. Signal penalties are only applied in the direction
specified by the OSM tag.

We add the assignment of traffic directions to the lua scripts,
maintaining backwards compatibility with the existing boolean
traffic states.

As part of the changes to the internal structures used for tracking
traffic signals during extraction, we stop serialising/deserialising
signals to the `.osrm` file. The traffic signals are only used by
`osrm-extract` so whilst this is a data format change, it will not
break any existing user processes.
2022-08-30 10:36:49 +01: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
Siarhei Fedartsou
91895604c9
Migrate to modern TBB version (#6300) 2022-08-24 18:13:49 +02:00
Michael Bell
a98074a051
Improvements to maneuver override processing (#6215)
This change unblocks the osrm-extract debug build, which is
currently failing on a maneuver override assertion.

The processing of maneuver overrides currently has three issues
- It assumes the via node(s) can't be compressed (the failing assertion)
- It can't handle via-paths containing incompressible nodes
- It doesn't interop with turn restriction on the same path

Turn restrictions and maneuver overrides both use the same
from-via-to path representation.
Therefore, we can fix these issues by consolidating their
structures and reusing the path representation for
turn restrictions, which already is robust to the above
issues.

This also simplifies some of the codebase by removing maneuver
override specific path processing.

There are ~100 maneuver overrides in the OSM database, so the
impact on processing and routing will be minimal.
2022-08-24 16:19:24 +01:00
Siarhei Fedartsou
8e74b7af9d
Enable performance-move-const-arg clang-tidy check (#6319) 2022-08-23 19:03:41 +02:00
Michael Bell
972a848094
Lazily generate optional route path data (#6045)
Currently route results are annotated with additional path information,
such as geometries, turn-by-turn steps and other metadata.

These annotations are generated if they are not requested or returned
in the response.
Datasets needed to generate these annotations are loaded and available
to the OSRM process even when unused.

This commit is a first step towards making the loading of these datasets
optional. We refactor the code so that route annotations are only
generated if explicitly requested and needed in the response.

Specifically, we change the following annotations to be lazily generated:
- Turn-by-turn steps
- Route Overview geometry
- Route segment metadata

For example. a /route/v1 request with
steps=false&overview=false&annotations=false
would no longer call the following data facade methods:
- GetOSMNodeIDOfNode
- GetTurnInstructionForEdgeID
- GetNameIndex
- GetNameForID
- GetRefForID
- GetTurnInstructionForEdgeID
- GetClassData
- IsLeftHandDriving
- GetTravelMode
- IsSegregated
- PreTurnBearing
- PostTurnBearing
- HasLaneData
- GetLaneData
- GetEntryClass

Requests that include segment metadata and/or overview geometry
but not turn-by-turn instructions will also benefit from this,
although there is some interdependency with the step instructions
- a call to GetTurnInstructionForEdgeID is still required.
Requests for OSM annotations will understandably still need to
call GetOSMNodeIDOfNode.

Making these changes unlocks the optional loading of data contained in
the following OSRM files:
- osrm.names
- osrm.icd
- osrm.nbg_nodes (partial)
- osrm.ebg_nodes (partial)
- osrm.edges
2022-08-22 12:59:20 +01:00
Michael Bell
b4b1aea567
Add support for non-round-trips with a single fixed endpoint (#6050)
Currently /trip supports finding round-trip routes where only the
start or end location is fixed. This PR extends this feature to
non-round-trip requests.

We do this by a new table manipulation that simulates non-round-trip
fixed endpoint requests as a round-trip request.
2022-08-22 12:56:47 +01:00
Siarhei Fedartsou
aadc088084
Fix distance calculation consistency. (#6315)
Consolidate great circle distance calculations to use cheap ruler library.
2022-08-19 22:31:40 +01:00
Siarhei Fedartsou
4e8ee288d9
Migrate to C++17. Update sol2 to 3.3.0. (#6279)
* Migrate to C++17. Update sol2 to 3.3.0.
2022-07-31 00:56:17 +01:00
Siarhei Fedartsou
06b1b980bb
Enable even more clang-tidy checks (#6273) 2022-07-04 21:46:59 +01:00
Siarhei Fedartsou
3d2db20777
Enable more clang-tidy checks. (#6270)
* Enable more clang-tidy checks
2022-06-30 14:32:12 +01:00
Michael Bell
04c2167c2d Fix for_each_indexed util function
- Fix typo in util function name for_each_indexed.
- Use the overloaded functions for_each_indexed and for_each_pair
  with a container argument where possible to improve readability.
2021-12-22 23:40:06 +00:00
Daniel Patterson
d5cd702242
Enable all unit tests (#5248)
* Add missing profile name to library extract test.

* Support both tzid and TZID properties on timezone geometry.  Improve validation of timezone polygons.

* Missing tzid property wasn't a geojson validation issue, shouldn't have been tested there.

* Use filesystem glob to loop over all test executables so we don't miss any in the future.

Co-authored-by: Michael Bell <michael@mjjbell.com>
2021-10-22 22:10:25 +01:00
Torben Hørup
b120c971a0
Make osrm-routed optional (#6144)
* Make osrm-routed optional

* Updated changelog

* require boost 1.60

* Update CMakeLists.txt

* Update CHANGELOG.md

Co-authored-by: Michael Bell <michael@mjjbell.com>
2021-10-08 17:06:55 +01:00
Michael Bell
f1f96166c5
Fix MLD level mask generation to support 64-bit masks. (#6123)
The generation of level masks for compactly storing partition cells
supports sizes that can be stored in 64 bits.

The current implementation fails if the total bit sum is 64 bits
exactly. A bit shift mechanism is used that is undefined when the
shift size is equal to the bit size of the underlying type. This
generates an incorrect mask value.

We fix this by adding a special case for a 64 bit offset. Given this
code is called at most |level| times, there will be no effect on
performance. We also update the assertions to reflect 64 bit masks
are now supported.
2021-09-21 18:09:38 +01:00
Michael Bell
971f0d3fe2 Format unit_tests 2021-09-03 18:35:01 +02:00