Class: QgsPointPatternFillSymbolLayer

class qgis.core.QgsPointPatternFillSymbolLayer

Bases: QgsImageFillSymbolLayer

A fill symbol layer which fills polygon shapes with repeating marker symbols.

Methods

applyBrushTransformFromContext

applyDataDefinedSettings

param context:

clipMode

Returns the marker clipping mode, which defines how markers are clipped at the edges of shapes.

clone

rtype:

QgsPointPatternFillSymbolLayer

color

rtype:

QColor

copyDataDefinedProperties

Copies all data defined properties of this layer to another symbol layer.

copyPaintEffect

Copies paint effect of this layer to another symbol layer

create

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

createFromSld

param element:

displacementX

Returns the horizontal displacement for odd numbered rows in the pattern.

displacementXMapUnitScale

Returns the map unit scale for the horizontal displacement between odd numbered rows in the pattern.

displacementXUnit

Returns the units for the horizontal displacement between rows in the pattern.

displacementY

Returns the vertical displacement for odd numbered columns in the pattern.

displacementYMapUnitScale

Returns the map unit scale for the vertical displacement between odd numbered columns in the pattern.

displacementYUnit

Returns the units for the vertical displacement between rows in the pattern.

distanceX

Returns the horizontal distance between rendered markers in the fill.

distanceXMapUnitScale

Returns the map unit scale for the horizontal distance between points in the pattern.

distanceXUnit

Returns the units for the horizontal distance between points in the pattern.

distanceY

Returns the vertical distance between rendered markers in the fill.

distanceYMapUnitScale

Returns the map unit scale for the vertical distance between points in the pattern.

distanceYUnit

Returns the units for the vertical distance between points in the pattern.

estimateMaxBleed

param context:

hasDataDefinedProperties

rtype:

bool

installMasks

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

layerType

rtype:

str

mapUnitScale

rtype:

QgsMapUnitScale

maximumRandomDeviationX

Returns the maximum horizontal random deviation of points in the pattern.

maximumRandomDeviationY

Returns the maximum vertical random deviation of points in the pattern.

offsetX

Returns the horizontal offset values for points in the pattern.

offsetXMapUnitScale

Returns the unit scale for the horizontal offset for rows in the pattern.

offsetXUnit

Returns the units for the horizontal offset for rows in the pattern.

offsetY

Returns the vertical offset values for points in the pattern.

offsetYMapUnitScale

Returns the unit scale for the vertical offset between rows in the pattern.

offsetYUnit

Returns the units for the vertical offset for rows in the pattern.

outputUnit

rtype:

Qgis.RenderUnit

properties

rtype:

Dict[str, Any]

randomDeviationXMapUnitScale

Returns the unit scale for the horizontal random deviation of points in the pattern.

randomDeviationXUnit

Returns the units for the horizontal random deviation of points in the pattern.

randomDeviationYMapUnitScale

Returns the unit scale for the vertical random deviation of points in the pattern.

randomDeviationYUnit

Returns the units for the vertical random deviation of points in the pattern.

removeMasks

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

renderPolygon

param points:

restoreOldDataDefinedProperties

Restores older data defined properties from string map.

seed

Returns the random number seed to use when randomly shifting points, or 0 if a truly random sequence will be used (causing points to appear in different locations with every map refresh).

setClipMode

Sets the marker clipping mode, which defines how markers are clipped at the edges of shapes.

setColor

param c:

setDisplacementX

Sets the horizontal displacement for odd numbered rows in the pattern.

setDisplacementXMapUnitScale

Sets the map unit scale for the horizontal displacement between odd numbered rows in the pattern.

setDisplacementXUnit

Sets the units for the horizontal displacement between rows in the pattern.

setDisplacementY

Sets the vertical displacement for odd numbered columns in the pattern.

setDisplacementYMapUnitScale

Sets the map unit scale for the vertical displacement between odd numbered columns in the pattern.

setDisplacementYUnit

Sets the units for the vertical displacement between rows in the pattern.

setDistanceX

Sets the horizontal distance between rendered markers in the fill.

setDistanceXMapUnitScale

Sets the map unit scale for the horizontal distance between points in the pattern.

setDistanceXUnit

Sets the unit for the horizontal distance between points in the pattern.

setDistanceY

Sets the vertical distance between rendered markers in the fill.

setDistanceYMapUnitScale

Sets the map unit scale for the vertical distance between points in the pattern.

setDistanceYUnit

Sets the unit for the vertical distance between points in the pattern.

setMapUnitScale

