osrm-backend/include/engine/routing_algorithms
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
..
alternative_path.hpp Add abstraction to change the data facade at compile time 2017-07-17 11:40:55 +00:00
direct_shortest_path.hpp fallback to CH, when coreCH used 2017-10-13 14:53:49 +01:00
many_to_many.hpp Calculating durations is unavoidable due to tie-breaking minimums, but we can avoid accumulating distances if they're not requested. 2018-10-30 15:41:06 -07:00
map_matching.hpp Add abstraction to change the data facade at compile time 2017-07-17 11:40:55 +00:00
routing_base_ch.hpp format code 2020-11-25 12:42:01 +01:00
routing_base_mld.hpp Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
routing_base.hpp Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
shortest_path_impl.hpp Configure clang-tidy job on CI (#6261) 2022-06-28 00:14:28 +01:00
shortest_path.hpp Remove references to external sources 2017-08-14 16:18:36 +02:00
tile_turns.hpp Split intersection analysis and guidance code 2018-02-02 11:33:38 -05:00