Class: QgsRasterMarkerSymbolLayer¶
Raster marker symbol layer class.
Added in version 3.6.
Class Hierarchy¶
Base classes¶
Abstract base class for marker symbol layers.  | 
|
Constructor for QgsSymbolLayer.  | 
Subclasses¶
Animated marker symbol layer class.  | 
Methods
Calculates the marker aspect ratio between width and height.  | 
|
Copies common properties to another layer.  | 
|
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 opacity.  | 
|
Returns the marker raster image path.  | 
|
Returns the preserved aspect ratio value,   | 
|
Sets common class properties from a properties map.  | 
|
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 opacity.  | 
|
Set the marker raster image path.  | 
|
Set preserved the marker aspect ratio between width and height.  | 
|
Calculates the default marker aspect ratio between width and height.  | 
Static Methods
Creates a raster marker symbol layer from a string map of properties.  | 
|
Turns relative paths in properties map to absolute when reading and vice versa when writing.  | 
- class qgis.core.QgsRasterMarkerSymbolLayer[source]¶
 Bases:
QgsMarkerSymbolLayer- __init__(path: str | None = '', size: float = DEFAULT_SVGMARKER_SIZE, angle: float = DEFAULT_SVGMARKER_ANGLE, scaleMethod: Qgis.ScaleMethod = DEFAULT_SCALE_METHOD)
 Constructs raster marker symbol layer with picture from given absolute path to a raster image file
- Parameters:
 path (Optional[str] = '')
size (float = DEFAULT_SVGMARKER_SIZE)
angle (float = DEFAULT_SVGMARKER_ANGLE)
scaleMethod (Qgis.ScaleMethod = DEFAULT_SCALE_METHOD)
- calculateAspectRatio(self, context: QgsSymbolRenderContext, scaledSize: float)[source]¶
 Calculates the marker aspect ratio between width and height.
- Parameters:
 context (QgsSymbolRenderContext) – symbol render context
scaledSize (float) -> (float) – size of symbol to render
hasDataDefinedAspectRatio – will be set to
Trueif marker has data defined aspectRatio
- copyCommonProperties(self, other: QgsRasterMarkerSymbolLayer | None)[source]¶
 Copies common properties to another layer.
Added in version 3.26.
- Parameters:
 other (Optional[QgsRasterMarkerSymbolLayer])
- static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None[source]¶
 Creates a raster marker symbol layer from a string map of properties.
- Parameters:
 properties (Dict[str, Any] = {}) – QVariantMap properties object
- Return type:
 Optional[QgsSymbolLayer]
- defaultAspectRatio(self) float[source]¶
 Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
See also
- Return type:
 float
- fixedAspectRatio(self) float[source]¶
 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
See also
- Return type:
 float
- opacity(self) float[source]¶
 Returns the marker opacity.
- Return type:
 float
- Returns:
 opacity value between 0 (fully transparent) and 1 (fully opaque)
See also
- preservedAspectRatio(self) bool[source]¶
 Returns the preserved aspect ratio value,
Trueif fixed aspect ratio has been lower or equal to 0.See also
- Return type:
 bool
- static resolvePaths(properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)[source]¶
 Turns relative paths in properties map to absolute when reading and vice versa when writing. Used internally when reading/writing symbols.
- Parameters:
 properties (Dict[str, Any])
pathResolver (QgsPathResolver)
saving (bool)
- setCommonProperties(self, properties: Dict[str, Any])[source]¶
 Sets common class properties from a
propertiesmap.Added in version 3.26.
- Parameters:
 properties (Dict[str, Any])
- setFixedAspectRatio(self, ratio: float)[source]¶
 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
See also
- setOpacity(self, opacity: float)[source]¶
 Set the marker opacity.
- Parameters:
 opacity (float) – opacity value between 0 (fully transparent) and 1 (fully opaque)
See also
- setPath(self, path: str | None)[source]¶
 Set the marker raster image path.
- Parameters:
 path (Optional[str]) – raster image path
See also
- setPreservedAspectRatio(self, par: bool) bool[source]¶
 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,
Trueif fixed aspect ratio has been lower or equal to 0
See also