ds.rst.copy() or Raster.copy()

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

abstractmethod RasterBase.copy(new_array=None, cast_nodata=True, deep=True)[source]#

Copy the raster in-memory.

Parameters:
  • new_array (NDArray[floating[Any] | integer[Any]] | None) – New array to use in the copied raster.

  • cast_nodata (bool) – Automatically cast nodata value to the default nodata for the new array type if not compatible. If False, will raise an error when incompatible.

  • deep (bool) – If True, will return a deep copy of the raster.

Return type:

RasterType

Returns:

Copy of the raster.