geoutils.DataArrayRasterAccessor.to_file

geoutils.DataArrayRasterAccessor.to_file#

DataArrayRasterAccessor.to_file(*args, **kwargs)[source]#

Write raster to file.

Wrapper around rioxarray.to_raster(), with additional logic to support Dask writing per default.

Dask rasters write one chunk at a time using a lock chosen from the active scheduler. The call completes the file by default, while compute=False returns a Dask object whose compute() method writes later. A user lock is passed through, including lock=False to disable chunked writing.

Parameters:
  • args (Any) – Positional arguments passed to rioxarray.to_raster().

  • kwargs (Any) – Keyword arguments passed to rioxarray.to_raster().

Return type:

Any

Returns:

A deferred Dask write when compute=False with chunked writing; otherwise None.