24.1.13. Creazione di vettori

24.1.13.1. Serie di linee di offset (parallele)

Crea copie di elementi lineari in un layer, creando versioni con offset multipli di ogni elemento. Ogni nuova versione è incrementalmente spostata di una distanza specificata.

Una distanza positiva crea delle linee con offset a sinistra e una distanza negativa crea delle linee con offset a destra.

../../../../_images/offset_lines_array.png

Fig. 24.24 In blu il layer di origine, in rosso quello di offset

checkbox Permette features in-place modification

24.1.13.1.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

INPUT

[vector: line]

Layer vettoriale lineare in ingresso da usare per gli offset.

Numero di elementi da creare

COUNT

[number dataDefined]

Predefinito: 10

Numero di copie di offset da generare per ogni elemento

Distanza di passo offset

OFFSET

[number dataDefined]

Predefinito: 1.0

Distanza tra due copie consecutive di offset

Segmenti

SEGMENTS

[number]

Predefinito: 8

Numero di segmenti lineari da usare per approssimare un quarto di cerchio quando si creano offset arrotondati

Stile della giunzione

JOIN_STYLE

[enumeration]

Predefinito: 0

Specifica se devono essere usate le giunzioni rotonde, oblique o smussate quando si fanno offset di angoli in una linea. Uno dei due:

  • 0 — Arrotondato

  • 1 — Seghettato

  • 2 — Smussato

Margine giunzione ad angolo

MITER_LIMIT

[number]

Predefinito: 2.0

Applicabile solo per gli stili di giunzione ad angolo, e controlla la distanza massima dalla curva di offset da usare quando si crea una giunzione ad angolo.

Linee di offset

OUTPUT

[vector: line]

Predefinito: [Create temporary layer]

Specifica il vettore lineare in uscita con le opzioni di offset. 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.13.1.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Linee di offset

OUTPUT

[vector: line]

Output line layer with offset features. The original features are also copied.

24.1.13.1.3. Codice Python

ID algoritmo: qgis:arrayoffsetlines

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.13.2. Array of translated features

Creates copies of features in a layer by creating multiple translated versions of each. Each copy is incrementally displaced by a preset amount in the X, Y and/or Z axis.

M values present in the geometry can also be translated.

../../../../_images/translate_array.png

Fig. 24.25 Input layers in blue tones, output layers with translated features in red tones

checkbox Permette features in-place modification

24.1.13.2.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

INPUT

[vector: any]

Input vector layer to translate

Numero di elementi da creare

COUNT

[number dataDefined]

Predefinito: 10

Number of copies to generate for each feature

Step distance (x-axis)

DELTA_X

[number dataDefined]

Predefinito: 0.0

Displacement to apply on the X axis

Step distance (y-axis)

DELTA_Y

[number dataDefined]

Predefinito: 0.0

Displacement to apply on the Y axis

Step distance (z-axis)

DELTA_Z

[number dataDefined]

Predefinito: 0.0

Displacement to apply on the Z axis

Step distance (m values)

DELTA_M

[number dataDefined]

Predefinito: 0.0

Displacement to apply on M

Translated

OUTPUT

[same as input]

Predefinito: [Create temporary layer]

Output vector layer with translated (moved) copies of the features. The original features are also copied. 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.13.2.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Translated

OUTPUT

[same as input]

Output vector layer with translated (moved) copies of the features. The original features are also copied.

24.1.13.2.3. Codice Python

ID algoritmo: qgis:arraytranslatedfeatures

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.13.3. Create grid

Creates a vector layer with a grid covering a given extent. Grid cells can have different shapes:

../../../../_images/create_grid.png

Fig. 24.26 Different grid cell shapes

The size of each element in the grid is defined using a horizontal and vertical spacing.

The CRS of the output layer must be defined.

The grid extent and the spacing values must be expressed in the coordinates and units of this CRS.

Default menu: Vector ► Research Tools

24.1.13.3.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Grid type

TYPE

