24.1.14. Vector general

24.1.14.1. Assegnare proiezione

Assegna una nuova proiezione ad un layer vettoriale.

Crea un nuovo layer con le stesse identiche caratteristiche e geometrie di quello in ingresso, ma assegnato a un nuovo SR. Le geometrie non sono riproiettate, sono solo assegnate a un diverso SR.

Questo algoritmo può essere usato per aggiustare i layer ai quali è stata assegnata una proiezione errata.

Gli attributi non vengono modificati da questo algoritmo.

24.1.14.1.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

IN INGRESSO

[vettore: qualsiasi]

Layer vettoriale con SR errato o mancante

SR assegnato

SR

[crs]

Default: EPSG:4326 - WGS84

Seleziona il nuovo SR da assegnare al layer vettoriale

SR assegnato

Opzionale

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specifica il layer di uscita che contiene solo i duplicati. Uno di:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.1.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

SR assegnato

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Layer vettoriale con proiezione assegnata

24.1.14.1.3. Codice Python

ID Algoritmo: qgis:assignprojection

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.2. Convert layer to spatial bookmarks

Creates spatial bookmarks corresponding to the extent of features contained in a layer.

24.1.14.2.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vector: line, polygon]

Il layer del vettore in ingresso

Bookmark destination

DESTINATION

[numero]

Predefinito: 0

Select the destination for the bookmarks. One of:

  • 0 — Project bookmarks

  • 1 — User bookmarks

Name field

NAME_EXPRESSION

[expression]

Field or expression that will give names to the generated bookmarks

Group field

GROUP_EXPRESSION

[expression]

Field or expression that will provide groups for the generated bookmarks

24.1.14.2.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Count of bookmarks added

COUNT

[numero]

24.1.14.2.3. Codice Python

Algorithm ID: qgis:layertobookmarks

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.3. Convert spatial bookmarks to layer

Creates a new layer containing polygon features for stored spatial bookmarks. The export can be filtered to only bookmarks belonging to the current project, to all user bookmarks, or a combination of both.

24.1.14.3.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Bookmark source

SOURCE

[enumeration] [list]

Default: [0,1]

Select the source(s) of the bookmarks. One or more of:

  • 0 — Project bookmarks

  • 1 — User bookmarks

Output CRS

SR

[crs]

Default: EPSG:4326 - WGS 84

The CRS of the output layer

Output

LIVELLO IN USCITA

[vector: polygon]

Predefinito: [Crea layer temporaneo]

Specify the output layer. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.3.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Output

LIVELLO IN USCITA

[vector: polygon]

The output (bookmarks) vector layer

24.1.14.3.3. Codice Python

ID Algoritmo: qgis:bookmarkstolayer

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.4. Create attribute index

Creates an index against a field of the attribute table to speed up queries. The support for index creation depends on both the layer’s data provider and the field type.

No outputs are created: the index is stored on the layer itself.

24.1.14.4.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Select the vector layer you want to create an attribute index for

Attribute to index

FIELD

[tablefield: any]

Field of the vector layer

24.1.14.4.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Indexed layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

A copy of the input vector layer with an index for the specified field

24.1.14.4.3. Codice Python

Algorithm ID: qgis:createattributeindex

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.5. Create spatial index

Creates an index to speed up access to the features in a layer based on their spatial location. Support for spatial index creation is dependent on the layer’s data provider.

No new output layers are created.

Default menu: Vector ► Data Management Tools

24.1.14.5.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Livello vettoriale in ingresso

24.1.14.5.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Indexed layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

A copy of the input vector layer with a spatial index

24.1.14.5.3. Codice Python

ID Algoritmo: qgis:createspatialindex

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.6. Define Shapefile projection

Sets the CRS (projection) of an existing Shapefile format dataset to the provided CRS. It is very useful when a Shapefile format dataset is missing the prj file and you know the correct projection.

Contrary to the Assegnare proiezione algorithm, it modifies the current layer and will not output a new layer.

