hydromt.data_catalog.sources.GeoDataFrameSource#

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

DataSource for GeoDataFrames.

Reads and validates DataCatalog entries.

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['GeoDataFrame']] = 'GeoDataFrame'#
field driver: GeoDataFrameDriver [Required]#
field data_adapter: GeoDataFrameAdapter [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: float = 0.0, variables: ~typing.List[str] | None = None, predicate: str = 'intersects', handle_nodata: ~hydromt.error.NoDataStrategy = NoDataStrategy.RAISE) GeoDataFrame | None[source]#

Use the driver and data adapter to read and harmonize the data.

to_file(file_path: ~pathlib.Path | str, *, driver_override: ~hydromt.data_catalog.drivers.geodataframe.geodataframe_driver.GeoDataFrameDriver | 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: float = 0.0, variables: list[str] | None = None, predicate: str = 'intersects', handle_nodata: ~hydromt.error.NoDataStrategy = NoDataStrategy.RAISE, write_kwargs: dict[str, ~typing.Any] | None = None) GeoDataFrameSource | None[source]#

Write the GeoDataFrameSource to a local file.

args:

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

Convert a geodataframe into a STAC Catalog representation.

Since geodataframes don’t support temporal dimension the datetime property will always be set to 0001-01-01. 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.