Class: QgsAbstractGeometrySimplifier

Abstract base class for simplify geometries using a specific algorithm

Class Hierarchy

Inheritance diagram of qgis.core.QgsAbstractGeometrySimplifier

Subclasses

QgsMapToPixelSimplifier

Implementation of GeometrySimplifier using the “MapToPixel” algorithm

QgsTopologyPreservingSimplifier

Implementation of GeometrySimplifier using the Douglas-Peucker algorithm

Methods

simplify

Returns a simplified version the specified geometry

Static Methods

isGeneralizableByDeviceBoundingBox

Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance

class qgis.core.QgsAbstractGeometrySimplifier[source]

Bases: object

static isGeneralizableByDeviceBoundingBox(envelope: QgsRectangle, mapToPixelTol: float = 1) bool[source]

Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance

Parameters:
Return type:

bool

static isGeneralizableByDeviceBoundingBox(points: Iterable[QPointF | QPoint], mapToPixelTol: float = 1) bool[source]

Returns whether the device-geometry can be replaced by its BBOX when is applied the specified tolerance

Parameters:
  • points (Iterable[Union[QPointF, QPoint]])

  • mapToPixelTol (float = 1)

Return type:

bool

simplify(self, geometry: QgsGeometry) QgsGeometry[source]

Returns a simplified version the specified geometry

Parameters:

geometry (QgsGeometry)

Return type:

QgsGeometry

simplify(self, geometry: QgsAbstractGeometry | None) QgsAbstractGeometry | None[source]

Returns a simplified version the specified geometry.

Will return None if no simplification is to be performed to the geometry.

Caller takes ownership of the returned geometry.

Added in version 3.18.

Parameters:

geometry (Optional[QgsAbstractGeometry])

Return type:

Optional[QgsAbstractGeometry]