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(
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
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