[Qgis-developer] Geometry of feature in python while digitizing

Marco Bernasocchi marco at bernawebdesign.ch
Fri May 11 14:53:48 PDT 2012

Hi all, I'm trying to make a custom form that can make some calculations 
on poligons when a button on it is pushed. For this I wrote a python 
script like explained by Nathan at [0].

All works when the form is opened by an action in the identify tool, but 
when the form is openend because the digitalization of the polygon is 
finished (right click) the form allways gets a featureID of 0 (using 
identify the ID varies).

So my problem is that I can't get to the geometry of the polygon just 
digitized. I allways get the geometry of feature 0.

My simplyfied function looks like this:

def openForm(dialog,layerID,featureID):
	msgBox = QMessageBox()
   	msgBox.setText("ID: " + str(featureID) )

any hints?
Thanks a lot

Marco Bernasocchi

More information about the Qgis-developer mailing list