Skip to content

fastquadtree.PointItem

Bases: Item[Point]

Specialized item container for point geometries.

This subclass of Item adds convenient x and y attributes for direct access to point coordinates.

Attributes:

Name Type Description
id_ int

Integer identifier.

geom G

Point geometry as (x, y) tuple.

obj Any

Associated Python object, or None if not set.

x Any

X coordinate (convenience accessor).

y Any

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.