Add processing Property Assessment method

This commit is contained in:
Alireza Adli 2024-03-28 18:34:42 -04:00
parent f91764184d
commit 04c10dacfb

View File

@ -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')
@ -80,7 +79,8 @@ class ScrubMTL:
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