raster_tools.clipping.clip#

raster_tools.clipping.clip(feature, data_raster, bounds=None)[source]#

Clip the data raster using the given feature.

Parameters
  • feature (str, Vector) – The feature to clip with. If a string, this is interpreted as a path.

  • data_raster (str, Raster) – The data raster to be clipped. If a string, this is interpreted as a path.

  • bounds (tuple, list, array, optional) – The bounding box of the clip operation: (minx, miny, maxx, maxy). If not provided, the bounds are computed from the feature. This will trigger computation of the feature.

Returns

The resulting clipped raster with dimensions that match the bounding box provided or the bounds of the feature.

Return type

Raster