param scale:

setMaximumRandomDeviationX

Sets the maximum horizontal random deviation of points in the pattern.

setMaximumRandomDeviationY

Sets the maximum vertical random deviation of points in the pattern.

setOffsetX

Sets the horizontal offset values for points in the pattern.

setOffsetXMapUnitScale

Sets the unit scale for the horizontal offset for rows in the pattern.

setOffsetXUnit

Sets the units for the horizontal offset between rows in the pattern.

setOffsetY

Sets the vertical offset values for points in the pattern.

setOffsetYMapUnitScale

Sets the unit scale for the vertical offset for rows in the pattern.

setOffsetYUnit

Sets the units for the vertical offset for rows in the pattern.

setOutputUnit

param unit:

setRandomDeviationXMapUnitScale

Sets the unit scale for the horizontal random deviation of points in the pattern.

setRandomDeviationXUnit

Sets the unit for the horizontal random deviation of points in the pattern.

setRandomDeviationYMapUnitScale

Sets the unit scale for the vertical random deviation of points in the pattern.

setRandomDeviationYUnit

Sets the unit for the vertical random deviation of points in the pattern.

setSeed

Sets the random number seed to use when randomly shifting 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).

setSubSymbol

param symbol:

shouldRenderUsingSelectionColor

Returns True if the symbol layer should be rendered using the selection color from the render context.

startFeatureRender

param feature:

startRender

param context:

stopFeatureRender

param feature:

stopRender

param context:

subSymbol

rtype:

QgsSymbol

toSld

param doc:

toTiledPatternImage

rtype:

QImage

usedAttributes

param context:

usesMapUnits

rtype:

bool

applyBrushTransformFromContext()
applyDataDefinedSettings(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext) –

clipMode(self) Qgis.MarkerClipMode

Returns the marker clipping mode, which defines how markers are clipped at the edges of shapes.

See also

setClipMode()

New in version 3.24.

Return type:

Qgis.MarkerClipMode

clone(self) QgsPointPatternFillSymbolLayer
Return type:

QgsPointPatternFillSymbolLayer

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

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

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

Caller takes ownership of the returned symbol layer.

Parameters:

