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

layerType

rtype

str

mapUnitScale

rtype

QgsMapUnitScale

opacity

Returns the line opacity.

outputUnit

rtype

QgsUnitTypes.RenderUnit

path

Returns the raster image path.

properties

rtype

Dict[str, Any]

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.

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

New in version 2.9.

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

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) QgsUnitTypes.RenderUnit
Return type

QgsUnitTypes.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]

renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters
renderPolylineUsingBrush(self, points: QPolygonF, context: QgsSymbolRenderContext, brush: Union[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.

New in version 3.0.

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: QgsUnitTypes.RenderUnit)
Parameters

unit (QgsUnitTypes.RenderUnit) –

setPath(self, path: str)

Set the raster image path.

See also

path()

Parameters

path (str) –

startRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

stopRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

usesMapUnits(self) bool
Return type

bool