Class: QgsMapToPixelSimplifier¶
Implementation of a geometry simplifier 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.
Class Hierarchy¶
Base classes¶
Abstract base class for simplifying geometries using a specific algorithm. |
Methods
Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context |
|
Sets the local simplification algorithm of the vector layer managed |
|
Sets the simplification hints of the vector layer managed |
|
Sets the tolerance of the vector layer managed |
|
Gets the local simplification algorithm of the vector layer managed |
|
Gets the simplification hints of the vector layer managed |
Static Methods
Returns the squared 2D-distance of the vector defined by the two points specified |
|
Returns whether the points belong to the same grid |
Attributes
- class qgis.core.QgsMapToPixelSimplifier[source]¶
Bases:
QgsAbstractGeometrySimplifier
- __init__(simplifyFlags: int, tolerance: float, simplifyAlgorithm: Qgis.VectorSimplificationAlgorithm = Qgis.VectorSimplificationAlgorithm.Distance)
Constructor
- Parameters:
simplifyFlags (int)
tolerance (float)
simplifyAlgorithm (Qgis.VectorSimplificationAlgorithm = Qgis.VectorSimplificationAlgorithm.Distance)
- __init__(a0: QgsMapToPixelSimplifier)
- Parameters:
- NoFlags = 0¶
- SimplifyEnvelope = 2¶
- class SimplifyFlag¶
Bases:
int
- SimplifyGeometry = 1¶
- static calculateLengthSquared2D(x1: float, y1: float, x2: float, y2: float) float [source]¶
Returns the squared 2D-distance of the vector defined by the two points specified
- Parameters:
x1 (float)
y1 (float)
x2 (float)
y2 (float)
- Return type:
float
- static equalSnapToGrid(x1: float, y1: float, x2: float, y2: float, gridOriginX: float, gridOriginY: float, gridInverseSizeXY: float) bool [source]¶
Returns whether the points belong to the same grid
- Parameters:
x1 (float)
y1 (float)
x2 (float)
y2 (float)
gridOriginX (float)
gridOriginY (float)
gridInverseSizeXY (float)
- Return type:
bool
- isGeneralizableByMapBoundingBox(envelope: QgsRectangle, map2pixelTol: float) bool [source]¶
Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
- Parameters:
envelope (
QgsRectangle
)map2pixelTol (float)
- Return type:
bool
- isGeneralizableByMapBoundingBox(self, envelope: QgsRectangle) bool [source]
Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
- Parameters:
envelope (
QgsRectangle
)- Return type:
bool
- setSimplifyAlgorithm(self, simplifyAlgorithm: Qgis.VectorSimplificationAlgorithm)[source]¶
Sets the local simplification algorithm of the vector layer managed
- Parameters:
simplifyAlgorithm (Qgis.VectorSimplificationAlgorithm)
- setSimplifyFlags(self, simplifyFlags: int)[source]¶
Sets the simplification hints of the vector layer managed
- Parameters:
simplifyFlags (int)
- setTolerance(self, value: float)[source]¶
Sets the tolerance of the vector layer managed
- Parameters:
value (float)
- simplifyAlgorithm(self) Qgis.VectorSimplificationAlgorithm [source]¶
Gets the local simplification algorithm of the vector layer managed
- Return type: