[Qgis-developer] QgsFeatureRequest::FilterType are mutually exclusive

Luigi Pirelli luipir at gmail.com
Tue Apr 28 00:39:49 PDT 2015


Hi MAthias,

thank you to let this thread live again... I already faced this code
limit times ago.
I just facing the limit on filtering locally instead of by server.
Problem especially heavy when managing big time series.
About your proposed solution I understand that filterExpression class
is mainly introduced to allow retro-compatibility, so old code remain
doing filtering using filterExpression class 1 (default) that leave
filterRect and filterExpression unmerged.

With this point of view I prefer solution 1.

regards, Luigi Pirelli

**************************************************************************************************
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Elance: https://www.elance.com/s/edit/luigipirelli/
* GitHub: https://github.com/luipir
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* Mastering QGIS:
https://www.packtpub.com/application-development/mastering-qgis
**************************************************************************************************


On 27 April 2015 at 17:55, Matthias Kuhn <matthias at opengis.ch> wrote:
> 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.
>
> One thing that I am currently working on is to apply this to the
> rule-based renderer. Especially for small-scale situations where a lot
> of features are in the visible extent but only a small fraction meeting
> certain criteria shall be rendered this can improve rendering speed.
>
> The problem that I am currently facing is, that the feature request does
> not allow combining a filterRect (extent) and an expression, since you
> can either set the request to filter by extent OR by expression.
>
> I thought about removing the FilterRect type and instead always combine
> it with the active filter type. E.g. if the filterType is
> filterExpression "class = 2" and a rect is set the two clauses will be
> joined by an AND. This may change the behavior of existing code in some
> cases but probably not much. Worse is that all providers will need to be
> revised to change this behavior...
> Another option would be to set the filterType to Expression and append
> an "AND INTERSECTS ..." to the expression. Probably this has to be done
> conditionally only for providers that can compile expressions because
> such a solution would bypass spatial indexes that work with filterRect
> (but not with the INSERSECTS operator).
>
> I am trying not to overcomplicate this. Are there any opinions, ideas,
> caveats, etc. that others can think of?
>
> Thank you for any feedback,
> Matthias
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list