24.1.16. Sovrapposizione di vettori

24.1.16.1. Clip (Ritaglio)

Ritaglia un layer vettoriale usando un layer poligonale.

Solo le parti degli elementi nel layer in ingresso che cadono all’interno dei poligoni del layer di sovrapposizione saranno aggiunti al layer risultante.

Avvertimento

Modifiche agli elementi

Gli attributi degli elementi risultano non modificati, anche se le proprietà come l’area o la lunghezza degli elementi saranno modificate dall’operazione di ritaglio. Se tali proprietà sono memorizzate come attributi, tali attributi dovranno essere aggiornati manualmente.

Questo algoritmo utilizza indici spaziali sui dati forniti, elabora le geometrie e applica un’operazione di ritaglio se la geometria non è interamente contenuta dalla geometria della maschera.

../../../../_images/clip4.png

Fig. 24.86 Operazione di ritaglio tra un layer in ingresso a due elementi e un layer di sovrapposizione a un solo elemento (sinistra) - per chiarezza gli elementi risultanti sono spostati (destra)

checkbox Permette features in-place modification

Default menu: Vector ► Geoprocessing Tools

Vedi anche

Intersection, Differenza

24.1.16.1.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: any]

Layer contenente gli elementi da ritagliare

Layer di sovrapposizione

OVERLAY

[vector: polygon]

Layer che contiene gli elementi per il ritaglio

Ritagliati

IN USCITA

[same as input]

Predefinito:[Create temporary layer]

Specifica il layer che deve contenere gli elementi del layer in ingresso che si trovano all’interno del layer di sovrapposizione (ritaglio). Uno di:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.1.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Ritagliati

IN USCITA

[same as input]

Layer containing features from the input layer split by the overlay layer.

24.1.16.1.3. Python code

ID Algoritmo: qgis:clip

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.16.2. Differenza

Extracts features from the input layer that don’t fall within the boundaries of the overlay layer.

Input layer features that partially overlap the overlay layer feature(s) are split along the boundary of those feature(s) and only the portions outside the overlay layer features are retained.

Gli attributi non vengono modificati (vedi warning).

../../../../_images/difference1.png

Fig. 24.87 Operazione di differenza tra un layer in ingresso a due elementi e un layer di sovrapposizione a un solo elemento (sinistra) - per chiarezza gli elementi risultanti sono spostati (destra)

checkbox Permette features in-place modification

Default menu: Vector ► Geoprocessing Tools

24.1.16.2.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: any]

Layer to extract (parts of) features from.

Layer di sovrapposizione

OVERLAY

[vector: any]

Layer containing the geometries that will be subtracted from the input layer geometries. It is expected to have at least as many dimensions (point: 0D, line: 1D, polygon: 2D, volume: 3D) as the input layer geometries.

Difference

IN USCITA

[same as input]

Predefinito:[Create temporary layer]

Specify the layer to contain the (parts of) features from the input layer that are not inside the overlay layer. One of:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.2.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Difference

IN USCITA

[same as input]

Layer containing (parts of) features from the input layer not overlapping the overlay layer.

24.1.16.2.3. Python code

ID Algoritmo: qgis:difference

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.16.3. Extract/clip by extent

Creates a new vector layer that only contains features which fall within a specified extent.

Any features which intersect the extent will be included.

Vedi anche

Clip (Ritaglio)

24.1.16.3.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: any]

Layer to extract (parts of) features from.

Extent (xmin, xmax, ymin, ymax)

ESTENSIONE

[extent]

Extent for clipping.

Clip features to extent

CLIP

[boolean]

Predefinito: False

If checked, output geometries will be automatically converted to multi geometries to ensure uniform output types. Moreover the geometries will be clipped to the extent chosen instead of taking the whole geometry as output.

Extracted

IN USCITA

[same as input]

Predefinito:[Create temporary layer]

