Class: QgsHeatmapRenderer

class qgis.core.QgsHeatmapRenderer

Bases: QgsFeatureRenderer

A renderer which draws points as a live heatmap

Methods

accept

param visitor

clone

rtype

QgsHeatmapRenderer

colorRamp

Returns the color ramp used for shading the heatmap.

convertFromRenderer

param renderer

convertSymbolRotation

convertSymbolSizeScale

copyRendererData

create

Creates a new heatmap renderer instance from XML

dump

rtype

str

maximumValue

Returns the maximum value used for shading the heatmap.

modifyRequestExtent

param extent

radius

Returns the radius for the heatmap

radiusMapUnitScale

Returns the map unit scale used for the heatmap’s radius

radiusUnit

Returns the units used for the heatmap’s radius

renderFeature

param feature

renderFeatureWithSymbol

renderQuality

Returns the render quality used for drawing the heatmap.

renderVertexMarker

renderVertexMarkerPolygon

renderVertexMarkerPolyline

save

param doc

setColorRamp

Sets the color ramp to use for shading the heatmap.

setMaximumValue

Sets the maximum value used for shading the heatmap.

setRadius

Sets the radius for the heatmap

setRadiusMapUnitScale

Sets the map unit scale used for the heatmap’s radius

setRadiusUnit

Sets the units used for the heatmap’s radius

setRenderQuality

Sets the render quality used for drawing the heatmap.

setWeightExpression

Sets the expression used for weighting points when generating the heatmap.

startRender

param context

stopRender

param context

symbolForFeature

symbols

usedAttributes

param context

weightExpression

Returns the expression used for weighting points when generating the heatmap.

accept(self, visitor: QgsStyleEntityVisitorInterface) → bool
Parameters

visitor (QgsStyleEntityVisitorInterface) –

Return type

bool

clone(self) → QgsHeatmapRenderer
Return type

QgsHeatmapRenderer

colorRamp(self) → QgsColorRamp

Returns the color ramp used for shading the heatmap.

Return type

QgsColorRamp

Returns

color ramp for heatmap

See also

setColorRamp()

convertFromRenderer(renderer: QgsFeatureRenderer) → QgsHeatmapRenderer
Parameters

renderer (QgsFeatureRenderer) –

Return type

QgsHeatmapRenderer

convertSymbolRotation()
convertSymbolSizeScale()
copyRendererData()
create(element: QDomElement, context: QgsReadWriteContext) → QgsFeatureRenderer

Creates a new heatmap renderer instance from XML

Parameters
Return type

QgsFeatureRenderer

dump(self) → str
Return type

str

maximumValue(self) → float

Returns the maximum value used for shading the heatmap.

Return type

float

Returns

maximum value for heatmap shading. If 0, then maximum value will be automatically calculated.

modifyRequestExtent(self, extent: QgsRectangle, context: QgsRenderContext)
Parameters
radius(self) → float

Returns the radius for the heatmap

Return type

float

Returns

heatmap radius

See also

setRadius()

See also

radiusUnit()

radiusMapUnitScale(self) → QgsMapUnitScale

Returns the map unit scale used for the heatmap’s radius

Return type

QgsMapUnitScale

Returns

map unit scale for heatmap’s radius

See also

radius()

See also

radiusUnit()

radiusUnit(self) → QgsUnitTypes.RenderUnit

Returns the units used for the heatmap’s radius

Return type

QgsUnitTypes.RenderUnit

Returns

units for heatmap radius

See also

radius()

See also

setRadiusUnit()

renderFeature(self, feature: QgsFeature, context: QgsRenderContext, layer: int = -1, selected: bool = False, drawVertexMarker: bool = False) → bool
Parameters
  • feature (QgsFeature) –

  • context (QgsRenderContext) –

  • layer (int = -1) –

  • selected (bool = False) –

  • drawVertexMarker (bool = False) –

Return type

bool

renderFeatureWithSymbol()
renderQuality(self) → float

Returns the render quality used for drawing the heatmap.

Return type

float

Returns

render quality. A value of 1 indicates maximum quality, and increasing the value will result in faster drawing but lower quality rendering.

renderVertexMarker()
renderVertexMarkerPolygon()
renderVertexMarkerPolyline()
save(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement
Parameters
Return type

QDomElement

setColorRamp(self, ramp: QgsColorRamp)

Sets the color ramp to use for shading the heatmap.

Parameters

ramp (QgsColorRamp) – color ramp for heatmap. Ownership of ramp is transferred to the renderer.

See also

colorRamp()

setMaximumValue(self, value: float)

Sets the maximum value used for shading the heatmap.

Parameters

value (float) – maximum value for heatmap shading. Set to 0 for automatic calculation of maximum value.

See also

maximumValue()

setRadius(self, radius: float)

Sets the radius for the heatmap

Parameters

radius (float) – heatmap radius

See also

radius()

See also

setRadiusUnit()

setRadiusMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale used for the heatmap’s radius

Parameters

scale (QgsMapUnitScale) – map unit scale for heatmap’s radius

See also

setRadius()

See also

setRadiusUnit()

setRadiusUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the units used for the heatmap’s radius

Parameters

unit (QgsUnitTypes.RenderUnit) – units for heatmap radius

See also

radiusUnit()

See also

setRadius()

setRenderQuality(self, quality: int)

Sets the render quality used for drawing the heatmap.

Parameters

quality (int) – render quality. A value of 1 indicates maximum quality, and increasing the value will result in faster drawing but lower quality rendering.

See also

renderQuality()

setWeightExpression(self, expression: str)

Sets the expression used for weighting points when generating the heatmap.

Parameters

expression (str) – point weight expression. If set to empty, all points are equally weighted.

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

context (QgsRenderContext) –

symbolForFeature(self, feature: QgsFeature, context: QgsRenderContext) → QgsSymbol

Note

symbolForFeature2 in Python bindings

Parameters
Return type

QgsSymbol

symbols(self, context: QgsRenderContext) → List[QgsSymbol]

Note

symbol2 in Python bindings

Parameters

context (QgsRenderContext) –

Return type

List[QgsSymbol]

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

context (QgsRenderContext) –

Return type

Set[str]

weightExpression(self) → str

Returns the expression used for weighting points when generating the heatmap.

Return type

str

Returns

point weight expression. If empty, all points are equally weighted.