Class: QgsProcessingParameterAlignRasterLayers

class qgis.core.QgsProcessingParameterAlignRasterLayers

Bases: QgsProcessingParameterDefinition

A parameter for Processing algorithms that need a list of input raster layers to align - this parameter provides Processing framework’s adapter for QList<QgsAlignRaster.Item>.

A valid value for this parameter is a list (QVariantList), where each item is a map (QVariantMap) in this form: { ‘inputFile’: string, ‘outputFile’: string, ‘resampleMethod’: int, ‘rescale’: bool, }

Also it can accept lists (either string lists or QgsMapLayer list) as well as individual layer object or string representing layer source.

Static functions parametersAsItems(), variantMapAsItem(), itemAsVariantMap() provide conversion between QgsAlignRaster.Item representation and QVariant representation.

New in version 3.34.

QgsProcessingParameterAlignRasterLayers(name: str, description: str = ‘’) Constructor for QgsProcessingParameterAlignRasterLayers.

QgsProcessingParameterAlignRasterLayers(QgsProcessingParameterAlignRasterLayers)

Methods

asPythonString

param outputType:

checkValueIsAcceptable

param input:

clone

rtype:

QgsProcessingParameterDefinition

defaultGuiValueFromSetting

Default gui value for an algorithm parameter from settings

itemAsVariantMap

Converts a single input layer to QVariant representation (a QVariantMap)

parameterAsItems

Converts a QVariant value (a QVariantList) to a list of input layers

type

rtype:

str

typeName

Returns the type name for the parameter class.

valueAsJsonObject

param value:

valueAsPythonString

param value:

valueAsString

param value:

variantMapAsItem

Converts a QVariant value (a QVariantMap) to a single input layer

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) str
Parameters:

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) –

Return type:

str

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) bool
Parameters:
Return type:

bool

clone(self) QgsProcessingParameterDefinition
Return type:

QgsProcessingParameterDefinition

defaultGuiValueFromSetting(self) Any

Default gui value for an algorithm parameter from settings

Returns:

default value from settings or invalid QVariant if there is no default value defined in the settings

New in version 3.34.

itemAsVariantMap(item: QgsAlignRasterData.RasterItem) Dict[str, Any]

Converts a single input layer to QVariant representation (a QVariantMap)

Parameters:

item (QgsAlignRasterData.RasterItem) –

Return type:

Dict[str, Any]

parameterAsItems(layersVariant: Any, context: QgsProcessingContext) List[QgsAlignRasterData.RasterItem]

Converts a QVariant value (a QVariantList) to a list of input layers

Parameters:
Return type:

List[QgsAlignRasterData.RasterItem]

type(self) str
Return type:

str

typeName() str

Returns the type name for the parameter class.

Return type:

str

valueAsJsonObject(self, value: Any, context: QgsProcessingContext) Any
Parameters:
Return type:

Any

valueAsPythonString(self, value: Any, context: QgsProcessingContext) str
Parameters:
Return type:

str

valueAsString(self, value: Any, context: QgsProcessingContext) Tuple[str, bool]
Parameters:
Return type:

Tuple[str, bool]

variantMapAsItem(layerVariantMap: Dict[str, Any], context: QgsProcessingContext) QgsAlignRasterData.RasterItem

Converts a QVariant value (a QVariantMap) to a single input layer

Parameters:
Return type:

QgsAlignRasterData.RasterItem