hydromt.DataArray.raster.clip_geom#

DataArray.raster.clip_geom(geom, align=None, buffer=0, mask=False)#

Clip object to bounding box of the geometry.

Parameters:
  • geom (geopandas.GeoDataFrame/Series,) – A geometry defining the area of interest.

  • align (float, optional) – Resolution to align the bounding box, by default None

  • buffer (int, optional) – Buffer around the bounding box expressed in resolution multiplicity, by default 0

  • mask (bool, optional) – Mask values outside geometry with the raster nodata value, and add a “mask” coordinate with the rasterize geometry mask.

Returns:

Data clipped to geometry

Return type:

xarray.DataSet or DataArray