Specify the layer to contain the features from the input layer that are inside the clip extent. One of:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.3.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Extracted

IN USCITA

[same as input]

Layer containing the clipped features.

24.1.16.3.3. Python code

ID Algoritmo: qgis:extractbyextent

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.16.4. Intersection

Extracts the portions of features from the input layer that overlap features in the overlay layer.

Features in the intersection layer are assigned the attributes of the overlapping features from both the input and overlay layers.

Gli attributi non vengono modificati (vedi warning).

../../../../_images/intersection.png

Fig. 24.88 The intersection operation: A two-features input layer and a single feature overlay layer (left) - resulting features are moved for clarity (right)

Default menu: Vector ► Geoprocessing Tools

24.1.16.4.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: any]

Layer to extract (parts of) features from.

Layer di sovrapposizione

OVERLAY

[vector: any]

Layer containing the features to check for overlap. Its features” geometry is expected to have at least as many dimensions (point: 0D, line: 1D, polygon: 2D, volume: 3D) as the input layer’s.

Input fields to keep (leave empty to keep all fields)

Optional

INPUT_FIELDS

[tablefield: any] [list]

Predefinito: None

Field(s) of the input layer to keep in the output. If no fields are chosen all fields are taken.

Overlay fields to keep (leave empty to keep all fields)

Optional

OVERLAY_FIELDS

[tablefield: any] [list]

Predefinito: None

Field(s) of the overlay layer to keep in the output. If no fields are chosen all fields are taken.

Overlay fields prefix

Optional

OVERLAY_FIELDS_PREFIX

[string]

Prefix to add to the field names of the intersect layer’s fields to avoid name collisions with fields in the input layer.

Intersection

IN USCITA

[same as input]

Predefinito:[Create temporary layer]

Specify the layer to contain (the parts of) the features from the input layer that overlap one or more features from the overlay layer. One of:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.4.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Intersection

IN USCITA

[same as input]

Layer containing (parts of) features from the input layer that overlap the overlay layer.

24.1.16.4.3. Python code

ID Algoritmo: qgis:intersection

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.16.5. Line intersections

Creates point features where the lines from the two layers intersect.

../../../../_images/line_intersection.png

Fig. 24.89 Points of intersection

Default menu: Vector ► Analysis Tools

24.1.16.5.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: line]

Input line layer.

Intersect layer

INTERSECT

[vector: line]

Layer to use to find line intersections.

Input fields to keep (leave empty to keep all fields)

Optional

INPUT_FIELDS

[tablefield: any] [list]

Predefinito: None

Field(s) of the input layer to keep in the output. If no fields are chosen all fields are taken.

Intersect fields to keep (leave empty to keep all fields)

Optional

INTERSECT_FIELDS

[tablefield: any] [list]

Predefinito: None

Field(s) of the intersect layer to keep in the output. If no fields are chosen all fields are taken.

Intersect fields prefix

Optional

OVERLAY_FIELDS_PREFIX

[string]

Prefix to add to the field names of the intersect layer’s fields to avoid name collisions with fields in the input layer.

Intersection

IN USCITA

[vector: point]

Predefinito:[Create temporary layer]

Specify the layer to contain the intersection points of the lines from the input and overlay layers. One of:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.5.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Intersections

IN USCITA

[vector: point]

Point vector layer with the intersections.

24.1.16.5.3. Python code

ID Algoritmo: qgis:lineintersections

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.16.6. Split with lines

Splits the lines or polygons in one layer using the lines in another layer to define the breaking points. Intersection between geometries in both layers are considered as split points.

Output will contain multi geometries for split features.

../../../../_images/split_with_lines.png

Fig. 24.90 Split lines

checkbox Permette features in-place modification

24.1.16.6.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: line, polygon]

Layer containing the lines or polygons to split.

Split layer

LINES

[vector: line]

Line layer whose lines are used to define the breaking points.

Split

IN USCITA

[same as input]

