Class: QgsRasterFillSymbolLayer¶
- class qgis.core.QgsRasterFillSymbolLayer¶
Bases:
QgsImageFillSymbolLayer
A class for filling symbols with a repeated raster image.
New in version 2.7.
QgsRasterFillSymbolLayer(imageFilePath: str = ‘’) Constructor for
QgsRasterFillSymbolLayer
, using a raster fill from the specifiedimageFilePath
.Enums
alias of
SymbolCoordinateReference
Methods
- param context:
- param context:
- rtype:
QgsRasterFillSymbolLayer
- rtype:
QColor
Coordinate mode for fill.
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Creates a new
QgsRasterFillSymbolLayer
from aproperties
map.Creates a new
QgsRasterFillSymbolLayer
from a SLDelement
.- param context:
Returns the height used for scaling the image used in the fill.
The path to the raster image used for the fill.
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layers- rtype:
str
Returns the offset for the fill.
Returns the map unit scale for the fill's offset.
Returns the units for the fill's offset.
Returns the opacity for the raster image used 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:
Turns relative paths in properties map to absolute when reading and vice versa when writing.
Restores older data defined properties from string map.
Set the coordinate mode for fill.
Sets the
height
for scaling the image.Sets the path to the raster image used for the fill.
Sets the offset for the fill.
Sets the map unit scale for the fill's offset.
Sets the units for the fill's offset.
Sets the
opacity
for the raster image used in the fill.- param unit:
Sets the map unit
scale
for the image's width and height.Sets the
unit
for the image's width and height.- param symbol:
Sets the
width
for scaling the image used in the fill.Sets the map unit
scale
for the image's width.Sets the
unit
for the image's width.Returns
True
if the symbol layer should be rendered using the selection color from the render context.Returns the map unit scale for the image's width and height.
Returns the units for the image's width and height.
- param context:
- param context:
- rtype:
QgsSymbol
- rtype:
bool
Returns the width used for scaling the image used in the fill.
Returns the map unit scale for the image's width.
Returns the units for the image's width.
- FillCoordinateMode¶
alias of
SymbolCoordinateReference
- applyBrushTransformFromContext(self, context: QgsSymbolRenderContext = None) bool ¶
- Parameters:
context (
QgsSymbolRenderContext
= None) –- Return type:
bool
- applyDataDefinedSettings(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- clone(self) QgsRasterFillSymbolLayer ¶
- Return type:
- color(self) QColor ¶
- Return type:
QColor
- coordinateMode(self) Qgis.SymbolCoordinateReference ¶
Coordinate mode for fill. Controls how the top left corner of the image fill is positioned relative to the feature.
- Return type:
- Returns:
coordinate mode
See also
- 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
QgsRasterFillSymbolLayer
from aproperties
map. The caller takes ownership of the returned object.- Parameters:
properties (Dict[str) –
- Return type:
- createFromSld(element: QDomElement) QgsSymbolLayer ¶
Creates a new
QgsRasterFillSymbolLayer
from a SLDelement
. The caller takes ownership of the returned object.New in version 3.30.
- Parameters:
element (QDomElement) –
- Return type:
- estimateMaxBleed(self, context: QgsRenderContext) float ¶
- Parameters:
context (QgsRenderContext) –
- Return type:
float
- height(self) float ¶
Returns the height used for scaling the image used in the fill.
If the height is 0 then the height will be calculated automatically based on the image’s
width()
.See also
See also
New in version 3.36.
- Return type:
float
- imageFilePath(self) str ¶
The path to the raster image used for the fill.
- Return type:
str
- Returns:
path to image file
See also
- 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
- offset(self) QPointF ¶
Returns the offset for the fill.
- Return type:
QPointF
- Returns:
offset for fill
See also
See also
See also
- offsetMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the fill’s offset.
- Return type:
- Returns:
map unit scale for offset
See also
See also
See also
- offsetUnit(self) Qgis.RenderUnit ¶
Returns the units for the fill’s offset.
- Return type:
- Returns:
units for offset
See also
See also
See also
- opacity(self) float ¶
Returns the opacity for the raster image used in the fill.
- Return type:
float
- Returns:
opacity value between 0 (fully transparent) and 1 (fully opaque)
See also
- 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) –
- resolvePaths(properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)¶
Turns relative paths in properties map to absolute when reading and vice versa when writing. Used internally when reading/writing symbols.
New in version 3.0.
- Parameters:
properties (Dict[str) –
pathResolver (QgsPathResolver) –
saving (bool) –
- restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])¶
Restores older data defined properties from string map.
New in version 3.0.
- setCoordinateMode(self, mode: Qgis.SymbolCoordinateReference)¶
Set the coordinate mode for fill. Controls how the top left corner of the image fill is positioned relative to the feature.
- Parameters:
mode (Qgis.SymbolCoordinateReference) – coordinate mode
See also
- setHeight(self, height: float)¶
Sets the
height
for scaling the image.If
height
is 0 then the height will be calculated automatically based on the image’swidth()
.See also
See also
See also
New in version 3.36.
- Parameters:
height (float) –
- setImageFilePath(self, imagePath: str)¶
Sets the path to the raster image used for the fill.
- Parameters:
imagePath (str) – path to image file
See also
- setOffset(self, offset: QPointF | QPoint)¶
Sets the offset for the fill.
- Parameters:
offset (Union[QPointF) – offset for fill
See also
See also
See also
- setOffsetMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map unit scale for the fill’s offset.
- Parameters:
scale (QgsMapUnitScale) – map unit scale for offset
See also
See also
See also
- setOffsetUnit(self, unit: Qgis.RenderUnit)¶
Sets the units for the fill’s offset.
- Parameters:
unit (Qgis.RenderUnit) – units for offset
See also
See also
See also
- setOpacity(self, opacity: float)¶
Sets the
opacity
for the raster image used in the fill.- Parameters:
opacity (float) – opacity value between 0 (fully transparent) and 1 (fully opaque)
See also
- setOutputUnit(self, unit: Qgis.RenderUnit)¶
- Parameters:
unit (Qgis.RenderUnit) –
- setSizeMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map unit
scale
for the image’s width and height.See also
See also
See also
See also
New in version 3.36.
- Parameters:
scale (QgsMapUnitScale) –
- setSizeUnit(self, unit: Qgis.RenderUnit)¶
Sets the
unit
for the image’s width and height.See also
See also
See also
New in version 3.36.
- Parameters:
unit (Qgis.RenderUnit) –
- setWidth(self, width: float)¶
Sets the
width
for scaling the image used in the fill.If
width
is 0 then the width will be calculated automatically based on the image’sheight()
.See also
See also
See also
See also
See also
- Parameters:
width (float) –
- setWidthMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map unit
scale
for the image’s width.See also
See also
See also
Deprecated since version use:
setSizeMapUnitScale()
instead.- Parameters:
scale (QgsMapUnitScale) –
- setWidthUnit(self, unit: Qgis.RenderUnit)¶
Sets the
unit
for the image’s width.See also
See also
See also
Deprecated since version use:
setSizeUnit()
instead.- Parameters:
unit (Qgis.RenderUnit) –
- 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.
- sizeMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the image’s width and height.
See also
See also
See also
See also
New in version 3.36.
- Return type:
- sizeUnit(self) Qgis.RenderUnit ¶
Returns the units for the image’s width and height.
See also
See also
See also
See also
New in version 3.36.
- Return type:
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- usesMapUnits(self) bool ¶
- Return type:
bool
- width(self) float ¶
Returns the width used for scaling the image used in the fill.
If the width is 0 then the width will be calculated automatically based on the image’s
height()
.See also
See also
See also
See also
- Return type:
float
- widthMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the image’s width.
See also
See also
See also
Deprecated since version use:
sizeMapUnitScale()
instead.- Return type:
- widthUnit(self) Qgis.RenderUnit ¶
Returns the units for the image’s width.
See also
See also
See also
Deprecated since version use:
sizeUnit()
instead.- Return type: