Hi Martin, thanks for your answer. I receive another type of error: "/home/francesco/.qgis//python/plugins/sextante_animove/href.py", line 126, in processAlgorithm idVar = inFeat[index] KeyError: '0'
where is the problem? Thanks Francesco >----Messaggio originale---- >Da: wonder...@gmail.com >Data: 02/02/2013 17.33 >A: "francescobocca...@libero.it"<francescobocca...@libero.it> >Cc: "qgis-developer@lists.osgeo.org"<qgis-developer@lists.osgeo.org> >Ogg: Re: [Qgis-developer] attributeMap() > >Hi Francesco > >On Sat, Feb 2, 2013 at 4:24 PM, francescobocca...@libero.it ><francescobocca...@libero.it> wrote: >> i have some problem to adapt my old code to new API. >> i have below piece of code: >> >> index = vproviderA.fieldNameIndex(field) >> atMap = inFeat.attributeMap() >> idVar = atMap[ index ] >> >> to get a value of a this features in a field. >> Now is it no possbile because QgsFeature hasn't attributeMap(). > >attributeMap() has been replaced by attributes(), but there's >additionally an easier way how to access attributes by indices: >>>> idVar = inFeat[0] > >And now there is even easier way for accessing attributes - directly >by field name: >>>> idVar = inFeat["name"] > >Martin > _______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer