27.1.21. ベクタテーブル
27.1.21.1. 自動インクリメントフィールドの追加
各地物にシーケンシャル値を与える新しい整数フィールドをベクタレイヤに追加する
このフィールドは、レイヤ内の地物の一意のIDとして使用できます。新しい属性は入力レイヤに追加されませんが、代わりに新しいレイヤが生成されます。
増加数列の初期開始値を指定できます。必要に応じて、増加数列はグループ化フィールドに基づくことができ、地物のソート順も指定できます。
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力ベクタレイヤ |
属性名 |
|
[文字列] Default: 'AUTO' |
自動増加値を格納するフィールド名 |
Start values at オプション |
|
[数値] デフォルト: 0 |
Choose the initial number of the incremental count |
Modulus value オプション |
|
[数値] デフォルト: 0 |
Specifying an optional modulus value will restart the count to START
whenever the field value reaches the modulus value. |
Group values by オプション |
|
[テーブルのフィールド:任意] [リスト] |
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. |
ソート式 オプション |
|
[式] |
Use an expression to sort the features in the layer either globally or if set, based on group fields. |
昇順 |
|
[ブール値] デフォルト: True |
|
NULLは最初にソートされる |
|
[ブール値] デフォルト: False |
|
Incremented |
|
[入力レイヤと同じ] デフォルト: |
Specify the output vector layer with the auto increment field. One of:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Incremented |
|
[入力レイヤと同じ] |
Vector layer with auto incremental field |
Python コード
Algorithm ID: native:addautoincrementalfield
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.2. 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.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力レイヤ |
属性名 |
|
[文字列] |
Name of the new field |
Field type |
|
[列挙型] デフォルト: 0 |
Type of the new field. You can choose between:
|
Field length |
|
[数値] デフォルト: 10 |
Length of the field |
Field precision |
|
[数値] デフォルト: 0 |
Precision of the field. Useful with Float field type. |
Added |
|
[入力レイヤと同じ] デフォルト: |
出力ベクタレイヤを指定します。次のいずれかです:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Added |
|
[入力レイヤと同じ] |
Vector layer with new field added |
Python コード
Algorithm ID: native:addfieldtoattributestable
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.3. Add unique value index field
Takes a vector layer and an attribute and adds a 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.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力レイヤ |
分類属性 |
|
[テーブルのフィールド:任意] |
Features that have the same value for this field will get the same index. |
Output field name |
|
[文字列] Default: 'NUM_FIELD' |
Name of the new field containing the indexes. |
Layer with index field |
|
[ベクタ:任意] デフォルト: |
Vector layer with the numeric field containing indexes. One of:
ここでファイルの文字コードを変更することもできます。 |
Class summary |
|
[テーブル] デフォルト: |
Specify the table to contain the summary of the class field mapped to the corresponding unique value. One of:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Layer with index field |
|
[入力レイヤと同じ] |
Vector layer with the numeric field containing indexes. |
Class summary |
|
[テーブル] |
Table with summary of the class field mapped to the corresponding unique value. |
Python コード
Algorithm ID: native:adduniquevalueindexfield
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.4. Add X/Y fields to layer
Adds X and Y (or latitude/longitude) fields to a point layer. The X/Y fields can be calculated in a different CRS to the layer (e.g. creating latitude/longitude fields for a layer in a projected CRS).
Allows
features in-place modification
of point features
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:ポイント] |
入力レイヤ |
Coordinate system |
|
[crs] Default: "EPSG:4326" |
Coordinate reference system to use for the generated x and y fields. |
Field prefix オプション |
|
[文字列] |
Prefix to add to the new field names to avoid name collisions with fields in the input layer. |
Added fields |
|
[ベクタ:ポイント] デフォルト: |
出力レイヤを指定します。次のいずれかです:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Added fields |
|
[ベクタ:ポイント] |
The output layer - identical to the input layer but with two
new double fields, |
Python コード
Algorithm ID: native:addxyfieldstolayer
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.5. 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.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力ベクタレイヤ |
Result field name |
|
[文字列] Default: 'NewField' |
Name of the new field |
Field type |
|
[列挙型] デフォルト: 0 |
Type of the new field. One of:
|
Field length |
|
[数値] デフォルト: 10 |
Length of the field |
Field precision |
|
[数値] デフォルト: 3 |
Precision of the field. Useful with Float field type. |
Global expression オプション |
|
[文字列] |
グローバル式セクションのコードは、計算機が入力レイヤのすべての地物を繰り返し処理する前に1回だけ実行されます。 したがって、これは、必要なモジュールをインポートしたり、以降の計算で使用される変数を計算したりするための正しい場所です。 |
Formula |
|
[文字列] |
The Python formula to evaluate. Example: To calculate the area of an input polygon layer you can add: value = $geom.area()
|
Calculated |
|
[入力レイヤと同じ] デフォルト: |
Specify the vector layer with the new calculated field. One of:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Calculated |
|
[入力レイヤと同じ] |
Vector layer with the new calculated field |
Python コード
Algorithm ID: qgis:advancedpythonfieldcalculator
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.6. Drop field(s)
Takes a vector layer and generates a new one that has the same features but without the selected columns.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
Input vector layer to drop field(s) from |
Fields to drop |
|
[テーブルのフィールド:任意] [リスト] |
The field(s) to drop |
Remaining fields |
|
[入力レイヤと同じ] デフォルト: |
Specify the output vector layer with the remaining fields. One of:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Remaining fields |
|
[入力レイヤと同じ] |
Vector layer with the remaining fields |
Python コード
Algorithm ID: native:deletecolumn
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.7. Explode HStore Field
Creates a copy of the input layer and adds a new field for every unique key in the HStore field.
The expected field list is an optional comma separated list. If this list is specified, only these fields are added and the HStore field is updated. By default, all unique keys are added.
The PostgreSQL HStore
is a simple key-value store used in PostgreSQL and GDAL (when reading
an OSM file
with the other_tags
field.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力ベクタレイヤ |
HStore field |
|
[テーブルのフィールド:任意] |
The field(s) to drop |
Expected list of fields separated by a comma オプション |
|
[文字列] デフォルト: '' |
Comma-separated list of fields to extract. The HStore field will be updated by removing these keys. |
出力レイヤ |
|
[入力レイヤと同じ] デフォルト: |
出力ベクタレイヤを指定します。次のいずれかです:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
出力レイヤ |
|
[入力レイヤと同じ] |
出力ベクタレイヤ |
Python コード
Algorithm ID: native:explodehstorefield
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.8. Extract binary field
Extracts contents from a binary field, saving them to individual files. Filenames can be generated using values taken from an attribute in the source table or based on a more complex expression.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
Input vector layer containing the binary data |
Binary field |
|
[テーブルのフィールド:任意] |
Field containing the binary data |
File name |
|
[式] |
Field or expression-based text to name each output file |
Destination folder |
|
[フォルダ] デフォルト: |
Folder in which to store the output files. One of:
|
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Folder |
|
[フォルダ] |
The folder that contains the output files. |
Python コード
Algorithm ID: native:extractbinary
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.9. Field calculator
Opens the field calculator (see 式). 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 layer to calculate on |
Output field name |
|
[文字列] |
The name of the field for the results |
Output field type |
|
[列挙型] デフォルト: 0 |
The type of the field. One of:
|
Output field width |
|
[数値] デフォルト: 10 |
The length of the result field (minimum 0) |
Field precision |
|
[数値] デフォルト: 3 |
The precision of the result field (minimum 0, maximum 15) |
Create new field |
|
[ブール値] デフォルト: True |
Should the result field be a new field |
Formula |
|
[式] |
The formula to use to calculate the result |
Output file |
|
[ベクタ:任意] デフォルト: |
Specification of the output layer.
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Calculated |
|
[ベクタ:任意] |
Output layer with the calculated field values |
Python コード
Algorithm ID: native:fieldcalculator
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.10. 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.
注釈
When using a template layer with constraints on fields, the information is displayed in the widget with a coloured background and tooltip. Treat this information as a hint during configuration. No constraints will be added on an output layer nor will they be checked or enforced by the algorithm.
The Refactor fields algorithm 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

図 27.125 Refactor fields dialog
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
The layer to modify |
Fields mapping |
|
[リスト] |
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:
|
Refactored |
|
[ベクタ:任意] デフォルト: |
出力レイヤの指定。次のいずれかです:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Refactored |
|
[ベクタ:任意] |
Output layer with refactored fields |
Python コード
Algorithm ID: native:refactorfields
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.11. Rename field
Renames an existing field from a vector layer.
The original layer is not modified. A new layer is generated where the attribute table contains the renamed field.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力ベクタレイヤ |
Field to rename |
|
[テーブルのフィールド:任意] |
The field to be altered |
New field name |
|
[文字列] |
The new field name |
Renamed |
|
[vector: same as input] デフォルト: |
出力レイヤの指定。次のいずれかです:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Renamed |
|
[vector: same as input] |
Output layer with the renamed field |
Python コード
Algorithm ID: qgis:renametablefield
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.12. Retain fields
Takes a vector layer and generates a new one that retains only the selected fields. All other fields will be dropped.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力ベクタレイヤ |
Fields to retain |
|
[テーブルのフィールド:任意] [リスト] |
List of fields to keep in the layer |
Retained fields |
|
[vector: same as input] デフォルト: |
出力レイヤの指定。次のいずれかです:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Retained fields |
|
[vector: same as input] |
Output layer with the retained fields |
Python コード
Algorithm ID: native:retainfields
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。
27.1.21.13. 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.
パラメーター
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
入力レイヤ |
|
[ベクタ:任意] |
入力ベクタレイヤ |
Text attribute to convert to float |
|
[テーブルのフィールド:文字列] |
The string field for the input layer that is to be converted to a float field. |
Float from text |
|
[入力レイヤと同じ] Default: |
出力レイヤを指定します。次のいずれかです:
ここでファイルの文字コードを変更することもできます。 |
出力
ラベル |
名前 |
タイプ |
説明 |
---|---|---|---|
Float from text |
|
[入力レイヤと同じ] |
Output vector layer with the string field converted into a float field |
Python コード
Algorithm ID: qgis:texttofloat
import processing
processing.run("algorithm_id", {parameter_dictionary})
algorithm id は、プロセシングツールボックス内でアルゴリズムにマウスカーソルを乗せた際に表示されるIDです。 parameter dictionary は、パラメータの「名前」とその値を指定するマッピング型です。Python コンソールからプロセシングアルゴリズムを実行する方法の詳細については、 プロセシングアルゴリズムをコンソールから使う を参照してください。