Class: QgsVectorFieldSymbolLayer

class qgis.core.QgsVectorFieldSymbolLayer

Bases: QgsMarkerSymbolLayer

A symbol layer class for displaying displacement arrows based on point layer attributes.

Methods

angleOrientation

rtype:

QgsVectorFieldSymbolLayer.AngleOrientation

angleUnits

rtype:

QgsVectorFieldSymbolLayer.AngleUnits

bounds

param a0:

clone

rtype:

Optional[QgsVectorFieldSymbolLayer]

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 the symbol layer

createFromSld

param element:

distanceMapUnitScale

rtype:

QgsMapUnitScale

distanceUnit

Returns the units for the distance.

drawPreviewIcon

param context:

hasDataDefinedProperties

rtype:

bool

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

markerOffset

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.

markerOffset2

markerOffsetWithWidthAndHeight

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.

outputUnit

rtype:

Qgis.RenderUnit

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

renderPoint

param point:

restoreOldDataDefinedProperties

Restores older data defined properties from string map.

scale

rtype:

float

setAngleOrientation

param orientation:

setAngleUnits

param units:

setColor

param color:

setDistanceMapUnitScale

param scale:

setDistanceUnit

Sets the units for the distance.

setMapUnitScale

param scale:

setOutputUnit

param unit:

setScale

param s:

setSubSymbol

param symbol:

setVectorFieldType

param type:

setXAttribute

param attribute:

setYAttribute

param attribute:

shouldRenderUsingSelectionColor

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

startRender

param context:

stopRender

param context:

subSymbol

rtype:

Optional[QgsSymbol]

toSld

param doc:

usedAttributes

param context:

usesMapUnits

rtype:

bool

vectorFieldType

rtype:

QgsVectorFieldSymbolLayer.VectorFieldType

xAttribute

rtype:

str

yAttribute

rtype:

str

Attributes

Cartesian

ClockwiseFromNorth

CounterclockwiseFromEast

Degrees

Height

Polar

Radians

class AngleOrientation

Bases: int

class AngleUnits

Bases: int

Cartesian = 0
ClockwiseFromNorth = 0
CounterclockwiseFromEast = 1
Degrees = 0
Height = 2
Polar = 1
Radians = 1
class VectorFieldType

Bases: int

angleOrientation(self) QgsVectorFieldSymbolLayer.AngleOrientation
Return type:

QgsVectorFieldSymbolLayer.AngleOrientation

angleUnits(self) QgsVectorFieldSymbolLayer.AngleUnits
Return type:

QgsVectorFieldSymbolLayer.AngleUnits

bounds(self, a0: QPointF | QPoint, a1: QgsSymbolRenderContext) QRectF
Parameters:
Return type:

QRectF

clone(self) QgsVectorFieldSymbolLayer | None
Return type:

Optional[QgsVectorFieldSymbolLayer]

color(self) QColor
Return type:

QColor

copyDataDefinedProperties(self, destLayer: QgsSymbolLayer | None)

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

Parameters:

destLayer – destination layer

copyPaintEffect(self, destLayer: QgsSymbolLayer | None)

Copies paint effect of this layer to another symbol layer

Parameters:

destLayer – destination layer

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

Creates the symbol layer

Parameters:

properties (Dict[str)

Return type:

Optional[QgsSymbolLayer]

createFromSld(element: QDomElement) QgsSymbolLayer | None
Parameters:

element (QDomElement)

Return type:

Optional[QgsSymbolLayer]

distanceMapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

distanceUnit(self) Qgis.RenderUnit

Returns the units for the distance.

Return type:

Qgis.RenderUnit

drawPreviewIcon(self, context: QgsSymbolRenderContext, size: QSize)
Parameters:
hasDataDefinedProperties(self) bool
Return type:

bool

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()

Added in version 3.30.

layerType(self) str
Return type:

str

mapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

markerOffset(self, context: QgsSymbolRenderContext)

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point.

Parameters:
  • context – symbol render context

  • offsetX – will be set to required horizontal offset (in painter units)

  • offsetY – will be set to required vertical offset (in painter units)

markerOffset2(self, context: QgsSymbolRenderContext, width: float, height: float, widthUnit: Qgis.RenderUnit, heightUnit: Qgis.RenderUnit, widthMapUnitScale: QgsMapUnitScale, heightMapUnitScale: QgsMapUnitScale)

Note

available in Python bindings as markerOffset2

markerOffsetWithWidthAndHeight(self, context: QgsSymbolRenderContext, width: float, height: float)

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point.

Parameters:
  • context – symbol render context

  • width – marker width

  • height – marker height

  • offsetX – will be set to required horizontal offset (in painter units)

  • offsetY – will be set to required vertical offset (in painter units)

Note

available in Python as markerOffsetWithWidthAndHeight

outputUnit(self) Qgis.RenderUnit
Return type:

Qgis.RenderUnit

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()

Added in version 3.30.

renderPoint(self, point: QPointF | QPoint, context: QgsSymbolRenderContext)
Parameters:
restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])

Restores older data defined properties from string map.

scale(self) float
Return type:

float

setAngleOrientation(self, orientation: QgsVectorFieldSymbolLayer.AngleOrientation)
Parameters:

orientation (QgsVectorFieldSymbolLayer.AngleOrientation)

setAngleUnits(self, units: QgsVectorFieldSymbolLayer.AngleUnits)
Parameters:

units (QgsVectorFieldSymbolLayer.AngleUnits)

setColor(self, color: QColor | Qt.GlobalColor)
Parameters:

color (Union[QColor)

setDistanceMapUnitScale(self, scale: QgsMapUnitScale)
Parameters:

scale (QgsMapUnitScale)

setDistanceUnit(self, unit: Qgis.RenderUnit)

Sets the units for the distance.

Parameters:

unit (Qgis.RenderUnit) – distance units

See also

distanceUnit()

setMapUnitScale(self, scale: QgsMapUnitScale)
Parameters:

scale (QgsMapUnitScale)

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

unit (Qgis.RenderUnit)

setScale(self, s: float)
Parameters:

s (float)

setSubSymbol(self, symbol: QgsSymbol | None) bool
Parameters:

symbol (Optional[QgsSymbol])

Return type:

bool

setVectorFieldType(self, type: QgsVectorFieldSymbolLayer.VectorFieldType)
Parameters:

type (QgsVectorFieldSymbolLayer.VectorFieldType)

setXAttribute(self, attribute: str | None)
Parameters:

attribute (Optional[str])

setYAttribute(self, attribute: str | None)
Parameters:

attribute (Optional[str])

shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool

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

Added in version 3.34.

startRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)

stopRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)

subSymbol(self) QgsSymbol | None
Return type:

Optional[QgsSymbol]

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

  • element (QDomElement)

  • props (Dict[str)

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

context (QgsRenderContext)

Return type:

Set[str]

usesMapUnits(self) bool
Return type:

bool

vectorFieldType(self) QgsVectorFieldSymbolLayer.VectorFieldType
Return type:

QgsVectorFieldSymbolLayer.VectorFieldType

xAttribute(self) str
Return type:

str

yAttribute(self) str
Return type:

str