Subgroup: Map

Class: QgsMapToPixelSimplifier

class qgis.core.QgsMapToPixelSimplifier(simplifyFlags: int, tolerance: float, simplifyAlgorithm: QgsMapToPixelSimplifier.SimplifyAlgorithm = QgsMapToPixelSimplifier.Distance)

Bases: qgis._core.QgsAbstractGeometrySimplifier

Constructor

QgsMapToPixelSimplifier(QgsMapToPixelSimplifier)

Implementation of GeometrySimplifier using the “MapToPixel” algorithm

Simplifies a geometry removing points within of the maximum distance difference that defines the MapToPixel info of a RenderContext request. This class enables simplify the geometries to be rendered in a MapCanvas target to speed up the vector drawing.

Methods

calculateLengthSquared2D Returns the squared 2D-distance of the vector defined by the two points specified
equalSnapToGrid Returns whether the points belong to the same grid
isGeneralizableByMapBoundingBox Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
setSimplifyAlgorithm Sets the local simplification algorithm of the vector layer managed
setSimplifyFlags Sets the simplification hints of the vector layer managed
setTolerance Sets the tolerance of the vector layer managed
simplify Returns a simplified version the specified geometry
simplifyAlgorithm Gets the local simplification algorithm of the vector layer managed
simplifyFlags Gets the simplification hints of the vector layer managed

Signals

Attributes

Distance
NoFlags
SimplifyEnvelope
SimplifyGeometry
SnapToGrid
Visvalingam
Distance = 0
NoFlags = 0
class SimplifyAlgorithm

Bases: int

SimplifyEnvelope = 2
class SimplifyFlag

Bases: int

SimplifyGeometry = 1
SnapToGrid = 1
Visvalingam = 2
calculateLengthSquared2D(x1: float, y1: float, x2: float, y2: float) → float

Returns the squared 2D-distance of the vector defined by the two points specified

equalSnapToGrid(x1: float, y1: float, x2: float, y2: float, gridOriginX: float, gridOriginY: float, gridInverseSizeXY: float) → bool

Returns whether the points belong to the same grid

isGeneralizableByMapBoundingBox(envelope: QgsRectangle, map2pixelTol: float) → bool

Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context

isGeneralizableByMapBoundingBox(self, envelope: QgsRectangle) -> bool Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context

setSimplifyAlgorithm(self, simplifyAlgorithm: QgsMapToPixelSimplifier.SimplifyAlgorithm)

Sets the local simplification algorithm of the vector layer managed

setSimplifyFlags(self, simplifyFlags: int)

Sets the simplification hints of the vector layer managed

setTolerance(self, value: float)

Sets the tolerance of the vector layer managed

simplify(self, geometry: QgsGeometry) → QgsGeometry

Returns a simplified version the specified geometry

simplifyAlgorithm(self) → QgsMapToPixelSimplifier.SimplifyAlgorithm

Gets the local simplification algorithm of the vector layer managed

simplifyFlags(self) → int

Gets the simplification hints of the vector layer managed