Ważne

Tłumaczenie jest wysiłkiem społeczności QGISa przyłącz się. Ta strona jest obecnie przetłumaczona w 58.03%.

24.2.8. Vector miscellaneous

24.2.8.1. Build virtual vector

Creates a virtual vector layer that contains a set of vector layers.

This algorithm is especially useful in case another algorithm needs multiple layers but accept only one vrt in which the layers are specified.

Parametry

Etykieta

Nazwa

Typ

Opis

Input datasources

INPUT

[vector: any] [list]

Select the vector layers you want to use to build the virtual vector

Create „unioned” VRT

UNIONED

[wartość logiczna]

Domyślnie: False

Check if you want to unite all the vectors in a single vrt file

Virtual vector

OUTPUT

[same as input]

Domyślnie: [Zapisz do pliku tymczasowego]

Specify the output layer containing only the duplicates. One of:

  • Zapisz do pliku tymczasowego

  • Zapisz do pliku…

Wyniki

Etykieta

Nazwa

Typ

Opis

Virtual vector

OUTPUT

[vector: any]

The output virtual vector made from the chosen sources

Kod Pythona

ID algorytmu: gdal:buildvirtualvector

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

24.2.8.2. Wykonaj SQL

Runs a simple or complex query with SQL syntax on the source layer. The result of the query will be added as a new layer.

This algorithm is derived from the GDAL ogr2ogr utility.

Parametry

Parametry podstawowe

Etykieta

Nazwa

Typ

Opis

Warstwa wejściowa

INPUT

[vector: any]

OGR-supported input vector layer

SQL expression

SQL

[ciąg tekstowy]

Defines the SQL query, for example SELECT * FROM my_table WHERE name is not null.

SQL dialect

DIALECT

[wyliczenie]

Domyślnie: 0

SQL dialect to use. One of:

  • 0 — None

  • 1 — OGR SQL

  • 2 — SQLite

Wynik SQL

OUTPUT

[vector: any]

Specification of the output layer. One of:

  • Zapisz do pliku tymczasowego

  • Zapisz do pliku…

For Save to File, the output format has to be specified. All GDAL vector formats are supported. For Save to a Temporary File the default output vector layer format will be used.

Parametry zaawansowane

Etykieta

Nazwa

Typ

Opis

Additional creation options

Opcjonalne

OPTIONS

[ciąg tekstowy]

Default: «» (no additional options)

Additional GDAL creation options.

Wyniki

Etykieta

Nazwa

Typ

Opis

Wynik SQL

OUTPUT

[vector: any]

Vector layer created by the query

Kod Pythona

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

24.2.8.3. Export to PostgreSQL (available connections)

Imports vector layers inside a PostgreSQL database on the basis of an available connection. The connection has to be defined properly beforehand. Be aware that the checkboxes «Save Username» and «Save Password» are activated. Then you can use the algorithm.

This algorithm is derived from the GDAL ogr2ogr utility.

Parametry

Etykieta

Nazwa

Typ

Opis

Database (connection name)

DATABASE

[ciąg tekstowy]

The PostgreSQL database to connect to

Warstwa wejściowa

INPUT

[vector: any]

OGR-supported vector layer to export to the database

Shape encoding

Opcjonalne

SHAPE_ENCODING

[ciąg tekstowy]

Domyślnie: «»

Sets the encoding to apply to the data

Output geometry type

GTYPE

[wyliczenie]

Domyślnie: 0

Defines the output geometry type. One of:

  • 0 —

  • 1 — NONE

  • 2 — GEOMETRY

  • 3 — POINT

  • 4 — LINESTRING

  • 5 — POLYGON

  • 6 — GEOMETRYCOLLECTION

  • 7 — MULTIPOINT

  • 8 — MULTIPOLYGON

  • 9 — MULTILINESTRING

  • 10 — CIRCULARSTRING

  • 11 — COUMPOUNDCURVE

  • 12 — CURVEPOLYGON

  • 13 — MULTICURVE

  • 14 — MULTISURFACE

  • 15 — CONVERT_TO_LINEAR

  • 16 — CONVERT_TO_CURVE

Assign an output CRS

Opcjonalne

A_SRS

[układ współrzędnych]

Default: Not set

Defines the output CRS of the database table

Reproject to this CRS on output

Opcjonalne

T_SRS

[układ współrzędnych]

Default: Not set

Reprojects/transforms to this CRS on output

Override source CRS

Opcjonalne

S_SRS

[układ współrzędnych]

Default: Not set

Overrides the input layer CRS

Schema (schema name)

Opcjonalne

SCHEMA

[ciąg tekstowy]

Default: «public»

Defines the schema for the database table

Table to export to (leave blank to use layer name)

Opcjonalne

TABLE

[ciąg tekstowy]

Domyślnie: «»

Defines a name for the table that will be imported into the database. By default the table name is the name of the input vector file.

Primary Key (new field)

Opcjonalne

PK

[ciąg tekstowy]

Domyślnie: «id»

Defines which attribute field will be the primary key of the database table

Primary Key (existing field, used if the above option is left empty)

Opcjonalne

PRIMARY_KEY

[tablefield: any]

Default: Not set

Defines which attribute field in the exported layer will be the primary key of the database table

Geometry column name

Opcjonalne

GEOCOLUMN

[ciąg tekstowy]

Domyślnie: «geom»

Defines in which attribute field of the database there will be the geometry information

Vector dimensions

Opcjonalne

DIM

[wyliczenie]

Domyślnie: 0 (2D)

Defines the coordinate dimensions of the imported vector data. One of:

  • 0 — 2 (XY)

  • 1 — 3 (XYZ)

  • 2 — 4 (XYZM)

Distance tolerance for simplification

Opcjonalne

SIMPLIFY

[ciąg tekstowy]

Domyślnie: «»

Defines a distance tolerance for the simplification of the vector geometries to be imported. By default there is no simplification.

Maximum distance between 2 nodes (densification)

Opcjonalne

SEGMENTIZE

[ciąg tekstowy]

Domyślnie: «»

The maximum distance between two nodes. Used to create intermediate points. By default there is no densification.

Select features by extent (defined in input layer CRS)

Opcjonalne

SPAT

[zasięg]

Default: Not set

You can select features from a given extent that will be in the output table.

Available methods are:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Clip the input layer using the above (rectangle) extent

CLIP

[wartość logiczna]

Domyślnie: False

The input layer will be clipped by the extent you defined before

Select features using a SQL „WHERE” statement (Ex: column=”value”)

Opcjonalne

WHERE

[ciąg tekstowy]

Domyślnie: «»

Defines with a SQL „WHERE” statement which features should be selected from the input layer

Group N features per transaction (Default: 2000)

Opcjonalne

GT

[ciąg tekstowy]

Domyślnie: «»

You can group the input features in transactions where N defines the size. By default N limits the transaction size to 20000 features.

Overwrite existing table

OVERWRITE

[wartość logiczna]

Domyślnie: True

If there is a table with the same name in the database, and if this option is set to True, the table will be overwritten.

Append to existing table

APPEND

[wartość logiczna]

Domyślnie: False

If checked / True the vector data will be appended to an existing table. New fields found in the input layer are ignored. By default a new table will be created.

Append and add new fields to existing table

ADDFIELDS

[wartość logiczna]

Domyślnie: False

If activated the vector data will be appended to an existing table, there won’t be a new table created. New fields found in input layer are added to the table. By default a new table will be created.

Do not launder columns/table names

LAUNDER

[wartość logiczna]

Domyślnie: False

With this option checked you can prevent the default behaviour (converting column names to lowercase, removing spaces and other invalid characters).

Do not create Spatial Index

INDEX

