2

I'd like to know how can I differentiate mixed input layer, in the graphical modeler of QGIS, based on the geometry type (line, point, polygon).

I used "multiple insert" -> "vector with no geometry required"; so I cannot use 3 "multiple insertions" for the 3 types of geometry, because it's not sure that there are layers with the 3 different types.

If there is a missing type, the dedicated insertion does not go ahead because it wants at least one layer of that type. So, I should try the way to put in input all layers of the map of every type, extract the layers of the same geometry type and go on with others algorithms...without the model stopping. Any suggestions?

0

1 Answer 1

1

You can easily achieve this by turning your model into a Python script, but I understand that's not your wish.

In the model, create the following structure, imagining that the desired end is polygons ![enter image description here

The secret is in Merge 1, 2 and 3. Within them, map both the model entries and an existing file in a fixed folder. For example, create a file of points, one of lines and one of polygons, all empty and receive them in the Merge.

This way the Merges will always receive some file and will not accuse an error. Errors may occur in the following steps, but for that it is enough to prepare these files that are saved in a fixed folder.

1
  • Thanks a lot! I'll try it.
    – Mark
    Feb 21, 2022 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.