25.1.19. Vector overlay

25.1.19.1. Clip

Clips a vector layer using the features of an additional polygon layer.

Only the parts of the features in the input layer that fall within the polygons of the overlay layer will be added to the resulting layer.

警告

Geometry modification only

This operation modifies only the features geometry. The attribute values of the features are not modified, although properties such as area or length of the features will be modified by the clipping operation. If such properties are stored as attributes, those attributes will have to be manually updated.

このアルゴリズムは、プロバイダで空間インデックスを使用し、ジオメトリが準備されたジオメトリを使用し、ジオメトリがマスクジオメトリに完全に含まれていない場合に切り抜き操作を適用します。

../../../../_images/clip3.png

図 25.101 2つの地物入力レイヤと1つの地物オーバーレイレイヤの間のクリッピング操作(左)---明確にするために結果の地物は移動されています(右)

checkbox Allows features in-place modification of point, line, and polygon features

Default menu: Vector ► Geoprocessing Tools

パラメーター

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: any]

Layer containing the features to be clipped

Overlay layer

OVERLAY

[vector: polygon]

Layer containing the clipping features

Clipped

OUTPUT

[same as input]

Default: [Create temporary layer]

Specify the layer to contain the features from the input layer that are inside the overlay (clipping) layer. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

出力

ラベル

名前

タイプ

説明

Clipped

OUTPUT

[same as input]

Layer containing features from the input layer split by the overlay layer.

Python code

Algorithm ID: qgis:clip

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.

25.1.19.2. Difference

Extracts features from the input layer that don't fall within the boundaries of the overlay layer.

Input layer features that partially overlap the overlay layer feature(s) are split along the boundary of those feature(s) and only the portions outside the overlay layer features are retained.

警告

Geometry modification only

This operation modifies only the features geometry. The attribute values of the features are not modified, although properties such as area or length of the features will be modified by the clipping operation. If such properties are stored as attributes, those attributes will have to be manually updated.

../../../../_images/difference.png

図 25.102 Difference operation between a two-features input layer and a single feature overlay layer (left) - resulting features are moved for clarity (right)

checkbox Allows features in-place modification of point, line, and polygon features

Default menu: Vector ► Geoprocessing Tools

参考

対称差, Clip

パラメーター

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: any]

Layer to extract (parts of) features from.

Overlay layer

OVERLAY

[vector: any]

Layer containing the geometries that will be subtracted from the input layer geometries. It is expected to have at least as many dimensions (point: 0D, line: 1D, polygon: 2D, volume: 3D) as the input layer geometries.

Difference

OUTPUT

[same as input]

Default: [Create temporary layer]

Specify the layer to contain the (parts of) features from the input layer that are not inside the overlay layer. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

出力

ラベル

名前

タイプ

説明

Difference

OUTPUT

[same as input]

Layer containing (parts of) features from the input layer not overlapping the overlay layer.

Python code

Algorithm ID: qgis:difference

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.

25.1.19.3. Extract/clip by extent

Creates a new vector layer that only contains features which fall within a specified extent.

Any features which intersect the extent will be included.

../../../../_images/extractbyextent.png

図 25.103 Extract operation between a three-feature input layer 'a' and a dashed extent (left) - resulting features with dashed extent for reference (right)

参考

Clip

パラメーター

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: any]

Layer to extract (parts of) features from.

Extent (xmin, xmax, ymin, ymax)

EXTENT

[extent]

Extent for clipping.

Available methods are:

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

  • Use map canvas extent

  • Draw on canvas

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

Clip features to extent

CLIP

[boolean]

Default: False

チェックを付けると、出力ジオメトリは自動的にマルチジオメトリに変換され、出力タイプが均一になります。さらに、それらのジオメトリは、ジオメトリ全体を出力として使用するのではなく、選択した範囲で切り取られます。

../../../../_images/extractbyextent_clip.png

図 25.104 Extract operation between a three-feature input layer 'a' and a dashed extent (left) - resulting features with dashed extent for reference (right)

Extracted

OUTPUT

[same as input]

Default: [Create temporary layer]

Specify the layer to contain the features from the input layer that are inside the clip extent. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

出力

ラベル

名前

タイプ

説明

Extracted

OUTPUT

[same as input]

Layer containing the clipped features.

Python code

Algorithm ID: qgis:extractbyextent

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.

25.1.19.4. Intersection

Extracts the portions of features from the input layer that overlap features in the overlay layer.

Features in the intersection layer are assigned the attributes of the overlapping features from both the input and overlay layers.

警告

Geometry modification only

This operation modifies only the features geometry. The attribute values of the features are not modified, although properties such as area or length of the features will be modified by the clipping operation. If such properties are stored as attributes, those attributes will have to be manually updated.

../../../../_images/intersection.png

図 25.105 The intersection operation: A two-features input layer and a single feature overlay layer (left) - resulting features are moved for clarity (right)

Default menu: Vector ► Geoprocessing Tools

参考

Clip, Difference

パラメーター

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: any]

Layer to extract (parts of) features from.

Overlay layer

OVERLAY

[vector: any]

Layer containing the features to check for overlap. Its features' geometry is expected to have at least as many dimensions (point: 0D, line: 1D, polygon: 2D, volume: 3D) as the input layer's.

Input fields to keep (leave empty to keep all fields)

Optional

INPUT_FIELDS

[tablefield: any] [list]

Default: None

Field(s) of the input layer to keep in the output. If no fields are chosen all fields are taken.

Overlay fields to keep (leave empty to keep all fields)

Optional

OVERLAY_FIELDS

[tablefield: any] [list]

Default: None

Field(s) of the overlay layer to keep in the output. If no fields are chosen all fields are taken.

Overlay fields prefix

Optional

OVERLAY_FIELDS_PREFIX

[string]

Prefix to add to the field names of the intersect layer's fields to avoid name collisions with fields in the input layer.

Intersection

OUTPUT

[same as input]

Default: [Create temporary layer]

Specify the layer to contain (the parts of) the features from the input layer that overlap one or more features from the overlay layer. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

出力

ラベル

名前

タイプ

説明

Intersection

OUTPUT

[same as input]

Layer containing (parts of) features from the input layer that overlap the overlay layer.

Python code

Algorithm ID: qgis:intersection

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.

25.1.19.5. Line intersections

Creates point features where the lines from the two layers intersect.

../../../../_images/line_intersection.png

図 25.106 Points of intersection

Default menu: Vector ► Analysis Tools

パラメーター

Basic parameters

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: line]

Input line layer.

Intersect layer

INTERSECT

[vector: line]

Layer to use to find line intersections.

Input fields to keep (leave empty to keep all fields)

Optional

INPUT_FIELDS

[tablefield: any] [list]

Default: None

Field(s) of the input layer to keep in the output. If no fields are chosen all fields are taken.

Intersect fields to keep (leave empty to keep all fields)

Optional

INTERSECT_FIELDS

[tablefield: any] [list]

Default: None

Field(s) of the intersect layer to keep in the output. If no fields are chosen all fields are taken.

Intersection

OUTPUT

[vector: point]

Default: [Create temporary layer]

Specify the layer to contain the intersection points of the lines from the input and overlay layers. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

Advanced parameters

ラベル

名前

タイプ

説明

Intersect fields prefix

Optional

INTERSECT_FIELDS_PREFIX

[string]

Prefix to add to the field names of the intersect layer's fields to avoid name collisions with fields in the input layer.

出力

ラベル

名前

タイプ

説明

Intersections

OUTPUT

[vector: point]

Point vector layer with the intersections.

Python code

Algorithm ID: qgis:lineintersections

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.

25.1.19.6. Split with lines

ラインまたはポリゴンを、別のレイヤのラインを使って切断します。両方のレイヤのジオメトリの交点が分割点とみなされます。

Output will contain multi geometries for split features.

../../../../_images/split_with_lines.png

図 25.107 Split lines

checkbox Allows features in-place modification of line and polygon features

パラメーター

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: line, polygon]

Layer containing the lines or polygons to split.

Split layer

LINES

[vector: line]

Line layer whose lines are used to define the breaking points.

Split

OUTPUT

[same as input]

Default: [Create temporary layer]

Specify the layer to contain the splitted (in case they are intersected by a line in the split layer) line/polygon features from the input layer. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

出力

ラベル

名前

タイプ

説明

Split

OUTPUT

[same as input]

Output vector layer with split lines or polygons from input layer.

Python code

Algorithm ID: qgis:splitwithlines

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.

25.1.19.7. 対称差

入力レイヤとオーバーレイレイヤの両方からの地物を含むが、2つのレイヤ間の重なっている領域は削除されているレイヤを作成します。

対称差分レイヤの属性テーブルには、入力レイヤとオーバーレイレイヤの両方の属性とフィールドが含まれています。

警告

Geometry modification only

This operation modifies only the features geometry. The attribute values of the features are not modified, although properties such as area or length of the features will be modified by the clipping operation. If such properties are stored as attributes, those attributes will have to be manually updated.

../../../../_images/symmetrical_difference.png

図 25.108 2つの地物入力レイヤと1つの地物オーバーレイレイヤの間の対称差操作(左)---明確にするために結果の地物は移動されています(右)

Default menu: Vector ► Geoprocessing Tools

パラメーター

Basic parameters

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: any]

First layer to extract (parts of) features from.

Overlay layer

OVERLAY

[vector: any]

Second layer to extract (parts of) features from. Ideally the geometry type should be the same as input layer.

Symmetrical difference

OUTPUT

[same as input]

Default: [Create temporary layer]

Specify the layer to contain (the parts of) the features from the input and overlay layers that do not overlap features from the other layer. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

Advanced parameters

ラベル

名前

タイプ

説明

Overlay fields prefix

Optional

OVERLAY_FIELDS_PREFIX

[string]

Prefix to add to the field names of the overlay layer's fields to avoid name collisions with fields in the input layer.

出力

ラベル

名前

タイプ

説明

Symmetrical difference

OUTPUT

[same as input]

Layer containing (parts of) features from each layer not overlapping the other layer.

Python code

Algorithm ID: qgis:symmetricaldifference

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.

25.1.19.8. Union

入力レイヤの地物が互いに重なっていないかどうかをチェックし、重なった部分と重なっていない部分を別の地物に分解します。重なった部分は、重なった地物の数だけ同じ地物が作成されます。

../../../../_images/union.png

図 25.109 Union operation with a single input layer of three overlapping features (left) - resulting features are moved for clarity (right)

オーバーレイレイヤも使用できます。その場合、それぞれのレイヤの地物はもう一方のレイヤの地物と重なり合う部分で分割され、入力レイヤとオーバーレイレイヤの両方からのすべての部分を含むレイヤーが作成されます。和集合(ユニオン)レイヤの属性テーブルは、重ならない地物についてはそれぞれの元のレイヤからの属性値、重なり合う地物については両方のレイヤからの属性値が収納されます。

../../../../_images/union_with_overlay.png

図 25.110 2つの地物入力レイヤと1つの地物オーバーレイレイヤの間の和操作(左)---明確にするために結果の地物は移動されています(右)

注釈

union(A,B) アルゴリズムの場合、レイヤAのジオメトリ同士またはレイヤBのジオメトリ同士の中で重なりがある場合、これらは溶解されません:すべての重なりを溶解するためには union(union(A,B)) をする必要があります。つまり作成された結果 X=union(A,B) に対して単一レイヤの union(X) を実行します。

Default menu: Vector ► Geoprocessing Tools

パラメーター

Basic parameters

ラベル

名前

タイプ

説明

Input layer

INPUT

[vector: any]

Input vector layer to split at any intersections.

Overlay layer

Optional

OVERLAY

[vector: any]

Layer that will be combined to the first one. Ideally the geometry type should be the same as input layer.

Union

OUTPUT

[same as input]

Default: [Create temporary layer]

Specify the layer to contain the (split and duplicated) features from the input layer and the overlay layer. One of:

  • Create Temporary Layer (TEMPORARY_OUTPUT)

  • Save to File…

  • Save to Geopackage…

  • Save to Database Table…

The file encoding can also be changed here.

Advanced parameters

ラベル

名前

タイプ

説明

Overlay fields prefix

Optional

OVERLAY_FIELDS_PREFIX

[string]

Prefix to add to the field names of the overlay layer's fields to avoid name collisions with fields in the input layer.

出力

ラベル

名前

タイプ

説明

Union

OUTPUT

[same as input]

Layer containing all the overlapping and non-overlapping parts from the processed layer(s).

Python code

Algorithm ID: qgis:union

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 プロセシングアルゴリズムをコンソールから使う for details on how to run processing algorithms from the Python console.