[enumeration]

Predefinito: 0

Shape of the grid. One of:

  • 0 — Punto

  • 1 — Linea

  • 2 — Rettangolo (poligono)

  • 3 — Rombo (poligono)

  • 4 — Esagono (poligono)

Grid extent

EXTENT

[extent]

Extent of the grid

Horizontal spacing

HSPACING

[number]

Predefinito: 1.0

Size of a grid cell on the X-axis

Vertical spacing

VSPACING

[number]

Predefinito: 1.0

Size of a grid cell on the Y-axis

Horizontal overlay

HOVERLAY

[number]

Predefinito: 0.0

Overlay distance between two consecutive grid cells on the X-axis

Vertical overlay

VOVERLAY

[number]

Predefinito: 0.0

Overlay distance between two consecutive grid cells on the Y-axis

Grid CRS

CRS

[crs]

Predefinito: SR del Progetto

Coordinate reference system to apply to the grid

Grid

OUTPUT

[vector: any]

Predefinito: [Create temporary layer]

Resulting vector grid 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.13.3.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Grid

OUTPUT

[vector: any]

Resulting vector grid layer. The output geometry type (point, line or polygon) depends on the Grid type.

24.1.13.3.3. Codice Python

ID algoritmo: qgis:creategrid

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.13.4. Create points layer from table

Creates points layer from a table with columns that contain coordinates fields.

Besides X and Y coordinates you can also specify Z and M fields.

24.1.13.4.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

INPUT

[vector: any]

Input vector layer or a table.

X field

XFIELD

[tablefield: any]

Field containing the X coordinate

Y field

YFIELD

[tablefield: any]

Field containing the Y coordinate

Z field

Optional

ZFIELD

[tablefield: any]

Field containing the Z coordinate

M field

Optional

MFIELD

[tablefield: any]

Field containing the M value

SR di destinazione

TARGET_CRS

[crs]

Predefinito: EPSG:4326

Coordinate reference system to use for layer. The provided coordinates are assumed to be compliant.

Points from table

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

Specify the resulting point 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.13.4.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Points from table

OUTPUT

[vector: point]

The resulting point layer

24.1.13.4.3. Codice Python

ID algoritmo: qgis:createpointslayerfromtable

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.13.5. Generate points (pixel centroids) along line

Generates a point vector layer from an input raster and line layer.

The points correspond to the pixel centroids that intersect the line layer.

../../../../_images/points_centroids.png

Fig. 24.27 Points of the pixel centroids

24.1.13.5.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer Raster

INPUT_RASTER

[raster]

Input raster layer

Layer Vettoriale

INPUT_VECTOR

[vector: line]

Input line vector layer

Points along line

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

Resulting point layer with pixel centroids. 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.13.5.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Points along line

OUTPUT

[vector: point]

Resulting point layer with pixel centroids

24.1.13.5.3. Codice Python

ID algoritmo: qgis:generatepointspixelcentroidsalongline

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.13.6. Generate points (pixel centroids) inside polygon

Generates a point vector layer from an input raster and polygon layer.

The points correspond to the pixel centroids that intersect the polygon layer.

../../../../_images/points_centroids_polygon.png

Fig. 24.28 Points of the pixel centroids

24.1.13.6.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer Raster

INPUT_RASTER

[raster]

Input raster layer

Layer Vettoriale

INPUT_VECTOR

[vector: polygon]

Input polygon vector layer

Points inside polygons

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

Resulting point layer of pixel centroids. 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.13.6.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Points inside polygons

OUTPUT

[vector: point]

Resulting point layer of pixel centroids

24.1.13.6.3. Codice Python

ID algoritmo: qgis:generatepointspixelcentroidsinsidepolygons

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.13.7. Import geotagged photos

Creates a point layer corresponding to the geotagged locations from JPEG images from a source folder.

The point layer will contain a single PointZ feature per input file from which the geotags could be read. Any altitude information from the geotags will be used to set the point’s Z value.

Besides longitude and latitude also altitude, direction and timestamp information, if present in the photo, will be added to the point as attributes.

24.1.13.7.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input folder

FOLDER

[folder]

Path to the source folder containing the geotagged photos

Scan recursively

RECURSIVE

[boolean]

Predefinito: False

If checked, the folder and its subfolders will be scanned

Photos

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

Specify the point vector layer for the geotagged photos. 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.

Invalid photos table

Optional

INVALID

[table]

Predefinito: [Skip output]

Specify the table of unreadable or non-geotagged photos. 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.13.7.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Photos

OUTPUT

[vector: point]

Point vector layer with geotagged photos. The form of the layer is automatically filled with paths and photo previews settings.

Invalid photos table

Optional

INVALID

[table]

Table of unreadable or non-geotagged photos can also be created.

24.1.13.7.3. Codice Python

ID Algoritmo: qgis:importphotos

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.13.8. Points to path

Converts a point layer to a line layer, by joining points in an order defined by a field in the input point layer (if the order field is a date/time field, the format must be specified).

Points can be grouped by a field to distinguish line features.

In addition to the line vector layer, a text file is output that describes the resulting line as a start point and a sequence of bearings / directions (relative to azimuth) and distances.

24.1.13.8.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input point layer

INPUT

[vector: point]

Input point vector layer

Close path

CLOSE_PATH

[boolean]

Predefinito: False

If checked, the first and last points of the line will be connected and close the generated path

Order field

ORDER_FIELD

[tablefield: any]

Field containing the order to connect the points in the path

Group field

Optional

GROUP_FIELD

[tablefield: any]

Point features of the same value in the field will be grouped in the same line. If not set, a single path is drawn with all the input points.

Date format (if order field is DateTime)

Optional

DATE_FORMAT

[string]

The format to use for the Order field parameter. Specify this only if the Order field is of type Date/Time.

Paths

OUTPUT

[vector: line]

Predefinito: [Create temporary layer]

Specify the line vector layer of the path. 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.

Directory for text output

OUTPUT_TEXT_DIR

[folder]

Predefinito: [Skip output]

Specify the directory that will contain the description files of points and paths. One of:

  • Skip Output

  • Save to a Temporary Directory

  • Save to Directory…

La codifica del file può anche essere cambiata qui.

24.1.13.8.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Paths

OUTPUT

[vector: line]

Line vector layer of the path

Directory for text output

OUTPUT_TEXT_DIR

[folder]

Directory containing description files of points and paths

24.1.13.8.3. Codice Python

ID Algoritmo: qgis:pointstopath

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.13.9. Random points along line

Creates a new point layer, with points placed on the lines of another layer.

For each line in the input layer, a given number of points is added to the resulting layer. The procedure for adding a point is to:

  1. randomly select a line feature from the input layer

  2. if the feature is multi-part, randomly select a part of it

  3. randomly select a segment of that line

  4. randomly select a position on that segment.

The procedure means that curved parts of the lines (with relatively short segments) will get more points than straight parts (with relatively long segments), as demonstrated in the illustration below, where the output of the Random points along lines algorithm can be compared with the output of the Random points on lines algorithm (that produces points with an, on average, even distribution along the lines).

../../../../_images/randompointsalonglines_illustration.png

Fig. 24.29 Example algorithm output. Left: Random points along line, right: Random points on lines

A minimum distance can be specified, to avoid points being too close to each other.

24.1.13.9.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input point layer

INPUT

[vector: line]

Input line vector layer

Numero di punti

POINTS_NUMBER

[number]

Predefinito: 1

Numero di punti da creare

Minimum distance between points

MIN_DISTANCE

[number]

Predefinito: 0.0

The minimum distance between points

Random points

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

The output random points. 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.13.9.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Random points

OUTPUT

[vector: point]

The output random points layer.

24.1.13.9.3. Codice Python

ID Algoritmo: qgis:qgisrandompointsalongline

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.13.10. Random points in extent

