Class: QgsRasterMarkerSymbolLayer¶
-
class
qgis.core.
QgsRasterMarkerSymbolLayer
(path: str = '', size: float = DEFAULT_SVGMARKER_SIZE, angle: float = DEFAULT_SVGMARKER_ANGLE, scaleMethod: QgsSymbol.ScaleMethod = DEFAULT_SCALE_METHOD)¶ Bases:
qgis._core.QgsMarkerSymbolLayer
Constructs raster marker symbol layer with picture from given absolute path to a raster image file
Raster marker symbol layer class.
New in version 3.6: Enums
Methods
Calculates the marker aspect ratio between width and height.
Creates a raster marker symbol layer from a string map of properties.
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,
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 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.
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) → QgsRasterMarkerSymbolLayer¶
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶ Creates a raster marker symbol layer from a string map of properties.
- Parameters
properties – QgsStringMap properties object
-
defaultAspectRatio
(self) → float¶ Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
See also
-
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
()¶
-
opacity
(self) → float¶ Returns the marker opacity.
- Returns
opacity value between 0 (fully transparent) and 1 (fully opaque)
See also
-
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
()¶
-
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)¶
-
setOpacity
(self, opacity: float)¶ Set the marker opacity.
- Parameters
opacity – opacity value between 0 (fully transparent) and 1 (fully opaque)
See also
-
setPath
(self, path: str)¶ Set the marker raster image path.
- Parameters
path – raster image path
See also
-
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
-
updateDefaultAspectRatio
(self) → float¶ Calculates the default marker aspect ratio between width and height.
- Returns
the default aspect ratio value
See also
-