DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Detailed Description

Utility functions for map data.

Various utility functions to deal with map data, including coordinate transformation, helpers to create input structs, etc.

Data Structures

struct  dwMapsLaneMerge
 Lane merge on a lane plan. More...
 
struct  dwMapsLaneMergeDetails
 Lane merge on a lane plan. More...
 
struct  dwMapsLaneSplit
 Lane split on a lane plan. More...
 
struct  dwMapsLaneSplitDetails
 Lane split on a lane plan. More...
 

Macros

#define DW_MAPS_INVALID_LANE_INDEX   99999999
 Value that represents an invalid lane index. More...
 

Enumerations

enum  dwMapsLaneEventType {
  DW_MAPS_LANEEVENTTYPE_NONE = 0,
  DW_MAPS_LANEEVENTTYPE_SPLIT = 1 << 0,
  DW_MAPS_LANEEVENTTYPE_MERGE = 1 << 1,
  DW_MAPS_LANEEVENTTYPE_BOTH = DW_MAPS_LANEEVENTTYPE_SPLIT | DW_MAPS_LANEEVENTTYPE_MERGE
}
 Lane event type indicates whether the next lane event is a lane split, a lane merge, or both. More...
 

Functions

DW_API_PUBLIC dwStatus dwMaps_closestPointOnPolyline (dwMapsGeoPoint *closestPoint, float64_t *distanceMeters, uint32_t *lineSegmentIndex, const dwMapsGeoPoint *p, const dwMapsGeoPolyline *polyline, bool ignoreHeight)
 Find closest point on a polyline of WGS84 points. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeBearingFromGeoPoints (float64_t *bearingRadian, const dwMapsGeoPoint *position, const dwMapsGeoPoint *headingPoint)
 Compute bearing in radian from two points. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeBearingFromRotation (float64_t *bearingRadian, const dwMatrix3d *localToENURotation33)
 Compute bearing in radian from localToENU rotation. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeBounds (dwMapsBounds *bounds, const dwMapsGeoPoint *p, float32_t radiusMeter)
 Compute WGS84 query bounds from position and radius in meters. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeBoundsSize (float32_t *width, float32_t *height, const dwMapsBounds *bounds)
 Compute width and height of bounds in meters. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeDistance (float64_t *distance, const dwMapsGeoPoint *p1, const dwMapsGeoPoint *p2)
 Compute Euclidean distance between two points. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeLocalToLocalTransform (dwTransformation3f *transform, const dwMapsGeoPoint *originSource, const dwMatrix3d *localToENURotationSource, const dwMapsGeoPoint *originTarget, const dwMatrix3d *localToENURotationTarget)
 Compute transform (translation and rotation) that changes a 3d point from one coordinate system to another. More...
 
DW_API_PUBLIC dwStatus dwMaps_computePolylineLength (float32_t *length, const dwMapsGeoPoint *points, uint32_t pointCount)
 Compute length of a polyline of wgs84 points in meters. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeRotationFromBearing (dwMatrix3d *localToENURotation33, float32_t bearingRadian)
 Create a rotation matrix that transfroms from a local coordinate system with x-axis pointing towards bearing into the ENU coordinate system. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeRotationFromGeoPoints (dwMatrix3d *localToENURotation33, const dwMapsGeoPoint *position, const dwMapsGeoPoint *headingPoint)
 Compute orientation matrix from two WGS84 points. More...
 
DW_API_PUBLIC dwStatus dwMaps_computeRotationFromLocalPoints (dwMatrix3d *localToENURotation33, const dwVector3f *position, const dwVector3f *headingPoint)
 Compute orientation matrix from two local points in an ENU space. More...
 
DW_API_PUBLIC dwStatus dwMaps_getConnectedToLocal (dwTransformation3f *connectedToLocal, const dwMapsLane *localLane, const dwMapsLane *connectedLane)
 Get coordinate transform to transform a point in connectedLane's coordinate system into the localLane's coordinate system. More...
 
DW_API_PUBLIC dwStatus dwMaps_getLaneChange (dwMapsSide *laneChangeSide, uint32_t *laneChangeCount, float32_t *laneChangeLength, const dwMapsLane *srcLane, const dwMapsLane *targetLane)
 Check if there's a valid lane change from one lane to another on the same road segment. More...
 
DW_API_PUBLIC dwStatus dwMaps_getLaneChangeAtGlobalPose (dwMapsSide *laneChangeSide, uint32_t *laneChangeCount, float32_t *laneChangeLength, const dwMapsLane *srcLane, const dwMapsLane *targetLane, const dwMapsGeoPoint *position, const dwMatrix3d *localToENURotation33)
 Check if there's a valid lane change from one lane to another on the same road segment. More...
 
DW_API_PUBLIC dwStatus dwMaps_getLaneChangeAtLocalPose (dwMapsSide *laneChangeSide, uint32_t *laneChangeCount, float32_t *laneChangeLength, const dwMapsLane *srcLane, const dwMapsLane *targetLane, const dwMapsRoadSegment *referenceRoadSegment, const dwVector3f *position, const dwMatrix3d *localToENURotation33)
 Check if there's a valid lane change from one lane to another on the same road segment. More...
 
DW_API_PUBLIC dwStatus dwMaps_getNeighborLane (const dwMapsLane **otherLane, const dwMapsLane *currentLane, dwMapsSide side, uint32_t offset, bool sideRelativeToDrivingDirection)
 Get a neighbor lane on a given side. More...
 
