Important

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

28.1.18. Raster tools

28.1.18.1. Align raster

NEW in 3.34

Aligns raster by resampling it to the same cell size and reprojecting to the same CRS as a reference raster.

Atenționare

This algorithm is ONLY available in the Model Designer context.

Parametri

Etichetă

Nume

Tipul

Descriere

Input layer

INPUT

[raster]

Input raster layer to align

Resampling method

RESAMPLING_METHOD

[enumerare]

Implicit: 0

Method to use for input layer resampling. Available options are:

  • 0 — Nearest Neighbour

  • 1 — Bilinear (2x2 kernel)

  • 2 — Cubic (4x4 kernel)

  • 3 — Cubic B-Spline (4x4 kernel)

  • 4 — Lanczos (6x6 kernel)

  • 5 — Average

  • 6 — Mode

  • 7 — Maximum

  • 8 — Minimum

  • 9 — Median

  • 10 — First quartile (Q1)

  • 11 — Third quartile (Q3)

Rescale values according to the cell size

RESCALE

[boolean]

Default: No

Reference layer

REFERENCE_LAYER

[raster]

A raster layer that will be used to fetch extent, cell size and CRS that will be applied to input layers.

Override reference CRS

Opţional

CRS

[crs]

CRS to be used instead of the reference layer’s

Override reference cell size X

Opţional

CELL_SIZE_X

[număr]

Cell size in X direction to be used instead of the reference layer’s

Override reference cell size Y

Opţional

CELL_SIZE_Y

[număr]

Cell size in Y direction to be used instead of the reference layer’s

Override reference grid offset X

Opţional

GRID_OFFSET_X

[număr]

Offset in X direction to apply to cells grid

Override reference grid offset Y

Opţional

GRID_OFFSET_Y

[număr]

Offset in Y direction to apply to cells grid

Clip to extent

Opţional

EXTENT

[extent]

Specify the extent of the output raster layer. It will internally be extended to a multiple of the tile size.

Metodele disponibile sunt:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Aligned raster

OUTPUT

[raster]

output raster with pixels resampled

Rezultat

Etichetă

Nume

Tipul

Descriere

Aligned raster

OUTPUT

[raster]

output raster with pixels resampled

Cod Python

Algorithm ID: native:alignraster

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

ID-ul algoritmului se afișează atunci când treceți peste algoritmul din caseta instrumentelor de procesare. Dicționarul parametrilor furnizează valorile și NUMELE parametrilor. Pentru detalii despre rularea algoritmilor de procesare din consola Python, parcurgeți Utilizarea algoritmilor de procesare din consolă.

28.1.18.2. Align rasters

NEW in 3.34

Aligns rasters by resampling them to the same cell size and reprojecting to the same CRS as a reference raster.

Atenționare

This algorithm is NOT available in the Model Designer context.

Parametri

Etichetă

Nume

Tipul

Descriere

Input layers

INPUT

[raster] [list]

List of input raster layers with resampling options associated (filled as a QgsProcessingParameterAlignRasterLayers item):

Input layer [string] (inputFile)

Full path of the input layer to align

Output file [string] (outputFile)

Full path of the corresponding aligned output layer

Resampling method [enumeration] (resampleMethod)

Method to use for input layer resampling. Available options are:

  • 0 — Nearest Neighbour

  • 1 — Bilinear (2x2 kernel)

  • 2 — Cubic (4x4 kernel)

  • 3 — Cubic B-Spline (4x4 kernel)

  • 4 — Lanczos (6x6 kernel)

  • 5 — Average

  • 6 — Mode

  • 7 — Maximum

  • 8 — Minimum

  • 9 — Median

  • 10 — First quartile (Q1)

  • 11 — Third quartile (Q3)

Rescale values according to the cell size [boolean] (rescale)

Reference layer

REFERENCE_LAYER

[raster]

A raster layer that will be used to fetch extent, cell size and CRS that will be applied to input layers.

Override reference CRS

Opţional

CRS

[crs]

CRS to be used instead of the reference layer’s

Override reference cell size X

Opţional

CELL_SIZE_X

[număr]

Cell size in X direction to be used instead of the reference layer’s

Override reference cell size Y

Opţional

CELL_SIZE_Y

[număr]

Cell size in Y direction to be used instead of the reference layer’s

Override reference grid offset X

Opţional

GRID_OFFSET_X

[număr]

Offset in X direction to apply to cells grid

Override reference grid offset Y

Opţional

GRID_OFFSET_Y

[număr]

Offset in Y direction to apply to cells grid

Clip to extent

Opţional

EXTENT

[extent]

Specify the extent of the output raster layer. It will internally be extended to a multiple of the tile size.

Metodele disponibile sunt:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Rezultat

Etichetă

Nume

Tipul

Descriere

Aligned rasters

OUTPUT_LAYERS

[raster] [list]

output rasters with pixels resampled

Cod Python

Algorithm ID: native:alignrasters

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

ID-ul algoritmului se afișează atunci când treceți peste algoritmul din caseta instrumentelor de procesare. Dicționarul parametrilor furnizează valorile și NUMELE parametrilor. Pentru detalii despre rularea algoritmilor de procesare din consola Python, parcurgeți Utilizarea algoritmilor de procesare din consolă.

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

Parametri

Etichetă

Nume

Tipul

Descriere

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

EXTENT

[extent]

Specify the extent of the output raster layer. It will internally be extended to a multiple of the tile size.

Metodele disponibile sunt:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Tile size

TILE_SIZE

[număr]

Implicit: 1024

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

Map units per pixel

MAP_UNITS_PER_PIXEL

[număr]

Implicit: 100.0

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

Make background transparent

MAKE_BACKGROUND_TRANSPARENT

[boolean]

Implicit: False

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

Map theme to render

Opţional

MAP_THEME

[enumerare]

Use an existing map theme for the rendering.

Single layer to render

Opţional

LAYER

[enumerare]

Choose a single layer for the rendering

Output layer

OUTPUT

[raster]

Implicit: [Salvare într-un fișier temporar]

Specification of the output raster. One of:

  • Salvare într-un Fișier Temporar

  • Salvare în Fișier…

Rezultat

Etichetă

Nume

Tipul

Descriere

Output layer

OUTPUT

[raster]

Stratul raster de ieșire

Cod Python

Algorithm ID: native:rasterize

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

ID-ul algoritmului se afișează atunci când treceți peste algoritmul din caseta instrumentelor de procesare. Dicționarul parametrilor furnizează valorile și NUMELE parametrilor. Pentru detalii despre rularea algoritmilor de procesare din consola Python, parcurgeți Utilizarea algoritmilor de procesare din consolă.

28.1.18.4. Umplere celule NoData

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. 28.39 Filling NoData values (in grey) of a raster

Parametri

Etichetă

Nume

Tipul

Descriere

Input raster

INPUT

[raster]

The raster to process.

Numărul benzii

BAND

[număr]

Implicit: 1

The band of the raster

Fill value

FILL_VALUE

[număr]

Implicit: 1.0

Set the value to use for the NoData pixels

Raster de ieșire

OUTPUT

[raster]

Implicit: [Salvare într-un fișier temporar]

Specification of the output raster. One of:

  • Salvare într-un Fișier Temporar

  • Salvare în Fișier…

Rezultat

Etichetă

Nume

Tipul

Descriere

Raster de ieșire

OUTPUT

[raster]

The output raster layer with filled data cells.

Cod Python

ID Algorithm: nativ:fillnodata

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

ID-ul algoritmului se afișează atunci când treceți peste algoritmul din caseta instrumentelor de procesare. Dicționarul parametrilor furnizează valorile și NUMELE parametrilor. Pentru detalii despre rularea algoritmilor de procesare din consola Python, parcurgeți Utilizarea algoritmilor de procesare din consolă.

28.1.18.5. Generate XYZ tiles (Directory)

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

Optionally, a Leaflet HTML output file using the generated tiles as a map layer could be created.

Parametri

Basic parameters

Etichetă

Nume

Tipul

Descriere

Extent (xmin, xmax, ymin, ymax)

EXTENT

[extent]

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

Metodele disponibile sunt:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Minimum zoom

ZOOM_MIN

[număr]

Implicit: 12

Minimum 0, maximum 25.

Maximum zoom

ZOOM_MAX

[număr]

Implicit: 12

Minimum 0, maximum 25.

DPI

DPI

[număr]

Implicit: 96

Minimum 48, maximum 600.

Background color

Opţional

BACKGROUND_COLOR

[color]

Implicit: QColor(0, 0, 0, 0)

Choose the background color for the tiles

Enable antialiasing

ANTIALIAS

[boolean]

Default: True

Determines if antialiasing should be enabled

Tile format

TILE_FORMAT

[enumerare]

