[Qgis-developer] setSubsetOfAttributes() doean't work?

Nathan Woodrow madmanwoo at gmail.com
Tue May 28 22:29:01 PDT 2013


Alex,

Seems like a bug.  I just ran into it trying to fix
http://hub.qgis.org/issues/7781

Martin do you have any idea what might be going on?

- Nathan


On Mon, May 13, 2013 at 5:50 PM, Alexander Bruy <alexander.bruy at gmail.com>wrote:

> Hi all,
>
> I try to get features within some rectangle, and want to get only
> some attributes without geometries. So I use next code:
>
> request = QgsFeatureRequest()
> request.setFilterRect(self.extent)
> request.setFlags(QgsFeatureRequest.NoGeometry)
> request.setSubsetOfAttributes([0, 3, 6])
> f = QgsFeature()
> fit = layer.getFeatures(request)
> while fit.nextFeature(f):
>   attrs = f.attributes()
>   # process attributes
>   ...
>
> but in attrs valiable I always get *all* feature attributes. Is this
> bug or maybe I miss something?
>
> Thanks,
> --
> Alexander Bruy
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130529/09ca2573/attachment.html>


More information about the Qgis-developer mailing list