DW_API_PUBLIC dwStatus dwMaps_getNeighborLaneCount (uint32_t *laneCount, uint32_t *laneCountAccessible, const dwMapsLane *lane, dwMapsSide side, bool sideRelativeToDrivingDirection)
 Get the number of lanes on the current road segment next to a given lane. More...
 
DW_API_PUBLIC dwStatus dwMaps_getNextLaneEvent (dwMapsLaneEventType *type, dwMapsLaneSplitDetails *laneSplit, dwMapsLaneMergeDetails *laneMerge, float32_t *nextEventDist, const dwMapsLane *currentLane, const bool *forwardOnPolyline, float32_t maxDistance)
 Get the next lane split and/or lane merge. More...
 
DW_API_PUBLIC dwStatus dwMaps_getNextLaneSplitAtGlobalPose (dwMapsLaneSplitDetails *laneSplit, float32_t *laneSplitDistance, const dwMapsLane *currentLane, float32_t maxSearchDistance, const dwMapsGeoPoint *position, const dwMatrix3d *localToENURotation33)
 Get next lane split. More...
 
DW_API_PUBLIC dwStatus dwMaps_getNextLaneSplitAtLocalPose (dwMapsLaneSplitDetails *laneSplit, float32_t *laneSplitDistance, const dwMapsLane *currentLane, float32_t maxSearchDistance, const dwMapsRoadSegment *referenceRoadSegment, const dwVector3f *position, const dwMatrix3d *localToENURotation33)
 Get next lane split. More...
 
DW_API_PUBLIC dwStatus dwMaps_getPointAhead (dwMapsGeoPoint *pointAhead, const dwMapsGeoPoint *position, const dwMatrix3d *localToENURotation33, float32_t distance)
 Get wgs84 point moving forward from a position. More...
 
DW_API_PUBLIC dwStatus dwMaps_interpolatePolylines (uint32_t *srcStartIndex, uint32_t *targetEndIndex, dwMapsGeoPointBuffer *interpolatedPoints, const dwMapsGeoPoint *srcPoints, uint32_t srcPointCount, const dwMapsGeoPoint *targetPoints, uint32_t targetPointCount, float32_t start, float32_t end, float32_t stepSize, float32_t(*interpolationFn)(float32_t, void *), void *interpolationFnContext)
 Interpolate between 2 polylines. More...
 
DW_API_PUBLIC dwStatus dwMaps_isConnectionDrivable (bool *isDrivable, const dwMapsLane *lane, const dwMapsLaneConnection *connection)
 Check whether it is possible/allowed to drive from the given onto the given connection. More...
 
DW_API_PUBLIC dwStatus dwMaps_resamplePolyline (dwMapsGeoPointBuffer *result, const dwMapsGeoPolyline *polyline, float32_t stepSize)
 Resample a polyline of WGS84 points to a polyline with fixed step size. More...
 
DW_API_PUBLIC dwStatus dwMaps_stitchLaneGeometry (dwMapsPointBuffer *polyline, dwMapsLanePtrBuffer *perPointLanes, const dwMapsLane *lanes, uint32_t laneCount, dwMapsLaneGeometry geometrySelection)
 Stitches the polylines of a list of lanes into a single polyline. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformPoint (dwVector3f *transformedPoint, const dwMapsGeoPoint *point, const dwMapsGeoPoint *localOrigin, const dwMatrix3d *localToENURotation33)
 Transform a WGS84 point into a point in a local coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33'. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformPointReverse (dwMapsGeoPoint *transformedPoint, const dwVector3f *point, const dwMapsGeoPoint *localOrigin, const dwMatrix3d *localToENURotation33)
 Transform a point in a local coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33' to a WGS84 point. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformPolylines (dwMapsPointBuffer *transformedPoints, const dwMapsGeoPolyline *polylines, uint32_t polylineCount, const dwMapsGeoPoint *localOrigin, const dwMatrix3d *localToENURotation33)
 Transform polylines into points in a local coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33'. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformPolylinesReverse (dwMapsGeoPointBuffer *transformedPoints, const dwPolyline3f *polylines, uint32_t polylineCount, const dwMapsGeoPoint *localOrigin, const dwMatrix3d *localToENURotation33)
 Transform local space polylines into WGS84 point polylines. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformRoadFeaturesToLocalSpace (dwMapsPolyline3fBuffer *localPolylines, dwMapsPointBuffer *pointBuffer, const dwMapsFeatureBuffer *features, const dwMapsGeoPoint *localOrigin, const dwMatrix3d *localToENURotation33, const dwMapsLocalBounds *localBounds)
 Get geometry from the list of specified road features, transformed into a local cartesian coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33', optionally filtered by bounds in local coordinate system. More...
 

Data Structure Documentation

◆ dwMapsLaneMerge

struct dwMapsLaneMerge
Data Fields
dwMapsLaneMeta laneAfterMerge lane into which the lanes merge
uint32_t mergingLaneCount number of merging lanes
uint32_t mergingLaneIndex index of the connection that connects to the lane on the lane plan.

DW_MAPS_INVALID_LANE_INDEX if the information is not available.

◆ dwMapsLaneMergeDetails

struct dwMapsLaneMergeDetails
Data Fields
const dwMapsLane * laneAfterMerge lane into which the lanes merge
uint32_t mergingLaneCount number of merging lanes
uint32_t mergingLaneIndex index of the connection that connects to the lane on the lane plan.

DW_MAPS_INVALID_LANE_INDEX if the information is not available.

