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?

Bera
81.7k14 gold badges85 silver badges199 bronze badges
asked Feb 18, 2022 at 17:58
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.

answered Feb 18, 2022 at 19:23
1
  • Thanks a lot! I'll try it. Commented Feb 21, 2022 at 13:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.