Class: QgsPointDisplacementRenderer

class qgis.core.QgsPointDisplacementRenderer(labelAttributeName: str = '')

Bases: QgsPointDistanceRenderer

Constructor for QgsPointDisplacementRenderer.

Parameters

labelAttributeName – optional attribute name for labeling points

A renderer that automatically displaces points with the same geographic location.

Methods

accept

param visitor

centerSymbol

Returns the symbol for the center of a displacement group (but not ownership of the symbol).

circleColor

Returns the color used for drawing the displacement group circle.

circleRadiusAddition

Returns the factor for increasing the ring size of displacement groups.

circleWidth

Returns the line width for the displacement group circle in mm.

clone

rtype

QgsPointDisplacementRenderer

convertFromRenderer

Creates a QgsPointDisplacementRenderer from an existing renderer.

convertSymbolRotation

convertSymbolSizeScale

copyRendererData

Clones generic renderer data to another renderer.

create

Create a renderer from XML element

drawGroup

drawLabels

labelDistanceFactor

Returns the factor for label distance from the symbol.

placement

Returns the placement method used for dispersing the points.

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

setCenterSymbol

Sets the center symbol for a displacement group.

setCircleColor

Sets the color used for drawing the displacement group circle.

setCircleRadiusAddition

Sets a factor for increasing the ring size of displacement groups.

setCircleWidth

Sets the line width for the displacement group circle.

setLabelDistanceFactor

Sets a factor for increasing the label distances from the symbol.

setPlacement

Sets the placement method used for dispersing the points.

startRender

param context

stopRender

param context

usedAttributes

param context

Attributes

ConcentricRings

Grid

Ring

ConcentricRings = 1
Grid = 2
class Placement

Bases: int

Ring = 0
accept(self, visitor: QgsStyleEntityVisitorInterface) bool
Parameters

visitor (QgsStyleEntityVisitorInterface) –

Return type

bool

centerSymbol(self) QgsMarkerSymbol

Returns the symbol for the center of a displacement group (but not ownership of the symbol).

Return type

QgsMarkerSymbol

circleColor(self) QColor

Returns the color used for drawing the displacement group circle.

See also

setCircleColor()

See also

circleWidth()

Return type

QColor

circleRadiusAddition(self) float

Returns the factor for increasing the ring size of displacement groups.

Return type

float

circleWidth(self) float

Returns the line width for the displacement group circle in mm.

See also

setCircleWidth()

See also

circleColor()

Return type

float

clone(self) QgsPointDisplacementRenderer
Return type

QgsPointDisplacementRenderer

convertFromRenderer(renderer: QgsFeatureRenderer) QgsPointDisplacementRenderer

Creates a QgsPointDisplacementRenderer from an existing renderer.

Return type

QgsPointDisplacementRenderer

Returns

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

New in version 2.5.

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: QgsSymbol.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

Create a renderer from XML element

Parameters
Return type

QgsFeatureRenderer

drawGroup()
drawLabels()
labelDistanceFactor(self) float

Returns the factor for label distance from the symbol.

New in version 3.8.

Return type

float

placement(self) QgsPointDisplacementRenderer.Placement

Returns the placement method used for dispersing the points.

See also

setPlacement()

New in version 2.12.

Return type

QgsPointDisplacementRenderer.Placement

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

setCenterSymbol(self, symbol: QgsMarkerSymbol)

Sets the center symbol for a displacement group.

Parameters

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

See also

centerSymbol()

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

Sets the color used for drawing the displacement group circle.

Parameters

color (Union[QColor) – circle color

See also

circleColor()

See also

setCircleWidth()

setCircleRadiusAddition(self, distance: float)

Sets a factor for increasing the ring size of displacement groups.

Parameters

distance (float) – addition factor

setCircleWidth(self, width: float)

Sets the line width for the displacement group circle.

Parameters

width (float) – line width in mm

See also

circleWidth()

See also

setCircleColor()

setLabelDistanceFactor(self, factor: float)

Sets a factor for increasing the label distances from the symbol.

Parameters

factor (float) – addition factor

New in version 3.8.

setPlacement(self, placement: QgsPointDisplacementRenderer.Placement)

Sets the placement method used for dispersing the points.

Parameters

placement (QgsPointDisplacementRenderer.Placement) – placement method

See also

placement()

New in version 2.12.

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]