Class: QgsLabelPointSettings

Contains settings related to how the label engine places and formats labels for point-like features.

QgsLabelPointSettings can be used for point features, or polygon features which are labeled in the “around” or “over” centroid placement modes.

Added in version 3.38.

Methods

maximumDistance

Returns the maximum distance which labels are allowed to be from their corresponding points.

maximumDistanceMapUnitScale

Returns the map unit scale for label maximum distance.

maximumDistanceUnit

Returns the units for label maximum distance.

predefinedPositionOrder

Returns the ordered list of predefined label positions for points.

quadrant

Returns the quadrant in which to offset labels from the point.

setMaximumDistance

Sets the maximum distance which labels are allowed to be from their corresponding points.

setMaximumDistanceMapUnitScale

Sets the map unit scale for label maximum distance.

setMaximumDistanceUnit

Sets the unit for label maximum distance.

setPredefinedPositionOrder

Sets the ordered list of predefined label positions for points.

setQuadrant

Sets the quadrant in which to offset labels from the point.

updateDataDefinedProperties

Updates the point settings to respect any data defined properties set within the specified properties collection.

class qgis.core.QgsLabelPointSettings[source]

Bases: object

maximumDistance(self) float[source]

Returns the maximum distance which labels are allowed to be from their corresponding points.

This setting works alongside the standard label offset distance properties to define a permissible range of distances at which labels can be placed from their points.

The default value is 0, which indicates that no maximum is set and the label’s usual distance from point will always be respected.

Return type:

float

maximumDistanceMapUnitScale(self) QgsMapUnitScale[source]

Returns the map unit scale for label maximum distance.

Return type:

QgsMapUnitScale

maximumDistanceUnit(self) Qgis.RenderUnit[source]

Returns the units for label maximum distance.

Return type:

Qgis.RenderUnit

predefinedPositionOrder(self) List[Qgis.LabelPredefinedPointPosition]

Returns the ordered list of predefined label positions for points.

Positions earlier in the list will be prioritized over later positions. Only used when the placement is set to Qgis.LabelPlacement.OrderedPositionsAroundPoint.

Return type:

List[Qgis.LabelPredefinedPointPosition]

quadrant(self) Qgis.LabelQuadrantPosition[source]

Returns the quadrant in which to offset labels from the point.

See also

setQuadrant()

Return type:

Qgis.LabelQuadrantPosition

setMaximumDistance(self, distance: float)[source]

Sets the maximum distance which labels are allowed to be from their corresponding points.

This setting works alongside the standard label offset distance properties to define a permissible range of distances at which labels can be placed from their points.

Setting distance to 0 indicates that no maximum is set and the label’s usual distance from point will always be respected.

Parameters:

distance (float)

setMaximumDistanceMapUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the map unit scale for label maximum distance.

Parameters:

scale (QgsMapUnitScale)

setMaximumDistanceUnit(self, unit: Qgis.RenderUnit)[source]

Sets the unit for label maximum distance.

Parameters:

unit (Qgis.RenderUnit)

setPredefinedPositionOrder(self, order: Iterable[Qgis.LabelPredefinedPointPosition])[source]

Sets the ordered list of predefined label positions for points.

Positions earlier in the list will be prioritized over later positions. Only used when the placement is set to Qgis.LabelPlacement.OrderedPositionsAroundPoint.

Parameters:

order (Iterable[Qgis.LabelPredefinedPointPosition])

setQuadrant(self, quadrant: Qgis.LabelQuadrantPosition)[source]

Sets the quadrant in which to offset labels from the point.

See also

quadrant()

Parameters:

quadrant (Qgis.LabelQuadrantPosition)

updateDataDefinedProperties(self, properties: QgsPropertyCollection, context: QgsExpressionContext)[source]

Updates the point settings to respect any data defined properties set within the specified properties collection.

Parameters: