hydromt.data_adapter.GeoDatasetAdapter.to_file#

GeoDatasetAdapter.to_file(data_root: str | ~pathlib.Path, data_name: str, bbox: ~typing.Tuple[float, float, float, float] | None = None, time_tuple: ~typing.Tuple[~datetime.datetime, ~datetime.datetime] | None = None, variables: ~typing.List[str] | None = None, driver: str | None = None, handle_nodata: ~hydromt.nodata.NoDataStrategy = NoDataStrategy.RAISE, logger: ~logging.Logger = <Logger hydromt.data_adapter.geodataset (WARNING)>, **kwargs) Tuple[str | Path, str | None, Dict[str, Any]] | None[source]#

Save a data slice to file.

Parameters:
  • data_root (str, Path) – Path to output folder

  • data_name (str) – Name of output file without extension.

  • bbox (array-like of floats) – (xmin, ymin, xmax, ymax) bounding box of area of interest.

  • time_tuple (tuple of str, datetime, optional) – Start and end date of period of interest. By default the entire time period of the dataset is returned.

  • driver (str, optional) – Driver to write file, e.g.: ‘netcdf’, ‘zarr’, by default None

  • variables (list of str, optional) – Names of GeoDataset variables to return. By default all dataset variables are returned.

  • **kwargs – Additional keyword arguments that are passed to the to_zarr function.

Returns:

  • fn_out (str) – Absolute path to output file

  • driver (str) – Name of driver to read data with, see get_geodataset()