From 04c10dacfb3bddd2fb5753ead20df53f9fe6261e Mon Sep 17 00:00:00 2001 From: Alireza Adli Date: Thu, 28 Mar 2024 18:34:42 -0400 Subject: [PATCH] Add processing Property Assessment method --- scrub_mtl_class.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scrub_mtl_class.py b/scrub_mtl_class.py index df766fa..5bf079f 100644 --- a/scrub_mtl_class.py +++ b/scrub_mtl_class.py @@ -3,12 +3,13 @@ from basic_functions import * class ScrubMTL: - def __init__(self, qgis_path, nrcan, geoindex, property_assessment, + def __init__(self, qgis_path, nrcan, geo_index, property_assessment, montreal_boundary, output_paths_dir): self.qgis_path = qgis_path - self.nrcan = nrcan - self.geoindex = geoindex - self.property_assessment = property_assessment + self.nrcan = self.initialize_layer(nrcan, 'NRCan') + self.geo_index = self.initialize_layer(geo_index, 'GeoIndex') + self.property_assessment = \ + self.initialize_layer(property_assessment, 'Property Assessment') self.montreal_boundary = montreal_boundary self.output_paths_dir = output_paths_dir self.output_paths = { @@ -46,10 +47,9 @@ class ScrubMTL: return ScrubLayer(self.qgis_path, layer_path, layer_name) def process_nrcan(self): - nrcan = self.initialize_layer(self.nrcan, 'NRCan') - print(f'Data Count of the NRCan layer: {nrcan.data_count}') - nrcan.create_spatial_index() - nrcan.fix_geometries(self.output_paths['Fixed NRCan']) + print(f'Data Count of the NRCan layer: {self.nrcan.data_count}') + self.nrcan.create_spatial_index() + self.nrcan.fix_geometries(self.output_paths['Fixed NRCan']) nrcan_fixed = \ self.initialize_layer(self.output_paths['Fixed NRCan'], 'Fixed NRCan') @@ -58,10 +58,9 @@ class ScrubMTL: f'after fixing geometries: {nrcan_fixed.layer.featureCount()}') def process_geo_index(self): - geo_index = self.initialize_layer(self.geoindex, 'GeoIndex') - print(f'Data Count of the GeoIndex layer: {geo_index.data_count}') - geo_index.create_spatial_index() - geo_index.fix_geometries(self.output_paths['Fixed GeoIndex']) + print(f'Data Count of the GeoIndex layer: {self.geo_index.data_count}') + self.geo_index.create_spatial_index() + self.geo_index.fix_geometries(self.output_paths['Fixed GeoIndex']) geo_index_fixed = \ self.initialize_layer(self.output_paths['Fixed GeoIndex'], 'Fixed GeoIndex') @@ -78,9 +77,10 @@ class ScrubMTL: f'({geo_index_clipped.layer_name}) after clipping it ' f'based on the Montreal Boundary layer: ' f'{geo_index_clipped.layer.featureCount()}') - + def process_property_assesment(self): - pass + print(f'Data Count of the GeoIndex layer: {self.property_assessment.data_count}') + self.property_assessment.create_spatial_index() def refine_heights(self): pass