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:
QgsMarkerSymbolLayer
Constructs SVG marker symbol layer with picture from given absolute path to a SVG file
QgsSvgMarkerSymbolLayer(
QgsSvgMarkerSymbolLayer
)- Parameters
path (str) –
size (float = DEFAULT_SVGMARKER_SIZE) –
angle (float = DEFAULT_SVGMARKER_ANGLE) –
scaleMethod –
-
bounds
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) → QRectF¶ - Parameters
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- Return type
QRectF
-
calculateAspectRatio
(self, context: QgsSymbolRenderContext, scaledSize: float) → Tuple[float, bool]¶ Calculates the marker aspect ratio between width and height.
- Parameters
context (QgsSymbolRenderContext) – symbol render context
scaledSize (float) – size of symbol to render
hasDataDefinedAspectRatio – will be set to true if marker has data defined aspectRatio
- Return type
Tuple[float, bool]
-
clone
(self) → QgsSvgMarkerSymbolLayer¶ - Return type
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶ - Parameters
properties (Dict[str) –
- Return type
-
createFromSld
(element: QDomElement) → QgsSymbolLayer¶ - Parameters
element (QDomElement) –
- Return type
-
defaultAspectRatio
(self) → float¶ Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
See also
- Return type
float
-
fillColor
(self) → QColor¶ - Return type
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
- Return type
float
-
layerType
(self) → str¶ - Return type
str
-
mapUnitScale
(self) → QgsMapUnitScale¶ - Return type
-
markerOffset
()¶
-
markerOffset2
()¶
-
markerOffsetWithWidthAndHeight
()¶
-
outputUnit
(self) → QgsUnitTypes.RenderUnit¶ - Return type
-
preservedAspectRatio
(self) → bool¶ Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
See also
- Return type
bool
-
properties
(self) → Dict[str, str]¶ - Return type
Dict[str, str]
-
renderPoint
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)¶ - Parameters
point (Union[QPointF) –
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.
- Parameters
properties (Dict[str) –
pathResolver (QgsPathResolver) –
saving (bool) –
-
restoreOldDataDefinedProperties
()¶
-
setFillColor
(self, color: Union[QColor, Qt.GlobalColor])¶ - Parameters
color (Union[QColor) –
-
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 (float) – Fixed Aspect Ratio
See also
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶ - Parameters
scale (QgsMapUnitScale) –
-
setOutputUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ - Parameters
unit (QgsUnitTypes.RenderUnit) –
-
setPreservedAspectRatio
(self, par: bool) → bool¶ Set preserved the marker aspect ratio between width and height.
- Parameters
par (bool) – Preserved Aspect Ratio
- Return type
bool
- 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])¶ - Parameters
c (Union[QColor) –
-
setStrokeWidth
(self, w: float)¶ - Parameters
w (float) –
-
setStrokeWidthMapUnitScale
(self, scale: QgsMapUnitScale)¶ - Parameters
scale (QgsMapUnitScale) –
-
setStrokeWidthUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the units for the stroke width.
- Parameters
unit (QgsUnitTypes.RenderUnit) – width units
See also
-
startRender
(self, context: QgsSymbolRenderContext)¶ - Parameters
context (QgsSymbolRenderContext) –
-
stopRender
(self, context: QgsSymbolRenderContext)¶ - Parameters
context (QgsSymbolRenderContext) –
-
strokeColor
(self) → QColor¶ - Return type
QColor
-
strokeWidth
(self) → float¶ - Return type
float
-
strokeWidthMapUnitScale
(self) → QgsMapUnitScale¶ - Return type
-
strokeWidthUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units for the stroke width.
See also
- Return type
-
updateDefaultAspectRatio
(self) → float¶ Calculates the default marker aspect ratio between width and height.
- Return type
float
- 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¶ - Parameters
e (QgsDxfExport) –
mmMapUnitScaleFactor (float) –
layerName (str) –
context (QgsSymbolRenderContext) –
shift (Union[QPointF) –
- Return type
bool
-
writeSldMarker
(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])¶ - Parameters
doc (QDomDocument) –
element (QDomElement) –
props (Dict[str) –