DriveWorks SDK Reference 3.5.78 Release For Test and Development only
Lane Tree
Note
SW Release Applicability: This tutorial is applicable to modules in NVIDIA DRIVE Software releases.

A Lane Tree represents how the road continues from a given lane on the map. The root of the Lane Tree is a selected source lane. The children of a tree node are its direct successor lanes at the end of the current Road Segment. Optionally, also the successors of neighbor lanes that are reachable through a lane change are child nodes. This supports exploration of reachable lanes from a given lane, up to a specified limit, either with or without lane changes. The limit can be either distance or driving time.

### To create a Lane Tree

1. Initialize a Lane Tree Handle with an existing Map Handle as input:
dwMapsLaneTreeHandle_t* laneTreeHandle,
uint32_t maxLaneCount,

The caller must estimate maxLaneCount. It is the maximum number of dwMapsLane objects that can be stored in the tree. The function uses it to pre-allocate the buffers used during the tree creation.

1. Create the tree with
const dwMapsLane* lane,
float32_t limit,
dwBool doLaneChanges,

### To obtain the Lane Tree result

There are three different ways to access the result:

• To access the tree structure through the root node, call:
• To get a list of all lanes in the tree, use:
uint32_t* laneCount,
Followed by:

• To get a sorted list of lanes from the root lane to each leaf of the Lane Tree, call:
uint32_t* leafCount,
Followed by:

dwMapsLaneBuffer* laneBuffer,
uint32_t leafIndex,

There is a helper function to stitch the geometry of connected lanes into one single polyline, see dwMaps_stitchLaneGeometry() in the next chapter: Lane Tree Helper Functions

For more information see Map Access Sample .