connect_lines#

module wntr.gis.geospatial

connect_lines(lines, threshold, plot=False)[source]#

Connect lines by identifying start and end nodes that are within a threshold distance

Parameters:
  • lines (gpd.GeoDataFrame) – GeoDataFrame with LineString geometry

  • tolerance (float) – Maximum distance between line endpoints, used to define connecting Point geometry

  • plot (bool) – Boolean indicating if a plot is created for the dendogram, and original and connected lines

Returns:

  • line GeoDataFrame contains LineString geometry, start_node_name, and end_node_name, along with original columns in lines

  • node GeoDataFrame contains connecting Point geometry and node names

Return type:

Tuple[line GeoDataFrame, node GeoDataFrame]