.

Интерфейс пакетной обработки

Введение

All algorithms (including models) can be executed as a batch process. That is, they can be executed using not just a single set of inputs, but several of them, executing the algorithm as many times as needed. This is useful when processing large amounts of data, since it is not necessary to launch the algorithm many times from the toolbox.

Чтобы запустить алгоритм в режиме пакетной обработки выделите его в панели инструментов, вызовите контекстное меню и выберите пункт Execute as batch process.

Figure Processing 26:

../../../_images/batch_processing_right_click.png

Batch Processing Right Click win

Таблица параметров

Запуск пакетной обработки во многом схож с выполнением единичной операции. Отличие лишь в том, что параметры теперь задаются для каждой итерации обработки. Диалог настройки в этом случае принимает вид таблицы.

Figure Processing 27:

../../../_images/batch_processing.png

Batch Processing win

Каждая строка таблицы соответствует одному запуску алгоритма, в ячейках находятся параметры. Это похоже на обычный диалог настройки алгоритмов, только используется другое расположение элементов.

По умолчанию в таблице три строки, при необходимости добавить или удалить строки можно при помощи кнопок внизу окна.

После того, как размер таблицы (число строк в ней) задан, можно приступать к её заполнению.

Заполнение таблицы параметров

For most parameters, setting the value is trivial. Just type the value or select it from the list of available options, depending on the parameter type.

The main differences are found for parameters representing layers or tables, and for output file paths. Regarding input layers and tables, when an algorithm is executed as part of a batch process, those input data objects are taken directly from files, and not from the set of them already opened in QGIS. For this reason, any algorithm can be executed as a batch process, even if no data objects at all are opened and the algorithm cannot be run from the toolbox.

Filenames for input data objects are introduced directly typing or, more conveniently, clicking on the browsebutton button on the right hand of the cell, which shows a typical file chooser dialog. Multiple files can be selected at once. If the input parameter represents a single data object and several files are selected, each one of them will be put in a separate row, adding new ones if needed. If the parameter represents a multiple input, all the selected files will be added to a single cell, separated by semicolons (;).

Output data objects are always saved to a file and, unlike when executing an algorithm from the toolbox, saving to a temporary file is not permitted. You can type the name directly or use the file chooser dialog that appears when clicking on the accompanying button.

После выбора выходного файла появится ещё один диалог, позволяющий автоматически заполнить остальные ячейки.

Figure Processing 28:

../../../_images/batch_processing_save.png

Диалог автозаполнения

Если выбрано значение Do not autofill (по умолчанию), в заданную ячейку будет просто вставлено выбранное имя файла. Если же выбрано любое другое значение, будут заполнены все ячейки. При этом имена файлов будут сформированы на основе указаного критерия автозаполнения. Такой подход значительно ускоряет заполнение таблицы параметров пакетной обработки.

Automatic filling can be done by simply adding correlative numbers to the selected file path, or by appending the value of another field at the same row. This is particularly useful for naming output data objects according to input ones.

Figure Processing 29:

../../../_images/batch_processing_filepath.png

Batch Processing File Path win

Выполнение пакетной обработки

После заполнения всех необходимых полей можно запустить процесс пакетной обработки просто нажав на кнопку [OK]. В нижней части диалога будет отображаться общий прогресс.