Class: QgsProcessingParameterGeometry¶
A geometry parameter for processing algorithms.
Added in version 3.16.
Class Hierarchy¶
Base classes¶
Base class for the definition of processing parameters.  | 
Methods
Returns the parameter allow multipart geometries.  | 
|
Returns the parameter allowed geometries, as a list of   | 
|
Sets the allow multipart geometries  | 
|
Sets the allowed geometryTypes, as a list of   | 
Static Methods
Creates a new parameter using the definition from a script code.  | 
|
Returns the type name for the parameter class.  | 
- 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
geometryTypesargument allows for specifying a list of geometry types (seeQgis.GeometryType) acceptable for this parameter. Passing a empty list will allow for any type of geometry. TheallowMultiPartargument 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:
 
- allowMultipart(self) bool[source]¶
 Returns the parameter allow multipart geometries.
See also
- 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.See also
- Return type:
 List[int]
- setAllowMultipart(self, allowMultipart: bool)[source]¶
 Sets the allow multipart geometries
See also
- Parameters:
 allowMultipart (bool)