Package org.opentrafficsim.road.network
Class LaneGeometryUtil
java.lang.Object
org.opentrafficsim.road.network.LaneGeometryUtil
This class is an extension (conceptually, not an actual java extension) of
OtsGeometryUtil. This utility has access
to classes that are specific to the ots-road project, and required to define geometry of objects in this context.
Copyright (c) 2023-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Method Summary
Modifier and TypeMethodDescriptionstatic LanecreateStraightLane(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length startOffset, org.djunits.value.vdouble.scalar.Length endOffset, org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType, LaneSpeedLimits speedLimits) Creates a simple straight lane.static LanecreateStraightLane(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length offset, org.djunits.value.vdouble.scalar.Length width, LaneType laneType, LaneSpeedLimits speedLimits) Creates a simple straight lane.static LanecreateStraightLane(CrossSectionLink link, String id, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction width, LaneType laneType, LaneSpeedLimits speedLimits) Creates a simple straight lane.static ObjectcreateStraightShoulder(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length startOffset, org.djunits.value.vdouble.scalar.Length endOffset, org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType) Creates a simple straight shoulder.static StripecreateStraightStripe(StripeData type, String id, CrossSectionLink link, org.djunits.value.vdouble.scalar.Length offset, org.djunits.value.vdouble.scalar.Length width) Creates a simple straight lane.static Polygon2dgetContour(PolyLine2d leftEdge, PolyLine2d rightEdge) Returns the contour based on left and right edge.
-
Method Details
-
getContour
Returns the contour based on left and right edge.- Parameters:
leftEdge- left edge, in design line directionrightEdge- right edge, in design line direction- Returns:
- a closed loop of both edges.
-
createStraightLane
public static Lane createStraightLane(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length offset, org.djunits.value.vdouble.scalar.Length width, LaneType laneType, LaneSpeedLimits speedLimits) Creates a simple straight lane. This method exists to create lanes for simple tests.- Parameters:
link- linkid- idoffset- end offsetwidth- end widthlaneType- lane typespeedLimits- speed limits- Returns:
- lane
-
createStraightLane
public static Lane createStraightLane(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length startOffset, org.djunits.value.vdouble.scalar.Length endOffset, org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType, LaneSpeedLimits speedLimits) Creates a simple straight lane. This method exists to create lanes for simple tests.- Parameters:
link- linkid- idstartOffset- start offsetendOffset- end offsetstartWidth- start widthendWidth- end widthlaneType- lane typespeedLimits- speed limits- Returns:
- lane
-
createStraightLane
public static Lane createStraightLane(CrossSectionLink link, String id, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction width, LaneType laneType, LaneSpeedLimits speedLimits) Creates a simple straight lane. This method exists to create lanes for simple tests.- Parameters:
link- linkid- idoffset- offset informationwidth- offset informationlaneType- lane typespeedLimits- speed limits- Returns:
- lane
-
createStraightStripe
public static Stripe createStraightStripe(StripeData type, String id, CrossSectionLink link, org.djunits.value.vdouble.scalar.Length offset, org.djunits.value.vdouble.scalar.Length width) Creates a simple straight lane. This method exists to create lanes for simple tests.- Parameters:
type- stripe dataid- idlink- linkoffset- end offsetwidth- end width- Returns:
- lane
-
createStraightShoulder
public static Object createStraightShoulder(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length startOffset, org.djunits.value.vdouble.scalar.Length endOffset, org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType) Creates a simple straight shoulder. This method exists to create shoulders for simple tests.- Parameters:
link- linkid- idstartOffset- start offsetendOffset- end offsetstartWidth- start widthendWidth- end widthlaneType- lane type- Returns:
- lane
-