As described in Map Request the Core Layer data is contained directly by the Map object returned as the result of a map request. Content Slice provides a complementary mechanism to access data-intensive Content Layer data per application and driving domain requirements.
Available Content Layers are obtained from the Map Provider interface.
As mentioned in Map Request, desired Content Layers may be specified when launching a map request, along with a geographic bounds or a planned route defined by WGS84 waypoints.
Completion of a map requests provides a data guarantee for the requested Content Layers, subject to availability for the requested Map. Map requests shall not fail in general due to limited coverage of requested Content Layers because we cannot guarantee full coverage for all layers, however local views into a Content Layers with sparse coverage may appear "empty" to the application.
This contract may change in future versions of the DriveWorks SDK, for example if applications are found to require complete coverage of requested Content Layers for safety reasons. Consuming code should not be harmed by this change if implemented, although more frequent map request failures may be observed for map requests in regions with limited Content Layer coverage.
The runtime mechanism for accessing Content Layers is called the Content Slice. This object is responsible for asynchronous retrieval of "layer slices" of selected Content Layers to provide local views into layer data for the client application.
Initialization of the Content Slice requires a list of Content Layers and a LocalLayout "scope" parameter defined as a maximum number of road segments per Local Layout. Those parameters are used internally to allocate memory as needed for the requested layers.
In the future we will add an explicit memory allocation cap to ContentSlice for improved control.
A typical application of ContentSlice is to retrieve local views of point clouds, localization images and other data-intensive content. Since these objects may not all be stored in memory for the full map, they are loaded from disk on demand and therefore accessed by asynchronous APIs.
The Content Slice object provides local view APIs to access the currently loaded content:
In order to load Content Layer data two objects are needed, Content Slice and Local Layout. Here is a partial use case for initialiation of these objects:
There is requirement for asynchronous updates, to avoid blocking the calling thread which in general may have real-time execution constraints. In addition it is required to use a polling API instead of callbacks to simplify application-side threading concerns.
This makes the full use for updating a Content Slice a bit complex: