hydromt.data_adapter.GeoDataFrameAdapter.to_file#
- GeoDataFrameAdapter.to_file(data_root: str | ~pathlib.Path, data_name: str, bbox: ~typing.Tuple[float, float, float, float] | None = None, driver: str | None = None, variables: ~typing.List[str] | None = None, handle_nodata: ~hydromt.nodata.NoDataStrategy = NoDataStrategy.RAISE, logger: ~logging.Logger = <Logger hydromt.data_adapter.geodataframe (WARNING)>, **kwargs) Tuple[str, str, Dict[Any, Any]] | None [source]#
Save a data slice to file.
- Parameters:
data_root (
str
,Path
) – Path to output folderdata_name (
str
) – Name of output file without extension.bbox (
array-like
offloats
) – (xmin, ymin, xmax, ymax) bounding box of area of interest.driver (
str
, optional) – Driver to write file, e.g.: ‘GPKG’, ‘ESRI Shapefile’ or any fiona data type, by default Nonevariables (
list
ofstr
, optional) – Names of GeoDataset variables to return. By default all dataset variables are returned.kwargs – Additional keyword arguments that are passed to the geopandas driver.
- Returns:
fn_out (
str
) – Absolute path to output filedriver (
str
) – Name of driver to read data with, seeget_geodataframe()