24.1.3. Check Geometry

24.1.3.1. Duplicated geometries

Checks for duplicated geometries in a vector layer, and reports them as errors.

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: geometry]

Layer with the geometries to check

Unique feature identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification

Duplicate geometries errors

ERRORS

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the errors location. 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.

Duplicate geometries

Optional

OUTPUT

[vector: same as input]

Default: [Skip output]

Specification of the output layer containing the geometries that were found to be duplicated. One of:

  • Skip Output

  • 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

Label

Name

Type

Description

Tolerance

TOLERANCE

[numeric: integer]

Default: 8

Numerical precision of geometric operations, given as an integer n, meaning that two vertices less than 10-n apart (in map units) are considered to be merged.

Outputs

Label

Name

Type

Description

Duplicate geometries errors

ERRORS

[vector: point]

Output point layer representing the error locations and information (the ID and name of the input layer, the geometry part, ring and vertex index of the erroneous feature, x and y coordinates of the error and affected feature IDs).

Duplicate geometries

OUTPUT

[vector: same as input]

Output layer containing the geometries that were found to be duplicated. Additional fields are added (see ERRORS output).

Python code

Algorithm ID: native:checkgeometryduplicate

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.1.3.2. Duplicated vertices

Checks for duplicated vertices in line or polygon geometries, and reports them as errors.

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: line, polygon]

Layer with the geometries to check

Unique feature identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification

Duplicated vertices errors

ERRORS

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the errors location. 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.

Duplicated vertices features

Optional

OUTPUT

[vector: same as input]

Default: [Skip output]

Specification of the output layer containing the features with duplicated vertices. One of:

  • Skip Output

  • 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

Label

Name

Type

Description

Tolerance

TOLERANCE

[numeric: integer]

Default: 8

Numerical precision of geometric operations, given as an integer n, meaning that two vertices less than 10-n apart (in map units) are considered to be merged.

Outputs

Label

Name

Type

Description

Duplicated vertices errors

ERRORS

[vector: point]

Output point layer representing the error locations and information (the ID and name of the input layer, the geometry part, ring and vertex index of the erroneous feature, x and y coordinates of the error).

Duplicated vertices features

OUTPUT

[vector: line, polygon]

Output layer containing the features with duplicated vertices. Additional fields are added (see ERRORS output).

Python code

Algorithm ID: native:checkgeometryduplicatenodes

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.1.3.3. Features inside polygon

Checks the input geometries contained in the polygons from the polygon layers list. A polygon layer can be checked against itself. Any contained features are reported as errors.

../../../../_images/check_geometry_featuresinsidepolygon.png

Fig. 24.2 Reporting errors on features inside a polygon.

See also

Delete features

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: geometry]

Layer with the geometries to check.

Unique feature identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification.

Polygon layers

POLYGONS

[vector: polygon][list]

List of polygon layers to check against.

Errors from contained features

ERRORS

[vector: point]

Default: [Create temporary layer]

Point layer representing the contained features. 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.

Contained features

Optional

OUTPUT

[vector: same as input]

Default: [Skip output]

Specification of the output layer containing features within the checked polygons. One of:

  • Skip Output

  • 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

Label

Name

Type

Description

Tolerance

TOLERANCE

[numeric: integer]

Default: 8

Numerical precision of geometric operations, given as an integer n, meaning that two vertices less than 10-n apart (in map units) are considered to be merged.

Outputs

Label

Name

Type

Description

Errors from contained features

ERRORS

[vector: point]

Output point layer representing the error locations and information (the ID and name of the input layer, the geometry part, ring and vertex index of the erroneous feature, x and y coordinates of the centroid of the contained feature, and the layer name and index of a polygon containing the feature).

Contained features

OUTPUT

[vector: same as input]

Output layer containing features within the checked polygons.

Python code

Algorithm ID: native:checkgeometrycontained

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.1.3.4. Holes

Detects holes in polygon geometries and reports them as errors.

../../../../_images/check_geometry_holes.png

Fig. 24.3 Reporting errors for holes on a polygon feature.

See also

Fill holes

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: polygon]

Layer with the geometries to check

Unique feature identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification

Holes errors

ERRORS

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the errors location. 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.

Polygons with holes

Optional

OUTPUT

[vector: polygon]

Default: [Skip output]

Polygon layer with the features containing holes. One of:

  • Skip Output

  • 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

Label

Name

Type

Description

Tolerance

TOLERANCE

[numeric: integer]

Default: 8

Numerical precision of geometric operations, given as an integer n, meaning that two vertices less than 10-n apart (in map units) are considered to be merged.

Outputs

Label

Name

Type

Description

Holes errors

ERRORS

[vector: point]

Output point layer representing the error locations and information (the ID and name of the input layer, the ID, geometry part, ring and vertex index of the erroneous feature, x and y coordinates of the error).

Polygon with holes

OUTPUT

[vector: polygon]

Output polygon layer with features containing holes. If no holes are found, the output layer will be empty.

Python code

Algorithm ID: native:checkgeometryhole

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.1.3.5. Self-intersections

Detects self-intersections in line or polygon geometries, and reports them as errors.

../../../../_images/check_geometry_selfintersections.png

Fig. 24.4 Reporting errors on features with self-intersections.

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: line, polygon]

Layer with the geometries to check

Unique feature identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification

Self-intersecting errors

ERRORS

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the errors location. 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.

Self-intersecting features

Optional

OUTPUT

[same as input]

Default: [Skip output]

Line or polygon layer containing self-intersected features. One of:

  • Skip Output

  • 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

Label

Name

Type

Description

Tolerance

TOLERANCE

[numeric: integer]

Default: 8

Numerical precision of geometric operations, given as an integer n, meaning that two vertices less than 10-n apart (in map units) are considered to be merged.

Outputs

Label

Name

Type

Description

Self-intersecting errors

ERRORS

[vector: point]

Output point layer representing the error locations and information (the ID and name of the input layer, the ID, geometry part, ring and vertex index of the erroneous feature, x and y coordinates of the error, the index of the intersecting segments).

Self-intersecting features

OUTPUT

[vector: line, polygon]

Output polygon or line layer with features containing the self-intersecting features. If no self-intersecting features are found, the output layer will be empty. Additional fields are added (see ERRORS output).

Python code

Algorithm ID: native:checkgeometryselfintersection

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.1.3.6. Small angles

Compares the angles within line or polygon geometries to a specified threshold, and reports as error any angle below that value.

../../../../_images/check_geometry_angle.png

Fig. 24.5 Reporting errors on a line feature for angles lower than 15°.

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: line, polygon]

Layer with the geometries to check.

Unique feature identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification.

Minimum angle

MIN_ANGLE

[numeric: double]

Allowed minimum angle between adjacent segments in a feature’s geometry. Any angle below this threshold is reported as error.

Small angle errors

ERRORS

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the errors location. 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

Label

Name

Type

Description

Tolerance

TOLERANCE

[numeric: integer]

Default: 8

Numerical precision of geometric operations, given as an integer n, meaning that two vertices less than 10-n apart (in map units) are considered to be merged.

Outputs

Label

Name

Type

Description

Small angle errors

ERRORS

[vector: point]

Output point layer representing the error locations and information (the ID and name of the input layer, the ID, geometry part, ring and vertex index of the erroneous feature, x and y coordinates of the error and the value of the erroneous angle).

Python code

Algorithm ID: native:checkgeometryangle

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.