1

I'm trying to add the attribute $area. I made a intersection and Tot_aera isn't the good one, so I want to add a new.

I made that :

from PyQt4.QtCore import *
try:
    if ind==-1:
        if caps & QgsVectorDataProvider.AddAttributes:
            res=provider.addAttributes( [ QgsField(nameattr,QVariant.Double) ] )
except:
    print "FALSE"

So I have a new attribute but NULL. So my question : How put "$area" in nameattr?

menes
  • 1,421
  • 2
  • 7
  • 24
Kwentinus
  • 11
  • 1

0 Answers0