Class: QgsSimplifyMethod

Contains information about how to simplify geometries fetched from a QgsFeatureIterator.

class qgis.core.QgsSimplifyMethod[source]

Bases: object

__init__()

construct a default method

__init__(a0: QgsSimplifyMethod)
Parameters:

a0 (QgsSimplifyMethod)

class MethodType

Bases: int

NoSimplification = 0
OptimizeForRendering = 1
PreserveTopology = 2
static createGeometrySimplifier(simplifyMethod: QgsSimplifyMethod) QgsAbstractGeometrySimplifier | None[source]

Creates a geometry simplifier according to specified method

Parameters:

simplifyMethod (QgsSimplifyMethod)

Return type:

Optional[QgsAbstractGeometrySimplifier]

forceLocalOptimization(self) bool[source]

Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries

Return type:

bool

methodType(self) QgsSimplifyMethod.MethodType[source]

Gets the simplification type

Return type:

QgsSimplifyMethod.MethodType

setForceLocalOptimization(self, localOptimization: bool)[source]

Sets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries

Parameters:

localOptimization (bool)

setMethodType(self, methodType: QgsSimplifyMethod.MethodType)[source]

Sets the simplification type

Parameters:

methodType (QgsSimplifyMethod.MethodType)

setThreshold(self, threshold: float)[source]

Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal.

Parameters:

threshold (float)

setTolerance(self, tolerance: float)[source]

Sets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.

Parameters:

tolerance (float)

threshold(self) float[source]

Gets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal.

Return type:

float

tolerance(self) float[source]

Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.

Return type:

float