Importante

Translation is a community effort you can join. This page is currently translated at 65.00%.

17.20. Um modelo de um modelo

Aviso

Atente que este capítulo não foi completamente testado, por favor informe qualquer problema; as imagens estão faltando

Nota

Nesta lição veremos como usar um modelo contido dentro de um modelo maior.

Já criamos alguns modelos, e nesta lição veremos como podemos combiná-los em um único maior. Um modelo se comporta como qualquer outro algoritmo, o que significa que você pode adicionar um modelo que você já criou como parte de outro que você criou depois disso.

In this case, we are going to expand our hydrological model, by adding the mean TWI value in each of the basins that it generates as result. To do that, we need to calculate the TWI, and to compute the statistics. Since we have already created a model to calculate TWI from a DEM, it is a good idea to reuse that model instead of adding the algorithms it contains individually.

Vamos começar com o modelo que usamos como ponto de partida na lição passada.

Aviso

todo: Adicione imagem

First, we will add the TWI model. For it to be available, it should have been saved on the models folder, since otherwise it will not be shown in the toolbox or the algorithms list in the modeler. Make sure you have it available.

Add it to the current model and use the input DEM as its input. The output is a temporary one, since we just want the TWI layer to compute the statistics. The only output of this model we are creating will still be the vector layer with the watersheds.

Aqui está a caixa de diálogo de parâmetros correspondente:

Aviso

todo: Adicione imagem

Now we have a TWI layer that we can use along with the watersheds vector layer, to generate a new one which contains the values of the TWI corresponding to each watershed.

This calculation is done using the Grid statistics in polygons algorithm. Use the layers mentioned above as input, to create the final result.

Aviso

todo: Adicione imagem

The output of the Vectorize grid classes algorithm was originally our final output, but now we just want it as an intermediate result. To change that, we have to edit the algorithm. Just double–click on it to see its parameters dialog, and delete the name of the output. That will make it a temporary output, as it is by default.

Aviso

todo: Adicione imagem

É assim que o modelo final deve ficar:

Aviso

todo: Adicione imagem

Como você vê, usar um modelo em outro modelo não é nada de especial, e você pode adicioná-lo da mesma forma que adiciona outro algoritmo, desde que o modelo seja salvo na pasta de modelos e esteja disponível na caixa de ferramentas.