osrm-backend/src
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
..
benchmarks Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
contractor Do not depend on ADL 2022-01-10 11:28:43 +00:00
customize Enable more clang-tidy checks. (#6270) 2022-06-30 14:32:12 +01:00
engine Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
extractor Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
guidance Fix distance calculation consistency. (#6315) 2022-08-19 22:31:40 +01:00
nodejs Do not use deprecated Callback::Call overload in Node bindings (#6318) 2022-08-20 17:27:14 +01:00
osrm Add missing files in exception message (#5360) 2022-08-22 08:32:25 +02:00
partitioner Enable more clang-tidy checks. (#6270) 2022-06-30 14:32:12 +01:00
server Use Boost.Beast to parse HTTP request (#6294) 2022-08-02 21:12:05 +01:00
storage Add missing files in exception message (#5360) 2022-08-22 08:32:25 +02:00
tools Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
updater Pass osm_node_ids by reference in osrm::updater::Updater class (#6298) 2022-08-15 21:12:58 +01:00
util Fix distance calculation consistency. (#6315) 2022-08-19 22:31:40 +01:00