Class: QgsRasterLineSymbolLayer

class qgis.core.QgsRasterLineSymbolLayer

Bases: QgsAbstractBrushedLineSymbolLayer

Line symbol layer type which draws line sections using a raster image file.

New in version 3.24.

QgsRasterLineSymbolLayer(path: str = ‘’) Constructor for QgsRasterLineSymbolLayer, with the specified raster image path.

Methods

clone

rtype:

QgsRasterLineSymbolLayer

color

rtype:

QColor

copyDataDefinedProperties

Copies all data defined properties of this layer to another symbol layer.

copyPaintEffect

Copies paint effect of this layer to another symbol layer

create

Creates a new QgsRasterLineSymbolLayer, using the settings serialized in the properties map (corresponding to the output from QgsRasterLineSymbolLayer.properties() ).

estimateMaxBleed

param context:

installMasks

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

layerType

rtype:

str

mapUnitScale

rtype:

QgsMapUnitScale

opacity

Returns the line opacity.

outputUnit

rtype:

Qgis.RenderUnit

path

Returns the raster image path.

properties

rtype:

Dict[str, Any]

removeMasks

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

renderPolyline

param points:

renderPolylineUsingBrush

Renders a polyline of points using the specified brush.

resolvePaths

Turns relative paths in properties map to absolute when reading and vice versa when writing.

restoreOldDataDefinedProperties

Restores older data defined properties from string map.

setMapUnitScale

param scale:

setOpacity

Set the line opacity.

setOutputUnit

param unit:

setPath

Set the raster image path.

shouldRenderUsingSelectionColor

Returns True if the symbol layer should be rendered using the selection color from the render context.

startRender

param context:

stopRender

param context:

usesMapUnits

rtype:

bool

clone(self) QgsRasterLineSymbolLayer
Return type:

QgsRasterLineSymbolLayer

color(self) QColor
Return type:

QColor

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

create(properties: Dict[str, Any] = {}) QgsSymbolLayer

Creates a new QgsRasterLineSymbolLayer, using the settings serialized in the properties map (corresponding to the output from QgsRasterLineSymbolLayer.properties() ).

Parameters:

properties (Dict[str) –

Return type:

QgsSymbolLayer

estimateMaxBleed(self, context: QgsRenderContext) float
Parameters:

context (QgsRenderContext) –

Return type:

float

installMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

See also

prepareMasks()

See also

removeMasks()

New in version 3.30.

layerType(self) str
Return type:

str

mapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

opacity(self) float

Returns the line opacity.

Return type:

float

Returns:

opacity value between 0 (fully transparent) and 1 (fully opaque)

See also

setOpacity()

outputUnit(self) Qgis.RenderUnit
Return type:

Qgis.RenderUnit

path(self) str

Returns the raster image path.

See also

setPath()

Return type:

str

properties(self) Dict[str, Any]
Return type:

Dict[str, Any]

removeMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

See also

prepareMasks()

See also

installMasks()

New in version 3.30.

renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters:
renderPolylineUsingBrush(self, points: QPolygonF, context: QgsSymbolRenderContext, brush: QBrush | QColor | Qt.GlobalColor | QGradient, patternThickness: float, patternLength: float)

Renders a polyline of points using the specified brush.

resolvePaths(properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)

Turns relative paths in properties map to absolute when reading and vice versa when writing. Used internally when reading/writing symbols.

Parameters:
  • properties (Dict[str) –

  • pathResolver (QgsPathResolver) –

  • saving (bool) –

restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])

Restores older data defined properties from string map.

setMapUnitScale(self, scale: QgsMapUnitScale)
Parameters:

scale (QgsMapUnitScale) –

setOpacity(self, opacity: float)

Set the line opacity.

Parameters:

opacity (float) – opacity value between 0 (fully transparent) and 1 (fully opaque)

See also

opacity()

setOutputUnit(self, unit: Qgis.RenderUnit)
Parameters:

unit (Qgis.RenderUnit) –

setPath(self, path: str)

Set the raster image path.

See also

path()

Parameters:

path (str) –

shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool

Returns True if the symbol layer should be rendered using the selection color from the render context.

New in version 3.34.

startRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext) –

stopRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext) –

usesMapUnits(self) bool
Return type:

bool