generalization.n100.river package
Submodules
generalization.n100.river.calculate_strahler module
generalization.n100.river.connect_river_lines module
generalization.n100.river.elevate_river_lines module
generalization.n100.river.extend_river_line module
- generalization.n100.river.extend_river_line.exclude_originating_line(all_rivers, dangle_oid, id_field)[source]
Create a feature layer that excludes the line from which the dangle originates.
- Parameters:
all_rivers – The feature class containing all river line features.
dangle_oid – The OID of the dangle point.
id_field – The field name that holds the original OID of the river lines.
- Returns:
A feature layer that excludes the originating line of the dangle.
- generalization.n100.river.extend_river_line.generate_near_table(dangle, near_features, water_polygon)[source]
Generate a near table for a dangle point to find the nearest feature’s closest point, considering both river and water polygon features.
- Parameters:
dangle – A point geometry representing the dangle.
excluded_rivers_layer – The feature layer containing all river line features excluding the originating line.
water_polygon – The feature class containing water polygon features.
- Returns:
The path to the near table generated.
- generalization.n100.river.extend_river_line.get_xy_coordinates(near_table)[source]
Extract the XY coordinates from the near table.
- Parameters:
near_table – The near table to extract coordinates from.
- Returns:
A tuple of XY coordinates for the dangle and the nearest feature.
- generalization.n100.river.extend_river_line.create_lines_from_coordinates(line_points, all_rivers)[source]
Create new line features from the pairs of XY coordinates.
- Parameters:
line_points – A list of tuples containing pairs of XY coordinates.
- Returns:
A list of arcpy.Polyline objects representing the new lines.
- generalization.n100.river.extend_river_line.process_new_lines(new_lines, all_rivers)[source]
Merge new line features with original river features and remove duplicates.
- Parameters:
new_lines – A list of arcpy.Polyline objects representing new lines to be added.
all_rivers – The feature class containing all river line features.
- Returns:
The feature class path of the final river network with new lines merged in.