Hi Calvin, have a look at the corresponding PyQGIS documentation for the QgsFeature.attribute() method:
http://geoapis.sourcepole.com/qgispyapi/qgsfeature#QgsFeature.attribute Regards, Germán 2017-02-14 16:31 GMT-05:00 Jürgen E. Fischer <[email protected]>: > Hi Calvin, > > On Tue, 14. Feb 2017 at 14:28:14 -0500, C Hamilton wrote: > > Am I missing something here or is the second 'attribute' method invalid? > > It's valid in C++ - in python there is only the method taking the index. > > Alternatively you can pythonically access the attribute with > feature[fieldname] > and feature[fieldindex] (also for assignment) and iterate the attributes > [attr > for attr in feature]. > > > Jürgen > > -- > Jürgen E. Fischer norBIT GmbH Tel. > +49-4931-918175-31 > Dipl.-Inf. (FH) Rheinstraße 13 Fax. > +49-4931-918175-50 > Software Engineer D-26506 Norden > http://www.norbit.de > QGIS release manager (PSC) Germany IRC: jef on FreeNode > > _______________________________________________ > Qgis-developer mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer > -- ----------- |\__ (:>__)( |/ Soluciones Geoinformáticas Libres http://geotux.tuxfamily.org/ http://twitter.com/GeoTux2 http://about.me/germancarrillo <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
_______________________________________________ Qgis-developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
