Class: QgsGenericNumericTransformer¶
-
class
qgis.core.
QgsGenericNumericTransformer
(minValue: float = 0, maxValue: float = 1, minOutput: float = 0, maxOutput: float = 1, nullOutput: float = 0, exponent: float = 1)¶ Bases:
qgis._core.QgsPropertyTransformer
Constructor for QgsGenericNumericTransformer.
- Parameters
minValue – minimum expected input value
maxValue – maximum expected input value
minOutput – minimum value to return
maxOutput – maximum value to return
nullOutput – value to return for null inputs
exponent – optional exponential for non-linear scaling
QgsGenericNumericTransformer(QgsGenericNumericTransformer)
QgsPropertyTransformer subclass for scaling an input numeric value into an output numeric value.
New in version 3.0: Enums
Methods
Returns the exponent for an exponential expression.
Attempts to parse an expression into a corresponding
QgsSizeScaleTransformer
.Returns the maximum calculated size.
Returns the minimum calculated size.
Returns the size value when an expression evaluates to NULL.
Sets the exponent for an exponential expression.
Sets the maximum calculated size.
Sets the minimum calculated size.
Sets the size value for when an expression evaluates to NULL.
Calculates the size corresponding to a specific
input
value.Signals
Attributes
-
clone
(self) → QgsGenericNumericTransformer¶
-
exponent
(self) → float¶ Returns the exponent for an exponential expression.
See also
-
fromExpression
(expression: str) → Tuple[QgsGenericNumericTransformer, str, str]¶ Attempts to parse an expression into a corresponding
QgsSizeScaleTransformer
.- Parameters
expression – expression to parse
fieldName – will be set to a field name which is used to calculate the input to the property transformer. This will be set to an empty string if an expression is the transformer input.
- Returns
corresponding
QgsSizeScaleTransformer
, or None if expression could notbaseExpression: will be set to the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
be parsed to a size scale transformer.
-
loadVariant
(self, definition: Any) → bool¶
-
maxOutputValue
(self) → float¶ Returns the maximum calculated size.
See also
-
minOutputValue
(self) → float¶ Returns the minimum calculated size.
See also
See also
-
nullOutputValue
(self) → float¶ Returns the size value when an expression evaluates to NULL.
See also
-
setExponent
(self, exponent: float)¶ Sets the exponent for an exponential expression.
- Parameters
exponent – exponent
See also
-
setMaxOutputValue
(self, size: float)¶ Sets the maximum calculated size.
- Parameters
size – maximum size
See also
See also
-
setMinOutputValue
(self, size: float)¶ Sets the minimum calculated size.
- Parameters
size – minimum size
See also
See also
-
setNullOutputValue
(self, size: float)¶ Sets the size value for when an expression evaluates to NULL.
- Parameters
size – null size
See also
-
toExpression
(self, baseExpression: str) → str¶
-
toVariant
(self) → Any¶
-
transform
(self, context: QgsExpressionContext, value: Any) → Any¶
-
transformNumeric
()¶
-
transformerType
(self) → QgsPropertyTransformer.Type¶
-
value
(self, input: float) → float¶ Calculates the size corresponding to a specific
input
value.- Returns
calculated size using size scale transformer’s parameters and type