Skip to content
Permalink
Browse files

[processing] adapt algorithms to use new band parameter

  • Loading branch information
alexbruy committed Aug 4, 2017
1 parent 49bfe69 commit 7c706d23cead9179eeae2cbcbc2734ec57350dd4
@@ -30,7 +30,7 @@
from qgis.core import (QgsRectangle,
QgsRasterBandStats,
QgsProcessingParameterRasterLayer,
QgsProcessingParameterNumber,
QgsProcessingParameterBand,
QgsProcessingParameterFileDestination,
QgsProcessingOutputHtml,
QgsProcessingOutputNumber)
@@ -60,10 +60,10 @@ def __init__(self):
def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT,
self.tr('Input layer')))
self.addParameter(QgsProcessingParameterNumber(self.BAND,
self.tr('Band number'),
QgsProcessingParameterNumber.Integer,
1, False, 1, 999))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
self.INPUT))
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT_HTML_FILE, self.tr('Statistics'), self.tr('HTML files (*.html)'), None, True))
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT_HTML_FILE, self.tr('Statistics')))

@@ -35,7 +35,7 @@
QgsProcessingParameterVectorLayer,
QgsProcessingParameterRasterLayer,
QgsProcessingParameterString,
QgsProcessingParameterNumber,
QgsProcessingParameterBand,
QgsProcessingParameterEnum,
QgsProcessingOutputVectorLayer)

@@ -78,9 +78,10 @@ def initAlgorithm(self, config=None):

self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT_RASTER,
self.tr('Raster layer')))
self.addParameter(QgsProcessingParameterNumber(self.RASTER_BAND,
self.tr('Raster band'),
minValue=1, maxValue=999, defaultValue=1))
self.addParameter(QgsProcessingParameterBand(self.RASTER_BAND,
self.tr('Raster band'),
1,
self.INPUT_RASTER))
self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT_VECTOR,
self.tr('Vector layer containing zones'),
[QgsProcessing.TypeVectorPolygon]))

0 comments on commit 7c706d2

Please sign in to comment.
You can’t perform that action at this time.