[wartość logiczna]

Domyślnie: False

Prevents a spatial index for the output table from being created. By default, a spatial index is added.

Continue after a failure, skipping the failed feature

SKIPFAILURES

[wartość logiczna]

Domyślnie: False

Continue after a failure, skipping the failed feature.

Validate geometries based on Simple Features specification

MAKEVALID

[wartość logiczna]

Domyślnie: False

Applies cleanup operations on geometries to ensure they are valid regarding the rules of the Simple Features specification.

Promote to Multipart

PROMOTETOMULTI

[wartość logiczna]

Domyślnie: True

Casts features geometry type to multipart in the output table

Keep width and precision of input attributes

PRECISION

[wartość logiczna]

Domyślnie: True

Avoids modifying column attributes to comply with input data

Additional creation options

Opcjonalne

OPTIONS

[ciąg tekstowy]

Default: «» (no additional options)

Additional GDAL creation options.

Wyniki

This algorithm has no output.

Kod Pythona

ID algorytmu: gdal:importvectorintopostgisdatabaseavailableconnections

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

24.2.8.4. Export to PostgreSQL (new connection)

Imports vector layers inside a PostgreSQL database. A new connection to the PostGIS database must be created.

This algorithm is derived from the GDAL ogr2ogr utility.

Parametry

Etykieta

Nazwa

Typ

Opis

Warstwa wejściowa

INPUT

[vector: any]

OGR-supported vector layer to export to the database

Shape encoding

Opcjonalne

SHAPE_ENCODING

[ciąg tekstowy]

Domyślnie: «»

Sets the encoding to apply to the data

Output geometry type

GTYPE

[wyliczenie]

Domyślnie: 0

Defines the output geometry type. One of:

  • 0 —

  • 1 — NONE

  • 2 — GEOMETRY

  • 3 — POINT

  • 4 — LINESTRING

  • 5 — POLYGON

  • 6 — GEOMETRYCOLLECTION

  • 7 — MULTIPOINT

  • 8 — MULTIPOLYGON

  • 9 — MULTILINESTRING

  • 10 — CIRCULARSTRING

  • 11 — COUMPOUNDCURVE

  • 12 — CURVEPOLYGON

  • 13 — MULTICURVE

  • 14 — MULTISURFACE

  • 15 — CONVERT_TO_LINEAR

  • 16 — CONVERT_TO_CURVE

Assign an output CRS

Opcjonalne

A_SRS

[układ współrzędnych]

Default: Not set

Defines the output CRS of the database table

Reproject to this CRS on output

Opcjonalne

T_SRS

[układ współrzędnych]

Default: Not set

Reprojects/transforms to this CRS on output

Override source CRS

Opcjonalne

S_SRS

[układ współrzędnych]

Default: Not set

Overrides the input layer CRS

Host

Opcjonalne

HOST

[ciąg tekstowy]

Domyślnie: «localhost»

Name of the database host

Port

Opcjonalne

PORT

[ciąg tekstowy]

Domyślnie: «5432»

Port number the PostgreSQL database server listens on

Nazwa użytkownika

Opcjonalne

USER

[ciąg tekstowy]

Domyślnie: «»

User name used to log in to the database

Database name

Opcjonalne

DBNAME

[ciąg tekstowy]

Domyślnie: «»

Name of the database

Hasło

Opcjonalne

PASSWORD

[ciąg tekstowy]

Domyślnie: «»

Password used with Username to connect to the database

Schema (schema name)

Opcjonalne

SCHEMA

[ciąg tekstowy]

Default: «public»

Defines the schema for the database table

Table name, leave blank to use input name

Opcjonalne

TABLE

[ciąg tekstowy]

Domyślnie: «»

Defines a name for the table that will be imported into the database. By default the table name is the name of the input vector file.

Primary Key (new field)

Opcjonalne

PK

[ciąg tekstowy]

Domyślnie: «id»

Defines which attribute field will be the primary key of the database table

Primary Key (existing field, used if the above option is left empty)

Opcjonalne

PRIMARY_KEY

[tablefield: any]

Default: Not set

Defines which attribute field in the exported layer will be the primary key of the database table

Geometry column name

Opcjonalne

GEOCOLUMN

[ciąg tekstowy]

Domyślnie: «geom»

Defines in which attribute field to store the geometry information

Vector dimensions

Opcjonalne

DIM

[wyliczenie]

Domyślnie: 0 (2D)

Defines the coordinate dimensions of the imported vector data. One of:

  • 0 — 2 (XY)

  • 1 — 3 (XYZ)

  • 2 — 4 (XYZM)

Distance tolerance for simplification

Opcjonalne

SIMPLIFY

[ciąg tekstowy]

Domyślnie: «»

Defines a distance tolerance for the simplification of the vector geometries to be imported. By default there is no simplification.

Maximum distance between 2 nodes (densification)

Opcjonalne

SEGMENTIZE

[ciąg tekstowy]

Domyślnie: «»

The maximum distance between two nodes. Used to create intermediate points. By default there is no densification.

Select features by extent (defined in input layer CRS)

Opcjonalne

SPAT

[zasięg]

Default: Not set

You can select features from a given extent that will be in the output table.

Available methods are:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Clip the input layer using the above (rectangle) extent

CLIP

[wartość logiczna]

Domyślnie: False

The input layer will be clipped by the extent you defined before

Fields to include (leave empty to use all fields)

Opcjonalne

FIELDS

[string] [list]

Domyślnie: []

Defines fields to keep from the imported vector file. If none is selected, all the fields are imported.

Select features using a SQL „WHERE” statement (Ex: column=”value”)

Opcjonalne

WHERE

[ciąg tekstowy]

Domyślnie: «»

Defines with a SQL „WHERE” statement which features should be selected for the output table

Group N features per transaction (Default: 2000)

Opcjonalne

GT

[ciąg tekstowy]

Domyślnie: «»

You can group the input features in transactions where N defines the size. By default N limits the transaction size to 20000 features.

Overwrite existing table

OVERWRITE

[wartość logiczna]

Domyślnie: True

If there is a table with the same name in the database, and if this option is set to True, the table will be overwritten.

Append to existing table

APPEND

[wartość logiczna]

Domyślnie: False

If checked / True the vector data will be appended to an existing table. New fields found in the input layer are ignored. By default a new table will be created.

Append and add new fields to existing table

ADDFIELDS

[wartość logiczna]

Domyślnie: False

If activated the vector data will be appended to an existing table, there won’t be created a new table. New fields found in input layer are added to the table. By default a new table will be created.

Do not launder columns/table names

LAUNDER

[wartość logiczna]

Domyślnie: False

With this option checked you can prevent the default behaviour (converting column names to lowercase, removing spaces and other invalid characters).

Do not create Spatial Index

INDEX

[wartość logiczna]

Domyślnie: False

Prevents a spatial index for the output table from being created. By default, a spatial index is added.

Continue after a failure, skipping the failed feature

SKIPFAILURES

[wartość logiczna]

Domyślnie: False

Continue after a failure, skipping the failed feature.

Validate geometries based on Simple Features specification

MAKEVALID

[wartość logiczna]

Domyślnie: False

Applies cleanup operations on geometries to ensure they are valid regarding the rules of the Simple Features specification.

Promote to Multipart

PROMOTETOMULTI

[wartość logiczna]

Domyślnie: True

Casts features geometry type to multipart in the output table

Keep width and precision of input attributes

PRECISION

[wartość logiczna]

Domyślnie: True

Avoids modifying column attributes to comply with input data

Additional creation options

Opcjonalne

OPTIONS

[ciąg tekstowy]

Default: «» (no additional options)

Additional GDAL creation options.

Wyniki

This algorithm has no output.

Kod Pythona

ID algorytmu: gdal:importvectorintopostgisdatabasenewconnection

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

24.2.8.5. Vector Information

Creates an information file that lists information about an OGR-supported data source. The output will be shown in a «Result» window and can be written into a HTML-file. The information includes the geometry type, feature count, the spatial extent, the projection information, the list of attributes and related type, list of relations and field domains, and many more.

This algorithm is derived from the GDAL ogrinfo utility.

Parametry

Parametry podstawowe

Etykieta

Nazwa

Typ

Opis

Warstwa wejściowa

INPUT

[vector: geometry]

Input vector layer

Enable listing of all layers in the dataset

ALL_LAYERS

[wartość logiczna]

Domyślnie: False

If checked, QGIS will output the information of all the layers in the input dataset instead of information of the first layer only. Convenient when a multi layer format (GeoPackage, GML, KML, SpatiaLite, SQLite, …) is used as input.

Summary output only

SUMMARY_ONLY

[wartość logiczna]

Domyślnie: True

Suppress listing of individual features and show only summary information like projection, schema, feature count and extents.

Suppress metadata info

NO_METADATA

[wartość logiczna]

Domyślnie: False

Suppress metadata printing. Some datasets may contain a lot of metadata strings.

Layer information

OUTPUT

[html]

Domyślnie: [Zapisz do pliku tymczasowego]

Specify the output HTML file that includes the file information. One of:

  • Zapisz do pliku tymczasowego

  • Zapisz do pliku…

If no HTML-file is defined the output will be written to a temporary file

Parametry zaawansowane

Etykieta

Nazwa

Typ

Opis

Additional command line parameters

Opcjonalne

EXTRA

[ciąg tekstowy]

Default: «» (no additional options)

Add extra GDAL command line options

Wyniki

Etykieta

Nazwa

Typ

Opis

Layer information

OUTPUT

[html]

The output HTML-file that includes the file information.

Kod Pythona

ID algorytmu: gdal:ogrinfo

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.

24.2.8.6. Vector Information (JSON)

Creates an information file that lists information about an OGR-supported data source. The output will be shown in a «Result» window and can be written into a .JSON file. The information includes the geometry type, feature count, the spatial extent, the projection information, the list of attributes and related type, list of relations and field domains, and many more.

This algorithm is derived from the GDAL ogrinfo utility.

Requires version of GDAL >= 3.7

Parametry

Parametry podstawowe

Etykieta

Nazwa

Typ

Opis

Warstwa wejściowa

INPUT

[vector: geometry]

Input vector layer

Enable listing of all layers in the dataset

ALL_LAYERS

[wartość logiczna]

Domyślnie: False

If checked, QGIS will output the information of all the layers in the input dataset instead of information of the first layer only. Convenient when a multi layer format (GeoPackage, GML, KML, SpatiaLite, SQLite, …) is used as input.

Enable listing of features

FEATURES

[wartość logiczna]

Domyślnie: False

Suppress metadata info

NO_METADATA

[wartość logiczna]

Domyślnie: False

Suppress metadata printing. Some datasets may contain a lot of metadata strings.

Layer information

OUTPUT

[plik]

Domyślnie: [Zapisz do pliku tymczasowego]

Specify the output JSON file that includes the file information. One of:

  • Zapisz do pliku tymczasowego

  • Zapisz do pliku…

If no JSON file is defined the output will be written to a temporary file

Parametry zaawansowane

Etykieta

Nazwa

Typ

Opis

Additional command line parameters

Opcjonalne

EXTRA

[ciąg tekstowy]

Default: «» (no additional options)

Add extra GDAL command line options

Wyniki

Etykieta

Nazwa

Typ

Opis

Layer information

OUTPUT

[plik]

The output .JSON file that includes the file information.

Kod Pythona

ID algorytmu: gdal:ogrinfojson

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.