const dwMapsLaneConnection * mergingLanes[DW_MAPS_MAX_LANE_CONNECTIONS] connections leading from 'laneAfterMerge' into the merging lanes.

Sorted from left to right.

◆ dwMapsLaneSplit

struct dwMapsLaneSplit
Data Fields
dwMapsLaneMeta laneBeforeSplit lane that splits
float32_t laneChangeLengthAfterSplit lane change distance available after the split to go to the same lane if split is not executed at the split point.

In the case of splitCount > 2, the value represents the worst case

uint32_t splitCount number of lanes emerging from the lane before the split
uint32_t splitIndex index of the connection that follows the lane plan.

DW_MAPS_INVALID_LANE_INDEX if the information is not available.

◆ dwMapsLaneSplitDetails

struct dwMapsLaneSplitDetails
Data Fields
const dwMapsLane * laneBeforeSplit lane that splits
float32_t laneChangeLengthAfterSplit lane change distance available after the split to go to the same lane if split is not executed at the split point.

In the case of splitCount > 2, the value represents the worst case

uint32_t splitCount number of lanes emerging from the lane before the split
uint32_t splitIndex index of the connection that follows the lane plan.

DW_MAPS_INVALID_LANE_INDEX if the information is not available.

const dwMapsLaneConnection * splitLanes[DW_MAPS_MAX_LANE_CONNECTIONS] list of connections leading into the new lanes.

Sorted from left to right.

Macro Definition Documentation

◆ DW_MAPS_INVALID_LANE_INDEX

#define DW_MAPS_INVALID_LANE_INDEX   99999999

Value that represents an invalid lane index.

Definition at line 1548 of file Maps.h.

Enumeration Type Documentation

◆ dwMapsLaneEventType

Lane event type indicates whether the next lane event is a lane split, a lane merge, or both.

Enumerator
DW_MAPS_LANEEVENTTYPE_NONE 
DW_MAPS_LANEEVENTTYPE_SPLIT 
DW_MAPS_LANEEVENTTYPE_MERGE 
DW_MAPS_LANEEVENTTYPE_BOTH 

Definition at line 1553 of file Maps.h.

Function Documentation

◆ dwMaps_closestPointOnPolyline()

DW_API_PUBLIC dwStatus dwMaps_closestPointOnPolyline ( dwMapsGeoPoint closestPoint,
float64_t distanceMeters,
uint32_t *  lineSegmentIndex,
const dwMapsGeoPoint p,
const dwMapsGeoPolyline polyline,
bool  ignoreHeight 
)

Find closest point on a polyline of WGS84 points.

Parameters
[out]closestPointClosest point on polyline. Can be nullptr if result not needed.
[out]distanceMetersDistance between the query point and the closest point. Can be nullptr if result not needed.
[out]lineSegmentIndexIndex of the line segment of the polyline (polyline point with smaller index) Can be nullptr if result not needed.
[in]pQuery point.
[in]polylinePolyline on which to search for the closest point.
[in]ignoreHeightIf true, distances are calculated after projection to height 0.
Returns
DW_SUCCESS Successfully found closest point. DW_INVALID_ARGUMENT 'p' or 'polyline' is a nullptr, or the polyline has less than 2 points.

◆ dwMaps_computeBearingFromGeoPoints()

DW_API_PUBLIC dwStatus dwMaps_computeBearingFromGeoPoints ( float64_t bearingRadian,
const dwMapsGeoPoint position,
const dwMapsGeoPoint headingPoint 
)

Compute bearing in radian from two points.

'bearingRadian' is the angle relative to 'north' direction, increasing clockwise from 0 to 2*Pi.

Parameters
[out]bearingRadianBearing pointing towards 'headingPoint' at given 'position'.
[in]positionPosition at which the bearing is computed.
[in]headingPointSecond point that defines the direction bearing is pointing towards.
Returns
DW_SUCCESS Successfully computed bearing.
DW_INVALID_ARGUMENT One or more parameters is a nullptr.

◆ dwMaps_computeBearingFromRotation()

DW_API_PUBLIC dwStatus dwMaps_computeBearingFromRotation ( float64_t bearingRadian,
const dwMatrix3d localToENURotation33 
)

Compute bearing in radian from localToENU rotation.

'bearingRadian' is the angle relative to 'north' direction, increasing clockwise from 0 to 2*Pi.

Parameters
[out]bearingRadianResulting bearing.
[in]localToENURotation33Rotation matrix that transforms from a right-handed local coordinate system with x-axis pointing towards 'bearing' and z-axis pointing up, into a local cartesian coordinate system with x-axis pointing east and y-axis pointing north) (east-north-up, ENU).
Returns
DW_SUCCESS Successfully computed bearing rotation matrix.
DW_INVALID_ARGUMENT 'bearingRadian' or 'localToENURotation33 is a nullptr'. DW_NOT_AVAILABLE Bearing is not defined if 'localToENURotation33' rotates the forward vector into the up or down vector of ENU space.

◆ dwMaps_computeBounds()

DW_API_PUBLIC dwStatus dwMaps_computeBounds ( dwMapsBounds bounds,
const dwMapsGeoPoint p,
float32_t  radiusMeter 
)

Compute WGS84 query bounds from position and radius in meters.

Parameters
[out]boundsComputed bounds
[in]pCenter point of query circle
[in]radiusMeterRadius in meters that the bounds need to cover. The Radius is a geodesic system on the earth sphere surface.
Returns
DW_SUCCESS Successfully computed maps bounds for given circle on earth sphere.
DW_INVALID_ARGUMENT 'bounds' or 'p' is a nullptr.

