Delete unnecessary fields

This commit is contained in:
Alireza Adli 2024-08-21 11:47:19 -04:00
parent 2d7a37f250
commit 8a37075c11

View File

@ -20,9 +20,30 @@ duplcated = 'C:/Users/a_adli/PycharmProjects/varennes_gis_oo/' \
# First, the layer will be duplicated as some records are going to be removed
varennes_nrcan = ScrubLayer(qgis_path, nrcan_varennes, 'NRCan Varennes')
varennes_nrcan_duplicate = varennes_nrcan.duplicate_layer(
duplcated, 'NRCan duplicated')
# Deleting duplicated layer unnecessary fields (will be added later)
varennes_nrcan_duplicate.delete_field('acqtech')
varennes_nrcan_duplicate.delete_field('acqtech_en')
varennes_nrcan_duplicate.delete_field('acqtech_fr')
varennes_nrcan_duplicate.delete_field('provider')
varennes_nrcan_duplicate.delete_field('provider_e')
varennes_nrcan_duplicate.delete_field('provider_f')
varennes_nrcan_duplicate.delete_field('datemin')
varennes_nrcan_duplicate.delete_field('datemax')
varennes_nrcan_duplicate.delete_field('haccmin')
varennes_nrcan_duplicate.delete_field('haccmax')
varennes_nrcan_duplicate.delete_field('vaccmin')
varennes_nrcan_duplicate.delete_field('vaccmax')
varennes_nrcan_duplicate.delete_field('heightmin')
varennes_nrcan_duplicate.delete_field('heightmax')
varennes_nrcan_duplicate.delete_field('elevmin')
varennes_nrcan_duplicate.delete_field('elevmax')
varennes_nrcan_duplicate.delete_field('bldgarea')
varennes_nrcan_duplicate.delete_field('comment')
tolerance = 5
varennes_nrcan_features = varennes_nrcan.layer.getFeatures()
varennes_nrcan_duplicate_features = \