geost.base.Collection.find_point_pairs#
- Collection.find_point_pairs(points: str | Path | gpd.GeoDataFrame | GeometryType, max_distance: float | int, n_points: int | None = None, return_distance: bool = False, include_in_header: bool = False) np.ndarray | None[source]#
Find pairs of points between the data and the given query points that are within a specified maximum distance.
- Parameters:
points (str | Path | gpd.GeoDataFrame | GeometryType) – Any type of point geometries that can be used for the selection: GeoDataFrame containing points or filepath to a shapefile like file, or Shapely Point, MultiPoint or list containing Point objects.
max_distance (float | int) – Maximum distance between points to be considered a pair.
n_points (int | None, optional) – Number of nearest points to consider for each point. If None, all points within the maximum distance will be considered. The default is None.
return_distance (bool, optional) – If True, the distances between the paired points will be returned as well. The default is False.
include_in_header (bool, optional) – If True, the found pairs will be included in the header of the Collection instance. Only applicable if direction is “data_to_query”. The default is False.
- Returns:
Array of shape (n_pairs, 2) containing the dataframe indices of the paired points in the data (column 0) and the query points (column 1) within range. If
return_distanceis True, the array will have shape (n_pairs, 3) with the third column containing the distances between the paired points.- Return type:
np.ndarray