hydromt.VectorModel.write_vector#

VectorModel.write_vector(fn: str = 'vector/vector.nc', fn_geom: str = 'vector/vector.geojson', ogr_compliant: bool = False, **kwargs)#

Write model vector to combined netcdf and geojson files.

Files are written at <root>/<fn> and at <root>/<fn_geom> 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

    (fn_geom set to None). Key-word arguments are passed to write_nc()

  • The geojson file contains both the attribute and the geometry data

    (fn 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:
  • fn (str, optional) – netcdf filename relative to model root, by default ‘vector/vector.nc’

  • fn_geom (str, optional) – geojson filename relative to model root, by default ‘vector/vector.geojson’

  • ogr_compliant (bool) – If fn only, write the netCDF4 file in an ogr compliant format This makes it readable as a vector file in e.g. QGIS see ogr_compliant() for more details.

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