- datacube.utils.cog.to_cog(geo_im, blocksize=None, ovr_blocksize=None, overview_resampling=None, overview_levels=None, use_windowed_writes=False, intermediate_compression=False, **extra_rio_opts)#
xarray.DataArrayinto Cloud Optimized GeoTiff bytes in memory.
This function doesn’t write to disk, it compresses in RAM, which is useful for saving data to S3 or other cloud object stores.
This function is “Dask aware”. If
geo_imis a Dask array, then the output of this function is also a Dask Delayed object. This allows us to compress multiple images concurrently across a Dask cluster. If you are not familiar with Dask this can be confusing, as no operation is performed until the
.compute()method is called, so if you call this function with Dask array it will return immediately without compressing any data.
nodata – Set
nodataflag to this value if supplied, by default
nodatais read from the attributes of the input array (
bool) – Write image block by block (might need this for large images)
extra_rio_opts – Any other option is passed to
In-memory GeoTiff file as bytes
- Return type
dask.Delayedobject if input is a Dask array