Subgroup: Simple

Class: QgsSimpleMarkerSymbolLayer

class qgis.core.QgsSimpleMarkerSymbolLayer

Bases: qgis._core.QgsSimpleMarkerSymbolLayerBase

Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.

Methods

angle Returns the rotation angle for the marker, in degrees clockwise from north.
availableShapes Returns a list of all available shape types.
bounds
calculateOffsetAndRotation
calculateSize
clone
color
copyDataDefinedProperties
copyPaintEffect
create Creates a new QgsSimpleMarkerSymbolLayer.
createFromSld Creates a new QgsSimpleMarkerSymbolLayer from an SLD XML element.
dataDefinedProperties Returns a reference to the symbol layer’s property collection, used for data defined overrides.
decodeShape Attempts to decode a string representation of a shape name to the corresponding shape.
draw
drawMarker Draws the marker shape in the specified painter.
drawPreviewIcon
dxfAngle get angle
dxfBrushColor get brush/fill color
dxfBrushStyle get brush/fill style
dxfColor get color
dxfCustomDashPattern get dash pattern
dxfOffset get offset
dxfPenStyle get pen style
dxfWidth get line width
enabled Returns true if symbol layer is enabled and will be drawn.
encodeShape Encodes a shape to its string representation.
estimateMaxBleed Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context.
fillColor
horizontalAnchorPoint Returns the horizontal anchor point for positioning the symbol.
isCompatibleWithSymbol Returns if the layer can be used below the specified symbol
isLocked
layerType
mapUnitScale
markerOffset
markerOffset2
markerOffsetWithWidthAndHeight
offset Returns the marker’s offset, which is the horizontal and vertical displacement which the rendered marker will have from the original feature’s geometry.
offsetMapUnitScale Returns the map unit scale for the symbol’s offset.
offsetUnit Returns the units for the symbol’s offset.
ogrFeatureStyle
outputUnit
paintEffect Returns the current paint effect for the layer.
penJoinStyle Returns the marker’s stroke join style (e.g., miter, bevel, etc).
prepareCache Prepares cache image
prepareExpressions Prepares all data defined property expressions for evaluation.
prepareMarkerPath
prepareMarkerShape
properties
propertyDefinitions Returns the symbol layer property definitions.
renderPoint
renderingPass
restoreOldDataDefinedProperties
scaleMethod Returns the method to use for scaling the marker’s size.
setAngle Sets the rotation angle for the marker.
setColor
setDataDefinedProperties Sets the symbol layer’s property collection, used for data defined overrides.
setDataDefinedProperty Sets a data defined property for the layer.
setEnabled Sets whether symbol layer is enabled and should be drawn.
setFillColor
setHorizontalAnchorPoint Sets the horizontal anchor point for positioning the symbol.
setLineAngle Sets the line angle modification for the symbol’s angle.
setLocked
setMapUnitScale
setOffset Sets the marker’s offset, which is the horizontal and vertical displacement which the rendered marker should have from the original feature’s geometry.
setOffsetMapUnitScale Sets the map unit scale for the symbol’s offset.
setOffsetUnit Sets the units for the symbol’s offset.
setOutputUnit
setPaintEffect Sets the current paint effect for the layer.
setPenJoinStyle Sets the marker’s stroke join style (e.g., miter, bevel, etc).
setRenderingPass
setScaleMethod Sets the method to use for scaling the marker’s size.
setShape Sets the rendered marker shape.
setSize Sets the symbol size.
setSizeMapUnitScale Sets the map unit scale for the symbol’s size.
setSizeUnit Sets the units for the symbol’s size.
setStrokeColor Sets the marker’s stroke color.
setStrokeStyle Sets the marker’s stroke style (e.g., solid, dashed, etc)
setStrokeWidth Sets the width of the marker’s stroke.
setStrokeWidthMapUnitScale Sets the map scale for the width of the marker’s stroke.
setStrokeWidthUnit Sets the unit for the width of the marker’s stroke.
setSubSymbol set layer’s subsymbol. takes ownership of the passed symbol
setVerticalAnchorPoint Sets the vertical anchor point for positioning the symbol.
shape Returns the shape for the rendered marker symbol.
shapeIsFilled Returns true if a symbol shape has a fill.
shapeToPolygon
size Returns the symbol size.
sizeMapUnitScale Returns the map unit scale for the symbol’s size.
sizeUnit Returns the units for the symbol’s size.
startRender
stopRender
strokeColor Returns the marker’s stroke color.
strokeStyle Returns the marker’s stroke style (e.g., solid, dashed, etc)
strokeWidth Returns the width of the marker’s stroke.
strokeWidthMapUnitScale Returns the map scale for the width of the marker’s stroke.
strokeWidthUnit Returns the unit for the width of the marker’s stroke.
subSymbol Returns the symbol’s sub symbol, if present.
toSld
type
usedAttributes Returns the set of attributes referenced by the layer.
verticalAnchorPoint Returns the vertical anchor point for positioning the symbol.
writeDxf
writeSldMarker

Attributes