Creates a new point layer with a given number of random points, all of them within a given extent.

A distance factor can be specified, to avoid points being too close to each other. If the minimum distance between points makes it impossible to create new points, either distance can be decreased or the maximum number of attempts may be increased.

Default menu: Vector ► Research Tools

24.1.13.10.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input extent

EXTENT

[extent]

Map extent for the random points

Numero di punti

POINTS_NUMBER

[number]

Predefinito: 1

Number of point to create

Minimum distance between points

MIN_DISTANCE

[number]

Predefinito: 0.0

The minimum distance between points

SR di destinazione

TARGET_CRS

[crs]

Predefinito: SR del Progetto

CRS of the random points layer

Maximum number of search attempts given the minimum distance

MAX_ATTEMPTS

[number]

Predefinito: 200

Maximum number of attempts to place the points

Random points

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

The output random points. 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.13.10.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Random points

OUTPUT

[vector: point]

The output random points layer.

24.1.13.10.3. Codice Python

ID Algoritmo: native:randompointsinextent

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.13.11. Random points in layer bounds

Creates a new point layer with a given number of random points, all of them within the extent of a given layer.

A minimum distance can be specified, to avoid points being too close to each other.

Default menu: Vector ► Research Tools

24.1.13.11.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

INPUT

[vector: polygon]

Input polygon layer defining the area

Numero di punti

POINTS_NUMBER

[number]

Predefinito: 1

Numero di punti da creare

Minimum distance between points

MIN_DISTANCE

[number]

Predefinito: 0.0

The minimum distance between points

Random points

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

The output random points. 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.13.11.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Random points

OUTPUT

[vector: point]

The output random points layer.

24.1.13.11.3. Codice Python

ID Algoritmo: qgis:randompointsinlayerbounds

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.13.12. Random points in polygons

Creates a point layer with points placed inside the polygons of another layer.

For each feature (polygon / multi-polygon) geometry in the input layer, the given number of points is added to the result layer.

Per feature and global minimum distances can be specified in order to avoid points being too close in the output point layer. If a minimum distance is specified, it may not be possible to generate the specified number of points for each feature. The total number of generated points and missed points are available as output from the algorithm.

The illustration below shows the effect of per feature and global minimum distances and zero/non-zero minimum distances (generated with the same seed, so at least the first point generated will be the same).

../../../../_images/randompointsinpolygons_mindistance.png

Fig. 24.30 Ten points per polygon feature, left: min. distances = 0, middle: min.distances = 1, right: min. distance = 1, global min. distance = 0

The maximum number of tries per point can be specified. This is only relevant for non-zero minimum distance.

A seed for the random number generator can be provided, making it possible to get identical random number sequences for different runs of the algorithm.

The attributes of the polygon feature on which a point was generated can be included (Include polygon attributes).

If you want approximately the same point density for all the features, you can data-define the number of points using the area of the polygon feature geometry.

24.1.13.12.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input polygon layer

INPUT

[vector: line]

Input polygon vector layer

Number of points for each feature

POINTS_NUMBER

[number dataDefined]

Predefinito: 1

Numero di punti da creare

Minimum distance between points

Optional

MIN_DISTANCE

[number dataDefined]

Predefinito: 0.0

The minimum distance between points within one polygon feature

Global minimum distance between points

Optional

MIN_DISTANCE_GLOBAL

[number dataDefined]

Predefinito: 0.0

The global minimum distance between points. Should be smaller than the Minimum distance between points (per feature) for that parameter to have an effect.

Maximum number of search attempts (for Min. dist. > 0)

Optional

MAX_TRIES_PER_POINT

[number dataDefined]

Predefinito: 10

The maximum number of tries per point. Only relevant if the minimum distance between points is set (and greater than 0).

Random seed

Optional

SEED

[number]

Default: Not set

The seed to use for the random number generator.

Include polygon attributes

INCLUDE_POLYGON_ATTRIBUTES

[boolean]

Predefinito: True

