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.

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

Reply via email to