DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Map Queries

Detailed Description

Functions to query map data.

Functions

DW_API_PUBLIC dwStatus dwMaps_getBounds (dwMapsBounds *bounds, dwConstMapHandle_t mapHandle)
 Get bounds of map data currently in memory. More...
 
DW_API_PUBLIC dwStatus dwMaps_getClosestLaneFromGeoPoint (const dwMapsLane **closestLane, dwMapsGeoPoint *closestPoint, const dwMapsGeoPoint *p, bool onlyDrivable, bool ignoreHeight, float32_t maxRadius, dwConstMapHandle_t mapHandle)
 Get closest lane in the map to a global gps point. More...
 
DW_API_PUBLIC dwStatus dwMaps_getClosestLaneFromLocalPoint (const dwMapsLane **closestLane, dwVector3f *closestPoint, const dwMapsRoadSegment *referenceRoadSegment, const dwVector3f *position, bool onlyDrivable, float32_t maxRadius, dwConstMapHandle_t mapHandle)
 Get closest lane in the map to a point in a local coordinate of a road segment. More...
 
DW_API_PUBLIC dwStatus dwMaps_getClosestLaneOnRoadSegment (const dwMapsLane **closestLane, dwVector3f *closestPoint, const dwMapsRoadSegment *referenceRoadSegment, const dwVector3f *position, bool onlyDrivable)
 Get closest lane on a road segment, given a position in coordinates of the same road segment. More...
 
DW_API_PUBLIC dwStatus dwMaps_getFeature (const dwMapsFeature **mapsFeature, const dwMapsFeatureId *id, dwConstMapHandle_t mapHandle)
 Get a map feature queried by a feature id. More...
 
DW_API_PUBLIC dwStatus dwMaps_getFeatures (dwMapsFeatureBuffer *features, uint32_t typeFilter, const dwMapsBounds *bounds, dwConstMapHandle_t mapHandle)
 Get features within bounds. More...
 
DW_API_PUBLIC dwStatus dwMaps_getLane (const dwMapsLane **lane, const dwMapsLaneId *id, dwConstMapHandle_t mapHandle)
 Get a lane queried by a lane id. More...
 
DW_API_PUBLIC dwStatus dwMaps_getLaneDividerGroup (const dwMapsLaneDividerGroup **laneDividerGroup, const dwMapsLaneDividerGroupId *id, dwConstMapHandle_t mapHandle)
 Get a lane divider group queried by a lane divider group id. More...
 
DW_API_PUBLIC dwStatus dwMaps_getLaneDividers (dwMapsLaneDividerBuffer *laneDividers, uint32_t typeFilter, const dwMapsBounds *bounds, dwConstMapHandle_t mapHandle)
 Get lane dividers within bounds. More...
 
DW_API_PUBLIC dwStatus dwMaps_getRoadSegment (const dwMapsRoadSegment **roadSegment, const dwMapsRoadSegmentId *id, dwConstMapHandle_t mapHandle)
 Get a road segment queried by a road segment id. More...
 
DW_API_PUBLIC dwStatus dwMaps_getRoadSegmentPointers (dwMapsRoadSegmentPointerBuffer *roadSegmentPointers, const dwMapsBounds *bounds, dwConstMapHandle_t mapHandle)
 Get pointers to road segments within bounds. More...
 
DW_API_PUBLIC dwStatus dwMaps_getRoadSegments (dwMapsRoadSegmentBuffer *roadSegments, const dwMapsBounds *bounds, dwConstMapHandle_t mapHandle)
 Get road segments within bounds. More...
 

Function Documentation

◆ dwMaps_getBounds()

DW_API_PUBLIC dwStatus dwMaps_getBounds ( dwMapsBounds bounds,
dwConstMapHandle_t  mapHandle 
)

Get bounds of map data currently in memory.

Parameters
[out]boundsBounds of map data currently in memory.
[in]mapHandleMap handle.
Returns
DW_SUCCESS Successfully returned bounds of map data.
DW_BAD_CAST Could not successfully cast handle to map object.
DW_INVALID_ARGUMENT 'bounds' is nullptr.

◆ dwMaps_getClosestLaneFromGeoPoint()

DW_API_PUBLIC dwStatus dwMaps_getClosestLaneFromGeoPoint ( const dwMapsLane **  closestLane,
dwMapsGeoPoint closestPoint,
const dwMapsGeoPoint p,
bool  onlyDrivable,
bool  ignoreHeight,
float32_t  maxRadius,
dwConstMapHandle_t  mapHandle 
)

Get closest lane in the map to a global gps point.

Parameters
[out]closestLaneOptional. Closest lane that has been found.
[out]closestPointOptional. Closest point on the closest lane.
[in]pQuery point
[in]onlyDrivableIf true, only drivable lanes are considered.
[in]ignoreHeightIf true, all points are projected onto height 0 before computing the distances.
[in]maxRadiusThe maximum radius around the current point to search for map data, in meters
[in]mapHandleMap to read from.
Returns
DW_SUCCESS Closest lane has been found
DW_NOT_AVAILABLE No lanes have been found around query point 'p'.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getClosestLaneFromLocalPoint()

DW_API_PUBLIC dwStatus dwMaps_getClosestLaneFromLocalPoint ( const dwMapsLane **  closestLane,
dwVector3f closestPoint,
const dwMapsRoadSegment referenceRoadSegment,
const dwVector3f position,
bool  onlyDrivable,
float32_t  maxRadius,
dwConstMapHandle_t  mapHandle 
)

Get closest lane in the map to a point in a local coordinate of a road segment.

Parameters
[out]closestLaneOptional. Closest lane that has been found.
[out]closestPointOptional. Closest point on the closest lane.
[in]referenceRoadSegmentRoad segment that defines the coordinate system of the provided position.
[in]positionQuery point in local coordinates
[in]onlyDrivableIf true, only drivable lanes are considered.
[in]maxRadiusThe maximum radius around the current point to search for map data, in meters
[in]mapHandleMap to read from.
Returns
DW_SUCCESS Closest lane has been found
DW_NOT_AVAILABLE No lanes have been found around query point 'position'.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getClosestLaneOnRoadSegment()

DW_API_PUBLIC dwStatus dwMaps_getClosestLaneOnRoadSegment ( const dwMapsLane **  closestLane,
dwVector3f closestPoint,
const dwMapsRoadSegment referenceRoadSegment,
const dwVector3f position,
bool  onlyDrivable 
)

Get closest lane on a road segment, given a position in coordinates of the same road segment.

Parameters
[out]closestLaneOptional. Closest lane that has been found.
[out]closestPointOptional. Closest point on the closest lane.
[in]referenceRoadSegmentRoad segment that defines the coordinate system of the provided position.
[in]positionQuery point in local coordinates
[in]onlyDrivableIf true, only drivable lanes are considered.
Returns
DW_SUCCESS Closest lane has been found
DW_NOT_AVAILABLE No lanes have been found around query point 'position'.
DW_BAD_CAST Could not successfully cast handle to map object.
Deprecated:
This method will be removed. Use dwMaps_getClosestLaneFromLocalPoint() instead.

◆ dwMaps_getFeature()

DW_API_PUBLIC dwStatus dwMaps_getFeature ( const dwMapsFeature **  mapsFeature,
const dwMapsFeatureId id,
dwConstMapHandle_t  mapHandle 
)

Get a map feature queried by a feature id.

Parameters
[out]mapsFeaturefeature whose id matches with 'id'. If not found, nullptr.
[in]idQuery feature ID.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS feature query successful.
DW_INVALID_ARGUMENT 'id' is a nullptr.
DW_NOT_AVAILABLE No feature found by the provided id.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getFeatures()

DW_API_PUBLIC dwStatus dwMaps_getFeatures ( dwMapsFeatureBuffer features,
uint32_t  typeFilter,
const dwMapsBounds bounds,
dwConstMapHandle_t  mapHandle 
)

Get features within bounds.

Feature is returned if at least one geometry point is within the provided bounds

Parameters
[in,out]featuresUser provided feature buffer.
[in]typeFilterCombination of dwMapsFeatureType values to filter the returned features by type.
[in]boundsQuery bounds. Defines the region of returned features. All data is returned if bounds is a nullptr.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS On success.
DW_INVALID_ARGUMENT 'features' is a nullptr or maxSize of 'features'
is not big enough.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getLane()