If set, a point will get the attributes from the line on which it is placed.

Random points in polygons

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

The output random points. 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.13.12.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Random points in polygons

OUTPUT

[vector: point]

The output random points layer.

Number of features with empty or no geometry

FEATURES_WITH_EMPTY_OR_NO_GEOMETRY

[number]

Total number of points generated

OUTPUT_POINTS

[number]

Number of missed points

POINTS_MISSED

[number]

The number of points that could not be generated due to the minimum distance constraint.

Number of features with missed points

POLYGONS_WITH_MISSED_POINTS

[number]

Not including features with empty or no geometry

24.1.13.12.3. Codice Python

ID Algoritmo: qgis:randompointsinpolygons

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.13.13. Random points inside polygons

Creates a new point layer with a given number of random points inside each polygon of the input polygon layer.

Two sampling strategies are available:

  • Points count: number of points for each feature

  • Points density: density of points for each feature

A minimum distance can be specified, to avoid points being too close to each other.

Default menu: Vector ► Research Tools

24.1.13.13.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer in ingresso

INPUT

[vector: polygon]

Input polygon vector layer

Sampling strategy

STRATEGY

[enumeration]

Predefinito: 0

Sampling strategy to use. One of:

  • 0 — Points count: number of points for each feature

  • 1 — Points density: density of points for each feature

Point count or density

VALUE

[number dataDefined]

Predefinito: 1.0

The number or density of points, depending on the chosen Sampling strategy.

Minimum distance between points

MIN_DISTANCE

[number]

Predefinito: 0.0

The minimum distance between points

Random points

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

The output random points. 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.13.13.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Random points

OUTPUT

[vector: point]

The output random points layer.

24.1.13.13.3. Codice Python

ID Algoritmo: qgis:randompointsinsidepolygons

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.13.14. Random points on lines

Creates a point layer with points placed on the lines of another layer.

For each feature (line / multi-line) geometry in the input layer, the given number of points is added to the result layer.

Per feature and global minimum distances can be specified in order to avoid points being too close in the output point layer. If a minimum distance is specified, it may not be possible to generate the specified number of points for each feature. The total number of generated points and missed points are available as output from the algorithm.

The illustration below shows the effect of per feature and global minimum distances and zero/non-zero minimum distances (generated with the same seed, so at least the first point generated will be the same).

../../../../_images/randompointsonlines_mindistance.png

Fig. 24.31 Five points per line feature, left: min. distances = 0, middle: min.distances != 0, right: min. distance != 0, global min. distance = 0

The maximum number of tries per point can be specified. This is only relevant for non-zero minimum distance.

A seed for the random number generator can be provided, making it possible to get identical random number sequences for different runs of the algorithm.

The attributes of the line feature on which a point was generated can be included (Include line attributes).

If you want approximately the same point density for all the line features, you can data-define the number of points using the length of the line feature geometry.

24.1.13.14.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input line layer

INPUT

[vector: line]

Input line vector layer

Number of points for each feature

POINTS_NUMBER

[number dataDefined]

Predefinito: 1

Numero di punti da creare

Minimum distance between points (per feature)

Optional

MIN_DISTANCE

[number dataDefined]

Predefinito: 0.0

The minimum distance between points within one line feature

Global minimum distance between points

Optional

MIN_DISTANCE_GLOBAL

[number dataDefined]

Predefinito: 0.0

The global minimum distance between points. Should be smaller than the Minimum distance between points (per feature) for that parameter to have an effect.

Maximum number of search attempts (for Min. dist. > 0)

Optional

MAX_TRIES_PER_POINT

[number dataDefined]

Predefinito: 10

The maximum number of tries per point. Only relevant if the minimum distance between points is set (and greater than 0).

Random seed

Optional

SEED

[number]

Default: Not set

The seed to use for the random number generator.

Include line attributes

INCLUDE_LINE_ATTRIBUTES

[boolean]

Predefinito: True

If set, a point will get the attributes from the line on which it is placed.

