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

rtype

QRectF

clone

rtype

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

param properties

createFromSld

param element

distanceMapUnitScale

rtype

QgsMapUnitScale

distanceUnit

Returns the units for the distance.

drawPreviewIcon

param context

hasDataDefinedProperties

rtype

bool

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

QgsUnitTypes.RenderUnit

properties

rtype

Dict[str, str]

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

startRender

param context

stopRender

param context

subSymbol

rtype

QgsSymbol

toSld

param doc

usedAttributes

param context

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, Union[QPointF, QPoint], QgsSymbolRenderContext) → QRectF
Return type

QRectF

clone(self)QgsVectorFieldSymbolLayer
Return type

QgsVectorFieldSymbolLayer

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, str] = {})QgsSymbolLayer
Parameters

properties (Dict[str) –

Return type

QgsSymbolLayer

createFromSld(element: QDomElement)QgsSymbolLayer
Parameters

element (QDomElement) –

Return type

QgsSymbolLayer

distanceMapUnitScale(self)QgsMapUnitScale
Return type

QgsMapUnitScale

distanceUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the distance.

Return type

QgsUnitTypes.RenderUnit

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

bool

layerType(self) → str
Return type

str

mapUnitScale(self)QgsMapUnitScale
Return type

QgsMapUnitScale

markerOffset(self, context: QgsSymbolRenderContext) → Tuple[float, 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

  • 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: QgsUnitTypes.RenderUnit, heightUnit: QgsUnitTypes.RenderUnit, widthMapUnitScale: QgsMapUnitScale, heightMapUnitScale: QgsMapUnitScale) → Tuple[float, float]

Note

available in Python bindings as markerOffset2

markerOffsetWithWidthAndHeight(self, context: QgsSymbolRenderContext, width: float, height: float) → Tuple[float, 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) → QgsUnitTypes.RenderUnit
Return type

QgsUnitTypes.RenderUnit

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

Dict[str, str]

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

Restores older data defined properties from string map.

New in version 3.0.

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: Union[QColor, Qt.GlobalColor])
Parameters

color (Union[QColor) –

setDistanceMapUnitScale(self, scale: QgsMapUnitScale)
Parameters

scale (QgsMapUnitScale) –

setDistanceUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the units for the distance.

Parameters

unit (QgsUnitTypes.RenderUnit) – distance units

See also

distanceUnit()

setMapUnitScale(self, scale: QgsMapUnitScale)
Parameters

scale (QgsMapUnitScale) –

setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)
Parameters

unit (QgsUnitTypes.RenderUnit) –

setScale(self, s: float)
Parameters

s (float) –

setSubSymbol(self, symbol: QgsSymbol) → bool
Parameters

symbol (QgsSymbol) –

Return type

bool

setVectorFieldType(self, type: QgsVectorFieldSymbolLayer.VectorFieldType)
Parameters

type (QgsVectorFieldSymbolLayer.VectorFieldType) –

setXAttribute(self, attribute: str)
Parameters

attribute (str) –

setYAttribute(self, attribute: str)
Parameters

attribute (str) –

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]

vectorFieldType(self) → QgsVectorFieldSymbolLayer.VectorFieldType
Return type

QgsVectorFieldSymbolLayer.VectorFieldType

xAttribute(self) → str
Return type

str

yAttribute(self) → str
Return type

str