Class: QgsPointDistanceRenderer¶
An abstract base class for distance based point renderers (e.g., clusterer and displacement renderers).
QgsPointDistanceRenderer
handles calculation of point
clusters using a distance based threshold. Subclasses must implement
drawGroup()
to handle the rendering of individual point
clusters in the desired style.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: QgsFeatureRenderer.clone()
, drawGroup()
Class Hierarchy¶
Base classes¶
Abstract base class for all 2D vector feature renderers. |
Subclasses¶
A renderer that automatically clusters points with the same geographic position. |
|
A renderer that automatically displaces points with the same geographic location. |
Methods
Returns the attribute name used for labeling points, or an empty string if no labeling will be done by the renderer. |
|
Returns the color used for for labeling points. |
|
Returns the font used for labeling points. |
|
Returns the minimum map scale (i.e. most "zoomed out") at which points should be labeled by the renderer. |
|
Sets the attribute name for labeling points. |
|
Sets the color to use for for labeling points. |
|
Sets the font used for labeling points. |
|
Sets the minimum map scale (i.e. most "zoomed out") at which points should be labeled by the renderer. |
|
Sets the tolerance distance for grouping points. |
|
Sets the map unit scale object for the distance tolerance. |
|
Sets the units for the tolerance distance. |
|
Returns the tolerance distance for grouping points. |
|
Returns the map unit scale object for the distance tolerance. |
|
Returns the units for the tolerance distance. |
- class qgis.core.QgsPointDistanceRenderer[source]¶
Bases:
QgsFeatureRenderer
- __init__(rendererName: str | None, labelAttributeName: str | None = '')
Constructor for QgsPointDistanceRenderer.
- Parameters:
rendererName (Optional[str]) – name of renderer for registry
labelAttributeName (Optional[str] = '') – optional attribute for labeling points
- class GroupedFeature¶
Bases:
object
Contains properties for a feature within a clustered group.
- feature: QgsFeature¶
Feature
- isSelected: bool¶
True if feature is selected and should be rendered in a selected state
- label: str¶
Optional label text
- symbol(self) QgsMarkerSymbol | None ¶
Base symbol for rendering feature
- Return type:
Optional[QgsMarkerSymbol]
- labelAttributeName(self) str [source]¶
Returns the attribute name used for labeling points, or an empty string if no labeling will be done by the renderer.
See also
See also
See also
See also
- Return type:
str
- labelColor(self) QColor [source]¶
Returns the color used for for labeling points.
See also
See also
See also
- Return type:
QColor
- labelFont(self) QFont [source]¶
Returns the font used for labeling points.
See also
See also
See also
- Return type:
QFont
- minimumLabelScale(self) float [source]¶
Returns the minimum map scale (i.e. most “zoomed out”) at which points should be labeled by the renderer. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
See also
See also
- Return type:
float
- setLabelAttributeName(self, name: str | None)[source]¶
Sets the attribute name for labeling points.
- Parameters:
name (Optional[str]) – attribute name, or empty string to avoid labeling features by the renderer
See also
See also
See also
See also
- setLabelColor(self, color: QColor | Qt.GlobalColor)[source]¶
Sets the color to use for for labeling points.
- Parameters:
color (Union[QColor, Qt.GlobalColor]) – label color
See also
See also
See also
- setLabelFont(self, font: QFont)[source]¶
Sets the font used for labeling points.
- Parameters:
font (QFont) – label font
See also
See also
See also
- setMinimumLabelScale(self, scale: float)[source]¶
Sets the minimum map
scale
(i.e. most “zoomed out”) at which points should be labeled by the renderer. Thescale
value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.See also
See also
- Parameters:
scale (float)
- setTolerance(self, distance: float)[source]¶
Sets the tolerance distance for grouping points. Units are specified using
setToleranceUnit()
.- Parameters:
distance (float) – tolerance distance
See also
See also
- setToleranceMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit scale object for the distance tolerance. This is only used if the
toleranceUnit()
is set toQgsUnitTypes
.RenderMapUnits.- Parameters:
scale (QgsMapUnitScale) – scale for distance tolerance
See also
See also
- setToleranceUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the units for the tolerance distance.
- Parameters:
unit (Qgis.RenderUnit) – tolerance distance units
See also
See also
- tolerance(self) float [source]¶
Returns the tolerance distance for grouping points. Units are retrieved using
toleranceUnit()
.See also
See also
- Return type:
float
- toleranceMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale object for the distance tolerance. This is only used if the
toleranceUnit()
is set toQgsUnitTypes
.RenderMapUnits.See also
See also
- Return type:
- toleranceUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the tolerance distance.
See also
See also
- Return type: