Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 66fc768d authored by PIERSON Julie's avatar PIERSON Julie
Browse files

renaming bands after merging ok

parent 64fa9343
...@@ -144,19 +144,22 @@ class MergeAndRenameAlgorithm(QgsProcessingAlgorithm): ...@@ -144,19 +144,22 @@ class MergeAndRenameAlgorithm(QgsProcessingAlgorithm):
'SEPARATE' : True, 'SEPARATE' : True,
'OUTPUT' : output_raster_path 'OUTPUT' : output_raster_path
} }
merge_result = processing.run("gdal:merge", merge_param, context=context, feedback=feedback) processing.run("gdal:merge", merge_param, context=context, feedback=feedback)
#
# # RENAMING BANDS # RENAMING BANDS
#
# # iterate over each band to set its description using table input # reading merged raster as a gdal raster
# for band_number in range(nb_row): merged_raster = gdal.Open(output_raster_path)
# band = output_raster.GetRasterBand(band_number + 1) # iterate over each band to set its description using table input
# new_name = band_table[band_number][index_newname] for band_number in range(nb_row):
# # if no new name was set, use old name band = merged_raster.GetRasterBand(band_number + 1)
# if new_name == '': new_name = band_table[band_number][index_newname]
# new_name = band_table[band_number][index_oldname] # if no new name was set, use old name
# band.SetDescription(new_name) if new_name == '':
new_name = band_table[band_number][index_oldname]
band.SetDescription(new_name)
# RETURNING RESULTS # RETURNING RESULTS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment