I have a set of different layers (and their respective shapefiles) with information of electric lines. All the layers have the same Fields in their Attribute Tables, but contain information about different features. I want to merge only the layers that I choose and save them into a new QgsVectorLayer (Or something similar).
To get all of the layers, I'm using this:
lyrs = self.iface.legendInterface().layers()
And I want to get something like:
new_layer=lyrs+lyrs new_layer.getFeatures() #Do something else from here, but is irrelevant to the question
(Obviously that last part won't work because "TypeError: unsupported operand type(s) for +: 'QgsVectorLayer' and 'QgsVectorLayer'", but that is the idea of what I need to get)
1: I would prefer a method that does not create a new shapefile like "qgis:mergevectorlayers" (The method will be called multiple times, and it would create a lot of unnecesary shapefiles)