23.1.5. Layer tools

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

图 23.7 In red the bounding box of the source layer

Default menu: Vector ► Research Tools

23.1.5.1.1. 參數

Label

名稱

Type

說明

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 PostGIS Table...

The file encoding can also be changed here.

23.1.5.1.2. 輸出

Label

名稱

Type

說明

Extent

OUTPUT

[vector: polygon]

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

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