Class: QgsProcessingParameterGeometry

A geometry parameter for processing algorithms.

Added in version 3.16.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingParameterGeometry

Base classes

QgsProcessingParameterDefinition

Base class for the definition of processing parameters.

class qgis.core.QgsProcessingParameterGeometry[source]

Bases: QgsProcessingParameterDefinition

__init__(name: str | None, description: str | None = '', defaultValue: Any = None, optional: bool = False, geometryTypes: Iterable[int] = [], allowMultipart: bool = True)

Constructor for QgsProcessingParameterGeometry.

The geometryTypes argument allows for specifying a list of geometry types (see Qgis.GeometryType) acceptable for this parameter. Passing a empty list will allow for any type of geometry. The allowMultiPart argument allows specifying a multi part geometry

Parameters:
  • name (Optional[str])

  • description (Optional[str] = '')

  • defaultValue (Any = None)

  • optional (bool = False)

  • geometryTypes (Iterable[int] = [])

  • allowMultipart (bool = True)

__init__(a0: QgsProcessingParameterGeometry)
Parameters:

a0 (QgsProcessingParameterGeometry)

allowMultipart(self) bool[source]

Returns the parameter allow multipart geometries.

Return type:

bool

static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterGeometry | None[source]

Creates a new parameter using the definition from a script code.

Parameters:
  • name (Optional[str])

  • description (Optional[str])

  • isOptional (bool)

  • definition (Optional[str])

Return type:

Optional[QgsProcessingParameterGeometry]

geometryTypes(self) List[int]

Returns the parameter allowed geometries, as a list of Qgis.GeometryType values.

Return type:

List[int]

setAllowMultipart(self, allowMultipart: bool)[source]

Sets the allow multipart geometries

See also

allowMultipart()

Parameters:

allowMultipart (bool)

setGeometryTypes(self, geometryTypes: Iterable[int])[source]

Sets the allowed geometryTypes, as a list of Qgis.GeometryType values.

See also

geometryTypes()

Parameters:

geometryTypes (Iterable[int])

static typeName() str[source]

Returns the type name for the parameter class.

Return type:

str