Subgroup: Svg
Class: QgsSvgMarkerSymbolLayer¶
-
class
qgis.core.
QgsSvgMarkerSymbolLayer
(path: str, size: float = DEFAULT_SVGMARKER_SIZE, angle: float = DEFAULT_SVGMARKER_ANGLE, scaleMethod: QgsSymbol.ScaleMethod = DEFAULT_SCALE_METHOD)¶ Bases:
qgis._core.QgsMarkerSymbolLayer
Constructs SVG marker symbol layer with picture from given absolute path to a SVG file
QgsSvgMarkerSymbolLayer(QgsSvgMarkerSymbolLayer)
Methods
bounds
calculateAspectRatio
Calculates the marker aspect ratio between width and height. clone
copyDataDefinedProperties
copyPaintEffect
create
createFromSld
defaultAspectRatio
Returns the default marker aspect ratio between width and height, 0 if not yet calculated. fillColor
fixedAspectRatio
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering layerType
mapUnitScale
markerOffset
markerOffset2
markerOffsetWithWidthAndHeight
outputUnit
path
Returns the marker SVG path. preservedAspectRatio
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0. properties
renderPoint
resolvePaths
Turns relative paths in properties map to absolute when reading and vice versa when writing. restoreOldDataDefinedProperties
setFillColor
setFixedAspectRatio
Set the marker aspect ratio between width and height to be used in rendering, if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering setMapUnitScale
setOutputUnit
setPath
Set the marker SVG path. setPreservedAspectRatio
Set preserved the marker aspect ratio between width and height. setStrokeColor
setStrokeWidth
setStrokeWidthMapUnitScale
setStrokeWidthUnit
Sets the units for the stroke width. startRender
stopRender
strokeColor
strokeWidth
strokeWidthMapUnitScale
strokeWidthUnit
Returns the units for the stroke width. updateDefaultAspectRatio
Calculates the default marker aspect ratio between width and height. writeDxf
writeSldMarker
Signals
Attributes
-
bounds
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) → QRectF¶
-
calculateAspectRatio
(self, context: QgsSymbolRenderContext, scaledSize: float) → Tuple[float, bool]¶ Calculates the marker aspect ratio between width and height.
Parameters: - context – symbol render context
- scaledSize – size of symbol to render
- hasDataDefinedAspectRatio – will be set to true if marker has data defined aspectRatio
Note
not available in Python bindings
-
clone
(self) → QgsSvgMarkerSymbolLayer¶
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶
-
createFromSld
(element: QDomElement) → QgsSymbolLayer¶
-
defaultAspectRatio
(self) → float¶ Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
See also
-
fillColor
(self) → QColor¶
-
fixedAspectRatio
(self) → float¶ Returns the marker aspect ratio between width and height to be used in rendering, if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
See also
-
layerType
(self) → str¶
-
mapUnitScale
(self) → QgsMapUnitScale¶
-
markerOffset
()¶
-
markerOffset2
()¶
-
markerOffsetWithWidthAndHeight
()¶
-
outputUnit
(self) → QgsUnitTypes.RenderUnit¶
-
preservedAspectRatio
(self) → bool¶ Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
See also
-
properties
(self) → Dict[str, str]¶
-
renderPoint
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)¶
-
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
()¶
-
setFillColor
(self, color: Union[QColor, Qt.GlobalColor])¶
-
setFixedAspectRatio
(self, ratio: float)¶ Set the marker aspect ratio between width and height to be used in rendering, if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
Parameters: ratio – Fixed Aspect Ratio See also
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶
-
setOutputUnit
(self, unit: QgsUnitTypes.RenderUnit)¶
-
setPreservedAspectRatio
(self, par: bool) → bool¶ Set preserved the marker aspect ratio between width and height.
Parameters: par – Preserved Aspect Ratio Returns: the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0 See also
-
setStrokeColor
(self, c: Union[QColor, Qt.GlobalColor])¶
-
setStrokeWidth
(self, w: float)¶
-
setStrokeWidthMapUnitScale
(self, scale: QgsMapUnitScale)¶
-
setStrokeWidthUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the units for the stroke width.
Parameters: unit – width units See also
-
startRender
(self, context: QgsSymbolRenderContext)¶
-
stopRender
(self, context: QgsSymbolRenderContext)¶
-
strokeColor
(self) → QColor¶
-
strokeWidth
(self) → float¶
-
strokeWidthMapUnitScale
(self) → QgsMapUnitScale¶
-
strokeWidthUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units for the stroke width.
See also
-
updateDefaultAspectRatio
(self) → float¶ Calculates the default marker aspect ratio between width and height.
Returns: the default aspect ratio value See also
-
writeDxf
(self, e: QgsDxfExport, mmMapUnitScaleFactor: float, layerName: str, context: QgsSymbolRenderContext, shift: Union[QPointF, QPoint] = QPointF(0, 0)) → bool¶
-
writeSldMarker
(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])¶
-