generalization.n100.river package

Submodules

generalization.n100.river.extend_river_line module

generalization.n100.river.extend_river_line.main()[source]
generalization.n100.river.extend_river_line.processing_preparation()[source]
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.

generalization.n100.river.minimum_spanning_tree_pruning module

generalization.n100.river.mst_loop module

generalization.n100.river.mst_loop.main()[source]
generalization.n100.river.mst_loop.prepare_data()[source]
generalization.n100.river.mst_loop.extract_closed_lines(input_feature_class, output_feature_class)[source]

Extracts lines that start and end at the same point from the input feature class and creates a new feature class containing only these closed lines.

Parameters: input_feature_class (str): The path to the input feature class to check. output_feature_class (str): The path to the output feature class for storing closed lines.

generalization.n100.river.mst_loop.create_collapsed_centerline()[source]
generalization.n100.river.mst_loop.filter_complicated_lakes()[source]
generalization.n100.river.mst_loop.create_feature_class()[source]

generalization.n100.river.preparing_river_network module

generalization.n100.river.preparing_river_network.main()[source]
Summary:

This script prepares the river network for the 1:100,000 scale by setting line directions and thinning hydrology lines.

Details:
  1. set_line_direction:

    Sets the direction of each stream segment in the river network based on downhill flow.

  2. thin_hydrology_lines:

    Thins the hydrology lines in the river network to optimize for the 1:100,000 scale. The function thins the river network, removing line segments based on hierarchy, direction, length and spacing between features

generalization.n100.river.preparing_river_network.set_line_direction()[source]
generalization.n100.river.preparing_river_network.thin_hydrology_lines()[source]

generalization.n100.river.river_centerline module

generalization.n100.river.river_centerline.main()[source]
generalization.n100.river.river_centerline.prepare_data()[source]
generalization.n100.river.river_centerline.create_dangles()[source]

generalization.n100.river.river_data_preparation module

generalization.n100.river.river_data_preparation.main()[source]
Summary:

This is the main function of river data preparation, which aims to prepare the data for future river generalization processing.

Details:
  1. selecting_polygon_features:

    This function creates new feature classes based on SQL-expressions: the first one to be used to generate centerlines, while the second is used to fill geometry gaps in the river network.

generalization.n100.river.river_data_preparation.selecting_polygon_features()[source]

generalization.n100.river.unconnected_river_geometry module

generalization.n100.river.unconnected_river_geometry.main()[source]
generalization.n100.river.unconnected_river_geometry.copy_input_features(geomotry_search_tolerance)[source]
generalization.n100.river.unconnected_river_geometry.process_batch(start, end, line_fc, polygon_fc, buffer_fc, id_field, dangle_id_field, shared_results, queue)[source]
generalization.n100.river.unconnected_river_geometry.resolve_geometry(id_field, dangle_id_field, all_problematic_ids)[source]

Module contents