A tradução é um esforço comunitário you can join. Esta página está atualmente traduzida em 40.00%.

27.3. A Barra de Ferramentas

The Processing Toolbox is the main element of the processing GUI, and the one that you are more likely to use in your daily work. It shows the list of all available algorithms grouped in different blocks called Providers, and custom models and scripts you can add to extend the set of tools. Hence the toolbox is the access point to run them, whether as a single process or as a batch process involving several executions of the same algorithm on different sets of inputs.


Fig. 27.6 Processamento

Providers can be (de)activated in the Processing settings dialog. By default, only providers that do not rely on third-party applications (that is, those that only require QGIS elements to be run) are active. Algorithms requiring external applications might need additional configuration. Configuring providers is explained in a later chapter in this manual.

In the upper part of the toolbox dialog, you will find a set of tools to:

  • work with processingModel Models: Create New Model…, Open Existing Model… and Add Model to Toolbox…;

  • work with pythonFile Scripts: Create New Script…, Create New Script from Template…, Open Existing Script… and Add Script to Toolbox…;

  • open the processingHistory History panel;

  • open the processingResult Results Viewer panel;

  • toggle the toolbox to the in-place modification mode using the processSelected Edit Features In-Place button: only the algorithms that are suitable to be executed on the active layer without outputting a new layer are displayed;

  • open the options Options dialog.

Below this toolbar is a search Search… box to help you easily find the tools you need. You can enter any word or phrase on the text box. Notice that, as you type, the number of algorithms, models or scripts in the toolbox is reduced to just those that contain the text you have entered in their names or keywords.


No topo da lista de algoritmos são exibidas as ferramentas utilizadas mais recentemente; útil se você quiser reexecutar alguma.


Fig. 27.7 Caixa de ferramentas de processamento mostrando os resultados da pesquisa

Para executar uma ferramenta, basta clicar duas vezes sobre seu nome na caixa de ferramentas.

27.3.1. O diálogo do algoritmo

Once you double-click on the name of the algorithm that you want to execute, a dialog similar to that in the Fig. 27.8 below is shown (in this case, the dialog corresponds to the Centroids algorithm).


Fig. 27.8 Diálogo Algoritmo - Parâmetros

The dialog shows two tabs (Parameters and Log) on the left part, the algorithm description on the right, and a set of buttons at the bottom. Parameter types

The Parameters tab is used to set the input values that the algorithm needs to be executed. It shows a list of input values and configuration parameters to be set. It of course has a different content, depending on the requirements of the algorithm to be executed, and is created automatically based on those requirements.


Setting your own default values for algorithm parameters

Algorithm dialogs open with some parameters prefilled with values from QGIS installation. It is however possible to set your own default values for specific algorithm parameters so that they are used at algorithm startup.

