Importante

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

28.1.6. Interpolação

28.1.6.1. Heatmap (kernel density estimation)

Creates a density (heatmap) raster of an input point vector layer using kernel density estimation.

The density is calculated based on the number of points in a location, with larger numbers of clustered points resulting in larger values. Heatmaps allow easy identification of hotspots and clustering of points.

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Camada de pontos

INPUT

[vetor: ponto]

Point vector layer to use for the heatmap

Raio

RADIUS

[número]

Padrão: 100.0

Heatmap search radius (or kernel bandwidth) in map units. The radius specifies the distance around a point at which the influence of the point will be felt. Larger values result in greater smoothing, but smaller values may show finer details and variation in point density.

Output raster size

PIXEL_SIZE

[número]

Padrão: 0.1

Pixel size of the output raster layer in layer units.

In the GUI, the size can be specified by the number of rows (Number of rows) / columns (Number of columns) or the pixel size( Pixel Size X / Pixel Size Y). Increasing the number of rows or columns will decrease the cell size and increase the file size of the output raster. The values in Rows, Columns, Pixel Size X and Pixel Size Y will be updated simultaneously - doubling the number of rows will double the number of columns, and the cell size will be halved. The extent of the output raster will remain the same (approximately).

Radius from field

Opcional

RADIUS_FIELD

[campo de tabela: numérico]

Sets the search radius for each feature from an attribute field in the input layer.

Weight from field

Opcional

WEIGHT_FIELD

[campo de tabela: numérico]

Allows input features to be weighted by an attribute field. This can be used to increase the influence certain features have on the resultant heatmap.

Kernel shape

KERNEL

[enumeração]

Padrão: 0

Controls the rate at which the influence of a point decreases as the distance from the point increases. Different kernels decay at different rates, so a triweight kernel gives features greater weight for distances closer to the point then the Epanechnikov kernel does. Consequently, triweight results in “sharper” hotspots and Epanechnikov results in “smoother” hotspots.

There are many shapes available (please see the Wikipedia page for further information):

  • 0 — Quartico

  • 1 — Triangular

  • 2 — Uniforme

  • 3 — Triweight

  • 4 — Epanechnikov

Decay ratio (Triangular kernels only)

Opcional

DECAY

[número]

Padrão: 0.0

Can be used with Triangular kernels to further control how heat from a feature decreases with distance from the feature.

  • A value of 0 (=minimum) indicates that the heat will be concentrated in the center of the given radius and completely extinguished at the edge.

  • A value of 0.5 indicates that pixels at the edge of the radius will be given half the heat as pixels at the center of the search radius.

  • A value of 1 means the heat is spread evenly over the whole search radius circle. (This is equivalent to the ‘Uniform’ kernel.)

  • A value greater than 1 indicates that the heat is higher towards the edge of the search radius than at the center.

Output value scaling

OUTPUT_VALUE

[enumeração]

Default: Raw

Allow to change the values of the output heatmap raster. One of:

  • 0 — Bruto

  • 1 — Scaled

Mapa de calor

OUTPUT

[raster]

Padrão: [Salvar em arquivo temporário]

Especificar a camada raster de saída com valores de densidade de kernel. Um de:

  • Salvar como Arquivo Temporário

  • Salvar em Arquivo…

Saídas

Etiqueta

Nome

Tipo

Descrição

Mapa de calor

OUTPUT

[raster]

Camada raster com valores de densidade de kernel

Exemplo: Criando um mapa de calor

For the following example, we will use the airports vector point layer from the QGIS sample dataset (see Baixando dados de amostra). Another excellent QGIS tutorial on making heatmaps can be found at http://qgistutorials.com.

In Fig. 28.2, the airports of Alaska are shown.

../../../../_images/heatmap_start.png

Fig. 28.2 Aeroportos do Alasca

  1. Open the Heatmap (Kernel Density Estimation) algorithm from the QGIS Interpolation group

  2. In the Point layer selectString field, select airports from the list of point layers loaded in the current project.

  3. Change the Radius to 1000000 meters.

  4. Change the Pixel size X to 1000. The Pixel size Y, Rows and Columns will be automatically updated.

  5. Click on Run to create and load the airports heatmap (see Fig. 28.4).

../../../../_images/heatmap_dialog.png

Fig. 28.3 The Heatmap Dialog

QGIS will generate the heatmap and add it to your map window. By default, the heatmap is shaded in greyscale, with lighter areas showing higher concentrations of airports. The heatmap can now be styled in QGIS to improve its appearance.

../../../../_images/heatmap_loaded_grey.png

Fig. 28.4 O mapa de calor após o carregamento parece uma superfície cinza

  1. Open the properties dialog of the heatmap_airports layer (select the layer heatmap_airports, open the context menu with the right mouse button and select Properties).

  2. Select the Symbology tab.

  3. Change the Render type selectString to ‘Singleband pseudocolor’.

  4. Select a suitable Color ramp selectString, for instance YlOrRd.

  5. Click the Classify button.

  6. Press OK to update the layer.

