osrm-backend/include/engine/guidance
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
..
assemble_geometry.hpp Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
assemble_leg.hpp Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
assemble_overview.hpp First round of lat,lng -> lng,lat switcheroo 2016-04-05 22:58:32 +02:00
assemble_route.hpp Format with clang-format 3.8 2016-05-27 21:05:04 +02:00
assemble_steps.hpp Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
collapse_scenario_detection.hpp access way names through RouteStep in post processing 2017-12-11 15:37:56 +00:00
collapse_turns.hpp Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
collapsing_utility.hpp Added post process logic to collapse segregated turn instructions (#4925) 2018-03-30 07:43:56 -04:00
lane_processing.hpp Trigger lane anticipation based on distance, see discussion in #4260 2017-07-18 11:23:46 +02:00
leg_geometry.hpp Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
post_processing.hpp Support maneuver relations (#4676) 2018-02-10 05:32:09 +11:00
postprocessing_toolkit.hpp Move guidance pre-processing code into GUIDANCE library 2018-02-02 11:33:38 -05:00
route_leg.hpp Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
route_step.hpp Support maneuver relations (#4676) 2018-02-10 05:32:09 +11:00
route.hpp Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
step_maneuver.hpp Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
verbosity_reduction.hpp deprecate use-lane -- the information can be found in the intersections array 2017-07-18 11:23:46 +02:00