area#

area(domain, population=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, add_as_label=True, label_name='Area', cmap='viridis')#

Returns the area of the objects in the domain. Add results as a label if required.

Parameters:
domainobject

The domain containing the objects whose areas are to be calculated.

populationquery-like, optional

A query specifying the objects to consider. Defaults to None.

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

Boundaries to include in the analysis. Defaults to None.

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

Boundaries to exclude from the analysis. Defaults to None.

boundary_exclude_distancefloat, optional

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

add_as_labelbool, optional

Whether to add the calculated areas as a label to the domain. Defaults to True.

label_namestr, optional

The name of the label to add. Defaults to ‘Area’.

cmapstr, optional

The colormap to use if adding the areas as a label. Defaults to ‘viridis’.

Returns:
areasnumpy.ndarray

The areas of the specified objects.

object_indicesnumpy.ndarray

The indices of the objects considered.

Raises:
ValueError

If the query is not of the correct type.