Embora o número e tipo de parâmetros dependerem das características do algoritmo, a estrutura é semelhante para todos eles. Os parâmetros encontrados na tabela podem ser de um dos seguintes tipos.

  • A vector layer, to select from a list of all vector layers available (currently opened) in QGIS. You can also use unloaded layers: press the button on the widget right-hand side, and select:

    • Select file…: selects file on disk using the Operating System file explorer

    • Browse for layer…: opens the Browser panel, allowing to take the layers directly from database sources (PostgreSQL, SQL Server, Oracle, …), web services (WFS, AFS, …) or files on disk.


    Fig. 27.9 Vector input widget


    By default, the layer widget shows the CRS of the layer along with its name. If you do not want to see this additional information, you can disable this functionality in the Processing Settings dialog, unchecking the General ► Show layer CRS definition in selection boxes option.

    The vector input widget also has following features:

    • an iterator iterate button: If toggled, the algorithm will be executed iteratively on each one of its features, instead of just once for the whole layer, producing as many outputs as times the algorithm is executed. This allows for automating the process when all features in a layer have to be processed separately. If the algorithm contains several input vectors you can iterate over, the iteration will be processed only on the first toggled parameter, in the order parameters are declared in the algorithm.

    • options Advanced options button to adjust settings to use for that specific parameter. These settings concern:

      • Invalid feature filtering: allows the default method for handling features with invalid geometries to be overridden

      • Limit features processed: optional limit on number of features processed from the source

      • Feature filter: allows to enter an expression to subset the layer dynamically when running the tool, avoiding the need for separate steps to set layer filters or create layer subsets.


      Fig. 27.10 Advanced options for vector input widget

    • It is also possible to limit the algorithm execution on the vector layer to its Selected features only.

  • A table, to select from a list of all available in QGIS. Non-spatial tables are loaded into QGIS like vector layers, and use the same widget.

  • A raster layer, to select from a list of all raster layers available in QGIS. The selector contains as well a button on its right-hand side, to let you select filenames that represent layers currently not loaded in QGIS.


    Fig. 27.11 Raster input widget

  • Uma opção, para escolher a partir de uma lista de seleção de opções possíveis.

  • A numerical value, to be introduced in a spin box. In some contexts (when the parameter applies at the feature level and not at the layer’s), you will find a dataDefine Data-defined override button by its side, allowing you to open the expression builder and enter a mathematical expression to generate variable values for the parameter. Some useful variables related to data loaded into QGIS can be added to your expression, so you can select a value derived from any of these variables, such as the cell size of a layer or the northernmost coordinate of another one.


Fig. 27.12 Entrada baseada em expressão

  • Um intervalo, com valores mínimo e máximo a serem introduzidos em duas caixas de texto.

  • A text string, to be introduced in a text box.

  • A field, to choose from the attributes table of a vector layer or a single table selected in another parameter.

  • A coordinate reference system. You can select it among the recently used ones from the drop-down list or from the CRS selection dialog that appears when you click on the button on the right-hand side.

  • An extent, a text box defining a rectangle through its corners coordinate in the format xmin, xmax, ymin, ymax. Press the mapIdentification Set to current map canvas extent button to use the map canvas extent. Clicking the arrow on the right-hand side of the value selector, a pop-up menu will appear, giving you options to:

    • Calculate from layer ►: fills the text box with the coordinates of the bounding box of a layer to select among the loaded ones

    • Calculate from layout map ►: fills the text box with the coordinates of a map item selected from a layout in the current project

    • Calculate from bookmark ►: fills the text box with the coordinates of a saved bookmark

    • mapIdentification Use current map canvas extent

    • Draw on canvas: the parameters window will hide itself, so you can click and drag onto the canvas. Once you have defined the extent rectangle, the dialog will reappear, containing the values in the extent text box.


    Fig. 27.13 Seletor de extensão

  • A list of elements (whether raster or vector layers, tables, fields) to select from. Click on the button at the left of the option to see a dialog like the following one. Multiple selection is allowed and when the dialog is closed, number of selected items is displayed in the parameter text box widget.


    Fig. 27.14 Seleção Múltipla

  • A tabela pequena a ser editada pelo usuário. Estes são usados para definir parâmetros como tabelas de pesquisa ou kernels de convolução, entre outros.

    Clique no botão do lado direito para ver a tabela e editar os seus valores.


    Fig. 27.15 Tabela fixa

    Dependendo do algoritmo, o número de linhas pode ser modificado ou não, utilizando os botões do lado direito da janela.


Some algorithms require many parameters to run, e.g. in the Calculadora Raster you have to specify manually the cell size, the extent and the CRS. You can avoid to choose all the parameters manually when the algorithm has the Reference layers parameter. With this parameter you can choose the reference layer and all its properties (cell size, extent, CRS) will be used. Logging the execution

Along with the Parameters tab, there is another tab named Log (see Fig. 27.16 below). Information provided by the algorithm during its execution is written in this tab, allowing you to track the execution as well as being aware and having more details about the algorithm as it runs. Information on algorithm execution is also output in the View ► Panels ► Log Messages Panel.

