Class: QgsRandomMarkerFillSymbolLayer¶
-
class
qgis.core.
QgsRandomMarkerFillSymbolLayer
(pointCount: int = 10, method: QgsRandomMarkerFillSymbolLayer.CountMethod = QgsRandomMarkerFillSymbolLayer.AbsoluteCount, densityArea: float = 250, seed: int = 0)¶ Bases:
QgsFillSymbolLayer
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.A fill symbol layer which places markers at random locations within polygons.
New in version 3.12.
- Parameters
pointCount (int = 10) –
method (QgsRandomMarkerFillSymbolLayer.CountMethod = QgsRandomMarkerFillSymbolLayer.AbsoluteCount) –
densityArea (float = 250) –
seed –
-
AbsoluteCount
= 0¶
-
class
CountMethod
¶ Bases:
int
-
DensityBasedCount
= 1¶
-
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) → QgsRandomMarkerFillSymbolLayer.CountMethod¶ Returns the count method used to randomly fill the polygon.
See also
- Return type
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶ Creates a new
QgsRandomMarkerFillSymbolLayer
using the specifiedproperties
map containing symbol properties (see properties()).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) → QgsUnitTypes.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
-
layerType
(self) → str¶ - Return type
str
-
mapUnitScale
(self) → QgsMapUnitScale¶ - Return type
-
outputUnit
(self) → QgsUnitTypes.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, str]¶ - Return type
Dict[str, str]
-
renderPolygon
(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)¶ - Parameters
points (QPolygonF) –
rings (Iterable[QPolygonF]) –
context (QgsSymbolRenderContext) –
-
restoreOldDataDefinedProperties
(self, stringMap: Dict[str, str])¶ 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: Union[QColor, Qt.GlobalColor])¶ - Parameters
color (Union[QColor) –
-
setCountMethod
(self, method: QgsRandomMarkerFillSymbolLayer.CountMethod)¶ Sets the count
method
used to randomly fill the polygon.See also
- Parameters
method (QgsRandomMarkerFillSymbolLayer.CountMethod) –
-
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: QgsUnitTypes.RenderUnit)¶ Sets the units for the density area.
- Parameters
unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)¶ - Parameters
unit (QgsUnitTypes.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) –
-
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]