Class: QgsGeometryOptions

Contains options to automatically adjust geometries to constraints on a layer.

Added in version 3.4.

Class Hierarchy

Inheritance diagram of qgis.core.QgsGeometryOptions

Base classes

QObject

Methods

apply

Apply any fixes configured on this class to geometry.

checkConfiguration

Access the configuration for the check checkId.

geometryChecks

A list of activated geometry checks.

geometryPrecision

The precision in which geometries on this layer should be saved.

isActive

Determines if at least one fix is enabled.

readXml

Read the geometry options from node.

removeDuplicateNodes

Automatically remove duplicate nodes on all geometries which are edited on this layer.

setCheckConfiguration

Set the configuration for the check checkId.

setGeometryChecks

A list of activated geometry checks.

setGeometryPrecision

The precision in which geometries on this layer should be saved.

setRemoveDuplicateNodes

Automatically remove duplicate nodes on all geometries which are edited on this layer.

writeXml

Write the geometry options to the node.

Signals

checkConfigurationChanged

Access the configuration for the check checkId.

geometryChecksChanged

A list of activated geometry checks.

geometryPrecisionChanged

The precision in which geometries on this layer should be saved.

removeDuplicateNodesChanged

Automatically remove duplicate nodes on all geometries which are edited on this layer.

class qgis.core.QgsGeometryOptions[source]

Bases: QObject

__init__()

Create a new QgsGeometryOptions object.

apply(self, geometry: QgsGeometry)[source]

Apply any fixes configured on this class to geometry.

Added in version 3.4.

Parameters:

geometry (QgsGeometry)

checkConfiguration(self, checkId: str | None) Dict[str, Any][source]

Access the configuration for the check checkId.

Added in version 3.4.

Parameters:

checkId (Optional[str])

Return type:

Dict[str, Any]

signal checkConfigurationChanged[source]

Access the configuration for the check checkId.

Added in version 3.4.

geometryChecks(self) List[str][source]

A list of activated geometry checks.

Added in version 3.4.

Return type:

List[str]

signal geometryChecksChanged[source]

A list of activated geometry checks.

Added in version 3.4.

geometryPrecision(self) float[source]

The precision in which geometries on this layer should be saved. Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid). Set to 0.0 to disable.

Added in version 3.4.

Return type:

float

signal geometryPrecisionChanged[source]

The precision in which geometries on this layer should be saved. Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid). Set to 0.0 to disable.

Added in version 3.4.

isActive(self) bool[source]

Determines if at least one fix is enabled.

Added in version 3.4.

Return type:

bool

readXml(self, node: QDomNode)[source]

Read the geometry options from node.

Added in version 3.4.

Parameters:

node (QDomNode)

removeDuplicateNodes(self) bool[source]

Automatically remove duplicate nodes on all geometries which are edited on this layer.

Added in version 3.4.

Return type:

bool

signal removeDuplicateNodesChanged[source]

Automatically remove duplicate nodes on all geometries which are edited on this layer.

Added in version 3.4.

setCheckConfiguration(self, checkId: str | None, checkConfiguration: Dict[str, Any])[source]

Set the configuration for the check checkId.

Added in version 3.4.

Parameters:
  • checkId (Optional[str])

  • checkConfiguration (Dict[str, Any])

setGeometryChecks(self, geometryChecks: Iterable[str | None])[source]

A list of activated geometry checks.

Added in version 3.4.

Parameters:

geometryChecks (Iterable[Optional[str]])

setGeometryPrecision(self, value: float)[source]

The precision in which geometries on this layer should be saved. Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid). Set to 0.0 to disable.

Added in version 3.4.

Parameters:

value (float)

setRemoveDuplicateNodes(self, value: bool)[source]

Automatically remove duplicate nodes on all geometries which are edited on this layer.

Added in version 3.4.

Parameters:

value (bool)

writeXml(self, node: QDomNode)[source]

Write the geometry options to the node.

Added in version 3.4.

Parameters:

node (QDomNode)