Re: [Qgis-developer] iterating over fields an values API 2.0

2014-02-19 Thread PIERRE Sylvain
Yes, I will do that Sylvain -Message d'origine- De : Martin Dobias [mailto:wonder...@gmail.com] Envoyé : mardi 18 février 2014 16:05 À : PIERRE Sylvain Cc : qgis-developer@lists.osgeo.org Objet : Re: [Qgis-developer] iterating over fields an values API 2.0 On Tue, Feb 18, 2014

Re: [Qgis-developer] iterating over fields an values API 2.0

2014-02-18 Thread Martin Dobias
On Tue, Feb 18, 2014 at 9:53 PM, PIERRE Sylvain wrote: > > > Yes! > That's it > > Thanks > > PS: Don't you think it should be clearly documented in the pyqgis cookbook? Agreed. Would you mind preparing a pull request to fix that? Thanks Martin ___ Qgis

Re: [Qgis-developer] iterating over fields an values API 2.0

2014-02-18 Thread PIERRE Sylvain
jet : Re: [Qgis-developer] iterating over fields an values API 2.0 On Mon, Feb 17, 2014 at 10:36 PM, PIERRE Sylvain wrote: > > > When iterating over vector features like this: > > fields = layer.pendingFields() > field_names = [field.name() for field in fields] > for elem in

Re: [Qgis-developer] iterating over fields an values API 2.0

2014-02-17 Thread Martin Dobias
On Mon, Feb 17, 2014 at 10:36 PM, PIERRE Sylvain wrote: > > > When iterating over vector features like this: > > fields = layer.pendingFields() > field_names = [field.name() for field in fields] > for elem in layer.getFeatures(): > atr = dict(zip(field_names, elem.attributes())) > >

[Qgis-developer] iterating over fields an values API 2.0

2014-02-17 Thread PIERRE Sylvain
Hi, I'm working on porting a standalone app from 1.8 to 2.0 API When iterating over vector features like this: fields = layer.pendingFields() field_names = [field.name() for field in fields] for elem in layer.getFeatures(): atr = dict(zip(field_names, elem.attributes())) returns t