Class: QgsLabelThinningSettings¶
- class qgis.core.QgsLabelThinningSettings¶
Bases:
sip.wrapper
Contains settings related to how the label engine removes candidate label positions and reduces the number of displayed labels.
New in version 3.12:
Methods
Returns
True
if the number of labels drawn for the layer should be limited.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.- limitNumberOfLabelsEnabled(self) bool ¶
Returns
True
if the number of labels drawn for the layer should be limited.See also
See also
- Return type
bool
- maximumNumberLabels(self) int ¶
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 ¶
Returns the minimum feature size (in millimeters) for a feature to be labelled.
See also
- Return type
float
- setLimitNumberLabelsEnabled(self, enabled: bool)¶
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)¶
Sets the maximum
number
of 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)¶
Sets the minimum feature
size
(in millimeters) for a feature to be labelled.See also
- Parameters
size (float) –
- updateDataDefinedProperties(self, properties: QgsPropertyCollection, context: QgsExpressionContext)¶
Updates the thinning settings to respect any data defined properties set within the specified
properties
collection.- Parameters
properties (QgsPropertyCollection) –
context (QgsExpressionContext) –