DW_API_PUBLIC dwStatus dwMaps_getLane ( const dwMapsLane **  lane,
const dwMapsLaneId id,
dwConstMapHandle_t  mapHandle 
)

Get a lane queried by a lane id.

Parameters
[out]laneLane whose id matches with 'id'. If not found, nullptr.
[in]idQuery lane ID.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS lane query successful.
DW_INVALID_ARGUMENT 'id' is a nullptr.
DW_NOT_AVAILABLE No lane found by the provided id.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getLaneDividerGroup()

DW_API_PUBLIC dwStatus dwMaps_getLaneDividerGroup ( const dwMapsLaneDividerGroup **  laneDividerGroup,
const dwMapsLaneDividerGroupId id,
dwConstMapHandle_t  mapHandle 
)

Get a lane divider group queried by a lane divider group id.

Parameters
[out]laneDividerGroupLane divider group whose id matches with 'id'. If not found, nullptr.
[in]idQuery lane divider group ID.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS Lane divider group query successful.
DW_INVALID_ARGUMENT 'id' is a nullptr.
DW_NOT_AVAILABLE No lane divider group found by the provided id.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getLaneDividers()

DW_API_PUBLIC dwStatus dwMaps_getLaneDividers ( dwMapsLaneDividerBuffer laneDividers,
uint32_t  typeFilter,
const dwMapsBounds bounds,
dwConstMapHandle_t  mapHandle 
)

Get lane dividers within bounds.

Some of the returned lane dividers may be outside of the bounds, but it is guaranteed that all lines within the bounds are returned.

Parameters
[in,out]laneDividersUser provided lane divider buffer.
[in]typeFilterCombination of dwMapsLaneDividerType values to filter the returned lane dividers by type.
[in]boundsQuery bounds. Defines the region of returned lane dividers. All data is returned if bounds is a nullptr.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS Lane divider query successful.
DW_INVALID_ARGUMENT 'laneDividers' is a nullptr or maxSize of 'laneDividers'
is not big enough.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getRoadSegment()

DW_API_PUBLIC dwStatus dwMaps_getRoadSegment ( const dwMapsRoadSegment **  roadSegment,
const dwMapsRoadSegmentId id,
dwConstMapHandle_t  mapHandle 
)

Get a road segment queried by a road segment id.

Parameters
[out]roadSegmentRoad segment whose id matches with 'id'. If not found, nullptr.
[in]idQuery road segment ID.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS Road segment query successful.
DW_INVALID_ARGUMENT 'id' is a nullptr.
DW_NOT_AVAILABLE No road segment found by the provided id.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getRoadSegmentPointers()

DW_API_PUBLIC dwStatus dwMaps_getRoadSegmentPointers ( dwMapsRoadSegmentPointerBuffer roadSegmentPointers,
const dwMapsBounds bounds,
dwConstMapHandle_t  mapHandle 
)

Get pointers to road segments within bounds.

Some of the road segments for the returned pointers may be outside of the bounds, but it is guaranteed that pointers to all road segments within the bounds are returned.

Parameters
[in,out]roadSegmentPointersUser provided road segment pointer buffer.
[in]boundsQuery bounds. Defines the region of returned lane divider lines. All data is returned if bounds is a nullptr.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS Road segment pointer query successful.
DW_INVALID_ARGUMENT 'roadSegmentPointers' is a nullptr, or maxSize of 'roadSegmentPointers' buffer is not big enough.
DW_INTERNAL_ERROR Unexpected internal sanity check failure.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMaps_getRoadSegments()

DW_API_PUBLIC dwStatus dwMaps_getRoadSegments ( dwMapsRoadSegmentBuffer roadSegments,
const dwMapsBounds bounds,
dwConstMapHandle_t  mapHandle 
)

Get road segments within bounds.

Some of the returned road segments may be outside of the bounds, but it is guaranteed that all road segments within the bounds are returned.

Parameters
[in,out]roadSegmentsUser provided road segment buffer.
[in]boundsQuery bounds. Defines the region of returned lane divider lines. All data is returned if bounds is a nullptr.
[in]mapHandleMap to read from.
Returns
DW_SUCCESS Road segment query successful.
DW_INVALID_ARGUMENT 'roadSegments' is a nullptr, or maxSize of 'roadSegments' buffer is not big enough.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.