Commit 262b3474 authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

Using virtual catalog

parent 7ba26ff3
......@@ -20,6 +20,7 @@ from qgis.core import (QgsProcessingAlgorithm,
QgsProcessingParameterEnum)
from qgis import processing
import glob
import gdal
import os
import sys
import shutil
......@@ -141,16 +142,16 @@ class TemporalSmoothing(QgsProcessingAlgorithm):
ndv = getNoDataValue(NDVI_TS_files[0])
nd = len(NDVI_TS_files)
'''
VRTOptions = gdal.BuildVRTOptions(separate=True)
VRT_file = os.path.join(os.path.dirname(output),'temp','input_ndvi.vrt')
gdal.BuildVRT(VRT_file,NDVI_TS_files,options=VRTOptions)
'''
tmp_folder = os.path.join(os.path.dirname(output), 'temp')
if not os.path.exists(tmp_folder):
os.mkdir(tmp_folder)
ts_vrt_opt = gdal.BuildVRTOptions(separate=True)
ts_vrt = os.path.join(tmp_folder, os.path.splitext(os.path.basename(TS_folder))[0] + '_list.vrt')
gdal.BuildVRT(ts_vrt, NDVI_TS_files, options=ts_vrt_opt)
Smooth_TS_pre = os.path.join(tmp_folder, os.path.splitext(os.path.basename(output))[0] + '_tmp.tif')
Smooth_app_parameters = {"il": NDVI_TS_files, "dates": datefile, "out": Smooth_TS_pre, "outputpixeltype":2}
Smooth_app_parameters = {"il": [ts_vrt], "dates": datefile, "out": Smooth_TS_pre, "outputpixeltype":2}
if deg != None:
Smooth_app_parameters['interp.sg.deg'] = deg
if rad != None:
......
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