2024-03-16 16:27:25 -04:00
|
|
|
from scrub_layer_class import *
|
2024-03-26 17:30:47 -04:00
|
|
|
from basic_functions import *
|
2024-03-16 16:27:25 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ScrubMTL:
|
2024-03-27 16:51:29 -04:00
|
|
|
def __init__(self, nrcan, geoindex, property_assessment,
|
|
|
|
montreal_boundary, output_paths_dir):
|
|
|
|
self.nrcan = nrcan
|
|
|
|
self.geoindex = geoindex
|
|
|
|
self.property_assessment = property_assessment
|
|
|
|
self.montreal_boundary = montreal_boundary
|
|
|
|
self.output_paths_dir = output_paths_dir
|
|
|
|
self.output_paths = {
|
|
|
|
'Fixed NRCan': '',
|
|
|
|
'Fixed GeoIndex': '',
|
|
|
|
'Clipped Fixed GeoIndex': '',
|
|
|
|
'Splitted NRCan': '',
|
|
|
|
'Pairwise Clipped Property Assessment Partitions': '',
|
|
|
|
'Pairwise Clipped Merged Property Assessment': '',
|
|
|
|
'Property Assessment and NRCan': '',
|
|
|
|
'Property Assessment and NRCan and GeoIndex': '',
|
|
|
|
'Deleted Duplicates Layer': '',
|
|
|
|
'Singled Parts Layer': ''
|
|
|
|
}
|
2024-03-16 16:27:25 -04:00
|
|
|
|
2024-03-26 17:30:47 -04:00
|
|
|
@staticmethod
|
|
|
|
def merge_layers(layers_path, mered_layer_path):
|
|
|
|
merging_layers = find_shp_files(layers_path)
|
|
|
|
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())
|
|
|
|
|
|
|
|
params = {'LAYERS': merging_layers,
|
|
|
|
'CRS': None,
|
|
|
|
'OUTPUT': mered_layer_path}
|
|
|
|
|
|
|
|
processing.run("native:mergevectorlayers", params)
|
|
|
|
|
2024-03-16 16:27:25 -04:00
|
|
|
def generate_output_paths(self):
|
2024-03-27 16:51:29 -04:00
|
|
|
for path in self.output_paths.keys():
|
|
|
|
new_folder = path.lower().replace(' ', '_')
|
|
|
|
output_path = self.output_paths_dir + '/' + new_folder
|
|
|
|
os.mkdir(output_path)
|
|
|
|
self.output_paths[path] = output_path + f'/{new_folder}.shp'
|
2024-03-16 16:27:25 -04:00
|
|
|
|
|
|
|
def initialize_layer(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def process_nrcan(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def process_geo_index(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def process_property_assesment(self):
|
|
|
|
pass
|
|
|
|
|
2024-03-16 16:33:47 -04:00
|
|
|
def refine_heights(self):
|
|
|
|
pass
|
|
|
|
|
2024-03-16 16:27:25 -04:00
|
|
|
def remove_redundant_fields(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def remove_records_by_area(self, area_limitation):
|
|
|
|
"""Area limitation can be assigned in the constructor"""
|
|
|
|
pass
|