Commit 54f1fa73 authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

WIP: complete refactoring of stratification application.

parent 2e78c0c7
......@@ -16,12 +16,14 @@ from qgis.core import (QgsProcessingAlgorithm,
QgsProcessingParameterFile,
QgsProcessingParameterString,
QgsProcessingParameterNumber,
QgsProcessingParameterBoolean,
QgsProcessingParameterRasterLayer,
QgsProcessingParameterRasterDestination)
from qgis import processing
import os
import gdal
import datetime
from shutil import rmtree
def find_next_date(datelist, date):
for i,l in enumerate(datelist):
......@@ -223,6 +225,14 @@ class LandscapeStratification(QgsProcessingAlgorithm):
)
)
self.addParameter(
QgsProcessingParameterBoolean(
self.KEEP_TEMP,
self.tr('Keep temporary files'),
defaultValue=False
)
)
def processAlgorithm(self, parameters, context, feedback):
Smooth_TS = self.parameterAsString(
......@@ -307,4 +317,7 @@ class LandscapeStratification(QgsProcessingAlgorithm):
out_layer = processing.run('otb:ManageNoData', ND_app_parameters, context=context, feedback=feedback)
setNoDataValue(LS_Strat, ndv)
if not parameters['KEEP_TEMP']:
rmtree(tmp_folder)
return {self.OUTPUT: out_layer}
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