quads
quads copied to clipboard
Insert() is not functional when data with properties inserted
def insert(self, point):
"""
Inserts a `Point` into the quadtree.
Args:
point (Point|tuple|None): The point to insert.
data (any): Optional. Corresponding data for that point. Default
is `None`.
Returns:
bool: `True` if insertion succeeded, otherwise `False`.
"""
pnt = self.convert_to_point(point)
# pnt.data = data
return self._root.insert(pnt)
In the insert() of class QuadTree, suggest to remove the "data=None" in the insert and delete "pnt.data=data".
Sorry for the code format and hope this helps!