Subgroup: other

Class: QgsGenericNumericTransformer

class qgis.core.QgsGenericNumericTransformer

Bases: qgis._core.QgsPropertyTransformer

QgsPropertyTransformer subclass for scaling an input numeric value into an output numeric value.

New in version 3.0: Methods

clone
create Factory method for creating a new property transformer of the specified type.
curveTransform Returns the curve transform applied to input values before they are transformed by the individual transform subclasses.
exponent Returns the exponent for an exponential expression.
fromExpression Attempts to parse an expression into a corresponding QgsSizeScaleTransformer.
loadVariant
maxOutputValue Returns the maximum calculated size.
maxValue Returns the maximum value expected by the transformer.
minOutputValue Returns the minimum calculated size.
minValue Returns the minimum value expected by the transformer.
nullOutputValue Returns the size value when an expression evaluates to NULL.
setCurveTransform Sets a curve transform to apply to input values before they are transformed by the individual transform subclasses.
setExponent Sets the exponent for an exponential expression.
setMaxOutputValue Sets the maximum calculated size.
setMaxValue Sets the maximum value expected by the transformer.
setMinOutputValue Sets the minimum calculated size.
setMinValue Sets the minimum value expected by the transformer.
setNullOutputValue Sets the size value for when an expression evaluates to NULL.
toExpression
toVariant
transform
transformNumeric
transformerType
value Calculates the size corresponding to a specific input value.

Attributes

ColorRampTransformer
GenericNumericTransformer
SizeScaleTransformer
clone(self) → QgsGenericNumericTransformer
exponent(self) → float

Returns the exponent for an exponential expression.

See also

setExponent()

See also

type()

fromExpression(expression: str) → Tuple[QgsGenericNumericTransformer, str, str]

Attempts to parse an expression into a corresponding QgsSizeScaleTransformer.

Parameters:
  • expression – expression to parse
  • baseExpression – 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. :param 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 not

be parsed to a size scale transformer.

loadVariant(self, definition: Any) → bool
maxOutputValue(self) → float

Returns the maximum calculated size.

See also

minSize()

minOutputValue(self) → float

Returns the minimum calculated size.

See also

setMinSize()

See also

maxSize()

nullOutputValue(self) → float

Returns the size value when an expression evaluates to NULL.

See also

setNullSize()

setExponent(self, exponent: float)

Sets the exponent for an exponential expression.

Parameters:exponent – exponent

See also

exponent()

setMaxOutputValue(self, size: float)

Sets the maximum calculated size.

Parameters:size – maximum size

See also

maxSize()

See also

setMinSize()

setMinOutputValue(self, size: float)

Sets the minimum calculated size.

Parameters:size – minimum size

See also

minSize()

See also

setMaxSize()

setNullOutputValue(self, size: float)

Sets the size value for when an expression evaluates to NULL.

Parameters:size – null size

See also

nullSize()

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