Skip to content

fastquadtree.RectItem

Bases: Item[Bounds]

Specialized item container for rectangle geometries.

This subclass of Item adds convenient min_x, min_y, max_x, and max_y attributes for direct access to rectangle bounds.

Attributes:

Name Type Description
id_ int

Integer identifier.

geom G

Rectangle geometry as (min_x, min_y, max_x, max_y) tuple.

obj Any

Associated Python object, or None if not set.

min_x Any

Minimum X coordinate (convenience accessor).

min_y Any

Minimum Y coordinate (convenience accessor).

max_x Any

Maximum X coordinate (convenience accessor).

max_y Any

Maximum Y coordinate (convenience accessor).

id_ = id_ instance-attribute

geom = geom instance-attribute

obj = obj instance-attribute

to_dict()

Serialize the item to a dictionary.

Returns:

Type Description
dict[str, Any]

Dictionary with 'id', 'geom', and 'obj' keys.

from_dict(data) classmethod

Deserialize an item from a dictionary.

Parameters:

Name Type Description Default
data dict[str, Any]

Dictionary with 'id', 'geom', and 'obj' keys.

required

Returns:

Type Description
Item

Item instance populated with the deserialized data.