I am building a Processing Model working with large vector Datasets with classification values. My vector file contains a lot of features (40.000) with one column containing classification values ranking from min (e.g. 1) to max (e.g. 15). Note that the min and max values of the classification can vary from Model-run to Model-run. I need to find a way to select all the features with the highest classification value to create a Buffer around them in a next step.
I already have a python script that writes the maximum value of a selected column in a number that than can be used in Processing:
##MaxFinder=name ##Layer=vector ##Fields=Field Layer ##value_KRK_max=output number 0 layer = processing.getObject( Layer ) idx = layer.fieldNameIndex( Fields ) KRK_max = layer.maximumValue(idx)
My idea was to define a function in the "Select by expression" tool, but I cannot make it work. Any suggestions?