Class: QgsEllipseSymbolLayer

A symbol layer for rendering objects with major and minor axis (e.g. ellipse, rectangle, etc).

Class Hierarchy

Inheritance diagram of qgis.core.QgsEllipseSymbolLayer

Base classes

QgsMarkerSymbolLayer

Abstract base class for marker symbol layers.

QgsSymbolLayer

Abstract base class for symbol layers.

Methods

penCapStyle

Returns the marker's stroke cap style (e.g., flat, round, etc).

penJoinStyle

Gets stroke join style.

setPenCapStyle

Sets the marker's stroke cap style (e.g., flat, round, etc).

setPenJoinStyle

Set stroke join style.

setShape

Sets the rendered ellipse marker shape.

setStrokeStyle

setStrokeWidth

setStrokeWidthMapUnitScale

setStrokeWidthUnit

Sets the units for the symbol's stroke width.

setSymbolHeight

setSymbolHeightMapUnitScale

setSymbolHeightUnit

Sets the units for the symbol's height.

setSymbolName

Sets the rendered ellipse marker shape using a symbol name.

setSymbolWidth

setSymbolWidthMapUnitScale

setSymbolWidthUnit

Sets the units for the symbol's width.

shape

Returns the shape for the rendered ellipse marker symbol.

strokeStyle

strokeWidth

strokeWidthMapUnitScale

strokeWidthUnit

Returns the units for the symbol's stroke width.

symbolHeight

symbolHeightMapUnitScale

symbolHeightUnit

Returns the units for the symbol's height.

symbolName

Returns the shape name for the rendered ellipse marker symbol.

symbolWidth

symbolWidthMapUnitScale

symbolWidthUnit

Returns the units for the symbol's width.

Static Methods

availableShapes

Returns a list of all available shape types.

create

Creates the symbol layer

createFromSld

decodeShape

Attempts to decode a string representation of a shape name to the corresponding shape.

encodeShape

Encodes a shape to its string representation.

shapeIsFilled

Returns True if a shape has a fill.

Attributes

Arrow

Circle

Cross

Diamond

HalfArc

Hexagon

LeftHalfTriangle

Octagon

Pentagon

QuarterCircle

Rectangle

RightHalfTriangle

SemiCircle

Star

ThirdCircle

Triangle

class qgis.core.QgsEllipseSymbolLayer[source]

Bases: QgsMarkerSymbolLayer

Arrow = 4
Circle = 0
Cross = 3
Diamond = 2
HalfArc = 5
Hexagon = 13
LeftHalfTriangle = 8
Octagon = 14
Pentagon = 12
QuarterCircle = 11
Rectangle = 1
RightHalfTriangle = 7
SemiCircle = 9
class Shape

Bases: int

Star = 15
ThirdCircle = 10
Triangle = 6
static availableShapes() List[QgsEllipseSymbolLayer.Shape]

Returns a list of all available shape types.

Return type:

List[QgsEllipseSymbolLayer.Shape]

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

Creates the symbol layer

Parameters:

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

Return type:

Optional[QgsSymbolLayer]

static createFromSld(element: QDomElement) QgsSymbolLayer | None[source]
Parameters:

element (QDomElement)

Return type:

Optional[QgsSymbolLayer]

static decodeShape(name: str | None)[source]

Attempts to decode a string representation of a shape name to the corresponding shape.

Parameters:
  • name (Optional[str]) -> (QgsEllipseSymbolLayer.Shape) – encoded shape name

  • ok – if specified, will be set to True if shape was successfully decoded

Returns:

decoded name

See also

encodeShape()

Added in version 3.20.

static encodeShape(shape: QgsEllipseSymbolLayer.Shape) str[source]

Encodes a shape to its string representation.

Parameters:

shape (QgsEllipseSymbolLayer.Shape) – shape to encode

Return type:

str

Returns:

encoded string

See also

decodeShape()

Added in version 3.20.

penCapStyle(self) Qt.PenCapStyle[source]

Returns the marker’s stroke cap style (e.g., flat, round, etc).

See also

setPenCapStyle()

See also

penJoinStyle()

See also

strokeColor()

See also

strokeStyle()

Added in version 3.20.

Return type:

Qt.PenCapStyle

penJoinStyle(self) Qt.PenJoinStyle[source]

Gets stroke join style.

Return type:

Qt.PenJoinStyle

setPenCapStyle(self, style: Qt.PenCapStyle)[source]

Sets the marker’s stroke cap style (e.g., flat, round, etc).

See also

penCapStyle()

See also

penJoinStyle()

See also

setStrokeColor()

See also

setStrokeStyle()

Added in version 3.20.

Parameters:

style (Qt.PenCapStyle)

setPenJoinStyle(self, style: Qt.PenJoinStyle)[source]

Set stroke join style.

Parameters:

style (Qt.PenJoinStyle)

setShape(self, shape: QgsEllipseSymbolLayer.Shape)[source]

Sets the rendered ellipse marker shape.

Parameters:

shape (QgsEllipseSymbolLayer.Shape) – new ellipse marker shape

See also

shape()

Added in version 3.20.

setStrokeStyle(self, strokeStyle: Qt.PenStyle)[source]
Parameters:

strokeStyle (Qt.PenStyle)

setStrokeWidth(self, w: float)[source]
Parameters:

w (float)

setStrokeWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]
Parameters:

scale (QgsMapUnitScale)

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

Sets the units for the symbol’s stroke width.

Parameters:

unit (Qgis.RenderUnit) – symbol units

setSymbolHeight(self, h: float)[source]
Parameters:

h (float)

setSymbolHeightMapUnitScale(self, scale: QgsMapUnitScale)[source]
Parameters:

scale (QgsMapUnitScale)

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

Sets the units for the symbol’s height.

Parameters:

unit (Qgis.RenderUnit) – symbol units

setSymbolName(self, name: str | None)[source]

Sets the rendered ellipse marker shape using a symbol name.

See also

setShape()

See also

shape()

Deprecated since version 3.20.

Parameters:

name (Optional[str])

setSymbolWidth(self, w: float)[source]
Parameters:

w (float)

setSymbolWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]
Parameters:

scale (QgsMapUnitScale)

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

Sets the units for the symbol’s width.

Parameters:

unit (Qgis.RenderUnit) – symbol units

shape(self) QgsEllipseSymbolLayer.Shape[source]

Returns the shape for the rendered ellipse marker symbol.

See also

setShape()

Added in version 3.20.

Return type:

QgsEllipseSymbolLayer.Shape

static shapeIsFilled(shape: QgsEllipseSymbolLayer.Shape) bool[source]

Returns True if a shape has a fill.

Return type:

bool

Returns:

True if shape uses a fill, or False if shape uses lines only

Added in version 3.20.

Parameters:

shape (QgsEllipseSymbolLayer.Shape)

strokeStyle(self) Qt.PenStyle[source]
Return type:

Qt.PenStyle

strokeWidth(self) float[source]
Return type:

float

strokeWidthMapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

strokeWidthUnit(self) Qgis.RenderUnit[source]

Returns the units for the symbol’s stroke width.

Return type:

Qgis.RenderUnit

symbolHeight(self) float[source]
Return type:

float

symbolHeightMapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

symbolHeightUnit(self) Qgis.RenderUnit[source]

Returns the units for the symbol’s height.

Return type:

Qgis.RenderUnit

symbolName(self) str[source]

Returns the shape name for the rendered ellipse marker symbol.

See also

shape()

See also

setShape()

Deprecated since version 3.20.

Return type:

str

symbolWidth(self) float[source]
Return type:

float

symbolWidthMapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

symbolWidthUnit(self) Qgis.RenderUnit[source]

Returns the units for the symbol’s width.

Return type:

Qgis.RenderUnit