Class: QgsLinearReferencingSymbolLayer¶
Line symbol layer used for decorating accordingly to linear referencing.
This symbol layer type allows placing text labels at regular intervals along a line (or at positions corresponding to existing vertices). Positions can be calculated using Cartesian distances, or interpolated from z or m values.
Added in version 3.40.
Class Hierarchy¶
Base classes¶
Abstract base class for line symbol layers.  | 
|
Constructor for QgsSymbolLayer.  | 
Methods
Returns the length of line over which the line's direction is averaged when calculating individual label angles.  | 
|
Returns the map unit scale for the length over which the line's direction is averaged when calculating individual label angles.  | 
|
Returns the unit for the length over which the line's direction is averaged when calculating individual label angles.  | 
|
Returns the interval between labels.  | 
|
Returns the offset between the line and linear referencing labels.  | 
|
Returns the map unit scale used for calculating the offset between the line and linear referencing labels.  | 
|
Returns the unit used for the offset between the line and linear referencing labels.  | 
|
Returns the label source, which dictates what quantity to use for the labels shown.  | 
|
Returns the numeric format used to format the labels for the layer.  | 
|
Returns the placement mode for the labels.  | 
|
Returns   | 
|
Sets the length of line over which the line's direction is averaged when calculating individual label angles.  | 
|
Sets the map unit scale for the length over which the line's direction is averaged when calculating individual label angles.  | 
|
Sets the unit for the length over which the line's direction is averaged when calculating individual label angles.  | 
|
Sets the interval between labels.  | 
|
Sets the offset between the line and linear referencing labels.  | 
|
Sets the map unit scale used for calculating the offset between the line and linear referencing labels.  | 
|
Sets the unit used for the offset between the line and linear referencing labels.  | 
|
Sets the label source, which dictates what quantity to use for the labels shown.  | 
|
Sets the numeric format used to format the labels for the layer.  | 
|
Sets the placement mode for the labels.  | 
|
Sets whether the labels and symbols should be rotated to match their line segment orientation.  | 
|
Sets whether a marker symbol should be shown corresponding to the labeled point on line.  | 
|
Sets the multiple distance to skip labels for.  | 
|
Sets the text format used to render the layer.  | 
|
Returns   | 
|
Returns the multiple distance to skip labels for.  | 
|
Returns the text format used to render the layer.  | 
Static Methods
Creates a new   | 
- class qgis.core.QgsLinearReferencingSymbolLayer[source]¶
 Bases:
QgsLineSymbolLayer- averageAngleLength(self) float[source]¶
 Returns the length of line over which the line’s direction is averaged when calculating individual label angles. Longer lengths smooth out angles from jagged lines to a greater extent.
Units are retrieved through
averageAngleUnit()See also
See also
See also
- Return type:
 float
- averageAngleMapUnitScale(self) QgsMapUnitScale¶
 Returns the map unit scale for the length over which the line’s direction is averaged when calculating individual label angles.
See also
See also
See also
- Return type:
 
- averageAngleUnit(self) Qgis.RenderUnit[source]¶
 Returns the unit for the length over which the line’s direction is averaged when calculating individual label angles.
See also
See also
See also
- Return type:
 
- static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None[source]¶
 Creates a new
QgsLinearReferencingSymbolLayer, using the specifiedproperties.The caller takes ownership of the returned object.
- Parameters:
 properties (Dict[str, Any] = {})
- Return type:
 Optional[QgsSymbolLayer]
- interval(self) float[source]¶
 Returns the interval between labels.
Units are always in the original layer CRS units.
See also
- Return type:
 float
- labelOffset(self) QPointF[source]¶
 Returns the offset between the line and linear referencing labels.
The unit for the offset is retrievable via
labelOffsetUnit().See also
See also
- Return type:
 QPointF
- labelOffsetMapUnitScale(self) QgsMapUnitScale¶
 Returns the map unit scale used for calculating the offset between the line and linear referencing labels.
See also
- Return type:
 
- labelOffsetUnit(self) Qgis.RenderUnit[source]¶
 Returns the unit used for the offset between the line and linear referencing labels.
See also
See also
- Return type:
 
- labelSource(self) Qgis.LinearReferencingLabelSource[source]¶
 Returns the label source, which dictates what quantity to use for the labels shown.
See also
- Return type:
 
- numericFormat(self) QgsNumericFormat | None[source]¶
 Returns the numeric format used to format the labels for the layer.
