Skip to content

Commit

Permalink
Merge pull request #124 from kartverket/small_updates
Browse files Browse the repository at this point in the history
Small updates
  • Loading branch information
maribhe authored Apr 4, 2024
2 parents e9225d9 + 0a01ff6 commit 25f5a94
Show file tree
Hide file tree
Showing 18 changed files with 617 additions and 585 deletions.
6 changes: 3 additions & 3 deletions custom_tools/custom_arcpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def select_location_and_make_feature_layer(
Example:
>>> custom_arcpy.select_location_and_make_feature_layer(
... input_layer=Building_N100.data_preparation___large_enough_polygon___n100_building.value,
... input_layer=Building_N100.data_preparation___polygons_that_are_large_enough___n100_building.value,
... overlap_type=custom_arcpy.OverlapType.INTERSECT.value,
... select_features=Building_N100.grunnriss_to_point__aggregated_polygon__n100.value,
... output_name=Building_N100.polygon_to_point___intersect_aggregated_and_original___n100_building.value,
... output_name=Building_N100.simplify_polygons___not_intersect_aggregated_and_original_polygon___n100_building.value,
... inverted=True,
... )
'grunnriss_to_point__intersect_aggregated_and_original__n100' created temporarily.
Expand Down Expand Up @@ -271,7 +271,7 @@ def select_location_and_make_permanent_feature(
Example:
>>> custom_arcpy.select_location_and_make_permanent_feature(
... input_layer=Building_N100.data_preperation___selected_waterfeatures_from_begrensningskurve___n100_building.value,
... input_layer=Building_N100.data_preperation___waterfeatures_from_begrensningskurve_not_rivers___n100_building.value,
... overlap_type=OverlapType.WITHIN_A_DISTANCE.value,
... select_features=Building_N100.polygon_propogate_displacement___after_displacement___n100_building.value,
... output_name=Building_N100.polygon_propogate_displacement___begrensningskurve_500m_from_displaced_polygon___n100_building.value,
Expand Down
2 changes: 1 addition & 1 deletion custom_tools/partition_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def run(self):
inputs = {
building_points: [
"input",
Building_N100.data_preparation___matrikkel_bygningspunkt___n100_building.value,
Building_N100.data_preparation___matrikkel_points___n100_building.value,
],
building_polygons: [
"input",
Expand Down
2 changes: 1 addition & 1 deletion custom_tools/partition_iterator_state_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def run(self):
inputs = {
building_points: [
"input",
Building_N100.data_preparation___matrikkel_bygningspunkt___n100_building.value,
Building_N100.data_preparation___matrikkel_points___n100_building.value,
],
building_polygons: [
"input",
Expand Down
188 changes: 92 additions & 96 deletions file_manager/n100/file_manager_buildings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
polygon_to_point = "polygon_to_point"
calculating_field_values = "calculating_field_values"
point_propogate_displacement = "point_propogate_displacement"
point_cleanup = "point_cleanup"
removing_points_in_water_features = "removing_points_in_water_features"
hospital_church_clusters = "hospital_church_clusters"
point_displacement_with_buffer = "point_displacement_with_buffer"
points_to_squares = "points_to_squares"
Expand Down Expand Up @@ -85,10 +85,27 @@ class Building_N100(Enum):
# DATA PREPARATION
# ========================================

data_preperation___selected_waterfeatures_from_begrensningskurve___n100_building = (
data_preperation___waterfeatures_from_begrensningskurve_not_rivers___n100_building = file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="waterfeatures_from_begrensningskurve_not_rivers",
)

data_preperation___waterfeatures_from_begrensningskurve_rivers___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="selected_waterfeatures_from_begrensningskurve",
description="waterfeatures_from_begrensningskurve_rivers",
)
)

data_preperation___waterfeatures_from_begrensningskurve_rivers_buffer___n100_building = file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="waterfeatures_from_begrensningskurve_rivers_buffer",
)

data_preparation___merged_begrensningskurve_all_waterbodies___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="merged_begrensningskurve_all_waterbodies",
)
)

Expand Down Expand Up @@ -134,10 +151,10 @@ class Building_N100(Enum):
)
)

data_preparation___unsplit_veg_sti___n100_building = (
data_preparation___unsplit_roads___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="unsplit_veg_sti",
description="unsplit_roads",
)
)

Expand Down Expand Up @@ -169,52 +186,78 @@ class Building_N100(Enum):
)
)

data_preparation___matrikkel_bygningspunkt___n100_building = (
data_preparation___matrikkel_points___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="matrikkel_bygningspunkt",
description="matrikkel_points",
)
)

data_preparation___n50_points___n100_building = file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="n50_points",
)

data_preparation___grunnriss_copy___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="grunnriss_copy",
)
)

data_preparation___large_enough_polygon___n100_building = (
data_preparation___polygons_that_are_large_enough___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="large_enough_polygon",
description="polygons_that_are_large_enough",
)
)

data_preparation___too_small_polygon___n100_building = (
data_preparation___polygons_that_are_too_small___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="too_small_polygon",
description="polygons_that_are_too_small",
)
)

data_preparation___points_created_from_small_polygon___n100_building = (
data_preparation___points_created_from_small_polygons___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="points_created_from_small_polygon",
description="points_created_from_small_polygons",
)
)

# ========================================
# CALCULATING FIELD VALUES
# ========================================
data_preperation___matrikkel_n50_points_merged___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="matrikkel_n50_points_merged",
)
)

calculating_field_values___merged_points_n50_matrikkel___n100_building = (
data_preparation___n50_polygons___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=calculating_field_values,
description="merged_points_n50_matrikkel",
script_source_name=data_preparation,
description="n50_polygons",
)
)

data_preparation___n50_points_in_urban_areas___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="n50_points_in_urban_areas",
)
)

data_preparation___churches_and_hospitals_in_urban_areas___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=data_preparation,
description="churches_and_hospitals_in_urban_areas",
)
)

# ========================================
# CALCULATING FIELD VALUES
# ========================================

calculate_field_values___points_pre_resolve_building_conflicts___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=calculating_field_values,
Expand All @@ -237,20 +280,6 @@ class Building_N100(Enum):
# POLYGON TO POINT
# ========================================

polygon_to_point___intersect_aggregated_and_original___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=polygon_to_point,
description="intersect_aggregated_and_original",
)
)

polygon_to_point___polygons_to_point___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=polygon_to_point,
description="polygons_to_point",
)
)

polygon_to_point___spatial_join_points___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=polygon_to_point,
Expand All @@ -269,6 +298,18 @@ class Building_N100(Enum):
# SIMPLIFY POLYGONS
# ========================================

simplify_polygons___aggregated_polygons_to_points___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=simplify_polygons,
description="aggregated_polygons_to_points",
)
)

simplify_polygons___not_intersect_aggregated_and_original_polygon___n100_building = file_manager.generate_file_name_gdb(
script_source_name=polygon_to_point,
description="not_intersect_aggregated_and_original_polygon",
)

simplify_polygons___small_gaps___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=simplify_polygons,
Expand Down Expand Up @@ -304,9 +345,11 @@ class Building_N100(Enum):
)
)

simplify_polygons___polygons___n100_building = file_manager.generate_file_name_gdb(
script_source_name=simplify_polygons,
description="polygons",
simplify_polygons___simplify_polygon___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=simplify_polygons,
description="simplify_polygon",
)
)

simplify_polygons___points___n100_building = file_manager.generate_file_name_gdb(
Expand Down Expand Up @@ -344,9 +387,9 @@ class Building_N100(Enum):
)
)

polygon_propogate_displacement___displacement_feature_1000m_from_polygon___n100_building = file_manager.generate_file_name_gdb(
polygon_propogate_displacement___displacement_feature_500m_from_polygon___n100_building = file_manager.generate_file_name_gdb(
script_source_name=polygon_propogate_displacement,
description="displacement_feature_1000m_from_polygon",
description="displacement_feature_500m_from_polygon",
)

polygon_propogate_displacement___begrensningskurve_500m_from_displaced_polygon___n100_building = file_manager.generate_file_name_gdb(
Expand Down Expand Up @@ -550,7 +593,6 @@ class Building_N100(Enum):
)
)

# Function: reducing_clusters
hospital_church_clusters___minimum_bounding_geometry_hospital___n100_hospital = (
file_manager.generate_file_name_gdb(
script_source_name=hospital_church_clusters,
Expand Down Expand Up @@ -607,76 +649,30 @@ class Building_N100(Enum):
)
)

point_propogate_displacement___displacement_feature_500m_from_point___n100_building = file_manager.generate_file_name_gdb(
script_source_name=point_propogate_displacement,
description="displacement_feature_500m_from_point",
)

point_propogate_displacement___points_after_propogate_displacement___n100_building = file_manager.generate_file_name_gdb(
script_source_name=point_propogate_displacement,
description="points_after_propogate_displacement",
)

# ========================================
# POINT CLEANUP
# REMOVING POINTS IN WATER FEATURES
# ========================================

point_cleanup___water_features___n100_building = (
removing_points_in_water_features___water_features___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
script_source_name=removing_points_in_water_features,
description="water_features",
)
)

point_cleanup___points_that_intersect_water_features___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="points_that_intersect_water_features",
)
)

point_cleanup___points_not_intersecting_buffer___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="points_not_intersecting_buffer",
)
)

point_cleanup___building_points_to_squares___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="building_points_to_squares",
)
)

point_cleanup___points_50m_from_building_polygons___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="points_50m_from_building_polygons",
)
)

point_cleanup___polygons_not_too_close_to_squares___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="polygons_not_too_close_to_squares",
)
)

point_cleanup___polygons_too_close_to_squares___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="polygons_too_close_to_squares",
)
)

point_cleanup___building_points_final___n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="building_points_final",
)
)

point_cleanup___building_points_merged_final__n100_building = (
file_manager.generate_file_name_gdb(
script_source_name=point_cleanup,
description="building_points_merged_final",
)
removing_points_in_water_features___points_that_do_not_intersect_water_features___n100_building = file_manager.generate_file_name_gdb(
script_source_name=removing_points_in_water_features,
description="points_that_do_not_intersect_water_features",
)

############################################## NEEDS TO BE UPDATED ###########################################################
Expand Down
5 changes: 3 additions & 2 deletions generalization/n100/building/building_main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Importing modules
from env_setup import environment_setup
from custom_tools.timing_decorator import timing_decorator
from custom_tools.timing_decorator import clear_print_output

# Importing building scripts
from generalization.n100.building import data_preparation
Expand All @@ -13,7 +14,7 @@
from generalization.n100.building import point_displacement_with_buffer
from generalization.n100.building import points_to_squares
from generalization.n100.building import resolve_building_conflicts_points
from generalization.n100.building import point_cleanup
from generalization.n100.building import removing_points_in_water_features
from generalization.n100.building import data_clean_up


Expand Down Expand Up @@ -50,7 +51,7 @@ def main():
11. clean_up_building
"""

clear_print_output()
environment_setup.main()
data_preparation.main()
simplify_polygons.main()
Expand Down
Loading

0 comments on commit 25f5a94

Please sign in to comment.