◆ dwMaps_computeBoundsSize()

DW_API_PUBLIC dwStatus dwMaps_computeBoundsSize ( float32_t width,
float32_t height,
const dwMapsBounds bounds 
)

Compute width and height of bounds in meters.

Compute the width and height of given maps bounds (defined by wgs84 coordinates). Computed width and height are euclidean distances of the outermost bound points (not the distance along the sphere surface).

Parameters
[out]widthLongest east-west distance within bounds in meters.
[out]heightLongest north-south distance within bounds in meters.
[in]boundsMaps bounds defined in wgs84 coordinates.
Returns
DW_SUCCESS Successfully compute widht and height of bounds.
DW_INVALID_ARGUMENT One or more parameters are a nullptr.

◆ dwMaps_computeDistance()

DW_API_PUBLIC dwStatus dwMaps_computeDistance ( float64_t distance,
const dwMapsGeoPoint p1,
const dwMapsGeoPoint p2 
)

Compute Euclidean distance between two points.

Parameters
[out]distanceEuclidean distance between the two points
[in]p1First point
[in]p2Second point
Returns
DW_SUCCESS Successfully computed distance DW_INVALID_ARGUMENT One or more parameters are a nullptr.

◆ dwMaps_computeLocalToLocalTransform()

DW_API_PUBLIC dwStatus dwMaps_computeLocalToLocalTransform ( dwTransformation3f transform,
const dwMapsGeoPoint originSource,
const dwMatrix3d localToENURotationSource,
const dwMapsGeoPoint originTarget,
const dwMatrix3d localToENURotationTarget 
)

Compute transform (translation and rotation) that changes a 3d point from one coordinate system to another.

Both source and target coordinate systems are defined by a geo point and a local to ENU Rotation matrix.

Parameters
[out]transformResulting transform.
[in]originSourceOrigin of the source coordinate system
[in]localToENURotationSourceLocal to ENU rotation of the source coordinate system. If this is NULL, it is interpreted as Identity, thus ENU at origin1.
[in]originTargetOrigin of the target coordinate system
[in]localToENURotationTargetLocal to ENU rotation of the target coordinate system. If this is NULL, it is interpreted as Identity, thus ENU at origin2.
Returns
DW_SUCCESS Successfully transformed 'point' into coordinate system with origin at origin2.
DW_INVALID_ARGUMENT 'transform', 'origin1' or 'origin2' is a nullptr.

◆ dwMaps_computePolylineLength()

DW_API_PUBLIC dwStatus dwMaps_computePolylineLength ( float32_t length,
const dwMapsGeoPoint points,
uint32_t  pointCount 
)

Compute length of a polyline of wgs84 points in meters.

Parameters
[out]lengthResulting polyline length.
[in]pointsPointer to polyline point array.
[in]pointCountNumber of points in polyline.
Returns
DW_SUCCESS Successfully computed polyline length DW_INVALID_ARGUMENT 'length' or 'points' is a nullptr.

◆ dwMaps_computeRotationFromBearing()

DW_API_PUBLIC dwStatus dwMaps_computeRotationFromBearing ( dwMatrix3d localToENURotation33,
float32_t  bearingRadian 
)

Create a rotation matrix that transfroms from a local coordinate system with x-axis pointing towards bearing into the ENU coordinate system.

Parameters
[out]localToENURotation33Rotation matrix that transforms from a right-handed local coordinate system with x-axis pointing towards 'bearing' and z-axis pointing up, into a local cartesian coordinate system with x-axis pointing east and y-axis pointing north) (east-north-up, ENU).
[in]bearingRadianBearing in radian.
Returns
DW_SUCCESS Successfully computed rotation matrix.
DW_INVALID_ARGUMENT 'localToENURotation33 is a nullptr'.

◆ dwMaps_computeRotationFromGeoPoints()

DW_API_PUBLIC dwStatus dwMaps_computeRotationFromGeoPoints ( dwMatrix3d localToENURotation33,
const dwMapsGeoPoint position,
const dwMapsGeoPoint headingPoint 
)

Compute orientation matrix from two WGS84 points.

Parameters
[out]localToENURotation33Rotation matrix that rotates from a right-handed local coordinate system with x-axis pointing towards the specified direction into a local cartesian coordinate system with x-axis pointing east and y-axis pointing north) (east-north-up, ENU).
[in]positionFirst point to describe heading direction
[in]headingPointSecond point to describe heading direction
Returns
DW_SUCCESS Successfully computed rotation matrix.
DW_INVALID_ARGUMENT One of the arguments is a nullptr'

◆ dwMaps_computeRotationFromLocalPoints()

DW_API_PUBLIC dwStatus dwMaps_computeRotationFromLocalPoints ( dwMatrix3d localToENURotation33,
const dwVector3f position,
const dwVector3f headingPoint 
)

Compute orientation matrix from two local points in an ENU space.

Parameters
[out]localToENURotation33Rotation matrix that rotates from a right-handed local coordinate system with x-axis pointing towards the specified into a local cartesian coordinate system with x-axis pointing east and y-axis pointing north) (east-north-up, ENU).
[in]positionFirst point to describe heading direction
[in]headingPointSecond point to describe heading direction
Returns
DW_SUCCESS Successfully computed rotation matrix.
DW_INVALID_ARGUMENT One of the arguments is a nullptr'

◆ dwMaps_getConnectedToLocal()

