Sunday 23 June 2019

How to rename the result of a QGIS Processing Algorithm


When calling a QgsAlgorithm from within another, the result will be named after this algorithm output regardless of what is setup as the output of the main one.


For instance, taking the code from the answer to this question, although the output is set with the name 'OUTPUT' and the returned dictionary is the following:


{'OUTPUT': 'clipped_xxxxxxxxxxxxxxxxxxxxx'}

the output layer is actually named 'clipped' and I cannot seem to be able to change this.


I've tried the setName() method on the QgsVectorLayer retrieved with QgsProcessingUtils.mapLayerFromString() but to no avail.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...