24.1.12. Raster tools

24.1.12.1. Convert map to raster

Creates a raster image of map canvas content.

A map theme can be selected to render a predetermined set of layers with a defined style for each layer.

Alternatively, a single layer can be selected if no map theme is set.

If neither map theme nor layer is set, the current map content will be rendered. The minimum extent entered will internally be extended to be a multiple of the tile size.

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Minimum extent to render (xmin, xmax, ymin, ymax)

EXTENT

[extent]

Specify the extent of the output raster layer. One of:

  • Use Canvas Extent

  • Select Extent on Canvas

  • Use Layer Extent…

It will internally be extended to a multiple of the tile size.

Tile size

TILE_SIZE

[number]

Default: 1024

Size of the tile of the output raster layer. Minimum value: 64.

Map units per pixel

MAP_UNITS_PER_PIXEL

[number]

Padrão: 100.0

Pixel size (in map units). Minimum value: 0.0

Make background transparent

MAKE_BACKGROUND_TRANSPARENT

[boolean]

Padrão: Falso

Allows exporting the map with a transparent background. Outputs an RGBA (instead of RGB) image if set to True.

Map theme to render

Opcional

MAP_THEME

[enumeration]

Use an existing map theme for the rendering.

Single layer to render

Opcional

LAYER

[enumeration]

Choose a single layer for the rendering

Camada de saída

SAÍDA

[raster]

Padrão: Salvar para arquivo temporário

Especificação do raster de saída. Um de:

  • Salvar como Arquivo Temporário

  • Salvar para Arquivo…

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

Saídas

Etiqueta

Nome

Tipo

Descrição

Camada de saída

SAÍDA

[raster]

Camada raster de saída

Python code

Algorithm ID: qgis:rasterize

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

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Usando os algoritmos do processamento a partir do Terminal Python. for details on how to run processing algorithms from the Python console.

24.1.12.2. Fill NoData cells

Resets the NoData values in the input raster to a chosen value, resulting in raster dataset with no NoData pixels.

The algorithm respects the input raster data type, e.g. a floating point fill value will be truncated when applied to an integer raster.

../../../../_images/fill_nodata.png

Fig. 24.25 Filling NoData values (in grey) of a raster

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Input raster

INPUT

[raster]

The raster to process.

Band number

BAND

[number]

Padrão: 1

The band of the raster

Fill value

FILL_VALUE

[number]

Default: 1.0

Set the value to use for the NoData pixels

Output raster

SAÍDA

[raster]

Default: [Save to temporary file]

Especificação do raster de saída. Um de:

  • Salvar como Arquivo Temporário

  • Salvar para Arquivo…

Saídas

Etiqueta

Nome

Tipo

Descrição

Output raster

SAÍDA

[raster]

The output raster layer with filled data cells.

Python code

Algorithm ID: native:fillnodata

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

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Usando os algoritmos do processamento a partir do Terminal Python. for details on how to run processing algorithms from the Python console.

24.1.12.3. Generate XYZ tiles (Directory)

Generates raster “XYZ” tiles using the current QGIS project as individual images to a directory structure.

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Extent (xmin, xmax, ymin, ymax)

EXTENT

[extent]

Specify the extent of the tiles. One of:

  • Use Canvas Extent

  • Select Extent on Canvas

  • Use Layer Extent…

It will internally be extended to a multiple of the tile size.

Minimum zoom

ZOOM_MIN

[number]

Padrão: 12

Minimum 0, maximum 25.

Maximum zoom

ZOOM_MAX

[number]

Padrão: 12

Minimum 0, maximum 25.

DPI

DPI

[number]

Default: 96

Minimum 48, maximum 600.

Background color

Opcional

BACKGROUND_COLOR

[color]

Default: QColor(0, 0, 0, 0)

Choose the background color for the tiles

Tile format

TILE_FORMAT

[enumeration]

Padrão: 0

Um de:

  • 0 — PNG

  • 1 — JPG

Quality (JPG only)

Opcional

QUALITY

[number]

Default: 75

Minimum 1, maximum 100.

Metatile size

Opcional

METATILESIZE

[number]

Padrão: 4

Specify a custom metatile size when generating XYZ tiles. Larger values may speed up the rendering of tiles and provide better labelling (fewer gaps without labels) at the expense of using more memory. Minimum 1, maximum 20.

Tile width

Opcional

TILE_WIDTH

[number]

Padrão: 256

Minimum 1, maximum 4096.

Tile height

Opcional

TILE_HEIGHT

[number]

Padrão: 256

Minimum 1, maximum 4096.

Use inverted tile Y axis (TMS conventions)

Opcional

TMS_CONVENTION

[boolean]

Padrão: Falso

Diretório de saída

OUTPUT_DIRECTORY

[folder]

Default: [Save to temporary folder]

Especificação do raster de saída. Um de:

  • Ignorar Saída

  • Salvar como Diretório Temporário

  • Salvar para Diretório…

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

Output html (Leaflet)

OUTPUT_HTML

[html]

Default: [Save to temporary file]

Specification of the output HTML file. One of:

  • Ignorar Saída

  • Salvar como Arquivo Temporário

  • Salvar para Arquivo…

Saídas

Etiqueta

Nome

Tipo

Descrição

Diretório de saída

OUTPUT_DIRECTORY

[folder]

Output directory (for the tiles)

Output html (Leaflet)

OUTPUT_HTML

[html]

The output HTML (Leaflet) file

Python code

Algorithm ID: qgis:tilesxyzdirectory

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

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Usando os algoritmos do processamento a partir do Terminal Python. for details on how to run processing algorithms from the Python console.

24.1.12.4. Generate XYZ tiles (MBTiles)

Generates raster “XYZ” tiles using the current QGIS project as a single file in the “MBTiles” format.

Parâmetros

Etiqueta

Nome

Tipo

Descrição

Extent (xmin, xmax, ymin, ymax)

EXTENT

[extent]

Specify the extent of the tiles. One of:

  • Use Canvas Extent

  • Select Extent on Canvas

  • Use Layer Extent…

It will internally be extended to a multiple of the tile size.

Minimum zoom

ZOOM_MIN

[number]

Padrão: 12

Minimum 0, maximum 25.

Maximum zoom

ZOOM_MAX

[number]

Padrão: 12

Minimum 0, maximum 25.

DPI

DPI

[number]

Default: 96

Minimum 48, maximum 600.

Background color

Opcional

BACKGROUND_COLOR

[color]

Default: QColor(0, 0, 0, 0)

Choose the background color for the tiles

Tile format

TILE_FORMAT

[enumeration]

Padrão: 0

Um de:

  • 0 — PNG

  • 1 — JPG

Quality (JPG only)

Opcional

QUALITY

[number]

Default: 75

Minimum 1, maximum 100.

Metatile size

Opcional

METATILESIZE

[number]

Padrão: 4

Specify a custom metatile size when generating XYZ tiles. Larger values may speed up the rendering of tiles and provide better labelling (fewer gaps without labels) at the expense of using more memory. Minimum 1, maximum 20.

Output file (for MBTiles)

OUTPUT_FILE

[file]

Default: [Save to temporary file]

Especificação do arquivo de saída. Um de:

  • Ignorar Saída

  • Salvar como Arquivo Temporário

  • Salvar para Arquivo…

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

Saídas

Etiqueta

Nome

Tipo

Descrição

Output file (for MBTiles)

OUTPUT_FILE

[file]

The output file.

Python code

Algorithm ID: qgis:tilesxyzmbtiles

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

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Usando os algoritmos do processamento a partir do Terminal Python. for details on how to run processing algorithms from the Python console.