On 10 May 2016 at 02:00, René-Luc Dhont <[email protected]> wrote: > Hi devs, > > I have an issue in QGIS Server with features filtered by FeatureId. I can > reproduce the issue in Python console. > > With a vector that has joined attributes and virtual attributes, the > QgsFeatureRequest::FilterFid retrieves a feature with all the attributes > values but just the layer fields. > With the same layer, the QgsFeatureRequest::FilterFids with 1 featureId > retrieves a feature with all the attributes values and fields.
Good catch - fixed in https://github.com/qgis/QGIS/commit/3340d8ea70463385feaf72b1b4e4c6e7446b480e Nyall > > You can test it in the Python console with that code wher `l` is the vector > layer > ``` > fr = QgsFeatureRequest().setFilterFid( 2 > ).setFlags(QgsFeatureRequest.NoFlags) > fit = l.getFeatures( fr ) > for feat in fit: > len( feat.fields().toList() ) > len( feat.attributes() ) > > fr = QgsFeatureRequest().setFilterFids( [2] > ).setFlags(QgsFeatureRequest.NoFlags) > fit = l.getFeatures( fr ) > for feat in fit: > len( feat.fields().toList() ) > len( feat.attributes() ) > ``` > In the first case, the len will be different, in the second case it is the > same. > > Does some one know how to fix it ? > > Regards, > René-Luc > _______________________________________________ > Qgis-developer mailing list > [email protected] > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer _______________________________________________ Qgis-developer mailing list [email protected] List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
