Class: QgsPointPatternFillSymbolLayer

class qgis.core.QgsPointPatternFillSymbolLayer

Bases: QgsImageFillSymbolLayer

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

Methods

angle

Returns the rotation angle of the pattern, in degrees clockwise.

applyBrushTransformFromContext

Returns True if the image brush should be transformed using the render context's texture origin.

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

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

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

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

setAngle

Sets the rotation angle of the pattern, in degrees clockwise.

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

startFeatureRender

param feature

startRender

param context

stopFeatureRender

param feature

stopRender

param context

subSymbol

rtype

QgsSymbol

toSld

param doc

usedAttributes

param context

usesMapUnits

rtype

bool

angle(self) float

Returns the rotation angle of the pattern, in degrees clockwise.

See also

setAngle()

New in version 3.24.

Return type

float

applyBrushTransformFromContext(self, context: QgsSymbolRenderContext = None) bool

Returns True if the image brush should be transformed using the render context’s texture origin.

New in version 3.16.

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

New in version 2.9.

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

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

Return type

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

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

Return type

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

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

See also

distanceYUnit()

Return type

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

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

See also

distanceXUnit()

Return type

QgsUnitTypes.RenderUnit

estimateMaxBleed(self, context: QgsRenderContext) float
Parameters

context (QgsRenderContext) –

Return type

float

hasDataDefinedProperties(self) bool
Return type

bool

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

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

QgsUnitTypes.RenderUnit

outputUnit(self) QgsUnitTypes.RenderUnit
Return type

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

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

New in version 3.24.

Return type

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

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

New in version 3.24.

Return type

QgsUnitTypes.RenderUnit

renderPolygon(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)
Parameters
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 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

setAngle(self, angle: float)

Sets the rotation angle of the pattern, in degrees clockwise.

See also

angle()

New in version 3.24.

Parameters

angle (float) –

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: Union[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: QgsUnitTypes.RenderUnit)

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

Parameters

unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)

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

Parameters

unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)

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

Parameters

unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)

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

Parameters

unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)

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

Parameters

unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)

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

Parameters

unit (QgsUnitTypes.RenderUnit) – offset units

See also

offsetYUnit()

See also

setOffsetXUnit()

New in version 3.8.

setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)
Parameters

unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)

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

New in version 3.24.

Parameters

unit (QgsUnitTypes.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: QgsUnitTypes.RenderUnit)

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

New in version 3.24.

Parameters

unit (QgsUnitTypes.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

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

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

context (QgsRenderContext) –

Return type

Set[str]

usesMapUnits(self) bool
Return type

bool