[QGIS-Developer] Proposal: changing the behaviour of QgsFeatureRequest

Nyall Dawson nyall.dawson at gmail.com
Sun Apr 28 16:46:40 PDT 2019


On Sun, 28 Apr 2019 at 07:18, Alexis R.L. <alroyliz0 at gmail.com> wrote:
>
> Greetings Everyone,
>
> While working on my PR (9648) I noticed that expression filter and a list of feature IDs are both considered the same thing cannot be used as two filtering criteria.
>
> I am aware that the intent was to only have one element active to filter out features other than the rectangle(? might be wrong on that one).
>
> What I am wondering if it would be a good thing to have both co exist (mostly for my PR as of now). A simply way to do so would be to use the give feature ids as the list to iterate over and check for the expression if there is one.

I also think this would be desirable. The tricky part (well, one
tricky part -- feature iterators are low level stuff, lots of
complexity there!) is avoiding any API breakage while adding new
methods to handle your use case.

The other (SUPER) tricky bit is that any change to feature requests
usually requires accompanying changes to every vector data provider in
order to keep consistent behaviour across all these providers. The
same request should always give the same result, regardless of the
actual underlying data provider. The consequence of this is that
you'll need to be update the postgres, mssql, oracle, OGR, memory,
spatialite, wfs, arcgis feature server, db2, and vector layer feature
iterator code. You'll also need to add many new unit tests to cover
all the changes to the different providers.

Definitely not a trivial change! Don't let this put you off making it,
but just be aware that this change would take even a QGIS core
developer a week or more of work to implement.

Nyall



>
> I assume that such a thing might be implemented without touching the current behaviour, otherwise one would have to remove either the expression or the IDs in some case when we want to override the current filtering method.
>
> Using multiple filtering method might be better than only forcing one and would provide more flexibility.
>
> As I have a PR that is related to this (https://github.com/qgis/QGIS/pull/9816 ) I would like to address this point in it and would like to have the discussion occur there as to the best way to implement such a thing without any breakage if people are not opposed to having only one filtering method in qgsfeaturerequest.
>
> Thanks and have a nice day!
>
> Alex
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list