Re: [Qgis-developer] How to get Provider default values for each attribute using Python

2013-02-08 Thread Alexandre Neto
Thank you Vinayan. Based on your code, I was able to make it work like this: new_attributes = layer.pendingFields() for j in new_attributes: if provider.defaultValue(j).isNull(): new_attributes[j] = feature.attributeMap()[j] else: new_attributes[j] = provider.defaultValue(

Re: [Qgis-developer] How to get Provider default values for each attribute using Python

2013-02-05 Thread vinayan
Hi Alexandre, I recently used provider default values in a plugin like this.. provider = layer.dataProvider() f = QgsFeature() #On the Fly reprojection. if layerCRSSrsid != projectCRSSrsid: geom.transform(QgsCoordinateTransform(projectCRSSrsid, layerCR

[Qgis-developer] How to get Provider default values for each attribute using Python

2013-02-05 Thread Alexandre Neto
I'm not sure if this is the right place to put this kind of questions, has all I see in here are much more complex debates about the actual developping of QGIS. I'm not very proficient neither with Python or QGIS API, but i'm trying to create a plugin that allows one to transform a selected multip