Subgroup: Point

Class: QgsPointDistanceRenderer

class qgis.core.QgsPointDistanceRenderer

Bases: qgis._core.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 implement drawGroup() to handle the rendering of individual point clusters in the desired style.

New in version 3.0: Methods

capabilities
checkLegendSymbolItem
clone Create a deep copy of this renderer.
convertSymbolRotation
convertSymbolSizeScale
copyRendererData Clones generic renderer data to another renderer.
defaultRenderer return a new renderer - used by default in vector layers
dump Returns debug information about this renderer
embeddedRenderer
filter
filterNeedsGeometry Returns true if this renderer requires the geometry to apply the filter.
forceRasterRender Returns whether the renderer must render as a raster.
labelAttributeName Returns the attribute name used for labeling points, or an empty string if no labeling will be done by the renderer.
labelColor Returns the color used for for labeling points.
labelFont Returns the font used for labeling points.
legendClassificationAttribute If supported by the renderer, return classification attribute for the use in legend
legendKeysForFeature
legendSymbolItemChecked
legendSymbolItems
legendSymbolItemsCheckable
load create a renderer from XML element
loadSld Create a new renderer according to the information contained in
minimumLabelScale Returns the minimum map scale (i.e.
modifyRequestExtent Allows for a renderer to modify the extent of a feature request prior to rendering
orderBy Get the order in which features shall be processed by this renderer.
orderByEnabled Returns whether custom ordering will be applied before features are processed by this renderer.
originalSymbolForFeature
originalSymbolsForFeature
paintEffect Returns the current paint effect for the renderer.
renderFeature
renderFeatureWithSymbol
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 store renderer info to XML element
setEmbeddedRenderer
setForceRasterRender Sets whether the renderer should be rendered to a raster destination.
setLabelAttributeName Sets the attribute name for labeling points.
setLabelColor Sets the color to use for for labeling points.
setLabelFont Sets the font used for labeling points.
setLegendSymbolItem
setMinimumLabelScale Sets the minimum map scale (i.e.
setOrderBy Define the order in which features shall be processed by this renderer.
setOrderByEnabled Sets whether custom ordering should be applied before features are processed by this renderer.
setPaintEffect Sets the current paint effect for the renderer.
setTolerance Sets the tolerance distance for grouping points.
setToleranceMapUnitScale Sets the map unit scale object for the distance tolerance.
setToleranceUnit Sets the units for the tolerance distance.
setUsingSymbolLevels
setVertexMarkerAppearance set type and size of editing vertex markers for subsequent rendering
startRender
stopRender
symbolForFeature
symbols
symbolsForFeature
toSld
tolerance Returns the tolerance distance for grouping points.
toleranceMapUnitScale Returns the map unit scale object for the distance tolerance.
toleranceUnit Returns the units for the tolerance distance.
type
usedAttributes
usingSymbolLevels
willRenderFeature
writeSld create the SLD UserStyle element following the SLD v1.1 specs with the given name

Attributes

Filter
MoreSymbolsPerFeature
ScaleDependent
SymbolLevels
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 state
  • label – optional label text, or empty string for no label

QgsPointDistanceRenderer.GroupedFeature(QgsPointDistanceRenderer.GroupedFeature)

feature
isSelected
label
symbol(self) → QgsMarkerSymbol

Base symbol for rendering feature

capabilities(self) → QgsFeatureRenderer.Capabilities
checkLegendSymbolItem(self, key: str, state: bool)
embeddedRenderer(self) → QgsFeatureRenderer
filter(self, fields: QgsFields = QgsFields()) → str
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

labelFont()

See also

labelColor()

labelColor(self) → QColor

Returns the color used for for labeling points.

See also

setLabelColor()

See also

labelFont()

labelFont(self) → QFont

Returns the font used for labeling points.

See also

setLabelFont()

See also

labelColor()

legendKeysForFeature(self, feature: QgsFeature, context: QgsRenderContext) → Set[str]
legendSymbolItemChecked(self, key: str) → bool
legendSymbolItems(self) → object
legendSymbolItemsCheckable(self) → 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.

originalSymbolForFeature(self, feat: QgsFeature, context: QgsRenderContext) → QgsSymbol
originalSymbolsForFeature(self, feat: QgsFeature, context: QgsRenderContext) → object
renderFeature(self, feature: QgsFeature, context: QgsRenderContext, layer: int = -1, selected: bool = False, drawVertexMarker: bool = False) → bool
setEmbeddedRenderer(self, r: QgsFeatureRenderer)
setLabelAttributeName(self, name: str)

Sets the attribute name for labeling points.

Parameters:name – attribute name, or empty string to avoid labeling features by the renderer

See also

setLabelFont()

See also

setLabelColor()

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

Sets the color to use for for labeling points.

Parameters:color – label color

See also

labelColor()

See also

setLabelFont()

setLabelFont(self, font: QFont)

Sets the font used for labeling points.

Parameters:font – label font

See also

labelFont()

See also

setLabelColor()

setLegendSymbolItem(self, 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. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

setTolerance(self, distance: float)

Sets the tolerance distance for grouping points. Units are specified using setToleranceUnit().

Parameters:distance – tolerance distance

See also

tolerance()

setToleranceMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale object for the distance tolerance. This is only used if the toleranceUnit() is set to QgsUnitTypes.RenderMapUnits.

Parameters:scale – scale for distance tolerance
setToleranceUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the units for the tolerance distance.

Parameters:unit – tolerance distance units

See also

setTolerance()

See also

toleranceUnit()

New in version 2.12.

startRender(self, context: QgsRenderContext, fields: QgsFields)
stopRender(self, context: QgsRenderContext)
symbolForFeature(self, feature: QgsFeature, context: QgsRenderContext) → QgsSymbol
symbols(self, context: QgsRenderContext) → object
symbolsForFeature(self, feat: QgsFeature, context: QgsRenderContext) → object
toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str] = {})
tolerance(self) → float

Returns the tolerance distance for grouping points. Units are retrieved using toleranceUnit().

See also

setTolerance()

See also

toleranceUnit()

toleranceMapUnitScale(self) → QgsMapUnitScale

Returns the map unit scale object for the distance tolerance. This is only used if the toleranceUnit() is set to QgsUnitTypes.RenderMapUnits.

See also

toleranceUnit()

toleranceUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the tolerance distance.

See also

tolerance()

New in version 2.12.

usedAttributes(self, context: QgsRenderContext) → Set[str]
willRenderFeature(self, feat: QgsFeature, context: QgsRenderContext) → bool