Class: QgsRandomMarkerFillSymbolLayer¶
- class qgis.core.QgsRandomMarkerFillSymbolLayer¶
Bases:
QgsFillSymbolLayer
A fill symbol layer which places markers at random locations within polygons.
New in version 3.12.
QgsRandomMarkerFillSymbolLayer(pointCount: int = 10, method: Qgis.PointCountMethod = Qgis.PointCountMethod.Absolute, densityArea: float = 250, seed: int = 0) Constructor for
QgsRandomMarkerFillSymbolLayer
, with the specifiedpointCount
.Optionally a specific random number
seed
can be used when generating points. Aseed
of 0 indicates that a truly random sequence will be used on every rendering, causing points to appear in different locations with every map refresh.Enums
alias of
PointCountMethod
Methods
- rtype:
bool
Returns
True
if point markers should be clipped to the polygon boundary.- rtype:
QgsRandomMarkerFillSymbolLayer
- rtype:
QColor
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Returns the count method used to randomly fill the polygon.
Creates a new
QgsRandomMarkerFillSymbolLayer
using the specifiedproperties
map containing symbol properties (seeproperties()
).Returns the density area used to count the number of points to randomly fill the polygon.
Returns the units for the density area.
Returns the map scale for the density area.
- rtype:
bool
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layers- rtype:
str
- rtype:
QgsMapUnitScale
- rtype:
Qgis.RenderUnit
Returns the count of random points to render in the fill.
- rtype:
Dict[str, Any]
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layers- param points:
Restores older data defined properties from string map.
Returns the random number seed to use when generating points, or 0 if a truly random sequence will be used (causing points to appear in different locations with every map refresh).
Sets whether point markers should be
clipped
to the polygon boundary.- param color:
Sets the count
method
used to randomly fill the polygon.Sets the density
area
used to count the number of points to randomly fill the polygon.Sets the units for the density area.
Sets the map scale for the density area.
- param scale:
- param unit:
Sets the
count
of random points to render in the fill.Sets the random number
seed
to use when generating points, or 0 if a truly random sequence will be used on every rendering (causing points to appear in different locations with every map refresh).- param symbol:
Returns
True
if the symbol layer should be rendered using the selection color from the render context.- param feature:
- param context:
- param feature:
- param context:
- rtype:
QgsSymbol
- param context:
- rtype:
bool
- CountMethod¶
alias of
PointCountMethod
- canCauseArtifactsBetweenAdjacentTiles(self) bool ¶
- Return type:
bool
- clipPoints(self) bool ¶
Returns
True
if point markers should be clipped to the polygon boundary.See also
- Return type:
bool
- clone(self) QgsRandomMarkerFillSymbolLayer ¶
- Return type:
- color(self) QColor ¶
- Return type:
QColor
- copyDataDefinedProperties(self, destLayer: QgsSymbolLayer)¶
Copies all data defined properties of this layer to another symbol layer.
- Parameters:
destLayer – destination layer
- copyPaintEffect(self, destLayer: QgsSymbolLayer)¶
Copies paint effect of this layer to another symbol layer
- Parameters:
destLayer – destination layer
New in version 2.9.
- countMethod(self) Qgis.PointCountMethod ¶
Returns the count method used to randomly fill the polygon.
See also
- Return type:
- create(properties: Dict[str, Any] = {}) QgsSymbolLayer ¶
Creates a new
QgsRandomMarkerFillSymbolLayer
using the specifiedproperties
map containing symbol properties (seeproperties()
).Caller takes ownership of the returned symbol layer.
- Parameters:
properties (Dict[str) –
- Return type:
- densityArea(self) float ¶
Returns the density area used to count the number of points to randomly fill the polygon.
Only used when the count method is set to QgsRandomMarkerFillSymbolLayer.DensityBasedCount.
Units are specified by
setDensityAreaUnit()
.See also
- Return type:
float
- densityAreaUnit(self) Qgis.RenderUnit ¶
Returns the units for the density area.
See also
- Return type:
- densityAreaUnitScale(self) QgsMapUnitScale ¶
Returns the map scale for the density area.
See also
See also
See also
- Return type:
- hasDataDefinedProperties(self) bool ¶
- Return type:
bool
- installMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- layerType(self) str ¶
- Return type:
str
- mapUnitScale(self) QgsMapUnitScale ¶
- Return type:
- outputUnit(self) Qgis.RenderUnit ¶
- Return type:
- pointCount(self) int ¶
Returns the count of random points to render in the fill.
See also
- Return type:
int
- properties(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- removeMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- renderPolygon(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)¶
- Parameters:
points (QPolygonF) –
rings (Iterable[QPolygonF]) –
context (QgsSymbolRenderContext) –
- restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])¶
Restores older data defined properties from string map.
New in version 3.0.
- seed(self) int ¶
Returns the random number seed to use when generating points, or 0 if a truly random sequence will be used (causing points to appear in different locations with every map refresh).
See also
- Return type:
int
- setClipPoints(self, clipped: bool)¶
Sets whether point markers should be
clipped
to the polygon boundary.See also
- Parameters:
clipped (bool) –
- setColor(self, color: QColor | Qt.GlobalColor | QGradient)¶
- Parameters:
color (Union[QColor) –
- setCountMethod(self, method: Qgis.PointCountMethod)¶
Sets the count
method
used to randomly fill the polygon.See also
- Parameters:
method (Qgis.PointCountMethod) –
- setDensityArea(self, area: float)¶
Sets the density
area
used to count the number of points to randomly fill the polygon.See also
- Parameters:
area (float) –
- setDensityAreaUnit(self, unit: Qgis.RenderUnit)¶
Sets the units for the density area.
- Parameters:
unit (Qgis.RenderUnit) – width units
See also
- setDensityAreaUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map scale for the density area.
- Parameters:
scale (QgsMapUnitScale) – density area map unit scale
See also
See also
See also
- setMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters:
scale (QgsMapUnitScale) –
- setOutputUnit(self, unit: Qgis.RenderUnit)¶
- Parameters:
unit (Qgis.RenderUnit) –
- setPointCount(self, count: int)¶
Sets the
count
of random points to render in the fill.See also
- Parameters:
count (int) –
- setSeed(self, seed: int)¶
Sets the random number
seed
to use when generating points, or 0 if a truly random sequence will be used on every rendering (causing points to appear in different locations with every map refresh).See also
- Parameters:
seed (int) –
- shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool ¶
Returns
True
if the symbol layer should be rendered using the selection color from the render context.New in version 3.34.
- startFeatureRender(self, feature: QgsFeature, context: QgsRenderContext)¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- stopFeatureRender(self, feature: QgsFeature, context: QgsRenderContext)¶
- Parameters:
feature (QgsFeature) –
context (QgsRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- usedAttributes(self, context: QgsRenderContext) Set[str] ¶
- Parameters:
context (QgsRenderContext) –
- Return type:
Set[str]
- usesMapUnits(self) bool ¶
- Return type:
bool