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... | |
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. |
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. |
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. |
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. |
#define DW_MAPS_INVALID_LANE_INDEX 99999999 |
enum dwMapsLaneEventType |
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.
[out] | closestPoint | Closest point on polyline. Can be nullptr if result not needed. |
[out] | distanceMeters | Distance between the query point and the closest point. Can be nullptr if result not needed. |
[out] | lineSegmentIndex | Index of the line segment of the polyline (polyline point with smaller index) Can be nullptr if result not needed. |
[in] | p | Query point. |
[in] | polyline | Polyline on which to search for the closest point. |
[in] | ignoreHeight | If true, distances are calculated after projection to height 0. |
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.
[out] | bearingRadian | Bearing pointing towards 'headingPoint' at given 'position'. |
[in] | position | Position at which the bearing is computed. |
[in] | headingPoint | Second point that defines the direction bearing is pointing towards. |
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.
[out] | bearingRadian | Resulting bearing. |
[in] | localToENURotation33 | Rotation 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). |
DW_API_PUBLIC dwStatus dwMaps_computeBounds | ( | dwMapsBounds * | bounds, |
const dwMapsGeoPoint * | p, | ||
float32_t | radiusMeter | ||
) |
Compute WGS84 query bounds from position and radius in meters.
[out] | bounds | Computed bounds |
[in] | p | Center point of query circle |
[in] | radiusMeter | Radius in meters that the bounds need to cover. The Radius is a geodesic system on the earth sphere surface. |
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).
[out] | width | Longest east-west distance within bounds in meters. |
[out] | height | Longest north-south distance within bounds in meters. |
[in] | bounds | Maps bounds defined in wgs84 coordinates. |
DW_API_PUBLIC dwStatus dwMaps_computeDistance | ( | float64_t * | distance, |
const dwMapsGeoPoint * | p1, | ||
const dwMapsGeoPoint * | p2 | ||
) |
Compute Euclidean distance between two points.
[out] | distance | Euclidean distance between the two points |
[in] | p1 | First point |
[in] | p2 | Second point |
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.
[out] | transform | Resulting transform. |
[in] | originSource | Origin of the source coordinate system |
[in] | localToENURotationSource | Local to ENU rotation of the source coordinate system. If this is NULL, it is interpreted as Identity, thus ENU at origin1. |
[in] | originTarget | Origin of the target coordinate system |
[in] | localToENURotationTarget | Local to ENU rotation of the target coordinate system. If this is NULL, it is interpreted as Identity, thus ENU at origin2. |
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.
[out] | length | Resulting polyline length. |
[in] | points | Pointer to polyline point array. |
[in] | pointCount | Number of points in polyline. |
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.
[out] | localToENURotation33 | Rotation 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] | bearingRadian | Bearing in radian. |
DW_API_PUBLIC dwStatus dwMaps_computeRotationFromGeoPoints | ( | dwMatrix3d * | localToENURotation33, |
const dwMapsGeoPoint * | position, | ||
const dwMapsGeoPoint * | headingPoint | ||
) |
Compute orientation matrix from two WGS84 points.
[out] | localToENURotation33 | Rotation 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] | position | First point to describe heading direction |
[in] | headingPoint | Second point to describe heading direction |
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.
[out] | localToENURotation33 | Rotation 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] | position | First point to describe heading direction |
[in] | headingPoint | Second point to describe heading direction |
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.
connectedToLocal | |
localLane | |
connectedLane |
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.
[out] | laneChangeSide | Side of the lane change in geometry direction. Can be a nullptr if this result is not needed. |
[out] | laneChangeCount | Number of lane changes needed to get from source to target lane. Can be a nullptr if this result is not needed. |
[in,out] | laneChangeLength | Input: 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] | srcLane | Source lane. |
[in] | targetLane | Target lane. |
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.
[out] | laneChangeSide | Side of the lane change. Relative to driving direction. Can be a nullptr if this result is not needed. |
[out] | laneChangeCount | Number of lane changes needed to get from source to target lane. Can be a nullptr if this result is not needed. |
[in,out] | laneChangeLength | Input: 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] | srcLane | Source lane. |
[in] | targetLane | Target lane. |
[in] | position | Current position. |
[in] | localToENURotation33 | Current 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'. |
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.
[out] | laneChangeSide | Side of the lane change. Relative to driving direction. Can be a nullptr if this result is not needed. |
[out] | laneChangeCount | Number of lane changes needed to get from source to target lane. Can be a nullptr if this result is not needed. |
[in,out] | laneChangeLength | Input: 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] | srcLane | Source lane. |
[in] | targetLane | Target lane. |
[in] | referenceRoadSegment | Road segment that defines the coordinate system of provided position and orientation. |
[in] | position | Current position, in coordinate system of referenceRoadSegment. |
[in] | localToENURotation33 | Current 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'. |
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.
[out] | otherLane | Neighbor lane. |
[in] | currentLane | Query lane |
[in] | side | DW_MAPS_SIDE_LEFT or DW_MAPS_SIDE_RIGHT |
[in] | offset | Offset defines which neighbor lane is requested, e.g. offset 1 is the direct neighbor, offset 2 is the next one, etc. |
[in] | sideRelativeToDrivingDirection | If 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. |
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.
[out] | laneCount | Optional. Total number of lanes on requested side. |
[out] | laneCountAccessible | Optional. 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] | lane | Query lane |
[in] | side | DW_MAPS_SIDE_LEFT or DW_MAPS_SIDE_RIGHT |
[in] | sideRelativeToDrivingDirection | If 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. |
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'.
[out] | type | None, lane split, lane merge, or both. |
[out] | laneSplit | Struct to contain the resulting lane split. |
[out] | laneMerge | Struct to contain the resulting lane merge. |
[out] | nextEventDist | Distance to where the next lane action (change/split) takes place. |
[in] | currentLane | Lane where the search for the next lane event is started. |
[in] | forwardOnPolyline | Defined 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] | maxDistance | Distance at which the the search for the next lane event is stopped. |
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.
laneSplit | Next split. |
laneSplitDistance | Distance of next lane split from current pose. |
currentLane | Current lane where the split search starts. |
maxSearchDistance | Maximum distance to search for a split. |
position | Position relative to the reference road segment. |
localToENURotation33 | 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 point 'referenceRoadSegment->origin'. |
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.
laneSplit | Next split. |
laneSplitDistance | Distance of next lane split from current pose. |
currentLane | Current lane where the split search starts. |
maxSearchDistance | Maximum distance to search for a split. |
referenceRoadSegment | Road segment the current pose refers to. |
position | Position relative to the reference road segment. |
localToENURotation33 | 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 point 'referenceRoadSegment->origin'. |
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.
[out] | pointAhead | Resulting wgs84 point ahead. |
[in] | position | Source position. |
[in] | localToENURotation33 | Rotation matrix that defines the orientation. |
[in] | distance | Distance to move forward from source position. |
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.
[out] | srcStartIndex | Index into the source polyline. First point before the interpolation. |
[out] | targetEndIndex | index into the target polyline. First point after the interpolation. |
[in,out] | interpolatedPoints | User buffer to store the interpolation result. |
[in] | srcPoints | Source polyline. |
[in] | srcPointCount | Number of points in source polyline. |
[in] | targetPoints | Target polyline. |
[in] | targetPointCount | Number of points in the target polyline. |
[in] | start | Defines where on the source polyline the interpolation starts. In meters. |
[in] | end | Defines where on the target polyline the interpolation stops. In meters. |
[in] | stepSize | Defines the resolution of the resulting interpolation polyline. In meters. |
[in] | interpolationFn | Callback 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] | interpolationFnContext | Optional user data that is passed on to the interpolation function callback. |
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
[out] | isDrivable | Result |
[in] | lane | Source lane. |
[in] | connection | Connection to be checked. |
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.
[out] | result | User provided buffer to hold the resulting resampled polyline point. |
[in] | polyline | Input polyline to resample. |
[in] | stepSize | Distance in meters between resampled points. |
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.
[in,out] | polyline | User provided wgs84 point buffer that gets filled with the result. |
[in,out] | perPointLanes | dwMapsLane for each point. Can be nullptr if not needed. |
[in] | lanes | List of connected lanes. |
[in] | laneCount | Number of connected lanes. |
[in] | geometrySelection | Selects geometry of the lane to be stitched. |
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'.
[out] | transformedPoint | Resulting local space point. |
[in] | point | WGS84 point. |
[in] | localOrigin | WGS84 coordinate point, origin of the local coordinate system. |
[in] | localToENURotation33 | 3x3 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. |
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.
[out] | transformedPoint | Resulting WGS84 point. |
[in] | point | Local coordinate point. |
[in] | localOrigin | WGS84 coordinate point, origin of the local coordinate system. |
[in] | localToENURotation33 | 3x3 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. |
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'.
[in,out] | transformedPoints | User provided point buffer for result. |
[in] | polylines | Start of polyline array. |
[in] | polylineCount | Number of polylines in the array. |
[in] | localOrigin | WGS84 coordinate point, origin of the local coordinate system. |
[in] | localToENURotation33 | 3x3 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. |
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.
[in,out] | transformedPoints | User provided point buffer for result. |
[in] | polylines | Start of polyline array. |
[in] | polylineCount | Number of polylines in polyline array. |
[in] | localOrigin | Origin of the ENU space |
[in] | localToENURotation33 | 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 '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. |
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.
[in,out] | localPolylines | User provided buffer to store local geometry. |
[in,out] | pointBuffer | User provided buffer holding the whole geometry. |
[in] | features | The list of road features to process. |
[in] | localOrigin | WGS84 coordinate point, origin of the local coordinate system. |
[in] | localToENURotation33 | 3x3 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] | localBounds | Optional bounds in the local coordinate system. No filtering is applied when it is nullptr. |