Class: QgsEllipseSymbolLayer¶
- class qgis.core.QgsEllipseSymbolLayer¶
Bases:
QgsMarkerSymbolLayer
A symbol layer for rendering objects with major and minor axis (e.g. ellipse, rectangle, etc).
Methods
Returns a list of all available shape types.
- param point
- rtype
QgsEllipseSymbolLayer
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
Attempts to decode a string representation of a shape name to the corresponding shape.
Encodes a shape to its string representation.
- rtype
QColor
- 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
QgsUnitTypes.RenderUnit
Returns the marker's stroke cap style (e.g., flat, round, etc).
Gets stroke join style.
- rtype
Dict[str, Any]
- param point
Restores older data defined properties from string map.
- param c
- param scale
- param unit
Sets the marker's stroke cap
style
(e.g., flat, round, etc).Set stroke join style.
Sets the rendered ellipse marker shape.
- param size
- param c
- param strokeStyle
- param w
- param scale
Sets the units for the symbol's stroke width.
- param h
- param scale
Sets the units for the symbol's height.
Sets the rendered ellipse marker shape using a symbol
name
.- param w
- param scale
Sets the units for the symbol's width.
Returns the shape for the rendered ellipse marker symbol.
Returns
True
if ashape
has a fill.- param context
- param context
- rtype
QColor
- rtype
Qt.PenStyle
- rtype
float
- rtype
QgsMapUnitScale
Returns the units for the symbol's stroke width.
- rtype
float
- rtype
QgsMapUnitScale
Returns the units for the symbol's height.
Returns the shape name for the rendered ellipse marker symbol.
- rtype
float
- rtype
QgsMapUnitScale
Returns the units for the symbol's width.
- param doc
- rtype
bool
- param e
- param doc
Attributes
- Arrow = 4¶
- Circle = 0¶
- Cross = 3¶
- Diamond = 2¶
- HalfArc = 5¶
- LeftHalfTriangle = 8¶
- Rectangle = 1¶
- RightHalfTriangle = 7¶
- SemiCircle = 9¶
- class Shape¶
Bases:
int
- Triangle = 6¶
- availableShapes() List[QgsEllipseSymbolLayer.Shape] ¶
Returns a list of all available shape types.
- Return type
- bounds(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) QRectF ¶
- Parameters
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- Return type
QRectF
- clone(self) QgsEllipseSymbolLayer ¶
- Return type
- 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 the symbol layer
- Parameters
properties (Dict[str) –
- Return type
- createFromSld(element: QDomElement) QgsSymbolLayer ¶
- Parameters
element (QDomElement) –
- Return type
- decodeShape(name: str) Tuple[QgsEllipseSymbolLayer.Shape, bool] ¶
Attempts to decode a string representation of a shape name to the corresponding shape.
- Parameters
name (str) – encoded shape name
ok – if specified, will be set to
True
if shape was successfully decoded
- Return type
Tuple[QgsEllipseSymbolLayer.Shape, bool]
- Returns
decoded name
See also
New in version 3.20.
- encodeShape(shape: QgsEllipseSymbolLayer.Shape) str ¶
Encodes a shape to its string representation.
- Parameters
shape (QgsEllipseSymbolLayer.Shape) – shape to encode
- Return type
str
- Returns
encoded string
See also
New in version 3.20.
- fillColor(self) QColor ¶
- Return type
QColor
- 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: 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
- penCapStyle(self) Qt.PenCapStyle ¶
Returns the marker’s stroke cap style (e.g., flat, round, etc).
See also
See also
See also
See also
New in version 3.20.
- Return type
Qt.PenCapStyle
- penJoinStyle(self) Qt.PenJoinStyle ¶
Gets stroke join style.
New in version 2.16.
- Return type
Qt.PenJoinStyle
- properties(self) Dict[str, Any] ¶
- Return type
Dict[str, Any]
- renderPoint(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)¶
- Parameters
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])¶
Restores older data defined properties from string map.
New in version 3.0.
- setFillColor(self, c: Union[QColor, Qt.GlobalColor, QGradient])¶
- Parameters
c (Union[QColor) –
- setMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters
scale (QgsMapUnitScale) –
- setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)¶
- Parameters
unit (QgsUnitTypes.RenderUnit) –
- setPenCapStyle(self, style: Qt.PenCapStyle)¶
Sets the marker’s stroke cap
style
(e.g., flat, round, etc).See also
See also
See also
See also
New in version 3.20.
- Parameters
style (Qt.PenCapStyle) –
- setPenJoinStyle(self, style: Qt.PenJoinStyle)¶
Set stroke join style.
New in version 2.16.
- Parameters
style (Qt.PenJoinStyle) –
- setShape(self, shape: QgsEllipseSymbolLayer.Shape)¶
Sets the rendered ellipse marker shape.
- Parameters
shape (QgsEllipseSymbolLayer.Shape) – new ellipse marker shape
See also
New in version 3.20.
- setSize(self, size: float)¶
- Parameters
size (float) –
- setStrokeColor(self, c: Union[QColor, Qt.GlobalColor, QGradient])¶
- Parameters
c (Union[QColor) –
- setStrokeStyle(self, strokeStyle: Qt.PenStyle)¶
- Parameters
strokeStyle (Qt.PenStyle) –
- setStrokeWidth(self, w: float)¶
- Parameters
w (float) –
- setStrokeWidthMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters
scale (QgsMapUnitScale) –
- setStrokeWidthUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the units for the symbol’s stroke width.
- Parameters
unit (QgsUnitTypes.RenderUnit) – symbol units
See also
- setSymbolHeight(self, h: float)¶
- Parameters
h (float) –
- setSymbolHeightMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters
scale (QgsMapUnitScale) –
- setSymbolHeightUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the units for the symbol’s height.
- Parameters
unit (QgsUnitTypes.RenderUnit) – symbol units
See also
See also
- setSymbolName(self, name: str)¶
Sets the rendered ellipse marker shape using a symbol
name
.See also
See also
Deprecated since version QGIS: 3.20
- Parameters
name (str) –
- setSymbolWidth(self, w: float)¶
- Parameters
w (float) –
- setSymbolWidthMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters
scale (QgsMapUnitScale) –
- setSymbolWidthUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the units for the symbol’s width.
- Parameters
unit (QgsUnitTypes.RenderUnit) – symbol units
See also
See also
- shape(self) QgsEllipseSymbolLayer.Shape ¶
Returns the shape for the rendered ellipse marker symbol.
See also
New in version 3.20.
- Return type
- shapeIsFilled(shape: QgsEllipseSymbolLayer.Shape) bool ¶
Returns
True
if ashape
has a fill.- Return type
bool
- Returns
True
if shape uses a fill, orFalse
if shape uses lines only
New in version 3.20.
- Parameters
shape (QgsEllipseSymbolLayer.Shape) –
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters
context (QgsSymbolRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters
context (QgsSymbolRenderContext) –
- strokeColor(self) QColor ¶
- Return type
QColor
- strokeStyle(self) Qt.PenStyle ¶
- Return type
Qt.PenStyle
- strokeWidth(self) float ¶
- Return type
float
- strokeWidthMapUnitScale(self) QgsMapUnitScale ¶
- Return type
- strokeWidthUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the units for the symbol’s stroke width.
See also
- Return type
- symbolHeight(self) float ¶
- Return type
float
- symbolHeightMapUnitScale(self) QgsMapUnitScale ¶
- Return type
- symbolHeightUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the units for the symbol’s height.
See also
See also
- Return type
- symbolName(self) str ¶
Returns the shape name for the rendered ellipse marker symbol.
See also
See also
Deprecated since version QGIS: 3.20
- Return type
str
- symbolWidth(self) float ¶
- Return type
float
- symbolWidthMapUnitScale(self) QgsMapUnitScale ¶
- Return type
- symbolWidthUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the units for the symbol’s width.
See also
See also
- Return type
- toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any])¶
- Parameters
doc (QDomDocument) –
element (QDomElement) –
props (Dict[str) –
- usesMapUnits(self) bool ¶
- Return type
bool
- writeDxf(self, e: QgsDxfExport, mmMapUnitScaleFactor: float, layerName: str, context: QgsSymbolRenderContext, shift: Union[QPointF, QPoint] = QPointF(0, 0)) bool ¶
- Parameters
e (QgsDxfExport) –
mmMapUnitScaleFactor (float) –
layerName (str) –
context (QgsSymbolRenderContext) –
shift (Union[QPointF) –
- Return type
bool
- writeSldMarker(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any])¶
- Parameters
doc (QDomDocument) –
element (QDomElement) –
props (Dict[str) –