Implicit: 0

One of:

  • 0 — PNG

  • 1 — JPG

Quality (JPG only)

Opţional

QUALITY

[număr]

Implicit: 75

Minimum 1, maximum 100.

Metatile size

Opţional

METATILESIZE

[număr]

Implicit: 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

Opţional

TILE_WIDTH

[număr]

Implicit: 256

Minimum 1, maximum 4096.

Tile height

Opţional

TILE_HEIGHT

[număr]

Implicit: 256

Minimum 1, maximum 4096.

Use inverted tile Y axis (TMS conventions)

Opţional

TMS_CONVENTION

[boolean]

Implicit: False

Director de ieșire

Opţional

OUTPUT_DIRECTORY

[folder]

Implicit: [Salvare într-un fișier temporar]

Specification of the output directory (for the tiles). One of:

  • Skip Output

  • Salvare Intr-un Director Temporar

  • Salvare în Director

Output html (Leaflet)

Opţional

OUTPUT_HTML

[html]

Implicit: [Salvare într-un fișier temporar]

Specification of the output HTML file. One of:

  • Skip Output

  • Salvare într-un Fișier Temporar

  • Salvare în Fișier…

Advanced parameters

NEW in 3.30

Etichetă

Nume

Tipul

Descriere

Leaflet HTML output title

Opţional

HTML_TITLE

[string]

Default: Not set

HTML <title>-tag used for the Leaflet HTML output file.

Leaflet HTML output attribution

Opţional

HTML_ATTRIBUTION

[string]

Default: Not set

Custom map attribution used for the Leaflet HTML output file. HTML links are possible.

Include OpenStreetMap basemap in Leaflet HTML output

Opţional

HTML_OSM

[boolean]

Implicit: False

An OpenStreetMap basemap layer (source: https://tile.openstreetmap.org) is included in the Leaflet HTML output file. Proper map attribution is added automatically.

Rezultat

Etichetă

Nume

Tipul

Descriere

Director de ieșire

OUTPUT_DIRECTORY

[folder]

Output directory (for the tiles)

Output html (Leaflet)

OUTPUT_HTML

[html]

The output HTML (Leaflet) file

Cod Python

Algorithm ID: native:tilesxyzdirectory

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

ID-ul algoritmului se afișează atunci când treceți peste algoritmul din caseta instrumentelor de procesare. Dicționarul parametrilor furnizează valorile și NUMELE parametrilor. Pentru detalii despre rularea algoritmilor de procesare din consola Python, parcurgeți Utilizarea algoritmilor de procesare din consolă.

28.1.18.6. Generate XYZ tiles (MBTiles)

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

Parametri

Etichetă

Nume

Tipul

Descriere

Extent (xmin, xmax, ymin, ymax)

EXTENT

[extent]

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

Metodele disponibile sunt:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Minimum zoom

ZOOM_MIN

[număr]

Implicit: 12

Minimum 0, maximum 25.

Maximum zoom

ZOOM_MAX

[număr]

Implicit: 12

Minimum 0, maximum 25.

DPI

DPI

[număr]

Implicit: 96

Minimum 48, maximum 600.

Background color

Opţional

BACKGROUND_COLOR

[color]

Implicit: QColor(0, 0, 0, 0)

Choose the background color for the tiles

Enable antialiasing

ANTIALIAS

[boolean]

Default: True

Determines if antialiasing should be enabled

Tile format

TILE_FORMAT

[enumerare]

Implicit: 0

One of:

  • 0 — PNG

  • 1 — JPG

Quality (JPG only)

Opţional

QUALITY

[număr]

Implicit: 75

Minimum 1, maximum 100.

Metatile size

Opţional

METATILESIZE

[număr]

Implicit: 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]

Implicit: [Salvare într-un fișier temporar]

Specification of the output file. One of:

  • Skip Output

  • Salvare într-un Fișier Temporar

  • Salvare în Fișier…

Rezultat

Etichetă

Nume

Tipul

Descriere

Output file (for MBTiles)

OUTPUT_FILE

[file]

The output file.

Cod Python

Algorithm ID: native:tilesxyzmbtiles

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

ID-ul algoritmului se afișează atunci când treceți peste algoritmul din caseta instrumentelor de procesare. Dicționarul parametrilor furnizează valorile și NUMELE parametrilor. Pentru detalii despre rularea algoritmilor de procesare din consola Python, parcurgeți Utilizarea algoritmilor de procesare din consolă.