Processing toolbox qgis как открыть
Перейти к содержимому

Processing toolbox qgis как открыть

  • автор:

27.3. The Toolbox

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.

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

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.

search

Below this toolbar is a 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.

At the top of the list of algorithms are displayed the most recent used tools; handy if you want to reexecute any.

../../../_images/toolbox_search.png

To execute a tool, just double-click on its name in the toolbox.

27.3.1. The algorithm dialog

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

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

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.

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

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.

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

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

    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:

    Some algorithms require many parameters to run, e.g. in the Raster calculator 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.

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

    ../../../_images/algdialoglog.png

    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.

    27.3.1.3. Other tools

    On the right hand side of the dialog you will find a short description of the algorithm, which will help you understand its purpose and its basic ideas. If such a description is not available, the description panel will not be shown.

    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:

    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.

    27.3.1.4. Override algorithm settings

    settings

    Triggered from within the Advanced drop-down menu at the bottom of an algorithm dialog, the 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

    27.3.1.5. A note on projections

    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.

    This is however less true for most of the external applications whose algorithms are exposed through the processing framework as they assume that all of the layers are already in a common coordinate system and ready to be analyzed.

    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.

    You still can execute the algorithm, but be aware that in most cases that will produce wrong results, such as empty layers due to input layers not overlapping.

    Use Processing algorithms to do intermediate reprojection

    When an algorithm can not successfully perform on multiple input layers due to unmatching CRSs, use QGIS internal algorithm such as Reproject layer to perform layers’ reprojection to the same CRS before executing the algorithm using these outputs.

    27.3.2. Data objects generated by algorithms

    Data objects generated by an algorithm can be of any of the following types:

    • A raster layer
    • A vector layer
    • A table
    • An HTML file (used for text and graphical outputs)

    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.

    To select an output channel, just click on the button on the right side of the text box, and you will see a small context menu with the available options.

    In the most usual case, you will select saving to a file. If you select that option, you will be prompted with 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 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.

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

    © Copyright 2002-now, QGIS project. Last updated on 2024 Mar 10, 14:00 +0000.

    The Processing Toolbox

    Just like the Toolboxes in ArcGIS Desktop, QGIS has the Processing toolbox. It contains processing tools and algorithms not only from QGIS itself but also from other sources such as GRASS GIS, SAGA and GDAL (which ArcGIS also uses). To use the processing toolbox you first have to activate it. this can be done by clicking the processing menu, and then select Toolbox
    After this is done the toolbox will open on the right hand side of the screen.
    This is where you can search for tools by name through the search bar or by category\ provider software manually.
    Some processing can be in both the base version of QGIS or in one of the other providers, for example the aggregate (or join by location) tool is found in both base QGIS twice and in both GRASS and SAGA.
    And thats it. you can use the tools according to each individual tools capability.
    If there is a tool you can’t find and need help, you can search for it in the guide by the name it has in ArcGIS Desktop and if we don’t have it yet you can contact us through the issues page

    My Processing Menu\Toolbox is Missing

    The processing toolbox is a Core Plugin in QGIS and as such must always be installed.
    That said, sometimes new users can’t find it (and experienced users who forgot they went through this part). If your toolber doesn’t have the processing menu and looks like this, don’t be scared.
    It just means you have to enable the processing plugin.
    To do this simply click the Plugins menu or alt + P and open the plugins manager.
    Search for «processing» and enable the plugin, this can take some time on slower systems.
    And thats it, you now have the processing menu and through it the processing toolbox. to open the processing toolbox go back up

    The QGIS Processing Toolbox¶

    The QGIS Processing Toolbox is a set of geo-spatial algorithms installed with QGIS. Some of them are in fact calling external applications, such as SAGA or GRASS GIS, which is why the algorithms are organised by provider.

    ../../_images/L7-03-00-processing-toolbox.png

    Type a keyword into the toolbox’ search bar to see what it offers. Searching for “buffer”, for instance, you will notice the different algorithm providers have in fact different implementations of the same algorithm. Often the choice is one of your personal liking, in rare cases the implementations have subtle differences which actually make a difference for your outcomes. E.g. many of the tools from GRASS treat all data as rasters, internally, granted to GRASS’ legacy as one of the earliest GIS systems still in use and the computational limitations at its time of development.

    ../../_images/L7-03-01-buffer.png

    These tools can be run one at a time, or – and that’s where we touch upon our course’s topic – be chained together to form more complex models. On top of that, all the individual algorithms and also the user-defined models can be used in batch-operations, i.e. running the same operation on a (large) number of files and/or with changing parameters.

    Let’s see how we can run two operations at once: We want to save a Shapefile with the species ranges of all damselfish of the Stegates genus, with simplified geometries. First we select our subset of features, then we simplify the geometries. Let’s use the Graphical Modeler of the processing framework. Open it from the Processing → Graphical Modeler menu.

    • As a first step, add two input parameters to the model, by drag-and-dropping them onto the empty canvas: a Vector Layer named Input Layer and a String called Genus .
    • Then, add a Select by attribute algorithm, and set its input layer to refer to our Input Layer variable. Enter GENUS_NAME for the selection attribute (that’s the column name in the example dataset which stores the genus information). Select = as a comparison operator, and choose the Genus variable as comparison value.

    ../../_images/L7-03-02-select-by-attribute.png

    ../../_images/L7-03-03-graphical-model.png

    Run the model by finding it from the toolbox and specifying an input layer and genus name.

    By Henrikki Tenkanen & Vuokko Heikinheimo
    © Copyright 2018, Henrikki Tenkanen & Vuokko Heikinheimo, Department of Geosciences and Geography, University of Helsinki.
    Last updated on Oct 23, 2020.

    The toolbox¶

    The 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, and it 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.

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

    The toolbox contains all the available algorithms, divided into so-called “Providers”.

    Providers can be (de)activated in the settings dialog. A label in the bottom part of the toolbox will remind you of that whenever there are inactive providers. Use the link in the label to open the settings window and set up providers. We will discuss the settings dialog later in this manual.

    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, you will find a text box. To reduce the number of algorithms shown in the toolbox and make it easier to find the one you need, you can enter any word or phrase on the text box. Notice that, as you type, the number of algorithms in the toolbox is reduced to just those that contain the text you have entered in their names.

    If there are algorithms that match your search but belong to a provider that is not active, an additional label will be shown in the lower part of the toolbox.

    ../../../_images/toolbox_search.png

    Processing Toolbox showing search results

    If you click on the link in that label, the list of algorithms will also include those from inactive providers, which will be shown in light gray. A link to active each inactive provider is also shown.

    ../../../_images/toolbox_search2.png

    Processing Toolbox showing search results

    To execute an algorithm, just double-click on its name in the toolbox.

    Диалог алгоритма¶

    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 ‘Polygon centroids’ algorithm).

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

    This dialog 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.

    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. You will see an iterator button by each vector layer selector, as shown in the figure below.

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

    Vector iterator button

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

    Expression based input

    • A range, with min and max values to be introduced in two text boxes.
    • 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 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 three options:
      • to select the value from a layer or the current canvas extent,
      • to define it by dragging directly onto the map canvas, or
      • to use the minimum coverage from all input layers.

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

      Если выбран первый вариант, появится следующий диалог.

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

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

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

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

      Multiple Selection

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

      Fixed Table

      Along with the Parameters tab, you will find another tab named Log. Information provided by the algorithm during its execution is written in this tab, and allow you to track the execution and be aware and have more details about the algorithm as it runs. Notice that not all algorithms write information to this tab, and many of them might run silently without producing any output other than the final files.

      On the right hand side of the dialog you wil find a short description of the algorithm, which will help you understand its purpose and its basic ideas. If such a description is not available, the description panel will not be shown.

      Some algorithms might have a more detailed help file, which might include description of every parameter it uses, or examples. In that case, you will find a Help tab in the parameters dialog.

      Немного о проекциях¶

      Algorithms that are run from the processing framework — this is also true for 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 analyzed. 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 settings 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.

      Вы можете продолжить выполнение алгоритма, но необходимо понимать, что в большинстве случаев результат будет неправильным. Например, итоговые слои будут пустыми, т.к. исходные слои не пересекаются.

      Данные, создаваёмые алгоритмами¶

      В результате работы алгоритма могут быть созданы следующие виды данных:

      • Растровый слой
      • Векторный слой
      • Таблица
      • Файл HTML (используется для отображения текста и графики)

      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 or Spatialite database, or a memory layer.

      To select an output channel, just click on the button on the right side of the text box, and you will see a small context menu with the available options.

      In the most usual case, you will select saving to a file. If you select that option, you will be prompted with 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 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 .shp 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 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).

      Configuring the processing framework¶

      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.

      Along with the aforementioned Output folder entry, the General block contains parameters for setting the default rendering style for output layers (that is, layers generated by using algorithms from any of the framework GUI components). Just create the style you want using QGIS, save it to a file, and then enter the path to that file in the settings so the algorithms can use it. Whenever a layer is loaded by Processing and added to the QGIS canvas, it will be rendered with that style.

      Rendering styles can be configured individually for each algorithm and each one of its outputs. Just right-click on the name of the algorithm in the toolbox and select Edit rendering styles for outputs. You will see a dialog like the one shown next.

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

      Select the style file ( .qml ) that you want for each output and press [OK].

      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.
      • Keep dialog open after running algorithm. Once an algorithm has finished execution and its output layers are loaded into the QGIS project, the algorithm dialog is closed. If you want to keep it open (to run the algorithm again with different parameters, or to better check the output that is written to the log tab), check this option
      • 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.

      • следующий
      • предыдущий |
      • »
      • Руководство пользователя QGIS »
      • QGIS processing framework »

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *