QGIS API Documentation  2.3.0-Master
QgsTopologyPreservingSimplifier Class Reference

Implementation of GeometrySimplifier using the Douglas-Peucker algorithm. More...

`#include <qgsgeometrysimplifier.h>`

Inheritance diagram for QgsTopologyPreservingSimplifier:
[legend]
Collaboration diagram for QgsTopologyPreservingSimplifier:
[legend]

## Public Member Functions

QgsTopologyPreservingSimplifier (double tolerance)
Implementation of GeometrySimplifier using the Douglas-Peucker algorithm. More...

virtual ~QgsTopologyPreservingSimplifier ()

virtual QgsGeometrysimplify (QgsGeometry *geometry) const
Returns a simplified version the specified geometry. More...

virtual bool simplifyGeometry (QgsGeometry *geometry) const
Simplifies the specified geometry. More...

Public Member Functions inherited from QgsAbstractGeometrySimplifier
virtual ~QgsAbstractGeometrySimplifier ()

## Protected Attributes

double mTolerance
Distance tolerance for the simplification. More...

Static Public Member Functions inherited from QgsAbstractGeometrySimplifier
static bool canbeGeneralizedByDeviceBoundingBox (const QgsRectangle &envelope, float mapToPixelTol=1.0f)
Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance. More...

static bool canbeGeneralizedByDeviceBoundingBox (const QVector< QPointF > &points, float mapToPixelTol=1.0f)
Returns whether the device-geometry can be replaced by its BBOX when is applied the specified tolerance. More...

## Detailed Description

Implementation of GeometrySimplifier using the Douglas-Peucker algorithm.

Simplifies a geometry, ensuring that the result is a valid geometry having the same dimension and number of components as the input. The simplification uses a maximum distance difference algorithm similar to the one used in the Douglas-Peucker algorithm.

Definition at line 50 of file qgsgeometrysimplifier.h.

## Constructor & Destructor Documentation

 QgsTopologyPreservingSimplifier::QgsTopologyPreservingSimplifier ( double tolerance )

Implementation of GeometrySimplifier using the Douglas-Peucker algorithm.

Definition at line 55 of file qgsgeometrysimplifier.cpp.

 QgsTopologyPreservingSimplifier::~QgsTopologyPreservingSimplifier ( )
virtual

Definition at line 58 of file qgsgeometrysimplifier.cpp.

## Member Function Documentation

 QgsGeometry * QgsTopologyPreservingSimplifier::simplify ( QgsGeometry * geometry ) const
virtual

Returns a simplified version the specified geometry.

Implements QgsAbstractGeometrySimplifier.

Definition at line 63 of file qgsgeometrysimplifier.cpp.

References mTolerance, and QgsGeometry::simplify().

 bool QgsTopologyPreservingSimplifier::simplifyGeometry ( QgsGeometry * geometry ) const
virtual

Simplifies the specified geometry.

Implements QgsAbstractGeometrySimplifier.

Definition at line 69 of file qgsgeometrysimplifier.cpp.

## Member Data Documentation

 double QgsTopologyPreservingSimplifier::mTolerance
protected

Distance tolerance for the simplification.

Definition at line 58 of file qgsgeometrysimplifier.h.

Referenced by simplify(), and simplifyGeometry().

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