Class: QgsLabelingEngineRuleMinimumDistanceLabelToLabel

A labeling engine rule which prevents labels being placed too close to labels from a different layer.

Added in version 3.40.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLabelingEngineRuleMinimumDistanceLabelToLabel

Base classes

QgsAbstractLabelingEngineRule

Abstract base class for labeling engine rules.

class qgis.core.QgsLabelingEngineRuleMinimumDistanceLabelToLabel[source]

Bases: QgsAbstractLabelingEngineRule

distance(self) float[source]

Returns the minimum permitted distance between labels from the labeledLayer() and the labels from the targetLayer().

See also

setDistance()

See also

distanceUnit()

Return type:

float

distanceUnit(self) Qgis.RenderUnit[source]

Returns the units for the distance between labels from the labeledLayer() and the labels from the targetLayer().

See also

distance()

Return type:

Qgis.RenderUnit

distanceUnitScale(self) QgsMapUnitScale

Returns the scaling for the distance between labels from the labeledLayer() and the labels from the targetLayer().

See also

distance()

Return type:

QgsMapUnitScale

labeledLayer(self) QgsMapLayer | None[source]

Returns the layer providing the labels.

Return type:

Optional[QgsMapLayer]

setDistance(self, distance: float)[source]

Sets the minimum permitted distance between labels from the labeledLayer() and the labels from the targetLayer().

See also

distance()

Parameters:

distance (float)

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

Sets the unit for the distance between labels from the labeledLayer() and the labels from the targetLayer().

See also

distanceUnit()

See also

setDistance()

Parameters:

unit (Qgis.RenderUnit)

setDistanceUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the scale for the distance between labels from the labeledLayer() and the labels from the targetLayer().

See also

setDistance()

Parameters:

scale (QgsMapUnitScale)

setLabeledLayer(self, layer: QgsMapLayer | None)[source]

Sets the layer providing the labels.

See also

labeledLayer()

Parameters:

layer (Optional[QgsMapLayer])

setTargetLayer(self, layer: QgsMapLayer | None)[source]

Sets the layer providing the labels which labels must be distant from.

See also

targetLayer()

Parameters:

layer (Optional[QgsMapLayer])

targetLayer(self) QgsMapLayer | None[source]

Returns the layer providing the labels which labels must be distant from.

See also

setTargetLayer()

Return type:

Optional[QgsMapLayer]