Beispiel #1
0
    def processAlgorithm(self, feedback):
        inputFile = self.getParameterValue(self.INPUT_LAYER)
        zFactor = self.getParameterValue(self.Z_FACTOR)
        outputFile = self.getOutputValue(self.OUTPUT_LAYER)

        outputFormat = raster.formatShortNameFromFileName(outputFile)

        ruggedness = QgsRuggednessFilter(inputFile, outputFile, outputFormat)
        ruggedness.setZFactor(zFactor)
        ruggedness.processRaster(None)
Beispiel #2
0
    def processAlgorithm(self, parameters, context, feedback):
        inputFile = self.parameterAsRasterLayer(parameters, self.INPUT, context).source()
        zFactor = self.parameterAsDouble(parameters, self.Z_FACTOR, context)

        outputFile = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
        outputFormat = QgsRasterFileWriter.driverForExtension(os.path.splitext(outputFile)[1])

        ruggedness = QgsRuggednessFilter(inputFile, outputFile, outputFormat)
        ruggedness.setZFactor(zFactor)
        ruggedness.processRaster(feedback)

        return {self.OUTPUT: outputFile}
Beispiel #3
0
    def processAlgorithm(self, parameters, context, feedback):
        inputFile = exportRasterLayer(self.parameterAsRasterLayer(parameters, self.INPUT, context))
        zFactor = self.parameterAsDouble(parameters, self.Z_FACTOR, context)

        outputFile = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)

        outputFormat = raster.formatShortNameFromFileName(outputFile)

        ruggedness = QgsRuggednessFilter(inputFile, outputFile, outputFormat)
        ruggedness.setZFactor(zFactor)
        ruggedness.processRaster(feedback)

        return {self.OUTPUT: outputFile}