Nota

For Shapefile datasets, the .prj and .qpj files will be overwritten - or created if missing - to match the provided CRS.

Default menu: Vector ► Data Management Tools

24.1.14.6.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

IN INGRESSO

[vettore: qualsiasi]

Vector layer with missing projection information

SR

SR

[crs]

Select the CRS to assign to the vector layer

24.1.14.6.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

IN INGRESSO

[lo stesso del livello in ingresso]

The input vector layer with the defined projection

24.1.14.6.3. Codice Python

ID Algoritmo: qgis:definecurrentprojection

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.7. Cancella le geometrie duplicate

Trova e rimuove le geometrie duplicate.

Attributes are not checked, so in case two features have identical geometries but different attributes, only one of them will be added to the result layer.

24.1.14.7.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

IN INGRESSO

[vettore: qualsiasi]

The layer with duplicate geometries you want to clean

Cleaned

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output layer. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.7.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Count of discarded duplicate records

DUPLICATE_COUNT

[numero]

Count of discarded duplicate records

Cleaned

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

The output layer without any duplicated geometries

Conteggio dei record mantenuti

RETAINED_COUNT

[numero]

Conteggio dei record univoci

24.1.14.7.3. Codice Python

ID Algoritmo: qgis:deleteduplicategeometries

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.8. Delete duplicates by attribute

Deletes duplicate rows by only considering the specified field / fields. The first matching row will be retained, and duplicates will be discarded.

Optionally, these duplicate records can be saved to a separate output for analysis.

24.1.14.8.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

IN INGRESSO

[vettore: qualsiasi]

The input layer

Fields to match duplicates by

FIELDS

[tablefield: any] [list]

Fields defining duplicates. Features with identical values for all these fields are considered duplicates.

Filtered (no duplicates)

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output layer containing the unique features. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

Filtered (duplicates)

Opzionale

DUPLICATES

[lo stesso del livello in ingresso]

Default: [Skip output]

Specifica il layer di uscita che contiene solo i duplicati. Uno di:

  • Skip output

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.8.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Filtered (duplicates)

Opzionale

DUPLICATES

[lo stesso del livello in ingresso]

Default: [Skip output]

Vector layer containing the removed features. Will not be produced if not specified (left as [Skip output]).

Count of discarded duplicate records

DUPLICATE_COUNT

[numero]

Count of discarded duplicate records

Filtered (no duplicates)

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Vector layer containing the unique features.

Conteggio dei record mantenuti

RETAINED_COUNT

[numero]

Conteggio dei record univoci

24.1.14.8.3. Codice Python

ID Algoritmo: qgis:deleteduplicatesbyattribute

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.9. Detect dataset changes

Compares two vector layers, and determines which features are unchanged, added or deleted between the two. It is designed for comparing two different versions of the same dataset.

../../../../_images/detect_change.png

Fig. 24.32 Detect dataset change example

24.1.14.9.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Original layer

ORIGINAL

[vettore: qualsiasi]

The vector layer considered as the original version

Revised layer

REVISED

[vettore: qualsiasi]

The revised or modified vector layer

Attributes to consider for match

Opzionale

COMPARE_ATTRIBUTES

[tablefield: any] [list]

Attributes to consider for match. By default, all attributes are compared.

Geometry comparison behavior

Opzionale

MATCH_TYPE

[numero]

Default: 1

Defines the criteria for comparison. Options:

  • 0 — Exact Match: includes the order and vertices count of geometries

  • 1 — Tolerant Match (Topological Equality): geometries are considered equal

Unchanged features

UNCHANGED

[vector: same as Original layer]

Specify the output vector layer containing the unchanged features. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

Added features

ADDED

[vector: same as Original layer]

Specify the output vector layer containing the added features. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

Deleted features

DELETED

[vector: same as Original layer]

Specify the output vector layer containing the deleted features. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.9.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Unchanged features

UNCHANGED

[vector: same as Original layer]

Vector layer containing the unchanged features.

Added features

