8

I built a model and use the tool "Extract by location". I would like to define the geometric predicate as a variable, so the user can choose between different predicates when he/she runs the model. How can I do that?

enter image description here

enter image description here

menes
  • 1,421
  • 2
  • 7
  • 24
Enzo Baldini
  • 2,327
  • 1
  • 15
  • 29

1 Answers1

12

The geometric predicate input expects an index, starting from 0 as input as array or comma separated string. E.g. '1,3' or [1,3] for contains and touches. Since using numbers is not quite intuitive, I suggest to use an Enum-Input: As already mentioned, the important thing is the order of the items within this input. It has to be the same as it would it be, if you directly choose it from the tool:

![enter image description here

So the Enum-Input has the same order (you can also allow multiple input):

enter image description here

So your model looks like this:

enter image description here

And the tool:

enter image description here

MrXsquared
  • 34,292
  • 21
  • 67
  • 117