I have a TimeManager-handled layer, meaning a layer which has a filter on it based on a attribute 'time'. So the layer has a subsetString.

Say, the total hour based dataset is 24 hour, so I see 1 hour at a time (using TimeManager)

BUT now I want to select all features from the original/whole dataset based on another attribute (usecase: select 1 feature and find others based on the value of one attribute of that feature, and show the count in total set).

I tried something like:

l=iface.mapCanvas().currentLayer()
request = QgsFeatureRequest()
request.disableFilter()
it = l.getFeatures( request.setFilterExpression( u'"device" = \'NL1212\'' ) )
i=0
for f in it:
    i += 1
    print "{} {}".format(i, f['gml_id'])

But still I get just 1 result.

Looking into the api I found: layer.dataProvider().featureSource().getFeatures(), but that already has the subsetString set

Anybody a clue or workaround (loading the data a second time in a hidden layer??)

Regards,

Richard
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to