Class: QgsLabelPosition

class qgis.core.QgsLabelPosition

Bases: sip.wrapper

Represents the calculated placement of a map label.

QgsLabelPosition(id: int, r: float, corners: Iterable[QgsPointXY], rect: QgsRectangle, w: float, h: float, layer: str, labeltext: str, labelfont: QFont, upside_down: bool, diagram: bool = False, pinned: bool = False, providerId: str = ‘’, labelGeometry: QgsGeometry = QgsGeometry(), isUnplaced: bool = False) Constructor for QgsLabelPosition.

Parameters:
  • id – associated feature ID

  • r – label rotation in degrees clockwise

  • corners – corner points of label bounding box, in map units

  • rect – label bounding box, in map units

  • w – width of label, in map units

  • h – height of label, in map units

  • layer – ID of associated map layer

  • labeltext – text rendered for label

  • labelfont – font used to render label

  • upside_downTrue if label is upside down

  • diagramTrue if label is a diagram

  • pinnedTrue if label has pinned placement

  • providerId – ID of associated label provider

  • labelGeometry – polygon geometry of label boundary

  • isUnplaced – set to True if label was unplaced (e.g. due to collisions with other labels)

QgsLabelPosition() Constructor for QgsLabelPosition

QgsLabelPosition(QgsLabelPosition)

Attributes

cornerPoints
featureId
height
isDiagram
isPinned
isUnplaced
labelFont
labelGeometry
labelRect
labelText
layerID
providerID
rotation
upsideDown
width