Class: QgsTemplatedLineSymbolLayerBase¶
- class qgis.core.QgsTemplatedLineSymbolLayerBase(rotateSymbol: bool = True, interval: float = 3)¶
Bases:
QgsLineSymbolLayer
Constructor for
QgsTemplatedLineSymbolLayerBase
. Creates a template line placed at the specifiedinterval
(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:
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 data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
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.
- rtype
QgsMapUnitScale
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.
- rtype
QgsUnitTypes.RenderUnit
Returns the placement of the symbols.
- rtype
Dict[str, str]
- param points
- param points
Renders the templated symbol at the specified
point
, using the given rendercontext
.Restores older data defined properties from string map.
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.
- param scale
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.
Attributes
- CentralPoint = 4¶
- CurvePoint = 5¶
- FirstVertex = 3¶
- Interval = 0¶
- LastVertex = 2¶
- class Placement¶
Bases:
int
- SegmentCenter = 6¶
- 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
- 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 symbol angles.
See also
See also
See also
- Return type
- 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
- Return type
- copyDataDefinedProperties(self, destLayer: QgsSymbolLayer)¶
Copies all data defined properties of this layer to another symbol layer.
- Parameters
destLayer – destination layer
- copyPaintEffect(self, destLayer: QgsSymbolLayer)¶
Copies paint effect of this layer to another symbol layer
- Parameters
destLayer – destination layer
New in version 2.9.
- copyTemplateSymbolProperties(self, destLayer: QgsTemplatedLineSymbolLayerBase)¶
Copies all common properties of this layer to another templated symbol layer.
- Parameters
destLayer (QgsTemplatedLineSymbolLayerBase) –
- interval(self) float ¶
Returns the interval between individual symbols. Units are specified through
intervalUnits()
.See also
See also
- Return type
float
- intervalMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the interval between symbols.
See also
See also
See also
- Return type
- intervalUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the units for the interval between symbols.
See also
See also
- Return type
- mapUnitScale(self) QgsMapUnitScale ¶
- Return type
- 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.
- Return type
float
- 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
- Return type
- offsetAlongLineUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the unit used for calculating the offset along line for symbols.
- Return type
- Returns
Offset along line unit type.
See also
See also
- outputUnit(self) QgsUnitTypes.RenderUnit ¶
- Return type
- placement(self) QgsTemplatedLineSymbolLayerBase.Placement ¶
Returns the placement of the symbols.
See also
- Return type
- properties(self) Dict[str, str] ¶
- Return type
Dict[str, str]
- renderPolygonStroke(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)¶
- Parameters
points (QPolygonF) –
rings (Iterable[QPolygonF]) –
context (QgsSymbolRenderContext) –
- renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)¶
- Parameters
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
isTrue
then the symbol will be drawn using the “selected feature” style and colors instead of the symbol’s normal style.- Parameters
point (Union[QPointF) –
feature (QgsFeature) –
context (QgsRenderContext) –
layer (int = -1) –
selected (bool = False) –
- restoreOldDataDefinedProperties(self, stringMap: Dict[str, str])¶
Restores older data defined properties from string map.
New in version 3.0.
- rotateSymbols(self) bool ¶
Returns
True
if the repeating symbols be rotated to match their line segment orientation.See also
- Return type
bool
- 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
- Parameters
length (float) –
- 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
- Parameters
scale (QgsMapUnitScale) –
- 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
- Parameters
unit (QgsUnitTypes.RenderUnit) –
- setCommonProperties(destLayer: QgsTemplatedLineSymbolLayerBase, properties: Dict[str, str])¶
Sets all common symbol properties in the
destLayer
, using the settings serialized in theproperties
map.- Parameters
destLayer (QgsTemplatedLineSymbolLayerBase) –
properties (Dict[str) –
- setInterval(self, interval: float)¶
Sets the interval between individual symbols.
- Parameters
interval (float) – 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
- Parameters
scale (QgsMapUnitScale) –
- setIntervalUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the units for the interval between symbols.
- Parameters
unit (QgsUnitTypes.RenderUnit) – interval units
See also
See also
- setMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters
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 (float) – 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
- Parameters
scale (QgsMapUnitScale) –
- setOffsetAlongLineUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the unit used for calculating the offset along line for symbols.
- Parameters
unit (QgsUnitTypes.RenderUnit) – Offset along line unit type.
See also
See also
- setPlacement(self, placement: QgsTemplatedLineSymbolLayerBase.Placement)¶
Sets the
placement
of the symbols.See also
- Parameters
placement (QgsTemplatedLineSymbolLayerBase.Placement) –
- setRotateSymbols(self, rotate: bool)¶
Sets whether the repeating symbols should be rotated to match their line segment orientation.
See also
- Parameters
rotate (bool) –
- setSymbolAngle(self, angle: float)¶
Sets the symbol’s
angle
, in degrees clockwise.- Parameters
angle (float) –
- 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 (float) – Angle in degrees, valid values are between 0 and 360
- symbolAngle(self) float ¶
Returns the symbol’s current angle, in degrees clockwise.
- Return type
float