onstove.RasterLayer.reproject#

RasterLayer.reproject(crs: CRS, output_path: str | None = None, cell_width: float | None = None, cell_height: float | None = None)[source]#

Reprojects the raster data into a specified coordinate system.

Uses the rasterio.features.rasterize function to reproject the current raster data into a different crs.

Parameters:
crs: rasterio.crs.CRS or dict

Target coordinate reference system. this can be anything accepted by rasterio.warp.reproject.

output_path: str, optional

A folder path where to save the output dataset. If not defined then the reprojected dataset is not saved to disk.

cell_width: float, optional

The cell width in units consistent with the raster’s crs. If provided the transform of the raster will be adjusted accordingly.

cell_height: float, optional

The cell height in units consistent with the raster’s crs. If provided the transform of the raster will be adjusted accordingly.