hydromt.model.components.VectorComponent.write#
- VectorComponent.write(*, filename: str | None = 'vector/vector.nc', geometry_filename: str | None = 'vector/vector.geojson', ogr_compliant: bool = False, **kwargs) None [source]#
Write model vector to combined netcdf and geojson files.
Files are written at <root>/<filename> and at <root>/<geometry_filename> respectively.
Three options are possible:
- The netcdf file contains the attribute data and the geojson file the
geometry vector data. Key-word arguments are passed to
write_nc()
- The netcdf file contains both the attribute and the geometry data
(geometry_filename set to None). Key-word arguments are passed to
write_nc()
- The geojson file contains both the attribute and the geometry data
(filename set to None). This option is possible only if all data variables are 1D. Else the data will be written to netcdf. Key-word arguments are passed to
to_gdf()
- Parameters:
filename (
str
, optional) – netcdf filename relative to model root, by default ‘vector/vector.nc’geometry_filename (
str
, optional) – geojson filename relative to model root, by default ‘vector/vector.geojson’ogr_compliant (
bool
) – If filename only, write the netCDF4 file in an ogr compliant format This makes it readable as a vector file in e.g. QGIS seeogr_compliant()
for more details.**kwargs – Additional keyword arguments that are passed to the write_nc function.