Class: QgsProcessingParameterArea

A double numeric parameter for area values.

Linked to a source layer or CRS parameter to determine what units the area values are in.

The number of decimals places shown in a area parameter’s widget can be specified by setting the parameter’s metadata. For example:

param = QgsProcessingParameterArea( 'VAL', 'Threshold')
# only show two decimal places in parameter's widgets, not 6:
param.setMetadata( {'widget_wrapper':
  { 'decimals': 2 }
})

Added in version 3.40.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingParameterArea

Base classes

QgsProcessingParameterNumber

A numeric parameter for processing algorithms.

QgsProcessingParameterDefinition

Base class for the definition of processing parameters.

class qgis.core.QgsProcessingParameterArea[source]

Bases: QgsProcessingParameterNumber

__init__(name: str | None, description: str | None = '', defaultValue: Any = None, parentParameterName: str | None = '', optional: bool = False, minValue: float = 0, maxValue: float = DBL_MAX)

Constructor for QgsProcessingParameterArea.

Parameters:
  • name (Optional[str])

  • description (Optional[str] = '')

  • defaultValue (Any = None)

  • parentParameterName (Optional[str] = '')

  • optional (bool = False)

  • minValue (float = 0)

  • maxValue (float = DBL_MAX)

__init__(a0: QgsProcessingParameterArea)
Parameters:

a0 (QgsProcessingParameterArea)

defaultUnit(self) Qgis.AreaUnit[source]

Returns the default area unit for the parameter.

See also

setDefaultUnit()

Return type:

Qgis.AreaUnit

parentParameterName(self) str[source]

Returns the name of the parent parameter, or an empty string if this is not set.

Return type:

str

setDefaultUnit(self, unit: Qgis.AreaUnit)[source]

Sets the default area unit for the parameter.

See also

defaultUnit()

Parameters:

unit (Qgis.AreaUnit)

setParentParameterName(self, parentParameterName: str | None)[source]

Sets the name of the parent layer parameter. Use an empty string if this is not required.

Parameters:

parentParameterName (Optional[str])