Class: QgsAbstractGeometrySimplifier¶
Abstract base class for simplifying geometries using a specific algorithm.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: simplify()
Class Hierarchy¶
Subclasses¶
Implementation of a geometry simplifier using the “MapToPixel” algorithm. |
|
Implementation of GeometrySimplifier using the Douglas-Peucker algorithm. |
Abstract Methods
Returns a simplified version the specified geometry |
Static Methods
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:
envelope (
QgsRectangle
)mapToPixelTol (float = 1)
- 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
- abstract simplify(self, geometry: QgsGeometry) QgsGeometry [source]¶
Returns a simplified version the specified geometry
- Parameters:
geometry (
QgsGeometry
)- Return type:
- abstract 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]