ADDED

[vector: same as Original layer]

Vector layer containing the added features.

Deleted features

DELETED

[vector: same as Original layer]

Vector layer containing the deleted features.

Count of unchanged features

UNCHANGED_COUNT

[numero]

Count of unchanged features.

Count of features added in revised layer

ADDED_COUNT

[numero]

Count of features added in revised layer.

Count of features deleted from original layer

DELETED_COUNT

[numero]

Count of features deleted from original layer.

24.1.14.9.3. Codice Python

ID Algoritmo: qgis:detectdatasetchanges

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.10. Geometrie eliminate

Creates a simple geometryless copy of the input layer attribute table. It keeps the attribute table of the source layer.

If the file is saved in a local folder, you can choose between many file formats.

checkbox Permette features in-place modification 1

24.1.14.10.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

IN INGRESSO

[vettore: qualsiasi]

Il layer del vettore in ingresso

Geometrie Eliminate

LIVELLO IN USCITA

[table]

Specifica il layer di uscita senza geometria. Uno di:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.10.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Geometrie Eliminate

LIVELLO IN USCITA

[table]

The output geometryless layer. A copy of the original attribute table.

24.1.14.10.3. Codice Python

ID Algoritmo: qgis:dropgeometries

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.11. Execute SQL

Runs a simple or complex query with SQL syntax on the source layer.

Input datasources are identified with input1, input2inputN and a simple query will look like SELECT * FROM input1.

Beside a simple query, you can add expressions or variables within the SQL query parameter itself. This is particulary useful if this algorithm is executed within a Processing model and you want to use a model input as a parameter of the query. An example of a query will then be SELECT * FROM [% @table %] where @table is the variable that identifies the model input.

The result of the query will be added as a new layer.

24.1.14.11.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Additional input datasources (called input1, .., inputN in the query)

INPUT_DATASOURCES

[vector: any] [list]

List of layers to query. In the SQL editor you can refer these layers with their real name or also with input1, input2, inputN depending on how many layers have been chosen.

SQL query

INPUT_QUERY

[stringa]

Type the string of your SQL query, e.g. SELECT * FROM input1.

Unique identifier field

Opzionale

INPUT_UID_FIELD

[stringa]

Specify the column with unique ID

Geometry field

Opzionale

INPUT_GEOMETRY_FIELD

[stringa]

Specify the geometry field

Geometry type

Opzionale

INPUT_GEOMETRY_TYPE

[numero]

Predefinito: 0

Choose the geometry of the result. By default the algorithm will autodetect it. One of:

  • 0 — Autodetect

  • 1 — No geometry

  • 2 — Point

  • 3 — LineString

  • 4 — Polygon

  • 5 — MultiPoint

  • 6 — MultiLineString

  • 7 — MultiPolygon

SR

Opzionale

INPUT_GEOMETRY_CRS

[crs]

The CRS to assign to the output layer

SQL Output

LIVELLO IN USCITA

[vettore: qualsiasi]

Predefinito: [Crea layer temporaneo]

Specify the output layer created by the query. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.11.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

SQL Output

LIVELLO IN USCITA

[vettore: qualsiasi]

Vector layer created by the query

24.1.14.11.3. Codice Python

ID Algoritmo: qgis:executesql

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.12. Extract selected features

Saves the selected features as a new layer.

Nota

If the selected layer has no selected features, the newly created layer will be empty.

24.1.14.12.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Layer to save the selection from

Selected features

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the vector layer for the selected features. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.12.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Selected features

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Vector layer with only the selected features, or no feature if none was selected.

24.1.14.12.3. Codice Python

ID Algoritmo: qgis:saveselectedfeatures

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.13. Find projection

Creates a shortlist of candidate coordinate reference systems, for instance for a layer with an unknown projection.

The area that the layer is expected to cover must be specified via the target area parameter. The coordinate reference system for this target area must be known to QGIS.

The algorithm operates by testing the layer’s extent in every known reference system and then listing any for which the bounds would be near the target area if the layer was in this projection.