The final result is shown in Fig. 28.5.

../../../../_images/heatmap_loaded_colour.png

Fig. 28.5 Mapa de calor estilizado dos aeroportos do Alasca

Código Python

Algorithm ID: qgis:heatmapkerneldensityestimation

import processing
processing.run("algorithm_id", {parameter_dictionary})

O id do algoritmo é exibido quando você passa o mouse sobre o algoritmo na Caixa de ferramentas de processamento. O dicionário de parâmetros fornece os nomes e valores dos parâmetros. Veja Usando os algoritmos do processamento a partir do Terminal Python. para detalhes sobre como executar algoritmos de processamento a partir do console Python.

28.1.6.2. Interpolação IDW

Generates an Inverse Distance Weighted (IDW) interpolation of a point vector layer.

Sample points are weighted during interpolation such that the influence of one point relative to another declines with distance from the unknown point you want to create.

O método de interpolação IDW também tem algumas desvantagens: a qualidade do resultado da interpolação pode diminuir, se a distribuição dos pontos de dados amostrais for desigual.

Furthermore, maximum and minimum values in the interpolated surface can only occur at sample data points.

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Camada(s) de entrada

INTERPOLATION_DATA

[string]

Vector layer(s) and field(s) to use for the interpolation, coded in a string (see the ParameterInterpolationData class in InterpolationWidgets for more details).

The following GUI elements are provided to compose the interpolation data string:

  • Vector layer [vector: any]

  • Interpolation attribute [tablefield: numeric]: Attribute to use in the interpolation

  • Use Z-coordinate for interpolation [boolean]: Uses the layer’s stored Z values (Default: False)

For each of the added layer-field combinations, a type can be chosen:

  • Pontos

  • Linhas estruturadas

  • Linhas de quebra

In the string, the layer-field elements are separated by '::|::'. The sub-elements of the layer-field elements are separated by '::~::'.

Coeficiente de distância P

DISTANCE_COEFFICIENT

[número]

Padrão: 2.0

Define o coeficiente de distância para a interpolação. Mínimo: 0,0, máximo: 100.0.

Extensão (xmin, xmax, ymin, ymax)

EXTENT

[extensão]

Extent of the output raster layer.

Os métodos disponíveis são:

  • Calcular a partir da camada…: utiliza a extensão de uma camada carregada no projeto atual

  • Calculado a partir do layout do mapa…: usa extensão do tipo Item do layout do mapa no projeto ativo.

  • Calcular a partir do bookmark…: usa a extensão de uma já salvada bookmark

  • Usar extensão de tela de mapa

  • Desenhe na tela: Clique e arreste um retângulo delimitando a área que deve ser levada em consideração.

  • Insira as coordenadas como xmin, xmax, ymin, ymax

Output raster size

PIXEL_SIZE

[número]

Padrão: 0.1

Pixel size of the output raster layer in layer units.

In the GUI, the size can be specified by the number of rows (Number of rows) / columns (Number of columns) or the pixel size( Pixel Size X / Pixel Size Y). Increasing the number of rows or columns will decrease the cell size and increase the file size of the output raster. The values in Rows, Columns, Pixel Size X and Pixel Size Y will be updated simultaneously - doubling the number of rows will double the number of columns, and the cell size will be halved. The extent of the output raster will remain the same (approximately).

Interpolado

OUTPUT

[raster]

Padrão: [Salvar em arquivo temporário]

Camada raster de valores interpolados. Um de:

  • Salvar como Arquivo Temporário

  • Salvar em Arquivo…

Saídas

Etiqueta

Nome

Tipo

Descrição

Interpolado

OUTPUT

[raster]

Camada raster de valores interpolados

Código Python

Algorithm ID: qgis:idwinterpolation

import processing
processing.run("algorithm_id", {parameter_dictionary})

O id do algoritmo é exibido quando você passa o mouse sobre o algoritmo na Caixa de ferramentas de processamento. O dicionário de parâmetros fornece os nomes e valores dos parâmetros. Veja Usando os algoritmos do processamento a partir do Terminal Python. para detalhes sobre como executar algoritmos de processamento a partir do console Python.

28.1.6.3. Densidade de linha

Calculates for each raster cell, the density measure of linear features within a circular neighbourhood. This measure is obtained by summing all the line segments intersecting the circular neighbourhood and dividing this sum by the area of such neighbourhood. A weighting factor can be applied to the line segments.

../../../../_images/linedensity.png

Fig. 28.6 Line density example. Input layer source: Roads Overijssel - The Netherlands (OSM).

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Camada de entrada de linha

INPUT

[vetor: qualquer]

Input vector layer containing line features

Campo de peso*

WEIGHT

[número]

Campo da camada que contém o fator de peso a ser usado durante o cálculo

Search Radius

RADIUS

[número]

Padrão: 10

