Class: QgsHeatmapRenderer¶
- class qgis.core.QgsHeatmapRenderer¶
Bases:
QgsFeatureRenderer
A renderer which draws points as a live heatmap
New in version 2.7:
Methods
- param visitor:
- rtype:
QgsHeatmapRenderer
Returns the color ramp used for shading the heatmap.
- param renderer:
Creates a new heatmap renderer instance from XML
- rtype:
str
Returns the maximum value used for shading the heatmap.
- param extent:
Returns the radius for the heatmap
Returns the map unit scale used for the heatmap's radius
Returns the units used for the heatmap's radius
- param feature:
Render the
feature
with thesymbol
usingcontext
.Returns the render quality used for drawing the heatmap.
render editing vertex marker at specified point
render editing vertex marker for a polygon
render editing vertex marker for a polyline
- param doc:
Saves generic renderer data into the specified
element
.Sets the color ramp to use for shading the heatmap.
Sets the maximum value used for shading the heatmap.
Sets the radius for the heatmap
Sets the map unit scale used for the heatmap's radius
Sets the units used for the heatmap's radius
Sets the render quality used for drawing the heatmap.
Sets the expression used for weighting points when generating the heatmap.
- param context:
- param context:
- param context:
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:
- colorRamp(self) QgsColorRamp ¶
Returns the color ramp used for shading the heatmap.
- Return type:
- Returns:
color ramp for heatmap
See also
- convertFromRenderer(renderer: QgsFeatureRenderer) QgsHeatmapRenderer ¶
- Parameters:
renderer (QgsFeatureRenderer) –
- Return type:
- 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
- create(element: QDomElement, context: QgsReadWriteContext) QgsFeatureRenderer ¶
Creates a new heatmap renderer instance from XML
- Parameters:
element (QDomElement) –
context (QgsReadWriteContext) –
- Return type:
- 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.
See also
- modifyRequestExtent(self, extent: QgsRectangle, context: QgsRenderContext)¶
- Parameters:
extent (QgsRectangle) –
context (QgsRenderContext) –
- radius(self) float ¶
Returns the radius for the heatmap
- Return type:
float
- Returns:
heatmap radius
See also
See also
See also
- radiusMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale used for the heatmap’s radius
- Return type:
- Returns:
map unit scale for heatmap’s radius
See also
See also
See also
- radiusUnit(self) Qgis.RenderUnit ¶
Returns the units used for the heatmap’s radius
- Return type:
- Returns:
units for heatmap radius
See also
See also
See also
- 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(self, feature: QgsFeature, symbol: QgsSymbol, context: QgsRenderContext, layer: int, selected: bool, drawVertexMarker: bool)¶
Render the
feature
with thesymbol
usingcontext
. Uselayer
to specify the symbol layer,selected
to specify if it should be rendered as selected anddrawVertexMarker
to specify if vertex markers should be rendered.
- 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.
See also
- renderVertexMarker(self, pt: 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:
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
QDomElement
- saveRendererData(self, doc: QDomDocument, element: QDomElement, context: QgsReadWriteContext)¶
Saves generic renderer data into the specified
element
.This method should be called in a subclass’
save()
implementation in order to store all common base class properties in the DOMelement
.New in version 3.22.
- 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
- 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
- setRadius(self, radius: float)¶
Sets the radius for the heatmap
- Parameters:
radius (float) – heatmap radius
See also
See also
See also
- 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
See also
See also
- setRadiusUnit(self, unit: Qgis.RenderUnit)¶
Sets the units used for the heatmap’s radius
- Parameters:
unit (Qgis.RenderUnit) – units for heatmap radius
See also
See also
See also
- 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
- 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.
See also
- startRender(self, context: QgsRenderContext, fields: QgsFields)¶
- Parameters:
context (QgsRenderContext) –
fields (QgsFields) –
- stopRender(self, context: QgsRenderContext)¶
- Parameters:
context (QgsRenderContext) –
- symbolForFeature(self, feature: QgsFeature, context: QgsRenderContext) QgsSymbol ¶
Note
symbolForFeature2 in Python bindings
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- Return type:
- 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.
See also