Outdated version of the documentation. Find the latest one here.

.

The toolbox

La Caja de herramientas es el principal elemento de procesamiento de la interfaz gráfica de usuario, y el que más se suele usar en el trabajo diario. Muestra un listado de todos los algoritmos disponibles agrupados en diferentes bloques, y es el punto de acceso para ejecutarlos, bien haciéndolo como un proceso único o bien como un proceso por lotes que realice varias ejecuciones del mismo algoritmo con diferentes conjuntos de entradas.

Figure Processing 5:

../../../_images/toolbox3.png

Processing Toolbox win

The toolbox contains all the available algorithms, divided into predefined groups. All these groups are found under a single tree entry named Geoalgorithms.

Además, hay dos entradas más llamadas Modelos y Scripts. Éstas permiten crear algorimtos y definir flujos de trabajo y tareas de procesamiento personalizados. Más adelante hay uan sección completa dedicada a esto.

En la parte superior de la caja de herramientas, hay una caja de texto. Para reducir el número de algoritmos que se muestran en la caja de herramientas y que resulte más fácil encontrar el que se necesita, se puede introducir cualquier palabra o frase en esa caja de texto. Según se va escribiendo, el número de algorimos que se muestra se va reduciendo a sólo aquellos que contienen el texto introducido en su nombre.

En la parte inferior, hay una caja desplegable en la que se puede elegir entre la lista simplificada (la ya explicada) y la lista avanzada. Si se cambia a la opción avanzada, la caja de herramientas tendrá este aspecto:

Figure Processing 6:

../../../_images/toolbox_advanced1.png

Processing Toolbox (advanced mode) win

En la vista avanzada, cada grupo representa a un ‘proveedor de algoritmos’, que es un conjunto de algorimos que tiene el mismo origen, por ejemplo de una aplicación externa con capacidades de geoprocesamiento. Algunos de estos grupos representan algoritmos de aplicaciones como SAGA, GRASS o R, mientras que otros contienen algorimos directamente programados usando el complemeto de procesamiento y no pertenecen a ningún otro programa.

Esta vista se recomienda para los usuarios/as que tienen cierto conocimiento de las aplicaciones de las que provienen los algoritmos, ya que estos se muestran con sus nombres y grupos originales.

Además, hay algunos algoritmos que sólo están disponibles en la vista avanzada, como las herramientas de LIDAR y los scripts basados en el software de cálculo estadístico R entre otras. Los plugins de QGIS independientes que añaden nuevos algoritmos a la caja de herramientas, se muestran también sólo en la vista avanzada.

En concreto, la vista simplificada contiene algoritmos de los siguientes productos:

  • GRASS
  • SAGA
  • OTB
  • Native QGIS algorithms

Si se usa QGIS en Windows, estos algorimos están plenamente funcionales desde el principio y pueden ejecutarse sin necesidad de instalaciones adicionales. Además, ejecutarlos no requiere un conocimiento previo de las aplicaciones externas que usan, haciéndolos más accesibles para usuarios/as sin experiencia.

If you want to use an algorithm not provided by any of the above providers, switch to the advanced mode by selecting the corresponding option at the bottom of the toolbox.

Para ejecutar un algoritmo, basta con hacer doble click sobre su nombre en la caja de herramientas.

El cuadro de diálogo de algoritmo

Once you double-click on the name of the algorithm that you want to execute, a dialog similar to that in the figure below is shown (in this case, the dialog corresponds to the SAGA ‘Convergence index’ algorithm).

Figure Processing 7:

../../../_images/parameters_dialog.png

Parameters Dialog win

This dialog is used to set the input values that the algorithm needs to be executed. It shows a table where input values and configuration parameters are 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. On the left side, the name of the parameter is shown. On the right side, the value of the parameter can be set.

Although the number and type of parameters depend on the characteristics of the algorithm, the structure is similar for all of them. The parameters found in the table can be of one of the following types.

  • A raster layer, to select from a list of all such layers available (currently opened) 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.

  • A vector layer, to select from a list of all vector layers available in QGIS. Layers not loaded in QGIS can be selected as well, as in the case of raster layers, but only if the algorithm does not require a table field selected from the attributes table of the layer. In that case, only opened layers can be selected, since they need to be open so as to retrieve the list of field names available.

    Se ve un botón por cada selector de capa vectorial, como se muestra en la figura inferior.

Figure Processing 8:

../../../_images/vector_iterator.png

Vector iterator button win

If the algorithm contains several of them, you will be able to toggle just one of them. If the button corresponding to a vector input is 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.

  • A table, to select from a list of all available in QGIS. Non-spatial tables are loaded into QGIS like vector layers, and in fact they are treated as such by the program. Currently, the list of available tables that you will see when executing an algorithm that needs one of them is restricted to tables coming from files in dBase (.dbf) or Comma-Separated Values (.csv) formats.
  • Una opción, a elegir de una lista de selección de posibles opciones.

  • A numerical value, to be introduced in a text box. You will find a button by its side. Clicking on it, you will see a dialog that allows you to enter a mathematical expression, so you can use it as a handy calculator. 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.

Figure Processing 9:

../../../_images/number_selector.png

Number Selector win

  • Un rango, con valores mínimo y máximo que se introducen en dos cuadros de texto.

  • Una cadena de texto, que se introduce en un cuadro de texto.

  • Un campo, a elegir desde la tabla de atributos de una capa vectorial o una tabla sencilla seleccionada en otro parámetro.

  • A coordinate reference system. You can type the EPSG code directly in the text box, or select it from the CRS selection dialog that appears when you click on the button on the right-hand side.

  • An extent, to be entered by four numbers representing its xmin, xmax, ymin, ymax limits. Clicking on the button on the right-hand side of the value selector, a pop-up menu will appear, giving you two options: to select the value from a layer or the current canvas extent, or to define it by dragging directly onto the map canvas.

    Figure Processing 10

    ../../../_images/extent.png

    Extent selector win

    Si se selecciona la primera opción, se verá una ventana como la siguiente.

    Figure Processing 11

    ../../../_images/extent_list.png

    Extent List win

    Si se selecciona la segunda opción, la ventana de parámetros se ocultará, para que se pueda definir el rectángulo haciendo click y arrastrando dentro del lienzo. Una vez hecho esto, el cuadro de diálogo reaparecerá, con los valores correspondientes ya rellenos en en cuadro de texto.

    Figure Processing 12:

    ../../../_images/extent_drag1.png

    Extent Drag win

  • A list of elements (whether raster layers, vector layers or tables), to select from the list of such layers available in QGIS. To make the selection, click on the small button on the left side of the corresponding row to see a dialog like the following one.

    Figure Processing 13:

    ../../../_images/multiple_selection.png

    Selección múltiple win

  • Una pequeña tabla para que la edite el usuario. Éstas se usan para definir parámetros como tablas de búsqueda o matrices de convolución entre otros.

    Click en el botón del lado derecho para ver la tabla y editar sus valores.

    Figure Processing 14:

    ../../../_images/fixed_table.png

    Fixed Table win

    Depending on the algorithm, the number of rows can be modified or not by using the buttons on the right side of the window.

You will find a [Help] tab in the the parameters dialog. If a help file is available, it will be shown, giving you more information about the algorithm and detailed descriptions of what each parameter does. Unfortunately, most algorithms lack good documentation, but if you feel like contributing to the project, this would be a good place to start.

Un comentario sobre proyecciones

Algorithms run from the processing framework — this is also true of most of the external applications whose algorithms are exposed through it. Do not perform any reprojection on input layers and assume that all of them are already in a common coordinate system and ready to be analized. Whenever you use more than one layer as input to an algorithm, whether vector or raster, it is up to you to make sure that they are all in the same coordinate system.

Note that, 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. That reprojection should be done manually, and then the resulting files should be used as input to the algorithm. Also, note that the reprojection process can be performed with the algorithms that are available in the processing framework itself.

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 configuration dialog, unchecking the Show CRS option.

