osrm-backend/unit_tests
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
..
common Enable more clang-tidy checks. (#6270) 2022-06-30 14:32:12 +01:00
contractor Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
customizer Fix osrm-contract, tests, on Windows 2020-11-15 14:22:26 +00:00
engine Lazily generate optional route path data (#6045) 2022-08-22 12:59:20 +01:00
extractor Enable even more clang-tidy checks (#6273) 2022-07-04 21:46:59 +01:00
fixtures Implement raster source feature to read data from third-party sources, to be used in lua profiles. 2015-09-03 22:28:18 -07:00
library Add support for non-round-trips with a single fixed endpoint (#6050) 2022-08-22 12:56:47 +01:00
mocks Add support for multiple via-way restrictions (#5907) 2020-12-20 13:59:57 -08:00
partitioner Migrate to C++17. Update sol2 to 3.3.0. (#6279) 2022-07-31 00:56:17 +01:00
server Enable more clang-tidy checks. (#6270) 2022-06-30 14:32:12 +01:00
storage Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
updater Enable all unit tests (#5248) 2021-10-22 22:10:25 +01:00
util Fix distance calculation consistency. (#6315) 2022-08-19 22:31:40 +01:00
CMakeLists.txt Make osrm-routed optional (#6144) 2021-10-08 17:06:55 +01:00
contractor_tests.cpp Implement exclude flags on CH using shared core 2017-09-01 21:26:00 +02:00
customizer_tests.cpp Move customizer tests to own unit 2017-03-13 23:04:45 +00:00
engine_tests.cpp Remove license headers from project source files; global license 2016-01-04 19:06:32 +01:00
extractor_tests.cpp Remove license headers from project source files; global license 2016-01-04 19:06:32 +01:00
library_tests.cpp Library tests build system integration 2016-04-05 22:58:32 +02:00
partitioner_tests.cpp Rename namespace partition to partitioner 2018-02-02 11:07:18 +01:00
server_tests.cpp Add viaroute suport for new API 2016-04-05 22:58:32 +02:00
storage_tests.cpp First step towards reading/writing tar 2018-03-26 11:02:03 +00:00
updater_tests.cpp Refactor isThroughStreet/Intersection options (#4751) 2018-01-19 13:49:00 -05:00
util_tests.cpp Remove license headers from project source files; global license 2016-01-04 19:06:32 +01:00