DW_API_PUBLIC dwStatus dwMaps_getConnectedToLocal ( dwTransformation3f connectedToLocal,
const dwMapsLane localLane,
const dwMapsLane connectedLane 
)

Get coordinate transform to transform a point in connectedLane's coordinate system into the localLane's coordinate system.

The transformation is stored in the corresponding dwMapsRoadSegmentConnection. This function looks for the that connection and returns the transform if found.

Parameters
connectedToLocal
localLane
connectedLane
Returns
DW_SUCCESS Successfully returned transformation.
DW_NOT_AVAILABLE No connection found for localLane and connectedLane.
DW_INVALID_ARGUMENT One or more parameters are a nullptr.

◆ dwMaps_getLaneChange()

DW_API_PUBLIC dwStatus dwMaps_getLaneChange ( dwMapsSide laneChangeSide,
uint32_t *  laneChangeCount,
float32_t laneChangeLength,
const dwMapsLane srcLane,
const dwMapsLane targetLane 
)

Check if there's a valid lane change from one lane to another on the same road segment.

Parameters
[out]laneChangeSideSide of the lane change in geometry direction. Can be a nullptr if this result is not needed.
[out]laneChangeCountNumber of lane changes needed to get from source to target lane. Can be a nullptr if this result is not needed.
[in,out]laneChangeLengthInput: search distance limit for the lane change length Output: length of stretch where the lane to the destination lane is possible Can be a nullptr if this result is not needed.
[in]srcLaneSource lane.
[in]targetLaneTarget lane.
Returns
DW_SUCCESS There is a valid lane change to get from source to target lane.
DW_INVALID_ARGUMENT 'srcLane' or 'targetLane' is a nullptr
DW_NOT_AVAILABLE Lane change from source to target lane not possible.

◆ dwMaps_getLaneChangeAtGlobalPose()

DW_API_PUBLIC dwStatus dwMaps_getLaneChangeAtGlobalPose ( dwMapsSide laneChangeSide,
uint32_t *  laneChangeCount,
float32_t laneChangeLength,
const dwMapsLane srcLane,
const dwMapsLane targetLane,
const dwMapsGeoPoint position,
const dwMatrix3d localToENURotation33 
)

Check if there's a valid lane change from one lane to another on the same road segment.

Position and orientation in absolute coordinates are used to figure out the driving direction on the lane.

Parameters
[out]laneChangeSideSide of the lane change. Relative to driving direction. Can be a nullptr if this result is not needed.
[out]laneChangeCountNumber of lane changes needed to get from source to target lane. Can be a nullptr if this result is not needed.
[in,out]laneChangeLengthInput: search distance limit for the lane change length Output: length of stretch where the change to the destination lane is possible. Can be a nullptr if this result is not needed.
[in]srcLaneSource lane.
[in]targetLaneTarget lane.
[in]positionCurrent position.
[in]localToENURotation33Current orientation. 3x3 Rotation matrix that rotates from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'position' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'position'.
Returns
DW_SUCCESS There is a valid lane change to get from source to target lane.
DW_INVALID_ARGUMENT 'srcLane', 'targetLane', 'position' or 'localToENURotation33' is a nullptr
DW_NOT_AVAILABLE Lane change from source to target lane not possible.

◆ dwMaps_getLaneChangeAtLocalPose()

DW_API_PUBLIC dwStatus dwMaps_getLaneChangeAtLocalPose ( dwMapsSide laneChangeSide,
uint32_t *  laneChangeCount,
float32_t laneChangeLength,
const dwMapsLane srcLane,
const dwMapsLane targetLane,
const dwMapsRoadSegment referenceRoadSegment,
const dwVector3f position,
const dwMatrix3d localToENURotation33 
)

Check if there's a valid lane change from one lane to another on the same road segment.

Position and orientation in local coordinates relative to the referenceRoadSegments ENU space are used to figure out the driving direction on the lane.

Parameters
[out]laneChangeSideSide of the lane change. Relative to driving direction. Can be a nullptr if this result is not needed.
[out]laneChangeCountNumber of lane changes needed to get from source to target lane. Can be a nullptr if this result is not needed.
[in,out]laneChangeLengthInput: search distance limit for the lane change length Output: length of stretch where the change to the destination lane is possible. Can be a nullptr if this result is not needed.
[in]srcLaneSource lane.
[in]targetLaneTarget lane.
[in]referenceRoadSegmentRoad segment that defines the coordinate system of provided position and orientation.
[in]positionCurrent position, in coordinate system of referenceRoadSegment.
[in]localToENURotation33Current orientation. 3x3 Rotation matrix that rotates from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'referenceRoadSegment->origin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at 'referenceRoadSegment->origin'.
Returns
DW_SUCCESS There is a valid lane change to get from source to target lane.
DW_INVALID_ARGUMENT 'srcLane', 'targetLane', 'position' or 'localToENURotation33' is a nullptr
DW_NOT_AVAILABLE Lane change from source to target lane not possible.

◆ dwMaps_getNeighborLane()

DW_API_PUBLIC dwStatus dwMaps_getNeighborLane ( const dwMapsLane **  otherLane,
const dwMapsLane currentLane,
dwMapsSide  side,
uint32_t  offset,
bool  sideRelativeToDrivingDirection 
)

Get a neighbor lane on a given side.

