Hi,

I have a point SHAPE layer with 4 points on a line (just to make them easy to 
number in this example, and the layer is created in QGIS).


1.       Start editing.

2.       Delete point number 3.

3.       In the python console do the following:

>>> len(list(iface.mapCanvas().currentLayer().getFeatures()))
3
>>> len(list(iface.mapCanvas().currentLayer().dataProvider().getFeatures()))
4
>>> req = QgsFeatureRequest()
>>> req = req.setLimit(3)
>>> len(list(iface.mapCanvas().currentLayer().getFeatures(req)))
2
>>> len(list(iface.mapCanvas().currentLayer().dataProvider().getFeatures(req)))
3

If I access the features using the data provider with no request, I get too 
many features back. If I use a request when getting features directly from the 
layer, I get too few features back.

I guess the layer directly gives me the best result, but it chokes when the 
request is limited.

Who can I trust when getting features during an editing session? Or should I 
approach this in another way?

Regards, Casper

Using QGIS master (d3882d5) in Windows 7, x64
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to