hydromt.data_catalog.sources.GeoDatasetSource#

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

DataSource class for the GeoDatasetSource 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['GeoDataset']] = 'GeoDataset'#
field driver: GeoDatasetDriver [Required]#
field data_adapter: GeoDatasetAdapter [Optional]#
read_data(*, mask: GeoDataFrame | GeoSeries | None = None, predicate: Literal['intersects', 'within', 'contains', 'overlaps', 'crosses', 'touches'] = 'intersects', variables: List[str] | None = None, time_range: TimeRange | None = None, single_var_as_array: bool = True, handle_nodata: 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.geodataset.geodataset_driver.GeoDatasetDriver | 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, predicate: ~typing.Literal['intersects', 'within', 'contains', 'overlaps', 'crosses', 'touches'] = 'intersects', variables: list[str] | None = None, time_range: ~hydromt.typing.type_def.TimeRange | None = None, single_var_as_array: bool = True, handle_nodata: ~hydromt.error.NoDataStrategy = NoDataStrategy.RAISE, write_kwargs: dict[str, ~typing.Any] | None = None) GeoDatasetSource | None[source]#

Write the GeoDatasetSource to a local file.

args:

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

Convert a geodataset 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] – None if the dataset was skipped.

Return type:

The STAC Catalog representation of the dataset, or

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.