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 whether duplicate label removal is permitted for this layer. |
|
Returns the minimum distance to other labels (i.e. the minimum space/margin around labels). |
|
Returns the map unit scale for the minimum distance to other labels. |
|
Returns the units for the minimum distance to other labels. |
|
Returns |
|
Returns the maximum number of labels which should be drawn for this layer. |
|
Returns the minimum distance to labels with duplicate text. |
|
Returns the map unit scale for the minimum distance to labels with duplicate text. |
|
Returns the units for the minimum distance to labels with duplicate text. |
|
Returns the minimum feature size (in millimeters) for a feature to be labelled. |
|
Sets whether duplicate label removal is permitted for this layer. |
|
Sets the minimum distance to other labels (i.e. the minimum space/margin around labels). |
|
Sets the map unit scale for the minimum distance to other labels. |
|
Sets the unit for the minimum distance to other labels. |
|
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 distance to labels with duplicate text. |
|
Sets the map unit scale for the minimum distance to labels with duplicate text. |
|
Sets the unit for the minimum distance to labels with duplicate text. |
|
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
- allowDuplicateRemoval(self) bool [source]¶
Returns whether duplicate label removal is permitted for this layer.
See also
Added in version 3.44.
- Return type:
bool
- labelMarginDistance(self) float [source]¶
Returns the minimum distance to other labels (i.e. the minimum space/margin around labels).
Units are specified through
labelMarginDistanceUnit()
.See also
See also
Added in version 3.44.
- Return type:
float
- labelMarginDistanceMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the minimum distance to other labels.
See also
See also
See also
Added in version 3.44.
- Return type:
- labelMarginDistanceUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the minimum distance to other labels.
See also
See also
Added in version 3.44.
- Return type:
- limitNumberOfLabelsEnabled(self) bool [source]¶
Returns
True
if 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
- minimumDistanceToDuplicate(self) float [source]¶
Returns the minimum distance to labels with duplicate text.
Units are specified through
minimumDistanceToDuplicateUnit()
.Note
This setting is only respected if
allowDuplicateRemoval()
isTrue
.See also
See also
Added in version 3.44.
- Return type:
float
- minimumDistanceToDuplicateMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the minimum distance to labels with duplicate text.
Note
This setting is only respected if
allowDuplicateRemoval()
isTrue
.See also
See also
Added in version 3.44.
- Return type:
- minimumDistanceToDuplicateUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the minimum distance to labels with duplicate text.
Note
This setting is only respected if
allowDuplicateRemoval()
isTrue
.See also
See also
Added in version 3.44.
- Return type:
- minimumFeatureSize(self) float [source]¶
Returns the minimum feature size (in millimeters) for a feature to be labelled.
See also
- Return type:
float
- setAllowDuplicateRemoval(self, allow: bool)[source]¶
Sets whether duplicate label removal is permitted for this layer.
See also
Added in version 3.44.
- Parameters:
allow (bool)
- setLabelMarginDistance(self, distance: float)[source]¶
Sets the minimum
distance
to other labels (i.e. the minimum space/margin around labels).Units are specified through
setLabelMarginDistanceUnit()
.See also
See also
Added in version 3.44.
- Parameters:
distance (float)
- setLabelMarginDistanceMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the minimum distance to other labels.See also
See also
See also
Added in version 3.44.
- Parameters:
scale (QgsMapUnitScale)
- setLabelMarginDistanceUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the minimum distance to other labels.See also
See also
Added in version 3.44.
- Parameters:
unit (Qgis.RenderUnit)
- 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
number
of labels which should be drawn for this layer. This only has an effect iflimitNumberOfLabelsEnabled()
isTrue
.See also
See also
- Parameters:
number (int)
- setMinimumDistanceToDuplicate(self, distance: float)[source]¶
Sets the minimum
distance
to labels with duplicate text.Units are specified through
setMinimumDistanceToDuplicateUnit()
.Note
This setting is only respected if
allowDuplicateRemoval()
isTrue
.See also
See also
Added in version 3.44.
- Parameters:
distance (float)
- setMinimumDistanceToDuplicateMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the minimum distance to labels with duplicate text.Note
This setting is only respected if
allowDuplicateRemoval()
isTrue
.See also
See also
Added in version 3.44.
- Parameters:
scale (QgsMapUnitScale)
- setMinimumDistanceToDuplicateUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the minimum distance to labels with duplicate text.Note
This setting is only respected if
allowDuplicateRemoval()
isTrue
.See also
See also
Added in version 3.44.
- Parameters:
unit (Qgis.RenderUnit)
- 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
properties
collection.- Parameters:
properties (QgsPropertyCollection)
context (QgsExpressionContext)