hydromt.model.components.VectorComponent.set#
- VectorComponent.set(data: DataArray | Dataset | ndarray | GeoDataFrame = None, *, name: str | None = None, overwrite_geom: bool = False) None [source]#
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
orxarray.Dataset
ornp.ndarray
orgpd.GeoDataFrame
) – new data to add to vectorname (
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