Class: QgsVectorFieldSymbolLayer¶
- class qgis.core.QgsVectorFieldSymbolLayer¶
Bases:
QgsMarkerSymbolLayer
A symbol layer class for displaying displacement arrows based on point layer attributes.
Methods
- rtype:
QgsVectorFieldSymbolLayer.AngleOrientation
- rtype:
QgsVectorFieldSymbolLayer.AngleUnits
- rtype:
QRectF
- rtype:
QgsVectorFieldSymbolLayer
- rtype:
QColor
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Creates the symbol layer
- param element:
- rtype:
QgsMapUnitScale
Returns the units for the distance.
- param context:
- rtype:
bool
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layers- rtype:
str
- rtype:
QgsMapUnitScale
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.
- rtype:
Qgis.RenderUnit
- rtype:
Dict[str, Any]
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layers- param point:
Restores older data defined properties from string map.
- rtype:
float
- param orientation:
- param units:
- param color:
- param scale:
Sets the units for the distance.
- param scale:
- param unit:
- param s:
- param symbol:
- param type:
- param attribute:
- param attribute:
Returns
True
if the symbol layer should be rendered using the selection color from the render context.- param context:
- param context:
- rtype:
QgsSymbol
- param doc:
- param context:
- rtype:
bool
- rtype:
QgsVectorFieldSymbolLayer.VectorFieldType
- rtype:
str
- rtype:
str
Attributes
- 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:
- angleUnits(self) QgsVectorFieldSymbolLayer.AngleUnits ¶
- Return type:
- bounds(self, Union[QPointF, QPoint], QgsSymbolRenderContext) QRectF ¶
- Return type:
QRectF
- clone(self) QgsVectorFieldSymbolLayer ¶
- Return type:
- 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 the symbol layer
- Parameters:
properties (Dict[str) –
- Return type:
- createFromSld(element: QDomElement) QgsSymbolLayer ¶
- Parameters:
element (QDomElement) –
- Return type:
- distanceMapUnitScale(self) QgsMapUnitScale ¶
- Return type:
- distanceUnit(self) Qgis.RenderUnit ¶
Returns the units for the distance.
See also
- Return type:
- drawPreviewIcon(self, context: QgsSymbolRenderContext, size: QSize)¶
- Parameters:
context (QgsSymbolRenderContext) –
size (QSize) –
- hasDataDefinedProperties(self) bool ¶
- Return type:
bool
- installMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- layerType(self) str ¶
- Return type:
str
- mapUnitScale(self) QgsMapUnitScale ¶
- Return type:
- 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: Qgis.RenderUnit, heightUnit: Qgis.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) Qgis.RenderUnit ¶
- Return type:
- 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 ifrecursive
isTrue
masks are removed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- renderPoint(self, point: QPointF | QPoint, context: QgsSymbolRenderContext)¶
- Parameters:
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- 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
- setMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters:
scale (QgsMapUnitScale) –
- setOutputUnit(self, unit: Qgis.RenderUnit)¶
- Parameters:
unit (Qgis.RenderUnit) –
- setScale(self, s: float)¶
- Parameters:
s (float) –
- setVectorFieldType(self, type: QgsVectorFieldSymbolLayer.VectorFieldType)¶
- Parameters:
- setXAttribute(self, attribute: str)¶
- Parameters:
attribute (str) –
- setYAttribute(self, attribute: str)¶
- Parameters:
attribute (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) –
- 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:
- xAttribute(self) str ¶
- Return type:
str
- yAttribute(self) str ¶
- Return type:
str