See also
- Return type:
 Optional[QgsNumericFormat]
- placement(self) Qgis.LinearReferencingPlacement[source]¶
 Returns the placement mode for the labels.
See also
- Return type:
 
- rotateLabels(self) bool[source]¶
 Returns
Trueif the labels and symbols are to be rotated to match their line segment orientation.See also
- Return type:
 bool
- setAverageAngleLength(self, length: float)[source]¶
 Sets the
lengthof line over which the line’s direction is averaged when calculating individual label angles. Longer lengths smooth out angles from jagged lines to a greater extent.Units are set through
setAverageAngleUnit()See also
See also
See also
- Parameters:
 length (float)
- setAverageAngleMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
 Sets the map unit
scalefor the length over which the line’s direction is averaged when calculating individual label angles.See also
See also
See also
- Parameters:
 scale (QgsMapUnitScale)
- setAverageAngleUnit(self, unit: Qgis.RenderUnit)[source]¶
 Sets the
unitfor the length over which the line’s direction is averaged when calculating individual label angles.See also
See also
See also
- Parameters:
 unit (Qgis.RenderUnit)
- setInterval(self, interval: float)[source]¶
 Sets the
intervalbetween labels.Units are always in the original layer CRS units.
See also
- Parameters:
 interval (float)
- setLabelOffset(self, offset: QPointF | QPoint)[source]¶
 Sets the
offsetbetween the line and linear referencing labels.The unit for the offset is set via
setLabelOffsetUnit().See also
See also
- Parameters:
 offset (Union[QPointF, QPoint])
- setLabelOffsetMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
 Sets the map unit
scaleused for calculating the offset between the line and linear referencing labels.See also
- Parameters:
 scale (QgsMapUnitScale)
- setLabelOffsetUnit(self, unit: Qgis.RenderUnit)[source]¶
 Sets the
unitused for the offset between the line and linear referencing labels.See also
See also
- Parameters:
 unit (Qgis.RenderUnit)
- setLabelSource(self, source: Qgis.LinearReferencingLabelSource)[source]¶
 Sets the label
source, which dictates what quantity to use for the labels shown.See also
- Parameters:
 source (Qgis.LinearReferencingLabelSource)
- setNumericFormat(self, format: QgsNumericFormat | None)[source]¶
 Sets the numeric
formatused to format the labels for the layer.Ownership of
formatis transferred to the layer.See also
- Parameters:
 format (Optional[QgsNumericFormat])
- setPlacement(self, placement: Qgis.LinearReferencingPlacement)[source]¶
 Sets the
placementmode for the labels.See also
- Parameters:
 placement (Qgis.LinearReferencingPlacement)
- setRotateLabels(self, rotate: bool)[source]¶
 Sets whether the labels and symbols should be rotated to match their line segment orientation.
See also
- Parameters:
 rotate (bool)
- setShowMarker(self, show: bool)[source]¶
 Sets whether a marker symbol should be shown corresponding to the labeled point on line.
The marker symbol is set using
setSubSymbol()See also
- Parameters:
 show (bool)
- setSkipMultiplesOf(self, multiple: float)[source]¶
 Sets the
multipledistance to skip labels for.If this value is non-zero, then any labels which are integer multiples of the returned value will be skipped. This allows creation of advanced referencing styles where a single
QgsSymbolhas multipleQgsLinearReferencingSymbolLayersymbol layers, eg allowing labeling every 100 in a normal font and every 1000 in a bold, larger font.See also
- Parameters:
 multiple (float)
- setTextFormat(self, format: QgsTextFormat)[source]¶
 Sets the text
formatused to render the layer.See also
- Parameters:
 format (QgsTextFormat)
- showMarker(self) bool[source]¶
 Returns
Trueif a marker symbol should be shown corresponding to the labeled point on line.The marker symbol is set using
setSubSymbol()See also
- Return type:
 bool
- skipMultiplesOf(self) float[source]¶
 Returns the multiple distance to skip labels for.
If this value is non-zero, then any labels which are integer multiples of the returned value will be skipped. This allows creation of advanced referencing styles where a single
QgsSymbolhas multipleQgsLinearReferencingSymbolLayersymbol layers, eg allowing labeling every 100 in a normal font and every 1000 in a bold, larger font.See also
- Return type:
 float
- textFormat(self) QgsTextFormat[source]¶
 Returns the text format used to render the layer.
See also
- Return type: