Hi Giovanni, On Thu, Oct 16, 2014 at 7:45 PM, G. Allegri <gioha...@gmail.com> wrote: > I need to iterate over a layer without the need of geometries. > I rembember I used this flag time ago and it worked fine. Now, if I set this > on the feature request, I get an empty set of features from the iterator. Am > I doing something wrong? > > req = QgsFeatureRequest(QgsExpression('$area>1000,00')) > reg.setFlags(QgsFeatureRequest.NoGeometry) > feats = [f for f in mylayer.getFeatures(req)]
if you set flag to NoGeometry you cannot pass the $area function as it needs of the geometry in order to calculate the correct value. your snippet should to work whether you store the value of $area in a new field and use it in your espression Could this be a reason? :) Ciao. -- Salvatore Larosa linkedIn: http://linkedin.com/in/larosasalvatore twitter: @lrssvt skype: s.larosa IRC: lrssvt on freenode _______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer