hydromt_delft3dfm.workflows.prepare_branches#
- hydromt_delft3dfm.workflows.prepare_branches(gdf_br: ~geopandas.geodataframe.GeoDataFrame, params: ~pandas.core.frame.DataFrame, br_type: ~typing.Literal['river', 'channel', 'pipe'], dst_crs: ~pyproj.crs.crs.CRS, filter: str = None, id_start: int = 1, spacing: ~pandas.core.frame.DataFrame = None, snap_offset: float = 0.0, allow_intersection_snapping: bool = False, allowed_columns: ~typing.List[str] = [], logger: ~logging.Logger = <Logger hydromt_delft3dfm.workflows.branches (WARNING)>) Tuple[GeoDataFrame, GeoDataFrame] [source]#
Set all common steps to add branches type of objects.
Example for ie channels, rivers, pipes… branches.
Default frictions and crossections will also be added.
- Parameters:
gdf_br (gpd.GeoDataFrame) – gpd.GeoDataFrame of branches.
params (pd.DataFrame) – pd.Dataframe of defaults values for gdf_br.
br_type (str) – branches type. Either “river”, “channel”, “pipe”.
dst_crs (pyproj.CRS) – Destination crs for the branches and branch_nodes.
id_start (int, optional) – Start index for branchid. By default 1.
filter (str, optional) – Keyword in branchtype column of gdf_br used to filter lines. If None all lines in br_fn are used (default).
spacing (float, optional) – Spacing value in meters to split the long pipelines lines into shorter pipes. By default inf - no splitting is applied.
snap_offset (float, optional) – Snapping tolerance to automatically connecting branches. Tolerance must be smaller than the shortest pipe length. By default 0.0, no snapping is applied.
allow_intersection_snapping (bool, optional) – Switch to choose whether snapping of multiple branch ends are allowed when
snap_offset
is used. By default True.allowed_columns (list, optional) – List of columns to filter in branches GeoDataFrame
logger (logging.Logger, optional) – Logger.
- Returns:
branches (gpd.GeoDataFrame) – Prepared branches.
branches_nodes (gpd.GeoDataFrame) – Nodes of the prepared branches.