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)
Enums
Methods
Calculates the marker aspect ratio between width and height.
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
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
Returns the marker SVG path.
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
Turns relative paths in properties map to absolute when reading and vice versa when writing.
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
Set the marker SVG path.
Set preserved the marker aspect ratio between width and height.
Sets the units for the stroke width.
Returns the units for the stroke width.
Calculates the default marker aspect ratio between width and height.
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
-
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])¶
-