eo_forge.utils.raster_utils.resample_raster

eo_forge.utils.raster_utils.resample_raster(raster, scale, close=False)

Resample a raster dataset by multiplying the pixel size by the scale factor, and update the dataset shape. For example, given a pixel size of 250m, dimensions of (1024, 1024) and a scale of 2, the resampled raster will have an output pixel size of 500m and dimensions of (512, 512) given a pixel size of 250m, dimensions of (1024, 1024) and a scale of 0.5, he resampled raster would have an output pixel size of 125m and dimensions of (2048, 2048) returns a DatasetReader instance from either a filesystem raster or MemoryFile (if out_path is None).

Returns
resampled raster: opened rasterio.MemoryFile