[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-developer
Subject:    Re: [Qgis-developer] setSubsetOfAttributes() doean't work?
From:       Nathan Woodrow <madmanwoo () gmail ! com>
Date:       2013-05-29 5:29:01
Message-ID: CAAi8Yg9XJ2vMmUVa82KDAhdKnwbvXSR6tA52MFq-kB9vztghOg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>

[Attachment #5 (text/html)]

<div dir="ltr">Alex, <div><br></div><div style>Seems like a bug.  I just ran into it \
trying to fix <a href="http://hub.qgis.org/issues/7781">http://hub.qgis.org/issues/7781</a></div><div \
style><br></div><div style>Martin do you have any idea what might be going on?</div>

<div style><br></div><div style>- Nathan</div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 13, 2013 at 5:50 PM, \
Alexander Bruy <span dir="ltr">&lt;<a href="mailto:alexander.bruy@gmail.com" \
target="_blank">alexander.bruy@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi all,<br> <br>
I try to get features within some rectangle, and want to get only<br>
some attributes without geometries. So I use next code:<br>
<br>
request = QgsFeatureRequest()<br>
request.setFilterRect(self.extent)<br>
request.setFlags(QgsFeatureRequest.NoGeometry)<br>
request.setSubsetOfAttributes([0, 3, 6])<br>
f = QgsFeature()<br>
fit = layer.getFeatures(request)<br>
while fit.nextFeature(f):<br>
  attrs = f.attributes()<br>
  # process attributes<br>
  ...<br>
<br>
but in attrs valiable I always get *all* feature attributes. Is this<br>
bug or maybe I miss something?<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Alexander Bruy<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
 <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" \
target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br> \
</font></span></blockquote></div><br></div>



_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic