Class: QgsPointDistanceRenderer¶
- class qgis.core.QgsPointDistanceRenderer¶
Bases:
QgsFeatureRenderer
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 implementdrawGroup()
to handle the rendering of individual point clusters in the desired style.New in version 3.0.
QgsPointDistanceRenderer(rendererName: str, labelAttributeName: str = ‘’) Constructor for QgsPointDistanceRenderer.
- Parameters:
rendererName – name of renderer for registry
labelAttributeName –
optional attribute for labeling points
Methods
- param visitor:
- rtype:
QgsFeatureRenderer.Capabilities
- param key:
- rtype:
QgsFeatureRenderer
- param fields:
- rtype:
bool
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.
- param key:
- param feature:
- param key:
- rtype:
List[QgsLegendSymbolItem]
- rtype:
bool
Returns the minimum map scale (i.e.
- param feature:
- param feature:
- param feature:
- param r:
Sets the attribute name for labeling points.
Sets the color to use for for labeling points.
Sets the font used for labeling points.
- param key:
Sets the minimum map
scale
(i.e.Sets the tolerance distance for grouping points.
Sets the map unit scale object for the distance tolerance.
Sets the units for the tolerance distance.
- param context:
- param context:
- param feature:
- param context:
- param feature:
- param doc:
Returns the tolerance distance for grouping points.
Returns the map unit scale object for the distance tolerance.
Returns the units for the tolerance distance.
- param context:
- param feature:
- class GroupedFeature(feature: QgsFeature, symbol: QgsMarkerSymbol, isSelected: bool, label: str = '')¶
Bases:
sip.wrapper
Constructor for GroupedFeature.
- Parameters:
feature – feature
symbol – base symbol for rendering feature (owned by GroupedFeature)
isSelected – set to
True
if feature is selected and should be rendered in a selected statelabel – optional label text, or empty string for no label
QgsPointDistanceRenderer.GroupedFeature(QgsPointDistanceRenderer.GroupedFeature)
- feature¶
- isSelected¶
- label¶
- symbol(self) QgsMarkerSymbol ¶
Base symbol for rendering feature
- Return type:
- accept(self, visitor: QgsStyleEntityVisitorInterface) bool ¶
- Parameters:
visitor (QgsStyleEntityVisitorInterface) –
- Return type:
bool
- capabilities(self) QgsFeatureRenderer.Capabilities ¶
- Return type:
- checkLegendSymbolItem(self, key: str, state: bool)¶
- Parameters:
key (str) –
state (bool) –
- embeddedRenderer(self) QgsFeatureRenderer ¶
- Return type:
- filter(self, fields: QgsFields = QgsFields()) str ¶
- Parameters:
fields (
QgsFields
= QgsFields()) –- Return type:
str
- filterNeedsGeometry(self) bool ¶
- Return type:
bool
- labelAttributeName(self) str ¶
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 ¶
Returns the color used for for labeling points.
See also
See also
See also
- Return type:
QColor
- labelFont(self) QFont ¶
Returns the font used for labeling points.
See also
See also
See also
- Return type:
QFont
- legendKeyToExpression(self, key: str, layer: QgsVectorLayer) Tuple[str, bool] ¶
- Parameters:
key (str) –
layer (QgsVectorLayer) –
- Return type:
Tuple[str, bool]
- legendKeysForFeature(self, feature: QgsFeature, context: QgsRenderContext) Set[str] ¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- Return type:
Set[str]
- legendSymbolItemChecked(self, key: str) bool ¶
- Parameters:
key (str) –
- Return type:
bool
- legendSymbolItems(self) List[QgsLegendSymbolItem] ¶
- Return type:
List[QgsLegendSymbolItem]
- legendSymbolItemsCheckable(self) bool ¶
- Return type:
bool
- minimumLabelScale(self) float ¶
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
- originalSymbolForFeature(self, feature: QgsFeature, context: QgsRenderContext) QgsSymbol ¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- Return type:
- originalSymbolsForFeature(self, feature: QgsFeature, context: QgsRenderContext) List[QgsSymbol] ¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- Return type:
List[QgsSymbol]
- 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
- setEmbeddedRenderer(self, r: QgsFeatureRenderer)¶
- Parameters:
r (QgsFeatureRenderer) –
- setLabelAttributeName(self, name: str)¶
Sets the attribute name for labeling points.
- Parameters:
name (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)¶
Sets the color to use for for labeling points.
- Parameters:
color (Union[QColor) – label color
See also
See also
See also
- setLabelFont(self, font: QFont)¶
Sets the font used for labeling points.
- Parameters:
font (QFont) – label font
See also
See also
See also
- setLegendSymbolItem(self, key: str, symbol: QgsSymbol)¶
- Parameters:
key (str) –
symbol (QgsSymbol) –
- setMinimumLabelScale(self, scale: float)¶
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)¶
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)¶
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: QgsUnitTypes.RenderUnit)¶
Sets the units for the tolerance distance.
- Parameters:
unit (QgsUnitTypes.RenderUnit) – tolerance distance units
See also
See also
New in version 2.12.
- 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 ¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- Return type:
- symbols(self, context: QgsRenderContext) List[QgsSymbol] ¶
- Parameters:
context (QgsRenderContext) –
- Return type:
List[QgsSymbol]
- symbolsForFeature(self, feature: QgsFeature, context: QgsRenderContext) List[QgsSymbol] ¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- Return type:
List[QgsSymbol]
- toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any] = {})¶
- Parameters:
doc (QDomDocument) –
element (QDomElement) –
props (Dict[str) –
- tolerance(self) float ¶
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) QgsUnitTypes.RenderUnit ¶
Returns the units for the tolerance distance.
See also
See also
New in version 2.12.
- Return type:
- usedAttributes(self, context: QgsRenderContext) Set[str] ¶
- Parameters:
context (QgsRenderContext) –
- Return type:
Set[str]
- willRenderFeature(self, feature: QgsFeature, context: QgsRenderContext) bool ¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- Return type:
bool