Class: QgsHashedLineSymbolLayer

Line symbol layer type which draws repeating line sections along a line feature.

Added in version 3.8.

Class Hierarchy

Inheritance diagram of qgis.core.QgsHashedLineSymbolLayer

Base classes

QgsTemplatedLineSymbolLayerBase

Base class for templated line symbols, e.g. line symbols which draw markers or hash lines at intervals along the line feature.

QgsLineSymbolLayer

Abstract base class for line symbol layers.

QgsSymbolLayer

Abstract base class for symbol layers.

Methods

hashAngle

Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.

hashLength

Returns the length of hash symbols.

hashLengthMapUnitScale

Returns the map unit scale for the hash length.

hashLengthUnit

Returns the units for the length of hash symbols.

setHashAngle

Sets the angle to use when drawing the hashed lines sections, in degrees clockwise.

setHashLength

Sets the length of hash symbols.

setHashLengthMapUnitScale

Sets the map unit scale for the hash length.

setHashLengthUnit

Sets the unit for the length of hash symbols.

Static Methods

create

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

class qgis.core.QgsHashedLineSymbolLayer[source]

Bases: QgsTemplatedLineSymbolLayerBase

__init__(rotateSymbol: bool = True, interval: float = 3)

Constructor for QgsHashedLineSymbolLayer. Creates a line with a default hash symbol, placed at the specified interval (in millimeters).

The rotateSymbol argument specifies whether individual hash symbols should be rotated to match the line segment alignment.

Parameters:
  • rotateSymbol (bool = True)

  • interval (float = 3)

static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None[source]

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

Parameters:

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

Return type:

Optional[QgsSymbolLayer]

hashAngle(self) float[source]

Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.

See also

setHashAngle()

Return type:

float

hashLength(self) float[source]

Returns the length of hash symbols. Units are specified through hashLengthUnits().

See also

setHashLength()

See also

hashLengthUnit()

Return type:

float

hashLengthMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the hash length.

See also

hashLengthUnit()

See also

hashLength()

Return type:

QgsMapUnitScale

hashLengthUnit(self) Qgis.RenderUnit[source]

Returns the units for the length of hash symbols.

See also

hashLength()

Return type:

Qgis.RenderUnit

setHashAngle(self, angle: float)[source]

Sets the angle to use when drawing the hashed lines sections, in degrees clockwise.

See also

hashAngle()

Parameters:

angle (float)

setHashLength(self, length: float)[source]

Sets the length of hash symbols. Units are specified through setHashLengthUnit()

See also

hashLength()

Parameters:

length (float)

setHashLengthMapUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the map unit scale for the hash length.

See also

setHashLength()

Parameters:

scale (QgsMapUnitScale)

setHashLengthUnit(self, unit: Qgis.RenderUnit)[source]

Sets the unit for the length of hash symbols.

See also

hashLengthUnit()

See also

setHashLength()

Parameters:

unit (Qgis.RenderUnit)