varennes_gis_oo/handle_varennes_ds_workflow.py

53 lines
2.0 KiB
Python

from scrub_layer_class import *
from varennes_io_paths import *
# Making folders for the output data layers
create_output_folders(output_paths, output_paths_dir)
# Initialize the input data layers
geo_index = ScrubLayer(qgis_path, input_paths['GeoIndex'], 'GeoIndex')
varennes_boundary = \
ScrubLayer(qgis_path, input_paths['Varennes Boundary'], 'Varennes Boundary')
property_assessment_2022 = ScrubLayer(
qgis_path, input_paths['Property Assessment 2022'], 'Property Assessment 2022')
print('Processing the GeoIndex layer')
print(geo_index)
geo_index.create_spatial_index()
geo_index.fix_geometries(output_paths['Fixed GeoIndex'])
# Defining a new layer for the fixed GeoIndex
geo_index_fixed = ScrubLayer(qgis_path, output_paths['Fixed GeoIndex'],
'Fixed GeoIndex')
geo_index_fixed.create_spatial_index()
print(geo_index_fixed)
geo_index_fixed.clip_layer(varennes_boundary.layer_path,
output_paths['Clipped Fixed GeoIndex'])
geo_index_clipped = \
ScrubLayer(qgis_path,
output_paths['Clipped Fixed GeoIndex'], 'Clipped Fixed GeoIndex')
geo_index_clipped.create_spatial_index()
print(geo_index_clipped)
print('Processing the Property Assessment 2022 layer')
print(property_assessment_2022)
property_assessment_2022.create_spatial_index()
property_assessment_2022.fix_geometries(output_paths['Fixed Property Assessment 2022'])
fixed_property_assessment_2022 = ScrubLayer(
qgis_path, input_paths['Fixed Property Assessment 2022'], 'Fixed Property Assessment 2022')
fixed_property_assessment_2022.create_spatial_index()
print(fixed_property_assessment_2022)
fixed_property_assessment_2022.clip_layer(
varennes_boundary.layer_path,
output_paths['Clipped Varennes Property Assessment'])
varennes_clipped_property_assessment = ScrubLayer(
qgis_path, output_paths['Clipped Varennes Property Assessment'],
'Clipped Varennes Property Assessment')
varennes_clipped_property_assessment.create_spatial_index()
print(varennes_clipped_property_assessment)