24.1.5. Layer tools

24.1.5.1. Export layer(s) information

NEW in 3.18

Creates a polygon layer with features corresponding to the extent of selected layer(s).

Additional layer details (CRS, provider name, file path, layer name, subset filter, abstract and attribution) are attached as attributes to each feature.

24.1.5.1.1. Parameters

Label

Name

Type

Description

Input layers

LAYERS

[vector: any][list]

Input vector layers to get information on.

Output

OUTPUT

[vector: polygon]

Default: [Create temporary layer]

Specification of the output layer with information. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

24.1.5.1.2. Outputs

Label

Name

Type

Description

Output

OUTPUT

[vector: polygon]

Polygon vector layer showing extent of input layers and associated information in attributes.

24.1.5.1.3. Python code

Algorithm ID: native:exportlayersinformation

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 Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

24.1.5.2. Export to spreadsheet

Exports the attributes of a selection of vector layers into a spreadsheet document or optionally appends them to an existing spreadsheet as additional sheets.

24.1.5.2.1. Parameters

Label

Name

Type

Description

Input layers

LAYERS

[vector: any][list]

Input vector layers. The output spreadsheet will consist of a sheet, for each layer, that contains the attributes of this layer.

Use field aliases as column headings

USE_ALIAS

[boolean]

Default: False

Use the field aliases from the attribute table for the spreadsheet.

Export formatted values instead of raw values

FORMATTED_VALUES

[boolean]

Default: False

If True, exports the formatted, human readable values (e.g., from a value map or value relation) to the spreadsheet.

Overwrite existing spreadsheet

OVERWRITE

[boolean]

Default: True

If the specified spreadsheet exists, setting this option to True will overwrite the existing spreadsheet. If this option is False and the spreadsheet exists, the layers will be appended as additional sheets.

Destination spreadsheet

OUTPUT

[file]

Default: [Save to temporary file]

Output spreadsheet with a sheet for every layer. One of:

  • Save to a Temporary File

  • Save to File…

24.1.5.2.2. Outputs

Label

Name

Type

Description

Destination spreadsheet

OUTPUT

[file]

Spreadsheet with a sheet for every layer.

Layers within spreadsheet

OUTPUT_LAYERS

[list]

The list of sheets added to the spreadsheet.

24.1.5.2.3. Python code

Algorithm ID: native:exporttospreadsheet

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 Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

24.1.5.3. Extract layer extent

Generates a vector layer with the minimum bounding box (rectangle with N-S orientation) that covers all the input features.

The output layer contains a single bounding box for the whole input layer.

../../../../_images/extract_layer_extent.png

Fig. 24.7 In red the bounding box of the source layer

Default menu: Vector ► Research Tools

24.1.5.3.1. Parameters

Label

Name

Type

Description

Layer

INPUT

[layer]

Input layer

Extent

OUTPUT

[vector: polygon]

Default: [Create temporary layer]

Specify the polygon vector layer for the output extent. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

24.1.5.3.2. Outputs

Label

Name

Type

Description

Extent

OUTPUT

[vector: polygon]

Output (polygon) vector layer with the extent (minimum bounding box)

24.1.5.3.3. Python code

Algorithm ID: qgis:polygonfromlayerextent

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 Using processing algorithms from the console for details on how to run processing algorithms from the Python console.