hydromt.VectorModel.set_vector#

VectorModel.set_vector(data: DataArray | Dataset | ndarray | GeoDataFrame = None, name: str | None = None, overwrite_geom: bool = False) None#

Add data to vector.

All layers of data must have identical spatial index. Only polygon geometry is supported.

If vector already contains a geometry layer different than data, overwrite_geom can be set to True to overwrite the complete vector object wit data (use with caution as previous data could be lost).

Parameters:
  • data (xarray.DataArray or xarray.Dataset or np.ndarray or gpd.GeoDataFrame) – new data to add to vector

  • name (str, optional) – Name of new data, this is used to overwrite the name of a DataArray or to select a variable from a Dataset.

  • overwrite_geom (bool, optional) – If True, overwrite the complete vector object with data, by default False