1

When attempting to use batch processing of any tool, I run into an issue when selecting input files. Using the Seeded Region Growing tool (SAGA) for example, here is my workflow and issue:

there are three inputs; Seeds, Features, and Seeds (again).

  1. For the first Seeds input, I click "Autofill..." then "Select files" and select my input files, each one gets its own entry, all good.

   a. Rows 2 and 3 in my screenshot

  1. Add inputs for the Features column, I click "Autofill..." then "Select files" and select my input files, but it creates new entries instead of associating those files with the inputs I selected in the previous step.

   a. Rows 5 and 6

   b. This step also adds a blank row to my table and I am not sure why (Row 4)

  1. Add inputs to the second Seeds column, again I click "Autofill..." then "Select files" and select my input files, but it creates new entries instead of associating those files with the inputs I selected in the previous step.

   a. Rows 7 and 8 screenshot of batch processing tool incorrectly adding input data

Using my steps above, the ideal outcome would be to only have rows #2 and #3 populated with files selected for Seeds, Features, and Seeds. I want to use “Autofill…” because it lets me select multiple files at once, clicking the “…” next to the input only allows me to select one at a time and I have hundreds of files. So my question is: How can I quickly select input files that correspond with the previous column’s entries?

3
  • You can try seting up two three rows manually, how you want >>> then export json and manipulate it to however you want and then reload it. Sep 30 '21 at 20:03
  • Thank you @ar-siddiqui, this method seems like the best way forward. Much appreciated!
    – Rocinante
    Oct 1 '21 at 13:02
  • @Rocinate If my solution worked for you please accept it as the answer. I just added detailed answer. Oct 1 '21 at 16:07
0

This approach is general and will work everywhere.

In the batch process, you can set up two-three rows manually like this.

enter image description here

Then you can export the configuration JSON using the save button.

enter image description here

The configuration json will look like this

[
    {
        "PARAMETERS": {
            "HydrologicSoilGroupLayer": "'MultiPolygon?crs=EPSG:3857&uid={bea0fcae-cb0e-47a3-9e8b-3ffc803a6a9c}'",
            "HydrologicSoilGroupField": "'hydgrpdcd'",
            "KFactorField": "'kffact'",
            "RasterCellSize": "30"
        },
        "OUTPUTS": {
            "Hsg": "C:/Users/asiddiqui/Documents/Projects/NSPECT/Atlanta/HSG1.tif",
            "K_factor": "C:/Users/asiddiqui/Documents/Projects/NSPECT/Atlanta/k_factor1.tif"
        }
    },
    {
        "PARAMETERS": {
            "HydrologicSoilGroupLayer": "'MultiPolygon?crs=EPSG:3857&uid={bea0fcae-cb0e-47a3-9e8b-3ffc803a6a9c}'",
            "HydrologicSoilGroupField": "'hydgrpdcd'",
            "KFactorField": "'kffact'",
            "RasterCellSize": "50"
        },
        "OUTPUTS": {
            "Hsg": "C:/Users/asiddiqui/Documents/Projects/NSPECT/Atlanta/HSG2.tif",
            "K_factor": "C:/Users/asiddiqui/Documents/Projects/NSPECT/Atlanta/k_factor2.tif"
        }
    }
]

Now you can manipulate the JSON however you want in any text editor and add rows.

Once your JSON is final you can reload it back using the open button. This will populate all rows from your JSON.

enter image description here

1
  • This method worked great, thank you for the help and detailed write up!
    – Rocinante
    Oct 1 '21 at 17:35
0

Instead of clicking autofill, try "Calculate by expression..." in that same dropdown menu, then your expression should just be @SEEDS and it should use the layer you input in the "Seeds" column.

1
  • Unfortunately the input files need to be different in each column, otherwise this idea would work well. Thank you for the help though!
    – Rocinante
    Oct 1 '21 at 13:03

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.