hydromt.data_catalog.adapters.GeoDataFrameAdapter.transform#

GeoDataFrameAdapter.transform(gdf: GeoDataFrame, metadata: SourceMetadata, *, mask: GeoDataFrame | None = None, variables: List[str] | None = None, predicate: str = 'intersects', handle_nodata: NoDataStrategy = NoDataStrategy.RAISE) GeoDataFrame | None[source]#

Read transform data to HydroMT standards.

Parameters:
  • gdf (gpd.GeoDataFrame) – input GeoDataFrame

  • metadata (SourceMetadata) – source metadata

  • mask (Optional[gpd.GeoDataFrame], optional) – mask to filter by geometry, by default None

  • variables (Optional[List[str]], optional) – variable filter, by default None

  • predicate (str, optional) – predicate to use for the mask filter, by default “intersects”

  • handle_nodata (NoDataStrategy, optional) – how to handle no data being present in the result, by default NoDataStrategy.RAISE

Returns:

filtered and harmonized GeoDataFrame

Return type:

Optional[gpd.GeoDataFrame]

Raises:
  • ValueError – if not all variables are found in the data

  • NoDataException – if no data in left after slicing and handle_nodata is NoDataStrategy.RAISE