24.1.14.13.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Layer with unknown projection

Target area for layer (xmin, xmax, ymin, ymax)

TARGET_AREA

[estensione]

The area that the layer covers. The options for specifying the extent are:

  • Use Canvas Extent

  • Select Extent on Canvas

  • Use Layer Extent

It is also possible to provide the extent coordinates directly (xmin, xmax, ymin, ymax).

CRS candidates

LIVELLO IN USCITA

[table]

Predefinito: [Crea layer temporaneo]

Specify the table (geometryless layer) for the CRS suggestions (EPSG codes). One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.13.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

CRS candidates

LIVELLO IN USCITA

[table]

A table with all the CRS (EPSG codes) of the matching criteria.

24.1.14.13.3. Codice Python

ID Algoritmo: qgis:findprojection

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.14. Flatten relationship

Flattens a relationship for a vector layer, exporting a single layer containing one parent feature per related child feature. This master feature contains all the attributes for the related features. This allows to have the relation as a plain table that can be e.g. exported to CSV.

../../../../_images/flatten_relationship.png

Fig. 24.33 Form of a region with related children (left) - A duplicate region feature for each related child, with joined attributes (right)

24.1.14.14.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Layer with the relationship that should be de-normalized

Flattened Layer

Opzionale

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Default: [Save to temporary file]

Specify the output (flattened) layer. One of:

  • Save to a Temporary File

  • Salva come File…

  • Save To GeoPackage…

  • Save to Database Table…

La codifica del file può anche essere cambiata qui.

24.1.14.14.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Flattened layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

A layer containing master features with all the attributes for the related features

24.1.14.14.3. Codice Python

ID Algoritmo: native:flattenrelationships

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.15. Join attributes by field value

Takes an input vector layer and creates a new vector layer that is an extended version of the input one, with additional attributes in its attribute table.

The additional attributes and their values are taken from a second vector layer. An attribute is selected in each of them to define the join criteria.

24.1.14.15.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Input vector layer. The output layer will consist of the features of this layer with attributes from matching features in the second layer.

Table field

FIELD

[tablefield: any]

Field of the source layer to use for the join

Input layer 2

INPUT_2

[vettore: qualsiasi]

Layer with the attribute table to join

Table field 2

FIELD_2

[tablefield: any]

Field of the second (join) layer to use for the join The type of the field must be equal to (or compatible with) the input table field type.

Layer 2 fields to copy

Opzionale

FIELDS_TO_COPY

[tablefield: any] [list]

Select the specific fields you want to add. By default all the fields are added.

Join type

METHOD

[numero]

Default: 1

The type of the final joined layer. One of:

  • 0 — Create separate feature for each matching feature (one-to-many)

  • 1 — Take attributes of the first matching feature only (one-to-one)

Discard records which could not be joined

DISCARD_NONMATCHING

[boolean]

Default: True

Check if you don’t want to keep the features that could not be joined

Joined field prefix

Opzionale

PREFIX

[stringa]

Add a prefix to joined fields in order to easily identify them and avoid field name collision

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output vector layer for the join. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

Unjoinable features from first layer

NON_MATCHING

[lo stesso del livello in ingresso]

Default: [Skip output]

Specify the output vector layer for unjoinable features from first layer. One of:

  • Skip output

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.15.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Number of joined features from input table

JOINED_COUNT

[numero]

Unjoinable features from first layer

Opzionale

NON_MATCHING

[lo stesso del livello in ingresso]

Vector layer with the non-matched features

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Output vector layer with added attributes from the join

Number of unjoinable features from input table

Opzionale

UNJOINABLE_COUNT

[numero]

24.1.14.15.3. Codice Python

ID Algoritmo: qgis:joinattributestable

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.16. Join attributes by location

Takes an input vector layer and creates a new vector layer that is an extended version of the input one, with additional attributes in its attribute table.

The additional attributes and their values are taken from a second vector layer. A spatial criteria is applied to select the values from the second layer that are added to each feature from the first layer.

