Class: QgsPointClusterRenderer

class qgis.core.QgsPointClusterRenderer

Bases: QgsPointDistanceRenderer

A renderer that automatically clusters points with the same geographic position.

Methods

accept

param visitor

clone

rtype

QgsPointClusterRenderer

clusterSymbol

Returns the symbol used for rendering clustered groups (but not ownership of the symbol).

convertFromRenderer

Creates a QgsPointClusterRenderer from an existing renderer.

convertSymbolRotation

convertSymbolSizeScale

copyRendererData

Clones generic renderer data to another renderer.

create

Creates a renderer from XML element

drawGroup

drawLabels

renderFeatureWithSymbol

Render the feature with the symbol using context.

renderVertexMarker

render editing vertex marker at specified point

renderVertexMarkerPolygon

render editing vertex marker for a polygon

renderVertexMarkerPolyline

render editing vertex marker for a polyline

save

param doc

setClusterSymbol

Sets the symbol for rendering clustered groups.

startRender

param context

stopRender

param context

usedAttributes

param context

accept(self, visitor: QgsStyleEntityVisitorInterface)bool
Parameters

visitor (QgsStyleEntityVisitorInterface) –

Return type

bool

clone(self)QgsPointClusterRenderer
Return type

QgsPointClusterRenderer

clusterSymbol(self)QgsMarkerSymbol

Returns the symbol used for rendering clustered groups (but not ownership of the symbol).

Return type

QgsMarkerSymbol

convertFromRenderer(renderer: QgsFeatureRenderer)QgsPointClusterRenderer

Creates a QgsPointClusterRenderer from an existing renderer.

Return type

QgsPointClusterRenderer

Returns

a new renderer if the conversion was possible, otherwise None.

Parameters

renderer (QgsFeatureRenderer) –

convertSymbolRotation(symbol: QgsSymbol, field: str)

Note

this function is used to convert old rotations expressions to symbol level DataDefined angle

convertSymbolSizeScale(symbol: QgsSymbol, method: Qgis.ScaleMethod, field: str)

Note

this function is used to convert old sizeScale expressions to symbol level DataDefined size

copyRendererData(self, destRenderer: QgsFeatureRenderer)

Clones generic renderer data to another renderer. Currently clones

  • Order By

  • Paint Effect

Parameters

destRenderer – destination renderer for copied effect

create(symbologyElem: QDomElement, context: QgsReadWriteContext)QgsFeatureRenderer

Creates a renderer from XML element

Parameters
Return type

QgsFeatureRenderer

drawGroup()
drawLabels()
renderFeatureWithSymbol(self, feature: QgsFeature, symbol: QgsSymbol, context: QgsRenderContext, layer: int, selected: bool, drawVertexMarker: bool)

Render the feature with the symbol using context. Use layer to specify the symbol layer, selected to specify if it should be rendered as selected and drawVertexMarker to specify if vertex markers should be rendered.

renderVertexMarker(self, pt: Union[QPointF, QPoint], context: QgsRenderContext)

render editing vertex marker at specified point

renderVertexMarkerPolygon(self, pts: QPolygonF, rings: Iterable[QPolygonF], context: QgsRenderContext)

render editing vertex marker for a polygon

renderVertexMarkerPolyline(self, pts: QPolygonF, context: QgsRenderContext)

render editing vertex marker for a polyline

save(self, doc: QDomDocument, context: QgsReadWriteContext)QDomElement
Parameters
Return type

QDomElement

setClusterSymbol(self, symbol: QgsMarkerSymbol)

Sets the symbol for rendering clustered groups.

Parameters

symbol (QgsMarkerSymbol) – new cluster symbol. Ownership is transferred to the renderer.

See also

clusterSymbol()

startRender(self, context: QgsRenderContext, fields: QgsFields)
Parameters
stopRender(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

usedAttributes(self, context: QgsRenderContext)Set[str]
Parameters

context (QgsRenderContext) –

Return type

Set[str]