I'm trying to create a new layer in QGIS based on an existing layer. The new features should have all the attributes of the corresponding features in the original layer. I've been trying to use outFeat.setAttributeMap(inFeat.attributeMap() ) similar to what Victor Olaya is doing at http://qgissextante.blogspot.de/2012/11/spliting-vector-layer.html, but all the attributes come out as NULL.