get_new_shape#
- get_new_shape(ds: str | ~cloudpathlib.cloudpath.CloudPath | ~pathlib.Path | ~typing.Tuple[~numpy.ndarray | ~numpy.ma.MaskedArray, dict] | ~xarray.core.dataarray.DataArray | ~xarray.core.dataset.Dataset | ~rasterio.io.DatasetReader | ~rasterio.io.DatasetWriter, resolution: tuple | list | float, size: tuple | list, window: ~rasterio.windows.Window = None) -> (<class 'int'>, <class 'int'>, <class 'bool'>)[source]#
Get the new shape (height, width) of a resampled raster.
- Parameters:
ds (AnyRasterType) – Path to the raster, its dataset, its
xarray
or a tuple containing its array and metadataresolution (Union[tuple, list, float]) – Resolution of the wanted band, in dataset resolution unit (X, Y)
size (Union[tuple, list]) – Size of the array (width, height). Not used if resolution is provided.
window (Window) – Window to be read
- Returns:
Height, width, do resampling
- Return type: