Важно
Translation is a community effort you can join. This page is currently translated at 23.60%.
28.2.8. Vector miscellaneous
28.2.8.1. Build virtual vector
Creates a virtual vector layer that contains a set of vector layers. The output virtual vector layer will not be opened in the current project.
This algorithm is especially useful in case another algorithm needs
multiple layers but accept only one vrt
in which the layers are
specified.
Параметры
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Input datasources |
|
[vector: any] [list] |
Select the vector layers you want to use to build the virtual vector |
Create «unioned» VRT |
|
[логическое значение] По умолчанию: Ложь |
Check if you want to unite all the vectors in a
single |
Virtual vector |
|
[same as input] По умолчанию: |
Specify the output layer containing only the duplicates. One of:
|
Результаты
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Virtual vector |
|
[vector: any] |
The output virtual vector made from the chosen sources |
Код на Python
Algorithm ID: gdal:buildvirtualvector
import processing
processing.run("algorithm_id", {parameter_dictionary})
ID алгоритма отображается при наведении мыши на алгоритм в Инструментах анализа. Словарь parameter dictionary содержит ключи параметров и их значения. См. Изпользование алгоритмов геообработки в консоли для детального описания того, как запускать алгоритмы анализа из консоли Python.
28.2.8.2. Execute 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.
Параметры
Basic parameters
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Исходный слой |
|
[vector: any] |
OGR-supported input vector layer |
SQL expression |
|
[string] |
Defines the SQL query, for example
|
SQL dialect |
|
[enumeration] Default: 0 |
SQL dialect to use. One of:
|
SQL result |
|
[vector: any] |
Specification of the output layer. One of:
For |
Advanced parameters
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Additional creation options Optional |
|
[string] Default: „“ (no additional options) |
Additional GDAL creation options. |
Результаты
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
SQL result |
|
[vector: any] |
Vector layer created by the query |
Код на Python
Algorithm ID: gdal:executesql
import processing
processing.run("algorithm_id", {parameter_dictionary})
ID алгоритма отображается при наведении мыши на алгоритм в Инструментах анализа. Словарь parameter dictionary содержит ключи параметров и их значения. См. Изпользование алгоритмов геообработки в консоли для детального описания того, как запускать алгоритмы анализа из консоли Python.
28.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.
Параметры
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Database (connection name) |
|
[string] |
The PostgreSQL database to connect to |
Исходный слой |
|
[vector: any] |
OGR-supported vector layer to export to the database |
Shape encoding Optional |
|
[string] Default: „“ |
Sets the encoding to apply to the data |
Output geometry type |
|
[enumeration] Default: 0 |
Defines the output geometry type. One of:
|
Assign an output CRS Optional |
|
[crs] Default: None |
Defines the output CRS of the database table |
Reproject to this CRS on output Optional |
|
[crs] Default: None |
Reprojects/transforms to this CRS on output |
Override source CRS Optional |
|
[crs] Default: None |
Overrides the input layer CRS |
Schema (schema name) Optional |
|
[string] Default: „public“ |
Defines the schema for the database table |
Table to export to (leave blank to use layer name) Optional |
|
[string] Default: „“ |
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) Optional |
|
[string] Default: „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) Optional |
|
[tablefield: any] Default: None |
Defines which attribute field in the exported layer will be the primary key of the database table |
Geometry column name Optional |
|
[string] Default: „geom“ |
Defines in which attribute field of the database there will be the geometry information |
Vector dimensions Optional |
|
[enumeration] Default: 0 (2D) |
Defines if the vector file to be imported has 2D or 3D data. One of:
|
Distance tolerance for simplification Optional |
|
[string] Default: „“ |
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) Optional |
|
[string] Default: „“ |
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) Optional |
|
[extent] Default: None |
You can select features from a given extent that will be in the output table. Available methods are:
|
Clip the input layer using the above (rectangle) extent Optional |
|
[логическое значение] По умолчанию: Ложь |
The input layer will be clipped by the extent you defined before |
Select features using a SQL «WHERE» statement (Ex: column=»value») Optional |
|
[string] Default: „“ |
Defines with a SQL «WHERE» statement which features should be selected from the input layer |
Group N features per transaction (Default: 2000) Optional |
|
[string] Default: „“ |
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 Optional |
|
[логическое значение] Default: 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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
|
Promote to Multipart Optional |
|
[логическое значение] Default: True |
Casts features geometry type to multipart in the output table |
Keep width and precision of input attributes Optional |
|
[логическое значение] Default: True |
Avoids modifying column attributes to comply with input data |
Additional creation options Optional |
|
[string] Default: „“ (no additional options) |
Additional GDAL creation options. |
Результаты
This algorithm has no output.
Код на Python
Algorithm ID: gdal:importvectorintopostgisdatabaseavailableconnections
import processing
processing.run("algorithm_id", {parameter_dictionary})
ID алгоритма отображается при наведении мыши на алгоритм в Инструментах анализа. Словарь parameter dictionary содержит ключи параметров и их значения. См. Изпользование алгоритмов геообработки в консоли для детального описания того, как запускать алгоритмы анализа из консоли Python.
28.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.
Параметры
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Исходный слой |
|
[vector: any] |
OGR-supported vector layer to export to the database |
Shape encoding Optional |
|
[string] Default: „“ |
Sets the encoding to apply to the data |
Output geometry type |
|
[enumeration] Default: 0 |
Defines the output geometry type. One of:
|
Assign an output CRS Optional |
|
[crs] Default: None |
Defines the output CRS of the database table |
Reproject to this CRS on output Optional |
|
[crs] Default: None |
Reprojects/transforms to this CRS on output |
Override source CRS Optional |
|
[crs] Default: None |
Overrides the input layer CRS |
Host Optional |
|
[string] Default: „localhost“ |
Name of the database host |
Port Optional |
|
[string] Default: „5432“ |
Port number the PostgreSQL database server listens on |
Username Optional |
|
[string] Default: „“ |
User name used to log in to the database |
Database name Optional |
|
[string] Default: „“ |
Name of the database |
Password Optional |
|
[string] Default: „“ |
Password used with Username to connect to the database |
Schema (schema name) Optional |
|
[string] Default: „public“ |
Defines the schema for the database table |
Table name, leave blank to use input name Optional |
|
[string] Default: „“ |
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) Optional |
|
[string] Default: „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) Optional |
|
[tablefield: any] Default: None |
Defines which attribute field in the exported layer will be the primary key of the database table |
Geometry column name Optional |
|
[string] Default: „geom“ |
Defines in which attribute field to store the geometry information |
Vector dimensions Optional |
|
[enumeration] Default: 0 (2D) |
Defines if the vector file to be imported has 2D or 3D data. One of:
|
Distance tolerance for simplification Optional |
|
[string] Default: „“ |
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) Optional |
|
[string] Default: „“ |
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) Optional |
|
[extent] Default: None |
You can select features from a given extent that will be in the output table. Available methods are:
|
Clip the input layer using the above (rectangle) extent Optional |
|
[логическое значение] По умолчанию: Ложь |
The input layer will be clipped by the extent you defined before |
Fields to include (leave empty to use all fields) Optional |
|
[string] [list] Default: [] |
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») Optional |
|
[string] Default: „“ |
Defines with a SQL «WHERE» statement which features should be selected for the output table |
Group N features per transaction (Default: 2000) Optional |
|
[string] Default: „“ |
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 Optional |
|
[логическое значение] Default: 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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
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 Optional |
|
[логическое значение] По умолчанию: Ложь |
|
Promote to Multipart Optional |
|
[логическое значение] Default: True |
Casts features geometry type to multipart in the output table |
Keep width and precision of input attributes Optional |
|
[логическое значение] Default: True |
Avoids modifying column attributes to comply with input data |
Additional creation options Optional |
|
[string] Default: „“ (no additional options) |
Additional GDAL creation options. |
Результаты
This algorithm has no output.
Код на Python
Algorithm ID: gdal:importvectorintopostgisdatabasenewconnection
import processing
processing.run("algorithm_id", {parameter_dictionary})
ID алгоритма отображается при наведении мыши на алгоритм в Инструментах анализа. Словарь parameter dictionary содержит ключи параметров и их значения. См. Изпользование алгоритмов геообработки в консоли для детального описания того, как запускать алгоритмы анализа из консоли Python.
28.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 and many more.
This algorithm is derived from the GDAL ogrinfo utility.
Параметры
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Исходный слой |
|
[vector: any] |
Input vector layer |
Summary output only Optional |
|
[логическое значение] Default: True |
|
Suppress metadata info Optional |
|
[логическое значение] По умолчанию: Ложь |
|
Layer information |
|
[html] По умолчанию: |
Specify the output HTML file that includes the file information. One of:
If no HTML-file is defined the output will be written to a temporary file |
Результаты
Ярлык |
Имя |
Тип |
Описание |
---|---|---|---|
Layer information |
|
[html] |
The output HTML-file that includes the file information. |
Код на Python
Algorithm ID: gdal:ogrinfo
import processing
processing.run("algorithm_id", {parameter_dictionary})
ID алгоритма отображается при наведении мыши на алгоритм в Инструментах анализа. Словарь parameter dictionary содержит ключи параметров и их значения. См. Изпользование алгоритмов геообработки в консоли для детального описания того, как запускать алгоритмы анализа из консоли Python.