Default menu: Vector ► Data Management Tools

24.1.14.16.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Input vector layer. The output layer will consist of the features of this layer with attributes from matching features in the second layer.

Join layer

JOIN

[vettore: qualsiasi]

The attributes of this vector layer will be added to the source layer attribute table.

Geometric predicate

PREDICATE

[enumeration] [list]

Default: [0]

Select the geometric criteria. One or more of:

  • 0 — intersects

  • 1 — contains

  • 2 — equals

  • 3 — touches

  • 4 — overlaps

  • 5 — within

  • 6 — crosses

Fields to add (leave empty to use all fields)

Opzionale

JOIN_FIELDS

[tablefield: any] [list]

Select the specific fields you want to add. By default all the fields are added.

Join type

METHOD

[numero]

The type of the final joined layer. One of:

  • 0 — Create separate feature for each matching feature (one-to-many)

  • 1 — Take attributes of the first matching feature only (one-to-one)

  • 2 — Take attributes of the feature with largest overlap only (one-to-one)

Discard records which could not be joined

DISCARD_NONMATCHING

[boolean]

Default: False

Remove from the output the input layer records which could not be joined

Joined field prefix

Opzionale

PREFIX

[stringa]

Add a prefix to joined fields in order to easily identify them and avoid field name collision

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output vector layer for the join. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

Unjoinable features from first layer

NON_MATCHING

[lo stesso del livello in ingresso]

Default: [Skip output]

Specify the output vector layer for unjoinable features from first layer. One of:

  • Skip output

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.16.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Number of joined features from input table

JOINED_COUNT

[numero]

Unjoinable features from first layer

Opzionale

NON_MATCHING

[lo stesso del livello in ingresso]

Vector layer of the non-matched features

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Output vector layer with added attributes from the join

24.1.14.16.3. Codice Python

ID Algoritmo: qgis:joinattributesbylocation

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.17. Join attributes by location (summary)

Takes an input vector layer and creates a new vector layer that is an extended version of the input one, with additional attributes in its attribute table.

The additional attributes and their values are taken from a second vector layer. A spatial criteria is applied to select the values from the second layer that are added to each feature from the first layer.

The algorithm calculates a statistical summary for the values from matching features in the second layer (e.g. maximum value, mean value, etc).

24.1.14.17.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Input vector layer. The output layer will consist of the features of this layer with attributes from matching features in the second layer.

Join layer

JOIN

[vettore: qualsiasi]

The attributes of this vector layer will be added to the source layer attribute table.

Geometric predicate

PREDICATE

[enumeration] [list]

Default: [0]

Select the geometric criteria. One or more of:

  • 0 — intersects

  • 1 — contains

  • 2 — equals

  • 3 — touches

  • 4 — overlaps

  • 5 — within

  • 6 — crosses

Fields to summarize (leave empty to use all fields)

Opzionale

JOIN_FIELDS

[tablefield: any] [list]

Select the specific fields you want to add and summarize. By default all the fields are added.

Summaries to calculate (leave empty to use all fields)

Opzionale

SUMMARIES

[enumeration] [list]

Default: []

Choose which type of summary you want to add to each field and for each feature. One or more of:

  • 0 — count

  • 1 — unique

  • 2 — min

  • 3 — max

  • 4 — range

  • 5 — sum

  • 6 — mean

  • 7 — median

  • 8 — stddev

  • 9 — minority

  • 10 — majority

  • 11 — q1

  • 12 — q3

  • 13 — iqr

  • 14 — empty

  • 15 — filled

  • 16 — min_length

  • 17 — max_length

  • 18 — mean_length

Discard records which could not be joined

DISCARD_NONMATCHING

[boolean]

Default: False

Remove from the output the input layer records which could not be joined

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output vector layer for the join. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.17.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Output vector layer with summarized attributes from the join

24.1.14.17.3. Codice Python

ID Algoritmo: qgis:joinbylocationsummary

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.18. Join attributes by nearest

Takes an input vector layer and creates a new vector layer with additional fields in its attribute table. The additional attributes and their values are taken from a second vector layer. Features are joined by finding the closest features from each layer.

By default only the nearest feature is joined, but the join can also join to the k-nearest neighboring features.

If a maximum distance is specified, only features which are closer than this distance will be matched.

24.1.14.18.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

IN INGRESSO

[vettore: qualsiasi]

The input layer.

Input layer 2

INPUT_2

[vettore: qualsiasi]

The join layer.

Layer 2 fields to copy (leave empty to copy all fields)

FIELDS_TO_COPY

[fields]

Join layer fields to copy (if empty, all fields will be copied).

Discard records which could not be joined

DISCARD_NONMATCHING

[boolean]

Default: False

Remove from the output the input layer records which could not be joined

Joined field prefix

PREFIX

[stringa]

Joined field prefix

Maximum nearest neighbors

NEIGHBORS

[numero]

Default: 1

Maximum number of nearest neighbors

Maximum distance

MAX_DISTANCE

[numero]

Maximum search distance

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the vector layer containing the joined features. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

Unjoinable features from first layer

NON_MATCHING

[lo stesso del livello in ingresso]

Default: [Skip output]

Specify the vector layer containing the features that could not be joined. One of:

  • Skip output

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.18.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Joined layer

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

The output joined layer.

Unjoinable features from first layer

NON_MATCHING

[lo stesso del livello in ingresso]

Layer containing the features from first layer that could not be joined to any features in the join layer.

Number of joined features from input table

JOINED_COUNT

[numero]

Number of features from the input table that have been joined.

Number of unjoinable features from input table

UNJOINABLE_COUNT

[numero]

Number of features from the input table that could not be joined.

24.1.14.18.3. Codice Python

Algorithm ID: qgis:joinbynearest

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.19. Merge vector layers

Combines multiple vector layers of the same geometry type into a single one.

The attribute table of the resulting layer will contain the fields from all input layers. If fields with the same name but different types are found then the exported field will be automatically converted into a string type field. New fields storing the original layer name and source are also added.

If any input layers contain Z or M values, then the output layer will also contain these values. Similarly, if any of the input layers are multi-part, the output layer will also be a multi-part layer.

Optionally, the destination coordinate reference system (CRS) for the merged layer can be set. If it is not set, the CRS will be taken from the first input layer. All layers will be reprojected to match this CRS.

../../../../_images/merge_vector_layers.png

Default menu: Vector ► Data Management Tools

Vedi anche

Split vector layer

24.1.14.19.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layers

LAYERS

[vector: any] [list]

The layers that are to be merged into a single layer. Layers should be of the same geometry type.

Destination CRS

Opzionale

SR

[crs]

Choose the CRS for the output layer. If not specified, the CRS of the first input layer is used.

Merged

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output vector layer. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.19.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Merged

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Output vector layer containing all the features and attributes from the input layers.

24.1.14.19.3. Codice Python

ID Algoritmo: qgis:mergevectorlayers

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.20. Order by expression

Sorts a vector layer according to an expression: changes the feature index according to an expression.

Be careful, it might not work as expected with some providers, the order might not be kept every time.

24.1.14.20.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Input vector layer to sort

Expression

EXPRESSION

[expression]

Expression to use for the sorting

Sort ascending

ASCENDING

[boolean]

Default: True

If checked the vector layer will be sorted from small to large values.

Sort nulls first

NULLS_FIRST

[boolean]

Default: False

If checked, Null values are placed first

Ordered

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output vector layer. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.20.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Ordered

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Output (sorted) vector layer

24.1.14.20.3. Codice Python

ID Algoritmo: qgis:orderbyexpression

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.21. Repair Shapefile

Repairs a broken ESRI Shapefile dataset by (re)creating the SHX file.

24.1.14.21.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Shapefile

IN INGRESSO

[file]

Full path to the ESRI Shapefile dataset with a missing or broken SHX file

24.1.14.21.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Repaired layer

LIVELLO IN USCITA

[vettore: qualsiasi]

The input vector layer with the SHX file repaired

24.1.14.21.3. Codice Python

ID Algoritmo: qgis:repairshapefile

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.22. Reproject layer

Reprojects a vector layer in a different CRS. The reprojected layer will have the same features and attributes of the input layer.

checkbox Permette features in-place modification 1

24.1.14.22.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Input vector layer to reproject

Target CRS

TARGET_CRS

[crs]

Default: EPSG:4326 - WGS 84

Destination coordinate reference system

Coordinate Operation

Opzionale

OPERATION

[stringa]

Specific operation to use for a particular reprojection task, instead of always forcing use of the current project’s transformation settings. Useful when reprojecting a particular layer and control over the exact transformation pipeline is required. Requires proj version >= 6.

Read more at Trasformazioni Datum.

Reprojected

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Predefinito: [Crea layer temporaneo]

Specify the output vector layer. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.22.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Reprojected

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Output (reprojected) vector layer

24.1.14.22.3. Codice Python

ID Algoritmo: qgis:reprojectlayer

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.23. Split features by character

Features are split into multiple output features by splitting a field’s value at a specified character. For instance, if a layer contains features with multiple comma separated values contained in a single field, this algorithm can be used to split these values up across multiple output features. Geometries and other attributes remain unchanged in the output. Optionally, the separator string can be a regular expression for added flexibility.

24.1.14.23.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Livello vettoriale in ingresso

Split using values in the field

FIELD

[tablefield: any]

Field to use for splitting

Split value using character

CHAR

[stringa]

Character to use for splitting

Use regular expression separator

REGEX

[boolean]

Default: False

Split

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Default: Create temporary layer

Specify output vector layer. One of:

  • Crea layer temporaneo (TEMPORARY_OUTPUT)

  • Salva come File…

  • Salva come Geopackage…

  • Salva su Tabella PostGIS…

La codifica del file può anche essere cambiata qui.

24.1.14.23.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Split

LIVELLO IN USCITA

[lo stesso del livello in ingresso]

Il layer vettoriale in uscita.

24.1.14.23.3. Codice Python

ID Algoritmo: qgis:splitfeaturesbycharacter

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.24. Split vector layer

Creates a set of vectors in an output folder based on an input layer and an attribute. The output folder will contain as many layers as the unique values found in the desired field.

The number of files generated is equal to the number of different values found for the specified attribute.

It is the opposite operation of merging.

Default menu: Vector ► Data Management Tools

Vedi anche

Merge vector layers

24.1.14.24.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Livello vettoriale in ingresso

Unique ID field

FIELD

[tablefield: any]

Field to use for splitting

Output directory

LIVELLO IN USCITA

[folder]

Default: [Save to temporary folder]

Specifica la cartella per i layer in uscita. Uno di:

  • Salva in una Cartella Temporanea

  • Salva nella Cartella…

La codifica del file può anche essere cambiata qui.

24.1.14.24.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Output directory

LIVELLO IN USCITA

[folder]

La cartella per i layer in uscita

Layer in uscita

OUTPUT_LAYERS

[same as input] [list]

The output vector layers resulting from the split.

24.1.14.24.3. Codice Python

ID Algoritmo: qgis:splitvectorlayer

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.

24.1.14.25. Truncate table

Truncates a layer, by deleting all features from within the layer.

Avvertimento

This algorithm modifies the layer in place, and deleted features cannot be restored!

24.1.14.25.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input Layer

IN INGRESSO

[vettore: qualsiasi]

Livello vettoriale in ingresso

24.1.14.25.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Truncated layer

LIVELLO IN USCITA

[folder]

The truncated (empty) layer

24.1.14.25.3. Codice Python

ID Algoritmo: qgis:truncatetable

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 Usare gli algoritmi di Processing dalla console dei comandi for details on how to run processing algorithms from the Python console.