ds.rst.icrop() or Raster.icrop()

ds.rst.icrop() or Raster.icrop()#

RasterBase.icrop(bbox, inplace=False)[source]#

Crop raster based on pixel indices (bbox), converting them into georeferenced coordinates.

Parameters:
  • bbox (list[int] | tuple[int, ...]) – Bounding box based on indices of the raster array (colmin, rowmin, colmax, rowmax).

  • inplace (bool) – (DEPRECATED. Use rast = rast.icrop() instead) Whether to crop in-place or not.

Return type:

RasterType | None

Returns:

Cropped raster.