generalization.n10.arealdekke package

Subpackages

Submodules

generalization.n10.arealdekke.area_merger module

generalization.n10.arealdekke.area_merger.area_merger(input_fc: str, buffered_fc: str, work_fc: str, output_fc: str, changed_area: str) None[source]

The main function that dissolves buffered geometries into the data set, removes overlapping areas and preserves topology.

Parameters:
  • input_fc (str) – Input feature class with original land use

  • buffered_fc (str) – Feature class with the buffer zones for thin polygons

  • work_fc (str) – Feature class to store half-processed results

  • output_fc (str) – Feature class to store output

  • changed_area (str) – The field name value of the land use ‘arealdekke’ that is enlarged and overlaps other areas

generalization.n10.arealdekke.area_merger.create_overlapping_land_use(input_fc: str, buffered_fc: str, output_fc: str, changed_area: str) None[source]

Creates a new feature class that keeps all original features except for those matching ‘changed_area’ and adds the buffered features so that the complete data contains correct, but overlapping areas.

Parameters:
  • input_fc (str) – Feature class containing all the original features

  • buffered_fc (str) – Feature class containing the buffered, small features

  • output_fc (str) – Feature class to be created with overlapping geometries

  • changed_area (str) – The attribute value of the attribute field to change

generalization.n10.arealdekke.area_merger.adjusting_surrounding_geometries(input_fc: str, buffered_fc: str, output_fc: str, changed_area: str) None[source]

Adjusts land use that intersects with ‘changed_area’ that have been enlarged to preserve topology.

Parameters:
  • input_fc (str) – Input feature class with overlapping land use

  • buffered_fc (str) – Feature class with the buffer zones for thin polygons

  • output_fc (str) – Feature class to store output

  • changed_area (str) – The field name value of the land use ‘arealdekke’ that is enlarged and overlaps other areas

generalization.n10.arealdekke.area_merger.create_wfm_gdbs(wfm: WorkFileManager) dict[source]

Creates all the temporarily files that are going to be used during the process of adjusting land use boundaries.

Parameters:

wfm (WorkFileManager) – The WorkFileManager instance that are keeping the files

Returns:

A dictionary with all the files as variables

Return type:

dict

generalization.n10.arealdekke.area_merger.fetch_relevant_data(input_fc: str, buffered_fc: str, files: dict, attr_val: str) None[source]
Copies the original data to work file manager and creates two feature classes:
  1. All the buffered data (locked)

  2. Data intersecting these buffers

Parameters:
  • input_fc (str) – Feature class with the original input data

  • buffered_fc (str) – Feature class with the buffers

  • files (dict) – Dictionary with all the working files

  • attr_val (str) – String representing the value of the attribute that must be locked

generalization.n10.arealdekke.area_merger.erase_overlap(files: dict) None[source]

Erase line parts of intersecting features that overlaps locked features (avoiding overlap).

Parameters:

files (dict) – Dictionary with all the working files

generalization.n10.arealdekke.area_merger.collect_and_finish(files: dict, output_fc: str) None[source]

Collects original data and modified data in one feature class, and copies the result to output.

Parameters:
  • files (dict) – Dictionary with all the working files

  • output_fc (str) – Feature class to store the final result

generalization.n10.arealdekke.arealdekke_dissolver module

generalization.n10.arealdekke.arealdekke_elver module

generalization.n10.arealdekke.arealdekke_innsjoer module

generalization.n10.arealdekke.arealdekke_orchestrator module

generalization.n10.arealdekke.attribute_analyzer module

generalization.n10.arealdekke.attribute_analyzer.sort_results(data: list) list[source]
generalization.n10.arealdekke.attribute_analyzer.write_to_file(data: list, filepath: str) None[source]
generalization.n10.arealdekke.attribute_analyzer.load_rules(csv_path: str) dict[source]

generalization.n10.arealdekke.attribute_changer module

generalization.n10.arealdekke.buff_small_polygon_segments module

generalization.n10.arealdekke.eliminate_small_polygons module

generalization.n10.arealdekke.expansion_controller module

generalization.n10.arealdekke.gangsykkel_dissolver module

generalization.n10.arealdekke.island_controller module

generalization.n10.arealdekke.island_controller.island_controller(input_fc: str, output_fc: str) None[source]

Main function dissolving small areas (also under minimum) on islands too small for multiple feature classes.

Parameters:
  • input_fc (str) – The input feature class with complete land use data

  • output_fc (str) – The feature class to store final output in

generalization.n10.arealdekke.island_controller.create_wfm_gdbs(wfm: WorkFileManager) dict[source]

Creates all the temporarily files that are going to be used during the process of combining land use on islands.

Parameters:

wfm (WorkFileManager) – The WorkFileManager instance that are keeping the files

Returns:

A dictionary with all the files as variables

Return type:

dict

generalization.n10.arealdekke.island_controller.copy_features_and_identifies_inner_holes(input_fc: str, files: dict) None[source]

Copy the original data into a separate feature class, add a new field on the water features where:

  • 1: polygon has inner hole

  • 0: polygon does not have inner hole

… and store those with in an own feature class.

Parameters:
  • input_fc (str) – Feature class with the original land use data

  • files (dict) – Dictionary with all the working files

generalization.n10.arealdekke.island_controller.find_hole_geometries(files: dict) None[source]

Extract hole boundaries and create own geometries of these that are of relevant size.

Parameters:

files (dict) – Dictionary with all the working files

generalization.n10.arealdekke.island_controller.find_holes_with_multiple_features(files: dict, stat_field: str) None[source]

Detects which of the hole polygons that contains multiple land use categories.

Parameters:
  • files (dict) – Dictionary with all the working files

  • stat_field (str) – Field name in statistic table

generalization.n10.arealdekke.island_controller.find_largest_feature_on_island(files: dict, stat_field: str) tuple[source]

For each of the detected relevant island, find the features with largest area.

Parameters:
  • files (dict) – Dictionary with all the working files

  • stat_field (str) – Field name in statistic table

Returns:

  • dict: Dictionary with island oid as key and feature oid with largest area inside as value

  • set: A set with object ID for all features inside relevant islands

Return type:

tuple

generalization.n10.arealdekke.island_controller.update_island_attributes(files: dict, area_ids: dict) None[source]

Sets the attributes of the island equal the largest inner polygon.

Parameters:
  • files (dict) – Dictionary with all the working files

  • area_ids (dict) – Connection between islands and inner polygons

generalization.n10.arealdekke.island_controller.update_relevant_islands(files: dict, feature_ids: set, output_fc: str)[source]

Erases the relevant island geometries from the input data and replaces these holes with the updated island polygons.

Parameters:
  • files (dict) – Dictionary with all the working files

  • feature_ids (set) – Set of object IDS that should be removed

  • output_fc (str) – The feature class to store the final data

generalization.n10.arealdekke.simplify_land_use module

generalization.n10.arealdekke.simplify_land_use.simplify_and_smooth_polygon(input_fc: str, output_fc: str) None[source]

Simplifies polygons with the WEIGHTED_AREA algorithm before they are smoothed with the BEZIER_INTERPOLATION algorithm.

Parameters:
  • input_fc (str) – The feature class with polygon geometries to be simplified and smoothed

  • output_fc (str) – The feature class where the result should be saved

Module contents