If you try to execute an algorithm using as input two or more layers with unmatching CRSs, a warning dialog will be shown.

Aún se puede ejecutar el algoritmo, pero en la mayoría de los casos se producirán resultados incorrectos, como capas vacias debido a que las capas de entrada no se solapan.

Resultados generados por algoritmos

Los tipos de resultados que se pueden generar cor un algoritmo son los siguientes:

  • Una capa ráster.

  • Una capa vectorial.

  • Una tabla

  • Un archivo HTML (usado para salidas de texto y salidas gráficas).

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 the architecture allows for any other way of storing it. For instance, a vector layer can be stored in a database or even uploaded to a remote server using a WFS-T service. Although solutions like these are not yet implemented, the processing framework is prepared to handle them, and we expect to add new kinds of output channels in a near feature.

To select an output channel, just click on the button on the right side of the text box. That will open a save file dialog, where you can select the desired file path. Supported file extensions are shown in the file format selector of the dialog, depending on the kind of output and the algorithm.

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 (usually .dbf` for tables, .tif for raster layers and .shp for vector layers) will be appended to the file path, and the file format corresponding to that extension will be used to save the layer or table.

If you do not enter any filename, 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 configuration dialog (you can open it from the 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.

When running an algorithm that uses a vector layer in iterative mode, the entered file path is used as the base path for all generated files, which are named using the base name and appending a number representing the index of the iteration. The file extension (and format) is used for all such generated files.

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.

For all the other types of output, you will find a checkbox that you can use to tell the algorithm whether to load the file once it is generated by the algorithm or not. By default, all files are opened.

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).

Configurar el entorno de trabajo de procesamiento

As has been mentioned, the configuration menu gives access to a new dialog where you can configure how algorithms work. Configuration parameters are structured in separate blocks that you can select on the left-hand side of the dialog.

Al igual que con la ya mencionada Carpeta de salida, el bloque General contienen parámetros para configurar el estilo de renderizado por defecto para capas de salida (es decir, capas que se generan usando algoritmos desde cualquiera de los componentes GUI del entorno de trabajo). Hay que crear el estilo deseado usando QGIS, salvarlo en un archivo, e introducir ela ruta a ese archivo en la configuración para que los algorimos lo puedan usar. Si SEXTANTE carga una capa y la añade al lienzo de QGIS , se renderizará usando ese estilo.

Los estilos de renderizado se pueden configurar individualmente para cada algoritmo y cada una de sus salidad. Basta con hacer clic derecho en el nombre del algoritmo en la caja de herramientas y seleccionar Editar estilos de renderizados para salidas. Aparecerá un cuadro de diálogo como el mostrado a continuación.

Figure Processing 15:

../../../_images/rendering_styles.png

Estilos de Renderizado win

Seleccionar el archivo de estilo (.qml) que se desee para cada salida y presionar [Aceptar].

Other configuration parameters in the General group are listed below:

  • Use filename as layer name. The name of each resulting layer created by an algorithm is defined by the algorithm itself. In some cases, a fixed name might be used, meaning that the same output name will be used, no matter which input layer is used. In other cases, the name might depend on the name of the input layer or some of the parameters used to run the algorithm. If this checkbox is checked, the name will be taken from the output filename instead. Notice that, if the output is saved to a temporary file, the filename of this temporary file is usually a long and meaningless one intended to avoid collision with other already existing filenames.
  • Use only selected features. If this option is selected, whenever a vector layer is used as input for an algorithm, only its selected features will be used. If the layer has no selected features, all features will be used.
  • Pre-execution script file and Post-execution script file. These parameters refer to scripts written using the processing scripting functionality, and are explained in the section covering scripting and the console.

Apart from the General block in the settings dialog, you will also find a block for algorithm providers. Each entry in this block contains an Activate item that you can use to make algorithms appear or not in the toolbox. Also, some algorithm providers have their own configuration items, which we will explain later when covering particular algorithm providers.