hydromt.model.components.GeomsComponent.write#
- GeomsComponent.write(filename: str | None = None, *, to_wgs84: bool = False, precision: int | None = -1, **kwargs) None[source]#
Write model geometries to a vector file (by default GeoJSON) at <root>/<filename>.
key-word arguments are passed to
geopandas.GeoDataFrame.to_file()- Parameters:
filename (
str | None, optional) – filename relative to model root. should contain a {name} placeholder which will be used to determine the names/keys of the geometries. if None, the path that was provided at init will be used. Can be a relative path.to_wgs84 (
bool, optional) – If True, the geoms will be reprojected to WGS84(EPSG:4326) before they are written.precision (
int | None, optional) – The number of decimal places for geometry coordinates. By default -1. If negative, the crs of the written file will be used to determine precision (6 for geographic, 1 for projected). If a positive integer is provided, that number of decimals will be used. If None, no rounding will be applied.**kwargs – Additional keyword arguments that are passed to the geopandas.to_file function.