QgsVectorSimplifyMethod class

This class contains information how to simplify geometries fetched from a vector layer.

Public types

enum SimplifyAlgorithm { Distance = 0, SnapToGrid = 1, Visvalingam = 2 }
Types of local simplification algorithms that can be used.
enum SimplifyHint { NoSimplification = 0, GeometrySimplification = 1, AntialiasingSimplification = 2, FullSimplification = 3 }
Simplification flags for fast rendering of features.

Constructors, destructors, conversion operators

QgsVectorSimplifyMethod()
construct a default object

Public functions

auto forceLocalOptimization() const -> bool
Gets where the simplification executes, after fetch the geometries from provider, or when supported, in provider before fetch the geometries.
auto maximumScale() const -> float
Gets the maximum scale at which the layer should be simplified.
void setForceLocalOptimization(bool localOptimization)
Sets where the simplification executes, after fetch the geometries from provider, or when supported, in provider before fetch the geometries.
void setMaximumScale(float maximumScale)
Sets the maximum scale at which the layer should be simplified.
void setSimplifyAlgorithm(SimplifyAlgorithm simplifyAlgorithm)
Sets the local simplification algorithm of the vector layer managed.
void setSimplifyHints(SimplifyHints simplifyHints)
Sets the simplification hints of the vector layer managed.
void setThreshold(float threshold)
Sets the simplification threshold of the vector layer managed.
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 simplifyAlgorithm() const -> SimplifyAlgorithm
Gets the local simplification algorithm of the vector layer managed.
auto simplifyHints() const -> SimplifyHints
Gets the simplification hints of the vector layer managed.
auto threshold() const -> float
Gets the simplification threshold of the vector layer managed.
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.

Enum documentation

enum QgsVectorSimplifyMethod::SimplifyAlgorithm

Types of local simplification algorithms that can be used.

Enumerators
Distance

The simplification uses the distance between points to remove duplicate points.

SnapToGrid

The simplification uses a grid (similar to ST_SnapToGrid) to remove duplicate points.

Visvalingam

The simplification gives each point in a line an importance weighting, so that least important points are removed first.

enum QgsVectorSimplifyMethod::SimplifyHint

Simplification flags for fast rendering of features.

Enumerators
NoSimplification

No simplification can be applied.

GeometrySimplification

The geometries can be simplified using the current map2pixel context state.

AntialiasingSimplification

The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'.

FullSimplification

All simplification hints can be applied ( Geometry + AA-disabling )