Class: QgsLabelThinningSettings¶
Contains settings related to how the label engine removes candidate label positions and reduces the number of displayed labels.
Added in version 3.12.
Methods
Returns   | 
|
Returns the maximum number of labels which should be drawn for this layer.  | 
|
Returns the minimum feature size (in millimeters) for a feature to be labelled.  | 
|
Sets whether the the number of labels drawn for the layer should be limited.  | 
|
Sets the maximum number of labels which should be drawn for this layer.  | 
|
Sets the minimum feature size (in millimeters) for a feature to be labelled.  | 
|
Updates the thinning settings to respect any data defined properties set within the specified properties collection.  | 
- class qgis.core.QgsLabelThinningSettings[source]¶
 Bases:
object- limitNumberOfLabelsEnabled(self) bool[source]¶
 Returns
Trueif the number of labels drawn for the layer should be limited.See also
See also
- Return type:
 bool
- maximumNumberLabels(self) int[source]¶
 Returns the maximum number of labels which should be drawn for this layer. This only has an effect if
limitNumberOfLabelsEnabled()isTrue.See also
See also
- Return type:
 int
- minimumFeatureSize(self) float[source]¶
 Returns the minimum feature size (in millimeters) for a feature to be labelled.
See also
- Return type:
 float
- setLimitNumberLabelsEnabled(self, enabled: bool)[source]¶
 Sets whether the the number of labels drawn for the layer should be limited.
See also
See also
- Parameters:
 enabled (bool)
- setMaximumNumberLabels(self, number: int)[source]¶
 Sets the maximum
numberof labels which should be drawn for this layer. This only has an effect iflimitNumberOfLabelsEnabled()isTrue.See also
See also
- Parameters:
 number (int)
- setMinimumFeatureSize(self, size: float)[source]¶
 Sets the minimum feature
size(in millimeters) for a feature to be labelled.See also
- Parameters:
 size (float)
- updateDataDefinedProperties(self, properties: QgsPropertyCollection, context: QgsExpressionContext)[source]¶
 Updates the thinning settings to respect any data defined properties set within the specified
propertiescollection.- Parameters:
 properties (QgsPropertyCollection)
context (QgsExpressionContext)