Vector table¶
Add autoincremental field¶
Adds a new integer field to a vector layer, with a sequential value for each feature.
This field can be used as a unique ID for features in the layer. The new attribute is not added to the input layer but a new layer is generated instead.
The initial starting value for the incremental series can be specified. Optionally, the incremental series can be based on grouping fields and a sort order for features can also be specified.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
The input vector layer. |
Field name |
|
[string] Default: ‘AUTO’ |
Name of the field with autoincremental values |
Start values at Optional |
|
[number] Default: 0 |
Choose the initial number of the incremental count |
Group values by Optional |
|
[tablefield: any] [list] |
Select grouping field(s): instead of a single count run for the whole layer, a separate count is processed for each value returned by the combination of these fields. |
Sort expression Optional |
|
[expression] |
Use an expression to sort the features in the layer either globally or if set, based on group fields. |
Sort ascending |
|
[boolean] Default: True |
When a |
Sort nulls first |
|
[boolean] Default: False |
When a |
Incremented |
|
[vector: any] Default: |
Specify the output vector layer with the auto increment field. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Incremented |
|
[vector: any] |
Vector layer with auto incremental field |
Add field to attributes table¶
Adds a new field to a vector layer.
The name and characteristics of the attribute are defined as parameters.
The new attribute is not added to the input layer but a new layer is generated instead.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
The input layer |
Field name |
|
[string] |
Name of the new field |
Field type |
|
[enumeration] Default: 0 |
Type of the new field. You can choose between:
|
Field length |
|
[number] Default: 10 |
Length of the field |
Field precision |
|
[number] Default: 0 |
Precision of the field. Useful with Float field type. |
Added |
|
[vector: any] Default: |
Specification of the output vector layer. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Added |
|
[vector: any] |
Vector layer with new field added |
Add unique value index field¶
Takes a vector layer and an attribute and adds a new numeric field.
Values in this field correspond to values in the specified attribute, so features with the same value for the attribute will have the same value in the new numeric field.
This creates a numeric equivalent of the specified attribute, which defines the same classes.
The new attribute is not added to the input layer but a new layer is generated instead.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
The input layer. |
Class field |
|
[tablefield: any] |
Features that have the same value for this field will get the same index. |
Output field name |
|
[string] Default: ‘NUM_FIELD’ |
Name of the new field containing the indexes. |
Layer with index field |
|
[vector: any] Default: |
Vector layer with the numeric field containing indexes. One of:
The file encoding can also be changed here. |
Class summary |
|
[table] Default: |
Specification of table to contain the summary of the class field mapped to the corresponding unique value. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Layer with index field |
|
[vector: any] |
Vector layer with the numeric field containing indexes. |
Class summary |
|
[table] |
Table with summary of the class field mapped to the corresponding unique value. |
Advanced Python field calculator¶
Adds a new attribute to a vector layer, with values resulting from applying an expression to each feature.
The expression is defined as a Python function.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
Input vector layer |
Result field name |
|
[string] Default: ‘NewField’ |
Name of the new field |
Field type |
|
[enumeration] Default: 0 |
Type of the new field. One of:
|
Field length |
|
[number] Default: 10 |
Length of the field |
Field precision |
|
[number] Default: 3 |
Precision of the field. Useful with Float field type. |
Global expression Optional |
|
[string] |
The code in the global expression section will be executed only once before the calculator starts iterating through all the features of the input layer. Therefore, this is the correct place to import necessary modules or to calculate variables that will be used in subsequent calculations. |
Formula |
|
[string] |
The Python formula to evaluate. Example: To calculate the area of an input polygon layer you can add: value = $geom.area()
|
Calculated |
|
[vector: any] Default: |
Specify the vector layer with the new calculated field. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Calculated |
|
[vector: any] |
Vector layer with the new calculated field |
Drop field(s)¶
Takes a vector layer and generates a new one that has the same features but without the selected columns.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
Input vector layer to drop field(s) from |
Fields to drop |
|
[tablefield: any] [list] |
The field(s) to drop |
Remaining fields |
|
[vector: any] Default: |
Vector layer with the remaining fields. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Remaining fields |
|
[vector: any] |
Vector layer with the remaining fields |
Feature filter (Modeler only)¶
Filters features from the input layer and redirects
them to one or several outputs.
If you do not know about any attribute names that are common to all
possible input layers, filtering is only possible on the feature
geometry and general record mechanisms, such as $id
and uuid
.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
The input layer. |
Outputs and filters (one or more) |
|
[vector: any] |
The output layers with filters (as many as there are filters). |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Output (one or more) |
|
[vector: any] |
The output layers with filtered features (as many as there are filters). |
Field calculator¶
Opens the field calculator (see Expressions). You can use all the supported expressions and functions.
A new layer is created with the result of the expression.
The field calculator is very useful when used in The graphical modeler.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
The layer to calculate on |
Output field name |
|
[string] |
The name of the field for the results |
Output field type |
|
[enumeration] Default: 0 |
The type of the field. One of:
|
Output field width |
|
[number] Default: 10 |
The length of the result field (minimum 0) |
Field precision |
|
[number] Default: 3 |
The precision of the result field (minimum 0, maximum 15) |
Create new field |
|
[boolean] Default: True |
Should the result field be a new field |
Formula |
|
[expression] |
The formula to use to calculate the result |
Output file |
|
[vector:any] Default: |
Specification of the output layer. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Calculated |
|
[vector: any] |
Output layer with the calculated field values |
Refactor fields¶
Allows editing the structure of the attribute table of a vector layer.
Fields can be modified in their type and name, using a fields mapping.
The original layer is not modified. A new layer is generated, which contains a modified attribute table, according to the provided fields mapping.
Refactor layer fields allows to:
Change field names and types
Add and remove fields
Reorder fields
Calculate new fields based on expressions
Load field list from another layer
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
The layer to modify |
Fields mapping |
|
[list] |
List of output fields with their definitions. The embedded table lists all the fields of the source layer and allows you to edit them: For each of the fields you’d like to reuse, you need to fill the following options:
Fields from another layer can be loaded into the field list in Load fields from layer. |
Refactored |
|
[vector: any] Default: |
Specification of the output layer. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Refactored |
|
[vector: any] |
Output layer with refactored fields |
Text to float¶
Modifies the type of a given attribute in a vector layer, converting a text attribute
containing numeric strings into a numeric attribute (e.g. ‘1’ to 1.0
).
The algorithm creates a new vector layer so the source one is not modified.
If the conversion is not possible the selected column will have NULL
values.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
The input vector layer. |
Text attribute to convert to float |
|
[tablefield: string] |
The string field for the input layer that is to be converted to a float field. |
Float from text |
|
[vector: any] Default: |
Specification of the output layer. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Float from text |
|
[vector: any] |
Output vector layer with the string field converted into a float field |