DriveWorks SDK Reference

| 0.6.67 Release

Map Initialization

Detailed Description

Functions to initialize, load and release map data.

Functions

DW_API_PUBLIC dwStatus dwMaps_initialize (dwMapHandle_t *mapHandle, const char *filename, dwContextHandle_t contextHandle)
 Creates a map handle and initializes the map data by deserializing a driveworks maps file. More...
 
DW_API_PUBLIC dwStatus dwMaps_initializeHERE (dwMapHandle_t *mapHandle, const dwMapsHEREConnectionParameters *params, const char *HEREMapCacheFile, float32_t splinePointSpacing, uint32_t maxRoadSegmentCount, dwContextHandle_t contextHandle)
 Creates a map handle for HERE maps data. More...
 
DW_API_PUBLIC dwStatus dwMaps_initializeTomTom (dwMapHandle_t *mapHandle, const char *file, uint32_t maxRoadSegmentCount, dwContextHandle_t contextHandle)
 Creates a map handle for TomTom maps data. More...
 
DW_API_PUBLIC dwStatus dwMaps_release (dwMapHandle_t *mapHandle)
 Release map handle. More...
 
DW_API_PUBLIC dwStatus dwMaps_update (dwBool *updated, const dwMapsBounds *bounds, dwBool download, dwMapHandle_t mapHandle)
 Updates map cache with map data within given bounds. More...
 

Function Documentation

◆ dwMaps_initialize()

DW_API_PUBLIC dwStatus dwMaps_initialize ( dwMapHandle_t mapHandle,
const char *  filename,
dwContextHandle_t  contextHandle 
)

Creates a map handle and initializes the map data by deserializing a driveworks maps file.

Buffer sizes are allocated to fit the file content.

Note
: allocates memory.
Parameters
[out]mapHandlemapHandle to be initialized
[in]filenamepath to driveworks maps file
[in]contextHandledriveworks context
Returns
DW_SUCCESS Map handle is successfully initialized.
DW_INVALID_ARGUMENT mapHandle, mapCacheFile is nullptr.
DW_FAILURE Error during maps backend access, or invalid enum encountered.
DW_FILE_INVALID Error loading file: not a valid driveworks maps file.

◆ dwMaps_initializeHERE()

DW_API_PUBLIC dwStatus dwMaps_initializeHERE ( dwMapHandle_t mapHandle,
const dwMapsHEREConnectionParameters params,
const char *  HEREMapCacheFile,
float32_t  splinePointSpacing,
uint32_t  maxRoadSegmentCount,
dwContextHandle_t  contextHandle 
)

Creates a map handle for HERE maps data.

Note
: allocates memory.
Parameters
[out]mapHandlemapHandle to be initialized
[in]paramsconnection parameter struct. optional, but necessary when updating HEREMapCacheFile.
[in]HEREMapCacheFilefile location for HERE map cache database
[in]splinePointSpacingSpacing of evaluated spline points
[in]maxRoadSegmentCountDefines the buffer sizes for map data storage.
[in]contextHandledriveworks context
Returns
DW_SUCCESS Map handle is successfully initialized.
DW_INVALID_ARGUMENT mapHandle, mapCacheFile is nullptr.
DW_FAILURE Error during maps backend access, or invalid enum encountered.

◆ dwMaps_initializeTomTom()

DW_API_PUBLIC dwStatus dwMaps_initializeTomTom ( dwMapHandle_t mapHandle,
const char *  file,
uint32_t  maxRoadSegmentCount,
dwContextHandle_t  contextHandle 
)

Creates a map handle for TomTom maps data.

Note
: allocates memory.
Parameters
[out]mapHandlemapHandle to be initialized
[in]filepath to a file containing the map data. xml and shp files are supported.
[in]maxRoadSegmentCountDefines the buffer sizes for map data storage.
[in]contextHandledriveworks context
Returns
DW_SUCCESS Map handle is successfully initialized.
DW_FILE_NOT_FOUND XML file not found.
DW_FILE_INVALID XML file does not have expected format.
DW_FAILURE Invalid enum encountered.
DW_INTERNAL_ERROR Unexpected internal sanity check failure.

◆ dwMaps_release()

DW_API_PUBLIC dwStatus dwMaps_release ( dwMapHandle_t mapHandle)

Release map handle.

Note
: Releases memory.
Parameters
[in,out]mapHandlemap handle to be released.
Returns
DW_SUCCESS Successfully released map object and handle.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_update()

DW_API_PUBLIC dwStatus dwMaps_update ( dwBool updated,
const dwMapsBounds bounds,
dwBool  download,
dwMapHandle_t  mapHandle 
)

Updates map cache with map data within given bounds.

Note
Allocates memory. Only implemented for HERE maps backend.
Parameters
[out]updatedOptional. DW_TRUE if some data has been updated, DW_FALSE otherwise.
[in]boundsBounds to specify which part of the map to update.
[in]downloadSpecify whether the local cache should be updated with remote data.
[in,out]mapHandleMap to get updated.
Returns
DW_SUCCESS Successfully updated map object with map data.
DW_FAILURE Error during maps backend access.
DW_BAD_CAST Could not successfully cast handle to map object.
DW_INVALID_ARGUMENT If 'bounds' parameter is a nullptr.