@@ -88,45 +88,6 @@ def polyline(self) -> List[Tuple[float,float,float]]:
8888 return sum (self .segments ,[])
8989
9090
91- @dataclass
92- @register
93- class RoadgraphSimpleLane :
94- """A lane in the roadgrap represented by points.
95-
96- By convention, the left and right boundaries are oriented in back to
97- forward order. The end boundary is from right to left, and the start
98- boundary is from left to right.
99- """
100- type : RoadgraphLaneEnum = RoadgraphLaneEnum .LANE # type of lane
101- surface : RoadgraphSurfaceEnum = RoadgraphSurfaceEnum .PAVEMENT # surface of lane
102- route_name : str = '' # name of the route (e.g., street name) that this lane is on
103- points : List [Tuple [float ,float ,float ]] = field (default_factory = list ) # points of the lane
104-
105- def to_frame (self , orig_frame : ObjectFrameEnum , new_frame : ObjectFrameEnum ,
106- current_origin = None , global_origin = None ) -> RoadgraphSimpleLane :
107- return replace (self ,points = [convert_point (p ,orig_frame ,new_frame ,current_origin ,global_origin ) for p in self .points ])
108-
109- def outline (self ) -> List [Tuple [float ,float ,float ]]:
110- """Produces a 2D outline of the lane, including elevation.
111-
112- The first point is the beginning-right of the lane, and the points
113- proceed CCW around the lane.
114-
115- If the begin and end are None, then straight lines are used to connect
116- the left and right boundaries. Otherwise, the begin and end curves
117- are used to connect the boundaries.
118- """
119- if self .left is None or self .right is None :
120- raise RuntimeError ("Cannot produce outline of lane with missing left or right boundary" )
121- points = self .right .polyline ()
122- if self .end is not None :
123- points += self .end .polyline ()
124- points += self .left .polyline ()[::- 1 ]
125- if self .begin is not None :
126- points += self .begin .polyline ()[::- 1 ]
127- return [key for key , _group in itertools .groupby (points )]
128-
129-
13091@dataclass
13192@register
13293class RoadgraphLane :
0 commit comments