Arrow
ArrowHead
ArrowHeadFilled
Bottom
Circle
Cross
Cross2
CrossFill
DiagonalHalfSquare
Diamond
EquilateralTriangle
HCenter
HalfSquare
Hexagon
Left
LeftHalfTriangle
Line
Pentagon
PropertyAngle
PropertyArrowHeadLength
PropertyArrowHeadThickness
PropertyArrowHeadType
PropertyArrowStartWidth
PropertyArrowType
PropertyArrowWidth
PropertyBlurRadius
PropertyCapStyle
PropertyCharacter
PropertyCoordinateMode
PropertyCustomDash
PropertyDisplacementX
PropertyDisplacementY
PropertyDistanceX
PropertyDistanceY
PropertyFile
PropertyFillColor
PropertyFillStyle
PropertyGradientReference1IsCentroid
PropertyGradientReference1X
PropertyGradientReference1Y
PropertyGradientReference2IsCentroid
PropertyGradientReference2X
PropertyGradientReference2Y
PropertyGradientSpread
PropertyGradientType
PropertyHeight
PropertyHorizontalAnchor
PropertyInterval
PropertyJoinStyle
PropertyLayerEnabled
PropertyLineAngle
PropertyLineDistance
PropertyName
PropertyOffset
PropertyOffsetAlongLine
PropertyOpacity
PropertyPlacement
PropertyPreserveAspectRatio
PropertySecondaryColor
PropertyShapeburstIgnoreRings
PropertyShapeburstMaxDistance
PropertyShapeburstUseWholeShape
PropertySize
PropertyStrokeColor
PropertyStrokeStyle
PropertyStrokeWidth
PropertyVerticalAnchor
PropertyWidth
QuarterCircle
QuarterSquare
Right
RightHalfTriangle
SemiCircle
Square
Star
ThirdCircle
Top
Triangle
VCenter
bounds(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) → QRectF
calculateOffsetAndRotation()
calculateSize()
clone(self) → QgsSimpleMarkerSymbolLayer
color(self) → QColor
copyDataDefinedProperties()
copyPaintEffect()
create(properties: Dict[str, str] = {}) → QgsSymbolLayer

Creates a new QgsSimpleMarkerSymbolLayer.

Parameters:properties – a property map containing symbol properties (see properties())
Returns:new QgsSimpleMarkerSymbolLayer
createFromSld(element: QDomElement) → QgsSymbolLayer

Creates a new QgsSimpleMarkerSymbolLayer from an SLD XML element.

Parameters:element – XML element containing SLD definition of symbol
Returns:new QgsSimpleMarkerSymbolLayer
draw()
drawMarker(self, p: QPainter, context: QgsSymbolRenderContext)

Draws the marker shape in the specified painter.

Parameters:
  • p – destination QPainter
  • context – symbol context

Note

this method does not handle setting the painter pen or brush to match the symbol’s fill or stroke

fillColor(self) → QColor
layerType(self) → str
mapUnitScale(self) → QgsMapUnitScale
markerOffset()
markerOffset2()
markerOffsetWithWidthAndHeight()
ogrFeatureStyle(self, mmScaleFactor: float, mapUnitScaleFactor: float) → str
outputUnit(self) → QgsUnitTypes.RenderUnit
penJoinStyle(self) → Qt.PenJoinStyle

Returns the marker’s stroke join style (e.g., miter, bevel, etc).

New in version 2.16.

See also

strokeColor()

See also

strokeStyle()

prepareCache(self, context: QgsSymbolRenderContext) → bool

Prepares cache image

Returns:true in case of success, false if cache image size too large
prepareMarkerPath()
prepareMarkerShape()
properties(self) → Dict[str, str]
renderPoint(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)
restoreOldDataDefinedProperties()
setColor(self, color: Union[QColor, Qt.GlobalColor])
setFillColor(self, color: Union[QColor, Qt.GlobalColor])
setMapUnitScale(self, scale: QgsMapUnitScale)
setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)
setPenJoinStyle(self, style: Qt.PenJoinStyle)

Sets the marker’s stroke join style (e.g., miter, bevel, etc).

Parameters:style – join style

New in version 2.16.

See also

penJoinStyle()

See also

setStrokeColor()

See also

setStrokeStyle()

setStrokeColor(self, color: Union[QColor, Qt.GlobalColor])

Sets the marker’s stroke color.

Parameters:color – stroke color

See also

strokeColor()

See also

setStrokeStyle()

setStrokeStyle(self, strokeStyle: Qt.PenStyle)

Sets the marker’s stroke style (e.g., solid, dashed, etc)

Parameters:strokeStyle – style

New in version 2.4.

See also

strokeStyle()

See also

setStrokeColor()

setStrokeWidth(self, w: float)

Sets the width of the marker’s stroke.

Parameters:w – stroke width. See strokeWidthUnit() for units.

See also

strokeWidth()

setStrokeWidthMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map scale for the width of the marker’s stroke.

Parameters:scale – stroke width map unit scale

See also

setStrokeWidth()

setStrokeWidthUnit(self, u: QgsUnitTypes.RenderUnit)

Sets the unit for the width of the marker’s stroke.

Parameters:u – stroke width unit

See also

setStrokeWidth()

shapeToPolygon()
startRender(self, context: QgsSymbolRenderContext)
strokeColor(self) → QColor

Returns the marker’s stroke color.

See also

setStrokeColor()

See also

strokeStyle()

See also

penJoinStyle()

strokeStyle(self) → Qt.PenStyle

Returns the marker’s stroke style (e.g., solid, dashed, etc)

New in version 2.4.

See also

setStrokeStyle()

See also

strokeColor()

See also

penJoinStyle()

strokeWidth(self) → float

Returns the width of the marker’s stroke.

See also

setStrokeWidth()

strokeWidthMapUnitScale(self) → QgsMapUnitScale

Returns the map scale for the width of the marker’s stroke.

See also

strokeWidth()

strokeWidthUnit(self) → QgsUnitTypes.RenderUnit

Returns the unit for the width of the marker’s stroke.

See also

strokeWidth()

writeDxf(self, e: QgsDxfExport, mmMapUnitScaleFactor: float, layerName: str, context: QgsSymbolRenderContext, shift: Union[QPointF, QPoint] = QPointF(0, 0)) → bool
writeSldMarker(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])