Radius of the circular neighbourhood. Units can be specified here.

Tamanho dos pixels

PIXEL_SIZE

[número]

Padrão: 10

Pixel size of the output raster layer in layer units. The raster has square pixels.

Line density raster

OUTPUT

[raster]

Padrão: [Salvar em arquivo temporário]

The output as a raster layer. One of:

  • Salvar como Arquivo Temporário

  • Salvar em Arquivo…

Saídas

Etiqueta

Nome

Tipo

Descrição

Line density raster

OUTPUT

[raster]

The output line density raster layer.

Código Python

Algorithm ID: native:linedensity

import processing
processing.run("algorithm_id", {parameter_dictionary})

O id do algoritmo é exibido quando você passa o mouse sobre o algoritmo na Caixa de ferramentas de processamento. O dicionário de parâmetros fornece os nomes e valores dos parâmetros. Veja Usando os algoritmos do processamento a partir do Terminal Python. para detalhes sobre como executar algoritmos de processamento a partir do console Python.

28.1.6.4. TIN Interpolation

Generates a Triangulated Irregular Network (TIN) interpolation of a point vector layer.

With the TIN method you can create a surface formed by triangles of nearest neighbor points. To do this, circumcircles around selected sample points are created and their intersections are connected to a network of non overlapping and as compact as possible triangles. The resulting surfaces are not smooth.

O algoritmo cria tanto a camada raster dos valores interpolados quanto a camada vetorial de linha com os limites da triangulação.

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Camada(s) de entrada

INTERPOLATION_DATA

[string]

Vector layer(s) and field(s) to use for the interpolation, coded in a string (see the ParameterInterpolationData class in InterpolationWidgets for more details).

The following GUI elements are provided to compose the interpolation data string:

  • Vector layer [vector: any]

  • Interpolation attribute [tablefield: numeric]: Attribute to use in the interpolation

  • Use Z-coordinate for interpolation [boolean]: Uses the layer’s stored Z values (Default: False)

For each of the added layer-field combinations, a type can be chosen:

  • Pontos

  • Linhas estruturadas

  • Linhas de quebra

In the string, the layer-field elements are separated by '::|::'. The sub-elements of the layer-field elements are separated by '::~::'.

Método de interpolação

METHOD

[enumeração]

Padrão: 0

Defina o método de interpolação a ser usado. Um de:

  • Linear

  • Clough-Toucher (cubic)

Extensão (xmin, xmax, ymin, ymax)

EXTENT

[extensão]

Extent of the output raster layer.

Os métodos disponíveis são:

  • Calcular a partir da camada…: utiliza a extensão de uma camada carregada no projeto atual

  • Calculado a partir do layout do mapa…: usa extensão do tipo Item do layout do mapa no projeto ativo.

  • Calcular a partir do bookmark…: usa a extensão de uma já salvada bookmark

  • Usar extensão de tela de mapa

  • Desenhe na tela: Clique e arreste um retângulo delimitando a área que deve ser levada em consideração.

  • Insira as coordenadas como xmin, xmax, ymin, ymax

Output raster size

PIXEL_SIZE

[número]

Padrão: 0.1

Pixel size of the output raster layer in layer units.

In the GUI, the size can be specified by the number of rows (Number of rows) / columns (Number of columns) or the pixel size( Pixel Size X / Pixel Size Y). Increasing the number of rows or columns will decrease the cell size and increase the file size of the output raster. The values in Rows, Columns, Pixel Size X and Pixel Size Y will be updated simultaneously - doubling the number of rows will double the number of columns, and the cell size will be halved. The extent of the output raster will remain the same (approximately).

Interpolado

OUTPUT

[raster]

Padrão: [Salvar em arquivo temporário]

The output TIN interpolation as a raster layer. One of:

  • Salvar como Arquivo Temporário

  • Salvar em Arquivo…

Triangulação

TRIANGULATION

[vetor: linha]

Default: [Pular saída]

The output TIN as a vector layer. One of:

  • Ignorar Saída

  • Criar Camada Temporária (TEMPORARY_OUTPUT)

  • Salvar em Arquivo…

  • Salvar para Geopackage…

  • Salvar na Tabela de Banco de Dados…

A codificação do arquivo também pode ser alterada aqui.

Saídas

Etiqueta

Nome

Tipo

Descrição

Interpolado

OUTPUT

[raster]

The output TIN interpolation as a raster layer

Triangulação

TRIANGULATION

[vetor: linha]

The output TIN as a vector layer.

Código Python

Algorithm ID: qgis:tininterpolation

import processing
processing.run("algorithm_id", {parameter_dictionary})

O id do algoritmo é exibido quando você passa o mouse sobre o algoritmo na Caixa de ferramentas de processamento. O dicionário de parâmetros fornece os nomes e valores dos parâmetros. Veja Usando os algoritmos do processamento a partir do Terminal Python. para detalhes sobre como executar algoritmos de processamento a partir do console Python.