From 80596d33fb795bd778bd34cb59e1bea1e84f67d1 Mon Sep 17 00:00:00 2001 From: Alireza Adli Date: Tue, 23 Jul 2024 17:22:07 -0400 Subject: [PATCH] Fix & clip geoindex for Varennes --- handle_varennes_ds_workflow.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/handle_varennes_ds_workflow.py b/handle_varennes_ds_workflow.py index f078407..9caa5c0 100644 --- a/handle_varennes_ds_workflow.py +++ b/handle_varennes_ds_workflow.py @@ -8,3 +8,24 @@ create_output_folders(output_paths, output_paths_dir) geo_index = ScrubLayer(qgis_path, input_paths['GeoIndex'], 'GeoIndex') varennes_boundary = \ ScrubLayer(qgis_path, input_paths['Varennes Boundary'], 'Varennes Boundary') + + +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)