onstove.OnStove.to_raster#
- OnStove.to_raster(variable: str, labels: dict[str, str] | None = None, cmap: dict[str, str] | None = None, metric: str = 'mean', nodata: float | int | None = None, mask: bool = False, mask_nodata: float | int | None = None)[source]#
Creates a RasterLayer and saves it as a
.tif
file and a.clr
colormap.- Parameters:
- variable: str
The column name from the
gdf
to use.- labels: dictionary of str key-value pairs, optional
Dictionary with the keys-value pairs to use for the data categories. It is only used for categorical data— see
create_layer()
.- cmap: dictionary of str key-value pairs, optional
Dictionary with the colors to use for each data category. It is only used for categorical data—see
create_layer()
.- metric: str, default ‘mean’
Metric to use to aggregate data. It is only used for non-categorical data. For available metrics see
create_layer()
.- nodata: float or int
Defines nodata values to be ignored by the function.