Exemplo n.º 1
0
def merge_pipes_00(in_pipe_paths):
    """Merges culvert features from multiple files.

    The merged culvert file will be saved in a new Hydro_Route group.

    Parameters
    ----------
    in_pipe_paths: list of str
        List of pipe files to merge. Pipe files should already be clipped to basin extent. (If not, run extract_pipes_00 first.)

    Returns
    --------
    output_path: str
    """
    from pathlib import Path

    from WBT.whitebox_tools import WhiteboxTools
    wbt = WhiteboxTools()

    last_pipe = Path(in_pipe_paths[-1])

    out_group = new_group_01(str(last_pipe.parent.parent),
                             last_pipe.stem.split('_')[1], "PIPES")
    output_path = new_file_00(str(last_pipe), "PIPES", "shp", str(out_group))

    wbt.merge_vectors(';'.join(in_pipe_paths), output_path)

    return output_path
Exemplo n.º 2
0
def merge_pipes_00(in_pipe_paths):
    """ Merge culvert features from multiple files
    Parameters
    ----------
    in_pipe_paths : list
        List of pipe files to merge
    """

    from WBT.whitebox_tools import WhiteboxTools

    wbt = WhiteboxTools()

    out_group = new_group_00(in_pipe_paths[-1])
    output_path = out_file_00(in_pipe_paths[-1], "PIPES", "shp", out_group)

    wbt.merge_vectors(';'.join(in_pipe_paths), output_path)

    return output_path