Class: QgsTemplatedLineSymbolLayerBase¶
-
class
qgis.core.
QgsTemplatedLineSymbolLayerBase
(rotateSymbol: bool = True, interval: float = 3)¶ Bases:
qgis._core.QgsLineSymbolLayer
Constructor for QgsTemplatedLineSymbolLayerBase. Creates a template line placed at the specified
interval
(in millimeters).The
rotateSymbol
argument specifies whether individual symbols should be rotated to match the line segment alignment.Base class for templated line symbols, e.g. line symbols which draw markers or hash lines at intervals along the line feature.
New in version 3.8: Enums
Methods
Returns the length of line over which the line’s direction is averaged when calculating individual symbol angles.
Returns the map unit scale for the length over which the line’s direction is averaged when calculating individual symbol angles.
Returns the unit for the length over which the line’s direction is averaged when calculating individual symbol angles.
Copies all common properties of this layer to another templated symbol layer.
Returns the interval between individual symbols.
Returns the map unit scale for the interval between symbols.
Returns the units for the interval between symbols.
Returns the offset along the line for the symbol placement.
Returns the map unit scale used for calculating the offset in map units along line for symbols.
Returns the unit used for calculating the offset along line for symbols.
Returns the placement of the symbols.
Renders the templated symbol at the specified
point
, using the given rendercontext
.Returns
True
if the repeating symbols be rotated to match their line segment orientation.Sets the
length
of line over which the line’s direction is averaged when calculating individual symbol angles.Sets the map unit
scale
for the length over which the line’s direction is averaged when calculating individual symbol angles.Sets the
unit
for the length over which the line’s direction is averaged when calculating individual symbol angles.Sets all common symbol properties in the
destLayer
, using the settings serialized in theproperties
map.Sets the interval between individual symbols.
Sets the map unit
scale
for the interval between symbols.Sets the units for the interval between symbols.
Sets the the offset along the line for the symbol placement.
Sets the map unit
scale
used for calculating the offset in map units along line for symbols.Sets the unit used for calculating the offset along line for symbols.
Sets the
placement
of the symbols.Sets whether the repeating symbols should be rotated to match their line segment orientation.
Sets the symbol’s
angle
, in degrees clockwise.Sets the line
angle
modification for the symbol’s angle.Returns the symbol’s current angle, in degrees clockwise.
Signals
Attributes
-
CentralPoint
= 4¶
-
CurvePoint
= 5¶
-
FirstVertex
= 3¶
-
Interval
= 0¶
-
LastVertex
= 2¶
-
class
Placement
¶ Bases:
int
-
Vertex
= 1¶
-
averageAngleLength
(self) → float¶ Returns the length of line over which the line’s direction is averaged when calculating individual symbol angles. Longer lengths smooth out angles from jagged lines to a greater extent.
Units are retrieved through averageAngleUnit()
See also
See also
See also
-
averageAngleMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale for the length over which the line’s direction is averaged when calculating individual symbol angles.
See also
See also
See also
-
averageAngleUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the unit for the length over which the line’s direction is averaged when calculating individual symbol angles.
See also
See also
See also
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
copyTemplateSymbolProperties
(self, destLayer: QgsTemplatedLineSymbolLayerBase)¶ Copies all common properties of this layer to another templated symbol layer.
-
interval
(self) → float¶ Returns the interval between individual symbols. Units are specified through intervalUnits().
See also
See also
-
intervalMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale for the interval between symbols.
See also
See also
See also
-
intervalUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units for the interval between symbols.
See also
See also
-
mapUnitScale
(self) → QgsMapUnitScale¶
-
offsetAlongLine
(self) → float¶ Returns the offset along the line for the symbol placement. For Interval placements, this is the distance between the start of the line and the first symbol. For FirstVertex and LastVertex placements, this is the distance between the symbol and the start of the line or the end of the line respectively. This setting has no effect for Vertex or CentralPoint placements.
- Returns
The offset along the line. The unit for the offset is retrievable via offsetAlongLineUnit.
See also
See also
See also
-
offsetAlongLineMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale used for calculating the offset in map units along line for symbols.
See also
-
offsetAlongLineUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the unit used for calculating the offset along line for symbols.
- Returns
Offset along line unit type.
See also
See also
-
outputUnit
(self) → QgsUnitTypes.RenderUnit¶
-
placement
(self) → QgsTemplatedLineSymbolLayerBase.Placement¶ Returns the placement of the symbols.
See also
-
properties
(self) → Dict[str, str]¶
-
renderPolygonStroke
(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)¶
-
renderPolyline
(self, points: QPolygonF, context: QgsSymbolRenderContext)¶
-
renderSymbol
(self, point: Union[QPointF, QPoint], feature: QgsFeature, context: QgsRenderContext, layer: int = -1, selected: bool = False)¶ Renders the templated symbol at the specified
point
, using the given rendercontext
.The
feature
argument is used to pass the feature currently being rendered (when available).If only a single symbol layer from the symbol should be rendered, it should be specified in the
layer
argument. Alayer
of -1 indicates that all symbol layers should be rendered.If
selected
is true then the symbol will be drawn using the “selected feature” style and colors instead of the symbol’s normal style.
-
restoreOldDataDefinedProperties
()¶
-
rotateSymbols
(self) → bool¶ Returns
True
if the repeating symbols be rotated to match their line segment orientation.See also
-
setAverageAngleLength
(self, length: float)¶ Sets the
length
of line over which the line’s direction is averaged when calculating individual symbol angles. Longer lengths smooth out angles from jagged lines to a greater extent.Units are set through setAverageAngleUnit()
See also
See also
See also
-
setAverageAngleMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit
scale
for the length over which the line’s direction is averaged when calculating individual symbol angles.See also
See also
See also
-
setAverageAngleUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the
unit
for the length over which the line’s direction is averaged when calculating individual symbol angles.See also
See also
See also
-
setCommonProperties
(destLayer: QgsTemplatedLineSymbolLayerBase, properties: Dict[str, str])¶ Sets all common symbol properties in the
destLayer
, using the settings serialized in theproperties
map.
-
setInterval
(self, interval: float)¶ Sets the interval between individual symbols.
- Parameters
interval – interval size. Units are specified through setIntervalUnit()
See also
See also
-
setIntervalMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit
scale
for the interval between symbols.See also
See also
See also
-
setIntervalUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the units for the interval between symbols.
- Parameters
unit – interval units
See also
See also
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶
-
setOffsetAlongLine
(self, offsetAlongLine: float)¶ Sets the the offset along the line for the symbol placement. For Interval placements, this is the distance between the start of the line and the first symbol. For FirstVertex and LastVertex placements, this is the distance between the symbol and the start of the line or the end of the line respectively. This setting has no effect for Vertex or CentralPoint placements.
- Parameters
offsetAlongLine – Distance to offset markers along the line. The offset unit is set via setOffsetAlongLineUnit.
See also
See also
See also
-
setOffsetAlongLineMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit
scale
used for calculating the offset in map units along line for symbols.See also
-
setOffsetAlongLineUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the unit used for calculating the offset along line for symbols.
- Parameters
unit – Offset along line unit type.
See also
See also
-
setPlacement
(self, placement: QgsTemplatedLineSymbolLayerBase.Placement)¶ Sets the
placement
of the symbols.See also
-
setRotateSymbols
(self, rotate: bool)¶ Sets whether the repeating symbols should be rotated to match their line segment orientation.
See also
-
setSymbolAngle
(self, angle: float)¶ Sets the symbol’s
angle
, in degrees clockwise.
-
setSymbolLineAngle
(self, angle: float)¶ Sets the line
angle
modification for the symbol’s angle. This angle is added to the symbol’s rotation and data defined rotation before rendering the symbol, and is used for orienting symbols to match the line’s angle.- Parameters
angle – Angle in degrees, valid values are between 0 and 360
-
symbolAngle
(self) → float¶ Returns the symbol’s current angle, in degrees clockwise.
-