Parameters
[out]otherLaneNeighbor lane.
[in]currentLaneQuery lane
[in]sideDW_MAPS_SIDE_LEFT or DW_MAPS_SIDE_RIGHT
[in]offsetOffset defines which neighbor lane is requested, e.g. offset 1 is the direct neighbor, offset 2 is the next one, etc.
[in]sideRelativeToDrivingDirectionIf true, the side is relative to the driving direction of the query lane. This means it is only defined if the lane has driving direction DW_MAPS_DIRECTION_FORWARD or DW_MAPS_DIRECTION_BACKWARD. Otherwise, the semantics of 'side' is relative to the geometry polyline direction.
Returns
DW_SUCCESS Neighbor lane has been successfully returned.
DW_INVALID_ARGUMENT 'side' may not be DW_MAPS_SIDE_NONE.
DW_NOT_AVAILABLE no neighbor has been found with the provided parameters.

◆ dwMaps_getNeighborLaneCount()

DW_API_PUBLIC dwStatus dwMaps_getNeighborLaneCount ( uint32_t *  laneCount,
uint32_t *  laneCountAccessible,
const dwMapsLane lane,
dwMapsSide  side,
bool  sideRelativeToDrivingDirection 
)

Get the number of lanes on the current road segment next to a given lane.

Parameters
[out]laneCountOptional. Total number of lanes on requested side.
[out]laneCountAccessibleOptional. Accessible number of lanes on requested side. A Lane is accessible when a lane change from the query lane to a neighbor lane is possible.
[in]laneQuery lane
[in]sideDW_MAPS_SIDE_LEFT or DW_MAPS_SIDE_RIGHT
[in]sideRelativeToDrivingDirectionIf true, the side is relative to the driving direction of the query lane. This means it is only defined if the lane has driving direction DW_MAPS_DIRECTION_FORWARD or DW_MAPS_DIRECTION_BACKWARD. Otherwise, the semantics of 'side' is relative to the geometry polyline direction.
Returns
DW_SUCCESS Lane counts have been returned successfully
DW_INVALID_ARGUMENT 'side' may not be DW_MAPS_SIDE_NONE

◆ dwMaps_getNextLaneEvent()

DW_API_PUBLIC dwStatus dwMaps_getNextLaneEvent ( dwMapsLaneEventType type,
dwMapsLaneSplitDetails laneSplit,
dwMapsLaneMergeDetails laneMerge,
float32_t nextEventDist,
const dwMapsLane currentLane,
const bool *  forwardOnPolyline,
float32_t  maxDistance 
)

Get the next lane split and/or lane merge.

Walk along the 'currentLane' up to a maximum distance and return first lane split or lane merge along the way. The walking direction (forward/backward) on the lane polyline can be provided optionally. If it is not provided, it is derived from the driving direction of 'currentLane', however this will fail if currentLane is drivable in both directions.

It is possible that the same point along the way there is both a split and merge. In that case both are returned and the type is set to DW_MAPS_LANEEVENTTYPE_BOTH.

When the next lane event is a lane split, but the next lane merge is required, the search can be continued by repeating the call, using each split lane as 'currentLane'.

Parameters
[out]typeNone, lane split, lane merge, or both.
[out]laneSplitStruct to contain the resulting lane split.
[out]laneMergeStruct to contain the resulting lane merge.
[out]nextEventDistDistance to where the next lane action (change/split) takes place.
[in]currentLaneLane where the search for the next lane event is started.
[in]forwardOnPolylineDefined in which direction the search happens. If nullptr, the direction is along the lane's driving direction (not that this will fail if the lane is drivable both ways.
[in]maxDistanceDistance at which the the search for the next lane event is stopped.
Returns
DW_SUCCESS Successfully finished the search ('type' contains the result type) DW_INVALID_ARGUMENT 'type', 'laneSplit', 'laneMerge', or 'currentLane' is a nullptr. DW_INTERNAL_ERROR In case of an internal problem, should not happen. DW_NOT_AVAILABLE 'forwardOnPolyline' is a nullptr and 'currentLane' does not have a driving direction defined.

◆ dwMaps_getNextLaneSplitAtGlobalPose()

DW_API_PUBLIC dwStatus dwMaps_getNextLaneSplitAtGlobalPose ( dwMapsLaneSplitDetails laneSplit,
float32_t laneSplitDistance,
const dwMapsLane currentLane,
float32_t  maxSearchDistance,
const dwMapsGeoPoint position,
const dwMatrix3d localToENURotation33 
)

Get next lane split.

Current pose defined in global coordinates.

  • The pose is required to compute the exact distance, and to get the orientation on the current lane.
Parameters
laneSplitNext split.
laneSplitDistanceDistance of next lane split from current pose.
currentLaneCurrent lane where the split search starts.
maxSearchDistanceMaximum distance to search for a split.
positionPosition relative to the reference road segment.
localToENURotation333x3 Rotation matrix that rotates from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'referenceRoadSegment->origin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'referenceRoadSegment->origin'.
Returns
DW_SUCCESS Successfully finished the search, a lane split was found. DW_INVALID_ARGUMENT At least one of the arguments is a nullptr. DW_NOT_AVAILABLE No lane split was found.

◆ dwMaps_getNextLaneSplitAtLocalPose()

DW_API_PUBLIC dwStatus dwMaps_getNextLaneSplitAtLocalPose ( dwMapsLaneSplitDetails laneSplit,
float32_t laneSplitDistance,
const dwMapsLane currentLane,
float32_t  maxSearchDistance,
const dwMapsRoadSegment referenceRoadSegment,
const dwVector3f position,
const dwMatrix3d localToENURotation33 
)

Get next lane split.

Current pose defined in local coordinates.

The pose is required to compute the exact distance, and to get the orientation on the current lane.

Parameters
laneSplitNext split.
laneSplitDistanceDistance of next lane split from current pose.
currentLaneCurrent lane where the split search starts.
maxSearchDistanceMaximum distance to search for a split.
referenceRoadSegmentRoad segment the current pose refers to.
positionPosition relative to the reference road segment.
localToENURotation333x3 Rotation matrix that rotates from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'referenceRoadSegment->origin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'referenceRoadSegment->origin'.
Returns
DW_SUCCESS Successfully finished the search, a lane split was found. DW_INVALID_ARGUMENT At least one of the arguments is a nullptr. DW_NOT_AVAILABLE No lane split was found.

◆ dwMaps_getPointAhead()

DW_API_PUBLIC dwStatus dwMaps_getPointAhead ( dwMapsGeoPoint pointAhead,
const dwMapsGeoPoint position,
const dwMatrix3d localToENURotation33,
float32_t  distance 
)

Get wgs84 point moving forward from a position.

Parameters
[out]pointAheadResulting wgs84 point ahead.
[in]positionSource position.
[in]localToENURotation33Rotation matrix that defines the orientation.
[in]distanceDistance to move forward from source position.
Returns
DW_SUCCESS Successfully returned point ahead.
DW_INVALID_ARGUMENT One of the arguments is a nullptr.

◆ dwMaps_interpolatePolylines()

DW_API_PUBLIC dwStatus dwMaps_interpolatePolylines ( uint32_t *  srcStartIndex,
uint32_t *  targetEndIndex,
dwMapsGeoPointBuffer interpolatedPoints,
const dwMapsGeoPoint srcPoints,
uint32_t  srcPointCount,
const dwMapsGeoPoint targetPoints,
uint32_t  targetPointCount,
float32_t  start,
float32_t  end,
float32_t  stepSize,
float32_t(*)(float32_t, void *)  interpolationFn,
void *  interpolationFnContext 
)

Interpolate between 2 polylines.

This function interpolates between two polylines, creating a smooth polyline that connects the source polyline to the target polyline. The interpolation starts at 'start' on the source polyline and ends at 'end' of the target polyline. These values are defined in meters along the source and target polylines. Between 'start' and 'end', at each step, defined by 'stepSize', a new interpolated point is added to the result polyline.

Parameters
[out]srcStartIndexIndex into the source polyline. First point before the interpolation.
[out]targetEndIndexindex into the target polyline. First point after the interpolation.
[in,out]interpolatedPointsUser buffer to store the interpolation result.
[in]srcPointsSource polyline.
[in]srcPointCountNumber of points in source polyline.
[in]targetPointsTarget polyline.
[in]targetPointCountNumber of points in the target polyline.
[in]startDefines where on the source polyline the interpolation starts. In meters.
[in]endDefines where on the target polyline the interpolation stops. In meters.
[in]stepSizeDefines the resolution of the resulting interpolation polyline. In meters.
[in]interpolationFnCallback to define the interpolation function. Argument to the function is a value between 0.0f and 1.0f that correspond to positions on the source and target lanes between 'start' and 'end'. The function should return a value between 0.0f and 1.0f, defining the weight of the source lane at that point. If nullptr, linear interpolation is applied.
[in]interpolationFnContextOptional user data that is passed on to the interpolation function callback.
Returns
DW_SUCCESS Successfully interpolated.
DW_INVALID_ARGUMENT Interpolation was not possible with given 'start' and 'end' values, or input polylines are invalid.

◆ dwMaps_isConnectionDrivable()

DW_API_PUBLIC dwStatus dwMaps_isConnectionDrivable ( bool *  isDrivable,
const dwMapsLane lane,
const dwMapsLaneConnection connection 
)

Check whether it is possible/allowed to drive from the given onto the given connection.

A connection is drivable if

  • both lane and the connected lane are drivable
  • lane and its connection has the same driving direction or one or both are drivable in both directions
Parameters
[out]isDrivableResult
[in]laneSource lane.
[in]connectionConnection to be checked.
Returns
DW_SUCCESS Successfully returned the isDrivable result;
DW_INVALID_ARGUMENT one of the parameters is null.

◆ dwMaps_resamplePolyline()

DW_API_PUBLIC dwStatus dwMaps_resamplePolyline ( dwMapsGeoPointBuffer result,
const dwMapsGeoPolyline polyline,
float32_t  stepSize 
)

Resample a polyline of WGS84 points to a polyline with fixed step size.

Parameters
[out]resultUser provided buffer to hold the resulting resampled polyline point.
[in]polylineInput polyline to resample.
[in]stepSizeDistance in meters between resampled points.
Returns
DW_SUCCESS Successfully resampled polyline. DW_INVALID_ARGUMENT 'result' or 'polyline', or stepSize is not positive. DW_BUFFER_FULL Result buffer not big enouhg.

◆ dwMaps_stitchLaneGeometry()

DW_API_PUBLIC dwStatus dwMaps_stitchLaneGeometry ( dwMapsPointBuffer polyline,
dwMapsLanePtrBuffer perPointLanes,
const dwMapsLane lanes,
uint32_t  laneCount,
dwMapsLaneGeometry  geometrySelection 
)

Stitches the polylines of a list of lanes into a single polyline.

