I have a huge amount of Raster Layers and I only want to change the cell size using gdal warpreproject. This is my attempt:
import os.path, glob
inputpath = 'C:/Users/DGM1'
outputpath = 'C:/Users/output'
directory = os.fsencode(inputpath)
os.chdir(inputpath)
for file in glob.glob('*.txt'):
print(file)
filename = os.fsdecode(file)
inputname = os.path.join(os.fsdecode(directory), filename)
outputname = outputpath + "warped" + str(filename)
processing.run("gdal:warpreproject",
{'INPUT':inputname, 'SOURCE_CRS':None,
'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:25832'),
'RESAMPLING':0, 'NODATA':None, 'TARGET_RESOLUTION':5, 'OPTIONS':'',
'DATA_TYPE':0, 'TARGET_EXTENT':None, 'TARGET_EXTENT_CRS':None,
'MULTITHREADING':False, 'EXTRA':'', 'OUTPUT':outputname})
I don't get any mistake when running the code but there are no raster layers saved to the output.
Any idea what could be the mistake?