- RTree.query(coordinates: ndarray, k: int = 4, within: bool = True, num_threads: int = 0) Tuple[ndarray, ndarray] #
Search for the nearest K nearest neighbors of a given point.
coordinates – a matrix
nis the number of observations and
ndimsis the number of coordinates in order: longitude and latitude in degrees, altitude in meters. If ndims is equal to 2 then the altitude is considered to be constant and equal to zero.
k – The number of nearest neighbors to be searched. Defaults to
within – If true, the method ensures that the neighbors found are located within the point of interest. Defaults to
num_threads – The number of threads to use for the computation. If 0 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. Defaults to
A tuple containing a matrix describing for each provided position, the distance, in meters, between the provided position and the found neighbors and a matrix containing the value of the different neighbors found for all provided positions. If no neighbors are found, the distance and the value are set to