Class: QgsRandomMarkerFillSymbolLayer

A fill symbol layer which places markers at random locations within polygons.

Added in version 3.12.

Class Hierarchy

Inheritance diagram of qgis.core.QgsRandomMarkerFillSymbolLayer

Base classes

QgsFillSymbolLayer

Abstract base class for fill symbol layers.

QgsSymbolLayer

Abstract base class for symbol layers.

Enums

CountMethod

alias of PointCountMethod

Methods

clipPoints

Returns True if point markers should be clipped to the polygon boundary.

countMethod

Returns the count method used to randomly fill the polygon.

densityArea

Returns the density area used to count the number of points to randomly fill the polygon.

densityAreaUnit

Returns the units for the density area.

densityAreaUnitScale

Returns the map scale for the density area.

pointCount

Returns the count of random points to render in the fill.

seed

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).

setClipPoints

Sets whether point markers should be clipped to the polygon boundary.

setCountMethod

Sets the count method used to randomly fill the polygon.

setDensityArea

Sets the density area used to count the number of points to randomly fill the polygon.

setDensityAreaUnit

Sets the units for the density area.

setDensityAreaUnitScale

Sets the map scale for the density area.

setPointCount

Sets the count of random points to render in the fill.

setSeed

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).

Static Methods

create

Creates a new QgsRandomMarkerFillSymbolLayer using the specified properties map containing symbol properties (see properties()).

class qgis.core.QgsRandomMarkerFillSymbolLayer[source]

Bases: QgsFillSymbolLayer

__init__(pointCount: int = 10, method: Qgis.PointCountMethod = Qgis.PointCountMethod.Absolute, densityArea: float = 250, seed: int = 0)

Constructor for QgsRandomMarkerFillSymbolLayer, with the specified pointCount.

Optionally a specific random number seed can be used when generating points. A seed 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.

Parameters:
  • pointCount (int = 10)

  • method (Qgis.PointCountMethod = Qgis.PointCountMethod.Absolute)

  • densityArea (float = 250)

  • seed (int = 0)

CountMethod

alias of PointCountMethod

clipPoints(self) bool[source]

Returns True if point markers should be clipped to the polygon boundary.

See also

setClipPoints()

Return type:

bool

countMethod(self) Qgis.PointCountMethod[source]

Returns the count method used to randomly fill the polygon.

See also

setCountMethod()

Return type:

Qgis.PointCountMethod

static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None[source]

Creates a new QgsRandomMarkerFillSymbolLayer using the specified properties map containing symbol properties (see properties()).

Caller takes ownership of the returned symbol layer.

Parameters:

properties (Dict[str, Any] = {})

Return type:

Optional[QgsSymbolLayer]

densityArea(self) float[source]

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

setDensityArea()

Return type:

float

densityAreaUnit(self) Qgis.RenderUnit[source]

Returns the units for the density area.

Return type:

Qgis.RenderUnit

densityAreaUnitScale(self) QgsMapUnitScale

Returns the map scale for the density area.

See also

densityArea()

Return type:

QgsMapUnitScale

pointCount(self) int[source]

Returns the count of random points to render in the fill.

See also

setPointCount()

Return type:

int

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

setSeed()

Return type:

int

setClipPoints(self, clipped: bool)[source]

Sets whether point markers should be clipped to the polygon boundary.

See also

clipPoints()

Parameters:

clipped (bool)

setCountMethod(self, method: Qgis.PointCountMethod)[source]

Sets the count method used to randomly fill the polygon.

See also

countMethod()

Parameters:

method (Qgis.PointCountMethod)

setDensityArea(self, area: float)[source]

Sets the density area used to count the number of points to randomly fill the polygon.

See also

densityArea()

Parameters:

area (float)

setDensityAreaUnit(self, unit: Qgis.RenderUnit)[source]

Sets the units for the density area.

Parameters:

unit (Qgis.RenderUnit) – width units

setDensityAreaUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the map scale for the density area.

Parameters:

scale (QgsMapUnitScale) – density area map unit scale

See also

setDensityArea()

setPointCount(self, count: int)[source]

Sets the count of random points to render in the fill.

See also

pointCount()

Parameters:

count (int)

setSeed(self, seed: int)[source]

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

seed()

Parameters:

seed (int)