Class: QgsLabelLineSettings¶
- class qgis.core.QgsLabelLineSettings¶
Bases:
sip.wrapper
Contains settings related to how the label engine places and formats labels for line features (or polygon features which are labeled in a “perimeter” style mode).
New in version 3.16:
Enums
Bases:
enum.IntEnum
Bases:
enum.IntEnum
Bases:
enum.IntEnum
Bases:
enum.IntEnum
Methods
Returns
True
if '<' or '>' (or custom strings set via leftDirectionSymbol and rightDirectionSymbol) will be automatically added to the label text, pointing in the direction of the line or polygon ring.Returns the line anchor clipping mode, which dictates how line strings are clipped before calculating the line anchor placement.
Returns the line anchor text point, which dictates which part of the label text should be placed at the
lineAnchorPercent()
.Returns the line anchor type, which dictates how the
lineAnchorPercent()
setting is handled.Returns the placement for direction symbols.
Returns the string to use for left direction arrows.
Returns the percent along the line at which labels should be placed.
Returns
True
if connected line features with identical label text should be merged prior to generating label positions.Returns the distance which labels are allowed to overrun past the start or end of line features.
Returns the map unit scale for label overrun distance.
Returns the units for label overrun distance.
Returns the line placement flags, which dictate how line labels can be placed above or below the lines.
Returns
True
if direction symbols should be reversed.Returns the string to use for right direction arrows.
Sets whether '<' or '>' (or custom strings set via leftDirectionSymbol and rightDirectionSymbol) will be automatically added to the label text, pointing in the direction of the line or polygon ring.
Sets the line anchor
clipping
mode, which dictates how line strings are clipped before calculating the line anchor placement.Sets the line anchor text
point
, which dictates which part of the label text should be placed at thelineAnchorPercent()
.Sets the line anchor
type
, which dictates how thelineAnchorPercent()
setting is handled.Sets the
placement
for direction symbols.Sets the string to use for left direction arrows.
Sets the
percent
along the line at which labels should be placed.Sets whether connected line features with identical label text should be merged prior to generating label positions.
Sets the
distance
which labels are allowed to overrun past the start or end of line features.Sets the map unit
scale
for label overrun distance.Sets the
unit
for label overrun distance.Returns the line placement
flags
, which dictate how line labels can be placed above or below the lines.Sets whether the direction symbols should be
reversed
.Sets the string to use for right direction arrows.
Updates the thinning settings to respect any data defined properties set within the specified
properties
collection.Attributes
- class AnchorClipping(value)¶
Bases:
enum.IntEnum
Clipping behavior for line anchor calculation.
New in version 3.20.
UseVisiblePartsOfLine
: Only visible parts of lines are considered when calculating the line anchor for labelsUseEntireLine
: Entire original feature line geometry is used when calculating the line anchor for labels
- UseEntireLine = 1¶
- UseVisiblePartsOfLine = 0¶
- baseClass¶
alias of
QgsLabelLineSettings
- class AnchorTextPoint(value)¶
Bases:
enum.IntEnum
Anchor point of label text.
New in version 3.26.
StartOfText
: Anchor using start of textCenterOfText
: Anchor using center of textEndOfText
: Anchor using end of textFollowPlacement
: Automatically set the anchor point based on the lineAnchorPercent() value. Values <25% will use the start of text, values > 75% will use the end of text, and values in between will use the center of the text
- CenterOfText = 1¶
- EndOfText = 2¶
- FollowPlacement = 3¶
- StartOfText = 0¶
- baseClass¶
alias of
QgsLabelLineSettings
- class AnchorType(value)¶
Bases:
enum.IntEnum
Line anchor types
HintOnly
: Line anchor is a hint for preferred placement only, but other placements close to the hint are permittedStrict
: Line anchor is a strict placement, and other placements are not permitted
- HintOnly = 0¶
- Strict = 1¶
- baseClass¶
alias of
QgsLabelLineSettings
- class DirectionSymbolPlacement(value)¶
Bases:
enum.IntEnum
Placement options for direction symbols.
SymbolLeftRight
: Place direction symbols on left/right of labelSymbolAbove
: Place direction symbols on above labelSymbolBelow
: Place direction symbols on below label
- SymbolAbove = 1¶
- SymbolBelow = 2¶
- SymbolLeftRight = 0¶
- baseClass¶
alias of
QgsLabelLineSettings
- addDirectionSymbol(self) bool ¶
Returns
True
if ‘<’ or ‘>’ (or custom strings set via leftDirectionSymbol and rightDirectionSymbol) will be automatically added to the label text, pointing in the direction of the line or polygon ring.See also
See also
See also
See also
See also
- Return type:
bool
- anchorClipping(self) QgsLabelLineSettings.AnchorClipping ¶
Returns the line anchor clipping mode, which dictates how line strings are clipped before calculating the line anchor placement.
See also
See also
See also
New in version 3.20.
- Return type:
- anchorTextPoint(self) QgsLabelLineSettings.AnchorTextPoint ¶
Returns the line anchor text point, which dictates which part of the label text should be placed at the
lineAnchorPercent()
.See also
New in version 3.26.
- Return type:
- anchorType(self) QgsLabelLineSettings.AnchorType ¶
Returns the line anchor type, which dictates how the
lineAnchorPercent()
setting is handled.See also
See also
See also
- Return type:
- directionSymbolPlacement(self) QgsLabelLineSettings.DirectionSymbolPlacement ¶
Returns the placement for direction symbols.
This setting controls whether to place direction symbols to the left/right, above or below label.
See also
See also
- Return type:
- leftDirectionSymbol(self) str ¶
Returns the string to use for left direction arrows.
See also
See also
See also
- Return type:
str
- lineAnchorPercent(self) float ¶
Returns the percent along the line at which labels should be placed.
By default, this is 0.5 which indicates that labels should be placed as close to the center of the line as possible. A value of 0.0 indicates that the labels should be placed as close to the start of the line as possible, while a value of 1.0 pushes labels towards the end of the line.
See also
See also
See also
See also
- Return type:
float
- mergeLines(self) bool ¶
Returns
True
if connected line features with identical label text should be merged prior to generating label positions.See also
- Return type:
bool
- overrunDistance(self) float ¶
Returns the distance which labels are allowed to overrun past the start or end of line features.
See also
See also
See also
- Return type:
float
- overrunDistanceMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for label overrun distance.
See also
See also
See also
- Return type:
- overrunDistanceUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the units for label overrun distance.
See also
See also
See also
- Return type:
- placementFlags(self) QgsLabeling.LinePlacementFlags ¶
Returns the line placement flags, which dictate how line labels can be placed above or below the lines.
See also
- Return type:
- reverseDirectionSymbol(self) bool ¶
Returns
True
if direction symbols should be reversed.See also
- Return type:
bool
- rightDirectionSymbol(self) str ¶
Returns the string to use for right direction arrows.
See also
See also
See also
- Return type:
str
- setAddDirectionSymbol(self, enabled: bool)¶
Sets whether ‘<’ or ‘>’ (or custom strings set via leftDirectionSymbol and rightDirectionSymbol) will be automatically added to the label text, pointing in the direction of the line or polygon ring.
See also
See also
See also
See also
See also
- Parameters:
enabled (bool) –
- setAnchorClipping(self, clipping: QgsLabelLineSettings.AnchorClipping)¶
Sets the line anchor
clipping
mode, which dictates how line strings are clipped before calculating the line anchor placement.See also
See also
See also
New in version 3.20.
- Parameters:
clipping (QgsLabelLineSettings.AnchorClipping) –
- setAnchorTextPoint(self, point: QgsLabelLineSettings.AnchorTextPoint)¶
Sets the line anchor text
point
, which dictates which part of the label text should be placed at thelineAnchorPercent()
.See also
New in version 3.26.
- Parameters:
point (QgsLabelLineSettings.AnchorTextPoint) –
- setAnchorType(self, type: QgsLabelLineSettings.AnchorType)¶
Sets the line anchor
type
, which dictates how thelineAnchorPercent()
setting is handled.See also
See also
See also
- Parameters:
type (QgsLabelLineSettings.AnchorType) –
- setDirectionSymbolPlacement(self, placement: QgsLabelLineSettings.DirectionSymbolPlacement)¶
Sets the
placement
for direction symbols.This setting controls whether to place direction symbols to the left/right, above or below label.
See also
See also
- Parameters:
placement (QgsLabelLineSettings.DirectionSymbolPlacement) –
- setLeftDirectionSymbol(self, symbol: str)¶
Sets the string to use for left direction arrows.
See also
See also
See also
- Parameters:
symbol (str) –
- setLineAnchorPercent(self, percent: float)¶
Sets the
percent
along the line at which labels should be placed.By default, this is 0.5 which indicates that labels should be placed as close to the center of the line as possible. A value of 0.0 indicates that the labels should be placed as close to the start of the line as possible, while a value of 1.0 pushes labels towards the end of the line.
See also
See also
See also
See also
- Parameters:
percent (float) –
- setMergeLines(self, merge: bool)¶
Sets whether connected line features with identical label text should be merged prior to generating label positions.
See also
- Parameters:
merge (bool) –
- setOverrunDistance(self, distance: float)¶
Sets the
distance
which labels are allowed to overrun past the start or end of line features.See also
See also
See also
- Parameters:
distance (float) –
- setOverrunDistanceMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map unit
scale
for label overrun distance.See also
See also
See also
- Parameters:
scale (QgsMapUnitScale) –
- setOverrunDistanceUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the
unit
for label overrun distance.See also
See also
See also
- Parameters:
unit (QgsUnitTypes.RenderUnit) –
- setPlacementFlags(self, flags: QgsLabeling.LinePlacementFlags | QgsLabeling.LinePlacementFlag)¶
Returns the line placement
flags
, which dictate how line labels can be placed above or below the lines.See also
- Parameters:
flags (Union[QgsLabeling.LinePlacementFlags) –
- setReverseDirectionSymbol(self, reversed: bool)¶
Sets whether the direction symbols should be
reversed
.See also
- Parameters:
reversed (bool) –
- setRightDirectionSymbol(self, symbol: str)¶
Sets the string to use for right direction arrows.
See also
See also
See also
- Parameters:
symbol (str) –
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- updateDataDefinedProperties(self, properties: QgsPropertyCollection, context: QgsExpressionContext)¶
Updates the thinning settings to respect any data defined properties set within the specified
properties
collection.- Parameters:
properties (QgsPropertyCollection) –
context (QgsExpressionContext) –