Predefinito:[Create temporary layer]

Specify the layer to contain the splitted (in case they are intersected by a line in the split layer) line/polygon features from the input layer. One of:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.6.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Split

IN USCITA

[same as input]

Output vector layer with split lines or polygons from input layer.

24.1.16.6.3. Python code

ID Algoritmo: qgis:splitwithlines

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.16.7. Symmetrical difference

Creates a layer containing features from both the input and overlay layers but with the overlapping areas between the two layers removed.

The attribute table of the symmetrical difference layer contains attributes and fields from both the input and overlay layers.

Gli attributi non vengono modificati (vedi warning).

../../../../_images/symmetrical_difference.png

Fig. 24.91 Symmetrical difference operation between a two-features input layer and a single feature overlay layer (left) - resulting features are moved for clarity (right)

Default menu: Vector ► Geoprocessing Tools

24.1.16.7.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: any]

First layer to extract (parts of) features from.

Layer di sovrapposizione

OVERLAY

[vector: any]

Second layer to extract (parts of) features from. Ideally the geometry type should be the same as input layer.

Overlay fields prefix

Optional

OVERLAY_FIELDS_PREFIX

[string]

Prefix to add to the field names of the overlay layer’s fields to avoid name collisions with fields in the input layer.

Symmetrical difference

IN USCITA

[same as input]

Predefinito:[Create temporary layer]

Specify the layer to contain (the parts of) the features from the input and overlay layers that do not overlap features from the other layer. One of:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.7.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Symmetrical difference

IN USCITA

[same as input]

Layer containing (parts of) features from each layer not overlapping the other layer.

24.1.16.7.3. Python code

ID Algoritmo: qgis:symmetricaldifference

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.16.8. Unione

Checks overlaps between features within the input layer and creates separate features for overlapping and non-overlapping parts. The area of overlap will create as many identical overlapping features as there are features that participate in that overlap.

../../../../_images/union1.png

Fig. 24.92 Union operation with a single input layer of three overlapping features (left) - resulting features are moved for clarity (right)

An overlay layer can also be used, in which case features from each layer are split at their overlap with features from the other one, creating a layer containing all the portions from both input and overlay layers. The attribute table of the union layer is filled with attribute values from the respective original layer for non-overlapping features, and attribute values from both layers for overlapping features.

../../../../_images/union_with_overlay.png

Fig. 24.93 Union operation between a two-features input layer and a single feature overlay layer (left) - resulting features are moved for clarity (right)

Nota

For union(A,B) algorithm, if there are overlaps among geometries of layer A or among geometries of layer B, these are not resolved: you need to do union(union(A,B)) to resolve all overlaps, i.e. run single layer union(X) on the produced result X=union(A,B).

Default menu: Vector ► Geoprocessing Tools

24.1.16.8.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Livello in ingresso

IN INGRESSO

[vector: any]

Input vector layer to split at any intersections.

Layer di sovrapposizione

Optional

OVERLAY

[vector: any]

Layer that will be combined to the first one. Ideally the geometry type should be the same as input layer.

Overlay fields prefix

Optional

OVERLAY_FIELDS_PREFIX

[string]

Prefix to add to the field names of the overlay layer’s fields to avoid name collisions with fields in the input layer.

Unione

IN USCITA

[same as input]

Predefinito:[Create temporary layer]

Specify the layer to contain the (split and duplicated) features from the input layer and the overlay layer. One of:

  • Crea Layer Temporaneo

  • Salva come File…

  • Salva come Geopackage…

  • Salva nella tabella PostGIS……

La codifica del file può anche essere cambiata qui.

24.1.16.8.2. In uscita:

Etichetta

Nome

Tipo

Descrizione

Unione

IN USCITA

[same as input]

Layer containing all the overlapping and non-overlapping parts from the processed layer(s).

24.1.16.8.3. Python code

ID Algoritmo: qgis:union

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.