2

Current I am trying to build a process model that edits fields and attributes of a collection of vector layer, the thing is though I can only select one vector layer and time to go through the "Refactor Fields" Algorithm. But because all three of the Vector layers have the same kind of attribute table and attributes. I want all of these three layers, going through the process at once. Not that we have to do the process three times but only once. How do we do this?

enter image description here

Note: this model is still a build in process, it is the refactor fields algorithm if you cannot understand dutch.

3
  • Since these have different data types, I think that you have to process it three times. Jun 11 '20 at 15:01
  • Good question, but i dont think thats possible at all. You need to create refactor fields 3 times.
    – MrXsquared
    Jun 11 '20 at 15:49
  • How do I copy that specific refactor fields algorithm three two more times? I do mean the settings. Jun 12 '20 at 3:41
2

I could think in three ways to get around that.

1. Batch Process

You can do a more generic model and then run as batch process.

2. Creating a intermediate Model

You can create a model that only process the Field Refactor, and than use it just like any other process algorithm. PROs: By this way you just have to setup only one algorithm. CONS: you'll have to share all model files.

3. Changing the Model File

The hardest way is to change the model file in the folder of the QGIS. This file can be changed (you have to load it in QGIS to see the changes) but is very hard to understand how to do it. But in your case, you can create in the model editor the field refactor and then change the setups in the file.

Furthermore you can understand the pattern and create a code (like python) to do the change for you if you have to do many attempts or are very complex types of changes.

1

as addition to comments from @MrXsquared and @marcel baliu see picture below:

enter image description here

5
  • How do I copy the exact settings of one my Refactor fields algorithms? Because all these three share the same "Settings", because the three layers have the same attribute tabel in terms of structure. Jun 12 '20 at 6:23
  • I think copy & paste is not possible with the modeller, you can export your model to python and then copy the part of the refactoring fields and adjust the inputs.
    – eurojam
    Jun 12 '20 at 6:39
  • Okay that kind of works the problem is that I do not seem an option that translate my Python Script back into a model. Is there an option for that? Jun 12 '20 at 7:09
  • you can bring the whole script as a processing algorithm back into you model. It should be available trough the definded group in the list of algorithm.
    – eurojam
    Jun 12 '20 at 17:05
  • Thanks for the tip but because this model is gonna be shared to my collagues, I need it to be just one Script. If the Script is dependent on another custo made cript, it kind of defeats the purpose. Mainly being dependent on the "basic" scripts you can find in QGIS. Jun 12 '20 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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