Notice that not all algorithms write information to the Log tab, and many of them might run silently without producing any output other than the final files. Check the Log Messages Panel in that case.


Fig. 27.16 Algorithm Dialog - Log

At the bottom of the Log tab you will find buttons to fileSave Save Log to File, editCopy Copy Log to Clipboard and clearConsole Clear Log. These are particularly handy when you have checked the Keep dialog open after running algorithm in the General part of the Processing options. Other tools

No lado direito da caixa de diálogo, você encontrará uma breve descrição do algoritmo, que o ajudará a entender seu propósito e suas ideias básicas. Se tal descrição não estiver disponível, o painel de descrição não será exibido.

For a more detailed help file, which might include description of every parameter it uses, or examples, you will find a Help button at the bottom of the dialog bringing you to the Processing algorithms documentation or to the provider documentation (for some third-party providers).

The Advanced ► menu provides functions to reuse the configuration defined in the dialog without running the algorithm:

  • settings Algorithm Settings…: allows to override processing settings for the current algorithm execution. More details at Override algorithm settings.

  • pythonFile Copy as Python Command: allows for easy copying of the equivalent PyQGIS command to run the tool using the parameters defined in the dialog

  • terminal Copy as qgis_process Command: allows for easy generation of qgis_process command, including its environment settings like the distance units, area units, ellipsoid, and any tricky parameter values like GeoPackage outputs with specific layers

  • editCopy Copy as JSON: all the settings of the command are copied in a JSON format, ready to be consumed by qgis_process. This is a convenient way to see the expected format of the commands, even for complex parameters (like TIN interpolation parameters). You can store these easily and then restore them later by pasting the values.

  • editPaste Paste Settings in a JSON format

The Run as Batch Process… button triggers the batch processing mode allowing to configure and run multiple instances of the algorithm with a variety of parameters. A Run as Single Process… helps you switch back from the batch mode.

When an algorithm execution finishes (either successfully or not), a new button Change Parameters is shown as long as the Log tab is active. Override algorithm settings

Triggered from within the Advanced drop-down menu at the bottom of an algorithm dialog, the settings Algorithm Settings… shows a panel allowing users to control general processing settings which apply to that algorithm execution only. It is intended to be a place where a user can override their global processing settings on an ad-hoc basis without having to change their usual default settings.

Settings that can be overridden are:

  • Invalid feature filtering: unlike the existing per-parameter setting override for this, setting the handling method here will apply to ALL inputs for the algorithm

  • Calculation settings, such as Distance units and Area units to use for distance/area measurements

  • Environment settings, such as Temporary folder and Number of threads to use Uma nota nas projeções

Processing algorithm execution are always performed in the input layer coordinate reference system (CRS). Due to QGIS’s on-the-fly reprojecting capabilities, although two layers might seem to overlap and match, that might not be true if their original coordinates are used without reprojecting them onto a common coordinate system. Whenever you use more than one layer as input to a QGIS native algorithm, whether vector or raster, the layers will all be reprojected to match the coordinate reference system of the first input layer.

No entanto, isso é menos verdadeiro para a maioria dos aplicativos externos cujos algoritmos são expostos por meio da estrutura de processamento, pois assumem que todas as camadas já estão em um sistema de coordenadas comum e prontas para serem analisadas.

By default, the parameters dialog will show a description of the CRS of each layer along with its name, making it easy to select layers that share the same CRS to be used as input layers. If you do not want to see this additional information, you can disable this functionality in the Processing settings dialog, unchecking the Show layer CRS definition in selection boxes option.

If you try to execute an algorithm using as input two or more layers with unmatching CRSs, a warning dialog will be shown. This occurs thanks to the Warn before executing if layer CRS’s do not match option.

Pode continuar a executar o algoritmo, mas tenha atenção que na maioria dos casos irá produzir resultados errados, tais como, camadas vazias devido à falta de sobreposição das camadas usadas como arquivos de entrada.


Use algoritmos de processamento para fazer reprojeção intermediária

