Hi, when I import a processing script in the QGIS Python console (see parts
of it below), it does not give any error and even displays ("Executing
algorithm xy"). However, the output file is not generated, i.e., there is
no file in the output directory. Does anyone know why? Do I need to save
raster output files differently? I also tried by hardcoding the filepath
(resampled = "C:/result.tif").

# Define name of resampled raster

resampled = str(os.path.splitext(f)[0] + "_" + str(j) + "pixels.tif")

# Run resampling of raster

processing.runalg('gdalogr:translate',{"INPUT":rlayer, "OUTSIZE":j,
"OUTSIZE_PERC":False, "EXPAND":2, "PROJWIN":"%f,%f,%f,%f" % (xmin, xmax,
ymin, ymax), "OUTPUT":resampled})

# Define name of tiled raster

tiled = str(os.path.splitext(f)[0] + "_" + str(j) + "pixels" + "_tiling_x"
+ str(l+1) + "y" + str(k) + ".tif")

# Run tiling of raster

processing.runalg('gdalogr:cliprasterbyextent', {"INPUT":reslayer,
"PROJWIN":"%f,%f,%f,%f" % (t_xmin,t_xmax,t_ymin,t_ymax), "OUTPUT":tiled})

Thank you,

Qgis-user mailing list
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to