muspan.query.

get_minimum_distances_centroids#

get_minimum_distances_centroids(domain, population_A, population_B, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, bypass_checks=False)#

Calculates the smallest distance from each object specified by objects_identifier_A to an object specified by objects_identifier_B.

Be aware, this function uses the centroid of each object - for shapes, this will be the shape centroid, not the boundary of the shape.

Parameters:
domainmuspan.domain

A muspan domain.

population_Aquery-like

The first population of objects or a query to select them.

population_Bquery-like

The second population of objects or a query to select them.

include_boundariesarray-like, query-like, or None, optional

Boundaries used to filter the populations for analysis; objects outside include_boundaries will be excluded. Defaults to None, which includes the entire domain.

exclude_boundariesarray-like, query-like, or None, optional

Boundaries used to filter populations to exclude from the analysis; objects inside exclude_boundaries will be excluded. Defaults to None.

boundary_exclude_distancefloat, optional

Buffer to exclude objects located within boundary_exclude_distance from the boundaries. Defaults to 0.

bypass_checksbool, optional

If True, standard checks on whether the queries can be interpreted are bypassed. May generate unexpected crashes if objects that can’t be interpreted as a query are passed in, but generates a substantial speed increase for large datasets when we’re confident the query is formatted correctly. Defaults to False.

Returns:
distance_arraynumpy.ndarray

Array containing minimum distances from each object in object_indices_A to an object centroid specified in objects_identifier_B.

object_indices_Anumpy.ndarray

Array containing object indices specified by objects_identifier_A.