Class: QgsMarkerLineSymbolLayer

class qgis.core.QgsMarkerLineSymbolLayer(rotateMarker: bool = DEFAULT_MARKERLINE_ROTATE, interval: float = DEFAULT_MARKERLINE_INTERVAL)

Bases: QgsLineSymbolLayer

Parameters
  • rotateMarker (bool = DEFAULT_MARKERLINE_ROTATE) –

  • interval

CentralPoint = 4
CurvePoint = 5
FirstVertex = 3
Interval = 0
LastVertex = 2
class Placement

Bases: int

Vertex = 1
clone(self) → QgsMarkerLineSymbolLayer
Return type

QgsMarkerLineSymbolLayer

color(self) → QColor
Return type

QColor

copyDataDefinedProperties()
copyPaintEffect()
create(properties: Dict[str, str] = {}) → QgsSymbolLayer

Create a new MarkerLineSymbolLayerV2

Parameters

properties (Dict[str) – A property map to deserialize saved information from properties()

Return type

QgsSymbolLayer

Returns

A new MarkerLineSymbolLayerV2

createFromSld(element: QDomElement) → QgsSymbolLayer

Create a new MarkerLineSymbolLayerV2 from SLD

Parameters

element (QDomElement) – An SLD XML DOM element

Return type

QgsSymbolLayer

Returns

A new MarkerLineSymbolLayerV2

estimateMaxBleed(self, context: QgsRenderContext) → float
Parameters

context (QgsRenderContext) –

Return type

float

hasDataDefinedProperties(self) → bool
Return type

bool

interval(self) → float

Returns the interval between individual markers. Units are specified through intervalUnits().

See also

setInterval()

See also

intervalUnit()

Return type

float

intervalMapUnitScale(self) → QgsMapUnitScale
Return type

QgsMapUnitScale

intervalUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the interval between markers.

See also

interval()

Return type

QgsUnitTypes.RenderUnit

layerType(self) → str
Return type

str

mapUnitScale(self) → QgsMapUnitScale
Return type

QgsMapUnitScale

markerAngle(self, points: QPolygonF, isRing: bool, vertex: int) → float
Parameters
  • points (QPolygonF) –

  • isRing (bool) –

  • vertex (int) –

Return type

float

offsetAlongLine(self) → float

Returns the offset along the line for the marker placement. For Interval placements, this is the distance between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the distance between the marker 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

placement()

New in version 2.3.

offsetAlongLineMapUnitScale(self) → QgsMapUnitScale

Returns the map unit scale used for calculating the offset in map units along line for markers.

Return type

QgsMapUnitScale

Returns

Offset along line map unit scale.

offsetAlongLineUnit(self) → QgsUnitTypes.RenderUnit

Returns the unit used for calculating the offset along line for markers.

Return type

QgsUnitTypes.RenderUnit

Returns

Offset along line unit type.

outputUnit(self) → QgsUnitTypes.RenderUnit
Return type

QgsUnitTypes.RenderUnit

placement(self) → QgsMarkerLineSymbolLayer.Placement

The placement of the markers.

Return type

QgsMarkerLineSymbolLayer.Placement

properties(self) → Dict[str, str]
Return type

Dict[str, str]

renderPolygonStroke(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)
Parameters
renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters
renderPolylineCentral(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters
renderPolylineInterval(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters
renderPolylineVertex(self, points: QPolygonF, context: QgsSymbolRenderContext, placement: QgsMarkerLineSymbolLayer.Placement = QgsMarkerLineSymbolLayer.Vertex)
Parameters
  • points (QPolygonF) –

  • context (QgsSymbolRenderContext) –

  • placement (QgsMarkerLineSymbolLayer.Placement = QgsMarkerLineSymbolLayer.Vertex) –

restoreOldDataDefinedProperties()
rotateMarker(self) → bool

Shall the marker be rotated.

Return type

bool

Returns

True if the marker should be rotated.

setColor(self, color: Union[QColor, Qt.GlobalColor])
Parameters

color (Union[QColor) –

setDataDefinedProperty(self, key: QgsSymbolLayer.Property, property: QgsProperty)
Parameters
setInterval(self, interval: float)

Sets the interval between individual markers.

Parameters

interval (float) – interval size. Units are specified through setIntervalUnit()

See also

interval()

setIntervalMapUnitScale(self, scale: QgsMapUnitScale)
Parameters

scale (QgsMapUnitScale) –

setIntervalUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the units for the interval between markers.

Parameters

unit (QgsUnitTypes.RenderUnit) – interval units

See also

intervalUnit()

See also

setInterval()

setMapUnitScale(self, scale: QgsMapUnitScale)
Parameters

scale (QgsMapUnitScale) –

setOffsetAlongLine(self, offsetAlongLine: float)

Sets the the offset along the line for the marker placement. For Interval placements, this is the distance between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the distance between the marker 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

setPlacement()

New in version 2.3.

setOffsetAlongLineMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale used for calculating the offset in map units along line for markers.

Parameters

scale (QgsMapUnitScale) – Offset along line map unit scale.

setOffsetAlongLineUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the unit used for calculating the offset along line for markers.

Parameters

unit (QgsUnitTypes.RenderUnit) – Offset along line unit type.

setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)
Parameters

unit (QgsUnitTypes.RenderUnit) –

setPlacement(self, p: QgsMarkerLineSymbolLayer.Placement)

The placement of the markers.

Parameters

p (QgsMarkerLineSymbolLayer.Placement) –

setRotateMarker(self, rotate: bool)

Shall the marker be rotated.

Parameters

rotate (bool) –

setSubSymbol(self, symbol: QgsSymbol) → bool
Parameters

symbol (QgsSymbol) –

Return type

bool

setWidth(self, width: float)
Parameters

width (float) –

startRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

stopRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

subSymbol(self) → QgsSymbol
Return type

QgsSymbol

toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])
Parameters
  • doc (QDomDocument) –

  • element (QDomElement) –

  • props (Dict[str) –

usedAttributes(self, context: QgsRenderContext) → Set[str]
Parameters

context (QgsRenderContext) –

Return type

Set[str]

width(self) → float

width(self, context: QgsRenderContext) -> float

Return type

float