hydromt.gis.raster_utils.full_from_transform#
- hydromt.gis.raster_utils.full_from_transform(transform: ~affine.Affine[float | int] | tuple[float | int], shape: tuple[int], *, nodata: float | int = nan, fill_value: float | int | None = None, dtype: type = <class 'numpy.float32'>, name: str | None = None, attrs: dict[str, ~typing.Any] | None = None, crs: dict[str, ~typing.Any] | int | str | None = None, lazy: bool = False) DataArray[source]#
Return a full DataArray based on a geospatial transform and shape.
See
full()for all options.- Parameters:
transform (
Affine[float | int] | tuple[float | int]) – Two dimensional affine transform for 2D linear mapping.shape (
tuple[int]) – Length along (dim0, y, x) dimensions, of which the first is optional. By default None.nodata (
float | int, optional) – No data value for new DataArray, important for reading with e.g. GDAL/ QGIS. By default nan.fill_value (
float | int, optional) – Fill value of the new DataArray. If not provided, the same value as the nodata value is used. By default None.dtype (
type, optional) – Data type, should be provided as a dtype defined by numpy (e.g. np.float32). By default np.float32.name (
str, optional) – DataArray name, by default None.attrs (
dict[str,Any], optional) – Additional attributes to assign to the DataArray. By default None.crs (
dict[str,Any] | int | str, optional) – Coordinate Reference System. Accepted is EPSG codes (int or str) and proj (str or dict). By default None.lazy (
bool, optional) – Whether to create a lazy DataArray. Defaults to False.
- Returns:
da – Newly created DataArray adhering to the provided transform and shape.
- Return type:
xr.DataArray