Quando um algoritmo não pode executar com sucesso em várias camadas de entrada devido a SRC’s não correspondentes, utilize o algoritmo interno QGIS como :ref:`qgisreprojetarcamada’ para executar a reprojeção de camadas para a mesma SRC antes de executar o algoritmo utilizando estas saídas.

27.3.2. Objetos de dados gerados por algoritmos

Objetos de dados gerado por um algoritmo podem ser dos seguintes tipos:

  • Uma camada raster

  • Uma camada vetorial

  • Uma tabela

  • Um arquivo HTML (usado para arquivo de saída de texto e gráficos)

These are all saved to disk, and the parameters table will contain a text box corresponding to each one of these outputs, where you can type the output channel to use for saving it. An output channel contains the information needed to save the resulting object somewhere. In the most usual case, you will save it to a file, but in the case of vector layers, and when they are generated by native algorithms (algorithms not using external applications) you can also save to a PostGIS, GeoPackage or SpatiaLite database, or a memory layer.

Para selecionar um canal de saída, basta clicar no botão do lado direito da caixa de texto e você verá um pequeno menu de contexto com as opções disponíveis.

No caso mais comum, você selecionará salvar em um arquivo. Se você selecionar essa opção, será exibida uma caixa de diálogo para salvar arquivo, onde você poderá selecionar o caminho do arquivo desejado. As extensões de arquivo suportadas são mostradas no seletor de formato de arquivo da caixa de diálogo, dependendo do tipo de saída e do algoritmo.

The format of the output is defined by the filename extension. The supported formats depend on what is supported by the algorithm itself. To select a format, just select the corresponding file extension (or add it, if you are directly typing the file path instead). If the extension of the file path you entered does not match any of the supported formats, a default extension will be appended to the file path, and the file format corresponding to that extension will be used to save the layer or table. Default extensions are .dbf for tables, .tif for raster layers and .gpkg for vector layers. These can be modified in the setting dialog, selecting any other of the formats supported by QGIS.

If you do not enter any filename in the output text box (or select the corresponding option in the context menu), the result will be saved as a temporary file in the corresponding default file format, and it will be deleted once you exit QGIS (take care with that, in case you save your project and it contains temporary layers).

You can set a default folder for output data objects. Go to the settings dialog (you can open it from the Settings ► Options ► Processing menu), and in the General group, you will find a parameter named Output folder. This output folder is used as the default path in case you type just a filename with no path (i.e., myfile.shp) when executing an algorithm.

Ao executar um algoritmo que usa uma camada de vetor no modo interativo, o caminho do arquivo digitado é utilizado como o caminho de base para todos os arquivos gerados, que são nomeados com o nome de base e acrescentando-se um número que representa o índice da iteração. A extensão do arquivo (e formato) é usado para todos esses arquivos gerados.

Apart from raster layers and tables, algorithms also generate graphics and text as HTML files. These results are shown at the end of the algorithm execution in a new dialog. This dialog will keep the results produced by any algorithm during the current session, and can be shown at any time by selecting Processing ► Results Viewer from the QGIS main menu.

Some external applications might have files (with no particular extension restrictions) as output, but they do not belong to any of the categories above. Those output files will not be processed by QGIS (opened or included into the current QGIS project), since most of the time they correspond to file formats or elements not supported by QGIS. This is, for instance, the case with LAS files used for LiDAR data. The files get created, but you won’t see anything new in your QGIS working session.

Para todos os outros tipos de saída, você encontrará uma caixa de verificação que você pode usar para dizer o algoritmo para saber se carregará o arquivo, uma vez que é gerado pelo algoritmo ou não. Por padrão, todos os arquivos são abertos.

Optional outputs are not supported. That is, all outputs are created. However, you can uncheck the corresponding checkbox if you are not interested in a given output, which essentially makes it behave like an optional output (in other words, the layer is created anyway, but if you leave the text box empty, it will be saved to a temporary file and deleted once you exit QGIS).