Class: QgsSVGFillSymbolLayer¶
-
class
qgis.core.
QgsSVGFillSymbolLayer
(svgFilePath: str, width: float = 20, rotation: float = 0)¶ Bases:
qgis._core.QgsImageFillSymbolLayer
Constructor for QgsSVGFillSymbolLayer, using the SVG picture at the specified absolute file path.
QgsSVGFillSymbolLayer(svgData: Union[QByteArray, bytes, bytearray], width: float = 20, rotation: float = 0) Constructor for QgsSVGFillSymbolLayer, using the specified SVG picture data.
A class for filling symbols with a repeated SVG file.
Enums
Methods
Creates a new QgsSVGFillSymbolLayer from a
properties
map.Creates a new QgsSVGFillSymbolLayer from a SLD
element
.Returns the width of the rendered SVG content within the fill (i.e.
Returns the map unit scale for the pattern’s width.
Returns the units for the width of the SVG images in the pattern.
Turns relative paths in properties map to absolute when reading and vice versa when writing.
Sets the
width
to render the SVG content as within the fill (i.e.Sets the map unit
scale
for the pattern’s width.Sets the
unit
for the width of the SVG images in the pattern.Sets the path to the SVG file to render in the fill.
Sets the fill color used for rendering the SVG content.
Sets the stroke color used for rendering the SVG content.
Sets the stroke width used for rendering the SVG content.
Sets the map unit
scale
for the pattern’s stroke.Sets the
unit
for the stroke width.Returns the path to the SVG file used to render the fill.
Returns the fill color used for rendering the SVG content.
Returns the stroke color used for rendering the SVG content.
Returns the stroke width used for rendering the SVG content.
Returns the map unit scale for the pattern’s stroke.
Returns the units for the stroke width.
Signals
Attributes
-
applyDataDefinedSettings
(self, context: QgsSymbolRenderContext)¶
-
clone
(self) → QgsSVGFillSymbolLayer¶
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶ Creates a new QgsSVGFillSymbolLayer from a
properties
map. The caller takes ownership of the returned object.
-
createFromSld
(element: QDomElement) → QgsSymbolLayer¶ Creates a new QgsSVGFillSymbolLayer from a SLD
element
. The caller takes ownership of the returned object.
-
layerType
(self) → str¶
-
mapUnitScale
(self) → QgsMapUnitScale¶
-
outputUnit
(self) → QgsUnitTypes.RenderUnit¶
-
patternWidth
(self) → float¶ Returns the width of the rendered SVG content within the fill (i.e. the pattern repeat/tile size).
Units are retrieved by patternWidthUnit()
See also
See also
See also
-
patternWidthMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale for the pattern’s width.
See also
See also
See also
-
patternWidthUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units for the width of the SVG images in the pattern.
See also
See also
See also
-
properties
(self) → Dict[str, str]¶
-
resolvePaths
(properties: Dict[str, str], 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.
-
restoreOldDataDefinedProperties
()¶
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶
-
setOutputUnit
(self, unit: QgsUnitTypes.RenderUnit)¶
-
setPatternWidth
(self, width: float)¶ Sets the
width
to render the SVG content as within the fill (i.e. the pattern repeat/tile size).Units are specified by setPatternWidthUnit()
See also
See also
See also
-
setPatternWidthMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit
scale
for the pattern’s width.See also
See also
See also
-
setPatternWidthUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the
unit
for the width of the SVG images in the pattern.See also
See also
See also
-
setSvgFilePath
(self, svgPath: str)¶ Sets the path to the SVG file to render in the fill.
This is usually an absolute file path. Other supported options include - relative paths to folders from the user’s SVG search paths - base64 encoded content, prefixed with a ‘base64:’ string - http(s) paths
See also
-
setSvgFillColor
(self, c: Union[QColor, Qt.GlobalColor])¶ Sets the fill color used for rendering the SVG content.
Fill color is only supported for parametrized SVG files. Color opacity is ignored if the SVG file does not support parametrized fill opacity.
See also
See also
-
setSvgStrokeColor
(self, c: Union[QColor, Qt.GlobalColor])¶ Sets the stroke color used for rendering the SVG content.
Stroke color is only supported for parametrized SVG files. Color opacity is ignored if the SVG file does not support parametrized outline opacity.
See also
See also
-
setSvgStrokeWidth
(self, w: float)¶ Sets the stroke width used for rendering the SVG content.
Stroke width is only supported for parametrized SVG files. Units are specified via setSvgStrokeWidthUnit()
See also
See also
See also
-
setSvgStrokeWidthMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit
scale
for the pattern’s stroke.See also
See also
See also
-
setSvgStrokeWidthUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the
unit
for the stroke width.See also
See also
See also
-
startRender
(self, context: QgsSymbolRenderContext)¶
-
stopRender
(self, context: QgsSymbolRenderContext)¶
-
svgFilePath
(self) → str¶ Returns the path to the SVG file used to render the fill.
See also
-
svgFillColor
(self) → QColor¶ Returns the fill color used for rendering the SVG content.
Fill color is only supported for parametrized SVG files.
See also
See also
-
svgStrokeColor
(self) → QColor¶ Returns the stroke color used for rendering the SVG content.
Stroke color is only supported for parametrized SVG files.
See also
See also
-
svgStrokeWidth
(self) → float¶ Returns the stroke width used for rendering the SVG content.
Stroke width is only supported for parametrized SVG files. Units are retrieved via setSvgStrokeWidthUnit()
See also
See also
See also
-
svgStrokeWidthMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale for the pattern’s stroke.
See also
See also
See also
-
svgStrokeWidthUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units for the stroke width.
See also
See also
See also
-
toSld
(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])¶
-