QgsSimplifyMethod class

This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.

Public types

enum MethodType { NoSimplification, OptimizeForRendering, PreserveTopology }

Public static functions

static auto createGeometrySimplifier(const QgsSimplifyMethod& simplifyMethod) -> QgsAbstractGeometrySimplifier*
Creates a geometry simplifier according to specified method.

Constructors, destructors, conversion operators

QgsSimplifyMethod() defaulted
construct a default method

Public functions

auto forceLocalOptimization() const -> bool
Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries.
auto methodType() const -> MethodType
Gets the simplification type.
void setForceLocalOptimization(bool localOptimization)
Sets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries.
void setMethodType(MethodType methodType)
Sets the simplification type.
void setThreshold(float threshold)
Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal.
void setTolerance(double tolerance)
Sets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.
auto threshold() const -> float
Gets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal.
auto tolerance() const -> double
Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.

Protected variables

bool mForceLocalOptimization
Simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries.
MethodType mMethodType
Simplification method.
float mThreshold
Simplification threshold.
double mTolerance
Simplification tolerance, it represents the maximum distance between two coordinates which can be considered equal.

Enum documentation

enum QgsSimplifyMethod::MethodType

Enumerators
NoSimplification

No simplification is applied.

OptimizeForRendering

Simplify using the map2pixel data to optimize the rendering of geometries.

PreserveTopology

Simplify using the Douglas-Peucker algorithm ensuring that the result is a valid geometry.