Class: QgsLabelingResults

class qgis.core.QgsLabelingResults

Bases: sip.wrapper

Class that stores computed placement from labeling engine.

Methods

allLabels

Returns a list of all labels generated by the labeling run.

calloutsWithinRectangle

Returns a list of callouts with origins or destinations inside the given rectangle.

groupedLabelPositions

Returns a list of all label positions sharing the same group ID (i.e. positions for individual characters in a curved label).

labelsAtPosition

Returns the details of any labels placed at the specified point (in map coordinates).

labelsWithinRect

Returns the details of any labels placed within the specified rectangle (in map coordinates).

setMapSettings

Sets the map settings associated with the labeling run.

allLabels(self) List[QgsLabelPosition]

Returns a list of all labels generated by the labeling run.

New in version 3.20.

Return type:

List[QgsLabelPosition]

calloutsWithinRectangle(self, rectangle: QgsRectangle) List[QgsCalloutPosition]

Returns a list of callouts with origins or destinations inside the given rectangle.

The rectangle is specified in map coordinates.

New in version 3.20.

Parameters:

rectangle (QgsRectangle) –

Return type:

List[QgsCalloutPosition]

groupedLabelPositions(self, groupId: int) List[QgsLabelPosition]

Returns a list of all label positions sharing the same group ID (i.e. positions for individual characters in a curved label).

New in version 3.26.

Parameters:

groupId (int) –

Return type:

List[QgsLabelPosition]

labelsAtPosition(self, p: QgsPointXY) List[QgsLabelPosition]

Returns the details of any labels placed at the specified point (in map coordinates).

Parameters:

p (QgsPointXY) –

Return type:

List[QgsLabelPosition]

labelsWithinRect(self, r: QgsRectangle) List[QgsLabelPosition]

Returns the details of any labels placed within the specified rectangle (in map coordinates).

Parameters:

r (QgsRectangle) –

Return type:

List[QgsLabelPosition]

setMapSettings(self, settings: QgsMapSettings)

Sets the map settings associated with the labeling run.

New in version 3.4.8.

Parameters:

settings (QgsMapSettings) –