[Qgis-developer] Error is QgsFeature API Documentation

Germán Carrillo carrillo.german at gmail.com
Tue Feb 14 13:46:19 PST 2017


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 <jef at norbit.de>:

> 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
> Qgis-developer at lists.osgeo.org
> 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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170214/edc80e0f/attachment.html>


More information about the Qgis-developer mailing list