Random points on lines

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

The output random points. 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.13.14.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Random points on lines

OUTPUT

[vector: point]

The output random points layer.

Number of features with empty or no geometry

FEATURES_WITH_EMPTY_OR_NO_GEOMETRY

[number]

Number of features with missed points

LINES_WITH_MISSED_POINTS

[number]

Not including features with empty or no geometry

Total number of points generated

OUTPUT_POINTS

[number]

Number of missed points

POINTS_MISSED

[number]

The number of points that could not be generated due to the minimum distance constraint.

24.1.13.14.3. Codice Python

ID Algoritmo: qgis:randompointsonlines

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.13.15. Raster pixels to points

Creates a vector layer of points corresponding to each pixel in a raster layer.

Converts a raster layer to a vector layer, by creating point features for each individual pixel’s center in the raster layer. Any nodata pixels are skipped in the output.

24.1.13.15.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer Raster

INPUT_RASTER

[raster]

Input raster layer

Band number

RASTER_BAND

[raster band]

Raster band to extract data from

Field name

FIELD_NAME

[string]

Default: “VALUE”

Name of the field to store the raster band value

Vector points

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

Specify the resulting point layer of pixels centroids. 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.13.15.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Vector points

OUTPUT

[vector: point]

Resulting point layer with pixels centroids

24.1.13.15.3. Codice Python

ID Algoritmo: qgis:pixelstopoints

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.13.16. Raster pixels to polygons

Creates a vector layer of polygons corresponding to each pixel in a raster layer.

Converts a raster layer to a vector layer, by creating polygon features for each individual pixel’s extent in the raster layer. Any nodata pixels are skipped in the output.

24.1.13.16.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Layer Raster

INPUT_RASTER

[raster]

Input raster layer

Band number

RASTER_BAND

[raster band]

Raster band to extract data from

Field name

FIELD_NAME

[string]

Default: “VALUE”

Name of the field to store the raster band value

Vector polygons

OUTPUT

[vector: polygon]

Predefinito: [Create temporary layer]

Specify the resulting polygon layer of pixel extents. 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.13.16.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Vector polygons

OUTPUT

[vector: polygon]

Resulting polygon layer of pixel extents

24.1.13.16.3. Codice Python

ID Algoritmo: qgis:pixelstopolygons

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.13.17. Regular points

Creates a new point layer with its points placed in a regular grid within a given extent.

The grid is specified either by the spacing between the points (same spacing for all dimensions) or by the number of points to generate. In the latter case, the spacing will be determined from the extent. In order to generate a full rectangular grid, at least the number of points specified by the user is generated for the latter case.

Random offsets to the point spacing can be applied, resulting in a non-regular point pattern.

Default menu: Vector ► Research Tools

24.1.13.17.1. Parametri

Etichetta

Nome

Tipo

Descrizione

Input extent (xmin, xmax, ymin, ymax)

EXTENT

[extent]

Map extent for the random points

Point spacing/count

SPACING

[number]

Predefinito: 100

Spacing between the points, or the number of points, depending on whether Use point spacing is checked or not.

Initial inset from corner (LH side)

INSET

[number]

Predefinito: 0.0

Offsets the points relative to the upper left corner. The value is used for both the X and Y axis.

Apply random offset to point spacing

RANDOMIZE

[boolean]

Predefinito: False

If checked the points will have a random spacing

Use point spacing

IS_SPACING

[boolean]

Predefinito: True

If unchecked the point spacing is not taken into account

SR layer in uscita

CRS

[crs]

Predefinito: SR del Progetto

CRS of the random points layer

Regular points

OUTPUT

[vector: point]

Predefinito: [Create temporary layer]

Specify the output regular point 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.13.17.2. In uscita

Etichetta

Nome

Tipo

Descrizione

Regular points

OUTPUT

[vector: point]

The output regular point layer.

24.1.13.17.3. Codice Python

ID Algoritmo: qgis:regularpoints

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.