queryο
- SearchTree.query(x, k=1, d=None, pick_relative_to_closest=True)ο
Find the (k) closest points.
- Parameters:
x (list, tuple or np.array of length 2) β The x- and y- coordinates to search.
k (int, optional) β The number of points to identify. The default is 1.
d (float, optional) β The max. distance (in plot-crs) to consider when identifying points. If None, the currently assigned distance (e.g. m.tree.d) is used. (see m.tree.set_search_radius on how to set the default distance!) The default is None.
pick_relative_to_closest (bool, optional) β
ONLY relevant if k > 1.
If True: pick (k) nearest neighbours based on the center of the closest point
If False: pick (k) nearest neighbours based on the click-position
The default is True.
- Returns:
i β The indexes of the selected datapoints with respect to the flattened array.
- Return type:
list