Thanks for this answer<br><br><div class="gmail_quote">2010/11/9 Carson Farmer <span dir="ltr">&lt;<a href="mailto:carson.farmer@gmail.com">carson.farmer@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
...and with the newer PyQGIS API, we can do things even more Pythonically:<br>
<br></blockquote><div><br></div><div>Is the new api usable from 1.5, or should I wait for the next version ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

def layerIds(layer):<br>
    layer.select([]) # we don&#39;t actually need the attributes<br>
    ids = [<a href="http://feat.id" target="_blank">feat.id</a>() for feat in layer]<br>
    return ids<br>
<br>
Obviously you could skip the step of creating the layerIds function,<br>
and then you&#39;d reduce the entire thing down to:<br>
<br>
layer = self.iface.mapCanvas().currentLayer() # or however else you<br>
get the layer<br>
layer.select([]) # we don&#39;t actually need the attributes<br>
layer.setSelectedFeatures([<a href="http://feat.id" target="_blank">feat.id</a>() for feat in layer]) # select all<br>
the feature ids<br></blockquote><div><br></div><div>Yes , it is more concise and the list comprehension is much more pythonistic ;)</div><div>I was on other php projects, and lost my python :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
My guess is that this would be quite a bit faster than boundingbox<br>
method, especially because select(QgsRectangle, bool) actually<br>
contains this:<br>
<br>
QgsFeature f;<br>
while ( nextFeature( f ) )<br>
{<br>
  select( <a href="http://f.id" target="_blank">f.id</a>(), false );<br>
}<br>
<br></blockquote><div><br></div><div>Ok. Thanks again ! </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
whereas setSelectedFeatures is more direct.<br>
<br>
Carson</blockquote></div>