properties (Dict[str) –

Return type:

QgsSymbolLayer

createFromSld(element: QDomElement) QgsSymbolLayer
Parameters:

element (QDomElement) –

Return type:

QgsSymbolLayer

displacementX(self) float

Returns the horizontal displacement for odd numbered rows in the pattern.

Units are retrieved via displacementXUnit().

Return type:

float

displacementXMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the horizontal displacement between odd numbered rows in the pattern.

See also

displacementX()

Return type:

QgsMapUnitScale

displacementXUnit(self) Qgis.RenderUnit

Returns the units for the horizontal displacement between rows in the pattern.

Return type:

Qgis.RenderUnit

displacementY(self) float

Returns the vertical displacement for odd numbered columns in the pattern.

Units are retrieved via displacementYUnit().

Return type:

float

displacementYMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the vertical displacement between odd numbered columns in the pattern.

See also

displacementY()

Return type:

QgsMapUnitScale

displacementYUnit(self) Qgis.RenderUnit

Returns the units for the vertical displacement between rows in the pattern.

Return type:

Qgis.RenderUnit

distanceX(self) float

Returns the horizontal distance between rendered markers in the fill.

Units are retrieved via distanceXUnit().

See also

setDistanceX()

See also

distanceXUnit()

Return type:

float

distanceXMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the horizontal distance between points in the pattern.

See also

distanceX()

Return type:

QgsMapUnitScale

distanceXUnit(self) Qgis.RenderUnit

Returns the units for the horizontal distance between points in the pattern.

See also

distanceYUnit()

Return type:

Qgis.RenderUnit

distanceY(self) float

Returns the vertical distance between rendered markers in the fill.

Units are retrieved via distanceYUnit().

See also

setDistanceY()

See also

distanceYUnit()

Return type:

float

distanceYMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the vertical distance between points in the pattern.

See also

distanceY()

Return type:

QgsMapUnitScale

distanceYUnit(self) Qgis.RenderUnit

Returns the units for the vertical distance between points in the pattern.

See also

distanceXUnit()

Return type:

Qgis.RenderUnit

estimateMaxBleed(self, context: QgsRenderContext) float
Parameters:

context (QgsRenderContext) –

Return type:

float

hasDataDefinedProperties(self) bool
Return type:

bool

installMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

See also

prepareMasks()

See also

removeMasks()

New in version 3.30.

layerType(self) str
Return type:

str

mapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

maximumRandomDeviationX(self) float

Returns the maximum horizontal random deviation of points in the pattern.

Units are retrieved via maximumRandomDeviationXUnit().

New in version 3.24.

Return type:

float

maximumRandomDeviationY(self) float

Returns the maximum vertical random deviation of points in the pattern.

Units are retrieved via maximumRandomDeviationYUnit().

New in version 3.24.

Return type:

float

offsetX(self) float

Returns the horizontal offset values for points in the pattern.

See also

setOffsetX()

See also

offsetY()

New in version 3.8.

Return type:

float

offsetXMapUnitScale(self) QgsMapUnitScale

Returns the unit scale for the horizontal offset for rows in the pattern.

New in version 3.8.

Return type:

QgsMapUnitScale

offsetXUnit(self) Qgis.RenderUnit

Returns the units for the horizontal offset for rows in the pattern.

See also

setOffsetXUnit()

See also

offsetYUnit()

New in version 3.8.

Return type:

Qgis.RenderUnit

offsetY(self) float

Returns the vertical offset values for points in the pattern.

See also

setOffsetY()

See also

offsetX()

New in version 3.8.

Return type:

float

offsetYMapUnitScale(self) QgsMapUnitScale

Returns the unit scale for the vertical offset between rows in the pattern.

New in version 3.8.

Return type:

QgsMapUnitScale

offsetYUnit(self) Qgis.RenderUnit

Returns the units for the vertical offset for rows in the pattern.

See also

setOffsetYUnit()

See also

offsetXUnit()

New in version 3.8.

Return type:

Qgis.RenderUnit

outputUnit(self) Qgis.RenderUnit
Return type:

Qgis.RenderUnit

properties(self) Dict[str, Any]
Return type:

Dict[str, Any]

randomDeviationXMapUnitScale(self) QgsMapUnitScale

Returns the unit scale for the horizontal random deviation of points in the pattern.

New in version 3.24.

Return type:

QgsMapUnitScale

randomDeviationXUnit(self) Qgis.RenderUnit

Returns the units for the horizontal random deviation of points in the pattern.

New in version 3.24.

Return type:

Qgis.RenderUnit

randomDeviationYMapUnitScale(self) QgsMapUnitScale

Returns the unit scale for the vertical random deviation of points in the pattern.

New in version 3.24.

Return type:

QgsMapUnitScale

randomDeviationYUnit(self) Qgis.RenderUnit

Returns the units for the vertical random deviation of points in the pattern.

New in version 3.24.

Return type:

Qgis.RenderUnit

removeMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

See also

prepareMasks()

See also

installMasks()

New in version 3.30.

renderPolygon(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)
Parameters:
restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])

Restores older data defined properties from string map.

seed(self) int

Returns the random number seed to use when randomly shifting 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()

New in version 3.24.

Return type:

int

setClipMode(self, mode: Qgis.MarkerClipMode)

Sets the marker clipping mode, which defines how markers are clipped at the edges of shapes.

See also

clipMode()

New in version 3.24.

Parameters:

mode (Qgis.MarkerClipMode) –

setColor(self, c: QColor | Qt.GlobalColor | QGradient)
Parameters:

c (Union[QColor) –

setDisplacementX(self, d: float)

Sets the horizontal displacement for odd numbered rows in the pattern.

Units are set via setDisplacementXUnit().

See also

displacementX()

Parameters:

d (float) –

setDisplacementXMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the horizontal displacement between odd numbered rows in the pattern.

Parameters:

scale (QgsMapUnitScale) –

setDisplacementXUnit(self, unit: Qgis.RenderUnit)

Sets the units for the horizontal displacement between rows in the pattern.

Parameters:

unit (Qgis.RenderUnit) – displacement units

setDisplacementY(self, d: float)

Sets the vertical displacement for odd numbered columns in the pattern.

Units are set via setDisplacementYUnit().

See also

displacementY()

Parameters:

d (float) –

setDisplacementYMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the vertical displacement between odd numbered columns in the pattern.

Parameters:

scale (QgsMapUnitScale) –

setDisplacementYUnit(self, unit: Qgis.RenderUnit)

Sets the units for the vertical displacement between rows in the pattern.

Parameters:

unit (Qgis.RenderUnit) – displacement units

setDistanceX(self, d: float)

Sets the horizontal distance between rendered markers in the fill.

Units are set via setDistanceXUnit().

See also

distanceX()

Parameters:

d (float) –

setDistanceXMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the horizontal distance between points in the pattern.

See also

setDistanceX()

Parameters:

scale (QgsMapUnitScale) –

setDistanceXUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the horizontal distance between points in the pattern.

Parameters:

unit (Qgis.RenderUnit) – distance units

See also

distanceXUnit()

setDistanceY(self, d: float)

Sets the vertical distance between rendered markers in the fill.

Units are set via setDistanceYUnit().

See also

distanceY()

Parameters:

d (float) –

setDistanceYMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the vertical distance between points in the pattern.

See also

setDistanceY()

Parameters:

scale (QgsMapUnitScale) –

setDistanceYUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the vertical distance between points in the pattern.

Parameters:

unit (Qgis.RenderUnit) – distance units

See also

distanceYUnit()

setMapUnitScale(self, scale: QgsMapUnitScale)
Parameters:

scale (QgsMapUnitScale) –

setMaximumRandomDeviationX(self, deviation: float)

Sets the maximum horizontal random deviation of points in the pattern.

Units are set via setMaximumRandomDeviationXUnit().

New in version 3.24.

Parameters:

deviation (float) –

setMaximumRandomDeviationY(self, deviation: float)

Sets the maximum vertical random deviation of points in the pattern.

Units are set via setMaximumRandomDeviationYUnit().

New in version 3.24.

Parameters:

deviation (float) –

setOffsetX(self, offset: float)

Sets the horizontal offset values for points in the pattern.

Parameters:

offset (float) – offset value

See also

offsetX()

See also

setOffsetY()

New in version 3.8.

setOffsetXMapUnitScale(self, scale: QgsMapUnitScale)

Sets the unit scale for the horizontal offset for rows in the pattern.

Parameters:

scale (QgsMapUnitScale) – offset unit scale

New in version 3.8.

setOffsetXUnit(self, unit: Qgis.RenderUnit)

Sets the units for the horizontal offset between rows in the pattern.

Parameters:

unit (Qgis.RenderUnit) – offset units

See also

offsetXUnit()

See also

setOffsetYUnit()

New in version 3.8.

setOffsetY(self, offset: float)

Sets the vertical offset values for points in the pattern.

Parameters:

offset (float) – offset value

See also

offsetY()

See also

setOffsetX()

New in version 3.8.

setOffsetYMapUnitScale(self, scale: QgsMapUnitScale)

Sets the unit scale for the vertical offset for rows in the pattern.

Parameters:

scale (QgsMapUnitScale) – offset unit scale

New in version 3.8.

setOffsetYUnit(self, unit: Qgis.RenderUnit)

Sets the units for the vertical offset for rows in the pattern.

Parameters:

unit (Qgis.RenderUnit) – offset units

See also

offsetYUnit()

See also

setOffsetXUnit()

New in version 3.8.

setOutputUnit(self, unit: Qgis.RenderUnit)
Parameters:

unit (Qgis.RenderUnit) –

setRandomDeviationXMapUnitScale(self, scale: QgsMapUnitScale)

Sets the unit scale for the horizontal random deviation of points in the pattern.

New in version 3.24.

Parameters:

scale (QgsMapUnitScale) –

setRandomDeviationXUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the horizontal random deviation of points in the pattern.

New in version 3.24.

Parameters:

unit (Qgis.RenderUnit) –

setRandomDeviationYMapUnitScale(self, scale: QgsMapUnitScale)

Sets the unit scale for the vertical random deviation of points in the pattern.

New in version 3.24.

Parameters:

scale (QgsMapUnitScale) –

setRandomDeviationYUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the vertical random deviation of points in the pattern.

New in version 3.24.

Parameters:

unit (Qgis.RenderUnit) –

setSeed(self, seed: int)

Sets the random number seed to use when randomly shifting 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()

New in version 3.24.

Parameters:

seed (int) –

setSubSymbol(self, symbol: QgsSymbol) bool
Parameters:

symbol (QgsSymbol) –

Return type:

bool

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:
startRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext) –

stopFeatureRender(self, feature: QgsFeature, context: QgsRenderContext)
Parameters:
stopRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext) –

subSymbol(self) QgsSymbol
Return type:

QgsSymbol

toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any])
Parameters:
  • doc (QDomDocument) –

  • element (QDomElement) –

  • props (Dict[str) –

toTiledPatternImage(self) QImage
Return type:

QImage

usedAttributes(self, context: QgsRenderContext) Set[str]
Parameters:

context (QgsRenderContext) –

Return type:

Set[str]

usesMapUnits(self) bool
Return type:

bool