Commit fc4681c0 authored by PIERSON Julie's avatar PIERSON Julie
Browse files

removing output since raster gets modified in place

parent 0e07d282
......@@ -82,14 +82,6 @@ class RenameBandsAlgorithm(QgsProcessingAlgorithm):
)
)
# TODO
# output raster layer
self.addParameter(
QgsProcessingParameterRasterDestination(
'OUTPUT',
self.tr('Raster output')
)
)
def processAlgorithm(self, parameters, context, feedback):
"""
......@@ -99,7 +91,6 @@ class RenameBandsAlgorithm(QgsProcessingAlgorithm):
# Retrieve inputs and outputs
input_raster = self.parameterAsRasterLayer(parameters, self.INPUT, context)
band_table = self.parameterAsMatrix(parameters, self.TABLE, context)
output_path_raster = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
# get input raster path
raster_path = input_raster.source()
......@@ -118,20 +109,9 @@ class RenameBandsAlgorithm(QgsProcessingAlgorithm):
for band_number in range(nbands):
band = raster_gdal.GetRasterBand(band_number + 1)
band.SetDescription(band_table[band_number][0])
# running gdal:translate processing algorithm
param_translate = {'INPUT': input_raster,
'TARGET_CRS':None,
'NODATA':None,
'COPY_SUBDATASETS':False,
'OPTIONS':'',
'EXTRA':'','DATA_TYPE':0,
'OUTPUT':output_path_raster
}
processing.run("gdal:translate", param_translate)
# Return the results of the algorithm as a dictionary
return {self.OUTPUT: output_path_raster, 'matrix': band_table}
return {}
def name(self):
"""
......
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