hydromt.data_catalog.sources.RasterDatasetSource#

pydantic model hydromt.data_catalog.sources.RasterDatasetSource[source]#

DataSource class for the RasterDataset type.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

data_type: ClassVar[Literal['RasterDataset']] = 'RasterDataset'#
field driver: RasterDatasetDriver [Required]#
field data_adapter: RasterDatasetAdapter [Optional]#
read_data(*, bbox: ~typing.Annotated[~typing.Tuple[float, float, float, float], <function _validate_bbox at 0x7f793cba1d00>] | None = None, mask: ~geopandas.geodataframe.GeoDataFrame | ~geopandas.geoseries.GeoSeries | None = None, buffer: int = 0, variables: ~typing.List[str] | None = None, time_range: ~hydromt.typing.type_def.TimeRange | None = None, zoom: int | ~typing.Tuple[float, str] | None = None, chunks: dict | None = None, single_var_as_array: bool = True, handle_nodata: ~hydromt.error.NoDataStrategy = NoDataStrategy.RAISE) Dataset | DataArray | None[source]#

Read data from this source.

Args:

to_file(file_path: ~pathlib.Path | str, *, driver_override: ~hydromt.data_catalog.drivers.raster.raster_dataset_driver.RasterDatasetDriver | None = None, bbox: ~typing.Annotated[~typing.Tuple[float, float, float, float], <function _validate_bbox at 0x7f793cba1d00>] | None = None, mask: ~geopandas.geodataframe.GeoDataFrame | ~geopandas.geoseries.GeoSeries | None = None, buffer: int = 0, time_range: ~hydromt.typing.type_def.TimeRange | None = None, zoom: int | ~typing.Tuple[float, str] | None = None, handle_nodata: ~hydromt.error.NoDataStrategy = NoDataStrategy.RAISE, write_kwargs: dict[str, ~typing.Any] | None = None) RasterDatasetSource | None[source]#

Write the RasterDatasetSource to a local file.

args:

to_stac_catalog(handle_nodata: NoDataStrategy = NoDataStrategy.IGNORE) Catalog | None[source]#

Convert a rasterdataset into a STAC Catalog representation.

The collection will contain an asset for each of the associated files.

Parameters:
  • (str (- handle_nodata) – Options are: “raise” to raise an error on failure, “ignore” to skip the dataset on failure

  • optional) (The error handling strategy.) – Options are: “raise” to raise an error on failure, “ignore” to skip the dataset on failure

Returns:

- Optional[StacCatalog] – if the dataset was skipped.

Return type:

The STAC Catalog representation of the dataset, or None

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.