xarray.DataArray.xvec.mask

xarray.DataArray.xvec.mask#

DataArray.xvec.mask(geometry, predicate=None, distance=None)#

Return boolean array representing the outcome of spatial predicate query

Take the DataArray containing variable geometry and return a mask matching the spaital predicate query.

Parameters:
geometryshapely.Geometry or Sequence[shapely.Geometry]

The geometry or sequence of geometries to use for masking.

predicatestr, optional

The spatial predicate to use for the query (e.g., ‘intersects’, ‘contains’). Default is None.

distancefloat or Sequence[float], optional

The distance or sequence of distances to use for the query. Default is None.

Returns:
xr.DataArray

A DataArray with the same shape as the original, where the elements matching the predicate are set to True.