This class describes the connection between two road nodes. This connection is defined in a single direction which coincides with the traffic direction.
This class describes the connection between two [COpendriveRoadNode](opendrive_road_node.md)road nodes. This connection is defined in a single direction which coincides with the traffic direction.
The next image shows (as solid arrows) the set of COpendriveLink's defined for the example road presented in [here]().
The next image shows (as solid arrows) the set of COpendriveLink's defined for the example road presented in [here](), with the COpendriveRoadNode's objects (as red dots).
<imgsrc="images/links.png"alt="COpendriveRoadNode objects created for the example road"width="607"height="544">
<imgsrc="images/links.png"alt="COpendriveLink objects created for the example road"width="607"height="544">
This class encodes the geometry as [G2 Spline]().
This class describes the geometry as [G2 Spline](g2_spline.md).
Links are created between a road node and:
* the next road node on the same lane and road segment (if any).
* the previous road node on the same lane and road segment (if any).
* the first or last road node on connecting lanes and road segments.
These type of links (called **lane links**) describe the actual geometry of the road and belong to a specific lane and road segment. Additional, links are also created between a road node and:
* the next road node on the adjacent lane (left or right) and the same road segment (if any).
* the previous road node on the adjacent lane (left or right) and the same road segment (if any).
* the first or last road node on connecting lanes and road segment.
This second type of links (called **non-lane links**) do not belong to any specific lane, only to a road segment.
In road junctions, the only links that are created are the ones defined by the Opendrive junction connectivity.
## Main features
The main features of this class are:
* Provides the reference to the parent lane [COpendriveLane]() and parent road segment [COpendriveRoadSegment]().
* Provides the reference to the starting and ending COpendriveRoadNode objects.
* It is possible to generate the actual path defined by the internal geometry.
* It is possible to find the closest position to the link geometry.
* Provides the reference to the starting and ending [COpendriveRoadNode](opendrive_road_node.md) objects.
* Provides road mark information between its two road nodes. For lane links this will always be OD_MARK_NONE, but for non-lane links it will correspond to the actual road mark.
* Provides the reference to the parent lane [COpendriveLane](opendrive_lane.md) only for lane links
* Provides the reference to the parent road segment [COpendriveRoadSegment](opendrive_road_segment.md).
* It is possible to find the closest pose (minimum distance) on the link geometry to a given poition.
* It is possible to generate the actual trajectory (sub-trajectory) defined by the internal geometry (x and y coordinates and optionally the heading).
* It is possible to get the pose and curvature at any point on the link trajectory.
* In case of unexpected errors, this class throws an instance of CException. All other errors are reported to the user.
For further details on the implementation of these features check the doxygen API documentation.