Hi Martin, your code works fine. I used : features = QGisLayers.features(vlayerA) for inFeat in features:
from SEXTANTE module and it is not works properly. so below code: for inFeat in vproviderA.getFeatures(): idVar = inFeat [ index ] working fine. Thanks Francesco >----Messaggio originale---- >Da: wonder...@gmail.com >Data: 04/02/2013 10.06 >A: "francescobocca...@libero.it"<francescobocca...@libero.it>, "qgis-dev" <qgis-developer@lists.osgeo.org> >Ogg: Re: Re: Re: [Qgis-developer] R: Re: attributeMap() > >On Mon, Feb 4, 2013 at 9:20 AM, francescobocca...@libero.it ><francescobocca...@libero.it> wrote: >> Hi Martin, >> this is my code: >> >> vproviderA = vlayerA.dataProvider() >> >> allAttrsA = vproviderA.attributeIndexes() #vettore contente tutti >> gli indici dei campi >> >> try: >> vproviderA.select(allAttrsA) >> except: >> vproviderA.getFeatures() > >You cannot use getFeatures() like this: it returns a feature iterator >which you need to use for accessing features - the state of iteration >over features is not held there, not in the provider. This is the >easiest way to use it: > >for feature in vproviderA.getFeatures(): > type = feature["type"] > # do something with type > >Martin > _______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer