24.1.6. Fix Geometry

24.1.6.1. Delete duplicated vertices

Deletes duplicated vertices from the input geometries.

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: line, polygon]

Layer with the geometries to fix, same as input in the check algorithm.

Error layer

ERRORS

[vector: point]

Point layer with the errors location, generated by the check algorithm.

Field of original feature unique identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification in input layer, as set in the check algorithm.

Field of part index

PART_IDX

[tablefield: integer]

Default: gc_partidx

Field storing the erroneous feature’s geometry part number.

Field of ring index

RING_IDX

[tablefield: integer]

Default: gc_ringidx

Field storing the erroneous feature’s geometry ring number.

Field of vertex index

VERTEX_IDX

[tablefield: integer]

Default: gc_vertidx

Field storing the erroneous feature’s geometry vertex number.

Fixed duplicate vertices layer

OUTPUT

[vector: same as input]

Default: [Create temporary layer]

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

Report layer from fixing duplicate vertices

REPORT

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the fixes 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

Report layer from fixing duplicate vertices

REPORT

[vector: point]

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

Fixed duplicate vertices layer

OUTPUT

[vector: same as input]

Output layer with the geometry fix applied to the input features.

Python code

Algorithm ID: native:fixgeometryduplicatenodes

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.6.2. Delete features

Deletes error features based on an error layer from the check geometry algorithms.

../../../../_images/fix_geometry_deletefeatures.png

Fig. 24.7 Before and after deleting features inside a polygon.

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: geometry]

Layer with the geometries to fix, same as input in the check algorithm.

Error layer

ERRORS

[vector: point]

Point layer with the errors location, generated by the check algorithm.

Field of original feature unique identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification in input layer, as set in the check algorithm.

Cleaned layer

OUTPUT

[vector: same as input]

Default: [Create temporary layer]

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

Report layer from deleting features

REPORT

[vector: point]

Default: [Create temporary layer]

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

Outputs

Label

Name

Type

Description

Report layer from deleting features

REPORT

[vector: point]

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

Cleaned layer

OUTPUT

[vector: same as input]

Output layer with features removed based on detected errors.

Python code

Algorithm ID: native:fixgeometrydeletefeatures

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.6.3. Delete small angles

Deletes vertices based on an error layer from the Small angles algorithm. When deletion of a vertex results in a duplicate vertex (when a spike vertex is deleted), the duplicate vertex is deleted to keep a single vertex and preserve topology.

Attention

This algorithm removes the vertex at the reported small angles, generating new segments that may form a new small angle.

../../../../_images/fix_geometry_angle.png

Fig. 24.8 Fixing reported errors on a line feature for angles lower than 15°.

See also

Small angles

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: line, polygon]

Layer with the geometries to fix, same as input in the check algorithm

Error layer

ERRORS

[vector: point]

Point layer with the errors location, generated by the check algorithm

Field of original feature unique identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification in input layer, as set in the check algorithm

Field of part index

PART_IDX

[tablefield: integer]

Default: gc_partidx

Field storing the erroneous feature’s geometry part number.

Field of ring index

RING_IDX

[tablefield: integer]

Default: gc_ringidx

Field storing the erroneous feature’s geometry ring number.

Field of vertex index

VERTEX_IDX

[tablefield: integer]

Default: gc_vertidx

Field storing the erroneous feature’s geometry vertex number.

Small angle fixed layer

OUTPUT

[vector: same as input]

Default: [Create temporary layer]

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

Report layer from fixing small angles

REPORT

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the fixes 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

Report layer from fixing small angles

REPORT

[vector: point]

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

Small angle fixed layer

OUTPUT

[same as input]

Output layer with the geometry fix applied to the input features

Python code

Algorithm ID: native:fixgeometryangle

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.6.4. Fill holes

Deletes holes in polygon geometries based on an error layer from the Holes algorithm.

../../../../_images/fix_geometry_holes.png

Fig. 24.9 Before and after fixing holes in a polygon feature.

See also

Holes, Delete holes

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: line, polygon]

Layer with the geometries to fix, same as input in the check algorithm

Error layer

ERRORS

[vector: point]

Point layer with the errors location, generated by the check algorithm

Field of original feature unique identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification in input layer, as set in the check algorithm

Field of part index

PART_IDX

[tablefield: integer] Default: gc_partidx

Field storing the erroneous feature’s geometry part number.

Field of ring index

RING_IDX

[tablefield: integer]

Default: gc_ringidx

Field storing the erroneous feature’s geometry ring number.

Field of vertex index

VERTEX_IDX

[tablefield: integer]

Default: gc_vertidx

Field storing the erroneous feature’s geometry vertex number.

Holes-filled layer

OUTPUT

[vector: polygon]

Default: [Create temporary layer]

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

Report layer from fixing holes

REPORT

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the fixes 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

Report layer from fixing holes

REPORT

[vector: point]

Output point layer representing the error locations and fix applied (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, the applied fix and its successfulness).

Holes-filled layer

OUTPUT

[vector: polygon]

Output layer of polygons without holes.

Python code

Algorithm ID: native:fixgeometryhole

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.6.5. Split self-intersecting geometries

Splits self-intersecting geometries based on an error layer from the Self-intersections algorithm.

../../../../_images/fix_geometry_splitselfintersectinggeometries.png

Fig. 24.10 Comparison between input layer, multi-object fix, and single-object fix geometries.

Parameters

Basic parameters

Label

Name

Type

Description

Input layer

INPUT

[vector: line, polygon]

Layer with the geometries to fix, same as input in the check algorithm

Error layer

ERRORS

[vector: point]

Point layer with the errors location, generated by the check algorithm

Method

METHOD

[enumeration]

Method to apply to the self-intersecting geometries:

  • 0 – Split feature into a multi-object feature: splits the self-intersecting geometry into multiple parts stored in a single multipart feature.

  • 1 – Split feature into multiple single-object features: splits the self-intersecting geometry into multiple parts, each part stored in a separate feature.

Field of original feature unique identifier

UNIQUE_ID

[tablefield: any]

Field storing unique values for feature identification in input layer, as set in the check algorithm

Field of part index

PART_IDX

[tablefield: integer]

Default: gc_partidx

Field storing the erroneous feature’s geometry part number.

Field of ring index

RING_IDX

[tablefield: integer]

Default: gc_ringidx

Field storing the erroneous feature’s geometry ring number.

Field of vertex index

VERTEX_IDX

[tablefield: integer]

Default: gc_vertidx

Field storing the erroneous feature’s geometry vertex number.

Field of segment 1

SEGMENT_1

[tablefield: integer]

Default: gc_segment_1

Field storing the number of the first segment involved in the erroneous intersection.

Field of segment 2

SEGMENT_2

[tablefield: integer]

Default: gc_segment_2

Field storing the number of the second segment involved in the erroneous intersection.

Self-intersections fixed layer

OUTPUT

[vector: same as input]

Default: [Create temporary layer]

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

Report layer from fixing self-intersections

REPORT

[vector: point]

Default: [Create temporary layer]

Specification of the output layer containing the fixes 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

Report layer from fixing self-intersections

REPORT

[vector: point]

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

Self-intersections fixed layer

OUTPUT

[vector: same as input]

Output layer with the geometry fix applied to the input features.

Python code

Algorithm ID: native:fixgeometryselfintersection

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.