qgis / QGIS-Documentation

QGIS Documentation
https://docs.qgis.org/latest
477 stars 700 forks source link

[FEATURE] Add feature filter algorithm #2533

Closed QGIS-feature-tracker closed 5 years ago

QGIS-feature-tracker commented 6 years ago

Original commit: https://github.com/qgis/QGIS/commit/147f6e71c46a5f1fd3d5b0da97f0a7028568552f by m-kuhn

Adds a new "feature filter" algorithm. This algorithm takes a list of expressions and creates an output for each of them. Matching features from the input layer are sent to the outputs.

This allows for an algorithm to only handle a subset of incoming features or to send different features to different outputs.

The algorithm is only available in the modeler.

havatv commented 5 years ago

@DelazJ, @m-kuhn, I can't find this algorithm in my QGIS 3.4.13 installation (on Ubuntu). There are, however, traces of the algorithm in the code on github (both for 3.4 and master). I find the files, for instance: src/analysis/processing/qgsalgorithmfilter.cpp.

Here are some lines from that file (both in the 3.4 and master github branches):

QString QgsFilterAlgorithm::displayName() const { return QObject::tr( "Feature Filter" ); } QString QgsFilterAlgorithm::group() const { return QObject::tr( "Vector table" ); }

So the name of the algorithm is not the same, and the group is also not the same as in the referenced commit. On github master I can only find a commit from Apr 5, 2018 in the history of the file, but I am not very familiar with searching the github history. What to do?

m-kuhn commented 5 years ago

It's only visible in the graphical modeller.

havatv commented 5 years ago

Yes, I can see it there. Is there a reason why it is not visible under "Vector table" in the processing toolbox? (It seems to be the only algorithms that is no available in the Processing toolbox)

Gustry commented 5 years ago

There are other algorithms not visible in the Processing toolbox and which are modeller only.

https://github.com/qgis/QGIS/search?q=FlagHideFromToolbox

"Load Layer", "String concatenation", "Variable Distance Buffer". These are not all "Vector table".

m-kuhn commented 5 years ago

I don't remember the exact details, it was after a discussion with @nyalldawson that it was decided. At least it would have been considerably harder to do outside the modeller.

DelazJ commented 5 years ago

"Load Layer", "String concatenation", "Variable Distance Buffer". These are not all "Vector table".

And they are documented at https://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/modelertools.html#modeler-tools

havatv commented 5 years ago

That makes sense. I will probably take a shot at this, then.