The script below is to merge number of layers in a specific group, the output layer name is Merged. How can I change the name? I tried to change the output parameters but it's not working.
root = QgsProject.instance().layerTreeRoot()
group = root.findGroup("RL")
layers = [layer.layer()
for layer in group.children()]
merged = processing.run("native:mergevectorlayers",\
{'LAYERS': layers, 'OUTPUT':"TEMPORARY_OUTPUT"})["OUTPUT"]
QgsProject.instance().addMapLayer(merged, False)
root.insertLayer(0, merged)
root = QgsProject.instance().layerTreeRoot()
group = root.findGroup("SL")
layers = [layer.layer()
for layer in group.children()]
merged = processing.run("native:mergevectorlayers",
{'LAYERS': layers, 'OUTPUT':"TEMPORARY_OUTPUT"})["OUTPUT"]
QgsProject.instance().addMapLayer(merged, False)
root.insertLayer(0, merged)
;with Python – Matt Jan 23 '22 at 12:11