You can download the shapefiles then create a Geodatabase and a new feature class of the desired coordinate system with the same field mapping as the source data. (You can import fields from the source shapefile during the process)
Once created, right click on the feature class --> Load Data
This way you can load many source shapefiles into one destination feature class on one shot.
OK here's the answer.
I have discovered the processing toolbox from which there was a simple solution: As per http://qgis.org/de/docs/user_manual/processing/console.html
From the console you can get a list of all the algorithms available which contain the word "merge" by typing:
import processing
processing.alglist("merge")
Then you could find out how to use the most appropriate function with:
processing.alghelp("qgis:mergevectorlayers")
Then simply use the algorithm in your script as follows:
processing.runalg("qgis:mergevectorlayers", layer1, layer2,"outputfilename.shp")
On the other hand manually merging shapes may still be useful. For those who still want to manually copy features from an input layer into some destination layer with attributes you need to first make sure the destination layer has those fields.
old_attribute_List = input_layer.dataProvider().fields().toList()
new_attribute_List=[]
for attrib in old_attribute_List:
if destination_layer.fieldNameIndex(attrib.name())==-1:
new_attribute_List.append(QgsField(attrib.name(),attrib.type()))
destination_layer_data_provider.addAttributes(new_attribute_List)
destination_layer.updateFields()
Then to manually copy over the features you can do:
destination_layer.startEditing()
cfeature = QgsFeature()
cfeatures=[]
xfeatures = input_layer.getFeatures()
for xfeature in xfeatures:
xgeometry = xfeature.geometry()
#GEOMETRY TRANSFORM GOES HERE IF DESTINATION CRS DIFFERS FROM INPUT CRS
cfeature_Attributes=[]
cfeature_Attributes.extend(xfeature.attributes())
cfeature.setGeometry(xgeometry)
cfeature.setAttributes(cfeature_Attributes)
cfeatures.append(cfeature)
destination_layer_data_provider.addFeatures(cfeatures)
destination_layer_data_provider.commitChanges()
Best Answer
Use the Merge (Data Management) geoprocessing tool.
It should give you a merged polygon with all the attributes intact.