MapElement¶

class standard_e2e.data_structures.MapElement(**data)[source]¶

Bases: BaseModel

A single HD map element (polyline, polygon, or point) in vehicle frame.

  • points: (N, 2) or (N, 3) float32 array. N == 1 is allowed for point-like elements (e.g. STOP_SIGN); N >= 2 for polylines / polygons. Datasets that ship only XY (e.g. AV2, where vector Z is advisory and may be NaN outside the ground-height ROI) emit (N, 2); datasets with reliable 3D maps (Waymo) emit (N, 3). The BEV rasterizer slices [:, :2] and works for both.

  • is_closed: True for polygons (last point connects to first); False for open polylines and points.

  • successor_ids / predecessor_ids: lane-graph connectivity (empty for non-lane elements). Unused by the BEV rasterizer; kept on the schema for future vector-output adapters.

  • left_neighbor_id / right_neighbor_id: lateral lane neighbours (None for non-lane elements). Single ID per side; if a source dataset ships a list, take the first.

  • attrs: dataset-specific per-element metadata. Standardised keys documented in docs/map_element_translation.md (e.g. lane_type, is_intersection, speed_limit_mph, paint_color, paint_pattern, paint_subtype_raw, road_edge_subtype, tl_state_per_ts, controlled_lane_id).

Parameters:
attrs: dict[str, Any]¶
id: str¶
is_closed: bool¶
left_neighbor_id: str | None¶
points: ndarray[tuple[Any, ...], dtype[float32]]¶
predecessor_ids: list[str]¶
right_neighbor_id: str | None¶
successor_ids: list[str]¶
type: MapElementType¶