[Qgis-developer] QgsFeatureRequest::FilterType are mutually exclusive
Matthias Kuhn
matthias at opengis.ch
Tue Apr 28 01:29:13 PDT 2015
So far it seems that combining all the filters with an AND seems to be
the preferred solution but let's wait for some more feedbacks.
I'll just briefly answer some of the previous comments for now
On 04/28/2015 09:50 AM, Hugo Mercier wrote:
> Hi Matthias,
>
> Le 27/04/2015 17:55, Matthias Kuhn a écrit :
>> Hi all,
>>
>> I am currently working on an "expression compiler". This will allow to
>> execute (some) expressions server side. Currently postgres is the main
>> target but it can be adapted to others as well. This makes it very easy
>> to write provider-independent code that is able to make use of database
>> indexes, reduce network traffic and relocate CPU usage to a server. I
>> will write more about this later.
> Nice. Looking forward to read this :)
A bit more is already there :)
https://github.com/qgis/QGIS/pull/2012
> Yes, IMHO filterXXX() is there to express a possible use of indexes. So
> I would be to keep filterRect() and filterExpression() and then remove
> filterType.
I just thought that an additional filter type "FilterCombined" may also
be an option...
> For backward compatibility, we could decide to filter only by expression
> if a filterRect is also present.
I don't understand this. Currently it's only possible to filter by
expression without a filter rect so making a rect mandatory for an
expression filter would be diametrical to this. Can you explain what you
mean?
@Alessandro
For more ORM-style chaining it would probably be nice to have it on
QgsExpression level and not QgsFeatureRequest level like this:
QgsExpression( 'country=\'IT\'' ).and( 'region=\'Liguria\'' )
We could then have a .where() function on QgsFeatureRequest that returns
a (shared) expression:
QgsFeatureReqest().where( 'country=\'IT\'' ).and( 'region=\'Liguria\'' )
This is a much lower priority for me at the moment.
Best
Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150428/69f8644e/attachment.pgp>
More information about the Qgis-developer
mailing list