Parameters
[in,out]polylineUser provided wgs84 point buffer that gets filled with the result.
[in,out]perPointLanesdwMapsLane for each point. Can be nullptr if not needed.
[in]lanesList of connected lanes.
[in]laneCountNumber of connected lanes.
[in]geometrySelectionSelects geometry of the lane to be stitched.
Returns
DW_SUCCESS Successfully return a stitched polyline for the input lanes. DW_NOT_AVAILABLE Could not successfully stitch the geometry of all lanes in the provided list. This can happen if some lanes in the list don't refer to a lane divider. DW_INVALID_ARGUMENT polyline of lanes is a nullptr.

◆ dwMaps_transformPoint()

DW_API_PUBLIC dwStatus dwMaps_transformPoint ( dwVector3f transformedPoint,
const dwMapsGeoPoint point,
const dwMapsGeoPoint localOrigin,
const dwMatrix3d localToENURotation33 
)

Transform a WGS84 point into a point in a local coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33'.

Parameters
[out]transformedPointResulting local space point.
[in]pointWGS84 point.
[in]localOriginWGS84 coordinate point, origin of the local coordinate system.
[in]localToENURotation333x3 Rotation matrix that transforms from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'localOrigin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'localOrigin'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
Returns
DW_SUCCESS Successfully transformed 'point' into euclidean local space.
DW_INVALID_ARGUMENT 'transformedPoint', 'point' or 'localOrigin' is a nullptr.

◆ dwMaps_transformPointReverse()

DW_API_PUBLIC dwStatus dwMaps_transformPointReverse ( dwMapsGeoPoint transformedPoint,
const dwVector3f point,
const dwMapsGeoPoint localOrigin,
const dwMatrix3d localToENURotation33 
)

Transform a point in a local coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33' to a WGS84 point.

Parameters
[out]transformedPointResulting WGS84 point.
[in]pointLocal coordinate point.
[in]localOriginWGS84 coordinate point, origin of the local coordinate system.
[in]localToENURotation333x3 Rotation matrix that transforms from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'localOrigin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'localOrigin'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
Returns
DW_SUCCESS Successfully transformed 'point' into WGS84 system.
DW_INVALID_ARGUMENT 'transformedPoint', 'point' or 'localOrigin' is a nullptr.

◆ dwMaps_transformPolylines()

DW_API_PUBLIC dwStatus dwMaps_transformPolylines ( dwMapsPointBuffer transformedPoints,
const dwMapsGeoPolyline polylines,
uint32_t  polylineCount,
const dwMapsGeoPoint localOrigin,
const dwMatrix3d localToENURotation33 
)

Transform polylines into points in a local coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33'.

Parameters
[in,out]transformedPointsUser provided point buffer for result.
[in]polylinesStart of polyline array.
[in]polylineCountNumber of polylines in the array.
[in]localOriginWGS84 coordinate point, origin of the local coordinate system.
[in]localToENURotation333x3 Rotation matrix that transforms from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'localOrigin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'localOrigin'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
Returns
DW_SUCCESS Successfully transformed WGS84 polylines into euclidean local space.
DW_INVALID_ARGUMENT 'transformedPoints', 'polylines', or 'localOrigin' is a nullptr, or maxSize of 'transformedPoints' is not big enough.

◆ dwMaps_transformPolylinesReverse()

DW_API_PUBLIC dwStatus dwMaps_transformPolylinesReverse ( dwMapsGeoPointBuffer transformedPoints,
const dwPolyline3f polylines,
uint32_t  polylineCount,
const dwMapsGeoPoint localOrigin,
const dwMatrix3d localToENURotation33 
)

Transform local space polylines into WGS84 point polylines.

Parameters
[in,out]transformedPointsUser provided point buffer for result.
[in]polylinesStart of polyline array.
[in]polylineCountNumber of polylines in polyline array.
[in]localOriginOrigin of the ENU space
[in]localToENURotation333x3 Rotation matrix that rotates from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'localOrigin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'localOrigin'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
Returns
DW_SUCCESS Successfully transformed local space polylines into WGS84 polylines
DW_INVALID_ARGUMENT 'transformedPoints', 'polylines', or 'localOrigin' is a nullptr, or maxSize of 'transformedPoints' is not big enough.

◆ dwMaps_transformRoadFeaturesToLocalSpace()

DW_API_PUBLIC dwStatus dwMaps_transformRoadFeaturesToLocalSpace ( dwMapsPolyline3fBuffer localPolylines,
dwMapsPointBuffer pointBuffer,
const dwMapsFeatureBuffer features,
const dwMapsGeoPoint localOrigin,
const dwMatrix3d localToENURotation33,
const dwMapsLocalBounds localBounds 
)

Get geometry from the list of specified road features, transformed into a local cartesian coordinate system defined by position 'localOrigin' and rotation matrix 'localToENURotation33', optionally filtered by bounds in local coordinate system.

Parameters
[in,out]localPolylinesUser provided buffer to store local geometry.
[in,out]pointBufferUser provided buffer holding the whole geometry.
[in]featuresThe list of road features to process.
[in]localOriginWGS84 coordinate point, origin of the local coordinate system.
[in]localToENURotation333x3 Rotation matrix that transforms from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'localOrigin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'localOrigin'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
[in]localBoundsOptional bounds in the local coordinate system. No filtering is applied when it is nullptr.
Returns
DW_SUCCESS If the call was successful.
DW_INVALID_ARGUMENT 'localPolylines', 'pointBuffer', 'features', 'localOrigin' is a nullptr,
or maxSize of 'localPolylines' or 'pointBuffer' is not big enough.
DW_INTERNAL_ERROR Unexpected internal failure.
DW_BAD_CAST Could not successfully cast handle to map object.