QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsSimplifyMethod Class Reference

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

#include <qgssimplifymethod.h>

Public Types

enum  MethodType { NoSimplification , OptimizeForRendering , PreserveTopology }
 

Public Member Functions

 QgsSimplifyMethod ()=default
 construct a default method More...
 
bool forceLocalOptimization () const
 Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries. More...
 
MethodType methodType () const
 Gets the simplification type. More...
 
bool operator!= (const QgsSimplifyMethod &v) const
 Inequality operator. More...
 
bool operator== (const QgsSimplifyMethod &v) const
 Equality operator. More...
 
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. More...
 
void setMethodType (MethodType methodType)
 Sets the simplification type. More...
 
void setThreshold (float threshold)
 Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal. More...
 
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. More...
 
float threshold () const
 Gets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal. More...
 
double tolerance () const
 Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal. More...
 

Static Public Member Functions

static QgsAbstractGeometrySimplifiercreateGeometrySimplifier (const QgsSimplifyMethod &simplifyMethod)
 Creates a geometry simplifier according to specified method. More...
 

Protected Attributes

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

Detailed Description

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

Definition at line 27 of file qgssimplifymethod.h.

Member Enumeration Documentation

◆ MethodType

Enumerator
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.

Definition at line 30 of file qgssimplifymethod.h.

Constructor & Destructor Documentation

◆ QgsSimplifyMethod()

QgsSimplifyMethod::QgsSimplifyMethod ( )
default

construct a default method

Member Function Documentation

◆ createGeometrySimplifier()

QgsAbstractGeometrySimplifier * QgsSimplifyMethod::createGeometrySimplifier ( const QgsSimplifyMethod simplifyMethod)
static

Creates a geometry simplifier according to specified method.

Definition at line 37 of file qgssimplifymethod.cpp.

◆ forceLocalOptimization()

bool QgsSimplifyMethod::forceLocalOptimization ( ) const
inline

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

Definition at line 58 of file qgssimplifymethod.h.

◆ methodType()

MethodType QgsSimplifyMethod::methodType ( ) const
inline

Gets the simplification type.

Definition at line 43 of file qgssimplifymethod.h.

◆ operator!=()

bool QgsSimplifyMethod::operator!= ( const QgsSimplifyMethod v) const

Inequality operator.

Definition at line 67 of file qgssimplifymethod.cpp.

◆ operator==()

bool QgsSimplifyMethod::operator== ( const QgsSimplifyMethod v) const

Equality operator.

Definition at line 58 of file qgssimplifymethod.cpp.

◆ setForceLocalOptimization()

void QgsSimplifyMethod::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.

Definition at line 32 of file qgssimplifymethod.cpp.

◆ setMethodType()

void QgsSimplifyMethod::setMethodType ( MethodType  methodType)

Sets the simplification type.

Definition at line 22 of file qgssimplifymethod.cpp.

◆ setThreshold()

void QgsSimplifyMethod::setThreshold ( float  threshold)
inline

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

Definition at line 51 of file qgssimplifymethod.h.

◆ setTolerance()

void QgsSimplifyMethod::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.

Definition at line 27 of file qgssimplifymethod.cpp.

◆ threshold()

float QgsSimplifyMethod::threshold ( ) const
inline

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

Definition at line 53 of file qgssimplifymethod.h.

◆ tolerance()

double QgsSimplifyMethod::tolerance ( ) const
inline

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

Definition at line 48 of file qgssimplifymethod.h.

Member Data Documentation

◆ mForceLocalOptimization

bool QgsSimplifyMethod::mForceLocalOptimization = true
protected

Simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries.

Definition at line 77 of file qgssimplifymethod.h.

◆ mMethodType

MethodType QgsSimplifyMethod::mMethodType = QgsSimplifyMethod::NoSimplification
protected

Simplification method.

Definition at line 71 of file qgssimplifymethod.h.

◆ mThreshold

float QgsSimplifyMethod::mThreshold = 1
protected

Simplification threshold.

Definition at line 75 of file qgssimplifymethod.h.

◆ mTolerance

double QgsSimplifyMethod::mTolerance = 1
protected

Simplification tolerance, it represents the maximum distance between two coordinates which can be considered equal.

Definition at line 73 of file qgssimplifymethod.h.


The documentation for this class was generated from the following files: